bbmail-0.8.3/0000777000175100017510000000000007644531363006532 5bbmail-0.8.3/README0000644000175100017510000000550407267400640007324 -- README for bbmail 0.4.0 Beta - a tool which checks your -- mailbox (like xbiff). -- Copyright (c) 1998,1999 by John Kennis -- parts Copyright (c) 1997,1998,1999 by Brad Hughes. -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -- -- (See the included file COPYING / GPL-2.0) -- This Tool displays the status of your mailbox and warns you when new mail has arrived. It is designed to look the same as the Blackbox toolbar (Blackbox is a Windowmanager for X11). To copy this look a great deal of the code is taken from Blackbox. The files Image.cc (.hh) are taken from the Blackbox, only one class-name was changed. The files LinkedListed.cc (.hh) are taken from Blackbox without any change. You can always get the latest release at: http://bbtools.windsofstorm.net/ Options: -------- The mailtool.position is given as +x+y or -x-y (or combination) where -x-y is the (x,y) distance of the right bottom of screen to the right bottom of bbmail. So position -0-0 puts the application in the lower right conner of the screen. bbmail -w(ithdrawn): Withdrawn, place bbmail in Blackbox Slit. bbmail -s(hape): Don't show frame window. See bbmail -h for all command-line options. Pop-support: You can get the new and total mail information using an external program (eg. fetchpop), without the need for getting the mail to your machine (see data/README.bbmail). Netscape-support: see data/README.bbmail For configuration options see INSTALL and data/README.bbmail Thanks to: ---------- Brad Hughes For writing the Blackbox Windowmanager (and with this a great deal of the code for this application). John A. Martin and Laurie Harper For there comments and suggestions. Alex Law For his audio-patch (although eventually not used, it did result in the new-mail command options). Nathan Clemons For hosting the bbtool web-site at http://sunrise.windsofstorm.net . Eric Davis For the acces restore time patch, included in bbmail > 0.6.0 Bill Beal For the bbmailparsefm.pl perl script Timshel Knoll For the help and patches for qmail support bbmail-0.8.3/AUTHORS0000644000175100017510000000123307267400770007513 Author: John Kennis Thanks to: Brad Hughes For writing the Blackbox Windowmanager (and with this a great deal of the code for this application). Laurie Harper and John A. Martin For there comments and suggestions. Nathan Clemons For hosting the bbtool web-site at http://bbtools.windsofstorm.net . Eric Davis For the acces restore time patch, included in bbmail > 0.6.0 Bill Beal For the bbmailparsefm.pl perl script Timshel Knoll For the help and patches for qmail support bbmail-0.8.3/COPYING0000644000175100017510000004310507051262521007471 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. bbmail-0.8.3/ChangeLog0000644000175100017510000001461507644531361010225 version-0.8.3 - fixed segfault version-0.8.2 - fixed a small bug in the menu version-0.8.1 - Some small changes to make bbmail compile with gcc3 (Thanks to Mads Martin Joergensen) version-0.8.0: - removed the none-blackbox specific configuration file. - added support for maildir mailboxes. - added close option in menu - added man-page version-0.7.0: - added support for maildir mailboxes. - changed config files, you now have to change either mbox, maildir or other. version-0.6.11: - menu is now placed entirly on the desktop. version-0.6.10: - updated image and display code (copied them from latest blackbox) version-0.6.9: - Now optional charachters can be defined (between '[' and ']') in the bbmail.mailbox.*.newmail.statusFlag resource. An example for netscape: bbmail.mailbox.*.newmail.statusFlag: X-Mozilla-Status: [89ABCDEF] version-6.8 - updated NETHints to BlackboxHints so it's possible again to display bbmail without decorations. version-6.7 - fixed segfault when envelope not shown - added -m option in main, now you can select which mailbox defined in configuration file to use. This makes it possible to start different bbmails for different mailboxes (using the same configuration file - added bbmailparsefm.pl perl script, which put the fetchmail output in a format which bbmail can use. See the bbmail.mailbox.1.proc: entry in the resource file (Thanks to Bill Beal for writing it) - fixed check time resources - added aditional debug info version-6.6 - fixed another segfault error - fixed menu placement version-6.5 - fixed segfault - fixed default texture version-6.4 - updated Image.* and BaseDisplay (now all ne gradients should work) version-6.3 - color, colorTo and gradient are ungrouped. For instance you can use the default blackbox colors but define another gradient in the bbmail.bb style file. - fixed bug, mail count is displayed in menu again. - added bbmail.mailbox.*.name to bbmnail.bb and bbmail.nobb - default mailbox message ignored - changed bevelWidth behaviour for placement in slit: default frame.bevelWidth is 0 when placed in the slit default envelope.bevelWidth = 0 when placed in the slit version-6.2 - fixed segfault when using -d options - Updated INSTALL version-0.6.1 - wmclass=bbtools; wmname=bbmail - setting -geometry works with -d option - menu is placed on correct position when using -d option - resizing decorated window disabled version-0.6.0 - updated image code - changed configuration style - added: restore acces time after spoolfile is read. Some mail programs (for instance mutt) use this to detect if new mail has arrived (Thanks to Eric Davis for the patch). - changed bbmail.mailbox.*.firstInput, bbmail.mailbox.*.secondInput to bbmail.mailbox.*.mode (see bbmail.bb or bbmail.nobb) - added support for decorated (normal) window version-0.5.3 - fixed bug for HP-UX version-0.5.2 - added resource numberOf.digits so you can define the max number displayed. version-0.5.1 - fixed bug for 8-bit (static) color-mode - added working resources withdrawn and shape (for placing bbmail in the slit) version-0.5.0 - rewrite of code version 0.4.7 - fixed segfault when not showing label - updated Image.cc (from Blackbox-0.50.4) now 8-bits display should be better supported. - config files can be defined as command-line options again - when one mailbox has no more new mail, the next mailbox with new mail is shown. version 0.4.6 - small bug in positioning the menu when in the slit fixed. version 0.4.5 - menu now works with the Slit - pressed button is shown when menu is open - when withdrawn bbmail always auto-reconfigures version 0.4.4 - fixed menu so reconfigure works - default for new-mail envelope now is the same as blackbox toolbar button version 0.4.3 - added menu support (disabled when in the Slit) - added bmail.label.transparent option. - some bug fixes version 0.4.2 - added support for different external mail-info formats (now fetchmail is supported) - fixed auto-reconfigure - fixed force check changed resource to bbmail.forceCheck.onDelay version 0.4.1 - changed use of external mail-check program so pop3 is supported. - buf fix in code external mail-check version 0.4.0 - added supprt for Blackbox Slit: -w : withdrawn in Slit (docked) -s : don't show frame window. - changed configuration style (better supporting Blackbox styles) - removed audio patch and replaced it by the possibility to execute command when new mail has arrived. Can be used to play audio when new mail has arrived. - Some additional bug-fixes version 0.3.6 (internal) - implemented audio patch by Alex Law , which made it possible to play sound when new mail arrived. version 0.3.5 - small bugfix, textColors are now correctly copied from bbtools-style file version 0.3.4 - bug fixed, counting mail through external program now works. - bug in bbtools.rc fixed, name bbtools.styleFile: changed to bbtools.mailtool.styleFile so different style files can be used for different bbtools. version 0.3.3 - bug fixed, counting mail through external program should now work. version 0.3.2 - add resources for boring colors (the color when counter is zero) version 0.3.1 - fixed error, 'mail counting' using external progra, should now work. - added error report, a cross is placed on the envelope when a mailbox can't be read. - changed data files so now the resource names are correct. - changed resource naming sceme of mailtool.mailbox.* version 0.3.0 - added support for multiple mailboxes - added support for reading Blackbox style - added support to count the mail using external program (eg. flist) - added automatic update when style-file is updated, you can now change the style. - added support for different 'Status:' reports in spoolfiles. - Spooldir can now be defined as command-line option - changed the configure scripts - added global configuration files version 0.2.0 - added resources to choose displaying: - # of total mails - # of new mails - envelope - added resource make it possible to only display when new mail has arrived - added possibility to start program when envelope is pushed. - some thing I have forgotten version 0.1.1 (internal) - fixed 'segmentation fault' bug when no spool-file was defined. - added resource to change color of lines in envelope - fixed (I hope) configure script - bbmail now installs in usr/local/bin - changed names of some resources 05-11-1998 first public version of bbmail (version 0.1.0) bbmail-0.8.3/INSTALL0000644000175100017510000000206107051262521007463 To make and install this program : run: ./configure (for configure options see ./configure --help) make make install (as root) The global configuration files can be found in $(datadir)/bbtools (default: /usr/local/share/bbtools). Blackbox users: --------------- By default bbmail reads the Blackbox style-file as defined in .blackboxrc and copies as much of the style as possible. The result is a application which looks a lot like the toolbar. Furthermore bbmail reads the bbmail.bb config file. The global configuration is placed in /usr/local/share/bbtools/ The local configuration can be placed in $HOME/.bbtools/ Just copy the global configuration file to $HOME/.bbtools/ (and change it) Users other Window managers (KDE wm-hints need to be supported): ---------------------------------------------------------------- bbmail reads the bbmail.nobb config file. The global configuration is placed in /usr/local/share/bbtools/ The local configuration can be placed in $HOME/.bbtools/ Just copy the global configuration file to $HOME/.bbtools/ (and change it) bbmail-0.8.3/Makefile.am0000644000175100017510000000122607342163721010475 CPPFLAGS = @CPPFLAGS@ @INTERLACE@ \ -DBBTOOL_GLOBAL=\"$(datadir)/bbtools/bbmail.bb\" \ -DBBTOOL_LOCAL=\".bbtools/bbmail.bb\" SUBDIRS = data scripts #mandir = $(prefix)/man man_MANS = bbmail.1 bin_PROGRAMS = bbmail bbmail_SOURCES = bbmail.cc Image.cc LinkedList.cc \ bbmail.hh Image.hh LinkedList.hh \ main.cc main.hh \ resource.cc resource.hh \ BaseDisplay.cc BaseDisplay.hh \ Timer.cc Timer.hh \ Baseresource.cc Baseresource.hh \ Basewindow.cc Basewindow.hh \ spoollist.cc spoollist.hh \ mailboxmenu.cc mailboxmenu.hh \ Basemenu.cc Basemenu.hh \ blackboxstyle.hh EXTRA_DIST = $(man_MANS) BUGS TODO bbmail_LDADD = @X_LIBS@ bbmail-0.8.3/Makefile.in0000644000175100017510000004345107644531237010522 # Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERLACE = @INTERLACE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ regex_cmd = @regex_cmd@ CPPFLAGS = @CPPFLAGS@ @INTERLACE@ \ -DBBTOOL_GLOBAL=\"$(datadir)/bbtools/bbmail.bb\" \ -DBBTOOL_LOCAL=\".bbtools/bbmail.bb\" SUBDIRS = data scripts #mandir = $(prefix)/man man_MANS = bbmail.1 bin_PROGRAMS = bbmail bbmail_SOURCES = bbmail.cc Image.cc LinkedList.cc \ bbmail.hh Image.hh LinkedList.hh \ main.cc main.hh \ resource.cc resource.hh \ BaseDisplay.cc BaseDisplay.hh \ Timer.cc Timer.hh \ Baseresource.cc Baseresource.hh \ Basewindow.cc Basewindow.hh \ spoollist.cc spoollist.hh \ mailboxmenu.cc mailboxmenu.hh \ Basemenu.cc Basemenu.hh \ blackboxstyle.hh EXTRA_DIST = $(man_MANS) BUGS TODO bbmail_LDADD = @X_LIBS@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = version.h bin_PROGRAMS = bbmail$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_bbmail_OBJECTS = bbmail.$(OBJEXT) Image.$(OBJEXT) \ LinkedList.$(OBJEXT) main.$(OBJEXT) resource.$(OBJEXT) \ BaseDisplay.$(OBJEXT) Timer.$(OBJEXT) Baseresource.$(OBJEXT) \ Basewindow.$(OBJEXT) spoollist.$(OBJEXT) mailboxmenu.$(OBJEXT) \ Basemenu.$(OBJEXT) bbmail_OBJECTS = $(am_bbmail_OBJECTS) bbmail_DEPENDENCIES = bbmail_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/depcomp @AMDEP_TRUE@DEP_FILES = $(DEPDIR)/BaseDisplay.Po $(DEPDIR)/Basemenu.Po \ @AMDEP_TRUE@ $(DEPDIR)/Baseresource.Po $(DEPDIR)/Basewindow.Po \ @AMDEP_TRUE@ $(DEPDIR)/Image.Po $(DEPDIR)/LinkedList.Po \ @AMDEP_TRUE@ $(DEPDIR)/Timer.Po $(DEPDIR)/bbmail.Po \ @AMDEP_TRUE@ $(DEPDIR)/mailboxmenu.Po $(DEPDIR)/main.Po \ @AMDEP_TRUE@ $(DEPDIR)/resource.Po $(DEPDIR)/spoollist.Po CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ CXXFLAGS = @CXXFLAGS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(bbmail_SOURCES) NROFF = nroff MANS = $(man_MANS) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS TODO aclocal.m4 configure configure.in depcomp \ install-sh missing mkinstalldirs version.h.in DIST_SUBDIRS = $(SUBDIRS) SOURCES = $(bbmail_SOURCES) all: all-recursive .SUFFIXES: .SUFFIXES: .cc .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$@ $(SHELL) ./config.status $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) version.h: $(top_builddir)/config.status version.h.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) bbmail$(EXEEXT): $(bbmail_OBJECTS) $(bbmail_DEPENDENCIES) @rm -f bbmail$(EXEEXT) $(CXXLINK) $(bbmail_LDFLAGS) $(bbmail_OBJECTS) $(bbmail_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/BaseDisplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Basemenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Baseresource.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Basewindow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/LinkedList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Timer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/bbmail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mailboxmenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/resource.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/spoollist.Po@am__quote@ distclean-depend: -rm -rf $(DEPDIR) .cc.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< .cc.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `cygpath -w $<` CXXDEPMODE = @CXXDEPMODE@ uninstall-info-am: man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done # 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 tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(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 $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . # Avoid unsightly `./'. distdir = $(PACKAGE)-$(VERSION) GZIP_ENV = --best distdir: $(DISTFILES) -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/. @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done for subdir in $(SUBDIRS); 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: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(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 -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || (echo "Error: files left after uninstall" 1>&2; \ exit 1) ) \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && $(MAKE) $(AM_MAKEFLAGS) distclean \ && rm -f $(distdir).tar.gz \ && (test `find . -type f -print | wc -l` -eq 0 \ || (echo "Error: files left after distclean" 1>&2; \ exit 1) ) -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) 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)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) distclean: distclean-recursive -rm -f config.status config.cache config.log distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-man install-exec-am: install-binPROGRAMS install-info: install-info-recursive install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-recursive dist dist-all \ distcheck distclean distclean-compile distclean-depend \ distclean-generic distclean-recursive distclean-tags distdir \ dvi dvi-am dvi-recursive info info-am info-recursive install \ install-am install-binPROGRAMS install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-man1 \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am \ uninstall-info-recursive uninstall-man uninstall-man1 \ uninstall-recursive # 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: bbmail-0.8.3/NEWS0000644000175100017510000000000007051262521007120 bbmail-0.8.3/TODO0000644000175100017510000000025607342173023007127 ADD -lm in configure - fix fvwm2-restart - clean up program - add more documentation (including man-page) Possibly: - add some kind of tooltip to display info new message bbmail-0.8.3/aclocal.m40000644000175100017510000004036207644526712010315 # aclocal.m4 generated automatically by aclocal 1.5 # Copyright 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Do all the work for Automake. 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. # serial 5 # 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... # We require 2.13 because we rely on SHELL being computed by configure. AC_PREREQ([2.13]) # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. # The purpose of this macro is to provide the user with a means to # check macros which are provided without letting her know how the # information is coded. # If this macro is not defined by Autoconf, define it here. ifdef([AC_PROVIDE_IFELSE], [], [define([AC_PROVIDE_IFELSE], [ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) # ---------------------------------------------- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first]) fi # Define the identity of the package. PACKAGE=$1 AC_SUBST(PACKAGE)dnl VERSION=$2 AC_SUBST(VERSION)dnl ifelse([$3],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. ifdef([m4_pattern_allow], [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl # Autoconf 2.50 always computes EXEEXT. However we need to be # compatible with 2.13, for now. So we always define EXEEXT, but we # don't compute it. AC_SUBST(EXEEXT) # Similar for OBJEXT -- only we only use OBJEXT if the user actually # requests that it be used. This is a bit dumb. : ${OBJEXT=o} AC_SUBST(OBJEXT) # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_DEP_TRACK])dnl AC_REQUIRE([AM_SET_DEPDIR])dnl 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 ]) # # Check to make sure that the build environment is sane. # # 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)]) # serial 2 # 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= am_backtick='`' AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # 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], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # 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 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # 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" 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 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 # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type" AC_SUBST([$1DEPMODE]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST(DEPDIR) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) pushdef([subst], defn([AC_SUBST])) subst(AMDEPBACKSLASH) popdef([subst]) ]) # Generate code to set up dependency tracking. # This macro should only be invoked once -- use via AC_REQUIRE. # Usage: # AM_OUTPUT_DEPENDENCY_COMMANDS # # 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_OUTPUT_COMMANDS([ test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do case "$mf" in Makefile) dirpart=.;; */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`echo "$file" | sed -e 's|/[^/]*$||'` $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])]) # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done 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 | fgrep -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 ]) # serial 3 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. # # FIXME: Once using 2.50, use this: # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [errprint(__file__:__line__: [$0: invalid condition: $1 ])dnl m4exit(1)])dnl ifelse([$1], [FALSE], [errprint(__file__:__line__: [$0: invalid condition: $1 ])dnl m4exit(1)])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi]) bbmail-0.8.3/configure0000755000175100017510000056320707644526716010400 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $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" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.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 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 as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="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 || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export 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 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="bbmail.cc" ac_default_prefix=/usr/local # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # 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 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_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_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-debug create debugging code default=no --enable-interlace include code for image interlacingdefault=yes 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 Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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 # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` 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 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 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.53. 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. # Also quote any args containing shell meta-characters. ac_configure_args= ac_sep= for ac_arg do case $ac_arg in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n ) continue ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; esac # Get rid of the leading space. done # 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 if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && 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 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" # ./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/* | \ /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=`CDPATH=:; 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= am_backtick='`' { echo "$as_me:$LINENO: WARNING: ${am_backtick}missing' script is too old or missing" >&5 echo "$as_me: WARNING: ${am_backtick}missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="${MAKE}"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # 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 rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null # test to see if srcdir already configured if test "`CDPATH=:; 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 # Define the identity of the package. PACKAGE=bbmail VERSION=0.8.3 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. # Autoconf 2.50 always computes EXEEXT. However we need to be # compatible with 2.13, for now. So we always define EXEEXT, but we # don't compute it. # Similar for OBJEXT -- only we only use OBJEXT if the user actually # requests that it be used. This is a bit dumb. : ${OBJEXT=o} # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"} 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"} INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. for ac_prog in sed 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_regex_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$regex_cmd"; then ac_cv_prog_regex_cmd="$regex_cmd" # 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_regex_cmd="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi regex_cmd=$ac_cv_prog_regex_cmd if test -n "$regex_cmd"; then echo "$as_me:$LINENO: result: $regex_cmd" >&5 echo "${ECHO_T}$regex_cmd" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$regex_cmd" && break done if test x$regex_cmd = "x"; then { { echo "$as_me:$LINENO: error: error. sed is required to build the default bbtoolsrc file." >&5 echo "$as_me: error: error. sed is required to build the default bbtoolsrc file." >&2;} { (exit 1); exit 1; }; } fi # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" if test $enableval = "no"; then test "$CFLAGS" = "" && CFLAGS="-O2 -Wall" test "$CXXFLAGS" = "" && CXXFLAGS="-O2 -Wall" test "$LDFLAGS" = "" && LDFLAGS="-s" else test "$CFLAGS" = "" && CFLAGS="-g -Wall -DDEBUG" test "$CXXFLAGS" = "" && CXXFLAGS="-g -Wall -DDEBUG" test "$LDFLAGS" = "" && LDFLAGS="" fi else test "$CFLAGS" = "" && CFLAGS="-O2 -Wall" test "$CXXFLAGS" = "" && CXXFLAGS="-O2 -Wall" test "$LDFLAGS" = "" && LDFLAGS="-s" fi; INTERLACE="" echo "$as_me:$LINENO: checking whether to include interlacing image code" >&5 echo $ECHO_N "checking whether to include interlacing image code... $ECHO_C" >&6 # Check whether --enable-interlace or --disable-interlace was given. if test "${enable_interlace+set}" = set; then enableval="$enable_interlace" if test x$enableval = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 INTERLACE="-DINTERLACE" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 INTERLACE="-DINTERLACE" 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 set dummy "$as_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" 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" >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # 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" >&5 echo $ECHO_N "checking for C compiler default output... $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= for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; a.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 --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&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'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&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 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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) 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" >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f 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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext 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); } && { 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 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f 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 # 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>&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 \ ''\ '#include ' \ '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 #line $LINENO "configure" #include "confdefs.h" #include $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 fi rm -f 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 cat conftest.$ac_ext >&5 fi rm -f 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 ac_config_commands="$ac_config_commands default-1" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done 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 | fgrep -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 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 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 # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break 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" 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 &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f 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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext 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); } && { 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 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f 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 \ ''\ '#include ' \ '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 #line $LINENO "configure" #include "confdefs.h" #include $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 fi rm -f 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=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="$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 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 # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break 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" # 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" # ./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/* | \ /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=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. # 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 #line $LINENO "configure" #include "confdefs.h" #include 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=$? egrep -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 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 cat 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 #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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 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 cat 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. # 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 #line $LINENO "configure" #include "confdefs.h" #include 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=$? egrep -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 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 cat 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 #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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 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 cat 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" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&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 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 #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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 else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err 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 #line $LINENO "configure" #include "confdefs.h" #include _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 #line $LINENO "configure" #include "confdefs.h" #include _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 #line $LINENO "configure" #include "confdefs.h" #include #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 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core 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 #line $LINENO "configure" #include "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>&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 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f 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 ctype.h fcntl.h libgen.h locale.h process.h signal.h stdio.h time.h unistd.h sys/param.h sys/select.h sys/stat.h sys/time.h sys/types.h sys/wait.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 #line $LINENO "configure" #include "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>&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 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f 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 #line $LINENO "configure" #include "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=$? egrep -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 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 cat 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 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 preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; 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: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&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 echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext 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); } && { 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_time=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi for ac_func in setlocale sigaction strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* 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 $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done 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 #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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 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 cat 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 #line $LINENO "configure" #include "confdefs.h" #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat 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.$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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 ac_R_nospace=no fi rm -f 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 #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 ac_R_space=no fi rm -f 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 #line $LINENO "configure" #include "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 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat 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 #line $LINENO "configure" #include "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 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f 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 #line $LINENO "configure" #include "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 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f 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.$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 #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. */ #include /* 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 (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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 f = gethostbyname; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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 cat conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f 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 #line $LINENO "configure" #include "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 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the nameserver (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. */ #include /* 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 connect (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_connect) || defined (__stub___connect) choke me #else f = connect; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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_connect=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 connect (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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_socket_connect=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6 if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. */ #include /* 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 remove (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_remove) || defined (__stub___remove) choke me #else f = remove; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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_remove=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6 if test $ac_cv_func_remove = no; then echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 remove (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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_posix_remove=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6 if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. */ #include /* 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 shmat (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_shmat) || defined (__stub___shmat) choke me #else f = shmat; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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_shmat=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 shmat (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 IceConnectionNumber (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi CFLAGS="$CFLAGS $X_CFLAGS" CXXFLAGS="$CXXFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS" echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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_X11_XOpenDisplay=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_X11_XOpenDisplay=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 if test $ac_cv_lib_X11_XOpenDisplay = yes; then LDFLAGS="$LDFLAGS -lX11" else { { echo "$as_me:$LINENO: error: XOpenDisplay not found in -lX11" >&5 echo "$as_me: error: XOpenDisplay not found in -lX11" >&2;} { (exit 1); exit 1; }; } fi LDFLAGS="$LDFLAGS $X_EXTRA_LIBS" 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 #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -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 else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err 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 #line $LINENO "configure" #include "confdefs.h" #include _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 #line $LINENO "configure" #include "confdefs.h" #include _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 #line $LINENO "configure" #include "confdefs.h" #include #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 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core 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 for ac_header in malloc.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 #line $LINENO "configure" #include "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>&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 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f 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 #line $LINENO "configure" #include "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=$? egrep -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 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 cat 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 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 preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; 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: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&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 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 #line $LINENO "configure" #include "confdefs.h" #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } 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; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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>&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 cat conftest.$ac_ext >&5 fi rm -f 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 echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext 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); } && { 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_c_const=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext 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); } && { 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_time=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { struct tm *tp; tp->tm_sec; ; return 0; } _ACEOF rm -f conftest.$ac_objext 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); } && { 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_struct_tm=time.h else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi for ac_func in select strstr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* 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 $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext 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='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 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files version.h Makefile data/Makefile scripts/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $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" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="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 || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "data/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@DEPDIR@,$DEPDIR,;t t s,@regex_cmd@,$regex_cmd,;t t s,@INTERLACE@,$INTERLACE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@CPP@,$CPP,;t t s,@X_CFLAGS@,$X_CFLAGS,;t t s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t s,@X_LIBS@,$X_LIBS,;t t s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } 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 # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` 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 # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in default-1 ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do case "$mf" in Makefile) dirpart=.;; */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`echo "$file" | sed -e 's|/[^/]*$||'` $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi bbmail-0.8.3/configure.in0000644000175100017510000000420607644526625010766 dnl Process this file with autoconf to produce a configure script. AC_INIT(bbmail.cc) AM_INIT_AUTOMAKE(bbmail, 0.8.3) AC_PREFIX_DEFAULT(/usr/local) AC_CHECK_PROGS(regex_cmd, sed) if test x$regex_cmd = "x"; then AC_MSG_ERROR([error. sed is required to build the default bbtoolsrc file.]) fi dnl get the debug values right AC_DEFUN(AC_SET_DEBUG, [ test "$CFLAGS" = "" && CFLAGS="-g -Wall -DDEBUG" test "$CXXFLAGS" = "" && CXXFLAGS="-g -Wall -DDEBUG" test "$LDFLAGS" = "" && LDFLAGS="" ]) AC_DEFUN(AC_SET_NODEBUG, [ test "$CFLAGS" = "" && CFLAGS="-O2 -Wall" test "$CXXFLAGS" = "" && CXXFLAGS="-O2 -Wall" test "$LDFLAGS" = "" && LDFLAGS="-s" ]) AC_ARG_ENABLE(debug,[ --enable-debug create debugging code [default=no]], [ if test $enableval = "no"; then AC_SET_NODEBUG else AC_SET_DEBUG fi ], AC_SET_NODEBUG) dnl Check for Interlacing INTERLACE="" AC_MSG_CHECKING([whether to include interlacing image code]) AC_ARG_ENABLE( interlace, [ --enable-interlace include code for image interlacing[default=yes]], if test x$enableval = "xyes"; then AC_MSG_RESULT([yes]) INTERLACE="-DINTERLACE" else AC_MSG_RESULT([no]) fi, AC_MSG_RESULT([yes]) INTERLACE="-DINTERLACE" ) AC_SUBST(INTERLACE) dnl Checks for programs. dnl needed by configure itsself AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_HEADER_STDC AC_CHECK_HEADERS(ctype.h fcntl.h libgen.h locale.h process.h signal.h stdio.h time.h unistd.h sys/param.h sys/select.h sys/stat.h sys/time.h sys/types.h sys/wait.h) AC_HEADER_TIME AC_CHECK_FUNCS(setlocale sigaction strftime) AC_PATH_X AC_PATH_XTRA CFLAGS="$CFLAGS $X_CFLAGS" CXXFLAGS="$CXXFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS" dnl Checks for X libraries. AC_CHECK_LIB(X11, XOpenDisplay, LDFLAGS="$LDFLAGS -lX11", AC_MSG_ERROR(XOpenDisplay not found in -lX11)) LDFLAGS="$LDFLAGS $X_EXTRA_LIBS" dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(malloc.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_CHECK_FUNCS(select strstr) AC_OUTPUT(version.h Makefile data/Makefile scripts/Makefile) bbmail-0.8.3/depcomp0000555000175100017510000002752507371577713010042 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; tru64) # The Tru64 AIX compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. tmpdepfile1="$object.d" tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` if test "$libtool" = yes; then "$@" -Wc,-MD else "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. test -z "$dashmflag" && dashmflag=-M ( IFS=" " case " $* " in *" --mode=compile "*) # this is libtool, let us make it quiet for arg do # cycle over the arguments case "$arg" in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) # X makedepend ( shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift;; -*) ;; *) set fnord "$@" "$arg"; shift;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tail +3 "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 bbmail-0.8.3/install-sh0000755000175100017510000001272107051262521010442 #! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 bbmail-0.8.3/missing0000755000175100017510000001420207051262521010031 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` if test -z "$files"; then files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` test -z "$files" || files="$files.in" else files=`echo "$files" | sed -e 's/:/ /g'` fi test -z "$files" && files="config.h.in" touch $files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print \ | sed 's/^\(.*\).am$/touch \1.in/' \ | sh ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 bbmail-0.8.3/mkinstalldirs0000755000175100017510000000133407051262521011242 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here bbmail-0.8.3/version.h.in0000644000175100017510000000007307051262521010676 #define BBTOOL "bbmail" #define BBTOOL_VERSION "@VERSION@" bbmail-0.8.3/bbmail.cc0000644000175100017510000010614107344516164010205 // bbmail.cc for bbmail - an tool for display the mail in X11. // // Copyright (c) 1998-2000 by John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "bbmail.hh" #include "version.h" #include #include Checkmail::Checkmail(ToolWindow *toolwindow) { bbtool=toolwindow; timer=new BTimer(bbtool->getCurrentScreenInfo()->getBaseDisplay(),this) ; timer->setTimeout(bbtool->getResource()->report.check_delay*1000); timer->start(); broken=False; last_totalmail=0; last_newmail=0; new_mailbox=0; spoolfile = new LOCALSPOOLFILE[bbtool->getResource()->report.number_of_spoolfiles]; memset(spoolfile,0, sizeof(LOCALSPOOLFILE)*bbtool->getResource()->report.number_of_spoolfiles); number_of_checks=bbtool->getResource()->report.force_check_delay; } Checkmail::~Checkmail() { delete [] spoolfile; } void Checkmail::Reconfigure() { delete [] spoolfile; spoolfile = new LOCALSPOOLFILE[bbtool->getResource()->report.number_of_spoolfiles]; memset(spoolfile,0, sizeof(LOCALSPOOLFILE)*bbtool->getResource()->report.number_of_spoolfiles); number_of_checks=bbtool->getResource()->report.force_check_delay; timeout(); } bool Checkmail::CheckMaildir(int spoolno) { struct stat file_status, maildir_status; if (bbtool->getResource()->spoolfile[spoolno].filename==NULL) { fprintf(stderr,"No qmail maildir specified\n"); return(false); } if (stat(bbtool->getResource()->spoolfile[spoolno].filename, &file_status)!=0) { fprintf(stderr,"Could not read status spool file %s\n", bbtool->getResource()->spoolfile[spoolno].filename); return(false); } // check maildir new/ if (stat(bbtool->getResource()->spoolfile[spoolno].new_maildir, &maildir_status)!=0) { fprintf(stderr,"Could not read status new maildir: %s\n", bbtool->getResource()->spoolfile[spoolno].new_maildir); return(false); } if (maildir_status.st_mtime > file_status.st_mtime) { file_status.st_mtime = maildir_status.st_mtime; } if (stat(bbtool->getResource()->spoolfile[spoolno].cur_maildir, &maildir_status)!=0) { fprintf(stderr,"Could not read status current maildir: %s\n", bbtool->getResource()->spoolfile[spoolno].cur_maildir); return(false); } if (maildir_status.st_mtime > file_status.st_mtime) { file_status.st_mtime = maildir_status.st_mtime; } if (file_status.st_mtime != spoolfile[spoolno].last_mtime) { spoolfile[spoolno].last_mtime = file_status.st_mtime; spoolfile[spoolno].newmail=0; DIR *dir; if ((dir = opendir (bbtool->getResource()->spoolfile[spoolno].new_maildir)) == NULL) { fprintf(stderr,"Could not open maildir %s\n", bbtool->getResource()->spoolfile[spoolno].new_maildir); return false; } while (readdir (dir)) spoolfile[spoolno].newmail++; /* -2 for . and .. */ spoolfile[spoolno].newmail-=2; closedir(dir); if ((dir = opendir (bbtool->getResource()->spoolfile[spoolno].cur_maildir)) == NULL) { fprintf(stderr,"Could not open maildir %s\n", bbtool->getResource()->spoolfile[spoolno].new_maildir); return false; } spoolfile[spoolno].totalmail=spoolfile[spoolno].newmail; while (readdir (dir)) spoolfile[spoolno].totalmail++; /* -2 for . and .. */ spoolfile[spoolno].totalmail-=2; closedir(dir); } return(true); } bool Checkmail::CheckOther(int spoolno,bool force) { struct stat file_status; FILE *fp; int num[2]={-1,-1}; int number_of_values; if ((bbtool->getResource()->spoolfile[spoolno].proc==NULL)& (bbtool->getResource()->spoolfile[spoolno].proc==NULL)) { fprintf(stderr,"Nothing to do, no proc defined\n"); return(false); } if (bbtool->getResource()->spoolfile[spoolno].filename!=NULL) { if (stat(bbtool->getResource()->spoolfile[spoolno].filename, &file_status)!=0) { fprintf(stderr,"Could not read status spool file %s\n", bbtool->getResource()->spoolfile[spoolno].filename); return(false); } } if ((file_status.st_mtime != spoolfile[spoolno].last_mtime)&& (bbtool->getResource()->spoolfile[spoolno].filename!=NULL)|| (force && bbtool->getResource()->spoolfile[spoolno].force_check)) { if (bbtool->getResource()->spoolfile[spoolno].second_ignore) number_of_values=1; else number_of_values=2; spoolfile[spoolno].last_mtime = file_status.st_mtime; int old_newmail=spoolfile[spoolno].newmail; spoolfile[spoolno].newmail=0; spoolfile[spoolno].totalmail=0; if (bbtool->getResource()->spoolfile[spoolno].proc!=NULL) { if ((fp=(FILE*)popen(bbtool->getResource()->spoolfile[spoolno].proc, "r")) == NULL) { fprintf(stderr,"Could not run command %s\n", bbtool->getResource()->spoolfile[spoolno].proc); return(false); } else { while (!(feof(fp))) { if (ReadPipe(fp,num,number_of_values)!=0) { if (num[0]>old_newmail) new_mailbox=spoolno; #ifdef DEBUG fprintf(stderr,"first int: %i, second int %i\n",num[0],num[1]); #endif spoolfile[spoolno].newmail+=num[0]; spoolfile[spoolno].totalmail+=num[1]; } else { if ((num[0]==-1)&(num[1]==-1)) { pclose(fp); return(false); } } } pclose(fp); } } if (bbtool->getResource()->spoolfile[spoolno].reversedProc!=NULL) { if ((fp=(FILE*)popen( bbtool->getResource()->spoolfile[spoolno].reversedProc, "r")) == NULL) { fprintf(stderr,"Could not run command %s\n", bbtool->getResource()->spoolfile[spoolno].reversedProc); return(false); } else { while (!(feof(fp))) { if (ReadPipe(fp,num,number_of_values)!=0) { if (num[1]>old_newmail) new_mailbox=spoolno; spoolfile[spoolno].newmail+=num[1]; spoolfile[spoolno].totalmail+=num[0]; } } pclose(fp); } } if (!bbtool->getResource()->spoolfile[spoolno].first_is_new) spoolfile[spoolno].newmail=spoolfile[spoolno].totalmail- spoolfile[spoolno].newmail; if (!bbtool->getResource()->spoolfile[spoolno].second_is_total) spoolfile[spoolno].totalmail=spoolfile[spoolno].newmail+ spoolfile[spoolno].totalmail; } return(true); } void Checkmail::forceCheck() { timeout(); } bool Checkmail::getChar(char *string,int *index) { bool special=false; if (string[*index]=='\\') { (*index)++; } else { if ((string[*index]=='[')|(string[*index]==']')) special=true; } return(special); } bool Checkmail::checkStatusFlag(char *status_flag,int spoolno) { int i,x,len; bool passed; len=strlen(bbtool->getResource()->spoolfile[spoolno].statusFlag); for (i=0,x=0;igetResource()->spoolfile[spoolno].statusFlag,&i)) { if ((bbtool->getResource()->spoolfile[spoolno].statusFlag[i]=='[')) { passed=false; while ((bbtool->getResource()->spoolfile[spoolno].statusFlag[i]!=']') & (igetResource()->spoolfile[spoolno].statusFlag, &i)) if (bbtool->getResource()->spoolfile[spoolno].statusFlag[i]== status_flag[x]) { passed=true; } } if (!passed) return false; } else { fprintf(stderr,"unexpected token in statusFlag\n"); } } else if (bbtool->getResource()->spoolfile[spoolno].statusFlag[i]!=status_flag[x]) return(false); } return(true); } bool Checkmail::CheckMbox(int spoolno) { int readmail=0; int mailcount=0; FILE *spool_id; bool read_status=True; char mailbuf[128]; struct stat file_status; int len; struct utimbuf ut; if (bbtool->getResource()->spoolfile[spoolno].filename==NULL) { fprintf(stderr,"No mbox mailfile specified\n"); return(false); } if (!(spool_id = fopen(bbtool->getResource()->spoolfile[spoolno].filename, "r"))) { fprintf(stderr,"Could not open mail spool file %s\n", bbtool->getResource()->spoolfile[spoolno].filename); return(false); } fstat(fileno(spool_id),&file_status); if(file_status.st_mtime != spoolfile[spoolno].last_mtime || file_status.st_size != spoolfile[spoolno].last_size) { spoolfile[spoolno].last_mtime = file_status.st_mtime; spoolfile[spoolno].last_size = file_status.st_size; len = strlen(bbtool->getResource()->spoolfile[spoolno].statusFlag); while(fgets(mailbuf, 127, spool_id)) { if(!strncmp(mailbuf, "From ", 5)) { mailcount++; read_status=False; } else if (checkStatusFlag(mailbuf,spoolno)) { if(!read_status) { readmail++; read_status=True; } } else if (!strncmp(mailbuf,"Subject",7)) { if (!strncmp(&mailbuf[9], "DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA",49)!=0) { mailcount--; read_status=True; } } } if ((mailcount-readmail)>spoolfile[spoolno].newmail) new_mailbox=spoolno; spoolfile[spoolno].newmail=mailcount-readmail; spoolfile[spoolno].totalmail=mailcount; #ifdef DEBUG fprintf(stderr,"mailcount=%d, readmail=%d, spoolno=%d\n",mailcount, readmail,spoolno); #endif } fclose(spool_id); ut.actime = file_status.st_atime; ut.modtime = file_status.st_mtime; utime(bbtool->getResource()->spoolfile[spoolno].filename, &ut); return(true); } void Checkmail::timeout() { int totalmail=0; bool change_raise=False; bool force=False; int i,old_total,old_new; bool redraw=False; newmail=0; broken=False; if (bbtool->getResource()->report.force_check) { if (bbtool->getResource()->report.force_check_delay==number_of_checks) { force=True; number_of_checks=0; } else { number_of_checks++; #ifdef DEBUG fprintf(stderr,"number_of_checks %i\n",number_of_checks); #endif } } for (i=0;igetResource()->report.number_of_spoolfiles;i++) { old_new=spoolfile[i].newmail; old_total=spoolfile[i].totalmail; if (bbtool->getResource()->spoolfile[i].type==SpoolList::other) { if (!(CheckOther(i,force))) { broken=True; } else { newmail+=spoolfile[i].newmail; totalmail+=spoolfile[i].totalmail; if ((spoolfile[i].newmail!=old_new)|(spoolfile[i].totalmail!=old_total)) bbtool->mbmenu->UpdateNumbers(spoolfile[i].newmail, spoolfile[i].totalmail,i); } } else if (bbtool->getResource()->spoolfile[i].type==SpoolList::mbox) { if (!(CheckMbox(i))) broken=True; else { totalmail+=spoolfile[i].totalmail; newmail+=spoolfile[i].newmail; if ((spoolfile[i].newmail!=old_new)|(spoolfile[i].totalmail!=old_total)) bbtool->mbmenu->UpdateNumbers(spoolfile[i].newmail, spoolfile[i].totalmail,i); } } else if (bbtool->getResource()->spoolfile[i].type==SpoolList::maildir) { if (!(CheckMaildir(i))) broken=True; else { totalmail+=spoolfile[i].totalmail; newmail+=spoolfile[i].newmail; if ((spoolfile[i].newmail!=old_new)|(spoolfile[i].totalmail!=old_total)) bbtool->mbmenu->UpdateNumbers(spoolfile[i].newmail, spoolfile[i].totalmail,i); } } } if (bbtool->mbmenu->isVisible() && bbtool->mbmenu->WaitForUpdate()) bbtool->mbmenu->Update(); if (newmail>last_newmail) change_raise = True; else { /* are there ny not empty mailboxes left */ for (i=0;igetResource()->report.number_of_spoolfiles;i++) { if (spoolfile[i].newmail!=0) { new_mailbox=i; // change_raise = True; } } } if ((newmail!=last_newmail)|(totalmail!=last_totalmail)|(broken) ) redraw=True; last_newmail=newmail; last_totalmail=totalmail; if (redraw) bbtool->Redraw(change_raise); } int Checkmail::ReadPipe(FILE *fp,int num[2],int number_of_values) { int i=0; bool found=False; bool newline=False; int x=0; char ch[6]={0,0,0,0,0,0}; while (!(feof(fp))&(x!=number_of_values)&(ch[i]!='\n')&(!newline)) { fread(&ch[i],1,1,fp); while ((ch[i]>='0' && ch[i] <='9' && ch[1]!='\n')&(!feof(fp))) { i++; if (i==7) return(0); fread(&ch[i],1,1,fp); found=True; } if (ch[i]=='\n') newline=True; if (found) { ch[i]='\0'; num[x]=atoi(ch); i=0; x++; found=False; } } /* skip to next line */ while (!(feof(fp))&(ch[0]!='\n')&(!newline)) fread(&ch[0],1,1,fp); return(x); } ToolWindow::ToolWindow(int argc,char **argv,struct CMDOPTIONS *options): Basewindow(argc,argv,options) { spooldir=options->spooldir; frame.x=0; frame.y=0; /* initialize image */ envelopePushed=False; close_app=False; /* initialize xrm database */ XrmInitialize(); resource = new Resource(this); pixmaplist = new PIXMAPLIST[resource->report.number_of_spoolfiles]; MakeWindow(False); checkmail=new Checkmail(this); Redraw(False); checkmail->forceCheck(); eventLoop(); } ToolWindow::~ToolWindow() { int i; XUnmapWindow(getXDisplay(),framewin); /* destroy pixmaps */ if (pixmap.frame) getImageControl()->removeImage(pixmap.frame); if (pixmap.label) getImageControl()->removeImage(pixmap.label); if (pixmap.envelope) getImageControl()->removeImage(pixmap.envelope); /* destroy windows */ for (i=0;iremoveImage(pixmaplist[i].envelope_newmail); if (pixmaplist[i].envelope_newmail_pressed) getImageControl()->removeImage(pixmaplist[i].envelope_newmail_pressed); } if (frameGC) XFreeGC(getXDisplay(),frameGC); if (labelGC) XFreeGC(getXDisplay(),labelGC); if (menuGC) XFreeGC(getXDisplay(),menuGC); if (menuHiBGGC) XFreeGC(getXDisplay(),menuHiBGGC); if (menuHiGC) XFreeGC(getXDisplay(),menuHiGC); if (menuFrameGC) XFreeGC(getXDisplay(),menuFrameGC); if (labelwin) XDestroyWindow(getXDisplay(),labelwin); if (envelopewin) XDestroyWindow(getXDisplay(),envelopewin); XDestroyWindow(getXDisplay(),framewin); delete resource; } void ToolWindow::reconfigure(void) { int i; /* destroy pixmaps */ getImageControl()->removeImage(pixmap.frame); getImageControl()->removeImage(pixmap.label); getImageControl()->removeImage(pixmap.envelope); getImageControl()->removeImage(pixmap.envelope_pressed); for (i=0;ireport.number_of_spoolfiles;i++) { getImageControl()->removeImage(pixmaplist[i].envelope_newmail); getImageControl()->removeImage(pixmaplist[i].envelope_newmail_pressed); } mbmenu->ClearMenu(); delete [] pixmaplist; resource->Reload(); mbmenu->Reconfigure(); checkmail->Reconfigure(); pixmaplist = new PIXMAPLIST[resource->report.number_of_spoolfiles]; MakeWindow(True); if (resource->show.label) XClearWindow(getXDisplay(), labelwin); XClearWindow(getXDisplay(), envelopewin); XClearWindow(getXDisplay(), framewin); Redraw(False); } void ToolWindow::saveMenuSearch(Window window,Basemenu *menu) { menuwin=window; } void ToolWindow::removeMenuSearch(Window window) { menuwin= (Window )NULL; } Resource *ToolWindow::getResource() { return resource; } void ToolWindow::MakeWindow(bool reconfigure) { XSetWindowAttributes attrib; XWMHints wmhints; int i; max_value=1; for (i=0;ireport.number_of_digits;i++) max_value*=10; max_value-=1; unsigned long create_mask = CWBackPixmap|CWCursor|CWEventMask; frame.height=resource->frame.font->ascent + resource->frame.font->descent+4*resource->frame.bevelWidth; if (resource->show.envelope) { envelope.height=frame.height-2*resource->frame.bevelWidth - 2*resource->envelope.bevelHeight; envelope.width=(envelope.height*3)/2; if (!(fmod((double)envelope.width,2.0) > 0.0)) envelope.width++; } else envelope.width=0; label.width=label.width0=label.width1=label.width2=label.width3=0; int extra_space=0; if (resource->show.label) { label.width0 = XTextWidth(resource->label.font,"0",strlen("0")); if (resource->show.newmail_counter) label.width1 = resource->report.number_of_digits*label.width0; if (resource->show.totalmail_counter) label.width3 = resource->report.number_of_digits*label.width0; if ((resource->show.totalmail_counter) & (resource->show.newmail_counter)) label.width2 = XTextWidth(resource->label.font,"/",strlen("/")); label.height=frame.height-2*resource->frame.bevelWidth; extra_space=resource->frame.bevelWidth; label.width=label.width1 + label.width2 + label.width3 + 2*resource->frame.bevelWidth; } frame.width =label.width + extra_space + envelope.width + resource->frame.bevelWidth*2+resource->envelope.bevelWidth*2; if (resource->position.mask & XNegative) resource->position.x = getCurrentScreenInfo()->getWidth()+ resource->position.x-frame.width; if (resource->position.mask & YNegative) resource->position.y = getCurrentScreenInfo()->getHeight()+ resource->position.y-frame.height; if (!withdrawn) { frame.x=resource->position.x; frame.y=resource->position.y; } attrib.background_pixmap = ParentRelative; pixmap.frame = getImageControl()->renderImage(frame.width, frame.height, &resource->frame.texture); if (withdrawn) { wmhints.initial_state = WithdrawnState; } else { wmhints.initial_state = NormalState; } attrib.cursor = getSessionCursor(); attrib.event_mask = ButtonPressMask | ButtonReleaseMask | ExposureMask | FocusChangeMask | KeyPressMask | StructureNotifyMask; if (!reconfigure) { framewin = XCreateWindow(getXDisplay(), getCurrentScreenInfo()->getRootWindow(), frame.x, frame.y, frame.width, frame.height, 0, getCurrentScreenInfo()->getDepth(), InputOutput,getCurrentScreenInfo()->getVisual(), create_mask, &attrib); } else if (!withdrawn) { XMoveResizeWindow(getXDisplay(),framewin,frame.x, frame.y, frame.width, frame.height); } else { XResizeWindow(getXDisplay(),framewin,frame.width, frame.height); } wmhints.flags = IconWindowHint | StateHint; wmhints.icon_window = framewin; // XSetStandardProperties(getXDisplay(),framewin,BBTOOL, // BBTOOL, None,getArgv(),getArgc(),NULL); XTextProperty windowname; XClassHint classhints; char *name=BBTOOL; XSizeHints sizehints; classhints.res_name=BBTOOL; classhints.res_class="bbtools"; sizehints.x=getResource()->position.x; sizehints.y=getResource()->position.y; sizehints.max_width=sizehints.min_width=frame.width; sizehints.max_height=sizehints.min_height=frame.height; sizehints.flags=USPosition|PMinSize|PMaxSize; XStringListToTextProperty(&name,1,&windowname); XSetWMProperties(getXDisplay(),framewin,&windowname,NULL,getArgv(),getArgc(), &sizehints,&wmhints,&classhints); Atom wmproto[2]; wmproto[0]=wm_delete_window; wmproto[1]=getBlackboxStructureMessagesAtom(); XSetWMProtocols(getXDisplay(), framewin,wmproto, 2); if (!decorated&&!withdrawn) { BlackboxHints bb_hints; bb_hints.decoration =DecorNone; bb_hints.attrib = AttribOmnipresent; bb_hints.flags = AttribDecoration|AttribOmnipresent; XChangeProperty(getXDisplay(), framewin, getBlackboxHintsAtom(), getBlackboxHintsAtom(), 32, PropModeReplace, (unsigned char *) &bb_hints, PropBlackboxHintsElements); } if (!shape) XSetWindowBackgroundPixmap(getXDisplay(), framewin, pixmap.frame); if (resource->show.label) { if (!resource->label.transparent) pixmap.label = getImageControl()->renderImage(label.width, label.height, &resource->label.texture); if (!reconfigure) labelwin = XCreateWindow(getXDisplay(), framewin, 2*resource->frame.bevelWidth +envelope.width+2*resource->envelope.bevelWidth, resource->frame.bevelWidth, label.width, label.height, 0, getCurrentScreenInfo()->getDepth(), InputOutput, getCurrentScreenInfo()->getVisual(), create_mask, &attrib); else XMoveResizeWindow(getXDisplay(),labelwin, 2*resource->frame.bevelWidth+ envelope.width+2*resource->envelope.bevelWidth, resource->frame.bevelWidth, label.width, label.height); if (!resource->label.transparent) XSetWindowBackgroundPixmap(getXDisplay(), labelwin, pixmap.label); } if (resource->show.envelope) { pixmap.envelope = getImageControl()->renderImage(envelope.width, envelope.height, &resource->envelope.texture); pixmap.envelope_pressed = getImageControl()->renderImage(envelope.width, envelope.height, &resource->envelope.texture_pressed); for (i=0;ireport.number_of_spoolfiles;i++) { pixmaplist[i].envelope_newmail = getImageControl()->renderImage(envelope.width, envelope.height, &resource->spoolfile[i].newmail_texture); pixmaplist[i].envelope_newmail_pressed = getImageControl()->renderImage(envelope.width, envelope.height, &resource->spoolfile[i].newmail_pressed_texture); } if (!reconfigure) envelopewin = XCreateWindow(getXDisplay(), framewin, resource->frame.bevelWidth+resource->envelope.bevelWidth, resource->frame.bevelWidth+resource->envelope.bevelWidth, envelope.width, envelope.height, 0, getCurrentScreenInfo()->getDepth(), InputOutput,getCurrentScreenInfo()->getVisual(), create_mask, &attrib); else XMoveResizeWindow(getXDisplay(),envelopewin, resource->frame.bevelWidth+resource->envelope.bevelWidth, resource->frame.bevelWidth+resource->envelope.bevelWidth, envelope.width, envelope.height); points[0].x = 2; points[0].y = 2; points[1].x = envelope.width/2; points[1].y = (envelope.height*2)/3; points[2].x = envelope.width-3; points[2].y = 2; points[3].x=2; points[3].y=envelope.height-3; points[4].x=envelope.width/3; points[4].y=envelope.height/2-1; points[5].x=envelope.width-3; points[5].y=envelope.height-3; points[6].x=(envelope.width*2)/3; points[6].y=envelope.height/2; points[7].x=envelope.width/3; points[7].y=2; points[8].x=(envelope.width*2)/3-1; points[8].y=envelope.height/2; points[9].x=(envelope.width*2)/3-1; points[9].y=2; points[10].x=envelope.width/3; points[10].y=envelope.height/2; } if (!reconfigure) { if (resource->show.label) { gcv.foreground = resource->label.newmail_textColor.getPixel(); gcv.font = resource->label.font->fid; labelGC = XCreateGC(getXDisplay(), labelwin,GCFont, &gcv); } gcv.foreground = resource->envelope.textColor.getPixel(); gcv.font = resource->frame.font->fid; frameGC = XCreateGC(getXDisplay(), framewin,GCFont, &gcv); gcv.font = resource->menu.font->fid; gcv.foreground = resource->menu.texture.getColor()->getPixel(); menuGC = XCreateGC(getXDisplay(), framewin,GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.highlightColor.getPixel(); gcv.arc_mode = ArcChord; gcv.fill_style = FillSolid; menuHiBGGC = XCreateGC(getXDisplay(), framewin,GCForeground| GCFillStyle|GCArcMode, &gcv); gcv.foreground = resource->menu.hitextColor.getPixel(); menuHiGC = XCreateGC(getXDisplay(), framewin, GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.textColor.getPixel(); menuFrameGC = XCreateGC(getXDisplay(), framewin,GCFont|GCForeground, &gcv); mbmenu = new Mailboxmenu(this); mbmenu->Update(); } else { if (resource->show.label) { gcv.foreground = resource->label.newmail_textColor.getPixel(); gcv.font = resource->label.font->fid; XChangeGC(getXDisplay(),labelGC,GCFont, &gcv); } gcv.foreground = resource->envelope.textColor.getPixel(); gcv.font = resource->frame.font->fid; XChangeGC(getXDisplay(),frameGC,GCFont, &gcv); gcv.font = resource->menu.font->fid; gcv.foreground = resource->menu.texture.getColor()->getPixel(); XChangeGC(getXDisplay(), menuGC,GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.highlightColor.getPixel(); XChangeGC(getXDisplay(), menuHiBGGC,GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.hitextColor.getPixel(); XChangeGC(getXDisplay(), menuHiGC, GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.textColor.getPixel(); XChangeGC(getXDisplay(), menuFrameGC,GCFont|GCForeground, &gcv); } if (!reconfigure) { XClearWindow(getXDisplay(), framewin); XMapWindow(getXDisplay(), framewin); XMapSubwindows(getXDisplay(), framewin); mapped=true; if (!decorated&&!withdrawn) XMoveResizeWindow(getXDisplay(),framewin,frame.x, frame.y, frame.width, frame.height); } } void ToolWindow::Redraw(bool change_raise) { if (resource->show.label) { char t[6]; if (resource->show.label) XClearWindow(getXDisplay(),labelwin); if (resource->show.newmail_counter) { if (checkmail->getNewmail()==0) XSetForeground(getXDisplay(),labelGC, resource->label.newmail_boring_textColor.getPixel()); else XSetForeground(getXDisplay(),labelGC, resource->label.newmail_textColor.getPixel()); if (checkmail->getNewmail()getNewmail()); int xposition=(resource->report.number_of_digits-strlen(t)) *label.width0 + resource->frame.bevelWidth; XDrawString(getXDisplay(), labelwin, labelGC, xposition, (label.height+resource->label.font->ascent- resource->label.font->descent) / 2, t, strlen(t)); } else { sprintf(t, ">"); int xposition=(resource->report.number_of_digits-strlen(t))* label.width0 + resource->frame.bevelWidth; XDrawString(getXDisplay(), labelwin, labelGC, xposition, (label.height+resource->label.font->ascent- resource->label.font->descent) / 2, t, strlen(t)); } } if (resource->show.totalmail_counter) { int totalmail_xposition=label.width0; if (resource->show.newmail_counter) { if ((checkmail->getLastTotalmail()==0)|(checkmail->getNewmail()==0)) XSetForeground(getXDisplay(),labelGC, resource->label.seperator_boring_textColor.getPixel()); else XSetForeground(getXDisplay(),labelGC, resource->label.seperator_textColor.getPixel()); sprintf(t, "/"); XDrawString(getXDisplay(), labelwin, labelGC, label.width1 + resource->frame.bevelWidth, (label.height+resource->label.font->ascent- resource->label.font->descent) / 2,t, strlen(t)); totalmail_xposition=label.width1+label.width2 + resource->frame.bevelWidth; } if (checkmail->getLastTotalmail()>max_value) { sprintf(t, ">"); XDrawString(getXDisplay(), labelwin, labelGC, totalmail_xposition, (label.height+resource->label.font->ascent- resource->label.font->descent) / 2,t, strlen(t)); } else { if (checkmail->getLastTotalmail()==0) XSetForeground(getXDisplay(),labelGC, resource->label.totalmail_boring_textColor.getPixel()); else XSetForeground(getXDisplay(),labelGC, resource->label.totalmail_textColor.getPixel()); sprintf(t, "%02d", checkmail->getLastTotalmail()); if (!(resource->show.newmail_counter)) totalmail_xposition-=label.width0/2-1; XDrawString(getXDisplay(), labelwin, labelGC, totalmail_xposition, (label.height+resource->label.font->ascent- resource->label.font->descent) / 2,t, strlen(t)); } } } if (checkmail->getNewmail()==0) { mbmenu->setHighlight(-1); if (resource->show.envelope) { if (envelopePushed) XSetWindowBackgroundPixmap(getXDisplay(), envelopewin, pixmap.envelope_pressed); else XSetWindowBackgroundPixmap(getXDisplay(), envelopewin, pixmap.envelope); XSetForeground(getXDisplay(),frameGC, resource->envelope.textColor.getPixel()); XClearWindow(getXDisplay(),envelopewin); XDrawLines(getXDisplay(),envelopewin,frameGC,points,3,CoordModeOrigin); XDrawLine(getXDisplay(), envelopewin, frameGC, points[3].x, points[3].y, points[4].x, points[4].y); XDrawLine(getXDisplay(), envelopewin, frameGC, points[5].x, points[5].y, points[6].x, points[6].y); if (checkmail->getBroken()) { XSetForeground(getXDisplay(),frameGC, resource->envelope.error_textColor.getPixel()); XSetLineAttributes(getXDisplay(),frameGC,2,LineSolid,CapButt,JoinMiter); XDrawLine(getXDisplay(), envelopewin, frameGC, points[7].x, points[7].y, points[8].x, points[8].y); XDrawLine(getXDisplay(), envelopewin, frameGC, points[9].x, points[9].y, points[10].x, points[10].y); XSetLineAttributes(getXDisplay(),frameGC,0,LineSolid,CapButt,JoinMiter); } } if (resource->show.onlyAtNewMail&mapped) { XUnmapSubwindows(getXDisplay(),framewin); XUnmapWindow(getXDisplay(),framewin); mapped=false; } } else { if (resource->show.envelope) { mbmenu->setHighlight(checkmail->getNewMailbox()); if (envelopePushed) XSetWindowBackgroundPixmap(getXDisplay(), envelopewin, pixmaplist[checkmail->getNewMailbox()].envelope_newmail_pressed); else XSetWindowBackgroundPixmap(getXDisplay(), envelopewin, pixmaplist[checkmail->getNewMailbox()].envelope_newmail); XSetForeground(getXDisplay(),frameGC, resource->spoolfile[checkmail->getNewMailbox()]. newmail_textColor.getPixel()); XClearWindow(getXDisplay(),envelopewin); XDrawLines(getXDisplay(),envelopewin,frameGC,points,3,CoordModeOrigin); XDrawLine(getXDisplay(), envelopewin, frameGC, points[3].x, points[3].y, points[4].x, points[4].y); XDrawLine(getXDisplay(), envelopewin, frameGC,points[5].x, points[5].y, points[6].x, points[6].y); if (checkmail->getBroken()) { XSetForeground(getXDisplay(),frameGC, resource->spoolfile[checkmail->getNewMailbox()]. newmail_error_textColor.getPixel()); XSetLineAttributes(getXDisplay(),frameGC,2,LineSolid,CapButt,JoinMiter); XDrawLine(getXDisplay(), envelopewin, frameGC, points[7].x, points[7].y, points[8].x, points[8].y); XDrawLine(getXDisplay(), envelopewin, frameGC, points[9].x, points[9].y, points[10].x, points[10].y); XSetLineAttributes(getXDisplay(),frameGC,0,LineSolid,CapButt,JoinMiter); } } if ((resource->show.onlyAtNewMail) & (!(mapped))) { XMapSubwindows(getXDisplay(),framewin); XMapWindow(getXDisplay(),framewin); mapped=true; } if (change_raise) { if (resource->spoolfile[checkmail->getNewMailbox()].bell) XBell(getXDisplay(),100); if ((resource->spoolfile[checkmail->getNewMailbox()].newmailProc!=NULL)); system(resource->spoolfile[checkmail->getNewMailbox()].newmailProc); if ((resource->report.auto_raise)&(!(raised))) { XRaiseWindow(getXDisplay(),framewin); raised=True; } } } } void ToolWindow::process_event(XEvent *Event) { /* process events */ switch (Event->type) { case ClientMessage: { if ((unsigned)Event->xclient.data.l[0]==wm_delete_window) shutdown(); } break; case Expose: { if (Event->xexpose.window==menuwin) mbmenu->exposeEvent(&Event->xexpose); else Redraw(False); } break; case ButtonPress: { if (Event->xbutton.window == menuwin) mbmenu->buttonPressEvent(&Event->xbutton); else { if (Event->xbutton.button == LEFT_BUTTON) { if (!(raised)) { XRaiseWindow(getXDisplay(),framewin); raised=True; } if (Event->xbutton.window==envelopewin) { envelopePushed=True; Redraw(False); } } else if (Event->xbutton.button == MIDDLE_BUTTON) { if (raised) { XLowerWindow(getXDisplay(),framewin); raised=False; } } else if (Event->xbutton.button == RIGHT_BUTTON) { if (Event->xbutton.window==envelopewin) { if (!envelopePushed) { envelopePushed=True; Redraw(False); if (mbmenu->isVisible()) mbmenu->hide(); else { if (mbmenu->WaitForUpdate()) mbmenu->Update(); mbmenu->Move(frame.x,frame.y,withdrawn); mbmenu->show(); } } else { envelopePushed=False; Redraw(False); mbmenu->hide(); } } } } } break; case ButtonRelease: { if (Event->xbutton.window == menuwin) mbmenu->buttonReleaseEvent(&Event->xbutton); else { if (Event->xbutton.button == LEFT_BUTTON) { if (Event->xbutton.window==envelopewin) { envelopePushed=False; Redraw(False); if (Event->xbutton.x > 0 && Event->xbutton.x < envelope.width && Event->xbutton.y >0 && Event->xbutton.y < envelope.height ) { if (checkmail->getNewmail()!=0) system(resource-> spoolfile[checkmail->getNewMailbox()].runCommand); else system(resource->report.runCommand); } } } /* if (Event->xbutton.button == RIGHT_BUTTON) { if (Event->xbutton.window==envelopewin) { } }*/ } } break; case MotionNotify: { if (Event->xmotion.window==menuwin) mbmenu->motionNotifyEvent(&Event->xmotion); } break; case EnterNotify: { if (Event->xcrossing.window==menuwin) mbmenu->enterNotifyEvent(&Event->xcrossing); } break; case LeaveNotify: { if (Event->xcrossing.window==menuwin) mbmenu->leaveNotifyEvent(&Event->xcrossing); } break; case ConfigureNotify: { if (Event->xconfigure.window==framewin && Event->xconfigure.send_event) { if (withdrawn) { reconfigure(); } int parent_x,parent_y; Window parent_root; unsigned int parent_width; unsigned int parent_height; unsigned int parent_border_width; unsigned int parent_depth; if (withdrawn) { XGetGeometry(getXDisplay(),Event->xconfigure.above,&parent_root, &parent_x,&parent_y,&parent_width,&parent_height, &parent_border_width,&parent_depth); frame.x=Event->xconfigure.x+parent_x; frame.y=Event->xconfigure.y+parent_y; } else { frame.x=Event->xconfigure.x; frame.y=Event->xconfigure.y; if (decorated) { if (position==NULL) position= new char [13]; sprintf(position,"+%i+%i",frame.x,frame.y); } } if (mbmenu->isVisible()) mbmenu->show(); } } } /* switch */ } bbmail-0.8.3/Image.cc0000644000175100017510000017414107270530047010000 // Image.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // 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. // stupid macros needed to access some functions in version 2 of the GNU C // library #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H #include "BaseDisplay.hh" #include "Image.hh" #ifdef HAVE_SYS_TYPES_H # include #endif // HAVE_SYS_TYPES_H #ifndef u_int32_t # ifdef uint_32_t typedef uint32_t u_int32_t; # else # ifdef __uint32_t typedef __uint32_t u_int32_t; # else typedef unsigned int u_int32_t; # endif # endif #endif #ifdef STDC_HEADERS # include # include #endif // STDC_HEADERS #ifdef HAVE_STDIO_H # include #endif // HAVE_STDIO_H #ifdef HAVE_CTYPE_H # include #endif // HAVE_CTYPE_H static unsigned long bsqrt(unsigned long x) { if (x <= 0) return 0; if (x == 1) return 1; unsigned long r = x >> 1; unsigned long q; while (1) { q = x / r; if (q >= r) return r; r = (r + q) >> 1; } } BImage::BImage(BImageControl *c, unsigned int w, unsigned int h) { control = c; width = ((signed) w > 0) ? w : 1; height = ((signed) h > 0) ? h : 1; red = new unsigned char[width * height]; green = new unsigned char[width * height]; blue = new unsigned char[width * height]; xtable = ytable = (unsigned int *) 0; cpc = control->getColorsPerChannel(); cpccpc = cpc * cpc; control->getColorTables(&red_table, &green_table, &blue_table, &red_offset, &green_offset, &blue_offset, &red_bits, &green_bits, &blue_bits); if (control->getVisual()->c_class != TrueColor) control->getXColorTable(&colors, &ncolors); } BImage::~BImage(void) { if (red) delete [] red; if (green) delete [] green; if (blue) delete [] blue; } Pixmap BImage::render(BTexture *texture) { if (texture->getTexture() & BImage_ParentRelative) return ParentRelative; else if (texture->getTexture() & BImage_Solid) return render_solid(texture); else if (texture->getTexture() & BImage_Gradient) return render_gradient(texture); return None; } Pixmap BImage::render_solid(BTexture *texture) { Pixmap pixmap = XCreatePixmap(control->getBaseDisplay()->getXDisplay(), control->getDrawable(), width, height, control->getDepth()); if (pixmap == None) { fprintf(stderr, "BImage::render_solid: error creating pixmap\n"); return None; } XGCValues gcv; GC gc, hgc, lgc; gcv.foreground = texture->getColor()->getPixel(); gcv.fill_style = FillSolid; gc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, GCForeground | GCFillStyle, &gcv); gcv.foreground = texture->getHiColor()->getPixel(); hgc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, GCForeground, &gcv); gcv.foreground = texture->getLoColor()->getPixel(); lgc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, GCForeground, &gcv); XFillRectangle(control->getBaseDisplay()->getXDisplay(), pixmap, gc, 0, 0, width, height); #ifdef INTERLACE if (texture->getTexture() & BImage_Interlaced) { gcv.foreground = texture->getColorTo()->getPixel(); GC igc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, GCForeground, &gcv); register unsigned int i = 0; for (; i < height; i += 2) XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, igc, 0, i, width, i); XFreeGC(control->getBaseDisplay()->getXDisplay(), igc); } #endif // INTERLACE if (texture->getTexture() & BImage_Bevel1) { if (texture->getTexture() & BImage_Raised) { XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, 0, height - 1, width - 1, height - 1); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, width - 1, height - 1, width - 1, 0); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, 0, 0, width - 1, 0); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, 0, height - 1, 0, 0); } else if (texture->getTexture() & BImage_Sunken) { XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, 0, height - 1, width - 1, height - 1); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, width - 1, height - 1, width - 1, 0); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, 0, 0, width - 1, 0); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, 0, height - 1, 0, 0); } } else if (texture->getTexture() & BImage_Bevel2) { if (texture->getTexture() & BImage_Raised) { XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, 1, height - 3, width - 3, height - 3); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, width - 3, height - 3, width - 3, 1); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, 1, 1, width - 3, 1); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, 1, height - 3, 1, 1); } else if (texture->getTexture() & BImage_Sunken) { XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, 1, height - 3, width - 3, height - 3); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, width - 3, height - 3, width - 3, 1); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, 1, 1, width - 3, 1); XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, 1, height - 3, 1, 1); } } XFreeGC(control->getBaseDisplay()->getXDisplay(), gc); XFreeGC(control->getBaseDisplay()->getXDisplay(), hgc); XFreeGC(control->getBaseDisplay()->getXDisplay(), lgc); return pixmap; } Pixmap BImage::render_gradient(BTexture *texture) { int inverted = 0; #ifdef INTERLACE interlaced = texture->getTexture() & BImage_Interlaced; #endif // INTERLACE if (texture->getTexture() & BImage_Sunken) { from = texture->getColorTo(); to = texture->getColor(); if (! (texture->getTexture() & BImage_Invert)) inverted = 1; } else { from = texture->getColor(); to = texture->getColorTo(); if (texture->getTexture() & BImage_Invert) inverted = 1; } control->getGradientBuffers(width, height, &xtable, &ytable); if (texture->getTexture() & BImage_Diagonal) dgradient(); else if (texture->getTexture() & BImage_Elliptic) egradient(); else if (texture->getTexture() & BImage_Horizontal) hgradient(); else if (texture->getTexture() & BImage_Pyramid) pgradient(); else if (texture->getTexture() & BImage_Rectangle) rgradient(); else if (texture->getTexture() & BImage_Vertical) vgradient(); else if (texture->getTexture() & BImage_CrossDiagonal) cdgradient(); else if (texture->getTexture() & BImage_PipeCross) pcgradient(); if (texture->getTexture() & BImage_Bevel1) bevel1(); else if (texture->getTexture() & BImage_Bevel2) bevel2(); if (inverted) invert(); Pixmap pixmap = renderPixmap(); return pixmap; } XImage *BImage::renderXImage(void) { XImage *image = XCreateImage(control->getBaseDisplay()->getXDisplay(), control->getVisual(), control->getDepth(), ZPixmap, 0, 0, width, height, 32, 0); if (! image) { fprintf(stderr, "BImage::renderXImage: error creating XImage\n"); return (XImage *) 0; } // insurance policy image->data = (char *) 0; unsigned char *d = new unsigned char[image->bytes_per_line * (height + 1)]; register unsigned int x, y, dithx, dithy, r, g, b, o, er, eg, eb, offset; unsigned char *pixel_data = d, *ppixel_data = d; unsigned long pixel; o = image->bits_per_pixel + ((image->byte_order == MSBFirst) ? 1 : 0); if (control->doDither() && width > 1 && height > 1) { unsigned char dither4[4][4] = { {0, 4, 1, 5}, {6, 2, 7, 3}, {1, 5, 0, 4}, {7, 3, 6, 2} }; #ifdef ORDEREDPSEUDO unsigned char dither8[8][8] = { { 0, 32, 8, 40, 2, 34, 10, 42 }, { 48, 16, 56, 24, 50, 18, 58, 26 }, { 12, 44, 4, 36, 14, 46, 6, 38 }, { 60, 28, 52, 20, 62, 30, 54, 22 }, { 3, 35, 11, 43, 1, 33, 9, 41 }, { 51, 19, 59, 27, 49, 17, 57, 25 }, { 15, 47, 7, 39, 13, 45, 5, 37 }, { 63, 31, 55, 23, 61, 29, 53, 21 } }; #endif // ORDEREDPSEUDO switch (control->getVisual()->c_class) { case TrueColor: // algorithm: ordered dithering... many many thanks to rasterman // (raster@rasterman.com) for telling me about this... portions of this // code is based off of his code in Imlib for (y = 0, offset = 0; y < height; y++) { dithy = y & 0x3; for (x = 0; x < width; x++, offset++) { dithx = x & 0x3; r = red[offset]; g = green[offset]; b = blue[offset]; er = r & (red_bits - 1); eg = g & (green_bits - 1); eb = b & (blue_bits - 1); r = red_table[r]; g = green_table[g]; b = blue_table[b]; if ((dither4[dithy][dithx] < er) && (r < red_table[255])) r++; if ((dither4[dithy][dithx] < eg) && (g < green_table[255])) g++; if ((dither4[dithy][dithx] < eb) && (b < blue_table[255])) b++; pixel = (r << red_offset) | (g << green_offset) | (b << blue_offset); switch (o) { case 16: // 16bpp LSB *pixel_data++ = pixel; *pixel_data++ = pixel >> 8; break; case 17: // 16bpp MSB *pixel_data++ = pixel >> 8; *pixel_data++ = pixel; break; case 24: // 24bpp LSB *pixel_data++ = pixel; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel >> 16; break; case 25: // 24bpp MSB *pixel_data++ = pixel >> 16; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel; break; case 32: // 32bpp LSB *pixel_data++ = pixel; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel >> 16; *pixel_data++ = pixel >> 24; break; case 33: // 32bpp MSB *pixel_data++ = pixel >> 24; *pixel_data++ = pixel >> 16; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel; break; } } pixel_data = (ppixel_data += image->bytes_per_line); } break; case StaticColor: case PseudoColor: { #ifndef ORDEREDPSEUDO short *terr, *rerr = new short[width + 2], *gerr = new short[width + 2], *berr = new short[width + 2], *nrerr = new short[width + 2], *ngerr = new short[width + 2], *nberr = new short[width + 2]; int rr, gg, bb, rer, ger, ber; int dd = 255 / control->getColorsPerChannel(); for (x = 0; x < width; x++) { *(rerr + x) = *(red + x); *(gerr + x) = *(green + x); *(berr + x) = *(blue + x); } *(rerr + x) = *(gerr + x) = *(berr + x) = 0; #endif // ORDEREDPSEUDO for (y = 0, offset = 0; y < height; y++) { #ifdef ORDEREDPSEUDO dithy = y & 7; for (x = 0; x < width; x++, offset++) { dithx = x & 7; r = red[offset]; g = green[offset]; b = blue[offset]; er = r & (red_bits - 1); eg = g & (green_bits - 1); eb = b & (blue_bits - 1); r = red_table[r]; g = green_table[g]; b = blue_table[b]; if ((dither8[dithy][dithx] < er) && (r < red_table[255])) r++; if ((dither8[dithy][dithx] < eg) && (g < green_table[255])) g++; if ((dither8[dithy][dithx] < eb) && (b < blue_table[255])) b++; pixel = (r * cpccpc) + (g * cpc) + b; *(pixel_data++) = colors[pixel].pixel; } pixel_data = (ppixel_data += image->bytes_per_line); } #else // !ORDEREDPSEUDO if (y < (height - 1)) { int i = offset + width; for (x = 0; x < width; x++, i++) { *(nrerr + x) = *(red + i); *(ngerr + x) = *(green + i); *(nberr + x) = *(blue + i); } *(nrerr + x) = *(red + (--i)); *(ngerr + x) = *(green + i); *(nberr + x) = *(blue + i); } for (x = 0; x < width; x++) { rr = rerr[x]; gg = gerr[x]; bb = berr[x]; if (rr > 255) rr = 255; else if (rr < 0) rr = 0; if (gg > 255) gg = 255; else if (gg < 0) gg = 0; if (bb > 255) bb = 255; else if (bb < 0) bb = 0; r = red_table[rr]; g = green_table[gg]; b = blue_table[bb]; rer = rerr[x] - r*dd; ger = gerr[x] - g*dd; ber = berr[x] - b*dd; pixel = (r * cpccpc) + (g * cpc) + b; *pixel_data++ = colors[pixel].pixel; r = rer >> 1; g = ger >> 1; b = ber >> 1; rerr[x+1] += r; gerr[x+1] += g; berr[x+1] += b; nrerr[x] += r; ngerr[x] += g; nberr[x] += b; } offset += width; pixel_data = (ppixel_data += image->bytes_per_line); terr = rerr; rerr = nrerr; nrerr = terr; terr = gerr; gerr = ngerr; ngerr = terr; terr = berr; berr = nberr; nberr = terr; } delete [] rerr; delete [] gerr; delete [] berr; delete [] nrerr; delete [] ngerr; delete [] nberr; #endif // ORDEREDPSUEDO break; } /* case StaticGray: case GrayScale: for (y = 0, offset = 0; y < height; y++) { dithy = y & 0x3; for (x = 0; x < width; x++, offset++) { dithx = x & 0x3; r = *(red + offset); g = *(green + offset); b = *(blue + offset); er = r & 0x7; eg = g & 0x7; eb = b & 0x7; if ((dither[dithy][dithx] < er) && (r < (256 - 8))) r += 8; if ((dither[dithy][dithx] < (eg << 1)) && (g < (256 - 4))) g += 4; if ((dither[dithy][dithx] < eb) && (b < (256 - 8))) b += 8; r = *(red_table + r); g = *(green_table + g); b = *(blue_table + b); g = ((r * 30) + (g * 59) + (b * 11)) / 100; *pixel_data++ = colors[g].pixel; } pixel_data = (ppixel_data += image->bytes_per_line); } break; */ default: fprintf(stderr, "BImage::renderXImage: unsupported visual\n"); delete [] d; XDestroyImage(image); return (XImage *) 0; } } else { switch (control->getVisual()->c_class) { case StaticColor: case PseudoColor: for (y = 0, offset = 0; y < height; y++) { for (x = 0; x < width; x++, offset++) { r = red_table[red[offset]]; g = green_table[green[offset]]; b = blue_table[blue[offset]]; pixel = (r * cpccpc) + (g * cpc) + b; *pixel_data++ = colors[pixel].pixel; } pixel_data = (ppixel_data += image->bytes_per_line); } break; case TrueColor: for (y = 0, offset = 0; y < height; y++) { for (x = 0; x < width; x++, offset++) { r = red_table[red[offset]]; g = green_table[green[offset]]; b = blue_table[blue[offset]]; pixel = (r << red_offset) | (g << green_offset) | (b << blue_offset); switch (o) { case 16: // 16bpp LSB *pixel_data++ = pixel; *pixel_data++ = pixel >> 8; break; case 17: // 16bpp MSB *pixel_data++ = pixel >> 8; *pixel_data++ = pixel; break; case 24: // 24bpp LSB *pixel_data++ = pixel; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel >> 16; break; case 25: // 24bpp MSB *pixel_data++ = pixel >> 16; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel; break; case 32: // 32bpp LSB *pixel_data++ = pixel; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel >> 16; *pixel_data++ = pixel >> 24; break; case 33: // 32bpp MSB *pixel_data++ = pixel >> 24; *pixel_data++ = pixel >> 16; *pixel_data++ = pixel >> 8; *pixel_data++ = pixel; break; } } pixel_data = (ppixel_data += image->bytes_per_line); } break; case StaticGray: case GrayScale: for (y = 0, offset = 0; y < height; y++) { for (x = 0; x < width; x++, offset++) { r = *(red_table + *(red + offset)); g = *(green_table + *(green + offset)); b = *(blue_table + *(blue + offset)); g = ((r * 30) + (g * 59) + (b * 11)) / 100; *pixel_data++ = colors[g].pixel; } pixel_data = (ppixel_data += image->bytes_per_line); } break; default: fprintf(stderr, "BImage::renderXImage: unsupported visual\n"); delete [] d; XDestroyImage(image); return (XImage *) 0; } } image->data = (char *) d; return image; } Pixmap BImage::renderPixmap(void) { Pixmap pixmap = XCreatePixmap(control->getBaseDisplay()->getXDisplay(), control->getDrawable(), width, height, control->getDepth()); if (pixmap == None) { fprintf(stderr, "BImage::renderPixmap: error creating pixmap\n"); return None; } XImage *image = renderXImage(); if (! image) { XFreePixmap(control->getBaseDisplay()->getXDisplay(), pixmap); return None; } else if (! image->data) { XDestroyImage(image); XFreePixmap(control->getBaseDisplay()->getXDisplay(), pixmap); return None; } XPutImage(control->getBaseDisplay()->getXDisplay(), pixmap, DefaultGC(control->getBaseDisplay()->getXDisplay(), control->getScreenInfo()->getScreenNumber()), image, 0, 0, 0, 0, width, height); if (image->data) { delete [] image->data; image->data = NULL; } XDestroyImage(image); return pixmap; } void BImage::bevel1(void) { if (width > 2 && height > 2) { unsigned char *pr = red, *pg = green, *pb = blue; register unsigned char r, g, b, rr ,gg ,bb; register unsigned int w = width, h = height - 1, wh = w * h; while (--w) { r = *pr; rr = r + (r >> 1); if (rr < r) rr = ~0; g = *pg; gg = g + (g >> 1); if (gg < g) gg = ~0; b = *pb; bb = b + (b >> 1); if (bb < b) bb = ~0; *pr = rr; *pg = gg; *pb = bb; r = *(pr + wh); rr = (r >> 2) + (r >> 1); if (rr > r) rr = 0; g = *(pg + wh); gg = (g >> 2) + (g >> 1); if (gg > g) gg = 0; b = *(pb + wh); bb = (b >> 2) + (b >> 1); if (bb > b) bb = 0; *((pr++) + wh) = rr; *((pg++) + wh) = gg; *((pb++) + wh) = bb; } r = *pr; rr = r + (r >> 1); if (rr < r) rr = ~0; g = *pg; gg = g + (g >> 1); if (gg < g) gg = ~0; b = *pb; bb = b + (b >> 1); if (bb < b) bb = ~0; *pr = rr; *pg = gg; *pb = bb; r = *(pr + wh); rr = (r >> 2) + (r >> 1); if (rr > r) rr = 0; g = *(pg + wh); gg = (g >> 2) + (g >> 1); if (gg > g) gg = 0; b = *(pb + wh); bb = (b >> 2) + (b >> 1); if (bb > b) bb = 0; *(pr + wh) = rr; *(pg + wh) = gg; *(pb + wh) = bb; pr = red + width; pg = green + width; pb = blue + width; while (--h) { r = *pr; rr = r + (r >> 1); if (rr < r) rr = ~0; g = *pg; gg = g + (g >> 1); if (gg < g) gg = ~0; b = *pb; bb = b + (b >> 1); if (bb < b) bb = ~0; *pr = rr; *pg = gg; *pb = bb; pr += width - 1; pg += width - 1; pb += width - 1; r = *pr; rr = (r >> 2) + (r >> 1); if (rr > r) rr = 0; g = *pg; gg = (g >> 2) + (g >> 1); if (gg > g) gg = 0; b = *pb; bb = (b >> 2) + (b >> 1); if (bb > b) bb = 0; *(pr++) = rr; *(pg++) = gg; *(pb++) = bb; } r = *pr; rr = r + (r >> 1); if (rr < r) rr = ~0; g = *pg; gg = g + (g >> 1); if (gg < g) gg = ~0; b = *pb; bb = b + (b >> 1); if (bb < b) bb = ~0; *pr = rr; *pg = gg; *pb = bb; pr += width - 1; pg += width - 1; pb += width - 1; r = *pr; rr = (r >> 2) + (r >> 1); if (rr > r) rr = 0; g = *pg; gg = (g >> 2) + (g >> 1); if (gg > g) gg = 0; b = *pb; bb = (b >> 2) + (b >> 1); if (bb > b) bb = 0; *pr = rr; *pg = gg; *pb = bb; } } void BImage::bevel2(void) { if (width > 4 && height > 4) { unsigned char r, g, b, rr ,gg ,bb, *pr = red + width + 1, *pg = green + width + 1, *pb = blue + width + 1; unsigned int w = width - 2, h = height - 1, wh = width * (height - 3); while (--w) { r = *pr; rr = r + (r >> 1); if (rr < r) rr = ~0; g = *pg; gg = g + (g >> 1); if (gg < g) gg = ~0; b = *pb; bb = b + (b >> 1); if (bb < b) bb = ~0; *pr = rr; *pg = gg; *pb = bb; r = *(pr + wh); rr = (r >> 2) + (r >> 1); if (rr > r) rr = 0; g = *(pg + wh); gg = (g >> 2) + (g >> 1); if (gg > g) gg = 0; b = *(pb + wh); bb = (b >> 2) + (b >> 1); if (bb > b) bb = 0; *((pr++) + wh) = rr; *((pg++) + wh) = gg; *((pb++) + wh) = bb; } pr = red + width; pg = green + width; pb = blue + width; while (--h) { r = *pr; rr = r + (r >> 1); if (rr < r) rr = ~0; g = *pg; gg = g + (g >> 1); if (gg < g) gg = ~0; b = *pb; bb = b + (b >> 1); if (bb < b) bb = ~0; *(++pr) = rr; *(++pg) = gg; *(++pb) = bb; pr += width - 3; pg += width - 3; pb += width - 3; r = *pr; rr = (r >> 2) + (r >> 1); if (rr > r) rr = 0; g = *pg; gg = (g >> 2) + (g >> 1); if (gg > g) gg = 0; b = *pb; bb = (b >> 2) + (b >> 1); if (bb > b) bb = 0; *(pr++) = rr; *(pg++) = gg; *(pb++) = bb; pr++; pg++; pb++; } } } void BImage::invert(void) { register unsigned int i, j, wh = (width * height) - 1; unsigned char tmp; for (i = 0, j = wh; j > i; j--, i++) { tmp = *(red + j); *(red + j) = *(red + i); *(red + i) = tmp; tmp = *(green + j); *(green + j) = *(green + i); *(green + i) = tmp; tmp = *(blue + j); *(blue + j) = *(blue + i); *(blue + i) = tmp; } } void BImage::dgradient(void) { // diagonal gradient code was written by Mike Cole // modified for interlacing by Brad Hughes float drx, dgx, dbx, dry, dgy, dby, yr = 0.0, yg = 0.0, yb = 0.0, xr = (float) from->getRed(), xg = (float) from->getGreen(), xb = (float) from->getBlue(); unsigned char *pr = red, *pg = green, *pb = blue; unsigned int w = width * 2, h = height * 2, *xt = xtable, *yt = ytable; register unsigned int x, y; dry = drx = (float) (to->getRed() - from->getRed()); dgy = dgx = (float) (to->getGreen() - from->getGreen()); dby = dbx = (float) (to->getBlue() - from->getBlue()); // Create X table drx /= w; dgx /= w; dbx /= w; for (x = 0; x < width; x++) { *(xt++) = (unsigned char) (xr); *(xt++) = (unsigned char) (xg); *(xt++) = (unsigned char) (xb); xr += drx; xg += dgx; xb += dbx; } // Create Y table dry /= h; dgy /= h; dby /= h; for (y = 0; y < height; y++) { *(yt++) = ((unsigned char) yr); *(yt++) = ((unsigned char) yg); *(yt++) = ((unsigned char) yb); yr += dry; yg += dgy; yb += dby; } // Combine tables to create gradient #ifdef INTERLACE if (! interlaced) { #endif // INTERLACE // normal dgradient for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { *(pr++) = *(xt++) + *(yt); *(pg++) = *(xt++) + *(yt + 1); *(pb++) = *(xt++) + *(yt + 2); } } #ifdef INTERLACE } else { // faked interlacing effect unsigned char channel, channel2; for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { if (y & 1) { channel = *(xt++) + *(yt); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pr++) = channel2; channel = *(xt++) + *(yt + 1); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pg++) = channel2; channel = *(xt++) + *(yt + 2); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pb++) = channel2; } else { channel = *(xt++) + *(yt); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr++) = channel2; channel = *(xt++) + *(yt + 1); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg++) = channel2; channel = *(xt++) + *(yt + 2); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb++) = channel2; } } } } #endif // INTERLACE } void BImage::hgradient(void) { float drx, dgx, dbx, xr = (float) from->getRed(), xg = (float) from->getGreen(), xb = (float) from->getBlue(); unsigned char *pr = red, *pg = green, *pb = blue; register unsigned int x, y; drx = (float) (to->getRed() - from->getRed()); dgx = (float) (to->getGreen() - from->getGreen()); dbx = (float) (to->getBlue() - from->getBlue()); drx /= width; dgx /= width; dbx /= width; #ifdef INTERLACE if (interlaced && height > 2) { // faked interlacing effect unsigned char channel, channel2; for (x = 0; x < width; x++, pr++, pg++, pb++) { channel = (unsigned char) xr; channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *pr = channel2; channel = (unsigned char) xg; channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *pg = channel2; channel = (unsigned char) xb; channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *pb = channel2; channel = (unsigned char) xr; channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr + width) = channel2; channel = (unsigned char) xg; channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg + width) = channel2; channel = (unsigned char) xb; channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb + width) = channel2; xr += drx; xg += dgx; xb += dbx; } pr += width; pg += width; pb += width; int offset; for (y = 2; y < height; y++, pr += width, pg += width, pb += width) { if (y & 1) offset = width; else offset = 0; memcpy(pr, (red + offset), width); memcpy(pg, (green + offset), width); memcpy(pb, (blue + offset), width); } } else { #endif // INTERLACE // normal hgradient for (x = 0; x < width; x++) { *(pr++) = (unsigned char) (xr); *(pg++) = (unsigned char) (xg); *(pb++) = (unsigned char) (xb); xr += drx; xg += dgx; xb += dbx; } for (y = 1; y < height; y++, pr += width, pg += width, pb += width) { memcpy(pr, red, width); memcpy(pg, green, width); memcpy(pb, blue, width); } #ifdef INTERLACE } #endif // INTERLACE } void BImage::vgradient(void) { float dry, dgy, dby, yr = (float) from->getRed(), yg = (float) from->getGreen(), yb = (float) from->getBlue(); unsigned char *pr = red, *pg = green, *pb = blue; register unsigned int y; dry = (float) (to->getRed() - from->getRed()); dgy = (float) (to->getGreen() - from->getGreen()); dby = (float) (to->getBlue() - from->getBlue()); dry /= height; dgy /= height; dby /= height; #ifdef INTERLACE if (interlaced) { // faked interlacing effect unsigned char channel, channel2; for (y = 0; y < height; y++, pr += width, pg += width, pb += width) { if (y & 1) { channel = (unsigned char) yr; channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; memset(pr, channel2, width); channel = (unsigned char) yg; channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; memset(pg, channel2, width); channel = (unsigned char) yb; channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; memset(pb, channel2, width); } else { channel = (unsigned char) yr; channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; memset(pr, channel2, width); channel = (unsigned char) yg; channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; memset(pg, channel2, width); channel = (unsigned char) yb; channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; memset(pb, channel2, width); } yr += dry; yg += dgy; yb += dby; } } else { #endif // INTERLACE // normal vgradient for (y = 0; y < height; y++, pr += width, pg += width, pb += width) { memset(pr, (unsigned char) yr, width); memset(pg, (unsigned char) yg, width); memset(pb, (unsigned char) yb, width); yr += dry; yg += dgy; yb += dby; } #ifdef INTERLACE } #endif // INTERLACE } void BImage::pgradient(void) { // pyramid gradient - based on original dgradient, written by // Mosfet (mosfet@kde.org) // adapted from kde sources for Blackbox by Brad Hughes float yr, yg, yb, drx, dgx, dbx, dry, dgy, dby, xr, xg, xb; int rsign, gsign, bsign; unsigned char *pr = red, *pg = green, *pb = blue; unsigned int tr = to->getRed(), tg = to->getGreen(), tb = to->getBlue(), *xt = xtable, *yt = ytable; register unsigned int x, y; dry = drx = (float) (to->getRed() - from->getRed()); dgy = dgx = (float) (to->getGreen() - from->getGreen()); dby = dbx = (float) (to->getBlue() - from->getBlue()); rsign = (drx < 0) ? -1 : 1; gsign = (dgx < 0) ? -1 : 1; bsign = (dbx < 0) ? -1 : 1; xr = yr = (drx / 2); xg = yg = (dgx / 2); xb = yb = (dbx / 2); // Create X table drx /= width; dgx /= width; dbx /= width; for (x = 0; x < width; x++) { *(xt++) = (unsigned char) ((xr < 0) ? -xr : xr); *(xt++) = (unsigned char) ((xg < 0) ? -xg : xg); *(xt++) = (unsigned char) ((xb < 0) ? -xb : xb); xr -= drx; xg -= dgx; xb -= dbx; } // Create Y table dry /= height; dgy /= height; dby /= height; for (y = 0; y < height; y++) { *(yt++) = ((unsigned char) ((yr < 0) ? -yr : yr)); *(yt++) = ((unsigned char) ((yg < 0) ? -yg : yg)); *(yt++) = ((unsigned char) ((yb < 0) ? -yb : yb)); yr -= dry; yg -= dgy; yb -= dby; } // Combine tables to create gradient #ifdef INTERLACE if (! interlaced) { #endif // INTERLACE // normal pgradient for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { *(pr++) = (unsigned char) (tr - (rsign * (*(xt++) + *(yt)))); *(pg++) = (unsigned char) (tg - (gsign * (*(xt++) + *(yt + 1)))); *(pb++) = (unsigned char) (tb - (bsign * (*(xt++) + *(yt + 2)))); } } #ifdef INTERLACE } else { // faked interlacing effect unsigned char channel, channel2; for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { if (y & 1) { channel = (unsigned char) (tr - (rsign * (*(xt++) + *(yt)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pr++) = channel2; channel = (unsigned char) (tg - (gsign * (*(xt++) + *(yt + 1)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pg++) = channel2; channel = (unsigned char) (tb - (bsign * (*(xt++) + *(yt + 2)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pb++) = channel2; } else { channel = (unsigned char) (tr - (rsign * (*(xt++) + *(yt)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr++) = channel2; channel = (unsigned char) (tg - (gsign * (*(xt++) + *(yt + 1)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg++) = channel2; channel = (unsigned char) (tb - (bsign * (*(xt++) + *(yt + 2)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb++) = channel2; } } } } #endif // INTERLACE } void BImage::rgradient(void) { // rectangle gradient - based on original dgradient, written by // Mosfet (mosfet@kde.org) // adapted from kde sources for Blackbox by Brad Hughes float drx, dgx, dbx, dry, dgy, dby, xr, xg, xb, yr, yg, yb; int rsign, gsign, bsign; unsigned char *pr = red, *pg = green, *pb = blue; unsigned int tr = to->getRed(), tg = to->getGreen(), tb = to->getBlue(), *xt = xtable, *yt = ytable; register unsigned int x, y; dry = drx = (float) (to->getRed() - from->getRed()); dgy = dgx = (float) (to->getGreen() - from->getGreen()); dby = dbx = (float) (to->getBlue() - from->getBlue()); rsign = (drx < 0) ? -2 : 2; gsign = (dgx < 0) ? -2 : 2; bsign = (dbx < 0) ? -2 : 2; xr = yr = (drx / 2); xg = yg = (dgx / 2); xb = yb = (dbx / 2); // Create X table drx /= width; dgx /= width; dbx /= width; for (x = 0; x < width; x++) { *(xt++) = (unsigned char) ((xr < 0) ? -xr : xr); *(xt++) = (unsigned char) ((xg < 0) ? -xg : xg); *(xt++) = (unsigned char) ((xb < 0) ? -xb : xb); xr -= drx; xg -= dgx; xb -= dbx; } // Create Y table dry /= height; dgy /= height; dby /= height; for (y = 0; y < height; y++) { *(yt++) = ((unsigned char) ((yr < 0) ? -yr : yr)); *(yt++) = ((unsigned char) ((yg < 0) ? -yg : yg)); *(yt++) = ((unsigned char) ((yb < 0) ? -yb : yb)); yr -= dry; yg -= dgy; yb -= dby; } // Combine tables to create gradient #ifdef INTERLACE if (! interlaced) { #endif // INTERLACE // normal rgradient for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { *(pr++) = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); *(pg++) = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); *(pb++) = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); } } #ifdef INTERLACE } else { // faked interlacing effect unsigned char channel, channel2; for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { if (y & 1) { channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pr++) = channel2; channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pg++) = channel2; channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pb++) = channel2; } else { channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr++) = channel2; channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg++) = channel2; channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb++) = channel2; } } } } #endif // INTERLACE } void BImage::egradient(void) { // elliptic gradient - based on original dgradient, written by // Mosfet (mosfet@kde.org) // adapted from kde sources for Blackbox by Brad Hughes float drx, dgx, dbx, dry, dgy, dby, yr, yg, yb, xr, xg, xb; int rsign, gsign, bsign; unsigned char *pr = red, *pg = green, *pb = blue; unsigned int *xt = xtable, *yt = ytable, tr = (unsigned long) to->getRed(), tg = (unsigned long) to->getGreen(), tb = (unsigned long) to->getBlue(); register unsigned int x, y; dry = drx = (float) (to->getRed() - from->getRed()); dgy = dgx = (float) (to->getGreen() - from->getGreen()); dby = dbx = (float) (to->getBlue() - from->getBlue()); rsign = (drx < 0) ? -1 : 1; gsign = (dgx < 0) ? -1 : 1; bsign = (dbx < 0) ? -1 : 1; xr = yr = (drx / 2); xg = yg = (dgx / 2); xb = yb = (dbx / 2); // Create X table drx /= width; dgx /= width; dbx /= width; for (x = 0; x < width; x++) { *(xt++) = (unsigned long) (xr * xr); *(xt++) = (unsigned long) (xg * xg); *(xt++) = (unsigned long) (xb * xb); xr -= drx; xg -= dgx; xb -= dbx; } // Create Y table dry /= height; dgy /= height; dby /= height; for (y = 0; y < height; y++) { *(yt++) = (unsigned long) (yr * yr); *(yt++) = (unsigned long) (yg * yg); *(yt++) = (unsigned long) (yb * yb); yr -= dry; yg -= dgy; yb -= dby; } // Combine tables to create gradient #ifdef INTERLACE if (! interlaced) { #endif // INTERLACE // normal egradient for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { *(pr++) = (unsigned char) (tr - (rsign * control->getSqrt(*(xt++) + *(yt)))); *(pg++) = (unsigned char) (tg - (gsign * control->getSqrt(*(xt++) + *(yt + 1)))); *(pb++) = (unsigned char) (tb - (bsign * control->getSqrt(*(xt++) + *(yt + 2)))); } } #ifdef INTERLACE } else { // faked interlacing effect unsigned char channel, channel2; for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { if (y & 1) { channel = (unsigned char) (tr - (rsign * control->getSqrt(*(xt++) + *(yt)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pr++) = channel2; channel = (unsigned char) (tg - (gsign * control->getSqrt(*(xt++) + *(yt + 1)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pg++) = channel2; channel = (unsigned char) (tb - (bsign * control->getSqrt(*(xt++) + *(yt + 2)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pb++) = channel2; } else { channel = (unsigned char) (tr - (rsign * control->getSqrt(*(xt++) + *(yt)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr++) = channel2; channel = (unsigned char) (tg - (gsign * control->getSqrt(*(xt++) + *(yt + 1)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg++) = channel2; channel = (unsigned char) (tb - (bsign * control->getSqrt(*(xt++) + *(yt + 2)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb++) = channel2; } } } } #endif // INTERLACE } void BImage::pcgradient(void) { // pipe cross gradient - based on original dgradient, written by // Mosfet (mosfet@kde.org) // adapted from kde sources for Blackbox by Brad Hughes float drx, dgx, dbx, dry, dgy, dby, xr, xg, xb, yr, yg, yb; int rsign, gsign, bsign; unsigned char *pr = red, *pg = green, *pb = blue; unsigned int *xt = xtable, *yt = ytable, tr = to->getRed(), tg = to->getGreen(), tb = to->getBlue(); register unsigned int x, y; dry = drx = (float) (to->getRed() - from->getRed()); dgy = dgx = (float) (to->getGreen() - from->getGreen()); dby = dbx = (float) (to->getBlue() - from->getBlue()); rsign = (drx < 0) ? -2 : 2; gsign = (dgx < 0) ? -2 : 2; bsign = (dbx < 0) ? -2 : 2; xr = yr = (drx / 2); xg = yg = (dgx / 2); xb = yb = (dbx / 2); // Create X table drx /= width; dgx /= width; dbx /= width; for (x = 0; x < width; x++) { *(xt++) = (unsigned char) ((xr < 0) ? -xr : xr); *(xt++) = (unsigned char) ((xg < 0) ? -xg : xg); *(xt++) = (unsigned char) ((xb < 0) ? -xb : xb); xr -= drx; xg -= dgx; xb -= dbx; } // Create Y table dry /= height; dgy /= height; dby /= height; for (y = 0; y < height; y++) { *(yt++) = ((unsigned char) ((yr < 0) ? -yr : yr)); *(yt++) = ((unsigned char) ((yg < 0) ? -yg : yg)); *(yt++) = ((unsigned char) ((yb < 0) ? -yb : yb)); yr -= dry; yg -= dgy; yb -= dby; } // Combine tables to create gradient #ifdef INTERLACE if (! interlaced) { #endif // INTERLACE // normal pcgradient for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { *(pr++) = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); *(pg++) = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1)))); *(pb++) = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2)))); } } #ifdef INTERLACE } else { // faked interlacing effect unsigned char channel, channel2; for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { if (y & 1) { channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pr++) = channel2; channel = (unsigned char) (tg - (bsign * min(*(xt++), *(yt + 1)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pg++) = channel2; channel = (unsigned char) (tb - (gsign * min(*(xt++), *(yt + 2)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pb++) = channel2; } else { channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr++) = channel2; channel = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg++) = channel2; channel = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb++) = channel2; } } } } #endif // INTERLACE } void BImage::cdgradient(void) { // cross diagonal gradient - based on original dgradient, written by // Mosfet (mosfet@kde.org) // adapted from kde sources for Blackbox by Brad Hughes float drx, dgx, dbx, dry, dgy, dby, yr = 0.0, yg = 0.0, yb = 0.0, xr = (float) from->getRed(), xg = (float) from->getGreen(), xb = (float) from->getBlue(); unsigned char *pr = red, *pg = green, *pb = blue; unsigned int w = width * 2, h = height * 2, *xt, *yt; register unsigned int x, y; dry = drx = (float) (to->getRed() - from->getRed()); dgy = dgx = (float) (to->getGreen() - from->getGreen()); dby = dbx = (float) (to->getBlue() - from->getBlue()); // Create X table drx /= w; dgx /= w; dbx /= w; for (xt = (xtable + (width * 3) - 1), x = 0; x < width; x++) { *(xt--) = (unsigned char) xb; *(xt--) = (unsigned char) xg; *(xt--) = (unsigned char) xr; xr += drx; xg += dgx; xb += dbx; } // Create Y table dry /= h; dgy /= h; dby /= h; for (yt = ytable, y = 0; y < height; y++) { *(yt++) = (unsigned char) yr; *(yt++) = (unsigned char) yg; *(yt++) = (unsigned char) yb; yr += dry; yg += dgy; yb += dby; } // Combine tables to create gradient #ifdef INTERLACE if (! interlaced) { #endif // INTERLACE // normal cdgradient for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { *(pr++) = *(xt++) + *(yt); *(pg++) = *(xt++) + *(yt + 1); *(pb++) = *(xt++) + *(yt + 2); } } #ifdef INTERLACE } else { // faked interlacing effect unsigned char channel, channel2; for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { if (y & 1) { channel = *(xt++) + *(yt); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pr++) = channel2; channel = *(xt++) + *(yt + 1); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pg++) = channel2; channel = *(xt++) + *(yt + 2); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pb++) = channel2; } else { channel = *(xt++) + *(yt); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr++) = channel2; channel = *(xt++) + *(yt + 1); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg++) = channel2; channel = *(xt++) + *(yt + 2); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb++) = channel2; } } } } #endif // INTERLACE } BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, int _cpc, unsigned long cache_timeout, unsigned long cmax) { basedisplay = dpy; screeninfo = scrn; setDither(_dither); setColorsPerChannel(_cpc); cache_max = cmax; #ifdef TIMEDCACHE if (cache_timeout) { timer = new BTimer(basedisplay, this); timer->setTimeout(cache_timeout); timer->start(); } else timer = (BTimer *) 0; #endif // TIMEDCACHE colors = (XColor *) 0; ncolors = 0; grad_xbuffer = grad_ybuffer = (unsigned int *) 0; grad_buffer_width = grad_buffer_height = 0; sqrt_table = (unsigned long *) 0; screen_depth = screeninfo->getDepth(); window = screeninfo->getRootWindow(); screen_number = screeninfo->getScreenNumber(); int count; XPixmapFormatValues *pmv = XListPixmapFormats(basedisplay->getXDisplay(), &count); root_colormap = DefaultColormap(basedisplay->getXDisplay(), screen_number); if (pmv) { bits_per_pixel = 0; for (int i = 0; i < count; i++) if (pmv[i].depth == screen_depth) { bits_per_pixel = pmv[i].bits_per_pixel; break; } XFree(pmv); } if (bits_per_pixel == 0) bits_per_pixel = screen_depth; if (bits_per_pixel >= 24) setDither(False); red_offset = green_offset = blue_offset = 0; switch (getVisual()->c_class) { case TrueColor: { int i; // compute color tables unsigned long red_mask = getVisual()->red_mask, green_mask = getVisual()->green_mask, blue_mask = getVisual()->blue_mask; while (! (red_mask & 1)) { red_offset++; red_mask >>= 1; } while (! (green_mask & 1)) { green_offset++; green_mask >>= 1; } while (! (blue_mask & 1)) { blue_offset++; blue_mask >>= 1; } red_bits = 255 / red_mask; green_bits = 255 / green_mask; blue_bits = 255 / blue_mask; for (i = 0; i < 256; i++) { red_color_table[i] = i / red_bits; green_color_table[i] = i / green_bits; blue_color_table[i] = i / blue_bits; } } break; case PseudoColor: case StaticColor: { ncolors = colors_per_channel * colors_per_channel * colors_per_channel; if (ncolors > (1 << screen_depth)) { colors_per_channel = (1 << screen_depth) / 3; ncolors = colors_per_channel * colors_per_channel * colors_per_channel; } if (colors_per_channel < 2 || ncolors > (1 << screen_depth)) { fprintf(stderr, "BImageControl::BImageControl: invalid colormap size %d " "(%d/%d/%d) - reducing", ncolors, colors_per_channel, colors_per_channel, colors_per_channel); colors_per_channel = (1 << screen_depth) / 3; } colors = new XColor[ncolors]; if (! colors) { fprintf(stderr, "BImageControl::BImageControl: error allocating " "colormap\n"); exit(1); } int i = 0, ii, p, r, g, b, #ifdef ORDEREDPSEUDO bits = 256 / colors_per_channel; #else // !ORDEREDPSEUDO bits = 255 / (colors_per_channel - 1); #endif // ORDEREDPSEUDO red_bits = green_bits = blue_bits = bits; for (i = 0; i < 256; i++) red_color_table[i] = green_color_table[i] = blue_color_table[i] = i / bits; for (r = 0, i = 0; r < colors_per_channel; r++) for (g = 0; g < colors_per_channel; g++) for (b = 0; b < colors_per_channel; b++, i++) { colors[i].red = (r * 0xffff) / (colors_per_channel - 1); colors[i].green = (g * 0xffff) / (colors_per_channel - 1); colors[i].blue = (b * 0xffff) / (colors_per_channel - 1); ; colors[i].flags = DoRed|DoGreen|DoBlue; } basedisplay->grab(); for (i = 0; i < ncolors; i++) if (! XAllocColor(basedisplay->getXDisplay(), getColormap(), &colors[i])) { fprintf(stderr, "couldn't alloc color %i %i %i\n", colors[i].red, colors[i].green, colors[i].blue); colors[i].flags = 0; } else colors[i].flags = DoRed|DoGreen|DoBlue; basedisplay->ungrab(); XColor icolors[256]; int incolors = (((1 << screen_depth) > 256) ? 256 : (1 << screen_depth)); for (i = 0; i < incolors; i++) icolors[i].pixel = i; XQueryColors(basedisplay->getXDisplay(), getColormap(), icolors, incolors); for (i = 0; i < ncolors; i++) { if (! colors[i].flags) { unsigned long chk = 0xffffffff, pixel, close = 0; p = 2; while (p--) { for (ii = 0; ii < incolors; ii++) { r = (colors[i].red - icolors[i].red) >> 8; g = (colors[i].green - icolors[i].green) >> 8; b = (colors[i].blue - icolors[i].blue) >> 8; pixel = (r * r) + (g * g) + (b * b); if (pixel < chk) { chk = pixel; close = ii; } colors[i].red = icolors[close].red; colors[i].green = icolors[close].green; colors[i].blue = icolors[close].blue; if (XAllocColor(basedisplay->getXDisplay(), getColormap(), &colors[i])) { colors[i].flags = DoRed|DoGreen|DoBlue; break; } } } } } break; } case GrayScale: case StaticGray: { if (getVisual()->c_class == StaticGray) { ncolors = 1 << screen_depth; } else { ncolors = colors_per_channel * colors_per_channel * colors_per_channel; if (ncolors > (1 << screen_depth)) { colors_per_channel = (1 << screen_depth) / 3; ncolors = colors_per_channel * colors_per_channel * colors_per_channel; } } if (colors_per_channel < 2 || ncolors > (1 << screen_depth)) { fprintf(stderr, "BImageControl::BImageControl: invalid colormap size %d " "(%d/%d/%d) - reducing", ncolors, colors_per_channel, colors_per_channel, colors_per_channel); colors_per_channel = (1 << screen_depth) / 3; } colors = new XColor[ncolors]; if (! colors) { fprintf(stderr, "BImageControl::BImageControl: error allocating " "colormap\n"); exit(1); } int i = 0, ii, p, bits = 255 / (colors_per_channel - 1); red_bits = green_bits = blue_bits = bits; for (i = 0; i < 256; i++) red_color_table[i] = green_color_table[i] = blue_color_table[i] = i / bits; basedisplay->grab(); for (i = 0; i < ncolors; i++) { colors[i].red = (i * 0xffff) / (colors_per_channel - 1); colors[i].green = (i * 0xffff) / (colors_per_channel - 1); colors[i].blue = (i * 0xffff) / (colors_per_channel - 1); ; colors[i].flags = DoRed|DoGreen|DoBlue; if (! XAllocColor(basedisplay->getXDisplay(), getColormap(), &colors[i])) { fprintf(stderr, "couldn't alloc color %i %i %i\n", colors[i].red, colors[i].green, colors[i].blue); colors[i].flags = 0; } else colors[i].flags = DoRed|DoGreen|DoBlue; } basedisplay->ungrab(); XColor icolors[256]; int incolors = (((1 << screen_depth) > 256) ? 256 : (1 << screen_depth)); for (i = 0; i < incolors; i++) icolors[i].pixel = i; XQueryColors(basedisplay->getXDisplay(), getColormap(), icolors, incolors); for (i = 0; i < ncolors; i++) { if (! colors[i].flags) { unsigned long chk = 0xffffffff, pixel, close = 0; p = 2; while (p--) { for (ii = 0; ii < incolors; ii++) { int r = (colors[i].red - icolors[i].red) >> 8; int g = (colors[i].green - icolors[i].green) >> 8; int b = (colors[i].blue - icolors[i].blue) >> 8; pixel = (r * r) + (g * g) + (b * b); if (pixel < chk) { chk = pixel; close = ii; } colors[i].red = icolors[close].red; colors[i].green = icolors[close].green; colors[i].blue = icolors[close].blue; if (XAllocColor(basedisplay->getXDisplay(), getColormap(), &colors[i])) { colors[i].flags = DoRed|DoGreen|DoBlue; break; } } } } } break; } default: fprintf(stderr, "BImageControl::BImageControl: unsupported visual %d\n", getVisual()->c_class); exit(1); } cache = new LinkedList; } BImageControl::~BImageControl(void) { if (sqrt_table) { delete [] sqrt_table; } if (grad_xbuffer) { delete [] grad_xbuffer; } if (grad_ybuffer) { delete [] grad_ybuffer; } if (colors) { unsigned long *pixels = new unsigned long [ncolors]; int i; for (i = 0; i < ncolors; i++) *(pixels + i) = (*(colors + i)).pixel; XFreeColors(basedisplay->getXDisplay(), getColormap(), pixels, ncolors, 0); delete [] colors; } if (cache->count()) { int i, n = cache->count(); fprintf(stderr, "BImageContol::~BImageControl: pixmap cache - " "releasing %d pixmaps\n", n); for (i = 0; i < n; i++) { Cache *tmp = cache->first(); XFreePixmap(basedisplay->getXDisplay(), tmp->pixmap); cache->remove(tmp); delete tmp; } #ifdef TIMEDCACHE if (timer) { timer->stop(); delete timer; } #endif // TIMEDCACHE } delete cache; } Pixmap BImageControl::searchCache(unsigned int width, unsigned int height, unsigned long texture, BColor *c1, BColor *c2) { if (cache->count()) { LinkedListIterator it(cache); for (; it.current(); it++) { if ((it.current()->width == width) && (it.current()->height == height) && (it.current()->texture == texture) && (it.current()->pixel1 == c1->getPixel())) if (texture & BImage_Gradient) { if (it.current()->pixel2 == c2->getPixel()) { it.current()->count++; return it.current()->pixmap; } } else { it.current()->count++; return it.current()->pixmap; } } } return None; } Pixmap BImageControl::renderImage(unsigned int width, unsigned int height, BTexture *texture) { if (texture->getTexture() & BImage_ParentRelative) return ParentRelative; Pixmap pixmap = searchCache(width, height, texture->getTexture(), texture->getColor(), texture->getColorTo()); if (pixmap) return pixmap; BImage image(this, width, height); pixmap = image.render(texture); if (pixmap) { Cache *tmp = new Cache; tmp->pixmap = pixmap; tmp->width = width; tmp->height = height; tmp->count = 1; tmp->texture = texture->getTexture(); tmp->pixel1 = texture->getColor()->getPixel(); if (texture->getTexture() & BImage_Gradient) tmp->pixel2 = texture->getColorTo()->getPixel(); else tmp->pixel2 = 0l; cache->insert(tmp); if ((unsigned) cache->count() > cache_max) { #ifdef DEBUG fprintf(stderr, "BImageControl::renderImage: cache is large, " "forcing cleanout\n"); #endif // DEBUG timeout(); } return pixmap; } return None; } void BImageControl::removeImage(Pixmap pixmap) { if (pixmap) { LinkedListIterator it(cache); for (; it.current(); it++) { if (it.current()->pixmap == pixmap) { Cache *tmp = it.current(); if (tmp->count) { tmp->count--; #ifdef TIMEDCACHE if (! timer) timeout(); #else // !TIMEDCACHE if (! tmp->count) timeout(); #endif // TIMEDCACHE } return; } } } } unsigned long BImageControl::getColor(const char *colorname, unsigned char *r, unsigned char *g, unsigned char *b) { XColor color; color.pixel = 0; if (! XParseColor(basedisplay->getXDisplay(), getColormap(), colorname, &color)) { fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", colorname); } else if (! XAllocColor(basedisplay->getXDisplay(), getColormap(), &color)) { fprintf(stderr, "BImageControl::getColor: color alloc error: \"%s\"\n", colorname); } if (color.red == 65535) *r = 0xff; else *r = (unsigned char) (color.red / 0xff); if (color.green == 65535) *g = 0xff; else *g = (unsigned char) (color.green / 0xff); if (color.blue == 65535) *b = 0xff; else *b = (unsigned char) (color.blue / 0xff); return color.pixel; } unsigned long BImageControl::getColor(const char *colorname) { XColor color; color.pixel = 0; if (! XParseColor(basedisplay->getXDisplay(), getColormap(), colorname, &color)) { fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", colorname); } else if (! XAllocColor(basedisplay->getXDisplay(), getColormap(), &color)) { fprintf(stderr, "BImageControl::getColor: color alloc error: \"%s\"\n", colorname); } return color.pixel; } void BImageControl::getColorTables(unsigned char **rmt, unsigned char **gmt, unsigned char **bmt, int *roff, int *goff, int *boff, int *rbit, int *gbit, int *bbit) { if (rmt) *rmt = red_color_table; if (gmt) *gmt = green_color_table; if (bmt) *bmt = blue_color_table; if (roff) *roff = red_offset; if (goff) *goff = green_offset; if (boff) *boff = blue_offset; if (rbit) *rbit = red_bits; if (gbit) *gbit = green_bits; if (bbit) *bbit = blue_bits; } void BImageControl::getXColorTable(XColor **c, int *n) { if (c) *c = colors; if (n) *n = ncolors; } void BImageControl::getGradientBuffers(unsigned int w, unsigned int h, unsigned int **xbuf, unsigned int **ybuf) { if (w > grad_buffer_width) { if (grad_xbuffer) { delete [] grad_xbuffer; } grad_buffer_width = w; grad_xbuffer = new unsigned int[grad_buffer_width * 3]; } if (h > grad_buffer_height) { if (grad_ybuffer) { delete [] grad_ybuffer; } grad_buffer_height = h; grad_ybuffer = new unsigned int[grad_buffer_height * 3]; } *xbuf = grad_xbuffer; *ybuf = grad_ybuffer; } void BImageControl::installRootColormap(void) { basedisplay->grab(); Bool install = True; int i = 0, ncmap = 0; Colormap *cmaps = XListInstalledColormaps(basedisplay->getXDisplay(), window, &ncmap); if (cmaps) { for (i = 0; i < ncmap; i++) if (*(cmaps + i) == getColormap()) install = False; if (install) XInstallColormap(basedisplay->getXDisplay(), getColormap()); XFree(cmaps); } basedisplay->ungrab(); } void BImageControl::setColorsPerChannel(int cpc) { if (cpc < 2) cpc = 2; if (cpc > 6) cpc = 6; colors_per_channel = cpc; } unsigned long BImageControl::getSqrt(unsigned int x) { if (! sqrt_table) { // build sqrt table for use with elliptic gradient sqrt_table = new unsigned long[(256 * 256 * 2) + 1]; int i = 0; for (; i < (256 * 256 * 2); i++) *(sqrt_table + i) = bsqrt(i); } return (*(sqrt_table + x)); } void BImageControl::parseTexture(BTexture *texture, char *t) { if ((! texture) || (! t)) return; int t_len = strlen(t) + 1, i; char *ts = new char[t_len]; if (! ts) return; // convert to lower case for (i = 0; i < t_len; i++) *(ts + i) = tolower(*(t + i)); if (strstr(ts, "parentrelative")) { texture->setTexture(BImage_ParentRelative); } else { texture->setTexture(0); if (strstr(ts, "solid")) texture->addTexture(BImage_Solid); else if (strstr(ts, "gradient")) { texture->addTexture(BImage_Gradient); if (strstr(ts, "crossdiagonal")) texture->addTexture(BImage_CrossDiagonal); else if (strstr(ts, "rectangle")) texture->addTexture(BImage_Rectangle); else if (strstr(ts, "pyramid")) texture->addTexture(BImage_Pyramid); else if (strstr(ts, "pipecross")) texture->addTexture(BImage_PipeCross); else if (strstr(ts, "elliptic")) texture->addTexture(BImage_Elliptic); else if (strstr(ts, "diagonal")) texture->addTexture(BImage_Diagonal); else if (strstr(ts, "horizontal")) texture->addTexture(BImage_Horizontal); else if (strstr(ts, "vertical")) texture->addTexture(BImage_Vertical); else texture->addTexture(BImage_Diagonal); } else texture->addTexture(BImage_Solid); if (strstr(ts, "raised")) texture->addTexture(BImage_Raised); else if (strstr(ts, "sunken")) texture->addTexture(BImage_Sunken); else if (strstr(ts, "flat")) texture->addTexture(BImage_Flat); else texture->addTexture(BImage_Raised); if (! (texture->getTexture() & BImage_Flat)) if (strstr(ts, "bevel2")) texture->addTexture(BImage_Bevel2); else texture->addTexture(BImage_Bevel1); #ifdef INTERLACE if (strstr(ts, "interlaced")) texture->addTexture(BImage_Interlaced); #endif // INTERLACE } delete [] ts; } void BImageControl::parseColor(BColor *color, char *c) { if (! color) return; if (color->isAllocated()) { unsigned long pixel = color->getPixel(); XFreeColors(basedisplay->getXDisplay(), getColormap(), &pixel, 1, 0); color->setPixel(0l); color->setRGB(0, 0, 0); color->setAllocated(False); } if (c) { unsigned char r, g, b; color->setPixel(getColor(c, &r, &g, &b)); color->setRGB(r, g, b); color->setAllocated(True); } } void BImageControl::timeout(void) { LinkedListIterator it(cache); for (; it.current(); it++) { Cache *tmp = it.current(); if (tmp->count <= 0) { XFreePixmap(basedisplay->getXDisplay(), tmp->pixmap); cache->remove(tmp); delete tmp; } } } bbmail-0.8.3/LinkedList.cc0000644000175100017510000001750307270530047011016 // LinkedList.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // 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. // stupid macros needed to access some functions in version 2 of the GNU C // library #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE #include "LinkedList.hh" #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H #ifdef HAVE_STDIO_H # include #endif // HAVE_STDIO_H __llist_iterator::__llist_iterator(__llist *l) { // initialize the iterator... list = l; if (list) { if (! list->iterators) list->iterators = new __llist; list->iterators->insert(this); } reset(); } __llist_iterator::~__llist_iterator(void) { if (list && list->iterators) list->iterators->remove(this); } void *__llist_iterator::current(void) { // return the current node data... if any return ((node) ? node->getData() : 0); } void __llist_iterator::reset(void) { // update the iterator's current node to the first node in the linked list if (list) node = list->_first; } const int __llist_iterator::set(const int index) { // set the current node to index if (list) { if (index < list->elements && index >= 0 && list->_first) { node = list->_first; for (register int i = 0; i < index; i++) node = node->getNext(); return 1; } } node = (__llist_node *) 0; return 0; } void __llist_iterator::operator++(void) { // iterate to the next node in the list... node = ((node) ? node->getNext() : 0); } void __llist_iterator::operator++(int) { // iterate to the next node in the list... node = ((node) ? node->getNext() : 0); } __llist::__llist(void *d) { // initialize the linked list... _first = (__llist_node *) 0; _last = (__llist_node *) 0; iterators = (__llist *) 0; elements = 0; if (d) insert(d); } __llist::~__llist(void) { // remove all the items in the list... for (register int i = 0, r = elements; i < r; i++) remove(0); if (iterators) { __llist_node *n = iterators->_first; while (n) { ((__llist_iterator *) n->getData())->list = (__llist *) 0; ((__llist_iterator *) n->getData())->node = (__llist_node *) 0; n = n->getNext(); } delete iterators; } } const int __llist::insert(void *d, int index) { // insert item into linked list at specified index... if ((! _first) || (! _last)) { // list is empty... insert the item as the first item, regardless of the // index given _first = new __llist_node; _first->setData(d); _first->setNext((__llist_node *) 0); _last = _first; } else { if (index == 0) { // if index is 0... prepend the data on the list __llist_node *nnode = new __llist_node; nnode->setData(d); nnode->setNext(_first); _first = nnode; } else if ((index == -1) || (index == elements)) { // if index is -1... append the data on the list __llist_node *nnode = new __llist_node; nnode->setData(d); nnode->setNext((__llist_node *) 0); _last->setNext(nnode); _last = nnode; } else if (index < elements) { // otherwise... insert the item at the position specified by index __llist_node *nnode = new __llist_node, *inode = _first->getNext(); if (! nnode) return -1; nnode->setData(d); for (register int i = 1; i < index; i++) if (inode) inode = inode->getNext(); else { delete nnode; return -1; } if ((! inode) || inode == _last) { nnode->setNext((__llist_node *) 0); _last->setNext(nnode); _last = nnode; } else { nnode->setNext(inode->getNext()); inode->setNext(nnode); } } } return ++elements; } const int __llist::remove(void *d) { // remove list item whose data pointer address matches the pointer address // given if ((! _first) || (! _last)) return -1; else if (_first->getData() == d) { // remove the first item in the list... __llist_node *node = _first; _first = _first->getNext(); if (iterators && iterators->_first) { __llist_node *n = iterators->_first; while (n) { ((__llist_iterator *) n->getData())->reset(); n = n->getNext(); } } --elements; delete node; return 0; } else { // iterate through the list and remove the first occurance of the item // NOTE: we don't validate _first in this assignment, because it is checked // for validity above... __llist_node *rnode = _first->getNext(), *prev = _first; for (register int i = 1; i < elements; i++) if (rnode) if (rnode->getData() == d) { // we found the item... update the previous node and delete the // now useless rnode... prev->setNext(rnode->getNext()); if (rnode == _last) _last = prev; if (iterators && iterators->_first) { __llist_node *n = iterators->_first; while (n) { ((__llist_iterator *) n->getData())->reset(); n = n->getNext(); } } --elements; delete rnode; return i; } else { prev = rnode; rnode = rnode->getNext(); } return -1; } } void *__llist::remove(const int index) { if (index >= elements || index < 0 || (! _first) || (! _last)) return (void *) 0; // remove list item at specified index within the list if (index == 0) { // remove the first item in the list... __llist_node *node = _first; void *data_return = _first->getData(); _first = _first->getNext(); if (iterators && iterators->_first) { __llist_node *n = iterators->_first; while (n) { ((__llist_iterator *) n->getData())->reset(); n = n->getNext(); } } --elements; delete node; return data_return; } else { __llist_node *rnode = _first->getNext(), *prev = _first; void *data_return = (void *) 0; for (register int i = 1; i < index; i++) if (rnode) { prev = rnode; rnode = rnode->getNext(); } else return (void *) 0; if (! rnode) return (void *) 0; prev->setNext(rnode->getNext()); data_return = rnode->getData(); if (rnode == _last) _last = prev; if (iterators && iterators->_first) { __llist_node *n = iterators->_first; while (n) { ((__llist_iterator *) n->getData())->reset(); n = n->getNext(); } } --elements; data_return = rnode->getData(); delete rnode; return data_return; } return (void *) 0; } void *__llist::find(const int index) { if (index >= elements || index < 0 || (! _first) || (! _last)) return (void *) 0; if (index == 0) { // return the first item return first(); } else if (index == (elements - 1)) { // return the last item return last(); } else { __llist_node *fnode = _first->getNext(); for (register int i = 1; i < index; i++) if (fnode) fnode = fnode->getNext(); else return (void *) 0; return fnode->getData(); } return (void *) 0; } void *__llist::first(void) { if (_first) return _first->getData(); return (void *) 0; } void *__llist::last(void) { if (_last) return _last->getData(); return (void *) 0; } bbmail-0.8.3/bbmail.hh0000644000175100017510000000754007273350002010206 // bbmail.hh for bbmail - an tool to display new mail in X11. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __MAIN_HH #define __MAIN_HH #include "Image.hh" #include "Basewindow.hh" #include "mailboxmenu.hh" #include "resource.hh" #include "Timer.hh" #define LEFT_BUTTON 1 #define MIDDLE_BUTTON 2 #define RIGHT_BUTTON 3 class Resource; class Mailboxmenu; class Basemenu; class BaseResource; class Basewindow; class ToolWindow; struct PIXMAP { Pixmap frame; Pixmap label; Pixmap envelope; Pixmap envelope_pressed; }; struct PIXMAPLIST { Pixmap envelope_newmail; Pixmap envelope_newmail_pressed; }; struct LABELSIZE { int width0; int width1; int width2; int width3; int width; int height; }; struct FRAMESIZE { int x; int y; int height; int width; }; struct ENVELOPESIZE { int height; int width; }; struct LOCALSPOOLFILE { time_t last_mtime; off_t last_size; int newmail; int totalmail; }; class Checkmail : public TimeoutHandler { public: Checkmail(ToolWindow *); virtual ~Checkmail(void); void Reconfigure(void); int getNewmail(void) { return(newmail); } int getLastTotalmail(void) { return(last_totalmail); } bool getBroken(void) { return(broken); } int getNewMailbox(void) { return(new_mailbox); } void forceCheck(void); private: bool CheckOther(int,bool); bool CheckMbox(int); bool CheckMaildir(int); int ReadPipe(FILE *,int *,int); bool checkStatusFlag(char *,int); bool getChar(char *,int *); void timeout(void); struct LOCALSPOOLFILE *spoolfile; ToolWindow *bbtool; BTimer *timer; int new_mailbox; int last_totalmail; int last_newmail; int newmail; bool broken; unsigned int number_of_checks; }; class ToolWindow : public Basewindow { public: ToolWindow(int argc,char **argv,struct CMDOPTIONS *); ~ToolWindow(void); Window framewin; Window labelwin; Window envelopewin; struct FRAMESIZE Frame(void) { return frame; } void EnvelopePushed(bool pushed) { envelopePushed=pushed; } void CreateWindow(void); void MakeWindow(bool); void EventLoop(void); void reconfigure(void); //void CheckConfig(void); void Redraw(bool); bool raised; char *spooldir; GC getMenuTitleGC(void) { return NULL;/*menuTitleGC;*/ } GC getMenuHiBGGC(void) { return menuHiBGGC; } GC getMenuHiGC(void) { return menuHiGC; } GC getMenuFrameGC(void) { return menuFrameGC; } void saveMenuSearch(Window,Basemenu *); void removeMenuSearch(Window window); Resource *getResource(void); enum { AlignDontCare = 1, AlignTop, AlignBottom }; enum { Right = 1, Left }; enum { Empty = 0, Round, Square, Triangle, Diamond }; Mailboxmenu *mbmenu; protected: virtual void process_event(XEvent *); private: Checkmail *checkmail; Window menuwin; Basemenu* basemenu; int server_grabs; BColor bckColor; XGCValues gcv; GC frameGC; GC labelGC; struct LABELSIZE label; struct FRAMESIZE frame; struct ENVELOPESIZE envelope; // struct LOCALSPOOLFILE *spoolfile; bool close_app; bool mapped; bool envelopePushed; XPoint points[11]; struct PIXMAP pixmap; struct PIXMAPLIST *pixmaplist; Resource *resource; int max_value; GC menuGC; GC menuHiBGGC; GC menuHiGC; GC menuFrameGC; }; #endif /* __MAIN_HH */ bbmail-0.8.3/Image.hh0000644000175100017510000001537307270530054010011 // Image.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // 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. #ifndef __Image_hh #define __Image_hh #include #include #include "Timer.hh" class BImage; class BImageControl; class BColor { private: int allocated; unsigned char red, green, blue; unsigned long pixel; public: BColor(char r = 0, char g = 0, char b = 0) { red = r; green = g; blue = b; pixel = 0; allocated = 0; } inline const int &isAllocated(void) const { return allocated; } inline const unsigned char &getRed(void) const { return red; } inline const unsigned char &getGreen(void) const { return green; } inline const unsigned char &getBlue(void) const { return blue; } inline const unsigned long &getPixel(void) const { return pixel; } inline void setAllocated(int a) { allocated = a; } inline void setRGB(char r, char g, char b) { red = r; green = g; blue = b; } inline void setPixel(unsigned long p) { pixel = p; } }; class BTexture { private: BColor color, colorTo, hiColor, loColor; unsigned long texture; public: BTexture(void) { texture = 0; } inline BColor *getColor(void) { return &color; } inline BColor *getColorTo(void) { return &colorTo; } inline BColor *getHiColor(void) { return &hiColor; } inline BColor *getLoColor(void) { return &loColor; } inline const unsigned long &getTexture(void) const { return texture; } inline void setTexture(unsigned long t) { texture = t; } inline void addTexture(unsigned long t) { texture |= t; } }; // bevel options #define BImage_Flat (1l<<1) #define BImage_Sunken (1l<<2) #define BImage_Raised (1l<<3) // textures #define BImage_Solid (1l<<4) #define BImage_Gradient (1l<<5) // gradients #define BImage_Horizontal (1l<<6) #define BImage_Vertical (1l<<7) #define BImage_Diagonal (1l<<8) #define BImage_CrossDiagonal (1l<<9) #define BImage_Rectangle (1l<<10) #define BImage_Pyramid (1l<<11) #define BImage_PipeCross (1l<<12) #define BImage_Elliptic (1l<<13) // bevel types #define BImage_Bevel1 (1l<<14) #define BImage_Bevel2 (1l<<15) // inverted image #define BImage_Invert (1l<<16) // parent relative image #define BImage_ParentRelative (1l<<17) #ifdef INTERLACE // fake interlaced image # define BImage_Interlaced (1l<<18) #endif // INTERLACE #include "BaseDisplay.hh" #include "LinkedList.hh" class BImage { private: BImageControl *control; #ifdef INTERLACE Bool interlaced; #endif // INTERLACE XColor *colors; BColor *from, *to; int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, ncolors, cpc, cpccpc; unsigned char *red, *green, *blue, *red_table, *green_table, *blue_table; unsigned int width, height, *xtable, *ytable; protected: Pixmap renderPixmap(void); XImage *renderXImage(void); void invert(void); void bevel1(void); void bevel2(void); void dgradient(void); void egradient(void); void hgradient(void); void pgradient(void); void rgradient(void); void vgradient(void); void cdgradient(void); void pcgradient(void); public: BImage(BImageControl *, unsigned int, unsigned int); ~BImage(void); Pixmap render(BTexture *); Pixmap render_solid(BTexture *); Pixmap render_gradient(BTexture *); }; class BImageControl : public TimeoutHandler { private: Bool dither; BaseDisplay *basedisplay; ScreenInfo *screeninfo; #ifdef TIMEDCACHE BTimer *timer; #endif // TIMEDCACHE Colormap root_colormap; Window window; XColor *colors; int colors_per_channel, ncolors, screen_number, screen_depth, bits_per_pixel, red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits; unsigned char red_color_table[256], green_color_table[256], blue_color_table[256]; unsigned int *grad_xbuffer, *grad_ybuffer, grad_buffer_width, grad_buffer_height; unsigned long *sqrt_table, cache_max; typedef struct Cache { Pixmap pixmap; unsigned int count, width, height; unsigned long pixel1, pixel2, texture; } Cache; LinkedList *cache; protected: Pixmap searchCache(unsigned int, unsigned int, unsigned long, BColor *, BColor *); public: BImageControl(BaseDisplay *, ScreenInfo *, Bool = False, int = 4, unsigned long = 300000l, unsigned long = 200l); virtual ~BImageControl(void); inline BaseDisplay *getBaseDisplay(void) { return basedisplay; } inline const Bool &doDither(void) { return dither; } inline const Colormap &getColormap(void) const { return root_colormap; } inline ScreenInfo *getScreenInfo(void) { return screeninfo; } inline const Window &getDrawable(void) const { return window; } inline Visual *getVisual(void) { return screeninfo->getVisual(); } inline const int &getBitsPerPixel(void) const { return bits_per_pixel; } inline const int &getDepth(void) const { return screen_depth; } inline const int &getColorsPerChannel(void) const { return colors_per_channel; } unsigned long getColor(const char *); unsigned long getColor(const char *, unsigned char *, unsigned char *, unsigned char *); unsigned long getSqrt(unsigned int); Pixmap renderImage(unsigned int, unsigned int, BTexture *); void installRootColormap(void); void removeImage(Pixmap); void getColorTables(unsigned char **, unsigned char **, unsigned char **, int *, int *, int *, int *, int *, int *); void getXColorTable(XColor **, int *); void getGradientBuffers(unsigned int, unsigned int, unsigned int **, unsigned int **); void setDither(Bool d) { dither = d; } void setColorsPerChannel(int); void parseTexture(BTexture *, char *); void parseColor(BColor *, char * = 0); virtual void timeout(void); }; #endif // __Image_hh bbmail-0.8.3/LinkedList.hh0000644000175100017510000000707607371576725011053 // LinkedList.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // 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. #ifndef __LinkedList_hh #define __LinkedList_hh class __llist_node { private: __llist_node *next; void *data; protected: public: __llist_node(void) { next = (__llist_node *) 0; data = (void *) 0; } inline __llist_node *getNext(void) { return next; } inline void *getData(void) { return data; } inline void setData(void *d) { data = d; } inline void setNext(__llist_node *n) { next = n; } }; // forward declaration class __llist; class __llist_iterator { private: __llist *list; __llist_node *node; friend class __llist; protected: __llist_iterator(__llist *); ~__llist_iterator(void); const int set(const int); void *current(void); void reset(void); void operator++(void); void operator++(int); }; class __llist { private: int elements; __llist_node *_first, *_last; __llist *iterators; friend class __llist_iterator; protected: __llist(void * = 0); ~__llist(void); inline const int &count(void) const { return elements; } inline const int empty(void) const { return (elements == 0); } const int insert(void *, int = -1); const int remove(void *); void *find(const int); void *remove(const int); void *first(void); void *last(void); }; template class LinkedListIterator : public __llist_iterator { public: LinkedListIterator(__llist *d = 0) : __llist_iterator(d) { return; } inline Z *current(void) { return (Z *) __llist_iterator::current(); } inline const int set(const int i) { return __llist_iterator::set(i); } inline void reset(void) { __llist_iterator::reset(); } inline void operator++(void) { __llist_iterator::operator++(); } inline void operator++(int) { __llist_iterator::operator++(0); } }; template class LinkedList : public __llist { public: LinkedList(Z *d = 0) : __llist(d) { return; } inline Z *find(const int i) { return (Z *) __llist::find(i); } inline Z *remove(const int i) { return (Z *) __llist::remove(i); } inline Z *first(void) { return (Z *) __llist::first(); } inline Z *last(void) { return (Z *) __llist::last(); } inline const int count(void) const { return __llist::count(); } inline const int empty(void) const { return __llist::empty(); } inline const int insert(Z *d, int i = -1) { return __llist::insert((void *) d, i); } inline const int remove(Z *d) { return __llist::remove((void *) d); } }; #endif // __LinkedList_hh bbmail-0.8.3/main.cc0000644000175100017510000000721307307750160007676 // Basewindow.cc for bbtools. // // Copyright (c) 1998-2000 by John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "bbmail.hh" #include "main.hh" void Usage() { fprintf(stdout,"\n%s version %s \n",BBTOOL,BBTOOL_VERSION); fprintf(stdout,"Usage: %s [options]\n",BBTOOL); fprintf(stdout,"Options:\n"); fprintf(stdout,"-display X server to connect to\n"); fprintf(stdout,"-c[onfig] Alternate config file\n"); fprintf(stdout,"-n[obb] Fall back on default configuration\n"); fprintf(stdout,"-v[ersion] Display version number\n"); fprintf(stdout,"-h[elp] Display this help\n"); fprintf(stdout,"-geom[etry] Set geometry of window\n"); fprintf(stdout,"-d[ecorated] Show 'normal' decorated window\n"); fprintf(stdout,"-w[ithdrawn] Place bbtool in the Slit\n"); fprintf(stdout,"-s[hape] Don't display groundplate\n"); fprintf(stdout,"-sp[ooldir] Define alternate spooldir\n"); fprintf(stdout,"-m[ailbox] Show only mailbox \n\n"); } int main(int argc,char **argv) { int i; struct CMDOPTIONS options; options.display_name=NULL; options.geometry=NULL; options.withdrawn=False; options.shape=False; options.config_file=NULL; options.nobb_config=False; options.decorated=False; options.spooldir=NULL; options.mailbox=0; options.app_name=argv[0]; for(i=1;igetXDisplay(), label.font); if (frame.font) XFreeFont(bbtool->getXDisplay(), frame.font); if (menu.font) XFreeFont(bbtool->getXDisplay(), menu.font); frame.font=label.font=menu.font=0; delete [] spoolfile; delete [] report.runCommand; } void Resource::LoadBBToolResource(void) { SizeAndPosition(); Frame(); Menu(); Show(); if (show.label) { Label(); } if (show.envelope) { Envelope(); } MailCheckSettings(); MailboxDep(); } void Resource::Frame() { XrmValue value; char *value_type; readTexture("bbmail.frame","Bbmail.Frame",BB_FRAME,"Toolbar", "slategrey","darkslategrey", "Raised Gradient Vertical Bevel1",&frame.texture); int default_bevel=4; if (bbtool->withdrawn) default_bevel=0; if (XrmGetResource(resource_db, "bbmail.bevelWidth","Bbmail.BevelWidth", &value_type, &value)) { if (sscanf(value.addr, "%u", &frame.bevelWidth) != 1) frame.bevelWidth = default_bevel; else if (frame.bevelWidth == 0) frame.bevelWidth = default_bevel; } else if (XrmGetResource(resource_db, BB_BEVELWIDTH,"BevelWidth", &value_type, &value) && !bbtool->withdrawn) { if (sscanf(value.addr, "%u", &frame.bevelWidth) != 1) frame.bevelWidth = 4; else if (frame.bevelWidth == 0) frame.bevelWidth = 4; } else frame.bevelWidth = default_bevel; } void Resource::Menu() { XrmValue value; char *value_type; readTexture("bbmail.menu","Bbmail.Menu",BB_MENU,"Menu.Frame", "slategrey","darkslategrey", "Raised Diagonal Gradient Bevel1",&menu.texture); readColor("bbmail.menu.highlight.color", "Bbmail.Menu.Highlight.Color", BB_MENU_HIGHLIGHT_COLOR,"Menu.highlightColor", "rgb:c/9/6",&menu.highlightColor); readColor("bbmail.menu.textColor","Bbmail.Menu.TextColor", BB_MENU_TEXTCOLOR,"Menu.Frame.TextColor", "LightGrey",&menu.textColor); readColor("bbmail.menu.highlight.textColor", "Bbmail.Menu.Highlight.TextColor", BB_MENU_HITEXTCOLOR,"Menu.Frame.HiTextColor", "white",&menu.hitextColor); if (XrmGetResource(resource_db,"bbmail.menu.justify","Bbmail.Menu.Justify", &value_type, &value)) { if (! strncasecmp("leftjustify", value.addr, value.size)) menu.justify = LeftJustify; else if (! strncasecmp("rightjustify", value.addr, value.size)) menu.justify = RightJustify; else if (! strncasecmp("centerjustify", value.addr, value.size)) menu.justify = CenterJustify; else menu.justify = LeftJustify; } else if (XrmGetResource(resource_db,BB_MENU_JUSTIFY,"Bbmail.Menu.Justify", &value_type, &value)) { if (! strncasecmp("leftjustify", value.addr, value.size)) menu.justify = LeftJustify; else if (! strncasecmp("rightjustify", value.addr, value.size)) menu.justify = RightJustify; else if (! strncasecmp("centerjustify", value.addr, value.size)) menu.justify = CenterJustify; else menu.justify = LeftJustify; } else menu.justify = LeftJustify; if (XrmGetResource(resource_db, "bbmail.menu.bulletStyle", "Bbmail.Menu.BulletStyle", &value_type, &value)) { if (! strncasecmp(value.addr, "empty", value.size)) menu.bullet_style = Empty; else if (! strncasecmp(value.addr, "square", value.size)) menu.bullet_style = Square; else if (! strncasecmp(value.addr, "triangle", value.size)) menu.bullet_style = Triangle; else if (! strncasecmp(value.addr, "diamond", value.size)) menu.bullet_style = Diamond; else menu.bullet_style = Round; } else { if (XrmGetResource(resource_db, BB_MENU_BULLETSTYLE, "Menu.BulletStyle", &value_type, &value)) { if (! strncasecmp(value.addr, "empty", value.size)) menu.bullet_style = Empty; else if (! strncasecmp(value.addr, "square", value.size)) menu.bullet_style = Square; else if (! strncasecmp(value.addr, "triangle", value.size)) menu.bullet_style = Triangle; else if (! strncasecmp(value.addr, "diamond", value.size)) menu.bullet_style = Diamond; else menu.bullet_style = Round; } else menu.bullet_style = Round; } if (XrmGetResource(resource_db, "bbmail.menu.bulletPosition", "Bbmail.Menu.BulletPosition", &value_type, &value)) { if (! strncasecmp(value.addr, "right", value.size)) menu.bullet_pos = Right; else menu.bullet_pos = Left; } else { if (XrmGetResource(resource_db, BB_MENU_BULLETPOSITION, "Menu.BulletPosition", &value_type, &value)) { if (! strncasecmp(value.addr, "right", value.size)) menu.bullet_pos = Right; else menu.bullet_pos = Left; } else menu.bullet_pos = Left; } const char *defaultFont = "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*"; if (menu.font) { XFreeFont(bbtool->getXDisplay(), menu.font); menu.font = 0; } if (XrmGetResource(resource_db, "bbmail.menu.font", "Bbmail.Menu.Font", &value_type, &value)) { if ((menu.font = XLoadQueryFont(bbtool->getXDisplay(), value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((menu.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else if (XrmGetResource(resource_db, BB_MENU_FONT, "MenuFont", &value_type, &value)) { if ((menu.font = XLoadQueryFont(bbtool->getXDisplay(), value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((menu.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else { if ((menu.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr,"blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } void Resource::SizeAndPosition() { XrmValue value; char *value_type; unsigned int w,h; char positionstring[11]; if (!(bbtool->withdrawn)) { if (XrmGetResource(resource_db, "bbmail.withdrawn", "Bbmail.Withdrawn", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->withdrawn = True; else bbtool->withdrawn = False; } else bbtool->withdrawn = False; } if (!(bbtool->shape)) { if (XrmGetResource(resource_db, "bbmail.shape", "Bbmail.Shape", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->shape = True; else bbtool->shape = False; } else bbtool->shape = bbtool->withdrawn; } if (!(bbtool->position)) { if (!(XrmGetResource(resource_db, "bbmail.position","Bbmail.Position", &value_type, &value))) strncpy(positionstring, "-0-0", 5); else strncpy(positionstring, value.addr, strlen(value.addr)+1); } else strncpy(positionstring, bbtool->position, strlen(bbtool->position)+1); position.mask=XParseGeometry(positionstring, &position.x, &position.y, &w, &h); if (!(position.mask & XValue)) position.x=0; if (!(position.mask & YValue)) position.y=0; /* need this to compute the height */ const char *defaultFont = "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*"; if (frame.font) { XFreeFont(bbtool->getXDisplay(), frame.font); frame.font = 0; } if (XrmGetResource(resource_db, "bbmail.heightBy.font","Bbmail.heightBy.Font", &value_type, &value)) { if ((frame.font = XLoadQueryFont(bbtool->getXDisplay(), value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((frame.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr,"blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else if (XrmGetResource(resource_db, BB_FONT,"TitleFont", &value_type, &value)) { if ((frame.font = XLoadQueryFont(bbtool->getXDisplay(), value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((frame.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else { if ((frame.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } void Resource::MailCheckSettings() { XrmValue value; char *value_type; if (XrmGetResource(resource_db, "bbmail.check.delay", "Bbmail.Check.Delay", &value_type, &value)) { if (sscanf(value.addr, "%u", &report.check_delay) != 1) report.check_delay = 5; else if (report.check_delay == 0) report.check_delay = 5; } else report.check_delay = 5; if (XrmGetResource(resource_db, "bbmail.forceCheck.onDelay", "Bbmail.forceCheck.onDelay",&value_type, &value)) { if (sscanf(value.addr, "%u", &report.force_check_delay) != 1) report.force_check_delay = 60; else if (report.check_delay == 0) report.force_check_delay = 1; } else report.force_check_delay = 60; if (XrmGetResource(resource_db, "bbmail.raised","Bbmail.Raised", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->raised = True; else bbtool->raised = False; } else bbtool->raised = True; if (XrmGetResource(resource_db, "bbmail.autoRaise","Bbmail.AutoRaise", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) report.auto_raise = True; else report.auto_raise = False; } else report.auto_raise = True; } void Resource::Label(void) { XrmValue value; char *value_type; /* text-label resources */ if (XrmGetResource(resource_db, "bbmail.label.transparent", "Bbmail.label.Transparent", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) label.transparent = True; else label.transparent = False; } else label.transparent = False; readTexture("bbmail.label", "Bbmail.Label",BB_LABEL,"Toolbar.Label", "slategrey","darkslategrey", "Sunken Gradient Vertical Bevel1",&label.texture); if (show.newmail_counter) { readColor("bbmail.newmail.counter.textColor", "Bbmail.Newmail.Counter.TextColor", BB_LABEL_TEXTCOLOR, "Toolbar.TextColor", "LightGrey",&label.newmail_textColor); readDatabaseColor("bbmail.newmail.counter.boring.textColor", "Bbmail.Newmail.Counter.Boring.TextColor", &label.newmail_boring_textColor); if (!label.newmail_boring_textColor.isAllocated()) CopyColor(&label.newmail_textColor, &label.newmail_boring_textColor); } if (show.totalmail_counter) { readColor("bbmail.totalmail.counter.textColor", "Bbmail.TotalMail.Counter.TextColor", BB_LABEL_TEXTCOLOR, "Toolbar.TextColor", "LightGrey",&label.totalmail_textColor); readDatabaseColor("bbmail.totalmail.counter.boring.textColor", "Bbmail.Totalmail.Counter.Boring.TextColor", &label.totalmail_boring_textColor); if (!label.totalmail_boring_textColor.isAllocated()) CopyColor(&label.totalmail_textColor, &label.totalmail_boring_textColor); } if (show.newmail_counter & show.totalmail_counter) { readColor("bbmail.seperator.counter.textColor", "Bbmail.Seperator.Counter.TextColor", BB_LABEL_TEXTCOLOR, "Toolbar.TextColor", "LightGrey",&label.seperator_textColor); readDatabaseColor("bbmail.seperator.counter.boring.textColor", "Bbmail.Seperator.Counter.Boring.TextColor", &label.seperator_boring_textColor); if (!label.seperator_boring_textColor.isAllocated()) CopyColor(&label.seperator_textColor, &label.seperator_boring_textColor); } const char *defaultFont = "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*"; if (label.font) { XFreeFont(bbtool->getXDisplay(), label.font); label.font = 0; } if (XrmGetResource(resource_db, "bbmail.label.font", "Bbmail.Label.Font", &value_type, &value)) { if ((label.font = XLoadQueryFont(bbtool->getXDisplay(), value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((label.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else if (XrmGetResource(resource_db, BB_FONT, "TitleFont", &value_type, &value)) { if ((label.font = XLoadQueryFont(bbtool->getXDisplay(), value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((label.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else { if ((label.font = XLoadQueryFont(bbtool->getXDisplay(), defaultFont)) == NULL) { fprintf(stderr,"blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } void Resource::Show() { XrmValue value; char *value_type; if (XrmGetResource(resource_db, "bbmail.numberOf.digits", "Bbmail.numberOf.digits", &value_type, &value)) { if (sscanf(value.addr, "%u", &report.number_of_digits) != 1) report.number_of_digits = 2; else if (report.number_of_digits==0) report.number_of_digits=1; } else report.number_of_digits = 2; /* what to show.resources */ if (XrmGetResource(resource_db, "bbmail.show.newmail.counter", "Bbmail.Display.Newmail.Counter", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) show.newmail_counter = True; else show.newmail_counter = False; } else show.newmail_counter = True; if (XrmGetResource(resource_db, "bbmail.show.totalmail.counter", "Bbmail.Display.Totalmail.Counter", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) show.totalmail_counter = True; else show.totalmail_counter = False; } else show.totalmail_counter = True; if (!( (show.totalmail_counter) | (show.newmail_counter))) show.label=False; else show.label=True; if (XrmGetResource(resource_db, "bbmail.show.envelope", "Bbmail.Display.Envelope", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) show.envelope = True; else show.envelope = False; } else show.envelope = True; if (XrmGetResource(resource_db, "bbmail.show.onlyAtnewmail", "Bbmail.Display.OnlyAtNewmail", &value_type, &value)) { if (! strncasecmp("false", value.addr, value.size)) show.onlyAtNewMail = False; else show.onlyAtNewMail = True; } else show.onlyAtNewMail = False; if (XrmGetResource(resource_db,"bbmail.pressed.runCommand","Bbmail.Pressed.RunCommand", &value_type, &value)) { int len = strlen(value.addr); delete [] report.runCommand; report.runCommand = new char[len + 2]; memset(report.runCommand, 0, len + 2); strncpy(report.runCommand, value.addr, len); if (value.addr[len-1]!='&') { report.runCommand[len]='&'; report.runCommand[len+1]='\0'; } } else report.runCommand=NULL; } void Resource::Envelope() { XrmValue value; char *value_type; if (!(show.onlyAtNewMail)) { unsigned long texture; texture = (frame.texture.getTexture() & ~(BImage_Raised|BImage_Sunken| BImage_Flat))|BImage_Sunken; readDatabaseTexture("bbmail.envelope","Bbmail.Envelope", &envelope.texture); if (!envelope.texture.getTexture()) { envelope.texture.setTexture(texture); CopyColor(frame.texture.getColor(),envelope.texture.getColor()); CopyColor(frame.texture.getColorTo(),envelope.texture.getColorTo()); } texture = (frame.texture.getTexture() & ~(BImage_Raised|BImage_Sunken| BImage_Flat))|BImage_Flat; readDatabaseTexture("bbmail.envelope.pressed","Bbmail.Envelope.Pressed", &envelope.texture_pressed); if (!envelope.texture.getTexture()) { envelope.texture_pressed.setTexture(texture); CopyColor(frame.texture.getColor(),envelope.texture_pressed.getColor()); CopyColor(frame.texture.getColorTo(), envelope.texture_pressed.getColorTo()); } readColor("bbmail.envelope.textColor","Bbmail.Envelope.TextColor", BB_ENVELOPE_TEXTCOLOR,"Toolbar.TextColor", "black",&envelope.textColor); readColor("bbmail.envelope.error.textColor", "Bbmail.Envelope.error.TextColor", 0,0,"red2",&envelope.error_textColor); if (XrmGetResource(resource_db, "bbmail.envelope.bevelWidth", "Bbmail.Envelope.BevelWidth", &value_type, &value)) { if (sscanf(value.addr, "%u", &envelope.bevelWidth) != 1) envelope.bevelWidth = 2; } else envelope.bevelWidth = 2; } envelope.bevelHeight=envelope.bevelWidth; if (bbtool->withdrawn) envelope.bevelHeight=0; } void Resource::MailboxDep(void) { XrmValue value; char *value_type; int i; char strname[48]; char strclass[48]; bool default_defined=False; int start_mailbox=1; if (bbtool->spooldir) { report.number_of_spoolfiles=1; delete [] spoolfile; spoolfile = new SpoolList[report.number_of_spoolfiles]; memset(spoolfile,0, report.number_of_spoolfiles*sizeof(SpoolList)); default_defined=True; } else { /* read number of spool-files */ if (XrmGetResource(resource_db, "bbmail.numberOf.mailboxes", "bbmail.NumberOf.Mailboxes", &value_type, &value)) { if (sscanf(value.addr, "%d", &report.number_of_spoolfiles) != 1) report.number_of_spoolfiles = 1; else { if (report.number_of_spoolfiles < 0) report.number_of_spoolfiles = 0; if (report.number_of_spoolfiles > 100) report.number_of_spoolfiles = 100; } } else { report.number_of_spoolfiles = 0; } if (bbtool->mailbox_number) { if (bbtool->mailbox_number>report.number_of_spoolfiles) { fprintf(stderr,"mailbox %i does not exist\n",bbtool->mailbox_number); exit(-1); } start_mailbox=bbtool->mailbox_number; report.number_of_spoolfiles=1; } if (report.number_of_spoolfiles!=0) { delete [] spoolfile; spoolfile = new SpoolList[report.number_of_spoolfiles]; memset(spoolfile,0, report.number_of_spoolfiles*sizeof(SpoolList)); } else { if (!getenv("MAIL")) { fprintf(stderr,"\nAborting: No spool filename specified. \n\n"); fprintf(stderr, "Make sure the enviroment variable MAIL is set\n"); exit(1); } report.number_of_spoolfiles=1; delete [] spoolfile; spoolfile = new SpoolList[report.number_of_spoolfiles]; memset(spoolfile,0, report.number_of_spoolfiles*sizeof(SpoolList)); default_defined=True; } } /* read spool file names */ for (i=0;ispooldir) { spoolfile[0].LoadFilename(bbtool->spooldir); } else { spoolfile[i].LoadFilename(getenv("MAIL")); } } else { sprintf(strname,"bbmail.mailbox.%d.filename",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Filename",i+start_mailbox); if (XrmGetResource(resource_db,strname, strclass, &value_type, &value)) spoolfile[i].LoadFilename(value.addr); else spoolfile[i].filename=NULL; } sprintf(strname,"bbmail.mailbox.%d.name",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.name",i+start_mailbox); if (XrmGetResource(resource_db,strname, strclass, &value_type, &value)) spoolfile[i].LoadName(value.addr); else { /* change this to default = filename */ char *dummy = new char [12]; sprintf(dummy,"mailbox %d",i+start_mailbox); spoolfile[i].LoadName(dummy); delete [] dummy; } /* new mail */ if (show.envelope) { sprintf(strname,"bbmail.mailbox.%d.newmail",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Newmail",i+start_mailbox); readTexture(strname,strclass,BB_NEWMAIL,"Toolbar.Button", "rgb:c/9/6","rgb:8/6/4", "Raised Gradient Diagonal Bevel1", &spoolfile[i].newmail_texture); sprintf(strname,"bbmail.mailbox.%d.newmail.pressed",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Newmail.Pressed",i+start_mailbox); readTexture(strname,strclass,BB_NEWMAIL_PRESSED,"Toolbar.Button.Pressed", "rgb:c/9/6","rgb:8/6/4", "Sunken Gradient Diagonal Bevel1", &spoolfile[i].newmail_pressed_texture); sprintf(strname,"bbmail.mailbox.%d.newmail.textColor",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Newmail.textColor",i+start_mailbox); readColor(strname,strclass,BB_ENVELOPE_TEXTCOLOR,"Toolbar.TextColor", "black",&spoolfile[i].newmail_textColor); sprintf(strname,"bbmail.mailbox.%d.newmail.error.textColor", i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Newmail.Error.textColor", i+start_mailbox); readColor(strname,strclass,0,0,"black", &spoolfile[i].newmail_error_textColor); sprintf(strname,"bbmail.mailbox.%d.newmail.pressed.runCommand", i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Newmail.Pressed.RunCommand", i+start_mailbox); if (XrmGetResource(resource_db,strname,strclass,&value_type, &value)) spoolfile[i].LoadrunCommand(value.addr); else { if (report.runCommand!=NULL) spoolfile[i].LoadrunCommand(report.runCommand); else spoolfile[i].runCommand=NULL; } } /* end envelope resources */ sprintf(strname,"bbmail.mailbox.%d.newmail.statusFlag",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Newmail.StatusFlag",i+start_mailbox); if (XrmGetResource(resource_db,strname,strclass,&value_type, &value)) spoolfile[i].LoadstatusFlag(value.addr); else { char *status = "Status: R"; spoolfile[i].LoadstatusFlag(status); } if (!default_defined) { sprintf(strname,"bbmail.mailbox.%d.proc",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.proc",i+start_mailbox); if (XrmGetResource(resource_db,strname,strclass, &value_type, &value)) { spoolfile[i].LoadProc(value.addr); if (spoolfile[i].filename==NULL) { report.force_check=True; spoolfile[i].force_check=True; } } else spoolfile[i].proc=NULL; sprintf(strname,"bbmail.mailbox.%d.reversedProc",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.ReversedProc",i+start_mailbox); if (XrmGetResource(resource_db,strname,strclass, &value_type, &value)) { spoolfile[i].LoadreversedProc(value.addr); if (spoolfile[i].filename==NULL) { report.force_check=True; spoolfile[i].force_check=True; } } else spoolfile[i].reversedProc=NULL; } sprintf(strname,"bbmail.mailbox.%d.newmail.runCommand",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.newmail.RunCommand",i+start_mailbox); if (XrmGetResource(resource_db,strname,strclass, &value_type, &value)) { spoolfile[i].LoadnewmailProc(value.addr); } else spoolfile[i].newmailProc=NULL; sprintf(strname,"bbmail.mailbox.%d.newmail.bell",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.newmail.Bell",i+start_mailbox); if (XrmGetResource(resource_db,strname,strclass, &value_type, &value)) { if (! strncasecmp("false", value.addr, value.size)) spoolfile[i].bell = False; else spoolfile[i].bell = True; } else spoolfile[i].bell = True; sprintf(strname,"bbmail.mailbox.%d.mode",i+start_mailbox); sprintf(strclass,"Bbmail.Mailbox.%d.Mode",i+start_mailbox); if (XrmGetResource(resource_db,strname,strclass, &value_type, &value)) { if (! strncasecmp("2", value.addr, value.size)) { spoolfile[i].first_is_new = True; spoolfile[i].second_is_total = False; spoolfile[i].second_ignore = False; } else if (! strncasecmp("3", value.addr, value.size)) { spoolfile[i].first_is_new = False; spoolfile[i].second_is_total = True; spoolfile[i].second_ignore = False; } else if (! strncasecmp("4", value.addr, value.size)) { spoolfile[i].first_is_new = True; spoolfile[i].second_is_total = True; spoolfile[i].second_ignore = True; } else { spoolfile[i].first_is_new = True; spoolfile[i].second_is_total = True; spoolfile[i].second_ignore = False; } } else { spoolfile[i].first_is_new = True; spoolfile[i].second_is_total = True; spoolfile[i].second_ignore = False; } } /* for */ } bbmail-0.8.3/resource.hh0000644000175100017510000000655507273350740010625 // resource.hh for bbmail - an tool to display new mail in X11. // // this program is free software; you can redistribute it and/or modify // it under the terms of the gnu general public license as published by // the free software foundation; either version 2 of the license, or // (at your option) any later version. // // this program is distributed in the hope that it will be useful, // but without any warranty; without even the implied warranty of // merchantability or fitness for a particular purpose. see the // gnu general public license for more details. // // you should have received a copy of the gnu general public license // along with this program; if not, write to the free software // foundation, inc., 675 mass ave, cambridge, ma 02139, usa. // // (see the included file copying / gpl-2.0) // #ifndef __RESOURCE_HH #define __RESOURCE_HH #include "bbmail.hh" #include "spoollist.hh" #include "Baseresource.hh" class SpoolList; class BaseResource; struct FRAME { int width; int height; BTexture texture; int bevelWidth; XFontStruct *font; }; struct POSITION { int x; int y; int mask; }; struct LABEL { int width; int width0, width1, width2, width3; int height; bool transparent; BTexture texture; XFontStruct *font; BColor newmail_textColor; BColor totalmail_textColor; BColor seperator_textColor; BColor newmail_boring_textColor; BColor totalmail_boring_textColor; BColor seperator_boring_textColor; }; struct MENU { BTexture texture; BColor textColor; BColor highlightColor; BColor hitextColor; int justify; XFontStruct *font; int bullet_style; int bullet_pos; }; struct ENVELOPE { int width; int height; BTexture texture; BTexture texture_pressed; BColor textColor; BColor error_textColor; int bevelWidth; int bevelHeight; }; struct SHOW { bool newmail_counter; bool totalmail_counter; bool label; bool envelope; bool onlyAtNewMail; }; struct REPORT { bool auto_raise; unsigned int check_delay; unsigned int force_check_delay; bool force_check; int number_of_spoolfiles; int number_of_digits; char *runCommand; }; class Resource : public BaseResource { public: Resource(ToolWindow *); ~Resource(void); struct FRAME frame; struct LABEL label; struct POSITION position; struct ENVELOPE envelope; struct SHOW show; struct REPORT report; struct MENU menu; SpoolList *spoolfile; /* menu */ const int getJustification(void) const { return LeftJustify; } int getMenuJustification(void) { return menu.justify; } XFontStruct *getTitleFont(void) { return menu.font; } XFontStruct *getMenuFont(void) { return menu.font; } unsigned int getBevelWidth(void) { return frame.bevelWidth; } BColor *getBorderColor(void) { return frame.texture.getColor(); } unsigned int getBorderWidth(void) { return 0; } int getBulletStyle(void) { return menu.bullet_style; } int getBulletPosition(void) { return menu.bullet_pos; } enum { AlignDontCare = 1, AlignTop, AlignBottom }; enum { Right = 1, Left }; enum { Empty = 0, Round, Square, Triangle, Diamond }; enum { LeftJustify = 1, RightJustify, CenterJustify }; protected: virtual void LoadBBToolResource(void); private: void Frame(void); void SizeAndPosition(void); void MailCheckSettings(void); void Label(void); void Show(void); void Envelope(void); void MailboxDep(void); void Menu(void); void Clean(void); }; #endif /* __RESOURCE_HH */ bbmail-0.8.3/BaseDisplay.cc0000644000175100017510000003560607342156457011171 // BaseDisplay.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // 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. // stupid macros needed to access some functions in version 2 of the GNU C // library #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H #include #include #include #include #ifdef SHAPE # include #endif // SHAPE #include "BaseDisplay.hh" #include "LinkedList.hh" #include "Timer.hh" #ifdef HAVE_FCNTL_H # include #endif // HAVE_FCNTL_H #ifdef HAVE_STDIO_H # include #endif // HAVE_STDIO_H #ifdef STDC_HEADERS # include # include #endif // STDC_HEADERS #ifdef HAVE_UNISTD_H # include # include #endif // HAVE_UNISTD_H #ifdef HAVE_SYS_SELECT_H # include #endif // HAVE_SYS_SELECT_H #ifdef HAVE_SIGNAL_H # include #endif // HAVE_SIGNAL_H #ifndef SA_NODEFER # ifdef SA_INTERRUPT # define SA_NODEFER SA_INTERRUPT # else // !SA_INTERRUPT # define SA_NODEFER (0) # endif // SA_INTERRUPT #endif // SA_NODEFER #ifdef HAVE_SYS_WAIT_H # include # include #endif // HAVE_SYS_WAIT_H #if defined(HAVE_PROCESS_H) && defined(__EMX__) # include #endif // HAVE_PROCESS_H __EMX__ // X error handler to handle any and all X errors while the application is // running static Bool internal_error = False; static Window last_bad_window = None; BaseDisplay *base_display; #ifdef DEBUG static int handleXErrors(Display *d, XErrorEvent *e) { char errtxt[128]; XGetErrorText(d, e->error_code, errtxt, 128); fprintf(stderr, "%s: X error: %s(%d) opcodes %d/%d\n resource 0x%lx\n", base_display->getApplicationName(), errtxt, e->error_code, e->request_code, e->minor_code, e->resourceid); #else // !DEBUG static int handleXErrors(Display *, XErrorEvent *e) { #endif // DEBUG if (e->error_code == BadWindow) last_bad_window = e->resourceid; if (internal_error) abort(); return(False); } // signal handler to allow for proper and gentle shutdown #ifndef HAVE_SIGACTION static RETSIGTYPE signalhandler(int sig) { #else // HAVE_SIGACTION static void signalhandler(int sig) { #endif // HAVE_SIGACTION static int re_enter = 0; switch (sig) { case SIGCHLD: int status; waitpid(-1, &status, WNOHANG | WUNTRACED); #ifndef HAVE_SIGACTION // assume broken, braindead sysv signal semantics signal(SIGCHLD, (RETSIGTYPE (*)(int)) signalhandler); #endif // HAVE_SIGACTION break; default: if (base_display->handleSignal(sig)) { #ifndef HAVE_SIGACTION // assume broken, braindead sysv signal semantics signal(sig, (RETSIGTYPE (*)(int)) signalhandler); #endif // HAVE_SIGACTION return; } fprintf(stderr, "%s: signal %d caught\n", base_display->getApplicationName(), sig); if (! base_display->isStartup() && ! re_enter) { internal_error = True; re_enter = 1; fprintf(stderr, "shutting down\n"); base_display->shutdown(); } if (sig != SIGTERM && sig != SIGINT) { fprintf(stderr, "aborting... dumping core\n"); abort(); } exit(0); break; } } // convenience functions #ifndef __EMX__ void bexec(const char *command, char* displaystring) { if (! fork()) { setsid(); putenv(displaystring); execl("/bin/sh", "/bin/sh", "-c", command, NULL); exit(0); } } #endif // !__EMX__ char *bstrdup(const char *s) { int l = strlen(s) + 1; char *n = new char[l]; strncpy(n, s, l); return n; } BaseDisplay::BaseDisplay(char *app_name, char *dpy_name) { application_name = app_name; _startup = True; _shutdown = False; server_grabs = 0; last_bad_window = None; ::base_display = this; #ifdef HAVE_SIGACTION struct sigaction action; action.sa_handler = signalhandler; action.sa_mask = sigset_t(); action.sa_flags = SA_NOCLDSTOP | SA_NODEFER; sigaction(SIGSEGV, &action, NULL); sigaction(SIGFPE, &action, NULL); sigaction(SIGTERM, &action, NULL); sigaction(SIGINT, &action, NULL); sigaction(SIGCHLD, &action, NULL); sigaction(SIGHUP, &action, NULL); sigaction(SIGUSR1, &action, NULL); sigaction(SIGUSR2, &action, NULL); #else // !HAVE_SIGACTION signal(SIGSEGV, (RETSIGTYPE (*)(int)) signalhandler); signal(SIGFPE, (RETSIGTYPE (*)(int)) signalhandler); signal(SIGTERM, (RETSIGTYPE (*)(int)) signalhandler); signal(SIGINT, (RETSIGTYPE (*)(int)) signalhandler); signal(SIGUSR1, (RETSIGTYPE (*)(int)) signalhandler); signal(SIGUSR2, (RETSIGTYPE (*)(int)) signalhandler); signal(SIGHUP, (RETSIGTYPE (*)(int)) signalhandler); signal(SIGCHLD, (RETSIGTYPE (*)(int)) signalhandler); #endif // HAVE_SIGACTION if (! (display = XOpenDisplay(dpy_name))) { fprintf(stderr, "BaseDisplay::BaseDisplay: connection to X server failed.\n"); ::exit(2); } else if (fcntl(ConnectionNumber(display), F_SETFD, 1) == -1) { fprintf(stderr, "BaseDisplay::BaseDisplay: couldn't mark display connection " "as close-on-exec\n"); ::exit(2); } number_of_screens = ScreenCount(display); display_name = XDisplayName(dpy_name); #ifdef SHAPE shape.extensions = XShapeQueryExtension(display, &shape.event_basep, &shape.error_basep); #else // !SHAPE shape.extensions = False; #endif // SHAPE xa_wm_colormap_windows = XInternAtom(display, "WM_COLORMAP_WINDOWS", False); xa_wm_protocols = XInternAtom(display, "WM_PROTOCOLS", False); xa_wm_state = XInternAtom(display, "WM_STATE", False); xa_wm_change_state = XInternAtom(display, "WM_CHANGE_STATE", False); xa_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); xa_wm_take_focus = XInternAtom(display, "WM_TAKE_FOCUS", False); motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False); blackbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); blackbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); blackbox_change_attributes = XInternAtom(display, "_BLACKBOX_CHANGE_ATTRIBUTES", False); blackbox_structure_messages = XInternAtom(display, "_BLACKBOX_STRUCTURE_MESSAGES", False); blackbox_notify_startup = XInternAtom(display, "_BLACKBOX_NOTIFY_STARTUP", False); blackbox_notify_window_add = XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False); blackbox_notify_window_del = XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False); blackbox_notify_current_workspace = XInternAtom(display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False); blackbox_notify_workspace_count = XInternAtom(display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False); blackbox_notify_window_focus = XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False); blackbox_notify_window_raise = XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False); blackbox_notify_window_lower = XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False); blackbox_change_workspace = XInternAtom(display, "_BLACKBOX_CHANGE_WORKSPACE", False); blackbox_change_window_focus = XInternAtom(display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False); blackbox_cycle_window_focus = XInternAtom(display, "_BLACKBOX_CYCLE_WINDOW_FOCUS", False); #ifdef NEWWMSPEC net_supported = XInternAtom(display, "_NET_SUPPORTED", False); net_client_list = XInternAtom(display, "_NET_CLIENT_LIST", False); net_client_list_stacking = XInternAtom(display, "_NET_CLIENT_LIST_STACKING", False); net_number_of_desktops = XInternAtom(display, "_NET_NUMBER_OF_DESKTOPS", False); net_desktop_geometry = XInternAtom(display, "_NET_DESKTOP_GEOMETRY", False); net_desktop_viewport = XInternAtom(display, "_NET_DESKTOP_VIEWPORT", False); net_current_desktop = XInternAtom(display, "_NET_CURRENT_DESKTOP", False); net_desktop_names = XInternAtom(display, "_NET_DESKTOP_NAMES", False); net_active_window = XInternAtom(display, "_NET_ACTIVE_WINDOW", False); net_workarea = XInternAtom(display, "_NET_WORKAREA", False); net_supporting_wm_check = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False); net_virtual_roots = XInternAtom(display, "_NET_VIRTUAL_ROOTS", False); net_close_window = XInternAtom(display, "_NET_CLOSE_WINDOW", False); net_wm_moveresize = XInternAtom(display, "_NET_WM_MOVERESIZE", False); net_properties = XInternAtom(display, "_NET_PROPERTIES", False); net_wm_name = XInternAtom(display, "_NET_WM_NAME", False); net_wm_desktop = XInternAtom(display, "_NET_WM_DESKTOP", False); net_wm_window_type = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); net_wm_state = XInternAtom(display, "_NET_WM_STATE", False); net_wm_strut = XInternAtom(display, "_NET_WM_STRUT", False); net_wm_icon_geometry = XInternAtom(display, "_NET_WM_ICON_GEOMETRY", False); net_wm_icon = XInternAtom(display, "_NET_WM_ICON", False); net_wm_pid = XInternAtom(display, "_NET_WM_PID", False); net_wm_handled_icons = XInternAtom(display, "_NET_WM_HANDLED_ICONS", False); net_wm_ping = XInternAtom(display, "_NET_WM_PING", False); #endif // NEWWMSPEC cursor.session = XCreateFontCursor(display, XC_left_ptr); cursor.move = XCreateFontCursor(display, XC_fleur); cursor.ll_angle = XCreateFontCursor(display, XC_ll_angle); cursor.lr_angle = XCreateFontCursor(display, XC_lr_angle); XSetErrorHandler((XErrorHandler) handleXErrors); timerList = new LinkedList; screenInfoList = new LinkedList; int i; for (i = 0; i < number_of_screens; i++) { ScreenInfo *screeninfo = new ScreenInfo(this, i); screenInfoList->insert(screeninfo); } } BaseDisplay::~BaseDisplay(void) { while (screenInfoList->count()) { ScreenInfo *si = screenInfoList->first(); screenInfoList->remove(si); delete si; } delete screenInfoList; // we don't create the BTimers, we don't delete them while (timerList->count()) timerList->remove(0); delete timerList; XCloseDisplay(display); } void BaseDisplay::eventLoop(void) { run(); int xfd = ConnectionNumber(display); while ((! _shutdown) && (! internal_error)) { if (XPending(display)) { XEvent e; XNextEvent(display, &e); if (last_bad_window != None && e.xany.window == last_bad_window) { #ifdef DEBUG fprintf(stderr, "BaseDisplay::eventLoop(): removing bad window " "from event queue\n"); #endif // DEBUG } else { last_bad_window = None; process_event(&e); } } else { fd_set rfds; timeval now, tm, *timeout = (timeval *) 0; FD_ZERO(&rfds); FD_SET(xfd, &rfds); if (timerList->count()) { gettimeofday(&now, 0); tm.tv_sec = tm.tv_usec = 0l; BTimer *timer = timerList->first(); tm.tv_sec = timer->getStartTime().tv_sec + timer->getTimeout().tv_sec - now.tv_sec; tm.tv_usec = timer->getStartTime().tv_usec + timer->getTimeout().tv_usec - now.tv_usec; while (tm.tv_usec >= 1000000) { tm.tv_sec++; tm.tv_usec -= 1000000; } while (tm.tv_usec < 0) { if (tm.tv_sec > 0) { tm.tv_sec--; tm.tv_usec += 1000000; } else { tm.tv_usec = 0; break; } } timeout = &tm; } select(xfd + 1, &rfds, 0, 0, timeout); // check for timer timeout gettimeofday(&now, 0); LinkedListIterator it(timerList); for(; it.current(); it++) { tm.tv_sec = it.current()->getStartTime().tv_sec + it.current()->getTimeout().tv_sec; tm.tv_usec = it.current()->getStartTime().tv_usec + it.current()->getTimeout().tv_usec; if ((now.tv_sec < tm.tv_sec) || (now.tv_sec == tm.tv_sec && now.tv_usec < tm.tv_usec)) break; it.current()->fireTimeout(); // restart the current timer so that the start time is updated if (! it.current()->doOnce()) it.current()->start(); else it.current()->stop(); } } } } const Bool BaseDisplay::validateWindow(Window window) { XEvent event; if (XCheckTypedWindowEvent(display, window, DestroyNotify, &event)) { XPutBackEvent(display, &event); return False; } return True; } void BaseDisplay::grab(void) { if (! server_grabs++) XGrabServer(display); } void BaseDisplay::ungrab(void) { if (! --server_grabs) XUngrabServer(display); if (server_grabs < 0) server_grabs = 0; } void BaseDisplay::addTimer(BTimer *timer) { if (! timer) return; LinkedListIterator it(timerList); int index = 0; for (; it.current(); it++, index++) if ((it.current()->getTimeout().tv_sec > timer->getTimeout().tv_sec) || ((it.current()->getTimeout().tv_sec == timer->getTimeout().tv_sec) && (it.current()->getTimeout().tv_usec >= timer->getTimeout().tv_usec))) break; timerList->insert(timer, index); } void BaseDisplay::removeTimer(BTimer *timer) { timerList->remove(timer); } ScreenInfo::ScreenInfo(BaseDisplay *d, int num) { basedisplay = d; screen_number = num; root_window = RootWindow(basedisplay->getXDisplay(), screen_number); depth = DefaultDepth(basedisplay->getXDisplay(), screen_number); width = WidthOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), screen_number)); height = HeightOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), screen_number)); // search for a TrueColor Visual... if we can't find one... we will use the // default visual for the screen XVisualInfo vinfo_template, *vinfo_return; int vinfo_nitems; vinfo_template.screen = screen_number; vinfo_template.c_class = TrueColor; visual = (Visual *) 0; if ((vinfo_return = XGetVisualInfo(basedisplay->getXDisplay(), VisualScreenMask | VisualClassMask, &vinfo_template, &vinfo_nitems)) && vinfo_nitems > 0) { for (int i = 0; i < vinfo_nitems; i++) { if (depth < (vinfo_return + i)->depth) { depth = (vinfo_return + i)->depth; visual = (vinfo_return + i)->visual; } } XFree(vinfo_return); } if (! visual) visual = DefaultVisual(basedisplay->getXDisplay(), screen_number); } bbmail-0.8.3/BaseDisplay.hh0000644000175100017510000002707707270530054011173 // BaseDisplay.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // 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. #ifndef __BaseDisplay_hh #define __BaseDisplay_hh #include #include // forward declaration class BaseDisplay; class ScreenInfo; #include "LinkedList.hh" #include "Timer.hh" #define AttribShaded (1l << 0) #define AttribMaxHoriz (1l << 1) #define AttribMaxVert (1l << 2) #define AttribOmnipresent (1l << 3) #define AttribWorkspace (1l << 4) #define AttribStack (1l << 5) #define AttribDecoration (1l << 6) #define StackTop (0) #define StackNormal (1) #define StackBottom (2) #define DecorNone (0) #define DecorNormal (1) #define DecorTiny (2) #define DecorTool (3) typedef struct _blackbox_hints { unsigned long flags, attrib, workspace, stack, decoration; } BlackboxHints; typedef struct _blackbox_attributes { unsigned long flags, attrib, workspace, stack; int premax_x, premax_y; unsigned int premax_w, premax_h; } BlackboxAttributes; #define PropBlackboxHintsElements (5) #define PropBlackboxAttributesElements (8) #ifndef __EMX__ void bexec(const char *, char *); #endif // !__EMX__ char *bstrdup(const char *); template inline Z min(Z a, Z b) { return ((a < b) ? a : b); } template inline Z max(Z a, Z b) { return ((a > b) ? a : b); } class BaseDisplay { private: struct cursor { Cursor session, move, ll_angle, lr_angle; } cursor; struct shape { Bool extensions; int event_basep, error_basep; } shape; Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state, xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state, motif_wm_hints; // NETAttributes Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; // NETStructureMessages Atom blackbox_structure_messages, blackbox_notify_startup, blackbox_notify_window_add, blackbox_notify_window_del, blackbox_notify_window_focus, blackbox_notify_current_workspace, blackbox_notify_workspace_count, blackbox_notify_window_raise, blackbox_notify_window_lower; // message_types for client -> wm messages Atom blackbox_change_workspace, blackbox_change_window_focus, blackbox_cycle_window_focus; #ifdef NEWWMSPEC // root window properties Atom net_supported, net_client_list, net_client_list_stacking, net_number_of_desktops, net_desktop_geometry, net_desktop_viewport, net_current_desktop, net_desktop_names, net_active_window, net_workarea, net_supporting_wm_check, net_virtual_roots; // root window messages Atom net_close_window, net_wm_moveresize; // application window properties Atom net_properties, net_wm_name, net_wm_desktop, net_wm_window_type, net_wm_state, net_wm_strut, net_wm_icon_geometry, net_wm_icon, net_wm_pid, net_wm_handled_icons; // application protocols Atom net_wm_ping; #endif // NEWWMSPEC Bool _startup, _shutdown; Display *display; LinkedList *screenInfoList; LinkedList *timerList; char *display_name, *application_name; int number_of_screens, server_grabs, colors_per_channel; protected: // pure virtual function... you must override this virtual void process_event(XEvent *) = 0; public: BaseDisplay(char *, char * = 0); virtual ~BaseDisplay(void); inline const Atom &getWMChangeStateAtom(void) const { return xa_wm_change_state; } inline const Atom &getWMStateAtom(void) const { return xa_wm_state; } inline const Atom &getWMDeleteAtom(void) const { return xa_wm_delete_window; } inline const Atom &getWMProtocolsAtom(void) const { return xa_wm_protocols; } inline const Atom &getWMTakeFocusAtom(void) const { return xa_wm_take_focus; } inline const Atom &getWMColormapAtom(void) const { return xa_wm_colormap_windows; } inline const Atom &getMotifWMHintsAtom(void) const { return motif_wm_hints; } // this atom is for normal app->WM hints about decorations, stacking, // starting workspace etc... inline const Atom &getBlackboxHintsAtom(void) const { return blackbox_hints; } // these atoms are for normal app->WM interaction beyond the scope of the // ICCCM... inline const Atom &getBlackboxAttributesAtom(void) const { return blackbox_attributes; } inline const Atom &getBlackboxChangeAttributesAtom(void) const { return blackbox_change_attributes; } // these atoms are for window->WM interaction, with more control and // information on window "structure"... common examples are // notifying apps when windows are raised/lowered... when the user changes // workspaces... i.e. "pager talk" inline const Atom &getBlackboxStructureMessagesAtom(void) const { return blackbox_structure_messages; } // *Notify* portions of the NETStructureMessages protocol inline const Atom &getBlackboxNotifyStartupAtom(void) const { return blackbox_notify_startup; } inline const Atom &getBlackboxNotifyWindowAddAtom(void) const { return blackbox_notify_window_add; } inline const Atom &getBlackboxNotifyWindowDelAtom(void) const { return blackbox_notify_window_del; } inline const Atom &getBlackboxNotifyWindowFocusAtom(void) const { return blackbox_notify_window_focus; } inline const Atom &getBlackboxNotifyCurrentWorkspaceAtom(void) const { return blackbox_notify_current_workspace; } inline const Atom &getBlackboxNotifyWorkspaceCountAtom(void) const { return blackbox_notify_workspace_count; } inline const Atom &getBlackboxNotifyWindowRaiseAtom(void) const { return blackbox_notify_window_raise; } inline const Atom &getBlackboxNotifyWindowLowerAtom(void) const { return blackbox_notify_window_lower; } // atoms to change that request changes to the desktop environment during // runtime... these messages can be sent by any client... as the sending // client window id is not included in the ClientMessage event... inline const Atom &getBlackboxChangeWorkspaceAtom(void) const { return blackbox_change_workspace; } inline const Atom &getBlackboxChangeWindowFocusAtom(void) const { return blackbox_change_window_focus; } inline const Atom &getBlackboxCycleWindowFocusAtom(void) const { return blackbox_cycle_window_focus; } #ifdef NEWWMSPEC // root window properties inline const Atom &getNETSupportedAtom(void) const { return net_supported; } inline const Atom &getNETClientListAtom(void) const { return net_client_list; } inline const Atom &getNETClientListStackingAtom(void) const { return net_client_list_stacking; } inline const Atom &getNETNumberOfDesktopsAtom(void) const { return net_number_of_desktops; } inline const Atom &getNETDesktopGeometryAtom(void) const { return net_desktop_geometry; } inline const Atom &getNETDesktopViewportAtom(void) const { return net_desktop_viewport; } inline const Atom &getNETCurrentDesktopAtom(void) const { return net_current_desktop; } inline const Atom &getNETDesktopNamesAtom(void) const { return net_desktop_names; } inline const Atom &getNETActiveWindowAtom(void) const { return net_active_window; } inline const Atom &getNETWorkareaAtom(void) const { return net_workarea; } inline const Atom &getNETSupportingWMCheckAtom(void) const { return net_supporting_wm_check; } inline const Atom &getNETVirtualRootsAtom(void) const { return net_virtual_roots; } // root window messages inline const Atom &getNETCloseWindowAtom(void) const { return net_close_window; } inline const Atom &getNETWMMoveResizeAtom(void) const { return net_wm_moveresize; } // application window properties inline const Atom &getNETPropertiesAtom(void) const { return net_properties; } inline const Atom &getNETWMNameAtom(void) const { return net_wm_name; } inline const Atom &getNETWMDesktopAtom(void) const { return net_wm_desktop; } inline const Atom &getNETWMWindowTypeAtom(void) const { return net_wm_window_type; } inline const Atom &getNETWMStateAtom(void) const { return net_wm_state; } inline const Atom &getNETWMStrutAtom(void) const { return net_wm_strut; } inline const Atom &getNETWMIconGeometryAtom(void) const { return net_wm_icon_geometry; } inline const Atom &getNETWMIconAtom(void) const { return net_wm_icon; } inline const Atom &getNETWMPidAtom(void) const { return net_wm_pid; } inline const Atom &getNETWMHandledIconsAtom(void) const { return net_wm_handled_icons; } // application protocols inline const Atom &getNETWMPingAtom(void) const { return net_wm_ping; } #endif // NEWWMSPEC inline ScreenInfo *getScreenInfo(int s) { return (ScreenInfo *) screenInfoList->find(s); } inline const Bool &hasShapeExtensions(void) const { return shape.extensions; } inline const Bool &doShutdown(void) const { return _shutdown; } inline const Bool &isStartup(void) const { return _startup; } inline const Cursor &getSessionCursor(void) const { return cursor.session; } inline const Cursor &getMoveCursor(void) const { return cursor.move; } inline const Cursor &getLowerLeftAngleCursor(void) const { return cursor.ll_angle; } inline const Cursor &getLowerRightAngleCursor(void) const { return cursor.lr_angle; } inline Display *getXDisplay(void) { return display; } inline const char *getXDisplayName(void) const { return (const char *) display_name; } inline const char *getApplicationName(void) const { return (const char *) application_name; } inline const int &getNumberOfScreens(void) const { return number_of_screens; } inline const int &getShapeEventBase(void) const { return shape.event_basep; } inline void shutdown(void) { _shutdown = True; } inline void run(void) { _startup = _shutdown = False; } const Bool validateWindow(Window); void grab(void); void ungrab(void); void eventLoop(void); void addTimer(BTimer *); void removeTimer(BTimer *); // another pure virtual... this is used to handle signals that BaseDisplay // doesn't understand itself virtual Bool handleSignal(int) = 0; }; class ScreenInfo { private: BaseDisplay *basedisplay; Visual *visual; Window root_window; int depth, screen_number; unsigned int width, height; protected: public: ScreenInfo(BaseDisplay *, int); inline BaseDisplay *getBaseDisplay(void) { return basedisplay; } inline Visual *getVisual(void) { return visual; } inline const Window &getRootWindow(void) const { return root_window; } inline const int &getDepth(void) const { return depth; } inline const int &getScreenNumber(void) const { return screen_number; } inline const unsigned int &getWidth(void) const { return width; } inline const unsigned int &getHeight(void) const { return height; } }; #endif // __BaseDisplay_hh bbmail-0.8.3/Timer.cc0000644000175100017510000000415107270530047010027 // Timer.cc for Blackbox - An X11 Window Manager // Copyright (c) 1997 - 1999 Brad Hughes (bhughes@tcac.net) // // 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. // stupid macros needed to access some functions in version 2 of the GNU C // library #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif // _GNU_SOURCE #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H #include "BaseDisplay.hh" #include "Timer.hh" BTimer::BTimer(BaseDisplay *d, TimeoutHandler *h) { display = d; handler = h; once = timing = False; } BTimer::~BTimer(void) { if (timing) stop(); } void BTimer::setTimeout(long t) { _timeout.tv_sec = t / 1000; _timeout.tv_usec = t; _timeout.tv_usec -= (_timeout.tv_sec * 1000); _timeout.tv_usec *= 1000; } void BTimer::setTimeout(timeval t) { _timeout.tv_sec = t.tv_sec; _timeout.tv_usec = t.tv_usec; } void BTimer::start(void) { gettimeofday(&_start, 0); if (! timing) { timing = True; display->addTimer(this); } } void BTimer::stop(void) { timing = False; display->removeTimer(this); } void BTimer::fireTimeout(void) { if (handler) handler->timeout(); } bbmail-0.8.3/Timer.hh0000644000175100017510000000447007371576725010064 // Timer.hh for Blackbox - An X11 Window Manager // Copyright (c) 1997 - 1999 Brad Hughes (bhughes@tcac.net) // // 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. #ifndef __Timer_hh #define __Timer_hh #ifdef TIME_WITH_SYS_TIME # include # include #else // !TIME_WITH_SYS_TIME # ifdef HAVE_SYS_TIME_H # include # else // !HAVE_SYS_TIME_H # include # endif // HAVE_SYS_TIME_H #endif // TIME_WITH_SYS_TIME // forward declaration class BTimer; class TimeoutHandler; #include "BaseDisplay.hh" class TimeoutHandler { public: virtual void timeout(void) = 0; }; class BTimer { friend class BaseDisplay; private: BaseDisplay *display; TimeoutHandler *handler; int timing, once; timeval _start, _timeout; protected: void fireTimeout(void); public: BTimer(BaseDisplay *, TimeoutHandler *); virtual ~BTimer(void); inline const int &isTiming(void) const { return timing; } inline const int &doOnce(void) const { return once; } inline const timeval &getTimeout(void) const { return _timeout; } inline const timeval &getStartTime(void) const { return _start; } inline void fireOnce(int o) { once = o; } void setTimeout(long); void setTimeout(timeval); void start(void); void stop(void); void reset(void); }; #endif // __Timer_hh bbmail-0.8.3/Baseresource.cc0000644000175100017510000003541207370047566011407 // Baseresource.cc for bbtools - tools to display resources in X11. // // Copyright (c) 1998-2000 John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include #include "bbmail.hh" #include "Baseresource.hh" #include "blackboxstyle.hh" BaseResource::BaseResource(ToolWindow *toolwindow) { XrmValue value; char *value_type; bbtool=toolwindow; style.style_filename=NULL; style.conf_filename=NULL; if (bbtool->nobb_config) { ReadBBtoolResource(); ResourceType=BBTOOLS; } else { char *homedir = getenv("HOME"); bbtool->config_filename = new char[strlen(homedir) + 32]; sprintf(bbtool->config_filename, "%s/.blackboxrc", homedir); if ((resource_db = XrmGetFileDatabase(bbtool->config_filename))!=NULL) { ReadBlackboxResource(); ResourceType=BLACKBOX; } else { ReadBBtoolResource(); ResourceType=BBTOOLS; } } if (XrmGetResource(resource_db, "session.colorsPerChannel", "Session.ColorsPerChannel", &value_type, &value)) { if (sscanf(value.addr, "%d", &bbtool->colors_per_channel) != 1) { bbtool->colors_per_channel = 4; } else { if (bbtool->colors_per_channel < 2) bbtool->colors_per_channel = 2; if (bbtool->colors_per_channel > 6) bbtool->colors_per_channel = 6; } } else bbtool->colors_per_channel = 4; if (XrmGetResource(resource_db, "session.imageDither", "Session.ImageDither", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->image_dither = True; else bbtool->image_dither = False; } else bbtool->image_dither = True; if (bbtool->image_dither && bbtool->getCurrentScreenInfo()->getVisual()->c_class == TrueColor && bbtool->getCurrentScreenInfo()->getDepth() >= 24) bbtool->image_dither = False; /* Need to do this here */ bbtool->setupImageControl(); } void BaseResource::Load() { LoadBBToolResource(); XrmDestroyDatabase(resource_db); } BaseResource::~BaseResource() { delete [] style.style_filename; delete [] style.conf_filename; style.style_filename=NULL; style.conf_filename=NULL; } void BaseResource::CopyColor(BColor *Color1,BColor *Color2) { Color2->setPixel(Color1->getPixel()); Color2->setRGB(Color1->getRed(),Color1->getGreen(),Color1->getBlue()); } void BaseResource::CopyTexture(BTexture Texture1,BTexture *Texture2) { CopyColor(Texture1.getColor(),Texture2->getColor()); CopyColor(Texture1.getColorTo(),Texture2->getColorTo()); CopyColor(Texture1.getHiColor(),Texture2->getHiColor()); CopyColor(Texture1.getLoColor(),Texture2->getLoColor()); Texture2->setTexture(Texture1.getTexture()); } void BaseResource::Reload() { switch (ResourceType) { case BBTOOLS: { ReadBBtoolResource(); } break; case BLACKBOX: { if ((resource_db = XrmGetFileDatabase(bbtool->config_filename))!=NULL) ReadBlackboxResource(); } break; } LoadBBToolResource(); XrmDestroyDatabase(resource_db); } bool BaseResource::ReadResourceFromFilename(char *rname, char *rclass) { struct stat file_status; char *filename=NULL; XrmValue value; char *value_type; if (XrmGetResource(resource_db,rname,rclass, &value_type, &value)) { int len = strlen(value.addr); delete [] filename; filename = new char[len + 1]; memset(filename, 0, len + 1); strncpy(filename, value.addr, len); if (stat(filename,&file_status)!=0) { db=NULL; delete [] filename; return(False); } db = XrmGetFileDatabase(filename); delete [] filename; return(True); } db=NULL; delete [] filename; return(False); } void BaseResource::ReadBBtoolResource() { if (bbtool->config_file) { if ((resource_db = XrmGetFileDatabase(bbtool->config_file))==NULL) { fprintf(stderr,"Could not open config file: %s\n", bbtool->config_file); fprintf(stderr,"Using internal defaults.\n"); } else bbtool->config_filename=bbtool->config_file; } else { delete [] style.conf_filename; char *homedir = getenv("HOME"); int len=strlen(homedir) + strlen(BBTOOL_LOCAL); style.conf_filename = new char[len+2]; memset(style.conf_filename, 0, len + 2); sprintf(style.conf_filename, "%s/%s", homedir,BBTOOL_LOCAL); if ((resource_db = XrmGetFileDatabase(style.conf_filename))==NULL) { delete [] style.conf_filename; int len=strlen(BBTOOL_GLOBAL); style.conf_filename = new char[len + 1]; memset(style.conf_filename, 0, len + 1); strncpy(style.conf_filename,BBTOOL_GLOBAL, len); if ((resource_db = XrmGetFileDatabase(style.conf_filename))==NULL) { fprintf(stderr,"Could not open default config file: %s\n", style.conf_filename); fprintf(stderr,"Using internal defaults.\n"); } else bbtool->config_filename=bbtool->config_file; } else bbtool->config_filename=bbtool->config_file; } } void BaseResource::ReadBlackboxResource() { if (!ReadResourceFromFilename("session.styleFile","Session.StyleFile")) { fprintf(stderr,"Could not open blackbox style file\n"); } else XrmCombineDatabase(db,&resource_db,False); if (bbtool->config_file!=NULL) { if ((db = XrmGetFileDatabase(bbtool->config_file))==NULL) { fprintf(stderr,"Could not open config file: %s\n", bbtool->config_file); return; } else { XrmCombineDatabase(db,&resource_db,True); } } else { delete [] style.conf_filename; char *homedir = getenv("HOME"); int len=strlen(homedir) + strlen(BBTOOL_LOCAL); style.conf_filename = new char[len+2]; memset(style.conf_filename, 0, len + 2); sprintf(style.conf_filename, "%s/%s", homedir,BBTOOL_LOCAL); if ((db = XrmGetFileDatabase(style.conf_filename))==NULL) { delete [] style.conf_filename; int len=strlen(BBTOOL_GLOBAL); style.conf_filename = new char[len + 1]; memset(style.conf_filename, 0, len + 1); strncpy(style.conf_filename,BBTOOL_GLOBAL, len); if ((db = XrmGetFileDatabase(style.conf_filename))==NULL) { fprintf(stderr,"Could not open default config file: %s\n", style.conf_filename); fprintf(stderr,"Using internal defaults.\n"); return; } else XrmCombineDatabase(db,&resource_db,True); } else XrmCombineDatabase(db,&resource_db,True); } } void BaseResource::readTexture(char *rname,char *rclass, char *bbname, char *bbclass,char *dcolor,char *dcolorTo, char *dtexture,BTexture *texture) { readDatabaseTexture(rname,rclass,bbname,bbclass,dcolor,dcolorTo,dtexture, texture); } void BaseResource::readDatabaseTexture(char *rname, char *rclass, BTexture *texture) { XrmValue value; char *value_type; texture->setTexture(0); if (XrmGetResource(resource_db, rname, rclass, &value_type, &value)) bbtool->getImageControl()->parseTexture(texture, value.addr); if (texture->getTexture() & BImage_Solid) { int clen = strlen(rclass) + 8, nlen = strlen(rname) + 8; char *colorclass = new char[clen], *colorname = new char[nlen]; sprintf(colorclass, "%s.Color", rclass); sprintf(colorname, "%s.color", rname); readDatabaseColor(colorname, colorclass, texture->getColor()); delete [] colorclass; delete [] colorname; if ((! texture->getColor()->isAllocated()) || (texture->getTexture() & BImage_Flat)) return; XColor xcol; xcol.red = (unsigned int) (texture->getColor()->getRed() + (texture->getColor()->getRed() >> 1)); if (xcol.red >= 0xff) xcol.red = 0xffff; else xcol.red *= 0xff; xcol.green = (unsigned int) (texture->getColor()->getGreen() + (texture->getColor()->getGreen() >> 1)); if (xcol.green >= 0xff) xcol.green = 0xffff; else xcol.green *= 0xff; xcol.blue = (unsigned int) (texture->getColor()->getBlue() + (texture->getColor()->getBlue() >> 1)); if (xcol.blue >= 0xff) xcol.blue = 0xffff; else xcol.blue *= 0xff; if (! XAllocColor(bbtool->getXDisplay(), bbtool->getImageControl()->getColormap(), &xcol)) xcol.pixel = 0; texture->getHiColor()->setPixel(xcol.pixel); xcol.red = (unsigned int) ((texture->getColor()->getRed() >> 2) + (texture->getColor()->getRed() >> 1)) * 0xff; xcol.green = (unsigned int) ((texture->getColor()->getGreen() >> 2) + (texture->getColor()->getGreen() >> 1)) * 0xff; xcol.blue = (unsigned int) ((texture->getColor()->getBlue() >> 2) + (texture->getColor()->getBlue() >> 1)) * 0xff; if (! XAllocColor(bbtool->getXDisplay(), bbtool->getImageControl()->getColormap(), &xcol)) xcol.pixel = 0; texture->getLoColor()->setPixel(xcol.pixel); } else if (texture->getTexture() & BImage_Gradient) { int clen = strlen(rclass) + 10, nlen = strlen(rname) + 10; char *colorclass = new char[clen], *colorname = new char[nlen], *colortoclass = new char[clen], *colortoname = new char[nlen]; sprintf(colorclass, "%s.Color", rclass); sprintf(colorname, "%s.color", rname); sprintf(colortoclass, "%s.ColorTo", rclass); sprintf(colortoname, "%s.colorTo", rname); readDatabaseColor(colorname, colorclass, texture->getColor()); readDatabaseColor(colortoname, colortoclass, texture->getColorTo()); delete [] colorclass; delete [] colorname; delete [] colortoclass; delete [] colortoname; } } void BaseResource::readColor(char *rname,char *rclass, char *bbname, char *bbclass,char *dcolor,BColor *color) { readDatabaseColor(rname,rclass,color); if (!color->isAllocated()) { readDatabaseColor(bbname,bbclass,color); if (!color->isAllocated()) bbtool->getImageControl()->parseColor(color,dcolor); } } void BaseResource::readDatabaseTexture(char *rname, char *rclass, char *bbrname,char *bbrclass,char *dcolor, char* dcolorto,char *dtexture,BTexture *texture) { XrmValue value; char *value_type; int clen,nlen; texture->setTexture(0); if (XrmGetResource(resource_db, rname, rclass, &value_type, &value)) bbtool->getImageControl()->parseTexture(texture, value.addr); else if (XrmGetResource(resource_db, bbrname, bbrclass, &value_type, &value)) bbtool->getImageControl()->parseTexture(texture, value.addr); else bbtool->getImageControl()->parseTexture(texture, dtexture); if (texture->getTexture() & BImage_Solid) { clen = strlen(rclass) + 8; nlen = strlen(rname) + 8; char *colorclass = new char[clen], *colorname = new char[nlen]; clen = strlen(bbrclass) + 8; nlen = strlen(bbrname) + 8; char *bbcolorclass = new char[clen], *bbcolorname = new char[nlen]; sprintf(colorclass, "%s.Color", rclass); sprintf(colorname, "%s.color", rname); sprintf(bbcolorclass, "%s.Color", bbrclass); sprintf(bbcolorname, "%s.color", bbrname); readColor(colorname,colorclass,bbcolorname,bbcolorclass, dcolor,texture->getColor()); delete [] colorclass; delete [] colorname; delete [] bbcolorclass; delete [] bbcolorname; if ((! texture->getColor()->isAllocated()) || (texture->getTexture() & BImage_Flat)) return; XColor xcol; xcol.red = (unsigned int) (texture->getColor()->getRed() + (texture->getColor()->getRed() >> 1)); if (xcol.red >= 0xff) xcol.red = 0xffff; else xcol.red *= 0xff; xcol.green = (unsigned int) (texture->getColor()->getGreen() + (texture->getColor()->getGreen() >> 1)); if (xcol.green >= 0xff) xcol.green = 0xffff; else xcol.green *= 0xff; xcol.blue = (unsigned int) (texture->getColor()->getBlue() + (texture->getColor()->getBlue() >> 1)); if (xcol.blue >= 0xff) xcol.blue = 0xffff; else xcol.blue *= 0xff; if (! XAllocColor(bbtool->getXDisplay(), bbtool->getImageControl()->getColormap(),&xcol)) xcol.pixel = 0; texture->getHiColor()->setPixel(xcol.pixel); xcol.red = (unsigned int) ((texture->getColor()->getRed() >> 2) + (texture->getColor()->getRed() >> 1)) * 0xff; xcol.green = (unsigned int) ((texture->getColor()->getGreen() >> 2) + (texture->getColor()->getGreen() >> 1)) * 0xff; xcol.blue = (unsigned int) ((texture->getColor()->getBlue() >> 2) + (texture->getColor()->getBlue() >> 1)) * 0xff; if (! XAllocColor(bbtool->getXDisplay(), bbtool->getImageControl()->getColormap(), &xcol)) xcol.pixel = 0; texture->getLoColor()->setPixel(xcol.pixel); } else if (texture->getTexture() & BImage_Gradient) { clen = strlen(rclass) + 10; nlen = strlen(rname) + 10; char *colorclass = new char[clen], *colorname = new char[nlen], *colortoclass = new char[clen], *colortoname = new char[nlen]; clen = strlen(bbrclass) + 10; nlen = strlen(bbrname) + 10; char *bbcolorclass = new char[clen], *bbcolorname = new char[nlen], *bbcolortoclass = new char[clen], *bbcolortoname = new char[nlen]; sprintf(colorclass, "%s.Color", rclass); sprintf(colorname, "%s.color", rname); sprintf(bbcolorclass, "%s.Color", bbrclass); sprintf(bbcolorname, "%s.color", bbrname); readColor(colorname,colorclass,bbcolorname,bbcolorclass, dcolor,texture->getColor()); sprintf(colortoclass, "%s.ColorTo", rclass); sprintf(colortoname, "%s.colorTo", rname); sprintf(bbcolortoclass, "%s.ColorTo", bbrclass); sprintf(bbcolortoname, "%s.colorTo", bbrname); readColor(colortoname,colortoclass,bbcolortoname,bbcolortoclass, dcolorto,texture->getColorTo()); delete [] colorclass; delete [] colorname; delete [] colortoclass; delete [] colortoname; delete [] bbcolorclass; delete [] bbcolorname; delete [] bbcolortoclass; delete [] bbcolortoname; } } void BaseResource::readDatabaseColor(char *rname, char *rclass, BColor *color) { XrmValue value; char *value_type; if (XrmGetResource(resource_db, rname, rclass, &value_type, &value)) bbtool->getImageControl()->parseColor(color, value.addr); else // parsing with no color string just deallocates the color, if it has // been previously allocated bbtool->getImageControl()->parseColor(color); } bbmail-0.8.3/Baseresource.hh0000644000175100017510000000400507342173407011404 // Baseresource.hh for bbtools - tools to display resources in X11. // // Copyright (c) 1998-2000 John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __BASERESOURCE_HH #define __BASERESOURCE_HH #define BBTOOLS 1 #define BLACKBOX 2 class ToolWindow; class BImageControl; struct STYLE { char *conf_filename; char *style_filename; }; class BaseResource { public: BaseResource(ToolWindow *); virtual ~BaseResource(void); void CopyColor(BColor *,BColor *); void CopyTexture(BTexture ,BTexture *); void Reload(void); STYLE style; protected: void Load(void); void readDatabaseColor(char *, char *, BColor *); void readDatabaseTexture(char*,char*,char *,char *, char *, char *,char *,BTexture *); void readDatabaseTexture(char *, char *,BTexture *); void readColor(char *,char *, char *,char *,char *,BColor *); void readTexture(char *,char *, char *,char *,char *,char *,char *, BTexture *); ToolWindow *bbtool; XrmDatabase resource_db; XrmDatabase db; virtual void LoadBBToolResource(void) = 0; private: bool ReadResourceFromFilename(char *, char *); void ReadBBtoolResource(void); void ReadDefaultResource(void); void ReadBlackboxResource(void); BImageControl *image_control; int ResourceType; }; #endif /* __BASERESOURCE_HH */ bbmail-0.8.3/Basewindow.cc0000644000175100017510000000561207312663110011047 // Basewindow.cc for bbtools. // // Copyright (c) 1998-2000 by John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "Basewindow.hh" #include "resource.hh" #ifdef HAVE_SIGNAL_H # include #endif // HAVE_SIGNAL_H #ifdef HAVE_SYS_SIGNAL_H # include #endif // HAVE_SYS_SIGNAL_H #ifndef SA_NODEFER # ifdef SA_INTERRUPT # define SA_NODEFER SA_INTERRUPT # else // !SA_INTERRUPT # define SA_NODEFER (0) # endif // SA_INTERRUPT #endif // SA_NODEFER static int handleXErrors(Display *, XErrorEvent *); Basewindow::Basewindow(int argc,char **argv,struct CMDOPTIONS *options) : BaseDisplay(options->app_name,options->display_name) { iargc=argc; iargv=argv; config_filename=NULL; position=options->geometry; withdrawn=options->withdrawn; shape=options->shape; decorated=options->decorated; config_file=options->config_file; nobb_config=options->nobb_config; mailbox_number=options->mailbox; current_screen_info = getScreenInfo(DefaultScreen(getXDisplay())); XSetErrorHandler((XErrorHandler) handleXErrors); wm_delete_window = XInternAtom (getXDisplay(), "WM_DELETE_WINDOW",False); } Basewindow::~Basewindow() {} Bool Basewindow::handleSignal(int sig) { switch (sig) { case SIGHUP: reconfigure(); break; case SIGSEGV: case SIGFPE: case SIGINT: case SIGTERM: shutdown(); default: return False; } return True; } void Basewindow::process_event(XEvent *event) {} void Basewindow::setupImageControl() { image_control = new BImageControl(this,getCurrentScreenInfo(),image_dither, colors_per_channel); image_control->installRootColormap(); } // X error handler to handle any and all X errors while blackbox is running static int handleXErrors(Display *d, XErrorEvent *e) { #ifdef DEBUG char errtxt[128]; XGetErrorText(d, e->error_code, errtxt, 128); fprintf(stderr, "bbmail: [ X Error event received. ]\n" " X Error of failed request: %d %s\n" " Major/minor opcode of failed request: %d / %d\n" " Resource id in failed request: 0x%lx\n", e->error_code, errtxt, e->request_code, e->minor_code, e->resourceid); #endif return(False); } bbmail-0.8.3/Basewindow.hh0000644000175100017510000000440507270530054011063 // Basewindow.hh for bbtools // // Copyright (c) 1998-2000 by John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __BASEWINDOW_HH #define __BASEWINDOW_HH #include #include #include #include #include #include #include #include #include #include #include "version.h" #include "Image.hh" #include "BaseDisplay.hh" #include "main.hh" class BImageControl; class Resource; class BaseDisplay; class Basewindow : public BaseDisplay { public: Basewindow(int, char**,struct CMDOPTIONS *); virtual ~Basewindow(); void setupImageControl(void); enum { B_LeftJustify = 1, B_RightJustify, B_CenterJustify }; BImageControl *getImageControl(void) { return image_control; } BColor border_color; int colors_per_channel; bool image_dither; Atom wm_delete_window; char *position; char *config_filename; char *config_file; char *style_file; int mailbox_number; bool nobb_config; bool withdrawn; bool shape; bool decorated; ScreenInfo *getCurrentScreenInfo(void) { return current_screen_info; } int getArgc(void) { return iargc; } char ** getArgv(void) { return iargv; } protected: virtual void process_event(XEvent *); virtual Bool handleSignal(int); virtual void reconfigure(void) = 0; GC menuGC; GC menuHiBGGC; GC menuHiGC; GC menuFrameGC; Window menuwin; ScreenInfo *current_screen_info; private: BImageControl *image_control; int iargc; char **iargv; }; #endif /* __BASEWINDOW_HH */ bbmail-0.8.3/spoollist.cc0000644000175100017510000000561707270530047011007 // spoollist.cc for bbmail - an tool to display new mail in X11. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "spoollist.hh" SpoolList::SpoolList() { filename=NULL; new_maildir=NULL; cur_maildir=NULL; } SpoolList::~SpoolList() { delete [] filename; delete [] new_maildir; delete [] cur_maildir; delete [] name; delete [] runCommand; delete [] statusFlag; delete [] proc; delete [] reversedProc; delete [] newmailProc; } void SpoolList::LoadFilename(char *value) { int len; len =strlen(value); filename = new char[len + 1]; memset(filename, 0, len + 1); strncpy(filename, value, len); if (type==maildir) { new_maildir = new char[len + 5]; sprintf (new_maildir, "%s/new", value); cur_maildir = new char[len + 5]; sprintf (cur_maildir, "%s/cur", value); } } void SpoolList::LoadName(char *value) { int len; len =strlen(value); name = new char[len + 16]; memset(name, 0, len + 16); strncpy(name, value, len); } void SpoolList::LoadrunCommand(char *value) { int len; len=strlen(value); if (value[len-1]!='&') { runCommand = new char[len + 2]; memset(runCommand, 0, len + 2); strncpy(runCommand, value, len); runCommand[len]='&'; } else { runCommand = new char[len + 1]; memset(runCommand, 0, len + 1); strncpy(runCommand, value, len); } } void SpoolList::LoadstatusFlag(char *value) { int len; len =strlen(value); statusFlag = new char[len + 1]; memset(statusFlag, 0, len + 1); strncpy(statusFlag, value, len); } void SpoolList::LoadProc(char *value) { int len; len =strlen(value); proc = new char[len + 2]; memset(proc, 0, len + 2); strncpy(proc, value, len); if (value[len-1]!='&') { proc[len]='&'; proc[len+1]='\0'; } } void SpoolList::LoadreversedProc(char *value) { int len; len =strlen(value); reversedProc = new char[len + 2]; memset(reversedProc, 0, len + 2); strncpy(reversedProc, value, len); if (value[len-1]!='&') { reversedProc[len]='&'; reversedProc[len+1]='\0'; } } void SpoolList::LoadnewmailProc(char *value) { int len; len =strlen(value); newmailProc = new char[len + 2]; memset(newmailProc, 0, len + 2); strncpy(newmailProc, value, len); if (value[len-1]!='&') { newmailProc[len]='&'; newmailProc[len+1]='\0'; } } bbmail-0.8.3/spoollist.hh0000644000175100017510000000313607270530055011012 // spoollist.hh for bbmail - an tool to display new mail in X11. // // this program is free software; you can redistribute it and/or modify // it under the terms of the gnu general public license as published by // the free software foundation; either version 2 of the license, or // (at your option) any later version. // // this program is distributed in the hope that it will be useful, // but without any warranty; without even the implied warranty of // merchantability or fitness for a particular purpose. see the // gnu general public license for more details. // // you should have received a copy of the gnu general public license // along with this program; if not, write to the free software // foundation, inc., 675 mass ave, cambridge, ma 02139, usa. // // (see the included file copying / gpl-2.0) // #ifndef __SPOOLLIST_HH #define __SPOOLLIST_HH #include "bbmail.hh" class SpoolList { public: SpoolList(void); ~SpoolList(void); enum TYPE {mbox,maildir,other} type; char *filename; char *cur_maildir; char *new_maildir; char *name; BColor newmail_textColor; BColor newmail_error_textColor; BTexture newmail_texture; BTexture newmail_pressed_texture; char *runCommand; char *statusFlag; bool procDefined; char *proc; char *reversedProc; char *newmailProc; bool force_check; bool bell; bool first_is_new; bool second_is_total; bool second_ignore; void LoadFilename(char *); void LoadName(char *); void LoadrunCommand(char *); void LoadstatusFlag(char *); void LoadProc(char *); void LoadreversedProc(char *); void LoadnewmailProc(char *); }; #endif /* __SPOLLIST_H */ bbmail-0.8.3/mailboxmenu.cc0000644000175100017510000000713007373257632011301 // mailboxmenu.cc for bbmail - an tool for display the mail in X11. // // Copyright (c) 1998-2000 by John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "mailboxmenu.hh" Mailboxmenu::Mailboxmenu(ToolWindow *toolwindow) : Basemenu(toolwindow) { int i; bbtool=toolwindow; setTitleVisibility(False); setMovable(False); setHidable(False); setAlignment(AlignBottom); defaultMenu(); word_length = new int [bbtool->getResource()->report.number_of_spoolfiles]; for (i=0;igetResource()->report.number_of_spoolfiles;i++) { insert(&bbtool->getResource()->spoolfile[i].name); word_length[i]=strlen(bbtool->getResource()->spoolfile[i].name); } insert("Reconfigure"); insert("Close"); } Mailboxmenu::~Mailboxmenu(void) { delete [] word_length; } void Mailboxmenu::ClearMenu() { int i; for (i=0;i<=bbtool->getResource()->report.number_of_spoolfiles;i++) remove(0); remove(0); remove(0); delete [] word_length; } void Mailboxmenu::Reconfigure() { int i; word_length = new int [bbtool->getResource()->report.number_of_spoolfiles]; for (i=0;igetResource()->report.number_of_spoolfiles;i++) { insert(&bbtool->getResource()->spoolfile[i].name); word_length[i]=strlen(bbtool->getResource()->spoolfile[i].name); } insert("Reconfigure"); insert("Close"); Basemenu::reconfigure(); } void Mailboxmenu::Move(int x, int y, bool withdrawn) { if (!withdrawn) { int y_old=y; y= y - getHeight() -1; if ((x+getWidth())>bbtool->getCurrentScreenInfo()->getWidth()) x=bbtool->getCurrentScreenInfo()->getWidth()-getWidth(); if (y<0) y=y_old+bbtool->Frame().height; Basemenu::move(x, y); } else { x= x - getWidth() - 6; if (x<0) x=x + getWidth() + 12; if (y<0) y=0; if (y+getHeight()>bbtool->getCurrentScreenInfo()->getHeight()) y=bbtool->getCurrentScreenInfo()->getHeight()-getHeight(); Basemenu::move(x, y); } } /* quick and dirty */ void Mailboxmenu::UpdateNumbers(int newmail, int totalmail,int spoolno) { char dummy[15]; bbtool->getResource()->spoolfile[spoolno].name[word_length[spoolno]]='\0'; sprintf(dummy," (%u/%u)",newmail,totalmail); strcat(bbtool->getResource()->spoolfile[spoolno].name,dummy); if (newmail>0) setHighlight(spoolno); Basemenu::reconfigure(); } void Mailboxmenu::Update() { wait_for_update=False; Basemenu::update(); } void Mailboxmenu::itemSelected(int button, int index) { if (button == 1) { if (index < bbtool->getResource()->report.number_of_spoolfiles) { system(bbtool->getResource()->spoolfile[index].runCommand); } else if (index == bbtool->getResource()->report.number_of_spoolfiles) { bbtool->reconfigure(); } else if (index == bbtool->getResource()->report.number_of_spoolfiles+1) { bbtool->shutdown(); } hide(); bbtool->EnvelopePushed(False); bbtool->Redraw(False); } } void Mailboxmenu::show(void) { XRaiseWindow(bbtool->getXDisplay(), getWindowID()); Basemenu::show(); } bbmail-0.8.3/mailboxmenu.hh0000644000175100017510000000275207270530054011304 // mailboxmenu.hh for bbmail - an tool for display the mail in X11. // // Copyright (c) 1998-2000 by John Kennis, jkennis@chello.nl // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __MAILBOXMENU_HH #define __MAILBOXMENU_HH #include "Basemenu.hh" #include "bbmail.hh" class Basemenu; class ToolWindow; class Mailboxmenu : public Basemenu { public: Mailboxmenu(ToolWindow *); ~Mailboxmenu(void); void UpdateNumbers(int, int, int); void Update(void); bool WaitForUpdate(void) { return wait_for_update; } void Move(int ,int, bool); void Reconfigure(void); void ClearMenu(void); void Clean(void); virtual void show(void); protected: virtual void itemSelected(int, int); private: ToolWindow *bbtool; int *word_length; bool wait_for_update; }; #endif /* __MAILBOXMENU_HH */ bbmail-0.8.3/Basemenu.cc0000644000175100017510000007114607270530046010515 // Basemenu.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 1999 by Brad Hughes, bhughes@tcac.net // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H #include "bbmail.hh" #include "Basemenu.hh" #ifdef HAVE_STDIO_H # include #endif // HAVE_STDIO_H #ifdef STDC_HEADERS # include # include #endif // STDC_HEADERS static Basemenu *shown = (Basemenu *) 0; Basemenu::Basemenu(ToolWindow *toolwindow) { bbtool = toolwindow; image_ctrl = bbtool->getImageControl(); display = bbtool->getXDisplay(); parent = (Basemenu *) 0; alignment = AlignDontCare; title_vis = movable = hidable = True; shifted = default_menu = moving = user_moved = visible = False; menu.x = menu.y = menu.x_shift = menu.y_shift = menu.x_move = menu.y_move = 0; always_highlight = which_sub = which_press = which_sbl = -1; indicator = bbtool->getResource()->getBulletStyle(); indicator_position = bbtool->getResource()->getBulletPosition(); menu.iframe_pixmap = menu.title_pixmap = None; menu.bevel_w = bbtool->getResource()->getBevelWidth(); menu.width = menu.title_h = menu.item_w = menu.iframe_h = bbtool->getResource()->getTitleFont()->ascent + bbtool->getResource()->getTitleFont()->descent + (menu.bevel_w * 2); menu.label = 0; menu.sublevels = menu.persub = menu.minsub = 0; menu.item_h = bbtool->getResource()->getMenuFont()->ascent + bbtool->getResource()->getMenuFont()->descent + (menu.bevel_w); menu.height = menu.title_h + bbtool->getResource()->getBorderWidth() + menu.iframe_h; unsigned long attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWEventMask; XSetWindowAttributes attrib; attrib.background_pixmap = None; attrib.background_pixel = attrib.border_pixel = bbtool->getResource()->getBorderColor()->getPixel(); attrib.override_redirect = True; attrib.event_mask = ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask; menu.frame = XCreateWindow(bbtool->getXDisplay(), bbtool->getCurrentScreenInfo()->getRootWindow(), menu.x, menu.y, menu.width, menu.height, bbtool->getResource()->getBorderWidth(), bbtool->getCurrentScreenInfo()->getDepth(), InputOutput, bbtool->getCurrentScreenInfo()->getVisual(), attrib_mask, &attrib); bbtool->saveMenuSearch(menu.frame, this); attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | CWEventMask; attrib.background_pixel = bbtool->getResource()->getBorderColor()->getPixel(); attrib.event_mask |= EnterWindowMask | LeaveWindowMask; menu.title = XCreateWindow(display, menu.frame, 0, 0, menu.width, menu.height, 0, bbtool->getCurrentScreenInfo()->getDepth(), InputOutput, bbtool->getCurrentScreenInfo()->getVisual(), attrib_mask, &attrib); bbtool->saveMenuSearch(menu.title, this); menu.iframe = XCreateWindow(display, menu.frame, 0, menu.title_h + bbtool->getResource()->getBorderWidth(), menu.width, menu.iframe_h, 0, bbtool->getCurrentScreenInfo()->getDepth(), InputOutput, bbtool->getCurrentScreenInfo()->getVisual(), attrib_mask, &attrib); bbtool->saveMenuSearch(menu.iframe, this); menuitems = new LinkedList; // even though this is the end of the constructor the menu is still not // completely created. items must be inserted and it must be update()'d } Basemenu::~Basemenu(void) { XUnmapWindow(display, menu.frame); if (shown && shown->getWindowID() == getWindowID()) shown = (Basemenu *) 0; int n = menuitems->count(); for (int i = 0; i < n; ++i) remove(0); delete menuitems; if (menu.label) delete [] menu.label; if (menu.title_pixmap) { image_ctrl->removeImage(menu.title_pixmap); menu.title_pixmap = None; } if (menu.iframe_pixmap) { image_ctrl->removeImage(menu.iframe_pixmap); menu.iframe_pixmap = None; } bbtool->removeMenuSearch(menu.title); XDestroyWindow(display, menu.title); bbtool->removeMenuSearch(menu.iframe); XDestroyWindow(display, menu.iframe); bbtool->removeMenuSearch(menu.frame); XDestroyWindow(display, menu.frame); } int Basemenu::insert(char *l, int function, char *e, int pos) { char *label = 0, *exec = 0; int llen, elen; if (l) { llen = strlen(l) + 1; label = new char[llen]; strncpy(label, l, llen); } if (e) { elen = strlen(e) + 1; exec = new char[elen + 1]; strncpy(exec, e, elen + 1); } BasemenuItem *item = new BasemenuItem(label, function, exec); menuitems->insert(item, pos); return menuitems->count(); } int Basemenu::insert(char *l, Basemenu *submenu, int pos) { char *label = 0; int llen = strlen(l); if (llen) { label = new char[llen + 1]; strncpy(label, l, llen + 1); } BasemenuItem *item = new BasemenuItem(label, submenu); menuitems->insert(item, pos); submenu->parent = this; if (submenu->title_vis) submenu->setMovable(True); if (! submenu->default_menu) submenu->setHidable(False); return menuitems->count(); } int Basemenu::insert(char **ulabel, int pos) { BasemenuItem *item = new BasemenuItem(ulabel); menuitems->insert(item, pos); return menuitems->count(); } int Basemenu::remove(int index) { if (index < 0 || index > menuitems->count()) return -1; BasemenuItem *item = menuitems->remove(index); if (item) { if ((! default_menu) && (item->submenu()) && (! item->submenu()->default_menu)) { Basemenu *tmp = (Basemenu *) item->submenu(); delete tmp; } if (item->label()) delete [] item->label(); if (item->exec()) delete [] item->exec(); delete item; } if (which_sub == index) which_sub = -1; if (always_highlight == index) always_highlight = -1; return menuitems->count(); } void Basemenu::update(void) { menu.item_h = bbtool->getResource()->getMenuFont()->ascent + bbtool->getResource()->getMenuFont()->descent + menu.bevel_w; if (title_vis) menu.item_w = (menu.bevel_w * 2) + XTextWidth(bbtool->getResource()->getTitleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); else menu.item_w = 1; int ii = 0; LinkedListIterator it(menuitems); for (; it.current(); it++) { BasemenuItem *itmp = it.current(); if (itmp->u) ii = (menu.bevel_w * 2) + (menu.item_h * 2) + XTextWidth(bbtool->getResource()->getMenuFont(), *itmp->u, strlen(*itmp->u)); else if (itmp->l) ii = (menu.bevel_w * 2) + (menu.item_h * 2) + XTextWidth(bbtool->getResource()->getMenuFont(), itmp->l, strlen(itmp->l)); else ii = 0; menu.item_w = ((menu.item_w < (unsigned int) ii) ? ii : menu.item_w); } if (menuitems->count()) { menu.sublevels = 1; while (((menu.item_h * (menuitems->count() + 1) / menu.sublevels) + menu.title_h + bbtool->getResource()->getBorderWidth()) > bbtool->getCurrentScreenInfo()->getHeight()) menu.sublevels++; if (menu.sublevels < menu.minsub) menu.sublevels = menu.minsub; menu.persub = menuitems->count() / menu.sublevels; if (menuitems->count() % menu.sublevels) menu.persub++; } else { menu.sublevels = 0; menu.persub = 0; } menu.width = (menu.sublevels * (menu.item_w)); if (! menu.width) menu.width = menu.item_w; menu.title_h = bbtool->getResource()->getTitleFont()->ascent + bbtool->getResource()->getTitleFont()->descent + (menu.bevel_w * 2); menu.iframe_h = (menu.item_h * menu.persub); menu.height = ((title_vis) ? menu.title_h + bbtool->getResource()->getBorderWidth() : 0) + menu.iframe_h; if (! menu.iframe_h) menu.iframe_h = 1; if (menu.height < 1) menu.height = 1; Pixmap tmp; if (title_vis) { tmp = menu.title_pixmap; menu.title_pixmap = image_ctrl->renderImage(menu.width, menu.title_h, &(bbtool->getResource()->frame.texture)); if (tmp) image_ctrl->removeImage(tmp); XSetWindowBackgroundPixmap(display, menu.title, menu.title_pixmap); XClearWindow(display, menu.title); } tmp = menu.iframe_pixmap; menu.iframe_pixmap = image_ctrl->renderImage(menu.width, menu.iframe_h, &(bbtool->getResource()->frame.texture)); if (tmp) image_ctrl->removeImage(tmp); XSetWindowBackgroundPixmap(display, menu.iframe, menu.iframe_pixmap); XResizeWindow(display, menu.frame, menu.width, menu.height); if (title_vis) XResizeWindow(display, menu.title, menu.width, menu.title_h); XMoveResizeWindow(display, menu.iframe, 0, ((title_vis) ? menu.title_h + bbtool->getResource()->getBorderWidth() : 0), menu.width, menu.iframe_h); XClearWindow(display, menu.frame); XClearWindow(display, menu.title); XClearWindow(display, menu.iframe); if (title_vis) switch (bbtool->getResource()->getJustification()) { case LeftJustify: { XDrawString(display, menu.title, bbtool->getMenuTitleGC(), menu.bevel_w, bbtool->getResource()->getTitleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case RightJustify: { int off = menu.bevel_w + XTextWidth(bbtool->getResource()->getTitleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); XDrawString(display, menu.title, bbtool->getMenuTitleGC(), menu.width - off, bbtool->getResource()->getTitleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case CenterJustify: { int ins = (menu.width - (XTextWidth(bbtool->getResource()->getTitleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))))) / 2; XDrawString(display, menu.title, bbtool->getMenuTitleGC(), ins, bbtool->getResource()->getTitleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } } int i = 0; for (i = 0; i < menuitems->count(); i++) if (i == which_sub) { drawItem(i, (i == always_highlight), True, 0); drawSubmenu(i); } else drawItem(i, (i == always_highlight), False, 0); if (parent && visible) parent->drawSubmenu(parent->which_sub); XMapSubwindows(display, menu.frame); } void Basemenu::show(void) { XMapSubwindows(display, menu.frame); XMapWindow(display, menu.frame); visible = True; if (! parent) { if (shown && ! shown->hasUserMoved()) shown->hide(); shown = this; } } void Basemenu::hide(void) { if (which_sub != -1) { BasemenuItem *tmp = menuitems->find(which_sub); tmp->submenu()->hide(); } user_moved = visible = False; which_sub = which_press = which_sub = -1; if (parent) { parent->drawItem(parent->which_sub, (parent->always_highlight == parent->which_sub), False, True); if (! default_menu) hidable = False; parent->which_sub = -1; } else if (shown && shown->getWindowID() == getWindowID()) shown = (Basemenu *) 0; XUnmapWindow(display, menu.frame); } void Basemenu::move(int x, int y) { menu.x = x; menu.y = y; XMoveWindow(display, menu.frame, x, y); if (which_sub != -1) drawSubmenu(which_sub); } void Basemenu::drawSubmenu(int index) { if (which_sub != -1 && which_sub != index) { BasemenuItem *itmp = menuitems->find(which_sub); if (! itmp->submenu()->hasUserMoved()) itmp->submenu()->hide(); } if (index >= 0 && index < menuitems->count()) { BasemenuItem *item = menuitems->find(index); if (item->submenu() && visible && (! item->submenu()->hasUserMoved())) { drawItem(index, False, True); int sbl = index / menu.persub, i = index - (sbl * menu.persub), x = (((shifted) ? menu.x_shift : menu.x) + (menu.item_w * (sbl + 1)) + bbtool->getResource()->getBorderWidth()), y; if (alignment == AlignTop) y = (((shifted) ? menu.y_shift : menu.y) + ((title_vis) ? menu.title_h + bbtool->getResource()->getBorderWidth() : 0) - ((item->submenu()->title_vis) ? item->submenu()->menu.title_h + bbtool->getResource()->getBorderWidth() : 0)); else y = (((shifted) ? menu.y_shift : menu.y) + (menu.item_h * i) + ((title_vis) ? menu.title_h + bbtool->getResource()->getBorderWidth() : 0) - ((item->submenu()->title_vis) ? item->submenu()->menu.title_h + bbtool->getResource()->getBorderWidth() : 0)); if (alignment == AlignBottom && (y + item->submenu()->menu.height) > ((shifted) ? menu.y_shift : menu.y) + menu.height) y = (((shifted) ? menu.y_shift : menu.y) + menu.height - item->submenu()->menu.height); if ((x + item->submenu()->getWidth()) > bbtool->getCurrentScreenInfo()->getWidth()) x = ((shifted) ? menu.x_shift : menu.x) - item->submenu()->getWidth() - bbtool->getResource()->getBorderWidth(); if (x < 0) x = 0; if ((y + item->submenu()->getHeight()) > bbtool->getCurrentScreenInfo()->getHeight()) y = bbtool->getCurrentScreenInfo()->getHeight() - item->submenu()->getHeight() - bbtool->getResource()->getBorderWidth(); if (y < 0) y = 0; item->submenu()->move(x, y); if (! item->submenu()->isVisible()) item->submenu()->show(); which_sub = index; } else which_sub = -1; } } Bool Basemenu::hasSubmenu(int index) { if ((index >= 0) && (index < menuitems->count())) if (menuitems->find(index)->submenu()) return True; else return False; else return False; } void Basemenu::drawItem(int index, Bool frame, Bool highlight, Bool clear) { if (index < 0 || index > menuitems->count()) return; int sbl = index / menu.persub, i = index - (sbl * menu.persub), ix = (sbl * menu.item_w), iy = (i * menu.item_h), tx = 0; BasemenuItem *item = menuitems->find(index); if (! item) return; switch(bbtool->getResource()->getMenuJustification()) { case LeftJustify: tx = ix + menu.bevel_w + menu.item_h + 1; break; case RightJustify: tx = ix + menu.item_w - (menu.item_h + menu.bevel_w + XTextWidth(bbtool->getResource()->getMenuFont(), ((item->ulabel()) ? *item->ulabel() : item->label()), strlen((item->ulabel()) ? *item->ulabel() : item->label()))); break; case CenterJustify: tx = ix + ((menu.item_w + 1 - XTextWidth(bbtool->getResource()->getMenuFont(), ((item->ulabel()) ? *item->ulabel() : item->label()), strlen((item->ulabel()) ? *item->ulabel() : item->label()))) / 2); break; } if (clear) { XClearArea(display, menu.iframe, ix, iy, menu.item_w, menu.item_h, False); } GC gc = (highlight || frame) ? bbtool->getMenuHiGC() : bbtool->getMenuFrameGC(), tgc = (highlight) ? bbtool->getMenuHiGC() : bbtool->getMenuFrameGC(); int fx = ix, hw = menu.item_h / 2, qw = menu.item_h / 4; if (indicator_position == Right) fx += (menu.item_w - menu.item_h - menu.bevel_w); if (highlight) { if (indicator == Round) { XFillArc(display, menu.iframe, bbtool->getMenuHiBGGC(), ix + 1, iy + 1, menu.item_h - 1, menu.item_h - 2, 90 * 64, 180 * 64); XFillArc(display, menu.iframe, bbtool->getMenuHiBGGC(), ix + menu.item_w - menu.item_h, iy + 1, menu.item_h - 1, menu.item_h - 2, 270 * 64, 180 * 64); XFillRectangle(display, menu.iframe, bbtool->getMenuHiBGGC(), ix + (menu.item_h / 2), iy + 1, menu.item_w - menu.item_h, menu.item_h - 1); } else XFillRectangle(display, menu.iframe, bbtool->getMenuHiBGGC(), ix + 1, iy + 1, menu.item_w - 2, menu.item_h - 2); } else if (frame) { if (indicator == Round) XFillArc(display, menu.iframe, bbtool->getMenuHiBGGC(), fx + 1, iy + 1, menu.item_h - 1, menu.item_h - 2, 0, 360 * 64); else XFillRectangle(display, menu.iframe, bbtool->getMenuHiBGGC(), fx + qw, iy + qw, hw + 1, hw + 1); } if (item->ulabel()) XDrawString(display, menu.iframe, tgc, tx, iy + bbtool->getResource()->getMenuFont()->ascent + (menu.bevel_w / 2) + 1, *item->ulabel(), strlen(*item->ulabel())); else if (item->label()) XDrawString(display, menu.iframe, tgc, tx, iy + bbtool->getResource()->getMenuFont()->ascent + (menu.bevel_w / 2) + 1, item->label(), strlen(item->label())); if (item->submenu()) { switch (indicator) { case Empty: break; case Round: default: XDrawArc(display, menu.iframe, gc, fx + qw + 1, iy + qw + 1, hw, hw, 0, 360 * 64); break; case Square: XDrawRectangle(display, menu.iframe, gc, fx + qw, iy + qw, hw, hw); break; case Triangle: XPoint tri[3]; if (indicator_position == Right) { tri[0].x = fx + hw - 2; tri[0].y = iy + hw - 2; tri[1].x = 4; tri[1].y = 2; tri[2].x = -4; tri[2].y = 2; } else { tri[0].x = fx + hw - 2; tri[0].y = iy + hw; tri[1].x = 4; tri[1].y = 2; tri[2].x = 0; tri[2].y = -4; } XFillPolygon(display, menu.iframe, gc, tri, 3, Convex, CoordModePrevious); break; case Diamond: XPoint dia[4]; dia[0].x = fx + hw - 3; dia[0].y = iy + hw; dia[1].x = 3; dia[1].y = -3; dia[2].x = 3; dia[2].y = 3; dia[3].x = -3; dia[3].y = 3; XFillPolygon(display, menu.iframe, gc, dia, 4, Convex, CoordModePrevious); break; } } } void Basemenu::setLabel(char *l) { if (menu.label) delete [] menu.label; if (l) { int mlen = strlen(l) + 1; menu.label = new char[mlen]; strncpy(menu.label, l, mlen); } else menu.label = 0; } void Basemenu::setHighlight(int index) { if (always_highlight != -1) drawItem(always_highlight, False, (which_sub == always_highlight), True); if (index >= 0 && index < menuitems->count()) { always_highlight = index; drawItem(always_highlight, True, (which_sub == always_highlight), True); } else always_highlight = -1; } void Basemenu::buttonPressEvent(XButtonEvent *be) { if (be->window == menu.iframe) { int sbl = (be->x / menu.item_w), i = (be->y / menu.item_h); int w = (sbl * menu.persub) + i; if (w < menuitems->count() && w >= 0) { which_press = i; which_sbl = sbl; BasemenuItem *item = menuitems->find(w); if (item->submenu()) drawSubmenu(w); else drawItem(w, False, True); } } } void Basemenu::buttonReleaseEvent(XButtonEvent *re) { if (re->window == menu.title) { if (moving) { XUngrabPointer(display, CurrentTime); moving = False; if (which_sub != -1) drawSubmenu(which_sub); } if (re->x >= 0 && re->x <= (signed) menu.width && re->y >= 0 && re->y <= (signed) menu.title_h) if (re->button == 3 && hidable) hide(); } else if (re->window == menu.iframe && re->x >= 0 && re->x < (signed) menu.width && re->y >= 0 && re->y < (signed) menu.iframe_h) { if (re->button == 3 && hidable) { hide(); } else { int sbl = (re->x / menu.item_w), i = (re->y / menu.item_h), ix = sbl * menu.item_w, iy = i * menu.item_h, w = (sbl * menu.persub) + i, p = (which_sbl * menu.persub) + which_press; if (w < menuitems->count() && w >= 0) { drawItem(p, (p == always_highlight), (p == which_sub), True); if (p == w) { if (re->x > ix && re->x < (signed) (ix + menu.item_w) && re->y > iy && re->y < (signed) (iy + menu.item_h)) { itemSelected(re->button, w); } } } else drawItem(p, False, True); } } else XUngrabPointer(display, CurrentTime); } void Basemenu::motionNotifyEvent(XMotionEvent *me) { if (me->window == menu.title && (me->state & Button1Mask)) { if (movable) { if (! moving) { if (XGrabPointer(display, menu.title, False, PointerMotionMask| ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, bbtool->getMoveCursor(), CurrentTime) == GrabSuccess) { moving = hidable = user_moved = True; if (parent) { parent->drawItem(parent->which_sub, (parent->which_sub == parent->always_highlight), False, True); parent->which_sub = -1; } menu.x_move = me->x; menu.y_move = me->y; if (which_sub != -1) drawSubmenu(which_sub); } else moving = False; } else { int dx = me->x_root - menu.x_move, dy = me->y_root - menu.y_move; menu.x = dx; menu.y = dy; XMoveWindow(display, menu.frame, dx, dy); if (which_sub != -1) drawSubmenu(which_sub); } } } else if ((! (me->state & Button1Mask)) && me->window == menu.iframe && me->x >= 0 && me->x < (signed) menu.width && me->y >= 0 && me->y < (signed) menu.iframe_h) { int sbl = (me->x / menu.item_w), i = (me->y / menu.item_h), w = (sbl * menu.persub) + i; if ((i != which_press || sbl != which_sbl) && (w < menuitems->count() && w >= 0)) { if (which_press != -1 && which_sbl != -1) { int p = (which_sbl * menu.persub) + which_press; BasemenuItem *item = menuitems->find(p); drawItem(p, (p == always_highlight), False, True); if (item->submenu()) if (item->submenu()->isVisible() && (! item->submenu()->hasUserMoved())) { item->submenu()->hide(); which_sub = -1; } } which_press = i; which_sbl = sbl; BasemenuItem *itmp = menuitems->find(w); if (itmp->submenu()) drawSubmenu(w); else drawItem(w, False, True); } } } void Basemenu::exposeEvent(XExposeEvent *ee) { if (ee->window == menu.title) { switch (bbtool->getResource()->getJustification()) { case LeftJustify: { XDrawString(display, menu.title, bbtool->getMenuTitleGC(), menu.bevel_w, bbtool->getResource()->getTitleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case RightJustify: { int off = XTextWidth(bbtool->getResource()->getTitleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))) + menu.bevel_w; XDrawString(display, menu.title, bbtool->getMenuTitleGC(), menu.width - off, bbtool->getResource()->getTitleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case CenterJustify: { int ins = (menu.width - (XTextWidth(bbtool->getResource()->getTitleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))))) / 2; XDrawString(display, menu.title, bbtool->getMenuTitleGC(), ins, bbtool->getResource()->getTitleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } } } else if (ee->window == menu.iframe) { LinkedListIterator it(menuitems); // this is a compilicated algorithm... lets do it step by step... // first... we see in which sub level the expose starts... and how many // items down in that sublevel int sbl = (ee->x / menu.item_w), id = (ee->y / menu.item_h), // next... figure out how many sublevels over the redraw spans sbl_d = ((ee->x + ee->width) / menu.item_w), // then we see how many items down to redraw id_d = ((ee->y + ee->height) / menu.item_h); if (id_d > menu.persub) id_d = menu.persub; // draw the sublevels and the number of items the exposure spans int i, ii; for (i = sbl; i <= sbl_d; i++) { // set the iterator to the first item in the sublevel needing redrawing it.set(id + (i * menu.persub)); for (ii = id; ii <= id_d && it.current(); it++, ii++) { int index = ii + (i * menu.persub); // redraw the item drawItem(index, (always_highlight == index), (which_sub == index)); } } } } void Basemenu::enterNotifyEvent(XCrossingEvent *ce) { if (ce->window == menu.iframe) { XGrabPointer(display, menu.iframe, False, PointerMotionMask| LeaveWindowMask|ButtonPressMask|ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, bbtool->getSessionCursor(), CurrentTime); menu.x_shift = menu.x, menu.y_shift = menu.y; if (menu.x + menu.width > bbtool->getCurrentScreenInfo()->getWidth()) { menu.x_shift = bbtool->getCurrentScreenInfo()->getWidth() - menu.width - 1; shifted = True; } else if (menu.x < 0) { menu.x_shift = 0; shifted = True; } if (menu.y + menu.height > bbtool->getCurrentScreenInfo()->getHeight()) { menu.y_shift = bbtool->getCurrentScreenInfo()->getHeight() - menu.height - 1; shifted = True; } else if (menu.y < 0) { menu.y_shift = 0; shifted = True; } if (shifted) XMoveWindow(display, menu.frame, menu.x_shift, menu.y_shift); if (which_sub != -1) { BasemenuItem *tmp = menuitems->find(which_sub); if (tmp->submenu()->isVisible()) { int sbl = (ce->x / menu.item_w), i = (ce->y / menu.item_h), w = (sbl * menu.persub) + i; if (w != which_sub && (! tmp->submenu()->hasUserMoved())) { tmp->submenu()->hide(); drawItem(which_sub, (w == always_highlight), False, True); which_sub = -1; } } } } } void Basemenu::leaveNotifyEvent(XCrossingEvent *ce) { if (ce->window == menu.iframe) { if (which_press != -1 && which_sbl != -1 && menuitems->count() > 0) { int p = (which_sbl * menu.persub) + which_press; drawItem(p, (p == always_highlight), (p == which_sub), True); which_sbl = which_press = -1; } if (shifted) { XMoveWindow(display, menu.frame, menu.x, menu.y); shifted = False; } if (! (ce->state & Button1Mask)) XUngrabPointer(display, CurrentTime); } } void Basemenu::reconfigure(void) { XSetWindowBackground(display, menu.frame, bbtool->getResource()->getBorderColor()->getPixel()); XSetWindowBorder(display, menu.frame, bbtool->getResource()->getBorderColor()->getPixel()); XSetWindowBorderWidth(display, menu.frame, bbtool->getResource()->getBorderWidth()); menu.bevel_w = bbtool->getResource()->getBevelWidth(); indicator_position = bbtool->getResource()->getBulletPosition(); indicator = bbtool->getResource()->getBulletStyle(); update(); } bbmail-0.8.3/Basemenu.hh0000644000175100017510000001066007371576725010541 // Basemenu.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 1999 by Brad Hughes, bhughes@tcac.net // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __Basemenu_hh #define __Basemenu_hh #include // forward declarations class Basemenu; class BasemenuItem; class ToolWindow; class BImageControl; class BScreen; #include "LinkedList.hh" class Basemenu { private: LinkedList *menuitems; ToolWindow *bbtool; Basemenu *parent; BImageControl *image_ctrl; Bool moving, visible, movable, user_moved, default_menu, title_vis, shifted, hidable; Display *display; int which_sub, which_press, which_sbl, alignment, always_highlight, indicator, indicator_position; struct menu { Pixmap iframe_pixmap, title_pixmap; Window frame, iframe, title; char *label; int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub; unsigned int width, height, title_h, iframe_h, item_w, item_h, bevel_w, bevel_h; } menu; virtual void drawSubmenu(int); virtual void drawItem(int, Bool = False, Bool = False, Bool = False); protected: BasemenuItem *find(int index) { return menuitems->find(index); } void setTitleVisibility(Bool b) { title_vis = b; } void setMovable(Bool b) { movable = b; } void setHidable(Bool h) { hidable = h; } void setAlignment(int a) { alignment = a; } void setMinimumSublevels(int m) { menu.minsub = m; } void setItemIndicator(int = -1, int = 0); virtual void itemSelected(int, int) = 0; public: Basemenu(ToolWindow *); virtual ~Basemenu(void); Bool hasSubmenu(int); Bool hasUserMoved(void) { return user_moved; } Bool isVisible(void) { return visible; } // BScreen *getScreen(void) { return screen; } Window getWindowID(void) { return menu.frame; } const char *getLabel(void) const { return menu.label; } int insert(char *, int = 0, char * = (char *) 0, int = -1); int insert(char **, int = -1); int insert(char *, Basemenu *, int = -1); int remove(int); int getX(void) { return menu.x; } int getY(void) { return menu.y; } int getCount(void) { return menuitems->count(); } int getHighlight(void) { return always_highlight; } int getIndicatorPosition(void) { return indicator_position; } unsigned int getWidth(void) { return menu.width; } unsigned int getHeight(void) { return menu.height; } unsigned int getTitleHeight(void) { return menu.title_h; } void buttonPressEvent(XButtonEvent *); void buttonReleaseEvent(XButtonEvent *); void motionNotifyEvent(XMotionEvent *); void enterNotifyEvent(XCrossingEvent *); void leaveNotifyEvent(XCrossingEvent *); void exposeEvent(XExposeEvent *); void reconfigure(void); void setLabel(char *n); void move(int, int); void update(void); void defaultMenu(void) { default_menu = True; } void setHighlight(int = -1); void setSubmenuIndicator(int = 1); void setIndicatorPosition(int = 1); virtual void show(void); virtual void hide(void); enum { AlignDontCare = 1, AlignTop, AlignBottom }; enum { Right = 1, Left }; enum { Empty = 0, Round, Square, Triangle, Diamond }; enum { LeftJustify = 1, RightJustify, CenterJustify }; }; class BasemenuItem { private: Basemenu *s; char **u, *l, *e; int f; friend class Basemenu; protected: public: BasemenuItem(char *lp, int fp, char *ep = (char *) 0) { l = lp; e = ep; s = 0; f = fp; u = 0; } BasemenuItem(char *lp, Basemenu *mp) { l = lp; s = mp; e = 0; f = 0; u = 0; } BasemenuItem(char **up) { u = up; l = e = 0; f = 0; s = 0; } char *exec(void) { return e; } char *label(void) { return l; } char **ulabel(void) { return u; } int function(void) { return f; } Basemenu *submenu(void) { return s; } }; #endif // __Basemenu_hh bbmail-0.8.3/blackboxstyle.hh0000644000175100017510000000400707270530054011625 // blackboxstyle.hh for bbmail - an tool to display new mail in X11. // // this program is free software; you can redistribute it and/or modify // it under the terms of the gnu general public license as published by // the free software foundation; either version 2 of the license, or // (at your option) any later version. // // this program is distributed in the hope that it will be useful, // but without any warranty; without even the implied warranty of // merchantability or fitness for a particular purpose. see the // gnu general public license for more details. // // you should have received a copy of the gnu general public license // along with this program; if not, write to the free software // foundation, inc., 675 mass ave, cambridge, ma 02139, usa. // // (see the included file copying / gpl-2.0) // #ifndef __BLACKBOXSTYLE_HH #define __BLACKBOXSTYLE_HH /* mailtool.frame */ #define BB_FRAME "toolbar" /* mailtool.label */ #define BB_LABEL "toolbar.label" /* mailtool.*.counter.textColor */ #define BB_LABEL_TEXTCOLOR "toolbar.textColor" /* mailtool.bevelWidth */ #define BB_BEVELWIDTH "bevelWidth" /* mailtool.*.font */ #define BB_FONT "titleFont" /* bbmail.menu.frame */ #define BB_MENU "menu.frame" /* bbmail.menu.highlight.color */ #define BB_MENU_HIGHLIGHT_COLOR "menu.frame.highlightColor" /* bbmail.menu.textColor */ #define BB_MENU_TEXTCOLOR "menu.frame.textColor" /* bbmail.menu.highlight.textColor */ #define BB_MENU_HITEXTCOLOR "menu.frame.hiTextColor" /* bbmail.menuJustify */ #define BB_MENU_JUSTIFY "menuJustify" /* bbmail.menuFont */ #define BB_MENU_FONT "menuFont" /* bbmail.mailbox.*.newmail */ #define BB_NEWMAIL "toolbar.button" /* bbmail.mailbox.*.newmail.pressed */ #define BB_NEWMAIL_PRESSED "toolbar.button.pressed" /* bbmail.mailbox.*.*.textColor */ #define BB_ENVELOPE_TEXTCOLOR "toolbar.textColor" /* bbmail.menu.bulletStyle */ #define BB_MENU_BULLETSTYLE "menu.bulletStyle" /* bbmail.menu.bulletPosiotion */ #define BB_MENU_BULLETPOSITION "menu.bulletPosition" #endif /* __BLACKBOXSTYLE_HH */ bbmail-0.8.3/bbmail.10000644000175100017510000001537707342531524007765 .TH "bbmail" "1" "May 14, 2001" "John Kennis" "" .SH "NAME" bbmail \- mailbox flag for X .SH "SYNOPSIS" .B bbmail .RI [ options ] .SH "DESCRIPTION" .B bbmail displays the status of a mailbox and warns when new mail has arrived. It has internal support for mbox and maildir mailboxes. Other mailboxes like MH or pop3 can be checked using an external program. The tool is designed to mimic the look and feel of the Blackbox window manager when used in combination with blackbox bbmail copies the style from Blackbox. A little picture of an envelope shows if new mail is present. Multiple mailboxes can be defined and different envelope colors are used to indicate new mail. If the envelope is pressed with left mouse button a program for example a mail client can be started. When the right button is pressed on the envelope a menu shows up. The menu shows all mailboxes and the new mail/total mail of that mail box. Another option in the menu is reconfigure, which causes bbmail to reconfigure (reread the config files). .SH "Options" .BR bbmail supports the following command line options: .TP .BI \-d " displayname" "\fR,\fP \-\^\-display " displayname Set display to displayname .TP .BI \-c " configname" "\fR,\fP \-\^\-config " configname Read configuration from configname instead of the default. .TP .BR \-v ", " \-\^\-version Display version number of bbmail .TP .BR \-h ", " \-\^\-help Display help on command line options .TP .BI \-g " +x+y" "\fR,\fP \-\^\-geometry" +x+y Set the position of bbmail to x,y. Use +x+y to specify the coordinates relative to the upper left corner, use \-x\-y specify the coordinates relative the lower right corner. This option is ignored when \-withdrawn flag is used. .TP .BR \-d ", " \-\^\-decorated Show bbmail in a normal window with title bar. .TP .BR \-w ", " \-\^\-withdrawn Put bbmail in the blackbox slit or Windowmaker dock. .TP .BR \-s ", " \-\^\-shape Don't display the background of bbmail. This only makes sense in combination with the \-withdrawn flag .SH "Configuration" \fBGlobal configuration:\fR By default the configuration file bbmail.bb can be found in /usr/local/share/bbtools \fBLocal configuration:\fR The default configuration file should be placed in ~/.bbtools/ The following options can be set in the configuration file: .TP .BI bbmail.bevelWidth: " width" Set the width between text label and edge of tool. .TP .BI bbmail.position: " +x+y" Set position of bbmail. .TP .BI bbmail.withdrawn: " boolean" Set to True to put bbmail in the blackbox slit or Windowmaker dock. Default set to false. .TP .BI bbmail.shape: "boolean" Set to True if bbmail shouldn't display its background. This gives a nice effect when withdrawn. Default set to false. .TP .BI bbmail.checkDelay: " seconds" Delay between checks. After delay mailbox file is checked for change. .TP .BI bbmail.forceCheck.onDelay: " seconds" Delay between checks. After delay external program to check mail is executed. .TP .BI bbmail.show.newmail.counter: " boolean" Set to true if bbmail should show the new mail counter. Default set to true. .TP .BI bbmail.show.totalmail.counter: " boolean" Set to true if bbmail should show the total mail counter. Default set to true. .TP .BI bbmail.show.envelope: " boolean" Set to true if bbmail should show envelope which flags new mail. Default set to true .TP .BI bbmail.numberOf.digits: " value" Set the number of digits of the new mail and total mail labels. Default it is set to 2, this makes it fit nicely in the slit. .TP .BI bbmail.show.onlyAtnewmail: " boolean" Set to true if bbmail should only show up when new mail has arrived. Default set to false .TP .BI bbmail.raised: " boolean" .TP .BI bbmail.autoRaise: " boolean" .TP .BI bbmail.pressed.runCommand: " command" The command to run when the envelope is pressed (using the left mouse button). This command is overridden by the newmail command. .TP .BI bbmail.numberOf.mailboxes: " value" Set the number of mailboxes you want to define. If set to 0, the environment variable MAIL is used to find default mailbox. .TP .BI bbmail.mailbox.*.type: " value" Set the type of mailbox to eother mbox, maildir or other. .BI bbmail.mailbox.*.fi lename: " filename" The filename of the mbox file or the directory of maildir .TP .BI bbmail.mailbox.*.name: " name" Name of mailbox, this name is shown in menu. .TP .BI bbmail.mailbox.*.newmail.pressed.runCommand: " command" The command to run when new mail is indicated. If this command is not defined the command defined by bbmail.pressed.runCommand is used. .TP .BI bbmail.mailbox.*.newmail.runCommand: " command" The command to run when new mail is received. Example: cat mail.wav > /dev/dsp .TP .BI bbmail.mailbox.*.newmail.bell: " boolean" If set to true the bell is sound when new mail arrives. .TP .BI bbmail.mailbox.*.newmail: " gradient" Set the gradient of the envelope when new mail is present. Example: Raised Gradient Vertical Bevel1 .TP .BI bbmail.mailbox.*.newmail.color: " color" Set the "from" color of the envelope when new mail is present. .TP .BI bbmail.mailbox.*.newmail.colorTo: " color" Set the "to" color of the envelope when new mail is present. .TP .BI bbmail.mailbox.*.newmail.pressed: "gradient" Set the gradient of the envelope when new mail is present and the envelope is pressed. Example: Flat Gradient Vertical Bevel1 .TP .BI bbmail.mailbox.*.newmail.textColor: " color" Set the color for the lines in the envelope. .TP .BI bbmail.mailbox.*.newmail.error.textColor: " color" Set color for the error indication in the envelope. .TP .BI bbmail.menu.justify: " justify" Set menu text justify to either CentreJustify, LeftJustify or RightJustify. .TP .BI bbmail.menu.bulletStyle: " bullet style" diamond Set menu bullet style to either diamond .TP .BI bbmail.menu.bulletPosition: " bullet position" Set menu bullet position to either left or right. .TP .BI bbmail.menu: " gradient" Set the gradient of the menu. .TP .BI bbmail.menu.color: " color" Set the "from" color of the menu. .TP .BI bbmail.menu.colorTo: " color" Set the "to" color of the menu. .B type mbox options bbmail.mailbox.1.newmail.statusFlag: " status" Set the status flag which in used in the mbox file to indicate mail is read. Example for Netscape: X\-Mozilla\-Status: [89ABCDEF] .B type other options .BI bbmail.mailbox.1.mode: " mode" mode: 1\- unread mail total mail 2\- unread mail read mail 3\- read mail total mail 4\- ignore second value (for both proc and reversed proc) .TP .BI bbmail.mailbox.1.proc: " program" The program to run to check for mail, bbmail searches for 2 integers in the output of the program. If none are found an error is reported. Example program MH: flist Example program fetchmail: fetchmail \-c | ~/.bbtools/bbmailparsefm.pl .SH "BUGS" The config file of bbmail doesn't handle spaces after commands very well. bbmail-0.8.3/BUGS0000644000175100017510000000011507051262521007113 - menu and Slit don't work together yet. - bbmail doesn't stay on top anymorebbmail-0.8.3/data/0000777000175100017510000000000007644531363007443 5bbmail-0.8.3/data/Makefile.am0000644000175100017510000000017307370047400011402 configdir = $(datadir)/bbtools CLEANFILES = bbtoolsrc config_DATA = bbmail.bb EXTRA_DIST = $(config_DATA) all-local: bbmail-0.8.3/data/Makefile.in0000644000175100017510000001321007644531237011421 # Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERLACE = @INTERLACE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ regex_cmd = @regex_cmd@ configdir = $(datadir)/bbtools CLEANFILES = bbtoolsrc config_DATA = bbmail.bb EXTRA_DIST = $(config_DATA) subdir = data mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(config_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status uninstall-info-am: install-configDATA: $(config_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(configdir) @list='$(config_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(configdir)/$$f"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(configdir)/$$f; \ done uninstall-configDATA: @$(NORMAL_UNINSTALL) @list='$(config_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(configdir)/$$f"; \ rm -f $(DESTDIR)$(configdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) all-local installdirs: $(mkinstalldirs) $(DESTDIR)$(configdir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-configDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-configDATA uninstall-info-am .PHONY: all all-am all-local check check-am clean clean-generic \ distclean distclean-generic distdir dvi dvi-am info info-am \ install install-am install-configDATA install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ uninstall uninstall-am uninstall-configDATA uninstall-info-am all-local: # 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: bbmail-0.8.3/data/bbmail.bb0000644000175100017510000001730707342206604011112 !********************************************************************** !** bbmail.bb Configuration file for bbmail when using Blackbox ** !********************************************************************** ! bbmail.bevelWidth: 4 !** width between end of frame and beginning of envelope ** !** aspect ratio between width an height of envelope is 3:4. ** !** So making this value bigger makes the envelope smaller ** ! bbmail.envelope.bevelWidth: 2 !********************************************************************** !** bbmail.config Configuration file for bbmail ** !********************************************************************** !************* How and where to display *********************** !** position of bbmail window ** bbmail.position: -0-0 !** place bbdate in the slit ** !bbmail.withdrawn: True !** don't show frame ** !bbmail.shape: True ! delay between mail checks ! bbmail.checkDelay: 5 ! bbmail.forceCheck.onDelay: 60 !************* What to display ******************************* bbmail.show.newmail.counter: True bbmail.show.totalmail.counter: True bbmail.show.envelope: True !** max number of digits displayed in the label ** !bbmail.numberOf.digits: 2 !** when to display ** bbmail.show.onlyAtnewmail: False !** bbmail on top of other windows ** bbmail.raised: True !** put bbmail on top of other windows when new mail is received. ** bbmail.autoRaise: True !************************************************************** ! ** command to execute when envelope is pushed, and no new mail is ** ! ** reported ** bbmail.pressed.runCommand: rxvt -e pine -i & ! ** number of spool dirs/files you define ** ! ** if number = 0, spoolfile will be taken from enviroment variable MAIL ** bbmail.numberOf.mailboxes: 0 !************* Defenition first mailbox ******************************* !** Choose mailbox type either mbox, maildir or other (mbox is default) ** !** When choosing other, proc and or reversedProc have to be set below ** !bbmail.mailbox.1.type: mbox !bbmail.mailbox.1.type: maildir !bbmail.mailbox.1.type: other !** name of mailbox: the mailbox filename !bbmail.mailbox.1.filename: !** label to display in menu !bbmail.mailbox.1.name: mailbox-1 !** command to run when new mail is reported ** !bbmail.mailbox.1.newmail.pressed.runCommand: rxvt -e pine -i -f folder1 !** command to run when new mail is reported ** !bbmail.mailbox.1.newmail.runCommand: cat mail.wav > /dev/dsp !** sound bell when new mail has arrived ** bbmail.mailbox.1.newmail.bell: True !*************** envelope style **************************************** !** style of envelope ** bbmail.mailbox.1.newmail: Raised Gradient Vertical Bevel1 bbmail.mailbox.1.newmail.color: red2 bbmail.mailbox.1.newmail.colorTo: red4 !** style of pressed envelope ** bbmail.mailbox.1.newmail.pressed: Flat Gradient Vertical Bevel1 bbmail.mailbox.1.newmail.pressed.color: red2 bbmail.mailbox.1.newmail.pressed.colorTo: red4 !** color of lines in envelope ** bbmail.mailbox.1.newmail.textColor: black bbmail.mailbox.1.newmail.error.textColor: black !************** mailbox: "mbox" options ********************************* !** line in mailbox-file indicating that mail is read. ** !** Program default (Status: R) is correct in most cases ** !** To use netscape mail files uncomment the following line ** !bbmail.mailbox.1.newmail.statusFlag: X-Mozilla-Status: [89ABCDEF] !bbmail.mailbox.1.newmail.statusFlag: Status: R !************** mailbox: "other" options ********************************* !** if you have choosen mailbox type "other" above, !** set the approperiate values below. !** mode: 1- unread mail total mail !** 2- unread mail read mail !** 3- read mail total mail !** 4- ignore second value (for both proc and reversed proc) !bbmail.mailbox.1.mode: 1 !** The program define here is used in stead of the internal check ** !** The program has to write the number of mails as described ** !** by mode any additional characters will be ignored ** !** example 1 using a mh mailbox: ** !bbmail.mailbox.1.proc: flist !** example 2 using fetchmail to get mailinfo from external ** !** mailserver. ** !bbmail.mailbox.1.proc: fetchmail -c | ~/.bbtools/bbmailparsefm.pl !** The two mail numbers are swaped after they are read ** !bbmail.mailbox.1.reversedProc: !************* Defenition second mailbox ****************************** !bbmail.mailbox.2.type: mbox !bbmail.mailbox.2.type: maildir !bbmail.mailbox.2.filename: !bbmail.mailbox.2.name: mailbox-2 !bbmail.mailbox.2.newmail.pressed.runCommand: rxvt -e pine -i -f folder2 !bbmail.mailbox.2.newmail.runCommand: cat mail.wav > /dev/dsp !bbmail.mailbox.2.newmail.bell: True !bbmail.mailbox.2.newmail.statusFlag: Status: R !bbmail.mailbox.2.mode: 1 !bbmail.mailbox.2.proc: flist !bbmail.mailbox.2.reversedProc: !**** envelope style second mailbox **** !bbmail.mailbox.2.newmail.color: yellow2 !bbmail.mailbox.2.newmail.colorTo: yellow4 !bbmail.mailbox.2.newmail.pressed.color: yellow2 !bbmail.mailbox.2.newmail.pressed.colorTo: yellow4 !bbmail.mailbox.2.newmail.textColor: black !bbmail.mailbox.2.newmail.error.textColor: black ! ************************************************************* ! ** By default the values below this point are taken from ** ! ** the Blackbox style. ** ! ** If you want to override something just uncomment it ** ! ** and change the value ** ! ************************************************************* ! font which determines the height (compatible with blackbox) !bbmail.heightBy.font: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* !** label font ** !bbmail.labelFont: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* !** menu font ** !bbmail.menuFont: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* !** menu justify !bbmail.menu.justify: CenterJustify !** menu bullet style !bbmail.menu.bulletStyle: diamond !** bullet position !bbmail.menu.bulletPosition: left ! ****************** define display styles **************************** !** define frame style ** !bbmail.frame: Raised Gradient Vertical Bevel1 !bbmail.frame.color: gray45 !bbmail.frame.colorTo: gray21 !** label style ** !label.transparent: False !bbmail.label: Sunken Gradient Vertical Bevel1 !bbmail.label.color: gray45 !bbmail.label.colorTo: gray21 !** envelope style (when no new mail is reported) ** !bbmail.envelope: Sunken Gradient Vertical Bevel1 !bbmail.envelope.color: gray45 !bbmail.envelope.colorTo: gray21 !** pressed envelope style (when no new mail is reported) ** !bbmail.envelope.pressed: Flat Gradient Vertical Bevel1 !bbmail.envelope.pressed.color: red2 !bbmail.envelope.pressed.colorTo: red4 !** menu style !bbmail.menu: Raised Gradient Vertical Bevel1 !bbmail.menu.color: gray45 !bbmail.menu.colorTo: gray21 !************ define line and font colors ****************************** !** color of lines in envelope ** !bbmail.envelope.textColor: black !bbmail.envelope.error.textColor: red1 !** text color of counters ** !bbmail.newmail.counter.textColor: lightgrey !bbmail.totalmail.counter.textColor: lightgrey !bbmail.seperator.counter.textColor: lightgrey !** text color of counters when zero !bbmail.newmail.counter.boring.textColor: gray55 !bbmail.totalmail.counter.boring.textColor: gray55 !bbmail.seperator.counter.boring.textColor: gray55 !** text color menu !bbmail.menu.textColor: lightgrey !bbmail.menu.higlight.textColor: white !** menu highlight color !bbmail.menu.highlight.color: sienna4 bbmail-0.8.3/scripts/0000777000175100017510000000000007644531363010221 5bbmail-0.8.3/scripts/Makefile.am0000644000175100017510000000011207074176461012164 configdir = $(datadir)/bbtools EXTRA_DIST = bbmailparsefm.pl all-local: bbmail-0.8.3/scripts/Makefile.in0000644000175100017510000001150307644531237012202 # Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERLACE = @INTERLACE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ regex_cmd = @regex_cmd@ configdir = $(datadir)/bbtools EXTRA_DIST = bbmailparsefm.pl subdir = scripts mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status uninstall-info-am: tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-info-am .PHONY: all all-am all-local check check-am clean clean-generic \ distclean distclean-generic distdir dvi dvi-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 \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic uninstall uninstall-am uninstall-info-am all-local: # 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: bbmail-0.8.3/scripts/bbmailparsefm.pl0000755000175100017510000000122407074176433013300 #!/usr/bin/perl # # Quickie script to parse fetchmail -c output # (IMAP proto) for use with bbmail # # Typical fetchmail output is: # "X messages (Y seen) for foo-user at bar-host." # # wcb 4/15/2000 # $newmail = 0; $totalmail = 0; $line = ; if ( $line =~ /^(\d+)\s+message/i ) { $totalmail = $1; if ( $line =~ /\s+\((\d+)\s+seen\)/i ) { $newmail = $totalmail - $1; } else { $newmail = $totalmail; } } elsif ( $line =~ / no mail/i ) { $newmail = 0; $totalmail = 0; } else # not getting expected fetchmail output, # so report error { $newmail = "error"; $totalmail = "error"; } print ($newmail, " ", $totalmail, "\n");