kdc2tiff-0.35/0042755000175000017500000000000007775115571011332 5ustar cvscvskdc2tiff-0.35/ChangeLog0100644000175000017500000001246707775114607013110 0ustar cvscvs2004-01-01 22:03:04 cvs * updated version M NEWS +3 -0 M README +1 -1 2004-01-01 22:00:13 cvs * updated log to new version produced from cvs log M ChangeLog +114 -85 2003-12-06 23:08:27 cvs * prevent unintentional overwriting of output files M OutputOptions.cpp +12 -1 M OutputOptions.h +5 -1 M kdc2tiff.cpp +26 -3 2003-12-06 20:54:04 cvs * changes to autoconf M config.h.in +28 -13 M configure +3947 -1252 2003-05-28 02:30:17 cvs * updated version and email address M AUTHORS +1 -1 M Makefile.in +3 -3 M README +3 -3 M aclocal.m4 +1 -1 M config.h.in +1 -3 M configure +2 -2 M configure.in +1 -1 2003-05-28 02:30:01 cvs * allocate large arrays on heap instead of stack to prevent seg faults M ChangeLog +27 -23 M GICBayer.cpp +12 -6 M GImageComponent.cpp +6 -4 M NEWS +3 -0 2002-11-20 20:22:36 cvs * corrected dates M ChangeLog +1 -1 M README +1 -1 2002-11-20 20:20:54 cvs * updated documentation for new release (v0.33) M ChangeLog +5 -0 M NEWS +3 -0 M README +1 -1 M TODO +7 -6 2002-10-31 23:03:13 cvs * another default argument value to remove M GFilter.cpp +1 -1 2002-10-30 02:27:33 cvs * removed =0 from argument list in class method implementations to satisfy * new compilers M GICBayer.cpp +3 -3 M GImageComponent.cpp +1 -1 2001-07-05 18:27:23 cvs * forgot to run autoconf/automake M Makefile.in +4 -3 M configure +66 -76 2001-07-05 18:26:43 cvs * removed references to DECODE_KDCTAG from configure.in and Makefile.am to * fix common build problems M ChangeLog +4 -0 M Makefile.am +2 -2 M NEWS +1 -0 M README +2 -2 M configure.in +6 -6 2000-05-29 Chris Studholme * more work on improving cache usage in GICBayer_* 2000-05-28 Chris Studholme * rewrote GImageComponent0 to make better use of cache * did similar rewrite of GICBayer_Green (for better cache use) * no longer display "Total Error" when using fast mode 2000-05-25 Chris Studholme * changed gamma correction to use a table 2000-05-08 Chris Studholme * added +g option for relative gamma correction 2000-03-11 Chris Studholme * added error messages for fseek() and fread() in GFile_JPEG::supportsFile and GFile_TIFF::supportsFile 2000-03-08 Chris Studholme * released version 0.31 2000-03-07 Chris Studholme * changed autoconf/automake setup to use config.h file * added configure option to decode KDC specific tags (default is off due to possible problem with Debian machines) 2000-01-17 Chris Studholme * project home page moved to sourceforge.net * released version 0.30 2000-01-10 Chris Studholme * fixed overflow bug in GFilter_GammaCorrection and GFilter_ContrastAdjust * started working on integer pixel calculations 2000-01-08 Chris Studholme * verified that compressed KDC files are handled accurately * added -f and +f options for fast processing * displays type of file being read * changed default output size for KDC files to 1200x900 2000-01-07 Chris Studholme * moved all de-bayerize stuff to GICBayer.cpp and GICBayer.h * finished improved de-bayer algorithm * converted GImageComponent pixel format to short 1999-12-23 Chris Studholme * created GImageComponent3 as an attempt to de-bayerize with better resolution 1999-12-20 Chris Studholme * make white balance less aggressive 1999-12-19 Chris Studholme * reduced stack usage of GImageComponent0 * made white balance work with all image types 1999-12-16 Chris Studholme * moved file type detection to GFile decendants and improved KDC detection * changed KDCImage to GFile_DC120 1999-12-15 Chris Studholme * fix fatal bug in white balance and improved algorithm * added checks to GFile_TIFF to verify the GImageComponent0 is working * improved JPEG/TIFF/KDC file detection algorithm in kdc2tiff.cpp 1999-12-14 Chris Studholme * changed OutputOptions to support "auto" and "none" with -W switch * implemented GFile_JPEG 1999-12-13 Chris Studholme * created GFilter_WhiteBalance and implemented it * changed GFile and KDCImage to calculate TTL white balance coefficients * changed OutputOptions to include lightwhite and outputwhite temperature values and to use GFilter_WhiteBalance (switch is -W) 1999-12-11 Chris Studholme * fixed outputname to remote leading / in kdc2tiff.cpp 1999-12-06 Chris Studholme * created classes GFile, GFile_TIFF, and GFile_JPEG * KDCImage is now decendent of GFile * GFile_TIFF has been implemented * kdc2tiff.cpp modified to make use of GFile_TIFF and GFile_JPEG * TIFF support based on input file extension tested and seems to work * JPEG files (detected by extension) cause 'not implemented' error 1999-12-02 Chris Studholme * ChangeLog file started * first use of autoconf/automake kdc2tiff-0.35/AUTHORS0100644000175000017500000000025007665017470012367 0ustar cvscvsAuthors of kdc2tiff: Initial and primary author is: Chris Studholme Some files copied from libtiff package, see: include/tif* xtif* kdc2tiff-0.35/COPYING0100644000175000017500000003547507254243227012366 0ustar cvscvs 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 kdc2tiff-0.35/include/0040755000175000017500000000000007775116072012750 5ustar cvscvskdc2tiff-0.35/include/tif_dir.h0100644000175000017500000001707507254243762014547 0ustar cvscvs/* $Header: /src/CVS/kdc2tiff/include/tif_dir.h,v 1.2 2001/03/15 22:53:38 cvs Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef _TIFFDIR_ #define _TIFFDIR_ /* * ``Library-private'' Directory-related Definitions. */ /* * Internal format of a TIFF directory entry. */ typedef struct { #define FIELD_SETLONGS 3 /* bit vector of fields that are set */ u_long td_fieldsset[FIELD_SETLONGS]; uint32 td_imagewidth, td_imagelength, td_imagedepth; uint32 td_tilewidth, td_tilelength, td_tiledepth; uint32 td_subfiletype; uint16 td_bitspersample; uint16 td_sampleformat; uint16 td_compression; uint16 td_photometric; uint16 td_threshholding; uint16 td_fillorder; uint16 td_orientation; uint16 td_samplesperpixel; uint32 td_rowsperstrip; uint16 td_minsamplevalue, td_maxsamplevalue; double td_sminsamplevalue, td_smaxsamplevalue; float td_xresolution, td_yresolution; uint16 td_resolutionunit; uint16 td_planarconfig; float td_xposition, td_yposition; uint16 td_pagenumber[2]; uint16* td_colormap[3]; uint16 td_halftonehints[2]; uint16 td_extrasamples; uint16* td_sampleinfo; char* td_documentname; char* td_artist; char* td_datetime; char* td_hostcomputer; char* td_imagedescription; char* td_make; char* td_model; char* td_software; char* td_pagename; tstrip_t td_stripsperimage; tstrip_t td_nstrips; /* size of offset & bytecount arrays */ uint32* td_stripoffset; uint32* td_stripbytecount; #if SUBIFD_SUPPORT uint16 td_nsubifd; uint32* td_subifd; #endif #ifdef YCBCR_SUPPORT float* td_ycbcrcoeffs; uint16 td_ycbcrsubsampling[2]; uint16 td_ycbcrpositioning; #endif #ifdef COLORIMETRY_SUPPORT float* td_whitepoint; float* td_primarychromas; float* td_refblackwhite; uint16* td_transferfunction[3]; #endif #ifdef CMYK_SUPPORT uint16 td_inkset; uint16 td_dotrange[2]; char* td_inknames; char* td_targetprinter; #endif } TIFFDirectory; /* * Field flags used to indicate fields that have * been set in a directory, and to reference fields * when manipulating a directory. */ /* * FIELD_IGNORE is used to signify tags that are to * be processed but otherwise ignored. This permits * antiquated tags to be quietly read and discarded. * Note that a bit *is* allocated for ignored tags; * this is understood by the directory reading logic * which uses this fact to avoid special-case handling */ #define FIELD_IGNORE 0 /* multi-item fields */ #define FIELD_IMAGEDIMENSIONS 1 #define FIELD_TILEDIMENSIONS 2 #define FIELD_RESOLUTION 3 #define FIELD_POSITION 4 /* single-item fields */ #define FIELD_SUBFILETYPE 5 #define FIELD_BITSPERSAMPLE 6 #define FIELD_COMPRESSION 7 #define FIELD_PHOTOMETRIC 8 #define FIELD_THRESHHOLDING 9 #define FIELD_FILLORDER 10 #define FIELD_DOCUMENTNAME 11 #define FIELD_IMAGEDESCRIPTION 12 #define FIELD_MAKE 13 #define FIELD_MODEL 14 #define FIELD_ORIENTATION 15 #define FIELD_SAMPLESPERPIXEL 16 #define FIELD_ROWSPERSTRIP 17 #define FIELD_MINSAMPLEVALUE 18 #define FIELD_MAXSAMPLEVALUE 19 #define FIELD_PLANARCONFIG 20 #define FIELD_PAGENAME 21 #define FIELD_RESOLUTIONUNIT 22 #define FIELD_PAGENUMBER 23 #define FIELD_STRIPBYTECOUNTS 24 #define FIELD_STRIPOFFSETS 25 #define FIELD_COLORMAP 26 #define FIELD_ARTIST 27 #define FIELD_DATETIME 28 #define FIELD_HOSTCOMPUTER 29 #define FIELD_SOFTWARE 30 #define FIELD_EXTRASAMPLES 31 #define FIELD_SAMPLEFORMAT 32 #define FIELD_SMINSAMPLEVALUE 33 #define FIELD_SMAXSAMPLEVALUE 34 #define FIELD_IMAGEDEPTH 35 #define FIELD_TILEDEPTH 36 #define FIELD_HALFTONEHINTS 37 #define FIELD_YCBCRCOEFFICIENTS 38 #define FIELD_YCBCRSUBSAMPLING 39 #define FIELD_YCBCRPOSITIONING 40 #define FIELD_REFBLACKWHITE 41 #define FIELD_WHITEPOINT 42 #define FIELD_PRIMARYCHROMAS 43 #define FIELD_TRANSFERFUNCTION 44 #define FIELD_INKSET 45 #define FIELD_INKNAMES 46 #define FIELD_DOTRANGE 47 #define FIELD_TARGETPRINTER 48 #define FIELD_SUBIFD 49 #define FIELD_CODEC 50 /* base of codec-private tags */ /* * Pseudo-tags don't normally need field bits since they * are not written to an output file (by definition). * The library also has express logic to always query a * codec for a pseudo-tag so allocating a field bit for * one is a waste. If codec wants to promote the notion * of a pseudo-tag being ``set'' or ``unset'' then it can * do using internal state flags without polluting the * field bit space defined for real tags. */ #define FIELD_PSEUDO 0 #define FIELD_LAST (32*FIELD_SETLONGS-1) #define TIFFExtractData(tif, type, v) \ ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \ ((v) >> (tif)->tif_typeshift[type]) & (tif)->tif_typemask[type] : \ (v) & (tif)->tif_typemask[type])) #define TIFFInsertData(tif, type, v) \ ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \ ((v) & (tif)->tif_typemask[type]) << (tif)->tif_typeshift[type] : \ (v) & (tif)->tif_typemask[type])) typedef struct { ttag_t field_tag; /* field's tag */ short field_readcount; /* read count (-1 for unknown) */ short field_writecount; /* write count (-1 for unknown) */ TIFFDataType field_type; /* type of associated data */ u_short field_bit; /* bit in fieldsset bit vector */ u_char field_oktochange; /* if true, can change while writing */ u_char field_passcount; /* if true, pass dir count on set */ char *field_name; /* ASCII name */ } TIFFFieldInfo; #define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ #define TIFF_VARIABLE -1 /* marker for variable length tags */ #define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ extern const int tiffDataWidth[]; /* table of tag datatype widths */ #define BITn(n) (((u_long)1L)<<((n)&0x1f)) #define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n)/32]) #define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field)) #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field)) #define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field)) #define FieldSet(fields, f) (fields[(f)/32] & BITn(f)) #define ResetFieldBit(fields, f) (fields[(f)/32] &= ~BITn(f)) #if defined(__cplusplus) extern "C" { #endif extern void _TIFFSetupFieldInfo(TIFF*); extern void _TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int); extern void _TIFFPrintFieldInfo(TIFF*, FILE*); extern const TIFFFieldInfo* _TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType); extern const TIFFFieldInfo* _TIFFFieldWithTag(TIFF*, ttag_t); extern TIFFDataType _TIFFSampleToTagType(TIFF*); #if defined(__cplusplus) } #endif #endif /* _TIFFDIR_ */ kdc2tiff-0.35/include/port.h0100644000175000017500000000114407254243227014075 0ustar cvscvs#ifndef _PORT_ #define _PORT_ 1 #ifdef __cplusplus extern "C" { #endif #include /* There are defined in sys/types.h typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; */ #define HOST_FILLORDER FILLORDER_LSB2MSB #define HOST_BIGENDIAN 0 #include #include #include #include #include typedef double dblparam_t; #ifdef __STRICT_ANSI__ #define INLINE __inline__ #else #define INLINE inline #endif #define GLOBALDATA(TYPE,NAME) extern TYPE NAME #ifdef __cplusplus } #endif #endif kdc2tiff-0.35/include/tiffconf.h0100644000175000017500000001110107254243762014705 0ustar cvscvs/* $Header: /src/CVS/kdc2tiff/include/tiffconf.h,v 1.2 2001/03/15 22:53:38 cvs Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef _TIFFCONF_ #define _TIFFCONF_ /* * Library Configuration Definitions. * * This file defines the default configuration for the library. * If the target system does not have make or a way to specify * #defines on the command line, this file can be edited to * configure the library. Otherwise, one can override portability * and configuration-related definitions from a Makefile or command * line by defining FEATURE_SUPPORT and COMPRESSION_SUPPORT (see below). */ /* * General portability-related defines: * * HAVE_IEEEFP define as 0 or 1 according to the floating point * format suported by the machine * BSDTYPES define this if your system does NOT define the * usual 4BSD typedefs u_int et. al. * HAVE_MMAP enable support for memory mapping read-only files; * this is typically deduced by the configure script * HOST_FILLORDER native cpu bit order: one of FILLORDER_MSB2LSB * or FILLODER_LSB2MSB; this is typically set by the * configure script * HOST_BIGENDIAN native cpu byte order: 1 if big-endian (Motorola) * or 0 if little-endian (Intel); this may be used * in codecs to optimize code */ #ifndef HAVE_IEEEFP #define HAVE_IEEEFP 1 #endif #ifndef HOST_FILLORDER #define HOST_FILLORDER FILLORDER_MSB2LSB #endif #ifndef HOST_BIGENDIAN #define HOST_BIGENDIAN 1 #endif #ifndef FEATURE_SUPPORT /* * Feature support definitions: * * COLORIMETRY_SUPPORT enable support for 6.0 colorimetry tags * YCBCR_SUPPORT enable support for 6.0 YCbCr tags * CMYK_SUPPORT enable support for 6.0 CMYK tags */ #define COLORIMETRY_SUPPORT #define YCBCR_SUPPORT #define CMYK_SUPPORT #endif /* FEATURE_SUPPORT */ #ifndef COMPRESSION_SUPPORT /* * Compression support defines: * * CCITT_SUPPORT enable support for CCITT Group 3 & 4 algorithms * PACKBITS_SUPPORT enable support for Macintosh PackBits algorithm * LZW_SUPPORT enable support for LZW algorithm * THUNDER_SUPPORT enable support for ThunderScan 4-bit RLE algorithm * NEXT_SUPPORT enable support for NeXT 2-bit RLE algorithm * OJPEG_SUPPORT enable support for 6.0-style JPEG DCT algorithms * (no builtin support, only a codec hook) * JPEG_SUPPORT enable support for post-6.0-style JPEG DCT algorithms * (requires freely available IJG software, see tif_jpeg.c) * ZIP_SUPPORT enable support for Deflate algorithm * (requires freely available zlib software, see tif_zip.c) * PIXARLOG_SUPPORT enable support for Pixar log-format algorithm */ #define CCITT_SUPPORT #define PACKBITS_SUPPORT #define LZW_SUPPORT #define THUNDER_SUPPORT #define NEXT_SUPPORT #endif /* COMPRESSION_SUPPORT */ /* * If JPEG compression is enabled then we must also include * support for the colorimetry and YCbCr-related tags. */ #ifdef JPEG_SUPPORT #ifndef YCBCR_SUPPORT #define YCBCR_SUPPORT #endif #ifndef COLORIMETRY_SUPPORT #define COLORIMETRY_SUPPORT #endif #endif /* JPEG_SUPPORT */ /* * ``Orthogonal Features'' * * STRIPCHOP_SUPPORT automatically convert single-strip uncompressed images * to mutiple strips of ~8Kb (for reducing memory use) * SUBIFD_SUPPORT enable support for SubIFD tag (thumbnails and such) */ #ifndef STRIPCHOP_SUPPORT #define STRIPCHOP_SUPPORT 1 /* enable strip chopping */ #endif #ifndef SUBIFD_SUPPORT #define SUBIFD_SUPPORT 1 /* enable SubIFD tag (330) support */ #endif #endif /* _TIFFCONF_ */ kdc2tiff-0.35/include/tiffiop.h0100644000175000017500000002677307254243762014574 0ustar cvscvs/* $Header: /src/CVS/kdc2tiff/include/tiffiop.h,v 1.2 2001/03/15 22:53:38 cvs Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef _TIFFIOP_ #define _TIFFIOP_ /* * ``Library-private'' definitions. */ /* * UNIX systems should run the configure script to generate * a port.h file that reflects the system capabilities. * Doing this obviates all the dreck done in tiffcomp.h. */ #if defined(unix) || defined(__unix) #include "port.h" #include "tiffconf.h" #else #include "tiffconf.h" #include "tiffcomp.h" #endif #include "tiffio.h" #include "tif_dir.h" #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif /* * Typedefs for ``method pointers'' used internally. */ typedef unsigned char tidataval_t; /* internal image data value type */ typedef tidataval_t* tidata_t; /* reference to internal image data */ typedef void (*TIFFVoidMethod)(TIFF*); typedef int (*TIFFBoolMethod)(TIFF*); typedef int (*TIFFPreMethod)(TIFF*, tsample_t); typedef int (*TIFFCodeMethod)(TIFF*, tidata_t, tsize_t, tsample_t); typedef int (*TIFFSeekMethod)(TIFF*, uint32); typedef void (*TIFFPostMethod)(TIFF*, tidata_t, tsize_t); typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list); typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list); typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); typedef uint32 (*TIFFStripMethod)(TIFF*, uint32); typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*); struct tiff { char* tif_name; /* name of open file */ int tif_fd; /* open file descriptor */ int tif_mode; /* open mode (O_*) */ uint32 tif_flags; #define TIFF_FILLORDER 0x0003 /* natural bit fill order for machine */ #define TIFF_DIRTYHEADER 0x0004 /* header must be written on close */ #define TIFF_DIRTYDIRECT 0x0008 /* current directory must be written */ #define TIFF_BUFFERSETUP 0x0010 /* data buffers setup */ #define TIFF_CODERSETUP 0x0020 /* encoder/decoder setup done */ #define TIFF_BEENWRITING 0x0040 /* written 1+ scanlines to file */ #define TIFF_SWAB 0x0080 /* byte swap file information */ #define TIFF_NOBITREV 0x0100 /* inhibit bit reversal logic */ #define TIFF_MYBUFFER 0x0200 /* my raw data buffer; free on close */ #define TIFF_ISTILED 0x0400 /* file is tile, not strip- based */ #define TIFF_MAPPED 0x0800 /* file is mapped into memory */ #define TIFF_POSTENCODE 0x1000 /* need call to postencode routine */ #define TIFF_INSUBIFD 0x2000 /* currently writing a subifd */ #define TIFF_UPSAMPLED 0x4000 /* library is doing data up-sampling */ #define TIFF_STRIPCHOP 0x8000 /* enable strip chopping support */ toff_t tif_diroff; /* file offset of current directory */ toff_t tif_nextdiroff; /* file offset of following directory */ TIFFDirectory tif_dir; /* internal rep of current directory */ TIFFHeader tif_header; /* file's header block */ tidata_t tif_clientdir; /* client TIFF directory */ const int* tif_typeshift; /* data type shift counts */ const long* tif_typemask; /* data type masks */ uint32 tif_row; /* current scanline */ tdir_t tif_curdir; /* current directory (index) */ tstrip_t tif_curstrip; /* current strip for read/write */ toff_t tif_curoff; /* current offset for read/write */ toff_t tif_dataoff; /* current offset for writing dir */ #if SUBIFD_SUPPORT uint16 tif_nsubifd; /* remaining subifds to write */ toff_t tif_subifdoff; /* offset for patching SubIFD link */ #endif /* tiling support */ uint32 tif_col; /* current column (offset by row too) */ ttile_t tif_curtile; /* current tile for read/write */ tsize_t tif_tilesize; /* # of bytes in a tile */ /* compression scheme hooks */ TIFFBoolMethod tif_setupdecode;/* called once before predecode */ TIFFPreMethod tif_predecode; /* pre- row/strip/tile decoding */ TIFFBoolMethod tif_setupencode;/* called once before preencode */ TIFFPreMethod tif_preencode; /* pre- row/strip/tile encoding */ TIFFBoolMethod tif_postencode; /* post- row/strip/tile encoding */ TIFFCodeMethod tif_decoderow; /* scanline decoding routine */ TIFFCodeMethod tif_encoderow; /* scanline encoding routine */ TIFFCodeMethod tif_decodestrip;/* strip decoding routine */ TIFFCodeMethod tif_encodestrip;/* strip encoding routine */ TIFFCodeMethod tif_decodetile; /* tile decoding routine */ TIFFCodeMethod tif_encodetile; /* tile encoding routine */ TIFFVoidMethod tif_close; /* cleanup-on-close routine */ TIFFSeekMethod tif_seek; /* position within a strip routine */ TIFFVoidMethod tif_cleanup; /* cleanup state routine */ TIFFStripMethod tif_defstripsize;/* calculate/constrain strip size */ TIFFTileMethod tif_deftilesize;/* calculate/constrain tile size */ tidata_t tif_data; /* compression scheme private data */ /* input/output buffering */ tsize_t tif_scanlinesize;/* # of bytes in a scanline */ tsize_t tif_scanlineskew;/* scanline skew for reading strips */ tidata_t tif_rawdata; /* raw data buffer */ tsize_t tif_rawdatasize;/* # of bytes in raw data buffer */ tidata_t tif_rawcp; /* current spot in raw buffer */ tsize_t tif_rawcc; /* bytes unread from raw buffer */ /* memory-mapped file support */ tidata_t tif_base; /* base of mapped file */ #ifdef __WIN32__ void* pv_map_handle; /* WIN32 file mapping handle; * must be contiguous with tif_base * since map & unmap only get tif_base * and assume 4 byte offset to * pv_map_handle. */ #endif toff_t tif_size; /* size of mapped file region (bytes) */ TIFFMapFileProc tif_mapproc; /* map file method */ TIFFUnmapFileProc tif_unmapproc;/* unmap file method */ /* input/output callback methods */ thandle_t tif_clientdata; /* callback parameter */ TIFFReadWriteProc tif_readproc; /* read method */ TIFFReadWriteProc tif_writeproc;/* write method */ TIFFSeekProc tif_seekproc; /* lseek method */ TIFFCloseProc tif_closeproc; /* close method */ TIFFSizeProc tif_sizeproc; /* filesize method */ /* post-decoding support */ TIFFPostMethod tif_postdecode; /* post decoding routine */ /* tag support */ TIFFFieldInfo** tif_fieldinfo; /* sorted table of registered tags */ int tif_nfields; /* # entries in registered tag table */ TIFFVSetMethod tif_vsetfield; /* tag set routine */ TIFFVGetMethod tif_vgetfield; /* tag get routine */ TIFFPrintMethod tif_printdir; /* directory print routine */ }; #define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */ #define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0) #define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0) #define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0) #define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0) #define TIFFReadFile(tif, buf, size) \ ((*(tif)->tif_readproc)((tif)->tif_clientdata,buf,size)) #define TIFFWriteFile(tif, buf, size) \ ((*(tif)->tif_writeproc)((tif)->tif_clientdata,buf,size)) #define TIFFSeekFile(tif, off, whence) \ ((*(tif)->tif_seekproc)((tif)->tif_clientdata,(toff_t)(off),whence)) #define TIFFCloseFile(tif) \ ((*(tif)->tif_closeproc)((tif)->tif_clientdata)) #define TIFFGetFileSize(tif) \ ((*(tif)->tif_sizeproc)((tif)->tif_clientdata)) #define TIFFMapFileContents(tif, paddr, psize) \ ((*(tif)->tif_mapproc)((tif)->tif_clientdata,paddr,psize)) #ifdef __WIN32__ #define TIFFUnmapFileContents(tif, addr, dummy) \ ((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,\ (toff_t)(tif)->pv_map_handle)) #else #define TIFFUnmapFileContents(tif, addr, size) \ ((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,size)) #endif /* * Default Read/Seek/Write definitions. */ #ifndef ReadOK #define ReadOK(tif, buf, size) \ (TIFFReadFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size) #endif #ifndef SeekOK #define SeekOK(tif, off) \ (TIFFSeekFile(tif, (toff_t) off, SEEK_SET) == (toff_t) off) #endif #ifndef WriteOK #define WriteOK(tif, buf, size) \ (TIFFWriteFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size) #endif /* NB: the uint32 casts are to silence certain ANSI-C compilers */ #define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) #define TIFFroundup(x, y) (TIFFhowmany(x,y)*((uint32)(y))) #if defined(__cplusplus) extern "C" { #endif extern int _TIFFgetMode(const char*, const char*); extern int _TIFFNoRowEncode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoStripEncode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoTileEncode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoRowDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t); extern int _TIFFNoSeek(TIFF*, uint32); extern void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t); extern void _TIFFSwab32BitData(TIFF*, tidata_t, tsize_t); extern void _TIFFSwab64BitData(TIFF*, tidata_t, tsize_t); extern int TIFFFlushData1(TIFF*); extern void TIFFFreeDirectory(TIFF*); extern int TIFFDefaultDirectory(TIFF*); extern int TIFFSetCompressionScheme(TIFF*, int); extern uint32 _TIFFDefaultStripSize(TIFF*, uint32); extern void _TIFFDefaultTileSize(TIFF*, uint32*, uint32*); extern void _TIFFsetByteArray(void**, void*, long); extern void _TIFFsetString(char**, char*); extern void _TIFFsetShortArray(uint16**, uint16*, long); extern void _TIFFsetLongArray(uint32**, uint32*, long); extern void _TIFFsetFloatArray(float**, float*, long); extern void _TIFFsetDoubleArray(double**, double*, long); extern void _TIFFprintAscii(FILE*, const char*); extern void _TIFFprintAsciiTag(FILE*, const char*, const char*); GLOBALDATA(TIFFErrorHandler,_TIFFwarningHandler); GLOBALDATA(TIFFErrorHandler,_TIFFerrorHandler); extern int TIFFInitDumpMode(TIFF*, int); #ifdef PACKBITS_SUPPORT extern int TIFFInitPackBits(TIFF*, int); #endif #ifdef CCITT_SUPPORT extern int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int); extern int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int); #endif #ifdef THUNDER_SUPPORT extern int TIFFInitThunderScan(TIFF*, int); #endif #ifdef NEXT_SUPPORT extern int TIFFInitNeXT(TIFF*, int); #endif #ifdef LZW_SUPPORT extern int TIFFInitLZW(TIFF*, int); #endif #ifdef OJPEG_SUPPORT extern int TIFFInitOJPEG(TIFF*, int); #endif #ifdef JPEG_SUPPORT extern int TIFFInitJPEG(TIFF*, int); #endif #ifdef JBIG_SUPPORT extern int TIFFInitJBIG(TIFF*, int); #endif #ifdef ZIP_SUPPORT extern int TIFFInitZIP(TIFF*, int); #endif #ifdef PIXARLOG_SUPPORT extern int TIFFInitPixarLog(TIFF*, int); #endif #ifdef VMS extern const TIFFCodec _TIFFBuiltinCODECS[]; #else extern TIFFCodec _TIFFBuiltinCODECS[]; #endif #if defined(__cplusplus) } #endif #endif /* _TIFFIOP_ */ kdc2tiff-0.35/GFile.cpp0100644000175000017500000000324307254247643013017 0ustar cvscvs#include #include #include #include "GFile.h" /* GFile is an abstract decendant of GImage. Derivatives of this class * represent various image file formats. This class currently does not * add any new functionality. It is reserved for future use. Known * examples are: * * GFile_TIFF * GFile_JPEG * GFile_KDC * * Written by: Chris Studholme * Last Update: 6-December-1999 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ /* ================ GFile methods ================ */ void GFile::calculateBestMinMax(int& min, int& max, unsigned int* histogram) { /* fprintf(stderr,"\nIndex: "); for (int i=0; i<256; ++i) fprintf(stderr," %5d",i); fprintf(stderr,"\n"); fprintf(stderr,"Histogram:"); for (int i=0; i<256; ++i) fprintf(stderr," %5d",histogram[i]); fprintf(stderr,"\n"); */ min=0; max=255; unsigned int lcount = histogram[min]; unsigned int hcount = histogram[max]; unsigned int threshold=100; do { // adjust min if ((lcount+histogram[min+1])=threshold)&&(min>0)) lcount -= histogram[min--]; // adjust max else if ((hcount+histogram[max-1])=threshold)&&(max<255)) hcount -= histogram[max++]; else break; } while (true); // fprintf(stderr,"Stats: %d %d %d\n",lcount,threshold,hcount); } void GFile::addToHistogram(unsigned int* histogram, unsigned char* array, int narray) { while (narray>0) { ++histogram[*array]; ++array; --narray; } } kdc2tiff-0.35/GFile.h0100644000175000017500000000253507254247222012460 0ustar cvscvs#ifndef _GFile_H #define _GFile_H #include "GImage.h" #include "GImageComponent.h" /* GFile is an abstract decendant of GImage. Derivatives of this class * represent various image file formats. Known examples are: * * GFile_TIFF * GFile_JPEG * GFile_KDC * * Written by: Chris Studholme * Last Update: 8-January-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ class GFile : public GImage { protected: GImageComponent* red; GImageComponent* green; GImageComponent* blue; public: virtual bool isOK()=0; int getPreferredWidth() { return getWidth(); } int getPreferredHeight() { return getHeight(); } static void calculateBestMinMax(int& min, int& max, unsigned int* histogram); static void addToHistogram(unsigned int* histogram, unsigned char* array, int narray); virtual void FindBestMinMax(int& min, int& max) { min=0; max=255; } virtual void FindWhiteBalance(float& r, float& b, int min=0) { float meanred = red->getMeanValue(); float meangreen = green->getMeanValue(); float meanblue = blue->getMeanValue(); r=(meanred-min)/(meangreen-min); b=(meanblue-min)/(meangreen-min); } int ReduceGrain(bool extra=false) { return red->ReduceGrain(extra) + green->ReduceGrain(extra) + blue->ReduceGrain(extra); } }; #endif kdc2tiff-0.35/GFile_DC120.cpp0100644000175000017500000000672607254250670013613 0ustar cvscvs#include #include #include #include "GFile_DC120.h" #include "GICBayer.h" /* Class used to handle processing of .kdc file from KDCFile. * * Written by: Chris Studholme * Last Update: 28-May-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ //#define _CHECKS // 848x976 (or is it 850x984) // GRGRGR (R is red, G is green, B is blue) // BGBGBG // GRGRGR // BGBGBG #ifdef _CHECKS #include #define KDCW 848 #define KDCH 976 double VerifyRedImage(GImageComponent* image, const unsigned char* imagedata) { double error=0; for (int y=0; ygetPixel(x,y,x+1,y+1); error += residule*residule; } return sqrt(error*4/KDCH/KDCW)/128; } double VerifyBlueImage(GImageComponent* image, const unsigned char* imagedata) { double error=0; for (int y=1; ygetPixel(x,y,x+1,y+1); error += residule*residule; } return sqrt(error*4/KDCH/KDCW)/128; } double VerifyGreenImage(GImageComponent* image, const unsigned char* imagedata) { double error=0; for (int y=0; ygetPixel(x,y,x+1,y+1); error += residule*residule; } return sqrt(error*2/KDCH/KDCW)/128; } #endif /* ================ GFile_DC120 methods ================ */ GFile_DC120::GFile_DC120(KDCFile& file, bool fast) { red=blue=green=0; w = file.getWidth(); h = file.getHeight(); aspect = file.getPixelAspect(); unsigned char* data = new unsigned char[w*h]; memset(data,0,sizeof(data)); if (!file.ReadKDCFile(data)) { fprintf(stderr,"GFile_DC120::GFile_DC120() ERROR READING FILE\n"); delete[] data; return; } fprintf(stderr,"De-bayerizing image: "); fprintf(stderr,"green... "); green = new GICBayer_Green(data,w,h,fast?-1:0); #ifdef _CHECKS fprintf(stderr,"\nGreen Error(l1): %g\n",green->getTotalError()); fprintf(stderr,"Green Error(l2): %g\n",VerifyGreenImage(green,data)); #endif fprintf(stderr,"red... "); red = new GICBayer_Red(data,w,h,*green,fast?-1:0); #ifdef _CHECKS fprintf(stderr,"\nRed Error(l1): %g\n",red->getTotalError()); fprintf(stderr,"Red Error(l2): %g\n",VerifyRedImage(red,data)); #endif fprintf(stderr,"blue... "); blue = new GICBayer_Blue(data,w,h,*green,fast?-1:0); #ifdef _CHECKS fprintf(stderr,"\nBlue Error(l1): %g\n",blue->getTotalError()); fprintf(stderr,"Blue Error(l2): %g\n",VerifyBlueImage(blue,data)); #endif fprintf(stderr,"done.\n"); if (!fast) fprintf(stderr,"Mean error is %g\n",(red->getTotalError() +green->getTotalError()+blue->getTotalError())/3); memset(histogram,0,sizeof(histogram)); addToHistogram(histogram,data,w*h); delete[] data; } GFile_DC120::~GFile_DC120() { delete red; delete green; delete blue; } bool GFile_DC120::supportsFile(FILE* file) { if (fseek(file,0,SEEK_SET)!=0) return false; unsigned char header[4]; if (fread(header,sizeof(header),1,file)!=1) return false; if ((header[0]!='M')||(header[1]!='M')|| (header[2]!=0)||(header[3]!=42)) return false; if (fseek(file,0x01dc,SEEK_SET)!=0) return false; char sig[5]; if (fread(sig,sizeof(sig),1,file)!=1) return false; return (strncmp(sig,"DC120",sizeof(sig))==0); } kdc2tiff-0.35/GFile_DC120.h0100644000175000017500000000322207254247222013243 0ustar cvscvs#ifndef _GFile_DC120_H #define _GFile_DC120_H /* Class used to handle processing of .kdc file from KDCFile. * * Written by: Chris Studholme * Last Update: 8-January-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ #include "GFile.h" #include "KDCFile.h" class GFile_DC120 : public GFile { protected: int w, h; double aspect; unsigned int histogram[256]; public: GFile_DC120(KDCFile& file, bool fast=false); virtual ~GFile_DC120(); static bool supportsFile(FILE* file); bool isOK() { return true; } void FindBestMinMax(int& min, int& max) { calculateBestMinMax(min,max,histogram); } int getWidth() { return w; } int getHeight() { return h; } int getPreferredWidth() { return 1200; } int getPreferredHeight() { return 900; } double getAspectRatio() { return aspect; } const char* getComments() { return NULL; } void getPixel(short& r, short& g, short& b, float x1, float y1, float x2, float y2) { r = red->getPixel(x1,y1,x2,y2); g = green->getPixel(x1,y1,x2,y2); b = blue->getPixel(x1,y1,x2,y2); } void getScanLineHorz(short* r, short* g, short* b, float x1, float y1, float x2, float y2, int npixels) { red->getScanLineHorz(r,x1,y1,x2,y2,npixels); green->getScanLineHorz(g,x1,y1,x2,y2,npixels); blue->getScanLineHorz(b,x1,y1,x2,y2,npixels); } void getScanLineVert(short* r, short* g, short* b, float x1, float y1, float x2, float y2, int npixels) { red->getScanLineVert(r,x1,y1,x2,y2,npixels); green->getScanLineVert(g,x1,y1,x2,y2,npixels); blue->getScanLineVert(b,x1,y1,x2,y2,npixels); } }; #endif kdc2tiff-0.35/GFile_JPEG.cpp0100644000175000017500000000645407254250670013625 0ustar cvscvs#include #include #include #include #include #include "GFile_JPEG.h" extern "C" { #include } /* GFile (ie. GImage) decendent for reading JPEG files. * * Written by: Chris Studholme * Last Update: 28-May-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ /* ================ GFile_JPEG methods ================ */ GFile_JPEG::GFile_JPEG(const char* filename, bool fast) { red=green=blue=NULL; w=h=0; // allocate and initialize a JPEG compression object jpeg_decompress_struct cinfo; jpeg_error_mgr jerr; cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo); // specify the source for the compressed data FILE* infile; if ((infile = fopen(filename, "rb")) == NULL) { fprintf(stderr, "can't open %s\n", filename); return; } jpeg_stdio_src(&cinfo, infile); // call jpeg_read_header() to obtain image info jpeg_read_header(&cinfo, TRUE); // set parameters for decompression cinfo.dct_method = JDCT_FLOAT; // jpeg_start_decompress(...); jpeg_start_decompress(&cinfo); w=cinfo.output_width; h=cinfo.output_height; if (cinfo.output_components!=3) { fprintf(stderr,"GFile_JPEG: only full color JPEG images are supported\n"); jpeg_destroy_decompress(&cinfo); fclose(infile); return; } int row_stride = cinfo.output_width * cinfo.output_components; /* Make a one-row-high sample array that will go away when done with image */ JSAMPARRAY buffer = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); unsigned char* r = new unsigned char[w*h]; unsigned char* g = new unsigned char[w*h]; unsigned char* b = new unsigned char[w*h]; // while (scan lines remain to be read) for (int y=0; ygetTotalError()+ green->getTotalError()+blue->getTotalError()); } GFile_JPEG::~GFile_JPEG() { if (red) delete red; if (green) delete green; if (blue) delete blue; } bool GFile_JPEG::supportsFile(FILE* file) { if (fseek(file,0,SEEK_SET)!=0) { fprintf(stderr,"GFile_JPEG::supportsFile() fseek() failed %d\n",errno); return false; } unsigned char header[2]; if (fread(header,sizeof(header),1,file)!=1) { fprintf(stderr,"GFile_JPEG::supportsFile() fread() failed %d\n",errno); return false; } return ((header[0]==0x0FF)&&(header[1]==0x0D8)); } kdc2tiff-0.35/GFile_JPEG.h0100644000175000017500000000341407254247222013262 0ustar cvscvs#ifndef _GFile_JPEG_H #define _GFile_JPEG_H #include "GFile.h" /* GFile (ie. GImage) decendent for reading JPEG files. * * Written by: Chris Studholme * Last Update: 8-January-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ class GFile_JPEG : public GFile { protected: int w,h; unsigned int histogram[256]; public: GFile_JPEG(const char* filename, bool fast=false); ~GFile_JPEG(); static bool supportsFile(FILE* file); bool isOK() { return ((red!=NULL)&&(green!=NULL)&&(blue!=NULL)); } void FindBestMinMax(int& min, int& max) { calculateBestMinMax(min,max,histogram); } const char* getComments() { return NULL; } int getWidth() { return w; } int getHeight() { return h; } /* width/height of individual pixel */ double getAspectRatio() { return 1; } /* must have x1getPixel(x1,y1,x2,y2); g = green->getPixel(x1,y1,x2,y2); b = blue->getPixel(x1,y1,x2,y2); } /* must have y1getScanLineHorz(r,x1,y1,x2,y2,npixels); green->getScanLineHorz(g,x1,y1,x2,y2,npixels); blue->getScanLineHorz(b,x1,y1,x2,y2,npixels); } /* must have x1getScanLineVert(r,x1,y1,x2,y2,npixels); green->getScanLineVert(g,x1,y1,x2,y2,npixels); blue->getScanLineVert(b,x1,y1,x2,y2,npixels); } }; #endif kdc2tiff-0.35/GFile_TIFF.cpp0100644000175000017500000000742007254250670013622 0ustar cvscvs#include #include #include #include #include "GFile_TIFF.h" /* GFile (ie. GImage) decendent for reading TIFF files. * * Written by: Chris Studholme * Last Update: 28-May-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ //#define _CHECKS #ifdef _CHECKS double VerifyImage(GImageComponent* image, const unsigned char* imagedata, int w, int h) { double error=0; for (int y=0; ygetPixel(x,y,x+1,y+1); error += residule*residule; //error += residule<0 ? -residule : residule; } return sqrt(error/w/h)/128; //return error/w/h/128; } #endif /* ================ GFile_TIFF methods ================ */ GFile_TIFF::GFile_TIFF(const char* filename, bool fast) { imagefile = TIFFOpen(filename,"r"); if (imagefile==0) { fprintf(stderr,"GFile_TIFF::GFile_TIFF, cannot read file '%s'\n",filename); return; } ReadImage(fast); } /* GFile_TIFF::GFile_TIFF(FILE* infile) { imagefile = infile; ReadImage(); } */ GFile_TIFF::~GFile_TIFF() { if (imagefile) TIFFClose(imagefile); if (red) delete red; if (green) delete green; if (blue) delete blue; } bool GFile_TIFF::supportsFile(FILE* file) { if (fseek(file,0,SEEK_SET)!=0) { fprintf(stderr,"GFile_TIFF::supportsFile() fseek() failed %d\n",errno); return false; } unsigned char header[4]; if (fread(header,sizeof(header),1,file)!=1) { fprintf(stderr,"GFile_TIFF::supportsFile() fread() failed %d\n",errno); return false; } return (((header[0]=='M')&&(header[1]=='M')&& (header[2]==0)&&(header[3]==42))|| ((header[0]=='I')&&(header[1]=='I')&& (header[2]==42)&&(header[3]==0))); } void GFile_TIFF::ReadImage(bool fast) { TIFFGetField(imagefile, TIFFTAG_IMAGEWIDTH, &w); TIFFGetField(imagefile, TIFFTAG_IMAGELENGTH, &h); int npixels = w*h; uint32* raster = new uint32[npixels]; if (raster==NULL) { fprintf(stderr,"GFile_TIFF::ReadImage, failed to allocate memory\n"); TIFFClose(imagefile); imagefile=0; return; } if (!TIFFReadRGBAImage(imagefile, w, h, raster, 0)) { fprintf(stderr,"GFile_TIFF::ReadImage, failed to read image\n"); TIFFClose(imagefile); imagefile=0; return; } // process image unsigned char* color = new unsigned char[npixels]; fprintf(stderr,"Initializing linear matrix... "); for (int y=0; ygetTotalError()); fprintf(stderr,"Red Error(l2): %g\n",VerifyImage(red,color,w,h)); #endif fprintf(stderr,"red... "); for (int y=0; ygetTotalError()); fprintf(stderr,"Green Error(l2): %g\n",VerifyImage(green,color,w,h)); #endif fprintf(stderr,"green... "); for (int y=0; ygetTotalError()); fprintf(stderr,"Blue Error(l2): %g\n",VerifyImage(blue,color,w,h)); #endif fprintf(stderr,"blue, done.\n"); if (!fast) fprintf(stderr,"Total Error is %g\n",red->getTotalError()+ green->getTotalError()+blue->getTotalError()); delete[] color; delete[] raster; } const char* GFile_TIFF::getComments() { return NULL; } /* width/height of individual pixel */ double GFile_TIFF::getAspectRatio() { return 1; } kdc2tiff-0.35/GFile_TIFF.h0100644000175000017500000000331207254247222013262 0ustar cvscvs#ifndef _GFile_TIFF_H #define _GFile_TIFF_H #include #include "GFile.h" /* GFile (ie. GImage) decendent for reading TIFF files. * * Written by: Chris Studholme * Last Update: 8-January-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ class GFile_TIFF : public GFile { protected: TIFF* imagefile; int w,h; public: GFile_TIFF(const char* filename, bool fast=false); // GFile_TIFF(FILE* imagefile); ~GFile_TIFF(); static bool supportsFile(FILE* file); bool isOK() { return (imagefile!=0); } const char* getComments(); int getWidth() { return w; } int getHeight() { return h; } /* width/height of individual pixel */ double getAspectRatio(); /* must have x1getPixel(x1,y1,x2,y2); g = green->getPixel(x1,y1,x2,y2); b = blue->getPixel(x1,y1,x2,y2); } /* must have y1getScanLineHorz(r,x1,y1,x2,y2,npixels); green->getScanLineHorz(g,x1,y1,x2,y2,npixels); blue->getScanLineHorz(b,x1,y1,x2,y2,npixels); } /* must have x1getScanLineVert(r,x1,y1,x2,y2,npixels); green->getScanLineVert(g,x1,y1,x2,y2,npixels); blue->getScanLineVert(b,x1,y1,x2,y2,npixels); } protected: void ReadImage(bool fast=false); }; #endif kdc2tiff-0.35/GFilter.cpp0100644000175000017500000001672607560333261013367 0ustar cvscvs#include #include #include #include "GFilter.h" /* GFilter is an abstract decendant of GImage. Derivatives of this class can * be used to filter an image in some way (scale, rotate, etc). * * Written by: Chris Studholme * Last Update: 25-May-2000 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ inline short boundcheck(int x) { if (x<-32768) return -32768; if (x>32767) return 32767; return x; } /* ================ GFilter_GammaCorrection methods ================ */ inline void GammaCorrect(short& red, short& green, short& blue, short* table) { red = *(short*)(((char*)table)+(red&0xFFFE)); green = *(short*)(((char*)table)+(green&0xFFFE)); blue = *(short*)(((char*)table)+(blue&0xFFFE)); } void GFilter_GammaCorrection::setGammaCorrection(float gamma) { // create table if (table) delete[] table; table = new short[32768]; // fill table float offset = (1-gamma)*log(range); for (int i=-32768; i<32768; ++i) { short e; if ((i<=min)||(i>=min+range)) e=i; else e=min+(int)exp((log(i-min)-offset)/gamma); *(short*)(((char*)table)+(i&0xFFFE))=e; } } void GFilter_GammaCorrection::getPixel(short& red, short& green, short& blue, float x1, float y1, float x2, float y2) { src.getPixel(red,green,blue,x1,y1,x2,y2); GammaCorrect(red,green,blue,table); } void GFilter_GammaCorrection::getScanLineHorz(short* red, short* green, short* blue, float x1, float y1, float x2, float y2, int npixels) { src.getScanLineHorz(red,green,blue,x1,y1,x2,y2,npixels); for (int i=0; i1) { green/=red; blue/=red; red=1; } if (blue>1) { red/=blue; green/=blue; blue=1; } rdiff=(int)(32678*red); gdiff=(int)(32678*green); bdiff=(int)(32678*blue); } void getPixel(short& red, short& green, short& blue, float x1, float y1, float x2, float y2); void getScanLineHorz(short* red, short* green, short* blue, float x1, float y1, float x2, float y2, int npixels); void getScanLineVert(short* red, short* green, short* blue, float x1, float y1, float x2, float y2, int npixels); }; class GFilter_Scale : public GFilter { /* * scaling filter */ protected: double aspectratio; int w,h; float xfactor,xoffset; float yfactor,yoffset; public: GFilter_Scale(GImage& image) : GFilter(image) { aspectratio=src.getAspectRatio(); w=src.getWidth(); h=src.getHeight(); calculateConstants(); } /* if either of width or height are zero, it will be calculated; * both must not be zero */ GFilter_Scale(GImage& image, int width, int height, double aspect=1) : GFilter(image) { w=width; h=height; aspectratio=aspect; if (w==0) w = (int)((h*src.getWidth()*src.getAspectRatio())/(src.getHeight()*aspectratio)); else if (h==0) h = (int)((w*src.getHeight()*aspectratio)/(src.getWidth()*src.getAspectRatio())); calculateConstants(); } /* changing the aspect ratio does not change the image dimensions; * therefore, the image may end up cropped if the dimensions are not reset */ void setAspectRatio(double ratio) { aspectratio=ratio; calculateConstants(); } /* sets the maximum dimensions the image may have; one dimension may be * set smaller to maintain aspect ratio and not crop the image */ void setMaximumDimensions(int width, int height) { w=width; h=height; double temp = (src.getWidth()*src.getAspectRatio())/(src.getHeight()*aspectratio); int ow = (int)(h*temp); if (oww) w=ow; else { int oh = (int)(w/temp); if (oh>h) h=oh; } calculateConstants(); } /* sets the image dimensions exactly; if crop=true, the image may be * cropped to maintain aspect ratio; if crop=false, the aspect ratio * will be changed to ensure that the image is not cropped */ void setDimensions(int width, int height, bool crop=true) { w=width; h=height; if (!crop) aspectratio=h*src.getWidth()*src.getAspectRatio()/(w*src.getHeight()); calculateConstants(); } int getWidth() { return w; } int getUncropWidth() { int ow=(int)((h*src.getWidth()*src.getAspectRatio())/(src.getHeight()*aspectratio)); return ow>w?ow:w; } int getHeight() { return h; } int getUncropHeight() { int oh=(int)((w*src.getHeight()*aspectratio)/(src.getWidth()*src.getAspectRatio())); return oh>h?oh:h; } int getPreferredWidth() { return w; } int getPreferredHeight() { return h; } double getAspectRatio() { return aspectratio; } void getPixel(short& red, short& green, short& blue, float x1, float y1, float x2, float y2); void getScanLineHorz(short* red, short* green, short* blue, float x1, float y1, float x2, float y2, int npixels); void getScanLineVert(short* red, short* green, short* blue, float x1, float y1, float x2, float y2, int npixels); private: void calculateConstants(); }; class GFilter_Rotate : public GFilter { /* * rotate filter */ protected: int degree; public: GFilter_Rotate(GImage& image, int angle=0) : GFilter(image) { degree=(360+angle)%360; if (degree%90!=0) fprintf(stderr,"GFilter_Rotate: rotate angle must be multiple of 90 degrees %d\n",degree); } void setClockwiseRotate(int angle=90) { degree=(360+angle)%360; if (degree%90!=0) fprintf(stderr,"GFilter_Rotate: rotate angle must be multiple of 90 degrees %d\n",degree); } void setCounterClockwiseRotate(int angle=90) { degree=(360-angle)%360; if (degree%90!=0) fprintf(stderr,"GFilter_Rotate: rotate angle must be multiple of 90 degrees %d\n",degree); } int getWidth() { return (degree==90)||(degree==270) ? src.getHeight() : src.getWidth(); } int getHeight() { return (degree==90)||(degree==270) ? src.getWidth() : src.getHeight(); } int getPreferredWidth() { return (degree==90)||(degree==270) ? src.getPreferredHeight() : src.getPreferredWidth(); } int getPreferredHeight() { return (degree==90)||(degree==270) ? src.getPreferredWidth() : src.getPreferredHeight(); } double getAspectRatio() { return (degree==90)||(degree==270) ? 1/src.getAspectRatio() : src.getAspectRatio(); } void getPixel(short& red, short& green, short& blue, float x1, float y1, float x2, float y2); void getScanLineHorz(short* red, short* green, short* blue, float x1, float y1, float x2, float y2, int npixels); void getScanLineVert(short* red, short* green, short* blue, float x1, float y1, float x2, float y2, int npixels); }; #endif kdc2tiff-0.35/GICBayer.cpp0100644000175000017500000004407007665017451013417 0ustar cvscvs/* Class which describes a single colour channel of an image in a generalized * way allowing for easy and accurate scaling to any size. These subclasses * of GImageComponent are ideal for de-bayerizing Bayer pattern images. * * Written by: Chris Studholme * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) * $Id: GICBayer.cpp,v 1.5 2003/05/28 02:30:01 cvs Exp $ */ #include #include #include #include "GICBayer.h" //#define SHOW_STATS #define MAXITTER 20 #define MINITTER 4 #define MINITTER_FAST 2 #define ITTER_INCR 1 template inline T MAX(T a, T b) { return (a>b ? a : b); } template inline T MAX(T a, T b, T c) { if (b>a) a=b; if (c>a) a=c; return a; } template inline T MAX(T a, T b, T c, T d) { if (b>a) a=b; if (c>a) a=c; if (d>a) a=d; return a; } template inline T MAX(T a, T b, T c, T d, T e, T f, T g, T h) { if (b>a) a=b; if (c>a) a=c; if (d>a) a=d; if (e>a) a=e; if (f>a) a=f; if (g>a) a=g; if (h>a) a=h; return a; } template inline T MIN(T a, T b) { return (a inline T MIN(T a, T b, T c) { if (b inline T MIN(T a, T b, T c, T d) { if (b inline T MIN(T a, T b, T c, T d, T e, T f, T g, T h) { if (b32767) return 32767; return x; } // returns c1 inline short extrapolate(short cmin, short cmax, short c2, short omin, short omax, short o1, short o2) { if (o1==o2) return c2; else if (o1o2)&&(o1>o3)) return MAX(c2,c3); else if ((o10) { gmin = MIN(gmin,tl[y*w+x-1]); gmax = MAX(gmax,tl[y*w+x-1]); if (x>1) { cmin = MIN(cmin,id[y*w+x-2]); cmax = MAX(cmax,id[y*w+x-2]); } } if (x0) { gmin = MIN(gmin,tl[y*w+x-w]); gmax = MAX(gmax,tl[y*w+x-w]); if (y>1) { cmin = MIN(cmin,id[(y-2)*w+x]); cmax = MAX(cmax,id[(y-2)*w+x]); } } if (y1) { pixel += extrapolate(gmin,gmax,tl[y*w+x-1],cmin,cmax,id[y*w+x],id[y*w+x-2]); ++count; } if (x1) { pixel += extrapolate(gmin,gmax,tl[(y-1)*w+x],cmin,cmax,id[y*w+x],id[(y-2)*w+x]); ++count; } if (y>4; } return error; } inline long green_error_middle(short* tl, short* id, int y, int w) { long error=0; if (y&1) { // right column int residule = (6*tl[y*w+w-1]+tl[(y-1)*w+w-1]+tl[(y+1)*w+w-1])/8 - id[y*w+w-1]; error += (residule*residule+8)>>4; } else { // left column int residule = (6*tl[y*w]+tl[(y-1)*w]+tl[(y+1)*w])/8 - id[y*w]; error += (residule*residule+8)>>4; } // middle pixels for (int x=2-(y&1); x>4; } return error; } inline long green_error_bottom(short* tl, short* id, int w, int h) { long error=0; for (int x=1; x>4; } return error; } GICBayer_Green::GICBayer_Green(const unsigned char* imagedata, int width, int height, float maxerr) : GImageComponent(width,height,maxerr) { /* initialize arrays */ short* id = new short[w*h]; for (int y=0; y1) green_make_up(tl,id,y-2,w,h); } green_make_up(tl,id,h-2,w,h); green_make_up(tl,id,h-1,w,h); /* main loop to calculate points */ int merror=(int)(maxerror*maxerror*128*128*w*h/2)>>4; long error; int itter=1; do { ++itter; error=0; // calculate better answer (edges) green_better_edges(tl,id,w,h); // do all three steps in one loop for better cache use for (int i=0; i=MINITTER) { if (i==1) // top row error += green_error_top(tl,id,w); else if (i>1) // middle rows error += green_error_middle(tl,id,i-1,w); } } // quit if we want it done fast if ((maxerr==-1)&&(itter>=MINITTER_FAST)) break; if (itter>=MINITTER) { // error (bottom row) error+= green_error_bottom(tl,id,w,h); // really aweful if (error<0) continue; // solution is good enough => quit if (error0) { gmin = MIN(gmin,gtl[y*w+x-w-1]); gmax = MAX(gmax,gtl[y*w+x-w-1]); rmin = MIN(rmin,tl[y*w+x-w-1]); rmax = MAX(rmax,tl[y*w+x-w-1]); } if (y0) { gmin = MIN(gmin,gtl[y*w+x+w-1]); gmax = MAX(gmax,gtl[y*w+x+w-1]); rmin = MIN(rmin,tl[y*w+x+w-1]); rmax = MAX(rmax,tl[y*w+x+w-1]); } } int count=1; int pixel = extrapolate(rmin,rmax,tl[y*w+x-w+1],gmin,gmax,gtl[y*w+x],gtl[y*w+x-w+1]); if (x>0) { pixel += extrapolate(rmin,rmax,tl[y*w+x-w-1],gmin,gmax,gtl[y*w+x],gtl[y*w+x-w-1]); ++count; } if (y0) { pixel += extrapolate(rmin,rmax,tl[y*w+x+w-1],gmin,gmax,gtl[y*w+x],gtl[y*w+x+w-1]); ++count; } } tl[y*w+x]=pixel/count; } } inline long red_error_top(short* tl, short* id, int w) { long error=0; for (int x=1; x>4; } return error; } inline long red_error_middle(short* tl, short* id, int y, int w) { long error=0; id += y*w/4; tl += y*w; // middle pixels for (int x=1; x>4; } // right column int residule = (6*tl[w-1]+tl[-1]+tl[2*w-1])/8 - id[w/2-1]; error += (residule*residule+8)>>4; return error; } inline void red_better_top(short* tl, short* id, int w, int h) { // top row for (int x=1; x>4); // main loop do { // do nitter/2 itterations in batch error=0; for (int head=0; head=0)&&(y0)) { if (y==0) error+=red_error_top(tl,id,w); else error+=red_error_middle(tl,id,y,w); } // calculate better answer if (y==0) red_better_top(tl,id,w,h); else red_better_middle(tl,id,y,w); } } } itter+=nitter/2; nitter=2*ITTER_INCR; // quit if we want it done fast if (merror<=0) break; // solution is good enough => quit if ((0<=error)&&(error0) { gmin = MIN(gmin,gtl[y*w+x-w-1]); gmax = MAX(gmax,gtl[y*w+x-w-1]); bmin = MIN(bmin,tl[y*w+x-w-1]); bmax = MAX(bmax,tl[y*w+x-w-1]); if (x0) { pixel += extrapolate(bmin,bmax,tl[y*w+x-w-1],gmin,gmax,gtl[y*w+x],gtl[y*w+x-w-1]); ++count; if (x>4; // middle pixels for (int x=2; x>4; } return error; } inline long blue_error_bottom(short* tl, short* id, int w, int h) { long error=0; id += (h-2)*w/4; tl += (h-1)*w; // bottom row for (int x=2; x>4; } return error; } GICBayer_Blue::GICBayer_Blue(const unsigned char* imagedata, int width, int height, GImageComponent& green, float maxerr) : GImageComponent(width,height,maxerr) { if ((green.getWidth()!=w)||(green.getHeight()!=h)) { fprintf(stderr,"GICBayer_Red: FATAL ERROR! green component has different dimensions\n"); return; } const short* gtl = green.getPointArray(); short* id = new short[w*h/4]; int itter=0; int nitter=2*(maxerr==-1?MINITTER_FAST:MINITTER); long error; int merror=(maxerr==-1?-1:((int)(maxerror*maxerror*128*128*w*h/4))>>4); // main loop do { // do nitter/2 itterations in batch error=0; for (int head=0; head=0)&&(y=0) { // calculate error if necessary if ((i==nitter-2)&&(merror>0)) { if (y quit if ((0<=error)&&(error #include #include "GImage.h" /* Abstract class for describing a generalized RGB image. Images have * width, height, aspect ratio, comments, and RGB pixels stored as int * with values typically in the range [-16384,16383], but may be outside * this range. * * Written by: Chris Studholme * Last Update: 2-December-1999 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ /* ================ GImage methods ================ */ /* must have y10) for (int i=0; i0) for (int i=0; i #include #include #include "GImageComponent.h" //#define SHOW_STATS #define DEFAULT_ERROR 0.1 #define MAXITTER 20 #define MINITTER 3 inline short boundcheck(int x) { if (x<-32768) return -32768; if (x>32767) return 32767; return x; } template inline T MAX(T a, T b) { return (a>b ? a : b); } template inline T MAX(T a, T b, T c) { if (b>a) a=b; if (c>a) a=c; return a; } template inline T MAX(T a, T b, T c, T d) { if (b>a) a=b; if (c>a) a=c; if (d>a) a=d; return a; } template inline T MAX(T a, T b, T c, T d, T e, T f, T g, T h) { if (b>a) a=b; if (c>a) a=c; if (d>a) a=d; if (e>a) a=e; if (f>a) a=f; if (g>a) a=g; if (h>a) a=h; return a; } template inline T MIN(T a, T b) { return (a inline T MIN(T a, T b, T c) { if (b inline T MIN(T a, T b, T c, T d) { if (b inline T MIN(T a, T b, T c, T d, T e, T f, T g, T h) { if (b0 ? error : DEFAULT_ERROR; totalerror=0; } /* x1>8; int ix2 = x2>>8; int iy1 = y1>>8; int iy2 = y2>>8; if (ix1<0) ix1=0; else if (ix1>=w-1) ix1=w-2; if (iy1<0) iy1=0; else if (iy1>=h-1) iy1=h-2; if (ix2<0) ix2=0; else if (ix2>=w-1) ix2=w-2; if (iy2<0) iy2=0; else if (iy2>=h-1) iy2=h-2; int logx=0; for (int i=ix2-ix1; i!=0; ++logx,i>>=1) ; // calculate log2(ix2-ix1) int logy=0; for (int i=iy2-iy1; i!=0; ++logy,i>>=1) ; // calculate log2(iy2-iy1) logy = logy>logx ? logy-logx : 0; int result=0; int by1 = y1 - (iy1<<8); for (int y=iy1; y<=iy2; ++y) { int by2 = y2 - (y<<8); if ((y<(h-2))&&(by2>256)) by2=256; int sy = by2+by1; int bx1 = x1 - (ix1<<8); int r1=0; for (int x=ix1; x<=ix2; ++x) { int bx2 = x2 - (x<<8); if ((x<(w-2))&&(bx2>256)) bx2=256; int sx = bx2+bx1; int p1 = (512-sx)*tl[y*w+x] +sx*tl[y*w+x+1]; // 24 bits int p2 = (512-sx)*tl[(y+1)*w+x] +sx*tl[(y+1)*w+x+1]; // 24 bits int p3 = (p1*512>>4) + ((8+p2-p1)>>4)*sy; // net shift right 4, 31 bits int dx = bx2-bx1; r1 += (((256+p3)>>9)*dx)>>logx; bx1=0; } int dy = by2-by1; result += (r1/(x2-x1)*dy)>>logy; // 31-logx bits by1=0; } return ( result/(y2-y1) )/4; } /* x1=w-1) ix1=w-2; if (iy1<0) iy1=0; else if (iy1>=h-1) iy1=h-2; if (ix2<0) ix2=0; else if (ix2>=w-1) ix2=w-2; if (iy2<0) iy2=0; else if (iy2>=h-1) iy2=h-2; double result=0; double by1 = y1-iy1; for (int y=iy1; y<=iy2; ++y) { double by2 = y2-y; if ((y<(h-2))&&(by2>1)) by2=1; double sy = by2+by1; double dy = by2-by1; double bx1 = x1-ix1; for (int x=ix1; x<=ix2; ++x) { double bx2 = x2-x; if ((x<(w-2))&&(bx2>1)) bx2=1; double sx = bx2+bx1; double dx = bx2-bx1; result += ( (sx-2)*(sy-2)*tl[y*w+x] -sx*(sy-2)*tl[y*w+x+1] -(sx-2)*sy*tl[(y+1)*w+x] +sx*sy*tl[(y+1)*w+x+1] )*dx*dy; bx1=0; } by1=0; } return ((int)(result/(x2-x1)/(y2-y1)))/4; } /* y10) for (int i=0; i0) for (int i=0; imax) { tl[y*w+x]=max; continue; } // check if central pixel is too dim int min = (extra ? MIN(tl[y*w+x-1],tl[y*w+x+1],tl[(y-1)*w+x],tl[(y+1)*w+x]) : MIN(tl[y*w+x-1],tl[y*w+x+1],tl[(y-1)*w+x], tl[(y+1)*w+x],tl[(y-1)*w+x-1],tl[(y-1)*w+x+1], tl[(y+1)*w+x-1],tl[(y+1)*w+x+1])); if (tl[y*w+x]werror)&&(itterwerror)&&(itterherror)&&(itterherror)&&(itter=tail; --y) for (int x=1; x=2)) { ++tail; --itter; totalerror+=werror; } // check answer at tail (accurate method) else while ((itter>=MINITTER)&&(tailwerror)&&(ittermitter) mitter=itter; --itter; } // advance head if (head class GImageComponent { /* * General function is piecewise quasi-linear function with pieces of: * f(x,y) = alpha*x + beta*y + gamma*x*y + omega, x,y e [0,1] * * The image coordinate system is (x,y) for x,y e [0,1], where (0,0) is top * left. * * This class is abstract. Only instanciate a derived class. */ protected: int w,h; short *tl; float maxerror; double totalerror; public: GImageComponent(int width, int height, float maxerror=0); virtual ~GImageComponent() { delete[] tl; } inline double getTotalError() { return totalerror; } int getWidth() { return w; } int getHeight() { return h; } const short* getPointArray() { return tl; } /* x1tl[i]) result=tl[i]; return 128+((float)result)/128; } float getMeanValue() { float result=0; for (int i=0; i #include #include #include #include extern "C" { #include } #ifdef DECODE_KDCTAG #include "xtiffio.h" #else #include "tiffio.h" #endif #include "KDCFile.h" //#define _VERBOSE //#define __COMPRESSED_PIXEL_STATS /* KDC image dimensions: * 848x976 * * Bayer patter: * GRGRGR (R is red, G is green, B is blue) * BGBGBG * GRGRGR * BGBGBG */ /* * Data for decoding uncompressed .kdc files. Kodak has gone * to a great deal of trouble to make it hard to reverse-engineer * this table, but I was able to compute it by calculating the * offset at which scan lines were correlated. Ed Hamrick, 10/24/97 */ static const short int kdcoff[] = { 0,828,798,488,648,748,698, 8,448,668,598,376,248,588,498,744, 48,508,398,264,696,428,298,632,496,348,198,152,296,268, 98,520, 96,188,846, 40,744,108,746,408,544, 28,646,776,344,796,546,296, 144,716,446,664,792,636,346,184,592,556,246,552,392,476,146, 72, 192,396, 46,440,840,316,794,808,640,236,694,328,440,156,594,696, 240, 76,494,216, 40,844,394,584,688,764,294,104,488,684,194,472, 288,604, 94,840, 88,524,842,360,736,444,742,728,536,364,642,248, 336,284,542,616,136,204,442,136,784,124,342,504,584, 44,242, 24, 384,812,142,392,184,732, 42,760,832,652,790,280,632,572,690,648, 432,492,590,168,232,412,490,536, 32,332,390, 56,680,252,290,424, 480,172,190,792,280, 92, 90,312, 80, 12,838,680,728,780,738,200, 528,700,638,568,328,620,538, 88,128,540,438,456,776,460,338,824, 576,380,238,344,376,300,138,712,176,220, 38,232,824,140,786,600, 624, 60,686,120,424,828,586,488,224,748,486, 8, 24,668,386,376, 672,588,286,744,472,508,186,264,272,428, 86,632, 72,348,834,152, 720,268,734,520,520,188,634, 40,320,108,534,408,120, 28,434,776, 768,796,334,296,568,716,234,664,368,636,134,184,168,556, 34,552, 816,476,782, 72,616,396,682,440,416,316,582,808,216,236,482,328, 16,156,382,696,664, 76,282,216,464,844,182,584,264,764, 82,104, 64,684,830,472,712,604,730,840,512,524,630,360,312,444,530,728, 112,364,430,248,760,284,330,616,560,204,230,136,360,124,130,504, 160, 44, 30, 24,808,812,778,392,608,732,678,760,408,652,578,280, 208,572,478,648, 8,492,378,168,656,412,278,536,456,332,178, 56, 256,252, 78,424, 56,172,826,792,704, 92,726,312,504, 12,626,680, 304,780,526,200,104,700,426,568,752,620,326, 88,552,540,226,456, 352,460,126,824,152,380, 26,344,800,300,774,712,600,220,674,232, 400,140,574,600,200, 60,474,120, 0,828,374,488,648,748,274, 8, 448,668,174,376,248,588, 74,744, 48,508,822,264,696,428,722,632, 496,348,622,152,296,268,522,520, 96,188,422, 40,744,108,322,408, 544, 28,222,776,344,796,122,296,144,716, 22,664,792,636,770,184, 592,556,670,552,392,476,570, 72,192,396,470,440,840,316,370,808, 640,236,270,328,440,156,170,696,240, 76, 70,216, 40,844,818,584, 688,764,718,104,488,684,618,472,288,604,518,840, 88,524,418,360, 736,444,318,728,536,364,218,248,336,284,118,616,136,204, 18,136, 784,124,766,504,584, 44,666, 24,384,812,566,392,184,732,466,760, 832,652,366,280,632,572,266,648,432,492,166,168,232,412, 66,536, 32,332,814, 56,680,252,714,424,480,172,614,792,280, 92,514,312, 80, 12,414,680,728,780,314,200,528,700,214,568,328,620,114, 88, 128,540, 14,456,776,460,762,824,576,380,662,344,376,300,562,712, 176,220,462,232,824,140,362,600,624, 60,262,120,424,828,162,488, 224,748, 62, 8, 24,668,810,376,672,588,710,744,472,508,610,264, 272,428,510,632, 72,348,410,152,720,268,310,520,520,188,210, 40, 320,108,110,408,120, 28, 10,776,768,796,758,296,568,716,658,664, 368,636,558,184,168,556,458,552,816,476,358, 72,616,396,258,440, 416,316,158,808,216,236, 58,328, 16,156,806,696,664, 76,706,216, 464,844,606,584,264,764,506,104, 64,684,406,472,712,604,306,840, 512,524,206,360,312,444,106,728,112,364, 6,248,760,284,754,616, 560,204,654,136,360,124,554,504,160, 44,454, 24,808,812,354,392, 608,732,254,760,408,652,154,280,208,572, 54,648, 8,492,802,168, 656,412,702,536,456,332,602, 56,256,252,502,424, 56,172,402,792, 704, 92,302,312,504, 12,202,680,304,780,102,200,104,700, 2,568, 752,620,750, 88,552,540,650,456,352,460,550,824,152,380,450,344, 800,300,350,712,600,220,250,232,400,140,150,600,200, 60, 50,120, 0,828,798,488,648,748,698, 8,448,668,598,376,248,588,498,744, 48,508,398,264,696,428,298,632,496,348,198,152,296,268, 98,520, 96,188,846, 40,744,108,746,408,544, 28,646,776,344,796,546,296, 144,716,446,664,792,636,346,184,592,556,246,552,392,476,146, 72, 192,396, 46,440,840,316,794,808,640,236,694,328,440,156,594,696, 240, 76,494,216, 40,844,394,584,688,764,294,104,488,684,194,472, 288,604, 94,840, 88,524,842,360,736,444,742,728,536,364,642,248, 336,284,542,616,136,204,442,136,784,124,342,504,584, 44,242, 24, }; static const unsigned char jpeghead[] = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x64, 0x00, 0x4B // maybe this last number should be 0x64 }; void KDCFile::FixScanline(unsigned char* dest, const unsigned char* src, int row) { for (unsigned int i=0; i0) pos+=size; // restore tiff error messages TIFFSetErrorHandler(eh); if (pos==0) { fprintf(stderr,"KDCFile::ReadUncompressedData, error reading image after %d bytes\n",pos); delete[] rawdata; TIFFClose(kdcimage); kdcimage=0; return false; } if (pos>=bufsize) { fprintf(stderr,"KDCFile::ReadUncompressedData, compressed image too large\n"); delete[] rawdata; TIFFClose(kdcimage); kdcimage=0; return false; } rawdata[sizeof(jpeghead)]=0; rawdata[sizeof(jpeghead)+1]=0; // order bytes correctly for (unsigned int i=sizeof(jpeghead)+2; ialloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); //FILE* out=fopen("kdcraw.bin","w"); /* Step 6: while (scan lines remain to be read) */ /* jpeg_read_scanlines(...); */ /* Here we use the library's state variable cinfo.output_scanline as the * loop counter, so that we don't have to keep track ourselves. */ while (cinfo.output_scanline < cinfo.output_height) { /* jpeg_read_scanlines expects an array of pointers to scanlines. * Here the array is only one element long, but you could ask for * more than one scanline at a time if that's more convenient. */ jpeg_read_scanlines(&cinfo, buffer, 1); // decode scanline to a pair of rows in the dest buffer for (unsigned int i=0; i class KDCFile { public: /* main directory */ /* standard tags */ const char* DateTime; const char* ImageDescription; const char* Make; const char* Model; const char* Software; /* Kodak specific tags */ const char* Copyright; // 33432 const char* T33423; const char* T36867; /* 33424 (0x8290) LONG (4) 1<1002> 33434 (0x829a) RATIONAL (5) 1<0.01069> 33437 (0x829d) RATIONAL (5) 1<2.5> 34850 (0x8822) SHORT (3) 1<2> 34859 (0x882b) SHORT (3) 1<0> 37382 (0x9206) RATIONAL (5) 1<0.7> 37385 (0x9209) SHORT (3) 1<31> 37386 (0x920a) RATIONAL (5) 1<100> 37393 (0x9211) SHORT (3) 1<1> 37398 (0x9216) BYTE (1) 4<00 00 00 0x1> 37399 (0x9217) SHORT (3) 1<2> */ /* sub directory */ /* 33421 (0x828d) SHORT (3) 2<2 2> 33422 (0x828e) BYTE (1) 4<0x1 0x2 00 0x1> 37122 (0x9102) RATIONAL (5) 1<0.75> 37400 (0x9218) SRATIONAL (10) 12<0 -2.02926 1.04202 -0.824892 0 -1.4279 5.95526 -0.572662 0 -0 */ protected: TIFF* kdcimage; static const unsigned int width = 848; static const unsigned int height = 976; public: KDCFile(const char* filename); ~KDCFile(); bool isOK() { return (kdcimage!=0); } bool ReadKDCFile(unsigned char* dest); unsigned int getWidth() { return width; } unsigned int getHeight() { return height; } /* Current measurements are: * 1.56691 * 1.56554 * Camera specs say: * 1.56 (7.8um by 5.0um) */ double getPixelAspect() { return 1.56; } protected: bool ReadUncompressedData(unsigned char* dest); void FixScanline(unsigned char* dest, const unsigned char* src, int row); bool ReadCompressedData(unsigned char* dest); bool UncompressJPEG(unsigned char* dest, const unsigned char* src, int srcsize); }; #endif kdc2tiff-0.35/Makefile.am0100644000175000017500000000110607321130543013336 0ustar cvscvsbin_PROGRAMS = kdc2tiff kdc2jpeg kdc2tiff_SOURCES = GImageComponent.cpp GImageComponent.h\ GICBayer.cpp GICBayer.h\ GImage.cpp GImage.h\ GFilter.cpp GFilter.h\ GFile.cpp GFile.h\ GFile_TIFF.cpp GFile_TIFF.h\ GFile_JPEG.cpp GFile_JPEG.h\ KDCFile.cpp KDCFile.h\ GFile_DC120.cpp GFile_DC120.h\ OutputOptions.cpp OutputOptions.h\ kdc2tiff.cpp EXTRA_kdc2tiff_SOURCES = xtif_dir.c xtiffio.h xtiffiop.h #kdc2tiff_DEPENDENCIES = @XTIFF@ #kdc2tiff_LDADD = @XTIFF@ INCLUDES = -Iinclude kdc2jpeg: kdc2tiff ln -f kdc2tiff kdc2jpeg kdc2tiff-0.35/Makefile.in0100644000175000017500000003104407775115443013372 0ustar cvscvs# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ bin_PROGRAMS = kdc2tiff kdc2jpeg kdc2tiff_SOURCES = GImageComponent.cpp GImageComponent.h GICBayer.cpp GICBayer.h GImage.cpp GImage.h GFilter.cpp GFilter.h GFile.cpp GFile.h GFile_TIFF.cpp GFile_TIFF.h GFile_JPEG.cpp GFile_JPEG.h KDCFile.cpp KDCFile.h GFile_DC120.cpp GFile_DC120.h OutputOptions.cpp OutputOptions.h kdc2tiff.cpp EXTRA_kdc2tiff_SOURCES = xtif_dir.c xtiffio.h xtiffiop.h #kdc2tiff_DEPENDENCIES = @XTIFF@ #kdc2tiff_LDADD = @XTIFF@ INCLUDES = -Iinclude ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ kdc2tiff_OBJECTS = GImageComponent.o GICBayer.o GImage.o GFilter.o \ GFile.o GFile_TIFF.o GFile_JPEG.o KDCFile.o GFile_DC120.o \ OutputOptions.o kdc2tiff.o kdc2tiff_LDADD = $(LDADD) kdc2tiff_DEPENDENCIES = kdc2tiff_LDFLAGS = kdc2jpeg_SOURCES = kdc2jpeg.c kdc2jpeg_OBJECTS = kdc2jpeg.o kdc2jpeg_LDADD = $(LDADD) kdc2jpeg_DEPENDENCIES = kdc2jpeg_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ Makefile.am Makefile.in NEWS TODO aclocal.m4 config.h.in configure \ configure.in install-sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best DEP_FILES = .deps/GFile.P .deps/GFile_DC120.P .deps/GFile_JPEG.P \ .deps/GFile_TIFF.P .deps/GFilter.P .deps/GICBayer.P .deps/GImage.P \ .deps/GImageComponent.P .deps/KDCFile.P .deps/OutputOptions.P \ .deps/kdc2jpeg.P .deps/kdc2tiff.P .deps/xtif_dir.P SOURCES = $(kdc2tiff_SOURCES) $(EXTRA_kdc2tiff_SOURCES) kdc2jpeg.c OBJECTS = $(kdc2tiff_OBJECTS) kdc2jpeg.o all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cpp .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/config.h.in: $(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h maintainer-clean-hdr: mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: kdc2tiff: $(kdc2tiff_OBJECTS) $(kdc2tiff_DEPENDENCIES) @rm -f kdc2tiff $(CXXLINK) $(kdc2tiff_LDFLAGS) $(kdc2tiff_OBJECTS) $(kdc2tiff_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) here=`cd $(top_builddir) && pwd`; \ top_distdir=`cd $(distdir) && pwd`; \ distdir=`cd $(distdir) && pwd`; \ cd $(top_srcdir) \ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) -include $(DEP_FILES) mostlyclean-depend: clean-depend: distclean-depend: -rm -rf .deps maintainer-clean-depend: %.o: %.c @echo '$(COMPILE) -c $<'; \ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< @-cp .deps/$(*F).pp .deps/$(*F).P; \ tr ' ' '\012' < .deps/$(*F).pp \ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ >> .deps/$(*F).P; \ rm .deps/$(*F).pp %.lo: %.c @echo '$(LTCOMPILE) -c $<'; \ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ < .deps/$(*F).pp > .deps/$(*F).P; \ tr ' ' '\012' < .deps/$(*F).pp \ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ >> .deps/$(*F).P; \ rm -f .deps/$(*F).pp %.o: %.cpp @echo '$(CXXCOMPILE) -c $<'; \ $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< @-cp .deps/$(*F).pp .deps/$(*F).P; \ tr ' ' '\012' < .deps/$(*F).pp \ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ >> .deps/$(*F).P; \ rm .deps/$(*F).pp %.lo: %.cpp @echo '$(LTCXXCOMPILE) -c $<'; \ $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ < .deps/$(*F).pp > .deps/$(*F).P; \ tr ' ' '\012' < .deps/$(*F).pp \ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ >> .deps/$(*F).P; \ rm -f .deps/$(*F).pp info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am all-recursive-am: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) config.h all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ mostlyclean-compile mostlyclean-tags mostlyclean-depend \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ clean-depend clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ distclean-tags distclean-depend distclean-generic \ clean-am distclean: distclean-am -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-depend maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir mostlyclean-depend \ distclean-depend clean-depend maintainer-clean-depend info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ install-exec-am install-exec install-data-am install-data install-am \ install uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean kdc2jpeg: kdc2tiff ln -f kdc2tiff kdc2jpeg # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: kdc2tiff-0.35/NEWS0100644000175000017500000000167607775114216012031 0ustar cvscvsNew in 0.35: * require -o option to overwrite destination files New in 0.34: * allocate fewer arrays on stack to avoid seg faults on MacOS X New in 0.33: * fixed compile time bugs needed for newer versions of gcc New in 0.32: * new option to 'add' gamma (+g) * performance enhancement in de-bayer algorithm * performance enhancement in gamma calculation * fixed some common build problems (and removed --enable-kdctag option) New in 0.31: * added configure option --enable-kdctag which defaults to off to fix problems some Debian users might have New in 0.30: * improved de-bayerization accuracy (with performance decrease) * option for fast de-bayerization (+f) * ability to read TIFF and JPEG files * default output size is 1200x900 for KDC files New in 0.20: * major source reorganization, cleaner implementation with a more object oriented structure * many performance improvements * uses autoconf/automake New in 0.1: * first public release kdc2tiff-0.35/OutputOptions.cpp0100644000175000017500000002154107764442373014711 0ustar cvscvs#include #include #include #include #include #include "OutputOptions.h" #include "GFilter.h" /* Class used to handle processing of command line parameters passed to * kdc2tiff and kdc2jpeg. * * Written by: Chris Studholme * Last Update: 6-Dec-2003 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ void OutputOptions::SetOutputParameters() { image=srcimage; // contrast enhancement int min=0; int max=255; if (contrastenhance) { // find best min and max srcimage->FindBestMinMax(min,max); min-=contrastenhance; max+=contrastenhance; if (min<0) min=0; if (max>255) max=255; if ((min>0)||(max<255)) { fprintf(stderr,"Adjusting constrast (%d,%d) -> (0,255).\n",min,max); GFilter_ContrastAdjustment* ca = new GFilter_ContrastAdjustment(*image,(min-128)*128,(max+1-128)*128); image=ca; } } // white balance if (lightwhite) { float red=1; float blue=1; srcimage->FindWhiteBalance(red,blue,min); fprintf(stderr,"Light source (%.2f,1.00,%.2f).\n",red,blue); // preferred light source // red *= 1.0169; // blue *= 1.003; // check for sane values if (red>1.4) red=1.4; if (red<0.7) red=0.7; if (blue>1.4) blue=1.4; if (blue<0.7) blue=0.7; // don't balance images that undergo insane contrast enhancement if (max-min<150) { float factor = ((float)max-min)/150; red = 1 + factor*(red-1); blue = 1 + factor*(blue-1); } if ((red<0.995)||(red>1.005)||(blue<0.995)||(blue>1.005)) { fprintf(stderr,"Balancing white (%.2f,1.00,%.2f).\n",red,blue); GFilter_WhiteBalance* wb = new GFilter_WhiteBalance(*image,1/red,1/blue); image=wb; } } // gamma correction if (gammacorrection!=1) { fprintf(stderr,"Applying gamma correction of %.2f.\n",gammacorrection); GFilter_GammaCorrection* gc = new GFilter_GammaCorrection(*image,gammacorrection); image=gc; } // rotate image if (rotate) { GFilter_Rotate* rot = new GFilter_Rotate(*image); switch (rotate) { case 1: rot->setClockwiseRotate(); fprintf(stderr,"Rotating image clockwise.\n"); break; case -1: rot->setCounterClockwiseRotate(); fprintf(stderr,"Rotating image counter-clockwise.\n"); break; default: fprintf(stderr,"invalid rotate value (%d)\n", rotate); } image=rot; } // default image dimensions if ((outputwidth==0)&&(outputheight==0)) { outputwidth=image->getPreferredWidth(); outputheight=image->getPreferredHeight(); } // scale image GFilter_Scale* scale = new GFilter_Scale(*image,outputwidth,outputheight); if ((outputwidth>0)&&(outputheight>0)) { if (!squarepixels) scale->setDimensions(outputwidth,outputheight,false); else if (nocrop) scale->setMaximumDimensions(outputwidth,outputheight); } image=scale; outputwidth=image->getWidth(); outputheight=image->getHeight(); fprintf(stderr,"Scaling image to %dx%d%s",outputwidth,outputheight, squarepixels?"":" (non-square pixels)"); int uncropwidth=scale->getUncropWidth(); int uncropheight=scale->getUncropHeight(); if ((uncropwidth!=outputwidth)||(uncropheight!=outputheight)) fprintf(stderr," cropping from %dx%d",uncropwidth,uncropheight); fprintf(stderr,".\n"); } void OutputOptions::SetOutputFilename() { if (outputname==0) { outputname = new char[strlen(inputname)+5]; strcpy(outputname,inputname); char* extension = strrchr(outputname,'.'); if ((extension!=0)&&(extension>strrchr(outputname,'/'))) strcpy(extension, outputtiff?".tif":".jpg"); else strcat(outputname,outputtiff?".tif":".jpg"); } } void OutputOptions::CalculateScanLine(unsigned char* dest, int y) { int w=image->getWidth(); short r[w],g[w],b[w]; image->getScanLineHorz(r,g,b,0,y,w,y+1,w); for (int x=0; x16383 ? 255 : 128+r[x]/128; dest[x*3+1] = g[x]<-16383 ? 0 : g[x]>16383 ? 255 : 128+g[x]/128; dest[x*3+2] = b[x]<-16383 ? 0 : b[x]>16383 ? 255 : 128+b[x]/128; } } // returns 0 if error char** OutputOptions::ParseOptions(int& argc, char*argv[]) { while (argc>0) { if (argv[0][0]=='-') { // stdin or stdout if (strcmp(argv[0],"-")==0) return argv; // next argument is a filename if (strcmp(argv[0],"--")==0) { --argc; return ++argv; } const char* switches = argv[0]+1; while (switches[0]) { switch (switches[0]) { // copyright case 'C': ++argv; if (--argc>0) copyright=argv[0]; else return 0; break; // compression scheme case 'c': ++argv; if (--argc>0) compresstype=argv[0]; else return 0; break; // output filename case 'o': ++argv; if (--argc>0) { outputname=argv[0]; overwrite=true; } else return 0; break; // rows per strip case 'r': ++argv; if (--argc>0) rowsperstrip=atoi(argv[0]); else return 0; if (rowsperstrip<=0) { fprintf(stderr,"invalid rows per strip value (%d)\n",rowsperstrip); return 0; } break; // don't create progressive jpeg case 'P': progressive=false; break; // jpeg quality setting case 'q': ++argv; if (--argc>0) quality=atoi(argv[0]); else return 0; if ((quality<0)||(quality>100)) { fprintf(stderr,"invalid quality value (%d)\n",quality); return 0; } break; // width case 'w': ++argv; if (--argc>0) outputwidth=atoi(argv[0]); else { return 0; } if (outputwidth<=0) { fprintf(stderr,"invalid image width (%d)\n",outputwidth); return 0; } break; // height case 'h': ++argv; if (--argc>0) outputheight=atoi(argv[0]); else return 0; if (outputheight<=0) { fprintf(stderr,"invalid image height (%d)\n",outputheight); return 0; } break; // gamma correction case 'g': ++argv; if (--argc>0) gammacorrection=atof(argv[0]); else return 0; if ((gammacorrection<0.2)||(gammacorrection>5)) { fprintf(stderr,"invalid gamma setting (%.1f)\n",gammacorrection); return 0; } break; // no grain reduction case 'G': grainreduction=0; break; // non-square pixels case 's': squarepixels=false; break; // non-fast de-bayer (highest quality) case 'f': fastdebayer=false; break; // no contrast enhancement case 'e': contrastenhance=0; break; // no cropping case 'p': nocrop=true; break; // don't rotate case 'R': rotate=0; break; // colour of light source (white) case 'W': ++argv; if (--argc>0) { if (strcasecmp(argv[0],"none")==0) lightwhite=0; else if (strcasecmp(argv[0],"auto")==0) lightwhite=-1; else if (strcasecmp(argv[0],"sun")==0) lightwhite=-1; else if (strcasecmp(argv[0],"shade")==0) lightwhite=-1; else if (strcasecmp(argv[0],"cloud")==0) lightwhite=-1; else if (strcasecmp(argv[0],"incandecent")==0) lightwhite=-1; else if (strcasecmp(argv[0],"flourescent")==0) lightwhite=-1; else { lightwhite=atoi(argv[0]); if ((lightwhite<500)||(lightwhite>15000)) { fprintf(stderr,"invalid light source temperature, assuming ttl mode\n"); lightwhite=-1; } } } else return 0; break; default: return 0; } ++switches; } } else if (argv[0][0]=='+') { const char* switches = argv[0]+1; float tempf; while (switches[0]) { switch (switches[0]) { // create progressive jpeg case 'P': progressive=true; break; // square pixels case 's': squarepixels=true; break; // fast de-bayer (sacrifice quality) case 'f': fastdebayer=true; break; // gamma correction case 'g': ++argv; if (--argc>0) tempf=atof(argv[0]); else return 0; if ((tempf<0.2)||(tempf>5)) { fprintf(stderr,"invalid gamma setting (%.1f)\n",tempf); return 0; } else gammacorrection*=tempf; break; // grain reduction case 'G': if (++grainreduction>2) grainreduction=2; break; // normal contrast enhancement case 'e': contrastenhance=2; break; case 'E': ++argv; if (--argc>0) contrastenhance=atoi(argv[0]); else return 0; if ((contrastenhance<=0)||(contrastenhance>255)) { fprintf(stderr,"invalid contrast enhancement (%d)\n", contrastenhance); return 0; } break; // crop if necessary case 'p': nocrop=false; break; // rotate clockwise case 'R': rotate=1; break; // rotate counter-clockwise case 'B': rotate=-1; break; default: return 0; } ++switches; } } // must be a filename else return argv; ++argv; --argc; } return argv; } kdc2tiff-0.35/OutputOptions.h0100644000175000017500000000551407764442511014352 0ustar cvscvs#ifndef _OutputOptions_H #define _OutputOptions_H /* Class used to handle processing of command line parameters passed to * kdc2tiff and kdc2jpeg. * * Written by: Chris Studholme * Last Update: 6-Dec-2003 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ #include "KDCFile.h" #include "GImage.h" #include "GFile_DC120.h" #define DEFAULT_JPEG_QUALITY 75 class OutputOptions { public: // input file options const char* inputname; GFile* srcimage; GImage* image; bool fastdebayer; KDCFile* kdcfile; // this should go away // image options int contrastenhance; float gammacorrection; int grainreduction; bool squarepixels; bool nocrop; int rotate; int outputwhite; int lightwhite; // 0=no correction, -1=auto // temporary variables float gammaoffset; // output file options char* outputname; bool overwrite; // overwrite output file if exists int outputwidth; int outputheight; char* copyright; // specific tiff options bool outputtiff; const char* compresstype; int rowsperstrip; // specific jpeg options bool outputjpeg; int quality; bool progressive; public: OutputOptions() { // defaults inputname=0; srcimage=0; image=0; fastdebayer=false; kdcfile=0; contrastenhance=2; gammacorrection=1; grainreduction=0; squarepixels=true; nocrop=false; rotate=0; gammaoffset=0; outputwhite=6500; lightwhite=0; outputname=0; overwrite=false; outputwidth=0; outputheight=0; copyright=0; outputtiff=false; compresstype=0; rowsperstrip=0; outputjpeg=false; quality=DEFAULT_JPEG_QUALITY; progressive=false; } OutputOptions(OutputOptions& other) { // copy from other inputname=other.inputname; srcimage=other.srcimage; image=other.image; fastdebayer=other.fastdebayer; kdcfile=other.kdcfile; contrastenhance=other.contrastenhance; gammacorrection=other.gammacorrection; grainreduction=other.grainreduction; squarepixels=other.squarepixels; nocrop=other.nocrop; rotate=other.rotate; gammaoffset=other.gammaoffset; outputwhite=other.outputwhite; lightwhite=other.lightwhite; outputname=other.outputname; //overwrite=other.overwrite; overwrite=false; outputwidth=other.outputwidth; outputheight=other.outputheight; copyright=other.copyright; outputtiff=other.outputtiff; compresstype=other.compresstype; rowsperstrip=other.rowsperstrip; outputjpeg=other.outputjpeg; quality=other.quality; progressive=other.progressive; } void SetOutputParameters(); void SetOutputFilename(); void CalculateScanLine(unsigned char* dest, int y); /* stops at first non-option, return 0 if error, new argv othersise */ char** ParseOptions(int& argc, char*argv[]); }; #endif kdc2tiff-0.35/README0100644000175000017500000000224107775114250012175 0ustar cvscvsThis software was originally written to convert .kdc files from a Kodak DC120 digital camera into .tif or .jpg format files. The software is slowly evolving into a general purpose image manipulation tool for all digital cameras. It is currently capable of reading .kdc, .tif, and .jpg files. Particular attention is paid to: * aspect ratio * accurate scaling * contrast adjustment * gamma correction * image rotation * TTL auto white balance Future releases will include: * better colour correction * ability to read camera specific tags included in .kdc file Consider this version to be: Version 0.35(beta) 20040101 All of the contents of this package (except files from tifflib) are copyright by Chris Studholme and licenced under the FSF General Public Licence. See the file COPYING for details. To install, do: ./configure make make install This will install kdc2tiff and kdc2jpeg in /usr/local/bin. This software has been developed and tested on a Debian 3.0 GNU/Linux system. Any questions, comments, criticism, or bugs should be emailed to: chris.studholme@utoronto.ca The home page for this project is located at: http://kdc2tiff.sourceforge.net/ kdc2tiff-0.35/TODO0100644000175000017500000000155507775114325012017 0ustar cvscvsImmediate plans: * figure out why image quality is not as good as Kodak supplied tools * figure out appropriate colour correction (white balance) * write a light tiff library for reading KDC files * include support for other .kdc file formats (ie. from DC40/DC50) * write a kdctopnm tool for use with the netpbm package Old plans: * improve contrast enhancement (work with intensity, not individual colors) * optimize getScanLine*() in GImageComponent * write cropping filter * write red-eye reduction algorithm * decode format of files from known digital cameras (DC120 and CP950) * rewrite the gamma correction equations to use all integer math * make TIFF compression scheme work * make contrast enhancement and white balance work with all image types * make command line interface as similar as possible to 'convert' * update GFilter_Rotate to handle non-90 degree angles kdc2tiff-0.35/aclocal.m40100644000175000017500000001045707775115443013172 0ustar cvscvsdnl 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. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) kdc2tiff-0.35/config.h.in0100644000175000017500000000226207775115455013353 0ustar cvscvs/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `jpeg' library (-ljpeg). */ #undef HAVE_LIBJPEG /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `tiff' library (-ltiff). */ #undef HAVE_LIBTIFF /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif kdc2tiff-0.35/configure0100755000175000017500000044434307775115164013246 0ustar cvscvs#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.58. # # 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="kdc2tiff.cpp" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP CXX CXXFLAGS ac_ct_CXX LN_S EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 CXX C++ compiler command CXXFLAGS C++ compiler flags 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.58. 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_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftestfile ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest* echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed 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 PACKAGE=kdc2tiff VERSION=0.35 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF missing_dir=`cd $ac_aux_dir && pwd` echo "$as_me:$LINENO: checking for working aclocal" >&5 echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working autoconf" >&5 echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working automake" >&5 echo $ECHO_N "checking for working automake... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOMAKE="$missing_dir/missing automake" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working autoheader" >&5 echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working makeinfo" >&5 echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi ac_config_headers="$ac_config_headers config.h" ac_config_commands="$ac_config_commands default-1" for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done 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 ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=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 # 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 ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking for main in -lm" >&5 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_main+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. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_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_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=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_main" >&5 echo "${ECHO_T}$ac_cv_lib_m_main" >&6 if test $ac_cv_lib_m_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" else { { echo "$as_me:$LINENO: error: a math library is required" >&5 echo "$as_me: error: a math library is required" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for main in -ltiff" >&5 echo $ECHO_N "checking for main in -ltiff... $ECHO_C" >&6 if test "${ac_cv_lib_tiff_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_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_tiff_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_tiff_main=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_tiff_main" >&5 echo "${ECHO_T}$ac_cv_lib_tiff_main" >&6 if test $ac_cv_lib_tiff_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBTIFF 1 _ACEOF LIBS="-ltiff $LIBS" else { { echo "$as_me:$LINENO: error: libtiff is required" >&5 echo "$as_me: error: libtiff is required" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for main in -ljpeg" >&5 echo $ECHO_N "checking for main in -ljpeg... $ECHO_C" >&6 if test "${ac_cv_lib_jpeg_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_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_jpeg_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_jpeg_main=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_jpeg_main" >&5 echo "${ECHO_T}$ac_cv_lib_jpeg_main" >&6 if test $ac_cv_lib_jpeg_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBJPEG 1 _ACEOF LIBS="-ljpeg $LIBS" else { { echo "$as_me:$LINENO: error: jpeglib is required" >&5 echo "$as_me: error: jpeglib is required" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #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 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 #AC_ARG_ENABLE(kdctag,[Decode KDC specific tags], # [if test $enable_kdctag != "no"; then # AC_DEFINE_UNQUOTED(DECODE_KDCTAG,1) # XTIFF=xtif_dir.o # AC_SUBST(XTIFF) # fi],) ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${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.58. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.58, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # _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" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@AWK@,$AWK,;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,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@LN_S@,$LN_S,;t t s,@EGREP@,$EGREP,;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 # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi kdc2tiff-0.35/configure.in0100644000175000017500000000174407775115157013644 0ustar cvscvsdnl Process this file with autoconf to produce a configure script. AC_INIT(kdc2tiff.cpp) AM_INIT_AUTOMAKE(kdc2tiff,0.35) AM_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S dnl Checks for libraries. AC_CHECK_LIB(m,main,,AC_MSG_ERROR([a math library is required])) AC_CHECK_LIB(tiff,main,,AC_MSG_ERROR([libtiff is required])) AC_CHECK_LIB(jpeg,main,,AC_MSG_ERROR([jpeglib is required])) dnl Checks for header files. AC_HEADER_STDC dnl AC_CHECK_HEADERS(fcntl.h unistd.h math.h string.h sys/types.h stdio.h stdlib.h) dnl AC_CHECK_HEADERS(jpeglib.h tiffio.h tiffio.h tiffcomp.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE dnl Checks for library functions. dnl Check options #AC_ARG_ENABLE(kdctag,[Decode KDC specific tags], # [if test $enable_kdctag != "no"; then # AC_DEFINE_UNQUOTED(DECODE_KDCTAG,1) # XTIFF=xtif_dir.o # AC_SUBST(XTIFF) # fi],) AC_OUTPUT(Makefile) kdc2tiff-0.35/install-sh0100755000175000017500000001273607254244251013330 0ustar cvscvs#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" 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 kdc2tiff-0.35/kdc2tiff.cpp0100644000175000017500000003415207764444550013532 0ustar cvscvs#include #include #include #include #include #include #include #include #include #include extern "C" { #include } #include "OutputOptions.h" #include "GFile_TIFF.h" #include "GFile_JPEG.h" /* Program to convert .kdc images to .tif or .jpg format. The name of the * binary and/or the name of the output file are used to determine what * image format the output file will be in. * * Written by: Chris Studholme * Last Update: 6-Dec-2003 * Copyright: GPL (http://www.fsf.org/copyleft/gpl.html) */ //#define __SHOW_WHITE_BALANCE // global variables #define TO_TIFF_PROGNAME1 "kdc2tiff" #define TO_TIFF_PROGNAME2 "kdc2tif" #define TO_JPEG_PROGNAME1 "kdc2jpeg" #define TO_JPEG_PROGNAME2 "kdc2jpg" #define TO_TIFF_EXT1 ".tiff" #define TO_TIFF_EXT2 ".tif" #define TO_JPEG_EXT1 ".jpeg" #define TO_JPEG_EXT2 ".jpg" const char* progname=0; bool FileExists(const char* path) { struct stat sbuf; if (stat(path,&sbuf)==0) return true; if (errno==ENOENT) return false; fprintf(stderr,"error checking for file %s\n",path); exit(1); } TIFF* CreateTiffFile(OutputOptions& options) { TIFF* tiffimage = TIFFOpen(options.outputname,"w"); TIFFSetField(tiffimage,TIFFTAG_IMAGEWIDTH,(uint32)options.outputwidth); TIFFSetField(tiffimage,TIFFTAG_IMAGELENGTH,(uint32)options.outputheight); TIFFSetField(tiffimage,TIFFTAG_BITSPERSAMPLE,(uint16)8); TIFFSetField(tiffimage,TIFFTAG_SAMPLESPERPIXEL,(uint16)3); TIFFSetField(tiffimage,TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_RGB); TIFFSetField(tiffimage,TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT); TIFFSetField(tiffimage,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG); TIFFSetField(tiffimage,TIFFTAG_FILLORDER,FILLORDER_LSB2MSB); // this is not correct, should use options.compresstype TIFFSetField(tiffimage,TIFFTAG_COMPRESSION,COMPRESSION_NONE); if (options.rowsperstrip==0) { options.rowsperstrip=8192/3/options.outputwidth; if (options.rowsperstrip<1) options.rowsperstrip=1; } TIFFSetField(tiffimage,TIFFTAG_ROWSPERSTRIP,(uint32)options.rowsperstrip); TIFFSetField(tiffimage,TIFFTAG_RESOLUTIONUNIT,RESUNIT_CENTIMETER); // print approx. 20cm x 15cm TIFFSetField(tiffimage,TIFFTAG_XRESOLUTION,(float)options.outputwidth/20); TIFFSetField(tiffimage,TIFFTAG_YRESOLUTION,(float)options.outputwidth/20); if (options.kdcfile) { if (options.kdcfile->ImageDescription!=NULL) TIFFSetField(tiffimage,TIFFTAG_DOCUMENTNAME, options.kdcfile->ImageDescription); if (options.kdcfile->DateTime!=NULL) TIFFSetField(tiffimage,TIFFTAG_DATETIME,options.kdcfile->DateTime); if (options.kdcfile->Make!=NULL) TIFFSetField(tiffimage,TIFFTAG_MAKE,options.kdcfile->Make); if (options.kdcfile->Model!=NULL) TIFFSetField(tiffimage,TIFFTAG_MODEL,options.kdcfile->Model); } // if (options.copyright!=NULL) // TIFFSetField(tiffimage,TIFFTAG_COPYRIGHT,options.copyright); // TIFFTAG_ARTIST 315 /* creator of image */ // TIFFTAG_HOSTCOMPUTER 316 /* machine where created */ // TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */ // TIFFTAG_SOFTWARE 305 /* name & release */ return tiffimage; } void WriteTiffImage(OutputOptions& options) { TIFF* tiffimage = CreateTiffFile(options); unsigned char rgb[options.outputwidth*3]; #ifdef __SHOW_WHITE_BALANCE unsigned long rmean=0; unsigned long gmean=0; unsigned long bmean=0; #endif // create image for (int y=0; yDateTime?strlen(options.kdcfile->DateTime):0) + (options.kdcfile->Model?strlen(options.kdcfile->Model):0) + (options.copyright?strlen(options.copyright):0); char* comment_text = new char[len_needed]; *comment_text=0; if (options.kdcfile->Model) { strcat(comment_text,"Model: "); strcat(comment_text,options.kdcfile->Model); strcat(comment_text,"\n"); } if (options.kdcfile->DateTime) { strcat(comment_text,"DateTime: "); strcat(comment_text,options.kdcfile->DateTime); } if (options.copyright) { strcat(comment_text,"\n"); strcat(comment_text,"Copyright: "); strcat(comment_text,options.copyright); } jpeg_write_marker(&cinfo, JPEG_COM, (const JOCTET*) comment_text, strlen(comment_text)); } unsigned char rgb[options.outputwidth*3]; JSAMPROW row_pointer[1]; row_pointer[0] = rgb; // create image for (int y=0; y0) { options.outputname = *argv++; --argc; } return argv; } main (int argc, char*argv[]) { // set program name progname = *argv++; --argc; if (strrchr(progname,'/')!=NULL) progname=strrchr(progname,'/')+1; // global options OutputOptions globaloptions; argv = ParseGlobalOptions(globaloptions, argc, argv); if (argv==0) { Usage(); return 1; } // read a little input file to figure out what it is FILE* input = fopen(globaloptions.inputname,"r"); if (input==NULL) { fprintf(stderr,"failed to open input file %s\n",globaloptions.inputname); return 1; } const char* inputfile = strrchr(globaloptions.inputname,'/'); inputfile = inputfile ? ++inputfile : globaloptions.inputname; // check file type if (GFile_JPEG::supportsFile(input)) { fprintf(stderr,"Reading JPEG file %s...\n",inputfile); globaloptions.srcimage = new GFile_JPEG(globaloptions.inputname,globaloptions.fastdebayer); } else if (GFile_TIFF::supportsFile(input)) { // check for DC120 file if (GFile_DC120::supportsFile(input)) { KDCFile* kdcfile = new KDCFile(globaloptions.inputname); if (!kdcfile->isOK()) { fprintf(stderr,"error reading input file %s\n",globaloptions.inputname); return 1; } fprintf(stderr,"Reading KDC file %s from DC120...\n",inputfile); fprintf(stderr," Description: %s\n",kdcfile->ImageDescription); fprintf(stderr," DateTime: %s\n",kdcfile->DateTime); fprintf(stderr," Make: %s\n",kdcfile->Make); fprintf(stderr," Model: %s\n",kdcfile->Model); fprintf(stderr," Software: %s\n",kdcfile->Software); globaloptions.kdcfile = kdcfile; globaloptions.srcimage = new GFile_DC120(*kdcfile,globaloptions.fastdebayer); } // standard TIFF file else { fprintf(stderr,"Reading TIFF file %s...\n",inputfile); globaloptions.srcimage = new GFile_TIFF(globaloptions.inputname,globaloptions.fastdebayer); } } else { fprintf(stderr,"unrecognized image format\n"); fclose(input); return 1; } fclose(input); if (!globaloptions.srcimage->isOK()) { fprintf(stderr,"error reading input file %s\n",globaloptions.inputname); return 1; } // grain reduction messes with the source image (hence: global only option) if (globaloptions.grainreduction) { bool extra=globaloptions.grainreduction>1; fprintf(stderr,"Reducing image graininess%s... ",extra?" (extra)":""); int count = globaloptions.srcimage->ReduceGrain(extra); int totalpixels = globaloptions.srcimage->getWidth()*globaloptions.srcimage->getHeight(); fprintf(stderr,"%.1f%% grain... done.\n",((float)count*100)/totalpixels); } // parse local options and write output files do { fprintf(stderr,"\n"); OutputOptions options(globaloptions); argv = ParseLocalOptions(options, argc, argv); if (argv==0) { Usage(); return 1; } const char* outputextension = options.outputname ? strrchr(options.outputname,'.') : 0; // figure out if we are to output TIFF or JPEG if ((strcasecmp(progname,TO_TIFF_PROGNAME1)==0)|| (strcasecmp(progname,TO_TIFF_PROGNAME2)==0)) options.outputtiff=true; else if ((strcasecmp(progname,TO_JPEG_PROGNAME1)==0)|| (strcasecmp(progname,TO_JPEG_PROGNAME2)==0)) options.outputjpeg=true; else if ((outputextension)&& ((strcasecmp(outputextension,TO_TIFF_EXT1)==0)|| (strcasecmp(outputextension,TO_TIFF_EXT2)==0))) options.outputtiff=true; else if ((outputextension)&& ((strcasecmp(outputextension,TO_JPEG_EXT1)==0)|| (strcasecmp(outputextension,TO_JPEG_EXT2)==0))) options.outputjpeg=true; else if ((options.compresstype)||(options.rowsperstrip)) options.outputtiff=true; else if (options.quality!=DEFAULT_JPEG_QUALITY) options.outputjpeg=true; else { fprintf(stderr,"\nCannot figure out whether to write a TIFF or JPEG. Please name the binary\none of: %s, %s, %s or %s;",TO_TIFF_PROGNAME1,TO_TIFF_PROGNAME2,TO_JPEG_PROGNAME1,TO_JPEG_PROGNAME2); fprintf(stderr," set an output filename with\nan extension of one of: %s, %s, %s or %s; or set a TIFF specific\nor JPEG specific option.\n\n",TO_TIFF_EXT1,TO_TIFF_EXT2,TO_JPEG_EXT1,TO_JPEG_EXT2); return 1; } options.SetOutputParameters(); options.SetOutputFilename(); const char* outputfile = strrchr(options.outputname,'/'); outputfile = outputfile ? ++outputfile : options.outputname; // do not overwrite destination unless "-o" was specified if (!options.overwrite && FileExists(options.outputname)) { fprintf(stderr,"NO OUTPUT WRITTEN!\n"); fprintf(stderr,"output file '%s' exists and -o not specified\n", options.outputname); continue; } // write output image if (options.outputtiff) { fprintf(stderr,"Writing TIFF file %s... ",outputfile); WriteTiffImage(options); fprintf(stderr,"done.\n"); } else if (options.outputjpeg) { fprintf(stderr,"Writing JPEG file %s... ",outputfile); WriteJpegImage(options); fprintf(stderr,"done.\n"); } else fprintf(stderr,"NO OUTPUT WRITTEN!\n"); } while (argc>0); // clean up delete globaloptions.srcimage; delete globaloptions.kdcfile; return 0; } kdc2tiff-0.35/missing0100755000175000017500000001421307254244251012713 0ustar cvscvs#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 kdc2tiff-0.35/mkinstalldirs0100755000175000017500000000132107254247644014127 0ustar cvscvs#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.6 2001/03/15 23:26:28 cvs Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here kdc2tiff-0.35/stamp-h.in0100644000175000017500000000001207775115455013220 0ustar cvscvstimestamp kdc2tiff-0.35/xtif_dir.c0100644000175000017500000003512307254247644013304 0ustar cvscvs/* * xtif_dir.c * * Extended TIFF Directory Tag Support. * * You may use this file as a template to add your own * extended tags to the library. Only the parts of the code * marked with "XXX" require modification. Three example tags * are shown; you should replace them with your own. * * Author: Niles D. Ritter */ #include #include #include "xtiffiop.h" /* Tiff info structure. * * Entry format: * { TAGNUMBER, ReadCount, WriteCount, DataType, FIELDNUM, * OkToChange, PassDirCountOnSet, AsciiName } * * For ReadCount, WriteCount, -1 = unknown; used for mult-valued * tags and ASCII. */ static const TIFFFieldInfo xtiffFieldInfo[] = { { TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, FIELD_33432, TRUE, FALSE, "copyright" }, { TIFFTAG_KDC_33423, -1, -1, TIFF_ASCII, FIELD_33423, TRUE, FALSE, "kdc_33423" }, { TIFFTAG_KDC_33424, 1, -1, TIFF_LONG, FIELD_33424, TRUE, FALSE, "kdc_33424" }, { TIFFTAG_KDC_33434, 1, -1, TIFF_RATIONAL, FIELD_33434, TRUE, FALSE, "kdc_33434" }, { TIFFTAG_KDC_33437, 1, -1, TIFF_RATIONAL, FIELD_33437, TRUE, FALSE, "kdc_33437" }, { TIFFTAG_KDC_34850, 1, -1, TIFF_SHORT, FIELD_34850, TRUE, FALSE, "kdc_34850" }, { TIFFTAG_KDC_34859, 1, -1, TIFF_SHORT, FIELD_34859, TRUE, FALSE, "kdc_34859" }, { TIFFTAG_KDC_DATETIME, -1, -1, TIFF_ASCII, FIELD_36867, TRUE, FALSE, "kdc_datetime" }, { TIFFTAG_KDC_37382, -1, -1, TIFF_RATIONAL, FIELD_37382, TRUE, FALSE, "kdc_37382" }, { TIFFTAG_KDC_37385, 1, -1, TIFF_SHORT, FIELD_37385, TRUE, FALSE, "kdc_37385" }, { TIFFTAG_KDC_37386, 1, -1, TIFF_RATIONAL, FIELD_37386, TRUE, FALSE, "kdc_37386" }, { TIFFTAG_KDC_37393, 1, -1, TIFF_SHORT, FIELD_37393, TRUE, FALSE, "kdc_37393" }, { TIFFTAG_KDC_37398, 4, -1, TIFF_BYTE, FIELD_37398, TRUE, FALSE, "kdc_37398" }, { TIFFTAG_KDC_37399, 1, -1, TIFF_SHORT, FIELD_37399, TRUE, FALSE, "kdc_37399" }, { TIFFTAG_KDC_33421, 2, -1, TIFF_SHORT, FIELD_33421, TRUE, FALSE, "kdc_33421" }, { TIFFTAG_KDC_33422, 4, -1, TIFF_BYTE, FIELD_33422, TRUE, FALSE, "kdc_33422" }, { TIFFTAG_KDC_37122, -1, -1, TIFF_RATIONAL, FIELD_37122, TRUE, FALSE, "kdc_37122" }, { TIFFTAG_KDC_37400, 12, -1, TIFF_SRATIONAL, FIELD_37400, TRUE, FALSE, "kdc_37400" } }; #define N(a) (sizeof (a) / sizeof (a[0])) static void _XTIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) { xtiff *xt = XTIFFDIR(tif); XTIFFDirectory *xd = &xt->xtif_dir; /* call the inherited method */ if (PARENT(xt,printdir)) (PARENT(xt,printdir))(tif,fd,flags); /* XXX Add field printing here. Replace the three example * tags implemented below with your own. */ if (TIFFFieldSet(tif,FIELD_33432)) { _TIFFprintAsciiTag(fd,"Copyright",xd->xd_copyright); } fprintf(fd,"--KDC Specific Tags--\n"); if (TIFFFieldSet(tif,FIELD_33423)) { _TIFFprintAsciiTag(fd,"Battery Status",xd->xd_kdc_33423); } if (TIFFFieldSet(tif,FIELD_36867)) { _TIFFprintAsciiTag(fd,"Date & Time",xd->xd_kdc_36867); } if (TIFFFieldSet(tif,FIELD_33424)) { fprintf(fd," 33424: %ld\n", xd->xd_kdc_33424); } if (TIFFFieldSet(tif,FIELD_33434)) { fprintf(fd," 33434: %ld/%ld\n", xd->xd_kdc_33434[0],xd->xd_kdc_33434[1]); } if (TIFFFieldSet(tif,FIELD_33437)) { fprintf(fd," 33437: %ld/%ld\n", xd->xd_kdc_33437[0],xd->xd_kdc_33437[1]); } if (TIFFFieldSet(tif,FIELD_34850)) { fprintf(fd," 34850: %d\n", xd->xd_kdc_34850); } if (TIFFFieldSet(tif,FIELD_34859)) { fprintf(fd," 34859: %d\n", xd->xd_kdc_34859); } if (TIFFFieldSet(tif,FIELD_37382)) { // fprintf(fd," 37382: %ld/%ld\n", xd->xd_kdc_37382[0],xd->xd_kdc_37382[1]); } if (TIFFFieldSet(tif,FIELD_37385)) { fprintf(fd," 37385: %d\n", xd->xd_kdc_37385); } if (TIFFFieldSet(tif,FIELD_37386)) { // fprintf(fd," 37386: %ld/%ld\n", xd->xd_kdc_37386[0],xd->xd_kdc_37386[1]); } if (TIFFFieldSet(tif,FIELD_37393)) { fprintf(fd," 37393: %d\n", xd->xd_kdc_37393); } if (TIFFFieldSet(tif,FIELD_37398)) { unsigned char* u = (unsigned char*)xd->xd_kdc_37398; fprintf(fd," 37398: %d %d %d %d\n", u[0],u[1],u[2],u[3]); } if (TIFFFieldSet(tif,FIELD_37399)) { fprintf(fd," 37399: %d\n", xd->xd_kdc_37399); } if (TIFFFieldSet(tif,FIELD_33421)) { fprintf(fd," 33421: %d %d\n", xd->xd_kdc_33421[0],xd->xd_kdc_33421[1]); } if (TIFFFieldSet(tif,FIELD_33422)) { unsigned char* u = (unsigned char*)xd->xd_kdc_33422; fprintf(fd," 33422: %d %d %d %d\n", u[0],u[1],u[2],u[3]); } if (TIFFFieldSet(tif,FIELD_37122)) { // fprintf(fd," 37122: %d\n", xd->xd_kdc_37122); } if (TIFFFieldSet(tif,FIELD_37400)) { fprintf(fd," 37400: %ld/%ld\n", xd->xd_kdc_37400[0],xd->xd_kdc_37400[1]); } } static int _XTIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) { xtiff *xt = XTIFFDIR(tif); XTIFFDirectory* xd = &xt->xtif_dir; int status = 1; /*uint32 v32=0; int v=0;*/ /*va_list ap1 = ap;*/ //fprintf(stderr,"_XTIFFVSetField() entered %d\n",tag); /* va_start is called by the calling routine */ switch (tag) { /* * XXX put your extended tags here; replace the implemented * example tags with your own. */ case TIFFTAG_KDC_33423: /*(0x828f) ASCII (2) 6*/ _TIFFsetString(&xd->xd_kdc_33423, va_arg(ap, char*)); break; case TIFFTAG_KDC_33424: /*(0x8290) LONG (4) 1<1002>*/ xd->xd_kdc_33424 = va_arg(ap, uint32); break; case TIFFTAG_KDC_33434: /*(0x829a) RATIONAL (5) 1<0.01069>*/ // _TIFFsetLongArray(&xd->xd_kdc_33434, va_arg(ap, uint32*),2); break; case TIFFTAG_KDC_33437: /*(0x829d) RATIONAL (5) 1<2.5>*/ // _TIFFsetLongArray(&xd->xd_kdc_33437, va_arg(ap, uint32*),2); break; case TIFFTAG_KDC_34850: /*(0x8822) SHORT (3) 1<2>*/ xd->xd_kdc_34850 = va_arg(ap, uint16); break; case TIFFTAG_KDC_34859: /*(0x882b) SHORT (3) 1<0>*/ xd->xd_kdc_34859 = va_arg(ap, uint16); break; case TIFFTAG_KDC_DATETIME: /*(0x9003) ASCII (2) 20<1994:03:25 00:00:25\0>*/ _TIFFsetString(&xd->xd_kdc_36867, va_arg(ap, char*)); break; case TIFFTAG_KDC_37382: /*(0x9206) RATIONAL (5) 1<0.7>*/ // _TIFFsetLongArray(&xd->xd_kdc_37382, va_arg(ap, uint32*),2); break; case TIFFTAG_KDC_37385: /*(0x9209) SHORT (3) 1<31>*/ xd->xd_kdc_37385 = va_arg(ap, uint16); break; case TIFFTAG_KDC_37386: /*(0x920a) RATIONAL (5) 1<100>*/ // _TIFFsetLongArray(&xd->xd_kdc_37386, va_arg(ap, uint32*),2); break; case TIFFTAG_KDC_37393: /*(0x9211) SHORT (3) 1<1>*/ xd->xd_kdc_37393 = va_arg(ap, uint16); break; case TIFFTAG_KDC_37398: /*(0x9216) BYTE (1) 4<00 00 00 0x1>*/ _TIFFsetByteArray(&xd->xd_kdc_37398, va_arg(ap, void*),4); break; case TIFFTAG_KDC_37399: /*(0x9217) SHORT (3) 1<2>*/ xd->xd_kdc_37399 = va_arg(ap, uint16); break; case TIFFTAG_KDC_33421: /*(0x828d) SHORT (3) 2<2 2>*/ _TIFFsetShortArray(&xd->xd_kdc_33421, va_arg(ap, uint16*),2); break; case TIFFTAG_KDC_33422: /*(0x828e) BYTE (1) 4<0x1 0x2 00 0x1>*/ _TIFFsetByteArray(&xd->xd_kdc_33422, va_arg(ap, void*),4); break; case TIFFTAG_KDC_37122: /*(0x9102) RATIONAL (5) 1<0.75>*/ // _TIFFsetLongArray(&xd->xd_kdc_37122, va_arg(ap, uint32*),2); break; case TIFFTAG_KDC_37400: /*(0x9218) SRATIONAL (10) 12<0 -2.02926 1.04202*/ // _TIFFsetLongArray(&xd->xd_kdc_37400, va_arg(ap, uint32*),24); break; case TIFFTAG_COPYRIGHT: _TIFFsetString(&xd->xd_copyright, va_arg(ap, char*)); break; default: /* call the inherited method */ return (PARENT(xt,vsetfield))(tif,tag,ap); break; } if (status) { /* we have to override the print method here, * after the compression tags have gotten to it. * This makes sense because the only time we would * need the extended print method is if an extended * tag is set by the reader. */ if (!(xt->xtif_flags & XTIFFP_PRINT)) { PARENT(xt,printdir) = TIFFMEMBER(tif,printdir); TIFFMEMBER(tif,printdir) = _XTIFFPrintDirectory; xt->xtif_flags |= XTIFFP_PRINT; } TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit); tif->tif_flags |= TIFF_DIRTYDIRECT; } va_end(ap); return (status); /* badvalue: TIFFError(tif->tif_name, "%d: Bad value for \"%s\"", v, _TIFFFieldWithTag(tif, tag)->field_name); va_end(ap); return (0); badvalue32: TIFFError(tif->tif_name, "%ld: Bad value for \"%s\"", v32, _TIFFFieldWithTag(tif, tag)->field_name); va_end(ap); return (0); */ } static int _XTIFFVGetField(TIFF* tif, ttag_t tag, va_list ap) { xtiff *xt = XTIFFDIR(tif); XTIFFDirectory* xd = &xt->xtif_dir; switch (tag) { /* * XXX put your extended tags here; replace the implemented * example tags with your own. */ case TIFFTAG_KDC_33423: /*(0x828f) ASCII (2) 6*/ *va_arg(ap, char**) = xd->xd_kdc_33423; break; case TIFFTAG_KDC_33424: /*(0x8290) LONG (4) 1<1002>*/ *va_arg(ap, uint32*) = xd->xd_kdc_33424; break; case TIFFTAG_KDC_33434: /*(0x829a) RATIONAL (5) 1<0.01069>*/ *va_arg(ap, uint32**) = xd->xd_kdc_33434; break; case TIFFTAG_KDC_33437: /*(0x829d) RATIONAL (5) 1<2.5>*/ *va_arg(ap, uint32**) = xd->xd_kdc_33437; break; case TIFFTAG_KDC_34850: /*(0x8822) SHORT (3) 1<2>*/ *va_arg(ap, uint16*) = xd->xd_kdc_34850; break; case TIFFTAG_KDC_34859: /*(0x882b) SHORT (3) 1<0>*/ *va_arg(ap, uint16*) = xd->xd_kdc_34859; break; case TIFFTAG_KDC_DATETIME: /*(0x9003) ASCII (2) 20<1994:03:25 00:00:25\0>*/ *va_arg(ap, char**) = xd->xd_kdc_36867; break; case TIFFTAG_KDC_37382: /*(0x9206) RATIONAL (5) 1<0.7>*/ *va_arg(ap, uint32**) = xd->xd_kdc_37382; break; case TIFFTAG_KDC_37385: /*(0x9209) SHORT (3) 1<31>*/ *va_arg(ap, uint16*) = xd->xd_kdc_37385; break; case TIFFTAG_KDC_37386: /*(0x920a) RATIONAL (5) 1<100>*/ *va_arg(ap, uint32**) = xd->xd_kdc_37386; break; case TIFFTAG_KDC_37393: /*(0x9211) SHORT (3) 1<1>*/ *va_arg(ap, uint16*) = xd->xd_kdc_37393; break; case TIFFTAG_KDC_37398: /*(0x9216) BYTE (1) 4<00 00 00 0x1>*/ *va_arg(ap, void**) = xd->xd_kdc_37398; break; case TIFFTAG_KDC_37399: /*(0x9217) SHORT (3) 1<2>*/ *va_arg(ap, uint16*) = xd->xd_kdc_37399; break; case TIFFTAG_KDC_33421: /*(0x828d) SHORT (3) 2<2 2>*/ *va_arg(ap, uint16**) = xd->xd_kdc_33421; break; case TIFFTAG_KDC_33422: /*(0x828e) BYTE (1) 4<0x1 0x2 00 0x1>*/ *va_arg(ap, void**) = xd->xd_kdc_33422; break; case TIFFTAG_KDC_37122: /*(0x9102) RATIONAL (5) 1<0.75>*/ *va_arg(ap, uint32**) = xd->xd_kdc_37122; break; case TIFFTAG_KDC_37400: /*(0x9218) SRATIONAL (10) 12<0 -2.02926 1.04202*/ *va_arg(ap, uint32**) = xd->xd_kdc_37400; break; case TIFFTAG_COPYRIGHT: *va_arg(ap, char**) = xd->xd_copyright; break; default: /* return inherited method */ return (PARENT(xt,vgetfield))(tif,tag,ap); break; } return (1); } #define CleanupField(member) { \ if (xd->member) { \ _TIFFfree(xd->member); \ xd->member = 0; \ } \ } /* * Release storage associated with a directory. */ static void _XTIFFFreeDirectory(xtiff* xt) { XTIFFDirectory* xd = &xt->xtif_dir; /* * XXX - Purge all Your allocated memory except * for the xtiff directory itself. This includes * all fields that require a _TIFFsetXXX call in * _XTIFFVSetField(). */ CleanupField(xd_kdc_33423); CleanupField(xd_kdc_33434); /* RATIONAL */ CleanupField(xd_kdc_33437); /* RATIONAL */ CleanupField(xd_kdc_36867); CleanupField(xd_kdc_37382); /* RATIONAL */ CleanupField(xd_kdc_37386); /* RATIONAL */ CleanupField(xd_kdc_37398); CleanupField(xd_kdc_33421); CleanupField(xd_kdc_33422); CleanupField(xd_kdc_37122); /* RATIONAL */ CleanupField(xd_kdc_37400); /* 24 x SRATIONAL */ CleanupField(xd_copyright); } #undef CleanupField static void _XTIFFLocalDefaultDirectory(TIFF *tif) { xtiff *xt = XTIFFDIR(tif); /*XTIFFDirectory* xd = &xt->xtif_dir;*/ /* Install the extended Tag field info */ _TIFFMergeFieldInfo(tif, xtiffFieldInfo, N(xtiffFieldInfo)); /* * free up any dynamically allocated arrays * before the new directory is read in. */ _XTIFFFreeDirectory(xt); _TIFFmemset(xt,0,sizeof(xtiff)); /* Override the tag access methods */ PARENT(xt,vsetfield) = TIFFMEMBER(tif,vsetfield); TIFFMEMBER(tif,vsetfield) = _XTIFFVSetField; PARENT(xt,vgetfield) = TIFFMEMBER(tif,vgetfield); TIFFMEMBER(tif,vgetfield) = _XTIFFVGetField; /* * XXX Set up any default values here. */ } /********************************************************************** * Nothing below this line should need to be changed. **********************************************************************/ static TIFFExtendProc _ParentExtender; /* * This is the callback procedure, and is * called by the DefaultDirectory method * every time a new TIFF directory is opened. */ static void _XTIFFDefaultDirectory(TIFF *tif) { xtiff *xt; /* Allocate Directory Structure if first time, and install it */ if (!(tif->tif_flags & XTIFF_INITIALIZED)) { xt = _TIFFmalloc(sizeof(xtiff)); if (!xt) { /* handle memory allocation failure here ! */ return; } _TIFFmemset(xt,0,sizeof(xtiff)); /* * Install into TIFF structure. */ TIFFMEMBER(tif,clientdir) = (tidata_t)xt; tif->tif_flags |= XTIFF_INITIALIZED; /* dont do this again! */ } /* set up our own defaults */ _XTIFFLocalDefaultDirectory(tif); /* Since an XTIFF client module may have overridden * the default directory method, we call it now to * allow it to set up the rest of its own methods. */ if (_ParentExtender) (*_ParentExtender)(tif); } /* * XTIFF Initializer -- sets up the callback * procedure for the TIFF module. */ static void _XTIFFInitialize(void) { static int first_time=1; if (! first_time) return; /* Been there. Done that. */ first_time = 0; /* Grab the inherited method and install */ _ParentExtender = TIFFSetTagExtender(_XTIFFDefaultDirectory); } /* * Public File I/O Routines. */ TIFF* XTIFFOpen(const char* name, const char* mode) { /* Set up the callback */ _XTIFFInitialize(); /* Open the file; the callback will set everything up */ return TIFFOpen(name, mode); } TIFF* XTIFFFdOpen(int fd, const char* name, const char* mode) { /* Set up the callback */ _XTIFFInitialize(); /* Open the file; the callback will set everything up */ return TIFFFdOpen(fd, name, mode); } void XTIFFClose(TIFF *tif) { xtiff *xt = XTIFFDIR(tif); /* call inherited function first */ TIFFClose(tif); /* Free up extended allocated memory */ _XTIFFFreeDirectory(xt); _TIFFfree(xt); } kdc2tiff-0.35/xtiffio.h0100644000175000017500000000452307254243227013142 0ustar cvscvs/* * xtiffio.h -- Public interface to Extended TIFF tags * * This is a template for defining a client module * which supports tag extensions to the standard libtiff * set. Only portions of the code marked "XXX" need to * be changed to support your tag set. * * written by: Niles D. Ritter */ #ifndef __xtiffio_h #define __xtiffio_h #include "tiffio.h" /* * KDC specific tags */ #define TIFFTAG_KDC_33423 33423 /*(0x828f) ASCII (2) 6*/ #define TIFFTAG_KDC_33424 33424 /*(0x8290) LONG (4) 1<1002>*/ #define TIFFTAG_KDC_33434 33434 /*(0x829a) RATIONAL (5) 1<0.01069>*/ #define TIFFTAG_KDC_33437 33437 /*(0x829d) RATIONAL (5) 1<2.5>*/ #define TIFFTAG_KDC_34850 34850 /*(0x8822) SHORT (3) 1<2>*/ #define TIFFTAG_KDC_34859 34859 /*(0x882b) SHORT (3) 1<0>*/ #define TIFFTAG_KDC_DATETIME 36867 /*(0x9003) ASCII (2) 20<1994:03:25 00:00:25\0>*/ #define TIFFTAG_KDC_37382 37382 /*(0x9206) RATIONAL (5) 1<0.7>*/ #define TIFFTAG_KDC_37385 37385 /*(0x9209) SHORT (3) 1<31>*/ #define TIFFTAG_KDC_37386 37386 /*(0x920a) RATIONAL (5) 1<100>*/ #define TIFFTAG_KDC_37393 37393 /*(0x9211) SHORT (3) 1<1>*/ #define TIFFTAG_KDC_37398 37398 /*(0x9216) BYTE (1) 4<00 00 00 0x1>*/ #define TIFFTAG_KDC_37399 37399 /*(0x9217) SHORT (3) 1<2>*/ #define TIFFTAG_KDC_33421 33421 /*(0x828d) SHORT (3) 2<2 2>*/ #define TIFFTAG_KDC_33422 33422 /*(0x828e) BYTE (1) 4<0x1 0x2 00 0x1>*/ #define TIFFTAG_KDC_37122 37122 /*(0x9102) RATIONAL (5) 1<0.75>*/ #define TIFFTAG_KDC_37400 37400 /*(0x9218) SRATIONAL (10) 12<0 -2.02926 1.04202 -0.824892 0 -1.4279 5.95526 -0.572662 0 -0.4228*/ /* * XXX Define Printing method flags. These * flags may be passed in to TIFFPrintDirectory() to * indicate that those particular field values should * be printed out in full, rather than just an indicator * of whether they are present or not. */ /*#define TIFFPRINT_MYMULTIDOUBLES 0x80000000*/ /********************************************************************** * Nothing below this line should need to be changed by the user. **********************************************************************/ #if defined(__cplusplus) extern "C" { #endif extern TIFF* XTIFFOpen(const char* name, const char* mode); extern TIFF* XTIFFFdOpen(int fd, const char* name, const char* mode); extern void XTIFFClose(TIFF *tif); #if defined(__cplusplus) } #endif #endif /* __xtiffio_h */ kdc2tiff-0.35/xtiffiop.h0100644000175000017500000000546707254243227013332 0ustar cvscvs/* * Private Extended TIFF library interface. * * uses private LIBTIFF interface. * * The portions of this module marked "XXX" should be * modified to support your tags instead. * * written by: Niles D. Ritter * */ #ifndef __xtiffiop_h #define __xtiffiop_h #include "tiffiop.h" #include "xtiffio.h" /********************************************************************** * User Configuration **********************************************************************/ /* XXX - Define number of your extended tags here */ #define NUM_XFIELD 18 #define XFIELD_BASE (FIELD_LAST-NUM_XFIELD) /* XXX - Define your Tag Fields here */ #define FIELD_33423 (XFIELD_BASE+0) #define FIELD_33424 (XFIELD_BASE+1) #define FIELD_33434 (XFIELD_BASE+2) #define FIELD_33437 (XFIELD_BASE+3) #define FIELD_34850 (XFIELD_BASE+4) #define FIELD_34859 (XFIELD_BASE+5) #define FIELD_36867 (XFIELD_BASE+6) #define FIELD_37382 (XFIELD_BASE+7) #define FIELD_37385 (XFIELD_BASE+8) #define FIELD_37386 (XFIELD_BASE+9) #define FIELD_37393 (XFIELD_BASE+10) #define FIELD_37398 (XFIELD_BASE+11) #define FIELD_37399 (XFIELD_BASE+12) #define FIELD_33421 (XFIELD_BASE+13) #define FIELD_33422 (XFIELD_BASE+14) #define FIELD_37122 (XFIELD_BASE+15) #define FIELD_37400 (XFIELD_BASE+16) #define FIELD_33432 (XFIELD_BASE+17) /* XXX - Define Private directory tag structure here */ struct XTIFFDirectory { char* xd_copyright; char* xd_kdc_33423; uint32 xd_kdc_33424; uint32* xd_kdc_33434; /* RATIONAL */ uint32* xd_kdc_33437; /* RATIONAL */ uint16 xd_kdc_34850; uint16 xd_kdc_34859; char* xd_kdc_36867; uint32* xd_kdc_37382; /* RATIONAL */ uint16 xd_kdc_37385; uint32* xd_kdc_37386; /* RATIONAL */ uint16 xd_kdc_37393; void* xd_kdc_37398; uint16 xd_kdc_37399; uint16* xd_kdc_33421; void* xd_kdc_33422; uint32* xd_kdc_37122; /* RATIONAL */ uint32* xd_kdc_37400; /* 24 x SRATIONAL */ }; typedef struct XTIFFDirectory XTIFFDirectory; /********************************************************************** * Nothing below this line should need to be changed by the user. **********************************************************************/ struct xtiff { TIFF *xtif_tif; /* parent TIFF pointer */ uint32 xtif_flags; #define XTIFFP_PRINT 0x00000001 XTIFFDirectory xtif_dir; /* internal rep of current directory */ TIFFVSetMethod xtif_vsetfield; /* inherited tag set routine */ TIFFVGetMethod xtif_vgetfield; /* inherited tag get routine */ TIFFPrintMethod xtif_printdir; /* inherited dir print method */ }; typedef struct xtiff xtiff; #define PARENT(xt,pmember) ((xt)->xtif_ ## pmember) #define TIFFMEMBER(tf,pmember) ((tf)->tif_ ## pmember) #define XTIFFDIR(tif) ((xtiff *)TIFFMEMBER(tif,clientdir)) /* Extended TIFF flags */ #define XTIFF_INITIALIZED 0x80000000 #endif /* __xtiffiop_h */