./sane-frontends-1.0.14/0000755000175000017500000000000010313255162012766 5ustar hmghmg./sane-frontends-1.0.14/AUTHORS0000644000175000017500000000064010130504524014032 0ustar hmghmgxcam: David Mosberger xscanimage: Tristan Tarrant, Andreas Beck, and David Mosberger scanadf: Tom Martone, Andreas Beck, and David Mosberger xscanimage icon: Maciek Podkomorzy Email addresses: Andreas Beck David Mosberger Maciek Podkomorzy Tom Martone Tristan Tarrant ./sane-frontends-1.0.14/COPYING0000644000175000017500000004312707203335554014040 0ustar hmghmg 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. ./sane-frontends-1.0.14/Changelog0000644000175000017500000007307410313254446014617 0ustar hmghmg****** Release of sane-frontends-1.0.14 ***** 2005-09-18 Henning Meier-Geinitz * configure configure.in: Changed version to 1.0.14. * src/Makefile.in: Added missing DISTFILE. 2005-05-31 Oliver Rauch * src/xcam.c update_param: added patch by Douglas Schilling Landgraf: if (dialog == NULL) return; 2005-05-10 Gerard Klaver * src/xcam.c - moved 2 DBG lines from above to below variable declarations (OS/2 compiler error bugreport Franz Bakan) - Changed declaration for "remaining" from SANE_Int to size_t moved lines for generating frame count, fps and 2005-05-07 Gerard Klaver * src/xcam.c -moved lines for generating frame count, fps and fps avarage value from nex_frame to input_available routine. -solved bug for fps values > 1 2005-04-11 Gerard Klaver * src/xcam.c added TXT button for option text line adding to i image with name, date and time info. font_6x11.h file and add_text routine taken from the (GPLed) webcam.c file, part of xawtv, (c) 1998-2002 Gerd Knorr. add_text was modified for this program (xcam_add_text). added RGB/BGR button option to switch the colors if needed. solved segment fault when no usb scanner/vidcam devices is attached to system ( bug report from Henning Meier-Geinitz) patch update for recording feature (SANE bugreport 300224) added SAVE Frame button, output filename box. With Save Frame button image can be saved as .pnm .pgm .pbm or .ppm file added info row with x, y, image-size, fps count, fps, fps_ava added -V and -h option (version and help added option -B -buffersize so instead of default input buffer of 32*1024 a buffer of 1024*1024 can be chosen src/font_6x11.h file added to src directory src/xscanimage.c updates for debug output src/preview.c updates for debug output src/gtkglue.c updates for debug output doc/xcam.man update for -B, help and debug info option 2004-12-11 Julien Blache * sanei resync with sane-backends, fixes a deadlock between xscanimage and saned when scanning over the network. 2004-10-30 Henning Meier-Geinitz * doc/scanadf.man src/scanadf.c: Wait for scan-scripts so all files are handled before leaving scanadf. Patch from Tristan Hill , bug #300993. 2004-10-17 Henning Meier-Geinitz * configure configure.in: Changed version to 1.0.13-cvs. End of freeze. ****** Release of sane-frontends-1.0.13 ***** 2004-10-17 Henning Meier-Geinitz * configure configure.in: Changed version to 1.0.13. 2004-10-16 Henning Meier-Geinitz * configure configure.in: Don't ask user to remove /dev/null. Current autoconf doesn't use cache files. -- snapshot 1.0.13-pre1 2004-10-10 Henning Meier-Geinitz * Makefile.in: Added xscanimage-icon-48x48-2.png to DISTFILES. 2004-10-05 Henning Meier-Geinitz * xscanimage-icon-48x48-2.png: Added xscanimage icon (from Maciek Podkomorzy ). 2004-10-03 Henning Meier-Geinitz * src/gtkglue.c: Don't try to print non-readable options. Don't try to write non-writable options (bug #300621). Don't print warnings for options without constraints. 2004-07-09 Henning Meier-Geinitz * doc/scanadf.man src/scanadf.c: Added -N option to stop scanadf from overwriting files (patch from Paul Walmsley ). 2004-05-12 Henning Meier-Geinitz * acinclude.m4 aclocal.m4 configure sane-frontends.lsm: Removed old links to ftp.mostang.com. 2004-04-29 Julien Blache * src/gtkglue.h: looks like someone wanted GSGDialog.twocolumn to an int rather than a GtkWidget *. Fixed. 2004-04-24 Henning Meier-Geinitz * Makefile.in: Remove autoconf temp files in distclean. 2004-04-20 Julien Blache * src/preview.c: make the preview work when it's resized. 2004-04-19 Julien Blache * src/xcam.c: fixed xcam layout. 2004-04-17 Henning Meier-Geinitz * configure configure.in: Set version to 1.0.12-cvs. ****** Release of sane-frontends-1.0.12 ***** 2004-04-17 Henning Meier-Geinitz * configure configure.in: Set version to 1.0.12. 2004-04-12 Henning Meier-Geinitz * src/gtkglue.c: Used "us" for microsecond as the UTF8 text didn't work with GTK 1.2. See bug #300621. -- snapshot 1.0.12-pre1 2004-04-09 Henning Meier-Geinitz * INSTALL: Updated supported Gimp versions. * configure configure.in: Make sure that build also works without libgtk 2.0. * config.guess config.sub: Updated. 2004-04-05 Gerard Klaver * src/gtkglue.c UTF8 patch from Mattias Ellert for SANE_UNIT_MICROSECOND, See bug #300621. 2004-04-05 Gerard Klaver * src/gtkglue.c src.gtkglue.h src/preferences.c src/preferences.h src/xcam.c src/xscanimage.c: Add display option one or two column See bug #300450. 2004-04-02 Henning Meier-Geinitz * src/preview.c src/xscanimage.c: Set sensitivity to false when scanning or previewing. This change fixes some problems that accour when preview ist started again while preview is running. See bug #300220, #300219, and #300218. 2004-04-02 Julien BLACHE * src/xscanimage.c: fix select_device_callback() to return 0, fixing a minor yet annoying bug in the device chooser (radio buttons didn't toggle their status when clicked). 2004-02-22 Henning Meier-Geinitz * lib/usleep.c sanei/sanei_load_values.c sanei/sanei_save_values.c: Port to nsr-tandem-nsk (patch from "Bates, Tom" ). 2004-01-25 Julien BLACHE * src/xscanimage.c: add a call to gimp_extension_ack(), conforming to the GIMP 2.0 plug-in API. Also initialize the status to GIMP_PDB_CALLING_ERROR. 2004-01-22 Julien BLACHE * src/xscanimage.c: reverse the #ifdef ENABLE_GIMP_1_3 logic, we now have ENABLE_GIMP_1_2 when GIMP 1.2 is explicitely wanted. * configure.in: make GIMP 2.0 the default. * include/sane/config.h: replace ENABLE_GIMP_1_3 by ENABLE_GIMP_1_2. * aclocal.m4, acinclude.m4: include the AM_PATH_GIMP_2_0 macros, which replaces the AM_PATH_GIMP_1_4 macro. 2003-12-15 Henning Meier-Geinitz * src/xscanimage: Added debug messages to most functions. Added checks for the return values of SANE API functions. * src/gtkglue.c src/preview.c: Added checks for the return values of SANE API functions. 2003-11-26 Henning Meier-Geinitz * Makefile.in: Generate md5 hash when making a release. Remove generated .lsm file in "make distclean". * doc/Makefile.in: Fixed link to images in HTML manpages. 2003-10-05 Henning Meier-Geinitz * src/xscanimage.c: Check if the gamma value is not negative and <255. based on a patch from Patch from Gerard Klaver , bug #300251. 2003-09-30 Henning Meier-Geinitz * src/xscanimage.c: Make sure that we save only to files with extension pnm (and similar). Patch from Gerard Klaver , bug #300239. 2003-09-24 Henning Meier-Geinitz * README doc/scanadf.man: Changed links to sane-project.org. Minor updates. * TODO Makefile.in: Removed TODO. Everything was added to the bug-tracking system. 2003-07-28 Henning Meier-Geinitz * INSTALL configure configure.in src/xscanimage.c: Support for gimp version 1.3.17 (patch from Julien BLACHE ). 2003-07-17 Henning Meier-Geinitz * src/xscanimage.c: Avoid integer overflow when calculating the size of very big images. 2003-06-25 Henning Meier-Geinitz * configure configure.in src/xscanimage.c: Fix for API-change in gimp 1.3.15 (patch from Julien BLACHE ). 2003-05-15 Henning Meier-Geinitz * INSTALL: Added information on dependency on devel packages for sane-backends. Mentioned supported versions of gtk and gimp explicitely. 2003-04-26 Henning Meier-Geinitz * configure configure.in: Changed version to 1.0.11-cvs. * sane-frontends.lsm: Added scanadf. ****** Release of sane-frontends-1.0.11 ***** 2003-04-20 Henning Meier-Geinitz * Makefile.in: Add acinclude.m4 to DISTFILES. * configure configure.in: New version: 1.0.11. 2003-03-23 Henning Meier-Geinitz * acinclude.m4 aclocal.m4 configure configure.in include/sane/config.h.in src/xscanimage.c: Added GIMP 1.3 support. Added support for autoheader. Patch from Julien BLACHE . 2003-03-22 Henning Meier-Geinitz * src/xcam.c: Use a scrollbar if the options dialog gets too big. Patch from Julien BLACHE . * acinclude.m4 aclocal.m4 configure configure.in src/Makefile.in src/gtkglue.c src/preview.c src/xscanimage.c: Added acinclude.m4 to create aclocal.m4 automatically. Added GTK2 support. Check for GTK2 only if the gimp plugin is disabled. If GTK2 is not available, we'll fallback to a lower version if available. Patch from Julien BLACHE . Check that setting resolution option in preview succeeded. Otherwise we may use the main resolution setting accidently. * TODO: Updated xcam and xscanimage entries. 2003-02-01 Henning Meier-Geinitz * src/xscanimage.c: Tell gimp which resolution we used for the scan. Based on patch from Aurelien Jarno . * src/xscanimage.c doc/xscanimage.man: Move gimp menu entries to File/Acquire/xscanimage/*. Patch from Julien BLACHE . ****** Release of sane-frontends-1.0.10. End of code freeze ***** 2003-01-31 Henning Meier-Geinitz * TODO: Removed PUT_PIXEL problem. * configure configure.in: Increased version to 1.0.10. 2003-01-29 Henning Meier-Geinitz * INSTALL: Added comment about OS/2 pthread problem. ---- CODE FREEZE FOR SANE 1.0.10 --- -- snapshot 1.0.10-pre3 2003-01-24 Henning Meier-Geinitz * src/xcam.c: Fixed the xcam code related to the GdkImage data buffer filling. I've resorted to the RGB shift values contained in the GdkVisual associated to the image. It seems to work pretty well now, and should be more portable among different platforms and X11 visuals. Only 24/32 bit was fixed, 15/16 bit may need more work. Patch from Andrea Suatoni . * src/xcam.c: Used shift values also for 15/16 bit modes. 2003-01-18 Henning Meier-Geinitz * configure configure.in include/sane/config.h.in src/preferences.c src/preview.c src/progress.c: Some platforms/compilers don't define u_int8_t so we must do that ourselves. -- snapshot 1.0.10-pre2 2003-01-14 Henning Meier-Geinitz * src/Makefile.in: Create $(DESTDIR)$(sanedatadir) before installing sane-style.rc. ---- FEATURE FREEZE FOR SANE 1.0.10 --- -- snapshot 1.0.10-pre1 2003-01-12 Henning Meier-Geinitz * src/xcam.c: Removed already defined Preferences variable. * TODO: Minor cleanup + update. 2003-01-05 Henning Meier-Geinitz * src/Makefile.in: Install sane-style.rc to $(sanedatadir) where it can be found by the frontends (from Andrea Suatoni ). 2002-12-30 Henning Meier-Geinitz * src/gtkglue.c src/xscanimage.c: Use a scrollbar if the options dialog gets too big. Make output filname dialog modal. Add check marks for unit menu. All patches from Julien BLACHE . 2002-11-14 Henning Meier-Geinitz * src/xscanimage.c: Added 16 bit support for stand-alone mode SANE_FRAME_GRAY and SANE_FRAME_RGB (from Sergey Vlasov .). Call scan_done if an error occurs during scan_start. Run sane_cancel even if sane_read wasn't called once. 2002-10-24 Henning Meier-Geinitz * configure configure.in: Addded extra version -cvs again. ****** Release of sane-frontends-1.0.9. End of code freeze ***** 2002-10-23 Henning Meier-Geinitz * configure configure.in: New version: 1.0.9. ---- CODE FREEZE FOR SANE 1.0.9 --- -- snapshot 1.0.9-pre2 2002-10-17 Henning Meier-Geinitz * src/preview.c src/preview.h src/xscanimage.c: Disable "Scan" and "Acquire Preview" buttons while scanning, and "Acquire Preview" while acquiring a preview. Avoids error messages and/or lockups. Patch from Aurelien Jarno . * TODO: Added some more xscanimage bugs. 2002-10-15 Henning Meier-Geinitz * src/preview.c: Added malloc that got lost in previous commit. 2002-09-30 Henning Meier-Geinitz * src/preview.c: Avoid unaligned 1 bit previews. Fixed 1 bit color mode (also three-pass). Changed 1 bit color modes to most significant bit is first pixel. ---- FEATURE FREEZE FOR SANE 1.0.9 --- -- snapshot 1.0.9-pre1 2002-09-02 Matto Marjanovic * src/progress.c, src/xscanimage.c: Added a couple of GTK mainloop calls so that the UI is updated in a more timely fashion. Helps with backends which have potentially slow sane_start() and sane_read() commands (e.g. microtek). 2002-06-07 Henning Meier-Geinitz * config.guess config.sub: Updated to latest versions (from ftp://ftp.gnu.org/pub/gnu/config/). 2002-05-27 Oliver Rauch * configure.in/configure V_EXTRA=-cvs ****** Release of sane-frontends-1.0.8. End of code freeze ***** 2002-05-25 Henning Meier-Geinitz * configure configure.in: Set version to 1.0.8. ---- CODE FREEZE FOR SANE 1.0.8 --- -- snapshot 1.0.8-pre1 2002-05-03 Henning Meier-Geinitz * configure configure.in: Check for libsyslog and libsocket for OS/2. ---- FEATURE FREEZE FOR SANE 1.0.8 --- 2002-04-13 Henning Meier-Geinitz * src/preview.c: Really use only guint types instead of u_int??_t. * configure configure.in lib/Makefile.in sanei/Makefile.in: Use ranlib if available. If we run AIX, don't use archives. 2002-04-06 Henning Meier-Geinitz * src/preview.c src/xscanimage.c: Don't remove imput tags that haven't been added. Don't hang when EOF and non-blocking. * PROBLEMS TODO: Moved the entry about progress bar in three-pass mode to PROBLEMS. 2002-04-02 Henning Meier-Geinitz * src/preview.c: Used guint types instead of u_int. Set order of pixels in 1 bit color mode to least significant -> most significant. That's the same as in three-pass mode. 2002-04-01 Henning Meier-Geinitz * src/preview.c: Fixed 1 bit color three-pass mode. Added 16 bit modes. Added 1 bit color mode. 2002-03-28 Henning Meier-Geinitz * Makefile.in: Remove *.tar.gz when making distclean. * doc/Makefile.in src/Makefile.in: Add DESTDIR variable to allow installing to a temporary directory. Actually print the names of the installed files, not only their path. 2002-03-15 Henning Meier-Geinitz * src/Makefile.in: Actually print what we are installing where. 2002-02-05 Henning Meier-Geinitz * configure configure.in: New version: 1.0.7-cvs. ****** Release of sane-frontends-1.0.7. End of code freeze ***** 2002-02-02 Henning Meier-Geinitz * config.guess config.sub: Use the same versions as in sane-backends to avoid compilation problems on newer platforms. 2002-01-29 Henning Meier-Geinitz * configure configure.in: New version: 1.0.7. Disabled extra version. ---- CODE FREEZE FOR SANE 1.0.7 --- --- sane-frontends-1.0.7-beta2 ---- 2002-01-27 Henning Meier-Geinitz * TODO: Removed entry about scanadf. Removed entry concerning testing. * INSTALL: Added link to man xscanimage. Added info about LD_LIBRARY_PATH. * doc/xscanimage.man: Updated for gimp-1.2. Added link to scanadf. 2002-01-26 Henning Meier-Geinitz * configure configure.in: Moved the message about problems from NEWS to configure itsself. * NEWS: Now this file describes the user-visible changes between releases as in sane-backends. Updated for sane-frontends 1.0.7. --- sane-frontends-1.0.7-beta1 --- 2002-01-16 Henning Meier-Geinitz * src/scanadf.c: OS/2 compatibility fixes. 2002-01-13 Tom Martone * doc/scanadf.man added sane(7) to SEE ALSO section 2002-01-12 Henning Meier-Geinitz * configure: Regenerated from configure.in. * doc/.cvsignore src/.cvsignore: Added scanadf. * INSTALL: Added note about --help. * README: Mentioned scanadf. 2002-01-11 Tom Martone * src/scanadf.c (new) * doc/scanadf.man (new) * ./configure.in * src/Makefile.in * doc/Makefile.in * AUTHORS added scanadf program 2002-01-08 Henning Meier-Geinitz * include/Makefile.in: Created. Moved distclean target to this file from root dir. * doc/Makefile.in lib/Makefile.in sanei/Makefile.in src/Makefile.in: Fixed .PHONY. Added target "dist". * Makefile.in: Added target "dist" and "sane-frontends". make dist creates sane-frontends-x.y.z.tar.gz and make sane-frontends also creates the appropriate sane-x-y-z.lsm. Moved distclean to include/. Fixed .PHONY. * configure configure.in: Added V_EXTRA version number to mark CVS releases (-cvs) and snapshosts/betas (e.g. -beta1). V_EXTRA will be empty for releases. Create include/Makefile. * sane-frontends.lsm: Made it more compatible with lsm standard. Added OpenBSD. Fixed mostang.com cvs directory. 2002-01-08 Oliver Rauch * configure.in: removed "rm -f $cache_file" when sane or gtk was not found. This was bad when a user used a global cache_file 2001-11-29 Oliver Schwartz * preview.c: in function restore_preview_image() check for width==0 to avoid floating point exception 2001-11-04 Henning Meier-Geinitz * sane-frontends-lsm: New file. Created Linux Software Map template to make uploading the sane-frontends package to mirrors easier. * Makefile.in: Added target "lsm" from sane-backends. ****** Release of sane-frontends-1.0.6. End of code freeze ***** ****** Code freeze for sane-1.0.6 is active ***** 2001-10-29 Henning Meier-Geinitz * configure configure.in: New version: 1.0.6. ****** snapshot 2001-10-27 ***** 2001-10-26 Henning Meier-Geinitz * INSTALL: GTK_CONFIG needs the full path name. ****** Feature freeze for sane-1.0.6 is active ***** ****** snapshot 2001-10-15 ***** 2001-10-13 Henning Meier-Geinitz * src/xscanimage.c: Fixed pnm output of images with a depth >8. Don't send gimp images with more then 8 bits/color. Patches from mh . Changed name of find-scanner to sane-find-scanner. * TODO: Added xscanimage problem with gamma tables. 2001-09-05 Henning Meier-Geinitz * INSTALL: Added paragraph about gcc and GNU make and the C compiler. Added sentence about GTK_CONFIG. Removed information about SANE 1.0.1. * README: Removed list of frontends. Point to mostang.com instead. 2001-08-03 Henning Meier-Geinitz * src/Makefile.in src/preview.c src/xscanimage.c: Use "xscanimage" as program name consistantly (instead of "xscan"). * configure configure.in lib/Makefile.in lib/alloca.c lib/getenv.c lib/getipt.c lib/getopt1.c lib/isfdtype.c lib/snprintf.c lib/strdup.c lib/strndup.c lib/strsep.c lib/usleep.c lib/vsyslog.c include/sane/config.h.in: Added missing getenv, isfdtype, and vsyslog functions from sane-backends. Used #include "../include/sane/config.h". 2001-07-11 Henning Meier-Geinitz * sanei/sanei_init_debug.c: Use syslog.h instead of sys/syslog.h. 2001-07-11 Henning Meier-Geinitz * INSTALL: Corrected some typos. * configure configure.in: Made the error message that is printed if the SANE libraries can't be found more verbose. 2001-07-07 Henning Meier-Geinitz * doc/Makefile.in: Use 6 lines as top/bottom margin for man2html to avoid losing 2 lines at every page break. * doc/.cvsignore: Added *.html. 2001-07-02 Oliver Rauch * configure/configure.in: added check for os2.h * src/xscanimage.c: added set_gimp_PLUG_IN_INFO(&PLUG_IN_INFO); before result = gimp_main (argc, argv); for os2 2001-07-01 Oliver Rauch ************************ end of code freeze *********************************** ************************ Release of sane-frontends 1.0.5 ********************** 2001-06-25 Oliver Rauch * configure/configure.in: changed version to 1.0.5 2001-06-25 ********** CODE FREEZE FOR SANE-1.0.5 snapshot sane-frontends-pre1-1.0.5 planned release on 2001-07-01 --- cvs snapshot-2001-06-17 --- 2001-06-12 Oliver Rauch * changed "#ifdef OS2" to "#ifdef HAVE_OS2_H" in gtkglue.c --- cvs snapshot-2001-06-10 --- 2001-06-10 Petter Reinholdtsen * TODO: Added URL to scanadf. 2001-06-09 Henning Meier-Geinitz * TODO: Added entry about sanei problems and removed entry about filters. 2001-06-09 Oliver Rauch * src/gtkglue.c: gsg_make_path(): colons ":" in dev_name are replaced by "+_" for OS2 --- feature freeze for sane-1.0.5 is active --- --- cvs snapshot-2001-06-05 --- 2001-05-28 Henning Meier-Geinitz * README doc/xcam.man doc/xscanimage.man: Added links to sane(7). * src/xscanimage.c src/xcam.c src/preview.c src/gtkglue.c src/preview.h src/gtkglue.h: Used #include "../include/..." for internal headers. * Makefile.in src/Makefile.in sanei/Makefile.in lib/Makefile.in doc/Makefile.in INSTALL: Added target "make uninstall". 2001-05-27 Petter Reinholdtsen * sanei/sanei_codec_bin.c sanei/sanei_wire.c: Synchronize with sane-backends/sanei/ to avoid linker problems. Correct fix is probably to make libsanei available from sane-backends. 2001-05-06 Henning Meier-Geinitz * configure.in1: Removed. 2001-05-05 Henning Meier-Geinitz * src/xscanimage.c: Fixed problems with old gimp versions. 2001-04-29 Henning Meier-Geinitz * src/Makefile.in: Missing quotation marks seem to cause problems with some shells. 2001-04-28 Henning Meier-Geinitz * TODO: Removed entries about >8bit support for xscanimage, xcam doc strings, and hand-scanner mode in xscanimage. * src/xscanimage.c: Print an error when hand-scanner mode is requested. Don't try to calculate image size in this case. 2001-04-27 Henning Meier-Geinitz * doc/xscanimage.man src/xscanimage.c src/xscanimage-gimp-1_0-compat.h: Implemented (again) support for SANE_DEFAULT_DEVICE. If set, the suitable backend is preselected in the device dialog. Use new Gimp API, added compatibility file for old Gimp API (from xsane). * TODO: Removed entry about SANE_DEFAULT_DEVICE and new Gimp API. 2001-04-22 Henning Meier-Geinitz * INSTALL: Clarified that /usr/local/lib/sane in ld.so.conf is only needed for SANE 1.0.1 and /usr/local/lib for 1.0.2 and later. * NEWS: Made the message shorter. Now the status output of configure should fit onto one screen. Updated Oliver's email address. * src/Makefile.in: Added message if no programs can be installed (usually if gtk wasn't found). 2001-04-11 Henning Meier-Geinitz * doc/xscanimage.man: Added descriptions of the --version and --help options. 2001-04-08 Henning Meier-Geinitz * INSTALL: Only gtk 0.99.13 is needed, not 1.2.0. Some spelling and formatting fixes. 2000-12-23 Henning Meier-Geinitz * aclocal.m4 configure: Fixed some bugs concerning link checks for libsane. * src/xscanimage.c: Use g_free for memory acquired by g_new. * TODO: Removed entries about g_free and ac_local.m4. ************************ Release of sane-frontends 1.0.4 ********************** 2000-12-17 Henning Meier-Geinitz * TODO: Added points about using g_free instead of free and the sane compile/link test problem. ************************** Code freeze for SANE 1.0.4 ************************ 2000-12-10 Henning Meier-Geinitz * doc/xscanimage.man: Fixed some typos and made clear that SANE_DEFAULT_DEVICE doesn't work yet. 2000-12-08 Henning Meier-Geinitz * TODO: Updated. Removed entry about --without-x. * src/xscanimage.c: Fixed bux: When closing "select device" dialog with the window manager xscanimage wasn't exited. ************************* snapshot-2000-12-04 ******************************* 2000-11-30 Oliver Rauch * src/Makefile.in: removed unused variable XSCAN ************************* snapshot-2000-11-28 ******************************* ************************* Feature freeze for SANE 1.0.4 ********************* 2000-11-26 Oliver Rauch * changed configure.in/configure: - removed test for X (AC_PATH_X), the X-Test is done in GTK - added configure optin "--disable-guis", this does not make sense in the moment because there are no non-GUI-progs, but it is planned to include other progs (e.g. scanadf). 2000-11-22 Henning Meier-Geinitz * README: Added link to QuiteInsane. 2000-11-19 Henning Meier-Geinitz * TODO: Removed entry about stiff.* * src/xscanimage.c: Removed support for SANE_DEFAULT_DEVICE. Using only this device without giving the user the ability to change to other devices isn't the intended behaviour. 2000-11-19 Oliver Rauch * xscanimage.c: Suppressed Gimp warning at xscanimage startup 2000-11-19 Oliver Rauch * Removed src/stiff.[ch] and removed SCAN_OBJ=stiff.o from src/Makefile.in 2000-11-18 Henning Meier-Geinitz * src/xscanimage.c: Moved Defines for DBG_* outside the #ifdef HAVE_LIBGIMP_GIMP_H block. 2000-11-16 Henning Meier-Geinitz * TODO: Entries about SANE_DEFAULT_DEVICE and DBG output. * src/xscanimage.c: Added suport for DBG messages. Added only a few messages including a more verbose output when xscanimage can't find any devices. Added support for SANE_DEFAULT_DEVICE. * doc/xscanimage.man: Documented support for SANE_DEFAULT_DEVICE and SANE_DEBUG_XSCANIMAGE. 2000-11-15 Oliver Rauch * changed sanei/Makefile.in: SANE_CFLAGS is used now (for #include ) * changed acloacl.m4: SANE_LDFLAGS is used for sane test 2000-11-14 Henning Meier-Geinitz * TODO: Added entries about stiff.c and libgimp warning in xscanimage. 2000-11-14 Oliver Rauch * changed src/Makefile.in: SANE_LDFLAGS is used now * changed aclocal.m4: removed bug (SANE_LDLAGS=>SANE_LDFLAGS) and updated configure script 2000-11-13 Oliver Rauch * changed configure + configure.in, script aborts now if sane or gtk is not found 2000-11-12 Henning Meier-Geinitz * README: Added information for developers and link to SANE website. * TODO: Updated. * INSTALL: Added link to GIMP website. * src/xcam.c: Application is exited when window is closed (by window manager) 2000-11-12, 2000-11-11 Oliver Rauch * several changes in configure scripts and Makefiles * removed several unnecessary files 2000-11-11 Henning Meier-Geinitz * .cvsignore doc/.cvsignore include/.cvsignore include/sane/.cvsignore lib/.cvsignore sanei/.cvsignore src/.cvsignore: Added .cvsignore files. * COPYING: Added GPL. * TODO: Added from sane-backends. * AUTHORS: Added from sane-backends. * README: New file. * NEWS: Renamed (old name: sane-frontend.NEWS). * INSTALL: Renamed (old name: sane.INSTALL) and some reformating. Added hint to PROBLEMS. Added some point about necessary packages. * PROBLEMS: Renamed (old name: sane.PROBLEMS). 2000-11-10 Oliver Rauch * created own Package for frontends xscanimage and xcam Old entries can be found in file ChangeLog of the package containing the backends of SANE. ./sane-frontends-1.0.14/INSTALL0000644000175000017500000000506610035600024014016 0ustar hmghmgHow to configure, build, and install SANE-FRONTENDS. Quick install: ============== ./configure make make install Type `./configure --help' for a list of options. Prerequisites: - GNU make version 3.70 or later and an ANSI C-Compiler (e.g. gcc) is needed for compilation. It may be necessary to specify the path to GNU make and the compiler by setting the environment variables MAKE and CC before running configure. - You must install the sane-backends package before you can configure this package. If you use pre-compiled binaries (e.g. from your distribution) you will also have to install the SANE headers (maybe in a package called sane-devel or similar). In this case you also need the -devel packages for all the software sane-backends depends on (e.g. libusb). If you're lucky, your distribution took care of that. Otherwise run sane-config --libs and make sure that the -devel packages for all the libraries mentioned in the output are installed. - For xscanimage and xcam you need the X Window libraries and headers. Furthermore GTK version 0.99.13 (or 1.0.*, 1.2.*, 2.0.*) must be installed together with its header files. GTK can be found at http://www.gtk.org/. For some operating systems it's necessary to set the path to gtk-config explicitely. This can be done by using the environment variable GTK_CONFIG. For FreeBSD try `GTK_CONFIG=/usr/X11R6/bin/gtk12-config'. - If you want to use xscanimage as a GIMP plug-in, the GIMP libraries and headers are necessary. See http://www.gimp.org/. See also `man xscanimage'. Versions 1.2.*, and 2.0.* are known to work. - If you get an error message that libsane-dll.so.1 or libsane-so.1 is not found, you have to tell your system where the SANE-libraries are installed. On some systems the library directory `/usr/local/lib' is not searched by the system's dynamic library loader. If SANE is installed in `/usr/local/...' you have to tell your system's dynamic library loader to search in `/usr/local/lib'. For Linux: add the path `/usr/local/lib' to /etc/ld.so.conf and call ldconfig (as root). Another approach is to set the environment variable LD_LIBRARY_PATH (or the equivalent on other operating systems) to `/usr/local/lib'. - OS/2: If you get errors like this one: "xcam.o: Undefined symbol _pthread_write referenced from text segment", libpthread must be linked. Find "gtk-config" on your system and add "-lpthreads" to the list of libraries. Uninstall ========= To uninstall the binaries and manual pages, type `make uninstall'. See also the PROBLEMS and README files. ./sane-frontends-1.0.14/Makefile.in0000644000175000017500000000516310132236323015035 0ustar hmghmgSHELL = /bin/sh VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = . PACKAGE = @PACKAGE@ VERSION = @VERSION@ distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION) 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 sanedatadir = @datadir@/sane MKDIR = $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ @SET_MAKE@ SUBDIRS = include lib sanei src doc DISTFILES = AUTHORS COPYING Changelog INSTALL Makefile.in NEWS PROBLEMS \ README acinclude.m4 aclocal.m4 config.guess config.sub configure \ configure.in install-sh mkinstalldirs sane-frontends.lsm \ xscanimage-icon-48x48-2.png .PHONY: all all-recursive clean clean-recursive depend \ depend-recursive dist install install-recursive lsm sane-frontends \ uninstall uninstall-recursive all: all-recursive $(PACKAGE)-$(VERSION).lsm: $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).lsm ( cat $(PACKAGE).lsm | \ sed -e "s|_DATE_|`date +%d%b%y`|g" \ -e "s|_VERSION_|$(VERSION)|g" \ -e "s|_T_S_|`find $(PACKAGE)-$(VERSION).tar.gz -printf \"%3k\"`|g"\ -e "s|_L_S_|`find $(PACKAGE).lsm -printf "%3k"`|g" > \ $(PACKAGE)-$(VERSION).lsm \ ) lsm: $(PACKAGE)-$(VERSION).lsm dist install: install-recursive uninstall: uninstall-recursive clean: clean-recursive distclean: clean distclean-recursive rm -f *~ *.log *.bak libtool *.tar.gz rm -f Makefile config.cache config.status rm -f intl/Makefile rm -f $(distdir).tar.gz.md5 rm -f sane-frontends-*.lsm rm -rf autom4te.cache depend: depend-recursive all-recursive install-recursive uninstall-recursive clean-recursive \ distclean-recursive depend-recursive: @for subdir in $(SUBDIRS); do \ target=`echo $@ | sed s/-recursive//`; \ echo making $$target in $$subdir; \ (cd $$subdir && $(MAKE) $$target) \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" dist: $(DISTFILES) rm -fr $(distdir) $(MKDIR) $(distdir) for file in $(DISTFILES); do \ ln $$file $(distdir) 2>/dev/null || cp -p $$file $(distdir); \ done for subdir in $(SUBDIRS) ; do \ mkdir $(distdir)/$$subdir || exit 1; \ (cd $$subdir && $(MAKE) $@) || exit 1; \ done tar chzf $(distdir).tar.gz $(distdir) rm -fr $(distdir) md5: dist md5sum $(distdir).tar.gz > $(distdir).tar.gz.md5 $(PACKAGE)-$(VERSION).tar.gz: dist sane-frontends: dist lsm md5 ./sane-frontends-1.0.14/NEWS0000644000175000017500000000037207424557633013510 0ustar hmghmg-*-Mode: outline-*- New with 1.0.7, released 2002-02-04: * New frontend: scanadf (command line frontend focussing on scanners with automatic document feeders). * Updated frontends: xscanimage * Documentation updates. * Build fixes. * Bugfixes. ./sane-frontends-1.0.14/PROBLEMS0000644000175000017500000000077007453547565014166 0ustar hmghmg- xscanimage/xcam crashes X server on Linux/Alpha Older versions of the TGA X server (such as version 3.1.2) are known to fail when creating shared images of certain sizes. This can be avoided by invoking xscanimage and xcam with option --no-shm. - In three-pass mode, the progress indicator is not updated correctly. This just menas that scanning is faster than the disk can handle. It happens especially in three-pass mode because much seeking is going on in this mode. ./sane-frontends-1.0.14/README0000644000175000017500000000234007734337474013671 0ustar hmghmgThis is the sane-frontends package. To find out more about SANE (Scanner Access Now Easy) look at the SANE website: http://www.sane-project.org/. There is also information on how to subscribe the SANE mailing list (sane-devel). These SANE applications (frontends) are included in this package (together with their documentation): Frontend Documentation (man page) -------------------------------------------------------------------------- xscanimage xscanimage(1) xcam xcam(1) scanadf scanadf(1) For general information about SANE, read man sane(7). You must install the sane-backends package before you can compile the frontends. sane-backends also includes the command-line frontend scanimage and the network daemon saned. For details about installation please read the INSTALL file. For a list of other SANE frontends look at http://www.sane-project.org//sane-frontends.html. Developers may wish to look at the SANE standard (sane.tex). It can be found in the sane-backends distribution or in various file formats at the website: http://www.sane-project.org/docs.html Please report bugs and missing features at our bug-tracking system: http://www.sane-project.org/bugs.html ./sane-frontends-1.0.14/acinclude.m40000644000175000017500000005775310050463321015174 0ustar hmghmg# acinclude.m4 for sane-frontends # AM_PATH_GTK # AM_PATH_GIMP # AM_PATH_SANE ###################################################################### # Configure paths for GTK+ # Owen Taylor 97-11-3 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS dnl AC_DEFUN(AM_PATH_GTK, [dnl dnl Get the cflags and libraries from the gtk-config script dnl AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], gtk_config_prefix="$withval", gtk_config_prefix="") AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], , enable_gtktest=yes) if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi AC_PATH_PROG(GTK_CONFIG, gtk-config, no) min_gtk_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" dnl dnl Now check if the installed GTK is sufficiently new. (Also sanity dnl checks the results of gtk-config to some extent dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include int main () { int major, minor, micro; system ("touch conf.gtktest"); if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); printf("*** correct copy of gtk-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GTK_CONFIG environment variable to the" echo "*** full path to gtk-config." else if test -f conf.gtktest ; then : else echo "*** Could not run GTK test program, checking why..." CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) ###################################################################### # Configure paths for The GIMP # Oliver Rauch 2000-12-28 dnl AM_PATH_GIMP([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS dnl AC_DEFUN(AM_PATH_GIMP, [dnl dnl Get the cflags and libraries from the gimp-config script dnl AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)], gimp_config_prefix="$withval", gimp_config_prefix="") AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)], gimp_config_exec_prefix="$withval", gimp_config_exec_prefix="") AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run a test GIMP program], , enable_gimptest=yes) ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" ac_save_GTK_CFLAGS="$GTK_CFLAGS" ac_save_GTK_LIBS="$GTK_LIBS" if test x$gimp_config_exec_prefix != x ; then gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" if test x${GIMP_CONFIG+set} != xset ; then GIMP_CONFIG=$gimp_config_exec_prefix/bin/gimp-config fi fi if test x$gimp_config_prefix != x ; then gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" if test x${GIMP_CONFIG+set} != xset ; then GIMP_CONFIG=$gimp_config_prefix/bin/gimp-config fi fi AC_PATH_PROG(GIMP_CONFIG, gimp-config, no) if test "$GIMP_CONFIG" = "no" ; then if test x$gimp_config_exec_prefix != x ; then gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" if test x${GIMP_TOOL+set} != xset ; then GIMP_TOOL=$gimp_config_exec_prefix/bin/gimptool fi fi if test x$gimp_config_prefix != x ; then gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" if test x${GIMP_TOOL+set} != xset ; then GIMP_TOOL=$gimp_config_prefix/bin/gimptool fi fi AC_PATH_PROG(GIMP_TOOL, gimptool, no) GIMP_CONFIG=$GIMP_TOOL fi min_gimp_version=ifelse([$1], ,1.0.0,$1) no_gimp="" if test "$GIMP_CONFIG" = "no" ; then dnl we do not have gimp-config (gimp-1.0.x does not have gimp-config) dnl so we have to use the GTK_* things for testing for gimp.h and gimpfeatures.h ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" AC_CHECK_HEADERS(libgimp/gimp.h, GIMP_LIBS="-lgimp", no_gimp=yes) AC_CHECK_HEADERS(libgimp/gimpfeatures.h) CPPFLAGS="$ac_save_CPPFLAGS" CFLAGS="${CFLAGS} ${GTK_CFLAGS}" LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" if test "x$no_gimp" = x ; then AC_MSG_CHECKING(GIMP compilation) gimp_config_major_version=-1 gimp_config_minor_version=0 gimp_config_micro_version=0 fi else dnl Ok, we have gimp-config and so we do not need the GTK_* things because they are dnl included in the output of gimp-config # GTK_CFLAGS="" # GTK_LIBS="" GIMP_CFLAGS=`$GIMP_CONFIG $gimp_config_args --cflags` GIMP_LIBS=`$GIMP_CONFIG $gimp_config_args --libs`" -lgimp" gimp_config_major_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gimp_config_minor_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gimp_config_micro_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` CFLAGS="${CFLAGS} ${GIMP_CFLAGS}" LIBS="${LIBS} ${GIMP_LIBS}" AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version) fi dnl dnl Now check if the installed GIMP is sufficiently new. (Also sanity dnl checks the results of gimp-config to some extent dnl if test "x$no_gimp" = x ; then if test "x$enable_gimptest" = "xyes" ; then rm -f conf.gimptest AC_TRY_RUN([ #include #include #define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ ($gimp_config_major_version > (major) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ $gimp_config_micro_version >= (micro))) #if !GIMP_TEST_CHECK_VERSION(1,1,25) # define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ #endif GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; int main () { int major, minor, micro; system ("touch conf.gimptest"); if (sscanf("$min_gimp_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gimp_version"); exit(1); } if ( ($gimp_config_major_version != -1) && ((gimp_major_version != $gimp_config_major_version) || (gimp_minor_version != $gimp_config_minor_version) || (gimp_micro_version != $gimp_config_micro_version)) ) { printf("\n*** 'gimp-config --version' returned %d.%d.%d, but GIMP (%d.%d.%d)\n", $gimp_config_major_version, $gimp_config_minor_version, $gimp_config_micro_version, gimp_major_version, gimp_minor_version, gimp_micro_version); printf ("*** was found! If gimp-config was correct, then it is best\n"); printf ("*** to remove the old version of GIMP. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gimp-config was wrong, set the environment variable GIMP_CONFIG\n"); printf("*** to point to the correct copy of gimp-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else { if ((gimp_major_version > major) || ((gimp_major_version == major) && (gimp_minor_version > minor)) || ((gimp_major_version == major) && (gimp_minor_version == minor) && (gimp_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GIMP (%d.%d.%d) was found.\n", gimp_major_version, gimp_minor_version, gimp_micro_version); printf("*** You need a version of GIMP newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GIMP is always available from ftp://ftp.gimp.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gimp-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GIMP, but you can also set the GIMP_CONFIG environment to point to the\n"); printf("*** correct copy of gimp-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ], , no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) fi fi if test "x$no_gimp" = x ; then dnl gimp test succeeded or not tested if test "x$enable_gimptest" = "xyes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(not tested) fi if test "$GIMP_CONFIG" != "no" ; then ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CPPFLAGS} ${GIMP_CFLAGS}" AC_CHECK_HEADERS(libgimp/gimp.h) AC_CHECK_HEADERS(libgimp/gimpfeatures.h) CPPFLAGS="$ac_save_CPPFLAGS" fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test -f conf.gimptest ; then : else echo "*** Could not run GIMP test program, checking why..." CFLAGS="$CFLAGS $GIMP_CFLAGS" LIBS="$LIBS $GIMP_LIBS" AC_TRY_LINK([ #include #include #define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ ($gimp_config_major_version > (major) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ $gimp_config_micro_version >= (micro))) #if !GIMP_TEST_CHECK_VERSION(1,1,25) # define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ #endif GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; ], [ return ((gimp_major_version) || (gimp_minor_version) || (gimp_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GIMP or finding the wrong" echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "***" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi dnl ok, gimp does not work, so we have to use the gtk_* things again GIMP_CFLAGS="" GIMP_LIBS="" # GTK_CFLAGS="$ac_save_GTK_CFLAGS" # GTK_LIBS="$ac_save_GTK_LIBS" # CFLAGS="${CFLAGS} ${GTK_CFLAGS}" # LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" ifelse([$3], , :, [$3]) fi AC_SUBST(GIMP_CFLAGS) AC_SUBST(GIMP_LIBS) rm -f conf.gimptest ]) # ******************************************************************** # Configure paths for SANE # Oliver Rauch 2000-10-30 dnl AM_PATH_SANE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SANE, and define SANE_CFLAGS and SANE_LIBS dnl AC_DEFUN(AM_PATH_SANE, [dnl dnl Get the cflags and libraries from the sane-config script dnl AC_ARG_WITH(sane-prefix,[ --with-sane-prefix=PFX Prefix where SANE is installed (optional)], sane_config_prefix="$withval", sane_config_prefix="") AC_ARG_WITH(sane-exec-prefix,[ --with-sane-exec-prefix=PFX Exec prefix where SANE is installed (optional)], sane_config_exec_prefix="$withval", sane_config_exec_prefix="") AC_ARG_ENABLE(sanetest, [ --disable-sanetest Do not try to compile and run a test SANE program], , enable_sanetest=yes) if test x$sane_config_exec_prefix != x ; then sane_config_args="$sane_config_args --exec-prefix=$sane_config_exec_prefix" if test x${SANE_CONFIG+set} != xset ; then SANE_CONFIG=$sane_config_exec_prefix/bin/sane-config fi fi if test x$sane_config_prefix != x ; then sane_config_args="$sane_config_args --prefix=$sane_config_prefix" if test x${SANE_CONFIG+set} != xset ; then SANE_CONFIG=$sane_config_prefix/bin/sane-config fi fi AC_PATH_PROG(SANE_CONFIG, sane-config, no) min_sane_version=ifelse([$1], ,1.0.0,$1) AC_MSG_CHECKING(for SANE - version >= $min_sane_version) no_sane="" if test "$SANE_CONFIG" = "no" ; then no_sane=yes else SANE_CFLAGS=`$SANE_CONFIG $sane_config_args --cflags` SANE_LDFLAGS=`$SANE_CONFIG $sane_config_args --ldflags` # SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs` SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs | sed -e 's/-lintl//g'` SANE_PREFIX=`$SANE_CONFIG $sane_config_args --prefix` sane_config_major_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` sane_config_minor_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` sane_config_micro_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sanetest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LDFLAGS="$LDFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SANE_CFLAGS" LDFLAGS="$LDFLAGS $SANE_LDFLAGS" LIBS="$LIBS $SANE_LIBS" dnl dnl Now check if the installed SANE is sufficiently new. (Also sanity dnl checks the results of sane-config to some extent dnl rm -f conf.sanetest AC_TRY_RUN([ #include #include int main () { int major, minor, micro; system ("touch conf.sanetest"); if (sscanf("$min_sane_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sane_version"); exit(1); } if ( ($sane_config_major_version == major) && ( ($sane_config_minor_version > minor) || ( ($sane_config_minor_version == minor) && ($sane_config_micro_version >= micro)))) { return 0; } else if ($sane_config_major_version > major) { printf("\n*** A too new version of SANE (%d.%d.%d) was found.\n", $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); printf("*** You need a version of SANE with the major version number %d.\n", major); } else { printf("\n*** An old version of SANE (%d.%d.%d) was found.\n", $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); printf("*** You need a version of SANE newer than %d.%d.%d. The latest version of\n", major, minor, micro); } printf("*** SANE is always available from http://www.sane-project.org\n"); printf("***\n"); printf("*** If you have already installed a sufficient version, this error\n"); printf("*** probably means that the wrong copy of the sane-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of SANE, but you can also set the SANE_CONFIG environment to point to the\n"); printf("*** correct copy of sane-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); return 1; } ],, no_sane=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sane" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$SANE_CONFIG" = "no" ; then echo "*** The sane-config script installed by SANE could not be found" echo "*** If SANE was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SANE_CONFIG environment variable to the" echo "*** full path to sane-config." else if test -f conf.sanetest ; then : else echo "*** Could not run SANE test program, checking why..." CFLAGS="$CFLAGS $SANE_CFLAGS" LIBS="$LIBS $SANE_LIBS" LDFLAGS="$LDFLAGS $SANE_LDFLAGS" AC_TRY_LINK([ #include #include ], [ return (SANE_CURRENT_MAJOR); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SANE or finding the wrong" echo "*** version of SANE. If it is not finding SANE, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SANE was incorrectly installed" echo "*** or that you have moved SANE since it was installed. In the latter case, you" echo "*** may want to edit the sane-config script: $SANE_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" fi fi SANE_CFLAGS="" SANE_LDFLAGS="" SANE_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(SANE_LDFLAGS) AC_SUBST(SANE_CFLAGS) AC_SUBST(SANE_LIBS) AC_SUBST(SANE_PREFIX) rm -f conf.sanetest ]) # ******************************************************************** ./sane-frontends-1.0.14/aclocal.m40000644000175000017500000012027210313252116014626 0ustar hmghmgdnl aclocal.m4 generated automatically by aclocal 1.4-p4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # acinclude.m4 for sane-frontends # AM_PATH_GTK # AM_PATH_GIMP # AM_PATH_SANE # Configure paths for GTK+ # Owen Taylor 97-11-3 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS dnl AC_DEFUN(AM_PATH_GTK, [dnl dnl Get the cflags and libraries from the gtk-config script dnl AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], gtk_config_prefix="$withval", gtk_config_prefix="") AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], , enable_gtktest=yes) if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi AC_PATH_PROG(GTK_CONFIG, gtk-config, no) min_gtk_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" dnl dnl Now check if the installed GTK is sufficiently new. (Also sanity dnl checks the results of gtk-config to some extent dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include int main () { int major, minor, micro; system ("touch conf.gtktest"); if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); printf("*** correct copy of gtk-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GTK_CONFIG environment variable to the" echo "*** full path to gtk-config." else if test -f conf.gtktest ; then : else echo "*** Could not run GTK test program, checking why..." CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) # Configure paths for The GIMP # Oliver Rauch 2000-12-28 dnl AM_PATH_GIMP([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS dnl AC_DEFUN(AM_PATH_GIMP, [dnl dnl Get the cflags and libraries from the gimp-config script dnl AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)], gimp_config_prefix="$withval", gimp_config_prefix="") AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)], gimp_config_exec_prefix="$withval", gimp_config_exec_prefix="") AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run a test GIMP program], , enable_gimptest=yes) ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" ac_save_GTK_CFLAGS="$GTK_CFLAGS" ac_save_GTK_LIBS="$GTK_LIBS" if test x$gimp_config_exec_prefix != x ; then gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" if test x${GIMP_CONFIG+set} != xset ; then GIMP_CONFIG=$gimp_config_exec_prefix/bin/gimp-config fi fi if test x$gimp_config_prefix != x ; then gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" if test x${GIMP_CONFIG+set} != xset ; then GIMP_CONFIG=$gimp_config_prefix/bin/gimp-config fi fi AC_PATH_PROG(GIMP_CONFIG, gimp-config, no) if test "$GIMP_CONFIG" = "no" ; then if test x$gimp_config_exec_prefix != x ; then gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" if test x${GIMP_TOOL+set} != xset ; then GIMP_TOOL=$gimp_config_exec_prefix/bin/gimptool fi fi if test x$gimp_config_prefix != x ; then gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" if test x${GIMP_TOOL+set} != xset ; then GIMP_TOOL=$gimp_config_prefix/bin/gimptool fi fi AC_PATH_PROG(GIMP_TOOL, gimptool, no) GIMP_CONFIG=$GIMP_TOOL fi min_gimp_version=ifelse([$1], ,1.0.0,$1) no_gimp="" if test "$GIMP_CONFIG" = "no" ; then dnl we do not have gimp-config (gimp-1.0.x does not have gimp-config) dnl so we have to use the GTK_* things for testing for gimp.h and gimpfeatures.h ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" AC_CHECK_HEADERS(libgimp/gimp.h, GIMP_LIBS="-lgimp", no_gimp=yes) AC_CHECK_HEADERS(libgimp/gimpfeatures.h) CPPFLAGS="$ac_save_CPPFLAGS" CFLAGS="${CFLAGS} ${GTK_CFLAGS}" LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" if test "x$no_gimp" = x ; then AC_MSG_CHECKING(GIMP compilation) gimp_config_major_version=-1 gimp_config_minor_version=0 gimp_config_micro_version=0 fi else dnl Ok, we have gimp-config and so we do not need the GTK_* things because they are dnl included in the output of gimp-config # GTK_CFLAGS="" # GTK_LIBS="" GIMP_CFLAGS=`$GIMP_CONFIG $gimp_config_args --cflags` GIMP_LIBS=`$GIMP_CONFIG $gimp_config_args --libs`" -lgimp" gimp_config_major_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gimp_config_minor_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gimp_config_micro_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` CFLAGS="${CFLAGS} ${GIMP_CFLAGS}" LIBS="${LIBS} ${GIMP_LIBS}" AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version) fi dnl dnl Now check if the installed GIMP is sufficiently new. (Also sanity dnl checks the results of gimp-config to some extent dnl if test "x$no_gimp" = x ; then if test "x$enable_gimptest" = "xyes" ; then rm -f conf.gimptest AC_TRY_RUN([ #include #include #define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ ($gimp_config_major_version > (major) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ $gimp_config_micro_version >= (micro))) #if !GIMP_TEST_CHECK_VERSION(1,1,25) # define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ #endif GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; int main () { int major, minor, micro; system ("touch conf.gimptest"); if (sscanf("$min_gimp_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gimp_version"); exit(1); } if ( ($gimp_config_major_version != -1) && ((gimp_major_version != $gimp_config_major_version) || (gimp_minor_version != $gimp_config_minor_version) || (gimp_micro_version != $gimp_config_micro_version)) ) { printf("\n*** 'gimp-config --version' returned %d.%d.%d, but GIMP (%d.%d.%d)\n", $gimp_config_major_version, $gimp_config_minor_version, $gimp_config_micro_version, gimp_major_version, gimp_minor_version, gimp_micro_version); printf ("*** was found! If gimp-config was correct, then it is best\n"); printf ("*** to remove the old version of GIMP. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gimp-config was wrong, set the environment variable GIMP_CONFIG\n"); printf("*** to point to the correct copy of gimp-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else { if ((gimp_major_version > major) || ((gimp_major_version == major) && (gimp_minor_version > minor)) || ((gimp_major_version == major) && (gimp_minor_version == minor) && (gimp_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GIMP (%d.%d.%d) was found.\n", gimp_major_version, gimp_minor_version, gimp_micro_version); printf("*** You need a version of GIMP newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GIMP is always available from ftp://ftp.gimp.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gimp-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GIMP, but you can also set the GIMP_CONFIG environment to point to the\n"); printf("*** correct copy of gimp-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ], , no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) fi fi if test "x$no_gimp" = x ; then dnl gimp test succeeded or not tested if test "x$enable_gimptest" = "xyes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(not tested) fi if test "$GIMP_CONFIG" != "no" ; then ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CPPFLAGS} ${GIMP_CFLAGS}" AC_CHECK_HEADERS(libgimp/gimp.h) AC_CHECK_HEADERS(libgimp/gimpfeatures.h) CPPFLAGS="$ac_save_CPPFLAGS" fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test -f conf.gimptest ; then : else echo "*** Could not run GIMP test program, checking why..." CFLAGS="$CFLAGS $GIMP_CFLAGS" LIBS="$LIBS $GIMP_LIBS" AC_TRY_LINK([ #include #include #define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ ($gimp_config_major_version > (major) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ $gimp_config_micro_version >= (micro))) #if !GIMP_TEST_CHECK_VERSION(1,1,25) # define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ #endif GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; ], [ return ((gimp_major_version) || (gimp_minor_version) || (gimp_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GIMP or finding the wrong" echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "***" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi dnl ok, gimp does not work, so we have to use the gtk_* things again GIMP_CFLAGS="" GIMP_LIBS="" # GTK_CFLAGS="$ac_save_GTK_CFLAGS" # GTK_LIBS="$ac_save_GTK_LIBS" # CFLAGS="${CFLAGS} ${GTK_CFLAGS}" # LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" ifelse([$3], , :, [$3]) fi AC_SUBST(GIMP_CFLAGS) AC_SUBST(GIMP_LIBS) rm -f conf.gimptest ]) # ******************************************************************** # Configure paths for SANE # Oliver Rauch 2000-10-30 dnl AM_PATH_SANE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SANE, and define SANE_CFLAGS and SANE_LIBS dnl AC_DEFUN(AM_PATH_SANE, [dnl dnl Get the cflags and libraries from the sane-config script dnl AC_ARG_WITH(sane-prefix,[ --with-sane-prefix=PFX Prefix where SANE is installed (optional)], sane_config_prefix="$withval", sane_config_prefix="") AC_ARG_WITH(sane-exec-prefix,[ --with-sane-exec-prefix=PFX Exec prefix where SANE is installed (optional)], sane_config_exec_prefix="$withval", sane_config_exec_prefix="") AC_ARG_ENABLE(sanetest, [ --disable-sanetest Do not try to compile and run a test SANE program], , enable_sanetest=yes) if test x$sane_config_exec_prefix != x ; then sane_config_args="$sane_config_args --exec-prefix=$sane_config_exec_prefix" if test x${SANE_CONFIG+set} != xset ; then SANE_CONFIG=$sane_config_exec_prefix/bin/sane-config fi fi if test x$sane_config_prefix != x ; then sane_config_args="$sane_config_args --prefix=$sane_config_prefix" if test x${SANE_CONFIG+set} != xset ; then SANE_CONFIG=$sane_config_prefix/bin/sane-config fi fi AC_PATH_PROG(SANE_CONFIG, sane-config, no) min_sane_version=ifelse([$1], ,1.0.0,$1) AC_MSG_CHECKING(for SANE - version >= $min_sane_version) no_sane="" if test "$SANE_CONFIG" = "no" ; then no_sane=yes else SANE_CFLAGS=`$SANE_CONFIG $sane_config_args --cflags` SANE_LDFLAGS=`$SANE_CONFIG $sane_config_args --ldflags` # SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs` SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs | sed -e 's/-lintl//g'` SANE_PREFIX=`$SANE_CONFIG $sane_config_args --prefix` sane_config_major_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` sane_config_minor_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` sane_config_micro_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sanetest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LDFLAGS="$LDFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SANE_CFLAGS" LDFLAGS="$LDFLAGS $SANE_LDFLAGS" LIBS="$LIBS $SANE_LIBS" dnl dnl Now check if the installed SANE is sufficiently new. (Also sanity dnl checks the results of sane-config to some extent dnl rm -f conf.sanetest AC_TRY_RUN([ #include #include int main () { int major, minor, micro; system ("touch conf.sanetest"); if (sscanf("$min_sane_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sane_version"); exit(1); } if ( ($sane_config_major_version == major) && ( ($sane_config_minor_version > minor) || ( ($sane_config_minor_version == minor) && ($sane_config_micro_version >= micro)))) { return 0; } else if ($sane_config_major_version > major) { printf("\n*** A too new version of SANE (%d.%d.%d) was found.\n", $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); printf("*** You need a version of SANE with the major version number %d.\n", major); } else { printf("\n*** An old version of SANE (%d.%d.%d) was found.\n", $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); printf("*** You need a version of SANE newer than %d.%d.%d. The latest version of\n", major, minor, micro); } printf("*** SANE is always available from http://www.sane-project.org\n"); printf("***\n"); printf("*** If you have already installed a sufficient version, this error\n"); printf("*** probably means that the wrong copy of the sane-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of SANE, but you can also set the SANE_CONFIG environment to point to the\n"); printf("*** correct copy of sane-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); return 1; } ],, no_sane=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sane" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$SANE_CONFIG" = "no" ; then echo "*** The sane-config script installed by SANE could not be found" echo "*** If SANE was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SANE_CONFIG environment variable to the" echo "*** full path to sane-config." else if test -f conf.sanetest ; then : else echo "*** Could not run SANE test program, checking why..." CFLAGS="$CFLAGS $SANE_CFLAGS" LIBS="$LIBS $SANE_LIBS" LDFLAGS="$LDFLAGS $SANE_LDFLAGS" AC_TRY_LINK([ #include #include ], [ return (SANE_CURRENT_MAJOR); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SANE or finding the wrong" echo "*** version of SANE. If it is not finding SANE, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SANE was incorrectly installed" echo "*** or that you have moved SANE since it was installed. In the latter case, you" echo "*** may want to edit the sane-config script: $SANE_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" fi fi SANE_CFLAGS="" SANE_LDFLAGS="" SANE_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(SANE_LDFLAGS) AC_SUBST(SANE_CFLAGS) AC_SUBST(SANE_LIBS) AC_SUBST(SANE_PREFIX) rm -f conf.sanetest ]) # ******************************************************************** # serial 1 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC # If the C compiler in not in ANSI C mode by default, try to add an option # to output variable @code{CC} to make it so. This macro tries various # options that select ANSI C on some system or another. It considers the # compiler to be in ANSI C mode if it handles function prototypes correctly. # # If you use this macro, you should check after calling it whether the C # compiler has been set to accept ANSI C; if not, the shell variable # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source # code in ANSI C, you can make an un-ANSIfied copy of it by using the # program @code{ansi2knr}, which comes with Ghostscript. # @end defmac AC_DEFUN(AM_PROG_CC_STDC, [AC_REQUIRE([AC_PROG_CC]) AC_BEFORE([$0], [AC_C_INLINE]) AC_BEFORE([$0], [AC_C_CONST]) dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require dnl a magic option to avoid problems with ANSI preprocessor commands dnl like #elif. dnl FIXME: can't do this because then AC_AIX won't work due to a dnl circular dependency. dnl AC_BEFORE([$0], [AC_PROG_CPP]) AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) AC_CACHE_VAL(am_cv_prog_cc_stdc, [am_cv_prog_cc_stdc=no ac_save_CC="$CC" # 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 -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" AC_TRY_COMPILE( [#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; ], [ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ], [am_cv_prog_cc_stdc="$ac_arg"; break]) done CC="$ac_save_CC" ]) if test -z "$am_cv_prog_cc_stdc"; then AC_MSG_RESULT([none needed]) else AC_MSG_RESULT($am_cv_prog_cc_stdc) fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac ]) # Configure paths for GTK+ # Owen Taylor 1997-2001 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, dnl pass to pkg-config dnl AC_DEFUN(AM_PATH_GTK_2_0, [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) pkg_config_args=gtk+-2.0 for module in . $4 do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo *** pkg-config too old; version 0.7 or better required. no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl dnl Now check if the installed GTK+ is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) # Configure paths for GIMP-2.0 # Manish Singh, Sven Neumann # Large parts shamelessly stolen from Owen Taylor dnl AM_PATH_GIMP_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS dnl AC_DEFUN([AM_PATH_GIMP_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gimptest, [ --disable-gimptest do not try to compile and run a test GIMP program],, enable_gimptest=yes) pkg_name=gimp-2.0 pkg_config_args="$pkg_name gimpui-2.0" no_gimp="" AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo *** pkg-config too old; version 0.7 or better required. no_gimp=yes PKG_CONFIG=no fi else no_gimp=yes fi min_gimp_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GIMP found in PKG_CONFIG_PATH" enable_gimptest=no fi if $PKG_CONFIG --atleast-version $min_gimp_version $pkg_config_args; then : else no_gimp=yes fi fi if test x"$no_gimp" = x ; then GIMP_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GIMP_LIBS=`$PKG_CONFIG $pkg_config_args --libs` GIMP_CFLAGS_NOUI=`$PKG_CONFIG $pkg_name --cflags` GIMP_LIBS_NOUI=`$PKG_CONFIG $pkg_name --libs` GIMP_DATA_DIR=`$PKG_CONFIG $pkg_name --variable=gimpdatadir` GIMP_PLUGIN_DIR=`$PKG_CONFIG $pkg_name --variable=gimplibdir` gimp_pkg_major_version=`$PKG_CONFIG --modversion $pkg_name | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gimp_pkg_minor_version=`$PKG_CONFIG --modversion $pkg_name | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gimp_pkg_micro_version=`$PKG_CONFIG --modversion $pkg_name | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gimptest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GIMP_CFLAGS" LIBS="$GIMP_LIBS $LIBS" dnl dnl Now check if the installed GIMP is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent dnl rm -f conf.gimptest AC_TRY_RUN([ #include #include #include GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ NULL, /* query_proc */ NULL /* run_proc */ }; int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gimptest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gimp_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gimp_version"); exit(1); } if (($gimp_pkg_major_version > major) || (($gimp_pkg_major_version == major) && ($gimp_pkg_minor_version > minor)) || (($gimp_pkg_major_version == major) && ($gimp_pkg_minor_version == minor) && ($gimp_pkg_micro_version >= micro))) { return 0; } else { printf("\n*** 'pkg-config --modversion %s' returned %d.%d.%d, but the minimum version\n", "$pkg_name", $gimp_pkg_major_version, $gimp_pkg_minor_version, $gimp_pkg_micro_version); printf("*** of GIMP required is %d.%d.%d. If pkg-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct the correct configuration files\n"); return 1; } } ],, no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gimp" = x ; then AC_MSG_RESULT(yes (version $gimp_pkg_major_version.$gimp_pkg_minor_version.$gimp_pkg_micro_version)) ifelse([$2], , :, [$2]) else if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.gimptest ; then : else echo "*** Could not run GIMP test program, checking why..." CFLAGS="$CFLAGS $GIMP_CFLAGS" LIBS="$LIBS $GIMP_LIBS" AC_TRY_LINK([ #include #include GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ NULL, /* query_proc */ NULL /* run_proc */ }; ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GIMP or finding the wrong" echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GIMP is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GIMP_CFLAGS="" GIMP_LIBS="" GIMP_CFLAGS_NOUI="" GIMP_LIBS_NOUI="" ifelse([$3], , :, [$3]) fi AC_SUBST(GIMP_CFLAGS) AC_SUBST(GIMP_LIBS) AC_SUBST(GIMP_CFLAGS_NOUI) AC_SUBST(GIMP_LIBS_NOUI) AC_SUBST(GIMP_DATA_DIR) AC_SUBST(GIMP_PLUGIN_DIR) rm -f conf.gimptest ]) ./sane-frontends-1.0.14/config.guess0000755000175000017500000012401310035600300015274 0ustar hmghmg#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-01-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pegasos:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/KFreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ./sane-frontends-1.0.14/config.sub0000755000175000017500000007431510035600305014755 0ustar hmghmg#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-01-05' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ./sane-frontends-1.0.14/configure0000755000175000017500000112167210313252002014675 0ustar hmghmg#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="include/sane/config.h.in" # 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" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION SANE_MAJOR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE build build_cpu build_vendor build_os host host_cpu host_vendor host_os ALLOCA RANLIB ac_ct_RANLIB SANE_CONFIG SANE_LDFLAGS SANE_CFLAGS SANE_LIBS SANE_PREFIX PKG_CONFIG GTK_CFLAGS GTK_LIBS GTK_CONFIG GIMP_CONFIG GIMP_TOOL GIMP_CFLAGS GIMP_LIBS GIMP_CFLAGS_NOUI GIMP_LIBS_NOUI GIMP_DATA_DIR GIMP_PLUGIN_DIR INCLUDES BINPROGS V_MAJOR V_MINOR V_BUILD DLL_PRELOAD LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-guis do not compile graphical user interfaces (GUIs) --disable-gtk2 do not use GTK2 --disable-gimp do not include GIMP plugin mode --enable-gimp12 include GIMP 1.2 plugin mode (this enables GIMP =< 1.2 plugin, defaults to GIMP 2.0) --disable-sanetest Do not try to compile and run a test SANE program --disable-gtktest do not try to compile and run a test GTK+ program --disable-gtktest Do not try to compile and run a test GTK program --disable-gimptest Do not try to compile and run a test GIMP program --disable-gimptest do not try to compile and run a test GIMP program Used environment variables that can be set by user: CFLAGS, CPPFLAGS, LDFLAGS, LIBS To add include or library paths call: env CPPFLAGS=\"-I/path/to/foo/include\" LDFLAGS=\"-L/path/to/foo/libs\" ./configure Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-sane-prefix=PFX Prefix where SANE is installed (optional) --with-sane-exec-prefix=PFX Exec prefix where SANE is installed (optional) --with-gtk-prefix=PFX Prefix where GTK is installed (optional) --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional) --with-gimp-prefix=PFX Prefix where GIMP is installed (optional) --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional) 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 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 # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers include/sane/config.h" # AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required. # AC_ARG_PROGRAM # version code: V_MAJOR=1 V_MINOR=0 V_BUILD=14 V_EXTRA= PACKAGE=sane-frontends GUIPROGS="xscanimage xcam" BINPROGS="scanadf" # languages # ALL_LINGUAS="cs de fr sv it tr" SANE_V_MAJOR=1 VERSION=${V_MAJOR}.${V_MINOR}.${V_BUILD}${V_EXTRA} PACKAGE_VERSION="$PACKAGE-$VERSION" cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF # Check whether --enable-guis or --disable-guis was given. if test "${enable_guis+set}" = set; then enableval="$enable_guis" USE_GUI=$enableval else USE_GUI=yes fi; # Check whether --enable-gtk2 or --disable-gtk2 was given. if test "${enable_gtk2+set}" = set; then enableval="$enable_gtk2" USE_GTK2=$enableval else USE_GTK2=yes fi; echo "$as_me:$LINENO: checking whether GIMP plugin is requested" >&5 echo $ECHO_N "checking whether GIMP plugin is requested... $ECHO_C" >&6 # Check whether --enable-gimp or --disable-gimp was given. if test "${enable_gimp+set}" = set; then enableval="$enable_gimp" USE_GIMP=$enableval else USE_GIMP=yes fi; # Check whether --enable-gimp12 or --disable-gimp12 was given. if test "${enable_gimp12+set}" = set; then enableval="$enable_gimp12" USE_GIMP12=$enableval else USE_GIMP12="no" fi; if test "${USE_GIMP12}" = "yes"; then echo "$as_me:$LINENO: result: yes, GIMP 1.2" >&5 echo "${ECHO_T}yes, GIMP 1.2" >&6 USE_GIMP="no" USE_GTK2="no" else echo "$as_me:$LINENO: result: $USE_GIMP, GIMP 2.0" >&5 echo "${ECHO_T}$USE_GIMP, GIMP 2.0" >&6 fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_minix_config_h+set}" = set; then echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking minix/config.h usability" >&5 echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking minix/config.h presence" >&5 echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 fi if test $ac_cv_header_minix_config_h = yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_strerror="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_strerror" = no; then for ac_lib in cposix; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_strerror="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6 if test "$ac_cv_search_strerror" != no; then test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &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_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ${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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi INCLUDES="${INCLUDES} -I/usr/local/include" CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" if test "${ac_cv_c_compiler_gnu}" = "yes"; then CFLAGS="${CFLAGS} -Wall" fi # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix*) #enable .so libraries, disable archives LDFLAGS="$LDFLAGS -Wl,-brtl" ;; esac echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in os2.h fcntl.h unistd.h libc.h sys/time.h sys/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err 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 for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((ssize_t *) 0) return 0; if (sizeof (ssize_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ssize_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 if test $ac_cv_type_ssize_t = yes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t long _ACEOF fi echo "$as_me:$LINENO: checking for u_char" >&5 echo $ECHO_N "checking for u_char... $ECHO_C" >&6 if test "${ac_cv_type_u_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((u_char *) 0) return 0; if (sizeof (u_char)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_char=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_char" >&5 echo "${ECHO_T}$ac_cv_type_u_char" >&6 if test $ac_cv_type_u_char = yes; then : else cat >>confdefs.h <<_ACEOF #define u_char unsigned char _ACEOF fi echo "$as_me:$LINENO: checking for u_int" >&5 echo $ECHO_N "checking for u_int... $ECHO_C" >&6 if test "${ac_cv_type_u_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((u_int *) 0) return 0; if (sizeof (u_int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int" >&5 echo "${ECHO_T}$ac_cv_type_u_int" >&6 if test $ac_cv_type_u_int = yes; then : else cat >>confdefs.h <<_ACEOF #define u_int unsigned int _ACEOF fi echo "$as_me:$LINENO: checking for u_long" >&5 echo $ECHO_N "checking for u_long... $ECHO_C" >&6 if test "${ac_cv_type_u_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((u_long *) 0) return 0; if (sizeof (u_long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_long" >&5 echo "${ECHO_T}$ac_cv_type_u_long" >&6 if test $ac_cv_type_u_long = yes; then : else cat >>confdefs.h <<_ACEOF #define u_long unsigned long _ACEOF fi echo "$as_me:$LINENO: checking for u_int8_t" >&5 echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 if test "${ac_cv_type_u_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((u_int8_t *) 0) return 0; if (sizeof (u_int8_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_int8_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int8_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6 if test $ac_cv_type_u_int8_t = yes; then : else cat >>confdefs.h <<_ACEOF #define u_int8_t unsigned char _ACEOF fi echo "$as_me:$LINENO: checking for u_int16_t" >&5 echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 if test "${ac_cv_type_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((u_int16_t *) 0) return 0; if (sizeof (u_int16_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_int16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int16_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 if test $ac_cv_type_u_int16_t = yes; then : else cat >>confdefs.h <<_ACEOF #define u_int16_t unsigned short _ACEOF fi echo "$as_me:$LINENO: checking for u_int32_t" >&5 echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((u_int32_t *) 0) return 0; if (sizeof (u_int32_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int32_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 if test $ac_cv_type_u_int32_t = yes; then : else cat >>confdefs.h <<_ACEOF #define u_int32_t unsigned int _ACEOF fi echo "$as_me:$LINENO: checking for sqrt in -lm" >&5 echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sqrt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sqrt (); int main () { sqrt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sqrt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_sqrt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5 echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6 if test $ac_cv_lib_m_sqrt = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi if test "`uname`" != "IRIX" -a "`uname`" != "IRIX64"; then echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi echo "$as_me:$LINENO: checking for syslog in -lsyslog" >&5 echo $ECHO_N "checking for syslog in -lsyslog... $ECHO_C" >&6 if test "${ac_cv_lib_syslog_syslog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsyslog $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char syslog (); int main () { syslog (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_syslog_syslog=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_syslog_syslog=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_syslog_syslog" >&5 echo "${ECHO_T}$ac_cv_lib_syslog_syslog" >&6 if test $ac_cv_lib_syslog_syslog = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSYSLOG 1 _ACEOF LIBS="-lsyslog $LIBS" fi # OS/2 needs this fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 (); /* 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 char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err 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 CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 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 ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 (); /* 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 char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err 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 working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); 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 ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap for ac_func in atexit mkdir sigprocmask strdup strndup strftime strstr \ strsep strtod snprintf usleep strcasecmp strncasecmp getenv isfdtype vsyslog 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 (); /* 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 char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err 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 if test "$ac_cv_header_os2_h" = "yes" ; then cat >>confdefs.h <<\_ACEOF #define strncasecmp strnicmp _ACEOF cat >>confdefs.h <<\_ACEOF #define strcasecmp stricmp _ACEOF fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 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_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi # Check whether --with-sane-prefix or --without-sane-prefix was given. if test "${with_sane_prefix+set}" = set; then withval="$with_sane_prefix" sane_config_prefix="$withval" else sane_config_prefix="" fi; # Check whether --with-sane-exec-prefix or --without-sane-exec-prefix was given. if test "${with_sane_exec_prefix+set}" = set; then withval="$with_sane_exec_prefix" sane_config_exec_prefix="$withval" else sane_config_exec_prefix="" fi; # Check whether --enable-sanetest or --disable-sanetest was given. if test "${enable_sanetest+set}" = set; then enableval="$enable_sanetest" else enable_sanetest=yes fi; if test x$sane_config_exec_prefix != x ; then sane_config_args="$sane_config_args --exec-prefix=$sane_config_exec_prefix" if test x${SANE_CONFIG+set} != xset ; then SANE_CONFIG=$sane_config_exec_prefix/bin/sane-config fi fi if test x$sane_config_prefix != x ; then sane_config_args="$sane_config_args --prefix=$sane_config_prefix" if test x${SANE_CONFIG+set} != xset ; then SANE_CONFIG=$sane_config_prefix/bin/sane-config fi fi # Extract the first word of "sane-config", so it can be a program name with args. set dummy sane-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SANE_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SANE_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_SANE_CONFIG="$SANE_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SANE_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SANE_CONFIG" && ac_cv_path_SANE_CONFIG="no" ;; esac fi SANE_CONFIG=$ac_cv_path_SANE_CONFIG if test -n "$SANE_CONFIG"; then echo "$as_me:$LINENO: result: $SANE_CONFIG" >&5 echo "${ECHO_T}$SANE_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi min_sane_version=1.0.0 echo "$as_me:$LINENO: checking for SANE - version >= $min_sane_version" >&5 echo $ECHO_N "checking for SANE - version >= $min_sane_version... $ECHO_C" >&6 no_sane="" if test "$SANE_CONFIG" = "no" ; then no_sane=yes else SANE_CFLAGS=`$SANE_CONFIG $sane_config_args --cflags` SANE_LDFLAGS=`$SANE_CONFIG $sane_config_args --ldflags` # SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs` SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs | sed -e 's/-lintl//g'` SANE_PREFIX=`$SANE_CONFIG $sane_config_args --prefix` sane_config_major_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` sane_config_minor_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` sane_config_micro_version=`$SANE_CONFIG $sane_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_sanetest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LDFLAGS="$LDFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SANE_CFLAGS" LDFLAGS="$LDFLAGS $SANE_LDFLAGS" LIBS="$LIBS $SANE_LIBS" rm -f conf.sanetest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int major, minor, micro; system ("touch conf.sanetest"); if (sscanf("$min_sane_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sane_version"); exit(1); } if ( ($sane_config_major_version == major) && ( ($sane_config_minor_version > minor) || ( ($sane_config_minor_version == minor) && ($sane_config_micro_version >= micro)))) { return 0; } else if ($sane_config_major_version > major) { printf("\n*** A too new version of SANE (%d.%d.%d) was found.\n", $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); printf("*** You need a version of SANE with the major version number %d.\n", major); } else { printf("\n*** An old version of SANE (%d.%d.%d) was found.\n", $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); printf("*** You need a version of SANE newer than %d.%d.%d. The latest version of\n", major, minor, micro); } printf("*** SANE is always available from http://www.sane-project.org\n"); printf("***\n"); printf("*** If you have already installed a sufficient version, this error\n"); printf("*** probably means that the wrong copy of the sane-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of SANE, but you can also set the SANE_CONFIG environment to point to the\n"); printf("*** correct copy of sane-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); return 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_sane=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sane" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 HAVE_SANE=yes else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$SANE_CONFIG" = "no" ; then echo "*** The sane-config script installed by SANE could not be found" echo "*** If SANE was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SANE_CONFIG environment variable to the" echo "*** full path to sane-config." else if test -f conf.sanetest ; then : else echo "*** Could not run SANE test program, checking why..." CFLAGS="$CFLAGS $SANE_CFLAGS" LIBS="$LIBS $SANE_LIBS" LDFLAGS="$LDFLAGS $SANE_LDFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return (SANE_CURRENT_MAJOR); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SANE or finding the wrong" echo "*** version of SANE. If it is not finding SANE, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SANE was incorrectly installed" echo "*** or that you have moved SANE since it was installed. In the latter case, you" echo "*** may want to edit the sane-config script: $SANE_CONFIG" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LDFLAGS="$ac_save_LDFLAGS" LIBS="$ac_save_LIBS" fi fi SANE_CFLAGS="" SANE_LDFLAGS="" SANE_LIBS="" : fi rm -f conf.sanetest if test "x${HAVE_SANE}" = "x"; then echo "**********************************************************************" echo "ERROR: Couldn't find SANE libraries (sane-backends). Possible reasons:" echo " - sane-backends isn't installed (install sane-backends before" echo " sane-frontends)" echo " - the SANE header files aren't installed (if you installed" echo " SANE as RPM make sure you also included the sane-devel RPM)" echo " - the SANE libraries can't be found because /usr/local/lib/ isn't" echo " searched by the dynamic linker (see INSTALL for details)" echo "**********************************************************************" echo "" exit fi # check for GTK2 or GTK >= 0.99.13 if test "${USE_GUI}" = "yes"; then if test "${USE_GTK2}" = "yes" || test "${USE_GIMP}" = "yes"; then # Check whether --enable-gtktest or --disable-gtktest was given. if test "${enable_gtktest+set}" = set; then enableval="$enable_gtktest" else enable_gtktest=yes fi; pkg_config_args=gtk+-2.0 for module in . do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=2.0.0 echo "$as_me:$LINENO: checking for GTK+ - version >= $min_gtk_version" >&5 echo $ECHO_N "checking for GTK+ - version >= $min_gtk_version... $ECHO_C" >&6 if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" rm -f conf.gtktest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_gtk=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then echo "$as_me:$LINENO: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5 echo "${ECHO_T}yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6 HAVE_GTK=yes else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" if test "${USE_GIMP}" = "yes"; then { echo "$as_me:$LINENO: WARNING: *** GIMP 2.0 plugin requested, but GTK+ 2.0 not found, falling back to GIMP/GTK+ < 2.0 if possible ***" >&5 echo "$as_me: WARNING: *** GIMP 2.0 plugin requested, but GTK+ 2.0 not found, falling back to GIMP/GTK+ < 2.0 if possible ***" >&2;} USE_GIMP=no USE_GIMP12=yes else { echo "$as_me:$LINENO: WARNING: *** GTK+ 2.0 not found, falling back to GTK+ < 2.0 if possible ***" >&5 echo "$as_me: WARNING: *** GTK+ 2.0 not found, falling back to GTK+ < 2.0 if possible ***" >&2;} fi fi rm -f conf.gtktest fi # fallback to GTK < 2 if GTK2 isn't available if test "${HAVE_GTK}" != "yes"; then # Check whether --with-gtk-prefix or --without-gtk-prefix was given. if test "${with_gtk_prefix+set}" = set; then withval="$with_gtk_prefix" gtk_config_prefix="$withval" else gtk_config_prefix="" fi; # Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given. if test "${with_gtk_exec_prefix+set}" = set; then withval="$with_gtk_exec_prefix" gtk_config_exec_prefix="$withval" else gtk_config_exec_prefix="" fi; # Check whether --enable-gtktest or --disable-gtktest was given. if test "${enable_gtktest+set}" = set; then enableval="$enable_gtktest" else enable_gtktest=yes fi; if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GTK_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GTK_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTK_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" ;; esac fi GTK_CONFIG=$ac_cv_path_GTK_CONFIG if test -n "$GTK_CONFIG"; then echo "$as_me:$LINENO: result: $GTK_CONFIG" >&5 echo "${ECHO_T}$GTK_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi min_gtk_version=0.99.13 echo "$as_me:$LINENO: checking for GTK - version >= $min_gtk_version" >&5 echo $ECHO_N "checking for GTK - version >= $min_gtk_version... $ECHO_C" >&6 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" rm -f conf.gtktest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int major, minor, micro; system ("touch conf.gtktest"); if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); printf("*** correct copy of gtk-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_gtk=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 HAVE_GTK=yes else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GTK_CONFIG environment variable to the" echo "*** full path to gtk-config." else if test -f conf.gtktest ; then : else echo "*** Could not run GTK test program, checking why..." CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" : fi rm -f conf.gtktest fi if test "${USE_GIMP12}" = "yes"; then # Check whether --with-gimp-prefix or --without-gimp-prefix was given. if test "${with_gimp_prefix+set}" = set; then withval="$with_gimp_prefix" gimp_config_prefix="$withval" else gimp_config_prefix="" fi; # Check whether --with-gimp-exec-prefix or --without-gimp-exec-prefix was given. if test "${with_gimp_exec_prefix+set}" = set; then withval="$with_gimp_exec_prefix" gimp_config_exec_prefix="$withval" else gimp_config_exec_prefix="" fi; # Check whether --enable-gimptest or --disable-gimptest was given. if test "${enable_gimptest+set}" = set; then enableval="$enable_gimptest" else enable_gimptest=yes fi; ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" ac_save_GTK_CFLAGS="$GTK_CFLAGS" ac_save_GTK_LIBS="$GTK_LIBS" if test x$gimp_config_exec_prefix != x ; then gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" if test x${GIMP_CONFIG+set} != xset ; then GIMP_CONFIG=$gimp_config_exec_prefix/bin/gimp-config fi fi if test x$gimp_config_prefix != x ; then gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" if test x${GIMP_CONFIG+set} != xset ; then GIMP_CONFIG=$gimp_config_prefix/bin/gimp-config fi fi # Extract the first word of "gimp-config", so it can be a program name with args. set dummy gimp-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GIMP_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GIMP_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GIMP_CONFIG="$GIMP_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GIMP_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GIMP_CONFIG" && ac_cv_path_GIMP_CONFIG="no" ;; esac fi GIMP_CONFIG=$ac_cv_path_GIMP_CONFIG if test -n "$GIMP_CONFIG"; then echo "$as_me:$LINENO: result: $GIMP_CONFIG" >&5 echo "${ECHO_T}$GIMP_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$GIMP_CONFIG" = "no" ; then if test x$gimp_config_exec_prefix != x ; then gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" if test x${GIMP_TOOL+set} != xset ; then GIMP_TOOL=$gimp_config_exec_prefix/bin/gimptool fi fi if test x$gimp_config_prefix != x ; then gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" if test x${GIMP_TOOL+set} != xset ; then GIMP_TOOL=$gimp_config_prefix/bin/gimptool fi fi # Extract the first word of "gimptool", so it can be a program name with args. set dummy gimptool; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GIMP_TOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GIMP_TOOL in [\\/]* | ?:[\\/]*) ac_cv_path_GIMP_TOOL="$GIMP_TOOL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GIMP_TOOL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GIMP_TOOL" && ac_cv_path_GIMP_TOOL="no" ;; esac fi GIMP_TOOL=$ac_cv_path_GIMP_TOOL if test -n "$GIMP_TOOL"; then echo "$as_me:$LINENO: result: $GIMP_TOOL" >&5 echo "${ECHO_T}$GIMP_TOOL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi GIMP_CONFIG=$GIMP_TOOL fi min_gimp_version=1.0.0 no_gimp="" if test "$GIMP_CONFIG" = "no" ; then ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" for ac_header in libgimp/gimp.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF GIMP_LIBS="-lgimp" else no_gimp=yes fi done for ac_header in libgimp/gimpfeatures.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="$ac_save_CPPFLAGS" CFLAGS="${CFLAGS} ${GTK_CFLAGS}" LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" if test "x$no_gimp" = x ; then echo "$as_me:$LINENO: checking GIMP compilation" >&5 echo $ECHO_N "checking GIMP compilation... $ECHO_C" >&6 gimp_config_major_version=-1 gimp_config_minor_version=0 gimp_config_micro_version=0 fi else # GTK_CFLAGS="" # GTK_LIBS="" GIMP_CFLAGS=`$GIMP_CONFIG $gimp_config_args --cflags` GIMP_LIBS=`$GIMP_CONFIG $gimp_config_args --libs`" -lgimp" gimp_config_major_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gimp_config_minor_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gimp_config_micro_version=`$GIMP_CONFIG $gimp_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` CFLAGS="${CFLAGS} ${GIMP_CFLAGS}" LIBS="${LIBS} ${GIMP_LIBS}" echo "$as_me:$LINENO: checking for GIMP - version >= $min_gimp_version" >&5 echo $ECHO_N "checking for GIMP - version >= $min_gimp_version... $ECHO_C" >&6 fi if test "x$no_gimp" = x ; then if test "x$enable_gimptest" = "xyes" ; then rm -f conf.gimptest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ ($gimp_config_major_version > (major) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ $gimp_config_micro_version >= (micro))) #if !GIMP_TEST_CHECK_VERSION(1,1,25) # define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ #endif GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; int main () { int major, minor, micro; system ("touch conf.gimptest"); if (sscanf("$min_gimp_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gimp_version"); exit(1); } if ( ($gimp_config_major_version != -1) && ((gimp_major_version != $gimp_config_major_version) || (gimp_minor_version != $gimp_config_minor_version) || (gimp_micro_version != $gimp_config_micro_version)) ) { printf("\n*** 'gimp-config --version' returned %d.%d.%d, but GIMP (%d.%d.%d)\n", $gimp_config_major_version, $gimp_config_minor_version, $gimp_config_micro_version, gimp_major_version, gimp_minor_version, gimp_micro_version); printf ("*** was found! If gimp-config was correct, then it is best\n"); printf ("*** to remove the old version of GIMP. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gimp-config was wrong, set the environment variable GIMP_CONFIG\n"); printf("*** to point to the correct copy of gimp-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else { if ((gimp_major_version > major) || ((gimp_major_version == major) && (gimp_minor_version > minor)) || ((gimp_major_version == major) && (gimp_minor_version == minor) && (gimp_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GIMP (%d.%d.%d) was found.\n", gimp_major_version, gimp_minor_version, gimp_micro_version); printf("*** You need a version of GIMP newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GIMP is always available from ftp://ftp.gimp.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gimp-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GIMP, but you can also set the GIMP_CONFIG environment to point to the\n"); printf("*** correct copy of gimp-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_gimp=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi if test "x$no_gimp" = x ; then if test "x$enable_gimptest" = "xyes" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: not tested" >&5 echo "${ECHO_T}not tested" >&6 fi if test "$GIMP_CONFIG" != "no" ; then ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CPPFLAGS} ${GIMP_CFLAGS}" for ac_header in libgimp/gimp.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in libgimp/gimpfeatures.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="$ac_save_CPPFLAGS" fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" HAVE_GIMP=yes else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test -f conf.gimptest ; then : else echo "*** Could not run GIMP test program, checking why..." CFLAGS="$CFLAGS $GIMP_CFLAGS" LIBS="$LIBS $GIMP_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ ($gimp_config_major_version > (major) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ $gimp_config_micro_version >= (micro))) #if !GIMP_TEST_CHECK_VERSION(1,1,25) # define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ #endif GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; int main () { return ((gimp_major_version) || (gimp_minor_version) || (gimp_micro_version)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GIMP or finding the wrong" echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "***" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi GIMP_CFLAGS="" GIMP_LIBS="" # GTK_CFLAGS="$ac_save_GTK_CFLAGS" # GTK_LIBS="$ac_save_GTK_LIBS" # CFLAGS="${CFLAGS} ${GTK_CFLAGS}" # LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" : fi rm -f conf.gimptest if test "${HAVE_GIMP}" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_GIMP_1_2 1 _ACEOF fi fi if test "${USE_GIMP}" = "yes"; then # Check whether --enable-gimptest or --disable-gimptest was given. if test "${enable_gimptest+set}" = set; then enableval="$enable_gimptest" else enable_gimptest=yes fi; pkg_name=gimp-2.0 pkg_config_args="$pkg_name gimpui-2.0" no_gimp="" # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo *** pkg-config too old; version 0.7 or better required. no_gimp=yes PKG_CONFIG=no fi else no_gimp=yes fi min_gimp_version=1.3.23 echo "$as_me:$LINENO: checking for GIMP - version >= $min_gimp_version" >&5 echo $ECHO_N "checking for GIMP - version >= $min_gimp_version... $ECHO_C" >&6 if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GIMP found in PKG_CONFIG_PATH" enable_gimptest=no fi if $PKG_CONFIG --atleast-version $min_gimp_version $pkg_config_args; then : else no_gimp=yes fi fi if test x"$no_gimp" = x ; then GIMP_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GIMP_LIBS=`$PKG_CONFIG $pkg_config_args --libs` GIMP_CFLAGS_NOUI=`$PKG_CONFIG $pkg_name --cflags` GIMP_LIBS_NOUI=`$PKG_CONFIG $pkg_name --libs` GIMP_DATA_DIR=`$PKG_CONFIG $pkg_name --variable=gimpdatadir` GIMP_PLUGIN_DIR=`$PKG_CONFIG $pkg_name --variable=gimplibdir` gimp_pkg_major_version=`$PKG_CONFIG --modversion $pkg_name | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gimp_pkg_minor_version=`$PKG_CONFIG --modversion $pkg_name | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gimp_pkg_micro_version=`$PKG_CONFIG --modversion $pkg_name | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gimptest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GIMP_CFLAGS" LIBS="$GIMP_LIBS $LIBS" rm -f conf.gimptest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ NULL, /* query_proc */ NULL /* run_proc */ }; int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gimptest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gimp_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gimp_version"); exit(1); } if (($gimp_pkg_major_version > major) || (($gimp_pkg_major_version == major) && ($gimp_pkg_minor_version > minor)) || (($gimp_pkg_major_version == major) && ($gimp_pkg_minor_version == minor) && ($gimp_pkg_micro_version >= micro))) { return 0; } else { printf("\n*** 'pkg-config --modversion %s' returned %d.%d.%d, but the minimum version\n", "$pkg_name", $gimp_pkg_major_version, $gimp_pkg_minor_version, $gimp_pkg_micro_version); printf("*** of GIMP required is %d.%d.%d. If pkg-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct the correct configuration files\n"); return 1; } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_gimp=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gimp" = x ; then echo "$as_me:$LINENO: result: yes (version $gimp_pkg_major_version.$gimp_pkg_minor_version.$gimp_pkg_micro_version)" >&5 echo "${ECHO_T}yes (version $gimp_pkg_major_version.$gimp_pkg_minor_version.$gimp_pkg_micro_version)" >&6 HAVE_GIMP=yes else if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.gimptest ; then : else echo "*** Could not run GIMP test program, checking why..." CFLAGS="$CFLAGS $GIMP_CFLAGS" LIBS="$LIBS $GIMP_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ NULL, /* query_proc */ NULL /* run_proc */ }; int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GIMP or finding the wrong" echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GIMP is incorrectly installed." fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GIMP_CFLAGS="" GIMP_LIBS="" GIMP_CFLAGS_NOUI="" GIMP_LIBS_NOUI="" : fi rm -f conf.gimptest if test "${HAVE_GIMP}" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBGIMP_GIMP_H 1 _ACEOF fi fi if test "x${HAVE_GTK}" = "x"; then echo "****************************************************************" echo "WARNING: GTK-0.99.13 or newer is needed for compiling the GUI" echo " frontends. If you installed gtk as rpm make sure" echo " you also installed gtk-devel." echo " ===> GUIs will be deactivated" echo "****************************************************************" echo "" echo "You may need to remove $cache_file before you run configure again." echo "" else BINPROGS=${BINPROGS}" "${GUIPROGS} fi fi CPPFLAGS="${CPPFLAGS} \ -DPATH_SANE_DATA_DIR=\$(sanedatadir) \ -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR} -DV_BUILD=${V_BUILD} -DSANE_V_MAJOR=${SANE_V_MAJOR}" # Check whether --enable-foo1 or --disable-foo1 was given. if test "${enable_foo1+set}" = set; then enableval="$enable_foo1" fi; # Check whether --enable-foo2 or --disable-foo2 was given. if test "${enable_foo2+set}" = set; then enableval="$enable_foo2" fi; ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile sanei/Makefile doc/Makefile include/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "sanei/Makefile" ) CONFIG_FILES="$CONFIG_FILES sanei/Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/sane/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/sane/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@SANE_MAJOR@,$SANE_MAJOR,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@ALLOCA@,$ALLOCA,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@SANE_CONFIG@,$SANE_CONFIG,;t t s,@SANE_LDFLAGS@,$SANE_LDFLAGS,;t t s,@SANE_CFLAGS@,$SANE_CFLAGS,;t t s,@SANE_LIBS@,$SANE_LIBS,;t t s,@SANE_PREFIX@,$SANE_PREFIX,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t s,@GTK_LIBS@,$GTK_LIBS,;t t s,@GTK_CONFIG@,$GTK_CONFIG,;t t s,@GIMP_CONFIG@,$GIMP_CONFIG,;t t s,@GIMP_TOOL@,$GIMP_TOOL,;t t s,@GIMP_CFLAGS@,$GIMP_CFLAGS,;t t s,@GIMP_LIBS@,$GIMP_LIBS,;t t s,@GIMP_CFLAGS_NOUI@,$GIMP_CFLAGS_NOUI,;t t s,@GIMP_LIBS_NOUI@,$GIMP_LIBS_NOUI,;t t s,@GIMP_DATA_DIR@,$GIMP_DATA_DIR,;t t s,@GIMP_PLUGIN_DIR@,$GIMP_PLUGIN_DIR,;t t s,@INCLUDES@,$INCLUDES,;t t s,@BINPROGS@,$BINPROGS,;t t s,@V_MAJOR@,$V_MAJOR,;t t s,@V_MINOR@,$V_MINOR,;t t s,@V_BUILD@,$V_BUILD,;t t s,@DLL_PRELOAD@,$DLL_PRELOAD,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac # 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; } 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 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo "****************************************************************" echo "* *" echo "* SANE-FRONTENDS configure status: *" echo "* -------------------------------- *" if test "x${HAVE_GTK}" != "x"; then echo "* - GUIs activated (xcam + xscanimage) *" if test "${GIMP_LIBS}set" != "set"; then echo "* - GIMP plugin activated for xscanimage *" else echo "* - GIMP plugin deactivated for xscanimage *" fi else if test "${USE_GUI}" = "yes"; then echo "* * GTK not found: GUIs deactivated *" else echo "* - GUIs deactivated (xcam + xscanimage) *" fi fi echo "* *" echo "****************************************************************" echo "* *" echo "* To compile SANE-FRONTENDS: *" echo "* -------------------------- *" echo "* make *" echo "* make install *" echo "* *" echo "* ------------------------------------------------------------ *" echo "* ... PLEASE READ SANE DOCUMENTATION BEFORE STARTING SANE ... *" echo "* ------------------------------------------------------------ *" echo "* *" echo "* If you experience any problems with sane-frontends please *" echo "* write to the sane mailing list or contact: *" echo "* Oliver Rauch *" echo "* *" echo "****************************************************************" ./sane-frontends-1.0.14/configure.in0000644000175000017500000002046010313251763015304 0ustar hmghmgdnl Process this file with autoconf to produce a configure script. -*-sh-*- AC_INIT(include/sane/config.h.in) AC_CONFIG_HEADER(include/sane/config.h) # AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required. # AC_ARG_PROGRAM # version code: V_MAJOR=1 V_MINOR=0 V_BUILD=14 V_EXTRA= PACKAGE=sane-frontends GUIPROGS="xscanimage xcam" BINPROGS="scanadf" # languages # ALL_LINGUAS="cs de fr sv it tr" SANE_V_MAJOR=1 VERSION=${V_MAJOR}.${V_MINOR}.${V_BUILD}${V_EXTRA} PACKAGE_VERSION="$PACKAGE-$VERSION" AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of the distribution.]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define to the version of the distribution.]) AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION", [Define to the name and the version of the distribution.]) AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(PACKAGE_VERSION) AC_SUBST(SANE_MAJOR) dnl Check if GUIs shall be compiled AC_ARG_ENABLE(guis, [ --disable-guis do not compile graphical user interfaces (GUIs)], USE_GUI=$enableval, USE_GUI=yes) dnl Check if GTK2 support is wanted AC_ARG_ENABLE(gtk2, [ --disable-gtk2 do not use GTK2], USE_GTK2=$enableval, USE_GTK2=yes) dnl Check for gimp plugin support AC_MSG_CHECKING([whether GIMP plugin is requested]) dnl Default is enabled GIMP plugin AC_ARG_ENABLE(gimp, [ --disable-gimp do not include GIMP plugin mode], USE_GIMP=$enableval, USE_GIMP=yes) AC_ARG_ENABLE(gimp12, [ --enable-gimp12 include GIMP 1.2 plugin mode (this enables GIMP =< 1.2 plugin, defaults to GIMP 2.0)], USE_GIMP12=$enableval, USE_GIMP12="no") if test "${USE_GIMP12}" = "yes"; then AC_MSG_RESULT([yes, GIMP 1.2]) USE_GIMP="no" USE_GTK2="no" else AC_MSG_RESULT([$USE_GIMP, GIMP 2.0]) fi dnl Checks for programs. AC_PROG_CC AC_AIX AC_MINIX AC_ISC_POSIX AM_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_CPP AC_PROG_GCC_TRADITIONAL INCLUDES="${INCLUDES} -I/usr/local/include" CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" if test "${ac_cv_prog_gcc}" = "yes"; then CFLAGS="${CFLAGS} -Wall" fi AC_CANONICAL_HOST dnl special LDFLAGS case "$host_os" in aix*) #enable .so libraries, disable archives LDFLAGS="$LDFLAGS -Wl,-brtl" ;; esac dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(os2.h fcntl.h unistd.h libc.h sys/time.h sys/types.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_TYPE_PID_T AC_CHECK_TYPE(ssize_t, long) AC_CHECK_TYPE(u_char, unsigned char) AC_CHECK_TYPE(u_int, unsigned int) AC_CHECK_TYPE(u_long, unsigned long) AC_CHECK_TYPE(u_int8_t, unsigned char) AC_CHECK_TYPE(u_int16_t, unsigned short) AC_CHECK_TYPE(u_int32_t, unsigned int) dnl Checks for libraries. AC_CHECK_LIB(m, sqrt) if test "`uname`" != "IRIX" -a "`uname`" != "IRIX64"; then AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(syslog, syslog) # OS/2 needs this fi dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_MMAP AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr \ strsep strtod snprintf usleep strcasecmp strncasecmp getenv isfdtype vsyslog) if test "$ac_cv_header_os2_h" = "yes" ; then AC_DEFINE(strncasecmp, strnicmp, [Define for OS/2 only]) AC_DEFINE(strcasecmp, stricmp, [Define for OS/2 only]) fi AC_CHECK_TOOL(RANLIB, ranlib, :) AM_PATH_SANE(1.0.0, HAVE_SANE=yes, ) dnl Print error message if sane is missing if test "x${HAVE_SANE}" = "x"; then echo "**********************************************************************" echo "ERROR: Couldn't find SANE libraries (sane-backends). Possible reasons:" echo " - sane-backends isn't installed (install sane-backends before" echo " sane-frontends)" echo " - the SANE header files aren't installed (if you installed" echo " SANE as RPM make sure you also included the sane-devel RPM)" echo " - the SANE libraries can't be found because /usr/local/lib/ isn't" echo " searched by the dynamic linker (see INSTALL for details)" echo "**********************************************************************" echo "" exit fi # check for GTK2 or GTK >= 0.99.13 if test "${USE_GUI}" = "yes"; then if test "${USE_GTK2}" = "yes" || test "${USE_GIMP}" = "yes"; then AM_PATH_GTK_2_0(2.0.0, HAVE_GTK=yes, [ if test "${USE_GIMP}" = "yes"; then AC_MSG_WARN([*** GIMP 2.0 plugin requested, but GTK+ 2.0 not found, falling back to GIMP/GTK+ < 2.0 if possible ***]) USE_GIMP=no USE_GIMP12=yes else AC_MSG_WARN([*** GTK+ 2.0 not found, falling back to GTK+ < 2.0 if possible ***]) fi]) fi # fallback to GTK < 2 if GTK2 isn't available if test "${HAVE_GTK}" != "yes"; then AM_PATH_GTK(0.99.13, HAVE_GTK=yes, ) fi if test "${USE_GIMP12}" = "yes"; then AM_PATH_GIMP(1.0.0, HAVE_GIMP=yes) if test "${HAVE_GIMP}" = "yes"; then AC_DEFINE([ENABLE_GIMP_1_2], 1, [Define to 1 if GIMP 1.2 support wanted]) fi fi if test "${USE_GIMP}" = "yes"; then AM_PATH_GIMP_2_0(1.3.23, HAVE_GIMP=yes) if test "${HAVE_GIMP}" = "yes"; then AC_DEFINE([HAVE_LIBGIMP_GIMP_H], 1, [Define to 1 if you have the header file.]) fi fi if test "x${HAVE_GTK}" = "x"; then echo "****************************************************************" echo "WARNING: GTK-0.99.13 or newer is needed for compiling the GUI" echo " frontends. If you installed gtk as rpm make sure" echo " you also installed gtk-devel." echo " ===> GUIs will be deactivated" echo "****************************************************************" echo "" echo "You may need to remove $cache_file before you run configure again." echo "" else BINPROGS=${BINPROGS}" "${GUIPROGS} fi fi AC_SUBST(INCLUDES) AC_SUBST(BINPROGS) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) CPPFLAGS="${CPPFLAGS} \ -DPATH_SANE_DATA_DIR=\$(sanedatadir) \ -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR} -DV_BUILD=${V_BUILD} -DSANE_V_MAJOR=${SANE_V_MAJOR}" AC_SUBST(V_MAJOR) AC_SUBST(V_MINOR) AC_SUBST(V_BUILD) AC_SUBST(DLL_PRELOAD) AC_ARG_ENABLE(foo1, [ Used environment variables that can be set by user: CFLAGS, CPPFLAGS, LDFLAGS, LIBS]) AC_ARG_ENABLE(foo2, [ To add include or library paths call: [env] CPPFLAGS=\"-I/path/to/foo/include\" LDFLAGS=\"-L/path/to/foo/libs\" ./configure]) AC_OUTPUT([Makefile lib/Makefile src/Makefile sanei/Makefile doc/Makefile include/Makefile],) echo "****************************************************************" echo "* *" echo "* SANE-FRONTENDS configure status: *" echo "* -------------------------------- *" if test "x${HAVE_GTK}" != "x"; then echo "* - GUIs activated (xcam + xscanimage) *" if test "${GIMP_LIBS}set" != "set"; then echo "* - GIMP plugin activated for xscanimage *" else echo "* - GIMP plugin deactivated for xscanimage *" fi else if test "${USE_GUI}" = "yes"; then echo "* * GTK not found: GUIs deactivated *" else echo "* - GUIs deactivated (xcam + xscanimage) *" fi fi echo "* *" echo "****************************************************************" echo "* *" echo "* To compile SANE-FRONTENDS: *" echo "* -------------------------- *" echo "* make *" echo "* make install *" echo "* *" echo "* ------------------------------------------------------------ *" echo "* ... PLEASE READ SANE DOCUMENTATION BEFORE STARTING SANE ... *" echo "* ------------------------------------------------------------ *" echo "* *" echo "* If you experience any problems with sane-frontends please *" echo "* write to the sane mailing list or contact: *" echo "* Oliver Rauch *" echo "* *" echo "****************************************************************" ./sane-frontends-1.0.14/install-sh0000755000175000017500000001256207202711524015002 0ustar hmghmg#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # 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. # # 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. # # This script is compatible with the BSD install script, but was written # from scratch. # # 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 ./sane-frontends-1.0.14/mkinstalldirs0000755000175000017500000000133207202711524015575 0ustar hmghmg#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Last modified: 1994-03-25 # Public domain errstatus=0 for file in ${1+"$@"} ; do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? fi if test ! -d "$pathcomp"; then errstatus=$lasterr fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here ./sane-frontends-1.0.14/sane-frontends.lsm0000644000175000017500000000316310050463212016427 0ustar hmghmgBegin4 Title: sane-frontends Version: _VERSION_ Entered-date: _DATE_ Description: sane-frontends contains applications for SANE (Scanner Access Now Easy). This package provides the graphical frontends xscanimage and xcam. Both use the GTK+ toolkit. xscanimage is used for scanners, xcam for cameras. xscanimage can also be used as gimp plugin. The package also provides the command-line frontend scanadf which is based on scanimage and is intended for scanners that use automatic document feeders. Keywords: camera, scanner, sane, frontend, application, ADF Author: David.Mosberger@acm.org (David Mosberger-Tang) becka@sunserver1.rz.uni-duesseldorf.de (Andreas Beck) ttarrant@etnoteam.it (Tristan Tarrant) Maintained-by: henning@meier-geinitz.de (Henning Meier-Geinitz) Oliver.Rauch@rauch-domain.de (Oliver Rauch) Primary-site: ftp.sane-project.org /pub/sane/sane-_VERSION_ _T_S_ kB sane-frontends-_VERSION_.tar.gz _L_S_ kB sane-frontends-_VERSION_.lsm Alternate-site: sunsite.unc.edu /pub/Linux/apps/graphics/capture Platforms: AIX, Digital Unix, HP Apollo Domain/OS, FreeBSD, HP-UX, IRIX, Linux (Alpha, m68k, SPARC, x86), NetBSD, OpenBSD, OpenStep (x86), SCO OpenServer 5.x (x86), OS/2, Solaris (SPARC, x86), SunOS. GNU make, sane-backends, and gtk+ is needed. The gimp libraries are recommended (for usage as gimp-plugin). Copying-policy: GPL End ./sane-frontends-1.0.14/xscanimage-icon-48x48-2.png0000644000175000017500000001175010130504310017466 0ustar hmghmgPNG  IHDR00WgAMA abKGD~ pHYs  tIME #3T(tEXtCommentCreated with The GIMPd%n599y_Tj[$HuK%IA//xsܭ{ټk׮muaR3ͩTjGIGGG]uHߏZW_s5~aYsss>|u]?\T1  " rhn7nB[s)h躎@i+l6eqnJ $ A$ \+!6mD&m 0 t]gaa#G3ϨzsX\Nr6uww)NK.ѻhuaH ~zؼy3t۶q˲u%xH0777)]T|_ }hg-'NKR{t]㞞u] j$ IB-غu+[la혦I*R(t^\.sۧFFFfshL\.wlQ+@z:FQ4\(4;{zzrARjm4MCi$qq.mvزe Tt:M&iDΟ?(cccg}?mơدmpp]BcLOOSu v0 ˲@t ! A6Mشi;v`pp4u}$affnjǏץ{+uvvп{''Z-lQ9qZ Vue%&ЄFq @ww7ׯgÆ lڴ ˲, \.Goo/{ B&nw>4G"}L2:Q FΙ)<]蘶ZSH))jfݺulܸa@8iMӾtM7Ƀ>OãE4M}M6}wvzѿ[l8~?w]=@ނ^q ĊeJg_-)ՅcՎl!Bǰd:lMriRTpڷ .첔_;졇(I~qKճB vT*8ChV_ nT_׾50 ϝգdw]*"1!cjeE1T=QcziKg2p]uK}rʴJֻ홙?kO^3u4o{ɻa,,p j`X*$ C~XŰRJ%lǦXlܸnZ_Wm$==;ꑎAm+$ډ ]0,/D~!V"B[mt< eA^#qR*V=CCC_iNN3__ P ` 3Н{Aw(.|re mo}뭈D *KKi,vh6yddpߝ3ۅ=`P#Cт5t/rzj 4/;²\V@Cy8e!*t!Ě\.YӍRZFR\}oT8`lv u†: Zq[AMSkRgVVTʖ@'İO.F^QJ8G0}hZ[llit5}|& U^>q/xfrܴ-5ǰ| >nPc tي.)X ۸FR hfwk Z):iǁy^hqNNNRՐR$ eǚn7\JYyӟ<˾BbwqUkho{+|mBh ԛ0tA1#(Xa) 4 hL3S(tlٳ* ٮT%V> !$ zrp]R[Z\_kl##)ObSA?d]'ݑ 8{zSO)4PJ8^<ϯT*"c~F(M ORR)l&-v!} .Z^kTor'oVs97ّ,%R#a%,RQV#/dpmɷDɪKKK5M&Re)e#B(B\dAlR[cR2Y\'EGBgh0ФhpuJqqxon>y.~gNC-EA1xpvtRioc:tǏ+۹\nFJ$huiZ'I&$JFihB 4 >RdpR)ҎC*&NUFn<'ߵDk5q`9,;-ulX0y ~oi̗UkN_:ygq7$I?Я2@#I"b^B t !U$, Mq]vsR)4MZFVE Ib&&&x7B}voĶm?OV5=??Xv!Vsh(N 8eƷ-ʞ:uo~=Qmfwi(!2HBo+. +Ѩi:סbHTUFiqնq)eY)۔RwqsUWb~3+0hÄQV UHEAg\.SjAfe/>X}Q0MH뺞^XXb͚5H)a檫J|bÆ~0^}衔BJv@! 0i5[8p|>C+#_I)G$9Q.KZ"j\,[&((J @,k^)}Ç?sȑ=CCCݻwROrDBC;T!g3%dJJYhjyZ<00" 8lYx3g׿8ԧ> :avmǘIGQG$(j?pp.Ȋ ttǵ,+Ai7hI)ݻ/mwJ %*~wl$yqJj57 p\ R)qiV8t]-dv[n1׮]K&gѿd2q|,sssKwBECb蚦VJeK5B(hBBa\)5U*ͦE 3$ImǮyI8^kўwgsIENDB`./sane-frontends-1.0.14/include/0000755000175000017500000000000010313255162014411 5ustar hmghmg./sane-frontends-1.0.14/include/sane/0000755000175000017500000000000010313255162015337 5ustar hmghmg./sane-frontends-1.0.14/include/sane/config.h.in0000644000175000017500000001353110010254604017357 0ustar hmghmg/* include/sane/config.h.in. Generated from configure.in by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if GIMP 1.2 support wanted */ #undef ENABLE_GIMP_1_2 /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getenv' function. */ #undef HAVE_GETENV /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isfdtype' function. */ #undef HAVE_ISFDTYPE /* Define to 1 if you have the header file. */ #undef HAVE_LIBC_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBGIMP_GIMPFEATURES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBGIMP_GIMP_H /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `syslog' library (-lsyslog). */ #undef HAVE_LIBSYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_OS2_H /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtod' function. */ #undef HAVE_STRTOD /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the `vsyslog' function. */ #undef HAVE_VSYSLOG /* Define to the name of the distribution. */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the name and the version of the distribution. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to the version of the distribution. */ #undef VERSION /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define as `__inline' if that's what the C compiler calls it, or to nothing if it is not supported. */ #undef inline /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* Define to `long' if does not define. */ #undef ssize_t /* Define for OS/2 only */ #undef strcasecmp /* Define for OS/2 only */ #undef strncasecmp /* Define to `unsigned char' if does not define. */ #undef u_char /* Define to `unsigned int' if does not define. */ #undef u_int /* Define to `unsigned short' if does not define. */ #undef u_int16_t /* Define to `unsigned int' if does not define. */ #undef u_int32_t /* Define to `unsigned char' if does not define. */ #undef u_int8_t /* Define to `unsigned long' if does not define. */ #undef u_long ./sane-frontends-1.0.14/include/sane/sanei.h0000644000175000017500000001304710162607322016615 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1996 David Mosberger-Tang and Andreas Beck Copyright (C) 2002, 2003 Henning Meier-Geinitz This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei.h * Convenience macros and function declarations for backends * @sa sanei_backend.h sanei_thread.h */ /* Doxygen documentation */ /** @mainpage SANEI (SANE internal routines) documentation * * @image html ../images/sane-logo2.jpg * @section intro Introduction * * The header files in the include/sane/ directory named sanei_*.h provide * function declarations and macros that can be used by every SANE backend. * Their implementations can be found in the sanei/ directory. The code aims * to be platform-independent to avoid lots of \#ifdef code in the backends. * Please use the SANEI functions wherever possible. * * This documentation was created by the use of doxygen, the * doc/doxygen-sanei.conf configuration file and dcoumentation in the sanei_*.h * files. * * This documenation is far from complete. Any help is appreciated. * * @section additional Additional documentation * - The SANE standard can be found at the SANE webserver. * - Information on how to write a backend: backend-writing.txt. * - General SANE documentation is on mailing list webpage * for details. That's the place to ask questions, report bugs, or announce * a new backend. * */ #ifndef sanei_h #define sanei_h #include /** @name Public macros and functions * @{ */ /** @def STRINGIFY(x) * Turn parameter into string. */ /** @def PASTE(x,y) * Concatenate parameters. * */ /** @def NELEMS(a) * Return number of elements of an array. * */ /** @fn extern SANE_Status sanei_check_value (const SANE_Option_Descriptor * opt, void * value); * Check the constraints of a SANE option. * * @param opt option to check * @param value value of the option * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if the value doesn't fit inside the constraint * or any other error occured * @sa sanei_constrain_value() */ /** @fn extern SANE_Status sanei_constrain_value (const SANE_Option_Descriptor * opt, void * value, SANE_Word * info); * Check the constraints of a SANE option and adjust its value if necessary. * * Depending on the type of the option and constraint, value is modified * to fit inside constraint. * * @param opt option to check * @param value value of the option * @param info info is set to SANE_INFO_INEXACT if value was changed * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if the function wasn't able to fit value into the * constraint or any other error occured * @sa sanei_check_value() */ /* @} */ /** @name Private macros * @{ */ /** @def STRINGIFY1(x) * Internal use only. */ /** @def PASTE1(x,y) * Internal use only. */ /* @} */ /* A few convenience macros: */ /** @hideinitializer */ #define NELEMS(a) ((int)(sizeof (a) / sizeof (a[0]))) /** @hideinitializer */ #define STRINGIFY1(x) #x /** @hideinitializer */ #define STRINGIFY(x) STRINGIFY1(x) /** @hideinitializer */ #define PASTE1(x,y) x##y /** @hideinitializer */ #define PASTE(x,y) PASTE1(x,y) extern SANE_Status sanei_check_value (const SANE_Option_Descriptor * opt, void * value); extern SANE_Status sanei_constrain_value (const SANE_Option_Descriptor * opt, void * value, SANE_Word * info); extern int sanei_save_values (int fd, SANE_Handle device); extern int sanei_load_values (int fd, SANE_Handle device); #endif /* sanei_h */ ./sane-frontends-1.0.14/include/sane/sanei_codec_ascii.h0000644000175000017500000000467710162607322021133 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1996 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_codec_ascii.h * ASCII codec for network and file transmissions * * Instead translating data to a byte stream this codec uses ASCII hex numbers. * Therefore it can be used for streams that are not 8-bit clean or which can * only use printable characters. It's currently used for saving/restoring * data to/from disk. * * @sa sanei_codec_bin.h sanei_net.h sanei_wire.h */ #ifndef sanei_codec_ascii_h #define sanei_codec_ascii_h /** Initialize the ascii codec * * Set the i/o functions of the Wire to those of the ASCII codec. * * @param w Wire */ extern void sanei_codec_ascii_init (Wire *w); #endif /* sanei_codec_ascii_h */ ./sane-frontends-1.0.14/include/sane/sanei_codec_bin.h0000644000175000017500000000451010162607322020575 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1996 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_codec_bin.h * Binary codec for network transmissions * * Transtale data to a byte stream while taking byte order problems into * account. This codec is currently used for saned and the network backend. * * @sa sanei_codec_ascii.h sanei_net.h sanei_wire.h */ #ifndef sanei_codec_bin_h #define sanei_codec_bin_h /** Initialize the binary codec * * Set the i/o functions of the Wire to those of the binary codec. * * @param w Wire */ extern void sanei_codec_bin_init (Wire *w); #endif /* sanei_codec_bin_h */ ./sane-frontends-1.0.14/include/sane/sanei_debug.h0000644000175000017500000001045610162607322017764 0ustar hmghmg/** @file sanei_debug.h * Support for printing debug messages. * * Use the functions of this header file to print debug or warning messages. */ #ifndef _SANEI_DEBUG_H #define _SANEI_DEBUG_H #include /** @name Public macros * These macros can be used in backends and other SANE-related * code. * * Before including sanei_debug.h, the following macros must be set: * * - BACKEND_NAME - The name of your backend without double-quotes (must be set in any case) * - STUBS - If this is defined, no macros will be included. Used in * backends consisting of more than one .c file. * - DEBUG_DECLARE_ONLY - Generates prototypes instead of functions. Used in * backends consisting of more than one .c file. * - DEBUG_NOT_STATIC - Doesn't generate static functions. Used in header files if * they are include in more than one .c file. * * @{ */ /** @def DBG_INIT() * Initialize sanei_debug. * * Call this function before you use any DBG function. */ /** @def DBG(level, fmt, ...) * Print a message at debug level `level' or higher using a printf-like * function. Example: DBG(1, "sane_open: opening fd \%d\\n", fd). * * @param level debug level * @param fmt format (see man 3 printf for details) * @param ... additional arguments */ /** @def IF_DBG(x) * Compile code only if debugging is enabled. * * Expands to x if debug support is enabled at compile-time. If NDEBUG is * defined at compile-time this macro expands to nothing. * * @param x code to expand when debugging is enabled */ /** * @def DBG_LEVEL * Current debug level. * * You can only read this "variable". */ /** @def ENTRY(name) * Expands to sane_BACKEND_NAME_name. * * Example: ENTRY(init) in mustek.c will expand to sane_mustek_init. */ /* @} */ /** @name Internal macros and functions * Do not use in your own code. * @{ */ /** @def DBG_LOCAL * Do not use in backends directly. * * Internal wrapper for printing function. */ /** @fn extern void sanei_init_debug (const char * backend, int * debug_level_var); * Do not use in backends directly. * * Actual init function. */ /** @fn extern void sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap); * Do not use in backends directly. * * Actual printing function. */ /* @} */ /** @hideinitializer*/ #define ENTRY(name) PASTE(PASTE(PASTE(sane_,BACKEND_NAME),_),name) #ifdef NDEBUG extern void sanei_debug_ndebug (int level, const char *msg, ...); # define DBG_LEVEL (0) # define DBG_INIT() # define DBG sanei_debug_ndebug # define IF_DBG(x) #else /* !NDEBUG */ /** @hideinitializer*/ # define DBG_LEVEL PASTE(sanei_debug_,BACKEND_NAME) # if defined(BACKEND_NAME) && !defined(STUBS) # ifdef DEBUG_DECLARE_ONLY extern int DBG_LEVEL; # else /* !DEBUG_DECLARE_ONLY */ int DBG_LEVEL = 0; # endif /* DEBUG_DECLARE_ONLY */ # endif /* BACKEND_NAME && !STUBS */ /** @hideinitializer*/ # define DBG_INIT() \ sanei_init_debug (STRINGIFY(BACKEND_NAME), &DBG_LEVEL) /** @hideinitializer*/ # define DBG_LOCAL PASTE(DBG_LEVEL,_call) # ifndef STUBS # ifdef DEBUG_DECLARE_ONLY extern void DBG_LOCAL (int level, const char *msg, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; # else /* !DEBUG_DECLARE_ONLY */ # include extern void sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap); #ifdef __GNUC__ # ifndef DEBUG_NOT_STATIC static # endif /* !DEBUG_NOT_STATIC */ void DBG_LOCAL (int level, const char *msg, ...) __attribute__ ((format (printf, 2, 3))); #endif /* __GNUC__ */ # ifndef DEBUG_NOT_STATIC static # endif /* !DEBUG_NOT_STATIC */ void DBG_LOCAL (int level, const char *msg, ...) { va_list ap; va_start (ap, msg); sanei_debug_msg (level, DBG_LEVEL, STRINGIFY(BACKEND_NAME), msg, ap); va_end (ap); } # endif /* DEBUG_DECLARE_ONLY */ # endif /* !STUBS */ /** @hideinitializer*/ # define DBG DBG_LOCAL extern void sanei_init_debug (const char * backend, int * debug_level_var); /** @hideinitializer*/ # define IF_DBG(x) x #endif /* NDEBUG */ #endif /* _SANEI_DEBUG_H */ ./sane-frontends-1.0.14/include/sane/sanei_wire.h0000644000175000017500000001104010162607323017633 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. Support routines to translate internal datatypes into a wire-format (used for RPCs and to save/restore options). */ #ifndef sanei_wire_h #define sanei_wire_h #include #define MAX_MEM (1024 * 1024) typedef enum { WIRE_ENCODE = 0, WIRE_DECODE, WIRE_FREE } WireDirection; struct Wire; typedef void (*WireCodecFunc) (struct Wire *w, void *val_ptr); typedef ssize_t (*WireReadFunc) (int fd, void * buf, size_t len); typedef ssize_t (*WireWriteFunc) (int fd, const void * buf, size_t len); typedef struct Wire { int version; /* protocol version in use */ WireDirection direction; int status; int allocated_memory; struct { WireCodecFunc w_byte; WireCodecFunc w_char; WireCodecFunc w_word; WireCodecFunc w_string; } codec; struct { size_t size; char *curr; char *start; char *end; } buffer; struct { int fd; WireReadFunc read; WireWriteFunc write; } io; } Wire; extern void sanei_w_init (Wire *w, void (*codec_init)(Wire *)); extern void sanei_w_exit (Wire *w); extern void sanei_w_space (Wire *w, size_t howmuch); extern void sanei_w_void (Wire *w); extern void sanei_w_byte (Wire *w, SANE_Byte *v); extern void sanei_w_char (Wire *w, SANE_Char *v); extern void sanei_w_word (Wire *w, SANE_Word *v); extern void sanei_w_bool (Wire *w, SANE_Bool *v); extern void sanei_w_ptr (Wire *w, void **v, WireCodecFunc w_value, size_t value_size); extern void sanei_w_string (Wire *w, SANE_String *v); extern void sanei_w_status (Wire *w, SANE_Status *v); extern void sanei_w_constraint_type (Wire *w, SANE_Constraint_Type *v); extern void sanei_w_value_type (Wire *w, SANE_Value_Type *v); extern void sanei_w_unit (Wire *w, SANE_Unit *v); extern void sanei_w_action (Wire *w, SANE_Action *v); extern void sanei_w_frame (Wire *w, SANE_Frame *v); extern void sanei_w_range (Wire *w, SANE_Range *v); extern void sanei_w_range_ptr (Wire *w, SANE_Range **v); extern void sanei_w_device (Wire *w, SANE_Device *v); extern void sanei_w_device_ptr (Wire *w, SANE_Device **v); extern void sanei_w_option_descriptor (Wire *w, SANE_Option_Descriptor *v); extern void sanei_w_option_descriptor_ptr (Wire *w, SANE_Option_Descriptor **v); extern void sanei_w_parameters (Wire *w, SANE_Parameters *v); extern void sanei_w_array (Wire *w, SANE_Word *len, void **v, WireCodecFunc w_element, size_t element_size); extern void sanei_w_set_dir (Wire *w, WireDirection dir); extern void sanei_w_call (Wire *w, SANE_Word proc_num, WireCodecFunc w_arg, void *arg, WireCodecFunc w_reply, void *reply); extern void sanei_w_reply (Wire *w, WireCodecFunc w_reply, void *reply); extern void sanei_w_free (Wire *w, WireCodecFunc w_reply, void *reply); #endif /* sanei_wire_h */ ./sane-frontends-1.0.14/include/Makefile.in0000644000175000017500000000301007416631455016465 0ustar hmghmgSHELL = /bin/sh VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. PACKAGE = @PACKAGE@ VERSION = @VERSION@ distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION) 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 configdir = ${sysconfdir}/sane.d sanedatadir = ${datadir}/sane docdir=$(prefix)/doc/sane-@VERSION@ MKDIR = $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ LN_S = @LN_S@ @SET_MAKE@ SANE_INCLUDES = $(addprefix $(top_srcdir)/include/sane/,config.h.in sanei.h \ sanei_codec_ascii.h sanei_codec_bin.h sanei_debug.h sanei_wire.h) OTHER_INCLUDES = $(addprefix $(top_srcdir)/include/,Makefile.in getopt.h \ lalloca.h) DISTFILES = $(SANE_INCLUDES) $(OTHER_INCLUDES) .PHONY: all clean depend dist install uninstall all: dist: $(DISTFILES) $(MKDIR) $(distdir)/include/sane for file in $(OTHER_INCLUDES); do \ ln $$file $(distdir)/include 2> /dev/null \ || cp -p $$file $(distdir)/include; \ done for file in $(SANE_INCLUDES); do \ ln $$file $(distdir)/include/sane 2> /dev/null \ || cp -p $$file $(distdir)/include/sane; \ done install: uninstall: clean: depend: distclean: clean rm -f *~ sane/*~ rm -f sane/config.h rm -f Makefile ./sane-frontends-1.0.14/include/getopt.h0000644000175000017500000001055507202714775016107 0ustar hmghmg/* Declarations for getopt. Copyright (C) 1989, 90, 91, 92, 93, 94 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. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #if defined (__STDC__) && __STDC__ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ extern int getopt (); extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); #endif /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* _GETOPT_H */ ./sane-frontends-1.0.14/include/lalloca.h0000644000175000017500000000263007202714775016207 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 The Free Software Foundation This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. This file implements a dynamic linking based SANE meta backend. It allows managing an arbitrary number of SANE backends by using dynamic linking to load backends on demand. */ #ifndef lalloca_h #define lalloca_h /* AIX requires this to be the first thing in the file. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ # if __STDC__ void *alloca (); # else char *alloca (); # endif # endif # endif # endif #endif #endif /* lalloca_h */ ./sane-frontends-1.0.14/lib/0000755000175000017500000000000010313255162013534 5ustar hmghmg./sane-frontends-1.0.14/lib/Makefile.in0000644000175000017500000000364107456077245015627 0ustar hmghmgSHELL = /bin/sh VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. PACKAGE = @PACKAGE@ VERSION = @VERSION@ distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION) 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 configdir = ${sysconfdir}/sane.d sanedatadir = ${datadir}/sane INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ RANLIB = @RANLIB@ CC = @CC@ INCLUDES = -I. -I$(srcdir) \ -I$(top_builddir)/include/sane -I$(top_srcdir)/include CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ DEFS = @DEFS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @SET_MAKE@ LIBLIB_OBJS = alloca.o getopt.o getopt1.o strndup.o \ strdup.o strsep.o snprintf.o usleep.o isfdtype.o \ vsyslog.o getenv.o LIBLIB_LTOBJS = alloca.lo getopt.lo getopt1.lo strndup.lo \ strdup.lo strsep.lo snprintf.lo usleep.lo isfdtype.lo \ vsyslog.lo getenv.lo TARGETS = $(LIBLIB_OBJS) TARGETS = liblib.a DISTFILES = Makefile.in alloca.c getenv.c getopt.c getopt1.c isfdtype.c \ snprintf.c strdup.c strndup.c strsep.c usleep.c vsyslog.c .PHONY: all check clean depend dist distclean install uninstall .SUFFIXES: .SUFFIXES: .c .o .c.o: $(COMPILE) $< @test -f $@ || $(COMPILE) $< all: $(TARGETS) liblib.a: $(LIBLIB_OBJS) ar r $@ $(LIBLIB_OBJS) $(RANLIB) $@ install: all uninstall: check: depend: makedepend -I. -I../include *.c clean: rm -f *.out *.o *.lo *~ *.a *.bak $(TESTPROGRAMS) rm -rf .libs distclean: clean rm -f Makefile dist: $(DISTFILES) for file in $(DISTFILES); do \ ln $$file $(distdir)/lib 2> /dev/null \ || cp -p $$file $(distdir)/lib ; \ done ./sane-frontends-1.0.14/lib/alloca.c0000644000175000017500000003342507332614205015146 0ustar hmghmg/* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #ifdef HAVE_CONFIG_H #include <../include/sane/config.h> #endif #ifndef HAVE_ALLOCA #ifdef emacs #include "blockinput.h" #endif /* If compiling with GCC 2, this file's not needed. */ #if !defined (__GNUC__) || __GNUC__ < 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ #ifndef alloca #ifdef emacs #ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ #ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time #endif /* STACK_DIRECTION undefined */ #endif /* static */ #endif /* emacs */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ #if defined (CRAY) && defined (CRAY_STACKSEG_END) long i00afunc (); #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) #else #define ADDRESS_FUNCTION(arg) &(arg) #endif #if __STDC__ typedef void *pointer; #else typedef char *pointer; #endif #define NULL 0 /* Different portions of Emacs need to call different versions of malloc. The Emacs executable needs alloca to call xmalloc, because ordinary malloc isn't protected from input signals. On the other hand, the utilities in lib-src need alloca to call malloc; some of them are very simple, and don't have an xmalloc routine. Non-Emacs programs expect this to call xmalloc. Callers below should use malloc. */ extern pointer malloc (); /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #ifndef STACK_DIRECTION #define STACK_DIRECTION 0 /* Direction unknown. */ #endif #if STACK_DIRECTION != 0 #define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ #else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ #define STACK_DIR stack_dir static void find_stack_direction () { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } #endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ #ifndef ALIGN_SIZE #define ALIGN_SIZE sizeof(double) #endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ pointer alloca (size) unsigned size; { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); #if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); #endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ #ifdef emacs BLOCK_INPUT; #endif for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free ((pointer) hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ #ifdef emacs UNBLOCK_INPUT; #endif } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { register pointer new = malloc (sizeof (header) + size); /* Address of header. */ ((header *) new)->h.next = last_alloca_header; ((header *) new)->h.deep = depth; last_alloca_header = (header *) new; /* User storage begins just after header. */ return (pointer) ((char *) new + sizeof (header)); } } #if defined (CRAY) && defined (CRAY_STACKSEG_END) #ifdef DEBUG_I00AFUNC #include #endif #ifndef CRAY_STACK #define CRAY_STACK #ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; #else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; #endif /* CRAY2 */ #endif /* not CRAY_STACK */ #ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } #else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); #endif if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o\n", pseg, size); #endif stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } #endif /* not CRAY2 */ #endif /* CRAY */ #endif /* no alloca */ #endif /* not GCC version 2 */ #endif /* !HAVE_ALLOCA */ ./sane-frontends-1.0.14/lib/getenv.c0000644000175000017500000000046407332614206015201 0ustar hmghmg#include "../include/sane/config.h" #ifndef HAVE_GETENV char * getenv(const char *name) { char *retval = 0; #ifdef HAVE_OS2_H if (0 != DosScanEnv (buf, &retval)) retval = 0; #else # error "Missing getenv() on this platform. Please implement." #endif return retval; } #endif /* !HAVE_GETENV */ ./sane-frontends-1.0.14/lib/getopt.c0000644000175000017500000005706507332614206015224 0ustar hmghmg/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO #define _NO_PROTO #endif #ifdef HAVE_CONFIG_H #include <../include/sane/config.h> #endif #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #if defined (_LIBC) || defined (HAVE_UNISTD_H) #include #endif #endif /* GNU C library. */ #ifdef VMS #include #if HAVE_STRING_H - 0 #include #endif #endif #ifdef WIN32 /* It's not Unix, really. See? Capital letters. */ #include #define getpid() GetCurrentProcessId() #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) #else # define _(msgid) (msgid) #endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* XXX 1003.2 says this must be 1 before any call. */ int optind = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return EOF with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ char *getenv (); static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ static const char *nonoption_flags; static int nonoption_flags_len; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize (const char *); #endif static const char * _getopt_initialize (optstring) const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind = 1; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; if (posixly_correct == NULL) { /* Bash 2.0 puts a special variable in the environment for each command it runs, specifying which ARGV elements are the results of file name wildcard expansion and therefore should not be considered as options. */ char var[100]; sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); nonoption_flags = getenv (var); if (nonoption_flags == NULL) nonoption_flags_len = 0; else nonoption_flags_len = strlen (nonoption_flags); } return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns `EOF'. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0) { optstring = _getopt_initialize (optstring); optind = 1; /* Don't scan ARGV[0], the program name. */ } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. */ #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && nonoption_flags[optind] == '1')) if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return EOF; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return EOF; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; #ifdef lint /* Suppress `used before initialized' warning. */ indfound = 0; #endif /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if (nameend - nextchar == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* _LIBC or not __GNU_LIBRARY__. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == EOF) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ ./sane-frontends-1.0.14/lib/getopt1.c0000644000175000017500000001027707332614207015300 0ustar hmghmg/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include <../include/sane/config.h> #endif #include "getopt.h" #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #else char *getenv (); #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* _LIBC or not __GNU_LIBRARY__. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == EOF) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ ./sane-frontends-1.0.14/lib/isfdtype.c0000644000175000017500000000075407332614210015535 0ustar hmghmg#include "../include/sane/config.h" #ifndef HAVE_ISFDTYPE #include int isfdtype(int fd, int fdtype) { struct stat st; if (fstat(fd, &st) == -1) return 0; /* couldn't stat fd */ if (st.st_mode == 0) return 1; /* At least Irix doesn't seem to know socket type */ #if defined(S_ISSOCK) return S_ISSOCK(st.st_mode) != 0; #elif defined(S_IFSOCK) && defined(S_IFMT) return (st.st_mode & S_IFMT) == S_IFSOCK; #else return 0; #endif } #endif /* !HAVE_ISFDTYPE */ ./sane-frontends-1.0.14/lib/snprintf.c0000644000175000017500000003637407332614210015560 0ustar hmghmg#include <../include/sane/config.h> #ifndef HAVE_SNPRINTF /*************************************************************************** * LPRng - An Extended Print Spooler System * * Copyright 1988-1997, Patrick Powell, San Diego, CA * papowell@sdsu.edu * See below for conditions of use. * *************************************************************************** * MODULE: snprintf.c * PURPOSE: LPRng version of printf - absolutely bombproof (hopefully!) **************************************************************************/ #if 0 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you are thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 7. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End #include "lp.h" #endif #include #include #include #define HAVE_STDARGS /* let's hope that works everywhere (mj) */ #define VA_LOCAL_DECL va_list ap; #define VA_START(f) va_start(ap, f) #define VA_SHIFT(v,t) ; /* no-op for ANSI */ #define VA_END va_end(ap) /**** ENDINCLUDE ****/ static char *const _id = "$Id: snprintf.c,v 1.2 2001/08/03 21:32:56 hmg Exp $"; /* * dopr(): poor man's version of doprintf */ static char * plp_Errormsg ( int err ); static void dopr( char *buffer, const char *format, va_list args ); static void fmtstr( char *value, int ljust, int len, int zpad, int precision ); static void fmtnum( long value, int base, int dosign, int ljust, int len, int zpad, int precision ); static void fmtdouble( int fmt, double value, int ljust, int len, int zpad, int precision ); static void dostr( char * ); static char *output; static void dopr_outch( int c ); static char *end; int visible_control = 1; /************************************************************** * Original: * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 * A bombproof version of doprnt (dopr) included. * Sigh. This sort of thing is always nasty do deal with. Note that * the version here does not include floating point... * * plp_snprintf() is used instead of sprintf() as it does limit checks * for string length. This covers a nasty loophole. * * The other functions are there to prevent NULL pointers from * causing nast effects. **************************************************************/ int vsnprintf(char *str, size_t count, const char *fmt, va_list args) { str[0] = 0; end = str+count-1; dopr( str, fmt, args ); if( count>0 ){ end[0] = 0; } return(strlen(str)); } /* VARARGS3 */ #ifdef HAVE_STDARGS int snprintf (char *str,size_t count,const char *fmt,...) #else int snprintf (va_alist) va_dcl #endif { #ifndef HAVE_STDARGS char *str; size_t count; char *fmt; #endif VA_LOCAL_DECL VA_START (fmt); VA_SHIFT (str, char *); VA_SHIFT (count, size_t ); VA_SHIFT (fmt, char *); (void) vsnprintf ( str, count, fmt, ap); VA_END; return( strlen( str ) ); } static void dopr( char *buffer, const char *format, va_list args ) { int ch; long value; int longflag = 0; char *strvalue; int ljust; int len; int zpad; int precision; int set_precision; double dval; int err = errno; output = buffer; while( (ch = *format++) ){ switch( ch ){ case '%': ljust = len = zpad = 0; precision = -1; set_precision = 0; nextch: ch = *format++; switch( ch ){ case 0: dostr( "**end of format**" ); return; case '-': ljust = 1; goto nextch; case '.': set_precision = 1; precision = 0; goto nextch; case '*': len = va_arg( args, int ); goto nextch; case '0': /* set zero padding if len not set */ if(len==0 && set_precision == 0 ) zpad = '0'; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if( set_precision ){ precision = precision*10 + ch - '0'; } else { len = len*10 + ch - '0'; } goto nextch; case 'l': longflag = 1; goto nextch; case 'u': case 'U': /*fmtnum(value,base,dosign,ljust,len, zpad, precision) */ if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 10,0, ljust, len, zpad, precision ); break; case 'o': case 'O': /*fmtnum(value,base,dosign,ljust,len, zpad, precision) */ if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 8,0, ljust, len, zpad, precision ); break; case 'd': case 'D': if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 10,1, ljust, len, zpad, precision ); break; case 'x': if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 16,0, ljust, len, zpad, precision ); break; case 'X': if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value,-16,0, ljust, len, zpad, precision ); break; case 's': strvalue = va_arg( args, char *); fmtstr( strvalue,ljust,len, zpad, precision ); break; case 'c': ch = va_arg( args, int ); { char b[2]; int vsb = visible_control; b[0] = ch; b[1] = 0; visible_control = 0; fmtstr( b,ljust,len, zpad, precision ); visible_control = vsb; } break; case 'f': case 'g': dval = va_arg( args, double ); fmtdouble( ch, dval,ljust,len, zpad, precision ); break; case 'm': fmtstr( plp_Errormsg(err),ljust,len, zpad, precision ); break; case '%': dopr_outch( ch ); continue; default: dostr( "???????" ); } longflag = 0; break; default: dopr_outch( ch ); break; } } *output = 0; } /* * Format '%[-]len[.precision]s' * - = left justify (ljust) * len = minimum length * precision = numbers of chars in string to use */ static void fmtstr( char *value, int ljust, int len, int zpad, int precision ) { int padlen, strlen, i, c; /* amount to pad */ if( value == 0 ){ value = ""; } if( precision > 0 ){ strlen = precision; } else { /* cheap strlen so you do not have library call */ for( strlen = 0; (c=value[strlen]); ++ strlen ){ if( visible_control && iscntrl( c ) && !isspace( c ) ){ ++strlen; } } } padlen = len - strlen; if( padlen < 0 ) padlen = 0; if( ljust ) padlen = -padlen; while( padlen > 0 ) { dopr_outch( ' ' ); --padlen; } /* output characters */ for( i = 0; (c = value[i]); ++i ){ if( visible_control && iscntrl( c ) && !isspace( c ) ){ dopr_outch('^'); c = ('@' | (c & 0x1F)); } dopr_outch(c); } while( padlen < 0 ) { dopr_outch( ' ' ); ++padlen; } } static void fmtnum( long value, int base, int dosign, int ljust, int len, int zpad, int precision ) { int signvalue = 0; unsigned long uvalue; char convert[20]; int place = 0; int padlen = 0; /* amount to pad */ int caps = 0; /* DEBUGP(("value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n", value, base, dosign, ljust, len, zpad )); */ uvalue = value; if( dosign ){ if( value < 0 ) { signvalue = '-'; uvalue = -value; } } if( base < 0 ){ caps = 1; base = -base; } do{ convert[place++] = (caps? "0123456789ABCDEF":"0123456789abcdef") [uvalue % (unsigned)base ]; uvalue = (uvalue / (unsigned)base ); }while(uvalue); convert[place] = 0; padlen = len - place; if( padlen < 0 ) padlen = 0; if( ljust ) padlen = -padlen; /* DEBUGP(( "str '%s', place %d, sign %c, padlen %d\n", convert,place,signvalue,padlen)); */ if( zpad && padlen > 0 ){ if( signvalue ){ dopr_outch( signvalue ); --padlen; signvalue = 0; } while( padlen > 0 ){ dopr_outch( zpad ); --padlen; } } while( padlen > 0 ) { dopr_outch( ' ' ); --padlen; } if( signvalue ) dopr_outch( signvalue ); while( place > 0 ) dopr_outch( convert[--place] ); while( padlen < 0 ){ dopr_outch( ' ' ); ++padlen; } } static void fmtdouble( int fmt, double value, int ljust, int len, int zpad, int precision ) { char convert[128]; char fmtstr[128]; int l; if( len == 0 ) len = 10; if( len > sizeof(convert) - 10 ){ len = sizeof(convert) - 10; } if( precision > sizeof(convert) - 10 ){ precision = sizeof(convert) - 10; } if( precision > len ) precision = len; strcpy( fmtstr, "%" ); if( ljust ) strcat(fmtstr, "-" ); if( len ){ sprintf( fmtstr+strlen(fmtstr), "%d", len ); } if( precision > 0 ){ sprintf( fmtstr+strlen(fmtstr), ".%d", precision ); } l = strlen( fmtstr ); fmtstr[l] = fmt; fmtstr[l+1] = 0; sprintf( convert, fmtstr, value ); dostr( convert ); } static void dostr( char *str ) { while(*str) dopr_outch(*str++); } static void dopr_outch( int c ) { if( end == 0 || output < end ){ *output++ = c; } } /**************************************************************************** * static char *plp_errormsg( int err ) * returns a printable form of the * errormessage corresponding to the valie of err. * This is the poor man's version of sperror(), not available on all systems * Patrick Powell Tue Apr 11 08:05:05 PDT 1995 ****************************************************************************/ /****************************************************************************/ #if !defined(HAVE_STRERROR) # if defined(HAVE_SYS_NERR) # if !defined(HAVE_SYS_NERR_DEF) extern int sys_nerr; # endif # define num_errors (sys_nerr) # else # define num_errors (-1) /* always use "errno=%d" */ # endif # if defined(HAVE_SYS_ERRLIST) # if !defined(HAVE_SYS_ERRLIST_DEF) extern const char *const sys_errlist[]; # endif # else # undef num_errors # define num_errors (-1) /* always use "errno=%d" */ # endif #endif static char * plp_Errormsg ( int err ) { char *cp; #if defined(HAVE_STRERROR) cp = (void *)strerror(err); #else # if defined(HAVE_SYS_ERRLIST) if (err >= 0 && err < num_errors) { cp = (void *)sys_errlist[err]; } else # endif { static char msgbuf[32]; /* holds "errno=%d". */ /* SAFE use of sprintf */ (void) sprintf (msgbuf, "errno=%d", err); cp = msgbuf; } #endif return (cp); } #if defined(TEST) #include int main( void ) { char buffer[128]; char *t; char *test1 = "01234"; errno = 1; plp_snprintf( buffer, sizeof(buffer), (t="errno '%m'")); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%-12s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12.2s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%-12.2s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.25 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.2345 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12g"), 1.25 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12.2g"), 1.25 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%0*d"), 6, 1 ); printf( "%s = '%s'\n", t, buffer ); return(0); } #endif #endif /* HAVE_SNPRINTF */ ./sane-frontends-1.0.14/lib/strdup.c0000644000175000017500000000214707332614211015226 0ustar hmghmg/* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <../include/sane/config.h> #include #include #ifndef HAVE_STRDUP char * strdup (const char * s) { char *clone; size_t size; size = strlen (s) + 1; clone = malloc (size); memcpy (clone, s, size); return clone; } #endif /* !HAVE_STRDUP */ ./sane-frontends-1.0.14/lib/strndup.c0000644000175000017500000000216607332614211015405 0ustar hmghmg/* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <../include/sane/config.h> #ifndef HAVE_STRNDUP #include #include #include char * strndup (const char * s, size_t n) { char *clone; clone = malloc (n + 1); strncpy (clone, s, n); clone[n] = '\0'; return clone; } #endif /* !HAVE_STRNDUP */ ./sane-frontends-1.0.14/lib/strsep.c0000644000175000017500000000260307332614212015223 0ustar hmghmg/* Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <../include/sane/config.h> #include #ifndef HAVE_STRSEP char * strsep (char **stringp, const char *delim) { char *begin, *end; begin = *stringp; if (! begin || *begin == '\0') return NULL; /* Find the end of the token. */ end = strpbrk (begin, delim); if (end) { /* Terminate the token and set *STRINGP past NUL character. */ *end++ = '\0'; *stringp = end; } else /* No more delimiters; this is the last token. */ *stringp = NULL; return begin; } #endif /* !HAVE_STRSEP */ ./sane-frontends-1.0.14/lib/usleep.c0000644000175000017500000000326210016077125015201 0ustar hmghmg/* Copyright (C) 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef __TANDEM #include #endif #include <../include/sane/config.h> #ifndef HAVE_USLEEP #include #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef apollo # include # include static time_$clock_t DomainTime100mS = { 0, 100000/4 }; static status_$t DomainStatus; #endif /* Sleep USECONDS microseconds, or until a previously set timer goes off. */ unsigned int usleep (unsigned int useconds) { #ifdef apollo /* The usleep function does not work under the SYS5.3 environment. Use the Domain/OS time_$wait call instead. */ time_$wait (time_$relative, DomainTime100mS, &DomainStatus); #else struct timeval delay; delay.tv_sec = 0; delay.tv_usec = useconds; select (0, 0, 0, 0, &delay); return 0; #endif } #endif /* !HAVE_USLEEP */ ./sane-frontends-1.0.14/lib/vsyslog.c0000644000175000017500000000046207332614212015412 0ustar hmghmg#include "../include/sane/config.h" #include "stdio.h" #include #include #ifndef HAVE_VSYSLOG void vsyslog(int priority, const char *format, va_list args) { char buf[1024]; vsnprintf(buf, sizeof(buf), format, args); syslog(priority, "%s", buf); } #endif /* !HAVE_VSYSLOG */ ./sane-frontends-1.0.14/sanei/0000755000175000017500000000000010313255162014065 5ustar hmghmg./sane-frontends-1.0.14/sanei/Makefile.in0000644000175000017500000000370407456077247016162 0ustar hmghmgSHELL = /bin/sh VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. PACKAGE = @PACKAGE@ VERSION = @VERSION@ distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION) 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 configdir = ${sysconfdir}/sane.d sanedatadir = ${datadir}/sane INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ RANLIB = @RANLIB@ CC = @CC@ INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ @SANE_CFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ DEFS = @DEFS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) MCOMP = --mode=compile MLINK = --mode=link @SET_MAKE@ LIBSANEI_OBJS = sanei_init_debug.o \ sanei_wire.o sanei_codec_ascii.o sanei_codec_bin.o \ sanei_save_values.o sanei_load_values.o LIBSANEI_LTOBJS = sanei_init_debug.lo \ sanei_wire.lo sanei_codec_ascii.lo sanei_codec_bin.lo \ sanei_save_values.lo sanei_load_values.lo TARGETS = libsanei.a DISTFILES = Makefile.in sanei_codec_ascii.c sanei_codec_bin.c \ sanei_init_debug.c sanei_load_values.c sanei_save_values.c \ sanei_thread.c sanei_wire.c .PHONY: all install check depend clean distclean uninstall dist .SUFFIXES: .SUFFIXES: .c .o .c.o: $(COMPILE) $< @test -f $@ || $(COMPILE) $< all: $(TARGETS) libsanei.a: $(LIBSANEI_OBJS) ar r $@ $(LIBSANEI_OBJS) $(RANLIB) $@ install: uninstall: depend: makedepend -I. -I../include *.c clean: rm -f *.out *.o *.lo *~ *.a *.bak $(OBJS) rm -rf .libs distclean: clean rm -f Makefile dist: $(DISTFILES) for file in $(DISTFILES); do \ ln $$file $(distdir)/sanei 2> /dev/null \ || cp -p $$file $(distdir)/sanei ; \ done ./sane-frontends-1.0.14/sanei/sanei_codec_ascii.c0000644000175000017500000001561107202713256017647 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "sane/config.h" #include #include #include #include #include #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_ascii.h" static const char *hexdigit = "0123456789abcdef"; static void skip_ws (Wire *w) { while (1) { sanei_w_space (w, 1); if (w->status != 0) return; if (!isspace (*w->buffer.curr)) return; ++w->buffer.curr; } } static unsigned get_digit (Wire *w) { unsigned digit; sanei_w_space (w, 1); digit = tolower(*w->buffer.curr++) - '0'; if (digit > 9) digit -= 'a' - ('9' + 1); if (digit > 0xf) { w->status = EINVAL; return 0; } return digit; } static SANE_Byte get_byte (Wire *w) { return get_digit (w) << 4 | get_digit (w); } static void ascii_w_byte (Wire *w, void *v) { SANE_Byte *b = v; switch (w->direction) { case WIRE_ENCODE: sanei_w_space (w, 3); *w->buffer.curr++ = hexdigit[(*b >> 4) & 0x0f]; *w->buffer.curr++ = hexdigit[(*b >> 0) & 0x0f]; *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: skip_ws (w); *b = get_byte (w); break; case WIRE_FREE: break; } } static void ascii_w_char (Wire *w, void *v) { SANE_Char *c = v; switch (w->direction) { case WIRE_ENCODE: sanei_w_space (w, 5); *w->buffer.curr++ = '\''; if (*c == '\'' || *c == '\\') *w->buffer.curr++ = '\\'; *w->buffer.curr++ = *c; *w->buffer.curr++ = '\''; *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: sanei_w_space (w, 4); if (*w->buffer.curr++ != '\'') { w->status = EINVAL; return; } *c = *w->buffer.curr++; if (*c == '\\') { sanei_w_space (w, 2); *c = *w->buffer.curr++; } if (*w->buffer.curr++ != '\'') { w->status = EINVAL; return; } break; case WIRE_FREE: break; } } static void ascii_w_string (Wire *w, void *v) { size_t len, alloced_len; SANE_String *s = v; char * str, ch; int done; switch (w->direction) { case WIRE_ENCODE: if (*s) { sanei_w_space (w, 1); *w->buffer.curr++ = '"'; str = *s; while ((ch = *str++)) { sanei_w_space (w, 2); if (ch == '"' || ch == '\\') *w->buffer.curr++ = '\\'; *w->buffer.curr++ = ch; } *w->buffer.curr++ = '"'; } else { sanei_w_space (w, 5); *w->buffer.curr++ = '('; *w->buffer.curr++ = 'n'; *w->buffer.curr++ = 'i'; *w->buffer.curr++ = 'l'; *w->buffer.curr++ = ')'; } sanei_w_space (w, 1); *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: skip_ws (w); sanei_w_space (w, 1); ch = *w->buffer.curr++; if (ch == '"') { alloced_len = len = 0; str = 0; done = 0; do { sanei_w_space (w, 1); if (w->status != 0) return; ch = *w->buffer.curr++; if (ch == '"') done = 1; if (ch == '\\') { sanei_w_space (w, 1); ch = *w->buffer.curr++; } if (len >= alloced_len) { alloced_len += 1024; if (!str) str = malloc (alloced_len); else str = realloc (str, alloced_len); if (str == 0) { /* Malloc failed, so return an error. */ w->status = ENOMEM; return; } } str[len++] = ch; } while (!done); str[len - 1] = '\0'; *s = realloc (str, len); if (*s == 0) { /* Malloc failed, so return an error. */ w->status = ENOMEM; return; } } else if (ch == '(') { sanei_w_space (w, 4); if ( *w->buffer.curr++ != 'n' || *w->buffer.curr++ != 'i' || *w->buffer.curr++ != 'l' || *w->buffer.curr++ != ')') { w->status = EINVAL; return; } *s = 0; } else { w->status = EINVAL; return; } break; case WIRE_FREE: if (*s) free (*s); break; } } static void ascii_w_word (Wire *w, void *v) { SANE_Word val, *word = v; int i, is_negative = 0; char buf[16]; switch (w->direction) { case WIRE_ENCODE: val = *word; i = sizeof (buf) - 1; if (val < 0) { is_negative = 1; val = -val; } do { buf[i--] = '0' + (val % 10); val /= 10; } while (val); if (is_negative) buf[i--] = '-'; sanei_w_space (w, sizeof (buf) - i); memcpy (w->buffer.curr, buf + i + 1, sizeof (buf) - i - 1); w->buffer.curr += sizeof (buf) - i - 1; *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: skip_ws (w); val = 0; sanei_w_space (w, 1); if (*w->buffer.curr == '-') { is_negative = 1; ++w->buffer.curr; } while (1) { sanei_w_space (w, 1); if (w->status != 0) return; if (!isdigit (*w->buffer.curr)) break; val = 10*val + (*w->buffer.curr++ - '0'); } *word = is_negative ? -val : val; break; case WIRE_FREE: break; } } void sanei_codec_ascii_init (Wire *w) { w->codec.w_byte = ascii_w_byte; w->codec.w_char = ascii_w_char; w->codec.w_word = ascii_w_word; w->codec.w_string = ascii_w_string; } ./sane-frontends-1.0.14/sanei/sanei_codec_bin.c0000644000175000017500000000712710162607323017326 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "sane/config.h" #include #include #include #include #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_bin.h" static void bin_w_byte (Wire *w, void *v) { SANE_Byte *b = v; sanei_w_space (w, 1); if (w->status) return; switch (w->direction) { case WIRE_ENCODE: *w->buffer.curr++ = *b; break; case WIRE_DECODE: *b = *w->buffer.curr++; break; case WIRE_FREE: break; } } static void bin_w_string (Wire *w, void *v) { SANE_Word len; SANE_String *s = v; if (w->direction != WIRE_DECODE) { len = 0; if (*s) len = strlen (*s) + 1; } sanei_w_array (w, &len, v, w->codec.w_byte, 1); if (w->direction == WIRE_DECODE) { if (len == 0) *s = 0; else if (w->status == 0) *(*s + len - 1) = '\0'; } } static void bin_w_word (Wire *w, void *v) { SANE_Word val, *word = v; sanei_w_space (w, 4); if (w->status) return; switch (w->direction) { case WIRE_ENCODE: val = *word; /* store in bigendian byte-order: */ w->buffer.curr[0] = (val >> 24) & 0xff; w->buffer.curr[1] = (val >> 16) & 0xff; w->buffer.curr[2] = (val >> 8) & 0xff; w->buffer.curr[3] = (val >> 0) & 0xff; w->buffer.curr += 4; break; case WIRE_DECODE: val = ( ((w->buffer.curr[0] & 0xff) << 24) | ((w->buffer.curr[1] & 0xff) << 16) | ((w->buffer.curr[2] & 0xff) << 8) | ((w->buffer.curr[3] & 0xff) << 0)); *word = val; w->buffer.curr += 4; break; case WIRE_FREE: break; } } void sanei_codec_bin_init (Wire *w) { w->codec.w_byte = bin_w_byte; w->codec.w_char = bin_w_byte; w->codec.w_word = bin_w_word; w->codec.w_string = bin_w_string; } ./sane-frontends-1.0.14/sanei/sanei_init_debug.c0000644000175000017500000000667707325354406017553 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "sane/config.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #ifdef HAVE_OS2_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #include #ifdef HAVE_OS2_H # define INCL_DOS # include #endif #define BACKEND_NAME sanei_debug #include "../include/sane/sanei_debug.h" void sanei_init_debug (const char * backend, int * var) { char ch, buf[256] = "SANE_DEBUG_"; const char * val; unsigned int i; *var = 0; for (i = 11; (ch = backend[i - 11]) != 0; ++i) { if (i >= sizeof (buf) - 1) break; buf[i] = toupper(ch); } buf[i] = '\0'; val = getenv (buf); if (!val) return; *var = atoi (val); DBG (0, "Setting debug level of %s to %d.\n", backend, *var); } void sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap) { char *msg; if (max_level >= level) { if ( 1 == isfdtype(fileno(stderr), S_IFSOCK) ) { msg = (char *)malloc (sizeof(char) * (strlen(be) + strlen(fmt) + 4)); if (msg == NULL) { syslog (LOG_DEBUG, "[sanei_debug] malloc() failed\n"); vsyslog (LOG_DEBUG, fmt, ap); } else { sprintf (msg, "[%s] %s", be, fmt); vsyslog(LOG_DEBUG, msg, ap); free (msg); } } else { fprintf (stderr, "[%s] ", be); vfprintf (stderr, fmt, ap); } } } #ifdef NDEBUG void sanei_debug_ndebug (int level, const char *fmt, ...) { /* this function is never called */ } #endif ./sane-frontends-1.0.14/sanei/sanei_load_values.c0000644000175000017500000001415310016077125017713 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file implements a routine to restore option values saved to a file (using sanei_save_values()). This is a bit tricky since setting an option may change the availability of other options. The problem is that we don't know the order of the set-value calls that resulted in the saved set of option values. One solution might be to simply keep setting all option values until we no longer get any changes to the option value set. However, that has the potential for live-lock. Instead, we keep track of what options caused a SANE_INFO_RELOAD_OPTIONS. For such options, their value is set exactly once. This guarantees convergence after a bounded (and usually small) number of iterations. The resulting value set is guaranteed to be the desired (saved) one as long as setting an option that affects availability of other options does not "lose" its value by setting another option. I don't think any sane backend would do this and since this is SANE, we just proved that this algorithm works perfectly. */ #ifdef __TANDEM #include #endif #ifdef _AIX # include /* MUST come first for AIX! */ #endif #include "sane/config.h" #include #include #include #include #ifdef HAVE_LIBC_H # include /* NeXTStep/OpenStep */ #endif #include #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_ascii.h" #define BITS_PER_LONG (8*sizeof (u_long)) #define SET(set, bit) \ ((set)[(bit)/BITS_PER_LONG] |= (1UL << (bit)%BITS_PER_LONG)) #define IS_SET(set, bit) \ (((set)[(bit)/BITS_PER_LONG] & (1UL << (bit)%BITS_PER_LONG)) != 0) int sanei_load_values (int fd, SANE_Handle device) { const SANE_Option_Descriptor *opt; SANE_Word *word_array; SANE_String name, str; u_long *caused_reload; SANE_Int num_options; SANE_Status status; int i, keep_going; SANE_Word word; SANE_Int info; off_t offset; size_t size; char *buf; Wire w; offset = lseek (fd, 0, SEEK_CUR); w.io.fd = fd; #ifdef __TANDEM w.io.read = floss_read; w.io.write = floss_write; #else w.io.read = read; w.io.write = write; #endif sanei_w_init (&w, sanei_codec_ascii_init); sanei_w_set_dir (&w, WIRE_DECODE); keep_going = 0; sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_options, 0); size = (num_options + BITS_PER_LONG - 1) / BITS_PER_LONG * sizeof (long); caused_reload = alloca (size); memset (caused_reload, 0, size); while (1) { sanei_w_space (&w, 3); if (!w.status) sanei_w_string (&w, &name); if (w.status) { if (keep_going) { lseek (fd, offset, SEEK_SET); sanei_w_set_dir (&w, WIRE_DECODE); keep_going = 0; continue; } return 0; } status = SANE_STATUS_GOOD; info = 0; for (i = 1; (opt = sane_get_option_descriptor (device, i)); ++i) { if (!opt->name || strcmp (opt->name, name) != 0) continue; if (IS_SET(caused_reload, i)) continue; switch (opt->type) { case SANE_TYPE_BOOL: case SANE_TYPE_INT: case SANE_TYPE_FIXED: if (opt->size == sizeof (SANE_Word)) { sanei_w_word (&w, &word); status = sane_control_option (device, i, SANE_ACTION_SET_VALUE, &word, &info); } else { SANE_Int len; sanei_w_array (&w, &len, (void **) &word_array, (WireCodecFunc) sanei_w_word, sizeof (SANE_Word)); status = sane_control_option (device, i, SANE_ACTION_SET_VALUE, word_array, &info); w.direction = WIRE_FREE; sanei_w_array (&w, &len, (void **) &word_array, (WireCodecFunc) sanei_w_word, sizeof (SANE_Word)); w.direction = WIRE_DECODE; } break; case SANE_TYPE_STRING: sanei_w_string (&w, &str); buf = malloc (opt->size); strncpy (buf, str, opt->size); buf[opt->size - 1] = '\0'; sanei_w_free (&w, (WireCodecFunc) sanei_w_string, &str); status = sane_control_option (device, i, SANE_ACTION_SET_VALUE, buf, &info); break; case SANE_TYPE_BUTTON: case SANE_TYPE_GROUP: break; } break; } sanei_w_free (&w, (WireCodecFunc) sanei_w_string, &name); if (status == SANE_STATUS_GOOD && (info & SANE_INFO_RELOAD_OPTIONS)) { SET (caused_reload, i); keep_going = 1; } } return 0; } ./sane-frontends-1.0.14/sanei/sanei_save_values.c0000644000175000017500000001125110016077125017726 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #ifdef __TANDEM #include #endif #include "sane/config.h" #include #include #include #ifdef HAVE_LIBC_H # include /* NeXTStep/OpenStep */ #endif #include #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_ascii.h" int sanei_save_values (int fd, SANE_Handle device) { const SANE_Option_Descriptor *opt; size_t word_array_size = 0; SANE_Word *word_array = 0; size_t str_size = 0; SANE_String str = 0; SANE_Word word; Wire w; int i; w.io.fd = fd; #ifdef __TANDEM w.io.read = floss_read; w.io.write = floss_write; #else w.io.read = read; w.io.write = write; #endif sanei_w_init (&w, sanei_codec_ascii_init); sanei_w_set_dir (&w, WIRE_ENCODE); for (i = 0; (opt = sane_get_option_descriptor (device, i)); ++i) { if ((opt->cap & (SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT)) != (SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT) || !opt->name) /* if we can't query AND set the option, don't bother saving it */ continue; switch (opt->type) { case SANE_TYPE_BOOL: case SANE_TYPE_INT: case SANE_TYPE_FIXED: if (opt->size == sizeof (SANE_Word)) { if (sane_control_option (device, i, SANE_ACTION_GET_VALUE, &word, 0) != SANE_STATUS_GOOD) continue; sanei_w_string (&w, (SANE_String *) &opt->name); sanei_w_word (&w, &word); } else { SANE_Int len = opt->size / sizeof (SANE_Word); if (opt->size > word_array_size) { word_array_size = ((opt->size + 32*sizeof (SANE_Word)) & ~(32*sizeof (SANE_Word) - 1)); if (word_array) word_array = realloc (word_array, word_array_size); else word_array = malloc (word_array_size); if (word_array == 0) { /* Malloc failed, so return an error. */ w.status = ENOMEM; return 1; } } if (sane_control_option (device, i, SANE_ACTION_GET_VALUE, word_array, 0) != SANE_STATUS_GOOD) continue; sanei_w_string (&w, (SANE_String *) &opt->name); sanei_w_array (&w, &len, (void **) &word_array, (WireCodecFunc) sanei_w_word, sizeof (SANE_Word)); } break; case SANE_TYPE_STRING: if (opt->size > str_size) { str_size = (opt->size + 1024) & ~1023; if (str) str = realloc (str, str_size); else str = malloc (str_size); if (str == 0) { /* Malloc failed, so return an error. */ w.status = ENOMEM; return 1; } } if (sane_control_option (device, i, SANE_ACTION_GET_VALUE, str, 0) != SANE_STATUS_GOOD) continue; sanei_w_string (&w, (SANE_String *) &opt->name); sanei_w_string (&w, &str); break; case SANE_TYPE_BUTTON: case SANE_TYPE_GROUP: break; } } sanei_w_set_dir (&w, WIRE_DECODE); if (word_array) free (word_array); if (str) free (str); return 0; } ./sane-frontends-1.0.14/sanei/sanei_thread.c0000644000175000017500000002240610162607323016665 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1998-2001 Yuri Dario Copyright (C) 2003-2004 Gerhard Jaeger (pthread/process support) This file is part of the SANE package. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. OS/2 Helper functions for the OS/2 port (using threads instead of forked processes). Don't use them in the backends, they are used automatically by macros. Other OS: use this lib, if you intend to let run your reader function within its own task (thread or process). Depending on the OS and/or the configure settings pthread or fork is used to achieve this goal. */ #include "sane/config.h" #include #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_OS2_H # define INCL_DOSPROCESS # include #endif #if !defined USE_PTHREAD && !defined HAVE_OS2_H # include #endif #if defined USE_PTHREAD # include #endif #define BACKEND_NAME sanei_thread /**< name of this module for debugging */ #include #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_thread.h" #ifndef _VAR_NOT_USED # define _VAR_NOT_USED(x) ((x)=(x)) #endif typedef struct { int (*func)( void* ); SANE_Status status; void *func_data; } ThreadDataDef, *pThreadDataDef; static ThreadDataDef td; /** for init issues - here only for the debug output */ void sanei_thread_init( void ) { DBG_INIT(); memset( &td, 0, sizeof(ThreadDataDef)); td.status = SANE_STATUS_GOOD; } SANE_Bool sanei_thread_is_forked( void ) { #if defined USE_PTHREAD || defined HAVE_OS2_H return SANE_FALSE; #else return SANE_TRUE; #endif } int sanei_thread_kill( int pid ) { DBG(2, "sanei_thread_kill() will kill %d\n", (int)pid); #ifdef USE_PTHREAD #if defined (__APPLE__) && defined (__MACH__) return pthread_kill((pthread_t)pid, SIGUSR2); #else return pthread_cancel((pthread_t)pid); #endif #elif defined HAVE_OS2_H return DosKillThread(pid); #else return kill( pid, SIGTERM ); #endif } #ifdef HAVE_OS2_H static void local_thread( void *arg ) { pThreadDataDef ltd = (pThreadDataDef)arg; DBG( 2, "thread started, calling func() now...\n" ); ltd->status = ltd->func( ltd->func_data ); DBG( 2, "func() done - status = %d\n", ltd->status ); _endthread(); } /* * starts a new thread or process * parameters: * star address of reader function * args pointer to scanner data structure * */ int sanei_thread_begin( int (*func)(void *args), void* args ) { int pid; td.func = func; td.func_data = args; pid = _beginthread( local_thread, NULL, 1024*1024, (void*)&td ); if ( pid == -1 ) { DBG( 1, "_beginthread() failed\n" ); return -1; } DBG( 2, "_beginthread() created thread %d\n", pid ); return pid; } int sanei_thread_waitpid( int pid, int *status ) { if (status) *status = 0; return pid; /* DosWaitThread( (TID*) &pid, DCWW_WAIT);*/ } int sanei_thread_sendsig( int pid, int sig ) { return 0; } #else /* HAVE_OS2_H */ #ifdef USE_PTHREAD /* seems to be undefined in MacOS X */ #ifndef PTHREAD_CANCELED # define PTHREAD_CANCELED ((void *) -1) #endif /** */ #if defined (__APPLE__) && defined (__MACH__) static void thread_exit_handler( int signo ) { DBG( 2, "signal(%i) caught, calling pthread_exit now...\n", signo ); pthread_exit( PTHREAD_CANCELED ); } #endif static void* local_thread( void *arg ) { static int status; pThreadDataDef ltd = (pThreadDataDef)arg; #if defined (__APPLE__) && defined (__MACH__) struct sigaction act; sigemptyset(&(act.sa_mask)); act.sa_flags = 0; act.sa_handler = thread_exit_handler; sigaction( SIGUSR2, &act, 0 ); #else int old; pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, &old ); pthread_setcanceltype ( PTHREAD_CANCEL_ASYNCHRONOUS, &old ); #endif DBG( 2, "thread started, calling func() now...\n" ); status = ltd->func( ltd->func_data ); /* so sanei_thread_get_status() will work correctly... */ ltd->status = status; DBG( 2, "func() done - status = %d\n", status ); /* return the status, so pthread_join is able to get it*/ pthread_exit((void*)&status ); } /** */ static void restore_sigpipe( void ) { struct sigaction act; if( sigaction( SIGPIPE, NULL, &act ) == 0 ) { if( act.sa_handler == SIG_IGN ) { sigemptyset( &act.sa_mask ); act.sa_flags = 0; act.sa_handler = SIG_DFL; DBG( 2, "restoring SIGPIPE to SIG_DFL\n" ); sigaction( SIGPIPE, &act, NULL ); } } } #else /* the process stuff */ static int eval_wp_result( int pid, int wpres, int pf ) { int retval = SANE_STATUS_IO_ERROR; if( wpres == pid ) { if( WIFEXITED(pf)) { retval = WEXITSTATUS(pf); } else { if( !WIFSIGNALED(pf)) { retval = SANE_STATUS_GOOD; } else { DBG( 1, "Child terminated by signal %d\n", WTERMSIG(pf)); if( WTERMSIG(pf) == SIGTERM ) retval = SANE_STATUS_GOOD; } } } return retval; } #endif int sanei_thread_begin( int (func)(void *args), void* args ) { int pid; #ifdef USE_PTHREAD struct sigaction act; pthread_t thread; /* if signal handler for SIGPIPE is SIG_DFL, replace by SIG_IGN */ if( sigaction( SIGPIPE, NULL, &act ) == 0 ) { if( act.sa_handler == SIG_DFL ) { sigemptyset( &act.sa_mask ); act.sa_flags = 0; act.sa_handler = SIG_IGN; DBG( 2, "setting SIGPIPE to SIG_IGN\n" ); sigaction( SIGPIPE, &act, NULL ); } } td.func = func; td.func_data = args; pid = pthread_create( &thread, NULL, local_thread, &td ); usleep( 1 ); if ( pid != 0 ) { DBG( 1, "pthread_create() failed with %d\n", pid ); return -1; } DBG( 2, "pthread_create() created thread %d\n", (int)thread ); return (int)thread; #else pid = fork(); if( pid < 0 ) { DBG( 1, "fork() failed\n" ); return -1; } if( pid == 0 ) { /* run in child context... */ int status = func( args ); /* don't use exit() since that would run the atexit() handlers */ _exit( status ); } /* parents return */ return pid; #endif } int sanei_thread_sendsig( int pid, int sig ) { #ifdef USE_PTHREAD DBG(2, "sanei_thread_sendsig() %d to thread(id=%d)\n", sig, pid); return pthread_kill((pthread_t)pid, sig ); #else DBG(2, "sanei_thread_sendsig() %d to process (id=%d)\n", sig, pid); return kill( pid, sig ); #endif } int sanei_thread_waitpid( int pid, int *status ) { #ifdef USE_PTHREAD int *ls; #else int ls; #endif int result, stat; stat = 0; DBG(2, "sanei_thread_waitpid() - %d\n", pid); #ifdef USE_PTHREAD result = pthread_join((pthread_t)pid, (void*)&ls ); if( 0 == result ) { if( PTHREAD_CANCELED == ls ) { DBG(2, "* thread has been canceled!\n" ); stat = SANE_STATUS_GOOD; } else { stat = *ls; } DBG(2, "* result = %d (%p)\n", stat, (void*)status ); result = pid; } /* call detach in any case to make sure that the thread resources * will be freed, when the thread has terminated */ DBG(2, "* detaching thread(%d)\n", pid ); pthread_detach((pthread_t)pid); if (status) *status = stat; restore_sigpipe(); #else result = waitpid( pid, &ls, 0 ); if((result < 0) && (errno == ECHILD)) { stat = SANE_STATUS_GOOD; result = pid; } else { stat = eval_wp_result( pid, result, ls ); DBG(2, "* result = %d (%p)\n", stat, (void*)status ); } if( status ) *status = stat; #endif return result; } #endif /* HAVE_OS2_H */ SANE_Status sanei_thread_get_status( int pid ) { #if defined USE_PTHREAD || defined HAVE_OS2_H _VAR_NOT_USED( pid ); return td.status; #else int ls, stat, result; stat = SANE_STATUS_IO_ERROR; if( pid > 0 ) { result = waitpid( pid, &ls, WNOHANG ); stat = eval_wp_result( pid, result, ls ); } return stat; #endif } /* END sanei_thread.c .......................................................*/ ./sane-frontends-1.0.14/sanei/sanei_wire.c0000644000175000017500000004362710162607323016374 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "sane/config.h" #include #include #include #include #include #include "../include/sane/sanei_wire.h" #define BACKEND_NAME sanei_wire #include "../include/sane/sanei_debug.h" void sanei_w_space (Wire * w, size_t howmuch) { size_t nbytes, left_over; int fd = w->io.fd; ssize_t nread, nwritten; DBG (3, "sanei_w_space: %lu bytes for wire %d\n", (u_long) howmuch, fd); if (howmuch > w->buffer.size) DBG (2, "sanei_w_space: bigger than buffer (%lu bytes), " "may be flush()\n", (u_long) w->buffer.size); if (w->status != 0) { DBG (1, "sanei_w_space: wire is in invalid state %d\n", w->status); return; } if (w->buffer.curr + howmuch > w->buffer.end) { DBG (4, "sanei_w_space: free buffer size is %lu\n", (u_long) (w->buffer.end - w->buffer.curr)); switch (w->direction) { case WIRE_ENCODE: nbytes = w->buffer.curr - w->buffer.start; w->buffer.curr = w->buffer.start; DBG (4, "sanei_w_space: ENCODE: sending %lu bytes\n", (u_long) nbytes); while (nbytes > 0) { nwritten = (*w->io.write) (fd, w->buffer.curr, nbytes); if (nwritten < 0) { DBG (1, "sanei_w_space: ENCODE: write failed (%d)\n", errno); w->status = errno; return; } w->buffer.curr += nwritten; nbytes -= nwritten; } w->buffer.curr = w->buffer.start; w->buffer.end = w->buffer.start + w->buffer.size; DBG (4, "sanei_w_space: ENCODE: free buffer is now %lu\n", (u_long) w->buffer.size); break; case WIRE_DECODE: left_over = w->buffer.end - w->buffer.curr; if ((signed) left_over < 0) { DBG (1, "sanei_w_space: DECODE: buffer underflow\n"); return; } if (left_over) { DBG (4, "sanei_w_space: DECODE: %lu bytes left in buffer\n", (u_long) left_over); memmove (w->buffer.start, w->buffer.curr, left_over); } w->buffer.curr = w->buffer.start; w->buffer.end = w->buffer.start + left_over; DBG (4, "sanei_w_space: DECODE: receiving data\n"); do { nread = (*w->io.read) (fd, w->buffer.end, w->buffer.size - left_over); if (nread <= 0) { DBG (2, "sanei_w_space: DECODE: no data received (%d)\n", errno); if (nread == 0) errno = EINVAL; w->status = errno; return; } left_over += nread; w->buffer.end += nread; } while (left_over < howmuch); DBG (4, "sanei_w_space: DECODE: %lu bytes read\n", (u_long) (w->buffer.end - w->buffer.start)); break; case WIRE_FREE: DBG (4, "sanei_w_space: FREE: doing nothing for free operation\n"); break; } } DBG (4, "sanei_w_space: done\n"); } void sanei_w_void (Wire * w) { DBG (3, "sanei_w_void: wire %d (void debug output)\n", w->io.fd); } void sanei_w_array (Wire * w, SANE_Word * len_ptr, void **v, WireCodecFunc w_element, size_t element_size) { SANE_Word len; char *val; int i; DBG (3, "sanei_w_array: wire %d, elements of size %lu\n", w->io.fd, (u_long) element_size); if (w->direction == WIRE_FREE) { if (*len_ptr && *v) { DBG (4, "sanei_w_array: FREE: freeing array (%d elements)\n", *len_ptr); val = *v; for (i = 0; i < *len_ptr; ++i) { (*w_element) (w, val); val += element_size; } free (*v); w->allocated_memory -= (*len_ptr * element_size); } else DBG (1, "sanei_w_array: FREE: tried to free array but *len_ptr or *v " "was NULL\n"); DBG (4, "sanei_w_array: FREE: done\n"); return; } if (w->direction == WIRE_ENCODE) len = *len_ptr; DBG (4, "sanei_w_array: send/receive array length\n"); sanei_w_word (w, &len); if (w->status) { DBG (1, "sanei_w_array: bad status: %d\n", w->status); return; } DBG (4, "sanei_w_array: array has %d elements\n", len); if (w->direction == WIRE_DECODE) { *len_ptr = len; if (len) { if (((unsigned int) len) > MAX_MEM || ((unsigned int) len * element_size) > MAX_MEM || (w->allocated_memory + len * element_size) > MAX_MEM) { DBG (0, "sanei_w_array: DECODE: maximum amount of allocated memory " "exceeded (limit: %u, new allocation: %u, total: %u bytes)\n", MAX_MEM, len * element_size, MAX_MEM + len * element_size); w->status = ENOMEM; return; } *v = malloc (len * element_size); if (*v == 0) { /* Malloc failed, so return an error. */ DBG (1, "sanei_w_array: DECODE: not enough free memory\n"); w->status = ENOMEM; return; } memset (*v, 0, len * element_size); w->allocated_memory += (len * element_size); } else *v = 0; } val = *v; DBG (4, "sanei_w_array: transferring array elements\n"); for (i = 0; i < len; ++i) { (*w_element) (w, val); val += element_size; if (w->status) { DBG (1, "sanei_w_array: bad status: %d\n", w->status); return; } } DBG (4, "sanei_w_array: done\n"); } void sanei_w_ptr (Wire * w, void **v, WireCodecFunc w_value, size_t value_size) { SANE_Word is_null; DBG (3, "sanei_w_ptr: wire %d, value pointer at is %lu bytes\n", w->io.fd, (u_long) value_size); if (w->direction == WIRE_FREE) { if (*v && value_size) { DBG (4, "sanei_w_ptr: FREE: freeing value\n"); (*w_value) (w, *v); free (*v); w->allocated_memory -= value_size; } else DBG (1, "sanei_w_ptr: FREE: tried to free value but *v or value_size " "was NULL\n"); DBG (4, "sanei_w_ptr: FREE: done\n"); return; } if (w->direction == WIRE_ENCODE) is_null = (*v == 0); DBG (4, "sanei_w_ptr: send/receive is_null\n"); sanei_w_word (w, &is_null); if (w->status) { DBG (1, "sanei_w_ptr: bad status: %d\n", w->status); return; } if (!is_null) { if (w->direction == WIRE_DECODE) { DBG (4, "sanei_w_ptr: DECODE: receive data pointed at\n"); if (value_size > MAX_MEM) { DBG (0, "sanei_w_ptr: DECODE: maximum amount of allocated memory " "exceeded (limit: %u, new allocation: %u, total: %u bytes)\n", MAX_MEM, value_size, (w->allocated_memory + value_size)); w->status = ENOMEM; return; } *v = malloc (value_size); if (*v == 0) { /* Malloc failed, so return an error. */ DBG (1, "sanei_w_ptr: DECODE: not enough free memory\n"); w->status = ENOMEM; return; } w->allocated_memory += value_size; memset (*v, 0, value_size); } (*w_value) (w, *v); } else if (w->direction == WIRE_DECODE) *v = 0; DBG (4, "sanei_w_ptr: done\n"); } void sanei_w_byte (Wire * w, SANE_Byte * v) { DBG (3, "sanei_w_byte: wire %d\n", w->io.fd); (*w->codec.w_byte) (w, v); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_byte: value = %d\n", *v); } void sanei_w_char (Wire * w, SANE_Char * v) { DBG (3, "sanei_w_char: wire %d\n", w->io.fd); (*w->codec.w_char) (w, v); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_char: value = %d\n", *v); } void sanei_w_word (Wire * w, SANE_Word * v) { DBG (3, "sanei_w_word: wire %d\n", w->io.fd); (*w->codec.w_word) (w, v); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_word: value = %d\n", *v); } void sanei_w_string (Wire * w, SANE_String * v) { DBG (3, "sanei_w_string: wire %d\n", w->io.fd); (*w->codec.w_string) (w, v); if (w->direction != WIRE_FREE && w->status == 0) DBG (4, "sanei_w_string: value = %s\n", *v); } void sanei_w_status (Wire * w, SANE_Status * v) { SANE_Word word = *v; DBG (3, "sanei_w_status: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_status: value = %d\n", word); } void sanei_w_bool (Wire * w, SANE_Bool * v) { SANE_Word word = *v; DBG (3, "sanei_w_bool: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_bool: value = %s\n", ((word == SANE_TRUE) ? ("true") : ("false"))); } void sanei_w_constraint_type (Wire * w, SANE_Constraint_Type * v) { SANE_Word word = *v; DBG (3, "sanei_w_constraint_type: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_constraint_type: value = %d\n", word); } void sanei_w_value_type (Wire * w, SANE_Value_Type * v) { SANE_Word word = *v; DBG (3, "sanei_w_value_type: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_value_type: value = %d\n", word); } void sanei_w_unit (Wire * w, SANE_Unit * v) { SANE_Word word = *v; DBG (3, "sanei_w_unit: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_unit: value = %d\n", word); /* gosh... all the sane_w_something should be a macro or something */ } void sanei_w_action (Wire * w, SANE_Action * v) { SANE_Word word = *v; DBG (3, "sanei_w_action: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_action: value = %d\n", word); } void sanei_w_frame (Wire * w, SANE_Frame * v) { SANE_Word word = *v; DBG (3, "sanei_w_frame: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_frame: value = %d\n", word); } void sanei_w_range (Wire * w, SANE_Range * v) { DBG (3, "sanei_w_range: wire %d\n", w->io.fd); sanei_w_word (w, &v->min); sanei_w_word (w, &v->max); sanei_w_word (w, &v->quant); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_range: min/max/step = %f/%f/%f\n", SANE_UNFIX (v->min), SANE_UNFIX (v->max), SANE_UNFIX (v->quant)); } void sanei_w_device (Wire * w, SANE_Device * v) { DBG (3, "sanei_w_device: wire %d\n", w->io.fd); sanei_w_string (w, (SANE_String *) & v->name); sanei_w_string (w, (SANE_String *) & v->vendor); sanei_w_string (w, (SANE_String *) & v->model); sanei_w_string (w, (SANE_String *) & v->type); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_device: %s %s from %s (%s)\n", v->name, v->model, v->vendor, v->type); } void sanei_w_device_ptr (Wire * w, SANE_Device ** v) { DBG (3, "sanei_w_device_ptr: wire %d\n", w->io.fd); sanei_w_ptr (w, (void **) v, (WireCodecFunc) sanei_w_device, sizeof (**v)); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_device_ptr: device struct at %p\n", *v); } void sanei_w_option_descriptor (Wire * w, SANE_Option_Descriptor * v) { SANE_Word len; DBG (3, "sanei_w_option_descriptor: wire %d\n", w->io.fd); sanei_w_string (w, (SANE_String *) & v->name); sanei_w_string (w, (SANE_String *) & v->title); sanei_w_string (w, (SANE_String *) & v->desc); sanei_w_value_type (w, &v->type); sanei_w_unit (w, &v->unit); sanei_w_word (w, &v->size); sanei_w_word (w, &v->cap); sanei_w_constraint_type (w, &v->constraint_type); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_option_descriptor: option %s\n", v->name); switch (v->constraint_type) { case SANE_CONSTRAINT_NONE: break; case SANE_CONSTRAINT_RANGE: sanei_w_ptr (w, (void **) &v->constraint.range, (WireCodecFunc) sanei_w_range, sizeof (SANE_Range)); break; case SANE_CONSTRAINT_WORD_LIST: if (w->direction != WIRE_DECODE) len = v->constraint.word_list[0] + 1; sanei_w_array (w, &len, (void **) &v->constraint.word_list, w->codec.w_word, sizeof (SANE_Word)); break; case SANE_CONSTRAINT_STRING_LIST: if (w->direction != WIRE_DECODE) { for (len = 0; v->constraint.string_list[len]; ++len); ++len; /* send NULL string, too */ } sanei_w_array (w, &len, (void **) &v->constraint.string_list, w->codec.w_string, sizeof (SANE_String)); break; } DBG (4, "sanei_w_option_descriptor: done\n"); } void sanei_w_option_descriptor_ptr (Wire * w, SANE_Option_Descriptor ** v) { DBG (3, "sanei_w_option_descriptor_ptr: wire %d\n", w->io.fd); sanei_w_ptr (w, (void **) v, (WireCodecFunc) sanei_w_option_descriptor, sizeof (**v)); DBG (4, "sanei_w_option_descriptor_ptr: done\n"); } void sanei_w_parameters (Wire * w, SANE_Parameters * v) { DBG (3, "sanei_w_parameters: wire %d\n", w->io.fd); sanei_w_frame (w, &v->format); sanei_w_bool (w, &v->last_frame); sanei_w_word (w, &v->bytes_per_line); sanei_w_word (w, &v->pixels_per_line); sanei_w_word (w, &v->lines); sanei_w_word (w, &v->depth); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_parameters: format/last/bpl/ppl/lines/depth = " "%d/%d/%d/%d/%d/%d\n", v->format, v->last_frame, v->bytes_per_line, v->pixels_per_line, v->lines, v->depth); } static void flush (Wire * w) { DBG (3, "flush: wire %d\n", w->io.fd); if (w->direction == WIRE_ENCODE) sanei_w_space (w, w->buffer.size + 1); else if (w->direction == WIRE_DECODE) w->buffer.curr = w->buffer.end = w->buffer.start; if (w->status != 0) DBG (2, "flush: error status %d\n", w->status); DBG (4, "flush: wire flushed\n"); } void sanei_w_set_dir (Wire * w, WireDirection dir) { DBG (3, "sanei_w_set_dir: wire %d, old direction WIRE_%s\n", w->io.fd, w->direction == WIRE_ENCODE ? "ENCODE" : (w->direction == WIRE_DECODE ? "DECODE" : "FREE")); if (w->direction == WIRE_DECODE && w->buffer.curr != w->buffer.end) DBG (1, "sanei_w_set_dir: WARNING: will delete %lu bytes from buffer\n", (u_long) (w->buffer.end - w->buffer.curr)); flush (w); w->direction = dir; DBG (4, "sanei_w_set_dir: direction changed\n"); flush (w); DBG (3, "sanei_w_set_dir: wire %d, new direction WIRE_%s\n", w->io.fd, dir == WIRE_ENCODE ? "ENCODE" : (dir == WIRE_DECODE ? "DECODE" : "FREE")); } void sanei_w_call (Wire * w, SANE_Word procnum, WireCodecFunc w_arg, void *arg, WireCodecFunc w_reply, void *reply) { DBG (3, "sanei_w_call: wire %d (old status %d)\n", w->io.fd, w->status); w->status = 0; sanei_w_set_dir (w, WIRE_ENCODE); DBG (4, "sanei_w_call: sending request (procedure number: %d)\n", procnum); sanei_w_word (w, &procnum); (*w_arg) (w, arg); if (w->status == 0) { DBG (4, "sanei_w_call: receiving reply\n"); sanei_w_set_dir (w, WIRE_DECODE); (*w_reply) (w, reply); } if (w->status != 0) DBG (2, "sanei_w_call: error status %d\n", w->status); DBG (4, "sanei_w_call: done\n"); } void sanei_w_reply (Wire * w, WireCodecFunc w_reply, void *reply) { DBG (3, "sanei_w_reply: wire %d (old status %d)\n", w->io.fd, w->status); w->status = 0; sanei_w_set_dir (w, WIRE_ENCODE); (*w_reply) (w, reply); flush (w); if (w->status != 0) DBG (2, "sanei_w_reply: error status %d\n", w->status); DBG (4, "sanei_w_reply: done\n"); } void sanei_w_free (Wire * w, WireCodecFunc w_reply, void *reply) { WireDirection saved_dir = w->direction; DBG (3, "sanei_w_free: wire %d\n", w->io.fd); w->direction = WIRE_FREE; (*w_reply) (w, reply); w->direction = saved_dir; if (w->status != 0) DBG (2, "sanei_w_free: error status %d\n", w->status); DBG (4, "sanei_w_free: done\n"); } void sanei_w_init (Wire * w, void (*codec_init_func) (Wire *)) { DBG_INIT (); DBG (3, "sanei_w_init: initializing\n"); w->status = 0; w->direction = WIRE_ENCODE; w->buffer.size = 8192; w->buffer.start = malloc (w->buffer.size); if (w->buffer.start == 0) { /* Malloc failed, so return an error. */ w->status = ENOMEM; DBG (1, "sanei_w_init: not enough free memory\n"); } w->buffer.curr = w->buffer.start; w->buffer.end = w->buffer.start + w->buffer.size; if (codec_init_func != 0) { DBG (4, "sanei_w_init: initializing codec\n"); (*codec_init_func) (w); } w->allocated_memory = 0; DBG (4, "sanei_w_init: done\n"); } void sanei_w_exit (Wire * w) { DBG (3, "sanei_w_exit: wire %d\n", w->io.fd); if (w->buffer.start) { DBG (4, "sanei_w_exit: freeing buffer\n"); free (w->buffer.start); } w->buffer.start = 0; w->buffer.size = 0; DBG (4, "sanei_w_exit: done\n"); } ./sane-frontends-1.0.14/src/0000755000175000017500000000000010313255162013555 5ustar hmghmg./sane-frontends-1.0.14/src/Makefile.in0000644000175000017500000000607110313254001015615 0ustar hmghmgSHELL = /bin/sh VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. PACKAGE = @PACKAGE@ VERSION = @VERSION@ distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION) sane_prefix = @SANE_PREFIX@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include configdir = ${sysconfdir}/sane.d sanedatadir = ${datadir}/sane MKDIR = $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ CC = @CC@ INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include \ @INCLUDES@ @GTK_CFLAGS@ @GIMP_CFLAGS@ DEFS = @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ @SANE_CFLAGS@ LDFLAGS = @LDFLAGS@ @SANE_LDFLAGS@ LIBS = @LIBS@ @SANE_LIBS@ GTK_LIBS = @GTK_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GIMP_LIBS = @GIMP_LIBS@ BINPROGS = @BINPROGS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(GTK_CFLAGS) LINK = $(CC) $(LDFLAGS) -o $@ @SET_MAKE@ PROGRAMS = $(BINPROGS) LIBLIB = ../lib/liblib.a LIBSANEI = ../sanei/libsanei.a XSCANIMAGE_OBJS = xscanimage.o progress.o preview.o preferences.o gtkglue.o XCAM_OBJS = xcam.o preferences.o gtkglue.o SCANADF_OBJS = scanadf.o DISTFILES = Makefile.in gtkglue.c gtkglue.h preferences.c preferences.h \ preview.c preview.h progress.c progress.h sane-style.rc xcam.c \ xscanimage-gimp-1_0-compat.h xscanimage.c scanadf.c font_6x11.h .PHONY: all clean depend dist distclean install uninstall .c.o: $(COMPILE) $< all: $(PROGRAMS) install: $(PROGRAMS) @if test -z "$(BINPROGS)" ; then \ echo "*** The list of frontends to install is empty." ; \ echo "*** Check the output of configure and the file config.log," ; \ echo "*** maybe the GTK libraries weren't found?" ; \ exit 1 ; \ fi $(MKDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) $(DESTDIR)$(sanedatadir) @for program in $(BINPROGS); do \ echo installing $${program} in $(bindir)/$${program}... ; \ $(INSTALL_PROGRAM) $${program} \ $(DESTDIR)$(bindir)/$${program}; \ done $(INSTALL_DATA) $(srcdir)/sane-style.rc \ $(DESTDIR)$(sanedatadir)/sane-style.rc uninstall: @for program in $(BINPROGS); do \ echo removing $(bindir)/$${program}...; \ rm -f $(bindir)/$${program}; \ done rm -f $(sanedatadir)/sane-style.rc xscanimage: $(XSCANIMAGE_OBJS) $(LIBSANEI) $(LIBLIB) $(LINK) $(XSCANIMAGE_OBJS) $(LIBSANEI) \ $(LIBLIB) $(GIMP_LIBS) $(GTK_LIBS) $(LIBS) xcam: $(XCAM_OBJS) $(LIBSANEI) $(LIBLIB) $(LINK) $(XCAM_OBJS) $(LIBSANEI) \ $(LIBLIB) $(GTK_LIBS) $(LIBS) scanadf: $(SCANADF_OBJS) $(LIBLIB) $(LINK) $(SCANADF_OBJS) $(LIBLIB) $(LIBS) clean: rm -f *.o *~ .*~ *.bak rm -rf .libs distclean: clean rm -f Makefile $(PROGRAMS) depend: makedepend $(INCLUDES) *.c dist: $(DISTFILES) for file in $(DISTFILES); do \ ln $$file $(distdir)/src 2> /dev/null \ || cp -p $$file $(distdir)/src ; \ done ./sane-frontends-1.0.14/src/gtkglue.c0000644000175000017500000011635410230207447015376 0ustar hmghmg/* gtk/SANE-glue -- gtk interfacing routines for SANE Uses the SANE library. Copyright (C) 1997 David Mosberger and Tristan Tarrant 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. */ #ifdef _AIX # include "../include/lalloca.h" /* MUST come first for AIX! */ #endif #include "../include/sane/config.h" #include "../include/lalloca.h" #include #include #include #include #include #include #include #include #include /* Apollo/DomainOS needs this _before_ sys/stat.h */ #include #include "gtkglue.h" #include "preferences.h" #include #include #define DBG_fatal 0 #define DBG_error 1 #define DBG_warning 2 #define DBG_info 3 #define DBG_debug 4 #define BACKEND_NAME gtkglue #include "../include/sane/sanei_debug.h" int gsg_message_dialog_active = 0; /* forward declarations: */ static void panel_rebuild (GSGDialog * dialog); static const char * unit_string (SANE_Unit unit) { double d; switch (unit) { case SANE_UNIT_NONE: return "none"; case SANE_UNIT_PIXEL: return "pixel"; case SANE_UNIT_BIT: return "bit"; case SANE_UNIT_DPI: return "dpi"; case SANE_UNIT_PERCENT: return "%"; case SANE_UNIT_MM: d = preferences.length_unit; if (d > 9.9 && d < 10.1) return "cm"; else if (d > 25.3 && d < 25.5) return "in"; return "mm"; case SANE_UNIT_MICROSECOND: return "us"; } return 0; } static void set_tooltip (GtkTooltips * tooltips, GtkWidget * widget, const char *desc) { if (desc && desc[0]) #ifdef HAVE_GTK_TOOLTIPS_SET_TIPS /* pre 0.99.4: */ gtk_tooltips_set_tips (tooltips, widget, (char *) desc); #else gtk_tooltips_set_tip (tooltips, widget, desc, 0); #endif } int gsg_make_path (size_t buf_size, char *buf, const char *prog_name, const char *prefix, const char *dev_name, const char *postfix) { struct passwd *pw; size_t len, extra; int i; /* first, make sure ~/.sane exists: */ pw = getpwuid (getuid ()); if (!pw) { snprintf (buf, buf_size, "Failed to determine home directory: %s.", strerror (errno)); gsg_error (buf); return -1; } snprintf (buf, buf_size, "%s/.sane", pw->pw_dir); mkdir (buf, 0777); /* ensure ~/.sane directory exists */ len = strlen (buf); if (prog_name) { extra = strlen (prog_name); if (len + extra + 1 >= buf_size) goto filename_too_long; buf[len++] = '/'; memcpy (buf + len, prog_name, extra); len += extra; buf[len] = '\0'; mkdir (buf, 0777); /* ensure ~/.sane/PROG_NAME directory exists */ } if (len >= buf_size) goto filename_too_long; buf[len++] = '/'; if (prefix) { extra = strlen (prefix); if (len + extra >= buf_size) goto filename_too_long; memcpy (buf + len, prefix, extra); len += extra; } if (dev_name) { /* Turn devicename into valid filename by replacing slashes by "+-". A lonely `+' gets translated into "++" so we can tell it from a substituted slash. */ for (i = 0; dev_name[i]; ++i) { if (len + 2 >= buf_size) goto filename_too_long; switch (dev_name[i]) { case '/': buf[len++] = '+'; buf[len++] = '-'; break; #ifdef HAVE_OS2_H case ':': /* OS2 can not handle colons in filenames */ buf[len++] = '+'; buf[len++] = '_'; break; #endif case '+': buf[len++] = '+'; default: buf[len++] = dev_name[i]; break; } } } if (postfix) { extra = strlen (postfix); if (len + extra >= buf_size) goto filename_too_long; memcpy (buf + len, postfix, extra); len += extra; } if (len >= buf_size) goto filename_too_long; buf[len++] = '\0'; return 0; filename_too_long: gsg_error ("Filename too long."); errno = E2BIG; return -1; } static void set_option (GSGDialog * dialog, int opt_num, void *val, SANE_Action action) { SANE_Status status; SANE_Int info; char buf[256]; status = sane_control_option (dialog->dev, opt_num, action, val, &info); if (status != SANE_STATUS_GOOD) { snprintf (buf, sizeof (buf), "Failed to set value of option %s: %s.", sane_get_option_descriptor (dialog->dev, opt_num)->name, sane_strstatus (status)); gsg_error (buf); return; } if (info & SANE_INFO_RELOAD_OPTIONS) { panel_rebuild (dialog); if (dialog->option_reload_callback) (*dialog->option_reload_callback) (dialog, dialog->option_reload_arg); } if ((info & SANE_INFO_RELOAD_PARAMS) && dialog->param_change_callback) (*dialog->param_change_callback) (dialog, dialog->param_change_arg); } void gsg_close_dialog_callback (GtkWidget * widget, gpointer data) { gtk_widget_destroy (data); gsg_message_dialog_active = 0; } void gsg_message (gchar * title, gchar * message) { GtkWidget *main_vbox, *label; GtkWidget *button, *message_dialog; if (gsg_message_dialog_active) { fprintf (stderr, "%s: %s\n", title, message); return; } gsg_message_dialog_active = 1; message_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_position (GTK_WINDOW (message_dialog), GTK_WIN_POS_MOUSE); gtk_window_set_title (GTK_WINDOW (message_dialog), title); /* create the main vbox */ main_vbox = gtk_vbox_new (TRUE, 5); gtk_container_border_width (GTK_CONTAINER (main_vbox), 5); gtk_widget_show (main_vbox); gtk_container_add (GTK_CONTAINER (message_dialog), main_vbox); /* the message */ label = gtk_label_new (message); gtk_container_add (GTK_CONTAINER (main_vbox), label); gtk_widget_show (label); /* the confirmation button */ button = gtk_button_new_with_label ("OK"); gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gsg_close_dialog_callback, message_dialog); gtk_container_add (GTK_CONTAINER (main_vbox), button); gtk_widget_show (button); gtk_widget_show (message_dialog); } void gsg_error (gchar * error) { gsg_message ("Error", error); } void gsg_warning (gchar * warning) { gsg_message ("Warning", warning); } static void get_filename_button_clicked (GtkWidget * w, gpointer data) { int *clicked = data; *clicked = 1; } int gsg_get_filename (const char *label, const char *default_name, size_t max_len, char *filename) { int cancel = 0, ok = 0; GtkWidget *filesel; filesel = gtk_file_selection_new ((char *) label); gtk_window_set_modal (GTK_WINDOW (filesel), TRUE); gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesel)->cancel_button), "clicked", (GtkSignalFunc) get_filename_button_clicked, &cancel); gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesel)->ok_button), "clicked", (GtkSignalFunc) get_filename_button_clicked, &ok); if (default_name) gtk_file_selection_set_filename (GTK_FILE_SELECTION (filesel), (char *) default_name); gtk_widget_show (filesel); while (!cancel && !ok) { if (!gtk_events_pending ()) usleep (100000); gtk_main_iteration (); } if (ok) { size_t len, cwd_len; char *cwd; strncpy (filename, gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)), max_len - 1); filename[max_len - 1] = '\0'; len = strlen (filename); cwd = alloca (len + 2); getcwd (cwd, len + 1); cwd_len = strlen (cwd); cwd[cwd_len++] = '/'; cwd[cwd_len] = '\0'; if (strncmp (filename, cwd, cwd_len) == 0) memcpy (filename, filename + cwd_len, len - cwd_len + 1); } gtk_widget_destroy (filesel); return cancel ? -1 : 0; } static gint autobutton_update (GtkWidget * widget, GSGDialogElement * elem) { GSGDialog *dialog = elem->dialog; int opt_num = elem - dialog->element; const SANE_Option_Descriptor *opt; SANE_Status status; SANE_Word val; char buf[256]; opt = sane_get_option_descriptor (dialog->dev, opt_num); if (GTK_TOGGLE_BUTTON (widget)->active) set_option (dialog, opt_num, 0, SANE_ACTION_SET_AUTO); else { status = sane_control_option (dialog->dev, opt_num, SANE_ACTION_GET_VALUE, &val, 0); if (status != SANE_STATUS_GOOD) { snprintf (buf, sizeof (buf), "Failed to obtain value of option %s: %s.", opt->name, sane_strstatus (status)); gsg_error (buf); } set_option (dialog, opt_num, &val, SANE_ACTION_SET_VALUE); } return FALSE; } static void autobutton_new (GtkWidget * parent, GSGDialogElement * elem, GtkWidget * label, GtkTooltips * tooltips) { GtkWidget *button, *alignment; button = gtk_check_button_new (); gtk_container_border_width (GTK_CONTAINER (button), 0); gtk_widget_set_usize (button, 20, 20); gtk_signal_connect (GTK_OBJECT (button), "toggled", (GtkSignalFunc) autobutton_update, elem); set_tooltip (tooltips, button, "Turns on automatic mode."); alignment = gtk_alignment_new (0.0, 1.0, 0.5, 0.5); gtk_container_add (GTK_CONTAINER (alignment), button); gtk_box_pack_end (GTK_BOX (parent), label, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (parent), alignment, FALSE, FALSE, 2); gtk_widget_show (alignment); gtk_widget_show (button); } static gint button_update (GtkWidget * widget, GSGDialogElement * elem) { GSGDialog *dialog = elem->dialog; int opt_num = elem - dialog->element; const SANE_Option_Descriptor *opt; SANE_Word val = SANE_FALSE; opt = sane_get_option_descriptor (dialog->dev, opt_num); if (GTK_TOGGLE_BUTTON (widget)->active) val = SANE_TRUE; set_option (dialog, opt_num, &val, SANE_ACTION_SET_VALUE); return FALSE; } static void button_new (GtkWidget * parent, const char *name, SANE_Word val, GSGDialogElement * elem, GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *button; button = gtk_check_button_new_with_label ((char *) name); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), val); gtk_signal_connect (GTK_OBJECT (button), "toggled", (GtkSignalFunc) button_update, elem); gtk_box_pack_start (GTK_BOX (parent), button, FALSE, TRUE, 0); if (!is_settable) gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE); gtk_widget_show (button); set_tooltip (tooltips, button, desc); elem->widget = button; } static void scale_update (GtkAdjustment * adj_data, GSGDialogElement * elem) { const SANE_Option_Descriptor *opt; GSGDialog *dialog = elem->dialog; SANE_Word val, new_val; int opt_num; double d; SANE_Status status; DBG_INIT (); DBG (DBG_debug, "scale_update\n"); opt_num = elem - dialog->element; opt = sane_get_option_descriptor (dialog->dev, opt_num); switch (opt->type) { case SANE_TYPE_INT: val = adj_data->value + 0.5; break; case SANE_TYPE_FIXED: d = adj_data->value; if (opt->unit == SANE_UNIT_MM) d *= preferences.length_unit; val = SANE_FIX (d); break; default: fprintf (stderr, "scale_update: unknown type %d\n", opt->type); return; } set_option (dialog, opt_num, &val, SANE_ACTION_SET_VALUE); status = sane_control_option (dialog->dev, opt_num, SANE_ACTION_GET_VALUE, &new_val, 0); if (status != SANE_STATUS_GOOD) { DBG (DBG_fatal, "scale_update: sane_control_option failed: %s\n", sane_strstatus (status)); return; } if (new_val != val) { val = new_val; goto value_changed; } return; /* value didn't change */ value_changed: switch (opt->type) { case SANE_TYPE_INT: adj_data->value = val; break; case SANE_TYPE_FIXED: d = SANE_UNFIX (val); if (opt->unit == SANE_UNIT_MM) d /= preferences.length_unit; adj_data->value = d; break; default: break; } /* Let widget know that value changed _again_. This must converge quickly---otherwise things would get very slow very quickly (as in "infinite recursion"): */ gtk_signal_emit_by_name (GTK_OBJECT (adj_data), "value_changed"); return; } static void scale_new (GtkWidget * parent, const char *name, gfloat val, gfloat min, gfloat max, gfloat quant, int automatic, GSGDialogElement * elem, GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *hbox, *label, *scale; hbox = gtk_hbox_new (FALSE, 2); gtk_container_border_width (GTK_CONTAINER (hbox), 0); gtk_box_pack_start (GTK_BOX (parent), hbox, FALSE, FALSE, 0); label = gtk_label_new ((char *) name); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); elem->data = gtk_adjustment_new (val, min, max, quant, 1.0, 0.0); scale = gtk_hscale_new (GTK_ADJUSTMENT (elem->data)); set_tooltip (tooltips, scale, desc); gtk_widget_set_usize (scale, 200, 0); if (automatic) autobutton_new (hbox, elem, scale, tooltips); else gtk_box_pack_end (GTK_BOX (hbox), scale, FALSE, FALSE, 0); gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_CONTINUOUS); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); if (quant - (int) quant == 0.0) gtk_scale_set_digits (GTK_SCALE (scale), 0); else /* one place behind decimal point */ gtk_scale_set_digits (GTK_SCALE (scale), 1); gtk_signal_connect (elem->data, "value_changed", (GtkSignalFunc) scale_update, elem); gtk_widget_show (label); gtk_widget_show (scale); if (!is_settable) gtk_widget_set_sensitive (GTK_WIDGET (hbox), FALSE); gtk_widget_show (hbox); elem->widget = scale; } static void push_button_callback (GtkWidget * widget, gpointer data) { GSGDialogElement *elem = data; GSGDialog *dialog = elem->dialog; int opt_num; opt_num = elem - dialog->element; set_option (dialog, opt_num, 0, SANE_ACTION_SET_VALUE); } static int option_menu_lookup (GSGMenuItem menu_items[], const char *string) { int i; for (i = 0; strcmp (menu_items[i].label, string) != 0; ++i); return i; } static void option_menu_callback (GtkWidget * widget, gpointer data) { GSGMenuItem *menu_item = data; GSGDialogElement *elem = menu_item->elem; const SANE_Option_Descriptor *opt; GSGDialog *dialog = elem->dialog; int opt_num; double dval; SANE_Word val; void *valp = &val; opt_num = elem - dialog->element; opt = sane_get_option_descriptor (dialog->dev, opt_num); switch (opt->type) { case SANE_TYPE_INT: sscanf (menu_item->label, "%d", &val); break; case SANE_TYPE_FIXED: sscanf (menu_item->label, "%lg", &dval); val = SANE_FIX (dval); break; case SANE_TYPE_STRING: valp = menu_item->label; break; default: fprintf (stderr, "option_menu_callback: unexpected type %d\n", opt->type); break; } set_option (dialog, opt_num, valp, SANE_ACTION_SET_VALUE); } static void option_menu_new (GtkWidget * parent, const char *name, char *str_list[], const char *val, GSGDialogElement * elem, GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *hbox, *label, *option_menu, *menu, *item; GSGMenuItem *menu_items; int i, num_items; hbox = gtk_hbox_new (FALSE, 2); gtk_container_border_width (GTK_CONTAINER (hbox), 0); gtk_box_pack_start (GTK_BOX (parent), hbox, FALSE, FALSE, 0); label = gtk_label_new ((char *) name); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); for (num_items = 0; str_list[num_items]; ++num_items); menu_items = malloc (num_items * sizeof (menu_items[0])); menu = gtk_menu_new (); for (i = 0; i < num_items; ++i) { item = gtk_menu_item_new_with_label (str_list[i]); gtk_container_add (GTK_CONTAINER (menu), item); gtk_signal_connect (GTK_OBJECT (item), "activate", (GtkSignalFunc) option_menu_callback, menu_items + i); gtk_widget_show (item); menu_items[i].label = str_list[i]; menu_items[i].elem = elem; menu_items[i].index = i; } option_menu = gtk_option_menu_new (); gtk_box_pack_end (GTK_BOX (hbox), option_menu, FALSE, FALSE, 2); gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu); gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu), option_menu_lookup (menu_items, val)); set_tooltip (tooltips, option_menu, desc); gtk_widget_show (label); gtk_widget_show (option_menu); if (!is_settable) gtk_widget_set_sensitive (GTK_WIDGET (hbox), FALSE); gtk_widget_show (hbox); elem->widget = option_menu; elem->menu_size = num_items; elem->menu = menu_items; } static void text_entry_callback (GtkWidget * w, gpointer data) { GSGDialogElement *elem = data; const SANE_Option_Descriptor *opt; GSGDialog *dialog = elem->dialog; const gchar *text; int opt_num; char *buf; opt_num = elem - dialog->element; opt = sane_get_option_descriptor (dialog->dev, opt_num); buf = alloca (opt->size); buf[0] = '\0'; text = gtk_entry_get_text (GTK_ENTRY (elem->widget)); if (text) strncpy (buf, text, opt->size); buf[opt->size - 1] = '\0'; set_option (dialog, opt_num, buf, SANE_ACTION_SET_VALUE); if (strcmp (buf, text) != 0) /* the backend modified the option value; update widget: */ gtk_entry_set_text (GTK_ENTRY (elem->widget), buf); } static void text_entry_new (GtkWidget * parent, const char *name, const char *val, GSGDialogElement * elem, GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *hbox, *text, *label; hbox = gtk_hbox_new (FALSE, 2); gtk_container_border_width (GTK_CONTAINER (hbox), 0); gtk_box_pack_start (GTK_BOX (parent), hbox, FALSE, FALSE, 0); label = gtk_label_new ((char *) name); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); text = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (text), (char *) val); gtk_box_pack_start (GTK_BOX (hbox), text, FALSE, TRUE, 0); gtk_signal_connect (GTK_OBJECT (text), "changed", (GtkSignalFunc) text_entry_callback, elem); set_tooltip (tooltips, text, desc); gtk_widget_show (hbox); if (!is_settable) gtk_widget_set_sensitive (GTK_WIDGET (hbox), FALSE); gtk_widget_show (label); gtk_widget_show (text); elem->widget = text; } static GtkWidget * group_new (GtkWidget * parent, const char *title) { GtkWidget *frame, *vbox; frame = gtk_frame_new ((char *) title); gtk_container_border_width (GTK_CONTAINER (frame), 4); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_box_pack_start (GTK_BOX (parent), frame, FALSE, FALSE, 0); vbox = gtk_vbox_new (FALSE, 4); gtk_container_border_width (GTK_CONTAINER (vbox), 2); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_widget_show (vbox); return vbox; } static GtkWidget * curve_new (GSGDialog * dialog, int optnum) { const SANE_Option_Descriptor *opt; gfloat fmin, fmax, val, *vector; SANE_Word *optval, min, max; GtkWidget *curve, *gamma; SANE_Status status; SANE_Handle dev; int i, optlen; gamma = gtk_gamma_curve_new (); curve = GTK_GAMMA_CURVE (gamma)->curve; dev = dialog->dev; opt = sane_get_option_descriptor (dev, optnum); optlen = opt->size / sizeof (SANE_Word); vector = alloca (optlen * (sizeof (vector[0]) + sizeof (optval[0]))); optval = (SANE_Word *) (vector + optlen); min = max = 0; switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: min = opt->constraint.range->min; max = opt->constraint.range->max; break; case SANE_CONSTRAINT_WORD_LIST: if (opt->constraint.word_list[0] > 1) { min = max = opt->constraint.word_list[1]; for (i = 2; i < opt->constraint.word_list[0]; ++i) { if (opt->constraint.word_list[i] < min) min = opt->constraint.word_list[i]; if (opt->constraint.word_list[i] > max) max = opt->constraint.word_list[i]; } } break; default: break; } if (min == max) { fprintf (stderr, "curve_new: warning: option `%s' has no value constraint\n", opt->name); fmin = 0; fmax = 255; } else if (opt->type == SANE_TYPE_FIXED) { fmin = SANE_UNFIX (min); fmax = SANE_UNFIX (max); } else { fmin = min; fmax = max; } gtk_curve_set_range (GTK_CURVE (curve), 0, optlen - 1, fmin, fmax); status = sane_control_option (dev, optnum, SANE_ACTION_GET_VALUE, optval, 0); if (status == SANE_STATUS_GOOD) { for (i = 0; i < optlen; ++i) { if (opt->type == SANE_TYPE_FIXED) val = SANE_UNFIX (optval[i]); else val = optval[i]; vector[i] = val; } gtk_curve_set_vector (GTK_CURVE (curve), optlen, vector); } else gtk_widget_set_sensitive (gamma, FALSE); return gamma; } static void vector_new (GSGDialog * dialog, GtkWidget * vbox, int num_vopts, int *vopts) { GtkWidget *notebook, *label, *curve; const SANE_Option_Descriptor *opt; int i; notebook = gtk_notebook_new (); gtk_container_border_width (GTK_CONTAINER (notebook), 4); gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0); for (i = 0; i < num_vopts; ++i) { opt = sane_get_option_descriptor (dialog->dev, vopts[i]); label = gtk_label_new ((char *) opt->title); vbox = gtk_vbox_new ( /* homogeneous */ FALSE, 0); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); gtk_widget_show (vbox); gtk_widget_show (label); curve = curve_new (dialog, vopts[i]); gtk_container_border_width (GTK_CONTAINER (curve), 4); gtk_box_pack_start (GTK_BOX (vbox), curve, TRUE, TRUE, 0); gtk_widget_show (curve); dialog->element[vopts[i]].widget = curve; } gtk_widget_show (notebook); } static void panel_destroy (GSGDialog * dialog) { const SANE_Option_Descriptor *opt; GSGDialogElement *elem; int i, j; #ifdef HAVE_GTK_TOOLTIPS_SET_TIPS /* pre 0.99.4: */ gtk_tooltips_unref (dialog->tooltips); #else # if GTK_MAJOR_VERSION == 2 gtk_object_sink (GTK_OBJECT (dialog->tooltips)); # else gtk_object_unref (GTK_OBJECT (dialog->tooltips)); # endif /* GTK_MAJOR_VERSION == 2 */ #endif gtk_widget_destroy (dialog->main_hbox); /* free the menu labels of integer/fix-point word-lists: */ for (i = 0; i < dialog->num_elements; ++i) { if (dialog->element[i].menu) { opt = sane_get_option_descriptor (dialog->dev, i); elem = dialog->element + i; if (opt->type != SANE_TYPE_STRING) for (j = 0; j < elem->menu_size; ++j) if (elem->menu[j].label) { free (elem->menu[j].label); elem->menu[j].label = 0; } free (elem->menu); elem->menu = 0; } } memset (dialog->element, 0, dialog->num_elements * sizeof (dialog->element[0])); } static void panel_build (GSGDialog * dialog) { GtkWidget *main_hbox, *standard_vbox, *advanced_vbox, *option_vbox; GtkWidget *parent, *vbox, *button, *label; const SANE_Option_Descriptor *opt; SANE_Handle dev = dialog->dev; double dval, dmin, dmax, dquant; char *buf, str[16], title[256]; GSGDialogElement *elem; SANE_Word quant, val; SANE_Status status; SANE_Int num_words; char **str_list; int i, j; int num_vector_opts = 0, *vector_opts; main_hbox = gtk_hbox_new (FALSE, 2); if (dialog->twocolumn) { option_vbox = gtk_hbox_new (FALSE, 2); /* two column display */ } else { option_vbox = gtk_vbox_new (FALSE, 2); /* one column display */ } gtk_box_pack_start (GTK_BOX (main_hbox), option_vbox, FALSE, FALSE, 0); gtk_widget_show (option_vbox); /* standard options vbox */ standard_vbox = gtk_vbox_new ( /* homogeneous */ FALSE, 0); gtk_widget_show (standard_vbox); gtk_box_pack_start (GTK_BOX (option_vbox), standard_vbox, FALSE, FALSE, 0); /* advanced options page */ advanced_vbox = gtk_vbox_new ( /* homogeneous */ FALSE, 0); gtk_box_pack_start (GTK_BOX (option_vbox), advanced_vbox, TRUE, TRUE, 0); /* use black as foreground: */ dialog->tooltips = gtk_tooltips_new (); dialog->tooltips_fg.red = 0; dialog->tooltips_fg.green = 0; dialog->tooltips_fg.blue = 0; /* postit yellow (khaki) as background: */ gdk_color_alloc (gtk_widget_get_colormap (main_hbox), &dialog->tooltips_fg); dialog->tooltips_bg.red = 61669; dialog->tooltips_bg.green = 59113; dialog->tooltips_bg.blue = 35979; gdk_color_alloc (gtk_widget_get_colormap (main_hbox), &dialog->tooltips_bg); /* GTK2 doesn't have the function (seems like it's not needed with GTK2 anyway) */ #if GTK_MAJOR_VERSION < 2 gtk_tooltips_set_colors (dialog->tooltips, &dialog->tooltips_bg, &dialog->tooltips_fg); #endif /* GTK_MAJOR_VERSION < 2 */ gsg_set_tooltips (dialog, preferences.tooltips_enabled); gtk_container_add (GTK_CONTAINER (dialog->window), main_hbox); dialog->main_hbox = main_hbox; dialog->advanced_vbox = advanced_vbox; /* reset well-known options: */ dialog->well_known.preview = -1; dialog->well_known.dpi = -1; dialog->well_known.coord[GSG_TL_X] = -1; dialog->well_known.coord[GSG_TL_Y] = -1; dialog->well_known.coord[GSG_BR_X] = -1; dialog->well_known.coord[GSG_BR_Y] = -1; vector_opts = alloca (dialog->num_elements * sizeof (int)); parent = standard_vbox; for (i = 1; i < dialog->num_elements; ++i) { opt = sane_get_option_descriptor (dev, i); if (!SANE_OPTION_IS_ACTIVE (opt->cap)) continue; /* pick up well-known options as we go: */ if (opt->name) { if (strcmp (opt->name, SANE_NAME_PREVIEW) == 0 && opt->type == SANE_TYPE_BOOL) { dialog->well_known.preview = i; continue; } else if (strcmp (opt->name, SANE_NAME_SCAN_RESOLUTION) == 0 && opt->unit == SANE_UNIT_DPI && (opt->type == SANE_TYPE_INT || opt->type == SANE_TYPE_FIXED)) dialog->well_known.dpi = i; else if (strcmp (opt->name, SANE_NAME_SCAN_TL_X) == 0) dialog->well_known.coord[GSG_TL_X] = i; else if (strcmp (opt->name, SANE_NAME_SCAN_TL_Y) == 0) dialog->well_known.coord[GSG_TL_Y] = i; else if (strcmp (opt->name, SANE_NAME_SCAN_BR_X) == 0) dialog->well_known.coord[GSG_BR_X] = i; else if (strcmp (opt->name, SANE_NAME_SCAN_BR_Y) == 0) dialog->well_known.coord[GSG_BR_Y] = i; } elem = dialog->element + i; elem->dialog = dialog; if (opt->unit == SANE_UNIT_NONE) strncpy (title, opt->title, sizeof (title)); else snprintf (title, sizeof (title), "%s [%s]", opt->title, unit_string (opt->unit)); switch (opt->type) { case SANE_TYPE_GROUP: /* group a set of options */ vbox = standard_vbox; if (opt->cap & SANE_CAP_ADVANCED) vbox = advanced_vbox; parent = group_new (vbox, title); elem->widget = parent; break; case SANE_TYPE_BOOL: if ((opt->cap & SANE_CAP_ADVANCED) && !dialog->advanced) break; if (!(opt->cap & SANE_CAP_SOFT_DETECT)) break; assert (opt->size == sizeof (SANE_Word)); status = sane_control_option (dialog->dev, i, SANE_ACTION_GET_VALUE, &val, 0); if (status != SANE_STATUS_GOOD) goto get_value_failed; button_new (parent, title, val, elem, dialog->tooltips, opt->desc, SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; case SANE_TYPE_INT: if ((opt->cap & SANE_CAP_ADVANCED) && !dialog->advanced) break; if (!(opt->cap & SANE_CAP_SOFT_DETECT)) break; if (opt->size != sizeof (SANE_Word)) { vector_opts[num_vector_opts++] = i; break; } status = sane_control_option (dialog->dev, i, SANE_ACTION_GET_VALUE, &val, 0); if (status != SANE_STATUS_GOOD) goto get_value_failed; switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: /* use a scale */ quant = opt->constraint.range->quant; if (quant == 0) quant = 1; scale_new (parent, title, val, opt->constraint.range->min, opt->constraint.range->max, quant, (opt->cap & SANE_CAP_AUTOMATIC), elem, dialog->tooltips, opt->desc, SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_WORD_LIST: /* use a "list-selection" widget */ num_words = opt->constraint.word_list[0]; str_list = malloc ((num_words + 1) * sizeof (str_list[0])); for (j = 0; j < num_words; ++j) { sprintf (str, "%d", opt->constraint.word_list[j + 1]); str_list[j] = strdup (str); } str_list[j] = 0; sprintf (str, "%d", val); option_menu_new (parent, title, str_list, str, elem, dialog->tooltips, opt->desc, SANE_OPTION_IS_SETTABLE (opt->cap)); free (str_list); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_NONE: /* having no constraint for an int is strange but allowed by the SANE standard so we just ignore such options here */ break; default: fprintf (stderr, "panel_build: unknown constraint %d!\n", opt->constraint_type); break; } break; case SANE_TYPE_FIXED: if ((opt->cap & SANE_CAP_ADVANCED) && !dialog->advanced) break; if (!(opt->cap & SANE_CAP_SOFT_DETECT)) break; if (opt->size != sizeof (SANE_Word)) { vector_opts[num_vector_opts++] = i; break; } status = sane_control_option (dialog->dev, i, SANE_ACTION_GET_VALUE, &val, 0); if (status != SANE_STATUS_GOOD) goto get_value_failed; switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: /* use a scale */ quant = opt->constraint.range->quant; if (quant == 0) quant = 1; dval = SANE_UNFIX (val); dmin = SANE_UNFIX (opt->constraint.range->min); dmax = SANE_UNFIX (opt->constraint.range->max); dquant = SANE_UNFIX (quant); if (opt->unit == SANE_UNIT_MM) { dval /= preferences.length_unit; dmin /= preferences.length_unit; dmax /= preferences.length_unit; dquant /= preferences.length_unit; } scale_new (parent, title, dval, dmin, dmax, dquant, (opt->cap & SANE_CAP_AUTOMATIC), elem, dialog->tooltips, opt->desc, SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_WORD_LIST: /* use a "list-selection" widget */ num_words = opt->constraint.word_list[0]; str_list = malloc ((num_words + 1) * sizeof (str_list[0])); for (j = 0; j < num_words; ++j) { sprintf (str, "%g", SANE_UNFIX (opt->constraint.word_list[j + 1])); str_list[j] = strdup (str); } str_list[j] = 0; sprintf (str, "%g", SANE_UNFIX (val)); option_menu_new (parent, title, str_list, str, elem, dialog->tooltips, opt->desc, SANE_OPTION_IS_SETTABLE (opt->cap)); free (str_list); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_NONE: /* having no constraint for a fixed is strange but allowed by the SANE standard so we just ignore such options here */ break; default: fprintf (stderr, "panel_build: unknown constraint %d!\n", opt->constraint_type); break; } break; case SANE_TYPE_STRING: if ((opt->cap & SANE_CAP_ADVANCED) && !dialog->advanced) break; if (!(opt->cap & SANE_CAP_SOFT_DETECT)) break; buf = malloc (opt->size); status = sane_control_option (dialog->dev, i, SANE_ACTION_GET_VALUE, buf, 0); if (status != SANE_STATUS_GOOD) { free (buf); goto get_value_failed; } switch (opt->constraint_type) { case SANE_CONSTRAINT_STRING_LIST: /* use a "list-selection" widget */ option_menu_new (parent, title, (char **) opt->constraint.string_list, buf, elem, dialog->tooltips, opt->desc, SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_NONE: text_entry_new (parent, title, buf, elem, dialog->tooltips, opt->desc, SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; default: fprintf (stderr, "panel_build: unknown constraint %d!\n", opt->constraint_type); break; } free (buf); break; case SANE_TYPE_BUTTON: if ((opt->cap & SANE_CAP_ADVANCED) && !dialog->advanced) break; button = gtk_button_new (); gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) push_button_callback, elem); set_tooltip (dialog->tooltips, button, opt->desc); label = gtk_label_new (title); gtk_container_add (GTK_CONTAINER (button), label); gtk_box_pack_start (GTK_BOX (parent), button, FALSE, TRUE, 0); gtk_widget_show (label); gtk_widget_show (button); elem->widget = button; gtk_widget_show (parent->parent); break; default: fprintf (stderr, "panel_build: Unknown type %d\n", opt->type); break; } continue; get_value_failed: { char msg[256]; sprintf (msg, "Failed to obtain value of option %s: %s.", opt->name, sane_strstatus (status)); gsg_error (msg); } } /* now add in vector editor, if necessary: */ if (num_vector_opts) vector_new (dialog, main_hbox, num_vector_opts, vector_opts); if (dialog->advanced) gtk_widget_show (dialog->advanced_vbox); else gtk_widget_hide (dialog->advanced_vbox); gtk_widget_show (main_hbox); } /* When an setting an option changes the dialog, everything may change: the option titles, the activity-status of the option, its constraints or what not. Thus, rather than trying to be clever in detecting what exactly changed, we use a brute-force method of rebuilding the entire dialog. */ static void panel_rebuild (GSGDialog * dialog) { panel_destroy (dialog); panel_build (dialog); } GSGDialog * gsg_create_dialog (GtkWidget * window, const char *device_name, GSGCallback option_reload_callback, void *option_reload_arg, GSGCallback param_change_callback, void *param_change_arg) { SANE_Int num_elements; GSGDialog *dialog; SANE_Status status; SANE_Handle dev; char buf[256]; status = sane_open (device_name, &dev); if (status != SANE_STATUS_GOOD) { sprintf (buf, "Failed to open device `%s': %s.", device_name, sane_strstatus (status)); gsg_error (buf); return 0; } if (sane_control_option (dev, 0, SANE_ACTION_GET_VALUE, &num_elements, 0) != SANE_STATUS_GOOD) { gsg_error ("Error obtaining option count."); sane_close (dev); return 0; } dialog = malloc (sizeof (*dialog)); memset (dialog, 0, sizeof (*dialog)); dialog->window = window; dialog->dev = dev; dialog->dev_name = strdup (device_name); dialog->num_elements = num_elements; dialog->option_reload_callback = option_reload_callback; dialog->option_reload_arg = option_reload_arg; dialog->param_change_callback = param_change_callback; dialog->param_change_arg = param_change_arg; dialog->advanced = preferences.advanced; dialog->twocolumn = preferences.twocolumn_enabled; dialog->element = malloc (num_elements * sizeof (dialog->element[0])); memset (dialog->element, 0, num_elements * sizeof (dialog->element[0])); panel_build (dialog); return dialog; } void gsg_refresh_dialog (GSGDialog * dialog) { panel_rebuild (dialog); if (dialog->param_change_callback) (*dialog->param_change_callback) (dialog, dialog->param_change_arg); } void gsg_update_scan_window (GSGDialog * dialog) { const SANE_Option_Descriptor *opt; double old_val, new_val; GSGDialogElement *elem; SANE_Status status; SANE_Word word; int i, optnum; char str[64]; for (i = 0; i < 4; ++i) if (dialog->well_known.coord[i] > 0) { optnum = dialog->well_known.coord[i]; elem = dialog->element + optnum; opt = sane_get_option_descriptor (dialog->dev, optnum); status = sane_control_option (dialog->dev, optnum, SANE_ACTION_GET_VALUE, &word, 0); if (status != SANE_STATUS_GOOD) continue; /* sliently ignore errors */ switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: if (opt->type == SANE_TYPE_INT) { old_val = GTK_ADJUSTMENT (elem->data)->value; new_val = word; GTK_ADJUSTMENT (elem->data)->value = new_val; } else { old_val = GTK_ADJUSTMENT (elem->data)->value; new_val = SANE_UNFIX (word); if (opt->unit == SANE_UNIT_MM) new_val /= preferences.length_unit; GTK_ADJUSTMENT (elem->data)->value = new_val; } if (old_val != new_val) gtk_signal_emit_by_name (GTK_OBJECT (elem->data), "value_changed"); break; case SANE_CONSTRAINT_WORD_LIST: if (opt->type == SANE_TYPE_INT) sprintf (str, "%d", word); else sprintf (str, "%g", SANE_UNFIX (word)); /* XXX maybe we should call this only when the value changes... */ gtk_option_menu_set_history (GTK_OPTION_MENU (elem->widget), option_menu_lookup (elem->menu, str)); break; default: break; } } } /* Ensure sure the device has up-to-date option values. Except for vectors, all option values are kept current. Vectors are downloaded into the device during this call. */ void gsg_sync (GSGDialog * dialog) { const SANE_Option_Descriptor *opt; gfloat val, *vector; SANE_Word *optval; int i, j, optlen; GtkWidget *curve; for (i = 1; i < dialog->num_elements; ++i) { opt = sane_get_option_descriptor (dialog->dev, i); if (!SANE_OPTION_IS_ACTIVE (opt->cap)) continue; if (opt->type != SANE_TYPE_INT && opt->type != SANE_TYPE_FIXED) continue; if (opt->size == sizeof (SANE_Word)) continue; /* ok, we're dealing with an active vector */ optlen = opt->size / sizeof (SANE_Word); optval = alloca (optlen * sizeof (optval[0])); vector = alloca (optlen * sizeof (vector[0])); curve = GTK_GAMMA_CURVE (dialog->element[i].widget)->curve; gtk_curve_get_vector (GTK_CURVE (curve), optlen, vector); for (j = 0; j < optlen; ++j) { val = vector[j]; if (opt->type == SANE_TYPE_FIXED) optval[j] = SANE_FIX (val); else optval[j] = val + 0.5; } set_option (dialog, i, optval, SANE_ACTION_SET_VALUE); } } void gsg_set_advanced (GSGDialog * dialog, int advanced) { dialog->advanced = advanced; panel_rebuild (dialog); } void gsg_set_tooltips (GSGDialog * dialog, int enable) { if (!dialog->tooltips) return; if (enable) gtk_tooltips_enable (dialog->tooltips); else gtk_tooltips_disable (dialog->tooltips); } void gsg_set_twocolumn (GSGDialog * dialog, int twocolumn) { dialog->twocolumn = twocolumn; panel_rebuild (dialog); } void gsg_set_sensitivity (GSGDialog * dialog, int sensitive) { const SANE_Option_Descriptor *opt; int i; for (i = 0; i < dialog->num_elements; ++i) { opt = sane_get_option_descriptor (dialog->dev, i); if (!SANE_OPTION_IS_ACTIVE (opt->cap) || opt->type == SANE_TYPE_GROUP || !dialog->element[i].widget) continue; if (!(opt->cap & SANE_CAP_ALWAYS_SETTABLE)) gtk_widget_set_sensitive (dialog->element[i].widget, sensitive); } } void gsg_destroy_dialog (GSGDialog * dialog) { SANE_Handle dev = dialog->dev; panel_destroy (dialog); free ((void *) dialog->dev_name); free (dialog->element); free (dialog); sane_close (dev); } ./sane-frontends-1.0.14/src/gtkglue.h0000644000175000017500000000667710044471501015406 0ustar hmghmg#ifndef gtkglue_h #define gtkglue_h #include #include #include "../include/sane/config.h" #include struct GSGDialog; typedef void (*GSGCallback) (struct GSGDialog *dialog, void *arg); typedef enum { GSG_TL_X, /* top-left x */ GSG_TL_Y, /* top-left y */ GSG_BR_X, /* bottom-right x */ GSG_BR_Y /* bottom-right y */ } GSGCornerCoordinates; typedef struct { /* The option number of the well-known options. Each of these may be -1 in case the backend doesn't define the respective option. */ int preview; int dpi; int coord[4]; } GSGWellKnownOptions; typedef struct { gchar *label; struct GSGDialogElement *elem; gint index; } GSGMenuItem; typedef struct GSGDialogElement { struct GSGDialog *dialog; /* wasteful, but is there a better solution? */ GtkWidget *automatic; /* auto button for options that support this */ GtkWidget *widget; GtkObject *data; int menu_size; /* # of items in menu (if any) */ GSGMenuItem *menu; } GSGDialogElement; typedef struct GSGDialog { GtkWidget *window; GtkWidget *main_hbox; GtkWidget *advanced_vbox; int twocolumn; GtkTooltips *tooltips; GdkColor tooltips_fg; GdkColor tooltips_bg; SANE_Handle *dev; const char *dev_name; GSGWellKnownOptions well_known; int num_elements; GSGDialogElement *element; gint idle_id; u_int rebuild : 1; u_int advanced : 1; /* This callback gets invoked whenever the backend notifies us that the option descriptors have changed. */ GSGCallback option_reload_callback; void *option_reload_arg; /* This callback gets invoked whenever the backend notifies us that the parameters have changed. */ GSGCallback param_change_callback; void *param_change_arg; } GSGDialog; extern int gsg_message_dialog_active; /* Construct the path and return it in filename_ret (this buffer must be at least max_len bytes long). The path is constructed as follows: ~/.sane/${PROG_NAME}/${PREFIX}${DEV_NAME}${POSTFIX} If PROG_NAME is NULL, an empty string is used and the leading slash is removed. On success, 0 is returned, on error a negative number and ERRNO is set to the appropriate value. */ extern int gsg_make_path (size_t max_len, char *filename_ret, const char *prog_name, const char *prefix, const char *dev_name, const char *postfix); extern void gsg_message (gchar *title, gchar * message); extern void gsg_error (gchar * error_message); extern void gsg_warning (gchar * warning_message); extern int gsg_get_filename (const char *label, const char *default_name, size_t max_len, char *filename); extern GSGDialog *gsg_create_dialog (GtkWidget *window, const char *device_name, GSGCallback option_reload_callback, void *option_reload_arg, GSGCallback param_callback, void *param_arg); extern void gsg_sync (GSGDialog *dialog); extern void gsg_refresh_dialog (GSGDialog *dialog); extern void gsg_update_scan_window (GSGDialog *dialog); extern void gsg_set_advanced (GSGDialog *dialog, int advanced); extern void gsg_set_tooltips (GSGDialog *dialog, int enable); extern void gsg_set_twocolumn (GSGDialog *dialog, int enable); extern void gsg_set_sensitivity (GSGDialog *dialog, int sensitive); extern void gsg_destroy_dialog (GSGDialog * dialog); #define gsg_dialog_get_device(dialog) ((dialog)->dev) #endif /* gtkglue_h */ ./sane-frontends-1.0.14/src/preferences.c0000644000175000017500000001073110034347607016232 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "../include/sane/config.h" #include #include #include #include #include #include "../include/sane/sanei.h" #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_ascii.h" #define POFFSET(field) ((char *) &((Preferences *) 0)->field - (char *) 0) #define PFIELD(p,offset,type) (*((type *)(((char *)(p)) + (offset)))) Preferences preferences = { 0, /* no preferred device (must be 0 or malloced!) */ 0, /* no default filename */ 0, /* advanced user */ 1, /* tooltips enabled */ 1, /* two column enabled */ 10.0, /* length unit */ 1, /* preserve_preview */ 0, /* preview_own_cmap */ 1.0 /* preview_gamma */ }; static void w_string (Wire *w, Preferences *p, long offset); static void w_double (Wire *w, Preferences *p, long offset); static void w_int (Wire *w, Preferences *p, long offset); static struct { SANE_String name; void (*codec) (Wire *w, Preferences *p, long offset); long offset; } desc[] = { {"device", w_string, POFFSET(device)}, {"filename", w_string, POFFSET(filename)}, {"advanced", w_int, POFFSET(advanced)}, {"tool-tips", w_int, POFFSET(tooltips_enabled)}, {"twocolumn", w_int, POFFSET(twocolumn_enabled)}, {"length-unit", w_double, POFFSET(length_unit)}, {"preserve-preview", w_int, POFFSET(preserve_preview)}, {"preview-own-cmap", w_int, POFFSET(preview_own_cmap)}, {"preview-gamma", w_double, POFFSET(preview_gamma)}, }; static void w_string (Wire *w, Preferences *p, long offset) { SANE_String string; if (w->direction == WIRE_ENCODE) string = PFIELD (p, offset, char *); sanei_w_string (w, &string); if (w->direction == WIRE_DECODE) { if (w->status == 0) { const char **field; field = &PFIELD (p, offset, const char *); if (*field) free ((char *) *field); *field = string ? strdup (string) : 0; } sanei_w_free (w, (WireCodecFunc) sanei_w_string, &string); } } static void w_double (Wire *w, Preferences *p, long offset) { SANE_Word word; if (w->direction == WIRE_ENCODE) word = SANE_FIX (PFIELD (p, offset, double)); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) { if (w->status == 0) PFIELD (p, offset, double) = SANE_UNFIX (word); sanei_w_free (w, (WireCodecFunc) sanei_w_word, &word); } } static void w_int (Wire *w, Preferences *p, long offset) { SANE_Word word; if (w->direction == WIRE_ENCODE) word = PFIELD (p, offset, int); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) { if (w->status == 0) PFIELD (p, offset, int) = word; sanei_w_free (w, (WireCodecFunc) sanei_w_word, &word); } } void preferences_save (int fd) { Wire w; int i; w.io.fd = fd; w.io.read = read; w.io.write = write; sanei_w_init (&w, sanei_codec_ascii_init); sanei_w_set_dir (&w, WIRE_ENCODE); for (i = 0; i < NELEMS (desc); ++i) { sanei_w_string (&w, &desc[i].name); (*desc[i].codec) (&w, &preferences, desc[i].offset); } sanei_w_set_dir (&w, WIRE_DECODE); /* flush it out */ } void preferences_restore (int fd) { SANE_String name; Wire w; int i; w.io.fd = fd; w.io.read = read; w.io.write = write; sanei_w_init (&w, sanei_codec_ascii_init); sanei_w_set_dir (&w, WIRE_DECODE); while (1) { sanei_w_space (&w, 3); if (w.status) return; sanei_w_string (&w, &name); if (w.status || !name) return; for (i = 0; i < NELEMS (desc); ++i) { if (strcmp (name, desc[i].name) == 0) { (*desc[i].codec) (&w, &preferences, desc[i].offset); break; } } } } ./sane-frontends-1.0.14/src/preferences.h0000644000175000017500000000141210034347607016233 0ustar hmghmg#ifndef preferences_h #define preferences_h #include typedef struct { const char *device; /* name of preferred device (or NULL) */ const char *filename; /* default filename */ int advanced; /* advanced user? */ int tooltips_enabled; /* should tooltips be disabled? */ int twocolumn_enabled; /* should two column be disabled? */ double length_unit; /* 1.0==mm, 10.0==cm, 25.4==inches, etc. */ int preserve_preview; /* save/restore preview image(s)? */ int preview_own_cmap; /* install colormap for preview */ double preview_gamma; /* gamma value for previews */ } Preferences; extern Preferences preferences; extern void preferences_save (int fd); extern void preferences_restore (int fd); #endif /* preferences_h */ ./sane-frontends-1.0.14/src/preview.c0000644000175000017500000011361310230207447015410 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang and Tristan Tarrant This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* The preview strategy is as follows: 1) A preview always acquires an image that covers the entire scan surface. This is necessary so the user can see not only what is, but also what isn't selected. 2) The preview must be zoomable so the user can precisely pick the selection area even for small scans on a large scan surface. The user also should have the option of resizing the preview window. 3) We let the user/backend pick whether a preview is in color, grayscale, lineart or what not. The only options that the preview may (temporarily) modify are: - resolution (set so the preview fills the window) - scan area options (top-left corner, bottom-right corner) - preview option (to let the backend know we're doing a preview) 4) The size of the scan surface is determined based on the constraints of the four corner coordinates. Missing constraints are replaced by +/-INF as appropriate (-INF form top-left, +INF for bottom-right coords). 5) The size of the preview window is determined based on the scan surface size: If the surface area is specified in pixels and if that size fits on the screen, we use that size. In all other cases, we make the window of a size so that neither the width nor the height is bigger than some fraction of the screen-size while preserving the aspect ratio (a surface width or height of INF implies an aspect ratio of 1). 6) Given the preview window size and the scan surface size, we select the resolution so the acquired preview image just fits in the preview window. The resulting resolution may be out of range in which case we pick the minum/maximum if there is a range or word-list constraint or a default value if there is no such constraint. 7) Once a preview image has been acquired, we know the size of the preview image (in pixels). An initial scale factor is chosen so the image fits into the preview window. */ #include "../include/sane/config.h" #include #include #include #include #include #include #include #include #include "gtkglue.h" #include "preview.h" #include "preferences.h" #define DBG_fatal 0 #define DBG_error 1 #define DBG_warning 2 #define DBG_info 3 #define DBG_debug 4 #define BACKEND_NAME preview #include "../include/sane/sanei_debug.h" #ifndef PATH_MAX # define PATH_MAX 1024 #endif /* Anything bigger than 2G will do, since SANE coordinates are 32 bit values. */ #define INF 5.0e9 #define MM_PER_INCH 25.4 /* Cut fp conversion routines some slack: */ #define GROSSLY_DIFFERENT(f1,f2) (fabs ((f1) - (f2)) > 1e-3) #ifdef __alpha__ /* This seems to be necessary for at least some XFree86 3.1.2 servers. It's known to be necessary for the XF86_TGA server for Linux/Alpha. Fortunately, it's no great loss so we turn this on by default for now. */ # define XSERVER_WITH_BUGGY_VISUALS #endif /* forward declarations */ static void scan_start (Preview * p); static void scan_done (Preview * p); static void draw_rect (GdkWindow * win, GdkGC * gc, int coord[4]) { gint x, y, w, h; x = coord[0]; y = coord[1]; w = coord[2] - x; h = coord[3] - y; if (w < 0) { x = coord[2]; w = -w; } if (h < 0) { y = coord[3]; h = -h; } gdk_draw_rectangle (win, gc, FALSE, x, y, w + 1, h + 1); } static void draw_selection (Preview * p) { if (!p->gc) /* window isn't mapped yet */ return; if (p->previous_selection.active) draw_rect (p->window->window, p->gc, p->previous_selection.coord); if (p->selection.active) draw_rect (p->window->window, p->gc, p->selection.coord); p->previous_selection = p->selection; } static void update_selection (Preview * p) { float min, max, normal, dev_selection[4]; const SANE_Option_Descriptor *opt; SANE_Status status; SANE_Word val; int i, optnum; p->previous_selection = p->selection; memcpy (dev_selection, p->surface, sizeof (dev_selection)); for (i = 0; i < 4; ++i) { optnum = p->dialog->well_known.coord[i]; if (optnum > 0) { opt = sane_get_option_descriptor (p->dialog->dev, optnum); status = sane_control_option (p->dialog->dev, optnum, SANE_ACTION_GET_VALUE, &val, 0); if (status != SANE_STATUS_GOOD) continue; if (opt->type == SANE_TYPE_FIXED) dev_selection[i] = SANE_UNFIX (val); else dev_selection[i] = val; } } for (i = 0; i < 2; ++i) { min = p->surface[i]; if (min <= -INF) min = 0.0; max = p->surface[i + 2]; if (max >= INF) max = p->preview_width; normal = ((i == 0) ? p->preview_width : p->preview_height) - 1; normal /= (max - min); p->selection.active = TRUE; p->selection.coord[i] = ((dev_selection[i] - min) * normal) + 0.5; p->selection.coord[i + 2] = ((dev_selection[i + 2] - min) * normal) + 0.5; if (p->selection.coord[i + 2] < p->selection.coord[i]) p->selection.coord[i + 2] = p->selection.coord[i]; } draw_selection (p); } static void get_image_scale (Preview * p, float *xscalep, float *yscalep) { float xscale, yscale; if (p->image_width == 0) xscale = 1.0; else { xscale = p->image_width / (float) p->preview_width; if (p->image_height > 0 && p->preview_height * xscale < p->image_height) xscale = p->image_height / (float) p->preview_height; } yscale = xscale; if (p->surface_unit == SANE_UNIT_PIXEL && p->image_width <= p->preview_width && p->image_height <= p->preview_height) { float swidth, sheight; assert (p->surface_type == SANE_TYPE_INT); swidth = (p->surface[GSG_BR_X] - p->surface[GSG_TL_X] + 1); sheight = (p->surface[GSG_BR_Y] - p->surface[GSG_TL_Y] + 1); xscale = 1.0; yscale = 1.0; if (p->image_width > 0 && swidth < INF) xscale = p->image_width / swidth; if (p->image_height > 0 && sheight < INF) yscale = p->image_height / sheight; } *xscalep = xscale; *yscalep = yscale; } static void paint_image (Preview * p) { float xscale, yscale, src_x, src_y; int dst_x, dst_y, height, x, y, src_offset; gint gwidth, gheight; gwidth = p->preview_width; gheight = p->preview_height; get_image_scale (p, &xscale, &yscale); memset (p->preview_row, 0xff, 3 * gwidth); /* don't draw last line unless it's complete: */ height = p->image_y; if (p->image_x == 0 && height < p->image_height) ++height; /* for now, use simple nearest-neighbor interpolation: */ src_offset = 0; src_x = src_y = 0.0; for (dst_y = 0; dst_y < gheight; ++dst_y) { y = (int) (src_y + 0.5); if (y >= height) break; src_offset = y * 3 * p->image_width; if (p->image_data) for (dst_x = 0; dst_x < gwidth; ++dst_x) { x = (int) (src_x + 0.5); if (x >= p->image_width) break; p->preview_row[3 * dst_x + 0] = p->image_data[src_offset + 3 * x + 0]; p->preview_row[3 * dst_x + 1] = p->image_data[src_offset + 3 * x + 1]; p->preview_row[3 * dst_x + 2] = p->image_data[src_offset + 3 * x + 2]; src_x += xscale; } gtk_preview_draw_row (GTK_PREVIEW (p->window), p->preview_row, 0, dst_y, gwidth); src_x = 0.0; src_y += yscale; } } static void display_partial_image (Preview * p) { paint_image (p); if (GTK_WIDGET_DRAWABLE (p->window)) { GtkPreview *preview = GTK_PREVIEW (p->window); int src_x, src_y; src_x = (p->window->allocation.width - preview->buffer_width) / 2; src_y = (p->window->allocation.height - preview->buffer_height) / 2; gtk_preview_put (preview, p->window->window, p->window->style->black_gc, src_x, src_y, 0, 0, p->preview_width, p->preview_height); } } static void display_maybe (Preview * p) { time_t now; time (&now); if (now > p->image_last_time_updated) { p->image_last_time_updated = now; display_partial_image (p); } } static void display_image (Preview * p) { if (p->params.lines <= 0 && p->image_y < p->image_height) { p->image_height = p->image_y; p->image_data = realloc (p->image_data, 3 * p->image_width * p->image_height); assert (p->image_data); } display_partial_image (p); scan_done (p); } static void preview_area_resize (GtkWidget * widget) { float min_x, max_x, min_y, max_y, xscale, yscale, f; Preview *p; p = gtk_object_get_data (GTK_OBJECT (widget), "PreviewPointer"); p->preview_width = widget->allocation.width; p->preview_height = widget->allocation.height; if (p->preview_row) p->preview_row = realloc (p->preview_row, 3 * p->preview_width); else p->preview_row = malloc (3 * p->preview_width); /* set the ruler ranges: */ min_x = p->surface[GSG_TL_X]; if (min_x <= -INF) min_x = 0.0; max_x = p->surface[GSG_BR_X]; if (max_x >= INF) max_x = p->preview_width - 1; min_y = p->surface[GSG_TL_Y]; if (min_y <= -INF) min_y = 0.0; max_y = p->surface[GSG_BR_Y]; if (max_y >= INF) max_y = p->preview_height - 1; /* convert mm to inches if that's what the user wants: */ if (p->surface_unit == SANE_UNIT_MM) { double factor = 1.0 / preferences.length_unit; min_x *= factor; max_x *= factor; min_y *= factor; max_y *= factor; } get_image_scale (p, &xscale, &yscale); if (p->surface_unit == SANE_UNIT_PIXEL) f = 1.0 / xscale; else if (p->image_width) f = xscale * p->preview_width / p->image_width; else f = 1.0; gtk_ruler_set_range (GTK_RULER (p->hruler), f * min_x, f * max_x, f * min_x, /* max_size */ 20); if (p->surface_unit == SANE_UNIT_PIXEL) f = 1.0 / yscale; else if (p->image_height) f = yscale * p->preview_height / p->image_height; else f = 1.0; gtk_ruler_set_range (GTK_RULER (p->vruler), f * min_y, f * max_y, f * min_y, /* max_size */ 20); paint_image (p); update_selection (p); } static void get_bounds (const SANE_Option_Descriptor * opt, float *minp, float *maxp) { float min, max; int i; min = -INF; max = INF; switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: min = opt->constraint.range->min; max = opt->constraint.range->max; break; case SANE_CONSTRAINT_WORD_LIST: min = INF; max = -INF; for (i = 1; i <= opt->constraint.word_list[0]; ++i) { if (opt->constraint.word_list[i] < min) min = opt->constraint.word_list[i]; if (opt->constraint.word_list[i] > max) max = opt->constraint.word_list[i]; } break; default: break; } if (opt->type == SANE_TYPE_FIXED) { if (min > -INF && min < INF) min = SANE_UNFIX (min); if (max > -INF && max < INF) max = SANE_UNFIX (max); } *minp = min; *maxp = max; } static void save_option (Preview * p, int option, SANE_Word * save_loc, int *valid) { SANE_Status status; if (option <= 0) { *valid = 0; return; } status = sane_control_option (p->dialog->dev, option, SANE_ACTION_GET_VALUE, save_loc, 0); *valid = (status == SANE_STATUS_GOOD); } static void restore_option (Preview * p, int option, SANE_Word saved_value, int valid) { const SANE_Option_Descriptor *opt; SANE_Status status; SANE_Handle dev; if (!valid) return; dev = p->dialog->dev; status = sane_control_option (dev, option, SANE_ACTION_SET_VALUE, &saved_value, 0); if (status != SANE_STATUS_GOOD) { char buf[256]; opt = sane_get_option_descriptor (dev, option); snprintf (buf, sizeof (buf), "Failed restore value of option %s: %s.", opt->name, sane_strstatus (status)); gsg_error (buf); } } static SANE_Status set_option_float (Preview * p, int option, float value) { const SANE_Option_Descriptor *opt; SANE_Handle dev; SANE_Word word; SANE_Status status; if (option <= 0 || value <= -INF || value >= INF) return SANE_STATUS_INVAL; dev = p->dialog->dev; opt = sane_get_option_descriptor (dev, option); if (opt->type == SANE_TYPE_FIXED) word = SANE_FIX (value) + 0.5; else word = value + 0.5; status = sane_control_option (dev, option, SANE_ACTION_SET_VALUE, &word, 0); if (status != SANE_STATUS_GOOD) { char buf[256]; opt = sane_get_option_descriptor (dev, option); snprintf (buf, sizeof (buf), "Failed to set option %s: %s.", opt->name, sane_strstatus (status)); gsg_error (buf); return status; } return SANE_STATUS_GOOD; } static void set_option_bool (Preview * p, int option, SANE_Bool value) { SANE_Handle dev; SANE_Status status; if (option <= 0) return; dev = p->dialog->dev; status = sane_control_option (dev, option, SANE_ACTION_SET_VALUE, &value, 0); if (status != SANE_STATUS_GOOD) { DBG (DBG_fatal, "set_option_bool: sane_control_option failed: %s\n", sane_strstatus (status)); return; } } static int increment_image_y (Preview * p) { size_t extra_size, offset; char buf[256]; p->image_x = 0; ++p->image_y; if (p->params.lines <= 0 && p->image_y >= p->image_height) { offset = 3 * p->image_width * p->image_height; extra_size = 3 * 32 * p->image_width; p->image_height += 32; p->image_data = realloc (p->image_data, offset + extra_size); if (!p->image_data) { snprintf (buf, sizeof (buf), "Failed to reallocate image memory: %s.", strerror (errno)); gsg_error (buf); scan_done (p); return -1; } memset (p->image_data + offset, 0xff, extra_size); } return 0; } static void input_available (gpointer data, gint source, GdkInputCondition cond) { SANE_Status status; Preview *p = data; u_char buf[8192]; SANE_Handle dev; SANE_Int len; int i, j; DBG_INIT (); DBG (DBG_debug, "input_available: enter\n"); dev = p->dialog->dev; while (1) { status = sane_read (dev, buf, sizeof (buf), &len); if (status != SANE_STATUS_GOOD) { if (status == SANE_STATUS_EOF) { if (p->params.last_frame) display_image (p); else { if (p->input_tag < 0) { display_maybe (p); while (gtk_events_pending ()) gtk_main_iteration (); } else { gdk_input_remove (p->input_tag); p->input_tag = -1; } scan_start (p); break; } } else { snprintf (buf, sizeof (buf), "Error during read: %s.", sane_strstatus (status)); gsg_error (buf); } scan_done (p); return; } if (!len) /* out of data for now */ { if (p->input_tag < 0) { display_maybe (p); while (gtk_events_pending ()) gtk_main_iteration (); continue; } else break; } switch (p->params.format) { case SANE_FRAME_RGB: switch (p->params.depth) { case 1: for (i = 0; i < len; ++i) { u_char mask = buf[i]; for (j = 7; j >= 0; --j) { u_char gl = (mask & (1 << j)) ? 0xff : 0x00; p->image_data[p->image_offset] = gl; if (j != 0) p->image_offset += 3; else { if ((p->image_offset % 3) != 2) p->image_offset -= 20; else p->image_offset++; } if (p->image_offset % 3 == 0) { if (++p->image_x >= p->image_width) { if (increment_image_y (p) < 0) return; } } } } break; case 8: for (i = 0; i < len; ++i) { p->image_data[p->image_offset++] = buf[i]; if (p->image_offset % 3 == 0) { if (++p->image_x >= p->image_width && increment_image_y (p) < 0) return; } } break; case 16: for (i = 0; i < len; ++i) { guint16 value = buf[i]; if ((i % 2) == 1) p->image_data[p->image_offset++] = *(guint8 *) (&value); if (p->image_offset % 6 == 0) { if (++p->image_x >= p->image_width && increment_image_y (p) < 0) return; } } break; default: goto bad_depth; } break; case SANE_FRAME_GRAY: switch (p->params.depth) { case 1: for (i = 0; i < len; ++i) { u_char mask = buf[i]; for (j = 7; j >= 0; --j) { u_char gl = (mask & (1 << j)) ? 0x00 : 0xff; p->image_data[p->image_offset++] = gl; p->image_data[p->image_offset++] = gl; p->image_data[p->image_offset++] = gl; if (++p->image_x >= p->image_width) { if (increment_image_y (p) < 0) return; break; /* skip padding bits */ } } } break; case 8: for (i = 0; i < len; ++i) { u_char gl = buf[i]; p->image_data[p->image_offset++] = gl; p->image_data[p->image_offset++] = gl; p->image_data[p->image_offset++] = gl; if (++p->image_x >= p->image_width && increment_image_y (p) < 0) return; } break; case 16: for (i = 0; i < len; ++i) { guint16 value = buf[i]; if ((i % 2) == 1) { p->image_data[p->image_offset++] = *(guint8 *) (&value); p->image_data[p->image_offset++] = *(guint8 *) (&value); p->image_data[p->image_offset++] = *(guint8 *) (&value); } if (p->image_offset % 2 == 0) { if (++p->image_x >= p->image_width && increment_image_y (p) < 0) return; } } break; default: goto bad_depth; } break; case SANE_FRAME_RED: case SANE_FRAME_GREEN: case SANE_FRAME_BLUE: switch (p->params.depth) { case 1: for (i = 0; i < len; ++i) { u_char mask = buf[i]; for (j = 7; j >= 0; --j) { u_char gl = (mask & (1 << j)) ? 0xff : 0x00; p->image_data[p->image_offset] = gl; p->image_offset += 3; if (++p->image_x >= p->image_width && increment_image_y (p) < 0) return; } } break; case 8: for (i = 0; i < len; ++i) { p->image_data[p->image_offset] = buf[i]; p->image_offset += 3; if (++p->image_x >= p->image_width && increment_image_y (p) < 0) return; } break; case 16: for (i = 0; i < len; ++i) { guint16 value = buf[i]; if ((i % 2) == 1) { p->image_data[p->image_offset] = *(guint8 *) (&value); p->image_offset += 3; } if (p->image_offset % 2 == 0) { if (++p->image_x >= p->image_width && increment_image_y (p) < 0) return; } } break; default: goto bad_depth; } break; default: fprintf (stderr, "preview.input_available: bad frame format %d\n", p->params.format); scan_done (p); return; } if (p->input_tag < 0) { display_maybe (p); while (gtk_events_pending ()) gtk_main_iteration (); } } display_maybe (p); return; bad_depth: snprintf (buf, sizeof (buf), "Preview cannot handle depth %d.", p->params.depth); gsg_error (buf); scan_done (p); return; } static void scan_done (Preview * p) { int i; p->scanning = FALSE; if (p->input_tag >= 0) { gdk_input_remove (p->input_tag); p->input_tag = -1; } sane_cancel (p->dialog->dev); restore_option (p, p->dialog->well_known.dpi, p->saved_dpi, p->saved_dpi_valid); for (i = 0; i < 4; ++i) restore_option (p, p->dialog->well_known.coord[i], p->saved_coord[i], p->saved_coord_valid[i]); set_option_bool (p, p->dialog->well_known.preview, SANE_FALSE); gtk_widget_set_sensitive (p->cancel, FALSE); gtk_widget_set_sensitive (p->preview, TRUE); gsg_set_sensitivity (p->dialog, TRUE); gtk_widget_set_sensitive (p->dialog->window->parent->parent->parent, TRUE); } static void scan_start (Preview * p) { SANE_Handle dev = p->dialog->dev; SANE_Status status; char buf[256]; int fd, y; gtk_widget_set_sensitive (p->cancel, TRUE); gtk_widget_set_sensitive (p->preview, FALSE); gsg_set_sensitivity (p->dialog, FALSE); gtk_widget_set_sensitive (p->dialog->window->parent->parent->parent, FALSE); /* clear old preview: */ memset (p->preview_row, 0xff, 3 * p->preview_width); for (y = 0; y < p->preview_height; ++y) gtk_preview_draw_row (GTK_PREVIEW (p->window), p->preview_row, 0, y, p->preview_width); if (p->input_tag >= 0) { gdk_input_remove (p->input_tag); p->input_tag = -1; } gsg_sync (p->dialog); status = sane_start (dev); if (status != SANE_STATUS_GOOD) { snprintf (buf, sizeof (buf), "Failed to start scanner: %s.", sane_strstatus (status)); gsg_error (buf); scan_done (p); return; } status = sane_get_parameters (dev, &p->params); if (status != SANE_STATUS_GOOD) { snprintf (buf, sizeof (buf), "Failed to obtain parameters: %s.", sane_strstatus (status)); gsg_error (buf); scan_done (p); return; } if ((p->params.format >= SANE_FRAME_RGB && p->params.format <= SANE_FRAME_BLUE) && p->params.depth == 1 && p->params.pixels_per_line % 8 != 0) { snprintf (buf, sizeof (buf), "Can't handle unaligned 1 bit RGB or three-pass mode."); gsg_error (buf); scan_done (p); return; } p->image_offset = p->image_x = p->image_y = 0; if (p->params.format >= SANE_FRAME_RED && p->params.format <= SANE_FRAME_BLUE) p->image_offset = p->params.format - SANE_FRAME_RED; if (!p->image_data || p->params.pixels_per_line != p->image_width || (p->params.lines >= 0 && p->params.lines != p->image_height)) { /* image size changed */ if (p->image_data) free (p->image_data); p->image_width = p->params.pixels_per_line; p->image_height = p->params.lines; if (p->image_height < 0) p->image_height = 32; /* may have to adjust as we go... */ p->image_data = malloc (p->image_width * p->image_height * 3); if (!p->image_data) { snprintf (buf, sizeof (buf), "Failed to allocate image memory: %s.", strerror (errno)); gsg_error (buf); scan_done (p); return; } memset (p->image_data, 0xff, 3 * p->image_width * p->image_height); } if (p->selection.active) { p->previous_selection = p->selection; p->selection.active = FALSE; draw_selection (p); } p->scanning = TRUE; if (sane_set_io_mode (dev, SANE_TRUE) == SANE_STATUS_GOOD && sane_get_select_fd (dev, &fd) == SANE_STATUS_GOOD) p->input_tag = gdk_input_add (fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, input_available, p); else input_available (p, -1, GDK_INPUT_READ); } static void establish_selection (Preview * p) { float min, max, normal, dev_selection[4]; int i; memcpy (dev_selection, p->surface, sizeof (dev_selection)); if (p->selection.active) for (i = 0; i < 2; ++i) { min = p->surface[i]; if (min <= -INF) min = 0.0; max = p->surface[i + 2]; if (max >= INF) max = p->preview_width; normal = 1.0 / (((i == 0) ? p->preview_width : p->preview_height) - 1); normal *= (max - min); dev_selection[i] = p->selection.coord[i] * normal + min; dev_selection[i + 2] = p->selection.coord[i + 2] * normal + min; } for (i = 0; i < 4; ++i) set_option_float (p, p->dialog->well_known.coord[i], dev_selection[i]); gsg_update_scan_window (p->dialog); if (p->dialog->param_change_callback) (*p->dialog->param_change_callback) (p->dialog, p->dialog->param_change_arg); } static int make_preview_image_path (Preview * p, size_t filename_size, char *filename) { return gsg_make_path (filename_size, filename, 0, "preview-", p->dialog->dev_name, ".ppm"); } static void restore_preview_image (Preview * p) { u_int psurface_type, psurface_unit; char filename[PATH_MAX]; int width, height; float psurface[4]; size_t nread; FILE *in; /* See whether there is a saved preview and load it if present: */ if (make_preview_image_path (p, sizeof (filename), filename) < 0) return; in = fopen (filename, "r"); if (!in) return; /* Be careful about consuming too many bytes after the final newline (e.g., consider an image whose first image byte is 13 (`\r'). */ if (fscanf (in, "P6\n# surface: %g %g %g %g %u %u\n%d %d\n255%*[\n]", psurface + 0, psurface + 1, psurface + 2, psurface + 3, &psurface_type, &psurface_unit, &width, &height) != 8) return; if (GROSSLY_DIFFERENT (psurface[0], p->surface[0]) || GROSSLY_DIFFERENT (psurface[1], p->surface[1]) || GROSSLY_DIFFERENT (psurface[2], p->surface[2]) || GROSSLY_DIFFERENT (psurface[3], p->surface[3]) || psurface_type != p->surface_type || psurface_unit != p->surface_unit) /* ignore preview image that was acquired for/with a different surface */ return; p->image_width = width; p->image_height = height; if ((width == 0) || (height == 0)) return; p->image_data = malloc (3 * width * height); if (!p->image_data) return; nread = fread (p->image_data, 3, width * height, in); p->image_y = nread / width; p->image_x = nread % width; } /* This is executed _after_ the gtkpreview's expose routine. */ static gint expose_handler (GtkWidget * window, GdkEvent * event, gpointer data) { Preview *p = data; p->selection.active = FALSE; update_selection (p); return FALSE; } static gint event_handler (GtkWidget * window, GdkEvent * event, gpointer data) { Preview *p = data; int i, tmp; if (event->type == GDK_EXPOSE) { if (!p->gc) { p->gc = gdk_gc_new (p->window->window); gdk_gc_set_function (p->gc, GDK_INVERT); gdk_gc_set_line_attributes (p->gc, 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER); paint_image (p); } else { p->selection.active = FALSE; draw_selection (p); } } else if (!p->scanning) switch (event->type) { case GDK_UNMAP: case GDK_MAP: break; case GDK_BUTTON_PRESS: p->selection.coord[0] = event->button.x; p->selection.coord[1] = event->button.y; p->selection_drag = TRUE; break; case GDK_BUTTON_RELEASE: if (!p->selection_drag) break; p->selection_drag = FALSE; p->selection.coord[2] = event->button.x; p->selection.coord[3] = event->button.y; p->selection.active = (p->selection.coord[0] != p->selection.coord[2] || p->selection.coord[1] != p->selection.coord[3]); if (p->selection.active) { for (i = 0; i < 2; i += 1) if (p->selection.coord[i] > p->selection.coord[i + 2]) { tmp = p->selection.coord[i]; p->selection.coord[i] = p->selection.coord[i + 2]; p->selection.coord[i + 2] = tmp; } if (p->selection.coord[0] < 0) p->selection.coord[0] = 0; if (p->selection.coord[1] < 0) p->selection.coord[1] = 0; if (p->selection.coord[2] >= p->preview_width) p->selection.coord[2] = p->preview_width - 1; if (p->selection.coord[3] >= p->preview_height) p->selection.coord[3] = p->preview_height - 1; } draw_selection (p); establish_selection (p); break; case GDK_MOTION_NOTIFY: if (p->selection_drag) { p->selection.active = TRUE; p->selection.coord[2] = event->motion.x; p->selection.coord[3] = event->motion.y; draw_selection (p); } break; default: #if 0 fprintf (stderr, "event_handler: unhandled event type %d\n", event->type); #endif break; } return FALSE; } static void start_button_clicked (GtkWidget * widget, gpointer data) { preview_scan (data); } static void cancel_button_clicked (GtkWidget * widget, gpointer data) { scan_done (data); } static void top_destroyed (GtkWidget * widget, gpointer call_data) { Preview *p = call_data; p->top = NULL; } Preview * preview_new (GSGDialog * dialog) { static int first_time = 1; GtkWidget *table, *frame; GtkSignalFunc signal_func; GtkWidgetClass *class; GtkBox *vbox, *hbox; Preview *p; p = malloc (sizeof (*p)); if (!p) return 0; memset (p, 0, sizeof (*p)); p->dialog = dialog; p->input_tag = -1; if (first_time) { first_time = 0; gtk_preview_set_gamma (preferences.preview_gamma); gtk_preview_set_install_cmap (preferences.preview_own_cmap); } #ifndef XSERVER_WITH_BUGGY_VISUALS gtk_widget_push_visual (gtk_preview_get_visual ()); #endif gtk_widget_push_colormap (gtk_preview_get_cmap ()); p->top = gtk_dialog_new (); gtk_signal_connect (GTK_OBJECT (p->top), "destroy", GTK_SIGNAL_FUNC (top_destroyed), p); gtk_window_set_title (GTK_WINDOW (p->top), "xscanimage preview"); vbox = GTK_BOX (GTK_DIALOG (p->top)->vbox); hbox = GTK_BOX (GTK_DIALOG (p->top)->action_area); /* construct the preview area (table with sliders & preview window) */ table = gtk_table_new (2, 2, /* homogeneous */ FALSE); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 1); gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1); gtk_container_border_width (GTK_CONTAINER (table), 2); gtk_box_pack_start (vbox, table, /* expand */ TRUE, /* fill */ TRUE, /* padding */ 0); /* the empty box in the top-left corner */ frame = gtk_frame_new ( /* label */ 0); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); /* the horizontal ruler */ p->hruler = gtk_hruler_new (); gtk_table_attach (GTK_TABLE (table), p->hruler, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); /* the vertical ruler */ p->vruler = gtk_vruler_new (); gtk_table_attach (GTK_TABLE (table), p->vruler, 0, 1, 1, 2, 0, GTK_FILL, 0, 0); /* the preview area */ p->window = gtk_preview_new (GTK_PREVIEW_COLOR); gtk_preview_set_expand (GTK_PREVIEW (p->window), TRUE); gtk_widget_set_events (p->window, GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); gtk_signal_connect (GTK_OBJECT (p->window), "event", (GtkSignalFunc) event_handler, p); gtk_signal_connect_after (GTK_OBJECT (p->window), "expose_event", (GtkSignalFunc) expose_handler, p); gtk_signal_connect_after (GTK_OBJECT (p->window), "size_allocate", (GtkSignalFunc) preview_area_resize, 0); gtk_object_set_data (GTK_OBJECT (p->window), "PreviewPointer", p); /* Connect the motion-notify events of the preview area with the rulers. Nifty stuff! */ #if GTK_MAJOR_VERSION == 2 class = GTK_WIDGET_CLASS (GTK_OBJECT_GET_CLASS (GTK_OBJECT (p->hruler))); #else class = GTK_WIDGET_CLASS (GTK_OBJECT (p->hruler)->klass); #endif /* GTK_MAJOR_VERSION == 2 */ signal_func = (GtkSignalFunc) class->motion_notify_event; gtk_signal_connect_object (GTK_OBJECT (p->window), "motion_notify_event", signal_func, GTK_OBJECT (p->hruler)); #if GTK_MAJOR_VERSION == 2 class = GTK_WIDGET_CLASS (GTK_OBJECT_GET_CLASS (GTK_OBJECT (p->vruler))); #else class = GTK_WIDGET_CLASS (GTK_OBJECT (p->vruler)->klass); #endif /* GTK_MAJOR_VERSION == 2 */ signal_func = (GtkSignalFunc) class->motion_notify_event; gtk_signal_connect_object (GTK_OBJECT (p->window), "motion_notify_event", signal_func, GTK_OBJECT (p->vruler)); p->viewport = gtk_frame_new ( /* label */ 0); gtk_frame_set_shadow_type (GTK_FRAME (p->viewport), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (p->viewport), p->window); gtk_table_attach (GTK_TABLE (table), p->viewport, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0); preview_update (p); /* fill in action area: */ /* Preview button */ p->preview = gtk_button_new_with_label ("Acquire Preview"); gtk_signal_connect (GTK_OBJECT (p->preview), "clicked", (GtkSignalFunc) start_button_clicked, p); gtk_box_pack_start (GTK_BOX (hbox), p->preview, TRUE, TRUE, 0); gtk_widget_show (p->preview); /* Cancel button */ p->cancel = gtk_button_new_with_label ("Cancel Preview"); gtk_signal_connect (GTK_OBJECT (p->cancel), "clicked", (GtkSignalFunc) cancel_button_clicked, p); gtk_box_pack_start (GTK_BOX (hbox), p->cancel, TRUE, TRUE, 0); gtk_widget_set_sensitive (p->cancel, FALSE); gtk_widget_show (p->cancel); gtk_widget_show (p->viewport); gtk_widget_show (p->window); gtk_widget_show (p->hruler); gtk_widget_show (p->vruler); gtk_widget_show (frame); gtk_widget_show (table); gtk_widget_show (p->top); gtk_widget_pop_colormap (); #ifndef XSERVER_WITH_BUGGY_VISUALS gtk_widget_pop_visual (); #endif return p; } void preview_update (Preview * p) { float val, width, height, max_width, max_height; const SANE_Option_Descriptor *opt; int i, surface_changed; SANE_Value_Type type; SANE_Unit unit; float min, max; surface_changed = 0; unit = SANE_UNIT_PIXEL; type = SANE_TYPE_INT; for (i = 0; i < 4; ++i) { val = (i & 2) ? INF : -INF; if (p->dialog->well_known.coord[i] > 0) { opt = sane_get_option_descriptor (p->dialog->dev, p->dialog->well_known.coord[i]); assert (opt->unit == SANE_UNIT_PIXEL || opt->unit == SANE_UNIT_MM); unit = opt->unit; type = opt->type; get_bounds (opt, &min, &max); if (i & 2) val = max; else val = min; } if (p->surface[i] != val) { surface_changed = 1; p->surface[i] = val; } } if (p->surface_unit != unit) { surface_changed = 1; p->surface_unit = unit; } if (p->surface_type != type) { surface_changed = 1; p->surface_type = type; } if (surface_changed && p->image_data) { free (p->image_data); p->image_data = 0; p->image_width = 0; p->image_height = 0; } /* guess the initial preview window size: */ width = p->surface[GSG_BR_X] - p->surface[GSG_TL_X]; height = p->surface[GSG_BR_Y] - p->surface[GSG_TL_Y]; if (p->surface_type == SANE_TYPE_INT) { width += 1.0; height += 1.0; } else { width += SANE_UNFIX (1.0); height += SANE_UNFIX (1.0); } assert (width > 0.0 && height > 0.0); if (width >= INF || height >= INF) p->aspect = 1.0; else p->aspect = width / height; if (surface_changed) { max_width = 0.5 * gdk_screen_width (); max_height = 0.5 * gdk_screen_height (); } else { max_width = p->window->allocation.width; max_height = p->window->allocation.height; } if (p->surface_unit != SANE_UNIT_PIXEL) { width = max_width; height = width / p->aspect; if (height > max_height) { height = max_height; width = height * p->aspect; } } else { if (width > max_width) width = max_width; if (height > max_height) height = max_height; } /* re-adjust so we maintain aspect without exceeding max size: */ if (width / height != p->aspect) { if (p->aspect > 1.0) height = width / p->aspect; else width = height * p->aspect; } p->preview_width = width + 0.5; p->preview_height = height + 0.5; if (surface_changed) { gtk_widget_set_usize (GTK_WIDGET (p->window), p->preview_width, p->preview_height); if (GTK_WIDGET_DRAWABLE (p->window)) preview_area_resize (p->window); if (preferences.preserve_preview) restore_preview_image (p); } update_selection (p); } void preview_scan (Preview * p) { float min, max, swidth, sheight, width, height, dpi = 0; const SANE_Option_Descriptor *opt; gint gwidth, gheight; int i; SANE_Status status; save_option (p, p->dialog->well_known.dpi, &p->saved_dpi, &p->saved_dpi_valid); for (i = 0; i < 4; ++i) save_option (p, p->dialog->well_known.coord[i], &p->saved_coord[i], p->saved_coord_valid + i); /* determine dpi, if necessary: */ if (p->dialog->well_known.dpi > 0) { opt = sane_get_option_descriptor (p->dialog->dev, p->dialog->well_known.dpi); gwidth = p->preview_width; gheight = p->preview_height; height = gheight; width = height * p->aspect; if (width > gwidth) { width = gwidth; height = width / p->aspect; } swidth = (p->surface[GSG_BR_X] - p->surface[GSG_TL_X]); if (swidth < INF) dpi = MM_PER_INCH * width / swidth; else { sheight = (p->surface[GSG_BR_Y] - p->surface[GSG_TL_Y]); if (sheight < INF) dpi = MM_PER_INCH * height / sheight; else dpi = 18.0; } get_bounds (opt, &min, &max); if (dpi < min) dpi = min; if (dpi > max) dpi = max; status = set_option_float (p, p->dialog->well_known.dpi, dpi); if (status != SANE_STATUS_GOOD) return; } /* set the scan window (necessary since backends may default to non-maximum size): */ for (i = 0; i < 4; ++i) set_option_float (p, p->dialog->well_known.coord[i], p->surface[i]); set_option_bool (p, p->dialog->well_known.preview, SANE_TRUE); /* OK, all set to go */ scan_start (p); } void preview_destroy (Preview * p) { char filename[PATH_MAX]; FILE *out; if (p->scanning) scan_done (p); /* don't save partial window */ else if (preferences.preserve_preview && p->image_data && make_preview_image_path (p, sizeof (filename), filename) >= 0) { /* save preview image */ out = fopen (filename, "w"); if (out) { /* always save it as a PPM image: */ fprintf (out, "P6\n# surface: %g %g %g %g %u %u\n%d %d\n255\n", p->surface[0], p->surface[1], p->surface[2], p->surface[3], p->surface_type, p->surface_unit, p->image_width, p->image_height); fwrite (p->image_data, 3, p->image_width * p->image_height, out); fclose (out); } } if (p->image_data) free (p->image_data); if (p->preview_row) free (p->preview_row); if (p->gc) gdk_gc_destroy (p->gc); if (p->top) gtk_widget_destroy (p->top); free (p); } ./sane-frontends-1.0.14/src/preview.h0000644000175000017500000000473007772616226015434 0ustar hmghmg/* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. SANE 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. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef preview_h #define preview_h #include #include "../include/sane/config.h" #include typedef struct { GSGDialog *dialog; /* the dialog for this preview */ SANE_Value_Type surface_type; SANE_Unit surface_unit; float surface[4]; /* the corners of the scan surface (device coords) */ float aspect; /* the aspect ratio of the scan surface */ int saved_dpi_valid; SANE_Word saved_dpi; int saved_coord_valid[4]; SANE_Word saved_coord[4]; /* desired/user-selected preview-window size: */ int preview_width; int preview_height; u_char *preview_row; int scanning; time_t image_last_time_updated; gint input_tag; SANE_Parameters params; int image_offset; int image_x; int image_y; int image_width; int image_height; u_char *image_data; /* 3 * image_width * image_height bytes */ GdkGC *gc; int selection_drag; struct { int active; int coord[4]; } selection, previous_selection; GtkWidget *top; /* top-level widget */ GtkWidget *hruler; GtkWidget *vruler; GtkWidget *viewport; GtkWidget *window; /* the preview window */ GtkWidget *cancel; /* the cancel button */ GtkWidget *preview; /* the preview button */ } Preview; /* Create a new preview based on the info in DIALOG. */ extern Preview *preview_new (GSGDialog *dialog); /* Some of the parameters may have changed---update the preview. */ extern void preview_update (Preview *p); /* Acquire a preview image and display it. */ extern void preview_scan (Preview *p); /* Destroy a preview. */ extern void preview_destroy (Preview *p); #endif /* preview_h */ ./sane-frontends-1.0.14/src/progress.c0000644000175000017500000000513107612347434015601 0ustar hmghmg/* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * Hacked (C) 1996 Tristan Tarrant * * 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. */ #include "../include/sane/config.h" #include #include #include #include "progress.h" static const int progress_x = 5; static const int progress_y = 5; void progress_cancel (GtkWidget * widget, gpointer data) { Progress_t *p = (Progress_t *) data; (*p->callback) (); } Progress_t * progress_new (char *title, char *text, GtkSignalFunc callback, gpointer callback_data) { GtkWidget *button, *label; GtkBox *vbox, *hbox; Progress_t *p; p = (Progress_t *) malloc (sizeof (Progress_t)); p->callback = callback; p->shell = gtk_dialog_new (); gtk_widget_set_uposition (p->shell, progress_x, progress_y); gtk_window_set_title (GTK_WINDOW (p->shell), title); vbox = GTK_BOX (GTK_DIALOG (p->shell)->vbox); hbox = GTK_BOX (GTK_DIALOG (p->shell)->action_area); gtk_container_border_width (GTK_CONTAINER (vbox), 7); label = gtk_label_new (text); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (vbox, label, FALSE, TRUE, 0); p->pbar = gtk_progress_bar_new (); gtk_widget_set_usize (p->pbar, 200, 20); gtk_box_pack_start (vbox, p->pbar, TRUE, TRUE, 0); button = gtk_toggle_button_new_with_label ("Cancel"); gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) progress_cancel, p); gtk_box_pack_start (hbox, button, TRUE, TRUE, 0); gtk_widget_show (label); gtk_widget_show (p->pbar); gtk_widget_show (button); gtk_widget_show (GTK_WIDGET (p->shell)); gtk_progress_bar_update (GTK_PROGRESS_BAR (p->pbar), 0); return p; } void progress_free (Progress_t * p) { if (p) { gtk_widget_destroy (p->shell); free (p); } } void progress_update (Progress_t * p, gfloat newval) { if (p) gtk_progress_bar_update (GTK_PROGRESS_BAR (p->pbar), newval); } ./sane-frontends-1.0.14/src/progress.h0000644000175000017500000000223507202713265015602 0ustar hmghmg/* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * * 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. */ #ifndef progress_h #define progress_h typedef struct Progress_t { GtkSignalFunc callback; gpointer callback_data; GtkWidget *shell; GtkWidget *pbar; } Progress_t; extern Progress_t *progress_new (char *, char *, GtkSignalFunc, void *); extern void progress_free (Progress_t *); extern void progress_update (Progress_t *, gfloat); #endif /* progress_h */ ./sane-frontends-1.0.14/src/sane-style.rc0000644000175000017500000000061407202713266016177 0ustar hmghmg# style [= ] # { #