Changeset 283 for trunk


Ignore:
Timestamp:
Jan 4, 2010, 8:20:18 PM (11 years ago)
Author:
rbri
Message:

JPEG plugin: libjpeg updated to version 7

Location:
trunk/libjpeg
Files:
18 deleted
90 edited

Legend:

Unmodified
Added
Removed
  • trunk/libjpeg/README

    r15 r283  
    22==========================================
    33
    4 README for release 6b of 27-Mar-1998
    5 ====================================
    6 
    7 This distribution contains the sixth public release of the Independent JPEG
     4README for release 7 of 27-Jun-2009
     5===================================
     6
     7This distribution contains the seventh public release of the Independent JPEG
    88Group's free JPEG software.  You are welcome to redistribute this software and
    99to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
    1010
    11 Serious users of this software (particularly those incorporating it into
    12 larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to
    13 our electronic mailing list.  Mailing list members are notified of updates
    14 and have a chance to participate in technical discussions, etc.
    15 
    16 This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
    17 Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
    18 Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
    19 Group.
     11This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
     12Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
     13Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
     14and other members of the Independent JPEG Group.
    2015
    2116IJG is not affiliated with the official ISO JPEG standards committee.
     
    3126REFERENCES          Where to learn more about JPEG.
    3227ARCHIVE LOCATIONS   Where to find newer versions of this software.
    33 RELATED SOFTWARE    Other stuff you should get.
     28ACKNOWLEDGMENTS     Special thanks.
    3429FILE FORMAT WARS    Software *not* to get.
    3530TO DO               Plans for future IJG releases.
     
    3833
    3934User documentation:
    40   install.doc       How to configure and install the IJG software.
    41   usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
     35  install.txt       How to configure and install the IJG software.
     36  usage.txt         Usage instructions for cjpeg, djpeg, jpegtran,
    4237                    rdjpgcom, and wrjpgcom.
    43   *.1               Unix-style man pages for programs (same info as usage.doc).
    44   wizard.doc        Advanced usage instructions for JPEG wizards only.
     38  *.1               Unix-style man pages for programs (same info as usage.txt).
     39  wizard.txt        Advanced usage instructions for JPEG wizards only.
    4540  change.log        Version-to-version change highlights.
    4641Programmer and internal documentation:
    47   libjpeg.doc       How to use the JPEG library in your own programs.
     42  libjpeg.txt       How to use the JPEG library in your own programs.
    4843  example.c         Sample code for calling the JPEG library.
    49   structure.doc     Overview of the JPEG library's internal structure.
    50   filelist.doc      Road map of IJG files.
    51   coderules.doc     Coding style rules --- please read if you contribute code.
    52 
    53 Please read at least the files install.doc and usage.doc.  Useful information
     44  structure.txt     Overview of the JPEG library's internal structure.
     45  filelist.txt      Road map of IJG files.
     46  coderules.txt     Coding style rules --- please read if you contribute code.
     47
     48Please read at least the files install.txt and usage.txt.  Some information
    5449can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
    5550ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
     
    6358========
    6459
    65 This package contains C software to implement JPEG image compression and
    66 decompression.  JPEG (pronounced "jay-peg") is a standardized compression
    67 method for full-color and gray-scale images.  JPEG is intended for compressing
    68 "real-world" scenes; line drawings, cartoons and other non-realistic images
    69 are not its strong suit.  JPEG is lossy, meaning that the output image is not
    70 exactly identical to the input image.  Hence you must not use JPEG if you
    71 have to have identical output bits.  However, on typical photographic images,
    72 very good compression levels can be obtained with no visible change, and
    73 remarkably high compression levels are possible if you can tolerate a
    74 low-quality image.  For more details, see the references, or just experiment
    75 with various compression settings.
     60This package contains C software to implement JPEG image encoding, decoding,
     61and transcoding.  JPEG (pronounced "jay-peg") is a standardized compression
     62method for full-color and gray-scale images.
    7663
    7764This software implements JPEG baseline, extended-sequential, and progressive
    7865compression processes.  Provision is made for supporting all variants of these
    7966processes, although some uncommon parameter settings aren't implemented yet.
    80 For legal reasons, we are not distributing code for the arithmetic-coding
    81 variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
    82 the hierarchical or lossless processes defined in the standard.
     67We have made no provision for supporting the hierarchical or lossless
     68processes defined in the standard.
    8369
    8470We provide a set of library routines for reading and writing JPEG image files,
     
    9278decoding, but they are essential for output to colormapped file formats or
    9379colormapped displays.  These extra functions can be compiled out of the
    94 library if not required for a particular application.  We have also included
    95 "jpegtran", a utility for lossless transcoding between different JPEG
    96 processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
    97 inserting and extracting textual comments in JFIF files.
     80library if not required for a particular application.
     81
     82We have also included "jpegtran", a utility for lossless transcoding between
     83different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
     84applications for inserting and extracting textual comments in JFIF files.
    9885
    9986The emphasis in designing this software has been on achieving portability and
     
    128115its user, assume the entire risk as to its quality and accuracy.
    129116
    130 This software is copyright (C) 1991-1998, Thomas G. Lane.
     117This software is copyright (C) 1991-2009, Thomas G. Lane, Guido Vollbeding.
    131118All Rights Reserved except as specified below.
    132119
     
    171158It is copyright by the Free Software Foundation but is freely distributable.
    172159The same holds for its supporting scripts (config.guess, config.sub,
    173 ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
    174 by M.I.T. but is also freely distributable.
    175 
    176 It appears that the arithmetic coding option of the JPEG spec is covered by
    177 patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
    178 legally be used without obtaining one or more licenses.  For this reason,
    179 support for arithmetic coding has been removed from the free JPEG software.
    180 (Since arithmetic coding provides only a marginal gain over the unpatented
    181 Huffman mode, it is unlikely that very many implementations will support it.)
    182 So far as we are aware, there are no patent restrictions on the remaining
    183 code.
     160ltmain.sh).  Another support script, install-sh, is copyright by X Consortium
     161but is also freely distributable.
    184162
    185163The IJG distribution formerly included code to read and write GIF files.
     
    199177==========
    200178
    201 We highly recommend reading one or more of these references before trying to
     179We recommend reading one or more of these references before trying to
    202180understand the innards of the JPEG software.
    203181
     
    208186applications of JPEG, and related topics.)  If you don't have the CACM issue
    209187handy, a PostScript file containing a revised version of Wallace's article is
    210 available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
     188available at http://www.ijg.org/files/wallace.ps.gz.  The file (actually
    211189a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
    212190omits the sample images that appeared in CACM, but it includes corrections
     
    223201at a full implementation, you've got one here...
    224202
    225 The best full description of JPEG is the textbook "JPEG Still Image Data
    226 Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
    227 by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
    228 The book includes the complete text of the ISO JPEG standards (DIS 10918-1
    229 and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
    230 in existence, and we highly recommend it.
    231 
    232 The JPEG standard itself is not available electronically; you must order a
    233 paper copy through ISO or ITU.  (Unless you feel a need to own a certified
    234 official copy, we recommend buying the Pennebaker and Mitchell book instead;
    235 it's much cheaper and includes a great deal of useful explanatory material.)
    236 In the USA, copies of the standard may be ordered from ANSI Sales at (212)
    237 642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
    238 doesn't take credit card orders, but Global does.)  It's not cheap: as of
    239 1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
    240 shipping/handling.  The standard is divided into two parts, Part 1 being the
    241 actual specification, while Part 2 covers compliance testing methods.  Part 1
    242 is titled "Digital Compression and Coding of Continuous-tone Still Images,
     203The best currently available description of JPEG is the textbook "JPEG Still
     204Image Data Compression Standard" by William B. Pennebaker and Joan L.
     205Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
     206Price US$59.95, 638 pp.  The book includes the complete text of the ISO JPEG
     207standards (DIS 10918-1 and draft DIS 10918-2).
     208Although this is by far the most detailed and comprehensive exposition of
     209JPEG publicly available, we point out that it is still missing an explanation
     210of the most essential properties and algorithms of the underlying DCT
     211technology.
     212If you think that you know about DCT-based JPEG after reading this book,
     213then you are in delusion.  The real fundamentals and corresponding potential
     214of DCT-based JPEG are not publicly known so far, and that is the reason for
     215all the mistaken developments taking place in the image coding domain.
     216
     217The original JPEG standard is divided into two parts, Part 1 being the actual
     218specification, while Part 2 covers compliance testing methods.  Part 1 is
     219titled "Digital Compression and Coding of Continuous-tone Still Images,
    243220Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
    24422110918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
    245222Continuous-tone Still Images, Part 2: Compliance testing" and has document
    246223numbers ISO/IEC IS 10918-2, ITU-T T.83.
    247 
    248 Some extensions to the original JPEG standard are defined in JPEG Part 3,
    249 a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
    250 currently does not support any Part 3 extensions.
    251224
    252225The JPEG standard does not specify all details of an interchangeable file
     
    258231        Milpitas, CA 95035
    259232        phone (408) 944-6300,  fax (408) 944-6314
    260 A PostScript version of this document is available by FTP at
    261 ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
    262 version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
    263 the figures.
     233A PostScript version of this document is available at
     234http://www.ijg.org/files/jfif.ps.gz.  There is also a plain text version at
     235http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
    264236
    265237The TIFF 6.0 file format specification can be obtained by FTP from
     
    268240IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
    269241Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
    270 (Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
    271 from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
     242(Compression tag 7).  Copies of this Note can be obtained from
     243http://www.ijg.org/files/.  It is expected that the next revision
    272244of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
    273245Although IJG's own code does not support TIFF/JPEG, the free libtiff library
    274 uses our library to implement TIFF/JPEG per the Note.  libtiff is available
    275 from ftp://ftp.sgi.com/graphics/tiff/.
     246uses our library to implement TIFF/JPEG per the Note.
    276247
    277248
     
    279250=================
    280251
    281 The "official" archive site for this software is ftp.uu.net (Internet
    282 address 192.48.96.9).  The most recent released version can always be found
    283 there in directory graphics/jpeg.  This particular version will be archived
    284 as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
    285 direct Internet access, UUNET's archives are also available via UUCP; contact
    286 help@uunet.uu.net for information on retrieving files that way.
    287 
    288 Numerous Internet sites maintain copies of the UUNET files.  However, only
    289 ftp.uu.net is guaranteed to have the latest official version.
    290 
    291 You can also obtain this software in DOS-compatible "zip" archive format from
    292 the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
    293 on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
    294 "JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
    295 release.
    296 
    297 The JPEG FAQ (Frequently Asked Questions) article is a useful source of
    298 general information about JPEG.  It is updated constantly and therefore is
    299 not included in this distribution.  The FAQ is posted every two weeks to
    300 Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
     252The "official" archive site for this software is www.ijg.org.
     253The most recent released version can always be found there in
     254directory "files".  This particular version will be archived as
     255http://www.ijg.org/files/jpegsrc.v7.tar.gz, and in Windows-compatible
     256"zip" archive format as http://www.ijg.org/files/jpegsr7.zip.
     257
     258The JPEG FAQ (Frequently Asked Questions) article is a source of some
     259general information about JPEG.
    301260It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
    302261and other news.answers archive sites, including the official news.answers
     
    308267
    309268
    310 RELATED SOFTWARE
    311 ================
    312 
    313 Numerous viewing and image manipulation programs now support JPEG.  (Quite a
    314 few of them use this library to do so.)  The JPEG FAQ described above lists
    315 some of the more popular free and shareware viewers, and tells where to
    316 obtain them on Internet.
    317 
    318 If you are on a Unix machine, we highly recommend Jef Poskanzer's free
    319 PBMPLUS software, which provides many useful operations on PPM-format image
    320 files.  In particular, it can convert PPM images to and from a wide range of
    321 other formats, thus making cjpeg/djpeg considerably more useful.  The latest
    322 version is distributed by the NetPBM group, and is available from numerous
    323 sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
    324 Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
    325 you are likely to have difficulty making it work on any non-Unix machine.
    326 
    327 A different free JPEG implementation, written by the PVRG group at Stanford,
    328 is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
    329 is designed for research and experimentation rather than production use;
    330 it is slower, harder to use, and less portable than the IJG code, but it
    331 is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
    332 which we do not.  (On the other hand, it doesn't do progressive JPEG.)
     269ACKNOWLEDGMENTS
     270===============
     271
     272Thank to Juergen Bruder of the Georg-Cantor-Organization at the
     273Martin-Luther-University Halle for providing me with a copy of the common
     274DCT algorithm article, only to find out that I had come to the same result
     275in a more direct and comprehensible way with a more generative approach.
     276
     277Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the
     278ITU JPEG (Study Group 16) meeting in Geneva, Switzerland.
     279
     280Thank to Thomas Wiegand and Gary Sullivan for inviting me to the
     281Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
     282
     283Thank to John Korejwa and Massimo Ballerini for inviting me to
     284fruitful consultations in Boston, MA and Milan, Italy.
     285
     286Thank to Hendrik Elstner, Roland Fassauer, and Simone Zuck for
     287corresponding business development.
     288
     289Thank to Nico Zschach and Dirk Stelling of the technical support team
     290at the Digital Images company in Halle for providing me with extra
     291equipment for configuration tests.
     292
     293Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful
     294communication about JPEG configuration in Sigma Photo Pro software.
     295
     296Last but not least special thank to Thomas G. Lane for the original
     297design and development of this singular software package.
    333298
    334299
     
    336301================
    337302
    338 Some JPEG programs produce files that are not compatible with our library.
    339 The root of the problem is that the ISO JPEG committee failed to specify a
    340 concrete file format.  Some vendors "filled in the blanks" on their own,
    341 creating proprietary formats that no one else could read.  (For example, none
    342 of the early commercial JPEG implementations for the Macintosh were able to
    343 exchange compressed files.)
    344 
    345 The file format we have adopted is called JFIF (see REFERENCES).  This format
    346 has been agreed to by a number of major commercial JPEG vendors, and it has
    347 become the de facto standard.  JFIF is a minimal or "low end" representation.
    348 We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
    349 Technical Note #2) for "high end" applications that need to record a lot of
    350 additional data about an image.  TIFF/JPEG is fairly new and not yet widely
    351 supported, unfortunately.
    352 
    353 The upcoming JPEG Part 3 standard defines a file format called SPIFF.
    354 SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
    355 be able to read the most common variant of SPIFF.  SPIFF has some technical
    356 advantages over JFIF, but its major claim to fame is simply that it is an
    357 official standard rather than an informal one.  At this point it is unclear
    358 whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
    359 standard.  IJG intends to support SPIFF once the standard is frozen, but we
    360 have not decided whether it should become our default output format or not.
    361 (In any case, our decoder will remain capable of reading JFIF indefinitely.)
    362 
    363 Various proprietary file formats incorporating JPEG compression also exist.
    364 We have little or no sympathy for the existence of these formats.  Indeed,
     303The ISO JPEG standards committee actually promotes different formats like
     304JPEG-2000 or JPEG-XR which are incompatible with original DCT-based JPEG
     305and which are based on faulty technologies.  IJG therefore does not and
     306will not support such momentary mistakes (see REFERENCES).
     307We have little or no sympathy for the promotion of these formats.  Indeed,
    365308one of the original reasons for developing this free software was to help
    366 force convergence on common, open format standards for JPEG files.  Don't
    367 use a proprietary file format!
     309force convergence on common, interoperable format standards for JPEG files.
     310Don't use an incompatible file format!
     311(In any case, our decoder will remain capable of reading existing JPEG
     312image files indefinitely.)
    368313
    369314
     
    371316=====
    372317
    373 The major thrust for v7 will probably be improvement of visual quality.
    374 The current method for scaling the quantization tables is known not to be
    375 very good at low Q values.  We also intend to investigate block boundary
    376 smoothing, "poor man's variable quantization", and other means of improving
    377 quality-vs-file-size performance without sacrificing compatibility.
    378 
    379 In future versions, we are considering supporting some of the upcoming JPEG
    380 Part 3 extensions --- principally, variable quantization and the SPIFF file
    381 format.
    382 
    383 As always, speeding things up is of great interest.
    384 
    385 Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
     318v7 is basically just a necessary interim release, paving the way for a
     319major breakthrough in image coding technology with the next v8 package
     320which is scheduled for release in the year 2010.
     321
     322Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
  • trunk/libjpeg/ansi2knr.c

    r15 r283  
    1 /* ansi2knr.c */
     1/* Copyright (C) 1989, 2000 Aladdin Enterprises.  All rights reserved. */
     2
     3/*$Id: ansi2knr.c,v 1.14 2003/09/06 05:36:56 eggert Exp $*/
    24/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
    35
     
    1214but only under the conditions described in the GPL.  A copy of this license
    1315is supposed to have been given to you along with ansi2knr so you can know
    14 your rights and responsibilities.  It should be in a file named COPYLEFT.
    15 [In the IJG distribution, the GPL appears below, not in a separate file.]
    16 Among other things, the copyright notice and this notice must be preserved
    17 on all copies.
     16your rights and responsibilities.  It should be in a file named COPYLEFT,
     17or, if there is no file named COPYLEFT, a file named COPYING.  Among other
     18things, the copyright notice and this notice must be preserved on all
     19copies.
    1820
    1921We explicitly state here what we believe is already implied by the GPL: if
     
    2729
    2830/*
    29 ---------- Here is the GNU GPL file COPYLEFT, referred to above ----------
    30 ----- These terms do NOT apply to the JPEG software itself; see README ------
    31 
    32                     GHOSTSCRIPT GENERAL PUBLIC LICENSE
    33                     (Clarified 11 Feb 1988)
    34 
    35  Copyright (C) 1988 Richard M. Stallman
    36  Everyone is permitted to copy and distribute verbatim copies of this
    37  license, but changing it is not allowed.  You can also use this wording
    38  to make the terms for other programs.
    39 
    40   The license agreements of most software companies keep you at the
    41 mercy of those companies.  By contrast, our general public license is
    42 intended to give everyone the right to share Ghostscript.  To make sure
    43 that you get the rights we want you to have, we need to make
    44 restrictions that forbid anyone to deny you these rights or to ask you
    45 to surrender the rights.  Hence this license agreement.
    46 
    47   Specifically, we want to make sure that you have the right to give
    48 away copies of Ghostscript, that you receive source code or else can get
    49 it if you want it, that you can change Ghostscript or use pieces of it
    50 in new free programs, and that you know you can do these things.
    51 
    52   To make sure that everyone has such rights, we have to forbid you to
    53 deprive anyone else of these rights.  For example, if you distribute
    54 copies of Ghostscript, you must give the recipients all the rights that
    55 you have.  You must make sure that they, too, receive or can get the
    56 source code.  And you must tell them their rights.
    57 
    58   Also, for our own protection, we must make certain that everyone finds
    59 out that there is no warranty for Ghostscript.  If Ghostscript is
    60 modified by someone else and passed on, we want its recipients to know
    61 that what they have is not what we distributed, so that any problems
    62 introduced by others will not reflect on our reputation.
    63 
    64   Therefore we (Richard M. Stallman and the Free Software Foundation,
    65 Inc.) make the following terms which say what you must do to be allowed
    66 to distribute or change Ghostscript.
    67 
    68 
    69                         COPYING POLICIES
    70 
    71   1. You may copy and distribute verbatim copies of Ghostscript source
    72 code as you receive it, in any medium, provided that you conspicuously
    73 and appropriately publish on each copy a valid copyright and license
    74 notice "Copyright (C) 1989 Aladdin Enterprises.  All rights reserved.
    75 Distributed by Free Software Foundation, Inc." (or with whatever year is
    76 appropriate); keep intact the notices on all files that refer to this
    77 License Agreement and to the absence of any warranty; and give any other
    78 recipients of the Ghostscript program a copy of this License Agreement
    79 along with the program.  You may charge a distribution fee for the
    80 physical act of transferring a copy.
    81 
    82   2. You may modify your copy or copies of Ghostscript or any portion of
    83 it, and copy and distribute such modifications under the terms of
    84 Paragraph 1 above, provided that you also do the following:
    85 
    86     a) cause the modified files to carry prominent notices stating
    87     that you changed the files and the date of any change; and
    88 
    89     b) cause the whole of any work that you distribute or publish,
    90     that in whole or in part contains or is a derivative of Ghostscript
    91     or any part thereof, to be licensed at no charge to all third
    92     parties on terms identical to those contained in this License
    93     Agreement (except that you may choose to grant more extensive
    94     warranty protection to some or all third parties, at your option).
    95 
    96     c) You may charge a distribution fee for the physical act of
    97     transferring a copy, and you may at your option offer warranty
    98     protection in exchange for a fee.
    99 
    100 Mere aggregation of another unrelated program with this program (or its
    101 derivative) on a volume of a storage or distribution medium does not bring
    102 the other program under the scope of these terms.
    103 
    104   3. You may copy and distribute Ghostscript (or a portion or derivative
    105 of it, under Paragraph 2) in object code or executable form under the
    106 terms of Paragraphs 1 and 2 above provided that you also do one of the
    107 following:
    108 
    109     a) accompany it with the complete corresponding machine-readable
    110     source code, which must be distributed under the terms of
    111     Paragraphs 1 and 2 above; or,
    112 
    113     b) accompany it with a written offer, valid for at least three
    114     years, to give any third party free (except for a nominal
    115     shipping charge) a complete machine-readable copy of the
    116     corresponding source code, to be distributed under the terms of
    117     Paragraphs 1 and 2 above; or,
    118 
    119     c) accompany it with the information you received as to where the
    120     corresponding source code may be obtained.  (This alternative is
    121     allowed only for noncommercial distribution and only if you
    122     received the program in object code or executable form alone.)
    123 
    124 For an executable file, complete source code means all the source code for
    125 all modules it contains; but, as a special exception, it need not include
    126 source code for modules which are standard libraries that accompany the
    127 operating system on which the executable file runs.
    128 
    129   4. You may not copy, sublicense, distribute or transfer Ghostscript
    130 except as expressly provided under this License Agreement.  Any attempt
    131 otherwise to copy, sublicense, distribute or transfer Ghostscript is
    132 void and your rights to use the program under this License agreement
    133 shall be automatically terminated.  However, parties who have received
    134 computer software programs from you with this License Agreement will not
    135 have their licenses terminated so long as such parties remain in full
    136 compliance.
    137 
    138   5. If you wish to incorporate parts of Ghostscript into other free
    139 programs whose distribution conditions are different, write to the Free
    140 Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not
    141 yet worked out a simple rule that can be stated here, but we will often
    142 permit this.  We will be guided by the two goals of preserving the free
    143 status of all derivatives of our free software and of promoting the
    144 sharing and reuse of software.
    145 
    146 Your comments and suggestions about our licensing policies and our
    147 software are welcome!  Please contact the Free Software Foundation,
    148 Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296.
    149 
    150                        NO WARRANTY
    151 
    152   BECAUSE GHOSTSCRIPT IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
    153 NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT
    154 WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD
    155 M. STALLMAN, ALADDIN ENTERPRISES, L. PETER DEUTSCH, AND/OR OTHER PARTIES
    156 PROVIDE GHOSTSCRIPT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    157 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    158 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE
    159 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GHOSTSCRIPT IS WITH
    160 YOU.  SHOULD GHOSTSCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
    161 NECESSARY SERVICING, REPAIR OR CORRECTION.
    162 
    163   IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
    164 STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., L. PETER DEUTSCH, ALADDIN
    165 ENTERPRISES, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
    166 GHOSTSCRIPT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
    167 ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
    168 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
    169 (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
    170 INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
    171 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GHOSTSCRIPT, EVEN IF YOU
    172 HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM
    173 BY ANY OTHER PARTY.
    174 
    175 -------------------- End of file COPYLEFT ------------------------------
    176 */
    177 
    178 /*
    17931 * Usage:
    180         ansi2knr input_file [output_file]
     32        ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
     33 * --filename provides the file name for the #line directive in the output,
     34 * overriding input_file (if present).
     35 * If no input_file is supplied, input is read from stdin.
    18136 * If no output_file is supplied, output goes to stdout.
    18237 * There are no error messages.
    18338 *
    18439 * ansi2knr recognizes function definitions by seeing a non-keyword
    185  * identifier at the left margin, followed by a left parenthesis,
    186  * with a right parenthesis as the last character on the line,
    187  * and with a left brace as the first token on the following line
    188  * (ignoring possible intervening comments).
    189  * It will recognize a multi-line header provided that no intervening
    190  * line ends with a left or right brace or a semicolon.
    191  * These algorithms ignore whitespace and comments, except that
    192  * the function name must be the first thing on the line.
    193  * The following constructs will confuse it:
     40 * identifier at the left margin, followed by a left parenthesis, with a
     41 * right parenthesis as the last character on the line, and with a left
     42 * brace as the first token on the following line (ignoring possible
     43 * intervening comments and/or preprocessor directives), except that a line
     44 * consisting of only
     45 *      identifier1(identifier2)
     46 * will not be considered a function definition unless identifier2 is
     47 * the word "void", and a line consisting of
     48 *      identifier1(identifier2, <<arbitrary>>)
     49 * will not be considered a function definition.
     50 * ansi2knr will recognize a multi-line header provided that no intervening
     51 * line ends with a left or right brace or a semicolon.  These algorithms
     52 * ignore whitespace, comments, and preprocessor directives, except that
     53 * the function name must be the first thing on the line.  The following
     54 * constructs will confuse it:
    19455 *      - Any other construct that starts at the left margin and
    19556 *          follows the above syntax (such as a macro or function call).
    196  *      - Some macros that tinker with the syntax of the function header.
     57 *      - Some macros that tinker with the syntax of function headers.
    19758 */
    19859
     
    20162 * <ghost@aladdin.com>.  Other authors are noted in the change history
    20263 * that follows (in reverse chronological order):
    203         lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with
     64
     65        lpd 2000-04-12 backs out Eggert's changes because of bugs:
     66        - concatlits didn't declare the type of its bufend argument;
     67        - concatlits didn't recognize when it was inside a comment;
     68        - scanstring could scan backward past the beginning of the string; when
     69        - the check for \ + newline in scanstring was unnecessary.
     70
     71        2000-03-05  Paul Eggert  <eggert@twinsun.com>
     72
     73        Add support for concatenated string literals.
     74        * ansi2knr.c (concatlits): New decl.
     75        (main): Invoke concatlits to concatenate string literals.
     76        (scanstring): Handle backslash-newline correctly.  Work with
     77        character constants.  Fix bug when scanning backwards through
     78        backslash-quote.  Check for unterminated strings.
     79        (convert1): Parse character constants, too.
     80        (appendline, concatlits): New functions.
     81        * ansi2knr.1: Document this.
     82
     83        lpd 1999-08-17 added code to allow preprocessor directives
     84                wherever comments are allowed
     85        lpd 1999-04-12 added minor fixes from Pavel Roskin
     86                <pavel_roskin@geocities.com> for clean compilation with
     87                gcc -W -Wall
     88        lpd 1999-03-22 added hack to recognize lines consisting of
     89                identifier1(identifier2, xxx) as *not* being procedures
     90        lpd 1999-02-03 made indentation of preprocessor commands consistent
     91        lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an
     92                endless loop; quoted strings within an argument list
     93                confused the parser
     94        lpd 1999-01-24 added a check for write errors on the output,
     95                suggested by Jim Meyering <meyering@ascend.com>
     96        lpd 1998-11-09 added further hack to recognize identifier(void)
     97                as being a procedure
     98        lpd 1998-10-23 added hack to recognize lines consisting of
     99                identifier1(identifier2) as *not* being procedures
     100        lpd 1997-12-08 made input_file optional; only closes input and/or
     101                output file if not stdin or stdout respectively; prints
     102                usage message on stderr rather than stdout; adds
     103                --filename switch (changes suggested by
     104                <ceder@lysator.liu.se>)
     105        lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with
    204106                compilers that don't understand void, as suggested by
    205107                Tom Lane
    206         lpd 96-01-15 changed to require that the first non-comment token
     108        lpd 1996-01-15 changed to require that the first non-comment token
    207109                on the line following a function header be a left brace,
    208110                to reduce sensitivity to macros, as suggested by Tom Lane
    209111                <tgl@sss.pgh.pa.us>
    210         lpd 95-06-22 removed #ifndefs whose sole purpose was to define
     112        lpd 1995-06-22 removed #ifndefs whose sole purpose was to define
    211113                undefined preprocessor symbols as 0; changed all #ifdefs
    212114                for configuration symbols to #ifs
    213         lpd 95-04-05 changed copyright notice to make it clear that
     115        lpd 1995-04-05 changed copyright notice to make it clear that
    214116                including ansi2knr in a program does not bring the entire
    215117                program under the GPL
    216         lpd 94-12-18 added conditionals for systems where ctype macros
     118        lpd 1994-12-18 added conditionals for systems where ctype macros
    217119                don't handle 8-bit characters properly, suggested by
    218120                Francois Pinard <pinard@iro.umontreal.ca>;
    219121                removed --varargs switch (this is now the default)
    220         lpd 94-10-10 removed CONFIG_BROKETS conditional
    221         lpd 94-07-16 added some conditionals to help GNU `configure',
     122        lpd 1994-10-10 removed CONFIG_BROKETS conditional
     123        lpd 1994-07-16 added some conditionals to help GNU `configure',
    222124                suggested by Francois Pinard <pinard@iro.umontreal.ca>;
    223125                properly erase prototype args in function parameters,
    224126                contributed by Jim Avera <jima@netcom.com>;
    225127                correct error in writeblanks (it shouldn't erase EOLs)
    226         lpd 89-xx-xx original version
     128        lpd 1989-xx-xx original version
    227129 */
    228130
     
    287189#endif
    288190
     191/* Define NULL (for *very* old compilers). */
     192#ifndef NULL
     193# define NULL (0)
     194#endif
     195
    289196/*
    290197 * The ctype macros don't always handle 8-bit characters correctly.
     
    292199 */
    293200#ifdef isascii
    294 #  undef HAVE_ISASCII           /* just in case */
    295 #  define HAVE_ISASCII 1
     201# undef HAVE_ISASCII            /* just in case */
     202# define HAVE_ISASCII 1
    296203#else
    297204#endif
    298205#if STDC_HEADERS || !HAVE_ISASCII
    299 #  define is_ascii(c) 1
     206# define is_ascii(c) 1
    300207#else
    301 #  define is_ascii(c) isascii(c)
     208# define is_ascii(c) isascii(c)
    302209#endif
    303210
     
    311218
    312219/* Forward references */
     220char *ppdirforward();
     221char *ppdirbackward();
    313222char *skipspace();
     223char *scanstring();
    314224int writeblanks();
    315225int test1();
     
    321231    int argc;
    322232    char *argv[];
    323 {       FILE *in, *out;
     233{       FILE *in = stdin;
     234        FILE *out = stdout;
     235        char *filename = 0;
     236        char *program_name = argv[0];
     237        char *output_name = 0;
    324238#define bufsize 5000                    /* arbitrary size */
    325239        char *buf;
    326240        char *line;
    327241        char *more;
     242        char *usage =
     243          "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
    328244        /*
    329245         * In previous versions, ansi2knr recognized a --varargs switch.
     
    335251         */
    336252        int convert_varargs = 1;
    337 
    338         if ( argc > 1 && argv[1][0] == '-' )
    339           {     if ( !strcmp(argv[1], "--varargs") )
    340                   {     convert_varargs = 1;
    341                         argc--;
    342                         argv++;
    343                   }
    344                 else
    345                   {     fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
    346                         exit(1);
    347                   }
     253        int output_error;
     254
     255        while ( argc > 1 && argv[1][0] == '-' ) {
     256          if ( !strcmp(argv[1], "--varargs") ) {
     257            convert_varargs = 1;
     258            argc--;
     259            argv++;
     260            continue;
    348261          }
     262          if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
     263            filename = argv[2];
     264            argc -= 2;
     265            argv += 2;
     266            continue;
     267          }
     268          fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name,
     269                  argv[1]);
     270          fprintf(stderr, usage);
     271          exit(1);
     272        }
    349273        switch ( argc )
    350274           {
    351275        default:
    352                 printf("Usage: ansi2knr input_file [output_file]\n");
     276                fprintf(stderr, usage);
    353277                exit(0);
     278        case 3:
     279                output_name = argv[2];
     280                out = fopen(output_name, "w");
     281                if ( out == NULL ) {
     282                  fprintf(stderr, "%s: Cannot open output file %s\n",
     283                          program_name, output_name);
     284                  exit(1);
     285                }
     286                /* falls through */
    354287        case 2:
    355                 out = stdout;
     288                in = fopen(argv[1], "r");
     289                if ( in == NULL ) {
     290                  fprintf(stderr, "%s: Cannot open input file %s\n",
     291                          program_name, argv[1]);
     292                  exit(1);
     293                }
     294                if ( filename == 0 )
     295                  filename = argv[1];
     296                /* falls through */
     297        case 1:
    356298                break;
    357         case 3:
    358                 out = fopen(argv[2], "w");
    359                 if ( out == NULL )
    360                    {    fprintf(stderr, "Cannot open output file %s\n", argv[2]);
    361                         exit(1);
    362                    }
    363            }
    364         in = fopen(argv[1], "r");
    365         if ( in == NULL )
    366            {    fprintf(stderr, "Cannot open input file %s\n", argv[1]);
     299           }
     300        if ( filename )
     301          fprintf(out, "#line 1 \"%s\"\n", filename);
     302        buf = malloc(bufsize);
     303        if ( buf == NULL )
     304           {
     305                fprintf(stderr, "Unable to allocate read buffer!\n");
    367306                exit(1);
    368307           }
    369         fprintf(out, "#line 1 \"%s\"\n", argv[1]);
    370         buf = malloc(bufsize);
    371308        line = buf;
    372309        while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
     
    385322                        if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
    386323                          goto wl;
    387                         switch ( *skipspace(more, 1) )
     324                        switch ( *skipspace(ppdirforward(more), 1) )
    388325                          {
    389326                          case '{':
     
    419356          fputs(buf, out);
    420357        free(buf);
    421         fclose(out);
    422         fclose(in);
     358        if ( output_name ) {
     359          output_error = ferror(out);
     360          output_error |= fclose(out);
     361        } else {                /* out == stdout */
     362          fflush(out);
     363          output_error = ferror(out);
     364        }
     365        if ( output_error ) {
     366          fprintf(stderr, "%s: error writing to %s\n", program_name,
     367                  (output_name ? output_name : "stdout"));
     368          exit(1);
     369        }
     370        if ( in != stdin )
     371          fclose(in);
    423372        return 0;
    424373}
    425374
    426 /* Skip over space and comments, in either direction. */
     375/*
     376 * Skip forward or backward over one or more preprocessor directives.
     377 */
     378char *
     379ppdirforward(p)
     380    char *p;
     381{
     382    for (; *p == '#'; ++p) {
     383        for (; *p != '\r' && *p != '\n'; ++p)
     384            if (*p == 0)
     385                return p;
     386        if (*p == '\r' && p[1] == '\n')
     387            ++p;
     388    }
     389    return p;
     390}
     391char *
     392ppdirbackward(p, limit)
     393    char *p;
     394    char *limit;
     395{
     396    char *np = p;
     397
     398    for (;; p = --np) {
     399        if (*np == '\n' && np[-1] == '\r')
     400            --np;
     401        for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
     402            if (np[-1] == 0)
     403                return np;
     404        if (*np != '#')
     405            return p;
     406    }
     407}
     408
     409/*
     410 * Skip over whitespace, comments, and preprocessor directives,
     411 * in either direction.
     412 */
    427413char *
    428414skipspace(p, dir)
    429     register char *p;
    430     register int dir;                   /* 1 for forward, -1 for backward */
    431 {       for ( ; ; )
    432            {    while ( is_space(*p) )
    433                   p += dir;
    434                 if ( !(*p == '/' && p[dir] == '*') )
    435                   break;
    436                 p += dir;  p += dir;
    437                 while ( !(*p == '*' && p[dir] == '/') )
    438                    {    if ( *p == 0 )
    439                           return p;     /* multi-line comment?? */
    440                         p += dir;
    441                    }
    442                 p += dir;  p += dir;
    443            }
    444         return p;
     415    char *p;
     416    int dir;                    /* 1 for forward, -1 for backward */
     417{
     418    for ( ; ; ) {
     419        while ( is_space(*p) )
     420            p += dir;
     421        if ( !(*p == '/' && p[dir] == '*') )
     422            break;
     423        p += dir;  p += dir;
     424        while ( !(*p == '*' && p[dir] == '/') ) {
     425            if ( *p == 0 )
     426                return p;       /* multi-line comment?? */
     427            p += dir;
     428        }
     429        p += dir;  p += dir;
     430    }
     431    return p;
     432}
     433
     434/* Scan over a quoted string, in either direction. */
     435char *
     436scanstring(p, dir)
     437    char *p;
     438    int dir;
     439{
     440    for (p += dir; ; p += dir)
     441        if (*p == '"' && p[-dir] != '\\')
     442            return p + dir;
    445443}
    446444
     
    476474test1(buf)
    477475    char *buf;
    478 {       register char *p = buf;
     476{       char *p = buf;
    479477        char *bend;
    480478        char *endfn;
     
    483481        if ( !isidfirstchar(*p) )
    484482          return 0;             /* no name at left margin */
    485         bend = skipspace(buf + strlen(buf) - 1, -1);
     483        bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
    486484        switch ( *bend )
    487485           {
     
    513511                char **key = words;
    514512                char *kp;
    515                 int len = endfn - buf;
     513                unsigned len = endfn - buf;
    516514
    517515                while ( (kp = *key) != 0 )
     
    521519                   }
    522520           }
     521           {
     522               char *id = p;
     523               int len;
     524               /*
     525                * Check for identifier1(identifier2) and not
     526                * identifier1(void), or identifier1(identifier2, xxxx).
     527                */
     528
     529               while ( isidchar(*p) )
     530                   p++;
     531               len = p - id;
     532               p = skipspace(p, 1);
     533               if (*p == ',' ||
     534                   (*p == ')' && (len != 4 || strncmp(id, "void", 4)))
     535                   )
     536                   return 0;    /* not a function */
     537           }
     538        /*
     539         * If the last significant character was a ), we need to count
     540         * parentheses, because it might be part of a formal parameter
     541         * that is a procedure.
     542         */
     543        if (contin > 0) {
     544            int level = 0;
     545
     546            for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1))
     547                level += (*p == '(' ? 1 : *p == ')' ? -1 : 0);
     548            if (level > 0)
     549                contin = -1;
     550        }
    523551        return contin;
    524552}
     
    532560    int convert_varargs;        /* Boolean */
    533561{       char *endfn;
    534         register char *p;
     562        char *p;
     563        /*
     564         * The breaks table contains pointers to the beginning and end
     565         * of each argument.
     566         */
    535567        char **breaks;
    536568        unsigned num_breaks = 2;        /* for testing */
     
    546578top:    p = endfn;
    547579        breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
    548         if ( breaks == 0 )
     580        if ( breaks == NULL )
    549581           {    /* Couldn't allocate break table, give up */
    550582                fprintf(stderr, "Unable to allocate break table!\n");
     
    558590           {    int level = 0;
    559591                char *lp = NULL;
    560                 char *rp;
     592                char *rp = NULL;
    561593                char *end = NULL;
    562594
     
    585617                                break;
    586618                           case '/':
    587                                 p = skipspace(p, 1) - 1;
     619                                if (p[1] == '*')
     620                                    p = skipspace(p, 1) - 1;
    588621                                break;
     622                           case '"':
     623                               p = scanstring(p, 1) - 1;
     624                               break;
    589625                           default:
    590626                                ;
     
    592628                   }
    593629                /* Erase any embedded prototype parameters. */
    594                 if ( lp )
     630                if ( lp && rp )
    595631                  writeblanks(lp + 1, rp);
    596632                p--;                    /* back up over terminator */
     
    608644                                 switch ( *--p )
    609645                                   {
    610                                    case ']': case ')': level++; break;
    611                                    case '[': case '(': level--; break;
    612                                    case '/': p = skipspace(p, -1) + 1; break;
     646                                   case ']': case ')':
     647                                       level++;
     648                                       break;
     649                                   case '[': case '(':
     650                                       level--;
     651                                       break;
     652                                   case '/':
     653                                       if (p > buf && p[-1] == '*')
     654                                           p = skipspace(p, -1) + 1;
     655                                       break;
     656                                   case '"':
     657                                       p = scanstring(p, -1) + 1;
     658                                       break;
    613659                                   default: ;
    614660                                   }
  • trunk/libjpeg/cdjpeg.h

    r15 r283  
    105105#define read_quant_tables       RdQTables
    106106#define read_scan_script        RdScnScript
     107#define set_quality_ratings     SetQRates
    107108#define set_quant_slots         SetQSlots
    108109#define set_sample_factors      SetSFacts
     
    132133
    133134EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
    134                                     int scale_factor, boolean force_baseline));
     135                                      boolean force_baseline));
    135136EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
     137EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,
     138                                         boolean force_baseline));
    136139EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
    137140EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
  • trunk/libjpeg/change.log

    r15 r283  
    11CHANGE LOG for Independent JPEG Group's JPEG software
     2
     3
     4Version 7  27-Jun-2009
     5----------------------
     6
     7New scaled DCTs implemented.
     8djpeg now supports scalings N/8 with all N from 1 to 16.
     9cjpeg now supports scalings 8/N with all N from 1 to 16.
     10Scaled DCTs with size larger than 8 are now also used for resolving the
     11common 2x2 chroma subsampling case without additional spatial resampling.
     12Separate spatial resampling for those kind of files is now only necessary
     13for N>8 scaling cases.
     14Furthermore, separate scaled DCT functions are provided for direct resolving
     15of the common asymmetric subsampling cases (2x1 and 1x2) without additional
     16spatial resampling.
     17
     18cjpeg -quality option has been extended for support of separate quality
     19settings for luminance and chrominance (or in general, for every provided
     20quantization table slot).
     21New API function jpeg_default_qtables() and q_scale_factor array in library.
     22
     23Added -nosmooth option to cjpeg, complementary to djpeg.
     24New variable "do_fancy_downsampling" in library, complement to fancy
     25upsampling.  Fancy upsampling now uses direct DCT scaling with sizes
     26larger than 8.  The old method is not reversible and has been removed.
     27
     28Support arithmetic entropy encoding and decoding.
     29Added files jaricom.c, jcarith.c, jdarith.c.
     30
     31Straighten the file structure:
     32Removed files jidctred.c, jcphuff.c, jchuff.h, jdphuff.c, jdhuff.h.
     33
     34jpegtran has a new "lossless" cropping feature.
     35
     36Implement -perfect option in jpegtran, new API function
     37jtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)
     38
     39Better error messages for jpegtran fopen failure.
     40(DP 203_jpegtran_errmsg.dpatch)
     41
     42Fix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:
     43according to Netpbm, the de facto standard implementation of the PNM formats,
     44the most significant byte is first. (DP 203_rdppm.dpatch)
     45
     46Add -raw option to rdjpgcom not to mangle the output.
     47(DP 205_rdjpgcom_raw.dpatch)
     48
     49Make rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)
     50
     51Add extern "C" to jpeglib.h.
     52This avoids the need to put extern "C" { ... } around #include "jpeglib.h"
     53in your C++ application.  Defining the symbol DONT_USE_EXTERN_C in the
     54configuration prevents this. (DP 202_jpeglib.h_c++.dpatch)
    255
    356
  • trunk/libjpeg/cjpeg.1

    r15 r283  
    1 .TH CJPEG 1 "20 March 1998"
     1.TH CJPEG 1 "10 June 2009"
    22.SH NAME
    33cjpeg \- compress an image file to a JPEG file
     
    3737The basic switches are:
    3838.TP
    39 .BI \-quality " N"
     39.BI \-quality " N[,...]"
    4040Scale quantization tables to adjust image quality.  Quality is 0 (worst) to
    4141100 (best); default is 75.  (See below for more info.)
     
    6262.B \-progressive
    6363Create progressive JPEG file (see below).
     64.TP
     65.BI \-scale " M/N"
     66Scale the output image by a factor M/N.  Currently supported scale factors are
     678/N with all N from 1 to 16.
    6468.TP
    6569.B \-targa
     
    108112.B \-baseline
    109113if you need to ensure compatibility at low quality values.)
     114.PP
     115The
     116.B \-quality
     117option has been extended in IJG version 7 for support of separate quality
     118settings for luminance and chrominance (or in general, for every provided
     119quantization table slot).  This feature is useful for high-quality
     120applications which cannot accept the damage of color data by coarse
     121subsampling settings.  You can now easily reduce the color data amount more
     122smoothly with finer control without separate subsampling.  The resulting file
     123is fully compliant with standard JPEG decoders.
     124Note that the
     125.B \-quality
     126ratings refer to the quantization table slots, and that the last value is
     127replicated if there are more q-table slots than parameters.  The default
     128q-table slots are 0 for luminance and 1 for chrominance with default tables as
     129given in the JPEG standard.  This is compatible with the old behaviour in case
     130that only one parameter is given, which is then used for both luminance and
     131chrominance (slots 0 and 1).  More or custom quantization tables can be set
     132with
     133.B \-qtables
     134and assigned to components with
     135.B \-qslots
     136parameter (see the "wizard" switches below).
     137.B Caution:
     138You must explicitely add
     139.BI \-sample " 1x1"
     140for efficient separate color
     141quality selection, since the default value used by library is 2x2!
    110142.PP
    111143The
     
    118150standard JPEG file of the same quality setting, and the total file size is
    119151about the same --- often a little smaller.
    120 .B Caution:
    121 progressive JPEG is not yet widely implemented, so many decoders will be
    122 unable to view a progressive JPEG file at all.
    123152.PP
    124153Switches for advanced users:
     
    137166machines, while the integer methods should give the same results everywhere.
    138167The fast integer method is much less accurate than the other two.
     168.TP
     169.B \-nosmooth
     170Don't use high-quality downsampling.
    139171.TP
    140172.BI \-restart " N"
     
    188220Switches for wizards:
    189221.TP
     222.B \-arithmetic
     223Use arithmetic coding.
     224.B Caution:
     225arithmetic coded JPEG is not yet widely implemented, so many decoders will be
     226unable to view an arithmetic coded JPEG file at all.
     227.TP
    190228.B \-baseline
    191229Force baseline-compatible quantization tables to be generated.  This clamps
     
    212250The "wizard" switches are intended for experimentation with JPEG.  If you
    213251don't know what you are doing, \fBdon't use them\fR.  These switches are
    214 documented further in the file wizard.doc.
     252documented further in the file wizard.txt.
    215253.SH EXAMPLES
    216254.LP
     
    277315Independent JPEG Group
    278316.SH BUGS
    279 Arithmetic coding is not supported for legal reasons.
    280 .PP
    281317GIF input files are no longer supported, to avoid the Unisys LZW patent.
    282 Use a Unisys-licensed program if you need to read a GIF file.  (Conversion
    283 of GIF files to JPEG is usually a bad idea anyway.)
     318(Conversion of GIF files to JPEG is usually a bad idea anyway.)
    284319.PP
    285320Not all variants of BMP and Targa file formats are supported.
     
    289324switch is not a bug, it's a feature.  (It would be a bug if the Targa format
    290325designers had not been clueless.)
    291 .PP
    292 Still not as fast as we'd like.
  • trunk/libjpeg/cjpeg.c

    r15 r283  
    33 *
    44 * Copyright (C) 1991-1998, Thomas G. Lane.
     5 * Modified 2003-2008 by Guido Vollbeding.
    56 * This file is part of the Independent JPEG Group's software.
    67 * For conditions of distribution and use, see the accompanying README file.
     
    150151
    151152  fprintf(stderr, "Switches (names may be abbreviated):\n");
    152   fprintf(stderr, "  -quality N     Compression quality (0..100; 5-95 is useful range)\n");
     153  fprintf(stderr, "  -quality N[,...]   Compression quality (0..100; 5-95 is useful range)\n");
    153154  fprintf(stderr, "  -grayscale     Create monochrome JPEG file\n");
    154155#ifdef ENTROPY_OPT_SUPPORTED
     
    157158#ifdef C_PROGRESSIVE_SUPPORTED
    158159  fprintf(stderr, "  -progressive   Create progressive JPEG file\n");
     160#endif
     161#ifdef DCT_SCALING_SUPPORTED
     162  fprintf(stderr, "  -scale M/N     Scale image by fraction M/N, eg, 1/2\n");
    159163#endif
    160164#ifdef TARGA_SUPPORTED
     
    174178          (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
    175179#endif
     180  fprintf(stderr, "  -nosmooth      Don't use high-quality downsampling\n");
    176181  fprintf(stderr, "  -restart N     Set restart interval in rows, or in blocks with B\n");
    177182#ifdef INPUT_SMOOTHING_SUPPORTED
     
    210215  int argn;
    211216  char * arg;
    212   int quality;                  /* -quality parameter */
    213   int q_scale_factor;           /* scaling percentage for -qtables */
    214217  boolean force_baseline;
    215218  boolean simple_progressive;
     219  char * qualityarg = NULL;     /* saves -quality parm if any */
    216220  char * qtablefile = NULL;     /* saves -qtables filename if any */
    217221  char * qslotsarg = NULL;      /* saves -qslots parm if any */
     
    220224
    221225  /* Set up default JPEG parameters. */
    222   /* Note that default -quality level need not, and does not,
    223    * match the default scaling for an explicit -qtables argument.
    224    */
    225   quality = 75;                 /* default -quality value */
    226   q_scale_factor = 100;         /* default to no scaling for -qtables */
     226
    227227  force_baseline = FALSE;       /* by default, allow 16-bit quantizers */
    228228  simple_progressive = FALSE;
     
    301301      cinfo->mem->max_memory_to_use = lval * 1000L;
    302302
     303    } else if (keymatch(arg, "nosmooth", 3)) {
     304      /* Suppress fancy downsampling */
     305      cinfo->do_fancy_downsampling = FALSE;
     306
    303307    } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
    304308      /* Enable entropy parm optimization. */
     
    329333
    330334    } else if (keymatch(arg, "quality", 1)) {
    331       /* Quality factor (quantization table scaling factor). */
    332       if (++argn >= argc)       /* advance to next argument */
    333         usage();
    334       if (sscanf(argv[argn], "%d", &quality) != 1)
    335         usage();
    336       /* Change scale factor in case -qtables is present. */
    337       q_scale_factor = jpeg_quality_scaling(quality);
     335      /* Quality ratings (quantization table scaling factors). */
     336      if (++argn >= argc)       /* advance to next argument */
     337        usage();
     338      qualityarg = argv[argn];
    338339
    339340    } else if (keymatch(arg, "qslots", 2)) {
     
    383384       */
    384385
    385     } else if (keymatch(arg, "scans", 2)) {
     386    } else if (keymatch(arg, "scale", 4)) {
     387      /* Scale the image by a fraction M/N. */
     388      if (++argn >= argc)       /* advance to next argument */
     389        usage();
     390      if (sscanf(argv[argn], "%d/%d",
     391                 &cinfo->scale_num, &cinfo->scale_denom) != 2)
     392        usage();
     393
     394    } else if (keymatch(arg, "scans", 4)) {
    386395      /* Set scan script. */
    387396#ifdef C_MULTISCAN_FILES_SUPPORTED
     
    423432    /* Set quantization tables for selected quality. */
    424433    /* Some or all may be overridden if -qtables is present. */
    425     jpeg_set_quality(cinfo, quality, force_baseline);
     434    if (qualityarg != NULL)     /* process -quality if it was present */
     435      if (! set_quality_ratings(cinfo, qualityarg, force_baseline))
     436        usage();
    426437
    427438    if (qtablefile != NULL)     /* process -qtables if it was present */
    428       if (! read_quant_tables(cinfo, qtablefile,
    429                               q_scale_factor, force_baseline))
     439      if (! read_quant_tables(cinfo, qtablefile, force_baseline))
    430440        usage();
    431441
  • trunk/libjpeg/ckconfig.c

    r15 r283  
    302302  /* Write out all the info */
    303303  fprintf(outfile, "/* jconfig.h --- generated by ckconfig.c */\n");
    304   fprintf(outfile, "/* see jconfig.doc for explanations */\n\n");
     304  fprintf(outfile, "/* see jconfig.txt for explanations */\n\n");
    305305#ifdef HAVE_PROTOTYPES
    306306  fprintf(outfile, "#define HAVE_PROTOTYPES\n");
  • trunk/libjpeg/config.guess

    r15 r283  
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
    4 #
     3#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     5#   Free Software Foundation, Inc.
     6
     7timestamp='2009-04-27'
     8
    59# This file is free software; you can redistribute it and/or modify it
    610# under the terms of the GNU General Public License as published by
     
    1519# You should have received a copy of the GNU General Public License
    1620# along with this program; if not, write to the Free Software
    17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     22# 02110-1301, USA.
    1823#
    1924# As a special exception to the GNU General Public License, if you
     
    2227# the same distribution terms that you use for the rest of that program.
    2328
    24 # Written by Per Bothner <bothner@cygnus.com>.
    25 # The master version of this file is at the FSF in /home/gd/gnu/lib.
     29
     30# Originally written by Per Bothner <per@bothner.com>.
     31# Please send patches to <config-patches@gnu.org>.  Submit a context
     32# diff and a properly formatted ChangeLog entry.
    2633#
    2734# This script attempts to guess a canonical system name similar to
     
    3037#
    3138# The plan is that this can be called by configure scripts if you
    32 # don't specify an explicit system type (host/target name).
    33 #
    34 # Only a few systems have been added to this list; please add others
    35 # (but try to keep the structure clean).
    36 #
     39# don't specify an explicit build system type.
     40
     41me=`echo "$0" | sed -e 's,.*/,,'`
     42
     43usage="\
     44Usage: $0 [OPTION]
     45
     46Output the configuration name of the system \`$me' is run on.
     47
     48Operation modes:
     49  -h, --help         print this help, then exit
     50  -t, --time-stamp   print date of last modification, then exit
     51  -v, --version      print version number, then exit
     52
     53Report bugs and patches to <config-patches@gnu.org>."
     54
     55version="\
     56GNU config.guess ($timestamp)
     57
     58Originally written by Per Bothner.
     59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
     602002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
     61
     62This is free software; see the source for copying conditions.  There is NO
     63warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
     64
     65help="
     66Try \`$me --help' for more information."
     67
     68# Parse command line
     69while test $# -gt 0 ; do
     70  case $1 in
     71    --time-stamp | --time* | -t )
     72       echo "$timestamp" ; exit ;;
     73    --version | -v )
     74       echo "$version" ; exit ;;
     75    --help | --h* | -h )
     76       echo "$usage"; exit ;;
     77    -- )     # Stop option processing
     78       shift; break ;;
     79    - ) # Use stdin as input.
     80       break ;;
     81    -* )
     82       echo "$me: invalid option $1$help" >&2
     83       exit 1 ;;
     84    * )
     85       break ;;
     86  esac
     87done
     88
     89if test $# != 0; then
     90  echo "$me: too many arguments$help" >&2
     91  exit 1
     92fi
     93
     94trap 'exit 1' 1 2 15
     95
     96# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
     97# compiler to aid in system detection is discouraged as it requires
     98# temporary files to be created and, as you can see below, it is a
     99# headache to deal with in a portable fashion.
     100
     101# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
     102# use `HOST_CC' if defined, but it is deprecated.
     103
     104# Portable tmp directory creation inspired by the Autoconf team.
     105
     106set_cc_for_build='
     107trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
     108trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
     109: ${TMPDIR=/tmp} ;
     110 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
     111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
     112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
     113 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
     114dummy=$tmp/dummy ;
     115tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
     116case $CC_FOR_BUILD,$HOST_CC,$CC in
     117 ,,)    echo "int x;" > $dummy.c ;
     118        for c in cc gcc c89 c99 ; do
     119          if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
     120             CC_FOR_BUILD="$c"; break ;
     121          fi ;
     122        done ;
     123        if test x"$CC_FOR_BUILD" = x ; then
     124          CC_FOR_BUILD=no_compiler_found ;
     125        fi
     126        ;;
     127 ,,*)   CC_FOR_BUILD=$CC ;;
     128 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
     129esac ; set_cc_for_build= ;'
    37130
    38131# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
    39 # (ghazi@noc.rutgers.edu 8/24/94.)
     132# (ghazi@noc.rutgers.edu 1994-08-24)
    40133if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
    41134        PATH=$PATH:/.attbin ; export PATH
     
    44137UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
    45138UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
    46 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
     139UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
    47140UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    48141
    49 trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
    50 
    51142# Note: order is significant - the case branches are not exclusive.
    52143
    53144case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     145    *:NetBSD:*:*)
     146        # NetBSD (nbsd) targets should (where applicable) match one or
     147        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
     148        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
     149        # switched to ELF, *-*-netbsd* would select the old
     150        # object file format.  This provides both forward
     151        # compatibility and a consistent mechanism for selecting the
     152        # object file format.
     153        #
     154        # Note: NetBSD doesn't particularly care about the vendor
     155        # portion of the name.  We always set it to "unknown".
     156        sysctl="sysctl -n hw.machine_arch"
     157        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
     158            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
     159        case "${UNAME_MACHINE_ARCH}" in
     160            armeb) machine=armeb-unknown ;;
     161            arm*) machine=arm-unknown ;;
     162            sh3el) machine=shl-unknown ;;
     163            sh3eb) machine=sh-unknown ;;
     164            sh5el) machine=sh5le-unknown ;;
     165            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
     166        esac
     167        # The Operating System including object format, if it has switched
     168        # to ELF recently, or will in the future.
     169        case "${UNAME_MACHINE_ARCH}" in
     170            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
     171                eval $set_cc_for_build
     172                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
     173                        | grep __ELF__ >/dev/null
     174                then
     175                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
     176                    # Return netbsd for either.  FIX?
     177                    os=netbsd
     178                else
     179                    os=netbsdelf
     180                fi
     181                ;;
     182            *)
     183                os=netbsd
     184                ;;
     185        esac
     186        # The OS release
     187        # Debian GNU/NetBSD machines have a different userland, and
     188        # thus, need a distinct triplet. However, they do not need
     189        # kernel version information, so it can be replaced with a
     190        # suitable tag, in the style of linux-gnu.
     191        case "${UNAME_VERSION}" in
     192            Debian*)
     193                release='-gnu'
     194                ;;
     195            *)
     196                release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
     197                ;;
     198        esac
     199        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
     200        # contains redundant information, the shorter form:
     201        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
     202        echo "${machine}-${os}${release}"
     203        exit ;;
     204    *:OpenBSD:*:*)
     205        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
     206        echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
     207        exit ;;
     208    *:ekkoBSD:*:*)
     209        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
     210        exit ;;
     211    *:SolidBSD:*:*)
     212        echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
     213        exit ;;
     214    macppc:MirBSD:*:*)
     215        echo powerpc-unknown-mirbsd${UNAME_RELEASE}
     216        exit ;;
     217    *:MirBSD:*:*)
     218        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
     219        exit ;;
    54220    alpha:OSF1:*:*)
    55         if test $UNAME_RELEASE = "V4.0"; then
     221        case $UNAME_RELEASE in
     222        *4.0)
    56223                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    57         fi
     224                ;;
     225        *5.*)
     226                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
     227                ;;
     228        esac
     229        # According to Compaq, /usr/sbin/psrinfo has been available on
     230        # OSF/1 and Tru64 systems produced since 1995.  I hope that
     231        # covers most systems running today.  This code pipes the CPU
     232        # types through head -n 1, so we only detect the type of CPU 0.
     233        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
     234        case "$ALPHA_CPU_TYPE" in
     235            "EV4 (21064)")
     236                UNAME_MACHINE="alpha" ;;
     237            "EV4.5 (21064)")
     238                UNAME_MACHINE="alpha" ;;
     239            "LCA4 (21066/21068)")
     240                UNAME_MACHINE="alpha" ;;
     241            "EV5 (21164)")
     242                UNAME_MACHINE="alphaev5" ;;
     243            "EV5.6 (21164A)")
     244                UNAME_MACHINE="alphaev56" ;;
     245            "EV5.6 (21164PC)")
     246                UNAME_MACHINE="alphapca56" ;;
     247            "EV5.7 (21164PC)")
     248                UNAME_MACHINE="alphapca57" ;;
     249            "EV6 (21264)")
     250                UNAME_MACHINE="alphaev6" ;;
     251            "EV6.7 (21264A)")
     252                UNAME_MACHINE="alphaev67" ;;
     253            "EV6.8CB (21264C)")
     254                UNAME_MACHINE="alphaev68" ;;
     255            "EV6.8AL (21264B)")
     256                UNAME_MACHINE="alphaev68" ;;
     257            "EV6.8CX (21264D)")
     258                UNAME_MACHINE="alphaev68" ;;
     259            "EV6.9A (21264/EV69A)")
     260                UNAME_MACHINE="alphaev69" ;;
     261            "EV7 (21364)")
     262                UNAME_MACHINE="alphaev7" ;;
     263            "EV7.9 (21364A)")
     264                UNAME_MACHINE="alphaev79" ;;
     265        esac
     266        # A Pn.n version is a patched version.
    58267        # A Vn.n version is a released version.
    59268        # A Tn.n version is a released field test version.
    60269        # A Xn.n version is an unreleased experimental baselevel.
    61270        # 1.2 uses "1.2" for uname -r.
    62         cat <<EOF >dummy.s
    63         .globl main
    64         .ent main
    65 main:
    66         .frame \$30,0,\$26,0
    67         .prologue 0
    68         .long 0x47e03d80 # implver $0
    69         lda \$2,259
    70         .long 0x47e20c21 # amask $2,$1
    71         srl \$1,8,\$2
    72         sll \$2,2,\$2
    73         sll \$0,3,\$0
    74         addl \$1,\$0,\$0
    75         addl \$2,\$0,\$0
    76         ret \$31,(\$26),1
    77         .end main
    78 EOF
    79         ${CC-cc} dummy.s -o dummy 2>/dev/null
    80         if test "$?" = 0 ; then
    81                 ./dummy
    82                 case "$?" in
    83                         7)
    84                                 UNAME_MACHINE="alpha"
    85                                 ;;
    86                         15)
    87                                 UNAME_MACHINE="alphaev5"
    88                                 ;;
    89                         14)
    90                                 UNAME_MACHINE="alphaev56"
    91                                 ;;
    92                         10)
    93                                 UNAME_MACHINE="alphapca56"
    94                                 ;;
    95                         16)
    96                                 UNAME_MACHINE="alphaev6"
    97                                 ;;
    98                 esac
    99         fi
    100         rm -f dummy.s dummy
    101         echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
    102         exit 0 ;;
     271        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     272        exit ;;
     273    Alpha\ *:Windows_NT*:*)
     274        # How do we know it's Interix rather than the generic POSIX subsystem?
     275        # Should we change UNAME_MACHINE based on the output of uname instead
     276        # of the specific Alpha model?
     277        echo alpha-pc-interix
     278        exit ;;
    103279    21064:Windows_NT:50:3)
    104280        echo alpha-dec-winnt3.5
    105         exit 0 ;;
     281        exit ;;
    106282    Amiga*:UNIX_System_V:4.0:*)
    107         echo m68k-cbm-sysv4
    108         exit 0;;
    109     amiga:NetBSD:*:*)
    110       echo m68k-cbm-netbsd${UNAME_RELEASE}
    111       exit 0 ;;
    112     amiga:OpenBSD:*:*)
    113         echo m68k-unknown-openbsd${UNAME_RELEASE}
    114         exit 0 ;;
    115     arc64:OpenBSD:*:*)
    116         echo mips64el-unknown-openbsd${UNAME_RELEASE}
    117         exit 0 ;;
    118     arc:OpenBSD:*:*)
    119         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    120         exit 0 ;;
    121     hkmips:OpenBSD:*:*)
    122         echo mips-unknown-openbsd${UNAME_RELEASE}
    123         exit 0 ;;
    124     pmax:OpenBSD:*:*)
    125         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    126         exit 0 ;;
    127     sgi:OpenBSD:*:*)
    128         echo mips-unknown-openbsd${UNAME_RELEASE}
    129         exit 0 ;;
    130     wgrisc:OpenBSD:*:*)
    131         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    132         exit 0 ;;
     283        echo m68k-unknown-sysv4
     284        exit ;;
     285    *:[Aa]miga[Oo][Ss]:*:*)
     286        echo ${UNAME_MACHINE}-unknown-amigaos
     287        exit ;;
     288    *:[Mm]orph[Oo][Ss]:*:*)
     289        echo ${UNAME_MACHINE}-unknown-morphos
     290        exit ;;
     291    *:OS/390:*:*)
     292        echo i370-ibm-openedition
     293        exit ;;
     294    *:z/VM:*:*)
     295        echo s390-ibm-zvmoe
     296        exit ;;
     297    *:OS400:*:*)
     298        echo powerpc-ibm-os400
     299        exit ;;
    133300    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    134301        echo arm-acorn-riscix${UNAME_RELEASE}
    135         exit 0;;
    136     arm32:NetBSD:*:*)
    137         echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    138         exit 0 ;;
    139     SR2?01:HI-UX/MPP:*:*)
     302        exit ;;
     303    arm:riscos:*:*|arm:RISCOS:*:*)
     304        echo arm-unknown-riscos
     305        exit ;;
     306    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
    140307        echo hppa1.1-hitachi-hiuxmpp
    141         exit 0;;
    142     Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
     308        exit ;;
     309    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    143310        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
    144311        if test "`(/bin/universe) 2>/dev/null`" = att ; then
     
    147314                echo pyramid-pyramid-bsd
    148315        fi
    149         exit 0 ;;
    150     NILE:*:*:dcosx)
     316        exit ;;
     317    NILE*:*:*:dcosx)
    151318        echo pyramid-pyramid-svr4
    152         exit 0 ;;
     319        exit ;;
     320    DRS?6000:unix:4.0:6*)
     321        echo sparc-icl-nx6
     322        exit ;;
     323    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
     324        case `/usr/bin/uname -p` in
     325            sparc) echo sparc-icl-nx7; exit ;;
     326        esac ;;
     327    s390x:SunOS:*:*)
     328        echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     329        exit ;;
     330    sun4H:SunOS:5.*:*)
     331        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     332        exit ;;
    153333    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    154334        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    155         exit 0 ;;
    156     i86pc:SunOS:5.*:*)
    157         echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    158         exit 0 ;;
     335        exit ;;
     336    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
     337        eval $set_cc_for_build
     338        SUN_ARCH="i386"
     339        # If there is a compiler, see if it is configured for 64-bit objects.
     340        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
     341        # This test works for both compilers.
     342        if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     343            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
     344                (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     345                grep IS_64BIT_ARCH >/dev/null
     346            then
     347                SUN_ARCH="x86_64"
     348            fi
     349        fi
     350        echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     351        exit ;;
    159352    sun4*:SunOS:6*:*)
    160353        # According to config.sub, this is the proper way to canonicalize
     
    162355        # it's likely to be more like Solaris than SunOS4.
    163356        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    164         exit 0 ;;
     357        exit ;;
    165358    sun4*:SunOS:*:*)
    166359        case "`/usr/bin/arch -k`" in
     
    171364        # Japanese Language versions have a version number like `4.1.3-JL'.
    172365        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
    173         exit 0 ;;
     366        exit ;;
    174367    sun3*:SunOS:*:*)
    175368        echo m68k-sun-sunos${UNAME_RELEASE}
    176         exit 0 ;;
     369        exit ;;
    177370    sun*:*:4.2BSD:*)
    178         UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
     371        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
    179372        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
    180373        case "`/bin/arch`" in
     
    186379                ;;
    187380        esac
    188         exit 0 ;;
     381        exit ;;
    189382    aushp:SunOS:*:*)
    190383        echo sparc-auspex-sunos${UNAME_RELEASE}
    191         exit 0 ;;
    192     atari*:NetBSD:*:*)
    193         echo m68k-atari-netbsd${UNAME_RELEASE}
    194         exit 0 ;;
    195     atari*:OpenBSD:*:*)
    196         echo m68k-unknown-openbsd${UNAME_RELEASE}
    197         exit 0 ;;
    198     sun3*:NetBSD:*:*)
    199         echo m68k-sun-netbsd${UNAME_RELEASE}
    200         exit 0 ;;
    201     sun3*:OpenBSD:*:*)
    202         echo m68k-unknown-openbsd${UNAME_RELEASE}
    203         exit 0 ;;
    204     mac68k:NetBSD:*:*)
    205         echo m68k-apple-netbsd${UNAME_RELEASE}
    206         exit 0 ;;
    207     mac68k:OpenBSD:*:*)
    208         echo m68k-unknown-openbsd${UNAME_RELEASE}
    209         exit 0 ;;
    210     mvme68k:OpenBSD:*:*)
    211         echo m68k-unknown-openbsd${UNAME_RELEASE}
    212         exit 0 ;;
    213     mvme88k:OpenBSD:*:*)
    214         echo m88k-unknown-openbsd${UNAME_RELEASE}
    215         exit 0 ;;
     384        exit ;;
     385    # The situation for MiNT is a little confusing.  The machine name
     386    # can be virtually everything (everything which is not
     387    # "atarist" or "atariste" at least should have a processor
     388    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
     389    # to the lowercase version "mint" (or "freemint").  Finally
     390    # the system name "TOS" denotes a system which is actually not
     391    # MiNT.  But MiNT is downward compatible to TOS, so this should
     392    # be no problem.
     393    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
     394        echo m68k-atari-mint${UNAME_RELEASE}
     395        exit ;;
     396    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
     397        echo m68k-atari-mint${UNAME_RELEASE}
     398        exit ;;
     399    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
     400        echo m68k-atari-mint${UNAME_RELEASE}
     401        exit ;;
     402    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
     403        echo m68k-milan-mint${UNAME_RELEASE}
     404        exit ;;
     405    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
     406        echo m68k-hades-mint${UNAME_RELEASE}
     407        exit ;;
     408    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
     409        echo m68k-unknown-mint${UNAME_RELEASE}
     410        exit ;;
     411    m68k:machten:*:*)
     412        echo m68k-apple-machten${UNAME_RELEASE}
     413        exit ;;
    216414    powerpc:machten:*:*)
    217415        echo powerpc-apple-machten${UNAME_RELEASE}
    218         exit 0 ;;
     416        exit ;;
    219417    RISC*:Mach:*:*)
    220418        echo mips-dec-mach_bsd4.3
    221         exit 0 ;;
     419        exit ;;
    222420    RISC*:ULTRIX:*:*)
    223421        echo mips-dec-ultrix${UNAME_RELEASE}
    224         exit 0 ;;
     422        exit ;;
    225423    VAX*:ULTRIX*:*:*)
    226424        echo vax-dec-ultrix${UNAME_RELEASE}
    227         exit 0 ;;
    228     2020:CLIX:*:*)
     425        exit ;;
     426    2020:CLIX:*:* | 2430:CLIX:*:*)
    229427        echo clipper-intergraph-clix${UNAME_RELEASE}
    230         exit 0 ;;
     428        exit ;;
    231429    mips:*:*:UMIPS | mips:*:*:RISCos)
    232         sed 's/^        //' << EOF >dummy.c
    233         int main (argc, argv) int argc; char **argv; {
     430        eval $set_cc_for_build
     431        sed 's/^        //' << EOF >$dummy.c
     432#ifdef __cplusplus
     433#include <stdio.h>  /* for printf() prototype */
     434        int main (int argc, char *argv[]) {
     435#else
     436        int main (argc, argv) int argc; char *argv[]; {
     437#endif
    234438        #if defined (host_mips) && defined (MIPSEB)
    235439        #if defined (SYSTYPE_SYSV)
     
    246450        }
    247451EOF
    248         ${CC-cc} dummy.c -o dummy \
    249           && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
    250           && rm dummy.c dummy && exit 0
    251         rm -f dummy.c dummy
     452        $CC_FOR_BUILD -o $dummy $dummy.c &&
     453          dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
     454          SYSTEM_NAME=`$dummy $dummyarg` &&
     455            { echo "$SYSTEM_NAME"; exit; }
    252456        echo mips-mips-riscos${UNAME_RELEASE}
    253         exit 0 ;;
     457        exit ;;
     458    Motorola:PowerMAX_OS:*:*)
     459        echo powerpc-motorola-powermax
     460        exit ;;
     461    Motorola:*:4.3:PL8-*)
     462        echo powerpc-harris-powermax
     463        exit ;;
     464    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
     465        echo powerpc-harris-powermax
     466        exit ;;
    254467    Night_Hawk:Power_UNIX:*:*)
    255468        echo powerpc-harris-powerunix
    256         exit 0 ;;
     469        exit ;;
    257470    m88k:CX/UX:7*:*)
    258471        echo m88k-harris-cxux7
    259         exit 0 ;;
     472        exit ;;
    260473    m88k:*:4*:R4*)
    261474        echo m88k-motorola-sysv4
    262         exit 0 ;;
     475        exit ;;
    263476    m88k:*:3*:R3*)
    264477        echo m88k-motorola-sysv3
    265         exit 0 ;;
     478        exit ;;
    266479    AViiON:dgux:*:*)
    267480        # DG/UX returns AViiON for all architectures
    268481        UNAME_PROCESSOR=`/usr/bin/uname -p`
    269         if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
    270         if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
    271              -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
     482        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
     483        then
     484            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
     485               [ ${TARGET_BINARY_INTERFACE}x = x ]
     486            then
    272487                echo m88k-dg-dgux${UNAME_RELEASE}
     488            else
     489                echo m88k-dg-dguxbcs${UNAME_RELEASE}
     490            fi
    273491        else
    274                 echo m88k-dg-dguxbcs${UNAME_RELEASE}
    275         fi
    276         else echo i586-dg-dgux${UNAME_RELEASE}
    277         fi
    278         exit 0 ;;
     492            echo i586-dg-dgux${UNAME_RELEASE}
     493        fi
     494        exit ;;
    279495    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    280496        echo m88k-dolphin-sysv3
    281         exit 0 ;;
     497        exit ;;
    282498    M88*:*:R3*:*)
    283499        # Delta 88k system running SVR3
    284500        echo m88k-motorola-sysv3
    285         exit 0 ;;
     501        exit ;;
    286502    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
    287503        echo m88k-tektronix-sysv3
    288         exit 0 ;;
     504        exit ;;
    289505    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
    290506        echo m68k-tektronix-bsd
    291         exit 0 ;;
     507        exit ;;
    292508    *:IRIX*:*:*)
    293509        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
    294         exit 0 ;;
     510        exit ;;
    295511    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    296         echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
    297         exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
    298     i?86:AIX:*:*)
     512        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
     513        exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     514    i*86:AIX:*:*)
    299515        echo i386-ibm-aix
    300         exit 0 ;;
     516        exit ;;
     517    ia64:AIX:*:*)
     518        if [ -x /usr/bin/oslevel ] ; then
     519                IBM_REV=`/usr/bin/oslevel`
     520        else
     521                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
     522        fi
     523        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
     524        exit ;;
    301525    *:AIX:2:3)
    302526        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
    303                 sed 's/^                //' << EOF >dummy.c
     527                eval $set_cc_for_build
     528                sed 's/^                //' << EOF >$dummy.c
    304529                #include <sys/systemcfg.h>
    305530
     
    312537                        }
    313538EOF
    314                 ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
    315                 rm -f dummy.c dummy
    316                 echo rs6000-ibm-aix3.2.5
     539                if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
     540                then
     541                        echo "$SYSTEM_NAME"
     542                else
     543                        echo rs6000-ibm-aix3.2.5
     544                fi
    317545        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
    318546                echo rs6000-ibm-aix3.2.4
     
    320548                echo rs6000-ibm-aix3.2
    321549        fi
    322         exit 0 ;;
    323     *:AIX:*:4)
    324         if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
     550        exit ;;
     551    *:AIX:*:[456])
     552        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
     553        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
    325554                IBM_ARCH=rs6000
    326555        else
     
    330559                IBM_REV=`/usr/bin/oslevel`
    331560        else
    332                 IBM_REV=4.${UNAME_RELEASE}
     561                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    333562        fi
    334563        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
    335         exit 0 ;;
     564        exit ;;
    336565    *:AIX:*:*)
    337566        echo rs6000-ibm-aix
    338         exit 0 ;;
     567        exit ;;
    339568    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
    340569        echo romp-ibm-bsd4.4
    341         exit 0 ;;
    342     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
     570        exit ;;
     571    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    343572        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
    344         exit 0 ;;                           # report: romp-ibm BSD 4.3
     573        exit ;;                             # report: romp-ibm BSD 4.3
    345574    *:BOSX:*:*)
    346575        echo rs6000-bull-bosx
    347         exit 0 ;;
     576        exit ;;
    348577    DPX/2?00:B.O.S.:*:*)
    349578        echo m68k-bull-sysv3
    350         exit 0 ;;
     579        exit ;;
    351580    9000/[34]??:4.3bsd:1.*:*)
    352581        echo m68k-hp-bsd
    353         exit 0 ;;
     582        exit ;;
    354583    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
    355584        echo m68k-hp-bsd4.4
    356         exit 0 ;;
    357     9000/[3478]??:HP-UX:*:*)
     585        exit ;;
     586    9000/[34678]??:HP-UX:*:*)
     587        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    358588        case "${UNAME_MACHINE}" in
    359589            9000/31? )            HP_ARCH=m68000 ;;
    360590            9000/[34]?? )         HP_ARCH=m68k ;;
    361             9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
    362             9000/8?? )            HP_ARCH=hppa1.0 ;;
     591            9000/[678][0-9][0-9])
     592                if [ -x /usr/bin/getconf ]; then
     593                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
     594                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
     595                    case "${sc_cpu_version}" in
     596                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
     597                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
     598                      532)                      # CPU_PA_RISC2_0
     599                        case "${sc_kernel_bits}" in
     600                          32) HP_ARCH="hppa2.0n" ;;
     601                          64) HP_ARCH="hppa2.0w" ;;
     602                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
     603                        esac ;;
     604                    esac
     605                fi
     606                if [ "${HP_ARCH}" = "" ]; then
     607                    eval $set_cc_for_build
     608                    sed 's/^              //' << EOF >$dummy.c
     609
     610              #define _HPUX_SOURCE
     611              #include <stdlib.h>
     612              #include <unistd.h>
     613
     614              int main ()
     615              {
     616              #if defined(_SC_KERNEL_BITS)
     617                  long bits = sysconf(_SC_KERNEL_BITS);
     618              #endif
     619                  long cpu  = sysconf (_SC_CPU_VERSION);
     620
     621                  switch (cpu)
     622                {
     623                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
     624                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
     625                case CPU_PA_RISC2_0:
     626              #if defined(_SC_KERNEL_BITS)
     627                    switch (bits)
     628                        {
     629                        case 64: puts ("hppa2.0w"); break;
     630                        case 32: puts ("hppa2.0n"); break;
     631                        default: puts ("hppa2.0"); break;
     632                        } break;
     633              #else  /* !defined(_SC_KERNEL_BITS) */
     634                    puts ("hppa2.0"); break;
     635              #endif
     636                default: puts ("hppa1.0"); break;
     637                }
     638                  exit (0);
     639              }
     640EOF
     641                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
     642                    test -z "$HP_ARCH" && HP_ARCH=hppa
     643                fi ;;
    363644        esac
     645        if [ ${HP_ARCH} = "hppa2.0w" ]
     646        then
     647            eval $set_cc_for_build
     648
     649            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
     650            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
     651            # generating 64-bit code.  GNU and HP use different nomenclature:
     652            #
     653            # $ CC_FOR_BUILD=cc ./config.guess
     654            # => hppa2.0w-hp-hpux11.23
     655            # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
     656            # => hppa64-hp-hpux11.23
     657
     658            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
     659                grep __LP64__ >/dev/null
     660            then
     661                HP_ARCH="hppa2.0w"
     662            else
     663                HP_ARCH="hppa64"
     664            fi
     665        fi
     666        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
     667        exit ;;
     668    ia64:HP-UX:*:*)
    364669        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    365         echo ${HP_ARCH}-hp-hpux${HPUX_REV}
    366         exit 0 ;;
     670        echo ia64-hp-hpux${HPUX_REV}
     671        exit ;;
    367672    3050*:HI-UX:*:*)
    368         sed 's/^        //' << EOF >dummy.c
     673        eval $set_cc_for_build
     674        sed 's/^        //' << EOF >$dummy.c
    369675        #include <unistd.h>
    370676        int
     
    391697        }
    392698EOF
    393         ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
    394         rm -f dummy.c dummy
     699        $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
     700                { echo "$SYSTEM_NAME"; exit; }
    395701        echo unknown-hitachi-hiuxwe2
    396         exit 0 ;;
     702        exit ;;
    397703    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
    398704        echo hppa1.1-hp-bsd
    399         exit 0 ;;
     705        exit ;;
    400706    9000/8??:4.3bsd:*:*)
    401707        echo hppa1.0-hp-bsd
    402         exit 0 ;;
     708        exit ;;
     709    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
     710        echo hppa1.0-hp-mpeix
     711        exit ;;
    403712    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
    404713        echo hppa1.1-hp-osf
    405         exit 0 ;;
     714        exit ;;
    406715    hp8??:OSF1:*:*)
    407716        echo hppa1.0-hp-osf
    408         exit 0 ;;
    409     i?86:OSF1:*:*)
     717        exit ;;
     718    i*86:OSF1:*:*)
    410719        if [ -x /usr/sbin/sysversion ] ; then
    411720            echo ${UNAME_MACHINE}-unknown-osf1mk
     
    413722            echo ${UNAME_MACHINE}-unknown-osf1
    414723        fi
    415         exit 0 ;;
     724        exit ;;
    416725    parisc*:Lites*:*:*)
    417726        echo hppa1.1-hp-lites
    418         exit 0 ;;
     727        exit ;;
    419728    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    420729        echo c1-convex-bsd
    421         exit 0 ;;
     730        exit ;;
    422731    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    423732        if getsysinfo -f scalar_acc
     
    425734        else echo c2-convex-bsd
    426735        fi
    427         exit 0 ;;
     736        exit ;;
    428737    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    429738        echo c34-convex-bsd
    430         exit 0 ;;
     739        exit ;;
    431740    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    432741        echo c38-convex-bsd
    433         exit 0 ;;
     742        exit ;;
    434743    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    435744        echo c4-convex-bsd
    436         exit 0 ;;
    437     CRAY*X-MP:*:*:*)
    438         echo xmp-cray-unicos
    439         exit 0 ;;
     745        exit ;;
    440746    CRAY*Y-MP:*:*:*)
    441         echo ymp-cray-unicos${UNAME_RELEASE}
    442         exit 0 ;;
     747        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     748        exit ;;
    443749    CRAY*[A-Z]90:*:*:*)
    444750        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
    445751        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
    446               -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
    447         exit 0 ;;
     752              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
     753              -e 's/\.[^.]*$/.X/'
     754        exit ;;
    448755    CRAY*TS:*:*:*)
    449         echo t90-cray-unicos${UNAME_RELEASE}
    450         exit 0 ;;
    451     CRAY-2:*:*:*)
    452         echo cray2-cray-unicos
    453         exit 0 ;;
    454     F300:UNIX_System_V:*:*)
    455         FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
     756        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     757        exit ;;
     758    CRAY*T3E:*:*:*)
     759        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     760        exit ;;
     761    CRAY*SV1:*:*:*)
     762        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     763        exit ;;
     764    *:UNICOS/mp:*:*)
     765        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     766        exit ;;
     767    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
     768        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     769        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    456770        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    457         echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    458         exit 0 ;;
    459     F301:UNIX_System_V:*:*)
    460        echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
    461        exit 0 ;;
    462     hp3[0-9][05]:NetBSD:*:*)
    463         echo m68k-hp-netbsd${UNAME_RELEASE}
    464         exit 0 ;;
    465     hp300:OpenBSD:*:*)
    466         echo m68k-unknown-openbsd${UNAME_RELEASE}
    467         exit 0 ;;
    468     i?86:BSD/386:*:* | *:BSD/OS:*:*)
     771        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     772        exit ;;
     773    5000:UNIX_System_V:4.*:*)
     774        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     775        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     776        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     777        exit ;;
     778    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    469779        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
    470         exit 0 ;;
     780        exit ;;
     781    sparc*:BSD/OS:*:*)
     782        echo sparc-unknown-bsdi${UNAME_RELEASE}
     783        exit ;;
     784    *:BSD/OS:*:*)
     785        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
     786        exit ;;
    471787    *:FreeBSD:*:*)
    472         echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    473         exit 0 ;;
    474     *:NetBSD:*:*)
    475         echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    476         exit 0 ;;
    477     *:OpenBSD:*:*)
    478         echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    479         exit 0 ;;
     788        case ${UNAME_MACHINE} in
     789            pc98)
     790                echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     791            amd64)
     792                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     793            *)
     794                echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     795        esac
     796        exit ;;
    480797    i*:CYGWIN*:*)
    481         echo i386-pc-cygwin32
    482         exit 0 ;;
    483     i*:MINGW*:*)
    484         echo i386-pc-mingw32
    485         exit 0 ;;
     798        echo ${UNAME_MACHINE}-pc-cygwin
     799        exit ;;
     800    *:MINGW*:*)
     801        echo ${UNAME_MACHINE}-pc-mingw32
     802        exit ;;
     803    i*:windows32*:*)
     804        # uname -m includes "-pc" on this system.
     805        echo ${UNAME_MACHINE}-mingw32
     806        exit ;;
     807    i*:PW*:*)
     808        echo ${UNAME_MACHINE}-pc-pw32
     809        exit ;;
     810    *:Interix*:[3456]*)
     811        case ${UNAME_MACHINE} in
     812            x86)
     813                echo i586-pc-interix${UNAME_RELEASE}
     814                exit ;;
     815            EM64T | authenticamd | genuineintel)
     816                echo x86_64-unknown-interix${UNAME_RELEASE}
     817                exit ;;
     818            IA64)
     819                echo ia64-unknown-interix${UNAME_RELEASE}
     820                exit ;;
     821        esac ;;
     822    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
     823        echo i${UNAME_MACHINE}-pc-mks
     824        exit ;;
     825    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
     826        # How do we know it's Interix rather than the generic POSIX subsystem?
     827        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
     828        # UNAME_MACHINE based on the output of uname instead of i386?
     829        echo i586-pc-interix
     830        exit ;;
     831    i*:UWIN*:*)
     832        echo ${UNAME_MACHINE}-pc-uwin
     833        exit ;;
     834    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
     835        echo x86_64-unknown-cygwin
     836        exit ;;
    486837    p*:CYGWIN*:*)
    487         echo powerpcle-unknown-cygwin32
    488         exit 0 ;;
     838        echo powerpcle-unknown-cygwin
     839        exit ;;
    489840    prep*:SunOS:5.*:*)
    490841        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    491         exit 0 ;;
     842        exit ;;
    492843    *:GNU:*:*)
     844        # the GNU system
    493845        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    494         exit 0 ;;
    495     *:Linux:*:*)
     846        exit ;;
     847    *:GNU/*:*:*)
     848        # other systems with GNU libc and userland
     849        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
     850        exit ;;
     851    i*86:Minix:*:*)
     852        echo ${UNAME_MACHINE}-pc-minix
     853        exit ;;
     854    arm*:Linux:*:*)
     855        eval $set_cc_for_build
     856        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
     857            | grep -q __ARM_EABI__
     858        then
     859            echo ${UNAME_MACHINE}-unknown-linux-gnu
     860        else
     861            echo ${UNAME_MACHINE}-unknown-linux-gnueabi
     862        fi
     863        exit ;;
     864    avr32*:Linux:*:*)
     865        echo ${UNAME_MACHINE}-unknown-linux-gnu
     866        exit ;;
     867    cris:Linux:*:*)
     868        echo cris-axis-linux-gnu
     869        exit ;;
     870    crisv32:Linux:*:*)
     871        echo crisv32-axis-linux-gnu
     872        exit ;;
     873    frv:Linux:*:*)
     874        echo frv-unknown-linux-gnu
     875        exit ;;
     876    ia64:Linux:*:*)
     877        echo ${UNAME_MACHINE}-unknown-linux-gnu
     878        exit ;;
     879    m32r*:Linux:*:*)
     880        echo ${UNAME_MACHINE}-unknown-linux-gnu
     881        exit ;;
     882    m68*:Linux:*:*)
     883        echo ${UNAME_MACHINE}-unknown-linux-gnu
     884        exit ;;
     885    mips:Linux:*:*)
     886        eval $set_cc_for_build
     887        sed 's/^        //' << EOF >$dummy.c
     888        #undef CPU
     889        #undef mips
     890        #undef mipsel
     891        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
     892        CPU=mipsel
     893        #else
     894        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
     895        CPU=mips
     896        #else
     897        CPU=
     898        #endif
     899        #endif
     900EOF
     901        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     902            /^CPU/{
     903                s: ::g
     904                p
     905            }'`"
     906        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     907        ;;
     908    mips64:Linux:*:*)
     909        eval $set_cc_for_build
     910        sed 's/^        //' << EOF >$dummy.c
     911        #undef CPU
     912        #undef mips64
     913        #undef mips64el
     914        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
     915        CPU=mips64el
     916        #else
     917        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
     918        CPU=mips64
     919        #else
     920        CPU=
     921        #endif
     922        #endif
     923EOF
     924        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     925            /^CPU/{
     926                s: ::g
     927                p
     928            }'`"
     929        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
     930        ;;
     931    or32:Linux:*:*)
     932        echo or32-unknown-linux-gnu
     933        exit ;;
     934    ppc:Linux:*:*)
     935        echo powerpc-unknown-linux-gnu
     936        exit ;;
     937    ppc64:Linux:*:*)
     938        echo powerpc64-unknown-linux-gnu
     939        exit ;;
     940    alpha:Linux:*:*)
     941        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
     942          EV5)   UNAME_MACHINE=alphaev5 ;;
     943          EV56)  UNAME_MACHINE=alphaev56 ;;
     944          PCA56) UNAME_MACHINE=alphapca56 ;;
     945          PCA57) UNAME_MACHINE=alphapca56 ;;
     946          EV6)   UNAME_MACHINE=alphaev6 ;;
     947          EV67)  UNAME_MACHINE=alphaev67 ;;
     948          EV68*) UNAME_MACHINE=alphaev68 ;;
     949        esac
     950        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
     951        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
     952        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
     953        exit ;;
     954    padre:Linux:*:*)
     955        echo sparc-unknown-linux-gnu
     956        exit ;;
     957    parisc:Linux:*:* | hppa:Linux:*:*)
     958        # Look for CPU level
     959        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
     960          PA7*) echo hppa1.1-unknown-linux-gnu ;;
     961          PA8*) echo hppa2.0-unknown-linux-gnu ;;
     962          *)    echo hppa-unknown-linux-gnu ;;
     963        esac
     964        exit ;;
     965    parisc64:Linux:*:* | hppa64:Linux:*:*)
     966        echo hppa64-unknown-linux-gnu
     967        exit ;;
     968    s390:Linux:*:* | s390x:Linux:*:*)
     969        echo ${UNAME_MACHINE}-ibm-linux
     970        exit ;;
     971    sh64*:Linux:*:*)
     972        echo ${UNAME_MACHINE}-unknown-linux-gnu
     973        exit ;;
     974    sh*:Linux:*:*)
     975        echo ${UNAME_MACHINE}-unknown-linux-gnu
     976        exit ;;
     977    sparc:Linux:*:* | sparc64:Linux:*:*)
     978        echo ${UNAME_MACHINE}-unknown-linux-gnu
     979        exit ;;
     980    vax:Linux:*:*)
     981        echo ${UNAME_MACHINE}-dec-linux-gnu
     982        exit ;;
     983    x86_64:Linux:*:*)
     984        echo x86_64-unknown-linux-gnu
     985        exit ;;
     986    xtensa*:Linux:*:*)
     987        echo ${UNAME_MACHINE}-unknown-linux-gnu
     988        exit ;;
     989    i*86:Linux:*:*)
    496990        # The BFD linker knows what the default object file format is, so
    497         # first see if it will tell us.
    498         ld_help_string=`ld --help 2>&1`
    499         ld_supported_emulations=`echo $ld_help_string \
    500                          | sed -ne '/supported emulations:/!d
     991        # first see if it will tell us. cd to the root directory to prevent
     992        # problems with other programs or directories called `ld' in the path.
     993        # Set LC_ALL=C to ensure ld outputs messages in English.
     994        ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
     995                         | sed -ne '/supported targets:/!d
    501996                                    s/[         ][      ]*/ /g
    502                                     s/.*supported emulations: *//
     997                                    s/.*supported targets: *//
    503998                                    s/ .*//
    504999                                    p'`
    505         case "$ld_supported_emulations" in
    506           i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
    507           i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
    508           sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
    509           m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
    510           elf32ppc)   echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
     1000        case "$ld_supported_targets" in
     1001          elf32-i386)
     1002                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
     1003                ;;
     1004          a.out-i386-linux)
     1005                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
     1006                exit ;;
     1007          "")
     1008                # Either a pre-BFD a.out linker (linux-gnuoldld) or
     1009                # one that does not give us useful --help.
     1010                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
     1011                exit ;;
    5111012        esac
    512 
    513         if test "${UNAME_MACHINE}" = "alpha" ; then
    514                 sed 's/^        //'  <<EOF >dummy.s
    515                 .globl main
    516                 .ent main
    517         main:
    518                 .frame \$30,0,\$26,0
    519                 .prologue 0
    520                 .long 0x47e03d80 # implver $0
    521                 lda \$2,259
    522                 .long 0x47e20c21 # amask $2,$1
    523                 srl \$1,8,\$2
    524                 sll \$2,2,\$2
    525                 sll \$0,3,\$0
    526                 addl \$1,\$0,\$0
    527                 addl \$2,\$0,\$0
    528                 ret \$31,(\$26),1
    529                 .end main
     1013        # Determine whether the default compiler is a.out or elf
     1014        eval $set_cc_for_build
     1015        sed 's/^        //' << EOF >$dummy.c
     1016        #include <features.h>
     1017        #ifdef __ELF__
     1018        # ifdef __GLIBC__
     1019        #  if __GLIBC__ >= 2
     1020        LIBC=gnu
     1021        #  else
     1022        LIBC=gnulibc1
     1023        #  endif
     1024        # else
     1025        LIBC=gnulibc1
     1026        # endif
     1027        #else
     1028        #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
     1029        LIBC=gnu
     1030        #else
     1031        LIBC=gnuaout
     1032        #endif
     1033        #endif
     1034        #ifdef __dietlibc__
     1035        LIBC=dietlibc
     1036        #endif
    5301037EOF
    531                 LIBC=""
    532                 ${CC-cc} dummy.s -o dummy 2>/dev/null
    533                 if test "$?" = 0 ; then
    534                         ./dummy
    535                         case "$?" in
    536                         7)
    537                                 UNAME_MACHINE="alpha"
    538                                 ;;
    539                         15)
    540                                 UNAME_MACHINE="alphaev5"
    541                                 ;;
    542                         14)
    543                                 UNAME_MACHINE="alphaev56"
    544                                 ;;
    545                         10)
    546                                 UNAME_MACHINE="alphapca56"
    547                                 ;;
    548                         16)
    549                                 UNAME_MACHINE="alphaev6"
    550                                 ;;
    551                         esac   
    552 
    553                         objdump --private-headers dummy | \
    554                           grep ld.so.1 > /dev/null
    555                         if test "$?" = 0 ; then
    556                                 LIBC="libc1"
    557                         fi
    558                 fi     
    559                 rm -f dummy.s dummy
    560                 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
    561         elif test "${UNAME_MACHINE}" = "mips" ; then
    562           cat >dummy.c <<EOF
    563 main(argc, argv)
    564      int argc;
    565      char *argv[];
    566 {
    567 #ifdef __MIPSEB__
    568   printf ("%s-unknown-linux-gnu\n", argv[1]);
    569 #endif
    570 #ifdef __MIPSEL__
    571   printf ("%sel-unknown-linux-gnu\n", argv[1]);
    572 #endif
    573   return 0;
    574 }
    575 EOF
    576           ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
    577           rm -f dummy.c dummy
    578         else
    579           # Either a pre-BFD a.out linker (linux-gnuoldld)
    580           # or one that does not give us useful --help.
    581           # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
    582           # If ld does not provide *any* "supported emulations:"
    583           # that means it is gnuoldld.
    584           echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
    585           test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
    586 
    587           case "${UNAME_MACHINE}" in
    588           i?86)
    589             VENDOR=pc;
    590             ;;
    591           *)
    592             VENDOR=unknown;
    593             ;;
    594           esac
    595           # Determine whether the default compiler is a.out or elf
    596           cat >dummy.c <<EOF
    597 #include <features.h>
    598 main(argc, argv)
    599      int argc;
    600      char *argv[];
    601 {
    602 #ifdef __ELF__
    603 # ifdef __GLIBC__
    604 #  if __GLIBC__ >= 2
    605     printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
    606 #  else
    607     printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
    608 #  endif
    609 # else
    610    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
    611 # endif
    612 #else
    613   printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
    614 #endif
    615   return 0;
    616 }
    617 EOF
    618           ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
    619           rm -f dummy.c dummy
    620         fi ;;
    621 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
    622 # are messed up and put the nodename in both sysname and nodename.
    623     i?86:DYNIX/ptx:4*:*)
     1038        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     1039            /^LIBC/{
     1040                s: ::g
     1041                p
     1042            }'`"
     1043        test x"${LIBC}" != x && {
     1044                echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
     1045                exit
     1046        }
     1047        test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
     1048        ;;
     1049    i*86:DYNIX/ptx:4*:*)
     1050        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
     1051        # earlier versions are messed up and put the nodename in both
     1052        # sysname and nodename.
    6241053        echo i386-sequent-sysv4
    625         exit 0 ;;
    626     i?86:UNIX_SV:4.2MP:2.*)
     1054        exit ;;
     1055    i*86:UNIX_SV:4.2MP:2.*)
    6271056        # Unixware is an offshoot of SVR4, but it has its own version
    6281057        # number series starting with 2...
     
    6311060        # Use sysv4.2uw... so that sysv4* matches it.
    6321061        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    633         exit 0 ;;
    634     i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
     1062        exit ;;
     1063    i*86:OS/2:*:*)
     1064        # If we were able to find `uname', then EMX Unix compatibility
     1065        # is probably installed.
     1066        echo ${UNAME_MACHINE}-pc-os2-emx
     1067        exit ;;
     1068    i*86:XTS-300:*:STOP)
     1069        echo ${UNAME_MACHINE}-unknown-stop
     1070        exit ;;
     1071    i*86:atheos:*:*)
     1072        echo ${UNAME_MACHINE}-unknown-atheos
     1073        exit ;;
     1074    i*86:syllable:*:*)
     1075        echo ${UNAME_MACHINE}-pc-syllable
     1076        exit ;;
     1077    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
     1078        echo i386-unknown-lynxos${UNAME_RELEASE}
     1079        exit ;;
     1080    i*86:*DOS:*:*)
     1081        echo ${UNAME_MACHINE}-pc-msdosdjgpp
     1082        exit ;;
     1083    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
     1084        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
    6351085        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
    636                 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
     1086                echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
    6371087        else
    638                 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
    639         fi
    640         exit 0 ;;
    641     i?86:*:3.2:*)
     1088                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
     1089        fi
     1090        exit ;;
     1091    i*86:*:5:[678]*)
     1092        # UnixWare 7.x, OpenUNIX and OpenServer 6.
     1093        case `/bin/uname -X | grep "^Machine"` in
     1094            *486*)           UNAME_MACHINE=i486 ;;
     1095            *Pentium)        UNAME_MACHINE=i586 ;;
     1096            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
     1097        esac
     1098        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
     1099        exit ;;
     1100    i*86:*:3.2:*)
    6421101        if test -f /usr/options/cb.name; then
    6431102                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
    6441103                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
    6451104        elif /bin/uname -X 2>/dev/null >/dev/null ; then
    646                 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
    647                 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
    648                 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
     1105                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
     1106                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
     1107                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
    6491108                        && UNAME_MACHINE=i586
     1109                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
     1110                        && UNAME_MACHINE=i686
     1111                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
     1112                        && UNAME_MACHINE=i686
    6501113                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
    6511114        else
    6521115                echo ${UNAME_MACHINE}-pc-sysv32
    6531116        fi
    654         exit 0 ;;
     1117        exit ;;
    6551118    pc:*:*:*)
     1119        # Left here for compatibility:
    6561120        # uname -m prints for DJGPP always 'pc', but it prints nothing about
    657         # the processor, so we play safe by assuming i386.
    658         echo i386-pc-msdosdjgpp
    659         exit 0 ;;
     1121        # the processor, so we play safe by assuming i586.
     1122        # Note: whatever this is, it MUST be the same as what config.sub
     1123        # prints for the "djgpp" host, or else GDB configury will decide that
     1124        # this is a cross-build.
     1125        echo i586-pc-msdosdjgpp
     1126        exit ;;
    6601127    Intel:Mach:3*:*)
    6611128        echo i386-pc-mach3
    662         exit 0 ;;
     1129        exit ;;
    6631130    paragon:*:*:*)
    6641131        echo i860-intel-osf1
    665         exit 0 ;;
     1132        exit ;;
    6661133    i860:*:4.*:*) # i860-SVR4
    6671134        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
     
    6701137          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
    6711138        fi
    672         exit 0 ;;
     1139        exit ;;
    6731140    mini*:CTIX:SYS*5:*)
    6741141        # "miniframe"
    6751142        echo m68010-convergent-sysv
    676         exit 0 ;;
    677     M68*:*:R3V[567]*:*)
    678         test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    679     3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
     1143        exit ;;
     1144    mc68k:UNIX:SYSTEM5:3.51m)
     1145        echo m68k-convergent-sysv
     1146        exit ;;
     1147    M680?0:D-NIX:5.3:*)
     1148        echo m68k-diab-dnix
     1149        exit ;;
     1150    M68*:*:R3V[5678]*:*)
     1151        test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     1152    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
    6801153        OS_REL=''
    6811154        test -r /etc/.relid \
    6821155        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    6831156        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    684           && echo i486-ncr-sysv4.3${OS_REL} && exit 0
     1157          && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
    6851158        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    686           && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     1159          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    6871160    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    6881161        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    689           && echo i486-ncr-sysv4 && exit 0 ;;
    690     m68*:LynxOS:2.*:*)
     1162          && { echo i486-ncr-sysv4; exit; } ;;
     1163    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
     1164        OS_REL='.3'
     1165        test -r /etc/.relid \
     1166            && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
     1167        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     1168            && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1169        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
     1170            && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
     1171        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
     1172            && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     1173    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    6911174        echo m68k-unknown-lynxos${UNAME_RELEASE}
    692         exit 0 ;;
     1175        exit ;;
    6931176    mc68030:UNIX_System_V:4.*:*)
    6941177        echo m68k-atari-sysv4
    695         exit 0 ;;
    696     i?86:LynxOS:2.*:*)
    697         echo i386-unknown-lynxos${UNAME_RELEASE}
    698         exit 0 ;;
     1178        exit ;;
    6991179    TSUNAMI:LynxOS:2.*:*)
    7001180        echo sparc-unknown-lynxos${UNAME_RELEASE}
    701         exit 0 ;;
    702     rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
     1181        exit ;;
     1182    rs6000:LynxOS:2.*:*)
    7031183        echo rs6000-unknown-lynxos${UNAME_RELEASE}
    704         exit 0 ;;
     1184        exit ;;
     1185    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
     1186        echo powerpc-unknown-lynxos${UNAME_RELEASE}
     1187        exit ;;
    7051188    SM[BE]S:UNIX_SV:*:*)
    7061189        echo mips-dde-sysv${UNAME_RELEASE}
    707         exit 0 ;;
     1190        exit ;;
     1191    RM*:ReliantUNIX-*:*:*)
     1192        echo mips-sni-sysv4
     1193        exit ;;
    7081194    RM*:SINIX-*:*:*)
    7091195        echo mips-sni-sysv4
    710         exit 0 ;;
     1196        exit ;;
    7111197    *:SINIX-*:*:*)
    7121198        if uname -p 2>/dev/null >/dev/null ; then
     
    7161202                echo ns32k-sni-sysv
    7171203        fi
    718         exit 0 ;;
    719     PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    720                            # says <Richard.M.Bartel@ccMail.Census.GOV>
     1204        exit ;;
     1205    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
     1206                      # says <Richard.M.Bartel@ccMail.Census.GOV>
    7211207        echo i586-unisys-sysv4
    722         exit 0 ;;
     1208        exit ;;
    7231209    *:UNIX_System_V:4*:FTX*)
    7241210        # From Gerald Hewes <hewes@openmarket.com>.
    7251211        # How about differentiating between stratus architectures? -djm
    7261212        echo hppa1.1-stratus-sysv4
    727         exit 0 ;;
     1213        exit ;;
    7281214    *:*:*:FTX*)
    7291215        # From seanf@swdc.stratus.com.
    7301216        echo i860-stratus-sysv4
    731         exit 0 ;;
     1217        exit ;;
     1218    i*86:VOS:*:*)
     1219        # From Paul.Green@stratus.com.
     1220        echo ${UNAME_MACHINE}-stratus-vos
     1221        exit ;;
     1222    *:VOS:*:*)
     1223        # From Paul.Green@stratus.com.
     1224        echo hppa1.1-stratus-vos
     1225        exit ;;
    7321226    mc68*:A/UX:*:*)
    7331227        echo m68k-apple-aux${UNAME_RELEASE}
    734         exit 0 ;;
    735     news*:NEWS-OS:*:6*)
     1228        exit ;;
     1229    news*:NEWS-OS:6*:*)
    7361230        echo mips-sony-newsos6
    737         exit 0 ;;
    738     R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
     1231        exit ;;
     1232    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    7391233        if [ -d /usr/nec ]; then
    7401234                echo mips-nec-sysv${UNAME_RELEASE}
     
    7421236                echo mips-unknown-sysv${UNAME_RELEASE}
    7431237        fi
    744         exit 0 ;;
     1238        exit ;;
     1239    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
     1240        echo powerpc-be-beos
     1241        exit ;;
     1242    BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
     1243        echo powerpc-apple-beos
     1244        exit ;;
     1245    BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
     1246        echo i586-pc-beos
     1247        exit ;;
     1248    BePC:Haiku:*:*)     # Haiku running on Intel PC compatible.
     1249        echo i586-pc-haiku
     1250        exit ;;
     1251    SX-4:SUPER-UX:*:*)
     1252        echo sx4-nec-superux${UNAME_RELEASE}
     1253        exit ;;
     1254    SX-5:SUPER-UX:*:*)
     1255        echo sx5-nec-superux${UNAME_RELEASE}
     1256        exit ;;
     1257    SX-6:SUPER-UX:*:*)
     1258        echo sx6-nec-superux${UNAME_RELEASE}
     1259        exit ;;
     1260    SX-7:SUPER-UX:*:*)
     1261        echo sx7-nec-superux${UNAME_RELEASE}
     1262        exit ;;
     1263    SX-8:SUPER-UX:*:*)
     1264        echo sx8-nec-superux${UNAME_RELEASE}
     1265        exit ;;
     1266    SX-8R:SUPER-UX:*:*)
     1267        echo sx8r-nec-superux${UNAME_RELEASE}
     1268        exit ;;
     1269    Power*:Rhapsody:*:*)
     1270        echo powerpc-apple-rhapsody${UNAME_RELEASE}
     1271        exit ;;
     1272    *:Rhapsody:*:*)
     1273        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
     1274        exit ;;
     1275    *:Darwin:*:*)
     1276        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
     1277        case $UNAME_PROCESSOR in
     1278            unknown) UNAME_PROCESSOR=powerpc ;;
     1279        esac
     1280        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     1281        exit ;;
     1282    *:procnto*:*:* | *:QNX:[0123456789]*:*)
     1283        UNAME_PROCESSOR=`uname -p`
     1284        if test "$UNAME_PROCESSOR" = "x86"; then
     1285                UNAME_PROCESSOR=i386
     1286                UNAME_MACHINE=pc
     1287        fi
     1288        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
     1289        exit ;;
     1290    *:QNX:*:4*)
     1291        echo i386-pc-qnx
     1292        exit ;;
     1293    NSE-?:NONSTOP_KERNEL:*:*)
     1294        echo nse-tandem-nsk${UNAME_RELEASE}
     1295        exit ;;
     1296    NSR-?:NONSTOP_KERNEL:*:*)
     1297        echo nsr-tandem-nsk${UNAME_RELEASE}
     1298        exit ;;
     1299    *:NonStop-UX:*:*)
     1300        echo mips-compaq-nonstopux
     1301        exit ;;
     1302    BS2000:POSIX*:*:*)
     1303        echo bs2000-siemens-sysv
     1304        exit ;;
     1305    DS/*:UNIX_System_V:*:*)
     1306        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
     1307        exit ;;
     1308    *:Plan9:*:*)
     1309        # "uname -m" is not consistent, so use $cputype instead. 386
     1310        # is converted to i386 for consistency with other x86
     1311        # operating systems.
     1312        if test "$cputype" = "386"; then
     1313            UNAME_MACHINE=i386
     1314        else
     1315            UNAME_MACHINE="$cputype"
     1316        fi
     1317        echo ${UNAME_MACHINE}-unknown-plan9
     1318        exit ;;
     1319    *:TOPS-10:*:*)
     1320        echo pdp10-unknown-tops10
     1321        exit ;;
     1322    *:TENEX:*:*)
     1323        echo pdp10-unknown-tenex
     1324        exit ;;
     1325    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
     1326        echo pdp10-dec-tops20
     1327        exit ;;
     1328    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
     1329        echo pdp10-xkl-tops20
     1330        exit ;;
     1331    *:TOPS-20:*:*)
     1332        echo pdp10-unknown-tops20
     1333        exit ;;
     1334    *:ITS:*:*)
     1335        echo pdp10-unknown-its
     1336        exit ;;
     1337    SEI:*:*:SEIUX)
     1338        echo mips-sei-seiux${UNAME_RELEASE}
     1339        exit ;;
     1340    *:DragonFly:*:*)
     1341        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
     1342        exit ;;
     1343    *:*VMS:*:*)
     1344        UNAME_MACHINE=`(uname -p) 2>/dev/null`
     1345        case "${UNAME_MACHINE}" in
     1346            A*) echo alpha-dec-vms ; exit ;;
     1347            I*) echo ia64-dec-vms ; exit ;;
     1348            V*) echo vax-dec-vms ; exit ;;
     1349        esac ;;
     1350    *:XENIX:*:SysV)
     1351        echo i386-pc-xenix
     1352        exit ;;
     1353    i*86:skyos:*:*)
     1354        echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
     1355        exit ;;
     1356    i*86:rdos:*:*)
     1357        echo ${UNAME_MACHINE}-pc-rdos
     1358        exit ;;
     1359    i*86:AROS:*:*)
     1360        echo ${UNAME_MACHINE}-pc-aros
     1361        exit ;;
    7451362esac
    7461363
     
    7481365#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
    7491366
    750 cat >dummy.c <<EOF
     1367eval $set_cc_for_build
     1368cat >$dummy.c <<EOF
    7511369#ifdef _SEQUENT_
    7521370# include <sys/types.h>
     
    7731391
    7741392#if defined (__arm) && defined (__acorn) && defined (__unix)
    775   printf ("arm-acorn-riscix"); exit (0);
     1393  printf ("arm-acorn-riscix\n"); exit (0);
    7761394#endif
    7771395
     
    7861404  int version;
    7871405  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
    788   printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
     1406  if (version < 4)
     1407    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
     1408  else
     1409    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
    7891410  exit (0);
    7901411#endif
     
    8311452
    8321453#if defined (vax)
    833 #if !defined (ultrix)
    834   printf ("vax-dec-bsd\n"); exit (0);
    835 #else
    836   printf ("vax-dec-ultrix\n"); exit (0);
    837 #endif
     1454# if !defined (ultrix)
     1455#  include <sys/param.h>
     1456#  if defined (BSD)
     1457#   if BSD == 43
     1458      printf ("vax-dec-bsd4.3\n"); exit (0);
     1459#   else
     1460#    if BSD == 199006
     1461      printf ("vax-dec-bsd4.3reno\n"); exit (0);
     1462#    else
     1463      printf ("vax-dec-bsd\n"); exit (0);
     1464#    endif
     1465#   endif
     1466#  else
     1467    printf ("vax-dec-bsd\n"); exit (0);
     1468#  endif
     1469# else
     1470    printf ("vax-dec-ultrix\n"); exit (0);
     1471# endif
    8381472#endif
    8391473
     
    8461480EOF
    8471481
    848 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
    849 rm -f dummy.c dummy
     1482$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
     1483        { echo "$SYSTEM_NAME"; exit; }
    8501484
    8511485# Apollos put the system type in the environment.
    8521486
    853 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
     1487test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
    8541488
    8551489# Convex versions that predate uname can use getsysinfo(1)
     
    8601494    c1*)
    8611495        echo c1-convex-bsd
    862         exit 0 ;;
     1496        exit ;;
    8631497    c2*)
    8641498        if getsysinfo -f scalar_acc
     
    8661500        else echo c2-convex-bsd
    8671501        fi
    868         exit 0 ;;
     1502        exit ;;
    8691503    c34*)
    8701504        echo c34-convex-bsd
    871         exit 0 ;;
     1505        exit ;;
    8721506    c38*)
    8731507        echo c38-convex-bsd
    874         exit 0 ;;
     1508        exit ;;
    8751509    c4*)
    8761510        echo c4-convex-bsd
    877         exit 0 ;;
     1511        exit ;;
    8781512    esac
    8791513fi
    8801514
    881 #echo '(Unable to guess system type)' 1>&2
     1515cat >&2 <<EOF
     1516$0: unable to guess system type
     1517
     1518This script, last modified $timestamp, has failed to recognize
     1519the operating system you are using. It is advised that you
     1520download the most up to date version of the config scripts from
     1521
     1522  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     1523and
     1524  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
     1525
     1526If the version you run ($0) is already up to date, please
     1527send the following data and any information you think might be
     1528pertinent to <config-patches@gnu.org> in order to provide the needed
     1529information to handle your system.
     1530
     1531config.guess timestamp = $timestamp
     1532
     1533uname -m = `(uname -m) 2>/dev/null || echo unknown`
     1534uname -r = `(uname -r) 2>/dev/null || echo unknown`
     1535uname -s = `(uname -s) 2>/dev/null || echo unknown`
     1536uname -v = `(uname -v) 2>/dev/null || echo unknown`
     1537
     1538/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
     1539/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
     1540
     1541hostinfo               = `(hostinfo) 2>/dev/null`
     1542/bin/universe          = `(/bin/universe) 2>/dev/null`
     1543/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
     1544/bin/arch              = `(/bin/arch) 2>/dev/null`
     1545/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
     1546/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
     1547
     1548UNAME_MACHINE = ${UNAME_MACHINE}
     1549UNAME_RELEASE = ${UNAME_RELEASE}
     1550UNAME_SYSTEM  = ${UNAME_SYSTEM}
     1551UNAME_VERSION = ${UNAME_VERSION}
     1552EOF
    8821553
    8831554exit 1
     1555
     1556# Local variables:
     1557# eval: (add-hook 'write-file-hooks 'time-stamp)
     1558# time-stamp-start: "timestamp='"
     1559# time-stamp-format: "%:y-%02m-%02d"
     1560# time-stamp-end: "'"
     1561# End:
  • trunk/libjpeg/config.sub

    r15 r283  
    11#! /bin/sh
    2 # Configuration validation subroutine script, version 1.1.
    3 #   Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
     2# Configuration validation subroutine script.
     3#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     5#   Free Software Foundation, Inc.
     6
     7timestamp='2009-04-17'
     8
    49# This file is (in principle) common to ALL GNU software.
    510# The presence of a machine in this file suggests that SOME GNU software
     
    1823# You should have received a copy of the GNU General Public License
    1924# along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 59 Temple Place - Suite 330,
    21 # Boston, MA 02111-1307, USA.
    22 
     25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     26# 02110-1301, USA.
     27#
    2328# As a special exception to the GNU General Public License, if you
    2429# distribute this file as part of a program that contains a
     
    2631# the same distribution terms that you use for the rest of that program.
    2732
     33
     34# Please send patches to <config-patches@gnu.org>.  Submit a context
     35# diff and a properly formatted ChangeLog entry.
     36#
    2837# Configuration subroutine to validate and canonicalize a configuration type.
    2938# Supply the specified configuration type as an argument.
     
    4655# It is wrong to echo any other type of specification.
    4756
    48 if [ x$1 = x ]
    49 then
    50         echo Configuration name missing. 1>&2
    51         echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
    52         echo "or     $0 ALIAS" 1>&2
    53         echo where ALIAS is a recognized configuration type. 1>&2
    54         exit 1
    55 fi
    56 
    57 # First pass through any local machine types.
    58 case $1 in
    59         *local*)
    60                 echo $1
    61                 exit 0
    62                 ;;
    63         *)
    64         ;;
     57me=`echo "$0" | sed -e 's,.*/,,'`
     58
     59usage="\
     60Usage: $0 [OPTION] CPU-MFR-OPSYS
     61       $0 [OPTION] ALIAS
     62
     63Canonicalize a configuration name.
     64
     65Operation modes:
     66  -h, --help         print this help, then exit
     67  -t, --time-stamp   print date of last modification, then exit
     68  -v, --version      print version number, then exit
     69
     70Report bugs and patches to <config-patches@gnu.org>."
     71
     72version="\
     73GNU config.sub ($timestamp)
     74
     75Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
     762002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
     77
     78This is free software; see the source for copying conditions.  There is NO
     79warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
     80
     81help="
     82Try \`$me --help' for more information."
     83
     84# Parse command line
     85while test $# -gt 0 ; do
     86  case $1 in
     87    --time-stamp | --time* | -t )
     88       echo "$timestamp" ; exit ;;
     89    --version | -v )
     90       echo "$version" ; exit ;;
     91    --help | --h* | -h )
     92       echo "$usage"; exit ;;
     93    -- )     # Stop option processing
     94       shift; break ;;
     95    - ) # Use stdin as input.
     96       break ;;
     97    -* )
     98       echo "$me: invalid option $1$help"
     99       exit 1 ;;
     100
     101    *local*)
     102       # First pass through any local machine types.
     103       echo $1
     104       exit ;;
     105
     106    * )
     107       break ;;
     108  esac
     109done
     110
     111case $# in
     112 0) echo "$me: missing argument$help" >&2
     113    exit 1;;
     114 1) ;;
     115 *) echo "$me: too many arguments$help" >&2
     116    exit 1;;
    65117esac
    66118
     
    69121maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    70122case $maybe_os in
    71   linux-gnu*)
     123  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
     124  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
     125  kopensolaris*-gnu* | \
     126  storm-chaos* | os2-emx* | rtmk-nova*)
    72127    os=-$maybe_os
    73128    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     
    95150        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    96151        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    97         -apple)
     152        -apple | -axis | -knuth | -cray)
    98153                os=
    99154                basic_machine=$1
    100155                ;;
     156        -sim | -cisco | -oki | -wec | -winbond)
     157                os=
     158                basic_machine=$1
     159                ;;
     160        -scout)
     161                ;;
     162        -wrs)
     163                os=-vxworks
     164                basic_machine=$1
     165                ;;
     166        -chorusos*)
     167                os=-chorusos
     168                basic_machine=$1
     169                ;;
     170        -chorusrdb)
     171                os=-chorusrdb
     172                basic_machine=$1
     173                ;;
    101174        -hiux*)
    102175                os=-hiuxwe2
    103176                ;;
     177        -sco6)
     178                os=-sco5v6
     179                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     180                ;;
    104181        -sco5)
    105                 os=sco3.2v5
     182                os=-sco3.2v5
    106183                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    107184                ;;
     
    118195                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    119196                ;;
     197        -sco5v6*)
     198                # Don't forget version if it is 3.2v4 or newer.
     199                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     200                ;;
    120201        -sco*)
    121202                os=-sco3.2v2
    122203                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    123204                ;;
     205        -udk*)
     206                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     207                ;;
    124208        -isc)
    125209                os=-isc2.2
     
    143227        -psos*)
    144228                os=-psos
     229                ;;
     230        -mint | -mint[0-9]*)
     231                basic_machine=m68k-atari
     232                os=-mint
    145233                ;;
    146234esac
     
    150238        # Recognize the basic CPU types without company name.
    151239        # Some are omitted here because they have special meanings below.
    152         tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
    153                 | arme[lb] | pyramid | mn10200 | mn10300 \
    154                 | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
    155                 | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
    156                 | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
    157                 | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
    158                 | mipstx39 | mipstx39el \
    159                 | sparc | sparclet | sparclite | sparc64 | v850)
     240        1750a | 580 \
     241        | a29k \
     242        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
     243        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
     244        | am33_2.0 \
     245        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
     246        | bfin \
     247        | c4x | clipper \
     248        | d10v | d30v | dlx | dsp16xx \
     249        | fido | fr30 | frv \
     250        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     251        | i370 | i860 | i960 | ia64 \
     252        | ip2k | iq2000 \
     253        | lm32 \
     254        | m32c | m32r | m32rle | m68000 | m68k | m88k \
     255        | maxq | mb | microblaze | mcore | mep | metag \
     256        | mips | mipsbe | mipseb | mipsel | mipsle \
     257        | mips16 \
     258        | mips64 | mips64el \
     259        | mips64octeon | mips64octeonel \
     260        | mips64orion | mips64orionel \
     261        | mips64r5900 | mips64r5900el \
     262        | mips64vr | mips64vrel \
     263        | mips64vr4100 | mips64vr4100el \
     264        | mips64vr4300 | mips64vr4300el \
     265        | mips64vr5000 | mips64vr5000el \
     266        | mips64vr5900 | mips64vr5900el \
     267        | mipsisa32 | mipsisa32el \
     268        | mipsisa32r2 | mipsisa32r2el \
     269        | mipsisa64 | mipsisa64el \
     270        | mipsisa64r2 | mipsisa64r2el \
     271        | mipsisa64sb1 | mipsisa64sb1el \
     272        | mipsisa64sr71k | mipsisa64sr71kel \
     273        | mipstx39 | mipstx39el \
     274        | mn10200 | mn10300 \
     275        | moxie \
     276        | mt \
     277        | msp430 \
     278        | nios | nios2 \
     279        | ns16k | ns32k \
     280        | or32 \
     281        | pdp10 | pdp11 | pj | pjl \
     282        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
     283        | pyramid \
     284        | score \
     285        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
     286        | sh64 | sh64le \
     287        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
     288        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
     289        | spu | strongarm \
     290        | tahoe | thumb | tic4x | tic80 | tron \
     291        | v850 | v850e \
     292        | we32k \
     293        | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
     294        | z8k | z80)
    160295                basic_machine=$basic_machine-unknown
    161296                ;;
     297        m6811 | m68hc11 | m6812 | m68hc12)
     298                # Motorola 68HC11/12.
     299                basic_machine=$basic_machine-unknown
     300                os=-none
     301                ;;
     302        m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
     303                ;;
     304        ms1)
     305                basic_machine=mt-unknown
     306                ;;
     307
    162308        # We use `pc' rather than `unknown'
    163309        # because (1) that's what they normally are, and
    164310        # (2) the word "unknown" tends to confuse beginning users.
    165         i[3456]86)
     311        i*86 | x86_64)
    166312          basic_machine=$basic_machine-pc
    167313          ;;
     
    172318                ;;
    173319        # Recognize the basic CPU types with company name.
    174         vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
    175               | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
    176               | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
    177               | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
    178               | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
    179               | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
    180               | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
    181               | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
    182               | sparc64-* | mips64-* | mipsel-* \
    183               | mips64el-* | mips64orion-* | mips64orionel-*  \
    184               | mipstx39-* | mipstx39el-* \
    185               | f301-*)
     320        580-* \
     321        | a29k-* \
     322        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
     323        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
     324        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
     325        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
     326        | avr-* | avr32-* \
     327        | bfin-* | bs2000-* \
     328        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
     329        | clipper-* | craynv-* | cydra-* \
     330        | d10v-* | d30v-* | dlx-* \
     331        | elxsi-* \
     332        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
     333        | h8300-* | h8500-* \
     334        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
     335        | i*86-* | i860-* | i960-* | ia64-* \
     336        | ip2k-* | iq2000-* \
     337        | lm32-* \
     338        | m32c-* | m32r-* | m32rle-* \
     339        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
     340        | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
     341        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
     342        | mips16-* \
     343        | mips64-* | mips64el-* \
     344        | mips64octeon-* | mips64octeonel-* \
     345        | mips64orion-* | mips64orionel-* \
     346        | mips64r5900-* | mips64r5900el-* \
     347        | mips64vr-* | mips64vrel-* \
     348        | mips64vr4100-* | mips64vr4100el-* \
     349        | mips64vr4300-* | mips64vr4300el-* \
     350        | mips64vr5000-* | mips64vr5000el-* \
     351        | mips64vr5900-* | mips64vr5900el-* \
     352        | mipsisa32-* | mipsisa32el-* \
     353        | mipsisa32r2-* | mipsisa32r2el-* \
     354        | mipsisa64-* | mipsisa64el-* \
     355        | mipsisa64r2-* | mipsisa64r2el-* \
     356        | mipsisa64sb1-* | mipsisa64sb1el-* \
     357        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
     358        | mipstx39-* | mipstx39el-* \
     359        | mmix-* \
     360        | mt-* \
     361        | msp430-* \
     362        | nios-* | nios2-* \
     363        | none-* | np1-* | ns16k-* | ns32k-* \
     364        | orion-* \
     365        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
     366        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
     367        | pyramid-* \
     368        | romp-* | rs6000-* \
     369        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
     370        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
     371        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
     372        | sparclite-* \
     373        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
     374        | tahoe-* | thumb-* \
     375        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
     376        | tron-* \
     377        | v850-* | v850e-* | vax-* \
     378        | we32k-* \
     379        | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
     380        | xstormy16-* | xtensa*-* \
     381        | ymp-* \
     382        | z8k-* | z80-*)
     383                ;;
     384        # Recognize the basic CPU types without company name, with glob match.
     385        xtensa*)
     386                basic_machine=$basic_machine-unknown
    186387                ;;
    187388        # Recognize the various machine names and aliases which stand
    188389        # for a CPU type and a company and sometimes even an OS.
     390        386bsd)
     391                basic_machine=i386-unknown
     392                os=-bsd
     393                ;;
    189394        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
    190395                basic_machine=m68000-att
     
    192397        3b*)
    193398                basic_machine=we32k-att
     399                ;;
     400        a29khif)
     401                basic_machine=a29k-amd
     402                os=-udi
     403                ;;
     404        abacus)
     405                basic_machine=abacus-unknown
     406                ;;
     407        adobe68k)
     408                basic_machine=m68010-adobe
     409                os=-scout
    194410                ;;
    195411        alliant | fx80)
     
    203419                os=-bsd
    204420                ;;
     421        amd64)
     422                basic_machine=x86_64-pc
     423                ;;
     424        amd64-*)
     425                basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
     426                ;;
    205427        amdahl)
    206428                basic_machine=580-amdahl
     
    208430                ;;
    209431        amiga | amiga-*)
    210                 basic_machine=m68k-cbm
     432                basic_machine=m68k-unknown
    211433                ;;
    212434        amigaos | amigados)
    213                 basic_machine=m68k-cbm
     435                basic_machine=m68k-unknown
    214436                os=-amigaos
    215437                ;;
    216438        amigaunix | amix)
    217                 basic_machine=m68k-cbm
     439                basic_machine=m68k-unknown
    218440                os=-sysv4
    219441                ;;
     
    222444                os=-sysv
    223445                ;;
     446        apollo68bsd)
     447                basic_machine=m68k-apollo
     448                os=-bsd
     449                ;;
     450        aros)
     451                basic_machine=i386-pc
     452                os=-aros
     453                ;;
    224454        aux)
    225455                basic_machine=m68k-apple
     
    230460                os=-dynix
    231461                ;;
     462        blackfin)
     463                basic_machine=bfin-unknown
     464                os=-linux
     465                ;;
     466        blackfin-*)
     467                basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
     468                os=-linux
     469                ;;
     470        c90)
     471                basic_machine=c90-cray
     472                os=-unicos
     473                ;;
     474        cegcc)
     475                basic_machine=arm-unknown
     476                os=-cegcc
     477                ;;
    232478        convex-c1)
    233479                basic_machine=c1-convex
     
    250496                os=-bsd
    251497                ;;
    252         cray | ymp)
    253                 basic_machine=ymp-cray
     498        cray | j90)
     499                basic_machine=j90-cray
    254500                os=-unicos
    255501                ;;
    256         cray2)
    257                 basic_machine=cray2-cray
    258                 os=-unicos
    259                 ;;
    260         [ctj]90-cray)
    261                 basic_machine=c90-cray
    262                 os=-unicos
     502        craynv)
     503                basic_machine=craynv-cray
     504                os=-unicosmp
     505                ;;
     506        cr16)
     507                basic_machine=cr16-unknown
     508                os=-elf
    263509                ;;
    264510        crds | unos)
    265511                basic_machine=m68k-crds
    266512                ;;
     513        crisv32 | crisv32-* | etraxfs*)
     514                basic_machine=crisv32-axis
     515                ;;
     516        cris | cris-* | etrax*)
     517                basic_machine=cris-axis
     518                ;;
     519        crx)
     520                basic_machine=crx-unknown
     521                os=-elf
     522                ;;
    267523        da30 | da30-*)
    268524                basic_machine=m68k-da30
     
    270526        decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
    271527                basic_machine=mips-dec
     528                ;;
     529        decsystem10* | dec10*)
     530                basic_machine=pdp10-dec
     531                os=-tops10
     532                ;;
     533        decsystem20* | dec20*)
     534                basic_machine=pdp10-dec
     535                os=-tops20
    272536                ;;
    273537        delta | 3300 | motorola-3300 | motorola-delta \
     
    279543                os=-sysv3
    280544                ;;
     545        dicos)
     546                basic_machine=i686-pc
     547                os=-dicos
     548                ;;
     549        djgpp)
     550                basic_machine=i586-pc
     551                os=-msdosdjgpp
     552                ;;
    281553        dpx20 | dpx20-*)
    282554                basic_machine=rs6000-bull
     
    298570                basic_machine=ns32k-encore
    299571                ;;
     572        es1800 | OSE68k | ose68k | ose | OSE)
     573                basic_machine=m68k-ericsson
     574                os=-ose
     575                ;;
    300576        fx2800)
    301577                basic_machine=i860-alliant
     
    308584                os=-sysv
    309585                ;;
     586        go32)
     587                basic_machine=i386-pc
     588                os=-go32
     589                ;;
    310590        h3050r* | hiux*)
    311591                basic_machine=hppa1.1-hitachi
     
    316596                os=-hms
    317597                ;;
     598        h8300xray)
     599                basic_machine=h8300-hitachi
     600                os=-xray
     601                ;;
     602        h8500hms)
     603                basic_machine=h8500-hitachi
     604                os=-hms
     605                ;;
    318606        harris)
    319607                basic_machine=m88k-harris
     
    331619                os=-hpux
    332620                ;;
     621        hp3k9[0-9][0-9] | hp9[0-9][0-9])
     622                basic_machine=hppa1.0-hp
     623                ;;
    333624        hp9k2[0-9][0-9] | hp9k31[0-9])
    334625                basic_machine=m68000-hp
     
    337628                basic_machine=m68k-hp
    338629                ;;
    339         hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
     630        hp9k6[0-9][0-9] | hp6[0-9][0-9])
     631                basic_machine=hppa1.0-hp
     632                ;;
     633        hp9k7[0-79][0-9] | hp7[0-79][0-9])
     634                basic_machine=hppa1.1-hp
     635                ;;
     636        hp9k78[0-9] | hp78[0-9])
     637                # FIXME: really hppa2.0-hp
     638                basic_machine=hppa1.1-hp
     639                ;;
     640        hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
     641                # FIXME: really hppa2.0-hp
     642                basic_machine=hppa1.1-hp
     643                ;;
     644        hp9k8[0-9][13679] | hp8[0-9][13679])
    340645                basic_machine=hppa1.1-hp
    341646                ;;
     
    346651                os=-nextstep3
    347652                ;;
     653        hppaosf)
     654                basic_machine=hppa1.1-hp
     655                os=-osf
     656                ;;
     657        hppro)
     658                basic_machine=hppa1.1-hp
     659                os=-proelf
     660                ;;
    348661        i370-ibm* | ibm*)
    349662                basic_machine=i370-ibm
    350                 os=-mvs
    351663                ;;
    352664# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
    353         i[3456]86v32)
     665        i*86v32)
    354666                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    355667                os=-sysv32
    356668                ;;
    357         i[3456]86v4*)
     669        i*86v4*)
    358670                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    359671                os=-sysv4
    360672                ;;
    361         i[3456]86v)
     673        i*86v)
    362674                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    363675                os=-sysv
    364676                ;;
    365         i[3456]86sol2)
     677        i*86sol2)
    366678                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    367679                os=-solaris2
     680                ;;
     681        i386mach)
     682                basic_machine=i386-mach
     683                os=-mach
     684                ;;
     685        i386-vsta | vsta)
     686                basic_machine=i386-unknown
     687                os=-vsta
    368688                ;;
    369689        iris | iris4d)
     
    381701                os=-sysv
    382702                ;;
     703        m68knommu)
     704                basic_machine=m68k-unknown
     705                os=-linux
     706                ;;
     707        m68knommu-*)
     708                basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
     709                os=-linux
     710                ;;
    383711        m88k-omron*)
    384712                basic_machine=m88k-omron
     
    392720                os=-sysv
    393721                ;;
     722        mingw32)
     723                basic_machine=i386-pc
     724                os=-mingw32
     725                ;;
     726        mingw32ce)
     727                basic_machine=arm-unknown
     728                os=-mingw32ce
     729                ;;
    394730        miniframe)
    395731                basic_machine=m68000-convergent
    396732                ;;
    397         mipsel*-linux*)
    398                 basic_machine=mipsel-unknown
    399                 os=-linux-gnu
    400                 ;;
    401         mips*-linux*)
    402                 basic_machine=mips-unknown
    403                 os=-linux-gnu
     733        *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
     734                basic_machine=m68k-atari
     735                os=-mint
    404736                ;;
    405737        mips3*-*)
     
    408740        mips3*)
    409741                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
     742                ;;
     743        monitor)
     744                basic_machine=m68k-rom68k
     745                os=-coff
     746                ;;
     747        morphos)
     748                basic_machine=powerpc-unknown
     749                os=-morphos
     750                ;;
     751        msdos)
     752                basic_machine=i386-pc
     753                os=-msdos
     754                ;;
     755        ms1-*)
     756                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
     757                ;;
     758        mvs)
     759                basic_machine=i370-ibm
     760                os=-mvs
    410761                ;;
    411762        ncr3000)
     
    413764                os=-sysv4
    414765                ;;
     766        netbsd386)
     767                basic_machine=i386-unknown
     768                os=-netbsd
     769                ;;
     770        netwinder)
     771                basic_machine=armv4l-rebel
     772                os=-linux
     773                ;;
    415774        news | news700 | news800 | news900)
    416775                basic_machine=m68k-sony
     
    424783                basic_machine=mips-sony
    425784                os=-newsos
     785                ;;
     786        necv70)
     787                basic_machine=v70-nec
     788                os=-sysv
    426789                ;;
    427790        next | m*-next )
     
    450813                os=-nindy
    451814                ;;
     815        mon960)
     816                basic_machine=i960-intel
     817                os=-mon960
     818                ;;
     819        nonstopux)
     820                basic_machine=mips-compaq
     821                os=-nonstopux
     822                ;;
    452823        np1)
    453824                basic_machine=np1-gould
     825                ;;
     826        nsr-tandem)
     827                basic_machine=nsr-tandem
     828                ;;
     829        op50n-* | op60c-*)
     830                basic_machine=hppa1.1-oki
     831                os=-proelf
     832                ;;
     833        openrisc | openrisc-*)
     834                basic_machine=or32-unknown
     835                ;;
     836        os400)
     837                basic_machine=powerpc-ibm
     838                os=-os400
     839                ;;
     840        OSE68000 | ose68000)
     841                basic_machine=m68000-ericsson
     842                os=-ose
     843                ;;
     844        os68k)
     845                basic_machine=m68k-none
     846                os=-os68k
    454847                ;;
    455848        pa-hitachi)
     
    461854                os=-osf
    462855                ;;
     856        parisc)
     857                basic_machine=hppa-unknown
     858                os=-linux
     859                ;;
     860        parisc-*)
     861                basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
     862                os=-linux
     863                ;;
    463864        pbd)
    464865                basic_machine=sparc-tti
     
    467868                basic_machine=m68k-tti
    468869                ;;
    469         pc532 | pc532-*)
     870        pc532 | pc532-*)
    470871                basic_machine=ns32k-pc532
    471872                ;;
    472         pentium | p5)
    473                 basic_machine=i586-intel
    474                 ;;
    475         pentiumpro | p6)
    476                 basic_machine=i686-intel
    477                 ;;
    478         pentium-* | p5-*)
     873        pc98)
     874                basic_machine=i386-pc
     875                ;;
     876        pc98-*)
     877                basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
     878                ;;
     879        pentium | p5 | k5 | k6 | nexgen | viac3)
     880                basic_machine=i586-pc
     881                ;;
     882        pentiumpro | p6 | 6x86 | athlon | athlon_*)
     883                basic_machine=i686-pc
     884                ;;
     885        pentiumii | pentium2 | pentiumiii | pentium3)
     886                basic_machine=i686-pc
     887                ;;
     888        pentium4)
     889                basic_machine=i786-pc
     890                ;;
     891        pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
    479892                basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
    480893                ;;
    481         pentiumpro-* | p6-*)
     894        pentiumpro-* | p6-* | 6x86-* | athlon-*)
    482895                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    483896                ;;
    484         k5)
    485                 # We don't have specific support for AMD's K5 yet, so just call it a Pentium
    486                 basic_machine=i586-amd
    487                 ;;
    488         nexen)
    489                 # We don't have specific support for Nexgen yet, so just call it a Pentium
    490                 basic_machine=i586-nexgen
     897        pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
     898                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     899                ;;
     900        pentium4-*)
     901                basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    491902                ;;
    492903        pn)
    493904                basic_machine=pn-gould
    494905                ;;
    495         power)  basic_machine=rs6000-ibm
     906        power)  basic_machine=power-ibm
    496907                ;;
    497908        ppc)    basic_machine=powerpc-unknown
    498                 ;;
     909                ;;
    499910        ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    500911                ;;
    501912        ppcle | powerpclittle | ppc-le | powerpc-little)
    502913                basic_machine=powerpcle-unknown
    503                 ;;
     914                ;;
    504915        ppcle-* | powerpclittle-*)
    505916                basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
    506917                ;;
     918        ppc64)  basic_machine=powerpc64-unknown
     919                ;;
     920        ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
     921                ;;
     922        ppc64le | powerpc64little | ppc64-le | powerpc64-little)
     923                basic_machine=powerpc64le-unknown
     924                ;;
     925        ppc64le-* | powerpc64little-*)
     926                basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
     927                ;;
    507928        ps2)
    508929                basic_machine=i386-ibm
    509930                ;;
     931        pw32)
     932                basic_machine=i586-unknown
     933                os=-pw32
     934                ;;
     935        rdos)
     936                basic_machine=i386-pc
     937                os=-rdos
     938                ;;
     939        rom68k)
     940                basic_machine=m68k-rom68k
     941                os=-coff
     942                ;;
    510943        rm[46]00)
    511944                basic_machine=mips-siemens
     
    513946        rtpc | rtpc-*)
    514947                basic_machine=romp-ibm
     948                ;;
     949        s390 | s390-*)
     950                basic_machine=s390-ibm
     951                ;;
     952        s390x | s390x-*)
     953                basic_machine=s390x-ibm
     954                ;;
     955        sa29200)
     956                basic_machine=a29k-amd
     957                os=-udi
     958                ;;
     959        sb1)
     960                basic_machine=mipsisa64sb1-unknown
     961                ;;
     962        sb1el)
     963                basic_machine=mipsisa64sb1el-unknown
     964                ;;
     965        sde)
     966                basic_machine=mipsisa32-sde
     967                os=-elf
     968                ;;
     969        sei)
     970                basic_machine=mips-sei
     971                os=-seiux
    515972                ;;
    516973        sequent)
     
    521978                os=-hms
    522979                ;;
     980        sh5el)
     981                basic_machine=sh5le-unknown
     982                ;;
     983        sh64)
     984                basic_machine=sh64-unknown
     985                ;;
     986        sparclite-wrs | simso-wrs)
     987                basic_machine=sparclite-wrs
     988                os=-vxworks
     989                ;;
    523990        sps7)
    524991                basic_machine=m68k-bull
     
    528995                basic_machine=spur-unknown
    529996                ;;
     997        st2000)
     998                basic_machine=m68k-tandem
     999                ;;
     1000        stratus)
     1001                basic_machine=i860-stratus
     1002                os=-sysv4
     1003                ;;
    5301004        sun2)
    5311005                basic_machine=m68000-sun
     
    5681042                basic_machine=i386-sun
    5691043                ;;
     1044        sv1)
     1045                basic_machine=sv1-cray
     1046                os=-unicos
     1047                ;;
    5701048        symmetry)
    5711049                basic_machine=i386-sequent
    5721050                os=-dynix
    5731051                ;;
     1052        t3e)
     1053                basic_machine=alphaev5-cray
     1054                os=-unicos
     1055                ;;
     1056        t90)
     1057                basic_machine=t90-cray
     1058                os=-unicos
     1059                ;;
     1060        tic54x | c54x*)
     1061                basic_machine=tic54x-unknown
     1062                os=-coff
     1063                ;;
     1064        tic55x | c55x*)
     1065                basic_machine=tic55x-unknown
     1066                os=-coff
     1067                ;;
     1068        tic6x | c6x*)
     1069                basic_machine=tic6x-unknown
     1070                os=-coff
     1071                ;;
     1072        tile*)
     1073                basic_machine=tile-unknown
     1074                os=-linux-gnu
     1075                ;;
    5741076        tx39)
    5751077                basic_machine=mipstx39-unknown
     
    5781080                basic_machine=mipstx39el-unknown
    5791081                ;;
     1082        toad1)
     1083                basic_machine=pdp10-xkl
     1084                os=-tops20
     1085                ;;
    5801086        tower | tower-32)
    5811087                basic_machine=m68k-ncr
     1088                ;;
     1089        tpf)
     1090                basic_machine=s390x-ibm
     1091                os=-tpf
    5821092                ;;
    5831093        udi29k)
     
    5891099                os=-sym1
    5901100                ;;
     1101        v810 | necv810)
     1102                basic_machine=v810-nec
     1103                os=-none
     1104                ;;
    5911105        vaxv)
    5921106                basic_machine=vax-dec
     
    5981112                ;;
    5991113        vpp*|vx|vx-*)
    600                basic_machine=f301-fujitsu
    601                ;;
     1114                basic_machine=f301-fujitsu
     1115                ;;
    6021116        vxworks960)
    6031117                basic_machine=i960-wrs
     
    6121126                os=-vxworks
    6131127                ;;
    614         xmp)
    615                 basic_machine=xmp-cray
     1128        w65*)
     1129                basic_machine=w65-wdc
     1130                os=-none
     1131                ;;
     1132        w89k-*)
     1133                basic_machine=hppa1.1-winbond
     1134                os=-proelf
     1135                ;;
     1136        xbox)
     1137                basic_machine=i686-pc
     1138                os=-mingw32
     1139                ;;
     1140        xps | xps100)
     1141                basic_machine=xps100-honeywell
     1142                ;;
     1143        ymp)
     1144                basic_machine=ymp-cray
    6161145                os=-unicos
    6171146                ;;
    618         xps | xps100)
    619                 basic_machine=xps100-honeywell
     1147        z8k-*-coff)
     1148                basic_machine=z8k-unknown
     1149                os=-sim
     1150                ;;
     1151        z80-*-coff)
     1152                basic_machine=z80-unknown
     1153                os=-sim
    6201154                ;;
    6211155        none)
     
    6261160# Here we handle the default manufacturer of certain CPU types.  It is in
    6271161# some cases the only manufacturer, in others, it is the most popular.
    628         mips)
    629                 if [ x$os = x-linux-gnu ]; then
    630                         basic_machine=mips-unknown
    631                 else
    632                         basic_machine=mips-mips
    633                 fi
     1162        w89k)
     1163                basic_machine=hppa1.1-winbond
     1164                ;;
     1165        op50n)
     1166                basic_machine=hppa1.1-oki
     1167                ;;
     1168        op60c)
     1169                basic_machine=hppa1.1-oki
    6341170                ;;
    6351171        romp)
    6361172                basic_machine=romp-ibm
    6371173                ;;
     1174        mmix)
     1175                basic_machine=mmix-knuth
     1176                ;;
    6381177        rs6000)
    6391178                basic_machine=rs6000-ibm
     
    6421181                basic_machine=vax-dec
    6431182                ;;
     1183        pdp10)
     1184                # there are many clones, so DEC is not a safe bet
     1185                basic_machine=pdp10-unknown
     1186                ;;
    6441187        pdp11)
    6451188                basic_machine=pdp11-dec
     
    6481191                basic_machine=we32k-att
    6491192                ;;
    650         sparc)
     1193        sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
     1194                basic_machine=sh-unknown
     1195                ;;
     1196        sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
    6511197                basic_machine=sparc-sun
    6521198                ;;
    653         cydra)
     1199        cydra)
    6541200                basic_machine=cydra-cydrome
    6551201                ;;
     
    6591205        orion105)
    6601206                basic_machine=clipper-highlevel
     1207                ;;
     1208        mac | mpw | mac-mpw)
     1209                basic_machine=m68k-apple
     1210                ;;
     1211        pmac | pmac-mpw)
     1212                basic_machine=powerpc-apple
     1213                ;;
     1214        *-unknown)
     1215                # Make sure to match an already-canonicalized machine name.
    6611216                ;;
    6621217        *)
     
    7081263              | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
    7091264              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
     1265              | -kopensolaris* \
    7101266              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    711               | -aos* \
     1267              | -aos* | -aros* \
    7121268              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    7131269              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    714               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    715               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
     1270              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
     1271              | -openbsd* | -solidbsd* \
     1272              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
     1273              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    7161274              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    7171275              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    718               | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    719               | -mingw32* | -linux-gnu* | -uxpv*)
     1276              | -chorusos* | -chorusrdb* | -cegcc* \
     1277              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
     1278              | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
     1279              | -uxpv* | -beos* | -mpeix* | -udk* \
     1280              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
     1281              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
     1282              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
     1283              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
     1284              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
     1285              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
     1286              | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
    7201287        # Remember, each alternative MUST END IN *, to match a version number.
     1288                ;;
     1289        -qnx*)
     1290                case $basic_machine in
     1291                    x86-* | i*86-*)
     1292                        ;;
     1293                    *)
     1294                        os=-nto$os
     1295                        ;;
     1296                esac
     1297                ;;
     1298        -nto-qnx*)
     1299                ;;
     1300        -nto*)
     1301                os=`echo $os | sed -e 's|nto|nto-qnx|'`
     1302                ;;
     1303        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
     1304              | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
     1305              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
     1306                ;;
     1307        -mac*)
     1308                os=`echo $os | sed -e 's|mac|macos|'`
     1309                ;;
     1310        -linux-dietlibc)
     1311                os=-linux-dietlibc
    7211312                ;;
    7221313        -linux*)
     
    7291320                os=`echo $os | sed -e 's|sunos6|solaris3|'`
    7301321                ;;
     1322        -opened*)
     1323                os=-openedition
     1324                ;;
     1325        -os400*)
     1326                os=-os400
     1327                ;;
     1328        -wince*)
     1329                os=-wince
     1330                ;;
    7311331        -osfrose*)
    7321332                os=-osfrose
     
    7441344                os=-aos
    7451345                ;;
     1346        -atheos*)
     1347                os=-atheos
     1348                ;;
     1349        -syllable*)
     1350                os=-syllable
     1351                ;;
     1352        -386bsd)
     1353                os=-bsd
     1354                ;;
    7461355        -ctix* | -uts*)
    7471356                os=-sysv
    7481357                ;;
     1358        -nova*)
     1359                os=-rtmk-nova
     1360                ;;
    7491361        -ns2 )
    750                 os=-nextstep2
     1362                os=-nextstep2
     1363                ;;
     1364        -nsk*)
     1365                os=-nsk
    7511366                ;;
    7521367        # Preserve the version number of sinix5.
     
    7571372                os=-sysv4
    7581373                ;;
     1374        -tpf*)
     1375                os=-tpf
     1376                ;;
    7591377        -triton*)
    7601378                os=-sysv3
     
    7751393        -sysv*)
    7761394                ;;
     1395        -ose*)
     1396                os=-ose
     1397                ;;
     1398        -es1800*)
     1399                os=-ose
     1400                ;;
    7771401        -xenix)
    7781402                os=-xenix
     1403                ;;
     1404        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
     1405                os=-mint
     1406                ;;
     1407        -aros*)
     1408                os=-aros
     1409                ;;
     1410        -kaos*)
     1411                os=-kaos
     1412                ;;
     1413        -zvmoe)
     1414                os=-zvmoe
     1415                ;;
     1416        -dicos*)
     1417                os=-dicos
    7791418                ;;
    7801419        -none)
     
    8001439
    8011440case $basic_machine in
     1441        score-*)
     1442                os=-elf
     1443                ;;
     1444        spu-*)
     1445                os=-elf
     1446                ;;
    8021447        *-acorn)
    8031448                os=-riscix1.2
    8041449                ;;
     1450        arm*-rebel)
     1451                os=-linux
     1452                ;;
    8051453        arm*-semi)
    8061454                os=-aout
    8071455                ;;
    808         pdp11-*)
     1456        c4x-* | tic4x-*)
     1457                os=-coff
     1458                ;;
     1459        # This must come before the *-dec entry.
     1460        pdp10-*)
     1461                os=-tops20
     1462                ;;
     1463        pdp11-*)
    8091464                os=-none
    8101465                ;;
     
    8241479                # os=-sunos4
    8251480                ;;
     1481        m68*-cisco)
     1482                os=-aout
     1483                ;;
     1484        mep-*)
     1485                os=-elf
     1486                ;;
     1487        mips*-cisco)
     1488                os=-elf
     1489                ;;
     1490        mips*-*)
     1491                os=-elf
     1492                ;;
     1493        or32-*)
     1494                os=-coff
     1495                ;;
    8261496        *-tti)  # must be before sparc entry or we get the wrong os.
    8271497                os=-sysv3
     
    8301500                os=-sunos4.1.1
    8311501                ;;
     1502        *-be)
     1503                os=-beos
     1504                ;;
     1505        *-haiku)
     1506                os=-haiku
     1507                ;;
    8321508        *-ibm)
    8331509                os=-aix
    8341510                ;;
     1511        *-knuth)
     1512                os=-mmixware
     1513                ;;
     1514        *-wec)
     1515                os=-proelf
     1516                ;;
     1517        *-winbond)
     1518                os=-proelf
     1519                ;;
     1520        *-oki)
     1521                os=-proelf
     1522                ;;
    8351523        *-hp)
    8361524                os=-hpux
     
    8751563                os=-nextstep3
    8761564                ;;
    877         *-gould)
     1565        *-gould)
    8781566                os=-sysv
    8791567                ;;
    880         *-highlevel)
     1568        *-highlevel)
    8811569                os=-bsd
    8821570                ;;
     
    8841572                os=-bsd
    8851573                ;;
    886         *-sgi)
     1574        *-sgi)
    8871575                os=-irix
    8881576                ;;
    889         *-siemens)
     1577        *-siemens)
    8901578                os=-sysv4
    8911579                ;;
     
    8931581                os=-rtu
    8941582                ;;
    895         f301-fujitsu)
     1583        f30[01]-fujitsu | f700-fujitsu)
    8961584                os=-uxpv
     1585                ;;
     1586        *-rom68k)
     1587                os=-coff
     1588                ;;
     1589        *-*bug)
     1590                os=-coff
     1591                ;;
     1592        *-apple)
     1593                os=-macos
     1594                ;;
     1595        *-atari*)
     1596                os=-mint
    8971597                ;;
    8981598        *)
     
    9171617                                vendor=ibm
    9181618                                ;;
     1619                        -beos*)
     1620                                vendor=be
     1621                                ;;
    9191622                        -hpux*)
    9201623                                vendor=hp
    9211624                                ;;
     1625                        -mpeix*)
     1626                                vendor=hp
     1627                                ;;
    9221628                        -hiux*)
    9231629                                vendor=hitachi
     
    9351641                                vendor=ns
    9361642                                ;;
    937                         -mvs*)
     1643                        -mvs* | -opened*)
     1644                                vendor=ibm
     1645                                ;;
     1646                        -os400*)
    9381647                                vendor=ibm
    9391648                                ;;
     
    9411650                                vendor=sequent
    9421651                                ;;
    943                         -vxsim* | -vxworks*)
     1652                        -tpf*)
     1653                                vendor=ibm
     1654                                ;;
     1655                        -vxsim* | -vxworks* | -windiss*)
    9441656                                vendor=wrs
    9451657                                ;;
     
    9471659                                vendor=apple
    9481660                                ;;
     1661                        -hms*)
     1662                                vendor=hitachi
     1663                                ;;
     1664                        -mpw* | -macos*)
     1665                                vendor=apple
     1666                                ;;
     1667                        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
     1668                                vendor=atari
     1669                                ;;
     1670                        -vos*)
     1671                                vendor=stratus
     1672                                ;;
    9491673                esac
    9501674                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
     
    9531677
    9541678echo $basic_machine$os
     1679exit
     1680
     1681# Local variables:
     1682# eval: (add-hook 'write-file-hooks 'time-stamp)
     1683# time-stamp-start: "timestamp='"
     1684# time-stamp-format: "%:y-%02m-%02d"
     1685# time-stamp-end: "'"
     1686# End:
  • trunk/libjpeg/configure

    r15 r283  
    11#! /bin/sh
    2 
    32# Guess values for system-dependent variables and create Makefiles.
    4 # Generated automatically using autoconf version 2.12
    5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
     3# Generated by GNU Autoconf 2.63 for libjpeg 7.0.
    64#
     5# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
     6# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
    77# This configure script is free software; the Free Software Foundation
    88# gives unlimited permission to copy, distribute and modify it.
    9 
    10 # Defaults:
    11 ac_help=
     9## --------------------- ##
     10## M4sh Initialization.  ##
     11## --------------------- ##
     12
     13# Be more Bourne compatible
     14DUALCASE=1; export DUALCASE # for MKS sh
     15if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
     16  emulate sh
     17  NULLCMD=:
     18  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
     19  # is contrary to our usage.  Disable this feature.
     20  alias -g '${1+"$@"}'='"$@"'
     21  setopt NO_GLOB_SUBST
     22else
     23  case `(set -o) 2>/dev/null` in
     24  *posix*) set -o posix ;;
     25esac
     26
     27fi
     28
     29
     30
     31
     32# PATH needs CR
     33# Avoid depending upon Character Ranges.
     34as_cr_letters='abcdefghijklmnopqrstuvwxyz'
     35as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
     36as_cr_Letters=$as_cr_letters$as_cr_LETTERS
     37as_cr_digits='0123456789'
     38as_cr_alnum=$as_cr_Letters$as_cr_digits
     39
     40as_nl='
     41'
     42export as_nl
     43# Printing a long string crashes Solaris 7 /usr/bin/printf.
     44as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
     45as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
     46as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
     47if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
     48  as_echo='printf %s\n'
     49  as_echo_n='printf %s'
     50else
     51  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
     52    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
     53    as_echo_n='/usr/ucb/echo -n'
     54  else
     55    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     56    as_echo_n_body='eval
     57      arg=$1;
     58      case $arg in
     59      *"$as_nl"*)
     60        expr "X$arg" : "X\\(.*\\)$as_nl";
     61        arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
     62      esac;
     63      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
     64    '
     65    export as_echo_n_body
     66    as_echo_n='sh -c $as_echo_n_body as_echo'
     67  fi
     68  export as_echo_body
     69  as_echo='sh -c $as_echo_body as_echo'
     70fi
     71
     72# The user is always right.
     73if test "${PATH_SEPARATOR+set}" != set; then
     74  PATH_SEPARATOR=:
     75  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
     76    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
     77      PATH_SEPARATOR=';'
     78  }
     79fi
     80
     81# Support unset when possible.
     82if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
     83  as_unset=unset
     84else
     85  as_unset=false
     86fi
     87
     88
     89# IFS
     90# We need space, tab and new line, in precisely that order.  Quoting is
     91# there to prevent editors from complaining about space-tab.
     92# (If _AS_PATH_WALK were called with IFS unset, it would disable word
     93# splitting by setting IFS to empty value.)
     94IFS=" ""        $as_nl"
     95
     96# Find who we are.  Look in the path if we contain no directory separator.
     97case $0 in
     98  *[\\/]* ) as_myself=$0 ;;
     99  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     100for as_dir in $PATH
     101do
     102  IFS=$as_save_IFS
     103  test -z "$as_dir" && as_dir=.
     104  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
     105done
     106IFS=$as_save_IFS
     107
     108     ;;
     109esac
     110# We did not find ourselves, most probably we were run as `sh COMMAND'
     111# in which case we are not to be found in the path.
     112if test "x$as_myself" = x; then
     113  as_myself=$0
     114fi
     115if test ! -f "$as_myself"; then
     116  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
     117  { (exit 1); exit 1; }
     118fi
     119
     120# Work around bugs in pre-3.0 UWIN ksh.
     121for as_var in ENV MAIL MAILPATH
     122do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
     123done
     124PS1='$ '
     125PS2='> '
     126PS4='+ '
     127
     128# NLS nuisances.
     129LC_ALL=C
     130export LC_ALL
     131LANGUAGE=C
     132export LANGUAGE
     133
     134# Required to use basename.
     135if expr a : '\(a\)' >/dev/null 2>&1 &&
     136   test "X`expr 00001 : '.*\(...\)'`" = X001; then
     137  as_expr=expr
     138else
     139  as_expr=false
     140fi
     141
     142if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
     143  as_basename=basename
     144else
     145  as_basename=false
     146fi
     147
     148
     149# Name of the executable.
     150as_me=`$as_basename -- "$0" ||
     151$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
     152         X"$0" : 'X\(//\)$' \| \
     153         X"$0" : 'X\(/\)' \| . 2>/dev/null ||
     154$as_echo X/"$0" |
     155    sed '/^.*\/\([^/][^/]*\)\/*$/{
     156            s//\1/
     157            q
     158          }
     159          /^X\/\(\/\/\)$/{
     160            s//\1/
     161            q
     162          }
     163          /^X\/\(\/\).*/{
     164            s//\1/
     165            q
     166          }
     167          s/.*/./; q'`
     168
     169# CDPATH.
     170$as_unset CDPATH
     171
     172
     173if test "x$CONFIG_SHELL" = x; then
     174  if (eval ":") 2>/dev/null; then
     175  as_have_required=yes
     176else
     177  as_have_required=no
     178fi
     179
     180  if test $as_have_required = yes &&     (eval ":
     181(as_func_return () {
     182  (exit \$1)
     183}
     184as_func_success () {
     185  as_func_return 0
     186}
     187as_func_failure () {
     188  as_func_return 1
     189}
     190as_func_ret_success () {
     191  return 0
     192}
     193as_func_ret_failure () {
     194  return 1
     195}
     196
     197exitcode=0
     198if as_func_success; then
     199  :
     200else
     201  exitcode=1
     202  echo as_func_success failed.
     203fi
     204
     205if as_func_failure; then
     206  exitcode=1
     207  echo as_func_failure succeeded.
     208fi
     209
     210if as_func_ret_success; then
     211  :
     212else
     213  exitcode=1
     214  echo as_func_ret_success failed.
     215fi
     216
     217if as_func_ret_failure; then
     218  exitcode=1
     219  echo as_func_ret_failure succeeded.
     220fi
     221
     222if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
     223  :
     224else
     225  exitcode=1
     226  echo positional parameters were not saved.
     227fi
     228
     229test \$exitcode = 0) || { (exit 1); exit 1; }
     230
     231(
     232  as_lineno_1=\$LINENO
     233  as_lineno_2=\$LINENO
     234  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
     235  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
     236") 2> /dev/null; then
     237  :
     238else
     239  as_candidate_shells=
     240    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     241for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
     242do
     243  IFS=$as_save_IFS
     244  test -z "$as_dir" && as_dir=.
     245  case $as_dir in
     246         /*)
     247           for as_base in sh bash ksh sh5; do
     248             as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
     249           done;;
     250       esac
     251done
     252IFS=$as_save_IFS
     253
     254
     255      for as_shell in $as_candidate_shells $SHELL; do
     256         # Try only shells that exist, to save several forks.
     257         if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
     258                { ("$as_shell") 2> /dev/null <<\_ASEOF
     259if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
     260  emulate sh
     261  NULLCMD=:
     262  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
     263  # is contrary to our usage.  Disable this feature.
     264  alias -g '${1+"$@"}'='"$@"'
     265  setopt NO_GLOB_SUBST
     266else
     267  case `(set -o) 2>/dev/null` in
     268  *posix*) set -o posix ;;
     269esac
     270
     271fi
     272
     273
     274:
     275_ASEOF
     276}; then
     277  CONFIG_SHELL=$as_shell
     278               as_have_required=yes
     279               if { "$as_shell" 2> /dev/null <<\_ASEOF
     280if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
     281  emulate sh
     282  NULLCMD=:
     283  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
     284  # is contrary to our usage.  Disable this feature.
     285  alias -g '${1+"$@"}'='"$@"'
     286  setopt NO_GLOB_SUBST
     287else
     288  case `(set -o) 2>/dev/null` in
     289  *posix*) set -o posix ;;
     290esac
     291
     292fi
     293
     294
     295:
     296(as_func_return () {
     297  (exit $1)
     298}
     299as_func_success () {
     300  as_func_return 0
     301}
     302as_func_failure () {
     303  as_func_return 1
     304}
     305as_func_ret_success () {
     306  return 0
     307}
     308as_func_ret_failure () {
     309  return 1
     310}
     311
     312exitcode=0
     313if as_func_success; then
     314  :
     315else
     316  exitcode=1
     317  echo as_func_success failed.
     318fi
     319
     320if as_func_failure; then
     321  exitcode=1
     322  echo as_func_failure succeeded.
     323fi
     324
     325if as_func_ret_success; then
     326  :
     327else
     328  exitcode=1
     329  echo as_func_ret_success failed.
     330fi
     331
     332if as_func_ret_failure; then
     333  exitcode=1
     334  echo as_func_ret_failure succeeded.
     335fi
     336
     337if ( set x; as_func_ret_success y && test x = "$1" ); then
     338  :
     339else
     340  exitcode=1
     341  echo positional parameters were not saved.
     342fi
     343
     344test $exitcode = 0) || { (exit 1); exit 1; }
     345
     346(
     347  as_lineno_1=$LINENO
     348  as_lineno_2=$LINENO
     349  test "x$as_lineno_1" != "x$as_lineno_2" &&
     350  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
     351
     352_ASEOF
     353}; then
     354  break
     355fi
     356
     357fi
     358
     359      done
     360
     361      if test "x$CONFIG_SHELL" != x; then
     362  for as_var in BASH_ENV ENV
     363        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
     364        done
     365        export CONFIG_SHELL
     366        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
     367fi
     368
     369
     370    if test $as_have_required = no; then
     371  echo This script requires a shell more modern than all the
     372      echo shells that I found on your system.  Please install a
     373      echo modern shell, or manually run the script under such a
     374      echo shell if you do have one.
     375      { (exit 1); exit 1; }
     376fi
     377
     378
     379fi
     380
     381fi
     382
     383
     384
     385(eval "as_func_return () {
     386  (exit \$1)
     387}
     388as_func_success () {
     389  as_func_return 0
     390}
     391as_func_failure () {
     392  as_func_return 1
     393}
     394as_func_ret_success () {
     395  return 0
     396}
     397as_func_ret_failure () {
     398  return 1
     399}
     400
     401exitcode=0
     402if as_func_success; then
     403  :
     404else
     405  exitcode=1
     406  echo as_func_success failed.
     407fi
     408
     409if as_func_failure; then
     410  exitcode=1
     411  echo as_func_failure succeeded.
     412fi
     413
     414if as_func_ret_success; then
     415  :
     416else
     417  exitcode=1
     418  echo as_func_ret_success failed.
     419fi
     420
     421if as_func_ret_failure; then
     422  exitcode=1
     423  echo as_func_ret_failure succeeded.
     424fi
     425
     426if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
     427  :
     428else
     429  exitcode=1
     430  echo positional parameters were not saved.
     431fi
     432
     433test \$exitcode = 0") || {
     434  echo No shell found that supports shell functions.
     435  echo Please tell bug-autoconf@gnu.org about your system,
     436  echo including any error possibly output before this message.
     437  echo This can help us improve future autoconf versions.
     438  echo Configuration will now proceed without shell functions.
     439}
     440
     441
     442
     443  as_lineno_1=$LINENO
     444  as_lineno_2=$LINENO
     445  test "x$as_lineno_1" != "x$as_lineno_2" &&
     446  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
     447
     448  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
     449  # uniformly replaced by the line number.  The first 'sed' inserts a
     450  # line-number line after each line using $LINENO; the second 'sed'
     451  # does the real work.  The second script uses 'N' to pair each
     452  # line-number line with the line containing $LINENO, and appends
     453  # trailing '-' during substitution so that $LINENO is not a special
     454  # case at line end.
     455  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
     456  # scripts with optimization help from Paolo Bonzini.  Blame Lee
     457  # E. McMahon (1931-1989) for sed's syntax.  :-)
     458  sed -n '
     459    p
     460    /[$]LINENO/=
     461  ' <$as_myself |
     462    sed '
     463      s/[$]LINENO.*/&-/
     464      t lineno
     465      b
     466      :lineno
     467      N
     468      :loop
     469      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
     470      t loop
     471      s/-\n.*//
     472    ' >$as_me.lineno &&
     473  chmod +x "$as_me.lineno" ||
     474    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
     475   { (exit 1); exit 1; }; }
     476
     477  # Don't try to exec as it changes $[0], causing all sort of problems
     478  # (the dirname of $[0] is not the place where we might find the
     479  # original and so on.  Autoconf is especially sensitive to this).
     480  . "./$as_me.lineno"
     481  # Exit status is that of the last command.
     482  exit
     483}
     484
     485
     486if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
     487  as_dirname=dirname
     488else
     489  as_dirname=false
     490fi
     491
     492ECHO_C= ECHO_N= ECHO_T=
     493case `echo -n x` in
     494-n*)
     495  case `echo 'x\c'` in
     496  *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
     497  *)   ECHO_C='\c';;
     498  esac;;
     499*)
     500  ECHO_N='-n';;
     501esac
     502if expr a : '\(a\)' >/dev/null 2>&1 &&
     503   test "X`expr 00001 : '.*\(...\)'`" = X001; then
     504  as_expr=expr
     505else
     506  as_expr=false
     507fi
     508
     509rm -f conf$$ conf$$.exe conf$$.file
     510if test -d conf$$.dir; then
     511  rm -f conf$$.dir/conf$$.file
     512else
     513  rm -f conf$$.dir
     514  mkdir conf$$.dir 2>/dev/null
     515fi
     516if (echo >conf$$.file) 2>/dev/null; then
     517  if ln -s conf$$.file conf$$ 2>/dev/null; then
     518    as_ln_s='ln -s'
     519    # ... but there are two gotchas:
     520    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     521    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
     522    # In both cases, we have to default to `cp -p'.
     523    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     524      as_ln_s='cp -p'
     525  elif ln conf$$.file conf$$ 2>/dev/null; then
     526    as_ln_s=ln
     527  else
     528    as_ln_s='cp -p'
     529  fi
     530else
     531  as_ln_s='cp -p'
     532fi
     533rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
     534rmdir conf$$.dir 2>/dev/null
     535
     536if mkdir -p . 2>/dev/null; then
     537  as_mkdir_p=:
     538else
     539  test -d ./-p && rmdir ./-p
     540  as_mkdir_p=false
     541fi
     542
     543if test -x / >/dev/null 2>&1; then
     544  as_test_x='test -x'
     545else
     546  if ls -dL / >/dev/null 2>&1; then
     547    as_ls_L_option=L
     548  else
     549    as_ls_L_option=
     550  fi
     551  as_test_x='
     552    eval sh -c '\''
     553      if test -d "$1"; then
     554        test -d "$1/.";
     555      else
     556        case $1 in
     557        -*)set "./$1";;
     558        esac;
     559        case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
     560        ???[sx]*):;;*)false;;esac;fi
     561    '\'' sh
     562  '
     563fi
     564as_executable_p=$as_test_x
     565
     566# Sed expression to map a string onto a valid CPP name.
     567as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
     568
     569# Sed expression to map a string onto a valid variable name.
     570as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
     571
     572
     573
     574
     575# Check that we are running under the correct shell.
     576SHELL=${CONFIG_SHELL-/bin/sh}
     577
     578case X$lt_ECHO in
     579X*--fallback-echo)
     580  # Remove one level of quotation (which was required for Make).
     581  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
     582  ;;
     583esac
     584
     585ECHO=${lt_ECHO-echo}
     586if test "X$1" = X--no-reexec; then
     587  # Discard the --no-reexec flag, and continue.
     588  shift
     589elif test "X$1" = X--fallback-echo; then
     590  # Avoid inline document here, it may be left over
     591  :
     592elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
     593  # Yippee, $ECHO works!
     594  :
     595else
     596  # Restart under the correct shell.
     597  exec $SHELL "$0" --no-reexec ${1+"$@"}
     598fi
     599
     600if test "X$1" = X--fallback-echo; then
     601  # used as fallback echo
     602  shift
     603  cat <<_LT_EOF
     604$*
     605_LT_EOF
     606  exit 0
     607fi
     608
     609# The HP-UX ksh and POSIX shell print the target directory to stdout
     610# if CDPATH is set.
     611(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
     612
     613if test -z "$lt_ECHO"; then
     614  if test "X${echo_test_string+set}" != Xset; then
     615    # find a string as large as possible, as long as the shell can cope with it
     616    for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
     617      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
     618      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
     619         { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
     620      then
     621        break
     622      fi
     623    done
     624  fi
     625
     626  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
     627     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
     628     test "X$echo_testing_string" = "X$echo_test_string"; then
     629    :
     630  else
     631    # The Solaris, AIX, and Digital Unix default echo programs unquote
     632    # backslashes.  This makes it impossible to quote backslashes using
     633    #   echo "$something" | sed 's/\\/\\\\/g'
     634    #
     635    # So, first we look for a working echo in the user's PATH.
     636
     637    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
     638    for dir in $PATH /usr/ucb; do
     639      IFS="$lt_save_ifs"
     640      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
     641         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
     642         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
     643         test "X$echo_testing_string" = "X$echo_test_string"; then
     644        ECHO="$dir/echo"
     645        break
     646      fi
     647    done
     648    IFS="$lt_save_ifs"
     649
     650    if test "X$ECHO" = Xecho; then
     651      # We didn't find a better echo, so look for alternatives.
     652      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
     653         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
     654         test "X$echo_testing_string" = "X$echo_test_string"; then
     655        # This shell has a builtin print -r that does the trick.
     656        ECHO='print -r'
     657      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
     658           test "X$CONFIG_SHELL" != X/bin/ksh; then
     659        # If we have ksh, try running configure again with it.
     660        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
     661        export ORIGINAL_CONFIG_SHELL
     662        CONFIG_SHELL=/bin/ksh
     663        export CONFIG_SHELL
     664        exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
     665      else
     666        # Try using printf.
     667        ECHO='printf %s\n'
     668        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
     669           echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
     670           test "X$echo_testing_string" = "X$echo_test_string"; then
     671          # Cool, printf works
     672          :
     673        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
     674             test "X$echo_testing_string" = 'X\t' &&
     675             echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
     676             test "X$echo_testing_string" = "X$echo_test_string"; then
     677          CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
     678          export CONFIG_SHELL
     679          SHELL="$CONFIG_SHELL"
     680          export SHELL
     681          ECHO="$CONFIG_SHELL $0 --fallback-echo"
     682        elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
     683             test "X$echo_testing_string" = 'X\t' &&
     684             echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
     685             test "X$echo_testing_string" = "X$echo_test_string"; then
     686          ECHO="$CONFIG_SHELL $0 --fallback-echo"
     687        else
     688          # maybe with a smaller string...
     689          prev=:
     690
     691          for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
     692            if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
     693            then
     694              break
     695            fi
     696            prev="$cmd"
     697          done
     698
     699          if test "$prev" != 'sed 50q "$0"'; then
     700            echo_test_string=`eval $prev`
     701            export echo_test_string
     702            exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
     703          else
     704            # Oops.  We lost completely, so just stick with echo.
     705            ECHO=echo
     706          fi
     707        fi
     708      fi
     709    fi
     710  fi
     711fi
     712
     713# Copy echo and quote the copy suitably for passing to libtool from
     714# the Makefile, instead of quoting the original, which is used later.
     715lt_ECHO=$ECHO
     716if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
     717   lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
     718fi
     719
     720
     721
     722
     723exec 7<&0 </dev/null 6>&1
     724
     725# Name of the host.
     726# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
     727# so uname gets run too.
     728ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
     729
     730#
     731# Initializations.
     732#
    12733ac_default_prefix=/usr/local
    13 # Any additions from configure.in:
    14 ac_help="$ac_help
    15   --enable-shared         build shared library using GNU libtool"
    16 ac_help="$ac_help
    17   --enable-static         build static library using GNU libtool"
    18 ac_help="$ac_help
    19   --enable-maxmem[=N]     enable use of temp files, set max mem usage to N MB"
    20 ac_help="$ac_help
    21 "
     734ac_clean_files=
     735ac_config_libobj_dir=.
     736LIBOBJS=
     737cross_compiling=no
     738subdirs=
     739MFLAGS=
     740MAKEFLAGS=
     741SHELL=${CONFIG_SHELL-/bin/sh}
     742
     743# Identity of this package.
     744PACKAGE_NAME='libjpeg'
     745PACKAGE_TARNAME='libjpeg'
     746PACKAGE_VERSION='7.0'
     747PACKAGE_STRING='libjpeg 7.0'
     748PACKAGE_BUGREPORT=''
     749
     750# Factoring default headers for most tests.
     751ac_includes_default="\
     752#include <stdio.h>
     753#ifdef HAVE_SYS_TYPES_H
     754# include <sys/types.h>
     755#endif
     756#ifdef HAVE_SYS_STAT_H
     757# include <sys/stat.h>
     758#endif
     759#ifdef STDC_HEADERS
     760# include <stdlib.h>
     761# include <stddef.h>
     762#else
     763# ifdef HAVE_STDLIB_H
     764#  include <stdlib.h>
     765# endif
     766#endif
     767#ifdef HAVE_STRING_H
     768# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
     769#  include <memory.h>
     770# endif
     771# include <string.h>
     772#endif
     773#ifdef HAVE_STRINGS_H
     774# include <strings.h>
     775#endif
     776#ifdef HAVE_INTTYPES_H
     777# include <inttypes.h>
     778#endif
     779#ifdef HAVE_STDINT_H
     780# include <stdint.h>
     781#endif
     782#ifdef HAVE_UNISTD_H
     783# include <unistd.h>
     784#endif"
     785
     786ac_subst_vars='am__EXEEXT_FALSE
     787am__EXEEXT_TRUE
     788LTLIBOBJS
     789LIBOBJS
     790JPEG_LIB_VERSION
     791MEMORYMGR
     792OTOOL64
     793OTOOL
     794LIPO
     795NMEDIT
     796DSYMUTIL
     797lt_ECHO
     798RANLIB
     799AR
     800NM
     801ac_ct_DUMPBIN
     802DUMPBIN
     803LD
     804FGREP
     805SED
     806LIBTOOL
     807OBJDUMP
     808DLLTOOL
     809AS
     810HAVE_LD_VERSION_SCRIPT_FALSE
     811HAVE_LD_VERSION_SCRIPT_TRUE
     812LN_S
     813MAINT
     814MAINTAINER_MODE_FALSE
     815MAINTAINER_MODE_TRUE
     816ANSI2KNR
     817U
     818EGREP
     819GREP
     820CPP
     821am__fastdepCC_FALSE
     822am__fastdepCC_TRUE
     823CCDEPMODE
     824AMDEPBACKSLASH
     825AMDEP_FALSE
     826AMDEP_TRUE
     827am__quote
     828am__include
     829DEPDIR
     830OBJEXT
     831EXEEXT
     832ac_ct_CC
     833CPPFLAGS
     834LDFLAGS
     835CFLAGS
     836CC
     837AM_BACKSLASH
     838AM_DEFAULT_VERBOSITY
     839am__untar
     840am__tar
     841AMTAR
     842am__leading_dot
     843SET_MAKE
     844AWK
     845mkdir_p
     846MKDIR_P
     847INSTALL_STRIP_PROGRAM
     848STRIP
     849install_sh
     850MAKEINFO
     851AUTOHEADER
     852AUTOMAKE
     853AUTOCONF
     854ACLOCAL
     855VERSION
     856PACKAGE
     857CYGPATH_W
     858am__isrc
     859INSTALL_DATA
     860INSTALL_SCRIPT
     861INSTALL_PROGRAM
     862target_os
     863target_vendor
     864target_cpu
     865target
     866host_os
     867host_vendor
     868host_cpu
     869host
     870build_os
     871build_vendor
     872build_cpu
     873build
     874target_alias
     875host_alias
     876build_alias
     877LIBS
     878ECHO_T
     879ECHO_N
     880ECHO_C
     881DEFS
     882mandir
     883localedir
     884libdir
     885psdir
     886pdfdir
     887dvidir
     888htmldir
     889infodir
     890docdir
     891oldincludedir
     892includedir
     893localstatedir
     894sharedstatedir
     895sysconfdir
     896datadir
     897datarootdir
     898libexecdir
     899sbindir
     900bindir
     901program_transform_name
     902prefix
     903exec_prefix
     904PACKAGE_BUGREPORT
     905PACKAGE_STRING
     906PACKAGE_VERSION
     907PACKAGE_TARNAME
     908PACKAGE_NAME
     909PATH_SEPARATOR
     910SHELL'
     911ac_subst_files=''
     912ac_user_opts='
     913enable_option_checking
     914enable_silent_rules
     915enable_dependency_tracking
     916enable_maintainer_mode
     917enable_ld_version_script
     918enable_shared
     919enable_static
     920with_pic
     921enable_fast_install
     922with_gnu_ld
     923enable_libtool_lock
     924enable_maxmem
     925'
     926      ac_precious_vars='build_alias
     927host_alias
     928target_alias
     929CC
     930CFLAGS
     931LDFLAGS
     932LIBS
     933CPPFLAGS
     934CPP'
     935
    22936
    23937# Initialize some variables set by options.
     938ac_init_help=
     939ac_init_version=false
     940ac_unrecognized_opts=
     941ac_unrecognized_sep=
    24942# The variables have the same names as the options, with