commit 854471326fd9423ccd2399ccb92bfcff647374f0 Author: Anselm R Garbe <garbeam@gmail.com> Date: Wed, 9 Sep 2009 13:25:00 +0100 up Diffstat:
AUTHORS | | | 11 | +++++++++++ |
BUGS | | | 7 | +++++++ |
CONTRIB | | | 53 | +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
COPYING | | | 21 | +++++++++++++++++++++ |
ChangeLog | | | 418 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
FAQ | | | 96 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
INSTALL | | | 104 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
LICENSE.txt | | | 21 | +++++++++++++++++++++ |
Makefile.am | | | 19 | +++++++++++++++++++ |
Makefile.in | | | 591 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
NEWS | | | 2 | ++ |
README | | | 5 | +++++ |
TODO | | | 26 | ++++++++++++++++++++++++++ |
aclocal.m4 | | | 933 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
action.cpp | | | 145 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
action.h | | | 95 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
actions.cpp | | | 1037 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
actions.h | | | 170 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
atoms.cpp | | | 80 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
atoms.h | | | 50 | ++++++++++++++++++++++++++++++++++++++++++++++++++ |
bar.cpp | | | 44 | ++++++++++++++++++++++++++++++++++++++++++++ |
bar.h | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
binder.cpp | | | 742 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
binder.h | | | 233 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
box.cpp | | | 50 | ++++++++++++++++++++++++++++++++++++++++++++++++++ |
box.h | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
client.cpp | | | 884 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
client.h | | | 155 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
clientbar.cpp | | | 348 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
clientbar.h | | | 53 | +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
config.h.in | | | 112 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
configure | | | 8075 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
configure.ac | | | 130 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
container.h | | | 272 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
cursors.cpp | | | 61 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
cursors.h | | | 40 | ++++++++++++++++++++++++++++++++++++++++ |
draw.cpp | | | 535 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
draw.h | | | 88 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
examples/session-managers/kdm-entry | | | 14 | ++++++++++++++ |
examples/statustext-deleuze.sh | | | 27 | +++++++++++++++++++++++++++ |
examples/statustext-gavin.sh | | | 29 | +++++++++++++++++++++++++++++ |
examples/statustext.sh | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
examples/themes/accent-theme.conf | | | 48 | ++++++++++++++++++++++++++++++++++++++++++++++++ |
examples/themes/flat-cyan-theme.conf | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
examples/themes/flat-grey-theme.conf | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
examples/themes/gold-theme.conf | | | 48 | ++++++++++++++++++++++++++++++++++++++++++++++++ |
examples/themes/laotse-theme.conf | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
examples/themes/lunatic-theme.conf | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
examples/themes/peacock-theme.conf | | | 48 | ++++++++++++++++++++++++++++++++++++++++++++++++ |
expander.cpp | | | 118 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
expander.h | | | 37 | +++++++++++++++++++++++++++++++++++++ |
float.cpp | | | 75 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
float.h | | | 30 | ++++++++++++++++++++++++++++++ |
font.cpp | | | 34 | ++++++++++++++++++++++++++++++++++ |
font.h | | | 52 | ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
frame.cpp | | | 458 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
frame.h | | | 71 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
inputbar.cpp | | | 463 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
inputbar.h | | | 82 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
install-sh | | | 325 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
kernel.cpp | | | 1294 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
kernel.h | | | 253 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
label.cpp | | | 110 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
label.h | | | 77 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
launcher.cpp | | | 114 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
launcher.h | | | 42 | ++++++++++++++++++++++++++++++++++++++++++ |
loader.cpp | | | 195 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
loader.h | | | 57 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
logger.cpp | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
logger.h | | | 36 | ++++++++++++++++++++++++++++++++++++ |
main.cpp | | | 343 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
man/Makefile.am | | | 2 | ++ |
man/Makefile.in | | | 387 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
man/actions.conf.5 | | | 366 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
man/common.conf.5 | | | 87 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
man/session.conf.5 | | | 37 | +++++++++++++++++++++++++++++++++++++ |
man/theme.conf.5 | | | 237 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
man/wmi.1 | | | 109 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
man/wmiremote.1 | | | 41 | +++++++++++++++++++++++++++++++++++++++++ |
menu.cpp | | | 408 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
menu.h | | | 113 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
missing | | | 360 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
monitor.cpp | | | 1040 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
monitor.h | | | 270 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
prompt.cpp | | | 22 | ++++++++++++++++++++++ |
prompt.h | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
rectangle.cpp | | | 52 | ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
rectangle.h | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
shortcut.cpp | | | 103 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
shortcut.h | | | 50 | ++++++++++++++++++++++++++++++++++++++++++++++++++ |
singleton.h | | | 33 | +++++++++++++++++++++++++++++++++ |
slot.cpp | | | 477 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
slot.h | | | 109 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
split.cpp | | | 382 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
split.h | | | 46 | ++++++++++++++++++++++++++++++++++++++++++++++ |
src/Makefile.am | | | 84 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
src/Makefile.in | | | 495 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
statusbar.cpp | | | 353 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
statusbar.h | | | 55 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
theme.cpp | | | 141 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
theme.h | | | 105 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
thing.cpp | | | 361 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
thing.h | | | 125 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
tree.cpp | | | 73 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
tree.h | | | 52 | ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
util.cpp | | | 496 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
util.h | | | 144 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
validators.cpp | | | 377 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
validators.h | | | 127 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
version.h.in | | | 1 | + |
widget.cpp | | | 98 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
widget.h | | | 50 | ++++++++++++++++++++++++++++++++++++++++++++++++++ |
wmi.h | | | 44 | ++++++++++++++++++++++++++++++++++++++++++++ |
wmi.spec | | | 122 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
wmi.spec.in | | | 122 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
wmiremote.cpp | | | 162 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
workspace.cpp | | | 987 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
workspace.h | | | 197 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
xcore.cpp | | | 686 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
xcore.h | | | 329 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
xfont.cpp | | | 62 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
xfont.h | | | 52 | ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
xft.m4 | | | 83 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
xftfont.cpp | | | 64 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
xftfont.h | | | 54 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
125 files changed, 31460 insertions(+), 0 deletions(-)
diff --git a/AUTHORS b/AUTHORS @@ -0,0 +1,11 @@ +$Id: AUTHORS 735 2004-09-27 18:36:45Z garbeam $ + +Current developers of the WMI: + + - Anselm R. Garbe <anselmg at t-online.de> + - Marcel Manthe <-0m0- at web.de> + - Oliver Rendgen <oli at hypeo.de> (Documentation) + - John Pham <jhnphm at gmail.com> (Debian packager) + - PEYROUX Jean <alnix at phear.org> (BSD ports maintainer) + - Matthew Allen <matthew at lith.com> (Art asset developer) + - Dr. Johann Pfefferl <johann.pfefferl at agfa.com> diff --git a/BUGS b/BUGS @@ -0,0 +1,7 @@ +$Id: BUGS 735 2004-09-27 18:36:45Z garbeam $ + +Grep the wmi-devel mailinglist on http://wmi.berlios.de for known bugs. +If your bug is not known or seems not to be, just post a mail to +Anselm R. Garbe <anselmg at t-online.de> or to the wmi-devel list. + +We don't use the BerliOS bugtracker yet. diff --git a/CONTRIB b/CONTRIB @@ -0,0 +1,53 @@ +$Id: CONTRIB 735 2004-09-27 18:36:45Z garbeam $ + +Current contributors: + + - Ryan Sorensen <rcsorensen at gmail.com> + (contributed transient mode patch) + - grayrest (varuious valueable feedback) + - zahod (contributed new default theme - industrial theme) + - Martin Moncrieffe (valueable feedback concerning mathematica) + - Hans Ulrich Niedermann (contributed rpm spec file for wmi trunk) + - Michael Ihde (contributed doxygen comments, some patches) + - Wilson Oliveira (contributed the WMIConf tool) + - carmee (contributed various feedback) + - Mathieu L (contributed various feedback) + - Brian Dorsey (contributed various feedback) + - Rajesh Menon (contributed various feedback) + - Oliver Kopp (contributed various feedback) + - Andreas Gunnarsson <wmi at zzlevo.net> + (contributed Split::neighbor() patch) + - AntThyKem <antthykem at tiscali.fr> + (contributed rpm package) + - Fernando Tarlá Cardoso Lemos <fernandotcl at spymac.com> + (contributed the wasplite theme, which is based on Matthews wasp theme) + - Fabian Braennstroem <f.braennstroem at gmx.de> + (contributed archlinux stable and current packages) + - Kathryn Andersen <kat_lists at katspace.com> + (contributed nice theme and valuable newbie feedback) + - Markus Lindorfer <markus.lindorfer at liwest.at> + (contributed patch to compile on Solaris) + - Marcin Pawlik <wapkil at o2.pl> + (contributed Control-keys patch for input mode) + - Gavin McCullagh <lists_gmc at fiachra.ucd.ie> + (contributed various ideas, active WMI user) + - Fernan Bolando <fernanbolando at mailc.net> + (one of the most active WMI testers, various ideas) + - Frank Ehmsen <ehmsen at gmx.de> (bug reports and various ideas) + - Gavin McCullagh <gavin at fiachra.ucd.ie> (various feedback) + - Fernan Bolando <fernanbolando at mailc.net> (various feedback) + +Inactive contributors/older contributors: + + - Rainer Trusch (bug reports and some ideas) + - Hannes Klas <greathun at gmx.de> (Wiki) + - Stefan Kuttler <Deleuze at gmx.net> (Inventor of project name) + +Special thanks to following people who gave very useful feedback from +the very beginning of development: + + - Dr. Frank Boehme (Various ideas, hints, feedback) + - Mark Weinem (Various ideas, hints, feedback) + - Tuncer M zayamut Ayaz (Provided some WMI paper corrections) + - Robert Lillack <rob at lillack.de> (Ideas about window management) + - et al. diff --git a/COPYING b/COPYING @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/ChangeLog b/ChangeLog @@ -0,0 +1,418 @@ +$Id: ChangeLog 735 2004-09-27 18:36:45Z garbeam $ + +wmi-10: + * cycling workspaces focusses the last focussed client + * toggle-statusbar-mode for displaying client title instead of + workspace pager and detached-clients, useful for long client + names + * renamed startup-action.name to startup.chain, now you can provide + arbitrary action names in a comma separated list for the startup.chain, + default is single "rehash" action + * removed groups + * renamed ex-floatbar into clientbar + * renamed toggle-status-mode into toggle-clientbar-mode + * improved mode pager button on client bar, filled means that there're + clients attached, unfilled means, no clients attached + * removed statusbar.status-width option which is calculated now + automatically + * renamed toggle-focus-mode into toggle-mode + * new menu button on new clientbar + * new menu for fast selection of clients and fast attaching detached + clients, also for fast action invocation + * new common.conf option 'menu.actions' for actions definition + within menu + * applied several patches by Dr. Pfefferl + * fixed BUG-24 (label overlapping) + * fixed toggle-max issues + * removed cycle-frame-* + * fixed bar and button sizes + * new theme colors for focus requests + color.focusreq.background + color.focusreq.text + color.focusreq.shine + color.focusreq.shadow + * changed default theme to zahod's industrial theme contribution + * implemented race prevention for EnterNotify's of sloppy focus stuff + with floating clients + * fixed broken destroy-* actions + * improved sticky handling, now sticky does not mean raised on top + * detached clients will get attached again after restart + * fixed following BUGS + BUG-51 (detaching firefox crashed wmi) + BUG-50 (endless resizing due to missing increment hint handling) + BUG-49 (destroy action have been broken) + BUG-39 (don't run startup.chain on restart) -> invalid, no bug + * implemented new actions 'hook-client' and 'unhook-client' which + make it possible to hook clients to specific workspaces + * Eliminated several BadWindow and BadMatch occurences + * autocompletion.mode option of common.conf reappeared, now + with two possibilities - 'default' and 'regex' + * improved menu with missing button functions, especially right click + on workspace items or clients (middle button click now inserts cut + buffer into client) + * new action 'toggle-sloppy-mode' which toggles the sloppy focussing + on the fly + * removed resize-move.info option, because bar is not supported anymore, + be a fan of pseudo resize info centered within pseudo client borders + * implemented meters controlled by wmiremote with special syntax - + wmiremote -m <percentage>#<text>,<precentage>#<text>,... + * Marcel implemented regexp support for input mode, just compile wmi + with --with-posix-regex and set autocompletion.mode=regex in + common.conf to enable it + * new slot.tabs entry for common.conf to create several slot tabs, use + this option like slot.tabs=default,icq,dockapps + * renamed toggle-client-bar into toggle-clientbar + * renamed toggle-status-bar into toggle-statusbar + * renamed toggle-inputmode into inputmode + * each workspace remembers the last focussed slot tab now + * removed --with-stacked-tabbing compile option, use cycle.mode= option + in common.conf instead + * improved clientbar illumination + * fixed toggle-slot brokeness after snap 558 + * now using Container for slot tabs also + * using CClient and CFrame (Container types) for workspace/monitor stuff, + to also support stacked tabbing for frames, detached, floating and sticky + clients + * slot raises on every mode change action + * shortcut handling is now improved + * new widget class for menu, slot and bar with default methods + * WM_TRANSIENT_FOR is taken into account now when setting maximized/float + settings for new windows through a patch by Ryan Sorensen + * new default.transient-mode={float,max} for default placement of + transients + * some general transient fixes + * sloppy focus focusses windows only, not raising them (raise with + click instead) + * slot improvements finished now - new cycle-slot-tab-prev/next + actions, implemented focus for slot, now you can easily focus an + slot app through mouse-over (enter) events + * toggle-mode now validates if senseful (if no client is attached + within the specific mode, toggle-mode is invalid) + * new colors for meters - + color.meter.background + color.meter.figure + color.meter.border.shine + color.meter.border.shadow + * new default.bar-mode={show,hide} and default.border-mode={show,hide} + options for common.conf to show hide borders/bars of + clients/frames by default + * implemented slot.mode={overlap,non-overlap} to get a + (non-)overlapping slot + * implemented '~' expansion for input mode + * new kill-slot-client action for killing focussed slot client + * new regex-mode for the input-line. compile with '--with-posix-regex' + and turn it on in common.conf with 'autocompletion.mode=regex' + * WMI shows a special box now when awaiting more keystrokes + (e.g. in sequential shortcut chains) + * implemented raise action, this fits better with current focussing + model (to prevent FocusOnClick if a client is already focused) + * mouse shortcuts are only allowed in single shortcuts or shortcut + chain prefixes but not in chain shortcuts + * improved shortcut handling with following ratpoison-alike + behavior - if you press same keystroke of a shortcut chain twice, + it'll send to the client (instead processed), this works only with + shortcut chains, not with simple shortcuts + * fixed several bogus window occurances + * removed slot.adjustment property - slot now always is adjusted + top-down (because of new overlap mode this is needed/simplified) + * renamed bind-keys action to bind-shortcut + * new action toggle-shortcuts implemented which ungrabs all + keybindings, except itself and inputmode keybinding until next + toggle-shortcuts action + * slot now takes only the height it needs (especially useful for + overlap mode of slot) + * implemented new select-monitor action for multihead configurations + * renamed attach-client to attach-last-client + * new attach-client action which provides a list of all detached + clients in input mode + * splitted color.meter.figure into three new colors as follows - + color.meter.figure.high (>66) + color.meter.figure.normal (<33) + color.meter.figure.low (else) + * improved wmiremote -m syntax, now wmi understands + wmiremote -m '!80#apm' as color negation from high to low or + vice versa + * applied Johann Pfefferl's patch which fixes + BUG-03 (if frame is resized over boundaries it gets obscured) + * fixed slot toggling bug reported by Kathryn Andersen + * lower has reappeared as Kathryn requested + * improved select-frame-* policy which prefers last directional + focussed frame before lowest distance policy (was a feature + request by grayrest) + * IconicState apps are started detached now + * reenabled slot solid filling till down bar when slot.style=solid + and slot.mode=non-overlap options are given in this specific way + * hook-client now works also for slot-tabs (you've to explicitly + focus the slot'ed client to hook it to a specific tab) + * action grab-move implemented which is bound by default to + mod1+Button1 to grab floating clients for moving (useful if + titlebars/borders are hidden) + * normalized the meter syntax from NN#<text> to NN%<text> (% is new + delimeter) + * frame.colwidth option for tiled mode (1..99) + * frame.autodestroy option for autodestroying frames (empty + frames are allowed now) ('yes' or 'no') + * frame.mode option which takes 'tabbed' or 'tiled' as argument + * toggle-tiled and zoom-client actions for tiled mode + * fixed slot persistence bug + * fixed frame resize related problems on workspace change + * new colors for tiled definitions + color.tiled.shine.focussed + color.tiled.shadow.focussed + color.tiled.shine.normal + color.tiled.shadow.normal + * closed open bugs, most are fixed, some multihead issues and some + fullscreen issues still exist + * updated manual pages + + + +wmi-9: + * split toggle-bars to show-bars, hide-bars + * split toggle-borders to show-borders, hide-borders + * rename toggle-unfocussed-group to hide-other-groups, show-other-groups + * removed lock actions cause of minimalism issues, use xlock instead, + also removed lock.password from common.conf + * added new startup-action.name property into common.conf which invokes + a startup action after start or restart of WMI + * implemented bar/slot visibility on a per workspace basis + * fixed cycle-workspace-prev issues + * tab based autocompletion, new common.conf property + 'autocompletion.mode={confirm,auto}', confirm means use tab + instead of autocomplete after each key press + * implemented button bindings in conjunction with a valid modifier + * implemented cycle-{workspace,group}-prev/next if WMI is not compiled + with stacked tabbing order supported which focusses prev/next + workspace or group in the logical order (not in the stacking order) + * implemented previous behavior also with cycle-{frame,client}-* + * implemented Lock keys handling, now NumLock and ScrollLock are + ignored by shortcuts if they're on or off + * implemented new autocompletion.mode for common.conf (also new default) + autoconfirm, thie is a mixture of original autocompletion and newer + confirm feature. + * new restart action implemented (currently without session management) + * new slot.adjustment property which provides top, center and bottom + adjustment of dockapps + * new slot.style property which provides a solid background filling + of the slot with bar background color (solid) or ignores it + (transparent) + * implemented new slot-client and unslot-client actions for moving + clients which aren't handled in the slot by default (because they + aren't Withdrawn) for let them go to the slot and back + * action arguments can now be smuggled to actions also via input + mode, e.g. exec*xterm, create-workspace+5, etc. + * gravity support, now emacs behaves ok (and all related bugs) + * removed explicit Settings class (not needed anymore) + * removed explicit Bindings class (not needed anymore) + * various code refactorings to met new fixed issues more convenient + * removed other-groups.mode option because we already have + show-/hide-other-groups on the fly (which is more senseful, think + of floating dialog boxes of maximized apps ;)) + * bar and slot visibility per workspace is now persistated in + session info + * the diamond box now looks like a honeycomb + * implemented prevent button invocation when a client/frame is not focussed + * removed sloppy mode, now all frames/clients are focusable through + a simple click + * toggle-pointer removed because we've no sloppy mode or warpPointer + stuff anymore + * implemented new select-client-id action + * fixed several multihead issues + * applied Andreas Gunnarsson nextNeighbor (Split) patch + * fixed broken multihead support + * removed resize-move.mode, because opaque move/resizing is not + really needed (KISS) + * improved split stuff, now select-frame-dir works perfect, also + all resizings work perfectly + * made transient handling ICCCM compliant + * removed double-parenting of clients attached to frames, now several + menu-popup issues should been fixed + * fixed gvim resize bug (maybe xemacs too, but not tested yet) + * fixed transient related crash bug (at least existant in ImageMagick) + * allow bar/slot overlapping of floating clients (also outside viewport area) + * implemented new action 'fit-client' which fits a floating client into + worksapce area, if it has been moved outside visible workspace area + or is greater + * created configure argument --without-slot which disables the slot + at compile time + * fixed slot configure request issues (resize gkrellm when it + requests it) + * fixed (un)slot-client issues with xterm and other clients with + decoration + * fixed accidental slot placements of withdrawn clients + * fixed broken buttons/menus in various apps, especially in motif + apps + * fixed focus loss bug when focussing an empty group + * implemented group and workspace focussing remembering for session + handling + * fixed workspace pager updates for mouse wheel cycling + * fixed workspace frame re-adjusting bug when select or cycle + workspaces + * re-enabled sloppy frame focussing + * fixed bugs + BUG-20 (ddd crash), + BUG-19 (xmms, plan), + BUG-18 (grace), + BUG-17 (menus in acroread), + BUG-16 (larger clients than screen), + BUG-15 (document scrolling in acroread), + BUG-12 (resize issues of gvim), + BUG-08 (xv large images), + BUG-07 (matlab menu choosing), + BUG-06 (scan windows), + BUG-02 (middle point issues with toggle-client-mode), + BUG-01 (Xnest) + * fixed gmplayer issues + * fixed cycle-frame-prev/next bugs + * fixed bugs + BUG-27 (resizing transients) + BUG-10 (advi crash) + * input mode now gets raised if status bar is invisible + * beginning with double tab in input mode, next entry will be + focussed + * focused group raises all clients again + * improved split algorithm (now supports directional state resizing) + * new banish action implemented (equivalent to ratpoison) + * improved input mode again + * fixed bugs + BUG-37 (exec with / prefix) + BUG-34 was reported as user error + BUG-38 (restart ignored floating clients) + BUG-36 (focus issue after lower) + BUG-35 (bar visibility issues on cycle-workspace) + BUG-32 (workspace focus when select-client) + BUG-31 (client walking on continues toggle-client-mode) + BUG-28 (transient crahses) + BUG-25 (pseudo clients after restart) + BUG-23 (eiphany crash, may have been transient related) + BUG-22 (SDL app focus fix) + BUG-14 (title change of minimized apps) + BUG-11 (emacs builtin window cycling) + BUG-09 (rox self-resizing) + BUG-05 (ssh-tunneled gnuplot crash) + BUG-04 (ssh somehost password dialog crash) + BUG-02 (outside frame middlepoint crash) + BUG-32 (gkrellm crash in slot) + BUG-26 (rox d'n'd didn't worked) + BUG-13 (chain action arguments stuff) + BUG-30 (bogus client area issues) + * updated manual pages + +wmi-8: + * select-client action for monitor-wide fast focussing of clients + * cycle-frame action readded for cycling frames + * toggle-frames action added for toggling frames + (older raise-all-frames has been removed) + * cycle-group action added for group based cycling + * cycle-prev/next removed + * attach-all-clients action implemented which attaches all detached + clients to the current workspace + * changed tab colorization of unfocussed clients of the active group + to a different default than unfocussed clients of inactive groups + * dynamic border width configuration for frames and clients + * toggle-border(s) actions for toggling the border on the fly + * new stacking order remebering of all WMI objects (clients, + frames, groups, workspaces) implemented + * unfocussed-groups.mode option for common.conf implemented (this + option has two modes (show/hide) which is used for default hiding + other (unfocussed) groups + * toggle-unfocussed-groups action which toggles the visibility of + unfocussed groups implemented + * lock implemented using lock.password common.conf property + * sticky group (monitor-wide) implemented with new actions + * sticky-client action implemented which makes a client sticky + * unsticky-client action implemented which resets a sticky client + to normal floating state + * added frame.buttons option to common.conf for frame button visibility + * applied Marcin Pawliks control keys patch for input mode + * applied Markus Lindorfers patch for Solaris support + * implemented Xft support + * implemented new shortcut handling with abstract syntax + {extern,intern,chain}.<name>.keys=[<mod(s)>*<key>::]*<mod(s)>*<key> + * implemented new option 'default.client-mode' to common.conf + which sets the default mode for unknown apps. + * wmiremote -p pretty prints current key bindungs of running WMI + session as ASCII art to the terminal + * implemented mouse-wheel based workspace and group cycling + * eliminated various compiler warnings (mostly unserious ones) + * destroy-action for self-defined chain and extern actions implemented + * implemented select-frames action + * removed autowarping the pointer + * drastic code size optimizations (removed useless inlines, + made unsigned to explicit unsigned int, etc.) + * renamed toggle-frames to toggle-focus-mode + * renamed toggle-client-state to toggle-client-mode + * new default key bindings only using alt*<...>, shift*alt*<...> and + ctrl*alt*<...> + * removed detachAllButton from floatbar (consistency reasons) + * removed all left frame buttons + * close button now scales better by big fonts (only 3 pixel center) + * toggle-focus-mode button in floatbar now gives feedback about + active mode like (overlapping=floating/non-overlapping=maximized) + * implemented bigger tolerance for diagonal resize pointer + * new slot behavior for NeXTish dockapps (gkrellm experimental) + removed slot.width and slot.justification, fast invocation menu + not implemented yet, cause this should be done externally + * removed autoraising of grouped clients if a floating client + is attached/focussed + * ICCCM overwork (should solve most known BUGs) + * focus clients through click into client area with alt key pressed + * written welcome section in wmi(1) manual page for newbies + * pop up manual page wmi(1) within xterm when wmi is started first + * moved actions detail description to actions.conf file + +wmi-7: + * overworked split handling (tree map layout) + * wmiremote supports remote action invocation + * overworked theme engine/look'n'feel + * support for size hints + * fixed xterm startup issues + * layer handling completely overworked, renamed to group + * overworked input mode + * new end-record actions + * various serious bug fixings + * simplified shrink/grow handling + * simplified/consistentified cycling + * improved detach-all handling + * renamed max-client-to-screen to toggle-max + * new toggle-bars action + * new manual pages + * new various configuration options in common.conf + * removed "common." prefix in common.conf + * changed release schema + * new join-frame-* action to join frames (opposite of split-frame-*) + * new send-client-* action to move a client from one frame to another + +wmi-6: + * renamed several actions + * new default color scheme + * code size minimization/optimzation + * rudimentary slot behavior implemented + * new floating app bar + * new layer handling implemented + * fixed many major bugs + * removed tweak stuff + +wmi-5: + * overworked window handling for max/min size hints + * several new actions (toggle-*, exec-term, lower, raise) + * bind key auto completion for action names + * exec argument auto completion + * floating mode for frames enabled + * resize handling overwork + * borderless clients support + * major bug fixing for several crashes + * maps have been renamed to chains + * bar neighbor handling/toggle-*-bar overwork + * cursor fixes + * client grabbing performance boost + +wmi-4: + * new window concept implemented + * several major bugs fixed + * fully refactored WMI + +wmi-1 - wmi-3: + * don't remember exactly, very experimental milestones + * there've been only 5 hackers who used wmi around this + time beside the author itself diff --git a/FAQ b/FAQ @@ -0,0 +1,96 @@ +$Id: FAQ 735 2004-09-27 18:36:45Z garbeam $ + +General +------- + +Q: How do I split frames? +A: First make sure, that your clients are maximized (through click on +maximize button or invoking toggle-client-mode action). +Second make sure, that at least two clients are running within the +focussed frame. If so, just use one of the split-frame-* actions. +Btw. the opposite of split-frame-* is join-frame-*. + +Q: It seems that the actions don't work? Nothing happens if I try to use +exec action? +A: Simply answer: you've to press RETURN after each action in input +mode. + +Q: How can I directly select workspaces? +A: You can use select-workspace action, but you can also define some +shortcuts to select a specific workspace fast through chains. Just +define following lines in your $HOME/.wmi/actions.conf file: +chain.selws1.seq="select-workspace+workspace 1" +chain.selws1.keys=alt+1 +chain.selws2.seq="select-workspace+workspace 2" +chain.selws2.keys=alt+1 +This enables alt+1 and alt+2 for direct workspace selection. + +Q: How could I determine all installed Xft fonts? +A: Use 'fc-list ""' command. + +Q: How could WMI be minimalist if it has hundreds of actions and +is highly customizable? +A: Compared to other window managers WMI is minimalist because it +concentrates on basic internal actions which can be extended through +chains or wmiremote scripts, but wether supports menus and icons nor +built-in dialogs for various things which may be found in conventional +window managers. +But WMI is not as minimalist as evilwm, larswm or failsafewm. + +Q: Why is WMI compared with vim? +A: When WMI was specified, the author was much oriented on the vi-like +approach of usage. First, it is designated to make it possible to control +everything from input mode, similiar to vim. But you can control +everything also via shortcuts, if you've configured any, also similiar +to vim mappings. Second, you've only one input mode where the statusbar +is located, this is similiar to vim. In opposite the emacs approach +is to provide input bars under each buffer. And third, the splitting +concept of WMI is pretty much oriented on the buffer splitting concept +of vim. +To sum up: The WMI input mode is for window manipulation, the vim +command mode is for file manipulation. + + +Configuration +------------- + +Q: The Xft fonts appear large, what can I do? +A: Have a look at +http://pdx.freedesktop.org/~fontconfig/fontconfig-user.html, this should +help you configure the fonts to a size and style you'd prefer. + +Q: Ion is more powerful than WMI, because WMI lacks of Lua support. +A: Really? Who bars you from using Lua in conjunction with wmiremote? + +Q: Why is Lua not used as Ion does? +A: I'm not against Lua in general, it's a simple Turing-complete +procedural language as many others. You may like it or not. +I think that the Lua integration in WMI would be adverse. +First, it's double-complexity, because the time you invest in learning +Lua could be invested to enhance your knowledge of C++ to implement +native window manager improvements. Second, it's a bottleneck, because +you're going to control fast native C++ code with interpreted Lua logic. +Third, Lua would be an additional build- and runtime dependency, but WMI +is designed to be a minimalist window manager. +If you really need Lua 'integration' anyway, just use it in +conjunction with wmiremote. + +Q: How do I undefine the default key bindings? +A: Insert some dummy action to your actions.conf and bind the keys you +want to make avaliable for applications to it (eg. alt+q since some +browsers use that one to quit): +extern.dummy.cmd="" +extern.dummy.cmd=alt+q +in wmi-9 there will also be an action "toggle-all-keys" to undefine +all keys (useful for nested remote WMI sessions) + + +Development +----------- + +Q: Why X resource management isn't used for configuration files? +A: Several reasons: + - the self-made settings behavior is more simple + - iteration over user defined keys is no problem/very simple + - configuration is homogetic + - the self-made settings behavior performs better diff --git a/INSTALL b/INSTALL @@ -0,0 +1,104 @@ +$Id: INSTALL 735 2004-09-27 18:36:45Z garbeam $ + +1. Required Software + +Make sure you have installed at least following software: + +* automake-1.5+ +* autoconf-2.5+ +* gcc-2.95+ +* X11R6 with Xlib and X headers +* STL library and headers + + +2. Installation of an SVN snapshot: + +# ./autogen.sh +# ./configure +# make +# sudo make install + + +3. Installation of a released version: + +# ./configure +# make +# sudo make install + + +4. Some build notes about configure arguments + +4.1. Notes for Xft support + +If you've installed Xft and freetype WMI will build with +Xft support by default. If Xft is not installed WMI won't +build with Xft support. If you explicitly don't want Xft +support, although having Xft installed just use following +configure argument: + +./configure --without-xft + +4.2. Notes for stacked tabbing + +WMI supports stacked tabbing with stack-alike visual +feedback within frame bars, groups and pagers. This feature +is not seen in any other window manager but disabled by +default. It's highly recommended to give it a try. All +focussed clients, groups, workspaces are arranged in +stacking order from left to right, the topmost element +is arranged leftwards and the bottom element is arranged +rightwards. +This results that the focussed element (e.g. a client in +a frame bar or group bar) appears always left, thus the +focus never changes, but the titles and order. +Just use following configure argument: + +./configure --with-stacked-tabbing + +4.3. Notes for debug support + +To run WMI with verbose debug output you've to configure it +with debug support: + +./configure --with-debug + +4.4. Notes for diamond box + +By default WMI draws a diamond box while resizing/moving +clients. If you don't like drawing the diamond box you +can disable it using: + +./configure --without-diamond + +4.5. Notes for disabling the slot + +By default WMI is built with slot support. +If you don't need it you can disable it using: + +./configure --without-slot + + +5. Start WMI + +To start WMI as your default window manager add following line +to your $HOME/.xinitrc: + +exec wmi + +and type + +# startx + +afterwards to launch X and the WMI. + + +6. Further Help + +To get in contact with WMI you should read at least the manual +pages wmi(1) and actions.conf(5). + + +7. Contact + +If you've problems visit http://wmi.berlios.de to get further +information. diff --git a/LICENSE.txt b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/Makefile.am b/Makefile.am @@ -0,0 +1,19 @@ +SUBDIRS = src man +MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in +ACLOCAL_AMFLAGS = -I . +EXTRA_DIST = BUGS CONTRIB FAQ LICENSE.txt xft.m4 examples/statustext.sh examples/statustext-gavin.sh examples/statustext-deleuze.sh examples/themes/flat-grey-theme.conf examples/themes/accent-theme.conf examples/themes/flat-cyan-theme.conf examples/themes/gold-theme.conf examples/themes/laotse-theme.conf examples/themes/lunatic-theme.conf examples/themes/peacock-theme.conf examples/session-managers/kdm-entry wmi.spec.in wmi.spec +CLEANFILES = wmi.spec + +# Yes, we could create wmi.spec from configure.in, but +# - Makefile.am content is easier to maintain +# - wmi.spec is rebuilt faster from wmi.spec.in if generated in +# Makefile.am + +wmi.spec: $(srcdir)/wmi.spec.in Makefile + sed \ + -e 's,[@]RPM_NAME[@],$(PACKAGE),g' \ + -e "s,[@]RPM_VERSION[@],$$(echo '$(VERSION)' | sed -e 's/-/./g'),g" \ + -e 's,[@]TAR_NAME[@],$(PACKAGE),g' \ + -e 's,[@]TAR_VERSION[@],$(VERSION),g' \ + < $(srcdir)/wmi.spec.in > wmi.spec + diff --git a/Makefile.in b/Makefile.in @@ -0,0 +1,591 @@ +# Makefile.in generated by automake 1.8.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 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@ +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 = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/version.h.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS TODO install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/./xft.m4 \ + $(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 = $(mkdir_p) +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = version.h +depcomp = +am__depfiles_maybe = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +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@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = src man +MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in +ACLOCAL_AMFLAGS = -I . +EXTRA_DIST = BUGS CONTRIB FAQ LICENSE.txt xft.m4 examples/statustext.sh examples/statustext-gavin.sh examples/statustext-deleuze.sh examples/themes/flat-grey-theme.conf examples/themes/accent-theme.conf examples/themes/flat-cyan-theme.conf examples/themes/gold-theme.conf examples/themes/laotse-theme.conf examples/themes/lunatic-theme.conf examples/themes/peacock-theme.conf examples/session-managers/kdm-entry wmi.spec.in wmi.spec +CLEANFILES = wmi.spec +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps'; \ + cd $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu --ignore-deps 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: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(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: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +version.h: $(top_builddir)/config.status $(srcdir)/version.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/. $(distdir)/examples $(distdir)/examples/session-managers $(distdir)/examples/themes + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || mkdir "$(distdir)/$$subdir" \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="../$(top_distdir)" \ + distdir="../$(distdir)/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + $(AMTAR) chof - $(distdir) | 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 + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(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 | $(AMTAR) xf - ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-recursive ctags \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ + dist-tarZ dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-recursive distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-info-am + + +# Yes, we could create wmi.spec from configure.in, but +# - Makefile.am content is easier to maintain +# - wmi.spec is rebuilt faster from wmi.spec.in if generated in +# Makefile.am + +wmi.spec: $(srcdir)/wmi.spec.in Makefile + sed \ + -e 's,[@]RPM_NAME[@],$(PACKAGE),g' \ + -e "s,[@]RPM_VERSION[@],$$(echo '$(VERSION)' | sed -e 's/-/./g'),g" \ + -e 's,[@]TAR_NAME[@],$(PACKAGE),g' \ + -e 's,[@]TAR_VERSION[@],$(VERSION),g' \ + < $(srcdir)/wmi.spec.in > wmi.spec +# 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/NEWS b/NEWS @@ -0,0 +1,2 @@ +$ Id: $ +Visit http://wmi.berlios.de for current news about the WMI. diff --git a/README b/README @@ -0,0 +1,5 @@ +$Id: README 59 2004-04-07 16:26:27Z garbeam $ + +Get further information from: http://wmi.berlios.de + +--Anselm R. Garbe diff --git a/TODO b/TODO @@ -0,0 +1,26 @@ +$Id: TODO 637 2004-09-08 23:09:49Z garbeam $ + +See wmi-devel mailinglist at http://wmi.berlios.de for details. + +19:37 < zahod_> Garbeam, hmm, looks like you use +color.frame.shadow/shine.normal for unfocused +clients in larsmode, which are set to black by default, +thus you can't see the borders if you use black background in +your terminals. 19:40 < zahod_> and if you change it to +color.frame.background.normal, then you will have the same +problems with white terminals, probably two of the most common +colors 19:41 < zahod_> so I think an theme.conf option would be good + + +TODOs for wmii-1: + ++ mod1+button3 resize similar to grab-move function +? history for input mode (remembers last actions) ++ resize increments handling ++ client request colormap support ++ window-snap-to-border for everything(!) ++ Drag'n'drop client detach/attaching like Ion does + +FUTURE refactoring: + +- Implement more self-destroying methods (themes deallocation, etc.) diff --git a/aclocal.m4 b/aclocal.m4 @@ -0,0 +1,933 @@ +# generated automatically by aclocal 1.8.4 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# This file is free software; 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. + +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) + +# 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.8.4])]) + +# AM_AUX_DIR_EXPAND + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# 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 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 6 + +# 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])]) + +# serial 7 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # 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 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 7 + +# 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 -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 11 + +# 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_MISSING_PROG(AMTAR, tar) +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([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]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +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)]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# -*- Autoconf -*- + + +# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. + +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# 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 + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + 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 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# 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])]) + +m4_include([./xft.m4]) diff --git a/action.cpp b/action.cpp @@ -0,0 +1,145 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: action.cpp 734 2004-09-27 18:15:45Z garbeam $ + +extern "C" { +#include <stdlib.h> +#include <string.h> +} + +#include "wmi.h" + +#include "action.h" +#include "actions.h" +#include "kernel.h" +#include "monitor.h" +#include "prompt.h" +#include "shortcut.h" +#include "validators.h" + + +Action::Action(string id, ToPerform toPerform, + IsValid isValid, Type type, char *argument) +{ + id_ = id; + toPerform_ = toPerform; + isValid_ = isValid; + type_ = type; + argument_ = argument; + shortcut_ = 0; + listenOn_ = 0; +} + +Action::~Action() { + if (argument_) { + free(argument_); + } +} + +void Action::perform() { + // great HACK to return from maximized frames back to normality + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + + if (focusedMonitor->isThingMaximized() && + (toPerform_ != &Actions::cycleClientNext) && + (toPerform_ != &Actions::cycleClientPrev) && + (toPerform_ != &Actions::toggleBar) && + (toPerform_ != &Actions::toggleMaximization)) + { + + focusedMonitor->toggleThingMaximization(); + } + + if (KERNEL->isRecording() && + (toPerform_ != &Actions::endChainRecord) && + (toPerform_ != &Actions::endScriptRecord) && + (toPerform_ != &Actions::inputMode)) + { + KERNEL->recordedActions()->push_back( + new Action(id_, 0, 0, type_, argument_ ? strdup(argument_) : 0)); + } + + Actions actions = *Actions::instance(); + + if (isValid()) { + (actions.*toPerform_)(this, argument_); // call action + } +} + +bool Action::isValid() { + Validators validators = *Validators::instance(); + + return (validators.*isValid_)(); +} + +Prompt *Action::prompt(unsigned int index) { + + unsigned int i = 0; + for (LPrompt::iterator it = prompts_.begin(); + it != prompts_.end(); it++) + { + if (i == index) { + return (*it); + } + i++; + } + + // should never occure + return 0; +} + +string Action::id() const { + return id_; +} + +unsigned int Action::promptsCount() const { + return prompts_.size(); +} + + +IsValid Action::getIsValid() const { + return isValid_; +} + +void Action::setShortcut(Shortcut *shortcut) { + shortcut_ = shortcut; + listenOn_ = shortcut; +} + +Shortcut *Action::shortcut() const { + return shortcut_; +} + +void Action::setArgument(char *argument) { + argument_ = argument; +} + +char *Action::argument() const { + return argument_; +} + +Action::Type Action::type() const { + return type_; +} + +void Action::setType(Type type) { + type_ = type; +} + + +LPrompt *Action::prompts() { + return &prompts_; +} + +ToPerform Action::getToPerform() const { + return toPerform_; +} + +void Action::setListenOn(Shortcut *listenOn) { + listenOn_ = listenOn; +} + +Shortcut *Action::listenOn() const { + return listenOn_; +} diff --git a/action.h b/action.h @@ -0,0 +1,95 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: action.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __ACTION_H +#define __ACTION_H + +extern "C" { +#include <X11/Xlib.h> +} + +#include <list> +#include <string> +#include "wmi.h" + +class Action; +class Actions; +class Prompt; +class Shortcut; +class Validators; + +// Method pointer type for actions +typedef void (Actions::*ToPerform)(Action *, const char *); +typedef bool (Validators::*IsValid)(); + +typedef list<Prompt *> LPrompt; + +/** Interface for all actions which will be performed by WMI. */ +class Action +{ + +public: + + enum Type {INTERN, EXTERN, SEQUENCE, UNKNOWN}; + + Action(string id, ToPerform toPerform, + IsValid isValid, Type type = INTERN, char *argument = 0); + + ~Action(); + + string id() const; + + unsigned int promptsCount() const; + + /** Performs the action. */ + void perform(); + + /** Returns <code>true</code> if the actions is possible. */ + bool isValid(); + + /** Returns the is possible method pointer. */ + IsValid getIsValid() const; + + void setShortcut(Shortcut *shortcut); + + Shortcut *shortcut() const; + + void setArgument(char *argument); + + char *argument() const; + + Type type() const; + + void setType(Type type); + + /** Returns prompt for argument at position 'index'. */ + Prompt *prompt(unsigned int index); + + LPrompt *prompts(); + + ToPerform getToPerform() const; + + void setListenOn(Shortcut *listenOn); + + Shortcut *listenOn() const; + +private: + + string id_; + ToPerform toPerform_; + IsValid isValid_; + + // for keyboard bindings + Shortcut *shortcut_; + Shortcut *listenOn_; + + // for special stuff + char *argument_; + Type type_; + LPrompt prompts_; + +}; + +#endif // __ACTION_H diff --git a/actions.cpp b/actions.cpp @@ -0,0 +1,1037 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: actions.cpp 734 2004-09-27 18:15:45Z garbeam $ + +extern "C" { +#include <assert.h> +#include <X11/Xlib.h> +} +#include <sstream> +#include <map> + +#include "actions.h" + +#include "action.h" +#include "binder.h" +#include "client.h" +#include "clientbar.h" +#include "frame.h" +#include "inputbar.h" +#include "launcher.h" +#include "kernel.h" +#include "monitor.h" +#include "logger.h" +#include "expander.h" +#include "prompt.h" +#include "slot.h" +#include "util.h" +#include "validators.h" +#include "workspace.h" + +Actions::Actions() { +} + +Actions::~Actions() { +} + +void Actions::initInternActions(MBindings *actionBindings) { + Action *action = 0; + + (*actionBindings)["restart"] = new Action("restart", &Actions::restart, &Validators::isAlwaysPossible); + (*actionBindings)["quit"] = new Action("quit", &Actions::quit, &Validators::isAlwaysPossible); + (*actionBindings)["save-settings"] = new Action("save-settings", &Actions::saveSettings, &Validators::isAlwaysPossible); + + (*actionBindings)["begin-record"] = new Action("begin-record", &Actions::beginChainRecord, &Validators::validateBeginRecord); + + action = new Action("end-record-chain", &Actions::endChainRecord, &Validators::validateEndRecord); + action->prompts()->push_back(new Prompt("action name : ", 0)); + (*actionBindings)["end-record-chain"] = action; + + action = new Action("end-record-script", &Actions::endScriptRecord, + &Validators::validateEndRecord); + action->prompts()->push_back(new Prompt("script path : ", 0)); + (*actionBindings)["end-record-script"] = action; + + (*actionBindings)["cancel-record"] = new Action("cancel-record", &Actions::cancelRecord, &Validators::validateCancelRecord); + + action = new Action("exec-term", &Actions::executeTerm, + &Validators::isWorkspaceFocused); + action->prompts()->push_back(new Prompt("command : ", &Binder::queryCommandForPattern)); + (*actionBindings)["exec-term"] = action; + + (*actionBindings)["rehash"] = new Action("rehash", &Actions::rehash, &Validators::isAlwaysPossible); + + action = new Action("exec", &Actions::execute, + &Validators::isWorkspaceFocused); + action->prompts()->push_back(new Prompt("command : ", &Binder::queryCommandForPattern)); + (*actionBindings)["exec"] = action; + + action = new Action("destroy-action", &Actions::destroyAction, + &Validators::validateDestroyAction); + action->prompts()->push_back(new Prompt("action to destroy : ", + &Binder::queryExternChainActionsForPattern)); + (*actionBindings)["destroy-action"] = action; + +#ifdef SLOT_SUPPORT + (*actionBindings)["slot-client"] = new Action("slot-client", &Actions::slotClient, &Validators::isClientFocused); + (*actionBindings)["unslot-client"] = new Action("unslot-client", &Actions::unslotClient, &Validators::existsSlotClient); + (*actionBindings)["toggle-slot"] = new Action("toggle-slot", &Actions::toggleSlot, &Validators::isAlwaysPossible); + (*actionBindings)["cycle-slot-tab-next"] = new Action("cycle-slot-tab-next", &Actions::cycleSlotTabNext, &Validators::existSlotTabs); + (*actionBindings)["cycle-slot-tab-prev"] = new Action("cycle-slot-tab-prev", &Actions::cycleSlotTabPrev, &Validators::existSlotTabs); + (*actionBindings)["kill-slot-client"] = new Action("kill-slot-client", &Actions::killSlotClient, &Validators::existsSlotClient); +#endif // SLOT_SUPPORT + + (*actionBindings)["toggle-client-sticky"] = new Action("toggle-client-sticky", &Actions::toggleClientSticky, &Validators::isClientFocused); + + (*actionBindings)["toggle-client-mode"] = new Action("toggle-client-mode", &Actions::toggleClientMode, &Validators::isFrameOrClientFrameFocused); + (*actionBindings)["grow-left"] = new Action("grow-left", &Actions::growLeft, &Validators::validateResizeLeft); + (*actionBindings)["grow-right"] = new Action("grow-right", &Actions::growRight, &Validators::validateResizeRight); + (*actionBindings)["grow-up"] = new Action("grow-up", &Actions::growUp, &Validators::validateResizeUp); + (*actionBindings)["grow-down"] = new Action("grow-down", &Actions::growDown, &Validators::validateResizeDown); + (*actionBindings)["shrink-left"] = new Action("shrink-left", &Actions::shrinkLeft, &Validators::validateResizeRight); + (*actionBindings)["shrink-right"] = new Action("shrink-right", &Actions::shrinkRight, &Validators::validateResizeLeft); + (*actionBindings)["shrink-up"] = new Action("shrink-up", &Actions::shrinkUp, &Validators::validateResizeDown); + (*actionBindings)["shrink-down"] = new Action("shrink-down", &Actions::shrinkDown, &Validators::validateResizeUp); + (*actionBindings)["move-client-left"] = new Action("move-client-left", &Actions::moveClientLeft, &Validators::isFloatingClientFocused); + (*actionBindings)["move-client-right"] = new Action("move-client-right", &Actions::moveClientRight, &Validators::isFloatingClientFocused); + (*actionBindings)["move-client-up"] = new Action("move-client-up", &Actions::moveClientUp, &Validators::isFloatingClientFocused); + (*actionBindings)["move-client-down"] = new Action("move-client-down", &Actions::moveClientDown, &Validators::isFloatingClientFocused); + (*actionBindings)["show-bars"] = new Action("show-bars", &Actions::showBars, &Validators::isFrameOrClientFrameFocused); + (*actionBindings)["hide-bars"] = new Action("hide-bars", &Actions::hideBars, &Validators::isFrameOrClientFrameFocused); + (*actionBindings)["toggle-bar"] = new Action("toggle-bar", &Actions::toggleBar, &Validators::isFrameOrClientFrameFocused); + (*actionBindings)["show-borders"] = new Action("show-borders", &Actions::showBorders, &Validators::isFrameOrClientFrameFocused); + (*actionBindings)["hide-borders"] = new Action("hide-borders", &Actions::hideBorders, &Validators::isFrameOrClientFrameFocused); + (*actionBindings)["toggle-border"] = new Action("toggle-border", &Actions::toggleBorder, &Validators::isFrameOrClientFrameFocused); + (*actionBindings)["toggle-statusbar"] = new Action("toggle-statusbar", &Actions::toggleStatusBar, &Validators::isAlwaysPossible); + (*actionBindings)["toggle-clientbar"] = new Action("toggle-clientbar", &Actions::toggleClientBar, &Validators::isAlwaysPossible); + (*actionBindings)["kill-client"] = new Action("kill-client", &Actions::killClient, &Validators::isClientFocused); + (*actionBindings)["cycle-client-next"] = new Action("cycle-client-next", &Actions::cycleClientNext, &Validators::existClients); + (*actionBindings)["cycle-workspace-next"] = new Action("cycle-workspace-next", &Actions::cycleWorkspaceNext, &Validators::existWorkspaces); + + (*actionBindings)["toggle-mode"] = new Action("toggle-mode", &Actions::toggleMode, &Validators::validateToggleMode); + + action = new Action("select-monitor", &Actions::selectMonitor, &Validators::existMonitors); + action->prompts()->push_back(new Prompt("monitor : ", + &Binder::queryMonitorsForPattern)); + (*actionBindings)["select-monitor"] = action; + + action = new Action("select-workspace", &Actions::selectWorkspace, &Validators::existWorkspaces); + action->prompts()->push_back(new Prompt("workspace : ", + &Binder::queryWorkspacesForPattern)); + (*actionBindings)["select-workspace"] = action; + + action = new Action("select-client", + &Actions::selectClient, &Validators::validateSelectClient); + action->prompts()->push_back(new Prompt("client : ", + &Binder::queryClientsForPattern)); + (*actionBindings)["select-client"] = action; + + action = new Action("select-client-id", + &Actions::selectClientId, &Validators::validateSelectClient); + action->prompts()->push_back(new Prompt("client id: ", + &Binder::queryClientIdsForPattern)); + (*actionBindings)["select-client-id"] = action; + + (*actionBindings)["hook-client"] = new Action("hook-client", &Actions::hookClient, &Validators::validateHookClient); + (*actionBindings)["unhook-client"] = new Action("unhook-client", &Actions::unhookClient, &Validators::validateUnhookClient); + + (*actionBindings)["cycle-client-prev"] = new Action("cycle-client-prev", &Actions::cycleClientPrev, &Validators::existClients); + (*actionBindings)["cycle-workspace-prev"] = new Action("cycle-workspace-prev", &Actions::cycleWorkspacePrev, &Validators::existWorkspaces); + (*actionBindings)["split-frame-left"] = new Action("split-frame-left", &Actions::splitFrameLeft, &Validators::existClientsWithinFrame); + (*actionBindings)["split-frame-right"] = new Action("split-frame-right", &Actions::splitFrameRight, &Validators::existClientsWithinFrame); + (*actionBindings)["split-frame-up"] = new Action("split-frame-up", &Actions::splitFrameUp, &Validators::existClientsWithinFrame); + (*actionBindings)["split-frame-down"] = new Action("split-frame-down", &Actions::splitFrameDown, &Validators::existClientsWithinFrame); + (*actionBindings)["join-frame-left"] = new Action("join-frame-left", &Actions::joinFrameLeft, &Validators::existsFrameLeft); + (*actionBindings)["join-frame-right"] = new Action("join-frame-right", &Actions::joinFrameRight, &Validators::existsFrameRight); + (*actionBindings)["join-frame-up"] = new Action("join-frame-up", &Actions::joinFrameUp, &Validators::existsFrameUp); + (*actionBindings)["join-frame-down"] = new Action("join-frame-down", &Actions::joinFrameDown, &Validators::existsFrameDown); + (*actionBindings)["send-client-left"] = new Action("send-client-left", &Actions::sendClientLeft, &Validators::existsFrameLeft); + (*actionBindings)["send-client-right"] = new Action("send-client-right", &Actions::sendClientRight, &Validators::existsFrameRight); + (*actionBindings)["send-client-up"] = new Action("send-client-up", &Actions::sendClientUp, &Validators::existsFrameUp); + (*actionBindings)["send-client-down"] = new Action("send-client-down", &Actions::sendClientDown, &Validators::existsFrameDown); + (*actionBindings)["detach-all-clients"] = new Action("detach-all-clients", &Actions::detachAllClients, &Validators::existClients); + (*actionBindings)["attach-all-clients"] = new Action("attach-all-clients", &Actions::attachAllClients, &Validators::existDetachedClients); + (*actionBindings)["detach-client"] = new Action("detach-client", &Actions::detachClient, &Validators::isClientFocused); + (*actionBindings)["attach-last-client"] = new Action("attach-last-client", &Actions::attachLastClient, &Validators::existsDetachedClient); + (*actionBindings)["inputmode"] = new Action("inputmode", &Actions::inputMode, &Validators::validateInputMode); + + action = new Action("attach-client", + &Actions::attachClient, &Validators::existDetachedClients); + action->prompts()->push_back(new Prompt("client : ", + &Binder::queryDetachedClientsForPattern)); + (*actionBindings)["attach-client"] = action; + + action = new Action("create-action", &Actions::createAction, + &Validators::isAlwaysPossible); + action->prompts()->push_back(new Prompt("command : ", &Binder::queryCommandForPattern)); + action->prompts()->push_back(new Prompt("action name : ", 0)); + (*actionBindings)["create-action"] = action; + + action = new Action("create-workspace", &Actions::createWorkspace, &Validators::isAlwaysPossible); + action->prompts()->push_back(new Prompt("workspace name : ", 0)); + (*actionBindings)["create-workspace"] = action; + + (*actionBindings)["destroy-frame"] = new Action("destroy-frame", &Actions::destroyFrame, &Validators::validateDestroyFrame); + (*actionBindings)["destroy-workspace"] = new Action("destroy-workspace", &Actions::destroyWorkspace, &Validators::validateDestroyWorkspace); + + action = new Action("bind-shortcut", &Actions::bindShortcut, + &Validators::isAlwaysPossible); + action->prompts()->push_back(new Prompt("action to bind : ", + &Binder::queryActionKeysWithoutValidationForPattern)); + action->prompts()->push_back(new Prompt("keys <modifier>+<key> : ", 0)); + (*actionBindings)["bind-shortcut"] = action; + + action = new Action("rename-workspace", &Actions::renameWorkspace, &Validators::isWorkspaceFocused); + action->prompts()->push_back(new Prompt("new name : ", 0)); + (*actionBindings)["rename-workspace"] = action; + + (*actionBindings)["select-frame-left"] = new Action("select-frame-left", &Actions::selectFrameLeft, &Validators::existsFrameLeft); + (*actionBindings)["select-frame-right"] = new Action("select-frame-right", &Actions::selectFrameRight, &Validators::existsFrameRight); + (*actionBindings)["select-frame-up"] = new Action("select-frame-up", &Actions::selectFrameUp, &Validators::existsFrameUp); + (*actionBindings)["select-frame-down"] = new Action("select-frame-down", &Actions::selectFrameDown, &Validators::existsFrameDown); + + (*actionBindings)["swap-frame-left"] = new Action("swap-frame-left", &Actions::swapFrameLeft, &Validators::existsFrameLeft); + (*actionBindings)["swap-frame-right"] = new Action("swap-frame-right", &Actions::swapFrameRight, &Validators::existsFrameRight); + (*actionBindings)["swap-frame-up"] = new Action("swap-frame-up", &Actions::swapFrameUp, &Validators::existsFrameUp); + (*actionBindings)["swap-frame-down"] = new Action("swap-frame-down", &Actions::swapFrameDown, &Validators::existsFrameDown); + + (*actionBindings)["swap-client-left"] = new Action("swap-client-left", &Actions::swapClientLeft, &Validators::existsFrameLeft); + (*actionBindings)["swap-client-right"] = new Action("swap-client-right", &Actions::swapClientRight, &Validators::existsFrameRight); + (*actionBindings)["swap-client-up"] = new Action("swap-client-up", &Actions::swapClientUp, &Validators::existsFrameUp); + (*actionBindings)["swap-client-down"] = new Action("swap-client-down", &Actions::swapClientDown, &Validators::existsFrameDown); + + (*actionBindings)["toggle-max"] = new Action("toggle-max", &Actions::toggleMaximization, &Validators::isFrameOrClientFrameFocused); + + (*actionBindings)["raise"] = new Action("raise", &Actions::raise, &Validators::isClientFocused); + (*actionBindings)["lower"] = new Action("lower", &Actions::lower, &Validators::isClientFocused); + (*actionBindings)["fit-client"] = new Action("fit-client", &Actions::fitClient, &Validators::isClientFocused); + (*actionBindings)["banish"] = new Action("banish", &Actions::banish, &Validators::isAlwaysPossible); + (*actionBindings)["toggle-clientbar-mode"] = new Action("toggle-clientbar-mode", &Actions::toggleClientBarMode, &Validators::isAlwaysPossible); + (*actionBindings)["toggle-sloppy-mode"] = new Action("toggle-sloppy-mode", &Actions::toggleSloppyMode, &Validators::isAlwaysPossible); + (*actionBindings)["toggle-shortcuts"] = new Action("toggle-shortcuts", &Actions::toggleShortcuts, &Validators::isAlwaysPossible); + (*actionBindings)["grab-move"] = new Action("grab-move", &Actions::grabMove, &Validators::isClientFrameFocused); + (*actionBindings)["toggle-tiled"] = new Action("toggle-tiled", &Actions::toggleTiled, &Validators::existClientsWithinFrame); + (*actionBindings)["zoom-client"] = new Action("zoom-client", &Actions::zoomClient, &Validators::existClientsWithinFrame); + +} + +void Actions::selectFrameLeft(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->selectFrame(LEFT); +} + +void Actions::selectFrameRight(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->selectFrame(RIGHT); +} + +void Actions::selectFrameUp(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->selectFrame(UP); +} + +void Actions::selectFrameDown(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->selectFrame(DOWN); +} + +void Actions::toggleShortcuts(Action *caller, const char *argument) { + KERNEL->toggleShortcuts(); +} + +void Actions::restart(Action *caller, const char *argument) { + KERNEL->restart(); +} + +void Actions::quit(Action *caller, const char *argument) { + KERNEL->stop(); +} + +void Actions::saveSettings(Action *caller, const char *argument) { + KERNEL->saveSettings(); +} + +void Actions::execute(Action *caller, const char *command) { + + Launcher::instance()->exec(command); +} + +void Actions::executeTerm(Action *caller, const char *command) { + MSettings *commonSettings = KERNEL->commonSettings(); + string cmd = Util::get(commonSettings, (string)"terminal") + " " + command; + + Launcher::instance()->exec(cmd); +} + +void Actions::cycleClientNext(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->cycleClientNext(); +} + +void Actions::cycleClientPrev(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->cycleClientPrev(); +} + +void Actions::attachAllClients(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + monitor->attachAllClients(); +} + +void Actions::detachAllClients(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + monitor->detachAllClients(); +} + +void Actions::detachClient(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + monitor->detachClient(); +} + +#ifdef SLOT_SUPPORT +void Actions::unslotClient(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->unslotClient(); +} + +void Actions::slotClient(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->slotClient(); +} + +void Actions::toggleSlot(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->toggleSlot(); +} + +void Actions::cycleSlotTabNext(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + monitor->cycleSlotTabNext(); +} + +void Actions::cycleSlotTabPrev(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + monitor->cycleSlotTabPrev(); +} + +void Actions::killSlotClient(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + KERNEL->killClient(monitor->slot()->focused()->focused()); +} + +#endif // SLOT_SUPPORT + +void Actions::attachClient(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + + monitor->attachClientByName(argument); +} + +void Actions::attachLastClient(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + + monitor->attachLastClient(); +} + +void Actions::toggleClientSticky(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->toggleClientSticky(); +} + +void Actions::toggleClientMode(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->toggleClientMode(); +} + +void Actions::toggleMode(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + + workspace->toggleMode(); +} + +void Actions::cycleWorkspaceNext(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->focus(monitor->next()); +} + +void Actions::cycleWorkspacePrev(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->focus(monitor->prev()); +} + +void Actions::growLeft(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, LEFT, true); +} + +void Actions::growRight(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, RIGHT, true); +} + +void Actions::growUp(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, UP, true); +} + +void Actions::growDown(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, DOWN, true); +} + +void Actions::shrinkLeft(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, LEFT, false); +} + +void Actions::shrinkRight(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, RIGHT, false); +} + +void Actions::shrinkUp(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, UP, false); +} + +void Actions::shrinkDown(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Thing *thing = workspace->focusedThing(); + assert(thing); + + workspace->resize(thing, DOWN, false); +} + +void Actions::moveClientLeft(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->moveClient(LEFT); + } +} + +void Actions::moveClientRight(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->moveClient(RIGHT); + } +} + +void Actions::moveClientUp(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->moveClient(UP); + } +} + +void Actions::moveClientDown(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->moveClient(DOWN); + } +} + +void Actions::sendClientLeft(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->sendClient(LEFT); + } +} + +void Actions::sendClientRight(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->sendClient(RIGHT); + } +} + +void Actions::sendClientUp(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->sendClient(UP); + } +} + +void Actions::sendClientDown(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Client *client = monitor->focusedClient(); + if (client) { + workspace->sendClient(DOWN); + } +} + +void Actions::joinFrameLeft(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->joinFrame(LEFT); +} + +void Actions::joinFrameRight(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->joinFrame(RIGHT); +} + +void Actions::joinFrameUp(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->joinFrame(UP); +} + +void Actions::joinFrameDown(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->joinFrame(DOWN); +} + +void Actions::splitFrameLeft(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->splitFrame(LEFT); +} + +void Actions::splitFrameRight(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->splitFrame(RIGHT); +} + +void Actions::splitFrameUp(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->splitFrame(UP); +} + +void Actions::splitFrameDown(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->splitFrame(DOWN); +} + +void Actions::showBorders(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->toggleBorders(true); +} + +void Actions::hideBorders(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->toggleBorders(false); +} + +void Actions::toggleBorder(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Thing *thing = workspace->focusedThing(); + if (thing) { + if (thing->borderWidth()) { + thing->setBorderWidth(0); + } + else { + thing->setBorderWidth(KERNEL->borderWidth()); + } + thing->resize(); + } +} + +void Actions::showBars(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->toggleBars(true); +} + +void Actions::hideBars(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + workspace->toggleBars(false); +} + +void Actions::toggleBar(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + assert(workspace); + + Thing *thing = workspace->focusedThing(); + if (thing) { + thing->setTitleBarHeight(thing->titleBarHeight() ? + 0 : monitor->titleBarHeight()); + thing->resize(); + } +} + +void Actions::toggleClientBar(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->toggleClientBar(); +} + +void Actions::toggleStatusBar(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->toggleStatusBar(); +} + +void Actions::inputMode(Action *caller, const char *argument) { + + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->inputBar()->runKey(KERNEL->defaultPrompt()); +} + +void Actions::killClient(Action *caller, const char *argument) { + + KERNEL->killClient(KERNEL->focusedClient()); +} + +void Actions::sequence(Action *caller, const char *command) { + + Launcher::instance()->execSeq(caller, command); +} + +void Actions::createAction(Action *caller, const char *argument) { + + string arg = argument; + LOGDEBUG("arg: " + arg); + unsigned int argDelim = arg.find_last_of('+'); + if (argDelim == string::npos) { + return; + } + string cmd = arg.substr(0, argDelim); + string bind = arg.substr(argDelim + 1); + + if ((bind.length() < 1) || (cmd.length() < 1)) { + return; + } + Action *action = new Action(bind, &Actions::execute, + &Validators::isWorkspaceFocused, Action::EXTERN, + (char *)cmd.c_str()); + (*KERNEL->actionBindings())[bind] = action; + (*KERNEL->actionSettings())["extern." + action->id() + ".cmd"] = cmd; +} + +void Actions::createWorkspace(Action *caller, const char *argument) { + + assert(argument != 0); + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + + focusedMonitor->createNewWorkspace(argument); +} + + +void Actions::bindShortcut(Action *caller, const char *argument) { + + KERNEL->bindShortcut(argument); +} + +// TODO: ungrab potentially keys before removing +void Actions::destroyAction(Action *caller, const char *argument) { + + Action *action = Util::get(KERNEL->actionBindings(), argument); + if (action && (action->type() != Action::INTERN)) { + + Util::remove(KERNEL->actionBindings(), argument); + string prefix = (action->type() == Action::EXTERN) ? "extern." : + "chain."; + prefix += argument; + Util::remove(KERNEL->actionSettings(), prefix); + } +} + +void Actions::destroyWorkspace(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + assert(monitor != 0); + + monitor->destroyWorkspace(monitor->focused()); +} + +void Actions::selectMonitor(Action *caller, const char *argument) { + + KERNEL->selectMonitor(argument); +} + +void Actions::selectWorkspace(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->workspaceForName(argument); + if (workspace) { + focusedMonitor->focus(workspace); + } +} + +void Actions::selectClientId(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + + focusedMonitor->focusClientById(argument); +} + +void Actions::selectClient(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + + focusedMonitor->focusClientByName(argument); +} + +void Actions::renameWorkspace(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + assert(focusedMonitor != 0); + + focusedMonitor->renameWorkspace(focusedMonitor->focused(), + argument); +} + +void Actions::swapFrameLeft(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapFrame(LEFT); +} + +void Actions::swapFrameRight(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapFrame(RIGHT); +} + +void Actions::swapFrameUp(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapFrame(UP); +} + +void Actions::swapFrameDown(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapFrame(DOWN); +} + +void Actions::swapClientLeft(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapClient(LEFT); +} + +void Actions::swapClientRight(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapClient(RIGHT); +} + +void Actions::swapClientUp(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapClient(UP); +} + +void Actions::swapClientDown(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + assert(workspace); + + workspace->swapClient(DOWN); +} + + +void Actions::toggleMaximization(Action *caller, const char *argument) { + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + + focusedMonitor->toggleThingMaximization(); +} + +void Actions::toggleClientBarMode(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + ClientBar *clientBar = focusedMonitor->clientBar(); + + clientBar->setMode((clientBar->mode() == ClientBar::PAGER) ? + ClientBar::CLIENTINFO : ClientBar::PAGER); + clientBar->illuminate(); +} + +void Actions::fitClient(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + + workspace->fitClient(); +} + +void Actions::lower(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + + workspace->lower(); +} + +void Actions::raise(Action *caller, const char *argument) { + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + Workspace *workspace = focusedMonitor->focused(); + + workspace->raise(); +} + +void Actions::rehash(Action *caller, const char *argument) { + + Expander::instance()->rehash(); +} + +void Actions::beginChainRecord(Action *caller, const char *argument) { + KERNEL->beginRecording(); +} + +void Actions::endChainRecord(Action *caller, const char *argument) { + KERNEL->endChainRecording(argument); +} + +void Actions::endScriptRecord(Action *caller, const char *argument) { + KERNEL->endScriptRecording(argument); +} + +void Actions::cancelRecord(Action *caller, const char *argument) { + KERNEL->cancelRecording(); +} + +void Actions::banish(Action *caller, const char *argument) { + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + focusedMonitor->banish(); +} + +void Actions::unhookClient(Action *caller, const char *argument) { + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + + focusedMonitor->unhookClient(); +} + +void Actions::hookClient(Action *caller, const char *argument) { + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + + focusedMonitor->hookClient(); +} + +void Actions::toggleSloppyMode(Action *caller, const char *argument) { + KERNEL->toggleSloppyMode(); +} + +void Actions::grabMove(Action *caller, const char *argument) { + KERNEL->grabMove(); +} + +void Actions::zoomClient(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Frame *frame = workspace->focusedFrame(); + + if (frame) { + frame->zoomClient(); + } +} + +void Actions::toggleTiled(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + Frame *frame = workspace->focusedFrame(); + if (frame) { + frame->toggleTiled(); + } +} + +void Actions::destroyFrame(Action *caller, const char *argument) { + Monitor *monitor = KERNEL->focusedMonitor(); + Workspace *workspace = monitor->focused(); + + if (workspace->focusedFrame()) { + workspace->destroyFrame(workspace->focusedFrame()); + } +} diff --git a/actions.h b/actions.h @@ -0,0 +1,170 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: actions.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __ACTIONS_H +#define __ACTIONS_H + +#include "singleton.h" + +#include <map> +#include "wmi.h" + +class Action; + +class Bindings; +class Kernel; +class Monitor; + +typedef map<string, Action *, less<string> > MBindings; + +/** + * Actions singleton class which delegates end-user interface to the + * appropriate business logic of WMI. + */ +class Actions : public Singleton<Actions> +{ + +public: + Actions(); + ~Actions(); + + void initInternActions(MBindings *actionBindings); + + // new macro record stuff + void beginChainRecord(Action *caller, const char *argument); + void endChainRecord(Action *caller, const char *argument); + void endScriptRecord(Action *caller, const char *argument); + void cancelRecord(Action *caller, const char *argument); + + // intern actions + void quit(Action *caller, const char *argument); + void restart(Action *caller, const char *argument); + + void rehash(Action *caller, const char *argument); + + void circulateWindowsUp(Action *caller, const char *argument); + + void toggleClientMode(Action *caller, const char *argument); + void toggleClientSticky(Action *caller, const char *argument); + void executeTerm(Action *caller, const char *command); + + void growLeft(Action *caller, const char *argument); + void growRight(Action *caller, const char *argument); + void growUp(Action *caller, const char *argument); + void growDown(Action *caller, const char *argument); + + void shrinkLeft(Action *caller, const char *argument); + void shrinkRight(Action *caller, const char *argument); + void shrinkUp(Action *caller, const char *argument); + void shrinkDown(Action *caller, const char *argument); + + void moveClientLeft(Action *caller, const char *argument); + void moveClientRight(Action *caller, const char *argument); + void moveClientUp(Action *caller, const char *argument); + void moveClientDown(Action *caller, const char *argument); + + void showBars(Action *caller, const char *argument); + void hideBars(Action *caller, const char *argument); + void toggleBar(Action *caller, const char *argument); + void toggleBorder(Action *caller, const char *argument); + void showBorders(Action *caller, const char *argument); + void hideBorders(Action *caller, const char *argument); + void toggleStatusBar(Action *caller, const char *argument); + void toggleClientBar(Action *caller, const char *argument); + void inputMode(Action *caller, const char *argument); + void toggleMode(Action *caller, const char *argument); + + void killClient(Action *caller, const char *argument); + + void cycleClientNext(Action *caller, const char *argument); + void cycleWorkspaceNext(Action *caller, const char *argument); + void cycleClientPrev(Action *caller, const char *argument); + void cycleWorkspacePrev(Action *caller, const char *argument); + + void joinFrameLeft(Action *caller, const char *argument); + void joinFrameRight(Action *caller, const char *argument); + void joinFrameUp(Action *caller, const char *argument); + void joinFrameDown(Action *caller, const char *argument); + + void sendClientLeft(Action *caller, const char *argument); + void sendClientRight(Action *caller, const char *argument); + void sendClientUp(Action *caller, const char *argument); + void sendClientDown(Action *caller, const char *argument); + + void splitFrameLeft(Action *caller, const char *argument); + void splitFrameRight(Action *caller, const char *argument); + void splitFrameUp(Action *caller, const char *argument); + void splitFrameDown(Action *caller, const char *argument); + + void attachClient(Action *caller, const char *argument); + void attachLastClient(Action *caller, const char *argument); + void detachClient(Action *caller, const char *argument); + void detachAllClients(Action *caller, const char *argument); + void attachAllClients(Action *caller, const char *argument); + + void createAction(Action *caller, const char *argument); + void createWorkspace(Action *caller, const char *argument); + + void destroyAction(Action *caller, const char *argument); + void destroyFrame(Action *caller, const char *argument); + void destroyWorkspace(Action *caller, const char *argument); + + void bindShortcut(Action *caller, const char *argument); + + void renameWorkspace(Action *caller, const char *argument); + void selectWorkspace(Action *caller, const char *argument); + void selectMonitor(Action *caller, const char *argument); + void selectClient(Action *caller, const char *argument); + void selectClientId(Action *caller, const char *argument); + + void selectFrameLeft(Action *caller, const char *argument); + void selectFrameRight(Action *caller, const char *argument); + void selectFrameUp(Action *caller, const char *argument); + void selectFrameDown(Action *caller, const char *argument); + + void swapFrameLeft(Action *caller, const char *argument); + void swapFrameRight(Action *caller, const char *argument); + void swapFrameUp(Action *caller, const char *argument); + void swapFrameDown(Action *caller, const char *argument); + + void swapClientLeft(Action *caller, const char *argument); + void swapClientRight(Action *caller, const char *argument); + void swapClientUp(Action *caller, const char *argument); + void swapClientDown(Action *caller, const char *argument); + +#ifdef SLOT_SUPPORT + void unslotClient(Action *caller, const char *argument); + void slotClient(Action *caller, const char *argument); + void toggleSlot(Action *caller, const char *argument); + void cycleSlotTabPrev(Action *caller, const char *argument); + void cycleSlotTabNext(Action *caller, const char *argument); + void killSlotClient(Action *caller, const char *argument); +#endif // SLOT_SUPPORT + + void toggleMaximization(Action *caller, const char *argument); + void toggleShortcuts(Action *caller, const char *argument); + + void lower(Action *caller, const char *argument); + void raise(Action *caller, const char *argument); + void saveSettings(Action *caller, const char *argument); + + // extern actions only use execute + void execute(Action *caller, const char *command); + + // map sequences only use sequences + void sequence(Action *caller, const char *command); + + void hookClient(Action *caller, const char *argument); + void unhookClient(Action *caller, const char *argument); + void fitClient(Action *caller, const char *argument); + void banish(Action *caller, const char *argument); + void toggleClientBarMode(Action *caller, const char *argument); + void toggleSloppyMode(Action *caller, const char *argument); + void grabMove(Action *caller, const char *argument); + void toggleTiled(Action *caller, const char *argument); + void zoomClient(Action *caller, const char *argument); +}; + +#endif // __ACTIONS_H diff --git a/atoms.cpp b/atoms.cpp @@ -0,0 +1,80 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: atoms.cpp 734 2004-09-27 18:15:45Z garbeam $ + +extern "C" { +#include "X11/Xatom.h" +} +#include <sstream> + +#include "atoms.h" + +#include "logger.h" +#include "kernel.h" +#include "wmi.h" +#include "xcore.h" + +Atom Atoms::WM_STATE = 0; +Atom Atoms::WM_CHANGE_STATE = 0; +Atom Atoms::WM_PROTOCOLS = 0; +Atom Atoms::WM_DELETE = 0; +Atom Atoms::WM_TAKE_FOCUS = 0; +Atom Atoms::WM_COLORMAPS = 0; + +Atom Atoms::MWM_HINTS = 0; + +Atom Atoms::NET_WM_DESKTOP = 0; + +Atom Atoms::WMI_ACTIONCMD = 0; +Atom Atoms::WMI_STATUSTEXT = 0; +Atom Atoms::WMI_METERTEXT = 0; +Atom Atoms::WMI_PRETTYPRINT_REQUEST = 0; +Atom Atoms::WMI_PRETTYPRINT_RESPONSE = 0; + +bool Atoms::initialized_ = false; + +void Atoms::initAtoms() +{ + if (initialized_) { + return; + } + + ostringstream oss; + + // ICCCM + WM_STATE = XCORE->internAtom("WM_STATE"); + oss << "WM_STATE: " << WM_STATE << endl; + WM_CHANGE_STATE = XCORE->internAtom("WM_CHANGE_STATE"); + oss << "WM_CHANGE_STATE: " << WM_CHANGE_STATE << endl; + WM_PROTOCOLS = XCORE->internAtom("WM_PROTOCOLS"); + oss << "WM_PROTOCOLS: " << WM_PROTOCOLS << endl; + WM_DELETE = XCORE->internAtom("WM_DELETE_WINDOW"); + oss << "WM_DELETE_WINDOW: " << WM_DELETE << endl; + WM_TAKE_FOCUS = XCORE->internAtom("WM_TAKE_FOCUS"); + oss << "WM_TAKE_FOCUS: " << WM_TAKE_FOCUS << endl; + WM_COLORMAPS = XCORE->internAtom("WM_COLORMAP_WINDOWS"); + oss << "WM_COLORMAP_WINDOWS: " << WM_COLORMAPS << endl; + oss << "XA_WM_ICON_NAME: " << XA_WM_ICON_NAME << endl; + oss << "XA_WM_NAME: " << XA_WM_NAME << endl; + oss << "XA_WM_TRANSIENT_FOR: " << XA_WM_TRANSIENT_FOR; + + LOGDEBUG(oss.str()); + + // MOTIF + MWM_HINTS = XCORE->internAtom("_MOTIF_WM_HINTS"); + + // NETWM + NET_WM_DESKTOP = XCORE->internAtom("_NET_WM_DESKTOP"); + + // WMI + WMI_ACTIONCMD = XCORE->internAtom("_WMI_ACTIONCMD"); + WMI_STATUSTEXT = XCORE->internAtom("_WMI_STATUSTEXT"); + WMI_METERTEXT = XCORE->internAtom("_WMI_METERTEXT"); + WMI_PRETTYPRINT_REQUEST = + XCORE->internAtom("_WMI_PRETTYPRINT_REQUEST"); + WMI_PRETTYPRINT_RESPONSE = + XCORE->internAtom("_WMI_PRETTYPRINT_RESPONSE"); + + initialized_ = true; +} diff --git a/atoms.h b/atoms.h @@ -0,0 +1,50 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: atoms.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __ATOMS_H +#define __ATOMS_H + +extern "C" { +#include "X11/Xlib.h" +} + +/** + * Container of all necessary X atoms used by WMI. + */ +class Atoms +{ + +public: + + /** Inits all atoms. */ + static void initAtoms(); + + /** ICCCM atoms */ + static Atom WM_STATE; + static Atom WM_CHANGE_STATE; + static Atom WM_PROTOCOLS; + static Atom WM_DELETE; + static Atom WM_TAKE_FOCUS; + static Atom WM_COLORMAPS; + + /** MOTIF atoms */ + static Atom MWM_HINTS; + + /** NETWM atoms */ + static Atom NET_WM_DESKTOP; + + /** wmi atoms */ + static Atom WMI_ACTIONCMD; + static Atom WMI_METERTEXT; + static Atom WMI_STATUSTEXT; + static Atom WMI_PRETTYPRINT_REQUEST; + static Atom WMI_PRETTYPRINT_RESPONSE; + +private: + + static bool initialized_; +}; + +#endif // __ATOMS_H diff --git a/bar.cpp b/bar.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: bar.cpp 734 2004-09-27 18:15:45Z garbeam $ + +#include "bar.h" + +#include <map> + +#include "draw.h" +#include "kernel.h" +#include "label.h" +#include "monitor.h" +#include "theme.h" +#include "util.h" +#include "xcore.h" + +Bar::Bar(Monitor *monitor, Rectangle *rect) : + Widget(monitor, rect) +{ + theme_ = this->monitor()->theme(); + isButtonVisible_ = (Util::get(KERNEL->commonSettings(), ("bar.buttons")) + == "yes"); + borderRect_ = Rectangle(0, 0, width(), height()); + + label_ = new Label(this->monitor(), window(), Label::CENTER, gc()); + label_->setX(1); + label_->setY(1); + label_->setWidth(width() - 2); + label_->setHeight(height() - 2); +} + +Bar::~Bar() { + delete label_; +} + + +void Bar::drawBorder() { + + Draw::drawRectBorder(window(), gc(), &borderRect_, + theme_->BAR_SHINE, theme_->BAR_SHADOW); + + XCORE->sync(); +} diff --git a/bar.h b/bar.h @@ -0,0 +1,47 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: bar.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __BAR_H +#define __BAR_H + +extern "C" { +#include <X11/Xlib.h> +} + +#include "widget.h" + +class Label; +class Monitor; +class Theme; + +/** Base class for status and client bars. */ +class Bar : public Widget { + +public: + + Bar(Monitor *monitor, Rectangle *rect); + virtual ~Bar(); + + virtual void illuminate() = 0; + + virtual void handleButtonPress(XButtonEvent *event) = 0; + virtual void handleButtonRelease(XButtonEvent *event) = 0; + virtual void handleMotionNotify(XMotionEvent *event) = 0; + +protected: + + Label *label_; + Theme *theme_; + + /** Draws border. */ + void drawBorder(); + bool isButtonVisible_; + +private: + + Rectangle borderRect_; +}; + +#endif // __BAR_H diff --git a/binder.cpp b/binder.cpp @@ -0,0 +1,742 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// Copyright (c) 2003 - 2004 Marcel Manthe <schneegloeckchen at gmx.li> +// See ../LICENSE.txt for license details. +// +// $Id: binder.cpp 734 2004-09-27 18:15:45Z garbeam $ + +extern "C" { +#include <assert.h> +} + +#include <sstream> +#include <string> +#include "wmi.h" + +#include "binder.h" + +#include "action.h" +#include "box.h" +#include "client.h" +#include "container.h" +#include "cursors.h" +#include "expander.h" +#include "frame.h" +#include "inputbar.h" +#include "kernel.h" +#include "logger.h" +#include "monitor.h" +#include "shortcut.h" +#include "thing.h" +#include "util.h" +#include "workspace.h" +#include "xcore.h" + + +Binder::Binder() { + actionBindings_ = KERNEL->actionBindings(); + initLockModifiers(); +#ifdef POSIX_REGEX + temp_pattern_="uninitalized"; + regex_prepare(); +#endif +} + +Binder::~Binder() { +} + +void Binder::grabShortcut(Shortcut *shortcut, Window window) { + + // update keysym definitions of the action + if (shortcut->button()) { + XCORE->grabButton(window, shortcut->modMask(), + shortcut->button()); + + if (shortcut->modMask() == AnyModifier) { + return; + } + if (numLockMask_) { + XCORE->grabButton(window, shortcut->modMask() | numLockMask_, + shortcut->button()); + XCORE->grabButton(window, shortcut->modMask() | numLockMask_ + | LockMask, shortcut->button()); + } + if (scrollLockMask_) { + XCORE->grabButton(window, shortcut->modMask() | scrollLockMask_, + shortcut->button()); + XCORE->grabButton(window, shortcut->modMask() | scrollLockMask_ + | LockMask, shortcut->button()); + } + if (numLockMask_ && scrollLockMask_) { + XCORE->grabButton(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_, shortcut->button()); + XCORE->grabButton(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_ | LockMask, shortcut->button()); + } + } + else if (shortcut->keyCode()) { + XCORE->grabKey(window, shortcut->modMask(), + shortcut->keyCode()); + + if (shortcut->modMask() == AnyModifier) { + return; + } + if (numLockMask_) { + XCORE->grabKey(window, shortcut->modMask() | numLockMask_, + shortcut->keyCode()); + XCORE->grabKey(window, shortcut->modMask() | numLockMask_ + | LockMask, shortcut->keyCode()); + } + if (scrollLockMask_) { + XCORE->grabKey(window, shortcut->modMask() | scrollLockMask_, + shortcut->keyCode()); + XCORE->grabKey(window, shortcut->modMask() | scrollLockMask_ + | LockMask, shortcut->keyCode()); + } + if (numLockMask_ && scrollLockMask_) { + XCORE->grabKey(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_, shortcut->keyCode()); + XCORE->grabKey(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_ | LockMask, shortcut->keyCode()); + } + } +} + +void Binder::ungrabShortcut(Shortcut *shortcut, Window window) { + + if (shortcut->button()) { + XCORE->ungrabButton(window, shortcut->modMask(), shortcut->button()); + + if (shortcut->modMask() == AnyModifier) { + return; + } + if (numLockMask_) { + XCORE->ungrabButton(window, shortcut->modMask() | numLockMask_, + shortcut->button()); + XCORE->ungrabButton(window, shortcut->modMask() | numLockMask_ + | LockMask, shortcut->button()); + } + if (scrollLockMask_) { + XCORE->ungrabButton(window, shortcut->modMask() | scrollLockMask_, + shortcut->button()); + XCORE->ungrabButton(window, shortcut->modMask() | scrollLockMask_ + | LockMask, shortcut->button()); + } + if (numLockMask_ && scrollLockMask_) { + XCORE->ungrabButton(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_, shortcut->button()); + XCORE->ungrabButton(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_ | LockMask, shortcut->button()); + } + } + else { + XCORE->ungrabKey(window, shortcut->modMask(), + shortcut->keyCode()); + + if (shortcut->modMask() == AnyModifier) { + return; + } + if (numLockMask_) { + XCORE->ungrabKey(window, shortcut->modMask() | numLockMask_, + shortcut->keyCode()); + XCORE->ungrabKey(window, shortcut->modMask() | numLockMask_ + | LockMask, shortcut->keyCode()); + } + if (scrollLockMask_) { + XCORE->ungrabKey(window, shortcut->modMask() | scrollLockMask_, + shortcut->keyCode()); + XCORE->ungrabKey(window, shortcut->modMask() | scrollLockMask_ + | LockMask, shortcut->keyCode()); + } + if (numLockMask_ && scrollLockMask_) { + XCORE->ungrabKey(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_, shortcut->keyCode()); + XCORE->ungrabKey(window, shortcut->modMask() | numLockMask_ + | scrollLockMask_ | LockMask, shortcut->keyCode()); + } + } +} + +void Binder::initKeys(Window window) { + + for (MBindings::iterator it = actionBindings_->begin(); + it != actionBindings_->end(); it++) + { + Action *action = (*it).second; + LOGDEBUG("initKeys: " + action->id()); + if (action->listenOn()) { + grabShortcut(action->listenOn(), window); + } + } +} + +string Binder::prettyPrintKeyBindings() { + + ostringstream oss; + for (MBindings::iterator it = actionBindings_->begin(); + it != actionBindings_->end(); it++) + { + Action *action = (*it).second; + Shortcut *shortcut = action->shortcut(); + Shortcut *tmp = action->shortcut(); + if (shortcut) { + oss.width(35); + oss.fill(' '); + oss << action->id() << " = "; + } + while (tmp) { + oss.width(0); + if (tmp->button()) { + oss << Util::stringForModMask(tmp->modMask()) + << Util::stringForButton(tmp->button()); + } + else { + oss << Util::stringForModMask(tmp->modMask()) + << XCORE->keyCodeToString(tmp->keyCode()); + } + tmp = tmp->next(); + if (tmp) { + oss << " :: "; + } + } + if (shortcut) { + oss << "\n"; + } + } + + string result = oss.str(); + if (result == "") { + result = "no key bindings defined\n"; + } + return result; +} + +void Binder::handleButton(Window window, XButtonEvent *event) +{ + LOGDEBUG("handle button press event"); + handleShortcut(window, event->state, 0, event->button); +} + +void Binder::handleShortcut(Window window, unsigned long modMask, + KeyCode keyCode, unsigned int button) +{ + LOGDEBUG("handle shortcut event"); + LAction grabbedActions; + // only gets in here for the first part of a shortcut, thus + // create a list of all shortcuts which are listened for + for (MBindings::iterator it = actionBindings_->begin(); + it != actionBindings_->end(); it++) + { + Action *action = (*it).second; + Shortcut *shortcut = action->listenOn(); + + if (shortcut && + (modMask == shortcut->modMask()) && + (keyCode == shortcut->keyCode()) && + (button == shortcut->button())) + { + if (shortcut->next()) { + action->setListenOn(shortcut->next()); + grabbedActions.push_back(action); + } + else { + grabbedActions.clear(); + LOGDEBUG("handle shortcut performs action '" + + action->id() + "'"); + if (action->promptsCount() > 0) { + KERNEL->focusedMonitor()->inputBar()->runArgument(action); + // action will be performed by argument processing + } + else { + action->perform(); + } + break; + } + } + } + if (grabbedActions.size()) { + Shortcut shortcut(modMask, keyCode, 0, button); + // now the magic occurs + handleShortcutChains(window, &shortcut, &grabbedActions); + } + // reset listen on info + for (MBindings::iterator it = actionBindings_->begin(); + it != actionBindings_->end(); it++) + { + Action *action = (*it).second; + if (action->shortcut()) { + // already grabbed + action->setListenOn(action->shortcut()); + } + } +} + +void Binder::handleShortcutChains(Window window, Shortcut *prefix, + LAction *grabbedActions) +{ + string sequence = + " " + Util::stringForModMask(prefix->modMask()) + + XCORE->keyCodeToString(prefix->keyCode()) + " ::"; + Box *box = KERNEL->focusedMonitor()->box(); + box->setText(sequence); + box->show(); + box->illuminate(); + + XCORE->grabKeyboard(window); + + bool isDoubleShortcut = false; + unsigned long modMask; + KeyCode keyCode; + Action *action = 0; + while (grabbedActions->size()) { + // fetch new key stroke + nextKeystroke(&modMask, &keyCode); + + if ((prefix->modMask() == modMask) && + (prefix->keyCode() == keyCode)) + { + isDoubleShortcut = true; + break; + } + prefix->setModMask(modMask); + prefix->setKeyCode(keyCode); + sequence += " " + Util::stringForModMask(modMask) + + XCORE->keyCodeToString(keyCode) + " ::"; + box->setText(sequence); + box->illuminate(); + for (LAction::iterator it = grabbedActions->begin(); + it != grabbedActions->end(); ) + { + action = *it; + Shortcut *shortcut = action->listenOn(); + if (shortcut && + (modMask == shortcut->modMask()) && + (keyCode == shortcut->keyCode())) + { + // iterates next + it++; + if (shortcut->next()) { + action->setListenOn(shortcut->next()); + } + else { + grabbedActions->clear(); // escape condition + break; + } + } + else { + // iterates next + it = grabbedActions->erase(it); + } + action = 0; + } + } + XCORE->ungrabKeyboard(); + box->hide(); + if (action) { + + LOGDEBUG("handle shortcut performs action '" + + action->id() + "'"); + if (action->promptsCount() > 0) { + KERNEL->focusedMonitor()->inputBar()->runArgument(action); + // action will be performed by argument processing + } + else { + action->perform(); + } + } + else if (isDoubleShortcut) { + emulateKeyPress(modMask, keyCode); + } +} + +void Binder::emulateKeyPress(unsigned long modMask, KeyCode keyCode) { + + Monitor *monitor = KERNEL->focusedMonitor(); + Client *client = monitor->focused()->topClient(); + + if (client) { + XEvent event; + event.xkey.type = KeyPress; + event.xkey.time = CurrentTime; + event.xkey.window = client->clientWindow(); + event.xkey.display = KERNEL->display(); + event.xkey.state = modMask; + event.xkey.keycode = keyCode; + XCORE->sendEvent(client->clientWindow(), KeyPressMask, &event); + event.xkey.type = KeyRelease; + XCORE->sendEvent(client->clientWindow(), KeyReleaseMask, &event); + XCORE->sync(); + } +} + +void Binder::nextKeystroke(unsigned long *modMask, KeyCode *keyCode) { + XEvent event; + KeySym sym; + *modMask = 0; + do { + XCORE->maskEvent(KeyPressMask, &event); + *modMask |= event.xkey.state & validModMask_; + *keyCode = event.xkey.keycode; + sym = XCORE->keyCodeToKeySym(event.xkey.keycode); + } while (IsModifierKey(sym)); +} + +void Binder::handleKey(Window window, XKeyEvent *event) +{ + LOGDEBUG("handle key press event"); + handleShortcut(window, event->state, event->keycode, 0); +} + +void Binder::grabButtons(Window window, unsigned long modMask) +{ + XCORE->grabButton(window, modMask, AnyModifier); +} + +void Binder::ungrabButtons(Window window) { + XCORE->ungrabButton(window, AnyModifier, AnyButton); +} + +#ifdef POSIX_REGEX +bool Binder::regex_first_match(const string& pattern, const string& haystack, int& begin, int& end){ + regmatch_t temp_regmatch; + + begin = 0; + end = -1 ; + bool condition = false; + if (pattern == temp_pattern_ && pattern!="") { condition = true; } else + { + condition = (regcomp(&temp_regex_, pattern.c_str(), REG_EXTENDED)==0); + if (!condition) regex_prepare(); //reinitialize + } + if (condition){ + bool result = (regexec(&temp_regex_, haystack.c_str(), 1, &temp_regmatch, 0)==0); + if (result){ + begin = temp_regmatch.rm_so; + end = temp_regmatch.rm_eo; + } + temp_pattern_ = pattern; + return result; + } + return false; +} + +bool Binder::regex_match(const string& pattern, const string& haystack){ + int begin; + int end; + return(regex_first_match(pattern, haystack, begin, end)); +} +#endif + + +string Binder::absolutePattern(string pattern, Sstring *names, + unsigned int offset) +{ + + string result = pattern; +if (!(names->empty())) { + +#ifdef POSIX_REGEX + if (doRegex_) { + + /* Check whether the search-pattern contains a modifier. + If it does, simply return the pattern itself, otherwise, + perform an infix-matching-algorithm. */ + + string first = *names->begin(); + for (int direction = 0; direction <= 1; direction++){ + bool matches_all = true; + do { + LOGDEBUG("Entering do-while-infix-matching-loop"); + int begin; + int end; + + if (regex_first_match (result, first, begin, end)){ + LOGDEBUG("pattern-rule matched first member"); + int count = end - begin + 1; + if (direction == 1) begin--; + if ((begin + count <= (int)first.length()) && (begin >= 0) && (count>0)){ + pattern=first.substr(begin, count); + LOGDEBUG("trying to add a char to pattern"); + LOGDEBUG(pattern); + } else break; + } + + for (Sstring::iterator it = names->begin(); it != names->end(); it++) + if(!regex_match(pattern, (*it))) matches_all = false; + if (matches_all) result = pattern; + } while (matches_all); + } + return(result); + } +#endif + + string firstName = *names->begin(); + string lastName = *names->rbegin(); + + unsigned int firstLength = firstName.length(); + unsigned int lastLength = lastName.length(); + for (unsigned int i = offset; + (i < firstLength) && (i < lastLength); i++) + { + if (firstName[i] == lastName[i]) { + result += firstName[i]; + } + else { + break; + } + } + } + + return result; // return absolute pattern +} + +void Binder::matchPattern(string digest, string pattern, Sstring *strings, + unsigned int patternLength) +{ + bool condition; + condition = (digest.substr(0, patternLength) == pattern); + +#ifdef POSIX_REGEX + if (doRegex_) { + condition = regex_match(pattern, digest); + } +#endif + + if (condition) { + strings->insert(digest); + } +} + +void Binder::initRegex(string pattern){ +#ifdef POSIX_REGEX + doRegex_ = Util::get(KERNEL->commonSettings(), "autocompletion.mode") == "regex"; +#endif +} + +string Binder::queryFramesForPattern(string pattern, Sstring *sFrames) +{ + + Workspace *workspace = KERNEL->focusedMonitor()->focused(); + CFrame *frames = workspace->frames(); + unsigned int patternLength = pattern.length(); + string lName; + initRegex(pattern); + for (LFrame::iterator it = frames->begin(); it != frames->end(); it++) { + Frame *frame = *it; + matchPattern(frame->name(), pattern, + sFrames, patternLength); + } + return absolutePattern(pattern, sFrames, patternLength); +} + +string Binder::queryClientIdsForPattern(string pattern, Sstring *clients) +{ + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + MClient *clientMap = focusedMonitor->clients(); + unsigned int patternLength = pattern.length(); + initRegex(pattern); + for (MClient::iterator it = clientMap->begin(); + it != clientMap->end(); it++) + { + Client *client = (*it).second; + if (client->attached() +#ifdef SLOT_SUPPORT + || client->mode() == Client::SLOT +#endif // SLOT_SUPPORT + ) + { + matchPattern(client->id(), pattern, clients, patternLength); + } + } + return absolutePattern(pattern, clients, pattern.length()); +} + +string Binder::queryClientsForPattern(string pattern, Sstring *clients) +{ + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + MClient *clientMap = focusedMonitor->clients(); + unsigned int patternLength = pattern.length(); + initRegex(pattern); + for (MClient::iterator it = clientMap->begin(); + it != clientMap->end(); it++) + { + Client *client = (*it).second; + if (client->attached() +#ifdef SLOT_SUPPORT + || client->mode() == Client::SLOT +#endif + ) + { + matchPattern(client->name(), pattern, clients, patternLength); + } + } + return absolutePattern(pattern, clients, pattern.length()); +} + +string Binder::queryDetachedClientsForPattern(string pattern, Sstring *clients) +{ + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + CClient *detachedClients = focusedMonitor->detachedClients(); + unsigned int patternLength = pattern.length(); + initRegex(pattern); + for (LClient::iterator it = detachedClients->begin(); + it != detachedClients->end(); it++) + { + Client *client = *it; + matchPattern(client->name(), pattern, clients, patternLength); + } + return absolutePattern(pattern, clients, pattern.length()); +} + +string Binder::queryMonitorsForPattern(string pattern, Sstring *monitors) { + + CMonitor *ms = KERNEL->monitors(); + unsigned int patternLength = pattern.length(); + initRegex(pattern); + for (LMonitor::iterator it = ms->begin(); it != ms->end(); it++) { + matchPattern((*it)->displayString(), pattern, monitors, patternLength); + } + + return absolutePattern(pattern, monitors, patternLength); +} + +string Binder::queryWorkspacesForPattern(string pattern, + Sstring *workspaces) +{ + + Monitor *focusedMonitor = KERNEL->focusedMonitor(); + unsigned int patternLength = pattern.length(); + string wsName; + initRegex(pattern); + for (LWorkspace::iterator it = focusedMonitor->begin(); + it != focusedMonitor->end(); it++) + { + matchPattern((*it)->name(), pattern, workspaces, patternLength); + } + + return absolutePattern(pattern, workspaces, patternLength); +} + +string Binder::queryExternChainActionsForPattern( + string pattern, Sstring *actionKeys) +{ + unsigned int patternLength = pattern.length(); + string actionKey; + Action *action; + initRegex(pattern); + for (MBindings::iterator it = actionBindings_->begin(); + it != actionBindings_->end(); it++) + { + actionKey = (*it).first; + action = (*it).second; + if (action->type() == Action::INTERN) { + continue; + } + matchPattern(actionKey, pattern, actionKeys, patternLength); + } + + return absolutePattern(pattern, actionKeys, patternLength); +} + +string Binder::queryActionKeysWithoutValidationForPattern( + string pattern, Sstring *actionKeys) +{ + unsigned int patternLength = pattern.length(); + string actionKey; + initRegex(pattern); + for (MBindings::iterator it = actionBindings_->begin(); + it != actionBindings_->end(); it++) + { + actionKey = (*it).first; + matchPattern(actionKey, pattern, actionKeys, patternLength); + } + + return absolutePattern(pattern, actionKeys, patternLength); +} + +string Binder::queryActionKeysForPattern(string pattern, Sstring *actionKeys) { + + unsigned int patternLength = pattern.length(); + string actionKey; + initRegex(pattern); + for (MBindings::iterator it = actionBindings_->begin(); + it != actionBindings_->end(); it++) + { + Action *action = (*it).second; + + if (action->isValid()) { + actionKey = (*it).first; + matchPattern(actionKey, pattern, actionKeys, patternLength); + } + } + + return absolutePattern(pattern, actionKeys, patternLength); +} + +string Binder::queryCommandForPattern(string pattern, Sstring *expands) { + + Expander::instance()->queryString(pattern); + Sstring exp = Expander::instance()->expands(); + initRegex(pattern); + + + unsigned int offset = pattern.find_last_of('/'); + if (offset == string::npos) offset=0; else offset++; + +#ifdef POSIX_REGEX + doRegex_ = doRegex_ && (offset == 0); +#endif + + for (Sstring::iterator it = exp.begin(); + it != exp.end(); it++) + { + matchPattern((string)(*it), pattern.substr(offset), expands, pattern.length()-offset); + } + + return absolutePattern(pattern, expands, pattern.length() - + pattern.find_last_of('/') - 1); +} + +#define NUM_MASKS 8 + +void Binder::initLockModifiers() { + XModifierKeymap *modmap; + KeyCode numLock, scrollLock; + + // preinit + numLockMask_ = scrollLockMask_ = 0; + + // init modifier map + modmap = XCORE->modifierMapping(); + + // modifier masks we know + static int masks[NUM_MASKS] = { + ShiftMask, LockMask, ControlMask, Mod1Mask, + Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask + }; + + // temporary keysyms of evil keys + numLock = XCORE->stringToKeyCode("Num_Lock"); + scrollLock = XCORE->stringToKeyCode("Scroll_Lock"); + + if (modmap && modmap->max_keypermod > 0) { + unsigned int max = NUM_MASKS * modmap->max_keypermod; + for (unsigned int i = 0; i < max; i++) { + if (numLock && (modmap->modifiermap[i] == numLock)) { + numLockMask_ = masks[i / modmap->max_keypermod]; + } + else if (scrollLock && (modmap->modifiermap[i] == scrollLock)) { + scrollLockMask_ = masks[i / modmap->max_keypermod]; + } + } + } + + XCORE->freeModifierMapping(modmap); + validModMask_ = 255 & ~(numLockMask_ | scrollLockMask_ | LockMask); +} + +unsigned int Binder::validModMask() const { + return validModMask_; +} diff --git a/binder.h b/binder.h @@ -0,0 +1,233 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// Copyright (c) 2003 - 2004 Marcel Manthe <schneegloeckchen at gmx.li> +// See ../LICENSE.txt for license details. +// +// $Id: binder.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __BINDER_H +#define __BINDER_H + +#include "singleton.h" + +extern "C" { +#include <X11/Xlib.h> +} + +#include <list> +#include <map> +#include <set> + +#ifdef POSIX_REGEX +#include <stack> +#include "logger.h" +#include <regex.h> +#endif + +#include <string> +#include "wmi.h" + +// forward declaration +class Action; +class Binder; +class Group; +class Kernel; +class Shortcut; + +typedef set<string> Sstring; +typedef map<string, Action *, less<string> > MBindings; +typedef list<Action *> LAction; + +/** + * Main class of all key- and button-grabbing related logic. + */ +class Binder : public Singleton<Binder> +{ + +public: + + /** Constructs a new grab manager instance. */ + Binder(); + + ~Binder(); + + /** Key initialization for a specific window. */ + void initKeys(Window window); + + /** Key event handler, window is for grabbing. */ + void handleKey(Window window, XKeyEvent *e); + + /** Button event handler, window is for grabbing. */ + void handleButton(Window window, XButtonEvent *e); + + /** Grabs the shortcut. */ + void grabShortcut(Shortcut *shortcut, Window window); + + /** Ungrabs shortcut. */ + void ungrabShortcut(Shortcut *shortcut, Window window); + + /** Grabs all buttons for the modMask of the specific window. */ + void grabButtons(Window window, unsigned long modMask); + + /** Ungrabs all buttons for the specific window. */ + void ungrabButtons(Window window); + + /** Returns pretty print of current key configuration. */ + string prettyPrintKeyBindings(); + + /** + * Queries all actions for the given pattern. + * Returns absolute equal pattern of <i>all</i> entries. + * @param pattern contains the pattern. + * @param set where to put matching action keys. + */ + string queryActionKeysForPattern(string pattern, Sstring *actionKeys); + + /** Similiar to previous, except actions aren't validated. */ + string queryActionKeysWithoutValidationForPattern(string pattern, + Sstring *actionKeys); + + + /** Similiar to previous, except that internal actions are ignored. */ + string queryExternChainActionsForPattern( + string pattern, Sstring *actionKeys); + + /** + * Queries all executables for the given pattern. + * Returns absolute equal pattern of <i>all</i> executables. + * @param pattern contains the pattern. + * @param set where to put matching executables. + */ + string queryCommandForPattern(string pattern, Sstring *expands); + + /** + * Queries all workspace names of the focused monitor. + * Returns absolute equal pattern of <i>all</i> workspaces. + * @param pattern contains the pattern. + * @param set where to put matching names. + */ + string queryWorkspacesForPattern(string pattern, Sstring *workspaces); + + /** + * Queries all monitor names. + * Returns absolute equal pattern of <i>all</i> monitors. + * @param pattern contains the pattern. + * @param set where to put matching names. + */ + string queryMonitorsForPattern(string pattern, Sstring *monitors); + + /** + * Queries all client names of the focused monitor. + * Returns absolute equal pattern of <i>all</i> clients. + * @param pattern contains the pattern. + * @param set where to put matching names. + */ + string queryClientsForPattern(string pattern, Sstring *clients); + + /** + * Queries all detached client names of the focused monitor. + * Returns absolute equal pattern of <i>all</i> clients. + * @param pattern contains the pattern. + * @param set where to put matching names. + */ + string queryDetachedClientsForPattern(string pattern, Sstring *clients); + + /** Same as above, except instead of client names, client ids. */ + string queryClientIdsForPattern(string pattern, Sstring *clients); + + /** + * Queries all frame names of the focused workspace. + * Returns absolute equal pattern of <i>all</i> frame ids. + * @param pattern contains the pattern. + * @param set where to put matching names. + */ + string queryFramesForPattern(string pattern, Sstring *sFrames); + + unsigned int validModMask() const; + +#ifdef POSIX_REGEX + string popRegexPattern(){ + string result; + if (!regexPattern_.empty()) regexPattern_.pop(); + if (regexPattern_.empty()){ + result = ""; + }else{ + result = regexPattern_.top(); + } + + return result; + } + + void pushRegexPattern(string pattern){ + regexPattern_.push(pattern); + + stack<string> temp = regexPattern_; + string res; + while (!temp.empty()){ + res= res + temp.top() + " --- " ; + temp.pop(); + } + LOGDEBUG("STACK: " + res); + + } + void clearRegexPattern(){ + while (!regexPattern_.empty()) regexPattern_.pop(); + } +#endif + +private: + + /** Helper handler for handleKey and handleButton action. */ + void handleShortcut(Window window, unsigned long modMask, + KeyCode keyCode, unsigned int button); + + /** Own key press processing shortcut handler (for postfixed + shortcuts). */ + void handleShortcutChains(Window window, Shortcut *prefix, + LAction *grabbedActions); + /** Helper for handleShortcutChains. Keyboard should be grabbed. */ + void nextKeystroke(unsigned long *modMask, KeyCode *keyCode); + + /** Emulates key press for client. */ + void emulateKeyPress(unsigned long modMask, KeyCode keyCode); + + /** Inits lock modifier detection (NumLock and ScrollLock). */ + void initLockModifiers(); + + /** + * Returns absolute pattern of the given set, at least pattern. + * @param offset begin of comparisions within set. + */ + string absolutePattern(string pattern, Sstring *names, unsigned int offset); + + /** + * Matches the pattern. + * @param digest the string to check match. + * @param pattern the pattern to match. + * @param strings the container set to insert matched strings. + * @param patternLength the pattern length. + */ + void matchPattern(string digest, string pattern, Sstring *strings, + unsigned int patternLength); + + void initRegex(string); + +#ifdef POSIX_REGEX + bool regex_first_match(const string& pattern, const string& haystack, + int& begin, int& end); + bool regex_match(const string& pattern, const string& haystack); + void regex_prepare(){regcomp(&temp_regex_, "", REG_EXTENDED); temp_pattern_="";} + string temp_pattern_; + regex_t temp_regex_; + bool doRegex_; + stack<string> regexPattern_; +#endif + + + MBindings *actionBindings_; + + unsigned int numLockMask_; + unsigned int scrollLockMask_; + unsigned int validModMask_; +}; + +#endif // __BINDER_H diff --git a/box.cpp b/box.cpp @@ -0,0 +1,50 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: box.cpp 734 2004-09-27 18:15:45Z garbeam $ + +#include "box.h" + +#include "draw.h" +#include "label.h" +#include "monitor.h" +#include "theme.h" +#include "xcore.h" + +Box::Box(Monitor *monitor, Rectangle *rect, string text) : + Widget(monitor, rect) +{ + theme_ = this->monitor()->theme(); + label_ = new Label(this->monitor(), window(), Label::CENTER, gc()); + label_->setX(1); + label_->setY(1); + label_->setHeight(height() - 2); + setText(text); +} + +Box::~Box() { + delete label_; +} + +void Box::setText(string text) { + label_->setText(text); + label_->adjustWidth(); + setX(monitor()->width() / 2 - label_->width() / 2 - 1); + setWidth(label_->width() + 2); + resize(); +} + +void Box::illuminate() { + if (!isVisible()) { + return; + } + Rectangle borderRect(0, 0, width(), height()); + label_->update(theme_->TAB_BACKGROUND_ACTIVE_FOCUSSED, + theme_->TAB_TEXT_ACTIVE_FOCUSSED, + theme_->TAB_SHINE_ACTIVE_FOCUSSED, + theme_->TAB_SHADOW_ACTIVE_FOCUSSED, + true, true); + Draw::drawRectBorder(window(), gc(), &borderRect, + theme_->BAR_SHINE, theme_->BAR_SHADOW); + XCORE->sync(); +} diff --git a/box.h b/box.h @@ -0,0 +1,39 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: box.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __BOX_H +#define __BOX_H + +extern "C" { +#include <X11/Xlib.h> +} + +#include <string> + +#include "widget.h" +#include "wmi.h" + +class Label; +class Monitor; +class Theme; + +/** Basic info box. */ +class Box : public Widget { + +public: + + Box(Monitor *monitor, Rectangle *rect, string text); + ~Box(); + + void setText(string text); + void illuminate(); + +private: + + Label *label_; + Theme *theme_; +}; + +#endif // __BOX_H diff --git a/client.cpp b/client.cpp @@ -0,0 +1,884 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: client.cpp 734 2004-09-27 18:15:45Z garbeam $ + +#include <sstream> + +extern "C" { +#include <assert.h> +#include <X11/Xatom.h> +} + +#include "client.h" + +#include "atoms.h" +#include "binder.h" +#include "cursors.h" +#include "draw.h" +#include "clientbar.h" +#include "frame.h" +#include "kernel.h" +#include "label.h" +#include "logger.h" +#include "rectangle.h" +#include "statusbar.h" +#include "monitor.h" +#include "util.h" +#include "slot.h" +#include "theme.h" +#include "workspace.h" +#include "xcore.h" + +Client::Client(Monitor *monitor, Window window, XWindowAttributes *attr) + : Thing(monitor, new Rectangle(), Thing::CLIENT) +{ + clientWindow_ = window; + frame_ = 0; + state_ = WithdrawnState; + iconName_ = ""; + isCentered_ = false; + protocols_ = 0; + hasFrame_ = false; + requestsFocus_ = false; + isDestroyed_ = false; + hooked_ = ""; + workspace_ = 0; + + ostringstream oss; + oss << "<" << monitor->nextClientId() << ">"; + id_ = oss.str(); + + eventMask_ = PropertyChangeMask; + XCORE->selectEvents(clientWindow_, eventMask_); + + setX(attr->x); + setY(attr->y); + setWidth(attr->width); + setHeight(attr->height); + borderWidth_ = attr->border_width; + + oss.str(""); + oss << "constructing new client with dimensions: " << + x() << "," << y() << "," << width() << "," << height(); + LOGDEBUG(oss.str()); + + className_ = XCORE->className(clientWindow_); + instanceName_ = XCORE->instanceName(clientWindow_); + + string value; + + updateTransient(); + if (transient_) { + value = Util::get(KERNEL->sessionSettings(), + "client." + className_ + "::" + instanceName_ + ".transient-mode"); + + if ("" == value) { + value = Util::get(KERNEL->commonSettings(), + "default.transient-mode"); + + if ("" == value) { + value = "float"; + } + } + } + else { + value = Util::get(KERNEL->sessionSettings(), + "client." + className_ + "::" + instanceName_ + ".mode"); + } + + if (value == "float") { + mode_ = FLOAT; + } + else if (value == "sticky") { + mode_ = STICKY; + } + else if (value == "max") { + mode_ = MAX; + } +#ifdef SLOT_SUPPORT + else if (value == "slot") { + mode_ = SLOT; + } +#endif // SLOT_SUPPORT + // fallback, unknown yet + else if (Util::get(KERNEL->commonSettings(), "default.client-mode") + == "float") + { + mode_ = FLOAT; + } + else { + mode_ = MAX; + } + + hooked_ = Util::get(KERNEL->sessionSettings(), + "client." + className_ + "::" + instanceName_ + ".hooked"); +} + +Client::~Client() { +} + +string Client::id() { + return id_; +} + +void Client::initICCCM() { + + state_ = XCORE->state(clientWindow_); + iconName_ = XCORE->atomValue(clientWindow_, XA_WM_ICON_NAME); + setName(XCORE->atomValue(clientWindow_, XA_WM_NAME) + id_); + if (iconName_ == "") { + iconName_ = name(); + } + else { + iconName_ += id_; + } + updateSize(); + protocols_ = XCORE->protocols(clientWindow_); + if (XCORE->hasDecoration(clientWindow_) && !frameWindow()) { + hasDecoration_ = true; + } + + updateTransient(); +} + +void Client::updateSize() { + + unsigned int dummy; + // TODO: increment handling + XCORE->updateSize(clientWindow_, &dummy, &dummy, + &dummy, &dummy, &isCentered_); +} + +void Client::updateTransient() { + + Window trans = XCORE->transient(clientWindow_); + transient_ = KERNEL->clientForWindow(trans); +} + +Client *Client::transient() const { + return transient_; +} + +void Client::sendConfiguration() { + XConfigureEvent event; + + ostringstream oss; + + oss << "send configuration: " << clientAreaRect_.x() << "," + << clientAreaRect_.y() << "," << clientAreaRect_.width() + << "," << clientAreaRect_.height(); + LOGDEBUG(oss.str()); + event.type = ConfigureNotify; + event.event = clientWindow_; + event.window = clientWindow_; + if (hasFrame_) { + event.x = x() + clientAreaRect_.x(); + event.y = y() + clientAreaRect_.y(); + } + else if (frame()) { + event.x = frame()->x() + clientAreaRect_.x(); + event.y = frame()->y() + clientAreaRect_.y(); + } + else { + event.x = clientAreaRect_.x(); + event.y = clientAreaRect_.y(); + } + event.width = clientAreaRect_.width(); + event.height = clientAreaRect_.height(); + event.border_width = clientBorderWidth_; + event.above = None; + event.override_redirect = False; + + XCORE->configure(clientWindow_, &event); +} + +void Client::resize() { + + clientAreaRect_.copy(this); + + if (hasFrame_) { + ostringstream oss; + oss << "frame resize: x=" << x() << ", y=" << y() << ", w=" << + width() << ", h=" << height(); + LOGDEBUG(oss.str()); + XCORE->moveResize(frameWindow(), this); + + if (frame()) { + // maximize client window + clientAreaRect_.setX(0); + clientAreaRect_.setY(0); + clientAreaRect_.setWidth(width()); + clientAreaRect_.setHeight(height()); + } + else { + label_->setY(borderWidth_); // label fix for toggleBorder + fitClientArea(); + } + } + XCORE->moveResize(clientWindow_, &clientAreaRect_); + sendConfiguration(); + illuminate(); +} + +void Client::gravitate(bool invert) { + + int dx = 0; + int dy = 0; + int gravity = NorthWestGravity; + XSizeHints sizeHints; + + XCORE->sizeHints(clientWindow_, &sizeHints); + + if (sizeHints.flags & PWinGravity) { + gravity = sizeHints.win_gravity; + } + + switch (gravity) { + case NorthEastGravity: + case EastGravity: + case SouthEastGravity: + dx = -borderWidth_; + break; + default: + break; + } + + switch (gravity) { + case SouthWestGravity: + case SouthGravity: + case SouthEastGravity: + dy = -titleBarHeight_ - borderWidth_; + break; + default: + break; + } + + if (invert) { + dx = -dx; + dy = -dy; + } + + setX(x() + dx); + setY(y() + dy); +} + +void Client::handleConfigureRequest(XConfigureRequestEvent *event) { + + XWindowChanges wc; + + if (event->value_mask & CWStackMode) { + if (attached()) { + if (!isFocused()) { + requestsFocus_ = true; + } + if (monitor()->focused() != attached()) { + attached()->setRequestsFocus(true); + } + } + event->value_mask &= ~CWStackMode; + } + + event->value_mask &= ~CWSibling; + if (!frame() +#ifdef SLOT_SUPPORT + || (mode_ == SLOT) +#endif + ) { + + // floating client + + gravitate(true); + + if (event->value_mask & CWX) { + setX(event->x); + } + if (event->value_mask & CWY) { + setY(event->y); + } + if (event->value_mask & CWWidth) { + setWidth(event->width); + } + if (event->value_mask & CWHeight) { + setHeight(event->height); + } + if (event->value_mask & CWBorderWidth) { + clientBorderWidth_ = event->border_width; + } + ostringstream oss; + oss << "configure request: x=" << x() << ", y=" << y() + << ", w=" << width() << ", h=" << height(); + LOGDEBUG(oss.str()); + + gravitate(false); + + // applied patch by Dr. J. Pfefferl + if (hasFrame_) { + + if((event->value_mask & CWWidth)) { + setWidth(width() + 2 * borderWidth_); + } + if((event->value_mask & CWHeight)) { + setHeight(height() + titleBarHeight_ + 2 * borderWidth_ + + (titleBarHeight_ ? 1 : 0)); + } + if((event->value_mask & CWX)) { + setX(x() - borderWidth_); + } + if((event->value_mask & CWY)) { + setY(y() - titleBarHeight_ - borderWidth_); + } + + wc.x = x(); + wc.y = y(); + wc.width = width(); + wc.height = height(); + wc.border_width = 1; // event->border_width + wc.sibling = None; + wc.stack_mode = event->detail; + XCORE->configureWindow(frameWindow(), event->value_mask, &wc); + fitClientArea(); + sendConfiguration(); + } + else { + // save current dimensions to client area + clientAreaRect_.copy(this); + } + } + +#ifdef SLOT_SUPPORT + if (mode_ == SLOT) { + monitor()->slot()->manage(); + } + else +#endif // SLOT_SUPPORT + { + // If client is attached to a frame, the clientAreaRect_ has + // the size of the frames client area. + wc.x = clientAreaRect_.x(); + wc.y = clientAreaRect_.y(); + wc.width = clientAreaRect_.width(); + wc.height = clientAreaRect_.height(); + wc.border_width = 0; + wc.sibling = None; + event->value_mask |= CWBorderWidth; + + XCORE->configureWindow(clientWindow_, event->value_mask, &wc); + + illuminate(); + } +} + +void Client::handlePropertyNotify(XPropertyEvent *event) { + + if (event->state == PropertyDelete) { + return; // ignore delete properties + } + + // WM atoms + if (event->atom == Atoms::WM_PROTOCOLS) { + protocols_ = XCORE->protocols(clientWindow_); + return; + } + else if (event->atom == Atoms::MWM_HINTS) { + if (XCORE->hasDecoration(clientWindow_) && !frameWindow()) { + hasDecoration_ = true; + } + return; + } + + // default atoms + static string tmp; + ostringstream oss; + switch (event->atom) { + case XA_WM_ICON_NAME: + tmp = XCORE->atomValue(clientWindow_, XA_WM_ICON_NAME); + if (tmp.length() > 0) { + // update only if the icon name is != 0 + iconName_ = tmp + id_; + } + monitor()->clientBar()->illuminate(); + monitor()->statusBar()->illuminate(); + break; + case XA_WM_NAME: + tmp = XCORE->atomValue(clientWindow_, XA_WM_NAME); + if (tmp.length() > 0) { + // update only if the title is != 0 + setName(tmp + id_); + } + illuminate(); + monitor()->statusBar()->illuminate(); + break; + case XA_WM_TRANSIENT_FOR: + updateTransient(); + break; + case XA_WM_NORMAL_HINTS: + updateSize(); + oss << "git size: x=" << x() << ", y=" << y() << ", w=" << + width() << ", h=" << height(); + LOGDEBUG(oss.str()); + break; + } +} + +void Client::handleUnmapNotify(XUnmapEvent *event) { + + if (!isVisible_ || !event->send_event) { + LOGDEBUG("client is already unvisible"); + return; + } + + LOGDEBUG("handle unmap client: " + name()); + if (frameWindow()) { + XCORE->hide(frameWindow()); + } + isVisible_ = false; + XCORE->setState(clientWindow_, WithdrawnState); + Workspace *ws = this->attached(); + if (ws) { + LOGDEBUG("going detaching client from workspace"); + ws->detachClient(this); + } +} + +void Client::show() { + if (isDestroyed_) { + return; + } + XCORE->showRaised(clientWindow_); + if (hasFrame_) { + XCORE->showRaised(frameWindow()); + } + state_ = NormalState; + KERNEL->installCursor(Cursors::NORMAL_CURSOR, clientWindow_); + XCORE->setState(clientWindow_, state_); + isVisible_ = true; +} + +void Client::hide() { + if (isDestroyed_) { + return; + } + if (hasFrame_) { + XCORE->hide(frameWindow()); + } + XCORE->hide(clientWindow_); + state_ = WithdrawnState; + XCORE->setState(clientWindow_, state_); + isVisible_ = false; + LOGDEBUG("client state changed"); + XCORE->sync(); +} + +void Client::setMode(Client::Mode mode) { + + mode_ = mode; + string modeStr; + + switch (mode_) { + case MAX: + modeStr = "max"; + break; + case STICKY: + modeStr = "sticky"; + break; + case FLOAT: + modeStr = "float"; + break; +#ifdef SLOT_SUPPORT + case SLOT: + modeStr = "slot"; + break; +#endif // SLOT_SUPPORT + } + if (transient_) { + (*KERNEL->sessionSettings())["client." + className_ + "::" + + instanceName_ + ".transient-mode"] = modeStr; + } + else { + (*KERNEL->sessionSettings())["client." + className_ + "::" + + instanceName_ + ".mode"] = modeStr; + } +} + +long Client::eventMask() const { + return eventMask_; +} + +string Client::className() const { + return className_; +} + +string Client::instanceName() const { + return instanceName_; +} + +string Client::iconName() const { + return iconName_; +} + +int Client::protocols() const { + return protocols_; +} + +// TODO: It would be a good idea to implement an align method +// for gravitation with value VH_CENTER +bool Client::isCentered() const { + return isCentered_; +} + +Client::Mode Client::mode() const { + return mode_; +} + +int Client::state() const { + return state_; +} + +Window Client::window() { + if (hasFrame_) { + return frameWindow_; + } + else { + return clientWindow_; + } +} + +void Client::reparent(Window parentWindow, int x, int y) { + if (isDestroyed_) { + return; + } + XCORE->reparent(clientWindow_, parentWindow, x, y); + assert(parentWindow); + hasFrame_ = (parentWindow == frameWindow()); +} + +void Client::createFrame() { + initFrameWindow(); + fitClientArea(); + XCORE->sync(); +} + +bool Client::isFocused() { + + if (frame()) { + return frame()->isFocused() + && frame()->focused() == this; + } + else if (attached()) { + return attached()->topClient() == this; + } + return 0; +} + +void Client::illuminate() { + + if (!isVisible_) { + return; + } + + if (frame()) { + frame()->illuminate(); + return; + } + + if (!hasFrame_) { + return; + } + LOGDEBUG("within client illuminate"); + XCORE->sync(); + + illuminateBorder(); + + bool foc = isFocused(); + unsigned int buttonWidth = 0; + + if (foc) { + buttonWidth = monitor()->buttonWidth(); + } + + if (titleBarHeight_) { + label_->setText(name()); + label_->setX(borderWidth_); + unsigned int textWidth = label_->adjustWidth(); + unsigned long tabShine = 0; + unsigned long tabShadow = 0; + label_->setWidth(width() - label_->x() - borderWidth_); + if (foc) { + if (areButtonsVisible_) { + label_->setWidth(label_->width() - 3 * buttonWidth - 2); + } + tabShine = theme_->TAB_SHINE_ACTIVE_FOCUSSED; + tabShadow = theme_->TAB_SHADOW_ACTIVE_FOCUSSED; + label_->update(theme_->TAB_BACKGROUND_ACTIVE_FOCUSSED, + theme_->TAB_TEXT_ACTIVE_FOCUSSED, + tabShine, tabShadow, true, true); + } + else if (requestsFocus_) { + tabShine = theme_->FOCUSREQ_SHINE; + tabShadow = theme_->FOCUSREQ_SHADOW; + label_->update(theme_->FOCUSREQ_BACKGROUND, + theme_->FOCUSREQ_TEXT, + tabShine, tabShadow, true, true); + } + else if (frame() && frame()->focused() == this) { + tabShine = theme_->TAB_SHINE_ACTIVE_NORMAL; + tabShadow = theme_->TAB_SHADOW_ACTIVE_NORMAL; + label_->update(theme_->TAB_BACKGROUND_ACTIVE_NORMAL, + theme_->TAB_TEXT_ACTIVE_NORMAL, + tabShine, tabShadow, true, true); + } + else { + tabShine = theme_->TAB_SHINE_INACTIVE_NORMAL; + tabShadow = theme_->TAB_SHADOW_INACTIVE_NORMAL; + label_->update(theme_->TAB_BACKGROUND_INACTIVE_NORMAL, + theme_->TAB_TEXT_INACTIVE_NORMAL, + tabShine, tabShadow, true, true); + } + + if (mode_ == Client::STICKY) { + + Draw::drawStickyNotifier(frameWindow(), gc_, label_, + tabShine, tabShadow, textWidth); + } + } + + if (foc) { + Draw::drawFloatBorderAnchors(frameWindow(), gc_, this, + theme_->FRAME_SHINE_FOCUSSED, + theme_->FRAME_SHADOW_FOCUSSED, + titleBarHeight_ + borderWidth_ + 1, + borderWidth_); + } +} + +void Client::handleButtonPress(XButtonEvent *event) { + + LOGDEBUG("entered ClientFrame::handleButtonPress"); +#ifdef SLOT_SUPPORT + if (mode_ == SLOT) { + monitor()->slot()->focusClient(this); + return; + } +#endif + if (attached() && !isFocused()) { + attached()->focus(this); + return; + } + else { + XCORE->raise(window()); + } + + if (frame()) { + return; + } + + buttonState_ = NONE; + + if (event->button == Button1) { + + if (titleBarHeight_ && areButtonsVisible_ && + (cursor_ == Cursors::NORMAL_CURSOR)) + { + int xPosition = event->x; + unsigned int buttonWidth = titleBarHeight_ + 1; + unsigned int offsetButtonGroup = width() - borderWidth_ - 3 * buttonWidth; + if ((xPosition > (int)offsetButtonGroup) && + (xPosition < (int)(width() - borderWidth_ - 1))) + { + xPosition -= offsetButtonGroup; + unsigned int buttonNum = xPosition / buttonWidth; + switch (buttonNum) { + case 0: + buttonState_ = MINCLIENT; + break; + case 1: + buttonState_ = DEMAX; + break; + case 2: + buttonState_ = CLOSE; + break; + } + illuminate(); + return; + } + } + + if (monitor()->isThingMaximized()) { + return; + } + + Direction dir = SOUTH_EAST; + if (cursor_ == Cursors::RESIZE_LEFT_CURSOR) { + dir = LEFT; + } + else if (cursor_ == Cursors::RESIZE_RIGHT_CURSOR) { + dir = RIGHT; + } + else if (cursor_ == Cursors::RESIZE_UP_CURSOR) { + dir = UP; + } + else if (cursor_ == Cursors::RESIZE_DOWN_CURSOR) { + dir = DOWN; + } + else if (cursor_ == Cursors::RESIZE_NORTH_WEST_CURSOR) { + dir = NORTH_WEST; + } + else if (cursor_ == Cursors::RESIZE_NORTH_EAST_CURSOR) { + dir = NORTH_EAST; + } + else if (cursor_ == Cursors::RESIZE_SOUTH_WEST_CURSOR) { + dir = SOUTH_WEST; + } + else if (cursor_ == Cursors::RESIZE_SOUTH_EAST_CURSOR) { + dir = SOUTH_EAST; + } + + KERNEL->runResizeMode(this, event, dir, + cursor_ != Cursors::NORMAL_CURSOR); + } +} + +void Client::handleButtonRelease(XButtonEvent *event) { + + // TODO: make buttons customizable + if (event->button == Button1) { + + if (titleBarHeight_ && (cursor_ == Cursors::NORMAL_CURSOR) && + (buttonState_ != NONE)) + { + if (monitor()->isThingMaximized()) { + monitor()->toggleThingMaximization(); + } + switch (buttonState_) { + case MINCLIENT: + monitor()->detachClient(); + break; + case DEMAX: + attached()->toggleClientMode(); + break; + case CLOSE: + XCORE->kill(clientWindow_, protocols_); + break; + default: + break; + } + buttonState_ = NONE; + return; + } + } +} + +Cursor Client::cursorForXY(int pointerX, int pointerY) { + + if (frame() || (borderWidth_ == 0)) + { + return Cursors::NORMAL_CURSOR; + } + + // rectangle attributes of client are used + bool left = pointerX < clientAreaRect_.x(); + bool right = pointerX >= (int)(clientAreaRect_.x() + + clientAreaRect_.width()); + bool up = pointerY < (int)(clientAreaRect_.y() + - titleBarHeight_ - 1); + bool down = pointerY >= (int)(clientAreaRect_.y() + + clientAreaRect_.height()); + + bool tolLeft = pointerX < (int)(clientAreaRect_.x() + titleBarHeight_); + bool tolRight = pointerX > (int)(clientAreaRect_.x() + + clientAreaRect_.width() + - titleBarHeight_ - 1); + bool tolUp = pointerY < (int)(clientAreaRect_.y() + titleBarHeight_); + bool tolDown = pointerY > (int)(clientAreaRect_.y() + + clientAreaRect_.height() + - titleBarHeight_ - 1); + + if ((left && up) || (left && tolUp) || (up && tolLeft)) { + return Cursors::RESIZE_NORTH_WEST_CURSOR; + } + else if ((right && up) || (right && tolUp) || (up && tolRight)) { + return Cursors::RESIZE_NORTH_EAST_CURSOR; + } + else if ((left && down) || (left && tolDown) || + (down && tolLeft)) + { + return Cursors::RESIZE_SOUTH_WEST_CURSOR; + } + else if ((right && down) || (right && tolDown) || (down && + tolRight)) + { + return Cursors::RESIZE_SOUTH_EAST_CURSOR; + } + + if (left) { + return Cursors::RESIZE_LEFT_CURSOR; + } + else if (right) { + return Cursors::RESIZE_RIGHT_CURSOR; + } + else if (up) { + return Cursors::RESIZE_UP_CURSOR; + } + else if (down) { + return Cursors::RESIZE_DOWN_CURSOR; + } + + return Cursors::NORMAL_CURSOR; +} + +Frame *Client::frame() const { + return frame_; +} + +void Client::setFrame(Frame *frame) { + frame_ = frame; +} + +Workspace *Client::attached() const { + return workspace_; +} + +void Client::setAttached(Workspace *workspace) { + workspace_ = workspace; +} + +Window Client::frameWindow() const { + return frameWindow_; +} + +Window Client::clientWindow() const { + return clientWindow_; +} + +bool Client::requestsFocus() const { + return requestsFocus_; +} + +void Client::setRequestsFocus(bool requestsFocus) { + requestsFocus_ = requestsFocus; +} + +void Client::setHooked(string hooked) { + hooked_ = hooked; + if (hooked_ != "") { + (*KERNEL->sessionSettings())["client." + className_ + "::" + + instanceName_ + ".hooked"] = hooked_; + } + else { + Util::remove(KERNEL->sessionSettings(), + "client." + className_ + "::" + instanceName_ + ".hooked"); + } +} + +string Client::hooked() const { + return hooked_; +} + +void Client::setDestroyed(bool isDestroyed) { + isDestroyed_ = isDestroyed; +} + +bool Client::isDestroyed() const { + return isDestroyed_; +} diff --git a/client.h b/client.h @@ -0,0 +1,155 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: client.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __CLIENT_H +#define __CLIENT_H + +extern "C" { +#include <X11/Xlib.h> +#include <X11/Xutil.h> +} + +#include <list> +#include <string> +#include "thing.h" +#include "wmi.h" + +// forward declaration +class Client; +class Monitor; +class Workspace; + +typedef list<Client *> LClient; + +/** + * Representates an X client window. + */ +class Client : public Thing +{ + +public: + + enum Mode {FLOAT, MAX, STICKY +#ifdef SLOT_SUPPORT + , SLOT +#endif // SLOT_SUPPORT + }; + + Client(Monitor *monitor, Window window, XWindowAttributes *attr); + ~Client(); + + /** Returns if this client is transient. */ + void setTransient(Client *client); + Client *transient() const; + + long eventMask() const; + + string className() const; + + string instanceName() const; + + string iconName() const; + + void sendConfiguration(); + + virtual void resize(); + + /** event handler. */ + void handleConfigureRequest(XConfigureRequestEvent *event); + void handleMapNotify(XMapEvent *event); + void handlePropertyNotify(XPropertyEvent *event); + void handleUnmapNotify(XUnmapEvent *event); + + virtual void show(); + virtual void hide(); + + int protocols() const; + + bool isCentered() const; + + void initICCCM(); + + void setMode(Mode mode); + + Mode mode() const; + + int state() const; + + /** Illuminates this frame. */ + virtual void illuminate(); + + virtual bool isFocused(); + + virtual void handleButtonPress(XButtonEvent *event); + virtual void handleButtonRelease(XButtonEvent *event); + + virtual Cursor cursorForXY(int pointerX, int pointerY); + + virtual Window window(); + Window frameWindow() const; + Window clientWindow() const; + + void setDestroyed(bool isDestroyed); + bool isDestroyed() const; + + void createFrame(); + + void reparent(Window parentWindow, int x, int y); + + string id(); + + Frame *frame() const; + void setFrame(Frame *frame); + + Workspace *attached() const; + void setAttached(Workspace *workspace); + + bool requestsFocus() const; + void setRequestsFocus(bool requestsFocus); + + /** + * Defines where this client prefers to be attached to. + * Must be a valid workspace or slot tab name. + */ + string hooked() const; + void setHooked(string hooked); + +private: + + void gravitate(bool invert); + + /** Updates the size of this client. */ + void updateSize(); + + /** Updates transient for this client. */ + void updateTransient(); + + Window clientWindow_; + + string className_; + string instanceName_; + string iconName_; + string hooked_; + + Workspace *workspace_; + Client *transient_; + Frame *frame_; + + unsigned int clientBorderWidth_; + + int protocols_; + int state_; + long eventMask_; + + bool isCentered_; + bool hasFrame_; + bool requestsFocus_; + bool isDestroyed_; + + Mode mode_; + string id_; +}; + +#endif // __CLIENT_H diff --git a/clientbar.cpp b/clientbar.cpp @@ -0,0 +1,348 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: clientbar.cpp 734 2004-09-27 18:15:45Z garbeam $ + +#include <list> +#include <string> +#include <sstream> + +#include "clientbar.h" + +#include "client.h" +#include "cursors.h" +#include "draw.h" +#include "frame.h" +#include "label.h" +#include "logger.h" +#include "menu.h" +#include "monitor.h" +#include "theme.h" +#include "thing.h" +#include "validators.h" +#include "workspace.h" +#include "xcore.h" + +ClientBar::ClientBar(Monitor *monitor, Rectangle *rect) + : Bar(monitor, rect) +{ + isModeButtonPressed_ = isMenuButtonPressed_ = false; + mode_ = PAGER; + menu_ = new Menu(monitor); +} + +ClientBar::~ClientBar() { +} + +void ClientBar::illuminate() { + + if (!isVisible()) { + return; + } + + LOGDEBUG("going to draw border"); + drawBorder(); + + label_->setText(""); + label_->setX(1); + label_->setWidth(width() - 2); + label_->update(theme_->BAR_BACKGROUND, theme_->BAR_TEXT, + theme_->BAR_SHINE, theme_->BAR_SHADOW); + + updateMenuButton(); + if (mode_ == PAGER) { + updateClientPager(); + } + else { + updateClientInfo(); + } + updateModeButton(); +} + + +void ClientBar::updateClientPager() { + + Workspace *workspace = monitor()->focused(); + CClient *clients = workspace->floatingClients(); + if (clients->size() > 0) { + unsigned int offsetX = isButtonVisible_ ? monitor()->buttonWidth() + 3 : 1; + unsigned int clientsWidth = width() - 2; + if (isButtonVisible_) { + clientsWidth -= (2 * monitor()->buttonWidth() + 4); + } + unsigned int i = 0; + unsigned int clientWidth = clientsWidth / clients->size(); + label_->setWidth(clientWidth); + for (LClient::iterator it = clients->begin(); it != clients->end(); ) { + Client *client = *it; + it++; + + label_->setX(offsetX + i * clientWidth); + if (it == clients->end()) { + // FIX for right button irretations + label_->setWidth(width() - label_->x() + - (isButtonVisible_ ? monitor()->buttonWidth() + 3 : 1)); + } + unsigned long shine, shadow; + label_->setText(client->name()); + if (client->isFocused()) { + shine = theme_->TAB_SHINE_ACTIVE_FOCUSSED; + shadow = theme_->TAB_SHADOW_ACTIVE_FOCUSSED; + label_->update(theme_->TAB_BACKGROUND_ACTIVE_FOCUSSED, + theme_->TAB_TEXT_ACTIVE_FOCUSSED, + shine, shadow, true, true); + } + else if (client->requestsFocus()) { + shine = theme_->FOCUSREQ_SHINE; + shadow = theme_->FOCUSREQ_SHADOW; + label_->update(theme_->FOCUSREQ_BACKGROUND, + theme_->FOCUSREQ_TEXT, + shine, shadow, true, true); + } + else { + shine = theme_->TAB_SHINE_ACTIVE_NORMAL; + shadow = theme_->TAB_SHADOW_ACTIVE_NORMAL; + label_->update(theme_->TAB_BACKGROUND_ACTIVE_NORMAL, + theme_->TAB_TEXT_ACTIVE_NORMAL, + shine, shadow, true, true); + } + + if (client->mode() == Client::STICKY) { + Draw::drawStickyNotifier(window(), gc(), label_, + shine, shadow, + label_->textWidth()); + } + i++; + } + } +} + +void ClientBar::updateMenuButton() { + + // button stuff + if (!isButtonVisible_) { + return; + } + + label_->setText(""); + label_->setX(1); + label_->setWidth(monitor()->buttonWidth()); + if (isMenuButtonPressed_) { + Draw::drawMenuButton(window(), gc(), label_, + theme_->BUTTON_BACKGROUND_PRESSED, + theme_->BUTTON_SHINE_BORDER_PRESSED, + theme_->BUTTON_SHADOW_BORDER_PRESSED, + theme_->BUTTON_SHINE_FIGURE_PRESSED, + theme_->BUTTON_SHADOW_FIGURE_PRESSED); + } + else { + Draw::drawMenuButton(window(), gc(), label_, + theme_->BUTTON_BACKGROUND_NORMAL, + theme_->BUTTON_SHINE_BORDER_NORMAL, + theme_->BUTTON_SHADOW_BORDER_NORMAL, + theme_->BUTTON_SHINE_FIGURE_NORMAL, + theme_->BUTTON_SHADOW_FIGURE_NORMAL); + } +} + +void ClientBar::updateModeButton() { + + // button stuff + if (!isButtonVisible_) { + return; + } + + Workspace *workspace = monitor()->focused(); + + label_->setText(""); + label_->setX(width() - monitor()->buttonWidth() - 1); + label_->setWidth(monitor()->buttonWidth()); + if (isModeButtonPressed_) { + if (workspace->isFrameMode()) { + Draw::drawFloatButton(window(), gc(), label_, + theme_->BUTTON_BACKGROUND_PRESSED, + theme_->BUTTON_SHINE_BORDER_PRESSED, + theme_->BUTTON_SHADOW_BORDER_PRESSED, + theme_->BUTTON_SHINE_FIGURE_PRESSED, + theme_->BUTTON_SHADOW_FIGURE_PRESSED, + workspace->floatingClients()->size()); + } + else { + Draw::drawMaxButton(window(), gc(), label_, + theme_->BUTTON_BACKGROUND_PRESSED, + theme_->BUTTON_SHINE_BORDER_PRESSED, + theme_->BUTTON_SHADOW_BORDER_PRESSED, + theme_->BUTTON_SHINE_FIGURE_PRESSED, + theme_->BUTTON_SHADOW_FIGURE_PRESSED, + workspace->focusedFrame() && + workspace->focusedFrame()->size()); + } + } + else { + if (workspace->isFrameMode()) { + Draw::drawFloatButton(window(), gc(), label_, + theme_->BUTTON_BACKGROUND_NORMAL, + theme_->BUTTON_SHINE_BORDER_NORMAL, + theme_->BUTTON_SHADOW_BORDER_NORMAL, + theme_->BUTTON_SHINE_FIGURE_NORMAL, + theme_->BUTTON_SHADOW_FIGURE_NORMAL, + workspace->floatingClients()->size()); + } + else { + Draw::drawMaxButton(window(), gc(), label_, + theme_->BUTTON_BACKGROUND_NORMAL, + theme_->BUTTON_SHINE_BORDER_NORMAL, + theme_->BUTTON_SHADOW_BORDER_NORMAL, + theme_->BUTTON_SHINE_FIGURE_NORMAL, + theme_->BUTTON_SHADOW_FIGURE_NORMAL, + workspace->focusedFrame() && + workspace->focusedFrame()->size()); + } + } +} + +void ClientBar::updateClientInfo() { + + // client info stuff + Workspace *focusedWorkspace = monitor()->focused(); + Client *client = focusedWorkspace->topClient(); + unsigned int offsetX = isButtonVisible_ ? monitor()->buttonWidth() + 3 : 1; + unsigned int clientInfoWidth = width() - 2; + if (isButtonVisible_) { + clientInfoWidth -= (2 * monitor()->buttonWidth() + 4); + } + label_->setX(offsetX); + label_->setWidth(clientInfoWidth); + label_->setText(client ? client->name() : ""); + label_->update(theme_->LABEL_BACKGROUND_FOCUSSED, + theme_->LABEL_TEXT_FOCUSSED, + theme_->LABEL_SHINE_FOCUSSED, + theme_->LABEL_SHADOW_FOCUSSED, + true, true); + if (client->mode() == Client::STICKY) { + Draw::drawStickyNotifier(window(), gc(), label_, + theme_->LABEL_SHINE_FOCUSSED, + theme_->LABEL_SHADOW_FOCUSSED, + label_->textWidth()); + } +} + +void ClientBar::handleButtonRelease(XButtonEvent *event) { + + if ((event->window != window())) { + return; + } + + if (isModeButtonPressed_) { + isModeButtonPressed_ = false; + Workspace *ws = monitor()->focused(); + if ((event->button == Button1) && + Validators::instance()->validateToggleMode()) + { + ws->toggleMode(); + } + illuminate(); + } + else if (isMenuButtonPressed_) { + toggleMenuMode(); + } +} + +void ClientBar::toggleMenuMode() { + + if (menu_->isVisible()) { + menu_->hide(); + isMenuButtonPressed_ = false; + } + else { + menu_->show(); + } + illuminate(); +} + +void ClientBar::handleButtonPress(XButtonEvent *event) { + + if ((event->window != window())) { + return; + } + + XCORE->raise(window()); + + // TODO: make buttons customizable + if (event->button == Button1) { + invokeClickedThing(event->x); + } + else if (event->button == Button4) { + monitor()->focused()->cycleClientPrev(); + } + else if (event->button == Button5) { + monitor()->focused()->cycleClientNext(); + } +} + +void ClientBar::handleMotionNotify(XMotionEvent *event) { + + if (isModeButtonPressed_) { + isModeButtonPressed_ = false; + illuminate(); + } +} + +void ClientBar::invokeClickedThing(int xPosition) { + + if (isButtonVisible_) { + if (xPosition < (int)(monitor()->buttonWidth() + 1)) { + isMenuButtonPressed_ = true; + } + else if (xPosition > (int)(width() - monitor()->buttonWidth() - 2)) { + isModeButtonPressed_ = true; + } + illuminate(); + if (isModeButtonPressed_ || isMenuButtonPressed_) { + return; + } + } + + if (mode_ != PAGER) { + illuminate(); + return; + } + + Workspace *workspace = monitor()->focused(); + unsigned int clientsWidth = width() - 2; + if (isButtonVisible_) { + clientsWidth -= (2 * monitor()->buttonWidth() + 4); + xPosition -= (monitor()->buttonWidth() + 3); + } + else { + xPosition -= 1; + } + + CClient *clients = workspace->floatingClients(); + if (!clients->size()) { + return; + } + + unsigned int clientNum = xPosition / (clientsWidth / clients->size()); + unsigned i = 0; + for (LClient::iterator it = clients->begin(); it != clients->end(); it++) { + if (i == clientNum) { + workspace->focus(*it); + illuminate(); + return; + } + i++; + } +} + +Menu *ClientBar::menu() const { + return menu_; +} + +void ClientBar::setMode(ClientBar::Mode mode) { + mode_ = mode; +} + +ClientBar::Mode ClientBar::mode() const { + return mode_; +} diff --git a/clientbar.h b/clientbar.h @@ -0,0 +1,53 @@ +// Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de> +// See ../LICENSE.txt for license details. +// +// $Id: clientbar.h 734 2004-09-27 18:15:45Z garbeam $ + +#ifndef __CLIENTBAR_H +#define __CLIENTBAR_H + +#include "bar.h" + +class Menu; +class Monitor; + +/** + * Represents the floating app bar of WMI. + */ +class ClientBar : public Bar { + +public: + + enum Mode {PAGER, CLIENTINFO}; + + ClientBar(Monitor *monitor, Rectangle *rect); + + ~ClientBar(); + + virtual void illuminate(); + + virtual void handleMotionNotify(XMotionEvent *event); + virtual void handleButtonPress(XButtonEvent *event); + virtual void handleButtonRelease(XButtonEvent *event); + + void toggleMenuMode(); + void setMode(Mode mode); + Mode mode() const; + + Menu *menu() const; + +private: + + void updateClientInfo(); + void updateClientPager(); + void updateModeButton(); + void updateMenuButton(); + + void invokeClickedThing(int xPosition); + bool isModeButtonPressed_; + bool isMenuButtonPressed_; + Mode mode_; + Menu *menu_; +}; + +#endif // __CLIENTBAR_H diff --git a/config.h.in b/config.h.in @@ -0,0 +1,112 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if wmi is to be build with debug information. */ +#undef DEBUG + +/* Define if wmi is to be build with diamond box. */ +#undef DIAMOND_BOX + +/* Define to 1 if you have the <assert.h> header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the <ctype.h> header file. */ +#undef HAVE_CTYPE_H + +/* 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 <regex.h> header file. */ +#undef HAVE_REGEX_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_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/select.h> header file. */ +#undef HAVE_SYS_SELECT_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 <sys/wait.h> header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the <time.h> header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the <X11/cursorfont.h> header file. */ +#undef HAVE_X11_CURSORFONT_H + +/* Define to 1 if you have the <X11/keysym.h> header file. */ +#undef HAVE_X11_KEYSYM_H + +/* Define to 1 if you have the <X11/Xatom.h> header file. */ +#undef HAVE_X11_XATOM_H + +/* Define to 1 if you have the <X11/Xlib.h> header file. */ +#undef HAVE_X11_XLIB_H + +/* Define to 1 if you have the <X11/Xmd.h> header file. */ +#undef HAVE_X11_XMD_H + +/* Define to 1 if you have the <X11/Xproto.h> header file. */ +#undef HAVE_X11_XPROTO_H + +/* Define to 1 if you have the <X11/Xresource.h> header file. */ +#undef HAVE_X11_XRESOURCE_H + +/* Define to 1 if you have the <X11/Xutil.h> header file. */ +#undef HAVE_X11_XUTIL_H + +/* Define to 1 if you have the <X11/X.h> header file. */ +#undef HAVE_X11_X_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if wmi is to be build with posix regex. */ +#undef POSIX_REGEX + +/* Define if wmi is to be build with slot support. */ +#undef SLOT_SUPPORT + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* antialias support */ +#undef XFT_SUPPORT + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING diff --git a/configure b/configure @@ -0,0 +1,8075 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# 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. +## --------------------- ## +## 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= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="src/main.cpp" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#if STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# if HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#if HAVE_STRINGS_H +# include <strings.h> +#endif +#if HAVE_INTTYPES_H +# include <inttypes.h> +#else +# if HAVE_STDINT_H +# include <stdint.h> +# endif +#endif +#if 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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot 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 EGREP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS PKG_CONFIG 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_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP + +# +# 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 this package 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 + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --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-x use the X Window System + --with-debug enable debug support + --with-posix-regex enable posix regex + --without-diamond disable diamond box whily move/resize + --without-slot disable slot + --with-xft-prefix=path Prefix where Xft is installed (optional) + --with-pkg-exec-prefix=path Exec prefix where pkg-config is installed (optional) + --without-xft disable Xft support + +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> + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP 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. + +_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 + +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 $as_me, 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.8" +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 + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + 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=wmi + VERSION=10 + + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + +# next release: AM_INIT_AUTOMAKE(wmi, 10, anselmg@t-online.de) + ac_config_headers="$ac_config_headers config.h" + +# following two AC_CHECK_HEADERS have been provided by Markus Lindorfer +# for Solaris compatibility +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 + + + +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 + +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 + + + +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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 non-existent 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 non-existent 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_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_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_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 { (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_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 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> +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +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); } && { ac_try='./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 + : +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 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 eval "test \"\${$as_ac_Header+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 { (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 + 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 conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 assert.h ctype.h stdio.h stdlib.h sys/select.h sys/stat.h sys/types.h sys/wait.h time.h unistd.h X11/cursorfont.h X11/keysym.h X11/Xatom.h X11/X.h X11/Xlib.h X11/Xmd.h X11/Xproto.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 { (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_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_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 eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 + +fi + +done + + + +for ac_header in X11/Xresource.h X11/Xutil.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 eval "test \"\${$as_ac_Header+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. */ +#ifdef HAVE_X11_XLIB_H + # include <X11/Xlib.h> + #endif + + +#include <$ac_header> +_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 + 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 conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + 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_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # 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_CXX="$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 +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +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_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# 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); } + +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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_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_cxx_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_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +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_cxx_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_cxx_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 + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" 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_CXX_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_CXX_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_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_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' + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_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 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 non-existent 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 non-existent 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +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 { (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_cxx_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_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 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> +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +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); } && { ac_try='./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 + : +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 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 + + +# check X headers and libs +echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + +fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'_ACEOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Intrinsic.h. + # First, try using that file with no special directory specified. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <X11/Intrinsic.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <X11/Intrinsic.h> +int +main () +{ +XtMalloc (0) + ; + 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_cxx_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 + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +cat >>confdefs.h <<\_ACEOF +#define X_DISPLAY_MISSING 1 +_ACEOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + 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 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_cxx_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_R_nospace=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_nospace=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_nospace = yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + 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 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_cxx_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_R_space=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_space=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_space = yes; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6 + fi + fi + LIBS=$ac_xsave_LIBS + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + 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 XOpenDisplay (); +int +main () +{ +XOpenDisplay (); + ; + 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_cxx_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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $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 dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + 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_cxx_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_dnet_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_dnet_ntoa=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_dnet_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $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 dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + 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_cxx_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_dnet_stub_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_stub_dnet_ntoa=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_dnet_stub_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+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 gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); 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 gethostbyname + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* 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_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 + + if test $ac_cv_func_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_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_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \