Check-in Differences
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From d108482c9b719929 To 294601b232f6563c

2013-05-05
10:48
changing Makefile-static-MinGW (now supporting liblzma for TIFFs) check-in: 64d6bbc0e8 user: sandro tags: trunk
2013-03-01
15:43
switching to v.1.1f (some small bug fixed) check-in: d108482c9b user: sandro tags: trunk
2012-12-13
11:32
fixing several issues reported by Paul Daisey (v.4.0 compatibility) check-in: 5733785446 user: sandro tags: trunk
2010-01-09
11:16
implementing Shaded Relief for Grids check-in: d4879cedec user: a.furieri@lqt.it tags: trunk
2009-12-07
15:41
supporting RGBA, ARGB, BGR and BGRA raw images check-in: 294601b232 user: a.furieri@lqt.it tags: trunk
2009-11-19
11:03
fixing makefile and warnings for MSVC check-in: bf94dc55e3 user: a.furieri@lqt.it tags: trunk

Changes to AUTHORS.

     1      1   Original Author:
     2      2   Alessandro Furieri <a.furieri@lqt.it>
     3      3   
     4         -Contributors:
     5         -Brad Hards <bradh@frogmouth.net>
            4  +Portion Copyrigth [the Epsilon Wavelet library]:
            5  +Alexander Simakov, <xander@entropyware.info>

Changes to COPYING.

     1         -                          MOZILLA PUBLIC LICENSE
     2         -                                Version 1.1
            1  +                   GNU GENERAL PUBLIC LICENSE
            2  +                       Version 3, 29 June 2007
            3  +
            4  + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
            5  + Everyone is permitted to copy and distribute verbatim copies
            6  + of this license document, but changing it is not allowed.
            7  +
            8  +                            Preamble
            9  +
           10  +  The GNU General Public License is a free, copyleft license for
           11  +software and other kinds of works.
           12  +
           13  +  The licenses for most software and other practical works are designed
           14  +to take away your freedom to share and change the works.  By contrast,
           15  +the GNU General Public License is intended to guarantee your freedom to
           16  +share and change all versions of a program--to make sure it remains free
           17  +software for all its users.  We, the Free Software Foundation, use the
           18  +GNU General Public License for most of our software; it applies also to
           19  +any other work released this way by its authors.  You can apply it to
           20  +your programs, too.
           21  +
           22  +  When we speak of free software, we are referring to freedom, not
           23  +price.  Our General Public Licenses are designed to make sure that you
           24  +have the freedom to distribute copies of free software (and charge for
           25  +them if you wish), that you receive source code or can get it if you
           26  +want it, that you can change the software or use pieces of it in new
           27  +free programs, and that you know you can do these things.
           28  +
           29  +  To protect your rights, we need to prevent others from denying you
           30  +these rights or asking you to surrender the rights.  Therefore, you have
           31  +certain responsibilities if you distribute copies of the software, or if
           32  +you modify it: responsibilities to respect the freedom of others.
           33  +
           34  +  For example, if you distribute copies of such a program, whether
           35  +gratis or for a fee, you must pass on to the recipients the same
           36  +freedoms that you received.  You must make sure that they, too, receive
           37  +or can get the source code.  And you must show them these terms so they
           38  +know their rights.
           39  +
           40  +  Developers that use the GNU GPL protect your rights with two steps:
           41  +(1) assert copyright on the software, and (2) offer you this License
           42  +giving you legal permission to copy, distribute and/or modify it.
           43  +
           44  +  For the developers' and authors' protection, the GPL clearly explains
           45  +that there is no warranty for this free software.  For both users' and
           46  +authors' sake, the GPL requires that modified versions be marked as
           47  +changed, so that their problems will not be attributed erroneously to
           48  +authors of previous versions.
           49  +
           50  +  Some devices are designed to deny users access to install or run
           51  +modified versions of the software inside them, although the manufacturer
           52  +can do so.  This is fundamentally incompatible with the aim of
           53  +protecting users' freedom to change the software.  The systematic
           54  +pattern of such abuse occurs in the area of products for individuals to
           55  +use, which is precisely where it is most unacceptable.  Therefore, we
           56  +have designed this version of the GPL to prohibit the practice for those
           57  +products.  If such problems arise substantially in other domains, we
           58  +stand ready to extend this provision to those domains in future versions
           59  +of the GPL, as needed to protect the freedom of users.
           60  +
           61  +  Finally, every program is threatened constantly by software patents.
           62  +States should not allow patents to restrict development and use of
           63  +software on general-purpose computers, but in those that do, we wish to
           64  +avoid the special danger that patents applied to a free program could
           65  +make it effectively proprietary.  To prevent this, the GPL assures that
           66  +patents cannot be used to render the program non-free.
           67  +
           68  +  The precise terms and conditions for copying, distribution and
           69  +modification follow.
           70  +
           71  +                       TERMS AND CONDITIONS
           72  +
           73  +  0. Definitions.
           74  +
           75  +  "This License" refers to version 3 of the GNU General Public License.
           76  +
           77  +  "Copyright" also means copyright-like laws that apply to other kinds of
           78  +works, such as semiconductor masks.
           79  +
           80  +  "The Program" refers to any copyrightable work licensed under this
           81  +License.  Each licensee is addressed as "you".  "Licensees" and
           82  +"recipients" may be individuals or organizations.
           83  +
           84  +  To "modify" a work means to copy from or adapt all or part of the work
           85  +in a fashion requiring copyright permission, other than the making of an
           86  +exact copy.  The resulting work is called a "modified version" of the
           87  +earlier work or a work "based on" the earlier work.
           88  +
           89  +  A "covered work" means either the unmodified Program or a work based
           90  +on the Program.
           91  +
           92  +  To "propagate" a work means to do anything with it that, without
           93  +permission, would make you directly or secondarily liable for
           94  +infringement under applicable copyright law, except executing it on a
           95  +computer or modifying a private copy.  Propagation includes copying,
           96  +distribution (with or without modification), making available to the
           97  +public, and in some countries other activities as well.
           98  +
           99  +  To "convey" a work means any kind of propagation that enables other
          100  +parties to make or receive copies.  Mere interaction with a user through
          101  +a computer network, with no transfer of a copy, is not conveying.
          102  +
          103  +  An interactive user interface displays "Appropriate Legal Notices"
          104  +to the extent that it includes a convenient and prominently visible
          105  +feature that (1) displays an appropriate copyright notice, and (2)
          106  +tells the user that there is no warranty for the work (except to the
          107  +extent that warranties are provided), that licensees may convey the
          108  +work under this License, and how to view a copy of this License.  If
          109  +the interface presents a list of user commands or options, such as a
          110  +menu, a prominent item in the list meets this criterion.
          111  +
          112  +  1. Source Code.
          113  +
          114  +  The "source code" for a work means the preferred form of the work
          115  +for making modifications to it.  "Object code" means any non-source
          116  +form of a work.
          117  +
          118  +  A "Standard Interface" means an interface that either is an official
          119  +standard defined by a recognized standards body, or, in the case of
          120  +interfaces specified for a particular programming language, one that
          121  +is widely used among developers working in that language.
          122  +
          123  +  The "System Libraries" of an executable work include anything, other
          124  +than the work as a whole, that (a) is included in the normal form of
          125  +packaging a Major Component, but which is not part of that Major
          126  +Component, and (b) serves only to enable use of the work with that
          127  +Major Component, or to implement a Standard Interface for which an
          128  +implementation is available to the public in source code form.  A
          129  +"Major Component", in this context, means a major essential component
          130  +(kernel, window system, and so on) of the specific operating system
          131  +(if any) on which the executable work runs, or a compiler used to
          132  +produce the work, or an object code interpreter used to run it.
          133  +
          134  +  The "Corresponding Source" for a work in object code form means all
          135  +the source code needed to generate, install, and (for an executable
          136  +work) run the object code and to modify the work, including scripts to
          137  +control those activities.  However, it does not include the work's
          138  +System Libraries, or general-purpose tools or generally available free
          139  +programs which are used unmodified in performing those activities but
          140  +which are not part of the work.  For example, Corresponding Source
          141  +includes interface definition files associated with source files for
          142  +the work, and the source code for shared libraries and dynamically
          143  +linked subprograms that the work is specifically designed to require,
          144  +such as by intimate data communication or control flow between those
          145  +subprograms and other parts of the work.
          146  +
          147  +  The Corresponding Source need not include anything that users
          148  +can regenerate automatically from other parts of the Corresponding
          149  +Source.
          150  +
          151  +  The Corresponding Source for a work in source code form is that
          152  +same work.
          153  +
          154  +  2. Basic Permissions.
          155  +
          156  +  All rights granted under this License are granted for the term of
          157  +copyright on the Program, and are irrevocable provided the stated
          158  +conditions are met.  This License explicitly affirms your unlimited
          159  +permission to run the unmodified Program.  The output from running a
          160  +covered work is covered by this License only if the output, given its
          161  +content, constitutes a covered work.  This License acknowledges your
          162  +rights of fair use or other equivalent, as provided by copyright law.
          163  +
          164  +  You may make, run and propagate covered works that you do not
          165  +convey, without conditions so long as your license otherwise remains
          166  +in force.  You may convey covered works to others for the sole purpose
          167  +of having them make modifications exclusively for you, or provide you
          168  +with facilities for running those works, provided that you comply with
          169  +the terms of this License in conveying all material for which you do
          170  +not control copyright.  Those thus making or running the covered works
          171  +for you must do so exclusively on your behalf, under your direction
          172  +and control, on terms that prohibit them from making any copies of
          173  +your copyrighted material outside their relationship with you.
          174  +
          175  +  Conveying under any other circumstances is permitted solely under
          176  +the conditions stated below.  Sublicensing is not allowed; section 10
          177  +makes it unnecessary.
          178  +
          179  +  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
          180  +
          181  +  No covered work shall be deemed part of an effective technological
          182  +measure under any applicable law fulfilling obligations under article
          183  +11 of the WIPO copyright treaty adopted on 20 December 1996, or
          184  +similar laws prohibiting or restricting circumvention of such
          185  +measures.
          186  +
          187  +  When you convey a covered work, you waive any legal power to forbid
          188  +circumvention of technological measures to the extent such circumvention
          189  +is effected by exercising rights under this License with respect to
          190  +the covered work, and you disclaim any intention to limit operation or
          191  +modification of the work as a means of enforcing, against the work's
          192  +users, your or third parties' legal rights to forbid circumvention of
          193  +technological measures.
          194  +
          195  +  4. Conveying Verbatim Copies.
          196  +
          197  +  You may convey verbatim copies of the Program's source code as you
          198  +receive it, in any medium, provided that you conspicuously and
          199  +appropriately publish on each copy an appropriate copyright notice;
          200  +keep intact all notices stating that this License and any
          201  +non-permissive terms added in accord with section 7 apply to the code;
          202  +keep intact all notices of the absence of any warranty; and give all
          203  +recipients a copy of this License along with the Program.
          204  +
          205  +  You may charge any price or no price for each copy that you convey,
          206  +and you may offer support or warranty protection for a fee.
          207  +
          208  +  5. Conveying Modified Source Versions.
          209  +
          210  +  You may convey a work based on the Program, or the modifications to
          211  +produce it from the Program, in the form of source code under the
          212  +terms of section 4, provided that you also meet all of these conditions:
          213  +
          214  +    a) The work must carry prominent notices stating that you modified
          215  +    it, and giving a relevant date.
          216  +
          217  +    b) The work must carry prominent notices stating that it is
          218  +    released under this License and any conditions added under section
          219  +    7.  This requirement modifies the requirement in section 4 to
          220  +    "keep intact all notices".
          221  +
          222  +    c) You must license the entire work, as a whole, under this
          223  +    License to anyone who comes into possession of a copy.  This
          224  +    License will therefore apply, along with any applicable section 7
          225  +    additional terms, to the whole of the work, and all its parts,
          226  +    regardless of how they are packaged.  This License gives no
          227  +    permission to license the work in any other way, but it does not
          228  +    invalidate such permission if you have separately received it.
          229  +
          230  +    d) If the work has interactive user interfaces, each must display
          231  +    Appropriate Legal Notices; however, if the Program has interactive
          232  +    interfaces that do not display Appropriate Legal Notices, your
          233  +    work need not make them do so.
          234  +
          235  +  A compilation of a covered work with other separate and independent
          236  +works, which are not by their nature extensions of the covered work,
          237  +and which are not combined with it such as to form a larger program,
          238  +in or on a volume of a storage or distribution medium, is called an
          239  +"aggregate" if the compilation and its resulting copyright are not
          240  +used to limit the access or legal rights of the compilation's users
          241  +beyond what the individual works permit.  Inclusion of a covered work
          242  +in an aggregate does not cause this License to apply to the other
          243  +parts of the aggregate.
          244  +
          245  +  6. Conveying Non-Source Forms.
          246  +
          247  +  You may convey a covered work in object code form under the terms
          248  +of sections 4 and 5, provided that you also convey the
          249  +machine-readable Corresponding Source under the terms of this License,
          250  +in one of these ways:
          251  +
          252  +    a) Convey the object code in, or embodied in, a physical product
          253  +    (including a physical distribution medium), accompanied by the
          254  +    Corresponding Source fixed on a durable physical medium
          255  +    customarily used for software interchange.
          256  +
          257  +    b) Convey the object code in, or embodied in, a physical product
          258  +    (including a physical distribution medium), accompanied by a
          259  +    written offer, valid for at least three years and valid for as
          260  +    long as you offer spare parts or customer support for that product
          261  +    model, to give anyone who possesses the object code either (1) a
          262  +    copy of the Corresponding Source for all the software in the
          263  +    product that is covered by this License, on a durable physical
          264  +    medium customarily used for software interchange, for a price no
          265  +    more than your reasonable cost of physically performing this
          266  +    conveying of source, or (2) access to copy the
          267  +    Corresponding Source from a network server at no charge.
          268  +
          269  +    c) Convey individual copies of the object code with a copy of the
          270  +    written offer to provide the Corresponding Source.  This
          271  +    alternative is allowed only occasionally and noncommercially, and
          272  +    only if you received the object code with such an offer, in accord
          273  +    with subsection 6b.
          274  +
          275  +    d) Convey the object code by offering access from a designated
          276  +    place (gratis or for a charge), and offer equivalent access to the
          277  +    Corresponding Source in the same way through the same place at no
          278  +    further charge.  You need not require recipients to copy the
          279  +    Corresponding Source along with the object code.  If the place to
          280  +    copy the object code is a network server, the Corresponding Source
          281  +    may be on a different server (operated by you or a third party)
          282  +    that supports equivalent copying facilities, provided you maintain
          283  +    clear directions next to the object code saying where to find the
          284  +    Corresponding Source.  Regardless of what server hosts the
          285  +    Corresponding Source, you remain obligated to ensure that it is
          286  +    available for as long as needed to satisfy these requirements.
          287  +
          288  +    e) Convey the object code using peer-to-peer transmission, provided
          289  +    you inform other peers where the object code and Corresponding
          290  +    Source of the work are being offered to the general public at no
          291  +    charge under subsection 6d.
          292  +
          293  +  A separable portion of the object code, whose source code is excluded
          294  +from the Corresponding Source as a System Library, need not be
          295  +included in conveying the object code work.
          296  +
          297  +  A "User Product" is either (1) a "consumer product", which means any
          298  +tangible personal property which is normally used for personal, family,
          299  +or household purposes, or (2) anything designed or sold for incorporation
          300  +into a dwelling.  In determining whether a product is a consumer product,
          301  +doubtful cases shall be resolved in favor of coverage.  For a particular
          302  +product received by a particular user, "normally used" refers to a
          303  +typical or common use of that class of product, regardless of the status
          304  +of the particular user or of the way in which the particular user
          305  +actually uses, or expects or is expected to use, the product.  A product
          306  +is a consumer product regardless of whether the product has substantial
          307  +commercial, industrial or non-consumer uses, unless such uses represent
          308  +the only significant mode of use of the product.
          309  +
          310  +  "Installation Information" for a User Product means any methods,
          311  +procedures, authorization keys, or other information required to install
          312  +and execute modified versions of a covered work in that User Product from
          313  +a modified version of its Corresponding Source.  The information must
          314  +suffice to ensure that the continued functioning of the modified object
          315  +code is in no case prevented or interfered with solely because
          316  +modification has been made.
          317  +
          318  +  If you convey an object code work under this section in, or with, or
          319  +specifically for use in, a User Product, and the conveying occurs as
          320  +part of a transaction in which the right of possession and use of the
          321  +User Product is transferred to the recipient in perpetuity or for a
          322  +fixed term (regardless of how the transaction is characterized), the
          323  +Corresponding Source conveyed under this section must be accompanied
          324  +by the Installation Information.  But this requirement does not apply
          325  +if neither you nor any third party retains the ability to install
          326  +modified object code on the User Product (for example, the work has
          327  +been installed in ROM).
          328  +
          329  +  The requirement to provide Installation Information does not include a
          330  +requirement to continue to provide support service, warranty, or updates
          331  +for a work that has been modified or installed by the recipient, or for
          332  +the User Product in which it has been modified or installed.  Access to a
          333  +network may be denied when the modification itself materially and
          334  +adversely affects the operation of the network or violates the rules and
          335  +protocols for communication across the network.
          336  +
          337  +  Corresponding Source conveyed, and Installation Information provided,
          338  +in accord with this section must be in a format that is publicly
          339  +documented (and with an implementation available to the public in
          340  +source code form), and must require no special password or key for
          341  +unpacking, reading or copying.
          342  +
          343  +  7. Additional Terms.
          344  +
          345  +  "Additional permissions" are terms that supplement the terms of this
          346  +License by making exceptions from one or more of its conditions.
          347  +Additional permissions that are applicable to the entire Program shall
          348  +be treated as though they were included in this License, to the extent
          349  +that they are valid under applicable law.  If additional permissions
          350  +apply only to part of the Program, that part may be used separately
          351  +under those permissions, but the entire Program remains governed by
          352  +this License without regard to the additional permissions.
          353  +
          354  +  When you convey a copy of a covered work, you may at your option
          355  +remove any additional permissions from that copy, or from any part of
          356  +it.  (Additional permissions may be written to require their own
          357  +removal in certain cases when you modify the work.)  You may place
          358  +additional permissions on material, added by you to a covered work,
          359  +for which you have or can give appropriate copyright permission.
          360  +
          361  +  Notwithstanding any other provision of this License, for material you
          362  +add to a covered work, you may (if authorized by the copyright holders of
          363  +that material) supplement the terms of this License with terms:
          364  +
          365  +    a) Disclaiming warranty or limiting liability differently from the
          366  +    terms of sections 15 and 16 of this License; or
          367  +
          368  +    b) Requiring preservation of specified reasonable legal notices or
          369  +    author attributions in that material or in the Appropriate Legal
          370  +    Notices displayed by works containing it; or
          371  +
          372  +    c) Prohibiting misrepresentation of the origin of that material, or
          373  +    requiring that modified versions of such material be marked in
          374  +    reasonable ways as different from the original version; or
          375  +
          376  +    d) Limiting the use for publicity purposes of names of licensors or
          377  +    authors of the material; or
          378  +
          379  +    e) Declining to grant rights under trademark law for use of some
          380  +    trade names, trademarks, or service marks; or
          381  +
          382  +    f) Requiring indemnification of licensors and authors of that
          383  +    material by anyone who conveys the material (or modified versions of
          384  +    it) with contractual assumptions of liability to the recipient, for
          385  +    any liability that these contractual assumptions directly impose on
          386  +    those licensors and authors.
          387  +
          388  +  All other non-permissive additional terms are considered "further
          389  +restrictions" within the meaning of section 10.  If the Program as you
          390  +received it, or any part of it, contains a notice stating that it is
          391  +governed by this License along with a term that is a further
          392  +restriction, you may remove that term.  If a license document contains
          393  +a further restriction but permits relicensing or conveying under this
          394  +License, you may add to a covered work material governed by the terms
          395  +of that license document, provided that the further restriction does
          396  +not survive such relicensing or conveying.
          397  +
          398  +  If you add terms to a covered work in accord with this section, you
          399  +must place, in the relevant source files, a statement of the
          400  +additional terms that apply to those files, or a notice indicating
          401  +where to find the applicable terms.
          402  +
          403  +  Additional terms, permissive or non-permissive, may be stated in the
          404  +form of a separately written license, or stated as exceptions;
          405  +the above requirements apply either way.
          406  +
          407  +  8. Termination.
          408  +
          409  +  You may not propagate or modify a covered work except as expressly
          410  +provided under this License.  Any attempt otherwise to propagate or
          411  +modify it is void, and will automatically terminate your rights under
          412  +this License (including any patent licenses granted under the third
          413  +paragraph of section 11).
          414  +
          415  +  However, if you cease all violation of this License, then your
          416  +license from a particular copyright holder is reinstated (a)
          417  +provisionally, unless and until the copyright holder explicitly and
          418  +finally terminates your license, and (b) permanently, if the copyright
          419  +holder fails to notify you of the violation by some reasonable means
          420  +prior to 60 days after the cessation.
          421  +
          422  +  Moreover, your license from a particular copyright holder is
          423  +reinstated permanently if the copyright holder notifies you of the
          424  +violation by some reasonable means, this is the first time you have
          425  +received notice of violation of this License (for any work) from that
          426  +copyright holder, and you cure the violation prior to 30 days after
          427  +your receipt of the notice.
          428  +
          429  +  Termination of your rights under this section does not terminate the
          430  +licenses of parties who have received copies or rights from you under
          431  +this License.  If your rights have been terminated and not permanently
          432  +reinstated, you do not qualify to receive new licenses for the same
          433  +material under section 10.
          434  +
          435  +  9. Acceptance Not Required for Having Copies.
          436  +
          437  +  You are not required to accept this License in order to receive or
          438  +run a copy of the Program.  Ancillary propagation of a covered work
          439  +occurring solely as a consequence of using peer-to-peer transmission
          440  +to receive a copy likewise does not require acceptance.  However,
          441  +nothing other than this License grants you permission to propagate or
          442  +modify any covered work.  These actions infringe copyright if you do
          443  +not accept this License.  Therefore, by modifying or propagating a
          444  +covered work, you indicate your acceptance of this License to do so.
          445  +
          446  +  10. Automatic Licensing of Downstream Recipients.
          447  +
          448  +  Each time you convey a covered work, the recipient automatically
          449  +receives a license from the original licensors, to run, modify and
          450  +propagate that work, subject to this License.  You are not responsible
          451  +for enforcing compliance by third parties with this License.
          452  +
          453  +  An "entity transaction" is a transaction transferring control of an
          454  +organization, or substantially all assets of one, or subdividing an
          455  +organization, or merging organizations.  If propagation of a covered
          456  +work results from an entity transaction, each party to that
          457  +transaction who receives a copy of the work also receives whatever
          458  +licenses to the work the party's predecessor in interest had or could
          459  +give under the previous paragraph, plus a right to possession of the
          460  +Corresponding Source of the work from the predecessor in interest, if
          461  +the predecessor has it or can get it with reasonable efforts.
          462  +
          463  +  You may not impose any further restrictions on the exercise of the
          464  +rights granted or affirmed under this License.  For example, you may
          465  +not impose a license fee, royalty, or other charge for exercise of
          466  +rights granted under this License, and you may not initiate litigation
          467  +(including a cross-claim or counterclaim in a lawsuit) alleging that
          468  +any patent claim is infringed by making, using, selling, offering for
          469  +sale, or importing the Program or any portion of it.
          470  +
          471  +  11. Patents.
          472  +
          473  +  A "contributor" is a copyright holder who authorizes use under this
          474  +License of the Program or a work on which the Program is based.  The
          475  +work thus licensed is called the contributor's "contributor version".
          476  +
          477  +  A contributor's "essential patent claims" are all patent claims
          478  +owned or controlled by the contributor, whether already acquired or
          479  +hereafter acquired, that would be infringed by some manner, permitted
          480  +by this License, of making, using, or selling its contributor version,
          481  +but do not include claims that would be infringed only as a
          482  +consequence of further modification of the contributor version.  For
          483  +purposes of this definition, "control" includes the right to grant
          484  +patent sublicenses in a manner consistent with the requirements of
          485  +this License.
          486  +
          487  +  Each contributor grants you a non-exclusive, worldwide, royalty-free
          488  +patent license under the contributor's essential patent claims, to
          489  +make, use, sell, offer for sale, import and otherwise run, modify and
          490  +propagate the contents of its contributor version.
          491  +
          492  +  In the following three paragraphs, a "patent license" is any express
          493  +agreement or commitment, however denominated, not to enforce a patent
          494  +(such as an express permission to practice a patent or covenant not to
          495  +sue for patent infringement).  To "grant" such a patent license to a
          496  +party means to make such an agreement or commitment not to enforce a
          497  +patent against the party.
          498  +
          499  +  If you convey a covered work, knowingly relying on a patent license,
          500  +and the Corresponding Source of the work is not available for anyone
          501  +to copy, free of charge and under the terms of this License, through a
          502  +publicly available network server or other readily accessible means,
          503  +then you must either (1) cause the Corresponding Source to be so
          504  +available, or (2) arrange to deprive yourself of the benefit of the
          505  +patent license for this particular work, or (3) arrange, in a manner
          506  +consistent with the requirements of this License, to extend the patent
          507  +license to downstream recipients.  "Knowingly relying" means you have
          508  +actual knowledge that, but for the patent license, your conveying the
          509  +covered work in a country, or your recipient's use of the covered work
          510  +in a country, would infringe one or more identifiable patents in that
          511  +country that you have reason to believe are valid.
          512  +
          513  +  If, pursuant to or in connection with a single transaction or
          514  +arrangement, you convey, or propagate by procuring conveyance of, a
          515  +covered work, and grant a patent license to some of the parties
          516  +receiving the covered work authorizing them to use, propagate, modify
          517  +or convey a specific copy of the covered work, then the patent license
          518  +you grant is automatically extended to all recipients of the covered
          519  +work and works based on it.
          520  +
          521  +  A patent license is "discriminatory" if it does not include within
          522  +the scope of its coverage, prohibits the exercise of, or is
          523  +conditioned on the non-exercise of one or more of the rights that are
          524  +specifically granted under this License.  You may not convey a covered
          525  +work if you are a party to an arrangement with a third party that is
          526  +in the business of distributing software, under which you make payment
          527  +to the third party based on the extent of your activity of conveying
          528  +the work, and under which the third party grants, to any of the
          529  +parties who would receive the covered work from you, a discriminatory
          530  +patent license (a) in connection with copies of the covered work
          531  +conveyed by you (or copies made from those copies), or (b) primarily
          532  +for and in connection with specific products or compilations that
          533  +contain the covered work, unless you entered into that arrangement,
          534  +or that patent license was granted, prior to 28 March 2007.
          535  +
          536  +  Nothing in this License shall be construed as excluding or limiting
          537  +any implied license or other defenses to infringement that may
          538  +otherwise be available to you under applicable patent law.
          539  +
          540  +  12. No Surrender of Others' Freedom.
          541  +
          542  +  If conditions are imposed on you (whether by court order, agreement or
          543  +otherwise) that contradict the conditions of this License, they do not
          544  +excuse you from the conditions of this License.  If you cannot convey a
          545  +covered work so as to satisfy simultaneously your obligations under this
          546  +License and any other pertinent obligations, then as a consequence you may
          547  +not convey it at all.  For example, if you agree to terms that obligate you
          548  +to collect a royalty for further conveying from those to whom you convey
          549  +the Program, the only way you could satisfy both those terms and this
          550  +License would be to refrain entirely from conveying the Program.
          551  +
          552  +  13. Use with the GNU Affero General Public License.
          553  +
          554  +  Notwithstanding any other provision of this License, you have
          555  +permission to link or combine any covered work with a work licensed
          556  +under version 3 of the GNU Affero General Public License into a single
          557  +combined work, and to convey the resulting work.  The terms of this
          558  +License will continue to apply to the part which is the covered work,
          559  +but the special requirements of the GNU Affero General Public License,
          560  +section 13, concerning interaction through a network will apply to the
          561  +combination as such.
          562  +
          563  +  14. Revised Versions of this License.
          564  +
          565  +  The Free Software Foundation may publish revised and/or new versions of
          566  +the GNU General Public License from time to time.  Such new versions will
          567  +be similar in spirit to the present version, but may differ in detail to
          568  +address new problems or concerns.
          569  +
          570  +  Each version is given a distinguishing version number.  If the
          571  +Program specifies that a certain numbered version of the GNU General
          572  +Public License "or any later version" applies to it, you have the
          573  +option of following the terms and conditions either of that numbered
          574  +version or of any later version published by the Free Software
          575  +Foundation.  If the Program does not specify a version number of the
          576  +GNU General Public License, you may choose any version ever published
          577  +by the Free Software Foundation.
          578  +
          579  +  If the Program specifies that a proxy can decide which future
          580  +versions of the GNU General Public License can be used, that proxy's
          581  +public statement of acceptance of a version permanently authorizes you
          582  +to choose that version for the Program.
          583  +
          584  +  Later license versions may give you additional or different
          585  +permissions.  However, no additional obligations are imposed on any
          586  +author or copyright holder as a result of your choosing to follow a
          587  +later version.
          588  +
          589  +  15. Disclaimer of Warranty.
          590  +
          591  +  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
          592  +APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
          593  +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
          594  +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
          595  +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
          596  +PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
          597  +IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
          598  +ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
          599  +
          600  +  16. Limitation of Liability.
          601  +
          602  +  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
          603  +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
          604  +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
          605  +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
          606  +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
          607  +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
          608  +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
          609  +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
          610  +SUCH DAMAGES.
          611  +
          612  +  17. Interpretation of Sections 15 and 16.
          613  +
          614  +  If the disclaimer of warranty and limitation of liability provided
          615  +above cannot be given local legal effect according to their terms,
          616  +reviewing courts shall apply local law that most closely approximates
          617  +an absolute waiver of all civil liability in connection with the
          618  +Program, unless a warranty or assumption of liability accompanies a
          619  +copy of the Program in return for a fee.
          620  +
          621  +                     END OF TERMS AND CONDITIONS
          622  +
          623  +            How to Apply These Terms to Your New Programs
          624  +
          625  +  If you develop a new program, and you want it to be of the greatest
          626  +possible use to the public, the best way to achieve this is to make it
          627  +free software which everyone can redistribute and change under these terms.
          628  +
          629  +  To do so, attach the following notices to the program.  It is safest
          630  +to attach them to the start of each source file to most effectively
          631  +state the exclusion of warranty; and each file should have at least
          632  +the "copyright" line and a pointer to where the full notice is found.
          633  +
          634  +    <one line to give the program's name and a brief idea of what it does.>
          635  +    Copyright (C) <year>  <name of author>
     3    636   
     4         -                              ---------------
          637  +    This program is free software: you can redistribute it and/or modify
          638  +    it under the terms of the GNU General Public License as published by
          639  +    the Free Software Foundation, either version 3 of the License, or
          640  +    (at your option) any later version.
     5    641   
     6         -1. Definitions.
          642  +    This program is distributed in the hope that it will be useful,
          643  +    but WITHOUT ANY WARRANTY; without even the implied warranty of
          644  +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
          645  +    GNU General Public License for more details.
     7    646   
     8         -     1.0.1. "Commercial Use" means distribution or otherwise making the
     9         -     Covered Code available to a third party.
    10         -
    11         -     1.1. "Contributor" means each entity that creates or contributes to
    12         -     the creation of Modifications.
          647  +    You should have received a copy of the GNU General Public License
          648  +    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    13    649   
    14         -     1.2. "Contributor Version" means the combination of the Original
    15         -     Code, prior Modifications used by a Contributor, and the Modifications
    16         -     made by that particular Contributor.
    17         -
    18         -     1.3. "Covered Code" means the Original Code or Modifications or the
    19         -     combination of the Original Code and Modifications, in each case
    20         -     including portions thereof.
          650  +Also add information on how to contact you by electronic and paper mail.
    21    651   
    22         -     1.4. "Electronic Distribution Mechanism" means a mechanism generally
    23         -     accepted in the software development community for the electronic
    24         -     transfer of data.
    25         -
    26         -     1.5. "Executable" means Covered Code in any form other than Source
    27         -     Code.
    28         -
    29         -     1.6. "Initial Developer" means the individual or entity identified
    30         -     as the Initial Developer in the Source Code notice required by Exhibit
    31         -     A.
    32         -
    33         -     1.7. "Larger Work" means a work which combines Covered Code or
    34         -     portions thereof with code not governed by the terms of this License.
          652  +  If the program does terminal interaction, make it output a short
          653  +notice like this when it starts in an interactive mode:
    35    654   
    36         -     1.8. "License" means this document.
    37         -
    38         -     1.8.1. "Licensable" means having the right to grant, to the maximum
    39         -     extent possible, whether at the time of the initial grant or
    40         -     subsequently acquired, any and all of the rights conveyed herein.
    41         -
    42         -     1.9. "Modifications" means any addition to or deletion from the
    43         -     substance or structure of either the Original Code or any previous
    44         -     Modifications. When Covered Code is released as a series of files, a
    45         -     Modification is:
    46         -          A. Any addition to or deletion from the contents of a file
    47         -          containing Original Code or previous Modifications.
    48         -
    49         -          B. Any new file that contains any part of the Original Code or
    50         -          previous Modifications.
    51         -
    52         -     1.10. "Original Code" means Source Code of computer software code
    53         -     which is described in the Source Code notice required by Exhibit A as
    54         -     Original Code, and which, at the time of its release under this
    55         -     License is not already Covered Code governed by this License.
    56         -
    57         -     1.10.1. "Patent Claims" means any patent claim(s), now owned or
    58         -     hereafter acquired, including without limitation,  method, process,
    59         -     and apparatus claims, in any patent Licensable by grantor.
    60         -
    61         -     1.11. "Source Code" means the preferred form of the Covered Code for
    62         -     making modifications to it, including all modules it contains, plus
    63         -     any associated interface definition files, scripts used to control
    64         -     compilation and installation of an Executable, or source code
    65         -     differential comparisons against either the Original Code or another
    66         -     well known, available Covered Code of the Contributor's choice. The
    67         -     Source Code can be in a compressed or archival form, provided the
    68         -     appropriate decompression or de-archiving software is widely available
    69         -     for no charge.
          655  +    <program>  Copyright (C) <year>  <name of author>
          656  +    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
          657  +    This is free software, and you are welcome to redistribute it
          658  +    under certain conditions; type `show c' for details.
    70    659   
    71         -     1.12. "You" (or "Your")  means an individual or a legal entity
    72         -     exercising rights under, and complying with all of the terms of, this
    73         -     License or a future version of this License issued under Section 6.1.
    74         -     For legal entities, "You" includes any entity which controls, is
    75         -     controlled by, or is under common control with You. For purposes of
    76         -     this definition, "control" means (a) the power, direct or indirect,
    77         -     to cause the direction or management of such entity, whether by
    78         -     contract or otherwise, or (b) ownership of more than fifty percent
    79         -     (50%) of the outstanding shares or beneficial ownership of such
    80         -     entity.
    81         -
    82         -2. Source Code License.
    83         -
    84         -     2.1. The Initial Developer Grant.
    85         -     The Initial Developer hereby grants You a world-wide, royalty-free,
    86         -     non-exclusive license, subject to third party intellectual property
    87         -     claims:
    88         -          (a)  under intellectual property rights (other than patent or
    89         -          trademark) Licensable by Initial Developer to use, reproduce,
    90         -          modify, display, perform, sublicense and distribute the Original
    91         -          Code (or portions thereof) with or without Modifications, and/or
    92         -          as part of a Larger Work; and
    93         -
    94         -          (b) under Patents Claims infringed by the making, using or
    95         -          selling of Original Code, to make, have made, use, practice,
    96         -          sell, and offer for sale, and/or otherwise dispose of the
    97         -          Original Code (or portions thereof).
    98         -
    99         -          (c) the licenses granted in this Section 2.1(a) and (b) are
   100         -          effective on the date Initial Developer first distributes
   101         -          Original Code under the terms of this License.
   102         -
   103         -          (d) Notwithstanding Section 2.1(b) above, no patent license is
   104         -          granted: 1) for code that You delete from the Original Code; 2)
   105         -          separate from the Original Code;  or 3) for infringements caused
   106         -          by: i) the modification of the Original Code or ii) the
   107         -          combination of the Original Code with other software or devices.
   108         -
   109         -     2.2. Contributor Grant.
   110         -     Subject to third party intellectual property claims, each Contributor
   111         -     hereby grants You a world-wide, royalty-free, non-exclusive license
   112         -
   113         -          (a)  under intellectual property rights (other than patent or
   114         -          trademark) Licensable by Contributor, to use, reproduce, modify,
   115         -          display, perform, sublicense and distribute the Modifications
   116         -          created by such Contributor (or portions thereof) either on an
   117         -          unmodified basis, with other Modifications, as Covered Code
   118         -          and/or as part of a Larger Work; and
   119         -
   120         -          (b) under Patent Claims infringed by the making, using, or
   121         -          selling of  Modifications made by that Contributor either alone
   122         -          and/or in combination with its Contributor Version (or portions
   123         -          of such combination), to make, use, sell, offer for sale, have
   124         -          made, and/or otherwise dispose of: 1) Modifications made by that
   125         -          Contributor (or portions thereof); and 2) the combination of
   126         -          Modifications made by that Contributor with its Contributor
   127         -          Version (or portions of such combination).
          660  +The hypothetical commands `show w' and `show c' should show the appropriate
          661  +parts of the General Public License.  Of course, your program's commands
          662  +might be different; for a GUI interface, you would use an "about box".
   128    663   
   129         -          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
   130         -          effective on the date Contributor first makes Commercial Use of
   131         -          the Covered Code.
   132         -
   133         -          (d)    Notwithstanding Section 2.2(b) above, no patent license is
   134         -          granted: 1) for any code that Contributor has deleted from the
   135         -          Contributor Version; 2)  separate from the Contributor Version;
   136         -          3)  for infringements caused by: i) third party modifications of
   137         -          Contributor Version or ii)  the combination of Modifications made
   138         -          by that Contributor with other software  (except as part of the
   139         -          Contributor Version) or other devices; or 4) under Patent Claims
   140         -          infringed by Covered Code in the absence of Modifications made by
   141         -          that Contributor.
   142         -
   143         -3. Distribution Obligations.
   144         -
   145         -     3.1. Application of License.
   146         -     The Modifications which You create or to which You contribute are
   147         -     governed by the terms of this License, including without limitation
   148         -     Section 2.2. The Source Code version of Covered Code may be
   149         -     distributed only under the terms of this License or a future version
   150         -     of this License released under Section 6.1, and You must include a
   151         -     copy of this License with every copy of the Source Code You
   152         -     distribute. You may not offer or impose any terms on any Source Code
   153         -     version that alters or restricts the applicable version of this
   154         -     License or the recipients' rights hereunder. However, You may include
   155         -     an additional document offering the additional rights described in
   156         -     Section 3.5.
   157         -
   158         -     3.2. Availability of Source Code.
   159         -     Any Modification which You create or to which You contribute must be
   160         -     made available in Source Code form under the terms of this License
   161         -     either on the same media as an Executable version or via an accepted
   162         -     Electronic Distribution Mechanism to anyone to whom you made an
   163         -     Executable version available; and if made available via Electronic
   164         -     Distribution Mechanism, must remain available for at least twelve (12)
   165         -     months after the date it initially became available, or at least six
   166         -     (6) months after a subsequent version of that particular Modification
   167         -     has been made available to such recipients. You are responsible for
   168         -     ensuring that the Source Code version remains available even if the
   169         -     Electronic Distribution Mechanism is maintained by a third party.
   170         -
   171         -     3.3. Description of Modifications.
   172         -     You must cause all Covered Code to which You contribute to contain a
   173         -     file documenting the changes You made to create that Covered Code and
   174         -     the date of any change. You must include a prominent statement that
   175         -     the Modification is derived, directly or indirectly, from Original
   176         -     Code provided by the Initial Developer and including the name of the
   177         -     Initial Developer in (a) the Source Code, and (b) in any notice in an
   178         -     Executable version or related documentation in which You describe the
   179         -     origin or ownership of the Covered Code.
   180         -
   181         -     3.4. Intellectual Property Matters
   182         -          (a) Third Party Claims.
   183         -          If Contributor has knowledge that a license under a third party's
   184         -          intellectual property rights is required to exercise the rights
   185         -          granted by such Contributor under Sections 2.1 or 2.2,
   186         -          Contributor must include a text file with the Source Code
   187         -          distribution titled "LEGAL" which describes the claim and the
   188         -          party making the claim in sufficient detail that a recipient will
   189         -          know whom to contact. If Contributor obtains such knowledge after
   190         -          the Modification is made available as described in Section 3.2,
   191         -          Contributor shall promptly modify the LEGAL file in all copies
   192         -          Contributor makes available thereafter and shall take other steps
   193         -          (such as notifying appropriate mailing lists or newsgroups)
   194         -          reasonably calculated to inform those who received the Covered
   195         -          Code that new knowledge has been obtained.
   196         -
   197         -          (b) Contributor APIs.
   198         -          If Contributor's Modifications include an application programming
   199         -          interface and Contributor has knowledge of patent licenses which
   200         -          are reasonably necessary to implement that API, Contributor must
   201         -          also include this information in the LEGAL file.
   202         -
   203         -               (c)    Representations.
   204         -          Contributor represents that, except as disclosed pursuant to
   205         -          Section 3.4(a) above, Contributor believes that Contributor's
   206         -          Modifications are Contributor's original creation(s) and/or
   207         -          Contributor has sufficient rights to grant the rights conveyed by
   208         -          this License.
   209         -
   210         -     3.5. Required Notices.
   211         -     You must duplicate the notice in Exhibit A in each file of the Source
   212         -     Code.  If it is not possible to put such notice in a particular Source
   213         -     Code file due to its structure, then You must include such notice in a
   214         -     location (such as a relevant directory) where a user would be likely
   215         -     to look for such a notice.  If You created one or more Modification(s)
   216         -     You may add your name as a Contributor to the notice described in
   217         -     Exhibit A.  You must also duplicate this License in any documentation
   218         -     for the Source Code where You describe recipients' rights or ownership
   219         -     rights relating to Covered Code.  You may choose to offer, and to
   220         -     charge a fee for, warranty, support, indemnity or liability
   221         -     obligations to one or more recipients of Covered Code. However, You
   222         -     may do so only on Your own behalf, and not on behalf of the Initial
   223         -     Developer or any Contributor. You must make it absolutely clear than
   224         -     any such warranty, support, indemnity or liability obligation is
   225         -     offered by You alone, and You hereby agree to indemnify the Initial
   226         -     Developer and every Contributor for any liability incurred by the
   227         -     Initial Developer or such Contributor as a result of warranty,
   228         -     support, indemnity or liability terms You offer.
   229         -
   230         -     3.6. Distribution of Executable Versions.
   231         -     You may distribute Covered Code in Executable form only if the
   232         -     requirements of Section 3.1-3.5 have been met for that Covered Code,
   233         -     and if You include a notice stating that the Source Code version of
   234         -     the Covered Code is available under the terms of this License,
   235         -     including a description of how and where You have fulfilled the
   236         -     obligations of Section 3.2. The notice must be conspicuously included
   237         -     in any notice in an Executable version, related documentation or
   238         -     collateral in which You describe recipients' rights relating to the
   239         -     Covered Code. You may distribute the Executable version of Covered
   240         -     Code or ownership rights under a license of Your choice, which may
   241         -     contain terms different from this License, provided that You are in
   242         -     compliance with the terms of this License and that the license for the
   243         -     Executable version does not attempt to limit or alter the recipient's
   244         -     rights in the Source Code version from the rights set forth in this
   245         -     License. If You distribute the Executable version under a different
   246         -     license You must make it absolutely clear that any terms which differ
   247         -     from this License are offered by You alone, not by the Initial
   248         -     Developer or any Contributor. You hereby agree to indemnify the
   249         -     Initial Developer and every Contributor for any liability incurred by
   250         -     the Initial Developer or such Contributor as a result of any such
   251         -     terms You offer.
          664  +  You should also get your employer (if you work as a programmer) or school,
          665  +if any, to sign a "copyright disclaimer" for the program, if necessary.
          666  +For more information on this, and how to apply and follow the GNU GPL, see
          667  +<http://www.gnu.org/licenses/>.
   252    668   
   253         -     3.7. Larger Works.
   254         -     You may create a Larger Work by combining Covered Code with other code
   255         -     not governed by the terms of this License and distribute the Larger
   256         -     Work as a single product. In such a case, You must make sure the
   257         -     requirements of this License are fulfilled for the Covered Code.
   258         -
   259         -4. Inability to Comply Due to Statute or Regulation.
   260         -
   261         -     If it is impossible for You to comply with any of the terms of this
   262         -     License with respect to some or all of the Covered Code due to
   263         -     statute, judicial order, or regulation then You must: (a) comply with
   264         -     the terms of this License to the maximum extent possible; and (b)
   265         -     describe the limitations and the code they affect. Such description
   266         -     must be included in the LEGAL file described in Section 3.4 and must
   267         -     be included with all distributions of the Source Code. Except to the
   268         -     extent prohibited by statute or regulation, such description must be
   269         -     sufficiently detailed for a recipient of ordinary skill to be able to
   270         -     understand it.
   271         -
   272         -5. Application of this License.
   273         -
   274         -     This License applies to code to which the Initial Developer has
   275         -     attached the notice in Exhibit A and to related Covered Code.
   276         -
   277         -6. Versions of the License.
   278         -
   279         -     6.1. New Versions.
   280         -     Netscape Communications Corporation ("Netscape") may publish revised
   281         -     and/or new versions of the License from time to time. Each version
   282         -     will be given a distinguishing version number.
   283         -
   284         -     6.2. Effect of New Versions.
   285         -     Once Covered Code has been published under a particular version of the
   286         -     License, You may always continue to use it under the terms of that
   287         -     version. You may also choose to use such Covered Code under the terms
   288         -     of any subsequent version of the License published by Netscape. No one
   289         -     other than Netscape has the right to modify the terms applicable to
   290         -     Covered Code created under this License.
   291         -
   292         -     6.3. Derivative Works.
   293         -     If You create or use a modified version of this License (which you may
   294         -     only do in order to apply it to code which is not already Covered Code
   295         -     governed by this License), You must (a) rename Your license so that
   296         -     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
   297         -     "MPL", "NPL" or any confusingly similar phrase do not appear in your
   298         -     license (except to note that your license differs from this License)
   299         -     and (b) otherwise make it clear that Your version of the license
   300         -     contains terms which differ from the Mozilla Public License and
   301         -     Netscape Public License. (Filling in the name of the Initial
   302         -     Developer, Original Code or Contributor in the notice described in
   303         -     Exhibit A shall not of themselves be deemed to be modifications of
   304         -     this License.)
   305         -
   306         -7. DISCLAIMER OF WARRANTY.
   307         -
   308         -     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
   309         -     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
   310         -     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
   311         -     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
   312         -     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
   313         -     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
   314         -     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
   315         -     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
   316         -     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
   317         -     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
   318         -
   319         -8. TERMINATION.
   320         -
   321         -     8.1.  This License and the rights granted hereunder will terminate
   322         -     automatically if You fail to comply with terms herein and fail to cure
   323         -     such breach within 30 days of becoming aware of the breach. All
   324         -     sublicenses to the Covered Code which are properly granted shall
   325         -     survive any termination of this License. Provisions which, by their
   326         -     nature, must remain in effect beyond the termination of this License
   327         -     shall survive.
   328         -
   329         -     8.2.  If You initiate litigation by asserting a patent infringement
   330         -     claim (excluding declatory judgment actions) against Initial Developer
   331         -     or a Contributor (the Initial Developer or Contributor against whom
   332         -     You file such action is referred to as "Participant")  alleging that:
   333         -
   334         -     (a)  such Participant's Contributor Version directly or indirectly
   335         -     infringes any patent, then any and all rights granted by such
   336         -     Participant to You under Sections 2.1 and/or 2.2 of this License
   337         -     shall, upon 60 days notice from Participant terminate prospectively,
   338         -     unless if within 60 days after receipt of notice You either: (i)
   339         -     agree in writing to pay Participant a mutually agreeable reasonable
   340         -     royalty for Your past and future use of Modifications made by such
   341         -     Participant, or (ii) withdraw Your litigation claim with respect to
   342         -     the Contributor Version against such Participant.  If within 60 days
   343         -     of notice, a reasonable royalty and payment arrangement are not
   344         -     mutually agreed upon in writing by the parties or the litigation claim
   345         -     is not withdrawn, the rights granted by Participant to You under
   346         -     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
   347         -     the 60 day notice period specified above.
   348         -
   349         -     (b)  any software, hardware, or device, other than such Participant's
   350         -     Contributor Version, directly or indirectly infringes any patent, then
   351         -     any rights granted to You by such Participant under Sections 2.1(b)
   352         -     and 2.2(b) are revoked effective as of the date You first made, used,
   353         -     sold, distributed, or had made, Modifications made by that
   354         -     Participant.
   355         -
   356         -     8.3.  If You assert a patent infringement claim against Participant
   357         -     alleging that such Participant's Contributor Version directly or
   358         -     indirectly infringes any patent where such claim is resolved (such as
   359         -     by license or settlement) prior to the initiation of patent
   360         -     infringement litigation, then the reasonable value of the licenses
   361         -     granted by such Participant under Sections 2.1 or 2.2 shall be taken
   362         -     into account in determining the amount or value of any payment or
   363         -     license.
   364         -
   365         -     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
   366         -     all end user license agreements (excluding distributors and resellers)
   367         -     which have been validly granted by You or any distributor hereunder
   368         -     prior to termination shall survive termination.
   369         -
   370         -9. LIMITATION OF LIABILITY.
   371         -
   372         -     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
   373         -     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
   374         -     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
   375         -     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
   376         -     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
   377         -     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
   378         -     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
   379         -     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
   380         -     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
   381         -     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
   382         -     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
   383         -     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
   384         -     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
   385         -     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
   386         -
   387         -10. U.S. GOVERNMENT END USERS.
   388         -
   389         -     The Covered Code is a "commercial item," as that term is defined in
   390         -     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
   391         -     software" and "commercial computer software documentation," as such
   392         -     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
   393         -     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
   394         -     all U.S. Government End Users acquire Covered Code with only those
   395         -     rights set forth herein.
   396         -
   397         -11. MISCELLANEOUS.
   398         -
   399         -     This License represents the complete agreement concerning subject
   400         -     matter hereof. If any provision of this License is held to be
   401         -     unenforceable, such provision shall be reformed only to the extent
   402         -     necessary to make it enforceable. This License shall be governed by
   403         -     California law provisions (except to the extent applicable law, if
   404         -     any, provides otherwise), excluding its conflict-of-law provisions.
   405         -     With respect to disputes in which at least one party is a citizen of,
   406         -     or an entity chartered or registered to do business in the United
   407         -     States of America, any litigation relating to this License shall be
   408         -     subject to the jurisdiction of the Federal Courts of the Northern
   409         -     District of California, with venue lying in Santa Clara County,
   410         -     California, with the losing party responsible for costs, including
   411         -     without limitation, court costs and reasonable attorneys' fees and
   412         -     expenses. The application of the United Nations Convention on
   413         -     Contracts for the International Sale of Goods is expressly excluded.
   414         -     Any law or regulation which provides that the language of a contract
   415         -     shall be construed against the drafter shall not apply to this
   416         -     License.
   417         -
   418         -12. RESPONSIBILITY FOR CLAIMS.
   419         -
   420         -     As between Initial Developer and the Contributors, each party is
   421         -     responsible for claims and damages arising, directly or indirectly,
   422         -     out of its utilization of rights under this License and You agree to
   423         -     work with Initial Developer and Contributors to distribute such
   424         -     responsibility on an equitable basis. Nothing herein is intended or
   425         -     shall be deemed to constitute any admission of liability.
   426         -
   427         -13. MULTIPLE-LICENSED CODE.
   428         -
   429         -     Initial Developer may designate portions of the Covered Code as
   430         -     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
   431         -     Developer permits you to utilize portions of the Covered Code under
   432         -     Your choice of the NPL or the alternative licenses, if any, specified
   433         -     by the Initial Developer in the file described in Exhibit A.
   434         -
   435         -EXHIBIT A -Mozilla Public License.
   436         -
   437         -     ``The contents of this file are subject to the Mozilla Public License
   438         -     Version 1.1 (the "License"); you may not use this file except in
   439         -     compliance with the License. You may obtain a copy of the License at
   440         -     http://www.mozilla.org/MPL/
   441         -
   442         -     Software distributed under the License is distributed on an "AS IS"
   443         -     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
   444         -     License for the specific language governing rights and limitations
   445         -     under the License.
   446         -
   447         -     The Original Code is the SpatiaLite library.
   448         -
   449         -     The Initial Developer of the Original Code is Alessandro Furieri.
   450         -     Portions created by the Initial Developer are Copyright (C) 2008
   451         -     the Initial Developer. All Rights Reserved.
   452         -
   453         -     Contributor(s): 
   454         -     Klaus Foerster <klaus.foerster@svg.cc> [AsSvg()]
   455         -     Luigi Costalli <luigi.costalli@gmail.com> [Dijkstra's shortest path algorithm]
   456         -
   457         -     The Vanuatu Team - University of Toronto [WKT parser]
   458         -     Supervisor: Greg Wilson <gvwilson@cs.toronto.ca>
   459         -     [you can find the complete team composition in gg_wkt.c]
   460         -
   461         -
   462         -     Alternatively, the contents of this file may be used under the terms of
   463         -     either the GNU General Public License Version 2 or later (the "GPL"), or
   464         -     the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   465         -     in which case the provisions of the GPL or the LGPL are applicable instead
   466         -     of those above. If you wish to allow use of your version of this file only
   467         -     under the terms of either the GPL or the LGPL, and not to allow others to
   468         -     use your version of this file under the terms of the MPL, indicate your
   469         -     decision by deleting the provisions above and replace them with the notice
   470         -     and other provisions required by the GPL or the LGPL. If you do not delete
   471         -     the provisions above, a recipient may use your version of this file under
   472         -     the terms of any one of the MPL, the GPL or the LGPL.
   473         -
   474         -     [NOTE: The text of this Exhibit A may differ slightly from the text of
   475         -     the notices in the Source Code files of the Original Code. You should
   476         -     use the text of this Exhibit A rather than the text found in the
   477         -     Original Code Source Code for Your Modifications.]
   478         -
          669  +  The GNU General Public License does not permit incorporating your program
          670  +into proprietary programs.  If your program is a subroutine library, you
          671  +may consider it more useful to permit linking proprietary applications with
          672  +the library.  If this is what you want to do, use the GNU Lesser General
          673  +Public License instead of this License.  But first, please read
          674  +<http://www.gnu.org/philosophy/why-not-lgpl.html>.

Deleted ChangeLog.

     1         -See the fossil archive at https://www.gaia-gis.it/fossil/librasterlite/timeline

Changes to Makefile-static-Linux.

    61     61   	/usr/local/lib/libgeos.a -lstdc++ -lm -lpthread -ldl
    62     62   	strip --strip-all ./static_bin/rasterlite_tool
    63     63   
    64     64   ./static_bin/rasterlite_grid: ./src/rasterlite_grid.o
    65     65   	$(CC) ./src/rasterlite_grid.o -o ./static_bin/rasterlite_grid \
    66     66   	/usr/local/lib/libgeotiff.a \
    67     67   	/usr/lib/libtiff.a \
    68         -	/usr/local/lib/libproj.a \
           68  +	/usr/lib/libproj.a \
    69     69   	/usr/lib/libjpeg.a \
    70     70   	/usr/lib/libz.a -lm
    71     71   	strip --strip-all ./static_bin/rasterlite_grid

Changes to Makefile-static-MinGW.

     1      1   # SandroFurieri (c) 2009
     2      2   # Makefile RasterLite statically linked tools [Win MSYS/MinGW]
     3      3   
     4         -CFLAGS = -Wall -Wextra -Wunused -pedantic -I/usr/local/include
     5         -GG = g++
     6         -CC = gcc
     7         -
     8      4   all: ./static_bin/rasterlite_load.exe ./static_bin/rasterlite_pyramid.exe \
     9      5   	./static_bin/rasterlite_topmost.exe ./static_bin/rasterlite_tool.exe \
    10      6   	./static_bin/rasterlite_grid.exe
    11      7   
    12      8   ./static_bin/rasterlite_load.exe: ./src/rasterlite_load.o
    13         -	$(GG) ./src/rasterlite_load.o -o ./static_bin/rasterlite_load.exe \
            9  +	$(CC) ./src/rasterlite_load.o -o ./static_bin/rasterlite_load.exe \
           10  +	./lib/.libs/librasterlite.a \
           11  +	/usr/local/lib/libgeotiff.a \
           12  +	/usr/local/lib/libtiff.a \
           13  +	/usr/local/lib/libjpeg.a \
           14  +	/usr/local/lib/libpng.a \
           15  +	/usr/local/lib/libz.a \
           16  +	/usr/local/lib/libspatialite.a \
           17  +	/usr/local/lib/libproj.a \
           18  +	/usr/local/lib/libgeos_c.a \
           19  +	/usr/local/lib/libiconv.a \
           20  +	/usr/local/lib/libgeos.a -lstdc++ -lm
           21  +	strip --strip-all ./static_bin/rasterlite_load.exe
           22  +
           23  +./static_bin/rasterlite_pyramid.exe: ./src/rasterlite_pyramid.o
           24  +	$(CC) ./src/rasterlite_pyramid.o -o ./static_bin/rasterlite_pyramid.exe \
    14     25   	./lib/.libs/librasterlite.a \
    15     26   	/usr/local/lib/libgeotiff.a \
    16     27   	/usr/local/lib/libtiff.a \
    17     28   	/usr/local/lib/libjpeg.a \
    18     29   	/usr/local/lib/libpng.a \
    19     30   	/usr/local/lib/libz.a \
    20     31   	/usr/local/lib/libspatialite.a \
    21         -	/usr/local/lib/libsqlite3.a \
    22         -	/usr/local/lib/liblwgeom.a \
    23         -	/usr/local/lib/libxml2.a \
    24     32   	/usr/local/lib/libproj.a \
    25     33   	/usr/local/lib/libgeos_c.a \
    26         -	/usr/local/lib/libfreexl.a \
    27         -	/usr/local/lib/libz.a \
    28     34   	/usr/local/lib/libiconv.a \
    29         -	/usr/local/lib/libgeos.a \
    30         -	-lm -lmsimg32 -lws2_32 -static-libstdc++ -static-libgcc
    31         -	strip --strip-all ./static_bin/rasterlite_load.exe
           35  +	/usr/local/lib/libgeos.a -lstdc++ -lm
           36  +	strip --strip-all ./static_bin/rasterlite_pyramid.exe
    32     37   
    33         -./static_bin/rasterlite_pyramid.exe: ./src/rasterlite_pyramid.o
    34         -	$(GG) ./src/rasterlite_pyramid.o -o ./static_bin/rasterlite_pyramid.exe \
           38  +./static_bin/rasterlite_topmost.exe: ./src/rasterlite_topmost.o
           39  +	$(CC) ./src/rasterlite_topmost.o -o ./static_bin/rasterlite_topmost.exe \
    35     40   	./lib/.libs/librasterlite.a \
    36     41   	/usr/local/lib/libgeotiff.a \
    37     42   	/usr/local/lib/libtiff.a \
    38     43   	/usr/local/lib/libjpeg.a \
    39     44   	/usr/local/lib/libpng.a \
    40     45   	/usr/local/lib/libz.a \
    41     46   	/usr/local/lib/libspatialite.a \
    42         -	/usr/local/lib/libsqlite3.a \
    43         -	/usr/local/lib/liblwgeom.a \
    44         -	/usr/local/lib/libxml2.a \
    45     47   	/usr/local/lib/libproj.a \
    46     48   	/usr/local/lib/libgeos_c.a \
    47         -	/usr/local/lib/libfreexl.a \
    48         -	/usr/local/lib/libz.a \
    49     49   	/usr/local/lib/libiconv.a \
    50         -	/usr/local/lib/libgeos.a \
    51         -	-lm -lmsimg32 -lws2_32 -static-libstdc++ -static-libgcc
    52         -	strip --strip-all ./static_bin/rasterlite_pyramid.exe
           50  +	/usr/local/lib/libgeos.a -lstdc++ -lm
           51  +	strip --strip-all ./static_bin/rasterlite_topmost.exe
    53     52   
    54         -./static_bin/rasterlite_topmost.exe: ./src/rasterlite_topmost.o
    55         -	$(GG) ./src/rasterlite_topmost.o -o ./static_bin/rasterlite_topmost.exe \
           53  +./static_bin/rasterlite_tool.exe: ./src/rasterlite_tool.o
           54  +	$(CC) ./src/rasterlite_tool.o -o ./static_bin/rasterlite_tool.exe \
    56     55   	./lib/.libs/librasterlite.a \
    57     56   	/usr/local/lib/libgeotiff.a \
    58     57   	/usr/local/lib/libtiff.a \
    59     58   	/usr/local/lib/libjpeg.a \
    60     59   	/usr/local/lib/libpng.a \
    61     60   	/usr/local/lib/libz.a \
    62     61   	/usr/local/lib/libspatialite.a \
    63         -	/usr/local/lib/libsqlite3.a \
    64         -	/usr/local/lib/liblwgeom.a \
    65         -	/usr/local/lib/libxml2.a \
    66     62   	/usr/local/lib/libproj.a \
    67     63   	/usr/local/lib/libgeos_c.a \
    68         -	/usr/local/lib/libfreexl.a \
    69         -	/usr/local/lib/libz.a \
    70     64   	/usr/local/lib/libiconv.a \
    71         -	/usr/local/lib/libgeos.a \
    72         -	-lm -lmsimg32 -lws2_32 -static-libstdc++ -static-libgcc
    73         -	strip --strip-all ./static_bin/rasterlite_topmost.exe
    74         -
    75         -./static_bin/rasterlite_tool.exe: ./src/rasterlite_tool.o
    76         -	$(GG) ./src/rasterlite_tool.o -o ./static_bin/rasterlite_tool.exe \
    77         -	./lib/.libs/librasterlite.a \
    78         -	/usr/local/lib/libgeotiff.a \
    79         -	/usr/local/lib/libtiff.a \
    80         -	/usr/local/lib/libjpeg.a \
    81         -	/usr/local/lib/libpng.a \
    82         -	/usr/local/lib/libz.a \
    83         -	/usr/local/lib/libspatialite.a \
    84         -	/usr/local/lib/libsqlite3.a \
    85         -	/usr/local/lib/liblwgeom.a \
    86         -	/usr/local/lib/libxml2.a \
    87         -	/usr/local/lib/libproj.a \
    88         -	/usr/local/lib/libgeos_c.a \
    89         -	/usr/local/lib/libfreexl.a \
    90         -	/usr/local/lib/libz.a \
    91         -	/usr/local/lib/libiconv.a \
    92         -	/usr/local/lib/libgeos.a \
    93         -	-lm -lmsimg32 -lws2_32 -static-libstdc++ -static-libgcc
           65  +	/usr/local/lib/libgeos.a -lstdc++ -lm
    94     66   	strip --strip-all ./static_bin/rasterlite_tool.exe
    95     67   
    96     68   ./static_bin/rasterlite_grid.exe: ./src/rasterlite_grid.o
    97     69   	$(CC) ./src/rasterlite_grid.o -o ./static_bin/rasterlite_grid.exe \
    98     70   	/usr/local/lib/libgeotiff.a \
    99     71   	/usr/local/lib/libtiff.a \
   100     72   	/usr/local/lib/libproj.a \
   101     73   	/usr/local/lib/libjpeg.a \
   102     74   	/usr/local/lib/libz.a 
   103     75   	strip --strip-all ./static_bin/rasterlite_grid.exe
   104         -
   105         -rasterlite_load.o:
   106         -	$(CC) $(CFLAGS) rasterlite_load.c -c
   107         -
   108         -rasterlite_pyramid.o:
   109         -	$(CC) $(CFLAGS) rasterlite_pyramid.c -c
   110         -
   111         -rasterlite_topmost.o:
   112         -	$(CC) $(CFLAGS) rasterlite_topmost.c -c
   113         -
   114         -rasterlite_tool.o:
   115         -	$(CC) $(CFLAGS) rasterlite_tool.c -c

Changes to Makefile.am.

     1         -ACLOCAL_AMFLAGS = -I m4
     2         -
     3         -SUBDIRS = headers lib src test
            1  +SUBDIRS = headers epsilon lib src 
     4      2   
     5      3   AUTOMAKE_OPTIONS = dist-zip
     6      4   
     7      5   EXTRA_DIST = Makefile-static-MinGW Makefile-static-Linux \
     8         -	Makefile-static-MacOsX makefile.vc nmake.opt 
            6  +	Makefile-static-MacOsX makefile.vc nmake.opt \
            7  +	librasterlite.def
     9      8   
    10      9   pkgconfigdir = $(libdir)/pkgconfig
    11     10   pkgconfig_DATA = rasterlite.pc
    12     11   
    13         -coverage-init:
    14         -	lcov --directory lib --capture --initial --output-file librasterlite_cov.info
    15         -
    16         -coverage::
    17         -	lcov --directory lib --output-file librasterlite_cov.info --capture
    18         -	genhtml -o covresults librasterlite_cov.info
    19         -
    20         -MOSTLYCLEANFILES = librasterlite_cov.info

Changes to Makefile.in.

     1         -# Makefile.in generated by automake 1.11.6 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
     6         -# Foundation, Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19         -am__make_dryrun = \
    20         -  { \
    21         -    am__dry=no; \
    22         -    case $$MAKEFLAGS in \
    23         -      *\\[\ \	]*) \
    24         -        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
    25         -          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
    26         -      *) \
    27         -        for am__flg in $$MAKEFLAGS; do \
    28         -          case $$am__flg in \
    29         -            *=*|--*) ;; \
    30         -            *n*) am__dry=yes; break;; \
    31         -          esac; \
    32         -        done;; \
    33         -    esac; \
    34         -    test $$am__dry = yes; \
    35         -  }
    36     18   pkgdatadir = $(datadir)/@PACKAGE@
    37         -pkgincludedir = $(includedir)/@PACKAGE@
    38     19   pkglibdir = $(libdir)/@PACKAGE@
    39         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    40     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    41     22   install_sh_DATA = $(install_sh) -c -m 644
    42     23   install_sh_PROGRAM = $(install_sh) -c
    43     24   install_sh_SCRIPT = $(install_sh) -c
    44     25   INSTALL_HEADER = $(INSTALL_DATA)
    45     26   transform = $(program_transform_name)
    46     27   NORMAL_INSTALL = :
................................................................................
    49     30   NORMAL_UNINSTALL = :
    50     31   PRE_UNINSTALL = :
    51     32   POST_UNINSTALL = :
    52     33   build_triplet = @build@
    53     34   host_triplet = @host@
    54     35   subdir = .
    55     36   DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
    56         -	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
    57         -	$(srcdir)/rasterlite.pc.in $(top_srcdir)/configure AUTHORS \
    58         -	COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \
    59         -	install-sh ltmain.sh missing
           37  +	$(srcdir)/Makefile.in $(srcdir)/rasterlite.pc.in \
           38  +	$(top_srcdir)/configure AUTHORS COPYING INSTALL config.guess \
           39  +	config.sub depcomp install-sh ltmain.sh missing
    60     40   ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    61         -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
    62         -	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
    63         -	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
    64         -	$(top_srcdir)/configure.ac
           41  +am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    65     42   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    66     43   	$(ACLOCAL_M4)
    67     44   am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
    68     45    configure.lineno config.status.lineno
    69     46   mkinstalldirs = $(install_sh) -d
    70         -CONFIG_HEADER = config.h
    71     47   CONFIG_CLEAN_FILES = rasterlite.pc
    72         -CONFIG_CLEAN_VPATH_FILES =
    73     48   SOURCES =
    74     49   DIST_SOURCES =
    75     50   RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
    76     51   	html-recursive info-recursive install-data-recursive \
    77     52   	install-dvi-recursive install-exec-recursive \
    78     53   	install-html-recursive install-info-recursive \
    79     54   	install-pdf-recursive install-ps-recursive install-recursive \
    80     55   	installcheck-recursive installdirs-recursive pdf-recursive \
    81     56   	ps-recursive uninstall-recursive
    82         -am__can_run_installinfo = \
    83         -  case $$AM_UPDATE_INFO_DIR in \
    84         -    n|no|NO) false;; \
    85         -    *) (install-info --version) >/dev/null 2>&1;; \
    86         -  esac
    87     57   am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    88     58   am__vpath_adj = case $$p in \
    89     59       $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    90     60       *) f=$$p;; \
    91     61     esac;
    92         -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
    93         -am__install_max = 40
    94         -am__nobase_strip_setup = \
    95         -  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
    96         -am__nobase_strip = \
    97         -  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
    98         -am__nobase_list = $(am__nobase_strip_setup); \
    99         -  for p in $$list; do echo "$$p $$p"; done | \
   100         -  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
   101         -  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
   102         -    if (++n[$$2] == $(am__install_max)) \
   103         -      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
   104         -    END { for (dir in files) print dir, files[dir] }'
   105         -am__base_list = \
   106         -  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   107         -  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
   108         -am__uninstall_files_from_dir = { \
   109         -  test -z "$$files" \
   110         -    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
   111         -    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
   112         -         $(am__cd) "$$dir" && rm -f $$files; }; \
   113         -  }
           62  +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
   114     63   am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
           64  +pkgconfigDATA_INSTALL = $(INSTALL_DATA)
   115     65   DATA = $(pkgconfig_DATA)
   116     66   RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   117     67     distclean-recursive maintainer-clean-recursive
   118         -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
   119         -	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
   120         -	distdir dist dist-all distcheck
   121     68   ETAGS = etags
   122     69   CTAGS = ctags
   123     70   DIST_SUBDIRS = $(SUBDIRS)
   124     71   DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   125     72   distdir = $(PACKAGE)-$(VERSION)
   126     73   top_distdir = $(distdir)
   127     74   am__remove_distdir = \
   128         -  if test -d "$(distdir)"; then \
   129         -    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
   130         -      && rm -rf "$(distdir)" \
   131         -      || { sleep 5 && rm -rf "$(distdir)"; }; \
   132         -  else :; fi
   133         -am__relativize = \
   134         -  dir0=`pwd`; \
   135         -  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
   136         -  sed_rest='s,^[^/]*/*,,'; \
   137         -  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
   138         -  sed_butlast='s,/*[^/]*$$,,'; \
   139         -  while test -n "$$dir1"; do \
   140         -    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
   141         -    if test "$$first" != "."; then \
   142         -      if test "$$first" = ".."; then \
   143         -        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
   144         -        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
   145         -      else \
   146         -        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
   147         -        if test "$$first2" = "$$first"; then \
   148         -          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
   149         -        else \
   150         -          dir2="../$$dir2"; \
   151         -        fi; \
   152         -        dir0="$$dir0"/"$$first"; \
   153         -      fi; \
   154         -    fi; \
   155         -    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
   156         -  done; \
   157         -  reldir="$$dir2"
           75  +  { test ! -d $(distdir) \
           76  +    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
           77  +         && rm -fr $(distdir); }; }
   158     78   DIST_ARCHIVES = $(distdir).tar.gz $(distdir).zip
   159     79   GZIP_ENV = --best
   160     80   distuninstallcheck_listfiles = find . -type f -print
   161         -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   162         -  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
   163     81   distcleancheck_listfiles = find . -type f -print
   164     82   ACLOCAL = @ACLOCAL@
   165     83   AMTAR = @AMTAR@
   166     84   AR = @AR@
   167     85   AS = @AS@
   168     86   AUTOCONF = @AUTOCONF@
   169     87   AUTOHEADER = @AUTOHEADER@
................................................................................
   179     97   CXXDEPMODE = @CXXDEPMODE@
   180     98   CXXFLAGS = @CXXFLAGS@
   181     99   CYGPATH_W = @CYGPATH_W@
   182    100   DEFS = @DEFS@
   183    101   DEPDIR = @DEPDIR@
   184    102   DLLTOOL = @DLLTOOL@
   185    103   DSYMUTIL = @DSYMUTIL@
   186         -DUMPBIN = @DUMPBIN@
          104  +ECHO = @ECHO@
   187    105   ECHO_C = @ECHO_C@
   188    106   ECHO_N = @ECHO_N@
   189    107   ECHO_T = @ECHO_T@
   190    108   EGREP = @EGREP@
   191    109   EXEEXT = @EXEEXT@
   192         -FGREP = @FGREP@
          110  +F77 = @F77@
          111  +FFLAGS = @FFLAGS@
   193    112   GREP = @GREP@
   194    113   INSTALL = @INSTALL@
   195    114   INSTALL_DATA = @INSTALL_DATA@
   196    115   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   197    116   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   198    117   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   199         -LD = @LD@
   200    118   LDFLAGS = @LDFLAGS@
   201    119   LIBOBJS = @LIBOBJS@
   202         -LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
   203         -LIBPNG_LIBS = @LIBPNG_LIBS@
   204    120   LIBS = @LIBS@
   205         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   206         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   207    121   LIBTOOL = @LIBTOOL@
   208         -LIPO = @LIPO@
   209    122   LN_S = @LN_S@
   210    123   LTLIBOBJS = @LTLIBOBJS@
   211    124   MAINT = @MAINT@
   212    125   MAKEINFO = @MAKEINFO@
   213         -MANIFEST_TOOL = @MANIFEST_TOOL@
   214    126   MKDIR_P = @MKDIR_P@
   215         -NM = @NM@
   216    127   NMEDIT = @NMEDIT@
   217    128   OBJDUMP = @OBJDUMP@
   218    129   OBJEXT = @OBJEXT@
   219         -OTOOL = @OTOOL@
   220         -OTOOL64 = @OTOOL64@
   221    130   PACKAGE = @PACKAGE@
   222    131   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   223    132   PACKAGE_NAME = @PACKAGE_NAME@
   224    133   PACKAGE_STRING = @PACKAGE_STRING@
   225    134   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   226         -PACKAGE_URL = @PACKAGE_URL@
   227    135   PACKAGE_VERSION = @PACKAGE_VERSION@
   228    136   PATH_SEPARATOR = @PATH_SEPARATOR@
   229         -PKG_CONFIG = @PKG_CONFIG@
   230         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   231         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   232    137   RANLIB = @RANLIB@
   233    138   SED = @SED@
   234    139   SET_MAKE = @SET_MAKE@
   235    140   SHELL = @SHELL@
   236    141   STRIP = @STRIP@
   237    142   VERSION = @VERSION@
   238    143   abs_builddir = @abs_builddir@
   239    144   abs_srcdir = @abs_srcdir@
   240    145   abs_top_builddir = @abs_top_builddir@
   241    146   abs_top_srcdir = @abs_top_srcdir@
   242         -ac_ct_AR = @ac_ct_AR@
   243    147   ac_ct_CC = @ac_ct_CC@
   244    148   ac_ct_CXX = @ac_ct_CXX@
   245         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          149  +ac_ct_F77 = @ac_ct_F77@
   246    150   am__include = @am__include@
   247    151   am__leading_dot = @am__leading_dot@
   248    152   am__quote = @am__quote@
   249    153   am__tar = @am__tar@
   250    154   am__untar = @am__untar@
   251    155   bindir = @bindir@
   252    156   build = @build@
................................................................................
   281    185   program_transform_name = @program_transform_name@
   282    186   psdir = @psdir@
   283    187   sbindir = @sbindir@
   284    188   sharedstatedir = @sharedstatedir@
   285    189   srcdir = @srcdir@
   286    190   sysconfdir = @sysconfdir@
   287    191   target_alias = @target_alias@
   288         -top_build_prefix = @top_build_prefix@
   289    192   top_builddir = @top_builddir@
   290    193   top_srcdir = @top_srcdir@
   291         -ACLOCAL_AMFLAGS = -I m4
   292         -SUBDIRS = headers lib src test
          194  +SUBDIRS = headers epsilon lib src 
   293    195   AUTOMAKE_OPTIONS = dist-zip
   294    196   EXTRA_DIST = Makefile-static-MinGW Makefile-static-Linux \
   295         -	Makefile-static-MacOsX makefile.vc nmake.opt 
          197  +	Makefile-static-MacOsX makefile.vc nmake.opt \
          198  +	librasterlite.def
   296    199   
   297    200   pkgconfigdir = $(libdir)/pkgconfig
   298    201   pkgconfig_DATA = rasterlite.pc
   299         -MOSTLYCLEANFILES = librasterlite_cov.info
   300         -all: config.h
   301         -	$(MAKE) $(AM_MAKEFLAGS) all-recursive
          202  +all: all-recursive
   302    203   
   303    204   .SUFFIXES:
   304         -am--refresh: Makefile
          205  +am--refresh:
   305    206   	@:
   306    207   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   307    208   	@for dep in $?; do \
   308    209   	  case '$(am__configure_deps)' in \
   309    210   	    *$$dep*) \
   310         -	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
   311         -	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
          211  +	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
          212  +	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
   312    213   		&& exit 0; \
   313    214   	      exit 1;; \
   314    215   	  esac; \
   315    216   	done; \
   316         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
   317         -	$(am__cd) $(top_srcdir) && \
   318         -	  $(AUTOMAKE) --gnu Makefile
          217  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
          218  +	cd $(top_srcdir) && \
          219  +	  $(AUTOMAKE) --foreign  Makefile
   319    220   .PRECIOUS: Makefile
   320    221   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   321    222   	@case '$?' in \
   322    223   	  *config.status*) \
   323    224   	    echo ' $(SHELL) ./config.status'; \
   324    225   	    $(SHELL) ./config.status;; \
   325    226   	  *) \
................................................................................
   327    228   	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
   328    229   	esac;
   329    230   
   330    231   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   331    232   	$(SHELL) ./config.status --recheck
   332    233   
   333    234   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   334         -	$(am__cd) $(srcdir) && $(AUTOCONF)
          235  +	cd $(srcdir) && $(AUTOCONF)
   335    236   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   336         -	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
   337         -$(am__aclocal_m4_deps):
   338         -
   339         -config.h: stamp-h1
   340         -	@if test ! -f $@; then rm -f stamp-h1; else :; fi
   341         -	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
   342         -
   343         -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
   344         -	@rm -f stamp-h1
   345         -	cd $(top_builddir) && $(SHELL) ./config.status config.h
   346         -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
   347         -	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
   348         -	rm -f stamp-h1
   349         -	touch $@
   350         -
   351         -distclean-hdr:
   352         -	-rm -f config.h stamp-h1
          237  +	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
   353    238   rasterlite.pc: $(top_builddir)/config.status $(srcdir)/rasterlite.pc.in
   354    239   	cd $(top_builddir) && $(SHELL) ./config.status $@
   355    240   
   356    241   mostlyclean-libtool:
   357    242   	-rm -f *.lo
   358    243   
   359    244   clean-libtool:
   360    245   	-rm -rf .libs _libs
   361    246   
   362    247   distclean-libtool:
   363         -	-rm -f libtool config.lt
          248  +	-rm -f libtool
   364    249   install-pkgconfigDATA: $(pkgconfig_DATA)
   365    250   	@$(NORMAL_INSTALL)
   366         -	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
   367         -	if test -n "$$list"; then \
   368         -	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
   369         -	  $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
   370         -	fi; \
   371         -	for p in $$list; do \
          251  +	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
          252  +	@list='$(pkgconfig_DATA)'; for p in $$list; do \
   372    253   	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
   373         -	  echo "$$d$$p"; \
   374         -	done | $(am__base_list) | \
   375         -	while read files; do \
   376         -	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
   377         -	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
          254  +	  f=$(am__strip_dir) \
          255  +	  echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
          256  +	  $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
   378    257   	done
   379    258   
   380    259   uninstall-pkgconfigDATA:
   381    260   	@$(NORMAL_UNINSTALL)
   382         -	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
   383         -	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
   384         -	dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
          261  +	@list='$(pkgconfig_DATA)'; for p in $$list; do \
          262  +	  f=$(am__strip_dir) \
          263  +	  echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
          264  +	  rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
          265  +	done
   385    266   
   386    267   # This directory's subdirectories are mostly independent; you can cd
   387    268   # into them and run `make' without going through this Makefile.
   388    269   # To change the values of `make' variables: instead of editing Makefiles,
   389    270   # (1) if the variable is set in `config.status', edit `config.status'
   390    271   #     (which will cause the Makefiles to be regenerated when you run `make');
   391    272   # (2) otherwise, pass the desired values on the `make' command line.
   392    273   $(RECURSIVE_TARGETS):
   393         -	@fail= failcom='exit 1'; \
          274  +	@failcom='exit 1'; \
   394    275   	for f in x $$MAKEFLAGS; do \
   395    276   	  case $$f in \
   396    277   	    *=* | --[!k]*);; \
   397    278   	    *k*) failcom='fail=yes';; \
   398    279   	  esac; \
   399    280   	done; \
   400    281   	dot_seen=no; \
................................................................................
   403    284   	  echo "Making $$target in $$subdir"; \
   404    285   	  if test "$$subdir" = "."; then \
   405    286   	    dot_seen=yes; \
   406    287   	    local_target="$$target-am"; \
   407    288   	  else \
   408    289   	    local_target="$$target"; \
   409    290   	  fi; \
   410         -	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
          291  +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
   411    292   	  || eval $$failcom; \
   412    293   	done; \
   413    294   	if test "$$dot_seen" = "no"; then \
   414    295   	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
   415    296   	fi; test -z "$$fail"
   416    297   
   417    298   $(RECURSIVE_CLEAN_TARGETS):
   418         -	@fail= failcom='exit 1'; \
          299  +	@failcom='exit 1'; \
   419    300   	for f in x $$MAKEFLAGS; do \
   420    301   	  case $$f in \
   421    302   	    *=* | --[!k]*);; \
   422    303   	    *k*) failcom='fail=yes';; \
   423    304   	  esac; \
   424    305   	done; \
   425    306   	dot_seen=no; \
................................................................................
   437    318   	for subdir in $$rev; do \
   438    319   	  echo "Making $$target in $$subdir"; \
   439    320   	  if test "$$subdir" = "."; then \
   440    321   	    local_target="$$target-am"; \
   441    322   	  else \
   442    323   	    local_target="$$target"; \
   443    324   	  fi; \
   444         -	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
          325  +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
   445    326   	  || eval $$failcom; \
   446    327   	done && test -z "$$fail"
   447    328   tags-recursive:
   448    329   	list='$(SUBDIRS)'; for subdir in $$list; do \
   449         -	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
          330  +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
   450    331   	done
   451    332   ctags-recursive:
   452    333   	list='$(SUBDIRS)'; for subdir in $$list; do \
   453         -	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
          334  +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
   454    335   	done
   455    336   
   456    337   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   457    338   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   458    339   	unique=`for i in $$list; do \
   459    340   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   460    341   	  done | \
   461         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          342  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   462    343   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   463    344   	mkid -fID $$unique
   464    345   tags: TAGS
   465    346   
   466         -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
          347  +TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   467    348   		$(TAGS_FILES) $(LISP)
   468         -	set x; \
          349  +	tags=; \
   469    350   	here=`pwd`; \
   470    351   	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
   471    352   	  include_option=--etags-include; \
   472    353   	  empty_fix=.; \
   473    354   	else \
   474    355   	  include_option=--include; \
   475    356   	  empty_fix=; \
   476    357   	fi; \
   477    358   	list='$(SUBDIRS)'; for subdir in $$list; do \
   478    359   	  if test "$$subdir" = .; then :; else \
   479    360   	    test ! -f $$subdir/TAGS || \
   480         -	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          361  +	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
   481    362   	  fi; \
   482    363   	done; \
   483         -	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
          364  +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   484    365   	unique=`for i in $$list; do \
   485    366   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   486    367   	  done | \
   487    368   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   488    369   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   489         -	shift; \
   490         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          370  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   491    371   	  test -n "$$unique" || unique=$$empty_fix; \
   492         -	  if test $$# -gt 0; then \
   493         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   494         -	      "$$@" $$unique; \
   495         -	  else \
   496         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   497         -	      $$unique; \
   498         -	  fi; \
          372  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          373  +	    $$tags $$unique; \
   499    374   	fi
   500    375   ctags: CTAGS
   501         -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
          376  +CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   502    377   		$(TAGS_FILES) $(LISP)
   503         -	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
          378  +	tags=; \
          379  +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   504    380   	unique=`for i in $$list; do \
   505    381   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   506    382   	  done | \
   507    383   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   508    384   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   509         -	test -z "$(CTAGS_ARGS)$$unique" \
          385  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   510    386   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   511         -	     $$unique
          387  +	     $$tags $$unique
   512    388   
   513    389   GTAGS:
   514    390   	here=`$(am__cd) $(top_builddir) && pwd` \
   515         -	  && $(am__cd) $(top_srcdir) \
   516         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          391  +	  && cd $(top_srcdir) \
          392  +	  && gtags -i $(GTAGS_ARGS) $$here
   517    393   
   518    394   distclean-tags:
   519    395   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   520    396   
   521    397   distdir: $(DISTFILES)
   522    398   	$(am__remove_distdir)
   523         -	test -d "$(distdir)" || mkdir "$(distdir)"
          399  +	test -d $(distdir) || mkdir $(distdir)
   524    400   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   525    401   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   526    402   	list='$(DISTFILES)'; \
   527    403   	  dist_files=`for file in $$list; do echo $$file; done | \
   528    404   	  sed -e "s|^$$srcdirstrip/||;t" \
   529    405   	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
   530    406   	case $$dist_files in \
................................................................................
   532    408   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   533    409   			   sort -u` ;; \
   534    410   	esac; \
   535    411   	for file in $$dist_files; do \
   536    412   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   537    413   	  if test -d $$d/$$file; then \
   538    414   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   539         -	    if test -d "$(distdir)/$$file"; then \
   540         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          415  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          416  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   541    417   	    fi; \
   542         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   543         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   544         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   545         -	    fi; \
   546         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          418  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   547    419   	  else \
   548         -	    test -f "$(distdir)/$$file" \
   549         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          420  +	    test -f $(distdir)/$$file \
          421  +	    || cp -p $$d/$$file $(distdir)/$$file \
   550    422   	    || exit 1; \
   551    423   	  fi; \
   552    424   	done
   553         -	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          425  +	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
   554    426   	  if test "$$subdir" = .; then :; else \
   555         -	    $(am__make_dryrun) \
   556         -	      || test -d "$(distdir)/$$subdir" \
   557         -	      || $(MKDIR_P) "$(distdir)/$$subdir" \
   558         -	      || exit 1; \
   559         -	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
   560         -	    $(am__relativize); \
   561         -	    new_distdir=$$reldir; \
   562         -	    dir1=$$subdir; dir2="$(top_distdir)"; \
   563         -	    $(am__relativize); \
   564         -	    new_top_distdir=$$reldir; \
   565         -	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
   566         -	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
   567         -	    ($(am__cd) $$subdir && \
          427  +	    test -d "$(distdir)/$$subdir" \
          428  +	    || $(MKDIR_P) "$(distdir)/$$subdir" \
          429  +	    || exit 1; \
          430  +	    distdir=`$(am__cd) $(distdir) && pwd`; \
          431  +	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
          432  +	    (cd $$subdir && \
   568    433   	      $(MAKE) $(AM_MAKEFLAGS) \
   569         -	        top_distdir="$$new_top_distdir" \
   570         -	        distdir="$$new_distdir" \
          434  +	        top_distdir="$$top_distdir" \
          435  +	        distdir="$$distdir/$$subdir" \
   571    436   		am__remove_distdir=: \
   572    437   		am__skip_length_check=: \
   573         -		am__skip_mode_fix=: \
   574    438   	        distdir) \
   575    439   	      || exit 1; \
   576    440   	  fi; \
   577    441   	done
   578         -	-test -n "$(am__skip_mode_fix)" \
   579         -	|| find "$(distdir)" -type d ! -perm -755 \
   580         -		-exec chmod u+rwx,go+rx {} \; -o \
          442  +	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
   581    443   	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
   582    444   	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
   583    445   	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
   584         -	|| chmod -R a+r "$(distdir)"
          446  +	|| chmod -R a+r $(distdir)
   585    447   dist-gzip: distdir
   586    448   	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
   587    449   	$(am__remove_distdir)
   588    450   
   589    451   dist-bzip2: distdir
   590         -	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
   591         -	$(am__remove_distdir)
   592         -
   593         -dist-lzip: distdir
   594         -	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
          452  +	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
   595    453   	$(am__remove_distdir)
   596    454   
   597    455   dist-lzma: distdir
   598    456   	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
   599    457   	$(am__remove_distdir)
   600    458   
   601         -dist-xz: distdir
   602         -	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
   603         -	$(am__remove_distdir)
   604         -
   605    459   dist-tarZ: distdir
   606    460   	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
   607    461   	$(am__remove_distdir)
   608    462   
   609    463   dist-shar: distdir
   610    464   	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
   611    465   	$(am__remove_distdir)
................................................................................
   622    476   
   623    477   # This target untars the dist file and tries a VPATH configuration.  Then
   624    478   # it guarantees that the distribution is self-contained by making another
   625    479   # tarfile.
   626    480   distcheck: dist
   627    481   	case '$(DIST_ARCHIVES)' in \
   628    482   	*.tar.gz*) \
   629         -	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
          483  +	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
   630    484   	*.tar.bz2*) \
   631         -	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
          485  +	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
   632    486   	*.tar.lzma*) \
   633         -	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
   634         -	*.tar.lz*) \
   635         -	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
   636         -	*.tar.xz*) \
   637         -	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
          487  +	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
   638    488   	*.tar.Z*) \
   639    489   	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
   640    490   	*.shar.gz*) \
   641         -	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
          491  +	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
   642    492   	*.zip*) \
   643    493   	  unzip $(distdir).zip ;;\
   644    494   	esac
   645         -	chmod -R a-w $(distdir); chmod u+w $(distdir)
          495  +	chmod -R a-w $(distdir); chmod a+w $(distdir)
   646    496   	mkdir $(distdir)/_build
   647    497   	mkdir $(distdir)/_inst
   648    498   	chmod a-w $(distdir)
   649         -	test -d $(distdir)/_build || exit 0; \
   650    499   	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
   651    500   	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
   652         -	  && am__cwd=`pwd` \
   653         -	  && $(am__cd) $(distdir)/_build \
          501  +	  && cd $(distdir)/_build \
   654    502   	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
   655         -	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
   656    503   	    $(DISTCHECK_CONFIGURE_FLAGS) \
   657    504   	  && $(MAKE) $(AM_MAKEFLAGS) \
   658    505   	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
   659    506   	  && $(MAKE) $(AM_MAKEFLAGS) check \
   660    507   	  && $(MAKE) $(AM_MAKEFLAGS) install \
   661    508   	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
   662    509   	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
................................................................................
   669    516   	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
   670    517   	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
   671    518   	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
   672    519   	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
   673    520   	  && rm -rf "$$dc_destdir" \
   674    521   	  && $(MAKE) $(AM_MAKEFLAGS) dist \
   675    522   	  && rm -rf $(DIST_ARCHIVES) \
   676         -	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
   677         -	  && cd "$$am__cwd" \
   678         -	  || exit 1
          523  +	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
   679    524   	$(am__remove_distdir)
   680    525   	@(echo "$(distdir) archives ready for distribution: "; \
   681    526   	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
   682    527   	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
   683    528   distuninstallcheck:
   684         -	@test -n '$(distuninstallcheck_dir)' || { \
   685         -	  echo 'ERROR: trying to run $@ with an empty' \
   686         -	       '$$(distuninstallcheck_dir)' >&2; \
   687         -	  exit 1; \
   688         -	}; \
   689         -	$(am__cd) '$(distuninstallcheck_dir)' || { \
   690         -	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
   691         -	  exit 1; \
   692         -	}; \
   693         -	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
          529  +	@cd $(distuninstallcheck_dir) \
          530  +	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
   694    531   	   || { echo "ERROR: files left after uninstall:" ; \
   695    532   	        if test -n "$(DESTDIR)"; then \
   696    533   	          echo "  (check DESTDIR support)"; \
   697    534   	        fi ; \
   698    535   	        $(distuninstallcheck_listfiles) ; \
   699    536   	        exit 1; } >&2
   700    537   distcleancheck: distclean
................................................................................
   704    541   	fi
   705    542   	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
   706    543   	  || { echo "ERROR: files left in build directory after distclean:" ; \
   707    544   	       $(distcleancheck_listfiles) ; \
   708    545   	       exit 1; } >&2
   709    546   check-am: all-am
   710    547   check: check-recursive
   711         -all-am: Makefile $(DATA) config.h
          548  +all-am: Makefile $(DATA)
   712    549   installdirs: installdirs-recursive
   713    550   installdirs-am:
   714    551   	for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
   715    552   	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
   716    553   	done
   717    554   install: install-recursive
   718    555   install-exec: install-exec-recursive
................................................................................
   720    557   uninstall: uninstall-recursive
   721    558   
   722    559   install-am: all-am
   723    560   	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   724    561   
   725    562   installcheck: installcheck-recursive
   726    563   install-strip:
   727         -	if test -z '$(STRIP)'; then \
   728         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   729         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   730         -	      install; \
   731         -	else \
   732         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   733         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   734         -	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
   735         -	fi
          564  +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
          565  +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          566  +	  `test -z '$(STRIP)' || \
          567  +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   736    568   mostlyclean-generic:
   737         -	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
   738    569   
   739    570   clean-generic:
   740    571   
   741    572   distclean-generic:
   742    573   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   743         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   744    574   
   745    575   maintainer-clean-generic:
   746    576   	@echo "This command is intended for maintainers to use"
   747    577   	@echo "it deletes files that may require special tools to rebuild."
   748    578   clean: clean-recursive
   749    579   
   750    580   clean-am: clean-generic clean-libtool mostlyclean-am
   751    581   
   752    582   distclean: distclean-recursive
   753    583   	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
   754    584   	-rm -f Makefile
   755         -distclean-am: clean-am distclean-generic distclean-hdr \
   756         -	distclean-libtool distclean-tags
          585  +distclean-am: clean-am distclean-generic distclean-libtool \
          586  +	distclean-tags
   757    587   
   758    588   dvi: dvi-recursive
   759    589   
   760    590   dvi-am:
   761    591   
   762    592   html: html-recursive
   763    593   
   764         -html-am:
   765         -
   766    594   info: info-recursive
   767    595   
   768    596   info-am:
   769    597   
   770    598   install-data-am: install-pkgconfigDATA
   771    599   
   772    600   install-dvi: install-dvi-recursive
   773    601   
   774         -install-dvi-am:
   775         -
   776    602   install-exec-am:
   777    603   
   778    604   install-html: install-html-recursive
   779    605   
   780         -install-html-am:
   781         -
   782    606   install-info: install-info-recursive
   783    607   
   784         -install-info-am:
   785         -
   786    608   install-man:
   787    609   
   788    610   install-pdf: install-pdf-recursive
   789    611   
   790         -install-pdf-am:
   791         -
   792    612   install-ps: install-ps-recursive
   793    613   
   794         -install-ps-am:
   795         -
   796    614   installcheck-am:
   797    615   
   798    616   maintainer-clean: maintainer-clean-recursive
   799    617   	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
   800    618   	-rm -rf $(top_srcdir)/autom4te.cache
   801    619   	-rm -f Makefile
   802    620   maintainer-clean-am: distclean-am maintainer-clean-generic
................................................................................
   811    629   
   812    630   ps: ps-recursive
   813    631   
   814    632   ps-am:
   815    633   
   816    634   uninstall-am: uninstall-pkgconfigDATA
   817    635   
   818         -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
   819         -	ctags-recursive install-am install-strip tags-recursive
          636  +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
          637  +	install-strip
   820    638   
   821    639   .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
   822    640   	all all-am am--refresh check check-am clean clean-generic \
   823    641   	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
   824         -	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
   825         -	dist-zip distcheck distclean distclean-generic distclean-hdr \
   826         -	distclean-libtool distclean-tags distcleancheck distdir \
   827         -	distuninstallcheck dvi dvi-am html html-am info info-am \
   828         -	install install-am install-data install-data-am install-dvi \
   829         -	install-dvi-am install-exec install-exec-am install-html \
   830         -	install-html-am install-info install-info-am install-man \
   831         -	install-pdf install-pdf-am install-pkgconfigDATA install-ps \
   832         -	install-ps-am install-strip installcheck installcheck-am \
   833         -	installdirs installdirs-am maintainer-clean \
   834         -	maintainer-clean-generic mostlyclean mostlyclean-generic \
   835         -	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
   836         -	uninstall uninstall-am uninstall-pkgconfigDATA
   837         -
   838         -
   839         -coverage-init:
   840         -	lcov --directory lib --capture --initial --output-file librasterlite_cov.info
   841         -
   842         -coverage::
   843         -	lcov --directory lib --output-file librasterlite_cov.info --capture
   844         -	genhtml -o covresults librasterlite_cov.info
          642  +	dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
          643  +	distclean distclean-generic distclean-libtool distclean-tags \
          644  +	distcleancheck distdir distuninstallcheck dvi dvi-am html \
          645  +	html-am info info-am install install-am install-data \
          646  +	install-data-am install-dvi install-dvi-am install-exec \
          647  +	install-exec-am install-html install-html-am install-info \
          648  +	install-info-am install-man install-pdf install-pdf-am \
          649  +	install-pkgconfigDATA install-ps install-ps-am install-strip \
          650  +	installcheck installcheck-am installdirs installdirs-am \
          651  +	maintainer-clean maintainer-clean-generic mostlyclean \
          652  +	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
          653  +	tags tags-recursive uninstall uninstall-am \
          654  +	uninstall-pkgconfigDATA
   845    655   
   846    656   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   847    657   # Otherwise a system limit (for SysV at least) may be exceeded.
   848    658   .NOEXPORT:

Deleted NEWS.


Changes to README.

    23     23       ./configure
    24     24   
    25     25   If another path prefix is required, then execute:
    26     26   
    27     27       ./configure --prefix=/my/path
    28     28   
    29     29   In either case, the directory of the prefix path must exist and be
    30         -writeable by the installer.
           30  +writable by the installer.
    31     31   
    32     32   After executing configure, execute:
    33     33   
    34     34       make
    35     35       make install
    36     36   
    37     37   Or even better, you can *strip* any executable binary, in order
................................................................................
    45     45       
    46     46   The external dependencies needed in order to build 'librasterlite'
    47     47   are the followings:
    48     48   
    49     49   libtiff	
    50     50   --------------
    51     51   a library required in order to access TIFF images
    52         -download site: http://www.libtiff.org
           52  +dowload site: http://www.libtiff.org
    53     53   
    54     54   libgeotiff
    55     55   --------------
    56     56   a library supporting GeoTIFF	
    57     57   download site: http://trac.osgeo.org/geotiff
    58     58   
    59     59   libjpeg
................................................................................
    60     60   --------------
    61     61   a library required in order to access JPEG images
    62     62   download site: http://www.ijg.org
    63     63   
    64     64   zlib
    65     65   --------------
    66     66   a library supporting DEFLATE (zip) compression
    67         -download site: http://www.zlib.net
           67  +dowload site: http://www.zlib.net
    68     68   
    69     69   libpng
    70     70   --------------
    71     71   a library supporting PNG images
    72     72   download site: http://www.libpng.org/pub/png/libpng.html
    73     73   
    74     74   libspatialite / libproj
    75     75   -----------------------
    76     76   please refer to the 'libspatialite' documentation.
    77     77   
           78  +IMPORTANTE NOTICE: librasterlite internally includes a copy 
           79  +of libepsilon, a library supporting Wavelt compressed images: 
           80  +so you ARE NOT required to install and/or build libepsilon
           81  +as a separete step.
           82  +libepsilon is a copyright of:
           83  +Alexander Simakov, <xander@entropyware.info>
           84  +download from: http://sourceforge.net/projects/epsilon-project/
           85  +
    78     86   3 - Build notes
    79     87   ===============
    80     88   
    81     89   3.1: Building on Linux
    82     90   ----------------------
    83     91   
    84     92   Building 'librasterlite' under Linux does not require any special 
    85         -setting; we'll assume you have unpacked the sources as 
           93  +setting; we'll suppose you have unpacked the sources as 
    86     94   ./librasterlite-1.0
    87     95   
    88     96   # cd librasterlite-1.0
    89     97   # ./configure
    90     98   # make
    91     99   # sudo make install
    92    100   #     or (in order to save some disk space)
    93    101   # sudo make install-strip
    94    102   
    95    103   IMPORTANT NOTICE:
    96    104   the above builds a dynamically-linked version of the tools (i.e. rasterlite_load, 
    97    105   rasterlite_pyramids and so on, depends on several shared libraries at run time).
    98         -If you want to get a statically-linked version of the tools (i.e. not
    99         -requiring any external dependencies), you simply have now to type:
          106  +If you want to get a statically-linked version of the tools (i.e., not
          107  +requiring any external dependency), you simply have now to type:
   100    108   
   101    109   # mkdir static_bin
   102    110   # make -f Makefile-static-Linux
   103    111   
   104         -and you'll get all statically-linked tools built into the ./static_bin dir.
          112  +and you'll get any statically-linked tool built into the ./static_bin dir.
   105    113   
   106    114   3.2: Building on MacOsX
   107    115   -----------------------
   108    116   
   109         -Building 'librasterlite' on MacOsX is mainly the same as for 
          117  +Building 'librasterlite' on MacOsX is quite the same as for 
   110    118   Linux.
   111         -We'll assume you have unpacked the sources as 
          119  +We'll suppose you have unpacked the sources as 
   112    120   ./librasterlite-1.0
   113    121   
   114    122   # cd librasterlite-1.0
   115    123   # ./configure
   116    124   # make
   117    125   # sudo make install
   118    126   #     or (in order to save some disk space)
   119    127   # sudo make install-strip
   120    128   
   121    129   IMPORTANT NOTICE: this will build an executable for your
   122    130   specific platform. i.e. when building on a PPC Mac,
   123         -resulting binary will be targeted to run on PPC.
          131  +resulting binary will be targeted to run on PPC anyway.
   124    132   And when building on Intel Mac, resulting binary will
   125    133   run on Intel target.
   126    134   
   127    135   IMPORTANT NOTICE:
   128    136   the above builds a dynamically-linked version of the tools (i.e. rasterlite_load, 
   129    137   rasterlite_pyramids and so on, depends on several shared libraries at run time).
   130         -If you want to get a statically-linked version of the tools (i.e. not
   131         -requiring any external dependencies), you simply have now to type:
          138  +If you want to get a statically-linked version of the tools (i.e., not
          139  +requiring any external dependency), you simply have now to type:
   132    140   
   133    141   # mkdir static_bin
   134    142   # make -f Makefile-static-MacOsX
   135    143   
   136         -and you'll get all statically-linked tools built into the ./static_bin dir.
          144  +and you'll get any statically-linked tool built into the ./static_bin dir.
   137    145   
   138    146   3.3: building on Windows
   139    147   ------------------------
   140    148   
   141         -On Windows systems you can choose between two different compilers:
          149  +On Windows systems you can choose using two different compilers:
   142    150   - MinGW / MSYS
   143         -  this represents a smart porting of a minimal Linux-like
          151  +  this represents a smart porting of a minimalistic Linux-like
   144    152     devel-toolkit
   145    153   - Microsoft Visual Studio .NET
   146    154     this one is the standard platform devel-toolkit
   147    155   
   148    156   3.3.1: using MinGW / MSYS
   149    157   -------------------------
   150    158   
   151         -We assume you have already installed the MinGW compiler and the MSYS shell.
          159  +We suppose you have already installed the MinGW compiler and the MSYS shell.
   152    160   Building 'librasterlite' under Windows is then more or less like building
   153    161   on any other UNIX-like system.
   154         -We'll assume you have unpacked the sources as 
          162  +We'll suppose you have unpacked the sources as 
   155    163   C:\librasterlite-1.0
   156    164   
   157    165   $ cd c:/librasterlite-1.0
   158    166   $ export "CFLAGS=-I/usr/local/include"
   159    167   $ export "LDFLAGS=-L/usr/local/lib"
   160    168   $ ./configure
   161    169   $ make
................................................................................
   162    170   $ make install-strip
   163    171   $     or (in order to save some disk space)
   164    172   $ make install-strip
   165    173   
   166    174   IMPORTANT NOTICE:
   167    175   the above builds a dynamically-linked version of the tools (i.e. rasterlite_load, 
   168    176   rasterlite_pyramids and so on, depends on several DLLs at run time).
   169         -If you want to get a statically-linked version of the tools (i.e. not
   170         -requiring any external dependencies), you simply have now to type:
          177  +If you want to get a statically-linked version of the tools (i.e., not
          178  +requiring any external dependency), you simply have now to type:
   171    179   
   172    180   $ mkdir static_bin
   173    181   $ make -f Makefile-static-MinGW
   174    182   
   175         -and you'll get all statically-linked tools built into the ./static_bin dir.
          183  +and you'll get any statically-linked tool built into the ./static_bin dir.
   176    184   
   177    185   3.3.2: using Microsoft Visual Studio .NET
   178    186   -----------------------------------------
   179    187   
   180         -We assume you have already installed Visual Studio enabling the command line
          188  +We suppose you have already installed Visual Studio enabling the command line
   181    189   tools [you are expected to use the command prompt shell].
   182    190   
   183         -We'll assume you have unpacked the sources as
          191  +We'll suppose you have unpacked the sources as
   184    192   C:\librasterlite-1.0
   185    193   
   186    194   > cd c:\librasterlite-1.0
   187    195   > nmake /f makefile.vc
   188    196   > nmake /f makefile.vc install
   189    197   
   190    198   Important notice: you can install any depending library [libtiff, jpeg ..]
   191    199   using the OSGeo4W installer: http://trac.osgeo.org/osgeo4w/
   192    200   

Changes to aclocal.m4.

     1         -# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
            1  +# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
     2      2   
     3      3   # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
     4         -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
     5         -# Inc.
            4  +# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     6      5   # This file is free software; the Free Software Foundation
     7      6   # gives unlimited permission to copy and/or distribute it,
     8      7   # with or without modifications, as long as this notice is preserved.
     9      8   
    10      9   # This program is distributed in the hope that it will be useful,
    11     10   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    12     11   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    13     12   # PARTICULAR PURPOSE.
    14     13   
    15     14   m4_ifndef([AC_AUTOCONF_VERSION],
    16     15     [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
    17         -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
    18         -[m4_warning([this file was generated for autoconf 2.68.
           16  +m4_if(AC_AUTOCONF_VERSION, [2.61],,
           17  +[m4_warning([this file was generated for autoconf 2.61.
    19     18   You have another version of autoconf.  It may work, but is not guaranteed to.
    20     19   If you have problems, you may need to regenerate the build system entirely.
    21     20   To do so, use the procedure documented by the package, typically `autoreconf'.])])
    22     21   
    23         -# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
    24         -# serial 1 (pkg-config-0.24)
    25         -# 
    26         -# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
           22  +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
           23  +
           24  +# serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL
           25  +
           26  +
           27  +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
           28  +# -----------------------------------------------------------
           29  +# If this macro is not defined by Autoconf, define it here.
           30  +m4_ifdef([AC_PROVIDE_IFELSE],
           31  +         [],
           32  +         [m4_define([AC_PROVIDE_IFELSE],
           33  +	         [m4_ifdef([AC_PROVIDE_$1],
           34  +		           [$2], [$3])])])
           35  +
           36  +
           37  +# AC_PROG_LIBTOOL
           38  +# ---------------
           39  +AC_DEFUN([AC_PROG_LIBTOOL],
           40  +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
           41  +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
           42  +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
           43  +  AC_PROVIDE_IFELSE([AC_PROG_CXX],
           44  +    [AC_LIBTOOL_CXX],
           45  +    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
           46  +  ])])
           47  +dnl And a similar setup for Fortran 77 support
           48  +  AC_PROVIDE_IFELSE([AC_PROG_F77],
           49  +    [AC_LIBTOOL_F77],
           50  +    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
           51  +])])
           52  +
           53  +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
           54  +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
           55  +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
           56  +  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
           57  +    [AC_LIBTOOL_GCJ],
           58  +    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
           59  +      [AC_LIBTOOL_GCJ],
           60  +      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
           61  +	[AC_LIBTOOL_GCJ],
           62  +      [ifdef([AC_PROG_GCJ],
           63  +	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
           64  +       ifdef([A][M_PROG_GCJ],
           65  +	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
           66  +       ifdef([LT_AC_PROG_GCJ],
           67  +	     [define([LT_AC_PROG_GCJ],
           68  +		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
           69  +])])# AC_PROG_LIBTOOL
           70  +
           71  +
           72  +# _AC_PROG_LIBTOOL
           73  +# ----------------
           74  +AC_DEFUN([_AC_PROG_LIBTOOL],
           75  +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
           76  +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
           77  +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
           78  +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
           79  +
           80  +# This can be used to rebuild libtool when needed
           81  +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
           82  +
           83  +# Always use our own libtool.
           84  +LIBTOOL='$(SHELL) $(top_builddir)/libtool'
           85  +AC_SUBST(LIBTOOL)dnl
           86  +
           87  +# Prevent multiple expansion
           88  +define([AC_PROG_LIBTOOL], [])
           89  +])# _AC_PROG_LIBTOOL
           90  +
           91  +
           92  +# AC_LIBTOOL_SETUP
           93  +# ----------------
           94  +AC_DEFUN([AC_LIBTOOL_SETUP],
           95  +[AC_PREREQ(2.50)dnl
           96  +AC_REQUIRE([AC_ENABLE_SHARED])dnl
           97  +AC_REQUIRE([AC_ENABLE_STATIC])dnl
           98  +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
           99  +AC_REQUIRE([AC_CANONICAL_HOST])dnl
          100  +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
          101  +AC_REQUIRE([AC_PROG_CC])dnl
          102  +AC_REQUIRE([AC_PROG_LD])dnl
          103  +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
          104  +AC_REQUIRE([AC_PROG_NM])dnl
          105  +
          106  +AC_REQUIRE([AC_PROG_LN_S])dnl
          107  +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
          108  +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
          109  +AC_REQUIRE([AC_OBJEXT])dnl
          110  +AC_REQUIRE([AC_EXEEXT])dnl
          111  +dnl
          112  +AC_LIBTOOL_SYS_MAX_CMD_LEN
          113  +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
          114  +AC_LIBTOOL_OBJDIR
          115  +
          116  +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
          117  +_LT_AC_PROG_ECHO_BACKSLASH
          118  +
          119  +case $host_os in
          120  +aix3*)
          121  +  # AIX sometimes has problems with the GCC collect2 program.  For some
          122  +  # reason, if we set the COLLECT_NAMES environment variable, the problems
          123  +  # vanish in a puff of smoke.
          124  +  if test "X${COLLECT_NAMES+set}" != Xset; then
          125  +    COLLECT_NAMES=
          126  +    export COLLECT_NAMES
          127  +  fi
          128  +  ;;
          129  +esac
          130  +
          131  +# Sed substitution that helps us do robust quoting.  It backslashifies
          132  +# metacharacters that are still active within double-quoted strings.
          133  +Xsed='sed -e 1s/^X//'
          134  +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
          135  +
          136  +# Same as above, but do not quote variable references.
          137  +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
          138  +
          139  +# Sed substitution to delay expansion of an escaped shell variable in a
          140  +# double_quote_subst'ed string.
          141  +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
          142  +
          143  +# Sed substitution to avoid accidental globbing in evaled expressions
          144  +no_glob_subst='s/\*/\\\*/g'
          145  +
          146  +# Constants:
          147  +rm="rm -f"
          148  +
          149  +# Global variables:
          150  +default_ofile=libtool
          151  +can_build_shared=yes
          152  +
          153  +# All known linkers require a `.a' archive for static linking (except MSVC,
          154  +# which needs '.lib').
          155  +libext=a
          156  +ltmain="$ac_aux_dir/ltmain.sh"
          157  +ofile="$default_ofile"
          158  +with_gnu_ld="$lt_cv_prog_gnu_ld"
          159  +
          160  +AC_CHECK_TOOL(AR, ar, false)
          161  +AC_CHECK_TOOL(RANLIB, ranlib, :)
          162  +AC_CHECK_TOOL(STRIP, strip, :)
          163  +
          164  +old_CC="$CC"
          165  +old_CFLAGS="$CFLAGS"
          166  +
          167  +# Set sane defaults for various variables
          168  +test -z "$AR" && AR=ar
          169  +test -z "$AR_FLAGS" && AR_FLAGS=cru
          170  +test -z "$AS" && AS=as
          171  +test -z "$CC" && CC=cc
          172  +test -z "$LTCC" && LTCC=$CC
          173  +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
          174  +test -z "$DLLTOOL" && DLLTOOL=dlltool
          175  +test -z "$LD" && LD=ld
          176  +test -z "$LN_S" && LN_S="ln -s"
          177  +test -z "$MAGIC_CMD" && MAGIC_CMD=file
          178  +test -z "$NM" && NM=nm
          179  +test -z "$SED" && SED=sed
          180  +test -z "$OBJDUMP" && OBJDUMP=objdump
          181  +test -z "$RANLIB" && RANLIB=:
          182  +test -z "$STRIP" && STRIP=:
          183  +test -z "$ac_objext" && ac_objext=o
          184  +
          185  +# Determine commands to create old-style static archives.
          186  +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
          187  +old_postinstall_cmds='chmod 644 $oldlib'
          188  +old_postuninstall_cmds=
          189  +
          190  +if test -n "$RANLIB"; then
          191  +  case $host_os in
          192  +  openbsd*)
          193  +    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
          194  +    ;;
          195  +  *)
          196  +    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
          197  +    ;;
          198  +  esac
          199  +  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
          200  +fi
          201  +
          202  +_LT_CC_BASENAME([$compiler])
          203  +
          204  +# Only perform the check for file, if the check method requires it
          205  +case $deplibs_check_method in
          206  +file_magic*)
          207  +  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
          208  +    AC_PATH_MAGIC
          209  +  fi
          210  +  ;;
          211  +esac
          212  +
          213  +_LT_REQUIRED_DARWIN_CHECKS
          214  +
          215  +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
          216  +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
          217  +enable_win32_dll=yes, enable_win32_dll=no)
          218  +
          219  +AC_ARG_ENABLE([libtool-lock],
          220  +    [AC_HELP_STRING([--disable-libtool-lock],
          221  +	[avoid locking (might break parallel builds)])])
          222  +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
          223  +
          224  +AC_ARG_WITH([pic],
          225  +    [AC_HELP_STRING([--with-pic],
          226  +	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
          227  +    [pic_mode="$withval"],
          228  +    [pic_mode=default])
          229  +test -z "$pic_mode" && pic_mode=default
          230  +
          231  +# Use C for the default configuration in the libtool script
          232  +tagname=
          233  +AC_LIBTOOL_LANG_C_CONFIG
          234  +_LT_AC_TAGCONFIG
          235  +])# AC_LIBTOOL_SETUP
          236  +
          237  +
          238  +# _LT_AC_SYS_COMPILER
          239  +# -------------------
          240  +AC_DEFUN([_LT_AC_SYS_COMPILER],
          241  +[AC_REQUIRE([AC_PROG_CC])dnl
          242  +
          243  +# If no C compiler was specified, use CC.
          244  +LTCC=${LTCC-"$CC"}
          245  +
          246  +# If no C compiler flags were specified, use CFLAGS.
          247  +LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
          248  +
          249  +# Allow CC to be a program name with arguments.
          250  +compiler=$CC
          251  +])# _LT_AC_SYS_COMPILER
          252  +
          253  +
          254  +# _LT_CC_BASENAME(CC)
          255  +# -------------------
          256  +# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
          257  +AC_DEFUN([_LT_CC_BASENAME],
          258  +[for cc_temp in $1""; do
          259  +  case $cc_temp in
          260  +    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
          261  +    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
          262  +    \-*) ;;
          263  +    *) break;;
          264  +  esac
          265  +done
          266  +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
          267  +])
          268  +
          269  +
          270  +# _LT_COMPILER_BOILERPLATE
          271  +# ------------------------
          272  +# Check for compiler boilerplate output or warnings with
          273  +# the simple compiler test code.
          274  +AC_DEFUN([_LT_COMPILER_BOILERPLATE],
          275  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
          276  +ac_outfile=conftest.$ac_objext
          277  +echo "$lt_simple_compile_test_code" >conftest.$ac_ext
          278  +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
          279  +_lt_compiler_boilerplate=`cat conftest.err`
          280  +$rm conftest*
          281  +])# _LT_COMPILER_BOILERPLATE
          282  +
          283  +
          284  +# _LT_LINKER_BOILERPLATE
          285  +# ----------------------
          286  +# Check for linker boilerplate output or warnings with
          287  +# the simple link test code.
          288  +AC_DEFUN([_LT_LINKER_BOILERPLATE],
          289  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
          290  +ac_outfile=conftest.$ac_objext
          291  +echo "$lt_simple_link_test_code" >conftest.$ac_ext
          292  +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
          293  +_lt_linker_boilerplate=`cat conftest.err`
          294  +$rm -r conftest*
          295  +])# _LT_LINKER_BOILERPLATE
          296  +
          297  +# _LT_REQUIRED_DARWIN_CHECKS
          298  +# --------------------------
          299  +# Check for some things on darwin
          300  +AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
          301  +  case $host_os in
          302  +    rhapsody* | darwin*)
          303  +    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
          304  +    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
          305  +
          306  +    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
          307  +      [lt_cv_apple_cc_single_mod=no
          308  +      if test -z "${LT_MULTI_MODULE}"; then
          309  +   # By default we will add the -single_module flag. You can override
          310  +   # by either setting the environment variable LT_MULTI_MODULE
          311  +   # non-empty at configure time, or by adding -multi_module to the
          312  +   # link flags.
          313  +   echo "int foo(void){return 1;}" > conftest.c
          314  +   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
          315  +     -dynamiclib ${wl}-single_module conftest.c
          316  +   if test -f libconftest.dylib; then
          317  +     lt_cv_apple_cc_single_mod=yes
          318  +     rm -rf libconftest.dylib*
          319  +   fi
          320  +   rm conftest.c
          321  +      fi])
          322  +    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
          323  +      [lt_cv_ld_exported_symbols_list],
          324  +      [lt_cv_ld_exported_symbols_list=no
          325  +      save_LDFLAGS=$LDFLAGS
          326  +      echo "_main" > conftest.sym
          327  +      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
          328  +      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
          329  +   [lt_cv_ld_exported_symbols_list=yes],
          330  +   [lt_cv_ld_exported_symbols_list=no])
          331  +   LDFLAGS="$save_LDFLAGS"
          332  +    ])
          333  +    case $host_os in
          334  +    rhapsody* | darwin1.[[0123]])
          335  +      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
          336  +    darwin1.*)
          337  +     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
          338  +    darwin*)
          339  +      # if running on 10.5 or later, the deployment target defaults
          340  +      # to the OS version, if on x86, and 10.4, the deployment
          341  +      # target defaults to 10.4. Don't you love it?
          342  +      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
          343  +   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
          344  +     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
          345  +   10.[[012]]*)
          346  +     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
          347  +   10.*)
          348  +     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
          349  +      esac
          350  +    ;;
          351  +  esac
          352  +    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
          353  +      _lt_dar_single_mod='$single_module'
          354  +    fi
          355  +    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
          356  +      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
          357  +    else
          358  +      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
          359  +    fi
          360  +    if test "$DSYMUTIL" != ":"; then
          361  +      _lt_dsymutil="~$DSYMUTIL \$lib || :"
          362  +    else
          363  +      _lt_dsymutil=
          364  +    fi
          365  +    ;;
          366  +  esac
          367  +])
          368  +
          369  +# _LT_AC_SYS_LIBPATH_AIX
          370  +# ----------------------
          371  +# Links a minimal program and checks the executable
          372  +# for the system default hardcoded library path. In most cases,
          373  +# this is /usr/lib:/lib, but when the MPI compilers are used
          374  +# the location of the communication and MPI libs are included too.
          375  +# If we don't find anything, use the default library path according
          376  +# to the aix ld manual.
          377  +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
          378  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
          379  +AC_LINK_IFELSE(AC_LANG_PROGRAM,[
          380  +lt_aix_libpath_sed='
          381  +    /Import File Strings/,/^$/ {
          382  +	/^0/ {
          383  +	    s/^0  *\(.*\)$/\1/
          384  +	    p
          385  +	}
          386  +    }'
          387  +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
          388  +# Check for a 64-bit object if we didn't find anything.
          389  +if test -z "$aix_libpath"; then
          390  +  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
          391  +fi],[])
          392  +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
          393  +])# _LT_AC_SYS_LIBPATH_AIX
          394  +
          395  +
          396  +# _LT_AC_SHELL_INIT(ARG)
          397  +# ----------------------
          398  +AC_DEFUN([_LT_AC_SHELL_INIT],
          399  +[ifdef([AC_DIVERSION_NOTICE],
          400  +	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
          401  +	 [AC_DIVERT_PUSH(NOTICE)])
          402  +$1
          403  +AC_DIVERT_POP
          404  +])# _LT_AC_SHELL_INIT
          405  +
          406  +
          407  +# _LT_AC_PROG_ECHO_BACKSLASH
          408  +# --------------------------
          409  +# Add some code to the start of the generated configure script which
          410  +# will find an echo command which doesn't interpret backslashes.
          411  +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
          412  +[_LT_AC_SHELL_INIT([
          413  +# Check that we are running under the correct shell.
          414  +SHELL=${CONFIG_SHELL-/bin/sh}
          415  +
          416  +case X$ECHO in
          417  +X*--fallback-echo)
          418  +  # Remove one level of quotation (which was required for Make).
          419  +  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
          420  +  ;;
          421  +esac
          422  +
          423  +echo=${ECHO-echo}
          424  +if test "X[$]1" = X--no-reexec; then
          425  +  # Discard the --no-reexec flag, and continue.
          426  +  shift
          427  +elif test "X[$]1" = X--fallback-echo; then
          428  +  # Avoid inline document here, it may be left over
          429  +  :
          430  +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
          431  +  # Yippee, $echo works!
          432  +  :
          433  +else
          434  +  # Restart under the correct shell.
          435  +  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
          436  +fi
          437  +
          438  +if test "X[$]1" = X--fallback-echo; then
          439  +  # used as fallback echo
          440  +  shift
          441  +  cat <<EOF
          442  +[$]*
          443  +EOF
          444  +  exit 0
          445  +fi
          446  +
          447  +# The HP-UX ksh and POSIX shell print the target directory to stdout
          448  +# if CDPATH is set.
          449  +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
          450  +
          451  +if test -z "$ECHO"; then
          452  +if test "X${echo_test_string+set}" != Xset; then
          453  +# find a string as large as possible, as long as the shell can cope with it
          454  +  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
          455  +    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
          456  +    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
          457  +       echo_test_string=`eval $cmd` &&
          458  +       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
          459  +    then
          460  +      break
          461  +    fi
          462  +  done
          463  +fi
          464  +
          465  +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
          466  +   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
          467  +   test "X$echo_testing_string" = "X$echo_test_string"; then
          468  +  :
          469  +else
          470  +  # The Solaris, AIX, and Digital Unix default echo programs unquote
          471  +  # backslashes.  This makes it impossible to quote backslashes using
          472  +  #   echo "$something" | sed 's/\\/\\\\/g'
          473  +  #
          474  +  # So, first we look for a working echo in the user's PATH.
          475  +
          476  +  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
          477  +  for dir in $PATH /usr/ucb; do
          478  +    IFS="$lt_save_ifs"
          479  +    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
          480  +       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
          481  +       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
          482  +       test "X$echo_testing_string" = "X$echo_test_string"; then
          483  +      echo="$dir/echo"
          484  +      break
          485  +    fi
          486  +  done
          487  +  IFS="$lt_save_ifs"
          488  +
          489  +  if test "X$echo" = Xecho; then
          490  +    # We didn't find a better echo, so look for alternatives.
          491  +    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
          492  +       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
          493  +       test "X$echo_testing_string" = "X$echo_test_string"; then
          494  +      # This shell has a builtin print -r that does the trick.
          495  +      echo='print -r'
          496  +    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
          497  +	 test "X$CONFIG_SHELL" != X/bin/ksh; then
          498  +      # If we have ksh, try running configure again with it.
          499  +      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
          500  +      export ORIGINAL_CONFIG_SHELL
          501  +      CONFIG_SHELL=/bin/ksh
          502  +      export CONFIG_SHELL
          503  +      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
          504  +    else
          505  +      # Try using printf.
          506  +      echo='printf %s\n'
          507  +      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
          508  +	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
          509  +	 test "X$echo_testing_string" = "X$echo_test_string"; then
          510  +	# Cool, printf works
          511  +	:
          512  +      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
          513  +	   test "X$echo_testing_string" = 'X\t' &&
          514  +	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
          515  +	   test "X$echo_testing_string" = "X$echo_test_string"; then
          516  +	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
          517  +	export CONFIG_SHELL
          518  +	SHELL="$CONFIG_SHELL"
          519  +	export SHELL
          520  +	echo="$CONFIG_SHELL [$]0 --fallback-echo"
          521  +      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
          522  +	   test "X$echo_testing_string" = 'X\t' &&
          523  +	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
          524  +	   test "X$echo_testing_string" = "X$echo_test_string"; then
          525  +	echo="$CONFIG_SHELL [$]0 --fallback-echo"
          526  +      else
          527  +	# maybe with a smaller string...
          528  +	prev=:
          529  +
          530  +	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
          531  +	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
          532  +	  then
          533  +	    break
          534  +	  fi
          535  +	  prev="$cmd"
          536  +	done
          537  +
          538  +	if test "$prev" != 'sed 50q "[$]0"'; then
          539  +	  echo_test_string=`eval $prev`
          540  +	  export echo_test_string
          541  +	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
          542  +	else
          543  +	  # Oops.  We lost completely, so just stick with echo.
          544  +	  echo=echo
          545  +	fi
          546  +      fi
          547  +    fi
          548  +  fi
          549  +fi
          550  +fi
          551  +
          552  +# Copy echo and quote the copy suitably for passing to libtool from
          553  +# the Makefile, instead of quoting the original, which is used later.
          554  +ECHO=$echo
          555  +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
          556  +   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
          557  +fi
          558  +
          559  +AC_SUBST(ECHO)
          560  +])])# _LT_AC_PROG_ECHO_BACKSLASH
          561  +
          562  +
          563  +# _LT_AC_LOCK
          564  +# -----------
          565  +AC_DEFUN([_LT_AC_LOCK],
          566  +[AC_ARG_ENABLE([libtool-lock],
          567  +    [AC_HELP_STRING([--disable-libtool-lock],
          568  +	[avoid locking (might break parallel builds)])])
          569  +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
          570  +
          571  +# Some flags need to be propagated to the compiler or linker for good
          572  +# libtool support.
          573  +case $host in
          574  +ia64-*-hpux*)
          575  +  # Find out which ABI we are using.
          576  +  echo 'int i;' > conftest.$ac_ext
          577  +  if AC_TRY_EVAL(ac_compile); then
          578  +    case `/usr/bin/file conftest.$ac_objext` in
          579  +    *ELF-32*)
          580  +      HPUX_IA64_MODE="32"
          581  +      ;;
          582  +    *ELF-64*)
          583  +      HPUX_IA64_MODE="64"
          584  +      ;;
          585  +    esac
          586  +  fi
          587  +  rm -rf conftest*
          588  +  ;;
          589  +*-*-irix6*)
          590  +  # Find out which ABI we are using.
          591  +  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
          592  +  if AC_TRY_EVAL(ac_compile); then
          593  +   if test "$lt_cv_prog_gnu_ld" = yes; then
          594  +    case `/usr/bin/file conftest.$ac_objext` in
          595  +    *32-bit*)
          596  +      LD="${LD-ld} -melf32bsmip"
          597  +      ;;
          598  +    *N32*)
          599  +      LD="${LD-ld} -melf32bmipn32"
          600  +      ;;
          601  +    *64-bit*)
          602  +      LD="${LD-ld} -melf64bmip"
          603  +      ;;
          604  +    esac
          605  +   else
          606  +    case `/usr/bin/file conftest.$ac_objext` in
          607  +    *32-bit*)
          608  +      LD="${LD-ld} -32"
          609  +      ;;
          610  +    *N32*)
          611  +      LD="${LD-ld} -n32"
          612  +      ;;
          613  +    *64-bit*)
          614  +      LD="${LD-ld} -64"
          615  +      ;;
          616  +    esac
          617  +   fi
          618  +  fi
          619  +  rm -rf conftest*
          620  +  ;;
          621  +
          622  +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
          623  +s390*-*linux*|sparc*-*linux*)
          624  +  # Find out which ABI we are using.
          625  +  echo 'int i;' > conftest.$ac_ext
          626  +  if AC_TRY_EVAL(ac_compile); then
          627  +    case `/usr/bin/file conftest.o` in
          628  +    *32-bit*)
          629  +      case $host in
          630  +        x86_64-*kfreebsd*-gnu)
          631  +          LD="${LD-ld} -m elf_i386_fbsd"
          632  +          ;;
          633  +        x86_64-*linux*)
          634  +          LD="${LD-ld} -m elf_i386"
          635  +          ;;
          636  +        ppc64-*linux*|powerpc64-*linux*)
          637  +          LD="${LD-ld} -m elf32ppclinux"
          638  +          ;;
          639  +        s390x-*linux*)
          640  +          LD="${LD-ld} -m elf_s390"
          641  +          ;;
          642  +        sparc64-*linux*)
          643  +          LD="${LD-ld} -m elf32_sparc"
          644  +          ;;
          645  +      esac
          646  +      ;;
          647  +    *64-bit*)
          648  +      case $host in
          649  +        x86_64-*kfreebsd*-gnu)
          650  +          LD="${LD-ld} -m elf_x86_64_fbsd"
          651  +          ;;
          652  +        x86_64-*linux*)
          653  +          LD="${LD-ld} -m elf_x86_64"
          654  +          ;;
          655  +        ppc*-*linux*|powerpc*-*linux*)
          656  +          LD="${LD-ld} -m elf64ppc"
          657  +          ;;
          658  +        s390*-*linux*)
          659  +          LD="${LD-ld} -m elf64_s390"
          660  +          ;;
          661  +        sparc*-*linux*)
          662  +          LD="${LD-ld} -m elf64_sparc"
          663  +          ;;
          664  +      esac
          665  +      ;;
          666  +    esac
          667  +  fi
          668  +  rm -rf conftest*
          669  +  ;;
          670  +
          671  +*-*-sco3.2v5*)
          672  +  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
          673  +  SAVE_CFLAGS="$CFLAGS"
          674  +  CFLAGS="$CFLAGS -belf"
          675  +  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
          676  +    [AC_LANG_PUSH(C)
          677  +     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
          678  +     AC_LANG_POP])
          679  +  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
          680  +    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
          681  +    CFLAGS="$SAVE_CFLAGS"
          682  +  fi
          683  +  ;;
          684  +sparc*-*solaris*)
          685  +  # Find out which ABI we are using.
          686  +  echo 'int i;' > conftest.$ac_ext
          687  +  if AC_TRY_EVAL(ac_compile); then
          688  +    case `/usr/bin/file conftest.o` in
          689  +    *64-bit*)
          690  +      case $lt_cv_prog_gnu_ld in
          691  +      yes*) LD="${LD-ld} -m elf64_sparc" ;;
          692  +      *)
          693  +        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
          694  +	  LD="${LD-ld} -64"
          695  +	fi
          696  +	;;
          697  +      esac
          698  +      ;;
          699  +    esac
          700  +  fi
          701  +  rm -rf conftest*
          702  +  ;;
          703  +
          704  +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
          705  +[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
          706  +  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
          707  +  AC_CHECK_TOOL(AS, as, false)
          708  +  AC_CHECK_TOOL(OBJDUMP, objdump, false)
          709  +  ;;
          710  +  ])
          711  +esac
          712  +
          713  +need_locks="$enable_libtool_lock"
          714  +
          715  +])# _LT_AC_LOCK
          716  +
          717  +
          718  +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
          719  +#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
          720  +# ----------------------------------------------------------------
          721  +# Check whether the given compiler option works
          722  +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
          723  +[AC_REQUIRE([LT_AC_PROG_SED])
          724  +AC_CACHE_CHECK([$1], [$2],
          725  +  [$2=no
          726  +  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
          727  +   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
          728  +   lt_compiler_flag="$3"
          729  +   # Insert the option either (1) after the last *FLAGS variable, or
          730  +   # (2) before a word containing "conftest.", or (3) at the end.
          731  +   # Note that $ac_compile itself does not contain backslashes and begins
          732  +   # with a dollar sign (not a hyphen), so the echo should work correctly.
          733  +   # The option is referenced via a variable to avoid confusing sed.
          734  +   lt_compile=`echo "$ac_compile" | $SED \
          735  +   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
          736  +   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
          737  +   -e 's:$: $lt_compiler_flag:'`
          738  +   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
          739  +   (eval "$lt_compile" 2>conftest.err)
          740  +   ac_status=$?
          741  +   cat conftest.err >&AS_MESSAGE_LOG_FD
          742  +   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
          743  +   if (exit $ac_status) && test -s "$ac_outfile"; then
          744  +     # The compiler can only warn and ignore the option if not recognized
          745  +     # So say no if there are warnings other than the usual output.
          746  +     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
          747  +     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
          748  +     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
          749  +       $2=yes
          750  +     fi
          751  +   fi
          752  +   $rm conftest*
          753  +])
          754  +
          755  +if test x"[$]$2" = xyes; then
          756  +    ifelse([$5], , :, [$5])
          757  +else
          758  +    ifelse([$6], , :, [$6])
          759  +fi
          760  +])# AC_LIBTOOL_COMPILER_OPTION
          761  +
          762  +
          763  +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
          764  +#                          [ACTION-SUCCESS], [ACTION-FAILURE])
          765  +# ------------------------------------------------------------
          766  +# Check whether the given compiler option works
          767  +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
          768  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
          769  +AC_CACHE_CHECK([$1], [$2],
          770  +  [$2=no
          771  +   save_LDFLAGS="$LDFLAGS"
          772  +   LDFLAGS="$LDFLAGS $3"
          773  +   echo "$lt_simple_link_test_code" > conftest.$ac_ext
          774  +   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
          775  +     # The linker can only warn and ignore the option if not recognized
          776  +     # So say no if there are warnings
          777  +     if test -s conftest.err; then
          778  +       # Append any errors to the config.log.
          779  +       cat conftest.err 1>&AS_MESSAGE_LOG_FD
          780  +       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
          781  +       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
          782  +       if diff conftest.exp conftest.er2 >/dev/null; then
          783  +         $2=yes
          784  +       fi
          785  +     else
          786  +       $2=yes
          787  +     fi
          788  +   fi
          789  +   $rm -r conftest*
          790  +   LDFLAGS="$save_LDFLAGS"
          791  +])
          792  +
          793  +if test x"[$]$2" = xyes; then
          794  +    ifelse([$4], , :, [$4])
          795  +else
          796  +    ifelse([$5], , :, [$5])
          797  +fi
          798  +])# AC_LIBTOOL_LINKER_OPTION
          799  +
          800  +
          801  +# AC_LIBTOOL_SYS_MAX_CMD_LEN
          802  +# --------------------------
          803  +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
          804  +[# find the maximum length of command line arguments
          805  +AC_MSG_CHECKING([the maximum length of command line arguments])
          806  +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
          807  +  i=0
          808  +  teststring="ABCD"
          809  +
          810  +  case $build_os in
          811  +  msdosdjgpp*)
          812  +    # On DJGPP, this test can blow up pretty badly due to problems in libc
          813  +    # (any single argument exceeding 2000 bytes causes a buffer overrun
          814  +    # during glob expansion).  Even if it were fixed, the result of this
          815  +    # check would be larger than it should be.
          816  +    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
          817  +    ;;
          818  +
          819  +  gnu*)
          820  +    # Under GNU Hurd, this test is not required because there is
          821  +    # no limit to the length of command line arguments.
          822  +    # Libtool will interpret -1 as no limit whatsoever
          823  +    lt_cv_sys_max_cmd_len=-1;
          824  +    ;;
          825  +
          826  +  cygwin* | mingw*)
          827  +    # On Win9x/ME, this test blows up -- it succeeds, but takes
          828  +    # about 5 minutes as the teststring grows exponentially.
          829  +    # Worse, since 9x/ME are not pre-emptively multitasking,
          830  +    # you end up with a "frozen" computer, even though with patience
          831  +    # the test eventually succeeds (with a max line length of 256k).
          832  +    # Instead, let's just punt: use the minimum linelength reported by
          833  +    # all of the supported platforms: 8192 (on NT/2K/XP).
          834  +    lt_cv_sys_max_cmd_len=8192;
          835  +    ;;
          836  +
          837  +  amigaos*)
          838  +    # On AmigaOS with pdksh, this test takes hours, literally.
          839  +    # So we just punt and use a minimum line length of 8192.
          840  +    lt_cv_sys_max_cmd_len=8192;
          841  +    ;;
          842  +
          843  +  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
          844  +    # This has been around since 386BSD, at least.  Likely further.
          845  +    if test -x /sbin/sysctl; then
          846  +      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
          847  +    elif test -x /usr/sbin/sysctl; then
          848  +      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
          849  +    else
          850  +      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
          851  +    fi
          852  +    # And add a safety zone
          853  +    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
          854  +    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
          855  +    ;;
          856  +
          857  +  interix*)
          858  +    # We know the value 262144 and hardcode it with a safety zone (like BSD)
          859  +    lt_cv_sys_max_cmd_len=196608
          860  +    ;;
          861  +
          862  +  osf*)
          863  +    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
          864  +    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
          865  +    # nice to cause kernel panics so lets avoid the loop below.
          866  +    # First set a reasonable default.
          867  +    lt_cv_sys_max_cmd_len=16384
          868  +    #
          869  +    if test -x /sbin/sysconfig; then
          870  +      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
          871  +        *1*) lt_cv_sys_max_cmd_len=-1 ;;
          872  +      esac
          873  +    fi
          874  +    ;;
          875  +  sco3.2v5*)
          876  +    lt_cv_sys_max_cmd_len=102400
          877  +    ;;
          878  +  sysv5* | sco5v6* | sysv4.2uw2*)
          879  +    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
          880  +    if test -n "$kargmax"; then
          881  +      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
          882  +    else
          883  +      lt_cv_sys_max_cmd_len=32768
          884  +    fi
          885  +    ;;
          886  +  *)
          887  +    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
          888  +    if test -n "$lt_cv_sys_max_cmd_len"; then
          889  +      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
          890  +      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
          891  +    else
          892  +      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
          893  +      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
          894  +	       = "XX$teststring") >/dev/null 2>&1 &&
          895  +	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
          896  +	      lt_cv_sys_max_cmd_len=$new_result &&
          897  +	      test $i != 17 # 1/2 MB should be enough
          898  +      do
          899  +        i=`expr $i + 1`
          900  +        teststring=$teststring$teststring
          901  +      done
          902  +      teststring=
          903  +      # Add a significant safety factor because C++ compilers can tack on massive
          904  +      # amounts of additional arguments before passing them to the linker.
          905  +      # It appears as though 1/2 is a usable value.
          906  +      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
          907  +    fi
          908  +    ;;
          909  +  esac
          910  +])
          911  +if test -n $lt_cv_sys_max_cmd_len ; then
          912  +  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
          913  +else
          914  +  AC_MSG_RESULT(none)
          915  +fi
          916  +])# AC_LIBTOOL_SYS_MAX_CMD_LEN
          917  +
          918  +
          919  +# _LT_AC_CHECK_DLFCN
          920  +# ------------------
          921  +AC_DEFUN([_LT_AC_CHECK_DLFCN],
          922  +[AC_CHECK_HEADERS(dlfcn.h)dnl
          923  +])# _LT_AC_CHECK_DLFCN
          924  +
          925  +
          926  +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
          927  +#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
          928  +# ---------------------------------------------------------------------
          929  +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
          930  +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
          931  +if test "$cross_compiling" = yes; then :
          932  +  [$4]
          933  +else
          934  +  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
          935  +  lt_status=$lt_dlunknown
          936  +  cat > conftest.$ac_ext <<EOF
          937  +[#line __oline__ "configure"
          938  +#include "confdefs.h"
          939  +
          940  +#if HAVE_DLFCN_H
          941  +#include <dlfcn.h>
          942  +#endif
          943  +
          944  +#include <stdio.h>
          945  +
          946  +#ifdef RTLD_GLOBAL
          947  +#  define LT_DLGLOBAL		RTLD_GLOBAL
          948  +#else
          949  +#  ifdef DL_GLOBAL
          950  +#    define LT_DLGLOBAL		DL_GLOBAL
          951  +#  else
          952  +#    define LT_DLGLOBAL		0
          953  +#  endif
          954  +#endif
          955  +
          956  +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
          957  +   find out it does not work in some platform. */
          958  +#ifndef LT_DLLAZY_OR_NOW
          959  +#  ifdef RTLD_LAZY
          960  +#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
          961  +#  else
          962  +#    ifdef DL_LAZY
          963  +#      define LT_DLLAZY_OR_NOW		DL_LAZY
          964  +#    else
          965  +#      ifdef RTLD_NOW
          966  +#        define LT_DLLAZY_OR_NOW	RTLD_NOW
          967  +#      else
          968  +#        ifdef DL_NOW
          969  +#          define LT_DLLAZY_OR_NOW	DL_NOW
          970  +#        else
          971  +#          define LT_DLLAZY_OR_NOW	0
          972  +#        endif
          973  +#      endif
          974  +#    endif
          975  +#  endif
          976  +#endif
          977  +
          978  +#ifdef __cplusplus
          979  +extern "C" void exit (int);
          980  +#endif
          981  +
          982  +void fnord() { int i=42;}
          983  +int main ()
          984  +{
          985  +  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
          986  +  int status = $lt_dlunknown;
          987  +
          988  +  if (self)
          989  +    {
          990  +      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
          991  +      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
          992  +      /* dlclose (self); */
          993  +    }
          994  +  else
          995  +    puts (dlerror ());
          996  +
          997  +    exit (status);
          998  +}]
          999  +EOF
         1000  +  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
         1001  +    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
         1002  +    lt_status=$?
         1003  +    case x$lt_status in
         1004  +      x$lt_dlno_uscore) $1 ;;
         1005  +      x$lt_dlneed_uscore) $2 ;;
         1006  +      x$lt_dlunknown|x*) $3 ;;
         1007  +    esac
         1008  +  else :
         1009  +    # compilation failed
         1010  +    $3
         1011  +  fi
         1012  +fi
         1013  +rm -fr conftest*
         1014  +])# _LT_AC_TRY_DLOPEN_SELF
         1015  +
         1016  +
         1017  +# AC_LIBTOOL_DLOPEN_SELF
         1018  +# ----------------------
         1019  +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
         1020  +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
         1021  +if test "x$enable_dlopen" != xyes; then
         1022  +  enable_dlopen=unknown
         1023  +  enable_dlopen_self=unknown
         1024  +  enable_dlopen_self_static=unknown
         1025  +else
         1026  +  lt_cv_dlopen=no
         1027  +  lt_cv_dlopen_libs=
         1028  +
         1029  +  case $host_os in
         1030  +  beos*)
         1031  +    lt_cv_dlopen="load_add_on"
         1032  +    lt_cv_dlopen_libs=
         1033  +    lt_cv_dlopen_self=yes
         1034  +    ;;
         1035  +
         1036  +  mingw* | pw32*)
         1037  +    lt_cv_dlopen="LoadLibrary"
         1038  +    lt_cv_dlopen_libs=
         1039  +   ;;
         1040  +
         1041  +  cygwin*)
         1042  +    lt_cv_dlopen="dlopen"
         1043  +    lt_cv_dlopen_libs=
         1044  +   ;;
         1045  +
         1046  +  darwin*)
         1047  +  # if libdl is installed we need to link against it
         1048  +    AC_CHECK_LIB([dl], [dlopen],
         1049  +		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
         1050  +    lt_cv_dlopen="dyld"
         1051  +    lt_cv_dlopen_libs=
         1052  +    lt_cv_dlopen_self=yes
         1053  +    ])
         1054  +   ;;
         1055  +
         1056  +  *)
         1057  +    AC_CHECK_FUNC([shl_load],
         1058  +	  [lt_cv_dlopen="shl_load"],
         1059  +      [AC_CHECK_LIB([dld], [shl_load],
         1060  +	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
         1061  +	[AC_CHECK_FUNC([dlopen],
         1062  +	      [lt_cv_dlopen="dlopen"],
         1063  +	  [AC_CHECK_LIB([dl], [dlopen],
         1064  +		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
         1065  +	    [AC_CHECK_LIB([svld], [dlopen],
         1066  +		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
         1067  +	      [AC_CHECK_LIB([dld], [dld_link],
         1068  +		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
         1069  +	      ])
         1070  +	    ])
         1071  +	  ])
         1072  +	])
         1073  +      ])
         1074  +    ;;
         1075  +  esac
         1076  +
         1077  +  if test "x$lt_cv_dlopen" != xno; then
         1078  +    enable_dlopen=yes
         1079  +  else
         1080  +    enable_dlopen=no
         1081  +  fi
         1082  +
         1083  +  case $lt_cv_dlopen in
         1084  +  dlopen)
         1085  +    save_CPPFLAGS="$CPPFLAGS"
         1086  +    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
         1087  +
         1088  +    save_LDFLAGS="$LDFLAGS"
         1089  +    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
         1090  +
         1091  +    save_LIBS="$LIBS"
         1092  +    LIBS="$lt_cv_dlopen_libs $LIBS"
         1093  +
         1094  +    AC_CACHE_CHECK([whether a program can dlopen itself],
         1095  +	  lt_cv_dlopen_self, [dnl
         1096  +	  _LT_AC_TRY_DLOPEN_SELF(
         1097  +	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
         1098  +	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
         1099  +    ])
         1100  +
         1101  +    if test "x$lt_cv_dlopen_self" = xyes; then
         1102  +      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
         1103  +      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
         1104  +    	  lt_cv_dlopen_self_static, [dnl
         1105  +	  _LT_AC_TRY_DLOPEN_SELF(
         1106  +	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
         1107  +	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
         1108  +      ])
         1109  +    fi
         1110  +
         1111  +    CPPFLAGS="$save_CPPFLAGS"
         1112  +    LDFLAGS="$save_LDFLAGS"
         1113  +    LIBS="$save_LIBS"
         1114  +    ;;
         1115  +  esac
         1116  +
         1117  +  case $lt_cv_dlopen_self in
         1118  +  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
         1119  +  *) enable_dlopen_self=unknown ;;
         1120  +  esac
         1121  +
         1122  +  case $lt_cv_dlopen_self_static in
         1123  +  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
         1124  +  *) enable_dlopen_self_static=unknown ;;
         1125  +  esac
         1126  +fi
         1127  +])# AC_LIBTOOL_DLOPEN_SELF
         1128  +
         1129  +
         1130  +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
         1131  +# ---------------------------------
         1132  +# Check to see if options -c and -o are simultaneously supported by compiler
         1133  +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
         1134  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         1135  +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
         1136  +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
         1137  +  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
         1138  +  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
         1139  +   $rm -r conftest 2>/dev/null
         1140  +   mkdir conftest
         1141  +   cd conftest
         1142  +   mkdir out
         1143  +   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
         1144  +
         1145  +   lt_compiler_flag="-o out/conftest2.$ac_objext"
         1146  +   # Insert the option either (1) after the last *FLAGS variable, or
         1147  +   # (2) before a word containing "conftest.", or (3) at the end.
         1148  +   # Note that $ac_compile itself does not contain backslashes and begins
         1149  +   # with a dollar sign (not a hyphen), so the echo should work correctly.
         1150  +   lt_compile=`echo "$ac_compile" | $SED \
         1151  +   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
         1152  +   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
         1153  +   -e 's:$: $lt_compiler_flag:'`
         1154  +   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
         1155  +   (eval "$lt_compile" 2>out/conftest.err)
         1156  +   ac_status=$?
         1157  +   cat out/conftest.err >&AS_MESSAGE_LOG_FD
         1158  +   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
         1159  +   if (exit $ac_status) && test -s out/conftest2.$ac_objext
         1160  +   then
         1161  +     # The compiler can only warn and ignore the option if not recognized
         1162  +     # So say no if there are warnings
         1163  +     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
         1164  +     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
         1165  +     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
         1166  +       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
         1167  +     fi
         1168  +   fi
         1169  +   chmod u+w . 2>&AS_MESSAGE_LOG_FD
         1170  +   $rm conftest*
         1171  +   # SGI C++ compiler will create directory out/ii_files/ for
         1172  +   # template instantiation
         1173  +   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
         1174  +   $rm out/* && rmdir out
         1175  +   cd ..
         1176  +   rmdir conftest
         1177  +   $rm conftest*
         1178  +])
         1179  +])# AC_LIBTOOL_PROG_CC_C_O
         1180  +
         1181  +
         1182  +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
         1183  +# -----------------------------------------
         1184  +# Check to see if we can do hard links to lock some files if needed
         1185  +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
         1186  +[AC_REQUIRE([_LT_AC_LOCK])dnl
         1187  +
         1188  +hard_links="nottested"
         1189  +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
         1190  +  # do not overwrite the value of need_locks provided by the user
         1191  +  AC_MSG_CHECKING([if we can lock with hard links])
         1192  +  hard_links=yes
         1193  +  $rm conftest*
         1194  +  ln conftest.a conftest.b 2>/dev/null && hard_links=no
         1195  +  touch conftest.a
         1196  +  ln conftest.a conftest.b 2>&5 || hard_links=no
         1197  +  ln conftest.a conftest.b 2>/dev/null && hard_links=no
         1198  +  AC_MSG_RESULT([$hard_links])
         1199  +  if test "$hard_links" = no; then
         1200  +    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
         1201  +    need_locks=warn
         1202  +  fi
         1203  +else
         1204  +  need_locks=no
         1205  +fi
         1206  +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
         1207  +
         1208  +
         1209  +# AC_LIBTOOL_OBJDIR
         1210  +# -----------------
         1211  +AC_DEFUN([AC_LIBTOOL_OBJDIR],
         1212  +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
         1213  +[rm -f .libs 2>/dev/null
         1214  +mkdir .libs 2>/dev/null
         1215  +if test -d .libs; then
         1216  +  lt_cv_objdir=.libs
         1217  +else
         1218  +  # MS-DOS does not allow filenames that begin with a dot.
         1219  +  lt_cv_objdir=_libs
         1220  +fi
         1221  +rmdir .libs 2>/dev/null])
         1222  +objdir=$lt_cv_objdir
         1223  +])# AC_LIBTOOL_OBJDIR
         1224  +
         1225  +
         1226  +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
         1227  +# ----------------------------------------------
         1228  +# Check hardcoding attributes.
         1229  +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
         1230  +[AC_MSG_CHECKING([how to hardcode library paths into programs])
         1231  +_LT_AC_TAGVAR(hardcode_action, $1)=
         1232  +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
         1233  +   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
         1234  +   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
         1235  +
         1236  +  # We can hardcode non-existant directories.
         1237  +  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
         1238  +     # If the only mechanism to avoid hardcoding is shlibpath_var, we
         1239  +     # have to relink, otherwise we might link with an installed library
         1240  +     # when we should be linking with a yet-to-be-installed one
         1241  +     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
         1242  +     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
         1243  +    # Linking always hardcodes the temporary library directory.
         1244  +    _LT_AC_TAGVAR(hardcode_action, $1)=relink
         1245  +  else
         1246  +    # We can link without hardcoding, and we can hardcode nonexisting dirs.
         1247  +    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
         1248  +  fi
         1249  +else
         1250  +  # We cannot hardcode anything, or else we can only hardcode existing
         1251  +  # directories.
         1252  +  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
         1253  +fi
         1254  +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
         1255  +
         1256  +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
         1257  +  # Fast installation is not supported
         1258  +  enable_fast_install=no
         1259  +elif test "$shlibpath_overrides_runpath" = yes ||
         1260  +     test "$enable_shared" = no; then
         1261  +  # Fast installation is not necessary
         1262  +  enable_fast_install=needless
         1263  +fi
         1264  +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
         1265  +
         1266  +
         1267  +# AC_LIBTOOL_SYS_LIB_STRIP
         1268  +# ------------------------
         1269  +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
         1270  +[striplib=
         1271  +old_striplib=
         1272  +AC_MSG_CHECKING([whether stripping libraries is possible])
         1273  +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
         1274  +  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
         1275  +  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
         1276  +  AC_MSG_RESULT([yes])
         1277  +else
         1278  +# FIXME - insert some real tests, host_os isn't really good enough
         1279  +  case $host_os in
         1280  +   darwin*)
         1281  +       if test -n "$STRIP" ; then
         1282  +         striplib="$STRIP -x"
         1283  +         old_striplib="$STRIP -S"
         1284  +         AC_MSG_RESULT([yes])
         1285  +       else
         1286  +  AC_MSG_RESULT([no])
         1287  +fi
         1288  +       ;;
         1289  +   *)
         1290  +  AC_MSG_RESULT([no])
         1291  +    ;;
         1292  +  esac
         1293  +fi
         1294  +])# AC_LIBTOOL_SYS_LIB_STRIP
         1295  +
         1296  +
         1297  +# AC_LIBTOOL_SYS_DYNAMIC_LINKER
         1298  +# -----------------------------
         1299  +# PORTME Fill in your ld.so characteristics
         1300  +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
         1301  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         1302  +AC_MSG_CHECKING([dynamic linker characteristics])
         1303  +library_names_spec=
         1304  +libname_spec='lib$name'
         1305  +soname_spec=
         1306  +shrext_cmds=".so"
         1307  +postinstall_cmds=
         1308  +postuninstall_cmds=
         1309  +finish_cmds=
         1310  +finish_eval=
         1311  +shlibpath_var=
         1312  +shlibpath_overrides_runpath=unknown
         1313  +version_type=none
         1314  +dynamic_linker="$host_os ld.so"
         1315  +sys_lib_dlsearch_path_spec="/lib /usr/lib"
         1316  +m4_if($1,[],[
         1317  +if test "$GCC" = yes; then
         1318  +  case $host_os in
         1319  +    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
         1320  +    *) lt_awk_arg="/^libraries:/" ;;
         1321  +  esac
         1322  +  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
         1323  +  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
         1324  +    # if the path contains ";" then we assume it to be the separator
         1325  +    # otherwise default to the standard path separator (i.e. ":") - it is
         1326  +    # assumed that no part of a normal pathname contains ";" but that should
         1327  +    # okay in the real world where ";" in dirpaths is itself problematic.
         1328  +    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
         1329  +  else
         1330  +    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
         1331  +  fi
         1332  +  # Ok, now we have the path, separated by spaces, we can step through it
         1333  +  # and add multilib dir if necessary.
         1334  +  lt_tmp_lt_search_path_spec=
         1335  +  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
         1336  +  for lt_sys_path in $lt_search_path_spec; do
         1337  +    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
         1338  +      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
         1339  +    else
         1340  +      test -d "$lt_sys_path" && \
         1341  +	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
         1342  +    fi
         1343  +  done
         1344  +  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
         1345  +BEGIN {RS=" "; FS="/|\n";} {
         1346  +  lt_foo="";
         1347  +  lt_count=0;
         1348  +  for (lt_i = NF; lt_i > 0; lt_i--) {
         1349  +    if ($lt_i != "" && $lt_i != ".") {
         1350  +      if ($lt_i == "..") {
         1351  +        lt_count++;
         1352  +      } else {
         1353  +        if (lt_count == 0) {
         1354  +          lt_foo="/" $lt_i lt_foo;
         1355  +        } else {
         1356  +          lt_count--;
         1357  +        }
         1358  +      }
         1359  +    }
         1360  +  }
         1361  +  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
         1362  +  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
         1363  +}'`
         1364  +  sys_lib_search_path_spec=`echo $lt_search_path_spec`
         1365  +else
         1366  +  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
         1367  +fi])
         1368  +need_lib_prefix=unknown
         1369  +hardcode_into_libs=no
         1370  +
         1371  +# when you set need_version to no, make sure it does not cause -set_version
         1372  +# flags to be left without arguments
         1373  +need_version=unknown
         1374  +
         1375  +case $host_os in
         1376  +aix3*)
         1377  +  version_type=linux
         1378  +  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
         1379  +  shlibpath_var=LIBPATH
         1380  +
         1381  +  # AIX 3 has no versioning support, so we append a major version to the name.
         1382  +  soname_spec='${libname}${release}${shared_ext}$major'
         1383  +  ;;
         1384  +
         1385  +aix[[4-9]]*)
         1386  +  version_type=linux
         1387  +  need_lib_prefix=no
         1388  +  need_version=no
         1389  +  hardcode_into_libs=yes
         1390  +  if test "$host_cpu" = ia64; then
         1391  +    # AIX 5 supports IA64
         1392  +    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
         1393  +    shlibpath_var=LD_LIBRARY_PATH
         1394  +  else
         1395  +    # With GCC up to 2.95.x, collect2 would create an import file
         1396  +    # for dependence libraries.  The import file would start with
         1397  +    # the line `#! .'.  This would cause the generated library to
         1398  +    # depend on `.', always an invalid library.  This was fixed in
         1399  +    # development snapshots of GCC prior to 3.0.
         1400  +    case $host_os in
         1401  +      aix4 | aix4.[[01]] | aix4.[[01]].*)
         1402  +      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
         1403  +	   echo ' yes '
         1404  +	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
         1405  +	:
         1406  +      else
         1407  +	can_build_shared=no
         1408  +      fi
         1409  +      ;;
         1410  +    esac
         1411  +    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
         1412  +    # soname into executable. Probably we can add versioning support to
         1413  +    # collect2, so additional links can be useful in future.
         1414  +    if test "$aix_use_runtimelinking" = yes; then
         1415  +      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
         1416  +      # instead of lib<name>.a to let people know that these are not
         1417  +      # typical AIX shared libraries.
         1418  +      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1419  +    else
         1420  +      # We preserve .a as extension for shared libraries through AIX4.2
         1421  +      # and later when we are not doing run time linking.
         1422  +      library_names_spec='${libname}${release}.a $libname.a'
         1423  +      soname_spec='${libname}${release}${shared_ext}$major'
         1424  +    fi
         1425  +    shlibpath_var=LIBPATH
         1426  +  fi
         1427  +  ;;
         1428  +
         1429  +amigaos*)
         1430  +  library_names_spec='$libname.ixlibrary $libname.a'
         1431  +  # Create ${libname}_ixlibrary.a entries in /sys/libs.
         1432  +  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
         1433  +  ;;
         1434  +
         1435  +beos*)
         1436  +  library_names_spec='${libname}${shared_ext}'
         1437  +  dynamic_linker="$host_os ld.so"
         1438  +  shlibpath_var=LIBRARY_PATH
         1439  +  ;;
         1440  +
         1441  +bsdi[[45]]*)
         1442  +  version_type=linux
         1443  +  need_version=no
         1444  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1445  +  soname_spec='${libname}${release}${shared_ext}$major'
         1446  +  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
         1447  +  shlibpath_var=LD_LIBRARY_PATH
         1448  +  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
         1449  +  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
         1450  +  # the default ld.so.conf also contains /usr/contrib/lib and
         1451  +  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
         1452  +  # libtool to hard-code these into programs
         1453  +  ;;
         1454  +
         1455  +cygwin* | mingw* | pw32*)
         1456  +  version_type=windows
         1457  +  shrext_cmds=".dll"
         1458  +  need_version=no
         1459  +  need_lib_prefix=no
         1460  +
         1461  +  case $GCC,$host_os in
         1462  +  yes,cygwin* | yes,mingw* | yes,pw32*)
         1463  +    library_names_spec='$libname.dll.a'
         1464  +    # DLL is installed to $(libdir)/../bin by postinstall_cmds
         1465  +    postinstall_cmds='base_file=`basename \${file}`~
         1466  +      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
         1467  +      dldir=$destdir/`dirname \$dlpath`~
         1468  +      test -d \$dldir || mkdir -p \$dldir~
         1469  +      $install_prog $dir/$dlname \$dldir/$dlname~
         1470  +      chmod a+x \$dldir/$dlname'
         1471  +    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
         1472  +      dlpath=$dir/\$dldll~
         1473  +       $rm \$dlpath'
         1474  +    shlibpath_overrides_runpath=yes
         1475  +
         1476  +    case $host_os in
         1477  +    cygwin*)
         1478  +      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
         1479  +      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
         1480  +      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
         1481  +      ;;
         1482  +    mingw*)
         1483  +      # MinGW DLLs use traditional 'lib' prefix
         1484  +      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
         1485  +      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
         1486  +      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
         1487  +        # It is most probably a Windows format PATH printed by
         1488  +        # mingw gcc, but we are running on Cygwin. Gcc prints its search
         1489  +        # path with ; separators, and with drive letters. We can handle the
         1490  +        # drive letters (cygwin fileutils understands them), so leave them,
         1491  +        # especially as we might pass files found there to a mingw objdump,
         1492  +        # which wouldn't understand a cygwinified path. Ahh.
         1493  +        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
         1494  +      else
         1495  +        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
         1496  +      fi
         1497  +      ;;
         1498  +    pw32*)
         1499  +      # pw32 DLLs use 'pw' prefix rather than 'lib'
         1500  +      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
         1501  +      ;;
         1502  +    esac
         1503  +    ;;
         1504  +
         1505  +  *)
         1506  +    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
         1507  +    ;;
         1508  +  esac
         1509  +  dynamic_linker='Win32 ld.exe'
         1510  +  # FIXME: first we should search . and the directory the executable is in
         1511  +  shlibpath_var=PATH
         1512  +  ;;
         1513  +
         1514  +darwin* | rhapsody*)
         1515  +  dynamic_linker="$host_os dyld"
         1516  +  version_type=darwin
         1517  +  need_lib_prefix=no
         1518  +  need_version=no
         1519  +  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
         1520  +  soname_spec='${libname}${release}${major}$shared_ext'
         1521  +  shlibpath_overrides_runpath=yes
         1522  +  shlibpath_var=DYLD_LIBRARY_PATH
         1523  +  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
         1524  +  m4_if([$1], [],[
         1525  +  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
         1526  +  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
         1527  +  ;;
         1528  +
         1529  +dgux*)
         1530  +  version_type=linux
         1531  +  need_lib_prefix=no
         1532  +  need_version=no
         1533  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
         1534  +  soname_spec='${libname}${release}${shared_ext}$major'
         1535  +  shlibpath_var=LD_LIBRARY_PATH
         1536  +  ;;
         1537  +
         1538  +freebsd1*)
         1539  +  dynamic_linker=no
         1540  +  ;;
         1541  +
         1542  +freebsd* | dragonfly*)
         1543  +  # DragonFly does not have aout.  When/if they implement a new
         1544  +  # versioning mechanism, adjust this.
         1545  +  if test -x /usr/bin/objformat; then
         1546  +    objformat=`/usr/bin/objformat`
         1547  +  else
         1548  +    case $host_os in
         1549  +    freebsd[[123]]*) objformat=aout ;;
         1550  +    *) objformat=elf ;;
         1551  +    esac
         1552  +  fi
         1553  +  version_type=freebsd-$objformat
         1554  +  case $version_type in
         1555  +    freebsd-elf*)
         1556  +      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
         1557  +      need_version=no
         1558  +      need_lib_prefix=no
         1559  +      ;;
         1560  +    freebsd-*)
         1561  +      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
         1562  +      need_version=yes
         1563  +      ;;
         1564  +  esac
         1565  +  shlibpath_var=LD_LIBRARY_PATH
         1566  +  case $host_os in
         1567  +  freebsd2*)
         1568  +    shlibpath_overrides_runpath=yes
         1569  +    ;;
         1570  +  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
         1571  +    shlibpath_overrides_runpath=yes
         1572  +    hardcode_into_libs=yes
         1573  +    ;;
         1574  +  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
         1575  +  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
         1576  +    shlibpath_overrides_runpath=no
         1577  +    hardcode_into_libs=yes
         1578  +    ;;
         1579  +  *) # from 4.6 on, and DragonFly
         1580  +    shlibpath_overrides_runpath=yes
         1581  +    hardcode_into_libs=yes
         1582  +    ;;
         1583  +  esac
         1584  +  ;;
         1585  +
         1586  +gnu*)
         1587  +  version_type=linux
         1588  +  need_lib_prefix=no
         1589  +  need_version=no
         1590  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
         1591  +  soname_spec='${libname}${release}${shared_ext}$major'
         1592  +  shlibpath_var=LD_LIBRARY_PATH
         1593  +  hardcode_into_libs=yes
         1594  +  ;;
         1595  +
         1596  +hpux9* | hpux10* | hpux11*)
         1597  +  # Give a soname corresponding to the major version so that dld.sl refuses to
         1598  +  # link against other versions.
         1599  +  version_type=sunos
         1600  +  need_lib_prefix=no
         1601  +  need_version=no
         1602  +  case $host_cpu in
         1603  +  ia64*)
         1604  +    shrext_cmds='.so'
         1605  +    hardcode_into_libs=yes
         1606  +    dynamic_linker="$host_os dld.so"
         1607  +    shlibpath_var=LD_LIBRARY_PATH
         1608  +    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
         1609  +    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1610  +    soname_spec='${libname}${release}${shared_ext}$major'
         1611  +    if test "X$HPUX_IA64_MODE" = X32; then
         1612  +      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
         1613  +    else
         1614  +      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
         1615  +    fi
         1616  +    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
         1617  +    ;;
         1618  +   hppa*64*)
         1619  +     shrext_cmds='.sl'
         1620  +     hardcode_into_libs=yes
         1621  +     dynamic_linker="$host_os dld.sl"
         1622  +     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
         1623  +     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
         1624  +     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1625  +     soname_spec='${libname}${release}${shared_ext}$major'
         1626  +     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
         1627  +     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
         1628  +     ;;
         1629  +   *)
         1630  +    shrext_cmds='.sl'
         1631  +    dynamic_linker="$host_os dld.sl"
         1632  +    shlibpath_var=SHLIB_PATH
         1633  +    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
         1634  +    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1635  +    soname_spec='${libname}${release}${shared_ext}$major'
         1636  +    ;;
         1637  +  esac
         1638  +  # HP-UX runs *really* slowly unless shared libraries are mode 555.
         1639  +  postinstall_cmds='chmod 555 $lib'
         1640  +  ;;
         1641  +
         1642  +interix[[3-9]]*)
         1643  +  version_type=linux
         1644  +  need_lib_prefix=no
         1645  +  need_version=no
         1646  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
         1647  +  soname_spec='${libname}${release}${shared_ext}$major'
         1648  +  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
         1649  +  shlibpath_var=LD_LIBRARY_PATH
         1650  +  shlibpath_overrides_runpath=no
         1651  +  hardcode_into_libs=yes
         1652  +  ;;
         1653  +
         1654  +irix5* | irix6* | nonstopux*)
         1655  +  case $host_os in
         1656  +    nonstopux*) version_type=nonstopux ;;
         1657  +    *)
         1658  +	if test "$lt_cv_prog_gnu_ld" = yes; then
         1659  +		version_type=linux
         1660  +	else
         1661  +		version_type=irix
         1662  +	fi ;;
         1663  +  esac
         1664  +  need_lib_prefix=no
         1665  +  need_version=no
         1666  +  soname_spec='${libname}${release}${shared_ext}$major'
         1667  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
         1668  +  case $host_os in
         1669  +  irix5* | nonstopux*)
         1670  +    libsuff= shlibsuff=
         1671  +    ;;
         1672  +  *)
         1673  +    case $LD in # libtool.m4 will add one of these switches to LD
         1674  +    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
         1675  +      libsuff= shlibsuff= libmagic=32-bit;;
         1676  +    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
         1677  +      libsuff=32 shlibsuff=N32 libmagic=N32;;
         1678  +    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
         1679  +      libsuff=64 shlibsuff=64 libmagic=64-bit;;
         1680  +    *) libsuff= shlibsuff= libmagic=never-match;;
         1681  +    esac
         1682  +    ;;
         1683  +  esac
         1684  +  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
         1685  +  shlibpath_overrides_runpath=no
         1686  +  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
         1687  +  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
         1688  +  hardcode_into_libs=yes
         1689  +  ;;
         1690  +
         1691  +# No shared lib support for Linux oldld, aout, or coff.
         1692  +linux*oldld* | linux*aout* | linux*coff*)
         1693  +  dynamic_linker=no
         1694  +  ;;
         1695  +
         1696  +# This must be Linux ELF.
         1697  +linux* | k*bsd*-gnu)
         1698  +  version_type=linux
         1699  +  need_lib_prefix=no
         1700  +  need_version=no
         1701  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1702  +  soname_spec='${libname}${release}${shared_ext}$major'
         1703  +  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
         1704  +  shlibpath_var=LD_LIBRARY_PATH
         1705  +  shlibpath_overrides_runpath=no
         1706  +  # This implies no fast_install, which is unacceptable.
         1707  +  # Some rework will be needed to allow for fast_install
         1708  +  # before this can be enabled.
         1709  +  hardcode_into_libs=yes
         1710  +
         1711  +  # Append ld.so.conf contents to the search path
         1712  +  if test -f /etc/ld.so.conf; then
         1713  +    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
         1714  +    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
         1715  +  fi
         1716  +
         1717  +  # We used to test for /lib/ld.so.1 and disable shared libraries on
         1718  +  # powerpc, because MkLinux only supported shared libraries with the
         1719  +  # GNU dynamic linker.  Since this was broken with cross compilers,
         1720  +  # most powerpc-linux boxes support dynamic linking these days and
         1721  +  # people can always --disable-shared, the test was removed, and we
         1722  +  # assume the GNU/Linux dynamic linker is in use.
         1723  +  dynamic_linker='GNU/Linux ld.so'
         1724  +  ;;
         1725  +
         1726  +netbsdelf*-gnu)
         1727  +  version_type=linux
         1728  +  need_lib_prefix=no
         1729  +  need_version=no
         1730  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
         1731  +  soname_spec='${libname}${release}${shared_ext}$major'
         1732  +  shlibpath_var=LD_LIBRARY_PATH
         1733  +  shlibpath_overrides_runpath=no
         1734  +  hardcode_into_libs=yes
         1735  +  dynamic_linker='NetBSD ld.elf_so'
         1736  +  ;;
         1737  +
         1738  +netbsd*)
         1739  +  version_type=sunos
         1740  +  need_lib_prefix=no
         1741  +  need_version=no
         1742  +  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
         1743  +    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
         1744  +    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
         1745  +    dynamic_linker='NetBSD (a.out) ld.so'
         1746  +  else
         1747  +    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
         1748  +    soname_spec='${libname}${release}${shared_ext}$major'
         1749  +    dynamic_linker='NetBSD ld.elf_so'
         1750  +  fi
         1751  +  shlibpath_var=LD_LIBRARY_PATH
         1752  +  shlibpath_overrides_runpath=yes
         1753  +  hardcode_into_libs=yes
         1754  +  ;;
         1755  +
         1756  +newsos6)
         1757  +  version_type=linux
         1758  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1759  +  shlibpath_var=LD_LIBRARY_PATH
         1760  +  shlibpath_overrides_runpath=yes
         1761  +  ;;
         1762  +
         1763  +nto-qnx*)
         1764  +  version_type=linux
         1765  +  need_lib_prefix=no
         1766  +  need_version=no
         1767  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1768  +  soname_spec='${libname}${release}${shared_ext}$major'
         1769  +  shlibpath_var=LD_LIBRARY_PATH
         1770  +  shlibpath_overrides_runpath=yes
         1771  +  ;;
         1772  +
         1773  +openbsd*)
         1774  +  version_type=sunos
         1775  +  sys_lib_dlsearch_path_spec="/usr/lib"
         1776  +  need_lib_prefix=no
         1777  +  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
         1778  +  case $host_os in
         1779  +    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
         1780  +    *)                         need_version=no  ;;
         1781  +  esac
         1782  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
         1783  +  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
         1784  +  shlibpath_var=LD_LIBRARY_PATH
         1785  +  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         1786  +    case $host_os in
         1787  +      openbsd2.[[89]] | openbsd2.[[89]].*)
         1788  +	shlibpath_overrides_runpath=no
         1789  +	;;
         1790  +      *)
         1791  +	shlibpath_overrides_runpath=yes
         1792  +	;;
         1793  +      esac
         1794  +  else
         1795  +    shlibpath_overrides_runpath=yes
         1796  +  fi
         1797  +  ;;
         1798  +
         1799  +os2*)
         1800  +  libname_spec='$name'
         1801  +  shrext_cmds=".dll"
         1802  +  need_lib_prefix=no
         1803  +  library_names_spec='$libname${shared_ext} $libname.a'
         1804  +  dynamic_linker='OS/2 ld.exe'
         1805  +  shlibpath_var=LIBPATH
         1806  +  ;;
         1807  +
         1808  +osf3* | osf4* | osf5*)
         1809  +  version_type=osf
         1810  +  need_lib_prefix=no
         1811  +  need_version=no
         1812  +  soname_spec='${libname}${release}${shared_ext}$major'
         1813  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1814  +  shlibpath_var=LD_LIBRARY_PATH
         1815  +  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
         1816  +  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
         1817  +  ;;
         1818  +
         1819  +rdos*)
         1820  +  dynamic_linker=no
         1821  +  ;;
         1822  +
         1823  +solaris*)
         1824  +  version_type=linux
         1825  +  need_lib_prefix=no
         1826  +  need_version=no
         1827  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1828  +  soname_spec='${libname}${release}${shared_ext}$major'
         1829  +  shlibpath_var=LD_LIBRARY_PATH
         1830  +  shlibpath_overrides_runpath=yes
         1831  +  hardcode_into_libs=yes
         1832  +  # ldd complains unless libraries are executable
         1833  +  postinstall_cmds='chmod +x $lib'
         1834  +  ;;
         1835  +
         1836  +sunos4*)
         1837  +  version_type=sunos
         1838  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
         1839  +  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
         1840  +  shlibpath_var=LD_LIBRARY_PATH
         1841  +  shlibpath_overrides_runpath=yes
         1842  +  if test "$with_gnu_ld" = yes; then
         1843  +    need_lib_prefix=no
         1844  +  fi
         1845  +  need_version=yes
         1846  +  ;;
         1847  +
         1848  +sysv4 | sysv4.3*)
         1849  +  version_type=linux
         1850  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1851  +  soname_spec='${libname}${release}${shared_ext}$major'
         1852  +  shlibpath_var=LD_LIBRARY_PATH
         1853  +  case $host_vendor in
         1854  +    sni)
         1855  +      shlibpath_overrides_runpath=no
         1856  +      need_lib_prefix=no
         1857  +      export_dynamic_flag_spec='${wl}-Blargedynsym'
         1858  +      runpath_var=LD_RUN_PATH
         1859  +      ;;
         1860  +    siemens)
         1861  +      need_lib_prefix=no
         1862  +      ;;
         1863  +    motorola)
         1864  +      need_lib_prefix=no
         1865  +      need_version=no
         1866  +      shlibpath_overrides_runpath=no
         1867  +      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
         1868  +      ;;
         1869  +  esac
         1870  +  ;;
         1871  +
         1872  +sysv4*MP*)
         1873  +  if test -d /usr/nec ;then
         1874  +    version_type=linux
         1875  +    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
         1876  +    soname_spec='$libname${shared_ext}.$major'
         1877  +    shlibpath_var=LD_LIBRARY_PATH
         1878  +  fi
         1879  +  ;;
         1880  +
         1881  +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
         1882  +  version_type=freebsd-elf
         1883  +  need_lib_prefix=no
         1884  +  need_version=no
         1885  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
         1886  +  soname_spec='${libname}${release}${shared_ext}$major'
         1887  +  shlibpath_var=LD_LIBRARY_PATH
         1888  +  hardcode_into_libs=yes
         1889  +  if test "$with_gnu_ld" = yes; then
         1890  +    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
         1891  +    shlibpath_overrides_runpath=no
         1892  +  else
         1893  +    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
         1894  +    shlibpath_overrides_runpath=yes
         1895  +    case $host_os in
         1896  +      sco3.2v5*)
         1897  +        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
         1898  +	;;
         1899  +    esac
         1900  +  fi
         1901  +  sys_lib_dlsearch_path_spec='/usr/lib'
         1902  +  ;;
         1903  +
         1904  +uts4*)
         1905  +  version_type=linux
         1906  +  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1907  +  soname_spec='${libname}${release}${shared_ext}$major'
         1908  +  shlibpath_var=LD_LIBRARY_PATH
         1909  +  ;;
         1910  +
         1911  +*)
         1912  +  dynamic_linker=no
         1913  +  ;;
         1914  +esac
         1915  +AC_MSG_RESULT([$dynamic_linker])
         1916  +test "$dynamic_linker" = no && can_build_shared=no
         1917  +
         1918  +AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
         1919  +[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
         1920  +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
         1921  +AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
         1922  +[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
         1923  +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
         1924  +
         1925  +variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
         1926  +if test "$GCC" = yes; then
         1927  +  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
         1928  +fi
         1929  +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
         1930  +
         1931  +
         1932  +# _LT_AC_TAGCONFIG
         1933  +# ----------------
         1934  +AC_DEFUN([_LT_AC_TAGCONFIG],
         1935  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         1936  +AC_ARG_WITH([tags],
         1937  +    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
         1938  +        [include additional configurations @<:@automatic@:>@])],
         1939  +    [tagnames="$withval"])
         1940  +
         1941  +if test -f "$ltmain" && test -n "$tagnames"; then
         1942  +  if test ! -f "${ofile}"; then
         1943  +    AC_MSG_WARN([output file `$ofile' does not exist])
         1944  +  fi
         1945  +
         1946  +  if test -z "$LTCC"; then
         1947  +    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
         1948  +    if test -z "$LTCC"; then
         1949  +      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
         1950  +    else
         1951  +      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
         1952  +    fi
         1953  +  fi
         1954  +  if test -z "$LTCFLAGS"; then
         1955  +    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
         1956  +  fi
         1957  +
         1958  +  # Extract list of available tagged configurations in $ofile.
         1959  +  # Note that this assumes the entire list is on one line.
         1960  +  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
         1961  +
         1962  +  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         1963  +  for tagname in $tagnames; do
         1964  +    IFS="$lt_save_ifs"
         1965  +    # Check whether tagname contains only valid characters
         1966  +    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
         1967  +    "") ;;
         1968  +    *)  AC_MSG_ERROR([invalid tag name: $tagname])
         1969  +	;;
         1970  +    esac
         1971  +
         1972  +    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
         1973  +    then
         1974  +      AC_MSG_ERROR([tag name \"$tagname\" already exists])
         1975  +    fi
         1976  +
         1977  +    # Update the list of available tags.
         1978  +    if test -n "$tagname"; then
         1979  +      echo appending configuration tag \"$tagname\" to $ofile
         1980  +
         1981  +      case $tagname in
         1982  +      CXX)
         1983  +	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
         1984  +	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
         1985  +	    (test "X$CXX" != "Xg++"))) ; then
         1986  +	  AC_LIBTOOL_LANG_CXX_CONFIG
         1987  +	else
         1988  +	  tagname=""
         1989  +	fi
         1990  +	;;
         1991  +
         1992  +      F77)
         1993  +	if test -n "$F77" && test "X$F77" != "Xno"; then
         1994  +	  AC_LIBTOOL_LANG_F77_CONFIG
         1995  +	else
         1996  +	  tagname=""
         1997  +	fi
         1998  +	;;
         1999  +
         2000  +      GCJ)
         2001  +	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
         2002  +	  AC_LIBTOOL_LANG_GCJ_CONFIG
         2003  +	else
         2004  +	  tagname=""
         2005  +	fi
         2006  +	;;
         2007  +
         2008  +      RC)
         2009  +	AC_LIBTOOL_LANG_RC_CONFIG
         2010  +	;;
         2011  +
         2012  +      *)
         2013  +	AC_MSG_ERROR([Unsupported tag name: $tagname])
         2014  +	;;
         2015  +      esac
         2016  +
         2017  +      # Append the new tag name to the list of available tags.
         2018  +      if test -n "$tagname" ; then
         2019  +      available_tags="$available_tags $tagname"
         2020  +    fi
         2021  +    fi
         2022  +  done
         2023  +  IFS="$lt_save_ifs"
         2024  +
         2025  +  # Now substitute the updated list of available tags.
         2026  +  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
         2027  +    mv "${ofile}T" "$ofile"
         2028  +    chmod +x "$ofile"
         2029  +  else
         2030  +    rm -f "${ofile}T"
         2031  +    AC_MSG_ERROR([unable to update list of available tagged configurations.])
         2032  +  fi
         2033  +fi
         2034  +])# _LT_AC_TAGCONFIG
         2035  +
         2036  +
         2037  +# AC_LIBTOOL_DLOPEN
         2038  +# -----------------
         2039  +# enable checks for dlopen support
         2040  +AC_DEFUN([AC_LIBTOOL_DLOPEN],
         2041  + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
         2042  +])# AC_LIBTOOL_DLOPEN
         2043  +
         2044  +
         2045  +# AC_LIBTOOL_WIN32_DLL
         2046  +# --------------------
         2047  +# declare package support for building win32 DLLs
         2048  +AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
         2049  +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
         2050  +])# AC_LIBTOOL_WIN32_DLL
         2051  +
         2052  +
         2053  +# AC_ENABLE_SHARED([DEFAULT])
         2054  +# ---------------------------
         2055  +# implement the --enable-shared flag
         2056  +# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
         2057  +AC_DEFUN([AC_ENABLE_SHARED],
         2058  +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
         2059  +AC_ARG_ENABLE([shared],
         2060  +    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
         2061  +	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
         2062  +    [p=${PACKAGE-default}
         2063  +    case $enableval in
         2064  +    yes) enable_shared=yes ;;
         2065  +    no) enable_shared=no ;;
         2066  +    *)
         2067  +      enable_shared=no
         2068  +      # Look at the argument we got.  We use all the common list separators.
         2069  +      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         2070  +      for pkg in $enableval; do
         2071  +	IFS="$lt_save_ifs"
         2072  +	if test "X$pkg" = "X$p"; then
         2073  +	  enable_shared=yes
         2074  +	fi
         2075  +      done
         2076  +      IFS="$lt_save_ifs"
         2077  +      ;;
         2078  +    esac],
         2079  +    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
         2080  +])# AC_ENABLE_SHARED
         2081  +
         2082  +
         2083  +# AC_DISABLE_SHARED
         2084  +# -----------------
         2085  +# set the default shared flag to --disable-shared
         2086  +AC_DEFUN([AC_DISABLE_SHARED],
         2087  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2088  +AC_ENABLE_SHARED(no)
         2089  +])# AC_DISABLE_SHARED
         2090  +
         2091  +
         2092  +# AC_ENABLE_STATIC([DEFAULT])
         2093  +# ---------------------------
         2094  +# implement the --enable-static flag
         2095  +# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
         2096  +AC_DEFUN([AC_ENABLE_STATIC],
         2097  +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
         2098  +AC_ARG_ENABLE([static],
         2099  +    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
         2100  +	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
         2101  +    [p=${PACKAGE-default}
         2102  +    case $enableval in
         2103  +    yes) enable_static=yes ;;
         2104  +    no) enable_static=no ;;
         2105  +    *)
         2106  +     enable_static=no
         2107  +      # Look at the argument we got.  We use all the common list separators.
         2108  +      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         2109  +      for pkg in $enableval; do
         2110  +	IFS="$lt_save_ifs"
         2111  +	if test "X$pkg" = "X$p"; then
         2112  +	  enable_static=yes
         2113  +	fi
         2114  +      done
         2115  +      IFS="$lt_save_ifs"
         2116  +      ;;
         2117  +    esac],
         2118  +    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
         2119  +])# AC_ENABLE_STATIC
         2120  +
         2121  +
         2122  +# AC_DISABLE_STATIC
         2123  +# -----------------
         2124  +# set the default static flag to --disable-static
         2125  +AC_DEFUN([AC_DISABLE_STATIC],
         2126  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2127  +AC_ENABLE_STATIC(no)
         2128  +])# AC_DISABLE_STATIC
         2129  +
         2130  +
         2131  +# AC_ENABLE_FAST_INSTALL([DEFAULT])
         2132  +# ---------------------------------
         2133  +# implement the --enable-fast-install flag
         2134  +# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
         2135  +AC_DEFUN([AC_ENABLE_FAST_INSTALL],
         2136  +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
         2137  +AC_ARG_ENABLE([fast-install],
         2138  +    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
         2139  +    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
         2140  +    [p=${PACKAGE-default}
         2141  +    case $enableval in
         2142  +    yes) enable_fast_install=yes ;;
         2143  +    no) enable_fast_install=no ;;
         2144  +    *)
         2145  +      enable_fast_install=no
         2146  +      # Look at the argument we got.  We use all the common list separators.
         2147  +      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         2148  +      for pkg in $enableval; do
         2149  +	IFS="$lt_save_ifs"
         2150  +	if test "X$pkg" = "X$p"; then
         2151  +	  enable_fast_install=yes
         2152  +	fi
         2153  +      done
         2154  +      IFS="$lt_save_ifs"
         2155  +      ;;
         2156  +    esac],
         2157  +    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
         2158  +])# AC_ENABLE_FAST_INSTALL
         2159  +
         2160  +
         2161  +# AC_DISABLE_FAST_INSTALL
         2162  +# -----------------------
         2163  +# set the default to --disable-fast-install
         2164  +AC_DEFUN([AC_DISABLE_FAST_INSTALL],
         2165  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2166  +AC_ENABLE_FAST_INSTALL(no)
         2167  +])# AC_DISABLE_FAST_INSTALL
         2168  +
         2169  +
         2170  +# AC_LIBTOOL_PICMODE([MODE])
         2171  +# --------------------------
         2172  +# implement the --with-pic flag
         2173  +# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
         2174  +AC_DEFUN([AC_LIBTOOL_PICMODE],
         2175  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2176  +pic_mode=ifelse($#,1,$1,default)
         2177  +])# AC_LIBTOOL_PICMODE
         2178  +
         2179  +
         2180  +# AC_PROG_EGREP
         2181  +# -------------
         2182  +# This is predefined starting with Autoconf 2.54, so this conditional
         2183  +# definition can be removed once we require Autoconf 2.54 or later.
         2184  +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
         2185  +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
         2186  +   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
         2187  +    then ac_cv_prog_egrep='grep -E'
         2188  +    else ac_cv_prog_egrep='egrep'
         2189  +    fi])
         2190  + EGREP=$ac_cv_prog_egrep
         2191  + AC_SUBST([EGREP])
         2192  +])])
         2193  +
         2194  +
         2195  +# AC_PATH_TOOL_PREFIX
         2196  +# -------------------
         2197  +# find a file program which can recognize shared library
         2198  +AC_DEFUN([AC_PATH_TOOL_PREFIX],
         2199  +[AC_REQUIRE([AC_PROG_EGREP])dnl
         2200  +AC_MSG_CHECKING([for $1])
         2201  +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
         2202  +[case $MAGIC_CMD in
         2203  +[[\\/*] |  ?:[\\/]*])
         2204  +  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
         2205  +  ;;
         2206  +*)
         2207  +  lt_save_MAGIC_CMD="$MAGIC_CMD"
         2208  +  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
         2209  +dnl $ac_dummy forces splitting on constant user-supplied paths.
         2210  +dnl POSIX.2 word splitting is done only on the output of word expansions,
         2211  +dnl not every word.  This closes a longstanding sh security hole.
         2212  +  ac_dummy="ifelse([$2], , $PATH, [$2])"
         2213  +  for ac_dir in $ac_dummy; do
         2214  +    IFS="$lt_save_ifs"
         2215  +    test -z "$ac_dir" && ac_dir=.
         2216  +    if test -f $ac_dir/$1; then
         2217  +      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
         2218  +      if test -n "$file_magic_test_file"; then
         2219  +	case $deplibs_check_method in
         2220  +	"file_magic "*)
         2221  +	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
         2222  +	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
         2223  +	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
         2224  +	    $EGREP "$file_magic_regex" > /dev/null; then
         2225  +	    :
         2226  +	  else
         2227  +	    cat <<EOF 1>&2
         2228  +
         2229  +*** Warning: the command libtool uses to detect shared libraries,
         2230  +*** $file_magic_cmd, produces output that libtool cannot recognize.
         2231  +*** The result is that libtool may fail to recognize shared libraries
         2232  +*** as such.  This will affect the creation of libtool libraries that
         2233  +*** depend on shared libraries, but programs linked with such libtool
         2234  +*** libraries will work regardless of this problem.  Nevertheless, you
         2235  +*** may want to report the problem to your system manager and/or to
         2236  +*** bug-libtool@gnu.org
         2237  +
         2238  +EOF
         2239  +	  fi ;;
         2240  +	esac
         2241  +      fi
         2242  +      break
         2243  +    fi
         2244  +  done
         2245  +  IFS="$lt_save_ifs"
         2246  +  MAGIC_CMD="$lt_save_MAGIC_CMD"
         2247  +  ;;
         2248  +esac])
         2249  +MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
         2250  +if test -n "$MAGIC_CMD"; then
         2251  +  AC_MSG_RESULT($MAGIC_CMD)
         2252  +else
         2253  +  AC_MSG_RESULT(no)
         2254  +fi
         2255  +])# AC_PATH_TOOL_PREFIX
         2256  +
         2257  +
         2258  +# AC_PATH_MAGIC
         2259  +# -------------
         2260  +# find a file program which can recognize a shared library
         2261  +AC_DEFUN([AC_PATH_MAGIC],
         2262  +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
         2263  +if test -z "$lt_cv_path_MAGIC_CMD"; then
         2264  +  if test -n "$ac_tool_prefix"; then
         2265  +    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
         2266  +  else
         2267  +    MAGIC_CMD=:
         2268  +  fi
         2269  +fi
         2270  +])# AC_PATH_MAGIC
         2271  +
         2272  +
         2273  +# AC_PROG_LD
         2274  +# ----------
         2275  +# find the pathname to the GNU or non-GNU linker
         2276  +AC_DEFUN([AC_PROG_LD],
         2277  +[AC_ARG_WITH([gnu-ld],
         2278  +    [AC_HELP_STRING([--with-gnu-ld],
         2279  +	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
         2280  +    [test "$withval" = no || with_gnu_ld=yes],
         2281  +    [with_gnu_ld=no])
         2282  +AC_REQUIRE([LT_AC_PROG_SED])dnl
         2283  +AC_REQUIRE([AC_PROG_CC])dnl
         2284  +AC_REQUIRE([AC_CANONICAL_HOST])dnl
         2285  +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
         2286  +ac_prog=ld
         2287  +if test "$GCC" = yes; then
         2288  +  # Check if gcc -print-prog-name=ld gives a path.
         2289  +  AC_MSG_CHECKING([for ld used by $CC])
         2290  +  case $host in
         2291  +  *-*-mingw*)
         2292  +    # gcc leaves a trailing carriage return which upsets mingw
         2293  +    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
         2294  +  *)
         2295  +    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
         2296  +  esac
         2297  +  case $ac_prog in
         2298  +    # Accept absolute paths.
         2299  +    [[\\/]]* | ?:[[\\/]]*)
         2300  +      re_direlt='/[[^/]][[^/]]*/\.\./'
         2301  +      # Canonicalize the pathname of ld
         2302  +      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
         2303  +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
         2304  +	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
         2305  +      done
         2306  +      test -z "$LD" && LD="$ac_prog"
         2307  +      ;;
         2308  +  "")
         2309  +    # If it fails, then pretend we aren't using GCC.
         2310  +    ac_prog=ld
         2311  +    ;;
         2312  +  *)
         2313  +    # If it is relative, then search for the first ld in PATH.
         2314  +    with_gnu_ld=unknown
         2315  +    ;;
         2316  +  esac
         2317  +elif test "$with_gnu_ld" = yes; then
         2318  +  AC_MSG_CHECKING([for GNU ld])
         2319  +else
         2320  +  AC_MSG_CHECKING([for non-GNU ld])
         2321  +fi
         2322  +AC_CACHE_VAL(lt_cv_path_LD,
         2323  +[if test -z "$LD"; then
         2324  +  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
         2325  +  for ac_dir in $PATH; do
         2326  +    IFS="$lt_save_ifs"
         2327  +    test -z "$ac_dir" && ac_dir=.
         2328  +    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
         2329  +      lt_cv_path_LD="$ac_dir/$ac_prog"
         2330  +      # Check to see if the program is GNU ld.  I'd rather use --version,
         2331  +      # but apparently some variants of GNU ld only accept -v.
         2332  +      # Break only if it was the GNU/non-GNU ld that we prefer.
         2333  +      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
         2334  +      *GNU* | *'with BFD'*)
         2335  +	test "$with_gnu_ld" != no && break
         2336  +	;;
         2337  +      *)
         2338  +	test "$with_gnu_ld" != yes && break
         2339  +	;;
         2340  +      esac
         2341  +    fi
         2342  +  done
         2343  +  IFS="$lt_save_ifs"
         2344  +else
         2345  +  lt_cv_path_LD="$LD" # Let the user override the test with a path.
         2346  +fi])
         2347  +LD="$lt_cv_path_LD"
         2348  +if test -n "$LD"; then
         2349  +  AC_MSG_RESULT($LD)
         2350  +else
         2351  +  AC_MSG_RESULT(no)
         2352  +fi
         2353  +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
         2354  +AC_PROG_LD_GNU
         2355  +])# AC_PROG_LD
         2356  +
         2357  +
         2358  +# AC_PROG_LD_GNU
         2359  +# --------------
         2360  +AC_DEFUN([AC_PROG_LD_GNU],
         2361  +[AC_REQUIRE([AC_PROG_EGREP])dnl
         2362  +AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
         2363  +[# I'd rather use --version here, but apparently some GNU lds only accept -v.
         2364  +case `$LD -v 2>&1 </dev/null` in
         2365  +*GNU* | *'with BFD'*)
         2366  +  lt_cv_prog_gnu_ld=yes
         2367  +  ;;
         2368  +*)
         2369  +  lt_cv_prog_gnu_ld=no
         2370  +  ;;
         2371  +esac])
         2372  +with_gnu_ld=$lt_cv_prog_gnu_ld
         2373  +])# AC_PROG_LD_GNU
         2374  +
         2375  +
         2376  +# AC_PROG_LD_RELOAD_FLAG
         2377  +# ----------------------
         2378  +# find reload flag for linker
         2379  +#   -- PORTME Some linkers may need a different reload flag.
         2380  +AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
         2381  +[AC_CACHE_CHECK([for $LD option to reload object files],
         2382  +  lt_cv_ld_reload_flag,
         2383  +  [lt_cv_ld_reload_flag='-r'])
         2384  +reload_flag=$lt_cv_ld_reload_flag
         2385  +case $reload_flag in
         2386  +"" | " "*) ;;
         2387  +*) reload_flag=" $reload_flag" ;;
         2388  +esac
         2389  +reload_cmds='$LD$reload_flag -o $output$reload_objs'
         2390  +case $host_os in
         2391  +  darwin*)
         2392  +    if test "$GCC" = yes; then
         2393  +      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
         2394  +    else
         2395  +      reload_cmds='$LD$reload_flag -o $output$reload_objs'
         2396  +    fi
         2397  +    ;;
         2398  +esac
         2399  +])# AC_PROG_LD_RELOAD_FLAG
         2400  +
         2401  +
         2402  +# AC_DEPLIBS_CHECK_METHOD
         2403  +# -----------------------
         2404  +# how to check for library dependencies
         2405  +#  -- PORTME fill in with the dynamic library characteristics
         2406  +AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
         2407  +[AC_CACHE_CHECK([how to recognize dependent libraries],
         2408  +lt_cv_deplibs_check_method,
         2409  +[lt_cv_file_magic_cmd='$MAGIC_CMD'
         2410  +lt_cv_file_magic_test_file=
         2411  +lt_cv_deplibs_check_method='unknown'
         2412  +# Need to set the preceding variable on all platforms that support
         2413  +# interlibrary dependencies.
         2414  +# 'none' -- dependencies not supported.
         2415  +# `unknown' -- same as none, but documents that we really don't know.
         2416  +# 'pass_all' -- all dependencies passed with no checks.
         2417  +# 'test_compile' -- check by making test program.
         2418  +# 'file_magic [[regex]]' -- check by looking for files in library path
         2419  +# which responds to the $file_magic_cmd with a given extended regex.
         2420  +# If you have `file' or equivalent on your system and you're not sure
         2421  +# whether `pass_all' will *always* work, you probably want this one.
         2422  +
         2423  +case $host_os in
         2424  +aix[[4-9]]*)
         2425  +  lt_cv_deplibs_check_method=pass_all
         2426  +  ;;
         2427  +
         2428  +beos*)
         2429  +  lt_cv_deplibs_check_method=pass_all
         2430  +  ;;
         2431  +
         2432  +bsdi[[45]]*)
         2433  +  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
         2434  +  lt_cv_file_magic_cmd='/usr/bin/file -L'
         2435  +  lt_cv_file_magic_test_file=/shlib/libc.so
         2436  +  ;;
         2437  +
         2438  +cygwin*)
         2439  +  # func_win32_libid is a shell function defined in ltmain.sh
         2440  +  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
         2441  +  lt_cv_file_magic_cmd='func_win32_libid'
         2442  +  ;;
         2443  +
         2444  +mingw* | pw32*)
         2445  +  # Base MSYS/MinGW do not provide the 'file' command needed by
         2446  +  # func_win32_libid shell function, so use a weaker test based on 'objdump',
         2447  +  # unless we find 'file', for example because we are cross-compiling.
         2448  +  if ( file / ) >/dev/null 2>&1; then
         2449  +    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
         2450  +    lt_cv_file_magic_cmd='func_win32_libid'
         2451  +  else
         2452  +    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
         2453  +    lt_cv_file_magic_cmd='$OBJDUMP -f'
         2454  +  fi
         2455  +  ;;
         2456  +
         2457  +darwin* | rhapsody*)
         2458  +  lt_cv_deplibs_check_method=pass_all
         2459  +  ;;
         2460  +
         2461  +freebsd* | dragonfly*)
         2462  +  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
         2463  +    case $host_cpu in
         2464  +    i*86 )
         2465  +      # Not sure whether the presence of OpenBSD here was a mistake.
         2466  +      # Let's accept both of them until this is cleared up.
         2467  +      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
         2468  +      lt_cv_file_magic_cmd=/usr/bin/file
         2469  +      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
         2470  +      ;;
         2471  +    esac
         2472  +  else
         2473  +    lt_cv_deplibs_check_method=pass_all
         2474  +  fi
         2475  +  ;;
         2476  +
         2477  +gnu*)
         2478  +  lt_cv_deplibs_check_method=pass_all
         2479  +  ;;
         2480  +
         2481  +hpux10.20* | hpux11*)
         2482  +  lt_cv_file_magic_cmd=/usr/bin/file
         2483  +  case $host_cpu in
         2484  +  ia64*)
         2485  +    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
         2486  +    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
         2487  +    ;;
         2488  +  hppa*64*)
         2489  +    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
         2490  +    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
         2491  +    ;;
         2492  +  *)
         2493  +    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
         2494  +    lt_cv_file_magic_test_file=/usr/lib/libc.sl
         2495  +    ;;
         2496  +  esac
         2497  +  ;;
         2498  +
         2499  +interix[[3-9]]*)
         2500  +  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
         2501  +  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
         2502  +  ;;
         2503  +
         2504  +irix5* | irix6* | nonstopux*)
         2505  +  case $LD in
         2506  +  *-32|*"-32 ") libmagic=32-bit;;
         2507  +  *-n32|*"-n32 ") libmagic=N32;;
         2508  +  *-64|*"-64 ") libmagic=64-bit;;
         2509  +  *) libmagic=never-match;;
         2510  +  esac
         2511  +  lt_cv_deplibs_check_method=pass_all
         2512  +  ;;
         2513  +
         2514  +# This must be Linux ELF.
         2515  +linux* | k*bsd*-gnu)
         2516  +  lt_cv_deplibs_check_method=pass_all
         2517  +  ;;
         2518  +
         2519  +netbsd* | netbsdelf*-gnu)
         2520  +  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
         2521  +    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
         2522  +  else
         2523  +    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
         2524  +  fi
         2525  +  ;;
         2526  +
         2527  +newos6*)
         2528  +  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
         2529  +  lt_cv_file_magic_cmd=/usr/bin/file
         2530  +  lt_cv_file_magic_test_file=/usr/lib/libnls.so
         2531  +  ;;
         2532  +
         2533  +nto-qnx*)
         2534  +  lt_cv_deplibs_check_method=unknown
         2535  +  ;;
         2536  +
         2537  +openbsd*)
         2538  +  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         2539  +    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
         2540  +  else
         2541  +    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
         2542  +  fi
         2543  +  ;;
         2544  +
         2545  +osf3* | osf4* | osf5*)
         2546  +  lt_cv_deplibs_check_method=pass_all
         2547  +  ;;
         2548  +
         2549  +rdos*)
         2550  +  lt_cv_deplibs_check_method=pass_all
         2551  +  ;;
         2552  +
         2553  +solaris*)
         2554  +  lt_cv_deplibs_check_method=pass_all
         2555  +  ;;
         2556  +
         2557  +sysv4 | sysv4.3*)
         2558  +  case $host_vendor in
         2559  +  motorola)
         2560  +    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
         2561  +    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
         2562  +    ;;
         2563  +  ncr)
         2564  +    lt_cv_deplibs_check_method=pass_all
         2565  +    ;;
         2566  +  sequent)
         2567  +    lt_cv_file_magic_cmd='/bin/file'
         2568  +    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
         2569  +    ;;
         2570  +  sni)
         2571  +    lt_cv_file_magic_cmd='/bin/file'
         2572  +    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
         2573  +    lt_cv_file_magic_test_file=/lib/libc.so
         2574  +    ;;
         2575  +  siemens)
         2576  +    lt_cv_deplibs_check_method=pass_all
         2577  +    ;;
         2578  +  pc)
         2579  +    lt_cv_deplibs_check_method=pass_all
         2580  +    ;;
         2581  +  esac
         2582  +  ;;
         2583  +
         2584  +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
         2585  +  lt_cv_deplibs_check_method=pass_all
         2586  +  ;;
         2587  +esac
         2588  +])
         2589  +file_magic_cmd=$lt_cv_file_magic_cmd
         2590  +deplibs_check_method=$lt_cv_deplibs_check_method
         2591  +test -z "$deplibs_check_method" && deplibs_check_method=unknown
         2592  +])# AC_DEPLIBS_CHECK_METHOD
         2593  +
         2594  +
         2595  +# AC_PROG_NM
         2596  +# ----------
         2597  +# find the pathname to a BSD-compatible name lister
         2598  +AC_DEFUN([AC_PROG_NM],
         2599  +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
         2600  +[if test -n "$NM"; then
         2601  +  # Let the user override the test.
         2602  +  lt_cv_path_NM="$NM"
         2603  +else
         2604  +  lt_nm_to_check="${ac_tool_prefix}nm"
         2605  +  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
         2606  +    lt_nm_to_check="$lt_nm_to_check nm"
         2607  +  fi
         2608  +  for lt_tmp_nm in $lt_nm_to_check; do
         2609  +    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
         2610  +    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
         2611  +      IFS="$lt_save_ifs"
         2612  +      test -z "$ac_dir" && ac_dir=.
         2613  +      tmp_nm="$ac_dir/$lt_tmp_nm"
         2614  +      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
         2615  +	# Check to see if the nm accepts a BSD-compat flag.
         2616  +	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
         2617  +	#   nm: unknown option "B" ignored
         2618  +	# Tru64's nm complains that /dev/null is an invalid object file
         2619  +	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
         2620  +	*/dev/null* | *'Invalid file or object type'*)
         2621  +	  lt_cv_path_NM="$tmp_nm -B"
         2622  +	  break
         2623  +	  ;;
         2624  +	*)
         2625  +	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
         2626  +	  */dev/null*)
         2627  +	    lt_cv_path_NM="$tmp_nm -p"
         2628  +	    break
         2629  +	    ;;
         2630  +	  *)
         2631  +	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
         2632  +	    continue # so that we can try to find one that supports BSD flags
         2633  +	    ;;
         2634  +	  esac
         2635  +	  ;;
         2636  +	esac
         2637  +      fi
         2638  +    done
         2639  +    IFS="$lt_save_ifs"
         2640  +  done
         2641  +  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
         2642  +fi])
         2643  +NM="$lt_cv_path_NM"
         2644  +])# AC_PROG_NM
         2645  +
         2646  +
         2647  +# AC_CHECK_LIBM
         2648  +# -------------
         2649  +# check for math library
         2650  +AC_DEFUN([AC_CHECK_LIBM],
         2651  +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
         2652  +LIBM=
         2653  +case $host in
         2654  +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
         2655  +  # These system don't have libm, or don't need it
         2656  +  ;;
         2657  +*-ncr-sysv4.3*)
         2658  +  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
         2659  +  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
         2660  +  ;;
         2661  +*)
         2662  +  AC_CHECK_LIB(m, cos, LIBM="-lm")
         2663  +  ;;
         2664  +esac
         2665  +])# AC_CHECK_LIBM
         2666  +
         2667  +
         2668  +# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
         2669  +# -----------------------------------
         2670  +# sets LIBLTDL to the link flags for the libltdl convenience library and
         2671  +# LTDLINCL to the include flags for the libltdl header and adds
         2672  +# --enable-ltdl-convenience to the configure arguments.  Note that
         2673  +# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
         2674  +# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
         2675  +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
         2676  +# (note the single quotes!).  If your package is not flat and you're not
         2677  +# using automake, define top_builddir and top_srcdir appropriately in
         2678  +# the Makefiles.
         2679  +AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
         2680  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2681  +  case $enable_ltdl_convenience in
         2682  +  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
         2683  +  "") enable_ltdl_convenience=yes
         2684  +      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
         2685  +  esac
         2686  +  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
         2687  +  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
         2688  +  # For backwards non-gettext consistent compatibility...
         2689  +  INCLTDL="$LTDLINCL"
         2690  +])# AC_LIBLTDL_CONVENIENCE
         2691  +
         2692  +
         2693  +# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
         2694  +# -----------------------------------
         2695  +# sets LIBLTDL to the link flags for the libltdl installable library and
         2696  +# LTDLINCL to the include flags for the libltdl header and adds
         2697  +# --enable-ltdl-install to the configure arguments.  Note that
         2698  +# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
         2699  +# and an installed libltdl is not found, it is assumed to be `libltdl'.
         2700  +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
         2701  +# '${top_srcdir}/' (note the single quotes!).  If your package is not
         2702  +# flat and you're not using automake, define top_builddir and top_srcdir
         2703  +# appropriately in the Makefiles.
         2704  +# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
         2705  +AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
         2706  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2707  +  AC_CHECK_LIB(ltdl, lt_dlinit,
         2708  +  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
         2709  +  [if test x"$enable_ltdl_install" = xno; then
         2710  +     AC_MSG_WARN([libltdl not installed, but installation disabled])
         2711  +   else
         2712  +     enable_ltdl_install=yes
         2713  +   fi
         2714  +  ])
         2715  +  if test x"$enable_ltdl_install" = x"yes"; then
         2716  +    ac_configure_args="$ac_configure_args --enable-ltdl-install"
         2717  +    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
         2718  +    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
         2719  +  else
         2720  +    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
         2721  +    LIBLTDL="-lltdl"
         2722  +    LTDLINCL=
         2723  +  fi
         2724  +  # For backwards non-gettext consistent compatibility...
         2725  +  INCLTDL="$LTDLINCL"
         2726  +])# AC_LIBLTDL_INSTALLABLE
         2727  +
         2728  +
         2729  +# AC_LIBTOOL_CXX
         2730  +# --------------
         2731  +# enable support for C++ libraries
         2732  +AC_DEFUN([AC_LIBTOOL_CXX],
         2733  +[AC_REQUIRE([_LT_AC_LANG_CXX])
         2734  +])# AC_LIBTOOL_CXX
         2735  +
         2736  +
         2737  +# _LT_AC_LANG_CXX
         2738  +# ---------------
         2739  +AC_DEFUN([_LT_AC_LANG_CXX],
         2740  +[AC_REQUIRE([AC_PROG_CXX])
         2741  +AC_REQUIRE([_LT_AC_PROG_CXXCPP])
         2742  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
         2743  +])# _LT_AC_LANG_CXX
         2744  +
         2745  +# _LT_AC_PROG_CXXCPP
         2746  +# ------------------
         2747  +AC_DEFUN([_LT_AC_PROG_CXXCPP],
         2748  +[
         2749  +AC_REQUIRE([AC_PROG_CXX])
         2750  +if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
         2751  +    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
         2752  +    (test "X$CXX" != "Xg++"))) ; then
         2753  +  AC_PROG_CXXCPP
         2754  +fi
         2755  +])# _LT_AC_PROG_CXXCPP
         2756  +
         2757  +# AC_LIBTOOL_F77
         2758  +# --------------
         2759  +# enable support for Fortran 77 libraries
         2760  +AC_DEFUN([AC_LIBTOOL_F77],
         2761  +[AC_REQUIRE([_LT_AC_LANG_F77])
         2762  +])# AC_LIBTOOL_F77
         2763  +
         2764  +
         2765  +# _LT_AC_LANG_F77
         2766  +# ---------------
         2767  +AC_DEFUN([_LT_AC_LANG_F77],
         2768  +[AC_REQUIRE([AC_PROG_F77])
         2769  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
         2770  +])# _LT_AC_LANG_F77
         2771  +
         2772  +
         2773  +# AC_LIBTOOL_GCJ
         2774  +# --------------
         2775  +# enable support for GCJ libraries
         2776  +AC_DEFUN([AC_LIBTOOL_GCJ],
         2777  +[AC_REQUIRE([_LT_AC_LANG_GCJ])
         2778  +])# AC_LIBTOOL_GCJ
         2779  +
         2780  +
         2781  +# _LT_AC_LANG_GCJ
         2782  +# ---------------
         2783  +AC_DEFUN([_LT_AC_LANG_GCJ],
         2784  +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
         2785  +  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
         2786  +    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
         2787  +      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
         2788  +	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
         2789  +	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
         2790  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
         2791  +])# _LT_AC_LANG_GCJ
         2792  +
         2793  +
         2794  +# AC_LIBTOOL_RC
         2795  +# -------------
         2796  +# enable support for Windows resource files
         2797  +AC_DEFUN([AC_LIBTOOL_RC],
         2798  +[AC_REQUIRE([LT_AC_PROG_RC])
         2799  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
         2800  +])# AC_LIBTOOL_RC
         2801  +
         2802  +
         2803  +# AC_LIBTOOL_LANG_C_CONFIG
         2804  +# ------------------------
         2805  +# Ensure that the configuration vars for the C compiler are
         2806  +# suitably defined.  Those variables are subsequently used by
         2807  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         2808  +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
         2809  +AC_DEFUN([_LT_AC_LANG_C_CONFIG],
         2810  +[lt_save_CC="$CC"
         2811  +AC_LANG_PUSH(C)
         2812  +
         2813  +# Source file extension for C test sources.
         2814  +ac_ext=c
         2815  +
         2816  +# Object file extension for compiled C test sources.
         2817  +objext=o
         2818  +_LT_AC_TAGVAR(objext, $1)=$objext
         2819  +
         2820  +# Code to be used in simple compile tests
         2821  +lt_simple_compile_test_code="int some_variable = 0;"
         2822  +
         2823  +# Code to be used in simple link tests
         2824  +lt_simple_link_test_code='int main(){return(0);}'
         2825  +
         2826  +_LT_AC_SYS_COMPILER
         2827  +
         2828  +# save warnings/boilerplate of simple test code
         2829  +_LT_COMPILER_BOILERPLATE
         2830  +_LT_LINKER_BOILERPLATE
         2831  +
         2832  +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
         2833  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         2834  +AC_LIBTOOL_PROG_CC_C_O($1)
         2835  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         2836  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         2837  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         2838  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         2839  +AC_LIBTOOL_SYS_LIB_STRIP
         2840  +AC_LIBTOOL_DLOPEN_SELF
         2841  +
         2842  +# Report which library types will actually be built
         2843  +AC_MSG_CHECKING([if libtool supports shared libraries])
         2844  +AC_MSG_RESULT([$can_build_shared])
         2845  +
         2846  +AC_MSG_CHECKING([whether to build shared libraries])
         2847  +test "$can_build_shared" = "no" && enable_shared=no
         2848  +
         2849  +# On AIX, shared libraries and static libraries use the same namespace, and
         2850  +# are all built from PIC.
         2851  +case $host_os in
         2852  +aix3*)
         2853  +  test "$enable_shared" = yes && enable_static=no
         2854  +  if test -n "$RANLIB"; then
         2855  +    archive_cmds="$archive_cmds~\$RANLIB \$lib"
         2856  +    postinstall_cmds='$RANLIB $lib'
         2857  +  fi
         2858  +  ;;
         2859  +
         2860  +aix[[4-9]]*)
         2861  +  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
         2862  +    test "$enable_shared" = yes && enable_static=no
         2863  +  fi
         2864  +    ;;
         2865  +esac
         2866  +AC_MSG_RESULT([$enable_shared])
         2867  +
         2868  +AC_MSG_CHECKING([whether to build static libraries])
         2869  +# Make sure either enable_shared or enable_static is yes.
         2870  +test "$enable_shared" = yes || enable_static=yes
         2871  +AC_MSG_RESULT([$enable_static])
         2872  +
         2873  +AC_LIBTOOL_CONFIG($1)
         2874  +
         2875  +AC_LANG_POP
         2876  +CC="$lt_save_CC"
         2877  +])# AC_LIBTOOL_LANG_C_CONFIG
         2878  +
         2879  +
         2880  +# AC_LIBTOOL_LANG_CXX_CONFIG
         2881  +# --------------------------
         2882  +# Ensure that the configuration vars for the C compiler are
         2883  +# suitably defined.  Those variables are subsequently used by
         2884  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         2885  +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
         2886  +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
         2887  +[AC_LANG_PUSH(C++)
         2888  +AC_REQUIRE([AC_PROG_CXX])
         2889  +AC_REQUIRE([_LT_AC_PROG_CXXCPP])
         2890  +
         2891  +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         2892  +_LT_AC_TAGVAR(allow_undefined_flag, $1)=
         2893  +_LT_AC_TAGVAR(always_export_symbols, $1)=no
         2894  +_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
         2895  +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         2896  +_LT_AC_TAGVAR(hardcode_direct, $1)=no
         2897  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         2898  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
         2899  +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         2900  +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
         2901  +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         2902  +_LT_AC_TAGVAR(hardcode_automatic, $1)=no
         2903  +_LT_AC_TAGVAR(module_cmds, $1)=
         2904  +_LT_AC_TAGVAR(module_expsym_cmds, $1)=
         2905  +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
         2906  +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
         2907  +_LT_AC_TAGVAR(no_undefined_flag, $1)=
         2908  +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         2909  +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
         2910  +
         2911  +# Dependencies to place before and after the object being linked:
         2912  +_LT_AC_TAGVAR(predep_objects, $1)=
         2913  +_LT_AC_TAGVAR(postdep_objects, $1)=
         2914  +_LT_AC_TAGVAR(predeps, $1)=
         2915  +_LT_AC_TAGVAR(postdeps, $1)=
         2916  +_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
         2917  +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
         2918  +
         2919  +# Source file extension for C++ test sources.
         2920  +ac_ext=cpp
         2921  +
         2922  +# Object file extension for compiled C++ test sources.
         2923  +objext=o
         2924  +_LT_AC_TAGVAR(objext, $1)=$objext
         2925  +
         2926  +# Code to be used in simple compile tests
         2927  +lt_simple_compile_test_code="int some_variable = 0;"
         2928  +
         2929  +# Code to be used in simple link tests
         2930  +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
         2931  +
         2932  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         2933  +_LT_AC_SYS_COMPILER
         2934  +
         2935  +# save warnings/boilerplate of simple test code
         2936  +_LT_COMPILER_BOILERPLATE
         2937  +_LT_LINKER_BOILERPLATE
         2938  +
         2939  +# Allow CC to be a program name with arguments.
         2940  +lt_save_CC=$CC
         2941  +lt_save_LD=$LD
         2942  +lt_save_GCC=$GCC
         2943  +GCC=$GXX
         2944  +lt_save_with_gnu_ld=$with_gnu_ld
         2945  +lt_save_path_LD=$lt_cv_path_LD
         2946  +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
         2947  +  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
         2948  +else
         2949  +  $as_unset lt_cv_prog_gnu_ld
         2950  +fi
         2951  +if test -n "${lt_cv_path_LDCXX+set}"; then
         2952  +  lt_cv_path_LD=$lt_cv_path_LDCXX
         2953  +else
         2954  +  $as_unset lt_cv_path_LD
         2955  +fi
         2956  +test -z "${LDCXX+set}" || LD=$LDCXX
         2957  +CC=${CXX-"c++"}
         2958  +compiler=$CC
         2959  +_LT_AC_TAGVAR(compiler, $1)=$CC
         2960  +_LT_CC_BASENAME([$compiler])
         2961  +
         2962  +# We don't want -fno-exception wen compiling C++ code, so set the
         2963  +# no_builtin_flag separately
         2964  +if test "$GXX" = yes; then
         2965  +  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
         2966  +else
         2967  +  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
         2968  +fi
         2969  +
         2970  +if test "$GXX" = yes; then
         2971  +  # Set up default GNU C++ configuration
         2972  +
         2973  +  AC_PROG_LD
         2974  +
         2975  +  # Check if GNU C++ uses GNU ld as the underlying linker, since the
         2976  +  # archiving commands below assume that GNU ld is being used.
         2977  +  if test "$with_gnu_ld" = yes; then
         2978  +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
         2979  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         2980  +
         2981  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
         2982  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         2983  +
         2984  +    # If archive_cmds runs LD, not CC, wlarc should be empty
         2985  +    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         2986  +    #     investigate it a little bit more. (MM)
         2987  +    wlarc='${wl}'
         2988  +
         2989  +    # ancient GNU ld didn't support --whole-archive et. al.
         2990  +    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
         2991  +	grep 'no-whole-archive' > /dev/null; then
         2992  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
         2993  +    else
         2994  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         2995  +    fi
         2996  +  else
         2997  +    with_gnu_ld=no
         2998  +    wlarc=
         2999  +
         3000  +    # A generic and very simple default shared library creation
         3001  +    # command for GNU C++ for the case where it uses the native
         3002  +    # linker, instead of GNU ld.  If possible, this setting should
         3003  +    # overridden to take advantage of the native linker features on
         3004  +    # the platform it is being used on.
         3005  +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
         3006  +  fi
         3007  +
         3008  +  # Commands to make compiler produce verbose output that lists
         3009  +  # what "hidden" libraries, object files and flags are used when
         3010  +  # linking a shared library.
         3011  +  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
         3012  +
         3013  +else
         3014  +  GXX=no
         3015  +  with_gnu_ld=no
         3016  +  wlarc=
         3017  +fi
         3018  +
         3019  +# PORTME: fill in a description of your system's C++ link characteristics
         3020  +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
         3021  +_LT_AC_TAGVAR(ld_shlibs, $1)=yes
         3022  +case $host_os in
         3023  +  aix3*)
         3024  +    # FIXME: insert proper C++ library support
         3025  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3026  +    ;;
         3027  +  aix[[4-9]]*)
         3028  +    if test "$host_cpu" = ia64; then
         3029  +      # On IA64, the linker does run time linking by default, so we don't
         3030  +      # have to do anything special.
         3031  +      aix_use_runtimelinking=no
         3032  +      exp_sym_flag='-Bexport'
         3033  +      no_entry_flag=""
         3034  +    else
         3035  +      aix_use_runtimelinking=no
         3036  +
         3037  +      # Test if we are trying to use run time linking or normal
         3038  +      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
         3039  +      # need to do runtime linking.
         3040  +      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
         3041  +	for ld_flag in $LDFLAGS; do
         3042  +	  case $ld_flag in
         3043  +	  *-brtl*)
         3044  +	    aix_use_runtimelinking=yes
         3045  +	    break
         3046  +	    ;;
         3047  +	  esac
         3048  +	done
         3049  +	;;
         3050  +      esac
         3051  +
         3052  +      exp_sym_flag='-bexport'
         3053  +      no_entry_flag='-bnoentry'
         3054  +    fi
         3055  +
         3056  +    # When large executables or shared objects are built, AIX ld can
         3057  +    # have problems creating the table of contents.  If linking a library
         3058  +    # or program results in "error TOC overflow" add -mminimal-toc to
         3059  +    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
         3060  +    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
         3061  +
         3062  +    _LT_AC_TAGVAR(archive_cmds, $1)=''
         3063  +    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3064  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         3065  +    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3066  +
         3067  +    if test "$GXX" = yes; then
         3068  +      case $host_os in aix4.[[012]]|aix4.[[012]].*)
         3069  +      # We only want to do this on AIX 4.2 and lower, the check
         3070  +      # below for broken collect2 doesn't work under 4.3+
         3071  +	collect2name=`${CC} -print-prog-name=collect2`
         3072  +	if test -f "$collect2name" && \
         3073  +	   strings "$collect2name" | grep resolve_lib_name >/dev/null
         3074  +	then
         3075  +	  # We have reworked collect2
         3076  +	  :
         3077  +	else
         3078  +	  # We have old collect2
         3079  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
         3080  +	  # It fails to find uninstalled libraries when the uninstalled
         3081  +	  # path is not listed in the libpath.  Setting hardcode_minus_L
         3082  +	  # to unsupported forces relinking
         3083  +	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         3084  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         3085  +	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         3086  +	fi
         3087  +	;;
         3088  +      esac
         3089  +      shared_flag='-shared'
         3090  +      if test "$aix_use_runtimelinking" = yes; then
         3091  +	shared_flag="$shared_flag "'${wl}-G'
         3092  +      fi
         3093  +    else
         3094  +      # not using gcc
         3095  +      if test "$host_cpu" = ia64; then
         3096  +	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
         3097  +	# chokes on -Wl,-G. The following line is correct:
         3098  +	shared_flag='-G'
         3099  +      else
         3100  +	if test "$aix_use_runtimelinking" = yes; then
         3101  +	  shared_flag='${wl}-G'
         3102  +	else
         3103  +	  shared_flag='${wl}-bM:SRE'
         3104  +	fi
         3105  +      fi
         3106  +    fi
         3107  +
         3108  +    # It seems that -bexpall does not export symbols beginning with
         3109  +    # underscore (_), so it is better to generate a list of symbols to export.
         3110  +    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
         3111  +    if test "$aix_use_runtimelinking" = yes; then
         3112  +      # Warning - without using the other runtime loading flags (-brtl),
         3113  +      # -berok will link without error, but may produce a broken library.
         3114  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
         3115  +      # Determine the default libpath from the value encoded in an empty executable.
         3116  +      _LT_AC_SYS_LIBPATH_AIX
         3117  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         3118  +
         3119  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         3120  +     else
         3121  +      if test "$host_cpu" = ia64; then
         3122  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
         3123  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
         3124  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
         3125  +      else
         3126  +	# Determine the default libpath from the value encoded in an empty executable.
         3127  +	_LT_AC_SYS_LIBPATH_AIX
         3128  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         3129  +	# Warning - without using the other run time loading flags,
         3130  +	# -berok will link without error, but may produce a broken library.
         3131  +	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
         3132  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
         3133  +	# Exported symbols can be pulled into shared objects from archives
         3134  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
         3135  +	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
         3136  +	# This is similar to how AIX traditionally builds its shared libraries.
         3137  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
         3138  +      fi
         3139  +    fi
         3140  +    ;;
         3141  +
         3142  +  beos*)
         3143  +    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         3144  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         3145  +      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
         3146  +      # support --undefined.  This deserves some investigation.  FIXME
         3147  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3148  +    else
         3149  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3150  +    fi
         3151  +    ;;
         3152  +
         3153  +  chorus*)
         3154  +    case $cc_basename in
         3155  +      *)
         3156  +	# FIXME: insert proper C++ library support
         3157  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3158  +	;;
         3159  +    esac
         3160  +    ;;
         3161  +
         3162  +  cygwin* | mingw* | pw32*)
         3163  +    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
         3164  +    # as there is no search path for DLLs.
         3165  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         3166  +    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         3167  +    _LT_AC_TAGVAR(always_export_symbols, $1)=no
         3168  +    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
         3169  +
         3170  +    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         3171  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
         3172  +      # If the export-symbols file already is a .def file (1st line
         3173  +      # is EXPORTS), use it as is; otherwise, prepend...
         3174  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
         3175  +	cp $export_symbols $output_objdir/$soname.def;
         3176  +      else
         3177  +	echo EXPORTS > $output_objdir/$soname.def;
         3178  +	cat $export_symbols >> $output_objdir/$soname.def;
         3179  +      fi~
         3180  +      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
         3181  +    else
         3182  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3183  +    fi
         3184  +  ;;
         3185  +      darwin* | rhapsody*)
         3186  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3187  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         3188  +      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
         3189  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         3190  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
         3191  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3192  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
         3193  +      if test "$GXX" = yes ; then
         3194  +      output_verbose_link_cmd='echo'
         3195  +      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
         3196  +      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
         3197  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
         3198  +      _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
         3199  +      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
         3200  +        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
         3201  +        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
         3202  +      fi
         3203  +      else
         3204  +      case $cc_basename in
         3205  +        xlc*)
         3206  +         output_verbose_link_cmd='echo'
         3207  +          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
         3208  +          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
         3209  +          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
         3210  +          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         3211  +          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         3212  +          ;;
         3213  +       *)
         3214  +         _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3215  +          ;;
         3216  +      esac
         3217  +      fi
         3218  +        ;;
         3219  +
         3220  +  dgux*)
         3221  +    case $cc_basename in
         3222  +      ec++*)
         3223  +	# FIXME: insert proper C++ library support
         3224  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3225  +	;;
         3226  +      ghcx*)
         3227  +	# Green Hills C++ Compiler
         3228  +	# FIXME: insert proper C++ library support
         3229  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3230  +	;;
         3231  +      *)
         3232  +	# FIXME: insert proper C++ library support
         3233  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3234  +	;;
         3235  +    esac
         3236  +    ;;
         3237  +  freebsd[[12]]*)
         3238  +    # C++ shared libraries reported to be fairly broken before switch to ELF
         3239  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3240  +    ;;
         3241  +  freebsd-elf*)
         3242  +    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3243  +    ;;
         3244  +  freebsd* | dragonfly*)
         3245  +    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
         3246  +    # conventions
         3247  +    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
         3248  +    ;;
         3249  +  gnu*)
         3250  +    ;;
         3251  +  hpux9*)
         3252  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         3253  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3254  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3255  +    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3256  +    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
         3257  +				# but as the default
         3258  +				# location of the library.
         3259  +
         3260  +    case $cc_basename in
         3261  +    CC*)
         3262  +      # FIXME: insert proper C++ library support
         3263  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3264  +      ;;
         3265  +    aCC*)
         3266  +      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         3267  +      # Commands to make compiler produce verbose output that lists
         3268  +      # what "hidden" libraries, object files and flags are used when
         3269  +      # linking a shared library.
         3270  +      #
         3271  +      # There doesn't appear to be a way to prevent this compiler from
         3272  +      # explicitly linking system object files so we need to strip them
         3273  +      # from the output so that they don't get included in the library
         3274  +      # dependencies.
         3275  +      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3276  +      ;;
         3277  +    *)
         3278  +      if test "$GXX" = yes; then
         3279  +        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         3280  +      else
         3281  +        # FIXME: insert proper C++ library support
         3282  +        _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3283  +      fi
         3284  +      ;;
         3285  +    esac
         3286  +    ;;
         3287  +  hpux10*|hpux11*)
         3288  +    if test $with_gnu_ld = no; then
         3289  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         3290  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3291  +
         3292  +      case $host_cpu in
         3293  +      hppa*64*|ia64*) ;;
         3294  +      *)
         3295  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3296  +        ;;
         3297  +      esac
         3298  +    fi
         3299  +    case $host_cpu in
         3300  +    hppa*64*|ia64*)
         3301  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         3302  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3303  +      ;;
         3304  +    *)
         3305  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3306  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
         3307  +					      # but as the default
         3308  +					      # location of the library.
         3309  +      ;;
         3310  +    esac
         3311  +
         3312  +    case $cc_basename in
         3313  +      CC*)
         3314  +	# FIXME: insert proper C++ library support
         3315  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3316  +	;;
         3317  +      aCC*)
         3318  +	case $host_cpu in
         3319  +	hppa*64*)
         3320  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3321  +	  ;;
         3322  +	ia64*)
         3323  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3324  +	  ;;
         3325  +	*)
         3326  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3327  +	  ;;
         3328  +	esac
         3329  +	# Commands to make compiler produce verbose output that lists
         3330  +	# what "hidden" libraries, object files and flags are used when
         3331  +	# linking a shared library.
         3332  +	#
         3333  +	# There doesn't appear to be a way to prevent this compiler from
         3334  +	# explicitly linking system object files so we need to strip them
         3335  +	# from the output so that they don't get included in the library
         3336  +	# dependencies.
         3337  +	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3338  +	;;
         3339  +      *)
         3340  +	if test "$GXX" = yes; then
         3341  +	  if test $with_gnu_ld = no; then
         3342  +	    case $host_cpu in
         3343  +	    hppa*64*)
         3344  +	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3345  +	      ;;
         3346  +	    ia64*)
         3347  +	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3348  +	      ;;
         3349  +	    *)
         3350  +	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3351  +	      ;;
         3352  +	    esac
         3353  +	  fi
         3354  +	else
         3355  +	  # FIXME: insert proper C++ library support
         3356  +	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3357  +	fi
         3358  +	;;
         3359  +    esac
         3360  +    ;;
         3361  +  interix[[3-9]]*)
         3362  +    _LT_AC_TAGVAR(hardcode_direct, $1)=no
         3363  +    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3364  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3365  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3366  +    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
         3367  +    # Instead, shared libraries are loaded at an image base (0x10000000 by
         3368  +    # default) and relocated if they conflict, which is a slow very memory
         3369  +    # consuming and fragmenting process.  To avoid this, we pick a random,
         3370  +    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
         3371  +    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
         3372  +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         3373  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         3374  +    ;;
         3375  +  irix5* | irix6*)
         3376  +    case $cc_basename in
         3377  +      CC*)
         3378  +	# SGI C++
         3379  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         3380  +
         3381  +	# Archives containing C++ object files must be created using
         3382  +	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
         3383  +	# necessary to make sure instantiated templates are included
         3384  +	# in the archive.
         3385  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
         3386  +	;;
         3387  +      *)
         3388  +	if test "$GXX" = yes; then
         3389  +	  if test "$with_gnu_ld" = no; then
         3390  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         3391  +	  else
         3392  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
         3393  +	  fi
         3394  +	fi
         3395  +	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3396  +	;;
         3397  +    esac
         3398  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3399  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3400  +    ;;
         3401  +  linux* | k*bsd*-gnu)
         3402  +    case $cc_basename in
         3403  +      KCC*)
         3404  +	# Kuck and Associates, Inc. (KAI) C++ Compiler
         3405  +
         3406  +	# KCC will only create a shared library if the output file
         3407  +	# ends with ".so" (or ".sl" for HP-UX), so rename the library
         3408  +	# to its proper name (with version) after linking.
         3409  +	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
         3410  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
         3411  +	# Commands to make compiler produce verbose output that lists
         3412  +	# what "hidden" libraries, object files and flags are used when
         3413  +	# linking a shared library.
         3414  +	#
         3415  +	# There doesn't appear to be a way to prevent this compiler from
         3416  +	# explicitly linking system object files so we need to strip them
         3417  +	# from the output so that they don't get included in the library
         3418  +	# dependencies.
         3419  +	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3420  +
         3421  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
         3422  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         3423  +
         3424  +	# Archives containing C++ object files must be created using
         3425  +	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
         3426  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
         3427  +	;;
         3428  +      icpc*)
         3429  +	# Intel C++
         3430  +	with_gnu_ld=yes
         3431  +	# version 8.0 and above of icpc choke on multiply defined symbols
         3432  +	# if we add $predep_objects and $postdep_objects, however 7.1 and
         3433  +	# earlier do not add the objects themselves.
         3434  +	case `$CC -V 2>&1` in
         3435  +	*"Version 7."*)
         3436  +  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3437  +  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         3438  +	  ;;
         3439  +	*)  # Version 8.0 or newer
         3440  +	  tmp_idyn=
         3441  +	  case $host_cpu in
         3442  +	    ia64*) tmp_idyn=' -i_dynamic';;
         3443  +	  esac
         3444  +  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3445  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         3446  +	  ;;
         3447  +	esac
         3448  +	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3449  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3450  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         3451  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
         3452  +	;;
         3453  +      pgCC* | pgcpp*)
         3454  +        # Portland Group C++ compiler
         3455  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
         3456  +  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
         3457  +
         3458  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
         3459  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         3460  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         3461  +        ;;
         3462  +      cxx*)
         3463  +	# Compaq C++
         3464  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3465  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
         3466  +
         3467  +	runpath_var=LD_RUN_PATH
         3468  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
         3469  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3470  +
         3471  +	# Commands to make compiler produce verbose output that lists
         3472  +	# what "hidden" libraries, object files and flags are used when
         3473  +	# linking a shared library.
         3474  +	#
         3475  +	# There doesn't appear to be a way to prevent this compiler from
         3476  +	# explicitly linking system object files so we need to strip them
         3477  +	# from the output so that they don't get included in the library
         3478  +	# dependencies.
         3479  +	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3480  +	;;
         3481  +      *)
         3482  +	case `$CC -V 2>&1 | sed 5q` in
         3483  +	*Sun\ C*)
         3484  +	  # Sun C++ 5.9
         3485  +	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
         3486  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3487  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
         3488  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         3489  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         3490  +
         3491  +	  # Not sure whether something based on
         3492  +	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
         3493  +	  # would be better.
         3494  +	  output_verbose_link_cmd='echo'
         3495  +
         3496  +	  # Archives containing C++ object files must be created using
         3497  +	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
         3498  +	  # necessary to make sure instantiated templates are included
         3499  +	  # in the archive.
         3500  +	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
         3501  +	  ;;
         3502  +	esac
         3503  +	;;
         3504  +    esac
         3505  +    ;;
         3506  +  lynxos*)
         3507  +    # FIXME: insert proper C++ library support
         3508  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3509  +    ;;
         3510  +  m88k*)
         3511  +    # FIXME: insert proper C++ library support
         3512  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3513  +    ;;
         3514  +  mvs*)
         3515  +    case $cc_basename in
         3516  +      cxx*)
         3517  +	# FIXME: insert proper C++ library support
         3518  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3519  +	;;
         3520  +      *)
         3521  +	# FIXME: insert proper C++ library support
         3522  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3523  +	;;
         3524  +    esac
         3525  +    ;;
         3526  +  netbsd* | netbsdelf*-gnu)
         3527  +    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
         3528  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
         3529  +      wlarc=
         3530  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         3531  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3532  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3533  +    fi
         3534  +    # Workaround some broken pre-1.5 toolchains
         3535  +    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
         3536  +    ;;
         3537  +  openbsd2*)
         3538  +    # C++ shared libraries are fairly broken
         3539  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3540  +    ;;
         3541  +  openbsd*)
         3542  +    if test -f /usr/libexec/ld.so; then
         3543  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3544  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3545  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
         3546  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3547  +      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         3548  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
         3549  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3550  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
         3551  +      fi
         3552  +      output_verbose_link_cmd='echo'
         3553  +    else
         3554  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3555  +    fi
         3556  +    ;;
         3557  +  osf3*)
         3558  +    case $cc_basename in
         3559  +      KCC*)
         3560  +	# Kuck and Associates, Inc. (KAI) C++ Compiler
         3561  +
         3562  +	# KCC will only create a shared library if the output file
         3563  +	# ends with ".so" (or ".sl" for HP-UX), so rename the library
         3564  +	# to its proper name (with version) after linking.
         3565  +	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
         3566  +
         3567  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3568  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3569  +
         3570  +	# Archives containing C++ object files must be created using
         3571  +	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
         3572  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
         3573  +
         3574  +	;;
         3575  +      RCC*)
         3576  +	# Rational C++ 2.4.1
         3577  +	# FIXME: insert proper C++ library support
         3578  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3579  +	;;
         3580  +      cxx*)
         3581  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         3582  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         3583  +
         3584  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3585  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3586  +
         3587  +	# Commands to make compiler produce verbose output that lists
         3588  +	# what "hidden" libraries, object files and flags are used when
         3589  +	# linking a shared library.
         3590  +	#
         3591  +	# There doesn't appear to be a way to prevent this compiler from
         3592  +	# explicitly linking system object files so we need to strip them
         3593  +	# from the output so that they don't get included in the library
         3594  +	# dependencies.
         3595  +	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3596  +	;;
         3597  +      *)
         3598  +	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
         3599  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         3600  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         3601  +
         3602  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3603  +	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3604  +
         3605  +	  # Commands to make compiler produce verbose output that lists
         3606  +	  # what "hidden" libraries, object files and flags are used when
         3607  +	  # linking a shared library.
         3608  +	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
         3609  +
         3610  +	else
         3611  +	  # FIXME: insert proper C++ library support
         3612  +	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3613  +	fi
         3614  +	;;
         3615  +    esac
         3616  +    ;;
         3617  +  osf4* | osf5*)
         3618  +    case $cc_basename in
         3619  +      KCC*)
         3620  +	# Kuck and Associates, Inc. (KAI) C++ Compiler
         3621  +
         3622  +	# KCC will only create a shared library if the output file
         3623  +	# ends with ".so" (or ".sl" for HP-UX), so rename the library
         3624  +	# to its proper name (with version) after linking.
         3625  +	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
         3626  +
         3627  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3628  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3629  +
         3630  +	# Archives containing C++ object files must be created using
         3631  +	# the KAI C++ compiler.
         3632  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
         3633  +	;;
         3634  +      RCC*)
         3635  +	# Rational C++ 2.4.1
         3636  +	# FIXME: insert proper C++ library support
         3637  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3638  +	;;
         3639  +      cxx*)
         3640  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
         3641  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         3642  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
         3643  +	  echo "-hidden">> $lib.exp~
         3644  +	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
         3645  +	  $rm $lib.exp'
         3646  +
         3647  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
         3648  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3649  +
         3650  +	# Commands to make compiler produce verbose output that lists
         3651  +	# what "hidden" libraries, object files and flags are used when
         3652  +	# linking a shared library.
         3653  +	#
         3654  +	# There doesn't appear to be a way to prevent this compiler from
         3655  +	# explicitly linking system object files so we need to strip them
         3656  +	# from the output so that they don't get included in the library
         3657  +	# dependencies.
         3658  +	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3659  +	;;
         3660  +      *)
         3661  +	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
         3662  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         3663  +	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         3664  +
         3665  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3666  +	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3667  +
         3668  +	  # Commands to make compiler produce verbose output that lists
         3669  +	  # what "hidden" libraries, object files and flags are used when
         3670  +	  # linking a shared library.
         3671  +	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
         3672  +
         3673  +	else
         3674  +	  # FIXME: insert proper C++ library support
         3675  +	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3676  +	fi
         3677  +	;;
         3678  +    esac
         3679  +    ;;
         3680  +  psos*)
         3681  +    # FIXME: insert proper C++ library support
         3682  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3683  +    ;;
         3684  +  sunos4*)
         3685  +    case $cc_basename in
         3686  +      CC*)
         3687  +	# Sun C++ 4.x
         3688  +	# FIXME: insert proper C++ library support
         3689  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3690  +	;;
         3691  +      lcc*)
         3692  +	# Lucid
         3693  +	# FIXME: insert proper C++ library support
         3694  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3695  +	;;
         3696  +      *)
         3697  +	# FIXME: insert proper C++ library support
         3698  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3699  +	;;
         3700  +    esac
         3701  +    ;;
         3702  +  solaris*)
         3703  +    case $cc_basename in
         3704  +      CC*)
         3705  +	# Sun C++ 4.2, 5.x and Centerline C++
         3706  +        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
         3707  +	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
         3708  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3709  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         3710  +	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
         3711  +
         3712  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         3713  +	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3714  +	case $host_os in
         3715  +	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
         3716  +	  *)
         3717  +	    # The compiler driver will combine and reorder linker options,
         3718  +	    # but understands `-z linker_flag'.
         3719  +	    # Supported since Solaris 2.6 (maybe 2.5.1?)
         3720  +	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
         3721  +	    ;;
         3722  +	esac
         3723  +	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3724  +
         3725  +	output_verbose_link_cmd='echo'
         3726  +
         3727  +	# Archives containing C++ object files must be created using
         3728  +	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
         3729  +	# necessary to make sure instantiated templates are included
         3730  +	# in the archive.
         3731  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
         3732  +	;;
         3733  +      gcx*)
         3734  +	# Green Hills C++ Compiler
         3735  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
         3736  +
         3737  +	# The C++ compiler must be used to create the archive.
         3738  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
         3739  +	;;
         3740  +      *)
         3741  +	# GNU C++ compiler with Solaris linker
         3742  +	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
         3743  +	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
         3744  +	  if $CC --version | grep -v '^2\.7' > /dev/null; then
         3745  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
         3746  +	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         3747  +		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
         3748  +
         3749  +	    # Commands to make compiler produce verbose output that lists
         3750  +	    # what "hidden" libraries, object files and flags are used when
         3751  +	    # linking a shared library.
         3752  +	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
         3753  +	  else
         3754  +	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
         3755  +	    # platform.
         3756  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
         3757  +	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         3758  +		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
         3759  +
         3760  +	    # Commands to make compiler produce verbose output that lists
         3761  +	    # what "hidden" libraries, object files and flags are used when
         3762  +	    # linking a shared library.
         3763  +	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
         3764  +	  fi
         3765  +
         3766  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
         3767  +	  case $host_os in
         3768  +	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
         3769  +	  *)
         3770  +	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
         3771  +	    ;;
         3772  +	  esac
         3773  +	fi
         3774  +	;;
         3775  +    esac
         3776  +    ;;
         3777  +  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
         3778  +    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         3779  +    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3780  +    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3781  +    runpath_var='LD_RUN_PATH'
         3782  +
         3783  +    case $cc_basename in
         3784  +      CC*)
         3785  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3786  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3787  +	;;
         3788  +      *)
         3789  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3790  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3791  +	;;
         3792  +    esac
         3793  +    ;;
         3794  +  sysv5* | sco3.2v5* | sco5v6*)
         3795  +    # Note: We can NOT use -z defs as we might desire, because we do not
         3796  +    # link with -lc, and that would cause any symbols used from libc to
         3797  +    # always be unresolved, which means just about no library would
         3798  +    # ever link correctly.  If we're not using GNU ld we use -z text
         3799  +    # though, which does catch some bad symbols but isn't as heavy-handed
         3800  +    # as -z defs.
         3801  +    # For security reasons, it is highly recommended that you always
         3802  +    # use absolute paths for naming shared libraries, and exclude the
         3803  +    # DT_RUNPATH tag from executables and libraries.  But doing so
         3804  +    # requires that you compile everything twice, which is a pain.
         3805  +    # So that behaviour is only enabled if SCOABSPATH is set to a
         3806  +    # non-empty value in the environment.  Most likely only useful for
         3807  +    # creating official distributions of packages.
         3808  +    # This is a hack until libtool officially supports absolute path
         3809  +    # names for shared libraries.
         3810  +    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         3811  +    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
         3812  +    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3813  +    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3814  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
         3815  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         3816  +    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3817  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
         3818  +    runpath_var='LD_RUN_PATH'
         3819  +
         3820  +    case $cc_basename in
         3821  +      CC*)
         3822  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3823  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3824  +	;;
         3825  +      *)
         3826  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3827  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3828  +	;;
         3829  +    esac
         3830  +    ;;
         3831  +  tandem*)
         3832  +    case $cc_basename in
         3833  +      NCC*)
         3834  +	# NonStop-UX NCC 3.20
         3835  +	# FIXME: insert proper C++ library support
         3836  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3837  +	;;
         3838  +      *)
         3839  +	# FIXME: insert proper C++ library support
         3840  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3841  +	;;
         3842  +    esac
         3843  +    ;;
         3844  +  vxworks*)
         3845  +    # FIXME: insert proper C++ library support
         3846  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3847  +    ;;
         3848  +  *)
         3849  +    # FIXME: insert proper C++ library support
         3850  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3851  +    ;;
         3852  +esac
         3853  +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
         3854  +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
         3855  +
         3856  +_LT_AC_TAGVAR(GCC, $1)="$GXX"
         3857  +_LT_AC_TAGVAR(LD, $1)="$LD"
         3858  +
         3859  +AC_LIBTOOL_POSTDEP_PREDEP($1)
         3860  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         3861  +AC_LIBTOOL_PROG_CC_C_O($1)
         3862  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         3863  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         3864  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         3865  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         3866  +
         3867  +AC_LIBTOOL_CONFIG($1)
         3868  +
         3869  +AC_LANG_POP
         3870  +CC=$lt_save_CC
         3871  +LDCXX=$LD
         3872  +LD=$lt_save_LD
         3873  +GCC=$lt_save_GCC
         3874  +with_gnu_ldcxx=$with_gnu_ld
         3875  +with_gnu_ld=$lt_save_with_gnu_ld
         3876  +lt_cv_path_LDCXX=$lt_cv_path_LD
         3877  +lt_cv_path_LD=$lt_save_path_LD
         3878  +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
         3879  +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
         3880  +])# AC_LIBTOOL_LANG_CXX_CONFIG
         3881  +
         3882  +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
         3883  +# ------------------------------------
         3884  +# Figure out "hidden" library dependencies from verbose
         3885  +# compiler output when linking a shared library.
         3886  +# Parse the compiler output and extract the necessary
         3887  +# objects, libraries and library flags.
         3888  +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
         3889  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         3890  +dnl we can't use the lt_simple_compile_test_code here,
         3891  +dnl because it contains code intended for an executable,
         3892  +dnl not a library.  It's possible we should let each
         3893  +dnl tag define a new lt_????_link_test_code variable,
         3894  +dnl but it's only used here...
         3895  +ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
         3896  +int a;
         3897  +void foo (void) { a = 0; }
         3898  +EOF
         3899  +],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
         3900  +class Foo
         3901  +{
         3902  +public:
         3903  +  Foo (void) { a = 0; }
         3904  +private:
         3905  +  int a;
         3906  +};
         3907  +EOF
         3908  +],[$1],[F77],[cat > conftest.$ac_ext <<EOF
         3909  +      subroutine foo
         3910  +      implicit none
         3911  +      integer*4 a
         3912  +      a=0
         3913  +      return
         3914  +      end
         3915  +EOF
         3916  +],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
         3917  +public class foo {
         3918  +  private int a;
         3919  +  public void bar (void) {
         3920  +    a = 0;
         3921  +  }
         3922  +};
         3923  +EOF
         3924  +])
         3925  +dnl Parse the compiler output and extract the necessary
         3926  +dnl objects, libraries and library flags.
         3927  +if AC_TRY_EVAL(ac_compile); then
         3928  +  # Parse the compiler output and extract the necessary
         3929  +  # objects, libraries and library flags.
         3930  +
         3931  +  # Sentinel used to keep track of whether or not we are before
         3932  +  # the conftest object file.
         3933  +  pre_test_object_deps_done=no
         3934  +
         3935  +  # The `*' in the case matches for architectures that use `case' in
         3936  +  # $output_verbose_cmd can trigger glob expansion during the loop
         3937  +  # eval without this substitution.
         3938  +  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
         3939  +
         3940  +  for p in `eval $output_verbose_link_cmd`; do
         3941  +    case $p in
         3942  +
         3943  +    -L* | -R* | -l*)
         3944  +       # Some compilers place space between "-{L,R}" and the path.
         3945  +       # Remove the space.
         3946  +       if test $p = "-L" \
         3947  +	  || test $p = "-R"; then
         3948  +	 prev=$p
         3949  +	 continue
         3950  +       else
         3951  +	 prev=
         3952  +       fi
         3953  +
         3954  +       if test "$pre_test_object_deps_done" = no; then
         3955  +	 case $p in
         3956  +	 -L* | -R*)
         3957  +	   # Internal compiler library paths should come after those
         3958  +	   # provided the user.  The postdeps already come after the
         3959  +	   # user supplied libs so there is no need to process them.
         3960  +	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
         3961  +	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
         3962  +	   else
         3963  +	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
         3964  +	   fi
         3965  +	   ;;
         3966  +	 # The "-l" case would never come before the object being
         3967  +	 # linked, so don't bother handling this case.
         3968  +	 esac
         3969  +       else
         3970  +	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
         3971  +	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
         3972  +	 else
         3973  +	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
         3974  +	 fi
         3975  +       fi
         3976  +       ;;
         3977  +
         3978  +    *.$objext)
         3979  +       # This assumes that the test object file only shows up
         3980  +       # once in the compiler output.
         3981  +       if test "$p" = "conftest.$objext"; then
         3982  +	 pre_test_object_deps_done=yes
         3983  +	 continue
         3984  +       fi
         3985  +
         3986  +       if test "$pre_test_object_deps_done" = no; then
         3987  +	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
         3988  +	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
         3989  +	 else
         3990  +	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
         3991  +	 fi
         3992  +       else
         3993  +	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
         3994  +	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
         3995  +	 else
         3996  +	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
         3997  +	 fi
         3998  +       fi
         3999  +       ;;
         4000  +
         4001  +    *) ;; # Ignore the rest.
         4002  +
         4003  +    esac
         4004  +  done
         4005  +
         4006  +  # Clean up.
         4007  +  rm -f a.out a.exe
         4008  +else
         4009  +  echo "libtool.m4: error: problem compiling $1 test program"
         4010  +fi
         4011  +
         4012  +$rm -f confest.$objext
         4013  +
         4014  +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
         4015  +if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
         4016  +  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
         4017  +fi
         4018  +
         4019  +# PORTME: override above test on systems where it is broken
         4020  +ifelse([$1],[CXX],
         4021  +[case $host_os in
         4022  +interix[[3-9]]*)
         4023  +  # Interix 3.5 installs completely hosed .la files for C++, so rather than
         4024  +  # hack all around it, let's just trust "g++" to DTRT.
         4025  +  _LT_AC_TAGVAR(predep_objects,$1)=
         4026  +  _LT_AC_TAGVAR(postdep_objects,$1)=
         4027  +  _LT_AC_TAGVAR(postdeps,$1)=
         4028  +  ;;
         4029  +
         4030  +linux*)
         4031  +  case `$CC -V 2>&1 | sed 5q` in
         4032  +  *Sun\ C*)
         4033  +    # Sun C++ 5.9
         4034  +    #
         4035  +    # The more standards-conforming stlport4 library is
         4036  +    # incompatible with the Cstd library. Avoid specifying
         4037  +    # it if it's in CXXFLAGS. Ignore libCrun as
         4038  +    # -library=stlport4 depends on it.
         4039  +    case " $CXX $CXXFLAGS " in
         4040  +    *" -library=stlport4 "*)
         4041  +      solaris_use_stlport4=yes
         4042  +      ;;
         4043  +    esac
         4044  +    if test "$solaris_use_stlport4" != yes; then
         4045  +      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
         4046  +    fi
         4047  +    ;;
         4048  +  esac
         4049  +  ;;
         4050  +
         4051  +solaris*)
         4052  +  case $cc_basename in
         4053  +  CC*)
         4054  +    # The more standards-conforming stlport4 library is
         4055  +    # incompatible with the Cstd library. Avoid specifying
         4056  +    # it if it's in CXXFLAGS. Ignore libCrun as
         4057  +    # -library=stlport4 depends on it.
         4058  +    case " $CXX $CXXFLAGS " in
         4059  +    *" -library=stlport4 "*)
         4060  +      solaris_use_stlport4=yes
         4061  +      ;;
         4062  +    esac
         4063  +
         4064  +    # Adding this requires a known-good setup of shared libraries for
         4065  +    # Sun compiler versions before 5.6, else PIC objects from an old
         4066  +    # archive will be linked into the output, leading to subtle bugs.
         4067  +    if test "$solaris_use_stlport4" != yes; then
         4068  +      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
         4069  +    fi
         4070  +    ;;
         4071  +  esac
         4072  +  ;;
         4073  +esac
         4074  +])
         4075  +case " $_LT_AC_TAGVAR(postdeps, $1) " in
         4076  +*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
         4077  +esac
         4078  +])# AC_LIBTOOL_POSTDEP_PREDEP
         4079  +
         4080  +# AC_LIBTOOL_LANG_F77_CONFIG
         4081  +# --------------------------
         4082  +# Ensure that the configuration vars for the C compiler are
         4083  +# suitably defined.  Those variables are subsequently used by
         4084  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         4085  +AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
         4086  +AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
         4087  +[AC_REQUIRE([AC_PROG_F77])
         4088  +AC_LANG_PUSH(Fortran 77)
         4089  +
         4090  +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         4091  +_LT_AC_TAGVAR(allow_undefined_flag, $1)=
         4092  +_LT_AC_TAGVAR(always_export_symbols, $1)=no
         4093  +_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
         4094  +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         4095  +_LT_AC_TAGVAR(hardcode_direct, $1)=no
         4096  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         4097  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
         4098  +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         4099  +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
         4100  +_LT_AC_TAGVAR(hardcode_automatic, $1)=no
         4101  +_LT_AC_TAGVAR(module_cmds, $1)=
         4102  +_LT_AC_TAGVAR(module_expsym_cmds, $1)=
         4103  +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
         4104  +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
         4105  +_LT_AC_TAGVAR(no_undefined_flag, $1)=
         4106  +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         4107  +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
         4108  +
         4109  +# Source file extension for f77 test sources.
         4110  +ac_ext=f
         4111  +
         4112  +# Object file extension for compiled f77 test sources.
         4113  +objext=o
         4114  +_LT_AC_TAGVAR(objext, $1)=$objext
         4115  +
         4116  +# Code to be used in simple compile tests
         4117  +lt_simple_compile_test_code="\
         4118  +      subroutine t
         4119  +      return
         4120  +      end
         4121  +"
         4122  +
         4123  +# Code to be used in simple link tests
         4124  +lt_simple_link_test_code="\
         4125  +      program t
         4126  +      end
         4127  +"
         4128  +
         4129  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         4130  +_LT_AC_SYS_COMPILER
         4131  +
         4132  +# save warnings/boilerplate of simple test code
         4133  +_LT_COMPILER_BOILERPLATE
         4134  +_LT_LINKER_BOILERPLATE
         4135  +
         4136  +# Allow CC to be a program name with arguments.
         4137  +lt_save_CC="$CC"
         4138  +CC=${F77-"f77"}
         4139  +compiler=$CC
         4140  +_LT_AC_TAGVAR(compiler, $1)=$CC
         4141  +_LT_CC_BASENAME([$compiler])
         4142  +
         4143  +AC_MSG_CHECKING([if libtool supports shared libraries])
         4144  +AC_MSG_RESULT([$can_build_shared])
         4145  +
         4146  +AC_MSG_CHECKING([whether to build shared libraries])
         4147  +test "$can_build_shared" = "no" && enable_shared=no
         4148  +
         4149  +# On AIX, shared libraries and static libraries use the same namespace, and
         4150  +# are all built from PIC.
         4151  +case $host_os in
         4152  +aix3*)
         4153  +  test "$enable_shared" = yes && enable_static=no
         4154  +  if test -n "$RANLIB"; then
         4155  +    archive_cmds="$archive_cmds~\$RANLIB \$lib"
         4156  +    postinstall_cmds='$RANLIB $lib'
         4157  +  fi
         4158  +  ;;
         4159  +aix[[4-9]]*)
         4160  +  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
         4161  +    test "$enable_shared" = yes && enable_static=no
         4162  +  fi
         4163  +  ;;
         4164  +esac
         4165  +AC_MSG_RESULT([$enable_shared])
         4166  +
         4167  +AC_MSG_CHECKING([whether to build static libraries])
         4168  +# Make sure either enable_shared or enable_static is yes.
         4169  +test "$enable_shared" = yes || enable_static=yes
         4170  +AC_MSG_RESULT([$enable_static])
         4171  +
         4172  +_LT_AC_TAGVAR(GCC, $1)="$G77"
         4173  +_LT_AC_TAGVAR(LD, $1)="$LD"
         4174  +
         4175  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         4176  +AC_LIBTOOL_PROG_CC_C_O($1)
         4177  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         4178  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         4179  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         4180  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         4181  +
         4182  +AC_LIBTOOL_CONFIG($1)
         4183  +
         4184  +AC_LANG_POP
         4185  +CC="$lt_save_CC"
         4186  +])# AC_LIBTOOL_LANG_F77_CONFIG
         4187  +
         4188  +
         4189  +# AC_LIBTOOL_LANG_GCJ_CONFIG
         4190  +# --------------------------
         4191  +# Ensure that the configuration vars for the C compiler are
         4192  +# suitably defined.  Those variables are subsequently used by
         4193  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         4194  +AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
         4195  +AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
         4196  +[AC_LANG_SAVE
         4197  +
         4198  +# Source file extension for Java test sources.
         4199  +ac_ext=java
         4200  +
         4201  +# Object file extension for compiled Java test sources.
         4202  +objext=o
         4203  +_LT_AC_TAGVAR(objext, $1)=$objext
         4204  +
         4205  +# Code to be used in simple compile tests
         4206  +lt_simple_compile_test_code="class foo {}"
         4207  +
         4208  +# Code to be used in simple link tests
         4209  +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
         4210  +
         4211  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         4212  +_LT_AC_SYS_COMPILER
         4213  +
         4214  +# save warnings/boilerplate of simple test code
         4215  +_LT_COMPILER_BOILERPLATE
         4216  +_LT_LINKER_BOILERPLATE
         4217  +
         4218  +# Allow CC to be a program name with arguments.
         4219  +lt_save_CC="$CC"
         4220  +CC=${GCJ-"gcj"}
         4221  +compiler=$CC
         4222  +_LT_AC_TAGVAR(compiler, $1)=$CC
         4223  +_LT_CC_BASENAME([$compiler])
         4224  +
         4225  +# GCJ did not exist at the time GCC didn't implicitly link libc in.
         4226  +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         4227  +
         4228  +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
         4229  +
         4230  +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
         4231  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         4232  +AC_LIBTOOL_PROG_CC_C_O($1)
         4233  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         4234  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         4235  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         4236  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         4237  +
         4238  +AC_LIBTOOL_CONFIG($1)
         4239  +
         4240  +AC_LANG_RESTORE
         4241  +CC="$lt_save_CC"
         4242  +])# AC_LIBTOOL_LANG_GCJ_CONFIG
         4243  +
         4244  +
         4245  +# AC_LIBTOOL_LANG_RC_CONFIG
         4246  +# -------------------------
         4247  +# Ensure that the configuration vars for the Windows resource compiler are
         4248  +# suitably defined.  Those variables are subsequently used by
         4249  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         4250  +AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
         4251  +AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
         4252  +[AC_LANG_SAVE
         4253  +
         4254  +# Source file extension for RC test sources.
         4255  +ac_ext=rc
         4256  +
         4257  +# Object file extension for compiled RC test sources.
         4258  +objext=o
         4259  +_LT_AC_TAGVAR(objext, $1)=$objext
         4260  +
         4261  +# Code to be used in simple compile tests
         4262  +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
         4263  +
         4264  +# Code to be used in simple link tests
         4265  +lt_simple_link_test_code="$lt_simple_compile_test_code"
         4266  +
         4267  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         4268  +_LT_AC_SYS_COMPILER
         4269  +
         4270  +# save warnings/boilerplate of simple test code
         4271  +_LT_COMPILER_BOILERPLATE
         4272  +_LT_LINKER_BOILERPLATE
         4273  +
         4274  +# Allow CC to be a program name with arguments.
         4275  +lt_save_CC="$CC"
         4276  +CC=${RC-"windres"}
         4277  +compiler=$CC
         4278  +_LT_AC_TAGVAR(compiler, $1)=$CC
         4279  +_LT_CC_BASENAME([$compiler])
         4280  +_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
         4281  +
         4282  +AC_LIBTOOL_CONFIG($1)
         4283  +
         4284  +AC_LANG_RESTORE
         4285  +CC="$lt_save_CC"
         4286  +])# AC_LIBTOOL_LANG_RC_CONFIG
         4287  +
         4288  +
         4289  +# AC_LIBTOOL_CONFIG([TAGNAME])
         4290  +# ----------------------------
         4291  +# If TAGNAME is not passed, then create an initial libtool script
         4292  +# with a default configuration from the untagged config vars.  Otherwise
         4293  +# add code to config.status for appending the configuration named by
         4294  +# TAGNAME from the matching tagged config vars.
         4295  +AC_DEFUN([AC_LIBTOOL_CONFIG],
         4296  +[# The else clause should only fire when bootstrapping the
         4297  +# libtool distribution, otherwise you forgot to ship ltmain.sh
         4298  +# with your package, and you will get complaints that there are
         4299  +# no rules to generate ltmain.sh.
         4300  +if test -f "$ltmain"; then
         4301  +  # See if we are running on zsh, and set the options which allow our commands through
         4302  +  # without removal of \ escapes.
         4303  +  if test -n "${ZSH_VERSION+set}" ; then
         4304  +    setopt NO_GLOB_SUBST
         4305  +  fi
         4306  +  # Now quote all the things that may contain metacharacters while being
         4307  +  # careful not to overquote the AC_SUBSTed values.  We take copies of the
         4308  +  # variables and quote the copies for generation of the libtool script.
         4309  +  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
         4310  +    SED SHELL STRIP \
         4311  +    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
         4312  +    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
         4313  +    deplibs_check_method reload_flag reload_cmds need_locks \
         4314  +    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
         4315  +    lt_cv_sys_global_symbol_to_c_name_address \
         4316  +    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
         4317  +    old_postinstall_cmds old_postuninstall_cmds \
         4318  +    _LT_AC_TAGVAR(compiler, $1) \
         4319  +    _LT_AC_TAGVAR(CC, $1) \
         4320  +    _LT_AC_TAGVAR(LD, $1) \
         4321  +    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
         4322  +    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
         4323  +    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
         4324  +    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
         4325  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
         4326  +    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
         4327  +    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
         4328  +    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
         4329  +    _LT_AC_TAGVAR(old_archive_cmds, $1) \
         4330  +    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
         4331  +    _LT_AC_TAGVAR(predep_objects, $1) \
         4332  +    _LT_AC_TAGVAR(postdep_objects, $1) \
         4333  +    _LT_AC_TAGVAR(predeps, $1) \
         4334  +    _LT_AC_TAGVAR(postdeps, $1) \
         4335  +    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
         4336  +    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
         4337  +    _LT_AC_TAGVAR(archive_cmds, $1) \
         4338  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
         4339  +    _LT_AC_TAGVAR(postinstall_cmds, $1) \
         4340  +    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
         4341  +    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
         4342  +    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
         4343  +    _LT_AC_TAGVAR(no_undefined_flag, $1) \
         4344  +    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
         4345  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
         4346  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
         4347  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
         4348  +    _LT_AC_TAGVAR(hardcode_automatic, $1) \
         4349  +    _LT_AC_TAGVAR(module_cmds, $1) \
         4350  +    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
         4351  +    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
         4352  +    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
         4353  +    _LT_AC_TAGVAR(exclude_expsyms, $1) \
         4354  +    _LT_AC_TAGVAR(include_expsyms, $1); do
         4355  +
         4356  +    case $var in
         4357  +    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
         4358  +    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
         4359  +    _LT_AC_TAGVAR(archive_cmds, $1) | \
         4360  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
         4361  +    _LT_AC_TAGVAR(module_cmds, $1) | \
         4362  +    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
         4363  +    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
         4364  +    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
         4365  +    extract_expsyms_cmds | reload_cmds | finish_cmds | \
         4366  +    postinstall_cmds | postuninstall_cmds | \
         4367  +    old_postinstall_cmds | old_postuninstall_cmds | \
         4368  +    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
         4369  +      # Double-quote double-evaled strings.
         4370  +      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
         4371  +      ;;
         4372  +    *)
         4373  +      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
         4374  +      ;;
         4375  +    esac
         4376  +  done
         4377  +
         4378  +  case $lt_echo in
         4379  +  *'\[$]0 --fallback-echo"')
         4380  +    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
         4381  +    ;;
         4382  +  esac
         4383  +
         4384  +ifelse([$1], [],
         4385  +  [cfgfile="${ofile}T"
         4386  +  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
         4387  +  $rm -f "$cfgfile"
         4388  +  AC_MSG_NOTICE([creating $ofile])],
         4389  +  [cfgfile="$ofile"])
         4390  +
         4391  +  cat <<__EOF__ >> "$cfgfile"
         4392  +ifelse([$1], [],
         4393  +[#! $SHELL
         4394  +
         4395  +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
         4396  +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
         4397  +# NOTE: Changes made to this file will be lost: look at ltmain.sh.
         4398  +#
         4399  +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
         4400  +# Free Software Foundation, Inc.
         4401  +#
         4402  +# This file is part of GNU Libtool:
         4403  +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    27   4404   #
    28   4405   # This program is free software; you can redistribute it and/or modify
    29   4406   # it under the terms of the GNU General Public License as published by
    30   4407   # the Free Software Foundation; either version 2 of the License, or
    31   4408   # (at your option) any later version.
    32   4409   #
    33   4410   # This program is distributed in the hope that it will be useful, but
    34   4411   # WITHOUT ANY WARRANTY; without even the implied warranty of
    35   4412   # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    36   4413   # General Public License for more details.
    37   4414   #
    38   4415   # You should have received a copy of the GNU General Public License
    39   4416   # along with this program; if not, write to the Free Software
    40         -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
         4417  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    41   4418   #
    42   4419   # As a special exception to the GNU General Public License, if you
    43   4420   # distribute this file as part of a program that contains a
    44   4421   # configuration script generated by Autoconf, you may include it under
    45   4422   # the same distribution terms that you use for the rest of that program.
    46   4423   
    47         -# PKG_PROG_PKG_CONFIG([MIN-VERSION])
    48         -# ----------------------------------
    49         -AC_DEFUN([PKG_PROG_PKG_CONFIG],
    50         -[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
    51         -m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
    52         -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
    53         -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
    54         -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
    55         -
    56         -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
    57         -	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
    58         -fi
    59         -if test -n "$PKG_CONFIG"; then
    60         -	_pkg_min_version=m4_default([$1], [0.9.0])
    61         -	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
    62         -	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
    63         -		AC_MSG_RESULT([yes])
         4424  +# A sed program that does not truncate output.
         4425  +SED=$lt_SED
         4426  +
         4427  +# Sed that helps us avoid accidentally triggering echo(1) options like -n.
         4428  +Xsed="$SED -e 1s/^X//"
         4429  +
         4430  +# The HP-UX ksh and POSIX shell print the target directory to stdout
         4431  +# if CDPATH is set.
         4432  +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
         4433  +
         4434  +# The names of the tagged configurations supported by this script.
         4435  +available_tags=
         4436  +
         4437  +# ### BEGIN LIBTOOL CONFIG],
         4438  +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
         4439  +
         4440  +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
         4441  +
         4442  +# Shell to use when invoking shell scripts.
         4443  +SHELL=$lt_SHELL
         4444  +
         4445  +# Whether or not to build shared libraries.
         4446  +build_libtool_libs=$enable_shared
         4447  +
         4448  +# Whether or not to build static libraries.
         4449  +build_old_libs=$enable_static
         4450  +
         4451  +# Whether or not to add -lc for building shared libraries.
         4452  +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
         4453  +
         4454  +# Whether or not to disallow shared libs when runtime libs are static
         4455  +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
         4456  +
         4457  +# Whether or not to optimize for fast installation.
         4458  +fast_install=$enable_fast_install
         4459  +
         4460  +# The host system.
         4461  +host_alias=$host_alias
         4462  +host=$host
         4463  +host_os=$host_os
         4464  +
         4465  +# The build system.
         4466  +build_alias=$build_alias
         4467  +build=$build
         4468  +build_os=$build_os
         4469  +
         4470  +# An echo program that does not interpret backslashes.
         4471  +echo=$lt_echo
         4472  +
         4473  +# The archiver.
         4474  +AR=$lt_AR
         4475  +AR_FLAGS=$lt_AR_FLAGS
         4476  +
         4477  +# A C compiler.
         4478  +LTCC=$lt_LTCC
         4479  +
         4480  +# LTCC compiler flags.
         4481  +LTCFLAGS=$lt_LTCFLAGS
         4482  +
         4483  +# A language-specific compiler.
         4484  +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
         4485  +
         4486  +# Is the compiler the GNU C compiler?
         4487  +with_gcc=$_LT_AC_TAGVAR(GCC, $1)
         4488  +
         4489  +# An ERE matcher.
         4490  +EGREP=$lt_EGREP
         4491  +
         4492  +# The linker used to build libraries.
         4493  +LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
         4494  +
         4495  +# Whether we need hard or soft links.
         4496  +LN_S=$lt_LN_S
         4497  +
         4498  +# A BSD-compatible nm program.
         4499  +NM=$lt_NM
         4500  +
         4501  +# A symbol stripping program
         4502  +STRIP=$lt_STRIP
         4503  +
         4504  +# Used to examine libraries when file_magic_cmd begins "file"
         4505  +MAGIC_CMD=$MAGIC_CMD
         4506  +
         4507  +# Used on cygwin: DLL creation program.
         4508  +DLLTOOL="$DLLTOOL"
         4509  +
         4510  +# Used on cygwin: object dumper.
         4511  +OBJDUMP="$OBJDUMP"
         4512  +
         4513  +# Used on cygwin: assembler.
         4514  +AS="$AS"
         4515  +
         4516  +# The name of the directory that contains temporary libtool files.
         4517  +objdir=$objdir
         4518  +
         4519  +# How to create reloadable object files.
         4520  +reload_flag=$lt_reload_flag
         4521  +reload_cmds=$lt_reload_cmds
         4522  +
         4523  +# How to pass a linker flag through the compiler.
         4524  +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
         4525  +
         4526  +# Object file suffix (normally "o").
         4527  +objext="$ac_objext"
         4528  +
         4529  +# Old archive suffix (normally "a").
         4530  +libext="$libext"
         4531  +
         4532  +# Shared library suffix (normally ".so").
         4533  +shrext_cmds='$shrext_cmds'
         4534  +
         4535  +# Executable file suffix (normally "").
         4536  +exeext="$exeext"
         4537  +
         4538  +# Additional compiler flags for building library objects.
         4539  +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
         4540  +pic_mode=$pic_mode
         4541  +
         4542  +# What is the maximum length of a command?
         4543  +max_cmd_len=$lt_cv_sys_max_cmd_len
         4544  +
         4545  +# Does compiler simultaneously support -c and -o options?
         4546  +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
         4547  +
         4548  +# Must we lock files when doing compilation?
         4549  +need_locks=$lt_need_locks
         4550  +
         4551  +# Do we need the lib prefix for modules?
         4552  +need_lib_prefix=$need_lib_prefix
         4553  +
         4554  +# Do we need a version for libraries?
         4555  +need_version=$need_version
         4556  +
         4557  +# Whether dlopen is supported.
         4558  +dlopen_support=$enable_dlopen
         4559  +
         4560  +# Whether dlopen of programs is supported.
         4561  +dlopen_self=$enable_dlopen_self
         4562  +
         4563  +# Whether dlopen of statically linked programs is supported.
         4564  +dlopen_self_static=$enable_dlopen_self_static
         4565  +
         4566  +# Compiler flag to prevent dynamic linking.
         4567  +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
         4568  +
         4569  +# Compiler flag to turn off builtin functions.
         4570  +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
         4571  +
         4572  +# Compiler flag to allow reflexive dlopens.
         4573  +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
         4574  +
         4575  +# Compiler flag to generate shared objects directly from archives.
         4576  +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
         4577  +
         4578  +# Compiler flag to generate thread-safe objects.
         4579  +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
         4580  +
         4581  +# Library versioning type.
         4582  +version_type=$version_type
         4583  +
         4584  +# Format of library name prefix.
         4585  +libname_spec=$lt_libname_spec
         4586  +
         4587  +# List of archive names.  First name is the real one, the rest are links.
         4588  +# The last name is the one that the linker finds with -lNAME.
         4589  +library_names_spec=$lt_library_names_spec
         4590  +
         4591  +# The coded name of the library, if different from the real name.
         4592  +soname_spec=$lt_soname_spec
         4593  +
         4594  +# Commands used to build and install an old-style archive.
         4595  +RANLIB=$lt_RANLIB
         4596  +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
         4597  +old_postinstall_cmds=$lt_old_postinstall_cmds
         4598  +old_postuninstall_cmds=$lt_old_postuninstall_cmds
         4599  +
         4600  +# Create an old-style archive from a shared archive.
         4601  +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
         4602  +
         4603  +# Create a temporary old-style archive to link instead of a shared archive.
         4604  +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
         4605  +
         4606  +# Commands used to build and install a shared archive.
         4607  +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
         4608  +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
         4609  +postinstall_cmds=$lt_postinstall_cmds
         4610  +postuninstall_cmds=$lt_postuninstall_cmds
         4611  +
         4612  +# Commands used to build a loadable module (assumed same as above if empty)
         4613  +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
         4614  +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
         4615  +
         4616  +# Commands to strip libraries.
         4617  +old_striplib=$lt_old_striplib
         4618  +striplib=$lt_striplib
         4619  +
         4620  +# Dependencies to place before the objects being linked to create a
         4621  +# shared library.
         4622  +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
         4623  +
         4624  +# Dependencies to place after the objects being linked to create a
         4625  +# shared library.
         4626  +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
         4627  +
         4628  +# Dependencies to place before the objects being linked to create a
         4629  +# shared library.
         4630  +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
         4631  +
         4632  +# Dependencies to place after the objects being linked to create a
         4633  +# shared library.
         4634  +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
         4635  +
         4636  +# The directories searched by this compiler when creating a shared
         4637  +# library
         4638  +compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
         4639  +
         4640  +# The library search path used internally by the compiler when linking
         4641  +# a shared library.
         4642  +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
         4643  +
         4644  +# Method to check whether dependent libraries are shared objects.
         4645  +deplibs_check_method=$lt_deplibs_check_method
         4646  +
         4647  +# Command to use when deplibs_check_method == file_magic.
         4648  +file_magic_cmd=$lt_file_magic_cmd
         4649  +
         4650  +# Flag that allows shared libraries with undefined symbols to be built.
         4651  +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
         4652  +
         4653  +# Flag that forces no undefined symbols.
         4654  +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
         4655  +
         4656  +# Commands used to finish a libtool library installation in a directory.
         4657  +finish_cmds=$lt_finish_cmds
         4658  +
         4659  +# Same as above, but a single script fragment to be evaled but not shown.
         4660  +finish_eval=$lt_finish_eval
         4661  +
         4662  +# Take the output of nm and produce a listing of raw symbols and C names.
         4663  +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
         4664  +
         4665  +# Transform the output of nm in a proper C declaration
         4666  +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
         4667  +
         4668  +# Transform the output of nm in a C name address pair
         4669  +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
         4670  +
         4671  +# This is the shared library runtime path variable.
         4672  +runpath_var=$runpath_var
         4673  +
         4674  +# This is the shared library path variable.
         4675  +shlibpath_var=$shlibpath_var
         4676  +
         4677  +# Is shlibpath searched before the hard-coded library search path?
         4678  +shlibpath_overrides_runpath=$shlibpath_overrides_runpath
         4679  +
         4680  +# How to hardcode a shared library path into an executable.
         4681  +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
         4682  +
         4683  +# Whether we should hardcode library paths into libraries.
         4684  +hardcode_into_libs=$hardcode_into_libs
         4685  +
         4686  +# Flag to hardcode \$libdir into a binary during linking.
         4687  +# This must work even if \$libdir does not exist.
         4688  +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
         4689  +
         4690  +# If ld is used when linking, flag to hardcode \$libdir into
         4691  +# a binary during linking. This must work even if \$libdir does
         4692  +# not exist.
         4693  +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
         4694  +
         4695  +# Whether we need a single -rpath flag with a separated argument.
         4696  +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
         4697  +
         4698  +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
         4699  +# resulting binary.
         4700  +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
         4701  +
         4702  +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
         4703  +# resulting binary.
         4704  +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
         4705  +
         4706  +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
         4707  +# the resulting binary.
         4708  +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
         4709  +
         4710  +# Set to yes if building a shared library automatically hardcodes DIR into the library
         4711  +# and all subsequent libraries and executables linked against it.
         4712  +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
         4713  +
         4714  +# Variables whose values should be saved in libtool wrapper scripts and
         4715  +# restored at relink time.
         4716  +variables_saved_for_relink="$variables_saved_for_relink"
         4717  +
         4718  +# Whether libtool must link a program against all its dependency libraries.
         4719  +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
         4720  +
         4721  +# Compile-time system search path for libraries
         4722  +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
         4723  +
         4724  +# Run-time system search path for libraries
         4725  +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
         4726  +
         4727  +# Fix the shell variable \$srcfile for the compiler.
         4728  +fix_srcfile_path=$lt_fix_srcfile_path
         4729  +
         4730  +# Set to yes if exported symbols are required.
         4731  +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
         4732  +
         4733  +# The commands to list exported symbols.
         4734  +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
         4735  +
         4736  +# The commands to extract the exported symbol list from a shared archive.
         4737  +extract_expsyms_cmds=$lt_extract_expsyms_cmds
         4738  +
         4739  +# Symbols that should not be listed in the preloaded symbols.
         4740  +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
         4741  +
         4742  +# Symbols that must always be exported.
         4743  +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
         4744  +
         4745  +ifelse([$1],[],
         4746  +[# ### END LIBTOOL CONFIG],
         4747  +[# ### END LIBTOOL TAG CONFIG: $tagname])
         4748  +
         4749  +__EOF__
         4750  +
         4751  +ifelse([$1],[], [
         4752  +  case $host_os in
         4753  +  aix3*)
         4754  +    cat <<\EOF >> "$cfgfile"
         4755  +
         4756  +# AIX sometimes has problems with the GCC collect2 program.  For some
         4757  +# reason, if we set the COLLECT_NAMES environment variable, the problems
         4758  +# vanish in a puff of smoke.
         4759  +if test "X${COLLECT_NAMES+set}" != Xset; then
         4760  +  COLLECT_NAMES=
         4761  +  export COLLECT_NAMES
         4762  +fi
         4763  +EOF
         4764  +    ;;
         4765  +  esac
         4766  +
         4767  +  # We use sed instead of cat because bash on DJGPP gets confused if
         4768  +  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
         4769  +  # text mode, it properly converts lines to CR/LF.  This bash problem
         4770  +  # is reportedly fixed, but why not run on old versions too?
         4771  +  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
         4772  +
         4773  +  mv -f "$cfgfile" "$ofile" || \
         4774  +    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
         4775  +  chmod +x "$ofile"
         4776  +])
         4777  +else
         4778  +  # If there is no Makefile yet, we rely on a make rule to execute
         4779  +  # `config.status --recheck' to rerun these tests and create the
         4780  +  # libtool script then.
         4781  +  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
         4782  +  if test -f "$ltmain_in"; then
         4783  +    test -f Makefile && make "$ltmain"
         4784  +  fi
         4785  +fi
         4786  +])# AC_LIBTOOL_CONFIG
         4787  +
         4788  +
         4789  +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
         4790  +# -------------------------------------------
         4791  +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
         4792  +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
         4793  +
         4794  +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
         4795  +
         4796  +if test "$GCC" = yes; then
         4797  +  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
         4798  +
         4799  +  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
         4800  +    lt_cv_prog_compiler_rtti_exceptions,
         4801  +    [-fno-rtti -fno-exceptions], [],
         4802  +    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
         4803  +fi
         4804  +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
         4805  +
         4806  +
         4807  +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
         4808  +# ---------------------------------
         4809  +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
         4810  +[AC_REQUIRE([AC_CANONICAL_HOST])
         4811  +AC_REQUIRE([LT_AC_PROG_SED])
         4812  +AC_REQUIRE([AC_PROG_NM])
         4813  +AC_REQUIRE([AC_OBJEXT])
         4814  +# Check for command to grab the raw symbol name followed by C symbol from nm.
         4815  +AC_MSG_CHECKING([command to parse $NM output from $compiler object])
         4816  +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
         4817  +[
         4818  +# These are sane defaults that work on at least a few old systems.
         4819  +# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
         4820  +
         4821  +# Character class describing NM global symbol codes.
         4822  +symcode='[[BCDEGRST]]'
         4823  +
         4824  +# Regexp to match symbols that can be accessed directly from C.
         4825  +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
         4826  +
         4827  +# Transform an extracted symbol line into a proper C declaration
         4828  +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
         4829  +
         4830  +# Transform an extracted symbol line into symbol name and symbol address
         4831  +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
         4832  +
         4833  +# Define system-specific variables.
         4834  +case $host_os in
         4835  +aix*)
         4836  +  symcode='[[BCDT]]'
         4837  +  ;;
         4838  +cygwin* | mingw* | pw32*)
         4839  +  symcode='[[ABCDGISTW]]'
         4840  +  ;;
         4841  +hpux*) # Its linker distinguishes data from code symbols
         4842  +  if test "$host_cpu" = ia64; then
         4843  +    symcode='[[ABCDEGRST]]'
         4844  +  fi
         4845  +  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
         4846  +  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
         4847  +  ;;
         4848  +linux* | k*bsd*-gnu)
         4849  +  if test "$host_cpu" = ia64; then
         4850  +    symcode='[[ABCDGIRSTW]]'
         4851  +    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
         4852  +    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
         4853  +  fi
         4854  +  ;;
         4855  +irix* | nonstopux*)
         4856  +  symcode='[[BCDEGRST]]'
         4857  +  ;;
         4858  +osf*)
         4859  +  symcode='[[BCDEGQRST]]'
         4860  +  ;;
         4861  +solaris*)
         4862  +  symcode='[[BDRT]]'
         4863  +  ;;
         4864  +sco3.2v5*)
         4865  +  symcode='[[DT]]'
         4866  +  ;;
         4867  +sysv4.2uw2*)
         4868  +  symcode='[[DT]]'
         4869  +  ;;
         4870  +sysv5* | sco5v6* | unixware* | OpenUNIX*)
         4871  +  symcode='[[ABDT]]'
         4872  +  ;;
         4873  +sysv4)
         4874  +  symcode='[[DFNSTU]]'
         4875  +  ;;
         4876  +esac
         4877  +
         4878  +# Handle CRLF in mingw tool chain
         4879  +opt_cr=
         4880  +case $build_os in
         4881  +mingw*)
         4882  +  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
         4883  +  ;;
         4884  +esac
         4885  +
         4886  +# If we're using GNU nm, then use its standard symbol codes.
         4887  +case `$NM -V 2>&1` in
         4888  +*GNU* | *'with BFD'*)
         4889  +  symcode='[[ABCDGIRSTW]]' ;;
         4890  +esac
         4891  +
         4892  +# Try without a prefix undercore, then with it.
         4893  +for ac_symprfx in "" "_"; do
         4894  +
         4895  +  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
         4896  +  symxfrm="\\1 $ac_symprfx\\2 \\2"
         4897  +
         4898  +  # Write the raw and C identifiers.
         4899  +  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
         4900  +
         4901  +  # Check to see that the pipe works correctly.
         4902  +  pipe_works=no
         4903  +
         4904  +  rm -f conftest*
         4905  +  cat > conftest.$ac_ext <<EOF
         4906  +#ifdef __cplusplus
         4907  +extern "C" {
         4908  +#endif
         4909  +char nm_test_var;
         4910  +void nm_test_func(){}
         4911  +#ifdef __cplusplus
         4912  +}
         4913  +#endif
         4914  +int main(){nm_test_var='a';nm_test_func();return(0);}
         4915  +EOF
         4916  +
         4917  +  if AC_TRY_EVAL(ac_compile); then
         4918  +    # Now try to grab the symbols.
         4919  +    nlist=conftest.nm
         4920  +    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
         4921  +      # Try sorting and uniquifying the output.
         4922  +      if sort "$nlist" | uniq > "$nlist"T; then
         4923  +	mv -f "$nlist"T "$nlist"
         4924  +      else
         4925  +	rm -f "$nlist"T
         4926  +      fi
         4927  +
         4928  +      # Make sure that we snagged all the symbols we need.
         4929  +      if grep ' nm_test_var$' "$nlist" >/dev/null; then
         4930  +	if grep ' nm_test_func$' "$nlist" >/dev/null; then
         4931  +	  cat <<EOF > conftest.$ac_ext
         4932  +#ifdef __cplusplus
         4933  +extern "C" {
         4934  +#endif
         4935  +
         4936  +EOF
         4937  +	  # Now generate the symbol file.
         4938  +	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
         4939  +
         4940  +	  cat <<EOF >> conftest.$ac_ext
         4941  +#if defined (__STDC__) && __STDC__
         4942  +# define lt_ptr_t void *
         4943  +#else
         4944  +# define lt_ptr_t char *
         4945  +# define const
         4946  +#endif
         4947  +
         4948  +/* The mapping between symbol names and symbols. */
         4949  +const struct {
         4950  +  const char *name;
         4951  +  lt_ptr_t address;
         4952  +}
         4953  +lt_preloaded_symbols[[]] =
         4954  +{
         4955  +EOF
         4956  +	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
         4957  +	  cat <<\EOF >> conftest.$ac_ext
         4958  +  {0, (lt_ptr_t) 0}
         4959  +};
         4960  +
         4961  +#ifdef __cplusplus
         4962  +}
         4963  +#endif
         4964  +EOF
         4965  +	  # Now try linking the two files.
         4966  +	  mv conftest.$ac_objext conftstm.$ac_objext
         4967  +	  lt_save_LIBS="$LIBS"
         4968  +	  lt_save_CFLAGS="$CFLAGS"
         4969  +	  LIBS="conftstm.$ac_objext"
         4970  +	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
         4971  +	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
         4972  +	    pipe_works=yes
         4973  +	  fi
         4974  +	  LIBS="$lt_save_LIBS"
         4975  +	  CFLAGS="$lt_save_CFLAGS"
         4976  +	else
         4977  +	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
         4978  +	fi
         4979  +      else
         4980  +	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
         4981  +      fi
         4982  +    else
         4983  +      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
         4984  +    fi
         4985  +  else
         4986  +    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
         4987  +    cat conftest.$ac_ext >&5
         4988  +  fi
         4989  +  rm -rf conftest* conftst*
         4990  +
         4991  +  # Do not use the global_symbol_pipe unless it works.
         4992  +  if test "$pipe_works" = yes; then
         4993  +    break
         4994  +  else
         4995  +    lt_cv_sys_global_symbol_pipe=
         4996  +  fi
         4997  +done
         4998  +])
         4999  +if test -z "$lt_cv_sys_global_symbol_pipe"; then
         5000  +  lt_cv_sys_global_symbol_to_cdecl=
         5001  +fi
         5002  +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
         5003  +  AC_MSG_RESULT(failed)
         5004  +else
         5005  +  AC_MSG_RESULT(ok)
         5006  +fi
         5007  +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
         5008  +
         5009  +
         5010  +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
         5011  +# ---------------------------------------
         5012  +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
         5013  +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
         5014  +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5015  +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
         5016  +
         5017  +AC_MSG_CHECKING([for $compiler option to produce PIC])
         5018  + ifelse([$1],[CXX],[
         5019  +  # C++ specific cases for pic, static, wl, etc.
         5020  +  if test "$GXX" = yes; then
         5021  +    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5022  +    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5023  +
         5024  +    case $host_os in
         5025  +    aix*)
         5026  +      # All AIX code is PIC.
         5027  +      if test "$host_cpu" = ia64; then
         5028  +	# AIX 5 now supports IA64 processor
         5029  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5030  +      fi
         5031  +      ;;
         5032  +    amigaos*)
         5033  +      # FIXME: we need at least 68020 code to build shared libraries, but
         5034  +      # adding the `-m68020' flag to GCC prevents building anything better,
         5035  +      # like `-m68040'.
         5036  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         5037  +      ;;
         5038  +    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
         5039  +      # PIC is the default for these OSes.
         5040  +      ;;
         5041  +    mingw* | cygwin* | os2* | pw32*)
         5042  +      # This hack is so that the source file can tell whether it is being
         5043  +      # built for inclusion in a dll (and should export symbols for example).
         5044  +      # Although the cygwin gcc ignores -fPIC, still need this for old-style
         5045  +      # (--disable-auto-import) libraries
         5046  +      m4_if([$1], [GCJ], [],
         5047  +	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
         5048  +      ;;
         5049  +    darwin* | rhapsody*)
         5050  +      # PIC is the default on this platform
         5051  +      # Common symbols not allowed in MH_DYLIB files
         5052  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
         5053  +      ;;
         5054  +    *djgpp*)
         5055  +      # DJGPP does not support shared libraries at all
         5056  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5057  +      ;;
         5058  +    interix[[3-9]]*)
         5059  +      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
         5060  +      # Instead, we relocate shared libraries at runtime.
         5061  +      ;;
         5062  +    sysv4*MP*)
         5063  +      if test -d /usr/nec; then
         5064  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
         5065  +      fi
         5066  +      ;;
         5067  +    hpux*)
         5068  +      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
         5069  +      # not for PA HP-UX.
         5070  +      case $host_cpu in
         5071  +      hppa*64*|ia64*)
         5072  +	;;
         5073  +      *)
         5074  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5075  +	;;
         5076  +      esac
         5077  +      ;;
         5078  +    *)
         5079  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5080  +      ;;
         5081  +    esac
         5082  +  else
         5083  +    case $host_os in
         5084  +      aix[[4-9]]*)
         5085  +	# All AIX code is PIC.
         5086  +	if test "$host_cpu" = ia64; then
         5087  +	  # AIX 5 now supports IA64 processor
         5088  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5089  +	else
         5090  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
         5091  +	fi
         5092  +	;;
         5093  +      chorus*)
         5094  +	case $cc_basename in
         5095  +	cxch68*)
         5096  +	  # Green Hills C++ Compiler
         5097  +	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
         5098  +	  ;;
         5099  +	esac
         5100  +	;;
         5101  +       darwin*)
         5102  +         # PIC is the default on this platform
         5103  +         # Common symbols not allowed in MH_DYLIB files
         5104  +         case $cc_basename in
         5105  +           xlc*)
         5106  +           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
         5107  +           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5108  +           ;;
         5109  +         esac
         5110  +       ;;
         5111  +      dgux*)
         5112  +	case $cc_basename in
         5113  +	  ec++*)
         5114  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5115  +	    ;;
         5116  +	  ghcx*)
         5117  +	    # Green Hills C++ Compiler
         5118  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5119  +	    ;;
         5120  +	  *)
         5121  +	    ;;
         5122  +	esac
         5123  +	;;
         5124  +      freebsd* | dragonfly*)
         5125  +	# FreeBSD uses GNU C++
         5126  +	;;
         5127  +      hpux9* | hpux10* | hpux11*)
         5128  +	case $cc_basename in
         5129  +	  CC*)
         5130  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5131  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
         5132  +	    if test "$host_cpu" != ia64; then
         5133  +	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
         5134  +	    fi
         5135  +	    ;;
         5136  +	  aCC*)
         5137  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5138  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
         5139  +	    case $host_cpu in
         5140  +	    hppa*64*|ia64*)
         5141  +	      # +Z the default
         5142  +	      ;;
         5143  +	    *)
         5144  +	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
         5145  +	      ;;
         5146  +	    esac
         5147  +	    ;;
         5148  +	  *)
         5149  +	    ;;
         5150  +	esac
         5151  +	;;
         5152  +      interix*)
         5153  +	# This is c89, which is MS Visual C++ (no shared libs)
         5154  +	# Anyone wants to do a port?
         5155  +	;;
         5156  +      irix5* | irix6* | nonstopux*)
         5157  +	case $cc_basename in
         5158  +	  CC*)
         5159  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5160  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5161  +	    # CC pic flag -KPIC is the default.
         5162  +	    ;;
         5163  +	  *)
         5164  +	    ;;
         5165  +	esac
         5166  +	;;
         5167  +      linux* | k*bsd*-gnu)
         5168  +	case $cc_basename in
         5169  +	  KCC*)
         5170  +	    # KAI C++ Compiler
         5171  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
         5172  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5173  +	    ;;
         5174  +	  icpc* | ecpc*)
         5175  +	    # Intel C++
         5176  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5177  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5178  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5179  +	    ;;
         5180  +	  pgCC* | pgcpp*)
         5181  +	    # Portland Group C++ compiler.
         5182  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5183  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
         5184  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5185  +	    ;;
         5186  +	  cxx*)
         5187  +	    # Compaq C++
         5188  +	    # Make sure the PIC flag is empty.  It appears that all Alpha
         5189  +	    # Linux and Compaq Tru64 Unix objects are PIC.
         5190  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5191  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5192  +	    ;;
         5193  +	  *)
         5194  +	    case `$CC -V 2>&1 | sed 5q` in
         5195  +	    *Sun\ C*)
         5196  +	      # Sun C++ 5.9
         5197  +	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5198  +	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5199  +	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
         5200  +	      ;;
         5201  +	    esac
         5202  +	    ;;
         5203  +	esac
         5204  +	;;
         5205  +      lynxos*)
         5206  +	;;
         5207  +      m88k*)
         5208  +	;;
         5209  +      mvs*)
         5210  +	case $cc_basename in
         5211  +	  cxx*)
         5212  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
         5213  +	    ;;
         5214  +	  *)
         5215  +	    ;;
         5216  +	esac
         5217  +	;;
         5218  +      netbsd* | netbsdelf*-gnu)
         5219  +	;;
         5220  +      osf3* | osf4* | osf5*)
         5221  +	case $cc_basename in
         5222  +	  KCC*)
         5223  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
         5224  +	    ;;
         5225  +	  RCC*)
         5226  +	    # Rational C++ 2.4.1
         5227  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5228  +	    ;;
         5229  +	  cxx*)
         5230  +	    # Digital/Compaq C++
         5231  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5232  +	    # Make sure the PIC flag is empty.  It appears that all Alpha
         5233  +	    # Linux and Compaq Tru64 Unix objects are PIC.
         5234  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5235  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5236  +	    ;;
         5237  +	  *)
         5238  +	    ;;
         5239  +	esac
         5240  +	;;
         5241  +      psos*)
         5242  +	;;
         5243  +      solaris*)
         5244  +	case $cc_basename in
         5245  +	  CC*)
         5246  +	    # Sun C++ 4.2, 5.x and Centerline C++
         5247  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5248  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5249  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
         5250  +	    ;;
         5251  +	  gcx*)
         5252  +	    # Green Hills C++ Compiler
         5253  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
         5254  +	    ;;
         5255  +	  *)
         5256  +	    ;;
         5257  +	esac
         5258  +	;;
         5259  +      sunos4*)
         5260  +	case $cc_basename in
         5261  +	  CC*)
         5262  +	    # Sun C++ 4.x
         5263  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5264  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5265  +	    ;;
         5266  +	  lcc*)
         5267  +	    # Lucid
         5268  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5269  +	    ;;
         5270  +	  *)
         5271  +	    ;;
         5272  +	esac
         5273  +	;;
         5274  +      tandem*)
         5275  +	case $cc_basename in
         5276  +	  NCC*)
         5277  +	    # NonStop-UX NCC 3.20
         5278  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5279  +	    ;;
         5280  +	  *)
         5281  +	    ;;
         5282  +	esac
         5283  +	;;
         5284  +      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
         5285  +	case $cc_basename in
         5286  +	  CC*)
         5287  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5288  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5289  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5290  +	    ;;
         5291  +	esac
         5292  +	;;
         5293  +      vxworks*)
         5294  +	;;
         5295  +      *)
         5296  +	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5297  +	;;
         5298  +    esac
         5299  +  fi
         5300  +],
         5301  +[
         5302  +  if test "$GCC" = yes; then
         5303  +    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5304  +    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5305  +
         5306  +    case $host_os in
         5307  +      aix*)
         5308  +      # All AIX code is PIC.
         5309  +      if test "$host_cpu" = ia64; then
         5310  +	# AIX 5 now supports IA64 processor
         5311  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5312  +      fi
         5313  +      ;;
         5314  +
         5315  +    amigaos*)
         5316  +      # FIXME: we need at least 68020 code to build shared libraries, but
         5317  +      # adding the `-m68020' flag to GCC prevents building anything better,
         5318  +      # like `-m68040'.
         5319  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         5320  +      ;;
         5321  +
         5322  +    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
         5323  +      # PIC is the default for these OSes.
         5324  +      ;;
         5325  +
         5326  +    mingw* | cygwin* | pw32* | os2*)
         5327  +      # This hack is so that the source file can tell whether it is being
         5328  +      # built for inclusion in a dll (and should export symbols for example).
         5329  +      # Although the cygwin gcc ignores -fPIC, still need this for old-style
         5330  +      # (--disable-auto-import) libraries
         5331  +      m4_if([$1], [GCJ], [],
         5332  +	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
         5333  +      ;;
         5334  +
         5335  +    darwin* | rhapsody*)
         5336  +      # PIC is the default on this platform
         5337  +      # Common symbols not allowed in MH_DYLIB files
         5338  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
         5339  +      ;;
         5340  +
         5341  +    interix[[3-9]]*)
         5342  +      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
         5343  +      # Instead, we relocate shared libraries at runtime.
         5344  +      ;;
         5345  +
         5346  +    msdosdjgpp*)
         5347  +      # Just because we use GCC doesn't mean we suddenly get shared libraries
         5348  +      # on systems that don't support them.
         5349  +      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5350  +      enable_shared=no
         5351  +      ;;
         5352  +
         5353  +    sysv4*MP*)
         5354  +      if test -d /usr/nec; then
         5355  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
         5356  +      fi
         5357  +      ;;
         5358  +
         5359  +    hpux*)
         5360  +      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
         5361  +      # not for PA HP-UX.
         5362  +      case $host_cpu in
         5363  +      hppa*64*|ia64*)
         5364  +	# +Z the default
         5365  +	;;
         5366  +      *)
         5367  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5368  +	;;
         5369  +      esac
         5370  +      ;;
         5371  +
         5372  +    *)
         5373  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5374  +      ;;
         5375  +    esac
         5376  +  else
         5377  +    # PORTME Check for flag to pass linker flags through the system compiler.
         5378  +    case $host_os in
         5379  +    aix*)
         5380  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5381  +      if test "$host_cpu" = ia64; then
         5382  +	# AIX 5 now supports IA64 processor
         5383  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5384  +      else
         5385  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
         5386  +      fi
         5387  +      ;;
         5388  +      darwin*)
         5389  +        # PIC is the default on this platform
         5390  +        # Common symbols not allowed in MH_DYLIB files
         5391  +       case $cc_basename in
         5392  +         xlc*)
         5393  +         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
         5394  +         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5395  +         ;;
         5396  +       esac
         5397  +       ;;
         5398  +
         5399  +    mingw* | cygwin* | pw32* | os2*)
         5400  +      # This hack is so that the source file can tell whether it is being
         5401  +      # built for inclusion in a dll (and should export symbols for example).
         5402  +      m4_if([$1], [GCJ], [],
         5403  +	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
         5404  +      ;;
         5405  +
         5406  +    hpux9* | hpux10* | hpux11*)
         5407  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5408  +      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
         5409  +      # not for PA HP-UX.
         5410  +      case $host_cpu in
         5411  +      hppa*64*|ia64*)
         5412  +	# +Z the default
         5413  +	;;
         5414  +      *)
         5415  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
         5416  +	;;
         5417  +      esac
         5418  +      # Is there a better lt_prog_compiler_static that works with the bundled CC?
         5419  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
         5420  +      ;;
         5421  +
         5422  +    irix5* | irix6* | nonstopux*)
         5423  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5424  +      # PIC (with -KPIC) is the default.
         5425  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5426  +      ;;
         5427  +
         5428  +    newsos6)
         5429  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5430  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5431  +      ;;
         5432  +
         5433  +    linux* | k*bsd*-gnu)
         5434  +      case $cc_basename in
         5435  +      icc* | ecc*)
         5436  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5437  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5438  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5439  +        ;;
         5440  +      pgcc* | pgf77* | pgf90* | pgf95*)
         5441  +        # Portland Group compilers (*not* the Pentium gcc compiler,
         5442  +	# which looks to be a dead project)
         5443  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5444  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
         5445  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5446  +        ;;
         5447  +      ccc*)
         5448  +        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5449  +        # All Alpha code is PIC.
         5450  +        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5451  +        ;;
         5452  +      *)
         5453  +        case `$CC -V 2>&1 | sed 5q` in
         5454  +	*Sun\ C*)
         5455  +	  # Sun C 5.9
         5456  +	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5457  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5458  +	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5459  +	  ;;
         5460  +	*Sun\ F*)
         5461  +	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
         5462  +	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5463  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5464  +	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
         5465  +	  ;;
         5466  +	esac
         5467  +	;;
         5468  +      esac
         5469  +      ;;
         5470  +
         5471  +    osf3* | osf4* | osf5*)
         5472  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5473  +      # All OSF/1 code is PIC.
         5474  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5475  +      ;;
         5476  +
         5477  +    rdos*)
         5478  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5479  +      ;;
         5480  +
         5481  +    solaris*)
         5482  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5483  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5484  +      case $cc_basename in
         5485  +      f77* | f90* | f95*)
         5486  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
         5487  +      *)
         5488  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
         5489  +      esac
         5490  +      ;;
         5491  +
         5492  +    sunos4*)
         5493  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
         5494  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
         5495  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5496  +      ;;
         5497  +
         5498  +    sysv4 | sysv4.2uw2* | sysv4.3*)
         5499  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5500  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5501  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5502  +      ;;
         5503  +
         5504  +    sysv4*MP*)
         5505  +      if test -d /usr/nec ;then
         5506  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
         5507  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5508  +      fi
         5509  +      ;;
         5510  +
         5511  +    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
         5512  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5513  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5514  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5515  +      ;;
         5516  +
         5517  +    unicos*)
         5518  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5519  +      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5520  +      ;;
         5521  +
         5522  +    uts4*)
         5523  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5524  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5525  +      ;;
         5526  +
         5527  +    *)
         5528  +      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5529  +      ;;
         5530  +    esac
         5531  +  fi
         5532  +])
         5533  +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
         5534  +
         5535  +#
         5536  +# Check to make sure the PIC flag actually works.
         5537  +#
         5538  +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
         5539  +  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
         5540  +    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
         5541  +    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
         5542  +    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
         5543  +     "" | " "*) ;;
         5544  +     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
         5545  +     esac],
         5546  +    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5547  +     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
         5548  +fi
         5549  +case $host_os in
         5550  +  # For platforms which do not support PIC, -DPIC is meaningless:
         5551  +  *djgpp*)
         5552  +    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5553  +    ;;
         5554  +  *)
         5555  +    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
         5556  +    ;;
         5557  +esac
         5558  +
         5559  +#
         5560  +# Check to make sure the static flag actually works.
         5561  +#
         5562  +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
         5563  +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
         5564  +  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
         5565  +  $lt_tmp_static_flag,
         5566  +  [],
         5567  +  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
         5568  +])
         5569  +
         5570  +
         5571  +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
         5572  +# ------------------------------------
         5573  +# See if the linker supports building shared libraries.
         5574  +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
         5575  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         5576  +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
         5577  +ifelse([$1],[CXX],[
         5578  +  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
         5579  +  case $host_os in
         5580  +  aix[[4-9]]*)
         5581  +    # If we're using GNU nm, then we don't want the "-C" option.
         5582  +    # -C means demangle to AIX nm, but means don't demangle with GNU nm
         5583  +    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
         5584  +      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
         5585  +    else
         5586  +      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
         5587  +    fi
         5588  +    ;;
         5589  +  pw32*)
         5590  +    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
         5591  +  ;;
         5592  +  cygwin* | mingw*)
         5593  +    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
         5594  +  ;;
         5595  +  linux* | k*bsd*-gnu)
         5596  +    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
         5597  +  ;;
         5598  +  *)
         5599  +    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
         5600  +  ;;
         5601  +  esac
         5602  +  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
         5603  +],[
         5604  +  runpath_var=
         5605  +  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
         5606  +  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
         5607  +  _LT_AC_TAGVAR(archive_cmds, $1)=
         5608  +  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
         5609  +  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
         5610  +  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
         5611  +  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         5612  +  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         5613  +  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
         5614  +  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         5615  +  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
         5616  +  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         5617  +  _LT_AC_TAGVAR(hardcode_direct, $1)=no
         5618  +  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
         5619  +  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         5620  +  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
         5621  +  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
         5622  +  _LT_AC_TAGVAR(module_cmds, $1)=
         5623  +  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
         5624  +  _LT_AC_TAGVAR(always_export_symbols, $1)=no
         5625  +  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
         5626  +  # include_expsyms should be a list of space-separated symbols to be *always*
         5627  +  # included in the symbol list
         5628  +  _LT_AC_TAGVAR(include_expsyms, $1)=
         5629  +  # exclude_expsyms can be an extended regexp of symbols to exclude
         5630  +  # it will be wrapped by ` (' and `)$', so one must not match beginning or
         5631  +  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
         5632  +  # as well as any symbol that contains `d'.
         5633  +  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
         5634  +  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
         5635  +  # platforms (ab)use it in PIC code, but their linkers get confused if
         5636  +  # the symbol is explicitly referenced.  Since portable code cannot
         5637  +  # rely on this symbol name, it's probably fine to never include it in
         5638  +  # preloaded symbol tables.
         5639  +  # Exclude shared library initialization/finalization symbols.
         5640  +dnl Note also adjust exclude_expsyms for C++ above.
         5641  +  extract_expsyms_cmds=
         5642  +  # Just being paranoid about ensuring that cc_basename is set.
         5643  +  _LT_CC_BASENAME([$compiler])
         5644  +  case $host_os in
         5645  +  cygwin* | mingw* | pw32*)
         5646  +    # FIXME: the MSVC++ port hasn't been tested in a loooong time
         5647  +    # When not using gcc, we currently assume that we are using
         5648  +    # Microsoft Visual C++.
         5649  +    if test "$GCC" != yes; then
         5650  +      with_gnu_ld=no
         5651  +    fi
         5652  +    ;;
         5653  +  interix*)
         5654  +    # we just hope/assume this is gcc and not c89 (= MSVC++)
         5655  +    with_gnu_ld=yes
         5656  +    ;;
         5657  +  openbsd*)
         5658  +    with_gnu_ld=no
         5659  +    ;;
         5660  +  esac
         5661  +
         5662  +  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
         5663  +  if test "$with_gnu_ld" = yes; then
         5664  +    # If archive_cmds runs LD, not CC, wlarc should be empty
         5665  +    wlarc='${wl}'
         5666  +
         5667  +    # Set some defaults for GNU ld with shared library support. These
         5668  +    # are reset later if shared libraries are not supported. Putting them
         5669  +    # here allows them to be overridden if necessary.
         5670  +    runpath_var=LD_RUN_PATH
         5671  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
         5672  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         5673  +    # ancient GNU ld didn't support --whole-archive et. al.
         5674  +    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
         5675  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
         5676  +      else
         5677  +  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         5678  +    fi
         5679  +    supports_anon_versioning=no
         5680  +    case `$LD -v 2>/dev/null` in
         5681  +      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
         5682  +      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
         5683  +      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
         5684  +      *\ 2.11.*) ;; # other 2.11 versions
         5685  +      *) supports_anon_versioning=yes ;;
         5686  +    esac
         5687  +
         5688  +    # See if GNU ld supports shared libraries.
         5689  +    case $host_os in
         5690  +    aix[[3-9]]*)
         5691  +      # On AIX/PPC, the GNU linker is very broken
         5692  +      if test "$host_cpu" != ia64; then
         5693  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5694  +	cat <<EOF 1>&2
         5695  +
         5696  +*** Warning: the GNU linker, at least up to release 2.9.1, is reported
         5697  +*** to be unable to reliably create shared libraries on AIX.
         5698  +*** Therefore, libtool is disabling shared libraries support.  If you
         5699  +*** really care for shared libraries, you may want to modify your PATH
         5700  +*** so that a non-GNU linker is found, and then restart.
         5701  +
         5702  +EOF
         5703  +      fi
         5704  +      ;;
         5705  +
         5706  +    amigaos*)
         5707  +      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
         5708  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         5709  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         5710  +
         5711  +      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
         5712  +      # that the semantics of dynamic libraries on AmigaOS, at least up
         5713  +      # to version 4, is to share data among multiple programs linked
         5714  +      # with the same dynamic library.  Since this doesn't match the
         5715  +      # behavior of shared libraries on other platforms, we can't use
         5716  +      # them.
         5717  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         5718  +      ;;
         5719  +
         5720  +    beos*)
         5721  +      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5722  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         5723  +	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
         5724  +	# support --undefined.  This deserves some investigation.  FIXME
         5725  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5726  +      else
         5727  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5728  +      fi
         5729  +      ;;
         5730  +
         5731  +    cygwin* | mingw* | pw32*)
         5732  +      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
         5733  +      # as there is no search path for DLLs.
         5734  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         5735  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         5736  +      _LT_AC_TAGVAR(always_export_symbols, $1)=no
         5737  +      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
         5738  +      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
         5739  +
         5740  +      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         5741  +        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
         5742  +	# If the export-symbols file already is a .def file (1st line
         5743  +	# is EXPORTS), use it as is; otherwise, prepend...
         5744  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
         5745  +	  cp $export_symbols $output_objdir/$soname.def;
         5746  +	else
         5747  +	  echo EXPORTS > $output_objdir/$soname.def;
         5748  +	  cat $export_symbols >> $output_objdir/$soname.def;
         5749  +	fi~
         5750  +	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
         5751  +      else
         5752  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5753  +      fi
         5754  +      ;;
         5755  +
         5756  +    interix[[3-9]]*)
         5757  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         5758  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         5759  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         5760  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         5761  +      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
         5762  +      # Instead, shared libraries are loaded at an image base (0x10000000 by
         5763  +      # default) and relocated if they conflict, which is a slow very memory
         5764  +      # consuming and fragmenting process.  To avoid this, we pick a random,
         5765  +      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
         5766  +      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
         5767  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         5768  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         5769  +      ;;
         5770  +
         5771  +    gnu* | linux* | k*bsd*-gnu)
         5772  +      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5773  +	tmp_addflag=
         5774  +	case $cc_basename,$host_cpu in
         5775  +	pgcc*)				# Portland Group C compiler
         5776  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         5777  +	  tmp_addflag=' $pic_flag'
         5778  +	  ;;
         5779  +	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
         5780  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         5781  +	  tmp_addflag=' $pic_flag -Mnomain' ;;
         5782  +	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
         5783  +	  tmp_addflag=' -i_dynamic' ;;
         5784  +	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
         5785  +	  tmp_addflag=' -i_dynamic -nofor_main' ;;
         5786  +	ifc* | ifort*)			# Intel Fortran compiler
         5787  +	  tmp_addflag=' -nofor_main' ;;
         5788  +	esac
         5789  +	case `$CC -V 2>&1 | sed 5q` in
         5790  +	*Sun\ C*)			# Sun C 5.9
         5791  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         5792  +	  tmp_sharedflag='-G' ;;
         5793  +	*Sun\ F*)			# Sun Fortran 8.3
         5794  +	  tmp_sharedflag='-G' ;;
         5795  +	*)
         5796  +	  tmp_sharedflag='-shared' ;;
         5797  +	esac
         5798  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5799  +
         5800  +	if test $supports_anon_versioning = yes; then
         5801  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
         5802  +  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
         5803  +  $echo "local: *; };" >> $output_objdir/$libname.ver~
         5804  +	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
         5805  +	fi
         5806  +	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
         5807  +      else
         5808  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5809  +      fi
         5810  +      ;;
         5811  +
         5812  +    netbsd* | netbsdelf*-gnu)
         5813  +      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
         5814  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
         5815  +	wlarc=
         5816  +      else
         5817  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5818  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         5819  +      fi
         5820  +      ;;
         5821  +
         5822  +    solaris*)
         5823  +      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
         5824  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5825  +	cat <<EOF 1>&2
         5826  +
         5827  +*** Warning: The releases 2.8.* of the GNU linker cannot reliably
         5828  +*** create shared libraries on Solaris systems.  Therefore, libtool
         5829  +*** is disabling shared libraries support.  We urge you to upgrade GNU
         5830  +*** binutils to release 2.9.1 or newer.  Another option is to modify
         5831  +*** your PATH or compiler configuration so that the native linker is
         5832  +*** used, and then restart.
         5833  +
         5834  +EOF
         5835  +      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5836  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5837  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         5838  +      else
         5839  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5840  +      fi
         5841  +      ;;
         5842  +
         5843  +    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
         5844  +      case `$LD -v 2>&1` in
         5845  +        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
         5846  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5847  +	cat <<_LT_EOF 1>&2
         5848  +
         5849  +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
         5850  +*** reliably create shared libraries on SCO systems.  Therefore, libtool
         5851  +*** is disabling shared libraries support.  We urge you to upgrade GNU
         5852  +*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
         5853  +*** your PATH or compiler configuration so that the native linker is
         5854  +*** used, and then restart.
         5855  +
         5856  +_LT_EOF
         5857  +	;;
         5858  +	*)
         5859  +	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5860  +	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
         5861  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
         5862  +	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
         5863  +	  else
         5864  +	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         5865  +	  fi
         5866  +	;;
         5867  +      esac
         5868  +      ;;
         5869  +
         5870  +    sunos4*)
         5871  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
         5872  +      wlarc=
         5873  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         5874  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         5875  +      ;;
         5876  +
         5877  +    *)
         5878  +      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5879  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5880  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         5881  +      else
         5882  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5883  +      fi
         5884  +      ;;
         5885  +    esac
         5886  +
         5887  +    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
         5888  +      runpath_var=
         5889  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         5890  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         5891  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         5892  +    fi
         5893  +  else
         5894  +    # PORTME fill in a description of your system's linker (not GNU ld)
         5895  +    case $host_os in
         5896  +    aix3*)
         5897  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         5898  +      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
         5899  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
         5900  +      # Note: this linker hardcodes the directories in LIBPATH if there
         5901  +      # are no directories specified by -L.
         5902  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         5903  +      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
         5904  +	# Neither direct hardcoding nor static linking is supported with a
         5905  +	# broken collect2.
         5906  +	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
         5907  +      fi
         5908  +      ;;
         5909  +
         5910  +    aix[[4-9]]*)
         5911  +      if test "$host_cpu" = ia64; then
         5912  +	# On IA64, the linker does run time linking by default, so we don't
         5913  +	# have to do anything special.
         5914  +	aix_use_runtimelinking=no
         5915  +	exp_sym_flag='-Bexport'
         5916  +	no_entry_flag=""
         5917  +      else
         5918  +	# If we're using GNU nm, then we don't want the "-C" option.
         5919  +	# -C means demangle to AIX nm, but means don't demangle with GNU nm
         5920  +	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
         5921  +	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
         5922  +	else
         5923  +	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
         5924  +	fi
         5925  +	aix_use_runtimelinking=no
         5926  +
         5927  +	# Test if we are trying to use run time linking or normal
         5928  +	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
         5929  +	# need to do runtime linking.
         5930  +	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
         5931  +	  for ld_flag in $LDFLAGS; do
         5932  +  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
         5933  +  	    aix_use_runtimelinking=yes
         5934  +  	    break
         5935  +  	  fi
         5936  +	  done
         5937  +	  ;;
         5938  +	esac
         5939  +
         5940  +	exp_sym_flag='-bexport'
         5941  +	no_entry_flag='-bnoentry'
         5942  +      fi
         5943  +
         5944  +      # When large executables or shared objects are built, AIX ld can
         5945  +      # have problems creating the table of contents.  If linking a library
         5946  +      # or program results in "error TOC overflow" add -mminimal-toc to
         5947  +      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
         5948  +      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
         5949  +
         5950  +      _LT_AC_TAGVAR(archive_cmds, $1)=''
         5951  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         5952  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         5953  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         5954  +
         5955  +      if test "$GCC" = yes; then
         5956  +	case $host_os in aix4.[[012]]|aix4.[[012]].*)
         5957  +	# We only want to do this on AIX 4.2 and lower, the check
         5958  +	# below for broken collect2 doesn't work under 4.3+
         5959  +	  collect2name=`${CC} -print-prog-name=collect2`
         5960  +	  if test -f "$collect2name" && \
         5961  +  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
         5962  +	  then
         5963  +  	  # We have reworked collect2
         5964  +  	  :
         5965  +	  else
         5966  +  	  # We have old collect2
         5967  +  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
         5968  +  	  # It fails to find uninstalled libraries when the uninstalled
         5969  +  	  # path is not listed in the libpath.  Setting hardcode_minus_L
         5970  +  	  # to unsupported forces relinking
         5971  +  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         5972  +  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         5973  +  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         5974  +	  fi
         5975  +	  ;;
         5976  +	esac
         5977  +	shared_flag='-shared'
         5978  +	if test "$aix_use_runtimelinking" = yes; then
         5979  +	  shared_flag="$shared_flag "'${wl}-G'
         5980  +	fi
         5981  +      else
         5982  +	# not using gcc
         5983  +	if test "$host_cpu" = ia64; then
         5984  +  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
         5985  +  	# chokes on -Wl,-G. The following line is correct:
         5986  +	  shared_flag='-G'
         5987  +	else
         5988  +	  if test "$aix_use_runtimelinking" = yes; then
         5989  +	    shared_flag='${wl}-G'
         5990  +	  else
         5991  +	    shared_flag='${wl}-bM:SRE'
         5992  +	  fi
         5993  +	fi
         5994  +      fi
         5995  +
         5996  +      # It seems that -bexpall does not export symbols beginning with
         5997  +      # underscore (_), so it is better to generate a list of symbols to export.
         5998  +      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
         5999  +      if test "$aix_use_runtimelinking" = yes; then
         6000  +	# Warning - without using the other runtime loading flags (-brtl),
         6001  +	# -berok will link without error, but may produce a broken library.
         6002  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
         6003  +       # Determine the default libpath from the value encoded in an empty executable.
         6004  +       _LT_AC_SYS_LIBPATH_AIX
         6005  +       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         6006  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         6007  +       else
         6008  +	if test "$host_cpu" = ia64; then
         6009  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
         6010  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
         6011  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
         6012  +	else
         6013  +	 # Determine the default libpath from the value encoded in an empty executable.
         6014  +	 _LT_AC_SYS_LIBPATH_AIX
         6015  +	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         6016  +	  # Warning - without using the other run time loading flags,
         6017  +	  # -berok will link without error, but may produce a broken library.
         6018  +	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
         6019  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
         6020  +	  # Exported symbols can be pulled into shared objects from archives
         6021  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
         6022  +	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
         6023  +	  # This is similar to how AIX traditionally builds its shared libraries.
         6024  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
         6025  +	fi
         6026  +      fi
         6027  +      ;;
         6028  +
         6029  +    amigaos*)
         6030  +      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
         6031  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6032  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6033  +      # see comment about different semantics on the GNU ld section
         6034  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         6035  +      ;;
         6036  +
         6037  +    bsdi[[45]]*)
         6038  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
         6039  +      ;;
         6040  +
         6041  +    cygwin* | mingw* | pw32*)
         6042  +      # When not using gcc, we currently assume that we are using
         6043  +      # Microsoft Visual C++.
         6044  +      # hardcode_libdir_flag_spec is actually meaningless, as there is
         6045  +      # no search path for DLLs.
         6046  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
         6047  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         6048  +      # Tell ltmain to make .lib files, not .a files.
         6049  +      libext=lib
         6050  +      # Tell ltmain to make .dll files, not .so files.
         6051  +      shrext_cmds=".dll"
         6052  +      # FIXME: Setting linknames here is a bad hack.
         6053  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
         6054  +      # The linker will automatically build a .lib file if we build a DLL.
         6055  +      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
         6056  +      # FIXME: Should let the user specify the lib program.
         6057  +      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
         6058  +      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
         6059  +      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
         6060  +      ;;
         6061  +
         6062  +    darwin* | rhapsody*)
         6063  +      case $host_os in
         6064  +        rhapsody* | darwin1.[[012]])
         6065  +         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
         6066  +         ;;
         6067  +       *) # Darwin 1.3 on
         6068  +         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
         6069  +           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
         6070  +         else
         6071  +           case ${MACOSX_DEPLOYMENT_TARGET} in
         6072  +             10.[[012]])
         6073  +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
         6074  +               ;;
         6075  +             10.*)
         6076  +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
         6077  +               ;;
         6078  +           esac
         6079  +         fi
         6080  +         ;;
         6081  +      esac
         6082  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         6083  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         6084  +      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
         6085  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         6086  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
         6087  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         6088  +    if test "$GCC" = yes ; then
         6089  +    	output_verbose_link_cmd='echo'
         6090  +        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
         6091  +        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
         6092  +        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
         6093  +        _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
         6094  +    else
         6095  +      case $cc_basename in
         6096  +        xlc*)
         6097  +         output_verbose_link_cmd='echo'
         6098  +         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
         6099  +         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
         6100  +          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
         6101  +         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         6102  +          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         6103  +          ;;
         6104  +       *)
         6105  +         _LT_AC_TAGVAR(ld_shlibs, $1)=no
         6106  +          ;;
         6107  +      esac
         6108  +    fi
         6109  +      ;;
         6110  +
         6111  +    dgux*)
         6112  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6113  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6114  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6115  +      ;;
         6116  +
         6117  +    freebsd1*)
         6118  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         6119  +      ;;
         6120  +
         6121  +    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
         6122  +    # support.  Future versions do this automatically, but an explicit c++rt0.o
         6123  +    # does not break anything, and helps significantly (at the cost of a little
         6124  +    # extra space).
         6125  +    freebsd2.2*)
         6126  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
         6127  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6128  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6129  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6130  +      ;;
         6131  +
         6132  +    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
         6133  +    freebsd2*)
         6134  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
         6135  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6136  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6137  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6138  +      ;;
         6139  +
         6140  +    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
         6141  +    freebsd* | dragonfly*)
         6142  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
         6143  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6144  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6145  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6146  +      ;;
         6147  +
         6148  +    hpux9*)
         6149  +      if test "$GCC" = yes; then
         6150  +	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         6151  +      else
         6152  +	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         6153  +      fi
         6154  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         6155  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6156  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6157  +
         6158  +      # hardcode_minus_L: Not really in the search PATH,
         6159  +      # but as the default location of the library.
         6160  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6161  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6162  +      ;;
         6163  +
         6164  +    hpux10*)
         6165  +      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
         6166  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
         6167  +      else
         6168  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
         6169  +      fi
         6170  +      if test "$with_gnu_ld" = no; then
         6171  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         6172  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6173  +
         6174  +	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6175  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6176  +
         6177  +	# hardcode_minus_L: Not really in the search PATH,
         6178  +	# but as the default location of the library.
         6179  +	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6180  +      fi
         6181  +      ;;
         6182  +
         6183  +    hpux11*)
         6184  +      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
         6185  +	case $host_cpu in
         6186  +	hppa*64*)
         6187  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6188  +	  ;;
         6189  +	ia64*)
         6190  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
         6191  +	  ;;
         6192  +	*)
         6193  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
         6194  +	  ;;
         6195  +	esac
         6196  +      else
         6197  +	case $host_cpu in
         6198  +	hppa*64*)
         6199  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6200  +	  ;;
         6201  +	ia64*)
         6202  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
         6203  +	  ;;
         6204  +	*)
         6205  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
         6206  +	  ;;
         6207  +	esac
         6208  +      fi
         6209  +      if test "$with_gnu_ld" = no; then
         6210  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         6211  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6212  +
         6213  +	case $host_cpu in
         6214  +	hppa*64*|ia64*)
         6215  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
         6216  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
         6217  +	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6218  +	  ;;
         6219  +	*)
         6220  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6221  +	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6222  +
         6223  +	  # hardcode_minus_L: Not really in the search PATH,
         6224  +	  # but as the default location of the library.
         6225  +	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6226  +	  ;;
         6227  +	esac
         6228  +      fi
         6229  +      ;;
         6230  +
         6231  +    irix5* | irix6* | nonstopux*)
         6232  +      if test "$GCC" = yes; then
         6233  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         6234  +      else
         6235  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         6236  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
         6237  +      fi
         6238  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6239  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6240  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         6241  +      ;;
         6242  +
         6243  +    netbsd* | netbsdelf*-gnu)
         6244  +      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
         6245  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
         6246  +      else
         6247  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
         6248  +      fi
         6249  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6250  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6251  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6252  +      ;;
         6253  +
         6254  +    newsos6)
         6255  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6256  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6257  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6258  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6259  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6260  +      ;;
         6261  +
         6262  +    openbsd*)
         6263  +      if test -f /usr/libexec/ld.so; then
         6264  +	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6265  +	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6266  +	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         6267  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
         6268  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
         6269  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         6270  +	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6271  +	else
         6272  +	  case $host_os in
         6273  +	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
         6274  +	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
         6275  +	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6276  +	     ;;
         6277  +	   *)
         6278  +	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
         6279  +	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         6280  +	     ;;
         6281  +	  esac
         6282  +        fi
         6283  +      else
         6284  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         6285  +      fi
         6286  +      ;;
         6287  +
         6288  +    os2*)
         6289  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6290  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6291  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         6292  +      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
         6293  +      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
         6294  +      ;;
         6295  +
         6296  +    osf3*)
         6297  +      if test "$GCC" = yes; then
         6298  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         6299  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         6300  +      else
         6301  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
         6302  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         6303  +      fi
         6304  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6305  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6306  +      ;;
         6307  +
         6308  +    osf4* | osf5*)	# as osf3* with the addition of -msym flag
         6309  +      if test "$GCC" = yes; then
         6310  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         6311  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         6312  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6313  +      else
         6314  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
         6315  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         6316  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
         6317  +	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
         6318  +
         6319  +	# Both c and cxx compiler support -rpath directly
         6320  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
         6321  +      fi
         6322  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6323  +      ;;
         6324  +
         6325  +    solaris*)
         6326  +      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
         6327  +      if test "$GCC" = yes; then
         6328  +	wlarc='${wl}'
         6329  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6330  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         6331  +	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
         6332  +      else
         6333  +	wlarc=''
         6334  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6335  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         6336  +  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
         6337  +      fi
         6338  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6339  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6340  +      case $host_os in
         6341  +      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
         6342  +      *)
         6343  +	# The compiler driver will combine and reorder linker options,
         6344  +	# but understands `-z linker_flag'.  GCC discards it without `$wl',
         6345  +	# but is careful enough not to reorder.
         6346  + 	# Supported since Solaris 2.6 (maybe 2.5.1?)
         6347  +	if test "$GCC" = yes; then
         6348  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
    64   6349   	else
    65         -		AC_MSG_RESULT([no])
    66         -		PKG_CONFIG=""
         6350  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
    67   6351   	fi
    68         -fi[]dnl
    69         -])# PKG_PROG_PKG_CONFIG
    70         -
    71         -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
    72         -#
    73         -# Check to see whether a particular set of modules exists.  Similar
    74         -# to PKG_CHECK_MODULES(), but does not set variables or print errors.
    75         -#
    76         -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
    77         -# only at the first occurence in configure.ac, so if the first place
    78         -# it's called might be skipped (such as if it is within an "if", you
    79         -# have to call PKG_CHECK_EXISTS manually
    80         -# --------------------------------------------------------------
    81         -AC_DEFUN([PKG_CHECK_EXISTS],
    82         -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
    83         -if test -n "$PKG_CONFIG" && \
    84         -    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
    85         -  m4_default([$2], [:])
    86         -m4_ifvaln([$3], [else
    87         -  $3])dnl
    88         -fi])
    89         -
    90         -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
    91         -# ---------------------------------------------
    92         -m4_define([_PKG_CONFIG],
    93         -[if test -n "$$1"; then
    94         -    pkg_cv_[]$1="$$1"
    95         - elif test -n "$PKG_CONFIG"; then
    96         -    PKG_CHECK_EXISTS([$3],
    97         -                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
    98         -		     [pkg_failed=yes])
    99         - else
   100         -    pkg_failed=untried
   101         -fi[]dnl
   102         -])# _PKG_CONFIG
   103         -
   104         -# _PKG_SHORT_ERRORS_SUPPORTED
   105         -# -----------------------------
   106         -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
   107         -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
   108         -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
   109         -        _pkg_short_errors_supported=yes
   110         -else
   111         -        _pkg_short_errors_supported=no
   112         -fi[]dnl
   113         -])# _PKG_SHORT_ERRORS_SUPPORTED
   114         -
   115         -
   116         -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
   117         -# [ACTION-IF-NOT-FOUND])
   118         -#
   119         -#
   120         -# Note that if there is a possibility the first call to
   121         -# PKG_CHECK_MODULES might not happen, you should be sure to include an
   122         -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
   123         -#
   124         -#
   125         -# --------------------------------------------------------------
   126         -AC_DEFUN([PKG_CHECK_MODULES],
   127         -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
   128         -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
   129         -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
   130         -
   131         -pkg_failed=no
   132         -AC_MSG_CHECKING([for $1])
   133         -
   134         -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
   135         -_PKG_CONFIG([$1][_LIBS], [libs], [$2])
   136         -
   137         -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
   138         -and $1[]_LIBS to avoid the need to call pkg-config.
   139         -See the pkg-config man page for more details.])
   140         -
   141         -if test $pkg_failed = yes; then
   142         -   	AC_MSG_RESULT([no])
   143         -        _PKG_SHORT_ERRORS_SUPPORTED
   144         -        if test $_pkg_short_errors_supported = yes; then
   145         -	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
   146         -        else 
   147         -	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
         6352  +	;;
         6353  +      esac
         6354  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         6355  +      ;;
         6356  +
         6357  +    sunos4*)
         6358  +      if test "x$host_vendor" = xsequent; then
         6359  +	# Use $CC to link under sequent, because it throws in some extra .o
         6360  +	# files that make .init and .fini sections work.
         6361  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
         6362  +      else
         6363  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
         6364  +      fi
         6365  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6366  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6367  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6368  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6369  +      ;;
         6370  +
         6371  +    sysv4)
         6372  +      case $host_vendor in
         6373  +	sni)
         6374  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6375  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
         6376  +	;;
         6377  +	siemens)
         6378  +	  ## LD is ld it makes a PLAMLIB
         6379  +	  ## CC just makes a GrossModule.
         6380  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
         6381  +	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
         6382  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
         6383  +        ;;
         6384  +	motorola)
         6385  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6386  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
         6387  +	;;
         6388  +      esac
         6389  +      runpath_var='LD_RUN_PATH'
         6390  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6391  +      ;;
         6392  +
         6393  +    sysv4.3*)
         6394  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6395  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6396  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
         6397  +      ;;
         6398  +
         6399  +    sysv4*MP*)
         6400  +      if test -d /usr/nec; then
         6401  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6402  +	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6403  +	runpath_var=LD_RUN_PATH
         6404  +	hardcode_runpath_var=yes
         6405  +	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
         6406  +      fi
         6407  +      ;;
         6408  +
         6409  +    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
         6410  +      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         6411  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         6412  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6413  +      runpath_var='LD_RUN_PATH'
         6414  +
         6415  +      if test "$GCC" = yes; then
         6416  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6417  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6418  +      else
         6419  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6420  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6421  +      fi
         6422  +      ;;
         6423  +
         6424  +    sysv5* | sco3.2v5* | sco5v6*)
         6425  +      # Note: We can NOT use -z defs as we might desire, because we do not
         6426  +      # link with -lc, and that would cause any symbols used from libc to
         6427  +      # always be unresolved, which means just about no library would
         6428  +      # ever link correctly.  If we're not using GNU ld we use -z text
         6429  +      # though, which does catch some bad symbols but isn't as heavy-handed
         6430  +      # as -z defs.
         6431  +      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         6432  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
         6433  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         6434  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6435  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
         6436  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         6437  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         6438  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
         6439  +      runpath_var='LD_RUN_PATH'
         6440  +
         6441  +      if test "$GCC" = yes; then
         6442  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6443  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6444  +      else
         6445  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6446  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6447  +      fi
         6448  +      ;;
         6449  +
         6450  +    uts4*)
         6451  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6452  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6453  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6454  +      ;;
         6455  +
         6456  +    *)
         6457  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         6458  +      ;;
         6459  +    esac
         6460  +  fi
         6461  +])
         6462  +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
         6463  +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
         6464  +
         6465  +#
         6466  +# Do we need to explicitly link libc?
         6467  +#
         6468  +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
         6469  +x|xyes)
         6470  +  # Assume -lc should be added
         6471  +  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
         6472  +
         6473  +  if test "$enable_shared" = yes && test "$GCC" = yes; then
         6474  +    case $_LT_AC_TAGVAR(archive_cmds, $1) in
         6475  +    *'~'*)
         6476  +      # FIXME: we may have to deal with multi-command sequences.
         6477  +      ;;
         6478  +    '$CC '*)
         6479  +      # Test whether the compiler implicitly links with -lc since on some
         6480  +      # systems, -lgcc has to come before -lc. If gcc already passes -lc
         6481  +      # to ld, don't add -lc before -lgcc.
         6482  +      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
         6483  +      $rm conftest*
         6484  +      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
         6485  +
         6486  +      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
         6487  +        soname=conftest
         6488  +        lib=conftest
         6489  +        libobjs=conftest.$ac_objext
         6490  +        deplibs=
         6491  +        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
         6492  +	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
         6493  +        compiler_flags=-v
         6494  +        linker_flags=-v
         6495  +        verstring=
         6496  +        output_objdir=.
         6497  +        libname=conftest
         6498  +        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
         6499  +        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
         6500  +        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
         6501  +        then
         6502  +	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         6503  +        else
         6504  +	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
   148   6505           fi
   149         -	# Put the nasty error message in config.log where it belongs
   150         -	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
   151         -
   152         -	m4_default([$4], [AC_MSG_ERROR(
   153         -[Package requirements ($2) were not met:
   154         -
   155         -$$1_PKG_ERRORS
   156         -
   157         -Consider adjusting the PKG_CONFIG_PATH environment variable if you
   158         -installed software in a non-standard prefix.
   159         -
   160         -_PKG_TEXT])
   161         -        ])
   162         -elif test $pkg_failed = untried; then
   163         -     	AC_MSG_RESULT([no])
   164         -	m4_default([$4], [AC_MSG_FAILURE(
   165         -[The pkg-config script could not be found or is too old.  Make sure it
   166         -is in your PATH or set the PKG_CONFIG environment variable to the full
   167         -path to pkg-config.
   168         -
   169         -_PKG_TEXT
   170         -
   171         -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
   172         -        ])
         6506  +        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
         6507  +      else
         6508  +        cat conftest.err 1>&5
         6509  +      fi
         6510  +      $rm conftest*
         6511  +      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
         6512  +      ;;
         6513  +    esac
         6514  +  fi
         6515  +  ;;
         6516  +esac
         6517  +])# AC_LIBTOOL_PROG_LD_SHLIBS
         6518  +
         6519  +
         6520  +# _LT_AC_FILE_LTDLL_C
         6521  +# -------------------
         6522  +# Be careful that the start marker always follows a newline.
         6523  +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
         6524  +# /* ltdll.c starts here */
         6525  +# #define WIN32_LEAN_AND_MEAN
         6526  +# #include <windows.h>
         6527  +# #undef WIN32_LEAN_AND_MEAN
         6528  +# #include <stdio.h>
         6529  +#
         6530  +# #ifndef __CYGWIN__
         6531  +# #  ifdef __CYGWIN32__
         6532  +# #    define __CYGWIN__ __CYGWIN32__
         6533  +# #  endif
         6534  +# #endif
         6535  +#
         6536  +# #ifdef __cplusplus
         6537  +# extern "C" {
         6538  +# #endif
         6539  +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
         6540  +# #ifdef __cplusplus
         6541  +# }
         6542  +# #endif
         6543  +#
         6544  +# #ifdef __CYGWIN__
         6545  +# #include <cygwin/cygwin_dll.h>
         6546  +# DECLARE_CYGWIN_DLL( DllMain );
         6547  +# #endif
         6548  +# HINSTANCE __hDllInstance_base;
         6549  +#
         6550  +# BOOL APIENTRY
         6551  +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
         6552  +# {
         6553  +#   __hDllInstance_base = hInst;
         6554  +#   return TRUE;
         6555  +# }
         6556  +# /* ltdll.c ends here */
         6557  +])# _LT_AC_FILE_LTDLL_C
         6558  +
         6559  +
         6560  +# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
         6561  +# ---------------------------------
         6562  +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
         6563  +
         6564  +
         6565  +# old names
         6566  +AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
         6567  +AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
         6568  +AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
         6569  +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
         6570  +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
         6571  +AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
         6572  +AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
         6573  +
         6574  +# This is just to silence aclocal about the macro not being used
         6575  +ifelse([AC_DISABLE_FAST_INSTALL])
         6576  +
         6577  +AC_DEFUN([LT_AC_PROG_GCJ],
         6578  +[AC_CHECK_TOOL(GCJ, gcj, no)
         6579  +  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
         6580  +  AC_SUBST(GCJFLAGS)
         6581  +])
         6582  +
         6583  +AC_DEFUN([LT_AC_PROG_RC],
         6584  +[AC_CHECK_TOOL(RC, windres, no)
         6585  +])
         6586  +
         6587  +
         6588  +# Cheap backport of AS_EXECUTABLE_P and required macros
         6589  +# from Autoconf 2.59; we should not use $as_executable_p directly.
         6590  +
         6591  +# _AS_TEST_PREPARE
         6592  +# ----------------
         6593  +m4_ifndef([_AS_TEST_PREPARE],
         6594  +[m4_defun([_AS_TEST_PREPARE],
         6595  +[if test -x / >/dev/null 2>&1; then
         6596  +  as_executable_p='test -x'
   173   6597   else
   174         -	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
   175         -	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
   176         -        AC_MSG_RESULT([yes])
   177         -	$3
   178         -fi[]dnl
   179         -])# PKG_CHECK_MODULES
   180         -
   181         -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
   182         -# Foundation, Inc.
   183         -#
   184         -# This file is free software; the Free Software Foundation
   185         -# gives unlimited permission to copy and/or distribute it,
   186         -# with or without modifications, as long as this notice is preserved.
   187         -
   188         -# serial 1
         6598  +  as_executable_p='test -f'
         6599  +fi
         6600  +])])# _AS_TEST_PREPARE
         6601  +
         6602  +# AS_EXECUTABLE_P
         6603  +# ---------------
         6604  +# Check whether a file is executable.
         6605  +m4_ifndef([AS_EXECUTABLE_P],
         6606  +[m4_defun([AS_EXECUTABLE_P],
         6607  +[AS_REQUIRE([_AS_TEST_PREPARE])dnl
         6608  +$as_executable_p $1[]dnl
         6609  +])])# AS_EXECUTABLE_P
         6610  +
         6611  +# NOTE: This macro has been submitted for inclusion into   #
         6612  +#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
         6613  +#  a released version of Autoconf we should remove this    #
         6614  +#  macro and use it instead.                               #
         6615  +# LT_AC_PROG_SED
         6616  +# --------------
         6617  +# Check for a fully-functional sed program, that truncates
         6618  +# as few characters as possible.  Prefer GNU sed if found.
         6619  +AC_DEFUN([LT_AC_PROG_SED],
         6620  +[AC_MSG_CHECKING([for a sed that does not truncate output])
         6621  +AC_CACHE_VAL(lt_cv_path_SED,
         6622  +[# Loop through the user's path and test for sed and gsed.
         6623  +# Then use that list of sed's as ones to test for truncation.
         6624  +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
         6625  +for as_dir in $PATH
         6626  +do
         6627  +  IFS=$as_save_IFS
         6628  +  test -z "$as_dir" && as_dir=.
         6629  +  for lt_ac_prog in sed gsed; do
         6630  +    for ac_exec_ext in '' $ac_executable_extensions; do
         6631  +      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
         6632  +        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
         6633  +      fi
         6634  +    done
         6635  +  done
         6636  +done
         6637  +IFS=$as_save_IFS
         6638  +lt_ac_max=0
         6639  +lt_ac_count=0
         6640  +# Add /usr/xpg4/bin/sed as it is typically found on Solaris
         6641  +# along with /bin/sed that truncates output.
         6642  +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
         6643  +  test ! -f $lt_ac_sed && continue
         6644  +  cat /dev/null > conftest.in
         6645  +  lt_ac_count=0
         6646  +  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
         6647  +  # Check for GNU sed and select it if it is found.
         6648  +  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
         6649  +    lt_cv_path_SED=$lt_ac_sed
         6650  +    break
         6651  +  fi
         6652  +  while true; do
         6653  +    cat conftest.in conftest.in >conftest.tmp
         6654  +    mv conftest.tmp conftest.in
         6655  +    cp conftest.in conftest.nl
         6656  +    echo >>conftest.nl
         6657  +    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
         6658  +    cmp -s conftest.out conftest.nl || break
         6659  +    # 10000 chars as input seems more than enough
         6660  +    test $lt_ac_count -gt 10 && break
         6661  +    lt_ac_count=`expr $lt_ac_count + 1`
         6662  +    if test $lt_ac_count -gt $lt_ac_max; then
         6663  +      lt_ac_max=$lt_ac_count
         6664  +      lt_cv_path_SED=$lt_ac_sed
         6665  +    fi
         6666  +  done
         6667  +done
         6668  +])
         6669  +SED=$lt_cv_path_SED
         6670  +AC_SUBST([SED])
         6671  +AC_MSG_RESULT([$SED])
         6672  +])
         6673  +
         6674  +# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
         6675  +#
         6676  +# This file is free software; the Free Software Foundation
         6677  +# gives unlimited permission to copy and/or distribute it,
         6678  +# with or without modifications, as long as this notice is preserved.
   189   6679   
   190   6680   # AM_AUTOMAKE_VERSION(VERSION)
   191   6681   # ----------------------------
   192   6682   # Automake X.Y traces this macro to ensure aclocal.m4 has been
   193   6683   # generated from the m4 files accompanying Automake X.Y.
   194   6684   # (This private macro should not be called outside this file.)
   195   6685   AC_DEFUN([AM_AUTOMAKE_VERSION],
   196         -[am__api_version='1.11'
         6686  +[am__api_version='1.10'
   197   6687   dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
   198   6688   dnl require some minimum version.  Point them to the right macro.
   199         -m4_if([$1], [1.11.6], [],
         6689  +m4_if([$1], [1.10.1], [],
   200   6690         [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
   201   6691   ])
   202   6692   
   203   6693   # _AM_AUTOCONF_VERSION(VERSION)
   204   6694   # -----------------------------
   205   6695   # aclocal traces this macro to find the Autoconf version.
   206   6696   # This is a private macro too.  Using m4_define simplifies
   207   6697   # the logic in aclocal, which can simply ignore this definition.
   208   6698   m4_define([_AM_AUTOCONF_VERSION], [])
   209   6699   
   210   6700   # AM_SET_CURRENT_AUTOMAKE_VERSION
   211   6701   # -------------------------------
   212   6702   # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
   213         -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
         6703  +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
   214   6704   AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
   215         -[AM_AUTOMAKE_VERSION([1.11.6])dnl
         6705  +[AM_AUTOMAKE_VERSION([1.10.1])dnl
   216   6706   m4_ifndef([AC_AUTOCONF_VERSION],
   217   6707     [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
   218         -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
         6708  +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
   219   6709   
   220   6710   # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
   221   6711   
   222         -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
         6712  +# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
   223   6713   #
   224   6714   # This file is free software; the Free Software Foundation
   225   6715   # gives unlimited permission to copy and/or distribute it,
   226   6716   # with or without modifications, as long as this notice is preserved.
   227   6717   
   228         -# serial 1
   229         -
   230   6718   # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
   231   6719   # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
   232   6720   # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
   233   6721   #
   234   6722   # Of course, Automake must honor this variable whenever it calls a
   235   6723   # tool from the auxiliary directory.  The problem is that $srcdir (and
   236   6724   # therefore $ac_aux_dir as well) can be either absolute or relative,
................................................................................
   270   6758   AC_PREREQ([2.50])dnl
   271   6759   # expand $ac_aux_dir to an absolute path
   272   6760   am_aux_dir=`cd $ac_aux_dir && pwd`
   273   6761   ])
   274   6762   
   275   6763   # AM_CONDITIONAL                                            -*- Autoconf -*-
   276   6764   
   277         -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
         6765  +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
   278   6766   # Free Software Foundation, Inc.
   279   6767   #
   280   6768   # This file is free software; the Free Software Foundation
   281   6769   # gives unlimited permission to copy and/or distribute it,
   282   6770   # with or without modifications, as long as this notice is preserved.
   283   6771   
   284         -# serial 9
         6772  +# serial 8
   285   6773   
   286   6774   # AM_CONDITIONAL(NAME, SHELL-CONDITION)
   287   6775   # -------------------------------------
   288   6776   # Define a conditional.
   289   6777   AC_DEFUN([AM_CONDITIONAL],
   290   6778   [AC_PREREQ(2.52)dnl
   291   6779    ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
   292   6780   	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
   293   6781   AC_SUBST([$1_TRUE])dnl
   294   6782   AC_SUBST([$1_FALSE])dnl
   295   6783   _AM_SUBST_NOTMAKE([$1_TRUE])dnl
   296   6784   _AM_SUBST_NOTMAKE([$1_FALSE])dnl
   297         -m4_define([_AM_COND_VALUE_$1], [$2])dnl
   298   6785   if $2; then
   299   6786     $1_TRUE=
   300   6787     $1_FALSE='#'
   301   6788   else
   302   6789     $1_TRUE='#'
   303   6790     $1_FALSE=
   304   6791   fi
   305   6792   AC_CONFIG_COMMANDS_PRE(
   306   6793   [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
   307   6794     AC_MSG_ERROR([[conditional "$1" was never defined.
   308   6795   Usually this means the macro was only invoked conditionally.]])
   309   6796   fi])])
   310   6797   
   311         -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
   312         -# 2010, 2011 Free Software Foundation, Inc.
         6798  +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
         6799  +# Free Software Foundation, Inc.
   313   6800   #
   314   6801   # This file is free software; the Free Software Foundation
   315   6802   # gives unlimited permission to copy and/or distribute it,
   316   6803   # with or without modifications, as long as this notice is preserved.
   317   6804   
   318         -# serial 12
         6805  +# serial 9
   319   6806   
   320   6807   # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
   321   6808   # written in clear, in which case automake, when reading aclocal.m4,
   322   6809   # will think it sees a *use*, and therefore will trigger all it's
   323   6810   # C support machinery.  Also note that it means that autoscan, seeing
   324   6811   # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
   325   6812   
................................................................................
   351   6838                  [am_cv_$1_dependencies_compiler_type],
   352   6839   [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   353   6840     # We make a subdir and do the tests there.  Otherwise we can end up
   354   6841     # making bogus files that we don't know about and never remove.  For
   355   6842     # instance it was reported that on HP-UX the gcc test will end up
   356   6843     # making a dummy file named `D' -- because `-MD' means `put the output
   357   6844     # in D'.
   358         -  rm -rf conftest.dir
   359   6845     mkdir conftest.dir
   360   6846     # Copy depcomp to subdir because otherwise we won't find it if we're
   361   6847     # using a relative directory.
   362   6848     cp "$am_depcomp" conftest.dir
   363   6849     cd conftest.dir
   364   6850     # We will build objects and dependencies in a subdirectory because
   365   6851     # it helps to detect inapplicable dependency modes.  For instance
................................................................................
   369   6855     # directory.
   370   6856     mkdir sub
   371   6857   
   372   6858     am_cv_$1_dependencies_compiler_type=none
   373   6859     if test "$am_compiler_list" = ""; then
   374   6860        am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
   375   6861     fi
   376         -  am__universal=false
   377         -  m4_case([$1], [CC],
   378         -    [case " $depcc " in #(
   379         -     *\ -arch\ *\ -arch\ *) am__universal=true ;;
   380         -     esac],
   381         -    [CXX],
   382         -    [case " $depcc " in #(
   383         -     *\ -arch\ *\ -arch\ *) am__universal=true ;;
   384         -     esac])
   385         -
   386   6862     for depmode in $am_compiler_list; do
   387   6863       # Setup a source with many dependencies, because some compilers
   388   6864       # like to wrap large dependency lists on column 80 (with \), and
   389   6865       # we should not choose a depcomp mode which is confused by this.
   390   6866       #
   391   6867       # We need to recreate these files for each test, as the compiler may
   392   6868       # overwrite some of them when testing with obscure command lines.
................................................................................
   396   6872         echo '#include "conftst'$i'.h"' >> sub/conftest.c
   397   6873         # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
   398   6874         # Solaris 8's {/usr,}/bin/sh.
   399   6875         touch sub/conftst$i.h
   400   6876       done
   401   6877       echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
   402   6878   
   403         -    # We check with `-c' and `-o' for the sake of the "dashmstdout"
   404         -    # mode.  It turns out that the SunPro C++ compiler does not properly
   405         -    # handle `-M -o', and we need to detect this.  Also, some Intel
   406         -    # versions had trouble with output in subdirs
   407         -    am__obj=sub/conftest.${OBJEXT-o}
   408         -    am__minus_obj="-o $am__obj"
   409   6879       case $depmode in
   410         -    gcc)
   411         -      # This depmode causes a compiler race in universal mode.
   412         -      test "$am__universal" = false || continue
   413         -      ;;
   414   6880       nosideeffect)
   415   6881         # after this tag, mechanisms are not by side-effect, so they'll
   416   6882         # only be used when explicitly requested
   417   6883         if test "x$enable_dependency_tracking" = xyes; then
   418   6884   	continue
   419   6885         else
   420   6886   	break
   421   6887         fi
   422   6888         ;;
   423         -    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
   424         -      # This compiler won't grok `-c -o', but also, the minuso test has
   425         -      # not run yet.  These depmodes are late enough in the game, and
   426         -      # so weak that their functioning should not be impacted.
   427         -      am__obj=conftest.${OBJEXT-o}
   428         -      am__minus_obj=
   429         -      ;;
   430   6889       none) break ;;
   431   6890       esac
         6891  +    # We check with `-c' and `-o' for the sake of the "dashmstdout"
         6892  +    # mode.  It turns out that the SunPro C++ compiler does not properly
         6893  +    # handle `-M -o', and we need to detect this.
   432   6894       if depmode=$depmode \
   433         -       source=sub/conftest.c object=$am__obj \
         6895  +       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
   434   6896          depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
   435         -       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
         6897  +       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
   436   6898            >/dev/null 2>conftest.err &&
   437   6899          grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
   438   6900          grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
   439         -       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
         6901  +       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
   440   6902          ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
   441   6903         # icc doesn't choke on unknown options, it will just issue warnings
   442   6904         # or remarks (even with -Werror).  So we grep stderr for any message
   443   6905         # that says an option was ignored or not supported.
   444   6906         # When given -MP, icc 7.0 and 7.1 complain thusly:
   445   6907         #   icc: Command line warning: ignoring option '-M'; no argument required
   446   6908         # The diagnosis changed in icc 8.0:
................................................................................
   481   6943   AC_DEFUN([AM_DEP_TRACK],
   482   6944   [AC_ARG_ENABLE(dependency-tracking,
   483   6945   [  --disable-dependency-tracking  speeds up one-time build
   484   6946     --enable-dependency-tracking   do not reject slow dependency extractors])
   485   6947   if test "x$enable_dependency_tracking" != xno; then
   486   6948     am_depcomp="$ac_aux_dir/depcomp"
   487   6949     AMDEPBACKSLASH='\'
   488         -  am__nodep='_no'
   489   6950   fi
   490   6951   AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
   491   6952   AC_SUBST([AMDEPBACKSLASH])dnl
   492   6953   _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
   493         -AC_SUBST([am__nodep])dnl
   494         -_AM_SUBST_NOTMAKE([am__nodep])dnl
   495   6954   ])
   496   6955   
   497   6956   # Generate code to set up dependency tracking.              -*- Autoconf -*-
   498   6957   
   499         -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
         6958  +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
   500   6959   # Free Software Foundation, Inc.
   501   6960   #
   502   6961   # This file is free software; the Free Software Foundation
   503   6962   # gives unlimited permission to copy and/or distribute it,
   504   6963   # with or without modifications, as long as this notice is preserved.
   505   6964   
   506         -#serial 5
         6965  +#serial 3
   507   6966   
   508   6967   # _AM_OUTPUT_DEPENDENCY_COMMANDS
   509   6968   # ------------------------------
   510   6969   AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   511         -[{
   512         -  # Autoconf 2.62 quotes --file arguments for eval, but not when files
   513         -  # are listed without --file.  Let's play safe and only enable the eval
   514         -  # if we detect the quoting.
   515         -  case $CONFIG_FILES in
   516         -  *\'*) eval set x "$CONFIG_FILES" ;;
   517         -  *)   set x $CONFIG_FILES ;;
   518         -  esac
   519         -  shift
   520         -  for mf
   521         -  do
   522         -    # Strip MF so we end up with the name of the file.
   523         -    mf=`echo "$mf" | sed -e 's/:.*$//'`
   524         -    # Check whether this is an Automake generated Makefile or not.
   525         -    # We used to match only the files named `Makefile.in', but
   526         -    # some people rename them; so instead we look at the file content.
   527         -    # Grep'ing the first line is not enough: some people post-process
   528         -    # each Makefile.in and add a new line on top of each file to say so.
   529         -    # Grep'ing the whole file is not good either: AIX grep has a line
   530         -    # limit of 2048, but all sed's we know have understand at least 4000.
   531         -    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
   532         -      dirpart=`AS_DIRNAME("$mf")`
   533         -    else
   534         -      continue
   535         -    fi
   536         -    # Extract the definition of DEPDIR, am__include, and am__quote
   537         -    # from the Makefile without running `make'.
   538         -    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
   539         -    test -z "$DEPDIR" && continue
   540         -    am__include=`sed -n 's/^am__include = //p' < "$mf"`
   541         -    test -z "am__include" && continue
   542         -    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
   543         -    # When using ansi2knr, U may be empty or an underscore; expand it
   544         -    U=`sed -n 's/^U = //p' < "$mf"`
   545         -    # Find all dependency output files, they are included files with
   546         -    # $(DEPDIR) in their names.  We invoke sed twice because it is the
   547         -    # simplest approach to changing $(DEPDIR) to its actual value in the
   548         -    # expansion.
   549         -    for file in `sed -n "
   550         -      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
   551         -	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
   552         -      # Make sure the directory exists.
   553         -      test -f "$dirpart/$file" && continue
   554         -      fdir=`AS_DIRNAME(["$file"])`
   555         -      AS_MKDIR_P([$dirpart/$fdir])
   556         -      # echo "creating $dirpart/$file"
   557         -      echo '# dummy' > "$dirpart/$file"
   558         -    done
         6970  +[for mf in $CONFIG_FILES; do
         6971  +  # Strip MF so we end up with the name of the file.
         6972  +  mf=`echo "$mf" | sed -e 's/:.*$//'`
         6973  +  # Check whether this is an Automake generated Makefile or not.
         6974  +  # We used to match only the files named `Makefile.in', but
         6975  +  # some people rename them; so instead we look at the file content.
         6976  +  # Grep'ing the first line is not enough: some people post-process
         6977  +  # each Makefile.in and add a new line on top of each file to say so.
         6978  +  # Grep'ing the whole file is not good either: AIX grep has a line
         6979  +  # limit of 2048, but all sed's we know have understand at least 4000.
         6980  +  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
         6981  +    dirpart=`AS_DIRNAME("$mf")`
         6982  +  else
         6983  +    continue
         6984  +  fi
         6985  +  # Extract the definition of DEPDIR, am__include, and am__quote
         6986  +  # from the Makefile without running `make'.
         6987  +  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
         6988  +  test -z "$DEPDIR" && continue
         6989  +  am__include=`sed -n 's/^am__include = //p' < "$mf"`
         6990  +  test -z "am__include" && continue
         6991  +  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
         6992  +  # When using ansi2knr, U may be empty or an underscore; expand it
         6993  +  U=`sed -n 's/^U = //p' < "$mf"`
         6994  +  # Find all dependency output files, they are included files with
         6995  +  # $(DEPDIR) in their names.  We invoke sed twice because it is the
         6996  +  # simplest approach to changing $(DEPDIR) to its actual value in the
         6997  +  # expansion.
         6998  +  for file in `sed -n "
         6999  +    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
         7000  +       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
         7001  +    # Make sure the directory exists.
         7002  +    test -f "$dirpart/$file" && continue
         7003  +    fdir=`AS_DIRNAME(["$file"])`
         7004  +    AS_MKDIR_P([$dirpart/$fdir])
         7005  +    # echo "creating $dirpart/$file"
         7006  +    echo '# dummy' > "$dirpart/$file"
   559   7007     done
   560         -}
         7008  +done
   561   7009   ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
   562   7010   
   563   7011   
   564   7012   # AM_OUTPUT_DEPENDENCY_COMMANDS
   565   7013   # -----------------------------
   566   7014   # This macro should only be invoked once -- use via AC_REQUIRE.
   567   7015   #
................................................................................
   570   7018   # need in order to bootstrap the dependency handling code.
   571   7019   AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
   572   7020   [AC_CONFIG_COMMANDS([depfiles],
   573   7021        [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
   574   7022        [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
   575   7023   ])
   576   7024   
   577         -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
   578         -# Free Software Foundation, Inc.
         7025  +# Do all the work for Automake.                             -*- Autoconf -*-
         7026  +
         7027  +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
         7028  +# 2005, 2006, 2008 Free Software Foundation, Inc.
   579   7029   #
   580   7030   # This file is free software; the Free Software Foundation
   581   7031   # gives unlimited permission to copy and/or distribute it,
   582   7032   # with or without modifications, as long as this notice is preserved.
   583   7033   
   584         -# serial 8
   585         -
   586         -# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
   587         -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
   588         -
   589         -# Do all the work for Automake.                             -*- Autoconf -*-
   590         -
   591         -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
   592         -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
   593         -#
   594         -# This file is free software; the Free Software Foundation
   595         -# gives unlimited permission to copy and/or distribute it,
   596         -# with or without modifications, as long as this notice is preserved.
   597         -
   598         -# serial 16
         7034  +# serial 13
   599   7035   
   600   7036   # This macro actually does too much.  Some checks are only needed if
   601   7037   # your package does certain things.  But this isn't really a big deal.
   602   7038   
   603   7039   # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
   604   7040   # AM_INIT_AUTOMAKE([OPTIONS])
   605   7041   # -----------------------------------------------
................................................................................
   608   7044   # and VERSION should now be passed to AC_INIT and removed from
   609   7045   # the call to AM_INIT_AUTOMAKE.
   610   7046   # We support both call styles for the transition.  After
   611   7047   # the next Automake release, Autoconf can make the AC_INIT
   612   7048   # arguments mandatory, and then we can depend on a new Autoconf
   613   7049   # release and drop the old call support.
   614   7050   AC_DEFUN([AM_INIT_AUTOMAKE],
   615         -[AC_PREREQ([2.62])dnl
         7051  +[AC_PREREQ([2.60])dnl
   616   7052   dnl Autoconf wants to disallow AM_ names.  We explicitly allow
   617   7053   dnl the ones we care about.
   618   7054   m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
   619   7055   AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
   620   7056   AC_REQUIRE([AC_PROG_INSTALL])dnl
   621   7057   if test "`cd $srcdir && pwd`" != "`pwd`"; then
   622   7058     # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
................................................................................
   659   7095   AC_REQUIRE([AM_SANITY_CHECK])dnl
   660   7096   AC_REQUIRE([AC_ARG_PROGRAM])dnl
   661   7097   AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
   662   7098   AM_MISSING_PROG(AUTOCONF, autoconf)
   663   7099   AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
   664   7100   AM_MISSING_PROG(AUTOHEADER, autoheader)
   665   7101   AM_MISSING_PROG(MAKEINFO, makeinfo)
   666         -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
   667         -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
         7102  +AM_PROG_INSTALL_SH
         7103  +AM_PROG_INSTALL_STRIP
   668   7104   AC_REQUIRE([AM_PROG_MKDIR_P])dnl
   669   7105   # We need awk for the "check" target.  The system "awk" is bad on
   670   7106   # some platforms.
   671   7107   AC_REQUIRE([AC_PROG_AWK])dnl
   672   7108   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
   673   7109   AC_REQUIRE([AM_SET_LEADING_DOT])dnl
   674   7110   _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
   675         -	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
   676         -			     [_AM_PROG_TAR([v7])])])
         7111  +              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
         7112  +	      		     [_AM_PROG_TAR([v7])])])
   677   7113   _AM_IF_OPTION([no-dependencies],,
   678   7114   [AC_PROVIDE_IFELSE([AC_PROG_CC],
   679         -		  [_AM_DEPENDENCIES(CC)],
   680         -		  [define([AC_PROG_CC],
   681         -			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
         7115  +                  [_AM_DEPENDENCIES(CC)],
         7116  +                  [define([AC_PROG_CC],
         7117  +                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
   682   7118   AC_PROVIDE_IFELSE([AC_PROG_CXX],
   683         -		  [_AM_DEPENDENCIES(CXX)],
   684         -		  [define([AC_PROG_CXX],
   685         -			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
         7119  +                  [_AM_DEPENDENCIES(CXX)],
         7120  +                  [define([AC_PROG_CXX],
         7121  +                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
   686   7122   AC_PROVIDE_IFELSE([AC_PROG_OBJC],
   687         -		  [_AM_DEPENDENCIES(OBJC)],
   688         -		  [define([AC_PROG_OBJC],
   689         -			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
         7123  +                  [_AM_DEPENDENCIES(OBJC)],
         7124  +                  [define([AC_PROG_OBJC],
         7125  +                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
   690   7126   ])
   691         -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
   692         -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
   693         -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
   694         -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
   695         -AC_CONFIG_COMMANDS_PRE(dnl
   696         -[m4_provide_if([_AM_COMPILER_EXEEXT],
   697         -  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
   698   7127   ])
   699   7128   
   700         -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
   701         -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
   702         -dnl mangled by Autoconf and run in a shell conditional statement.
   703         -m4_define([_AC_COMPILER_EXEEXT],
   704         -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
   705         -
   706   7129   
   707   7130   # When config.status generates a header, we must update the stamp-h file.
   708   7131   # This file resides in the same directory as the config header
   709   7132   # that is generated.  The stamp files are numbered to have different names.
   710   7133   
   711   7134   # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
   712   7135   # loop where config.status creates the headers, so we can generate
................................................................................
   721   7144         break ;;
   722   7145       * )
   723   7146         _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   724   7147     esac
   725   7148   done
   726   7149   echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
   727   7150   
   728         -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
   729         -# Inc.
         7151  +# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
   730   7152   #
   731   7153   # This file is free software; the Free Software Foundation
   732   7154   # gives unlimited permission to copy and/or distribute it,
   733   7155   # with or without modifications, as long as this notice is preserved.
   734   7156   
   735         -# serial 1
   736         -
   737   7157   # AM_PROG_INSTALL_SH
   738   7158   # ------------------
   739   7159   # Define $install_sh.
   740   7160   AC_DEFUN([AM_PROG_INSTALL_SH],
   741   7161   [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
   742         -if test x"${install_sh}" != xset; then
   743         -  case $am_aux_dir in
   744         -  *\ * | *\	*)
   745         -    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
   746         -  *)
   747         -    install_sh="\${SHELL} $am_aux_dir/install-sh"
   748         -  esac
   749         -fi
         7162  +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
   750   7163   AC_SUBST(install_sh)])
   751   7164   
   752   7165   # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
   753   7166   #
   754   7167   # This file is free software; the Free Software Foundation
   755   7168   # gives unlimited permission to copy and/or distribute it,
   756   7169   # with or without modifications, as long as this notice is preserved.
................................................................................
   769   7182   fi
   770   7183   rmdir .tst 2>/dev/null
   771   7184   AC_SUBST([am__leading_dot])])
   772   7185   
   773   7186   # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
   774   7187   # From Jim Meyering
   775   7188   
   776         -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
   777         -# 2011 Free Software Foundation, Inc.
         7189  +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
         7190  +# Free Software Foundation, Inc.
   778   7191   #
   779   7192   # This file is free software; the Free Software Foundation
   780   7193   # gives unlimited permission to copy and/or distribute it,
   781   7194   # with or without modifications, as long as this notice is preserved.
   782   7195   
   783         -# serial 5
         7196  +# serial 4
   784   7197   
   785         -# AM_MAINTAINER_MODE([DEFAULT-MODE])
   786         -# ----------------------------------
   787         -# Control maintainer-specific portions of Makefiles.
   788         -# Default is to disable them, unless `enable' is passed literally.
   789         -# For symmetry, `disable' may be passed as well.  Anyway, the user
   790         -# can override the default with the --enable/--disable switch.
   791   7198   AC_DEFUN([AM_MAINTAINER_MODE],
   792         -[m4_case(m4_default([$1], [disable]),
   793         -       [enable], [m4_define([am_maintainer_other], [disable])],
   794         -       [disable], [m4_define([am_maintainer_other], [enable])],
   795         -       [m4_define([am_maintainer_other], [enable])
   796         -        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
   797         -AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
   798         -  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
   799         -  AC_ARG_ENABLE([maintainer-mode],
   800         -[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
         7199  +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
         7200  +  dnl maintainer-mode is disabled by default
         7201  +  AC_ARG_ENABLE(maintainer-mode,
         7202  +[  --enable-maintainer-mode  enable make rules and dependencies not useful
   801   7203   			  (and sometimes confusing) to the casual installer],
   802         -      [USE_MAINTAINER_MODE=$enableval],
   803         -      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
         7204  +      USE_MAINTAINER_MODE=$enableval,
         7205  +      USE_MAINTAINER_MODE=no)
   804   7206     AC_MSG_RESULT([$USE_MAINTAINER_MODE])
   805         -  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
         7207  +  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
   806   7208     MAINT=$MAINTAINER_MODE_TRUE
   807         -  AC_SUBST([MAINT])dnl
         7209  +  AC_SUBST(MAINT)dnl
   808   7210   ]
   809   7211   )
   810   7212   
   811   7213   AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
   812   7214   
   813   7215   # Check to see how 'make' treats includes.	            -*- Autoconf -*-
   814   7216   
   815         -# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
         7217  +# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
   816   7218   #
   817   7219   # This file is free software; the Free Software Foundation
   818   7220   # gives unlimited permission to copy and/or distribute it,
   819   7221   # with or without modifications, as long as this notice is preserved.
   820   7222   
   821         -# serial 4
         7223  +# serial 3
   822   7224   
   823   7225   # AM_MAKE_INCLUDE()
   824   7226   # -----------------
   825   7227   # Check to see how make treats includes.
   826   7228   AC_DEFUN([AM_MAKE_INCLUDE],
   827   7229   [am_make=${MAKE-make}
   828   7230   cat > confinc << 'END'
   829   7231   am__doit:
   830         -	@echo this is the am__doit target
         7232  +	@echo done
   831   7233   .PHONY: am__doit
   832   7234   END
   833   7235   # If we don't find an include directive, just comment out the code.
   834   7236   AC_MSG_CHECKING([for style of include used by $am_make])
   835   7237   am__include="#"
   836   7238   am__quote=
   837   7239   _am_result=none
   838   7240   # First try GNU make style include.
   839   7241   echo "include confinc" > confmf
   840         -# Ignore all kinds of additional output from `make'.
   841         -case `$am_make -s -f confmf 2> /dev/null` in #(
   842         -*the\ am__doit\ target*)
   843         -  am__include=include
   844         -  am__quote=
   845         -  _am_result=GNU
   846         -  ;;
   847         -esac
         7242  +# We grep out `Entering directory' and `Leaving directory'
         7243  +# messages which can occur if `w' ends up in MAKEFLAGS.
         7244  +# In particular we don't look at `^make:' because GNU make might
         7245  +# be invoked under some other name (usually "gmake"), in which
         7246  +# case it prints its new name instead of `make'.
         7247  +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
         7248  +   am__include=include
         7249  +   am__quote=
         7250  +   _am_result=GNU
         7251  +fi
   848   7252   # Now try BSD make style include.
   849   7253   if test "$am__include" = "#"; then
   850   7254      echo '.include "confinc"' > confmf
   851         -   case `$am_make -s -f confmf 2> /dev/null` in #(
   852         -   *the\ am__doit\ target*)
   853         -     am__include=.include
   854         -     am__quote="\""
   855         -     _am_result=BSD
   856         -     ;;
   857         -   esac
         7255  +   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
         7256  +      am__include=.include
         7257  +      am__quote="\""
         7258  +      _am_result=BSD
         7259  +   fi
   858   7260   fi
   859   7261   AC_SUBST([am__include])
   860   7262   AC_SUBST([am__quote])
   861   7263   AC_MSG_RESULT([$_am_result])
   862   7264   rm -f confinc confmf
   863   7265   ])
   864   7266   
   865   7267   # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
   866   7268   
   867         -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
         7269  +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
   868   7270   # Free Software Foundation, Inc.
   869   7271   #
   870   7272   # This file is free software; the Free Software Foundation
   871   7273   # gives unlimited permission to copy and/or distribute it,
   872   7274   # with or without modifications, as long as this notice is preserved.
   873   7275   
   874         -# serial 6
         7276  +# serial 5
   875   7277   
   876   7278   # AM_MISSING_PROG(NAME, PROGRAM)
   877   7279   # ------------------------------
   878   7280   AC_DEFUN([AM_MISSING_PROG],
   879   7281   [AC_REQUIRE([AM_MISSING_HAS_RUN])
   880   7282   $1=${$1-"${am_missing_run}$2"}
   881   7283   AC_SUBST($1)])
................................................................................
   884   7286   # AM_MISSING_HAS_RUN
   885   7287   # ------------------
   886   7288   # Define MISSING if not defined so far and test if it supports --run.
   887   7289   # If it does, set am_missing_run to use it, otherwise, to nothing.
   888   7290   AC_DEFUN([AM_MISSING_HAS_RUN],
   889   7291   [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
   890   7292   AC_REQUIRE_AUX_FILE([missing])dnl
   891         -if test x"${MISSING+set}" != xset; then
   892         -  case $am_aux_dir in
   893         -  *\ * | *\	*)
   894         -    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
   895         -  *)
   896         -    MISSING="\${SHELL} $am_aux_dir/missing" ;;
   897         -  esac
   898         -fi
         7293  +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
   899   7294   # Use eval to expand $SHELL
   900   7295   if eval "$MISSING --run true"; then
   901   7296     am_missing_run="$MISSING --run "
   902   7297   else
   903   7298     am_missing_run=
   904   7299     AC_MSG_WARN([`missing' script is too old or missing])
   905   7300   fi
   906   7301   ])
   907   7302   
   908         -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
   909         -# Inc.
         7303  +# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
   910   7304   #
   911   7305   # This file is free software; the Free Software Foundation
   912   7306   # gives unlimited permission to copy and/or distribute it,
   913   7307   # with or without modifications, as long as this notice is preserved.
   914   7308   
   915         -# serial 1
   916         -
   917   7309   # AM_PROG_MKDIR_P
   918   7310   # ---------------
   919   7311   # Check for `mkdir -p'.
   920   7312   AC_DEFUN([AM_PROG_MKDIR_P],
   921   7313   [AC_PREREQ([2.60])dnl
   922   7314   AC_REQUIRE([AC_PROG_MKDIR_P])dnl
   923   7315   dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
................................................................................
   932   7324     [[\\/$]]* | ?:[[\\/]]*) ;;
   933   7325     */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
   934   7326   esac
   935   7327   ])
   936   7328   
   937   7329   # Helper functions for option handling.                     -*- Autoconf -*-
   938   7330   
   939         -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
   940         -# Foundation, Inc.
         7331  +# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
   941   7332   #
   942   7333   # This file is free software; the Free Software Foundation
   943   7334   # gives unlimited permission to copy and/or distribute it,
   944   7335   # with or without modifications, as long as this notice is preserved.
   945   7336   
   946         -# serial 5
         7337  +# serial 3
   947   7338   
   948   7339   # _AM_MANGLE_OPTION(NAME)
   949   7340   # -----------------------
   950   7341   AC_DEFUN([_AM_MANGLE_OPTION],
   951   7342   [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
   952   7343   
   953   7344   # _AM_SET_OPTION(NAME)
   954         -# --------------------
         7345  +# ------------------------------
   955   7346   # Set option NAME.  Presently that only means defining a flag for this option.
   956   7347   AC_DEFUN([_AM_SET_OPTION],
   957   7348   [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
   958   7349   
   959   7350   # _AM_SET_OPTIONS(OPTIONS)
   960         -# ------------------------
         7351  +# ----------------------------------
   961   7352   # OPTIONS is a space-separated list of Automake options.
   962   7353   AC_DEFUN([_AM_SET_OPTIONS],
   963         -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
         7354  +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
   964   7355   
   965   7356   # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
   966   7357   # -------------------------------------------
   967   7358   # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
   968   7359   AC_DEFUN([_AM_IF_OPTION],
   969   7360   [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
   970   7361   
   971   7362   # Check to make sure that the build environment is sane.    -*- Autoconf -*-
   972   7363   
   973         -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
         7364  +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
   974   7365   # Free Software Foundation, Inc.
   975   7366   #
   976   7367   # This file is free software; the Free Software Foundation
   977   7368   # gives unlimited permission to copy and/or distribute it,
   978   7369   # with or without modifications, as long as this notice is preserved.
   979   7370   
   980         -# serial 5
         7371  +# serial 4
   981   7372   
   982   7373   # AM_SANITY_CHECK
   983   7374   # ---------------
   984   7375   AC_DEFUN([AM_SANITY_CHECK],
   985   7376   [AC_MSG_CHECKING([whether build environment is sane])
   986   7377   # Just in case
   987   7378   sleep 1
   988   7379   echo timestamp > conftest.file
   989         -# Reject unsafe characters in $srcdir or the absolute working directory
   990         -# name.  Accept space and tab only in the latter.
   991         -am_lf='
   992         -'
   993         -case `pwd` in
   994         -  *[[\\\"\#\$\&\'\`$am_lf]]*)
   995         -    AC_MSG_ERROR([unsafe absolute working directory name]);;
   996         -esac
   997         -case $srcdir in
   998         -  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
   999         -    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
  1000         -esac
  1001         -
  1002   7380   # Do `set' in a subshell so we don't clobber the current shell's
  1003   7381   # arguments.  Must try -L first in case configure is actually a
  1004   7382   # symlink; some systems play weird games with the mod time of symlinks
  1005   7383   # (eg FreeBSD returns the mod time of the symlink's containing
  1006   7384   # directory).
  1007   7385   if (
  1008         -   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
         7386  +   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
  1009   7387      if test "$[*]" = "X"; then
  1010   7388         # -L didn't work.
  1011         -      set X `ls -t "$srcdir/configure" conftest.file`
         7389  +      set X `ls -t $srcdir/configure conftest.file`
  1012   7390      fi
  1013   7391      rm -f conftest.file
  1014   7392      if test "$[*]" != "X $srcdir/configure conftest.file" \
  1015   7393         && test "$[*]" != "X conftest.file $srcdir/configure"; then
  1016   7394   
  1017   7395         # If neither matched, then we have a broken ls.  This can happen
  1018   7396         # if, for instance, CONFIG_SHELL is bash and it inherits a
................................................................................
  1029   7407      :
  1030   7408   else
  1031   7409      AC_MSG_ERROR([newly created file is older than distributed files!
  1032   7410   Check your system clock])
  1033   7411   fi
  1034   7412   AC_MSG_RESULT(yes)])
  1035   7413   
  1036         -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
         7414  +# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
  1037   7415   #
  1038   7416   # This file is free software; the Free Software Foundation
  1039   7417   # gives unlimited permission to copy and/or distribute it,
  1040   7418   # with or without modifications, as long as this notice is preserved.
  1041   7419   
  1042         -# serial 1
  1043         -
  1044   7420   # AM_PROG_INSTALL_STRIP
  1045   7421   # ---------------------
  1046   7422   # One issue with vendor `install' (even GNU) is that you can't
  1047   7423   # specify the program used to strip binaries.  This is especially
  1048   7424   # annoying in cross-compiling environments, where the build's strip
  1049   7425   # is unlikely to handle the host's binaries.
  1050   7426   # Fortunately install-sh will honor a STRIPPROG variable, so we
................................................................................
  1059   7435   dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
  1060   7436   if test "$cross_compiling" != no; then
  1061   7437     AC_CHECK_TOOL([STRIP], [strip], :)
  1062   7438   fi
  1063   7439   INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  1064   7440   AC_SUBST([INSTALL_STRIP_PROGRAM])])
  1065   7441   
  1066         -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
         7442  +# Copyright (C) 2006  Free Software Foundation, Inc.
  1067   7443   #
  1068   7444   # This file is free software; the Free Software Foundation
  1069   7445   # gives unlimited permission to copy and/or distribute it,
  1070   7446   # with or without modifications, as long as this notice is preserved.
  1071   7447   
  1072         -# serial 3
  1073         -
  1074   7448   # _AM_SUBST_NOTMAKE(VARIABLE)
  1075   7449   # ---------------------------
  1076   7450   # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  1077   7451   # This macro is traced by Automake.
  1078   7452   AC_DEFUN([_AM_SUBST_NOTMAKE])
  1079   7453   
  1080         -# AM_SUBST_NOTMAKE(VARIABLE)
  1081         -# --------------------------
  1082         -# Public sister of _AM_SUBST_NOTMAKE.
  1083         -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  1084         -
  1085   7454   # Check how to create a tarball.                            -*- Autoconf -*-
  1086   7455   
  1087         -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
         7456  +# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
  1088   7457   #
  1089   7458   # This file is free software; the Free Software Foundation
  1090   7459   # gives unlimited permission to copy and/or distribute it,
  1091   7460   # with or without modifications, as long as this notice is preserved.
  1092   7461   
  1093   7462   # serial 2
  1094   7463   
................................................................................
  1102   7471   # $tardir.
  1103   7472   #     tardir=directory && $(am__tar) > result.tar
  1104   7473   #
  1105   7474   # Substitute a variable $(am__untar) that extract such
  1106   7475   # a tarball read from stdin.
  1107   7476   #     $(am__untar) < result.tar
  1108   7477   AC_DEFUN([_AM_PROG_TAR],
  1109         -[# Always define AMTAR for backward compatibility.  Yes, it's still used
  1110         -# in the wild :-(  We should find a proper way to deprecate it ...
  1111         -AC_SUBST([AMTAR], ['$${TAR-tar}'])
         7478  +[# Always define AMTAR for backward compatibility.
         7479  +AM_MISSING_PROG([AMTAR], [tar])
  1112   7480   m4_if([$1], [v7],
  1113         -     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
         7481  +     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
  1114   7482        [m4_case([$1], [ustar],, [pax],,
  1115   7483                 [m4_fatal([Unknown tar format])])
  1116   7484   AC_MSG_CHECKING([how to create a $1 tar archive])
  1117   7485   # Loop over all known methods to create a tar archive until one works.
  1118   7486   _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  1119   7487   _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  1120   7488   # Do not fold the above two line into one, because Tru64 sh and
................................................................................
  1175   7543   
  1176   7544   AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  1177   7545   AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  1178   7546   AC_SUBST([am__tar])
  1179   7547   AC_SUBST([am__untar])
  1180   7548   ]) # _AM_PROG_TAR
  1181   7549   
  1182         -m4_include([m4/libtool.m4])
  1183         -m4_include([m4/ltoptions.m4])
  1184         -m4_include([m4/ltsugar.m4])
  1185         -m4_include([m4/ltversion.m4])
  1186         -m4_include([m4/lt~obsolete.m4])

Changes to config.guess.

     1      1   #! /bin/sh
     2      2   # Attempt to guess a canonical system name.
     3      3   #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4         -#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
     5         -#   Free Software Foundation, Inc.
            4  +#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
            5  +#   Inc.
     6      6   
     7         -timestamp='2009-11-20'
            7  +timestamp='2007-07-22'
     8      8   
     9      9   # This file is free software; you can redistribute it and/or modify it
    10     10   # under the terms of the GNU General Public License as published by
    11     11   # the Free Software Foundation; either version 2 of the License, or
    12     12   # (at your option) any later version.
    13     13   #
    14     14   # This program is distributed in the hope that it will be useful, but
................................................................................
    23     23   #
    24     24   # As a special exception to the GNU General Public License, if you
    25     25   # distribute this file as part of a program that contains a
    26     26   # configuration script generated by Autoconf, you may include it under
    27     27   # the same distribution terms that you use for the rest of that program.
    28     28   
    29     29   
    30         -# Originally written by Per Bothner.  Please send patches (context
    31         -# diff format) to <config-patches@gnu.org> and include a ChangeLog
    32         -# entry.
           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.
    33     33   #
    34     34   # This script attempts to guess a canonical system name similar to
    35     35   # config.sub.  If it succeeds, it prints the system name on stdout, and
    36     36   # exits with 0.  Otherwise, it exits with 1.
    37     37   #
    38         -# You can get the latest version of this script from:
    39         -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
           38  +# The plan is that this can be called by configure scripts if you
           39  +# don't specify an explicit build system type.
    40     40   
    41     41   me=`echo "$0" | sed -e 's,.*/,,'`
    42     42   
    43     43   usage="\
    44     44   Usage: $0 [OPTION]
    45     45   
    46     46   Output the configuration name of the system \`$me' is run on.
................................................................................
    52     52   
    53     53   Report bugs and patches to <config-patches@gnu.org>."
    54     54   
    55     55   version="\
    56     56   GNU config.guess ($timestamp)
    57     57   
    58     58   Originally written by Per Bothner.
    59         -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
    60         -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
           59  +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
           60  +Free Software Foundation, Inc.
    61     61   
    62     62   This is free software; see the source for copying conditions.  There is NO
    63     63   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    64     64   
    65     65   help="
    66     66   Try \`$me --help' for more information."
    67     67   
................................................................................
   166    166   	esac
   167    167   	# The Operating System including object format, if it has switched
   168    168   	# to ELF recently, or will in the future.
   169    169   	case "${UNAME_MACHINE_ARCH}" in
   170    170   	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
   171    171   		eval $set_cc_for_build
   172    172   		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
   173         -			| grep -q __ELF__
          173  +			| grep __ELF__ >/dev/null
   174    174   		then
   175    175   		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
   176    176   		    # Return netbsd for either.  FIX?
   177    177   		    os=netbsd
   178    178   		else
   179    179   		    os=netbsdelf
   180    180   		fi
................................................................................
   320    320       DRS?6000:unix:4.0:6*)
   321    321   	echo sparc-icl-nx6
   322    322   	exit ;;
   323    323       DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
   324    324   	case `/usr/bin/uname -p` in
   325    325   	    sparc) echo sparc-icl-nx7; exit ;;
   326    326   	esac ;;
   327         -    s390x:SunOS:*:*)
   328         -	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   329         -	exit ;;
   330    327       sun4H:SunOS:5.*:*)
   331    328   	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   332    329   	exit ;;
   333    330       sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   334    331   	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   335    332   	exit ;;
   336         -    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
   337         -	echo i386-pc-auroraux${UNAME_RELEASE}
   338         -	exit ;;
   339    333       i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
   340         -	eval $set_cc_for_build
   341         -	SUN_ARCH="i386"
   342         -	# If there is a compiler, see if it is configured for 64-bit objects.
   343         -	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
   344         -	# This test works for both compilers.
   345         -	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
   346         -	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
   347         -		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
   348         -		grep IS_64BIT_ARCH >/dev/null
   349         -	    then
   350         -		SUN_ARCH="x86_64"
   351         -	    fi
   352         -	fi
   353         -	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          334  +	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   354    335   	exit ;;
   355    336       sun4*:SunOS:6*:*)
   356    337   	# According to config.sub, this is the proper way to canonicalize
   357    338   	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
   358    339   	# it's likely to be more like Solaris than SunOS4.
   359    340   	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   360    341   	exit ;;
................................................................................
   547    528   		fi
   548    529   	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
   549    530   		echo rs6000-ibm-aix3.2.4
   550    531   	else
   551    532   		echo rs6000-ibm-aix3.2
   552    533   	fi
   553    534   	exit ;;
   554         -    *:AIX:*:[456])
          535  +    *:AIX:*:[45])
   555    536   	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
   556    537   	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
   557    538   		IBM_ARCH=rs6000
   558    539   	else
   559    540   		IBM_ARCH=powerpc
   560    541   	fi
   561    542   	if [ -x /usr/bin/oslevel ] ; then
................................................................................
   655    636   	    #
   656    637   	    # $ CC_FOR_BUILD=cc ./config.guess
   657    638   	    # => hppa2.0w-hp-hpux11.23
   658    639   	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
   659    640   	    # => hppa64-hp-hpux11.23
   660    641   
   661    642   	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
   662         -		grep -q __LP64__
          643  +		grep __LP64__ >/dev/null
   663    644   	    then
   664    645   		HP_ARCH="hppa2.0w"
   665    646   	    else
   666    647   		HP_ARCH="hppa64"
   667    648   	    fi
   668    649   	fi
   669    650   	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
................................................................................
   806    787       i*:windows32*:*)
   807    788       	# uname -m includes "-pc" on this system.
   808    789       	echo ${UNAME_MACHINE}-mingw32
   809    790   	exit ;;
   810    791       i*:PW*:*)
   811    792   	echo ${UNAME_MACHINE}-pc-pw32
   812    793   	exit ;;
   813         -    *:Interix*:*)
          794  +    *:Interix*:[3456]*)
   814    795       	case ${UNAME_MACHINE} in
   815    796   	    x86)
   816    797   		echo i586-pc-interix${UNAME_RELEASE}
   817    798   		exit ;;
   818         -	    authenticamd | genuineintel | EM64T)
          799  +	    EM64T | authenticamd)
   819    800   		echo x86_64-unknown-interix${UNAME_RELEASE}
   820    801   		exit ;;
   821         -	    IA64)
   822         -		echo ia64-unknown-interix${UNAME_RELEASE}
   823         -		exit ;;
   824    802   	esac ;;
   825    803       [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
   826    804   	echo i${UNAME_MACHINE}-pc-mks
   827    805   	exit ;;
   828         -    8664:Windows_NT:*)
   829         -	echo x86_64-pc-mks
   830         -	exit ;;
   831    806       i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   832    807   	# How do we know it's Interix rather than the generic POSIX subsystem?
   833    808   	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
   834    809   	# UNAME_MACHINE based on the output of uname instead of i386?
   835    810   	echo i586-pc-interix
   836    811   	exit ;;
   837    812       i*:UWIN*:*)
................................................................................
   853    828       *:GNU/*:*:*)
   854    829   	# other systems with GNU libc and userland
   855    830   	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
   856    831   	exit ;;
   857    832       i*86:Minix:*:*)
   858    833   	echo ${UNAME_MACHINE}-pc-minix
   859    834   	exit ;;
   860         -    alpha:Linux:*:*)
   861         -	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
   862         -	  EV5)   UNAME_MACHINE=alphaev5 ;;
   863         -	  EV56)  UNAME_MACHINE=alphaev56 ;;
   864         -	  PCA56) UNAME_MACHINE=alphapca56 ;;
   865         -	  PCA57) UNAME_MACHINE=alphapca56 ;;
   866         -	  EV6)   UNAME_MACHINE=alphaev6 ;;
   867         -	  EV67)  UNAME_MACHINE=alphaev67 ;;
   868         -	  EV68*) UNAME_MACHINE=alphaev68 ;;
   869         -        esac
   870         -	objdump --private-headers /bin/sh | grep -q ld.so.1
   871         -	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
   872         -	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
   873         -	exit ;;
   874    835       arm*:Linux:*:*)
   875         -	eval $set_cc_for_build
   876         -	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
   877         -	    | grep -q __ARM_EABI__
   878         -	then
   879         -	    echo ${UNAME_MACHINE}-unknown-linux-gnu
   880         -	else
   881         -	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
   882         -	fi
          836  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   883    837   	exit ;;
   884    838       avr32*:Linux:*:*)
   885    839   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   886    840   	exit ;;
   887    841       cris:Linux:*:*)
   888    842   	echo cris-axis-linux-gnu
   889    843   	exit ;;
   890    844       crisv32:Linux:*:*)
   891    845   	echo crisv32-axis-linux-gnu
   892    846   	exit ;;
   893    847       frv:Linux:*:*)
   894    848       	echo frv-unknown-linux-gnu
   895    849   	exit ;;
   896         -    i*86:Linux:*:*)
   897         -	LIBC=gnu
   898         -	eval $set_cc_for_build
   899         -	sed 's/^	//' << EOF >$dummy.c
   900         -	#ifdef __dietlibc__
   901         -	LIBC=dietlibc
   902         -	#endif
   903         -EOF
   904         -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
   905         -	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
   906         -	exit ;;
   907    850       ia64:Linux:*:*)
   908    851   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   909    852   	exit ;;
   910    853       m32r*:Linux:*:*)
   911    854   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   912    855   	exit ;;
   913    856       m68*:Linux:*:*)
   914    857   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   915    858   	exit ;;
   916         -    mips:Linux:*:* | mips64:Linux:*:*)
          859  +    mips:Linux:*:*)
          860  +	eval $set_cc_for_build
          861  +	sed 's/^	//' << EOF >$dummy.c
          862  +	#undef CPU
          863  +	#undef mips
          864  +	#undef mipsel
          865  +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
          866  +	CPU=mipsel
          867  +	#else
          868  +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
          869  +	CPU=mips
          870  +	#else
          871  +	CPU=
          872  +	#endif
          873  +	#endif
          874  +EOF
          875  +	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
          876  +	    /^CPU/{
          877  +		s: ::g
          878  +		p
          879  +	    }'`"
          880  +	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
          881  +	;;
          882  +    mips64:Linux:*:*)
   917    883   	eval $set_cc_for_build
   918    884   	sed 's/^	//' << EOF >$dummy.c
   919    885   	#undef CPU
   920         -	#undef ${UNAME_MACHINE}
   921         -	#undef ${UNAME_MACHINE}el
          886  +	#undef mips64
          887  +	#undef mips64el
   922    888   	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   923         -	CPU=${UNAME_MACHINE}el
          889  +	CPU=mips64el
   924    890   	#else
   925    891   	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   926         -	CPU=${UNAME_MACHINE}
          892  +	CPU=mips64
   927    893   	#else
   928    894   	CPU=
   929    895   	#endif
   930    896   	#endif
   931    897   EOF
   932         -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
          898  +	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
          899  +	    /^CPU/{
          900  +		s: ::g
          901  +		p
          902  +	    }'`"
   933    903   	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   934    904   	;;
   935    905       or32:Linux:*:*)
   936    906   	echo or32-unknown-linux-gnu
   937    907   	exit ;;
   938         -    padre:Linux:*:*)
   939         -	echo sparc-unknown-linux-gnu
          908  +    ppc:Linux:*:*)
          909  +	echo powerpc-unknown-linux-gnu
   940    910   	exit ;;
   941         -    parisc64:Linux:*:* | hppa64:Linux:*:*)
   942         -	echo hppa64-unknown-linux-gnu
          911  +    ppc64:Linux:*:*)
          912  +	echo powerpc64-unknown-linux-gnu
          913  +	exit ;;
          914  +    alpha:Linux:*:*)
          915  +	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          916  +	  EV5)   UNAME_MACHINE=alphaev5 ;;
          917  +	  EV56)  UNAME_MACHINE=alphaev56 ;;
          918  +	  PCA56) UNAME_MACHINE=alphapca56 ;;
          919  +	  PCA57) UNAME_MACHINE=alphapca56 ;;
          920  +	  EV6)   UNAME_MACHINE=alphaev6 ;;
          921  +	  EV67)  UNAME_MACHINE=alphaev67 ;;
          922  +	  EV68*) UNAME_MACHINE=alphaev68 ;;
          923  +        esac
          924  +	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
          925  +	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
          926  +	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
   943    927   	exit ;;
   944    928       parisc:Linux:*:* | hppa:Linux:*:*)
   945    929   	# Look for CPU level
   946    930   	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   947    931   	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
   948    932   	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
   949    933   	  *)    echo hppa-unknown-linux-gnu ;;
   950    934   	esac
   951    935   	exit ;;
   952         -    ppc64:Linux:*:*)
   953         -	echo powerpc64-unknown-linux-gnu
   954         -	exit ;;
   955         -    ppc:Linux:*:*)
   956         -	echo powerpc-unknown-linux-gnu
          936  +    parisc64:Linux:*:* | hppa64:Linux:*:*)
          937  +	echo hppa64-unknown-linux-gnu
   957    938   	exit ;;
   958    939       s390:Linux:*:* | s390x:Linux:*:*)
   959    940   	echo ${UNAME_MACHINE}-ibm-linux
   960    941   	exit ;;
   961    942       sh64*:Linux:*:*)
   962    943       	echo ${UNAME_MACHINE}-unknown-linux-gnu
   963    944   	exit ;;
................................................................................
   969    950   	exit ;;
   970    951       vax:Linux:*:*)
   971    952   	echo ${UNAME_MACHINE}-dec-linux-gnu
   972    953   	exit ;;
   973    954       x86_64:Linux:*:*)
   974    955   	echo x86_64-unknown-linux-gnu
   975    956   	exit ;;
   976         -    xtensa*:Linux:*:*)
   977         -    	echo ${UNAME_MACHINE}-unknown-linux-gnu
          957  +    xtensa:Linux:*:*)
          958  +    	echo xtensa-unknown-linux-gnu
   978    959   	exit ;;
          960  +    i*86:Linux:*:*)
          961  +	# The BFD linker knows what the default object file format is, so
          962  +	# first see if it will tell us. cd to the root directory to prevent
          963  +	# problems with other programs or directories called `ld' in the path.
          964  +	# Set LC_ALL=C to ensure ld outputs messages in English.
          965  +	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
          966  +			 | sed -ne '/supported targets:/!d
          967  +				    s/[ 	][ 	]*/ /g
          968  +				    s/.*supported targets: *//
          969  +				    s/ .*//
          970  +				    p'`
          971  +        case "$ld_supported_targets" in
          972  +	  elf32-i386)
          973  +		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
          974  +		;;
          975  +	  a.out-i386-linux)
          976  +		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
          977  +		exit ;;
          978  +	  coff-i386)
          979  +		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
          980  +		exit ;;
          981  +	  "")
          982  +		# Either a pre-BFD a.out linker (linux-gnuoldld) or
          983  +		# one that does not give us useful --help.
          984  +		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
          985  +		exit ;;
          986  +	esac
          987  +	# Determine whether the default compiler is a.out or elf
          988  +	eval $set_cc_for_build
          989  +	sed 's/^	//' << EOF >$dummy.c
          990  +	#include <features.h>
          991  +	#ifdef __ELF__
          992  +	# ifdef __GLIBC__
          993  +	#  if __GLIBC__ >= 2
          994  +	LIBC=gnu
          995  +	#  else
          996  +	LIBC=gnulibc1
          997  +	#  endif
          998  +	# else
          999  +	LIBC=gnulibc1
         1000  +	# endif
         1001  +	#else
         1002  +	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
         1003  +	LIBC=gnu
         1004  +	#else
         1005  +	LIBC=gnuaout
         1006  +	#endif
         1007  +	#endif
         1008  +	#ifdef __dietlibc__
         1009  +	LIBC=dietlibc
         1010  +	#endif
         1011  +EOF
         1012  +	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
         1013  +	    /^LIBC/{
         1014  +		s: ::g
         1015  +		p
         1016  +	    }'`"
         1017  +	test x"${LIBC}" != x && {
         1018  +		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
         1019  +		exit
         1020  +	}
         1021  +	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
         1022  +	;;
   979   1023       i*86:DYNIX/ptx:4*:*)
   980   1024   	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
   981   1025   	# earlier versions are messed up and put the nodename in both
   982   1026   	# sysname and nodename.
   983   1027   	echo i386-sequent-sysv4
   984   1028   	exit ;;
   985   1029       i*86:UNIX_SV:4.2MP:2.*)
................................................................................
  1000   1044   	exit ;;
  1001   1045       i*86:atheos:*:*)
  1002   1046   	echo ${UNAME_MACHINE}-unknown-atheos
  1003   1047   	exit ;;
  1004   1048       i*86:syllable:*:*)
  1005   1049   	echo ${UNAME_MACHINE}-pc-syllable
  1006   1050   	exit ;;
  1007         -    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
         1051  +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
  1008   1052   	echo i386-unknown-lynxos${UNAME_RELEASE}
  1009   1053   	exit ;;
  1010   1054       i*86:*DOS:*:*)
  1011   1055   	echo ${UNAME_MACHINE}-pc-msdosdjgpp
  1012   1056   	exit ;;
  1013   1057       i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
  1014   1058   	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
................................................................................
  1044   1088   	else
  1045   1089   		echo ${UNAME_MACHINE}-pc-sysv32
  1046   1090   	fi
  1047   1091   	exit ;;
  1048   1092       pc:*:*:*)
  1049   1093   	# Left here for compatibility:
  1050   1094           # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1051         -        # the processor, so we play safe by assuming i586.
  1052         -	# Note: whatever this is, it MUST be the same as what config.sub
  1053         -	# prints for the "djgpp" host, or else GDB configury will decide that
  1054         -	# this is a cross-build.
  1055         -	echo i586-pc-msdosdjgpp
         1095  +        # the processor, so we play safe by assuming i386.
         1096  +	echo i386-pc-msdosdjgpp
  1056   1097           exit ;;
  1057   1098       Intel:Mach:3*:*)
  1058   1099   	echo i386-pc-mach3
  1059   1100   	exit ;;
  1060   1101       paragon:*:*:*)
  1061   1102   	echo i860-intel-osf1
  1062   1103   	exit ;;
................................................................................
  1086   1127   	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1087   1128   	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
  1088   1129   	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1089   1130   	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
  1090   1131       3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1091   1132           /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1092   1133             && { echo i486-ncr-sysv4; exit; } ;;
  1093         -    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  1094         -	OS_REL='.3'
  1095         -	test -r /etc/.relid \
  1096         -	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1097         -	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1098         -	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
  1099         -	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1100         -	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
  1101         -	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
  1102         -	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
  1103   1134       m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1104   1135   	echo m68k-unknown-lynxos${UNAME_RELEASE}
  1105   1136   	exit ;;
  1106   1137       mc68030:UNIX_System_V:4.*:*)
  1107   1138   	echo m68k-atari-sysv4
  1108   1139   	exit ;;
  1109   1140       TSUNAMI:LynxOS:2.*:*)
  1110   1141   	echo sparc-unknown-lynxos${UNAME_RELEASE}
  1111   1142   	exit ;;
  1112   1143       rs6000:LynxOS:2.*:*)
  1113   1144   	echo rs6000-unknown-lynxos${UNAME_RELEASE}
  1114   1145   	exit ;;
  1115         -    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
         1146  +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
  1116   1147   	echo powerpc-unknown-lynxos${UNAME_RELEASE}
  1117   1148   	exit ;;
  1118   1149       SM[BE]S:UNIX_SV:*:*)
  1119   1150   	echo mips-dde-sysv${UNAME_RELEASE}
  1120   1151   	exit ;;
  1121   1152       RM*:ReliantUNIX-*:*:*)
  1122   1153   	echo mips-sni-sysv4
................................................................................
  1171   1202   	exit ;;
  1172   1203       BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
  1173   1204   	echo powerpc-apple-beos
  1174   1205   	exit ;;
  1175   1206       BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
  1176   1207   	echo i586-pc-beos
  1177   1208   	exit ;;
  1178         -    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
  1179         -	echo i586-pc-haiku
  1180         -	exit ;;
  1181   1209       SX-4:SUPER-UX:*:*)
  1182   1210   	echo sx4-nec-superux${UNAME_RELEASE}
  1183   1211   	exit ;;
  1184   1212       SX-5:SUPER-UX:*:*)
  1185   1213   	echo sx5-nec-superux${UNAME_RELEASE}
  1186   1214   	exit ;;
  1187   1215       SX-6:SUPER-UX:*:*)
................................................................................
  1201   1229   	exit ;;
  1202   1230       *:Rhapsody:*:*)
  1203   1231   	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1204   1232   	exit ;;
  1205   1233       *:Darwin:*:*)
  1206   1234   	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
  1207   1235   	case $UNAME_PROCESSOR in
  1208         -	    i386)
  1209         -		eval $set_cc_for_build
  1210         -		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
  1211         -		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  1212         -		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
  1213         -		      grep IS_64BIT_ARCH >/dev/null
  1214         -		  then
  1215         -		      UNAME_PROCESSOR="x86_64"
  1216         -		  fi
  1217         -		fi ;;
  1218   1236   	    unknown) UNAME_PROCESSOR=powerpc ;;
  1219   1237   	esac
  1220   1238   	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
  1221   1239   	exit ;;
  1222   1240       *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1223   1241   	UNAME_PROCESSOR=`uname -p`
  1224   1242   	if test "$UNAME_PROCESSOR" = "x86"; then
................................................................................
  1292   1310   	exit ;;
  1293   1311       i*86:skyos:*:*)
  1294   1312   	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
  1295   1313   	exit ;;
  1296   1314       i*86:rdos:*:*)
  1297   1315   	echo ${UNAME_MACHINE}-pc-rdos
  1298   1316   	exit ;;
  1299         -    i*86:AROS:*:*)
  1300         -	echo ${UNAME_MACHINE}-pc-aros
  1301         -	exit ;;
  1302   1317   esac
  1303   1318   
  1304   1319   #echo '(No uname command or uname output not recognized.)' 1>&2
  1305   1320   #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  1306   1321   
  1307   1322   eval $set_cc_for_build
  1308   1323   cat >$dummy.c <<EOF
................................................................................
  1455   1470   cat >&2 <<EOF
  1456   1471   $0: unable to guess system type
  1457   1472   
  1458   1473   This script, last modified $timestamp, has failed to recognize
  1459   1474   the operating system you are using. It is advised that you
  1460   1475   download the most up to date version of the config scripts from
  1461   1476   
  1462         -  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
         1477  +  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
  1463   1478   and
  1464         -  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
         1479  +  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
  1465   1480   
  1466   1481   If the version you run ($0) is already up to date, please
  1467   1482   send the following data and any information you think might be
  1468   1483   pertinent to <config-patches@gnu.org> in order to provide the needed
  1469   1484   information to handle your system.
  1470   1485   
  1471   1486   config.guess timestamp = $timestamp

Deleted config.h.

     1         -/* config.h.  Generated from config.h.in by configure.  */
     2         -/* config.h.in.  Generated from configure.ac by autoheader.  */
     3         -
     4         -/* Define to 1 if you have the <dlfcn.h> header file. */
     5         -#define HAVE_DLFCN_H 1
     6         -
     7         -/* Define to 1 if you have the <fcntl.h> header file. */
     8         -#define HAVE_FCNTL_H 1
     9         -
    10         -/* Define to 1 if you have the `fdatasync' function. */
    11         -#define HAVE_FDATASYNC 1
    12         -
    13         -/* Define to 1 if you have the <float.h> header file. */
    14         -#define HAVE_FLOAT_H 1
    15         -
    16         -/* Define to 1 if you have the `ftruncate' function. */
    17         -#define HAVE_FTRUNCATE 1
    18         -
    19         -/* Define to 1 if you have the <geotiff/geotiff.h> header file. */
    20         -/* #undef HAVE_GEOTIFF_GEOTIFF_H */
    21         -
    22         -/* Define to 1 if you have the <geotiff.h> header file. */
    23         -/* #undef HAVE_GEOTIFF_H */
    24         -
    25         -/* Define to 1 if you have the `getcwd' function. */
    26         -#define HAVE_GETCWD 1
    27         -
    28         -/* Define to 1 if you have the `gettimeofday' function. */
    29         -#define HAVE_GETTIMEOFDAY 1
    30         -
    31         -/* Define to 1 if you have the <inttypes.h> header file. */
    32         -#define HAVE_INTTYPES_H 1
    33         -
    34         -/* Define to 1 if you have the <jerror.h> header file. */
    35         -#define HAVE_JERROR_H 1
    36         -
    37         -/* Define to 1 if you have the <jpeglib.h> header file. */
    38         -#define HAVE_JPEGLIB_H 1
    39         -
    40         -/* Define to 1 if you have the `geotiff' library (-lgeotiff). */
    41         -#define HAVE_LIBGEOTIFF 1
    42         -
    43         -/* Define to 1 if you have the <libgeotiff/geotiff.h> header file. */
    44         -#define HAVE_LIBGEOTIFF_GEOTIFF_H 1
    45         -
    46         -/* Define to 1 if you have the `jpeg' library (-ljpeg). */
    47         -#define HAVE_LIBJPEG 1
    48         -
    49         -/* Define to 1 if you have the `proj' library (-lproj). */
    50         -#define HAVE_LIBPROJ 1
    51         -
    52         -/* Define to 1 if you have the `tiff' library (-ltiff). */
    53         -#define HAVE_LIBTIFF 1
    54         -
    55         -/* Define to 1 if you have the `z' library (-lz). */
    56         -#define HAVE_LIBZ 1
    57         -
    58         -/* Define to 1 if you have the `localtime_r' function. */
    59         -#define HAVE_LOCALTIME_R 1
    60         -
    61         -/* Define to 1 if `lstat' has the bug that it succeeds when given the
    62         -   zero-length file name argument. */
    63         -/* #undef HAVE_LSTAT_EMPTY_STRING_BUG */
    64         -
    65         -/* Define to 1 if you have the <math.h> header file. */
    66         -#define HAVE_MATH_H 1
    67         -
    68         -/* Define to 1 if you have the `memmove' function. */
    69         -#define HAVE_MEMMOVE 1
    70         -
    71         -/* Define to 1 if you have the <memory.h> header file. */
    72         -#define HAVE_MEMORY_H 1
    73         -
    74         -/* Define to 1 if you have the `memset' function. */
    75         -#define HAVE_MEMSET 1
    76         -
    77         -/* Define to 1 if you have the `sqrt' function. */
    78         -/* #undef HAVE_SQRT */
    79         -
    80         -/* Define to 1 if `stat' has the bug that it succeeds when given the
    81         -   zero-length file name argument. */
    82         -/* #undef HAVE_STAT_EMPTY_STRING_BUG */
    83         -
    84         -/* Define to 1 if you have the <stddef.h> header file. */
    85         -#define HAVE_STDDEF_H 1
    86         -
    87         -/* Define to 1 if you have the <stdint.h> header file. */
    88         -#define HAVE_STDINT_H 1
    89         -
    90         -/* Define to 1 if you have the <stdio.h> header file. */
    91         -#define HAVE_STDIO_H 1
    92         -
    93         -/* Define to 1 if you have the <stdlib.h> header file. */
    94         -#define HAVE_STDLIB_H 1
    95         -
    96         -/* Define to 1 if you have the `strcasecmp' function. */
    97         -#define HAVE_STRCASECMP 1
    98         -
    99         -/* Define to 1 if you have the `strerror' function. */
   100         -#define HAVE_STRERROR 1
   101         -
   102         -/* Define to 1 if you have the `strftime' function. */
   103         -#define HAVE_STRFTIME 1
   104         -
   105         -/* Define to 1 if you have the <strings.h> header file. */
   106         -#define HAVE_STRINGS_H 1
   107         -
   108         -/* Define to 1 if you have the <string.h> header file. */
   109         -#define HAVE_STRING_H 1
   110         -
   111         -/* Define to 1 if you have the `strncasecmp' function. */
   112         -#define HAVE_STRNCASECMP 1
   113         -
   114         -/* Define to 1 if you have the `strstr' function. */
   115         -#define HAVE_STRSTR 1
   116         -
   117         -/* Define to 1 if you have the <sys/stat.h> header file. */
   118         -#define HAVE_SYS_STAT_H 1
   119         -
   120         -/* Define to 1 if you have the <sys/time.h> header file. */
   121         -#define HAVE_SYS_TIME_H 1
   122         -
   123         -/* Define to 1 if you have the <sys/types.h> header file. */
   124         -#define HAVE_SYS_TYPES_H 1
   125         -
   126         -/* Define to 1 if you have the <unistd.h> header file. */
   127         -#define HAVE_UNISTD_H 1
   128         -
   129         -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
   130         -   slash. */
   131         -#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
   132         -
   133         -/* Define to the sub-directory in which libtool stores uninstalled libraries.
   134         -   */
   135         -#define LT_OBJDIR ".libs/"
   136         -
   137         -/* Name of package */
   138         -#define PACKAGE "librasterlite"
   139         -
   140         -/* Define to the address where bug reports for this package should be sent. */
   141         -#define PACKAGE_BUGREPORT "a.furieri @ lqt.it"
   142         -
   143         -/* Define to the full name of this package. */
   144         -#define PACKAGE_NAME "librasterlite"
   145         -
   146         -/* Define to the full name and version of this package. */
   147         -#define PACKAGE_STRING "librasterlite 1.1f"
   148         -
   149         -/* Define to the one symbol short name of this package. */
   150         -#define PACKAGE_TARNAME "librasterlite"
   151         -
   152         -/* Define to the home page for this package. */
   153         -#define PACKAGE_URL ""
   154         -
   155         -/* Define to the version of this package. */
   156         -#define PACKAGE_VERSION "1.1f"
   157         -
   158         -/* Define to 1 if you have the ANSI C header files. */
   159         -#define STDC_HEADERS 1
   160         -
   161         -/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
   162         -#define TIME_WITH_SYS_TIME 1
   163         -
   164         -/* Define to 1 if your <sys/time.h> declares `struct tm'. */
   165         -/* #undef TM_IN_SYS_TIME */
   166         -
   167         -/* Version number of package */
   168         -#define VERSION "1.1f"
   169         -
   170         -/* Define to empty if `const' does not conform to ANSI C. */
   171         -/* #undef const */
   172         -
   173         -/* Define to `long int' if <sys/types.h> does not define. */
   174         -/* #undef off_t */
   175         -
   176         -/* Define to `unsigned int' if <sys/types.h> does not define. */
   177         -/* #undef size_t */
   178         -
   179         -/* Define to empty if the keyword `volatile' does not work. Warning: valid
   180         -   code using `volatile' can become incorrect without. Disable with care. */
   181         -/* #undef volatile */

Deleted config.h.in.

     1         -/* config.h.in.  Generated from configure.ac by autoheader.  */
     2         -
     3         -/* Define to 1 if you have the <dlfcn.h> header file. */
     4         -#undef HAVE_DLFCN_H
     5         -
     6         -/* Define to 1 if you have the <fcntl.h> header file. */
     7         -#undef HAVE_FCNTL_H
     8         -
     9         -/* Define to 1 if you have the `fdatasync' function. */
    10         -#undef HAVE_FDATASYNC
    11         -
    12         -/* Define to 1 if you have the <float.h> header file. */
    13         -#undef HAVE_FLOAT_H
    14         -
    15         -/* Define to 1 if you have the `ftruncate' function. */
    16         -#undef HAVE_FTRUNCATE
    17         -
    18         -/* Define to 1 if you have the <geotiff/geotiff.h> header file. */
    19         -#undef HAVE_GEOTIFF_GEOTIFF_H
    20         -
    21         -/* Define to 1 if you have the <geotiff.h> header file. */
    22         -#undef HAVE_GEOTIFF_H
    23         -
    24         -/* Define to 1 if you have the `getcwd' function. */
    25         -#undef HAVE_GETCWD
    26         -
    27         -/* Define to 1 if you have the `gettimeofday' function. */
    28         -#undef HAVE_GETTIMEOFDAY
    29         -
    30         -/* Define to 1 if you have the <inttypes.h> header file. */
    31         -#undef HAVE_INTTYPES_H
    32         -
    33         -/* Define to 1 if you have the <jerror.h> header file. */
    34         -#undef HAVE_JERROR_H
    35         -
    36         -/* Define to 1 if you have the <jpeglib.h> header file. */
    37         -#undef HAVE_JPEGLIB_H
    38         -
    39         -/* Define to 1 if you have the `geotiff' library (-lgeotiff). */
    40         -#undef HAVE_LIBGEOTIFF
    41         -
    42         -/* Define to 1 if you have the <libgeotiff/geotiff.h> header file. */
    43         -#undef HAVE_LIBGEOTIFF_GEOTIFF_H
    44         -
    45         -/* Define to 1 if you have the `jpeg' library (-ljpeg). */
    46         -#undef HAVE_LIBJPEG
    47         -
    48         -/* Define to 1 if you have the `proj' library (-lproj). */
    49         -#undef HAVE_LIBPROJ
    50         -
    51         -/* Define to 1 if you have the `tiff' library (-ltiff). */
    52         -#undef HAVE_LIBTIFF
    53         -
    54         -/* Define to 1 if you have the `z' library (-lz). */
    55         -#undef HAVE_LIBZ
    56         -
    57         -/* Define to 1 if you have the `localtime_r' function. */
    58         -#undef HAVE_LOCALTIME_R
    59         -
    60         -/* Define to 1 if `lstat' has the bug that it succeeds when given the
    61         -   zero-length file name argument. */
    62         -#undef HAVE_LSTAT_EMPTY_STRING_BUG
    63         -
    64         -/* Define to 1 if you have the <math.h> header file. */
    65         -#undef HAVE_MATH_H
    66         -
    67         -/* Define to 1 if you have the `memmove' function. */
    68         -#undef HAVE_MEMMOVE
    69         -
    70         -/* Define to 1 if you have the <memory.h> header file. */
    71         -#undef HAVE_MEMORY_H
    72         -
    73         -/* Define to 1 if you have the `memset' function. */
    74         -#undef HAVE_MEMSET
    75         -
    76         -/* Define to 1 if you have the `sqrt' function. */
    77         -#undef HAVE_SQRT
    78         -
    79         -/* Define to 1 if `stat' has the bug that it succeeds when given the
    80         -   zero-length file name argument. */
    81         -#undef HAVE_STAT_EMPTY_STRING_BUG
    82         -
    83         -/* Define to 1 if you have the <stddef.h> header file. */
    84         -#undef HAVE_STDDEF_H
    85         -
    86         -/* Define to 1 if you have the <stdint.h> header file. */
    87         -#undef HAVE_STDINT_H
    88         -
    89         -/* Define to 1 if you have the <stdio.h> header file. */
    90         -#undef HAVE_STDIO_H
    91         -
    92         -/* Define to 1 if you have the <stdlib.h> header file. */
    93         -#undef HAVE_STDLIB_H
    94         -
    95         -/* Define to 1 if you have the `strcasecmp' function. */
    96         -#undef HAVE_STRCASECMP
    97         -
    98         -/* Define to 1 if you have the `strerror' function. */
    99         -#undef HAVE_STRERROR
   100         -
   101         -/* Define to 1 if you have the `strftime' function. */
   102         -#undef HAVE_STRFTIME
   103         -
   104         -/* Define to 1 if you have the <strings.h> header file. */
   105         -#undef HAVE_STRINGS_H
   106         -
   107         -/* Define to 1 if you have the <string.h> header file. */
   108         -#undef HAVE_STRING_H
   109         -
   110         -/* Define to 1 if you have the `strncasecmp' function. */
   111         -#undef HAVE_STRNCASECMP
   112         -
   113         -/* Define to 1 if you have the `strstr' function. */
   114         -#undef HAVE_STRSTR
   115         -
   116         -/* Define to 1 if you have the <sys/stat.h> header file. */
   117         -#undef HAVE_SYS_STAT_H
   118         -
   119         -/* Define to 1 if you have the <sys/time.h> header file. */
   120         -#undef HAVE_SYS_TIME_H
   121         -
   122         -/* Define to 1 if you have the <sys/types.h> header file. */
   123         -#undef HAVE_SYS_TYPES_H
   124         -
   125         -/* Define to 1 if you have the <unistd.h> header file. */
   126         -#undef HAVE_UNISTD_H
   127         -
   128         -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
   129         -   slash. */
   130         -#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
   131         -
   132         -/* Define to the sub-directory in which libtool stores uninstalled libraries.
   133         -   */
   134         -#undef LT_OBJDIR
   135         -
   136         -/* Name of package */
   137         -#undef PACKAGE
   138         -
   139         -/* Define to the address where bug reports for this package should be sent. */
   140         -#undef PACKAGE_BUGREPORT
   141         -
   142         -/* Define to the full name of this package. */
   143         -#undef PACKAGE_NAME
   144         -
   145         -/* Define to the full name and version of this package. */
   146         -#undef PACKAGE_STRING
   147         -
   148         -/* Define to the one symbol short name of this package. */
   149         -#undef PACKAGE_TARNAME
   150         -
   151         -/* Define to the home page for this package. */
   152         -#undef PACKAGE_URL
   153         -
   154         -/* Define to the version of this package. */
   155         -#undef PACKAGE_VERSION
   156         -
   157         -/* Define to 1 if you have the ANSI C header files. */
   158         -#undef STDC_HEADERS
   159         -
   160         -/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
   161         -#undef TIME_WITH_SYS_TIME
   162         -
   163         -/* Define to 1 if your <sys/time.h> declares `struct tm'. */
   164         -#undef TM_IN_SYS_TIME
   165         -
   166         -/* Version number of package */
   167         -#undef VERSION
   168         -
   169         -/* Define to empty if `const' does not conform to ANSI C. */
   170         -#undef const
   171         -
   172         -/* Define to `long int' if <sys/types.h> does not define. */
   173         -#undef off_t
   174         -
   175         -/* Define to `unsigned int' if <sys/types.h> does not define. */
   176         -#undef size_t
   177         -
   178         -/* Define to empty if the keyword `volatile' does not work. Warning: valid
   179         -   code using `volatile' can become incorrect without. Disable with care. */
   180         -#undef volatile

Changes to config.sub.

     1      1   #! /bin/sh
     2      2   # Configuration validation subroutine script.
     3      3   #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     4         -#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
     5         -#   Free Software Foundation, Inc.
            4  +#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
            5  +#   Inc.
     6      6   
     7         -timestamp='2009-11-20'
            7  +timestamp='2007-06-28'
     8      8   
     9      9   # This file is (in principle) common to ALL GNU software.
    10     10   # The presence of a machine in this file suggests that SOME GNU software
    11     11   # can handle that machine.  It does not imply ALL GNU software can.
    12     12   #
    13     13   # This file is free software; you can redistribute it and/or modify
    14     14   # it under the terms of the GNU General Public License as published by
................................................................................
    28     28   # As a special exception to the GNU General Public License, if you
    29     29   # distribute this file as part of a program that contains a
    30     30   # configuration script generated by Autoconf, you may include it under
    31     31   # the same distribution terms that you use for the rest of that program.
    32     32   
    33     33   
    34     34   # Please send patches to <config-patches@gnu.org>.  Submit a context
    35         -# diff and a properly formatted GNU ChangeLog entry.
           35  +# diff and a properly formatted ChangeLog entry.
    36     36   #
    37     37   # Configuration subroutine to validate and canonicalize a configuration type.
    38     38   # Supply the specified configuration type as an argument.
    39     39   # If it is invalid, we print an error message on stderr and exit with code 1.
    40     40   # Otherwise, we print the canonical config type on stdout and succeed.
    41     41   
    42         -# You can get the latest version of this script from:
    43         -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    44         -
    45     42   # This file is supposed to be the same for all GNU packages
    46     43   # and recognize all the CPU types, system types and aliases
    47     44   # that are meaningful with *any* GNU software.
    48     45   # Each package is responsible for reporting which valid configurations
    49     46   # it does not support.  The user should be able to distinguish
    50     47   # a failure to support a valid configuration from a meaningless
    51     48   # configuration.
................................................................................
    71     68     -v, --version      print version number, then exit
    72     69   
    73     70   Report bugs and patches to <config-patches@gnu.org>."
    74     71   
    75     72   version="\
    76     73   GNU config.sub ($timestamp)
    77     74   
    78         -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
    79         -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
           75  +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
           76  +Free Software Foundation, Inc.
    80     77   
    81     78   This is free software; see the source for copying conditions.  There is NO
    82     79   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    83     80   
    84     81   help="
    85     82   Try \`$me --help' for more information."
    86     83   
................................................................................
   121    118   
   122    119   # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
   123    120   # Here we must recognize all the valid KERNEL-OS combinations.
   124    121   maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
   125    122   case $maybe_os in
   126    123     nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
   127    124     uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
   128         -  kopensolaris*-gnu* | \
   129    125     storm-chaos* | os2-emx* | rtmk-nova*)
   130    126       os=-$maybe_os
   131    127       basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
   132    128       ;;
   133    129     *)
   134    130       basic_machine=`echo $1 | sed 's/-[^-]*$//'`
   135    131       if [ $basic_machine != $1 ]
................................................................................
   148    144   		;;
   149    145   	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
   150    146   	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
   151    147   	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
   152    148   	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
   153    149   	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
   154    150   	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
   155         -	-apple | -axis | -knuth | -cray | -microblaze)
          151  +	-apple | -axis | -knuth | -cray)
   156    152   		os=
   157    153   		basic_machine=$1
   158    154   		;;
   159         -        -bluegene*)
   160         -	        os=-cnk
   161         -		;;
   162    155   	-sim | -cisco | -oki | -wec | -winbond)
   163    156   		os=
   164    157   		basic_machine=$1
   165    158   		;;
   166    159   	-scout)
   167    160   		;;
   168    161   	-wrs)
................................................................................
   252    245   	| bfin \
   253    246   	| c4x | clipper \
   254    247   	| d10v | d30v | dlx | dsp16xx \
   255    248   	| fido | fr30 | frv \
   256    249   	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
   257    250   	| i370 | i860 | i960 | ia64 \
   258    251   	| ip2k | iq2000 \
   259         -	| lm32 \
   260    252   	| m32c | m32r | m32rle | m68000 | m68k | m88k \
   261         -	| maxq | mb | microblaze | mcore | mep | metag \
          253  +	| maxq | mb | microblaze | mcore | mep \
   262    254   	| mips | mipsbe | mipseb | mipsel | mipsle \
   263    255   	| mips16 \
   264    256   	| mips64 | mips64el \
   265         -	| mips64octeon | mips64octeonel \
   266         -	| mips64orion | mips64orionel \
   267         -	| mips64r5900 | mips64r5900el \
   268    257   	| mips64vr | mips64vrel \
          258  +	| mips64orion | mips64orionel \
   269    259   	| mips64vr4100 | mips64vr4100el \
   270    260   	| mips64vr4300 | mips64vr4300el \
   271    261   	| mips64vr5000 | mips64vr5000el \
   272    262   	| mips64vr5900 | mips64vr5900el \
   273    263   	| mipsisa32 | mipsisa32el \
   274    264   	| mipsisa32r2 | mipsisa32r2el \
   275    265   	| mipsisa64 | mipsisa64el \
   276    266   	| mipsisa64r2 | mipsisa64r2el \
   277    267   	| mipsisa64sb1 | mipsisa64sb1el \
   278    268   	| mipsisa64sr71k | mipsisa64sr71kel \
   279    269   	| mipstx39 | mipstx39el \
   280    270   	| mn10200 | mn10300 \
   281         -	| moxie \
   282    271   	| mt \
   283    272   	| msp430 \
   284    273   	| nios | nios2 \
   285    274   	| ns16k | ns32k \
   286    275   	| or32 \
   287    276   	| pdp10 | pdp11 | pj | pjl \
   288    277   	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
   289    278   	| pyramid \
   290         -	| rx \
   291    279   	| score \
   292         -	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
          280  +	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
   293    281   	| sh64 | sh64le \
   294    282   	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
   295    283   	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
   296    284   	| spu | strongarm \
   297    285   	| tahoe | thumb | tic4x | tic80 | tron \
   298         -	| ubicom32 \
   299    286   	| v850 | v850e \
   300    287   	| we32k \
   301    288   	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
   302         -	| z8k | z80)
          289  +	| z8k)
   303    290   		basic_machine=$basic_machine-unknown
   304    291   		;;
   305         -	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
          292  +	m6811 | m68hc11 | m6812 | m68hc12)
   306    293   		# Motorola 68HC11/12.
   307    294   		basic_machine=$basic_machine-unknown
   308    295   		os=-none
   309    296   		;;
   310    297   	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
   311    298   		;;
   312    299   	ms1)
................................................................................
   338    325   	| d10v-* | d30v-* | dlx-* \
   339    326   	| elxsi-* \
   340    327   	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
   341    328   	| h8300-* | h8500-* \
   342    329   	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
   343    330   	| i*86-* | i860-* | i960-* | ia64-* \
   344    331   	| ip2k-* | iq2000-* \
   345         -	| lm32-* \
   346    332   	| m32c-* | m32r-* | m32rle-* \
   347    333   	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
   348         -	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
          334  +	| m88110-* | m88k-* | maxq-* | mcore-* \
   349    335   	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
   350    336   	| mips16-* \
   351    337   	| mips64-* | mips64el-* \
   352         -	| mips64octeon-* | mips64octeonel-* \
   353         -	| mips64orion-* | mips64orionel-* \
   354         -	| mips64r5900-* | mips64r5900el-* \
   355    338   	| mips64vr-* | mips64vrel-* \
          339  +	| mips64orion-* | mips64orionel-* \
   356    340   	| mips64vr4100-* | mips64vr4100el-* \
   357    341   	| mips64vr4300-* | mips64vr4300el-* \
   358    342   	| mips64vr5000-* | mips64vr5000el-* \
   359    343   	| mips64vr5900-* | mips64vr5900el-* \
   360    344   	| mipsisa32-* | mipsisa32el-* \
   361    345   	| mipsisa32r2-* | mipsisa32r2el-* \
   362    346   	| mipsisa64-* | mipsisa64el-* \
................................................................................
   369    353   	| msp430-* \
   370    354   	| nios-* | nios2-* \
   371    355   	| none-* | np1-* | ns16k-* | ns32k-* \
   372    356   	| orion-* \
   373    357   	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
   374    358   	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
   375    359   	| pyramid-* \
   376         -	| romp-* | rs6000-* | rx-* \
   377         -	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
          360  +	| romp-* | rs6000-* \
          361  +	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
   378    362   	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
   379    363   	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
   380    364   	| sparclite-* \
   381    365   	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
   382    366   	| tahoe-* | thumb-* \
   383         -	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
          367  +	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
   384    368   	| tron-* \
   385         -	| ubicom32-* \
   386    369   	| v850-* | v850e-* | vax-* \
   387    370   	| we32k-* \
   388    371   	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
   389         -	| xstormy16-* | xtensa*-* \
          372  +	| xstormy16-* | xtensa-* \
   390    373   	| ymp-* \
   391         -	| z8k-* | z80-*)
   392         -		;;
   393         -	# Recognize the basic CPU types without company name, with glob match.
   394         -	xtensa*)
   395         -		basic_machine=$basic_machine-unknown
          374  +	| z8k-*)
   396    375   		;;
   397    376   	# Recognize the various machine names and aliases which stand
   398    377   	# for a CPU type and a company and sometimes even an OS.
   399    378   	386bsd)
   400    379   		basic_machine=i386-unknown
   401    380   		os=-bsd
   402    381   		;;
................................................................................
   452    431   		basic_machine=m68k-apollo
   453    432   		os=-sysv
   454    433   		;;
   455    434   	apollo68bsd)
   456    435   		basic_machine=m68k-apollo
   457    436   		os=-bsd
   458    437   		;;
   459         -	aros)
   460         -		basic_machine=i386-pc
   461         -		os=-aros
   462         -		;;
   463    438   	aux)
   464    439   		basic_machine=m68k-apple
   465    440   		os=-aux
   466    441   		;;
   467    442   	balance)
   468    443   		basic_machine=ns32k-sequent
   469    444   		os=-dynix
   470    445   		;;
   471         -	blackfin)
   472         -		basic_machine=bfin-unknown
   473         -		os=-linux
   474         -		;;
   475         -	blackfin-*)
   476         -		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
   477         -		os=-linux
   478         -		;;
   479         -	bluegene*)
   480         -		basic_machine=powerpc-ibm
   481         -		os=-cnk
   482         -		;;
   483    446   	c90)
   484    447   		basic_machine=c90-cray
   485    448   		os=-unicos
   486    449   		;;
   487         -        cegcc)
   488         -		basic_machine=arm-unknown
   489         -		os=-cegcc
   490         -		;;
   491    450   	convex-c1)
   492    451   		basic_machine=c1-convex
   493    452   		os=-bsd
   494    453   		;;
   495    454   	convex-c2)
   496    455   		basic_machine=c2-convex
   497    456   		os=-bsd
................................................................................
   551    510   	      | 3300-motorola | delta-motorola)
   552    511   		basic_machine=m68k-motorola
   553    512   		;;
   554    513   	delta88)
   555    514   		basic_machine=m88k-motorola
   556    515   		os=-sysv3
   557    516   		;;
   558         -	dicos)
   559         -		basic_machine=i686-pc
   560         -		os=-dicos
   561         -		;;
   562    517   	djgpp)
   563    518   		basic_machine=i586-pc
   564    519   		os=-msdosdjgpp
   565    520   		;;
   566    521   	dpx20 | dpx20-*)
   567    522   		basic_machine=rs6000-bull
   568    523   		os=-bosx
................................................................................
   709    664   			;;
   710    665   		esac
   711    666   		;;
   712    667   	isi68 | isi)
   713    668   		basic_machine=m68k-isi
   714    669   		os=-sysv
   715    670   		;;
   716         -	m68knommu)
   717         -		basic_machine=m68k-unknown
   718         -		os=-linux
   719         -		;;
   720         -	m68knommu-*)
   721         -		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
   722         -		os=-linux
   723         -		;;
   724    671   	m88k-omron*)
   725    672   		basic_machine=m88k-omron
   726    673   		;;
   727    674   	magnum | m3230)
   728    675   		basic_machine=mips-mips
   729    676   		os=-sysv
   730    677   		;;
   731    678   	merlin)
   732    679   		basic_machine=ns32k-utek
   733    680   		os=-sysv
   734    681   		;;
   735         -        microblaze)
   736         -		basic_machine=microblaze-xilinx
   737         -		;;
   738    682   	mingw32)
   739    683   		basic_machine=i386-pc
   740    684   		os=-mingw32
   741    685   		;;
   742    686   	mingw32ce)
   743    687   		basic_machine=arm-unknown
   744    688   		os=-mingw32ce
................................................................................
   865    809   		basic_machine=hppa1.1-hitachi
   866    810   		os=-hiuxwe2
   867    811   		;;
   868    812   	paragon)
   869    813   		basic_machine=i860-intel
   870    814   		os=-osf
   871    815   		;;
   872         -	parisc)
   873         -		basic_machine=hppa-unknown
   874         -		os=-linux
   875         -		;;
   876         -	parisc-*)
   877         -		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
   878         -		os=-linux
   879         -		;;
   880    816   	pbd)
   881    817   		basic_machine=sparc-tti
   882    818   		;;
   883    819   	pbb)
   884    820   		basic_machine=m68k-tti
   885    821   		;;
   886    822   	pc532 | pc532-*)
................................................................................
  1081   1017   		basic_machine=tic55x-unknown
  1082   1018   		os=-coff
  1083   1019   		;;
  1084   1020   	tic6x | c6x*)
  1085   1021   		basic_machine=tic6x-unknown
  1086   1022   		os=-coff
  1087   1023   		;;
  1088         -	tile*)
  1089         -		basic_machine=tile-unknown
  1090         -		os=-linux-gnu
  1091         -		;;
  1092   1024   	tx39)
  1093   1025   		basic_machine=mipstx39-unknown
  1094   1026   		;;
  1095   1027   	tx39el)
  1096   1028   		basic_machine=mipstx39el-unknown
  1097   1029   		;;
  1098   1030   	toad1)
................................................................................
  1160   1092   		basic_machine=ymp-cray
  1161   1093   		os=-unicos
  1162   1094   		;;
  1163   1095   	z8k-*-coff)
  1164   1096   		basic_machine=z8k-unknown
  1165   1097   		os=-sim
  1166   1098   		;;
  1167         -	z80-*-coff)
  1168         -		basic_machine=z80-unknown
  1169         -		os=-sim
  1170         -		;;
  1171   1099   	none)
  1172   1100   		basic_machine=none-none
  1173   1101   		os=-none
  1174   1102   		;;
  1175   1103   
  1176   1104   # Here we handle the default manufacturer of certain CPU types.  It is in
  1177   1105   # some cases the only manufacturer, in others, it is the most popular.
................................................................................
  1202   1130   		;;
  1203   1131   	pdp11)
  1204   1132   		basic_machine=pdp11-dec
  1205   1133   		;;
  1206   1134   	we32k)
  1207   1135   		basic_machine=we32k-att
  1208   1136   		;;
  1209         -	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
         1137  +	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
  1210   1138   		basic_machine=sh-unknown
  1211   1139   		;;
  1212   1140   	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
  1213   1141   		basic_machine=sparc-sun
  1214   1142   		;;
  1215   1143   	cydra)
  1216   1144   		basic_machine=cydra-cydrome
................................................................................
  1252   1180   
  1253   1181   if [ x"$os" != x"" ]
  1254   1182   then
  1255   1183   case $os in
  1256   1184           # First match some system type aliases
  1257   1185           # that might get confused with valid system types.
  1258   1186   	# -solaris* is a basic system type, with this one exception.
  1259         -        -auroraux)
  1260         -	        os=-auroraux
  1261         -		;;
  1262   1187   	-solaris1 | -solaris1.*)
  1263   1188   		os=`echo $os | sed -e 's|solaris1|sunos4|'`
  1264   1189   		;;
  1265   1190   	-solaris)
  1266   1191   		os=-solaris2
  1267   1192   		;;
  1268   1193   	-svr4*)
................................................................................
  1275   1200   		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  1276   1201   		;;
  1277   1202   	# First accept the basic system types.
  1278   1203   	# The portable systems comes first.
  1279   1204   	# Each alternative MUST END IN A *, to match a version number.
  1280   1205   	# -sysv* is not here because it comes later, after sysvr4.
  1281   1206   	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  1282         -	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
  1283         -	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
  1284         -	      | -sym* | -kopensolaris* \
         1207  +	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
         1208  +	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
  1285   1209   	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  1286         -	      | -aos* | -aros* \
         1210  +	      | -aos* \
  1287   1211   	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  1288   1212   	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  1289   1213   	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
  1290   1214   	      | -openbsd* | -solidbsd* \
  1291   1215   	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
  1292   1216   	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  1293   1217   	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  1294   1218   	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  1295         -	      | -chorusos* | -chorusrdb* | -cegcc* \
         1219  +	      | -chorusos* | -chorusrdb* \
  1296   1220   	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  1297   1221   	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
  1298   1222   	      | -uxpv* | -beos* | -mpeix* | -udk* \
  1299   1223   	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
  1300   1224   	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  1301   1225   	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
  1302   1226   	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
  1303   1227   	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
  1304   1228   	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
  1305         -	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
         1229  +	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
  1306   1230   	# Remember, each alternative MUST END IN *, to match a version number.
  1307   1231   		;;
  1308   1232   	-qnx*)
  1309   1233   		case $basic_machine in
  1310   1234   		    x86-* | i*86-*)
  1311   1235   			;;
  1312   1236   		    *)
................................................................................
  1428   1352   		;;
  1429   1353   	-kaos*)
  1430   1354   		os=-kaos
  1431   1355   		;;
  1432   1356   	-zvmoe)
  1433   1357   		os=-zvmoe
  1434   1358   		;;
  1435         -	-dicos*)
  1436         -		os=-dicos
  1437         -		;;
  1438   1359   	-none)
  1439   1360   		;;
  1440   1361   	*)
  1441   1362   		# Get rid of the `-' at the beginning of $os.
  1442   1363   		os=`echo $os | sed 's/[^-]*-//'`
  1443   1364   		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  1444   1365   		exit 1
................................................................................
  1628   1549   		case $os in
  1629   1550   			-riscix*)
  1630   1551   				vendor=acorn
  1631   1552   				;;
  1632   1553   			-sunos*)
  1633   1554   				vendor=sun
  1634   1555   				;;
  1635         -			-cnk*|-aix*)
         1556  +			-aix*)
  1636   1557   				vendor=ibm
  1637   1558   				;;
  1638   1559   			-beos*)
  1639   1560   				vendor=be
  1640   1561   				;;
  1641   1562   			-hpux*)
  1642   1563   				vendor=hp

Changes to configure.

more than 10,000 changes

Changes to configure.ac.

     1      1   #                                               -*- Autoconf -*-
     2      2   # Process this file with autoconf to produce a configure script.
     3      3   
     4      4   AC_PREREQ(2.61)
     5         -AC_INIT(librasterlite, 1.1f, a.furieri @ lqt.it)
            5  +AC_INIT(librasterlite, 1.0, a.furieri @ lqt.it)
     6      6   AC_LANG(C) 
     7         -AC_CONFIG_AUX_DIR([.])
     8         -AC_CONFIG_MACRO_DIR([m4])
     9      7   
    10      8   AM_INIT_AUTOMAKE 
    11      9   AM_MAINTAINER_MODE
    12         -AM_CONFIG_HEADER(config.h)
    13     10   
    14     11   # Checks for header files.
    15     12   AC_CHECK_HEADERS(stdlib.h,, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
    16     13   AC_CHECK_HEADERS(stdio.h,,[AC_MSG_ERROR([cannot find stdio.h, bailing out])])
    17     14   AC_CHECK_HEADERS(string.h,, [AC_MSG_ERROR([cannot find string.h, bailing out])])
    18     15   AC_CHECK_HEADERS(memory.h,, [AC_MSG_ERROR([cannot find memory.h, bailing out])])
    19     16   AC_CHECK_HEADERS(math.h,,[AC_MSG_ERROR([cannot find math.h, bailing out])])
................................................................................
    20     17   AC_CHECK_HEADERS(float.h,,[AC_MSG_ERROR([cannot find float.h, bailing out])])
    21     18   AC_CHECK_HEADERS(fcntl.h,,[AC_MSG_ERROR([cannot find fcntl.h, bailing out])])
    22     19   AC_CHECK_HEADERS(inttypes.h,, [AC_MSG_ERROR([cannot find inttypes.h, bailing out])])
    23     20   AC_CHECK_HEADERS(stddef.h,, [AC_MSG_ERROR([cannot find stddef.h, bailing out])])
    24     21   AC_CHECK_HEADERS(stdint.h,, [AC_MSG_ERROR([cannot find stdint.h, bailing out])])
    25     22   AC_CHECK_HEADERS(sys/time.h,, [AC_MSG_ERROR([cannot find sys/time.h, bailing out])])
    26     23   AC_CHECK_HEADERS(unistd.h,, [AC_MSG_ERROR([cannot find unistd.h, bailing out])])
    27         -AC_CHECK_HEADERS(jpeglib.h,, [AC_MSG_ERROR([cannot find jpeglib.h, bailing out])])
    28         -AC_CHECK_HEADERS(jerror.h,, [AC_MSG_ERROR([cannot find jerror.h, bailing out])])
    29         -
    30         -#
    31         -# testing GeoTiff headers
    32         -# on some systems they are located on -/include
    33         -# on other systems they are on -/include/geotiff
    34         -# or even on -/include/libgeotiff
    35         -#
    36         -# this patch was kindly contributed by Brad Hards
    37         -# 2011-09-02
    38         -#
    39         -AC_CHECK_HEADERS(geotiff/geotiff.h)
    40         -AC_CHECK_HEADERS(libgeotiff/geotiff.h)
    41         -AC_CHECK_HEADERS(geotiff.h)
    42         -if test x"$ac_cv_header_geotiff_geotiff_h" != x"yes" &&
    43         -    test x"$ac_cv_header_libgeotiff_geotiff_h" != x"yes" &&
    44         -    test x"$ac_cv_header_geotiff_h" != x"yes";
    45         -then
    46         -    AC_MSG_ERROR(['libgeotiff' is required but the header (geotiff.h) doesn't seem to be installed on this system])
    47         -fi 
    48     24   
    49     25   # Checks for programs.
    50     26   AC_PROG_CXX
    51     27   AC_PROG_CC
    52     28   AC_PROG_CPP
    53     29   AC_PROG_INSTALL
    54     30   AC_PROG_LN_S 
................................................................................
    67     43   # Checks for library functions.
    68     44   AC_FUNC_LSTAT
    69     45   AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
    70     46   AC_FUNC_MEMCMP 
    71     47   AC_FUNC_STAT 
    72     48   AC_FUNC_STRFTIME
    73     49   AC_CHECK_FUNCS([memset sqrt strcasecmp strerror strncasecmp strstr fdatasync ftruncate getcwd gettimeofday localtime_r memmove strerror])
    74         -
    75         -# Checks for required libraries
    76         -AC_CHECK_LIB(z,inflateInit_,,AC_MSG_ERROR(['libz' is required but it doesn't seem to be installed on this system.]),-lm)
    77         -AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(['libjpeg' is required but it doesn't seem to be installed on this system.]),-lm)
    78         -AC_CHECK_LIB(tiff,TIFFClientOpen,,AC_MSG_ERROR(['libtiff' is required but it doesn't seem to be installed on this system.]),-lm)
    79         -AC_CHECK_LIB(proj,pj_init_plus,,AC_MSG_ERROR(['libproj' is required but it doesn't seem to be installed on this system.]),-lm)
    80         -AC_CHECK_LIB(geotiff,GTIFSetFromProj4,,AC_MSG_ERROR(['libgeotiff' [>= v.1.2.5] is required but it doesn't seem to be installed on this system.]),-lm)
    81         -
    82         -PKG_CHECK_MODULES([LIBSPATIALITE], [spatialite], , AC_MSG_ERROR(['libspatialite' is required but it doesn't seem to be installed on this system.]))
    83         -AC_SUBST(LIBSPATIALITE_CFLAGS)
    84         -AC_SUBST(LIBSPATIALITE_LIBS)
    85         -
    86         -PKG_CHECK_MODULES([LIBPNG], [libpng], , AC_MSG_ERROR(['libpng' is required but it doesn't seem to be installed on this system.]))
    87         -AC_SUBST(LIBPNG_CFLAGS)
    88         -AC_SUBST(LIBPNG_LIBS)
    89         -
    90         -#
    91         -#    --enable-gcov
    92         -#
    93         -AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov],[turn on code coverage analysis tools]))
    94         -if test "x$enable_gcov" = "xyes"; then
    95         -    dnl Check for -fprofile-arcs and -ftest-coverage option
    96         -    CFLAGS=$CFLAGS" -fprofile-arcs -ftest-coverage -g"
    97         -    GCOV_FLAGS="-lgcov"
    98         -fi
    99         -
   100     50   
   101     51   AC_CONFIG_FILES([Makefile \
   102     52   		headers/Makefile \
           53  +		epsilon/Makefile \
   103     54   		lib/Makefile \
   104     55   		src/Makefile \
   105         -		test/Makefile \
   106     56   		rasterlite.pc])
   107     57   
   108     58   AC_OUTPUT

Changes to depcomp.

     1      1   #! /bin/sh
     2      2   # depcomp - compile a program generating dependencies as side-effects
     3      3   
     4         -scriptversion=2009-04-28.21; # UTC
            4  +scriptversion=2007-03-29.01
     5      5   
     6         -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
     7         -# Software Foundation, Inc.
            6  +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
            7  +# Foundation, Inc.
     8      8   
     9      9   # This program is free software; you can redistribute it and/or modify
    10     10   # it under the terms of the GNU General Public License as published by
    11     11   # the Free Software Foundation; either version 2, or (at your option)
    12     12   # any later version.
    13     13   
    14     14   # This program is distributed in the hope that it will be useful,
    15     15   # but WITHOUT ANY WARRANTY; without even the implied warranty of
    16     16   # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17     17   # GNU General Public License for more details.
    18     18   
    19     19   # You should have received a copy of the GNU General Public License
    20         -# along with this program.  If not, see <http://www.gnu.org/licenses/>.
           20  +# along with this program; if not, write to the Free Software
           21  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
           22  +# 02110-1301, USA.
    21     23   
    22     24   # As a special exception to the GNU General Public License, if you
    23     25   # distribute this file as part of a program that contains a
    24     26   # configuration script generated by Autoconf, you may include it under
    25     27   # the same distribution terms that you use for the rest of that program.
    26     28   
    27     29   # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
................................................................................
    81     83   
    82     84   if test "$depmode" = dashXmstdout; then
    83     85      # This is just like dashmstdout with a different argument.
    84     86      dashmflag=-xM
    85     87      depmode=dashmstdout
    86     88   fi
    87     89   
    88         -cygpath_u="cygpath -u -f -"
    89         -if test "$depmode" = msvcmsys; then
    90         -   # This is just like msvisualcpp but w/o cygpath translation.
    91         -   # Just convert the backslash-escaped backslashes to single forward
    92         -   # slashes to satisfy depend.m4
    93         -   cygpath_u="sed s,\\\\\\\\,/,g"
    94         -   depmode=msvisualcpp
    95         -fi
    96         -
    97     90   case "$depmode" in
    98     91   gcc3)
    99     92   ## gcc 3 implements dependency tracking that does exactly what
   100     93   ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
   101     94   ## it if -MD -MP comes after the -MF stuff.  Hmm.
   102     95   ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
   103     96   ## the command line argument order; so add the flags where they
................................................................................
   195    188       # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
   196    189       # the IRIX cc adds comments like `#:fec' to the end of the
   197    190       # dependency line.
   198    191       tr ' ' '
   199    192   ' < "$tmpdepfile" \
   200    193       | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
   201    194       tr '
   202         -' ' ' >> "$depfile"
   203         -    echo >> "$depfile"
          195  +' ' ' >> $depfile
          196  +    echo >> $depfile
   204    197   
   205    198       # The second pass generates a dummy entry for each header file.
   206    199       tr ' ' '
   207    200   ' < "$tmpdepfile" \
   208    201      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
   209         -   >> "$depfile"
          202  +   >> $depfile
   210    203     else
   211    204       # The sourcefile does not contain any dependencies, so just
   212    205       # store a dummy comment line, to avoid errors with the Makefile
   213    206       # "include basename.Plo" scheme.
   214    207       echo "#dummy" > "$depfile"
   215    208     fi
   216    209     rm -f "$tmpdepfile"
................................................................................
   331    324     for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
   332    325     do
   333    326       test -f "$tmpdepfile" && break
   334    327     done
   335    328     if test -f "$tmpdepfile"; then
   336    329       sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
   337    330       # Add `dependent.h:' lines.
   338         -    sed -ne '2,${
   339         -	       s/^ *//
   340         -	       s/ \\*$//
   341         -	       s/$/:/
   342         -	       p
   343         -	     }' "$tmpdepfile" >> "$depfile"
          331  +    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
   344    332     else
   345    333       echo "#dummy" > "$depfile"
   346    334     fi
   347    335     rm -f "$tmpdepfile" "$tmpdepfile2"
   348    336     ;;
   349    337   
   350    338   tru64)
................................................................................
   412    400   dashmstdout)
   413    401     # Important note: in order to support this mode, a compiler *must*
   414    402     # always write the preprocessed file to stdout, regardless of -o.
   415    403     "$@" || exit $?
   416    404   
   417    405     # Remove the call to Libtool.
   418    406     if test "$libtool" = yes; then
   419         -    while test "X$1" != 'X--mode=compile'; do
          407  +    while test $1 != '--mode=compile'; do
   420    408         shift
   421    409       done
   422    410       shift
   423    411     fi
   424    412   
   425    413     # Remove `-o $object'.
   426    414     IFS=" "
................................................................................
   463    451     exit 1
   464    452     ;;
   465    453   
   466    454   makedepend)
   467    455     "$@" || exit $?
   468    456     # Remove any Libtool call
   469    457     if test "$libtool" = yes; then
   470         -    while test "X$1" != 'X--mode=compile'; do
          458  +    while test $1 != '--mode=compile'; do
   471    459         shift
   472    460       done
   473    461       shift
   474    462     fi
   475    463     # X makedepend
   476    464     shift
   477         -  cleared=no eat=no
   478         -  for arg
   479         -  do
          465  +  cleared=no
          466  +  for arg in "$@"; do
   480    467       case $cleared in
   481    468       no)
   482    469         set ""; shift
   483    470         cleared=yes ;;
   484    471       esac
   485         -    if test $eat = yes; then
   486         -      eat=no
   487         -      continue
   488         -    fi
   489    472       case "$arg" in
   490    473       -D*|-I*)
   491    474         set fnord "$@" "$arg"; shift ;;
   492    475       # Strip any option that makedepend may not understand.  Remove
   493    476       # the object too, otherwise makedepend will parse it as a source file.
   494         -    -arch)
   495         -      eat=yes ;;
   496    477       -*|$object)
   497    478         ;;
   498    479       *)
   499    480         set fnord "$@" "$arg"; shift ;;
   500    481       esac
   501    482     done
   502         -  obj_suffix=`echo "$object" | sed 's/^.*\././'`
          483  +  obj_suffix="`echo $object | sed 's/^.*\././'`"
   503    484     touch "$tmpdepfile"
   504    485     ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   505    486     rm -f "$depfile"
   506    487     cat < "$tmpdepfile" > "$depfile"
   507    488     sed '1,2d' "$tmpdepfile" | tr ' ' '
   508    489   ' | \
   509    490   ## Some versions of the HPUX 10.20 sed can't process this invocation
................................................................................
   515    496   cpp)
   516    497     # Important note: in order to support this mode, a compiler *must*
   517    498     # always write the preprocessed file to stdout.
   518    499     "$@" || exit $?
   519    500   
   520    501     # Remove the call to Libtool.
   521    502     if test "$libtool" = yes; then
   522         -    while test "X$1" != 'X--mode=compile'; do
          503  +    while test $1 != '--mode=compile'; do
   523    504         shift
   524    505       done
   525    506       shift
   526    507     fi
   527    508   
   528    509     # Remove `-o $object'.
   529    510     IFS=" "
................................................................................
   553    534     cat < "$tmpdepfile" >> "$depfile"
   554    535     sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
   555    536     rm -f "$tmpdepfile"
   556    537     ;;
   557    538   
   558    539   msvisualcpp)
   559    540     # Important note: in order to support this mode, a compiler *must*
   560         -  # always write the preprocessed file to stdout.
          541  +  # always write the preprocessed file to stdout, regardless of -o,
          542  +  # because we must use -o when running libtool.
   561    543     "$@" || exit $?
   562         -
   563         -  # Remove the call to Libtool.
   564         -  if test "$libtool" = yes; then
   565         -    while test "X$1" != 'X--mode=compile'; do
   566         -      shift
   567         -    done
   568         -    shift
   569         -  fi
   570         -
   571    544     IFS=" "
   572    545     for arg
   573    546     do
   574    547       case "$arg" in
   575         -    -o)
   576         -      shift
   577         -      ;;
   578         -    $object)
   579         -      shift
   580         -      ;;
   581    548       "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
   582    549   	set fnord "$@"
   583    550   	shift
   584    551   	shift
   585    552   	;;
   586    553       *)
   587    554   	set fnord "$@" "$arg"
   588    555   	shift
   589    556   	shift
   590    557   	;;
   591    558       esac
   592    559     done
   593         -  "$@" -E 2>/dev/null |
   594         -  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
          560  +  "$@" -E |
          561  +  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
   595    562     rm -f "$depfile"
   596    563     echo "$object : \\" > "$depfile"
   597         -  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
          564  +  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
   598    565     echo "	" >> "$depfile"
   599         -  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
          566  +  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   600    567     rm -f "$tmpdepfile"
   601    568     ;;
   602    569   
   603         -msvcmsys)
   604         -  # This case exists only to let depend.m4 do its work.  It works by
   605         -  # looking at the text of this script.  This case will never be run,
   606         -  # since it is checked for above.
   607         -  exit 1
   608         -  ;;
   609         -
   610    570   none)
   611    571     exec "$@"
   612    572     ;;
   613    573   
   614    574   *)
   615    575     echo "Unknown depmode $depmode" 1>&2
   616    576     exit 1
................................................................................
   621    581   
   622    582   # Local Variables:
   623    583   # mode: shell-script
   624    584   # sh-indentation: 2
   625    585   # eval: (add-hook 'write-file-hooks 'time-stamp)
   626    586   # time-stamp-start: "scriptversion="
   627    587   # time-stamp-format: "%:y-%02m-%02d.%02H"
   628         -# time-stamp-time-zone: "UTC"
   629         -# time-stamp-end: "; # UTC"
          588  +# time-stamp-end: "$"
   630    589   # End:

Added epsilon/Makefile.am.

            1  +INCLUDES = -I$(top_srcdir)/lib
            2  +METASOURCES = AUTO
            3  +noinst_LTLIBRARIES = libepsilon.la
            4  +libepsilon_la_SOURCES = bit_io.c checksum.c cobs.c color.c common.c dc_level.c \
            5  +	filter.c filterbank.c libmain.c list.c mem_alloc.c merge_split.c pad.c \
            6  +	resample.c speck.c
            7  +noinst_HEADERS = bit_io.h checksum.h cobs.h color.h common.h daub97lift.h \
            8  +	dc_level.h filter.h filterbank.h libmain.h list.h mem_alloc.h \
            9  +	merge_split.h pad.h resample.h speck.h epsilon.h
           10  +
           11  +EXTRA_DIST = msvc/stdint.h msvc/inttypes.h

Added epsilon/Makefile.in.

            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
            2  +# @configure_input@
            3  +
            4  +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
            6  +# This Makefile.in is free software; the Free Software Foundation
            7  +# gives unlimited permission to copy and/or distribute it,
            8  +# with or without modifications, as long as this notice is preserved.
            9  +
           10  +# This program is distributed in the hope that it will be useful,
           11  +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
           12  +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
           13  +# PARTICULAR PURPOSE.
           14  +
           15  +@SET_MAKE@
           16  +
           17  +
           18  +VPATH = @srcdir@
           19  +pkgdatadir = $(datadir)/@PACKAGE@
           20  +pkglibdir = $(libdir)/@PACKAGE@
           21  +pkgincludedir = $(includedir)/@PACKAGE@
           22  +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
           23  +install_sh_DATA = $(install_sh) -c -m 644
           24  +install_sh_PROGRAM = $(install_sh) -c
           25  +install_sh_SCRIPT = $(install_sh) -c
           26  +INSTALL_HEADER = $(INSTALL_DATA)
           27  +transform = $(program_transform_name)
           28  +NORMAL_INSTALL = :
           29  +PRE_INSTALL = :
           30  +POST_INSTALL = :
           31  +NORMAL_UNINSTALL = :
           32  +PRE_UNINSTALL = :
           33  +POST_UNINSTALL = :
           34  +build_triplet = @build@
           35  +host_triplet = @host@
           36  +subdir = epsilon
           37  +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
           38  +	$(srcdir)/Makefile.in
           39  +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
           40  +am__aclocal_m4_deps = $(top_srcdir)/configure.ac
           41  +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
           42  +	$(ACLOCAL_M4)
           43  +mkinstalldirs = $(install_sh) -d
           44  +CONFIG_CLEAN_FILES =
           45  +LTLIBRARIES = $(noinst_LTLIBRARIES)
           46  +libepsilon_la_LIBADD =
           47  +am_libepsilon_la_OBJECTS = bit_io.lo checksum.lo cobs.lo color.lo \
           48  +	common.lo dc_level.lo filter.lo filterbank.lo libmain.lo \
           49  +	list.lo mem_alloc.lo merge_split.lo pad.lo resample.lo \
           50  +	speck.lo
           51  +libepsilon_la_OBJECTS = $(am_libepsilon_la_OBJECTS)
           52  +DEFAULT_INCLUDES = -I.@am__isrc@
           53  +depcomp = $(SHELL) $(top_srcdir)/depcomp
           54  +am__depfiles_maybe = depfiles
           55  +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
           56  +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
           57  +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
           58  +	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
           59  +	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
           60  +CCLD = $(CC)
           61  +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
           62  +	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
           63  +	$(LDFLAGS) -o $@
           64  +SOURCES = $(libepsilon_la_SOURCES)
           65  +DIST_SOURCES = $(libepsilon_la_SOURCES)
           66  +HEADERS = $(noinst_HEADERS)
           67  +ETAGS = etags
           68  +CTAGS = ctags
           69  +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
           70  +ACLOCAL = @ACLOCAL@
           71  +AMTAR = @AMTAR@
           72  +AR = @AR@
           73  +AS = @AS@
           74  +AUTOCONF = @AUTOCONF@
           75  +AUTOHEADER = @AUTOHEADER@
           76  +AUTOMAKE = @AUTOMAKE@
           77  +AWK = @AWK@
           78  +CC = @CC@
           79  +CCDEPMODE = @CCDEPMODE@
           80  +CFLAGS = @CFLAGS@
           81  +CPP = @CPP@
           82  +CPPFLAGS = @CPPFLAGS@
           83  +CXX = @CXX@
           84  +CXXCPP = @CXXCPP@
           85  +CXXDEPMODE = @CXXDEPMODE@
           86  +CXXFLAGS = @CXXFLAGS@
           87  +CYGPATH_W = @CYGPATH_W@
           88  +DEFS = @DEFS@
           89  +DEPDIR = @DEPDIR@
           90  +DLLTOOL = @DLLTOOL@
           91  +DSYMUTIL = @DSYMUTIL@
           92  +ECHO = @ECHO@
           93  +ECHO_C = @ECHO_C@
           94  +ECHO_N = @ECHO_N@
           95  +ECHO_T = @ECHO_T@
           96  +EGREP = @EGREP@
           97  +EXEEXT = @EXEEXT@
           98  +F77 = @F77@
           99  +FFLAGS = @FFLAGS@
          100  +GREP = @GREP@
          101  +INSTALL = @INSTALL@
          102  +INSTALL_DATA = @INSTALL_DATA@
          103  +INSTALL_PROGRAM = @INSTALL_PROGRAM@
          104  +INSTALL_SCRIPT = @INSTALL_SCRIPT@
          105  +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
          106  +LDFLAGS = @LDFLAGS@
          107  +LIBOBJS = @LIBOBJS@
          108  +LIBS = @LIBS@
          109  +LIBTOOL = @LIBTOOL@
          110  +LN_S = @LN_S@
          111  +LTLIBOBJS = @LTLIBOBJS@
          112  +MAINT = @MAINT@
          113  +MAKEINFO = @MAKEINFO@
          114  +MKDIR_P = @MKDIR_P@
          115  +NMEDIT = @NMEDIT@
          116  +OBJDUMP = @OBJDUMP@
          117  +OBJEXT = @OBJEXT@
          118  +PACKAGE = @PACKAGE@
          119  +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
          120  +PACKAGE_NAME = @PACKAGE_NAME@
          121  +PACKAGE_STRING = @PACKAGE_STRING@
          122  +PACKAGE_TARNAME = @PACKAGE_TARNAME@
          123  +PACKAGE_VERSION = @PACKAGE_VERSION@
          124  +PATH_SEPARATOR = @PATH_SEPARATOR@
          125  +RANLIB = @RANLIB@
          126  +SED = @SED@
          127  +SET_MAKE = @SET_MAKE@
          128  +SHELL = @SHELL@
          129  +STRIP = @STRIP@
          130  +VERSION = @VERSION@
          131  +abs_builddir = @abs_builddir@
          132  +abs_srcdir = @abs_srcdir@
          133  +abs_top_builddir = @abs_top_builddir@
          134  +abs_top_srcdir = @abs_top_srcdir@
          135  +ac_ct_CC = @ac_ct_CC@
          136  +ac_ct_CXX = @ac_ct_CXX@
          137  +ac_ct_F77 = @ac_ct_F77@
          138  +am__include = @am__include@
          139  +am__leading_dot = @am__leading_dot@
          140  +am__quote = @am__quote@
          141  +am__tar = @am__tar@
          142  +am__untar = @am__untar@
          143  +bindir = @bindir@
          144  +build = @build@
          145  +build_alias = @build_alias@
          146  +build_cpu = @build_cpu@
          147  +build_os = @build_os@
          148  +build_vendor = @build_vendor@
          149  +builddir = @builddir@
          150  +datadir = @datadir@
          151  +datarootdir = @datarootdir@
          152  +docdir = @docdir@
          153  +dvidir = @dvidir@
          154  +exec_prefix = @exec_prefix@
          155  +host = @host@
          156  +host_alias = @host_alias@
          157  +host_cpu = @host_cpu@
          158  +host_os = @host_os@
          159  +host_vendor = @host_vendor@
          160  +htmldir = @htmldir@
          161  +includedir = @includedir@
          162  +infodir = @infodir@
          163  +install_sh = @install_sh@
          164  +libdir = @libdir@
          165  +libexecdir = @libexecdir@
          166  +localedir = @localedir@
          167  +localstatedir = @localstatedir@
          168  +mandir = @mandir@
          169  +mkdir_p = @mkdir_p@
          170  +oldincludedir = @oldincludedir@
          171  +pdfdir = @pdfdir@
          172  +prefix = @prefix@
          173  +program_transform_name = @program_transform_name@
          174  +psdir = @psdir@
          175  +sbindir = @sbindir@
          176  +sharedstatedir = @sharedstatedir@
          177  +srcdir = @srcdir@
          178  +sysconfdir = @sysconfdir@
          179  +target_alias = @target_alias@
          180  +top_builddir = @top_builddir@
          181  +top_srcdir = @top_srcdir@
          182  +INCLUDES = -I$(top_srcdir)/lib
          183  +METASOURCES = AUTO
          184  +noinst_LTLIBRARIES = libepsilon.la
          185  +libepsilon_la_SOURCES = bit_io.c checksum.c cobs.c color.c common.c dc_level.c \
          186  +	filter.c filterbank.c libmain.c list.c mem_alloc.c merge_split.c pad.c \
          187  +	resample.c speck.c
          188  +
          189  +noinst_HEADERS = bit_io.h checksum.h cobs.h color.h common.h daub97lift.h \
          190  +	dc_level.h filter.h filterbank.h libmain.h list.h mem_alloc.h \
          191  +	merge_split.h pad.h resample.h speck.h epsilon.h
          192  +
          193  +EXTRA_DIST = msvc/stdint.h msvc/inttypes.h
          194  +all: all-am
          195  +
          196  +.SUFFIXES:
          197  +.SUFFIXES: .c .lo .o .obj
          198  +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
          199  +	@for dep in $?; do \
          200  +	  case '$(am__configure_deps)' in \
          201  +	    *$$dep*) \
          202  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          203  +		&& exit 0; \
          204  +	      exit 1;; \
          205  +	  esac; \
          206  +	done; \
          207  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  epsilon/Makefile'; \
          208  +	cd $(top_srcdir) && \
          209  +	  $(AUTOMAKE) --foreign  epsilon/Makefile
          210  +.PRECIOUS: Makefile
          211  +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          212  +	@case '$?' in \
          213  +	  *config.status*) \
          214  +	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          215  +	  *) \
          216  +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
          217  +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
          218  +	esac;
          219  +
          220  +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
          221  +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
          222  +
          223  +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
          224  +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
          225  +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
          226  +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
          227  +
          228  +clean-noinstLTLIBRARIES:
          229  +	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
          230  +	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
          231  +	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          232  +	  test "$$dir" != "$$p" || dir=.; \
          233  +	  echo "rm -f \"$${dir}/so_locations\""; \
          234  +	  rm -f "$${dir}/so_locations"; \
          235  +	done
          236  +libepsilon.la: $(libepsilon_la_OBJECTS) $(libepsilon_la_DEPENDENCIES) 
          237  +	$(LINK)  $(libepsilon_la_OBJECTS) $(libepsilon_la_LIBADD) $(LIBS)
          238  +
          239  +mostlyclean-compile:
          240  +	-rm -f *.$(OBJEXT)
          241  +
          242  +distclean-compile:
          243  +	-rm -f *.tab.c
          244  +
          245  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_io.Plo@am__quote@
          246  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksum.Plo@am__quote@
          247  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobs.Plo@am__quote@
          248  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color.Plo@am__quote@
          249  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@
          250  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dc_level.Plo@am__quote@
          251  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Plo@am__quote@
          252  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filterbank.Plo@am__quote@
          253  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmain.Plo@am__quote@
          254  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@
          255  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem_alloc.Plo@am__quote@
          256  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/merge_split.Plo@am__quote@
          257  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pad.Plo@am__quote@
          258  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resample.Plo@am__quote@
          259  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speck.Plo@am__quote@
          260  +
          261  +.c.o:
          262  +@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
          263  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          264  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
          265  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
          266  +@am__fastdepCC_FALSE@	$(COMPILE) -c $<
          267  +
          268  +.c.obj:
          269  +@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
          270  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          271  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
          272  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
          273  +@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
          274  +
          275  +.c.lo:
          276  +@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
          277  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
          278  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
          279  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
          280  +@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
          281  +
          282  +mostlyclean-libtool:
          283  +	-rm -f *.lo
          284  +
          285  +clean-libtool:
          286  +	-rm -rf .libs _libs
          287  +
          288  +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
          289  +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
          290  +	unique=`for i in $$list; do \
          291  +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          292  +	  done | \
          293  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
          294  +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
          295  +	mkid -fID $$unique
          296  +tags: TAGS
          297  +
          298  +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          299  +		$(TAGS_FILES) $(LISP)
          300  +	tags=; \
          301  +	here=`pwd`; \
          302  +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
          303  +	unique=`for i in $$list; do \
          304  +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          305  +	  done | \
          306  +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          307  +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
          308  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
          309  +	  test -n "$$unique" || unique=$$empty_fix; \
          310  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          311  +	    $$tags $$unique; \
          312  +	fi
          313  +ctags: CTAGS
          314  +CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          315  +		$(TAGS_FILES) $(LISP)
          316  +	tags=; \
          317  +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
          318  +	unique=`for i in $$list; do \
          319  +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          320  +	  done | \
          321  +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          322  +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
          323  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
          324  +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
          325  +	     $$tags $$unique
          326  +
          327  +GTAGS:
          328  +	here=`$(am__cd) $(top_builddir) && pwd` \
          329  +	  && cd $(top_srcdir) \
          330  +	  && gtags -i $(GTAGS_ARGS) $$here
          331  +
          332  +distclean-tags:
          333  +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
          334  +
          335  +distdir: $(DISTFILES)
          336  +	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
          337  +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
          338  +	list='$(DISTFILES)'; \
          339  +	  dist_files=`for file in $$list; do echo $$file; done | \
          340  +	  sed -e "s|^$$srcdirstrip/||;t" \
          341  +	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
          342  +	case $$dist_files in \
          343  +	  */*) $(MKDIR_P) `echo "$$dist_files" | \
          344  +			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
          345  +			   sort -u` ;; \
          346  +	esac; \
          347  +	for file in $$dist_files; do \
          348  +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
          349  +	  if test -d $$d/$$file; then \
          350  +	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
          351  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          352  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
          353  +	    fi; \
          354  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
          355  +	  else \
          356  +	    test -f $(distdir)/$$file \
          357  +	    || cp -p $$d/$$file $(distdir)/$$file \
          358  +	    || exit 1; \
          359  +	  fi; \
          360  +	done
          361  +check-am: all-am
          362  +check: check-am
          363  +all-am: Makefile $(LTLIBRARIES) $(HEADERS)
          364  +installdirs:
          365  +install: install-am
          366  +install-exec: install-exec-am
          367  +install-data: install-data-am
          368  +uninstall: uninstall-am
          369  +
          370  +install-am: all-am
          371  +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
          372  +
          373  +installcheck: installcheck-am
          374  +install-strip:
          375  +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
          376  +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          377  +	  `test -z '$(STRIP)' || \
          378  +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
          379  +mostlyclean-generic:
          380  +
          381  +clean-generic:
          382  +
          383  +distclean-generic:
          384  +	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
          385  +
          386  +maintainer-clean-generic:
          387  +	@echo "This command is intended for maintainers to use"
          388  +	@echo "it deletes files that may require special tools to rebuild."
          389  +clean: clean-am
          390  +
          391  +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
          392  +	mostlyclean-am
          393  +
          394  +distclean: distclean-am
          395  +	-rm -rf ./$(DEPDIR)
          396  +	-rm -f Makefile
          397  +distclean-am: clean-am distclean-compile distclean-generic \
          398  +	distclean-tags
          399  +
          400  +dvi: dvi-am
          401  +
          402  +dvi-am:
          403  +
          404  +html: html-am
          405  +
          406  +info: info-am
          407  +
          408  +info-am:
          409  +
          410  +install-data-am:
          411  +
          412  +install-dvi: install-dvi-am
          413  +
          414  +install-exec-am:
          415  +
          416  +install-html: install-html-am
          417  +
          418  +install-info: install-info-am
          419  +
          420  +install-man:
          421  +
          422  +install-pdf: install-pdf-am
          423  +
          424  +install-ps: install-ps-am
          425  +
          426  +installcheck-am:
          427  +
          428  +maintainer-clean: maintainer-clean-am
          429  +	-rm -rf ./$(DEPDIR)
          430  +	-rm -f Makefile
          431  +maintainer-clean-am: distclean-am maintainer-clean-generic
          432  +
          433  +mostlyclean: mostlyclean-am
          434  +
          435  +mostlyclean-am: mostlyclean-compile mostlyclean-generic \
          436  +	mostlyclean-libtool
          437  +
          438  +pdf: pdf-am
          439  +
          440  +pdf-am:
          441  +
          442  +ps: ps-am
          443  +
          444  +ps-am:
          445  +
          446  +uninstall-am:
          447  +
          448  +.MAKE: install-am install-strip
          449  +
          450  +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
          451  +	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
          452  +	distclean-compile distclean-generic distclean-libtool \
          453  +	distclean-tags distdir dvi dvi-am html html-am info info-am \
          454  +	install install-am install-data install-data-am install-dvi \
          455  +	install-dvi-am install-exec install-exec-am install-html \
          456  +	install-html-am install-info install-info-am install-man \
          457  +	install-pdf install-pdf-am install-ps install-ps-am \
          458  +	install-strip installcheck installcheck-am installdirs \
          459  +	maintainer-clean maintainer-clean-generic mostlyclean \
          460  +	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
          461  +	pdf pdf-am ps ps-am tags uninstall uninstall-am
          462  +
          463  +# Tell versions [3.59,3.63) of GNU make to not export all variables.
          464  +# Otherwise a system limit (for SysV at least) may be exceeded.
          465  +.NOEXPORT:

Added epsilon/bit_io.c.

            1  +/*
            2  + * $Id: bit_io.c,v 1.12 2008/03/25 19:31:44 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <bit_io.h>
           26  +
           27  +void
           28  +init_bits (bit_buffer * bb, unsigned char *buf, int size)
           29  +{
           30  +    assert (size > 0);
           31  +
           32  +    bb->start = bb->next = buf;
           33  +    bb->end = bb->start + size;
           34  +    bb->bits = bb->pending = 0;
           35  +}
           36  +
           37  +int
           38  +write_bits (bit_buffer * bb, int value, int size)
           39  +{
           40  +    assert (size <= 24);
           41  +
           42  +    /* No more space available */
           43  +    if (bb->next >= bb->end)
           44  +      {
           45  +	  return BIT_BUFFER_OVERFLOW;
           46  +      }
           47  +
           48  +    /* Save requested number of bits */
           49  +    bb->bits |= (value << bb->pending);
           50  +    bb->pending += size;
           51  +
           52  +    /* Write complete octets */
           53  +    while (bb->pending >= 8)
           54  +      {
           55  +	  if (bb->next >= bb->end)
           56  +	    {
           57  +		return BIT_BUFFER_OVERFLOW;
           58  +	    }
           59  +
           60  +	  *bb->next++ = (unsigned char) (bb->bits & 0xff);
           61  +
           62  +	  bb->bits >>= 8;
           63  +	  bb->pending -= 8;
           64  +      }
           65  +
           66  +    return BIT_BUFFER_OK;
           67  +}
           68  +
           69  +int
           70  +read_bits (bit_buffer * bb, int *value, int size)
           71  +{
           72  +    assert (size <= 24);
           73  +
           74  +    /* Read missing bytes */
           75  +    while (bb->pending < size)
           76  +      {
           77  +	  if (bb->next >= bb->end)
           78  +	    {
           79  +		return BIT_BUFFER_UNDERFLOW;
           80  +	    }
           81  +
           82  +	  bb->bits |= (*bb->next++ << bb->pending);
           83  +	  bb->pending += 8;
           84  +      }
           85  +
           86  +    *value = bb->bits & (~(~0 << size));
           87  +
           88  +    bb->bits >>= size;
           89  +    bb->pending -= size;
           90  +
           91  +    return BIT_BUFFER_OK;
           92  +}
           93  +
           94  +int
           95  +flush_bits (bit_buffer * bb)
           96  +{
           97  +    if (bb->pending)
           98  +      {
           99  +	  return write_bits (bb, 0UL, 8);
          100  +      }
          101  +    else
          102  +      {
          103  +	  return BIT_BUFFER_OK;
          104  +      }
          105  +}

Added epsilon/bit_io.h.

            1  +/*
            2  + * $Id: bit_io.h,v 1.15 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Bit I/O
           27  + *
           28  + *  This file contains bit I/O routines. */
           29  +
           30  +#ifndef __BIT_IO_H__
           31  +#define __BIT_IO_H__
           32  +
           33  +#ifdef __cplusplus
           34  +extern "C"
           35  +{
           36  +#endif
           37  +
           38  +/** \addtogroup bit_io Bit I/O */
           39  +/*@{*/
           40  +
           41  +#include <common.h>
           42  +
           43  +/** All bits are successfuly processed */
           44  +#define BIT_BUFFER_OK           0
           45  +/** Cannot write bits, output buffer is full */
           46  +#define BIT_BUFFER_OVERFLOW     1
           47  +/** Cannot read bits, input buffer is empty */
           48  +#define BIT_BUFFER_UNDERFLOW    2
           49  +
           50  +/** Bit-buffer structure
           51  + *
           52  + *  This structure represents bit-buffer. */
           53  +    typedef struct bit_buffer_tag
           54  +    {
           55  +    /** Start of buffer */
           56  +	unsigned char *start;
           57  +    /** End of buffer */
           58  +	unsigned char *end;
           59  +    /** Next input/output byte */
           60  +	unsigned char *next;
           61  +    /** Bit buffer */
           62  +	unsigned long bits;
           63  +    /** Pending bits */
           64  +	int pending;
           65  +    } bit_buffer;
           66  +
           67  +/** Write one zero bit */
           68  +#define write_0(_bb)            write_bits(_bb, 0UL, 1)
           69  +/** Write one unity bit */
           70  +#define write_1(_bb)            write_bits(_bb, 1UL, 1)
           71  +/** Read one bit */
           72  +#define read_bit(_bb, _bit)     read_bits(_bb, _bit, 1)
           73  +
           74  +/** Initialize bit-buffer for reading or writting
           75  + *
           76  + *  This function initializes bit-buffer \a bb for reading or
           77  + *  writting bits.
           78  + *
           79  + *  \param bb Bit-buffer to initialize
           80  + *  \param buf Actual input/output buffer
           81  + *  \param size Actual buffer size
           82  + *
           83  + *  \return \c VOID */
           84  +    void init_bits (bit_buffer * bb, unsigned char *buf, int size);
           85  +
           86  +/** Write bits
           87  + *
           88  + *  This function writes \a size least significant bits of
           89  + *  the \a value to the bit-buffer \a bb.
           90  + *
           91  + *  \note The function expects that \a size <= 24.
           92  + *
           93  + *  \param bb Bit-buffer
           94  + *  \param value Bits to write
           95  + *  \param size Number of bits to write
           96  + *
           97  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
           98  +    int write_bits (bit_buffer * bb, int value, int size);
           99  +
          100  +/** Read bits
          101  + *
          102  + *  This function reads \a size least significant bits
          103  + *  from the bit-buffer \a bb  into the \a value argument.
          104  + *
          105  + *  \note Function expects that \a size <= 24.
          106  + *
          107  + *  \param bb Bit-buffer
          108  + *  \param value Location to store the bits
          109  + *  \param size Number of bits to read
          110  + *
          111  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          112  +    int read_bits (bit_buffer * bb, int *value, int size);
          113  +
          114  +/** Flush bits
          115  + *
          116  + *  This function flushes all pending bits if there are any.
          117  + *
          118  + *  \param bb Bit-buffer
          119  + *
          120  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          121  +    int flush_bits (bit_buffer * bb);
          122  +
          123  +/*@}*/
          124  +
          125  +#ifdef __cplusplus
          126  +}
          127  +#endif
          128  +
          129  +#endif				/* __BIT_IO_H__ */

Added epsilon/checksum.c.

            1  +/*
            2  + * $Id: checksum.c,v 1.13 2007/07/21 15:15:25 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <checksum.h>
           26  +
           27  +/* largest prime smaller than 65536 */
           28  +#define BASE 65521
           29  +
           30  +/* NMAX is the largest n such that 255 * n (n + 1) / 2 + (n + 1) * (BASE - 1) <= 2^32 - 1 */
           31  +#define NMAX 5552
           32  +
           33  +/* Loop unrolling hack */
           34  +#define SUM1(data, i) { s1 += data[i]; s2 += s1; }
           35  +#define SUM2(data, i) SUM1(data, i); SUM1(data, i + 1);
           36  +#define SUM4(data, i) SUM2(data, i); SUM2(data, i + 2);
           37  +#define SUM8(data, i) SUM4(data, i); SUM4(data, i + 4);
           38  +#define SUM16(data)   SUM8(data, 0); SUM8(data, 8)
           39  +
           40  +/* CRC32 polynomial */
           41  +#define CRC32_POLY 0xedb88320L
           42  +
           43  +/* CRC32 precalculated table */
           44  +local crc32_t crc32_table[256] = {
           45  +    0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
           46  +    0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
           47  +    0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
           48  +    0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
           49  +    0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
           50  +    0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
           51  +    0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
           52  +    0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
           53  +    0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
           54  +    0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
           55  +    0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
           56  +    0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
           57  +    0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
           58  +    0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
           59  +    0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
           60  +    0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
           61  +    0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
           62  +    0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
           63  +    0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
           64  +    0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
           65  +    0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
           66  +    0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
           67  +    0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
           68  +    0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
           69  +    0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
           70  +    0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
           71  +    0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
           72  +    0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
           73  +    0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
           74  +    0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
           75  +    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
           76  +    0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
           77  +    0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
           78  +    0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
           79  +    0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
           80  +    0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
           81  +    0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
           82  +    0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
           83  +    0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
           84  +    0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
           85  +    0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
           86  +    0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
           87  +    0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
           88  +    0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
           89  +    0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
           90  +    0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
           91  +    0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
           92  +    0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
           93  +    0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
           94  +    0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
           95  +    0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
           96  +    0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
           97  +    0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
           98  +    0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
           99  +    0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
          100  +    0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
          101  +    0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
          102  +    0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
          103  +    0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
          104  +    0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
          105  +    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
          106  +    0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
          107  +    0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
          108  +    0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
          109  +};
          110  +
          111  +crc32_t
          112  +epsilon_adler32 (unsigned char *data, int length)
          113  +{
          114  +    crc32_t s1 = 1;
          115  +    crc32_t s2 = 0;
          116  +    int k;
          117  +
          118  +    assert (length >= 0);
          119  +
          120  +    if (length == 0)
          121  +      {
          122  +	  return 1;
          123  +      }
          124  +
          125  +    while (length > 0)
          126  +      {
          127  +	  k = length < NMAX ? length : NMAX;
          128  +	  length -= k;
          129  +
          130  +	  while (k >= 16)
          131  +	    {
          132  +		SUM16 (data);
          133  +		data += 16;
          134  +		k -= 16;
          135  +	    }
          136  +
          137  +	  if (k != 0)
          138  +	      do
          139  +		{
          140  +		    s1 += *data++;
          141  +		    s2 += s1;
          142  +		}
          143  +	      while (--k);
          144  +
          145  +	  s1 %= BASE;
          146  +	  s2 %= BASE;
          147  +      }
          148  +
          149  +    return (s2 << 16) | s1;
          150  +}
          151  +
          152  +crc32_t
          153  +epsilon_crc32 (unsigned char *data, int length)
          154  +{
          155  +    crc32_t crc = 0xffffffff;
          156  +    int i;
          157  +    assert (length >= 0);
          158  +
          159  +    for (i = 0; i < length; i++)
          160  +      {
          161  +	  crc = crc32_table[(crc ^ data[i]) & 0xff] ^ (crc >> 8);
          162  +      }
          163  +    return crc ^ 0xffffffff;
          164  +}
          165  +
          166  +/* This auxilliary function is used for CRC-32 table
          167  + * generation. It is not exported or used by the program. */
          168  +local void
          169  +make_crc32_table (void)
          170  +{
          171  +    crc32_t crc;
          172  +    int n, k;
          173  +
          174  +    printf ("local crc32_t crc32_table[256] = {\n");
          175  +
          176  +    for (n = 0; n < 256; n++)
          177  +      {
          178  +	  crc = (crc32_t) n;
          179  +
          180  +	  for (k = 0; k < 8; k++)
          181  +	    {
          182  +		if (crc & 1)
          183  +		  {
          184  +		      crc = CRC32_POLY ^ (crc >> 1);
          185  +		  }
          186  +		else
          187  +		  {
          188  +		      crc >>= 1;
          189  +		  }
          190  +	    }
          191  +
          192  +	  if ((n & 0x03) == 0)
          193  +	    {
          194  +		printf ("    ");
          195  +	    }
          196  +
          197  +	  printf ("0x%08x,%s", crc, (n & 0x03) == 0x03 ? "" : " ");
          198  +
          199  +	  if ((n & 0x03) == 0x03)
          200  +	    {
          201  +		printf ("\n");
          202  +	    }
          203  +      }
          204  +
          205  +    printf ("};\n");
          206  +}

Added epsilon/checksum.h.

            1  +/*
            2  + * $Id: checksum.h,v 1.13 2007/07/21 15:15:25 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Checksum calculation
           27  + *
           28  + *  This file contains routines for CRC-32 and ADLER-32 checksum
           29  + *  calculation. At the moment program uses only CRC-32 algorithm.
           30  + *
           31  + *  \section References
           32  + *
           33  + *  <a href="http://www.ross.net/crc/">A Painless Guide to CRC Error Detection Algorithms</a><br>
           34  + *  <a href="http://en.wikipedia.org/wiki/CRC32">Wikipedia: CRC-32</a><br>
           35  + *  <a href="http://en.wikipedia.org/wiki/Adler-32">Wikipedia: ADLER-32</a> */
           36  +
           37  +#ifndef __CHECKSUM_H__
           38  +#define __CHECKSUM_H__
           39  +
           40  +#ifdef __cplusplus
           41  +extern "C"
           42  +{
           43  +#endif
           44  +
           45  +/** \addtogroup checksum Checksum calculation */
           46  +/*@{*/
           47  +
           48  +#include <common.h>
           49  +#include <epsilon.h>
           50  +
           51  +/** Compute ADLER-32 checksum
           52  + *
           53  + *  This function computes ADLER-32 checksum.
           54  + *
           55  + *  \param data Data to sum
           56  + *  \param length Data length
           57  + *
           58  + *  \return Checksum */
           59  +    crc32_t epsilon_adler32 (unsigned char *data, int length);
           60  +
           61  +/** Compute CRC-32 checksum
           62  + *
           63  + *  This function computes CRC-32 checksum.
           64  + *
           65  + *  \param data Data to sum
           66  + *  \param length Data length
           67  + *
           68  + *  \return Checksum */
           69  +    crc32_t epsilon_crc32 (unsigned char *data, int length);
           70  +
           71  +/*@}*/
           72  +
           73  +#ifdef __cplusplus
           74  +}
           75  +#endif
           76  +
           77  +#endif				/* __CHECKSUM_H__ */

Added epsilon/cobs.c.

            1  +/*
            2  + * $Id: cobs.c,v 1.12 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <cobs.h>
           26  +
           27  +#define FINISH_BLOCK(_x) (*code_ptr = (_x), \
           28  +                           code_ptr = output_data++, \
           29  +                           code = 0x01)
           30  +
           31  +int
           32  +stuff_data (unsigned char *input_data, unsigned char *output_data,
           33  +	    int input_length, int output_length)
           34  +{
           35  +    unsigned char *input_end = input_data + input_length;
           36  +    unsigned char *output_start = output_data;
           37  +
           38  +    unsigned char *code_ptr = output_data++;
           39  +    unsigned char code = 0x01;
           40  +
           41  +    /* Sanity checks */
           42  +    assert (input_length > 0);
           43  +    assert (output_length >= input_length + input_length / 254 + 1);
           44  +
           45  +    while (input_data < input_end)
           46  +      {
           47  +	  if (*input_data == 0)
           48  +	    {
           49  +		FINISH_BLOCK (code);
           50  +	    }
           51  +	  else
           52  +	    {
           53  +		*output_data++ = *input_data;
           54  +		code++;
           55  +
           56  +		if (code == 0xff)
           57  +		  {
           58  +		      FINISH_BLOCK (code);
           59  +		  }
           60  +	    }
           61  +
           62  +	  input_data++;
           63  +      }
           64  +
           65  +    FINISH_BLOCK (code);
           66  +
           67  +    return output_data - output_start - 1;
           68  +}
           69  +
           70  +int
           71  +unstuff_data (unsigned char *input_data, unsigned char *output_data,
           72  +	      int input_length, int output_length)
           73  +{
           74  +    unsigned char *input_end = input_data + input_length;
           75  +    unsigned char *output_end = output_data + output_length;
           76  +    unsigned char *output_start = output_data;
           77  +
           78  +    /* Sanity checks */
           79  +    assert (input_length > 0);
           80  +    assert (output_length >= input_length);
           81  +
           82  +    while (input_data < input_end)
           83  +      {
           84  +	  int code = *input_data++;
           85  +	  int i;
           86  +
           87  +	  for (i = 1;
           88  +	       (i < code) && (input_data < input_end)
           89  +	       && (output_data < output_end); i++)
           90  +	    {
           91  +		*output_data++ = *input_data++;
           92  +	    }
           93  +
           94  +	  if ((code > 0x00) && (code < 0xff) &&
           95  +	      (input_data < input_end) && (output_data < output_end))
           96  +	    {
           97  +		*output_data++ = 0;
           98  +	    }
           99  +      }
          100  +
          101  +    return output_data - output_start;
          102  +}

Added epsilon/cobs.h.

            1  +/*
            2  + * $Id: cobs.h,v 1.14 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Byte stuffing
           27  + *
           28  + *  This file contains routines for efficient byte stuffing.
           29  + *  The algorithm used here called COBS, which is stands for Consistent
           30  + *  Overhead Byte Stuffing. Byte stuffing is very useful for parallel
           31  + *  image processing and improves overall system robustness.
           32  + *
           33  + *  \section References
           34  + *
           35  + *  Stuart Cheshire and Mary Baker, "Consistent Overhead Byte Stuffing".
           36  + *  IEEE/ACM Transactions on Networking. vol. 7 pp. 159-172 April 1999. */
           37  +
           38  +#ifndef __COBS_H__
           39  +#define __COBS_H__
           40  +
           41  +#ifdef __cplusplus
           42  +extern "C"
           43  +{
           44  +#endif
           45  +
           46  +/** \addtogroup stuffing Byte stuffing */
           47  +/*@{*/
           48  +
           49  +#include <common.h>
           50  +
           51  +/** Byte stuffing
           52  + *
           53  + *  This function performes byte stuffing. All zero-valued
           54  + *  bytes in the \a input_data will be eliminated. The result
           55  + *  will be stored in the \a output_data. This operation involves
           56  + *  some marginal data expansion, no more than 0.4% at worst case.
           57  + *
           58  + *  \param input_data Input data
           59  + *  \param output_data Output data
           60  + *  \param input_length Input data length
           61  + *  \param output_length Output data length
           62  + *
           63  + *  \return Number of bytes actually used in the \a output_data
           64  + *
           65  + *  \note Caller must allocate enough space for the \a output_data
           66  + *  beforehand. This value can be calculated by the following
           67  + *  formula: \a input_length + (\a input_length / 254) + 1. */
           68  +    int stuff_data (unsigned char *input_data, unsigned char *output_data,
           69  +		    int input_length, int output_length);
           70  +
           71  +/** Byte unstuffing
           72  + *
           73  + *  This function is inverse to the previous one. It recovers original data.
           74  + *  The result will be stored in the \a output_data.
           75  + *
           76  + *  \param input_data Input data
           77  + *  \param output_data Output data
           78  + *  \param input_length Input data length
           79  + *  \param output_length Output data length
           80  + *
           81  + *  \return Number of bytes actually used in the \a output_data
           82  + *
           83  + *  \note Caller must allocate enough space for the \a output_data
           84  + *  beforehand. Safe value is \a input_length.  */
           85  +    int unstuff_data (unsigned char *input_data, unsigned char *output_data,
           86  +		      int input_length, int output_length);
           87  +
           88  +/*@}*/
           89  +
           90  +#ifdef __cplusplus
           91  +}
           92  +#endif
           93  +
           94  +#endif				/* __COBS_H__ */

Added epsilon/color.c.

            1  +/*
            2  + * $Id: color.c,v 1.13 2008/03/29 21:37:06 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <color.h>
           26  +
           27  +/* Look-up tables for increase RGB to YCbCr conversion speed */
           28  +
           29  +local double O_299000[256] = {
           30  +    0, 0.299, 0.598, 0.897, 1.196, 1.495, 1.794, 2.093,
           31  +    2.392, 2.691, 2.99, 3.289, 3.588, 3.887, 4.186, 4.485,
           32  +    4.784, 5.083, 5.382, 5.681, 5.98, 6.279, 6.578, 6.877,
           33  +    7.176, 7.475, 7.774, 8.073, 8.372, 8.671, 8.97, 9.269,
           34  +    9.568, 9.867, 10.166, 10.465, 10.764, 11.063, 11.362, 11.661,
           35  +    11.96, 12.259, 12.558, 12.857, 13.156, 13.455, 13.754, 14.053,
           36  +    14.352, 14.651, 14.95, 15.249, 15.548, 15.847, 16.146, 16.445,
           37  +    16.744, 17.043, 17.342, 17.641, 17.94, 18.239, 18.538, 18.837,
           38  +    19.136, 19.435, 19.734, 20.033, 20.332, 20.631, 20.93, 21.229,
           39  +    21.528, 21.827, 22.126, 22.425, 22.724, 23.023, 23.322, 23.621,
           40  +    23.92, 24.219, 24.518, 24.817, 25.116, 25.415, 25.714, 26.013,
           41  +    26.312, 26.611, 26.91, 27.209, 27.508, 27.807, 28.106, 28.405,
           42  +    28.704, 29.003, 29.302, 29.601, 29.9, 30.199, 30.498, 30.797,
           43  +    31.096, 31.395, 31.694, 31.993, 32.292, 32.591, 32.89, 33.189,
           44  +    33.488, 33.787, 34.086, 34.385, 34.684, 34.983, 35.282, 35.581,
           45  +    35.88, 36.179, 36.478, 36.777, 37.076, 37.375, 37.674, 37.973,
           46  +    38.272, 38.571, 38.87, 39.169, 39.468, 39.767, 40.066, 40.365,
           47  +    40.664, 40.963, 41.262, 41.561, 41.86, 42.159, 42.458, 42.757,
           48  +    43.056, 43.355, 43.654, 43.953, 44.252, 44.551, 44.85, 45.149,
           49  +    45.448, 45.747, 46.046, 46.345, 46.644, 46.943, 47.242, 47.541,
           50  +    47.84, 48.139, 48.438, 48.737, 49.036, 49.335, 49.634, 49.933,
           51  +    50.232, 50.531, 50.83, 51.129, 51.428, 51.727, 52.026, 52.325,
           52  +    52.624, 52.923, 53.222, 53.521, 53.82, 54.119, 54.418, 54.717,
           53  +    55.016, 55.315, 55.614, 55.913, 56.212, 56.511, 56.81, 57.109,
           54  +    57.408, 57.707, 58.006, 58.305, 58.604, 58.903, 59.202, 59.501,
           55  +    59.8, 60.099, 60.398, 60.697, 60.996, 61.295, 61.594, 61.893,
           56  +    62.192, 62.491, 62.79, 63.089, 63.388, 63.687, 63.986, 64.285,
           57  +    64.584, 64.883, 65.182, 65.481, 65.78, 66.079, 66.378, 66.677,
           58  +    66.976, 67.275, 67.574, 67.873, 68.172, 68.471, 68.77, 69.069,
           59  +    69.368, 69.667, 69.966, 70.265, 70.564, 70.863, 71.162, 71.461,
           60  +    71.76, 72.059, 72.358, 72.657, 72.956, 73.255, 73.554, 73.853,
           61  +    74.152, 74.451, 74.75, 75.049, 75.348, 75.647, 75.946, 76.245,
           62  +};
           63  +
           64  +local double O_587000[256] = {
           65  +    0, 0.587, 1.174, 1.761, 2.348, 2.935, 3.522, 4.109,
           66  +    4.696, 5.283, 5.87, 6.457, 7.044, 7.631, 8.218, 8.805,
           67  +    9.392, 9.979, 10.566, 11.153, 11.74, 12.327, 12.914, 13.501,
           68  +    14.088, 14.675, 15.262, 15.849, 16.436, 17.023, 17.61, 18.197,
           69  +    18.784, 19.371, 19.958, 20.545, 21.132, 21.719, 22.306, 22.893,
           70  +    23.48, 24.067, 24.654, 25.241, 25.828, 26.415, 27.002, 27.589,
           71  +    28.176, 28.763, 29.35, 29.937, 30.524, 31.111, 31.698, 32.285,
           72  +    32.872, 33.459, 34.046, 34.633, 35.22, 35.807, 36.394, 36.981,
           73  +    37.568, 38.155, 38.742, 39.329, 39.916, 40.503, 41.09, 41.677,
           74  +    42.264, 42.851, 43.438, 44.025, 44.612, 45.199, 45.786, 46.373,
           75  +    46.96, 47.547, 48.134, 48.721, 49.308, 49.895, 50.482, 51.069,
           76  +    51.656, 52.243, 52.83, 53.417, 54.004, 54.591, 55.178, 55.765,
           77  +    56.352, 56.939, 57.526, 58.113, 58.7, 59.287, 59.874, 60.461,
           78  +    61.048, 61.635, 62.222, 62.809, 63.396, 63.983, 64.57, 65.157,
           79  +    65.744, 66.331, 66.918, 67.505, 68.092, 68.679, 69.266, 69.853,
           80  +    70.44, 71.027, 71.614, 72.201, 72.788, 73.375, 73.962, 74.549,
           81  +    75.136, 75.723, 76.31, 76.897, 77.484, 78.071, 78.658, 79.245,
           82  +    79.832, 80.419, 81.006, 81.593, 82.18, 82.767, 83.354, 83.941,
           83  +    84.528, 85.115, 85.702, 86.289, 86.876, 87.463, 88.05, 88.637,
           84  +    89.224, 89.811, 90.398, 90.985, 91.572, 92.159, 92.746, 93.333,
           85  +    93.92, 94.507, 95.094, 95.681, 96.268, 96.855, 97.442, 98.029,
           86  +    98.616, 99.203, 99.79, 100.377, 100.964, 101.551, 102.138, 102.725,
           87  +    103.312, 103.899, 104.486, 105.073, 105.66, 106.247, 106.834, 107.421,
           88  +    108.008, 108.595, 109.182, 109.769, 110.356, 110.943, 111.53, 112.117,
           89  +    112.704, 113.291, 113.878, 114.465, 115.052, 115.639, 116.226, 116.813,
           90  +    117.4, 117.987, 118.574, 119.161, 119.748, 120.335, 120.922, 121.509,
           91  +    122.096, 122.683, 123.27, 123.857, 124.444, 125.031, 125.618, 126.205,
           92  +    126.792, 127.379, 127.966, 128.553, 129.14, 129.727, 130.314, 130.901,
           93  +    131.488, 132.075, 132.662, 133.249, 133.836, 134.423, 135.01, 135.597,
           94  +    136.184, 136.771, 137.358, 137.945, 138.532, 139.119, 139.706, 140.293,
           95  +    140.88, 141.467, 142.054, 142.641, 143.228, 143.815, 144.402, 144.989,
           96  +    145.576, 146.163, 146.75, 147.337, 147.924, 148.511, 149.098, 149.685,
           97  +};
           98  +
           99  +local double O_114000[256] = {
          100  +    0, 0.114, 0.228, 0.342, 0.456, 0.57, 0.684, 0.798,
          101  +    0.912, 1.026, 1.14, 1.254, 1.368, 1.482, 1.596, 1.71,
          102  +    1.824, 1.938, 2.052, 2.166, 2.28, 2.394, 2.508, 2.622,
          103  +    2.736, 2.85, 2.964, 3.078, 3.192, 3.306, 3.42, 3.534,
          104  +    3.648, 3.762, 3.876, 3.99, 4.104, 4.218, 4.332, 4.446,
          105  +    4.56, 4.674, 4.788, 4.902, 5.016, 5.13, 5.244, 5.358,
          106  +    5.472, 5.586, 5.7, 5.814, 5.928, 6.042, 6.156, 6.27,
          107  +    6.384, 6.498, 6.612, 6.726, 6.84, 6.954, 7.068, 7.182,
          108  +    7.296, 7.41, 7.524, 7.638, 7.752, 7.866, 7.98, 8.094,
          109  +    8.208, 8.322, 8.436, 8.55, 8.664, 8.778, 8.892, 9.006,
          110  +    9.12, 9.234, 9.348, 9.462, 9.576, 9.69, 9.804, 9.918,
          111  +    10.032, 10.146, 10.26, 10.374, 10.488, 10.602, 10.716, 10.83,
          112  +    10.944, 11.058, 11.172, 11.286, 11.4, 11.514, 11.628, 11.742,
          113  +    11.856, 11.97, 12.084, 12.198, 12.312, 12.426, 12.54, 12.654,
          114  +    12.768, 12.882, 12.996, 13.11, 13.224, 13.338, 13.452, 13.566,
          115  +    13.68, 13.794, 13.908, 14.022, 14.136, 14.25, 14.364, 14.478,
          116  +    14.592, 14.706, 14.82, 14.934, 15.048, 15.162, 15.276, 15.39,
          117  +    15.504, 15.618, 15.732, 15.846, 15.96, 16.074, 16.188, 16.302,
          118  +    16.416, 16.53, 16.644, 16.758, 16.872, 16.986, 17.1, 17.214,
          119  +    17.328, 17.442, 17.556, 17.67, 17.784, 17.898, 18.012, 18.126,
          120  +    18.24, 18.354, 18.468, 18.582, 18.696, 18.81, 18.924, 19.038,
          121  +    19.152, 19.266, 19.38, 19.494, 19.608, 19.722, 19.836, 19.95,
          122  +    20.064, 20.178, 20.292, 20.406, 20.52, 20.634, 20.748, 20.862,
          123  +    20.976, 21.09, 21.204, 21.318, 21.432, 21.546, 21.66, 21.774,
          124  +    21.888, 22.002, 22.116, 22.23, 22.344, 22.458, 22.572, 22.686,
          125  +    22.8, 22.914, 23.028, 23.142, 23.256, 23.37, 23.484, 23.598,
          126  +    23.712, 23.826, 23.94, 24.054, 24.168, 24.282, 24.396, 24.51,
          127  +    24.624, 24.738, 24.852, 24.966, 25.08, 25.194, 25.308, 25.422,
          128  +    25.536, 25.65, 25.764, 25.878, 25.992, 26.106, 26.22, 26.334,
          129  +    26.448, 26.562, 26.676, 26.79, 26.904, 27.018, 27.132, 27.246,
          130  +    27.36, 27.474, 27.588, 27.702, 27.816, 27.93, 28.044, 28.158,
          131  +    28.272, 28.386, 28.5, 28.614, 28.728, 28.842, 28.956, 29.07,
          132  +};
          133  +
          134  +local double O_168736[256] = {
          135  +    0, 0.168736, 0.337472, 0.506208, 0.674944, 0.84368, 1.01242, 1.18115,
          136  +    1.34989, 1.51862, 1.68736, 1.8561, 2.02483, 2.19357, 2.3623, 2.53104,
          137  +    2.69978, 2.86851, 3.03725, 3.20598, 3.37472, 3.54346, 3.71219, 3.88093,
          138  +    4.04966, 4.2184, 4.38714, 4.55587, 4.72461, 4.89334, 5.06208, 5.23082,
          139  +    5.39955, 5.56829, 5.73702, 5.90576, 6.0745, 6.24323, 6.41197, 6.5807,
          140  +    6.74944, 6.91818, 7.08691, 7.25565, 7.42438, 7.59312, 7.76186, 7.93059,
          141  +    8.09933, 8.26806, 8.4368, 8.60554, 8.77427, 8.94301, 9.11174, 9.28048,
          142  +    9.44922, 9.61795, 9.78669, 9.95542, 10.1242, 10.2929, 10.4616, 10.6304,
          143  +    10.7991, 10.9678, 11.1366, 11.3053, 11.474, 11.6428, 11.8115, 11.9803,
          144  +    12.149, 12.3177, 12.4865, 12.6552, 12.8239, 12.9927, 13.1614, 13.3301,
          145  +    13.4989, 13.6676, 13.8364, 14.0051, 14.1738, 14.3426, 14.5113, 14.68,
          146  +    14.8488, 15.0175, 15.1862, 15.355, 15.5237, 15.6924, 15.8612, 16.0299,
          147  +    16.1987, 16.3674, 16.5361, 16.7049, 16.8736, 17.0423, 17.2111, 17.3798,
          148  +    17.5485, 17.7173, 17.886, 18.0548, 18.2235, 18.3922, 18.561, 18.7297,
          149  +    18.8984, 19.0672, 19.2359, 19.4046, 19.5734, 19.7421, 19.9108, 20.0796,
          150  +    20.2483, 20.4171, 20.5858, 20.7545, 20.9233, 21.092, 21.2607, 21.4295,
          151  +    21.5982, 21.7669, 21.9357, 22.1044, 22.2732, 22.4419, 22.6106, 22.7794,
          152  +    22.9481, 23.1168, 23.2856, 23.4543, 23.623, 23.7918, 23.9605, 24.1292,
          153  +    24.298, 24.4667, 24.6355, 24.8042, 24.9729, 25.1417, 25.3104, 25.4791,
          154  +    25.6479, 25.8166, 25.9853, 26.1541, 26.3228, 26.4916, 26.6603, 26.829,
          155  +    26.9978, 27.1665, 27.3352, 27.504, 27.6727, 27.8414, 28.0102, 28.1789,
          156  +    28.3476, 28.5164, 28.6851, 28.8539, 29.0226, 29.1913, 29.3601, 29.5288,
          157  +    29.6975, 29.8663, 30.035, 30.2037, 30.3725, 30.5412, 30.71, 30.8787,
          158  +    31.0474, 31.2162, 31.3849, 31.5536, 31.7224, 31.8911, 32.0598, 32.2286,
          159  +    32.3973, 32.566, 32.7348, 32.9035, 33.0723, 33.241, 33.4097, 33.5785,
          160  +    33.7472, 33.9159, 34.0847, 34.2534, 34.4221, 34.5909, 34.7596, 34.9284,
          161  +    35.0971, 35.2658, 35.4346, 35.6033, 35.772, 35.9408, 36.1095, 36.2782,
          162  +    36.447, 36.6157, 36.7844, 36.9532, 37.1219, 37.2907, 37.4594, 37.6281,
          163  +    37.7969, 37.9656, 38.1343, 38.3031, 38.4718, 38.6405, 38.8093, 38.978,
          164  +    39.1468, 39.3155, 39.4842, 39.653, 39.8217, 39.9904, 40.1592, 40.3279,
          165  +    40.4966, 40.6654, 40.8341, 41.0028, 41.1716, 41.3403, 41.5091, 41.6778,
          166  +    41.8465, 42.0153, 42.184, 42.3527, 42.5215, 42.6902, 42.8589, 43.0277,
          167  +};
          168  +
          169  +local double O_331264[256] = {
          170  +    0, 0.331264, 0.662528, 0.993792, 1.32506, 1.65632, 1.98758, 2.31885,
          171  +    2.65011, 2.98138, 3.31264, 3.6439, 3.97517, 4.30643, 4.6377, 4.96896,
          172  +    5.30022, 5.63149, 5.96275, 6.29402, 6.62528, 6.95654, 7.28781, 7.61907,
          173  +    7.95034, 8.2816, 8.61286, 8.94413, 9.27539, 9.60666, 9.93792, 10.2692,
          174  +    10.6004, 10.9317, 11.263, 11.5942, 11.9255, 12.2568, 12.588, 12.9193,
          175  +    13.2506, 13.5818, 13.9131, 14.2444, 14.5756, 14.9069, 15.2381, 15.5694,
          176  +    15.9007, 16.2319, 16.5632, 16.8945, 17.2257, 17.557, 17.8883, 18.2195,
          177  +    18.5508, 18.882, 19.2133, 19.5446, 19.8758, 20.2071, 20.5384, 20.8696,
          178  +    21.2009, 21.5322, 21.8634, 22.1947, 22.526, 22.8572, 23.1885, 23.5197,
          179  +    23.851, 24.1823, 24.5135, 24.8448, 25.1761, 25.5073, 25.8386, 26.1699,
          180  +    26.5011, 26.8324, 27.1636, 27.4949, 27.8262, 28.1574, 28.4887, 28.82,
          181  +    29.1512, 29.4825, 29.8138, 30.145, 30.4763, 30.8076, 31.1388, 31.4701,
          182  +    31.8013, 32.1326, 32.4639, 32.7951, 33.1264, 33.4577, 33.7889, 34.1202,
          183  +    34.4515, 34.7827, 35.114, 35.4452, 35.7765, 36.1078, 36.439, 36.7703,
          184  +    37.1016, 37.4328, 37.7641, 38.0954, 38.4266, 38.7579, 39.0892, 39.4204,
          185  +    39.7517, 40.0829, 40.4142, 40.7455, 41.0767, 41.408, 41.7393, 42.0705,
          186  +    42.4018, 42.7331, 43.0643, 43.3956, 43.7268, 44.0581, 44.3894, 44.7206,
          187  +    45.0519, 45.3832, 45.7144, 46.0457, 46.377, 46.7082, 47.0395, 47.3708,
          188  +    47.702, 48.0333, 48.3645, 48.6958, 49.0271, 49.3583, 49.6896, 50.0209,
          189  +    50.3521, 50.6834, 51.0147, 51.3459, 51.6772, 52.0084, 52.3397, 52.671,
          190  +    53.0022, 53.3335, 53.6648, 53.996, 54.3273, 54.6586, 54.9898, 55.3211,
          191  +    55.6524, 55.9836, 56.3149, 56.6461, 56.9774, 57.3087, 57.6399, 57.9712,
          192  +    58.3025, 58.6337, 58.965, 59.2963, 59.6275, 59.9588, 60.29, 60.6213,
          193  +    60.9526, 61.2838, 61.6151, 61.9464, 62.2776, 62.6089, 62.9402, 63.2714,
          194  +    63.6027, 63.934, 64.2652, 64.5965, 64.9277, 65.259, 65.5903, 65.9215,
          195  +    66.2528, 66.5841, 66.9153, 67.2466, 67.5779, 67.9091, 68.2404, 68.5716,
          196  +    68.9029, 69.2342, 69.5654, 69.8967, 70.228, 70.5592, 70.8905, 71.2218,
          197  +    71.553, 71.8843, 72.2156, 72.5468, 72.8781, 73.2093, 73.5406, 73.8719,
          198  +    74.2031, 74.5344, 74.8657, 75.1969, 75.5282, 75.8595, 76.1907, 76.522,
          199  +    76.8532, 77.1845, 77.5158, 77.847, 78.1783, 78.5096, 78.8408, 79.1721,
          200  +    79.5034, 79.8346, 80.1659, 80.4972, 80.8284, 81.1597, 81.4909, 81.8222,
          201  +    82.1535, 82.4847, 82.816, 83.1473, 83.4785, 83.8098, 84.1411, 84.4723,
          202  +};
          203  +
          204  +local double O_500000[256] = {
          205  +    0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5,
          206  +    4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5,
          207  +    8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5,
          208  +    12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5,
          209  +    16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5,
          210  +    20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5,
          211  +    24, 24.5, 25, 25.5, 26, 26.5, 27, 27.5,
          212  +    28, 28.5, 29, 29.5, 30, 30.5, 31, 31.5,
          213  +    32, 32.5, 33, 33.5, 34, 34.5, 35, 35.5,
          214  +    36, 36.5, 37, 37.5, 38, 38.5, 39, 39.5,
          215  +    40, 40.5, 41, 41.5, 42, 42.5, 43, 43.5,
          216  +    44, 44.5, 45, 45.5, 46, 46.5, 47, 47.5,
          217  +    48, 48.5, 49, 49.5, 50, 50.5, 51, 51.5,
          218  +    52, 52.5, 53, 53.5, 54, 54.5, 55, 55.5,
          219  +    56, 56.5, 57, 57.5, 58, 58.5, 59, 59.5,
          220  +    60, 60.5, 61, 61.5, 62, 62.5, 63, 63.5,
          221  +    64, 64.5, 65, 65.5, 66, 66.5, 67, 67.5,
          222  +    68, 68.5, 69, 69.5, 70, 70.5, 71, 71.5,
          223  +    72, 72.5, 73, 73.5, 74, 74.5, 75, 75.5,
          224  +    76, 76.5, 77, 77.5, 78, 78.5, 79, 79.5,
          225  +    80, 80.5, 81, 81.5, 82, 82.5, 83, 83.5,
          226  +    84, 84.5, 85, 85.5, 86, 86.5, 87, 87.5,
          227  +    88, 88.5, 89, 89.5, 90, 90.5, 91, 91.5,
          228  +    92, 92.5, 93, 93.5, 94, 94.5, 95, 95.5,
          229  +    96, 96.5, 97, 97.5, 98, 98.5, 99, 99.5,
          230  +    100, 100.5, 101, 101.5, 102, 102.5, 103, 103.5,
          231  +    104, 104.5, 105, 105.5, 106, 106.5, 107, 107.5,
          232  +    108, 108.5, 109, 109.5, 110, 110.5, 111, 111.5,
          233  +    112, 112.5, 113, 113.5, 114, 114.5, 115, 115.5,
          234  +    116, 116.5, 117, 117.5, 118, 118.5, 119, 119.5,
          235  +    120, 120.5, 121, 121.5, 122, 122.5, 123, 123.5,
          236  +    124, 124.5, 125, 125.5, 126, 126.5, 127, 127.5,
          237  +};
          238  +
          239  +local double O_418688[256] = {
          240  +    0, 0.418688, 0.837376, 1.25606, 1.67475, 2.09344, 2.51213, 2.93082,
          241  +    3.3495, 3.76819, 4.18688, 4.60557, 5.02426, 5.44294, 5.86163, 6.28032,
          242  +    6.69901, 7.1177, 7.53638, 7.95507, 8.37376, 8.79245, 9.21114, 9.62982,
          243  +    10.0485, 10.4672, 10.8859, 11.3046, 11.7233, 12.142, 12.5606, 12.9793,
          244  +    13.398, 13.8167, 14.2354, 14.6541, 15.0728, 15.4915, 15.9101, 16.3288,
          245  +    16.7475, 17.1662, 17.5849, 18.0036, 18.4223, 18.841, 19.2596, 19.6783,
          246  +    20.097, 20.5157, 20.9344, 21.3531, 21.7718, 22.1905, 22.6092, 23.0278,
          247  +    23.4465, 23.8652, 24.2839, 24.7026, 25.1213, 25.54, 25.9587, 26.3773,
          248  +    26.796, 27.2147, 27.6334, 28.0521, 28.4708, 28.8895, 29.3082, 29.7268,
          249  +    30.1455, 30.5642, 30.9829, 31.4016, 31.8203, 32.239, 32.6577, 33.0764,
          250  +    33.495, 33.9137, 34.3324, 34.7511, 35.1698, 35.5885, 36.0072, 36.4259,
          251  +    36.8445, 37.2632, 37.6819, 38.1006, 38.5193, 38.938, 39.3567, 39.7754,
          252  +    40.194, 40.6127, 41.0314, 41.4501, 41.8688, 42.2875, 42.7062, 43.1249,
          253  +    43.5436, 43.9622, 44.3809, 44.7996, 45.2183, 45.637, 46.0557, 46.4744,
          254  +    46.8931, 47.3117, 47.7304, 48.1491, 48.5678, 48.9865, 49.4052, 49.8239,
          255  +    50.2426, 50.6612, 51.0799, 51.4986, 51.9173, 52.336, 52.7547, 53.1734,
          256  +    53.5921, 54.0108, 54.4294, 54.8481, 55.2668, 55.6855, 56.1042, 56.5229,
          257  +    56.9416, 57.3603, 57.7789, 58.1976, 58.6163, 59.035, 59.4537, 59.8724,
          258  +    60.2911, 60.7098, 61.1284, 61.5471, 61.9658, 62.3845, 62.8032, 63.2219,
          259  +    63.6406, 64.0593, 64.478, 64.8966, 65.3153, 65.734, 66.1527, 66.5714,
          260  +    66.9901, 67.4088, 67.8275, 68.2461, 68.6648, 69.0835, 69.5022, 69.9209,
          261  +    70.3396, 70.7583, 71.177, 71.5956, 72.0143, 72.433, 72.8517, 73.2704,
          262  +    73.6891, 74.1078, 74.5265, 74.9452, 75.3638, 75.7825, 76.2012, 76.6199,
          263  +    77.0386, 77.4573, 77.876, 78.2947, 78.7133, 79.132, 79.5507, 79.9694,
          264  +    80.3881, 80.8068, 81.2255, 81.6442, 82.0628, 82.4815, 82.9002, 83.3189,
          265  +    83.7376, 84.1563, 84.575, 84.9937, 85.4124, 85.831, 86.2497, 86.6684,
          266  +    87.0871, 87.5058, 87.9245, 88.3432, 88.7619, 89.1805, 89.5992, 90.0179,
          267  +    90.4366, 90.8553, 91.274, 91.6927, 92.1114, 92.53, 92.9487, 93.3674,
          268  +    93.7861, 94.2048, 94.6235, 95.0422, 95.4609, 95.8796, 96.2982, 96.7169,
          269  +    97.1356, 97.5543, 97.973, 98.3917, 98.8104, 99.2291, 99.6477, 100.066,
          270  +    100.485, 100.904, 101.322, 101.741, 102.16, 102.579, 102.997, 103.416,
          271  +    103.835, 104.253, 104.672, 105.091, 105.509, 105.928, 106.347, 106.765,
          272  +};
          273  +
          274  +local double O_081312[256] = {
          275  +    0, 0.081312, 0.162624, 0.243936, 0.325248, 0.40656, 0.487872, 0.569184,
          276  +    0.650496, 0.731808, 0.81312, 0.894432, 0.975744, 1.05706, 1.13837, 1.21968,
          277  +    1.30099, 1.3823, 1.46362, 1.54493, 1.62624, 1.70755, 1.78886, 1.87018,
          278  +    1.95149, 2.0328, 2.11411, 2.19542, 2.27674, 2.35805, 2.43936, 2.52067,
          279  +    2.60198, 2.6833, 2.76461, 2.84592, 2.92723, 3.00854, 3.08986, 3.17117,
          280  +    3.25248, 3.33379, 3.4151, 3.49642, 3.57773, 3.65904, 3.74035, 3.82166,
          281  +    3.90298, 3.98429, 4.0656, 4.14691, 4.22822, 4.30954, 4.39085, 4.47216,
          282  +    4.55347, 4.63478, 4.7161, 4.79741, 4.87872, 4.96003, 5.04134, 5.12266,
          283  +    5.20397, 5.28528, 5.36659, 5.4479, 5.52922, 5.61053, 5.69184, 5.77315,
          284  +    5.85446, 5.93578, 6.01709, 6.0984, 6.17971, 6.26102, 6.34234, 6.42365,
          285  +    6.50496, 6.58627, 6.66758, 6.7489, 6.83021, 6.91152, 6.99283, 7.07414,
          286  +    7.15546, 7.23677, 7.31808, 7.39939, 7.4807, 7.56202, 7.64333, 7.72464,
          287  +    7.80595, 7.88726, 7.96858, 8.04989, 8.1312, 8.21251, 8.29382, 8.37514,
          288  +    8.45645, 8.53776, 8.61907, 8.70038, 8.7817, 8.86301, 8.94432, 9.02563,
          289  +    9.10694, 9.18826, 9.26957, 9.35088, 9.43219, 9.5135, 9.59482, 9.67613,
          290  +    9.75744, 9.83875, 9.92006, 10.0014, 10.0827, 10.164, 10.2453, 10.3266,
          291  +    10.4079, 10.4892, 10.5706, 10.6519, 10.7332, 10.8145, 10.8958, 10.9771,
          292  +    11.0584, 11.1397, 11.2211, 11.3024, 11.3837, 11.465, 11.5463, 11.6276,
          293  +    11.7089, 11.7902, 11.8716, 11.9529, 12.0342, 12.1155, 12.1968, 12.2781,
          294  +    12.3594, 12.4407, 12.522, 12.6034, 12.6847, 12.766, 12.8473, 12.9286,
          295  +    13.0099, 13.0912, 13.1725, 13.2539, 13.3352, 13.4165, 13.4978, 13.5791,
          296  +    13.6604, 13.7417, 13.823, 13.9044, 13.9857, 14.067, 14.1483, 14.2296,
          297  +    14.3109, 14.3922, 14.4735, 14.5548, 14.6362, 14.7175, 14.7988, 14.8801,
          298  +    14.9614, 15.0427, 15.124, 15.2053, 15.2867, 15.368, 15.4493, 15.5306,
          299  +    15.6119, 15.6932, 15.7745, 15.8558, 15.9372, 16.0185, 16.0998, 16.1811,
          300  +    16.2624, 16.3437, 16.425, 16.5063, 16.5876, 16.669, 16.7503, 16.8316,
          301  +    16.9129, 16.9942, 17.0755, 17.1568, 17.2381, 17.3195, 17.4008, 17.4821,
          302  +    17.5634, 17.6447, 17.726, 17.8073, 17.8886, 17.97, 18.0513, 18.1326,
          303  +    18.2139, 18.2952, 18.3765, 18.4578, 18.5391, 18.6204, 18.7018, 18.7831,
          304  +    18.8644, 18.9457, 19.027, 19.1083, 19.1896, 19.2709, 19.3523, 19.4336,
          305  +    19.5149, 19.5962, 19.6775, 19.7588, 19.8401, 19.9214, 20.0028, 20.0841,
          306  +    20.1654, 20.2467, 20.328, 20.4093, 20.4906, 20.5719, 20.6532, 20.7346,
          307  +};
          308  +
          309  +void
          310  +convert_RGB_to_YCbCr (coeff_t ** R, coeff_t ** G, coeff_t ** B,
          311  +		      coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
          312  +		      int width, int height)
          313  +{
          314  +    int i, j;
          315  +
          316  +    assert (width > 0);
          317  +    assert (height > 0);
          318  +
          319  +    /* Perhaps one should optimize this code with integer-valued
          320  +     * look-up tables. On the other hand, the rest of the program
          321  +     * (e.g. wavelet transform, resampling etc.) still using FPU.
          322  +     * Moreover, additional rounding operation (even with proper
          323  +     * rescaling) will involve some marginal image distortion. */
          324  +    for (i = 0; i < height; i++)
          325  +      {
          326  +	  for (j = 0; j < width; j++)
          327  +	    {
          328  +		int r = (int) R[i][j];
          329  +		int g = (int) G[i][j];
          330  +		int b = (int) B[i][j];
          331  +
          332  +		Y[i][j] = O_299000[r] + O_587000[g] + O_114000[b];
          333  +		Cb[i][j] = -O_168736[r] - O_331264[g] + O_500000[b] + 128.0;
          334  +		Cr[i][j] = O_500000[r] - O_418688[g] - O_081312[b] + 128.0;
          335  +	    }
          336  +      }
          337  +}
          338  +
          339  +void
          340  +convert_YCbCr_to_RGB (coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
          341  +		      coeff_t ** R, coeff_t ** G, coeff_t ** B,
          342  +		      int width, int height)
          343  +{
          344  +    int i, j;
          345  +
          346  +    assert (width > 0);
          347  +    assert (height > 0);
          348  +
          349  +    /* Due to rounding and quantization errors output RGB values
          350  +     * may not be enclosed within [0..255] interval. To solve
          351  +     * this problem the values are clipped after transformation. */
          352  +    for (i = 0; i < height; i++)
          353  +      {
          354  +	  for (j = 0; j < width; j++)
          355  +	    {
          356  +		R[i][j] = CLIP (Y[i][j] + (Cr[i][j] - 128.0) * 1.402);
          357  +		G[i][j] =
          358  +		    CLIP (Y[i][j] - (Cb[i][j] - 128.0) * 0.34413 -
          359  +			  (Cr[i][j] - 128.0) * 0.71414);
          360  +		B[i][j] = CLIP (Y[i][j] + (Cb[i][j] - 128.0) * 1.772);
          361  +	    }
          362  +      }
          363  +}
          364  +
          365  +void
          366  +clip_channel (coeff_t ** channel, int width, int height)
          367  +{
          368  +    int i, j;
          369  +
          370  +    assert (width > 0);
          371  +    assert (height > 0);
          372  +
          373  +    for (i = 0; i < height; i++)
          374  +      {
          375  +	  for (j = 0; j < width; j++)
          376  +	    {
          377  +		channel[i][j] = CLIP (channel[i][j]);
          378  +	    }
          379  +      }
          380  +}

Added epsilon/color.h.

            1  +/*
            2  + * $Id: color.h,v 1.16 2008/03/29 21:37:06 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Color space convertion
           27  + *
           28  + *  This file contains routines for color space conversion.
           29  + *
           30  + *  \section References
           31  + *
           32  + *  International Telecommunications Union, ITU-R BT.601 */
           33  +
           34  +#ifndef __COLOR_H__
           35  +#define __COLOR_H__
           36  +
           37  +#ifdef __cplusplus
           38  +extern "C"
           39  +{
           40  +#endif
           41  +
           42  +/** \addtogroup color Color space conversion */
           43  +/*@{*/
           44  +
           45  +#include <common.h>
           46  +
           47  +/** Round value to the nearest integer */
           48  +#define ROUND(_x)               ((_x) < 0 ? (int) ((_x) - 0.5) : (int) ((_x) + 0.5))
           49  +/** Enclose value in the [0..255] interval */
           50  +#define CLIP(_x)                ((_x) < 0 ? 0 : ((_x) > 255 ? 255 : ROUND((_x))))
           51  +
           52  +/** RGB to YCbCr conversion
           53  + *
           54  + *  This function converts image from RGB to YCbCr color space.
           55  + *
           56  + *  \param R Red channel
           57  + *  \param G Green channel
           58  + *  \param B Blue channel
           59  + *  \param Y Luma channel
           60  + *  \param Cb Chroma-blue channel
           61  + *  \param Cr Chroma-red channel
           62  + *  \param width Image width
           63  + *  \param height Image height
           64  + *
           65  + *  \return \c VOID */
           66  +    void convert_RGB_to_YCbCr (coeff_t ** R, coeff_t ** G, coeff_t ** B,
           67  +			       coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
           68  +			       int width, int height);
           69  +
           70  +/** YCbCr to RGB conversion
           71  + *
           72  + *  This function converts image from YCbCr to RGB color space.
           73  + *
           74  + *  \param Y Luma channel
           75  + *  \param Cb Chroma-blue channel
           76  + *  \param Cr Chroma-red channel
           77  + *  \param R Red channel
           78  + *  \param G Green channel
           79  + *  \param B Blue channel
           80  + *  \param width Image width
           81  + *  \param height Image height
           82  + *
           83  + *  \return \c VOID
           84  + *
           85  + *  \note On return, all values are enclosed within [0..255] interval. */
           86  +    void convert_YCbCr_to_RGB (coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
           87  +			       coeff_t ** R, coeff_t ** G, coeff_t ** B,
           88  +			       int width, int height);
           89  +
           90  +/** Channel clipping
           91  + *
           92  + *  This function encloses (clips) each \a channel value within [0..255] interval
           93  + *  with appropriative rounding.
           94  + *
           95  + *  \param channel Channel to clip
           96  + *  \param width Image width
           97  + *  \param height Image height
           98  + *
           99  + *  \return \c VOID */
          100  +    void clip_channel (coeff_t ** channel, int width, int height);
          101  +
          102  +/*@}*/
          103  +
          104  +#ifdef __cplusplus
          105  +}
          106  +#endif
          107  +
          108  +#endif				/* __COLOR_H__ */

Added epsilon/common.c.

            1  +/*
            2  + * $Id: common.c,v 1.13 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +
           26  +int
           27  +number_of_bits (int value)
           28  +{
           29  +    int bits;
           30  +
           31  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 3));
           32  +    if (bits)
           33  +	return bits + 24;
           34  +
           35  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 2));
           36  +    if (bits)
           37  +	return bits + 16;
           38  +
           39  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 1));
           40  +    if (bits)
           41  +	return bits + 8;
           42  +
           43  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 0));
           44  +    if (bits)
           45  +	return bits;
           46  +
           47  +    return 0;
           48  +}
           49  +
           50  +int
           51  +is_power_of_two (int value)
           52  +{
           53  +    return (value == (1 << (number_of_bits (value) - 1)));
           54  +}

Added epsilon/common.h.

            1  +/*
            2  + * $Id: common.h,v 1.27 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Useful macro and defines
           27  + *
           28  + *  This file contains useful macro and defines which are
           29  + *  common to all library parts. */
           30  +
           31  +#ifndef __COMMON_H__
           32  +#define __COMMON_H__
           33  +
           34  +#ifdef __cplusplus
           35  +extern "C"
           36  +{
           37  +#endif
           38  +
           39  +/** \addtogroup misc Miscellanea */
           40  +/*@{*/
           41  +
           42  +#ifdef HAVE_CONFIG_H
           43  +# include <config.h>
           44  +#endif
           45  +
           46  +#include <stdlib.h>
           47  +#include <stdio.h>
           48  +#include <assert.h>
           49  +#include <sys/types.h>
           50  +
           51  +/** Maximum value */
           52  +#define MAX(_x, _y)             ((_x) > (_y) ? (_x) : (_y))
           53  +/** Minimum value */
           54  +#define MIN(_x, _y)             ((_x) < (_y) ? (_x) : (_y))
           55  +/** Absolute value */
           56  +#define ABS(_x)                 ((_x) >= 0 ? (_x) : -(_x))
           57  +/** Square root */
           58  +#define SQRT2                   1.414213562373095
           59  +/** Very helpful definition */
           60  +#define local                   static
           61  +
           62  +/** Table to speed-up number_of_bits() calculation */
           63  +    local int number_of_bits_table[256] = {
           64  +	0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
           65  +	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
           66  +	6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
           67  +	6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
           68  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           69  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           70  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           71  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           72  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           73  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           74  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           75  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           76  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           77  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           78  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           79  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           80  +    };
           81  +
           82  +/** Number of bits in a byte value */
           83  +#define NUMBER_OF_BITS(_x) (number_of_bits_table[(_x)])
           84  +/** Extract one byte from integer */
           85  +#define GET_BYTE(_x, _i) (((unsigned char *) &(_x))[(_i)])
           86  +
           87  +/** Type definition for filter coefficients */
           88  +    typedef double coeff_t;
           89  +
           90  +/** Number of bits in the value
           91  + *
           92  + *  This function computes the number of bits in the \a value
           93  + *  (e.g. number_of_bits(13) = 4).
           94  + *
           95  + *  \param value Target value
           96  + *
           97  + *  \return Number of bits */
           98  +    int number_of_bits (int value);
           99  +
          100  +/** Check whether the \a value is a power of two or not
          101  + *
          102  + *  This function checks whether the \a value is a
          103  + *  power of two or not.
          104  + *
          105  + *  \param value Target value
          106  + *
          107  + *  \return \c 1 if \a value is a power of two and \c 0 otherwise */
          108  +    int is_power_of_two (int value);
          109  +
          110  +/*@}*/
          111  +
          112  +#ifdef __cplusplus
          113  +}
          114  +#endif
          115  +
          116  +#endif /* __COMMON_H__ */

Added epsilon/daub97lift.h.

            1  +/*
            2  + * $Id: daub97lift.h,v 1.2 2008/03/29 19:57:31 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Daubechies 9/7 wavelet transform (Lifting)
           27  + *
           28  + *  This file contains lifting implementation of a famous Daubechies 9/7
           29  + *  wavelet transform. Lifting transforms are faster than generic
           30  + *  filter-based counterparts, but they lack uniformity.
           31  + *
           32  + *  \section References
           33  + *
           34  + *  <a href="http://qccpack.sourceforge.net/">QccPack, James E. Fowler</a> */
           35  +
           36  +#ifndef __DAUB97LIFT_H__
           37  +#define __DAUB97LIFT_H__
           38  +
           39  +#ifdef __cplusplus
           40  +extern "C"
           41  +{
           42  +#endif
           43  +
           44  +/** \addtogroup daub97lift Daubechies 9/7 wavelet transform (Lifting) */
           45  +/*@{*/
           46  +
           47  +#ifdef HAVE_CONFIG_H
           48  +# include <config.h>
           49  +#endif
           50  +
           51  +#include <common.h>
           52  +
           53  +/** ALPHA coefficient */
           54  +#define ALPHA     -1.58615986717275
           55  +/** BETA coefficient */
           56  +#define BETA      -0.05297864003258
           57  +/** GAMMA coefficient */
           58  +#define GAMMA      0.88293362717904
           59  +/** DELTA coefficient */
           60  +#define DELTA      0.44350482244527
           61  +/** EPSILON coefficient */
           62  +#define EPSILON    1.14960430535816
           63  +
           64  +/** One dimensional Daubechies 9/7 wavelet decomposition
           65  + *
           66  + *  This function performes one stage of 1D wavelet decomposition
           67  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
           68  + *  stored in \a signal_out. On return, the first half of \a signal_out
           69  + *  will be occupied with lowpass coefficients, the second half - with highpass
           70  + *  coefficients.
           71  + *
           72  + *  \param signal_in Input signal
           73  + *  \param signal_out Output signal
           74  + *  \param signal_length Signal length
           75  + *
           76  + *  \return \c VOID
           77  + *
           78  + *  \note \a signal_length should be even. */
           79  +    inline local void daub97lift_analysis_1D_even (coeff_t * signal_in,
           80  +						   coeff_t * signal_out,
           81  +						   int signal_length);
           82  +
           83  +/** One dimensional wavelet reconstruction
           84  + *
           85  + *  This function performes one stage of 1D wavelet reconstruction
           86  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
           87  + *  stored in \a signal_out.
           88  + *
           89  + *  \param signal_in Input signal
           90  + *  \param signal_out Output signal
           91  + *  \param signal_length Signal length
           92  + *
           93  + *  \return \c VOID
           94  + *
           95  + *  \note \a signal_length should be even. */
           96  +    inline local void daub97lift_synthesis_1D_even (coeff_t * signal_in,
           97  +						    coeff_t * signal_out,
           98  +						    int signal_length);
           99  +
          100  +/** One dimensional Daubechies 9/7 wavelet decomposition
          101  + *
          102  + *  This function performes one stage of 1D wavelet decomposition
          103  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
          104  + *  stored in \a signal_out. On return, the first half of \a signal_out
          105  + *  will be occupied with lowpass coefficients, the second half - with highpass
          106  + *  coefficients.
          107  + *
          108  + *  \param signal_in Input signal
          109  + *  \param signal_out Output signal
          110  + *  \param signal_length Signal length
          111  + *
          112  + *  \return \c VOID
          113  + *
          114  + *  \note \a signal_length should be odd, as a consequence
          115  + *  there will be one extra lowpass coefficient. */
          116  +    inline local void daub97lift_analysis_1D_odd (coeff_t * signal_in,
          117  +						  coeff_t * signal_out,
          118  +						  int signal_length);
          119  +
          120  +/** One dimensional wavelet reconstruction
          121  + *
          122  + *  This function performes one stage of 1D wavelet reconstruction
          123  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
          124  + *  stored in \a signal_out.
          125  + *
          126  + *  \param signal_in Input signal
          127  + *  \param signal_out Output signal
          128  + *  \param signal_length Signal length
          129  + *
          130  + *  \return \c VOID
          131  + *
          132  + *  \note \a signal_length should be odd. */
          133  +    inline local void daub97lift_synthesis_1D_odd (coeff_t * signal_in,
          134  +						   coeff_t * signal_out,
          135  +						   int signal_length);
          136  +
          137  +/* Those functions are placed here in order to be inline-ed */
          138  +
          139  +    inline local void daub97lift_analysis_1D_even (coeff_t * signal_in,
          140  +						   coeff_t * signal_out,
          141  +						   int signal_length)
          142  +    {
          143  +	int i;
          144  +
          145  +	for (i = 1; i < signal_length - 2; i += 2)
          146  +	  {
          147  +	      signal_in[i] += ALPHA * (signal_in[i - 1] + signal_in[i + 1]);
          148  +	  }
          149  +
          150  +	signal_in[signal_length - 1] +=
          151  +	    2 * ALPHA * signal_in[signal_length - 2];
          152  +	signal_in[0] += 2 * BETA * signal_in[1];
          153  +
          154  +	for (i = 2; i < signal_length; i += 2)
          155  +	  {
          156  +	      signal_in[i] += BETA * (signal_in[i + 1] + signal_in[i - 1]);
          157  +	  }
          158  +
          159  +	for (i = 1; i < signal_length - 2; i += 2)
          160  +	  {
          161  +	      signal_in[i] += GAMMA * (signal_in[i - 1] + signal_in[i + 1]);
          162  +	  }
          163  +
          164  +	signal_in[signal_length - 1] +=
          165  +	    2 * GAMMA * signal_in[signal_length - 2];
          166  +	signal_in[0] = EPSILON * (signal_in[0] + 2 * DELTA * signal_in[1]);
          167  +
          168  +	for (i = 2; i < signal_length; i += 2)
          169  +	  {
          170  +	      signal_in[i] =
          171  +		  EPSILON * (signal_in[i] +
          172  +			     DELTA * (signal_in[i + 1] + signal_in[i - 1]));
          173  +	  }
          174  +
          175  +	for (i = 1; i < signal_length; i += 2)
          176  +	  {
          177  +	      signal_in[i] /= (-EPSILON);
          178  +	  }
          179  +
          180  +	{
          181  +	    int half = signal_length / 2;
          182  +	    coeff_t *even = signal_out;
          183  +	    coeff_t *odd = signal_out + half;
          184  +
          185  +	    for (i = 0; i < half; i++)
          186  +	      {
          187  +		  even[i] = signal_in[i * 2];
          188  +		  odd[i] = signal_in[i * 2 + 1];
          189  +	      }
          190  +	}
          191  +    }
          192  +
          193  +    inline local void daub97lift_synthesis_1D_even (coeff_t * signal_in,
          194  +						    coeff_t * signal_out,
          195  +						    int signal_length)
          196  +    {
          197  +	int i;
          198  +
          199  +	{
          200  +	    int half = signal_length / 2;
          201  +	    coeff_t *even = signal_in;
          202  +	    coeff_t *odd = signal_in + half;
          203  +
          204  +	    for (i = 0; i < half; i++)
          205  +	      {
          206  +		  signal_out[i * 2] = even[i];
          207  +		  signal_out[i * 2 + 1] = odd[i];
          208  +	      }
          209  +	}
          210  +
          211  +	for (i = 1; i < signal_length; i += 2)
          212  +	  {
          213  +	      signal_out[i] *= (-EPSILON);
          214  +	  }
          215  +
          216  +	signal_out[0] = signal_out[0] / EPSILON - 2 * DELTA * signal_out[1];
          217  +
          218  +	for (i = 2; i < signal_length; i += 2)
          219  +	  {
          220  +	      signal_out[i] =
          221  +		  signal_out[i] / EPSILON - DELTA * (signal_out[i + 1] +
          222  +						     signal_out[i - 1]);
          223  +	  }
          224  +
          225  +	for (i = 1; i < signal_length - 2; i += 2)
          226  +	  {
          227  +	      signal_out[i] -= GAMMA * (signal_out[i - 1] + signal_out[i + 1]);
          228  +	  }
          229  +
          230  +	signal_out[signal_length - 1] -=
          231  +	    2 * GAMMA * signal_out[signal_length - 2];
          232  +	signal_out[0] -= 2 * BETA * signal_out[1];
          233  +
          234  +	for (i = 2; i < signal_length; i += 2)
          235  +	  {
          236  +	      signal_out[i] -= BETA * (signal_out[i + 1] + signal_out[i - 1]);
          237  +	  }
          238  +
          239  +	for (i = 1; i < signal_length - 2; i += 2)
          240  +	  {
          241  +	      signal_out[i] -= ALPHA * (signal_out[i - 1] + signal_out[i + 1]);
          242  +	  }
          243  +
          244  +	signal_out[signal_length - 1] -=
          245  +	    2 * ALPHA * signal_out[signal_length - 2];
          246  +    }
          247  +
          248  +    inline local void daub97lift_analysis_1D_odd (coeff_t * signal_in,
          249  +						  coeff_t * signal_out,
          250  +						  int signal_length)
          251  +    {
          252  +	int i;
          253  +
          254  +	for (i = 1; i < signal_length - 1; i += 2)
          255  +	  {
          256  +	      signal_in[i] += ALPHA * (signal_in[i - 1] + signal_in[i + 1]);
          257  +	  }
          258  +
          259  +	signal_in[0] += 2 * BETA * signal_in[1];
          260  +
          261  +	for (i = 2; i < signal_length - 2; i += 2)
          262  +	  {
          263  +	      signal_in[i] += BETA * (signal_in[i + 1] + signal_in[i - 1]);
          264  +	  }
          265  +
          266  +	signal_in[signal_length - 1] += 2 * BETA * signal_in[signal_length - 2];
          267  +
          268  +	for (i = 1; i < signal_length - 1; i += 2)
          269  +	  {
          270  +	      signal_in[i] += GAMMA * (signal_in[i - 1] + signal_in[i + 1]);
          271  +	  }
          272  +
          273  +	signal_in[0] = EPSILON * (signal_in[0] + 2 * DELTA * signal_in[1]);
          274  +
          275  +	for (i = 2; i < signal_length - 2; i += 2)
          276  +	  {
          277  +	      signal_in[i] =
          278  +		  EPSILON * (signal_in[i] +
          279  +			     DELTA * (signal_in[i + 1] + signal_in[i - 1]));
          280  +	  }
          281  +
          282  +	signal_in[signal_length - 1] = EPSILON * (signal_in[signal_length - 1] +
          283  +						  2 * DELTA *
          284  +						  signal_in[signal_length - 2]);
          285  +
          286  +	for (i = 1; i < signal_length - 1; i += 2)
          287  +	  {
          288  +	      signal_in[i] /= (-EPSILON);
          289  +	  }
          290  +
          291  +	{
          292  +	    int half = signal_length / 2 + 1;
          293  +	    coeff_t *even = signal_out;
          294  +	    coeff_t *odd = signal_out + half;
          295  +
          296  +	    for (i = 0; i < half - 1; i++)
          297  +	      {
          298  +		  even[i] = signal_in[i * 2];
          299  +		  odd[i] = signal_in[i * 2 + 1];
          300  +	      }
          301  +
          302  +	    even[half - 1] = signal_in[signal_length - 1];
          303  +	}
          304  +    }
          305  +
          306  +    inline local void daub97lift_synthesis_1D_odd (coeff_t * signal_in,
          307  +						   coeff_t * signal_out,
          308  +						   int signal_length)
          309  +    {
          310  +	int i;
          311  +
          312  +	{
          313  +	    int half = signal_length / 2 + 1;
          314  +	    coeff_t *even = signal_in;
          315  +	    coeff_t *odd = signal_in + half;
          316  +
          317  +	    for (i = 0; i < half - 1; i++)
          318  +	      {
          319  +		  signal_out[i * 2] = even[i];
          320  +		  signal_out[i * 2 + 1] = odd[i];
          321  +	      }
          322  +
          323  +	    signal_out[signal_length - 1] = even[half - 1];
          324  +	}
          325  +
          326  +	for (i = 1; i < signal_length - 1; i += 2)
          327  +	  {
          328  +	      signal_out[i] *= (-EPSILON);
          329  +	  }
          330  +
          331  +	signal_out[0] = signal_out[0] / EPSILON - 2 * DELTA * signal_out[1];
          332  +
          333  +	for (i = 2; i < signal_length - 2; i += 2)
          334  +	  {
          335  +	      signal_out[i] =
          336  +		  signal_out[i] / EPSILON - DELTA * (signal_out[i + 1] +
          337  +						     signal_out[i - 1]);
          338  +	  }
          339  +
          340  +	signal_out[signal_length - 1] =
          341  +	    signal_out[signal_length - 1] / EPSILON -
          342  +	    2 * DELTA * signal_out[signal_length - 2];
          343  +
          344  +	for (i = 1; i < signal_length - 1; i += 2)
          345  +	  {
          346  +	      signal_out[i] -= GAMMA * (signal_out[i - 1] + signal_out[i + 1]);
          347  +	  }
          348  +
          349  +	signal_out[0] -= 2 * BETA * signal_out[1];
          350  +
          351  +	for (i = 2; i < signal_length - 2; i += 2)
          352  +	  {
          353  +	      signal_out[i] -= BETA * (signal_out[i + 1] + signal_out[i - 1]);
          354  +	  }
          355  +
          356  +	signal_out[signal_length - 1] -=
          357  +	    2 * BETA * signal_out[signal_length - 2];
          358  +
          359  +	for (i = 1; i < signal_length - 1; i += 2)
          360  +	  {
          361  +	      signal_out[i] -= ALPHA * (signal_out[i - 1] + signal_out[i + 1]);
          362  +	  }
          363  +    }
          364  +
          365  +/*@}*/
          366  +
          367  +#ifdef __cplusplus
          368  +}
          369  +#endif
          370  +
          371  +#endif /* __DAUB97LIFT_H__ */

Added epsilon/dc_level.c.

            1  +/*
            2  + * $Id: dc_level.c,v 1.9 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <dc_level.h>
           26  +
           27  +coeff_t
           28  +dc_level_shift (coeff_t ** channel, int width, int height)
           29  +{
           30  +    int i, j;
           31  +    coeff_t average = 0.0;
           32  +
           33  +    for (i = 0; i < height; i++)
           34  +      {
           35  +	  for (j = 0; j < width; j++)
           36  +	    {
           37  +		average += channel[i][j];
           38  +	    }
           39  +      }
           40  +
           41  +    average = average / (width * height);
           42  +
           43  +    for (i = 0; i < height; i++)
           44  +      {
           45  +	  for (j = 0; j < width; j++)
           46  +	    {
           47  +		channel[i][j] -= average;
           48  +	    }
           49  +      }
           50  +
           51  +    return average;
           52  +}
           53  +
           54  +void
           55  +dc_level_unshift (coeff_t ** channel, coeff_t average, int width, int height)
           56  +{
           57  +    int i, j;
           58  +
           59  +    for (i = 0; i < height; i++)
           60  +      {
           61  +	  for (j = 0; j < width; j++)
           62  +	    {
           63  +		channel[i][j] += average;
           64  +	    }
           65  +      }
           66  +}

Added epsilon/dc_level.h.

            1  +/*
            2  + * $Id: dc_level.h,v 1.11 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief DC level shift
           27  + *
           28  + *  In order to further improve codec perfomance, input signal must be
           29  + *  centered around zero before applying wavelet transform. One can
           30  + *  accomplish this by subtracting mean value from each image sample.
           31  + *  This preprocessing step results in wavelet coefficient magnitude
           32  + *  decrease, which in turn, reduces number of bits required for
           33  + *  image encoding. After decoding, one have to perform the inverse
           34  + *  operation, i.e. add stored mean value to each reconstructed image sample. */
           35  +
           36  +#ifndef __DC_LEVEL_H__
           37  +#define __DC_LEVEL_H__
           38  +
           39  +#ifdef __cplusplus
           40  +extern "C"
           41  +{
           42  +#endif
           43  +
           44  +/** \addtogroup dc_level DC level shift */
           45  +/*@{*/
           46  +
           47  +#include <common.h>
           48  +
           49  +/** DC level shift
           50  + *
           51  + *  This function subtracts mean value from each image sample.
           52  + *
           53  + *  \param channel Image channel
           54  + *  \param width Image width
           55  + *  \param height Image height
           56  + *
           57  + *  \return Mean value */
           58  +    coeff_t dc_level_shift (coeff_t ** channel, int width, int height);
           59  +
           60  +/** DC level unshift
           61  + *
           62  + *  This function adds stored mean value to each
           63  + *  reconstructed image sample.
           64  + *
           65  + *  \param channel Image channel
           66  + *  \param average Average (mean) value
           67  + *  \param width Image width
           68  + *  \param height Image height
           69  + *
           70  + *  \return \c VOID */
           71  +    void dc_level_unshift (coeff_t ** channel, coeff_t average, int width,
           72  +			   int height);
           73  +
           74  +/*@}*/
           75  +
           76  +#ifdef __cplusplus
           77  +}
           78  +#endif
           79  +
           80  +#endif				/* __DC_LEVEL_H__ */

Added epsilon/epsilon.h.

            1  +/*
            2  + * $Id: epsilon.h,v 1.58 2007/07/22 15:45:02 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Top-level library interface
           27  + *
           28  + *  This file contains top-level library interface. This is the
           29  + *  only header that user program needs to include. */
           30  +
           31  +/** \mainpage EPSILON - wavelet image compression library
           32  + *
           33  + *  \section about_sec About
           34  + *
           35  + *  EPSILON is an OpenSource wavelet image compression library.
           36  + *  The library consists of several independed modules and have
           37  + *  very simple and clear layout. Each module is intensively
           38  + *  tested and carefully documented. This manual can be thought
           39  + *  as an exhaustive library API reference. It covers top-level
           40  + *  library interface as well as library internals. Being included
           41  + *  into the source code the information presented here is
           42  + *  always up to date.
           43  + *
           44  + *  \section contact_sec Contact
           45  + *
           46  + *  Feedback, bug-reports and patches are welcome.
           47  + *  Feel free to write: Alexander Simakov,
           48  + *  &lt;<a href="mailto:xander@entropyware.info">xander@entropyware.info</a>&gt;
           49  + *
           50  + *  <a href="http://epsilon-project.sourceforge.net">http://epsilon-project.sourceforge.net</a><br> */
           51  +
           52  +#ifndef __EPSILON_H__
           53  +#define __EPSILON_H__
           54  +
           55  +#ifdef __cplusplus
           56  +extern "C"
           57  +{
           58  +#endif
           59  +
           60  +#include <inttypes.h>
           61  +
           62  +/** \addtogroup toplevel Top-level library interface */
           63  +/*@{*/
           64  +
           65  +/** Block marker
           66  + *
           67  + *  Each block in the stream should be terminated
           68  + *  with one or more \ref EPS_MARKER values. This
           69  + *  technique greatly improves overall system
           70  + *  robustness and leads to quick stream
           71  + *  resynchronization. */
           72  +#define EPS_MARKER              0x00
           73  +
           74  +/** GRAYSCALE block
           75  + *
           76  + *  This type of blocks is intended for storing grayscale
           77  + *  image data. */
           78  +#define EPS_GRAYSCALE_BLOCK     1
           79  +
           80  +/** TRUECOLOR block
           81  + *
           82  + *  This type of blocks is intended for storing truecolor
           83  + *  image data. */
           84  +#define EPS_TRUECOLOR_BLOCK     2
           85  +
           86  +/** Maximal (recomended) block width and height */
           87  +#define EPS_MAX_BLOCK_SIZE       1024
           88  +/** Minimal (recomended) block width and height */
           89  +#define EPS_MIN_BLOCK_SIZE       32
           90  +
           91  +/** Minimal (mandatory) buffer size for GRAYSCALE block */
           92  +#define EPS_MIN_GRAYSCALE_BUF   256
           93  +/** Maximal (recomended) buffer size for GRAYSCALE block */
           94  +#define EPS_MAX_GRAYSCALE_BUF   2 * EPS_MAX_BLOCK_SIZE * EPS_MAX_BLOCK_SIZE
           95  +/** Minimal (mandatory) buffer size for TRUECOLOR block */
           96  +#define EPS_MIN_TRUECOLOR_BUF   256
           97  +/** Maximal (recomended) buffer size for TRUECOLOR block */
           98  +#define EPS_MAX_TRUECOLOR_BUF   6 * EPS_MAX_BLOCK_SIZE * EPS_MAX_BLOCK_SIZE
           99  +
          100  +/** Normal mode
          101  + *
          102  + *  This mode assumes that image is square and height = width = 2 ^ N. */
          103  +#define EPS_MODE_NORMAL         0
          104  +
          105  +/** OTLPF mode
          106  + *
          107  + *  This mode also assumes that image is square, but height = width = (2 ^ N) + 1.
          108  + *  In a few words, OTLPF is some kind of hack to reduce boundary artefacts
          109  + *  when image is broken into several tiles. Due to mathematical constrains
          110  + *  this method can be applied to biorthogonal filters only. */
          111  +#define EPS_MODE_OTLPF          1
          112  +
          113  +/** Data or header CRC is correct */
          114  +#define EPS_GOOD_CRC            0
          115  +/** Data or header CRC is incorrect */
          116  +#define EPS_BAD_CRC             1
          117  +
          118  +/** Extract all filterbank IDs */
          119  +#define EPS_FB_ID               0
          120  +/** Extract all filterbank names */
          121  +#define EPS_FB_NAME             1
          122  +/** Extract all filterbank orthogonality types */
          123  +#define EPS_FB_TYPE             2
          124  +
          125  +/** Default bit-budget percent for the Y channel */
          126  +#define EPS_Y_RT                90
          127  +/** Default bit-budget percent for the Cb channel */
          128  +#define EPS_Cb_RT               5
          129  +/** Default bit-budget percent for the Cr channel */
          130  +#define EPS_Cr_RT               5
          131  +
          132  +/** Minimal value for bit-budget percent value */
          133  +#define EPS_MIN_RT              1
          134  +/** Maximal value for bit-budget percent value */
          135  +#define EPS_MAX_RT              98
          136  +
          137  +/** Perform no image resampling */
          138  +#define EPS_RESAMPLE_444        0
          139  +/** Resample image according to the 4:2:0 scheme */
          140  +#define EPS_RESAMPLE_420        1
          141  +
          142  +/** Successful operation */
          143  +#define EPS_OK                  0
          144  +/** Incorrect function parameter */
          145  +#define EPS_PARAM_ERROR         1
          146  +/** Incorrect data format */
          147  +#define EPS_FORMAT_ERROR        2
          148  +/** Specified filterbank is not supported */
          149  +#define EPS_UNSUPPORTED_FB      3
          150  +
          151  +/** Type definition for CRC32 value */
          152  +    typedef uint32_t crc32_t;
          153  +
          154  +/** GRAYSCALE block header */
          155  +    typedef struct gs_hdr_tag
          156  +    {
          157  +    /** Image width */
          158  +	int W;
          159  +    /** Image height */
          160  +	int H;
          161  +    /** Block width */
          162  +	int w;
          163  +    /** Block height */
          164  +	int h;
          165  +    /** Block X coordinate */
          166  +	int x;
          167  +    /** Block Y coordinate */
          168  +	int y;
          169  +    /** Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF */
          170  +	int mode;
          171  +    /** DC value */
          172  +	int dc;
          173  +    /** Filterbank ID (should not be modified or released) */
          174  +	char *fb_id;
          175  +    } gs_hdr;
          176  +
          177  +/** TRUECOLOR block header */
          178  +    typedef struct tc_hdr_tag
          179  +    {
          180  +    /** Image width */
          181  +	int W;
          182  +    /** Image height */
          183  +	int H;
          184  +    /** Block width */
          185  +	int w;
          186  +    /** Block height */
          187  +	int h;
          188  +    /** Block X coordinate */
          189  +	int x;
          190  +    /** Block Y coordinate */
          191  +	int y;
          192  +    /** Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF */
          193  +	int mode;
          194  +    /** Either \ref EPS_RESAMPLE_444 or \ref EPS_RESAMPLE_420 */
          195  +	int resample;
          196  +    /** DC value of the Y channel */
          197  +	int dc_Y;
          198  +    /** DC value of the Cb channel */
          199  +	int dc_Cb;
          200  +    /** DC value of the Cr channel */
          201  +	int dc_Cr;
          202  +    /** Initial ratio of the Y channel */
          203  +	int Y_rt;
          204  +    /** Initial ratio of the Cb channel */
          205  +	int Cb_rt;
          206  +    /** Initial ratio of the Cr channel */
          207  +	int Cr_rt;
          208  +    /** Filterbank ID (should not be modified or released) */
          209  +	char *fb_id;
          210  +    } tc_hdr;
          211  +
          212  +/** Generic block header */
          213  +    typedef struct eps_block_header_tag
          214  +    {
          215  +    /** Block type
          216  +     *
          217  +     *  Either \ref EPS_GRAYSCALE_BLOCK or \ref EPS_TRUECOLOR_BLOCK. */
          218  +	int block_type;
          219  +
          220  +    /** Header size in bytes */
          221  +	int hdr_size;
          222  +    /** Data size in bytes */
          223  +	int data_size;
          224  +
          225  +    /** Header CRC */
          226  +	crc32_t chk;
          227  +    /** Data CRC */
          228  +	crc32_t crc;
          229  +
          230  +    /** Header CRC flag
          231  +     *
          232  +     *  Either \ref EPS_GOOD_CRC or \ref EPS_BAD_CRC */
          233  +	int chk_flag;
          234  +    /** Data CRC flag
          235  +     *
          236  +     *  Either \ref EPS_GOOD_CRC or \ref EPS_BAD_CRC */
          237  +	int crc_flag;
          238  +
          239  +	union
          240  +	{
          241  +	/** Special information for GRAYSCALE blocks */
          242  +	    gs_hdr gs;
          243  +	/** Special information for TRUECOLOR blocks */
          244  +	    tc_hdr tc;
          245  +	} uhdr;
          246  +    } eps_block_header;
          247  +
          248  +/** Query available filterbanks
          249  + *
          250  + *  Depending on the \a type parameter this function
          251  + *  composes a \c NULL terminated list of all available
          252  + *  filterbank IDs, names or orthogonality types.
          253  + *
          254  + *  \note The caller should subsequently release allocated list
          255  + *  (using \ref eps_free_fb_info function) when it is no longer
          256  + *  required.
          257  + *
          258  + *  \note The caller should not modify allocated structure.
          259  +
          260  + *  \param type Type of information: either \ref EPS_FB_ID or
          261  + *  \ref EPS_FB_NAME or \ref EPS_FB_TYPE
          262  + *
          263  + *  \return List of strings */
          264  +    char **eps_get_fb_info (int type);
          265  +
          266  +/** Release filterbank information
          267  + *
          268  + *  This function releases filterbank infomation,
          269  + *  allocated by the \ref eps_get_fb_info function.
          270  + *
          271  + *  \param info List of strings
          272  + *
          273  + *  \return \c VOID */
          274  +    void eps_free_fb_info (char **info);
          275  +
          276  +/** Memory allocation
          277  + *
          278  + *  This function allocates one-dimensional array of desired size.
          279  + *
          280  + *  \param size Size in bytes
          281  + *
          282  + *  \return Array pointer
          283  + *
          284  + *  \warning This function halts the program if all virtual memory
          285  + *  is exhausted. */
          286  +    void **eps_xmalloc (int size);
          287  +
          288  +/** 2D-malloc
          289  + *
          290  + *  This function allocates two-dimensional array of desired size.
          291  + *
          292  + *  \param width Array width
          293  + *  \param height Array height
          294  + *  \param size Element size
          295  + *
          296  + *  \return Array pointer
          297  + *
          298  + *  \warning This function halts the program if all virtual memory
          299  + *  is exhausted. */
          300  +    void **eps_malloc_2D (int width, int height, int size);
          301  +
          302  +/** 2D-free
          303  + *
          304  + *  This function releases two-dimensional array allocated by \ref eps_malloc_2D.
          305  + *
          306  + *  \param ptr Array pointer
          307  + *  \param width Array width
          308  + *  \param height Array height
          309  + *
          310  + *  \return \c VOID */
          311  +    void eps_free_2D (void **ptr, int width, int height);
          312  +
          313  +/** Read block header
          314  + *
          315  + *  This function performes a broad range of tasks:
          316  + *
          317  + *  <ul>
          318  + *  <li>Read and parse block header</li>
          319  + *  <li>Check header consistency</li>
          320  + *  <li>Check header and data CRC</li>
          321  + *  <li>Fill special \ref eps_block_header structure with
          322  + *  gathered information (it is worthwhile to mention that
          323  + *  all decoding functions in the library rely on this
          324  + *  structure)</li>
          325  + *  </ul>
          326  + *
          327  + *  The \ref eps_block_header structure consists of two parts:
          328  + *  general part and special part. The first one holds information
          329  + *  that is common for all block types. The second one holds
          330  + *  information that is specific for a particular block type.
          331  + *
          332  + *  \note The data buffer \a buf should hold \b whole block
          333  + *  without markers.
          334  + *
          335  + *  \param buf Data buffer
          336  + *  \param buf_size Buffer size
          337  + *  \param hdr Block header
          338  + *
          339  + *  \return The function returns either \ref EPS_OK (the header
          340  + *  is well-formed, the \a hdr structure is filled appropriately)
          341  + *  or \ref EPS_PARAM_ERROR (your should not get this error
          342  + *  unless you pass a \c NULL pointer, negative buffer size or
          343  + *  something like that) or \ref EPS_FORMAT_ERROR (the header is
          344  + *  malformed, block should be ignored). */
          345  +    int eps_read_block_header (unsigned char *buf, int buf_size,
          346  +			       eps_block_header * hdr);
          347  +
          348  +/** Encode a GRAYSCALE block
          349  + *
          350  + *  This function encodes a signle grayscale image \a block of
          351  + *  size \a w by \a h pixels as block of type \ref EPS_GRAYSCALE_BLOCK.
          352  + *  It is assumed that the \a block is taken from the image of size
          353  + *  \a W by \a H pixels at position (\a x, \a y). All these parameters
          354  + *  should be consistent. The encoded data is stored in the \a buf
          355  + *  of size \a buf_size.
          356  + *
          357  + *  \note The most surprising thing here is that you can choose almost
          358  + *  any (see note below) \a buf_size you wish! Thus you can precisely
          359  + *  control encoding bit-rate. This technique is called embedded coding.
          360  + *  In a few words, any encoded prefix can be used to decode a whole
          361  + *  image. So, you can safely truncate stream at any point.
          362  + *
          363  + *  \note The caller should allocate at least \ref EPS_MIN_GRAYSCALE_BUF
          364  + *  bytes for the \a buf.
          365  + *
          366  + *  \note On successful return, the value pointed by the \a buf_size
          367  + *  will be overwritten with a real amount of bytes used in the
          368  + *  \a buf (it will be less then or equal to the original \a buf_size
          369  + *  value).
          370  + *
          371  + *  \note Depending on the \a mode parameter maximal \a block
          372  + *  width or height is either \ref EPS_MAX_BLOCK_SIZE (if \a mode =
          373  + *  \ref EPS_MODE_NORMAL) or \ref EPS_MAX_BLOCK_SIZE + 1
          374  + *  (if \a mode = \ref EPS_MODE_OTLPF).
          375  + *
          376  + *  \note There is no restrictions on the image size itself.
          377  + *
          378  + *  \note The caller should select a value for the \a fb_id
          379  + *  parameter from the list generated by the \ref eps_get_fb_info
          380  + *  function.
          381  + *
          382  + *  \note The caller should not use orthogonal filterbanks
          383  + *  with \a mode = \ref EPS_MODE_OTLPF. Orthogonality type
          384  + *  can be queried with the \ref eps_get_fb_info function.
          385  + *
          386  + *  \param block Image block
          387  + *  \param W Image width
          388  + *  \param H Image height
          389  + *  \param w Block width
          390  + *  \param h Block height
          391  + *  \param x Block X coordinate
          392  + *  \param y Block Y coordinate
          393  + *  \param buf Buffer
          394  + *  \param buf_size Buffer size
          395  + *  \param fb_id Filterbank ID
          396  + *  \param mode Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF
          397  + *
          398  + *  \return The function returns either \ref EPS_OK (the block is
          399  + *  successfully encoded), or \ref EPS_PARAM_ERROR (one or more
          400  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank with
          401  + *  specified \a fb_id not found). */
          402  +    int eps_encode_grayscale_block (unsigned char **block, int W, int H, int w,
          403  +				    int h, int x, int y, unsigned char *buf,
          404  +				    int *buf_size, char *fb_id, int mode);
          405  +
          406  +/** Decode a GRAYSCALE block
          407  + *
          408  + *  This function decodes a GRAYSCALE image \a block from
          409  + *  the \a buf. Block and image dimensions as well as other
          410  + *  necessary information is taken from the \a hdr structure
          411  + *  filled by the \ref eps_read_block_header function
          412  + *  beforehand.
          413  + *
          414  + *  \note The caller should not invoke this function if the \a buf
          415  + *  contains no data, i.e. \ref eps_block_header::data_size = 0.
          416  + *
          417  + *  \note The caller should allocate an image \a block
          418  + *  beforehand. Block dimensions as well as other information
          419  + *  is available in the \a hdr structure.
          420  + *
          421  + *  \param block Image block
          422  + *  \param buf Buffer
          423  + *  \param hdr Block header
          424  + *
          425  + *  \return The function returns either \ref EPS_OK (the block is
          426  + *  successfully decoded), or \ref EPS_PARAM_ERROR (one or more
          427  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank
          428  + *  used by encoder not found). */
          429  +    int eps_decode_grayscale_block (unsigned char **block, unsigned char *buf,
          430  +				    eps_block_header * hdr);
          431  +
          432  +/** Encode a TRUECOLOR block
          433  + *
          434  + *  This function encodes a generic RGB truecolor image block.
          435  + *  The original RGB data is arranged in three arrays: \a block_R,
          436  + *  \a block_G and \a block_B respectively. All components should
          437  + *  have equal dimensions: \a w by \a h pixels. It is assumed that
          438  + *  the block is taken from the image of size \a W by \a H pixels
          439  + *  at position (\a x, \a y). All these parameters should be
          440  + *  consistent. The encoded data is stored in the \a buf of size
          441  + *  \a buf_size.
          442  + *
          443  + *  \note The most surprising thing here is that you can choose almost
          444  + *  any (see note below) \a buf_size you wish! Thus you can precisely
          445  + *  control encoding bit-rate. This technique is called embedded coding.
          446  + *  In a few words, any encoded prefix can be used to decode a whole
          447  + *  image. So, you can safely truncate stream at any point.
          448  + *
          449  + *  \note The caller should allocate at least \ref EPS_MIN_TRUECOLOR_BUF
          450  + *  bytes for the \a buf.
          451  + *
          452  + *  \note The overall bit-budget available for the encoder is
          453  + *  \a buf_size bytes. The caller should divide it between
          454  + *  three channels (Y, Cb, Cr) using the following parameters:
          455  + *  \a Y_rt, \a Cb_rt and \a Cr_rt. The function will report an
          456  + *  error unless  \a Y_rt + \a Cb_rt + \a Cr_rt equals to 100%.
          457  + *  If no matter you can use default values: \ref EPS_Y_RT,
          458  + *  \ref EPS_Cb_RT and \ref EPS_Cr_RT.
          459  + *
          460  + *  \note On successful return, the value pointed by the \a buf_size
          461  + *  will be overwritten with a real amount of bytes used in the
          462  + *  \a buf (it will be less then or equal to the original \a buf_size
          463  + *  value).
          464  + *
          465  + *  \note Depending on the \a mode parameter maximal block
          466  + *  width or height is either \ref EPS_MAX_BLOCK_SIZE (if \a mode =
          467  + *  \ref EPS_MODE_NORMAL) or \ref EPS_MAX_BLOCK_SIZE + 1
          468  + *  (if \a mode = \ref EPS_MODE_OTLPF).
          469  + *
          470  + *  \note There is no restrictions on the image size itself.
          471  + *
          472  + *  \note The caller should select a value for the \a fb_id
          473  + *  parameter from the list generated by the \ref eps_get_fb_info
          474  + *  function.
          475  + *
          476  + *  \note The caller should not use orthogonal filterbanks
          477  + *  with \a mode = \ref EPS_MODE_OTLPF. Orthogonality type
          478  + *  can be queried with the \ref eps_get_fb_info function.
          479  + *
          480  + *  \param block_R Red component
          481  + *  \param block_G Green component
          482  + *  \param block_B Blue component
          483  + *  \param W Image width
          484  + *  \param H Image height
          485  + *  \param w Block width
          486  + *  \param h Block height
          487  + *  \param x Block X coordinate
          488  + *  \param y Block Y coordinate
          489  + *  \param resample Resampling scheme: either \ref EPS_RESAMPLE_444 or \ref EPS_RESAMPLE_420
          490  + *  \param buf Buffer
          491  + *  \param buf_size Buffer size
          492  + *  \param Y_rt Bit-budget percent for the Y channel
          493  + *  \param Cb_rt Bit-budget percent for the Cb channel
          494  + *  \param Cr_rt Bit-budget percent for the Cr channel
          495  + *  \param fb_id Filterbank ID
          496  + *  \param mode Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF
          497  + *
          498  + *  \return The function returns either \ref EPS_OK (the block is
          499  + *  successfully encoded), or \ref EPS_PARAM_ERROR (one or more
          500  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank
          501  + *  with specified \a fb_id not found). */
          502  +    int eps_encode_truecolor_block (unsigned char **block_R,
          503  +				    unsigned char **block_G,
          504  +				    unsigned char **block_B,
          505  +				    int W, int H, int w, int h,
          506  +				    int x, int y, int resample,
          507  +				    unsigned char *buf, int *buf_size,
          508  +				    int Y_rt, int Cb_rt, int Cr_rt,
          509  +				    char *fb_id, int mode);
          510  +
          511  +/** Decode a TRUECOLOR block
          512  + *
          513  + *  This function decodes a TRUECOLOR image block from
          514  + *  the \a buf. The resulted RGB data will be stored in the
          515  + *  \a block_R, \a block_G, and \a block_B arrays
          516  + *  respectively. Block and image dimensions as well as
          517  + *  other necessary information is taken from the \a hdr
          518  + *  structure filled by the \ref eps_read_block_header
          519  + *  function beforehand.
          520  + *
          521  + *  \note The caller should not invoke this function if the \a buf
          522  + *  contains no data, i.e. \ref eps_block_header::data_size = 0.
          523  + *
          524  + *  \note The caller should allocate \a block_R, \a block_G,
          525  + *  and \a block_B arrays beforehand. Block dimensions as well
          526  + *  as other information is available in the \a hdr structure.
          527  + *
          528  + *  \param block_R Red component
          529  + *  \param block_G Green component
          530  + *  \param block_B Blue component
          531  + *  \param buf Buffer
          532  + *  \param hdr Block header
          533  + *
          534  + *  \return The function returns either \ref EPS_OK (the block is
          535  + *  successfully decoded), or \ref EPS_PARAM_ERROR (one or more
          536  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank
          537  + *  used by encoder not found) or \ref EPS_FORMAT_ERROR
          538  + *  (unsupported data format). */
          539  +    int eps_decode_truecolor_block (unsigned char **block_R,
          540  +				    unsigned char **block_G,
          541  +				    unsigned char **block_B,
          542  +				    unsigned char *buf, eps_block_header * hdr);
          543  +
          544  +/** Truncate block
          545  + *
          546  + *  This function truncates already encoded GRAYSCALE
          547  + *  or TRUECOLOR block. Due to embedded encoding
          548  + *  truncation is equivalent to block re-compression.
          549  + *
          550  + *  \param buf_in Input buffer
          551  + *  \param buf_out Output buffer
          552  + *  \param hdr Block header
          553  + *  \param truncate_size Desired truncated block size
          554  + *
          555  + *  \note On successful return, the value pointed by the
          556  + *  \a truncate_size parameter will be overwritten with a
          557  + *  real amount of bytes used in the \a buf_out (it will
          558  + *  be less then or equal to the original \a truncate_size value).
          559  + *
          560  + *  \note Minimal value for the \a truncate_size parameter can be
          561  + *  calculated as MAX(\ref EPS_MIN_GRAYSCALE_BUF, \ref EPS_MIN_TRUECOLOR_BUF).
          562  + *
          563  + *  \return The function returns either \ref EPS_OK (the block is
          564  + *  successfully truncated), or \ref EPS_PARAM_ERROR (one or more
          565  + *  parameters are incorrect). */
          566  +    int eps_truncate_block (unsigned char *buf_in, unsigned char *buf_out,
          567  +			    eps_block_header * hdr, int *truncate_size);
          568  +
          569  +/*@}*/
          570  +
          571  +#ifdef __cplusplus
          572  +}
          573  +#endif
          574  +
          575  +#endif				/* __EPSILON_H__ */

Added epsilon/filter.c.

            1  +/*
            2  + * $Id: filter.c,v 1.18 2008/03/30 07:38:53 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <filter.h>
           26  +#include <filterbank.h>
           27  +#include <daub97lift.h>
           28  +#include <mem_alloc.h>
           29  +#include <string.h>
           30  +
           31  +inline local int
           32  +periodic_extension (int index, int length)
           33  +{
           34  +    if (index >= 0)
           35  +      {
           36  +	  if (index < length)
           37  +	    {
           38  +		return index;
           39  +	    }
           40  +	  else
           41  +	    {
           42  +		return (index % length);
           43  +	    }
           44  +      }
           45  +    else
           46  +      {
           47  +	  return (length - 1 - (ABS (index) - 1) % length);
           48  +      }
           49  +}
           50  +
           51  +inline local int
           52  +symmetric_W_extension (int index, int length)
           53  +{
           54  +    if ((index >= 0) && (index < length))
           55  +      {
           56  +	  return index;
           57  +      }
           58  +
           59  +    if (length == 1)
           60  +      {
           61  +	  return 0;
           62  +      }
           63  +
           64  +    index = ABS (index) % (2 * length - 2);
           65  +
           66  +    if (index >= length)
           67  +      {
           68  +	  index = 2 * length - 2 - index;
           69  +      }
           70  +
           71  +    return index;
           72  +}
           73  +
           74  +inline local int
           75  +symmetric_H_extension (int index, int length)
           76  +{
           77  +    if ((index >= 0) && (index < length))
           78  +      {
           79  +	  return index;
           80  +      }
           81  +
           82  +    if (length == 1)
           83  +      {
           84  +	  return 0;
           85  +      }
           86  +
           87  +    index = (ABS (index) - (index < 0)) % (2 * length);
           88  +
           89  +    if (index >= length)
           90  +      {
           91  +	  index = 2 * length - index - 1;
           92  +      }
           93  +
           94  +    return index;
           95  +}
           96  +
           97  +inline local void
           98  +downsample_signal (coeff_t * input_signal, coeff_t * output_signal,
           99  +		   int input_length, int output_length, int phase)
          100  +{
          101  +    int i, j;
          102  +
          103  +    for (i = phase, j = 0; i < input_length; i += 2, j++)
          104  +      {
          105  +	  output_signal[j] = input_signal[i];
          106  +      }
          107  +}
          108  +
          109  +inline local void
          110  +upsample_signal (coeff_t * input_signal, coeff_t * output_signal,
          111  +		 int input_length, int output_length, int phase)
          112  +{
          113  +    int i, j, k;
          114  +
          115  +    for (i = 0, j = phase; i < input_length; i++, j += 2)
          116  +      {
          117  +	  output_signal[j] = input_signal[i];
          118  +      }
          119  +
          120  +    for (k = phase ^ 1; k < output_length; k += 2)
          121  +      {
          122  +	  output_signal[k] = 0;
          123  +      }
          124  +}
          125  +
          126  +inline local void
          127  +filter_periodic (coeff_t * input_signal, coeff_t * output_signal,
          128  +		 int signal_length, filter_t * filter)
          129  +{
          130  +    int i, j, k;
          131  +
          132  +    switch (filter->causality)
          133  +      {
          134  +      case CAUSAL:
          135  +	  {
          136  +	      for (i = 0; i < signal_length; i += 1)
          137  +		{
          138  +		    output_signal[i] = 0;
          139  +		    for (j = 0; j < filter->length; j++)
          140  +		      {
          141  +			  k = periodic_extension (i - j, signal_length);
          142  +			  output_signal[i] +=
          143  +			      input_signal[k] * filter->coeffs[j];
          144  +		      }
          145  +		}
          146  +
          147  +	      break;
          148  +	  }
          149  +      case ANTICAUSAL:
          150  +	  {
          151  +	      for (i = 0; i < signal_length; i += 2)
          152  +		{
          153  +		    output_signal[i] = 0;
          154  +		    for (j = 0; j < filter->length; j++)
          155  +		      {
          156  +			  k = periodic_extension (i + j, signal_length);
          157  +			  output_signal[i] +=
          158  +			      input_signal[k] * filter->coeffs[filter->length -
          159  +							       j - 1];
          160  +		      }
          161  +		}
          162  +
          163  +	      break;
          164  +	  }
          165  +      default:
          166  +	  {
          167  +	      assert (0);
          168  +	      break;
          169  +	  }
          170  +      }
          171  +}
          172  +
          173  +inline local void
          174  +filter_symmetric (coeff_t * input_signal, coeff_t * output_signal,
          175  +		  int signal_length, filter_t * filter)
          176  +{
          177  +    int i, j, k1, k2;
          178  +
          179  +    switch (filter->causality)
          180  +      {
          181  +      case SYMMETRIC_WHOLE:
          182  +	  {
          183  +	      if (filter->type == LOWPASS_ANALYSIS)
          184  +		{
          185  +		    for (i = 0; i < signal_length; i += 2)
          186  +		      {
          187  +			  output_signal[i] =
          188  +			      input_signal[i] * filter->coeffs[0];
          189  +			  for (j = 1; j < filter->length; j++)
          190  +			    {
          191  +				k1 = symmetric_W_extension (i + j,
          192  +							    signal_length);
          193  +				k2 = symmetric_W_extension (i - j,
          194  +							    signal_length);
          195  +				output_signal[i] +=
          196  +				    (input_signal[k1] +
          197  +				     input_signal[k2]) * filter->coeffs[j];
          198  +			    }
          199  +		      }
          200  +		}
          201  +	      else if (filter->type == HIGHPASS_ANALYSIS)
          202  +		{
          203  +		    for (i = 1; i < signal_length; i += 2)
          204  +		      {
          205  +			  output_signal[i] =
          206  +			      input_signal[i] * filter->coeffs[0];
          207  +			  for (j = 1; j < filter->length; j++)
          208  +			    {
          209  +				k1 = symmetric_W_extension (i + j,
          210  +							    signal_length);
          211  +				k2 = symmetric_W_extension (i - j,
          212  +							    signal_length);
          213  +				output_signal[i] +=
          214  +				    (input_signal[k1] +
          215  +				     input_signal[k2]) * filter->coeffs[j];
          216  +			    }
          217  +		      }
          218  +		}
          219  +	      else
          220  +		{
          221  +		    for (i = 0; i < signal_length; i++)
          222  +		      {
          223  +			  output_signal[i] =
          224  +			      input_signal[i] * filter->coeffs[0];
          225  +			  for (j = 1; j < filter->length; j++)
          226  +			    {
          227  +				k1 = symmetric_W_extension (i + j,
          228  +							    signal_length);
          229  +				k2 = symmetric_W_extension (i - j,
          230  +							    signal_length);
          231  +				output_signal[i] +=
          232  +				    (input_signal[k1] +
          233  +				     input_signal[k2]) * filter->coeffs[j];
          234  +			    }
          235  +		      }
          236  +		}
          237  +
          238  +	      break;
          239  +	  }
          240  +	  /* Some day I hope to add 'case SYMMETRIC_HALF' here */
          241  +      default:
          242  +	  {
          243  +	      assert (0);
          244  +	      break;
          245  +	  }
          246  +      }
          247  +}
          248  +
          249  +local void
          250  +analysis_1D (coeff_t * input_signal, coeff_t * output_signal,
          251  +	     coeff_t * temp, int signal_length, filterbank_t * fb)
          252  +{
          253  +    coeff_t *lowpass;
          254  +    coeff_t *highpass;
          255  +
          256  +    /* Sanity checks */
          257  +    assert (signal_length > 0);
          258  +    assert ((fb->type == BIORTHOGONAL) || ((fb->type == ORTHOGONAL)
          259  +					   && !(signal_length & 1)));
          260  +
          261  +    /* Trivial case */
          262  +    if (signal_length == 1)
          263  +      {
          264  +	  output_signal[0] = input_signal[0] * SQRT2;
          265  +	  return;
          266  +      }
          267  +
          268  +    if (fb->type == ORTHOGONAL)
          269  +      {
          270  +	  lowpass = output_signal;
          271  +	  highpass = output_signal + signal_length / 2;
          272  +
          273  +	  /* Lowpass analysis */
          274  +	  filter_periodic (input_signal, temp, signal_length,
          275  +			   fb->lowpass_analysis);
          276  +	  downsample_signal (temp, lowpass, signal_length, signal_length / 2,
          277  +			     PHASE_EVEN);
          278  +
          279  +	  /* Highpass analysis */
          280  +	  filter_periodic (input_signal, temp, signal_length,
          281  +			   fb->highpass_analysis);
          282  +	  downsample_signal (temp, highpass, signal_length, signal_length / 2,
          283  +			     PHASE_EVEN);
          284  +      }
          285  +    else
          286  +      {
          287  +	  lowpass = output_signal;
          288  +	  highpass = output_signal + signal_length / 2 + (signal_length & 1);
          289  +
          290  +	  /* Lowpass analysis */
          291  +	  filter_symmetric (input_signal, temp, signal_length,
          292  +			    fb->lowpass_analysis);
          293  +	  downsample_signal (temp, lowpass, signal_length,
          294  +			     (signal_length + 1) / 2, PHASE_EVEN);
          295  +
          296  +	  /* Highpass analysis */
          297  +	  filter_symmetric (input_signal, temp, signal_length,
          298  +			    fb->highpass_analysis);
          299  +	  downsample_signal (temp, highpass, signal_length, signal_length / 2,
          300  +			     PHASE_ODD);
          301  +      }
          302  +}
          303  +
          304  +local void
          305  +synthesis_1D (coeff_t * input_signal, coeff_t * output_signal,
          306  +	      coeff_t * temp1, coeff_t * temp2, coeff_t * temp3,
          307  +	      int signal_length, filterbank_t * fb)
          308  +{
          309  +    coeff_t *lowpass;
          310  +    coeff_t *highpass;
          311  +    int i;
          312  +
          313  +    /* Sanity checks */
          314  +    assert (signal_length > 0);
          315  +    assert ((fb->type == BIORTHOGONAL) || ((fb->type == ORTHOGONAL)
          316  +					   && !(signal_length & 1)));
          317  +
          318  +    /* Trivial case */
          319  +    if (signal_length == 1)
          320  +      {
          321  +	  output_signal[0] = input_signal[0] / SQRT2;
          322  +	  return;
          323  +      }
          324  +
          325  +    if (fb->type == ORTHOGONAL)
          326  +      {
          327  +	  lowpass = input_signal;
          328  +	  highpass = input_signal + signal_length / 2;
          329  +
          330  +	  /* Lowpass synthesis */
          331  +	  upsample_signal (lowpass, temp1, signal_length / 2, signal_length,
          332  +			   PHASE_EVEN);
          333  +	  filter_periodic (temp1, temp2, signal_length, fb->lowpass_synthesis);
          334  +
          335  +	  /* Highpass synthesis */
          336  +	  upsample_signal (highpass, temp1, signal_length / 2, signal_length,
          337  +			   PHASE_EVEN);
          338  +	  filter_periodic (temp1, temp3, signal_length, fb->highpass_synthesis);
          339  +      }
          340  +    else
          341  +      {
          342  +	  lowpass = input_signal;
          343  +	  highpass = input_signal + signal_length / 2 + (signal_length & 1);
          344  +
          345  +	  /* Lowpass synthesis */
          346  +	  upsample_signal (lowpass, temp1, (signal_length + 1) / 2,
          347  +			   signal_length, PHASE_EVEN);
          348  +	  filter_symmetric (temp1, temp2, signal_length, fb->lowpass_synthesis);
          349  +
          350  +	  /* Highpass synthesis */
          351  +	  upsample_signal (highpass, temp1, signal_length / 2, signal_length,
          352  +			   PHASE_ODD);
          353  +	  filter_symmetric (temp1, temp3, signal_length,
          354  +			    fb->highpass_synthesis);
          355  +      }
          356  +
          357  +    /* Combine arrays */
          358  +    for (i = 0; i < signal_length; i++)
          359  +      {
          360  +	  output_signal[i] = temp2[i] + temp3[i];
          361  +      }
          362  +}
          363  +
          364  +void
          365  +analysis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          366  +	     int signal_length, int mode, filterbank_t * fb)
          367  +{
          368  +    coeff_t *input;
          369  +    coeff_t *output;
          370  +    coeff_t *temp;
          371  +
          372  +    int scale, length;
          373  +    int scales;
          374  +    int i, j;
          375  +
          376  +    assert (signal_length > 1);
          377  +
          378  +    /* Transform as many times as possible */
          379  +    scales = number_of_bits (signal_length) - 1;
          380  +
          381  +    /* Sanity checks */
          382  +    assert (((mode == MODE_NORMAL) && (signal_length == 1 << scales)) ||
          383  +	    ((mode == MODE_OTLPF) && (signal_length == (1 << scales) + 1)));
          384  +
          385  +    input = xmalloc (signal_length * sizeof (coeff_t));
          386  +    output = xmalloc (signal_length * sizeof (coeff_t));
          387  +    temp = xmalloc (signal_length * sizeof (coeff_t));
          388  +
          389  +    for (i = 0; i < signal_length; i++)
          390  +      {
          391  +	  for (j = 0; j < signal_length; j++)
          392  +	    {
          393  +		output_signal[i][j] = input_signal[i][j];
          394  +	    }
          395  +      }
          396  +
          397  +    /* Transform image */
          398  +    for (scale = 0; scale < scales; scale++)
          399  +      {
          400  +	  length = mode + (1 << (scales - scale));
          401  +
          402  +	  /* Transform rows */
          403  +	  for (i = 0; i < length; i++)
          404  +	    {
          405  +		for (j = 0; j < length; j++)
          406  +		  {
          407  +		      input[j] = output_signal[i][j];
          408  +		  }
          409  +
          410  +		if (!strcmp (fb->id, "daub97lift"))
          411  +		  {
          412  +		      if (length % 2)
          413  +			{
          414  +			    daub97lift_analysis_1D_odd (input, output, length);
          415  +			}
          416  +		      else
          417  +			{
          418  +			    daub97lift_analysis_1D_even (input, output, length);
          419  +			}
          420  +		  }
          421  +		else
          422  +		  {
          423  +		      analysis_1D (input, output, temp, length, fb);
          424  +		  }
          425  +
          426  +		for (j = 0; j < length; j++)
          427  +		  {
          428  +		      output_signal[i][j] = output[j];
          429  +		  }
          430  +	    }
          431  +
          432  +	  /* Transform columns */
          433  +	  for (i = 0; i < length; i++)
          434  +	    {
          435  +		for (j = 0; j < length; j++)
          436  +		  {
          437  +		      input[j] = output_signal[j][i];
          438  +		  }
          439  +
          440  +		if (!strcmp (fb->id, "daub97lift"))
          441  +		  {
          442  +		      if (length % 2)
          443  +			{
          444  +			    daub97lift_analysis_1D_odd (input, output, length);
          445  +			}
          446  +		      else
          447  +			{
          448  +			    daub97lift_analysis_1D_even (input, output, length);
          449  +			}
          450  +		  }
          451  +		else
          452  +		  {
          453  +		      analysis_1D (input, output, temp, length, fb);
          454  +		  }
          455  +
          456  +		for (j = 0; j < length; j++)
          457  +		  {
          458  +		      output_signal[j][i] = output[j];
          459  +		  }
          460  +	    }
          461  +      }
          462  +
          463  +    free (input);
          464  +    free (output);
          465  +    free (temp);
          466  +}
          467  +
          468  +void
          469  +synthesis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          470  +	      int signal_length, int mode, filterbank_t * fb)
          471  +{
          472  +    coeff_t *input;
          473  +    coeff_t *output;
          474  +    coeff_t *temp1;
          475  +    coeff_t *temp2;
          476  +    coeff_t *temp3;
          477  +
          478  +    int scale, length;
          479  +    int scales;
          480  +    int i, j;
          481  +
          482  +    assert (signal_length > 1);
          483  +
          484  +    /* Transform as many times as possible */
          485  +    scales = number_of_bits (signal_length) - 1;
          486  +
          487  +    /* Sanity checks */
          488  +    assert (((mode == MODE_NORMAL) && (signal_length == 1 << scales)) ||
          489  +	    ((mode == MODE_OTLPF) && (signal_length == (1 << scales) + 1)));
          490  +
          491  +    /* Temporary arrays */
          492  +    input = xmalloc (signal_length * sizeof (coeff_t));
          493  +    output = xmalloc (signal_length * sizeof (coeff_t));
          494  +    temp1 = xmalloc (signal_length * sizeof (coeff_t));
          495  +    temp2 = xmalloc (signal_length * sizeof (coeff_t));
          496  +    temp3 = xmalloc (signal_length * sizeof (coeff_t));
          497  +
          498  +    for (i = 0; i < signal_length; i++)
          499  +      {
          500  +	  for (j = 0; j < signal_length; j++)
          501  +	    {
          502  +		output_signal[i][j] = input_signal[i][j];
          503  +	    }
          504  +      }
          505  +
          506  +    /* Transform image */
          507  +    for (scale = 0; scale < scales; scale++)
          508  +      {
          509  +	  length = mode + (1 << (scale + 1));
          510  +
          511  +	  /* Transform rows */
          512  +	  for (i = 0; i < length; i++)
          513  +	    {
          514  +		for (j = 0; j < length; j++)
          515  +		  {
          516  +		      input[j] = output_signal[i][j];
          517  +		  }
          518  +
          519  +		if (!strcmp (fb->id, "daub97lift"))
          520  +		  {
          521  +		      if (length % 2)
          522  +			{
          523  +			    daub97lift_synthesis_1D_odd (input, output, length);
          524  +			}
          525  +		      else
          526  +			{
          527  +			    daub97lift_synthesis_1D_even (input, output,
          528  +							  length);
          529  +			}
          530  +		  }
          531  +		else
          532  +		  {
          533  +		      synthesis_1D (input, output, temp1, temp2, temp3, length,
          534  +				    fb);
          535  +		  }
          536  +
          537  +		for (j = 0; j < length; j++)
          538  +		  {
          539  +		      output_signal[i][j] = output[j];
          540  +		  }
          541  +	    }
          542  +
          543  +	  /* Transform columns */
          544  +	  for (i = 0; i < length; i++)
          545  +	    {
          546  +		for (j = 0; j < length; j++)
          547  +		  {
          548  +		      input[j] = output_signal[j][i];
          549  +		  }
          550  +
          551  +		if (!strcmp (fb->id, "daub97lift"))
          552  +		  {
          553  +		      if (length % 2)
          554  +			{
          555  +			    daub97lift_synthesis_1D_odd (input, output, length);
          556  +			}
          557  +		      else
          558  +			{
          559  +			    daub97lift_synthesis_1D_even (input, output,
          560  +							  length);
          561  +			}
          562  +		  }
          563  +		else
          564  +		  {
          565  +		      synthesis_1D (input, output, temp1, temp2, temp3, length,
          566  +				    fb);
          567  +		  }
          568  +
          569  +		for (j = 0; j < length; j++)
          570  +		  {
          571  +		      output_signal[j][i] = output[j];
          572  +		  }
          573  +	    }
          574  +      }
          575  +
          576  +    /* Release temporary arrays */
          577  +    free (input);
          578  +    free (output);
          579  +    free (temp1);
          580  +    free (temp2);
          581  +    free (temp3);
          582  +}

Added epsilon/filter.h.

            1  +/*
            2  + * $Id: filter.h,v 1.19 2008/03/28 22:52:29 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Signal filtering
           27  + *
           28  + *  Wavelet transform implementation based on filter banks.
           29  + *
           30  + *  \section References
           31  + *
           32  + *  Gilbert Strang, Truong Nguyen "Wavelets and Filter Banks".
           33  + *
           34  + *  Jianxin Wei, Mark Pickering, Michael Frater, John Arnold,
           35  + *  John Boman, Wenjun Zeng "Boundary Artefact Reduction Using
           36  + *  Odd Tile Length and the Low Pass First Convention (OTLPF)". */
           37  +
           38  +#ifndef __FILTER_H__
           39  +#define __FILTER_H__
           40  +
           41  +#ifdef __cplusplus
           42  +extern "C"
           43  +{
           44  +#endif
           45  +
           46  +#if defined(_MSC_VER) && !defined(__cplusplus)
           47  +#define inline	__inline
           48  +#endif				/* not MSVC C compiler */
           49  +
           50  +/** \addtogroup wavelet Wavelet transform */
           51  +/*@{*/
           52  +
           53  +#include <common.h>
           54  +#include <filterbank.h>
           55  +
           56  +/** Normal mode
           57  + *
           58  + *  This mode assumes that image is square and height = width = 2 ^ N. */
           59  +#define MODE_NORMAL             0
           60  +/** OTLPF mode
           61  + *
           62  + *  This mode also assumes that image is square, but height = width = (2 ^ N) + 1.
           63  + *  In a few words, OTLPF is some kind of hack to reduce boundary artefacts
           64  + *  when image is broken into several tiles. Due to mathematical constrains
           65  + *  this method can be applied to biorthogonal filters only. For more
           66  + *  information see references. */
           67  +#define MODE_OTLPF              1
           68  +
           69  +/** Periodic signal extension
           70  + *
           71  + *  This function extends signal in a periodic fashion.
           72  + *  For example: ... 2 3 4 | 1 2 3 4 | 1 2 3 ...
           73  + *  This kind of extension is used with orthogonal filters.
           74  + *
           75  + *  \param index Sample index
           76  + *  \param length Signal length
           77  + *
           78  + *  \return Real sample index within array bounds
           79  + *
           80  + *  \note Actually, signal is not extended as the function name states.
           81  + *  This function just computes real sample index within array bounds. */
           82  +    inline local int periodic_extension (int index, int length);
           83  +
           84  +/** Symmetric-whole signal extension
           85  + *
           86  + *  This function extends signal in symmetric-whole fasion.
           87  + *  For example: ... 4 3 2 | 1 2 3 4 | 3 2 1 ... This kind
           88  + *  of extension is used with biorthogonal filters of odd length.
           89  + *
           90  + *  \param index Sample index
           91  + *  \param length Signal length
           92  + *
           93  + *  \return Real sample index within array bounds
           94  + *
           95  + *  \note Actually, signal is not extended as the function name states.
           96  + *  This function just computes real sample index within array bounds. */
           97  +    inline local int symmetric_W_extension (int index, int length);
           98  +
           99  +/** Symmetric-half signal extension
          100  + *
          101  + *  This function extends signal in symmetric-half fasion.
          102  + *  For example: ... 3 2 1 | 1 2 3 4 | 4 3 2 ... (i.e. boundary
          103  + *  samples are duplicated). This kind of extension is used with
          104  + *  biorthogonal filters of even length.
          105  + *
          106  + *  \param index Sample index
          107  + *  \param length Signal length
          108  + *
          109  + *  \return Real sample index within array bounds
          110  + *
          111  + *  \note Actually, signal is not extended as the function name states.
          112  + *  This function just computes real sample index within array bounds. */
          113  +    inline local int symmetric_H_extension (int index, int length);
          114  +
          115  +/** Signal downsampling
          116  + *
          117  + *  This function downsamples signal by the factor of two. Depending
          118  + *  on \a phase, #PHASE_EVEN or #PHASE_ODD, odd-numbered (1, 3, 5, ...)
          119  + *  or even-numbered (0, 2, 4, ...) samples are rejected respectively.
          120  + *
          121  + *  \param input_signal Input signal
          122  + *  \param output_signal Output signal
          123  + *  \param input_length Input signal length
          124  + *  \param output_length Output signal length
          125  + *  \param phase Downsampling phase
          126  + *
          127  + *  \return \c VOID
          128  + *
          129  + *  \note Caller must allocate enough space for \a output_signal beforehand. */
          130  +    inline local void downsample_signal (coeff_t * input_signal,
          131  +					 coeff_t * output_signal,
          132  +					 int input_length, int output_length,
          133  +					 int phase);
          134  +
          135  +/** Signal upsampling
          136  + *
          137  + *  This function is inverse to the previous one. It inserts zeros between
          138  + *  \a input_signal samples. Depending on \a phase, #PHASE_EVEN or #PHASE_ODD,
          139  + *  zeros are insered into the odd-numbered (1, 3, 5, ...) or
          140  + *  even-numbered (0, 2, 4, ...) positions respectively.
          141  + *
          142  + *  \param input_signal Input signal
          143  + *  \param output_signal Output signal
          144  + *  \param input_length Input signal length
          145  + *  \param output_length Output signal length
          146  + *  \param phase Upsampling phase
          147  + *
          148  + *  \return \c VOID
          149  + *
          150  + *  \note Caller must allocate enough space for \a output_signal beforehand. */
          151  +    inline local void upsample_signal (coeff_t * input_signal,
          152  +				       coeff_t * output_signal,
          153  +				       int input_length, int output_length,
          154  +				       int phase);
          155  +
          156  +/** Periodic signal filtering
          157  + *
          158  + *  This function filters \a input_signal of length \a signal_length
          159  + *  into the \a output_signal using specified \a filter. Boundary
          160  + *  samples are evaluated using peridic extension.
          161  + *
          162  + *  \param input_signal Input signal
          163  + *  \param output_signal Output signal
          164  + *  \param signal_length Signal length
          165  + *  \param filter Filter
          166  + *
          167  + *  \return \c VOID
          168  + *
          169  + *  \note \a filter must be orthogonal.
          170  + *  \note \a signal_length must be even. */
          171  +    inline local void filter_periodic (coeff_t * input_signal,
          172  +				       coeff_t * output_signal,
          173  +				       int signal_length, filter_t * filter);
          174  +
          175  +/** Symmetric signal filtering
          176  + *
          177  + *  This function filters \a input_signal of length \a signal_length
          178  + *  into the \a output_signal using specified \a filter. Boundary
          179  + *  samples are evaluated using symmetric extension.
          180  + *
          181  + *  \param input_signal Input signal
          182  + *  \param output_signal Output signal
          183  + *  \param signal_length Signal length
          184  + *  \param filter Filter
          185  + *
          186  + *  \return \c VOID
          187  + *
          188  + *  \note \a filter must be biorthogonal.
          189  + *  \note \a signal_length can be either even or odd.
          190  + *
          191  + *  \todo Add support for even-length biorthogonal filters. */
          192  +    inline local void filter_symmetric (coeff_t * input_signal,
          193  +					coeff_t * output_signal,
          194  +					int signal_length, filter_t * filter);
          195  +
          196  +/** One dimensional wavelet decomposition
          197  + *
          198  + *  This function performes one stage of 1D wavelet decomposition
          199  + *  of \a input_signal using filter bank \a fb. The result is
          200  + *  stored in \a output_signal. This operation requires one temporary
          201  + *  array of length \a signal_length. On return, the first half of \a output_signal
          202  + *  will be occupied with lowpass coefficients, the second half - with highpass
          203  + *  coefficients.
          204  + *
          205  + *  \param input_signal Input signal
          206  + *  \param output_signal Output signal
          207  + *  \param temp Temporary array
          208  + *  \param signal_length Signal length
          209  + *  \param fb Filter bank
          210  + *
          211  + *  \return \c VOID
          212  + *
          213  + *  \note If \a signal_length is odd and \a fb is biorthogonal, then
          214  + *  there will be one extra lowpass coefficient. */
          215  +    local void analysis_1D (coeff_t * input_signal, coeff_t * output_signal,
          216  +			    coeff_t * temp, int signal_length,
          217  +			    filterbank_t * fb);
          218  +
          219  +/** One dimensional wavelet reconstruction
          220  + *
          221  + *  This function performes one stage of 1D wavelet reconstruction
          222  + *  of \a input_signal using filter bank \a fb. The result is
          223  + *  stored in \a output_signal. This operation requires tree temporary
          224  + *  arrays of length \a signal_length.
          225  + *
          226  + *  \param input_signal Input signal
          227  + *  \param output_signal Output signal
          228  + *  \param temp1 Temporary array 1
          229  + *  \param temp2 Temporary array 2
          230  + *  \param temp3 Temporary array 3
          231  + *  \param signal_length Signal length
          232  + *  \param fb Filter bank
          233  + *
          234  + *  \return \c VOID */
          235  +    local void synthesis_1D (coeff_t * input_signal, coeff_t * output_signal,
          236  +			     coeff_t * temp1, coeff_t * temp2, coeff_t * temp3,
          237  +			     int signal_length, filterbank_t * fb);
          238  +
          239  +/** Two dimensional wavelet decomposition
          240  + *
          241  + *  This function performes N stages of 2D wavelet decomposition of
          242  + *  \a input_signal using filter bank \a fb. Image is assumed to be square:
          243  + *  if \a mode = #MODE_NORMAL, then width = height = signal_length = 2 ^ N;
          244  + *  if \a mode = #MODE_OTLPF, then width = height = signal_length = (2 ^ N) + 1.
          245  + *
          246  + *  \param input_signal Input signal
          247  + *  \param output_signal Output signal
          248  + *  \param signal_length Signal length (width = height)
          249  + *  \param mode Either #MODE_NORMAL or #MODE_OTLPF
          250  + *  \param fb Filter bank
          251  + *
          252  + *  \return \c VOID */
          253  +    void analysis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          254  +		      int signal_length, int mode, filterbank_t * fb);
          255  +
          256  +/** Two dimensional wavelet reconstruction
          257  + *
          258  + *  This function performes N stages of 2D wavelet reconstruction of
          259  + *  \a input_signal using filter bank \a fb. Image is assumed to be square:
          260  + *  if \a mode = #MODE_NORMAL, then width = height = signal_length = 2 ^ N;
          261  + *  if \a mode = #MODE_OTLPF, then width = height = signal_length = (2 ^ N) + 1.
          262  + *
          263  + *  \param input_signal Input signal
          264  + *  \param output_signal Output signal
          265  + *  \param signal_length Signal length (width = height)
          266  + *  \param mode Either #MODE_NORMAL or #MODE_OTLPF
          267  + *  \param fb Filter bank
          268  + *
          269  + *  \return \c VOID */
          270  +    void synthesis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          271  +		       int signal_length, int mode, filterbank_t * fb);
          272  +
          273  +/*@}*/
          274  +
          275  +#ifdef __cplusplus
          276  +}
          277  +#endif
          278  +
          279  +#endif				/* __FILTER_H__ */

Added epsilon/filterbank.c.

            1  +/*
            2  + * $Id: filterbank.c,v 1.12 2008/03/28 22:52:29 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <filterbank.h>
           26  +
           27  +/* Haar filter. */
           28  +
           29  +static coeff_t haar_lowpass_analysis_coeffs[] = {
           30  +    0.7071067811865475,
           31  +    0.7071067811865475,
           32  +};
           33  +
           34  +static coeff_t haar_highpass_analysis_coeffs[] = {
           35  +    0.7071067811865475,
           36  +    -0.7071067811865475,
           37  +};
           38  +
           39  +static coeff_t haar_lowpass_synthesis_coeffs[] = {
           40  +    0.7071067811865475,
           41  +    0.7071067811865475,
           42  +};
           43  +
           44  +static coeff_t haar_highpass_synthesis_coeffs[] = {
           45  +    -0.7071067811865475,
           46  +    0.7071067811865475,
           47  +};
           48  +
           49  +static filter_t haar_lowpass_analysis = {
           50  +    2,
           51  +    ANTICAUSAL,
           52  +    LOWPASS_ANALYSIS,
           53  +    haar_lowpass_analysis_coeffs,
           54  +};
           55  +
           56  +static filter_t haar_highpass_analysis = {
           57  +    2,
           58  +    ANTICAUSAL,
           59  +    HIGHPASS_ANALYSIS,
           60  +    haar_highpass_analysis_coeffs,
           61  +};
           62  +
           63  +static filter_t haar_lowpass_synthesis = {
           64  +    2,
           65  +    CAUSAL,
           66  +    LOWPASS_SYNTHESIS,
           67  +    haar_lowpass_synthesis_coeffs,
           68  +};
           69  +
           70  +static filter_t haar_highpass_synthesis = {
           71  +    2,
           72  +    CAUSAL,
           73  +    HIGHPASS_SYNTHESIS,
           74  +    haar_highpass_synthesis_coeffs,
           75  +};
           76  +
           77  +static filterbank_t haar = {
           78  +    "haar",
           79  +    "Haar",
           80  +    ORTHOGONAL,
           81  +    &haar_lowpass_analysis,
           82  +    &haar_highpass_analysis,
           83  +    &haar_lowpass_synthesis,
           84  +    &haar_highpass_synthesis,
           85  +};
           86  +
           87  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
           88  + * Communications on Pure and Applied Mathematics, vol. 41,
           89  + * pp. 909-996, 1988. */
           90  +
           91  +static coeff_t daub4_lowpass_analysis_coeffs[] = {
           92  +    0.4829629131445341,
           93  +    0.8365163037378077,
           94  +    0.2241438680420134,
           95  +    -0.1294095225512603,
           96  +};
           97  +
           98  +static coeff_t daub4_highpass_analysis_coeffs[] = {
           99  +    -0.1294095225512603,
          100  +    -0.2241438680420134,
          101  +    0.8365163037378077,
          102  +    -0.4829629131445341,
          103  +};
          104  +
          105  +static coeff_t daub4_lowpass_synthesis_coeffs[] = {
          106  +    -0.1294095225512603,
          107  +    0.2241438680420134,
          108  +    0.8365163037378077,
          109  +    0.4829629131445341,
          110  +};
          111  +
          112  +static coeff_t daub4_highpass_synthesis_coeffs[] = {
          113  +    -0.4829629131445341,
          114  +    0.8365163037378077,
          115  +    -0.2241438680420134,
          116  +    -0.1294095225512603,
          117  +};
          118  +
          119  +static filter_t daub4_lowpass_analysis = {
          120  +    4,
          121  +    ANTICAUSAL,
          122  +    LOWPASS_ANALYSIS,
          123  +    daub4_lowpass_analysis_coeffs,
          124  +};
          125  +
          126  +static filter_t daub4_highpass_analysis = {
          127  +    4,
          128  +    ANTICAUSAL,
          129  +    HIGHPASS_ANALYSIS,
          130  +    daub4_highpass_analysis_coeffs,
          131  +};
          132  +
          133  +static filter_t daub4_lowpass_synthesis = {
          134  +    4,
          135  +    CAUSAL,
          136  +    LOWPASS_SYNTHESIS,
          137  +    daub4_lowpass_synthesis_coeffs,
          138  +};
          139  +
          140  +static filter_t daub4_highpass_synthesis = {
          141  +    4,
          142  +    CAUSAL,
          143  +    HIGHPASS_SYNTHESIS,
          144  +    daub4_highpass_synthesis_coeffs,
          145  +};
          146  +
          147  +static filterbank_t daub4 = {
          148  +    "daub4",
          149  +    "Daubechies D4",
          150  +    ORTHOGONAL,
          151  +    &daub4_lowpass_analysis,
          152  +    &daub4_highpass_analysis,
          153  +    &daub4_lowpass_synthesis,
          154  +    &daub4_highpass_synthesis,
          155  +};
          156  +
          157  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          158  + * Communications on Pure and Applied Mathematics, vol. 41,
          159  + * pp. 909-996, 1988. */
          160  +
          161  +static coeff_t daub6_lowpass_analysis_coeffs[] = {
          162  +    0.3326705529500825,
          163  +    0.8068915093110924,
          164  +    0.4598775021184914,
          165  +    -0.1350110200102546,
          166  +    -0.0854412738820267,
          167  +    0.0352262918857095,
          168  +};
          169  +
          170  +static coeff_t daub6_highpass_analysis_coeffs[] = {
          171  +    0.0352262918857095,
          172  +    0.0854412738820267,
          173  +    -0.1350110200102546,
          174  +    -0.4598775021184914,
          175  +    0.8068915093110924,
          176  +    -0.3326705529500825,
          177  +};
          178  +
          179  +static coeff_t daub6_lowpass_synthesis_coeffs[] = {
          180  +    0.0352262918857095,
          181  +    -0.0854412738820267,
          182  +    -0.1350110200102546,
          183  +    0.4598775021184914,
          184  +    0.8068915093110924,
          185  +    0.3326705529500825,
          186  +};
          187  +
          188  +static coeff_t daub6_highpass_synthesis_coeffs[] = {
          189  +    -0.3326705529500825,
          190  +    0.8068915093110924,
          191  +    -0.4598775021184914,
          192  +    -0.1350110200102546,
          193  +    0.0854412738820267,
          194  +    0.0352262918857095,
          195  +};
          196  +
          197  +static filter_t daub6_lowpass_analysis = {
          198  +    6,
          199  +    ANTICAUSAL,
          200  +    LOWPASS_ANALYSIS,
          201  +    daub6_lowpass_analysis_coeffs,
          202  +};
          203  +
          204  +static filter_t daub6_highpass_analysis = {
          205  +    6,
          206  +    ANTICAUSAL,
          207  +    HIGHPASS_ANALYSIS,
          208  +    daub6_highpass_analysis_coeffs,
          209  +};
          210  +
          211  +static filter_t daub6_lowpass_synthesis = {
          212  +    6,
          213  +    CAUSAL,
          214  +    LOWPASS_SYNTHESIS,
          215  +    daub6_lowpass_synthesis_coeffs,
          216  +};
          217  +
          218  +static filter_t daub6_highpass_synthesis = {
          219  +    6,
          220  +    CAUSAL,
          221  +    HIGHPASS_SYNTHESIS,
          222  +    daub6_highpass_synthesis_coeffs,
          223  +};
          224  +
          225  +static filterbank_t daub6 = {
          226  +    "daub6",
          227  +    "Daubechies D6",
          228  +    ORTHOGONAL,
          229  +    &daub6_lowpass_analysis,
          230  +    &daub6_highpass_analysis,
          231  +    &daub6_lowpass_synthesis,
          232  +    &daub6_highpass_synthesis,
          233  +};
          234  +
          235  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          236  + * Communications on Pure and Applied Mathematics, vol. 41,
          237  + * pp. 909-996, 1988. */
          238  +
          239  +static coeff_t daub8_lowpass_analysis_coeffs[] = {
          240  +    0.2303778133088964,
          241  +    0.7148465705529154,
          242  +    0.6308807679398587,
          243  +    -0.0279837694168599,
          244  +    -0.1870348117190931,
          245  +    0.0308413818355607,
          246  +    0.0328830116668852,
          247  +    -0.0105974017850690,
          248  +};
          249  +
          250  +static coeff_t daub8_highpass_analysis_coeffs[] = {
          251  +    -0.0105974017850690,
          252  +    -0.0328830116668852,
          253  +    0.0308413818355607,
          254  +    0.1870348117190931,
          255  +    -0.0279837694168599,
          256  +    -0.6308807679398587,
          257  +    0.7148465705529154,
          258  +    -0.2303778133088964,
          259  +};
          260  +
          261  +static coeff_t daub8_lowpass_synthesis_coeffs[] = {
          262  +    -0.0105974017850690,
          263  +    0.0328830116668852,
          264  +    0.0308413818355607,
          265  +    -0.1870348117190931,
          266  +    -0.0279837694168599,
          267  +    0.6308807679398587,
          268  +    0.7148465705529154,
          269  +    0.2303778133088964,
          270  +};
          271  +
          272  +static coeff_t daub8_highpass_synthesis_coeffs[] = {
          273  +    -0.2303778133088964,
          274  +    0.7148465705529154,
          275  +    -0.6308807679398587,
          276  +    -0.0279837694168599,
          277  +    0.1870348117190931,
          278  +    0.0308413818355607,
          279  +    -0.0328830116668852,
          280  +    -0.0105974017850690,
          281  +};
          282  +
          283  +static filter_t daub8_lowpass_analysis = {
          284  +    8,
          285  +    ANTICAUSAL,
          286  +    LOWPASS_ANALYSIS,
          287  +    daub8_lowpass_analysis_coeffs,
          288  +};
          289  +
          290  +static filter_t daub8_highpass_analysis = {
          291  +    8,
          292  +    ANTICAUSAL,
          293  +    HIGHPASS_ANALYSIS,
          294  +    daub8_highpass_analysis_coeffs,
          295  +};
          296  +
          297  +static filter_t daub8_lowpass_synthesis = {
          298  +    8,
          299  +    CAUSAL,
          300  +    LOWPASS_SYNTHESIS,
          301  +    daub8_lowpass_synthesis_coeffs,
          302  +};
          303  +
          304  +static filter_t daub8_highpass_synthesis = {
          305  +    8,
          306  +    CAUSAL,
          307  +    HIGHPASS_SYNTHESIS,
          308  +    daub8_highpass_synthesis_coeffs,
          309  +};
          310  +
          311  +static filterbank_t daub8 = {
          312  +    "daub8",
          313  +    "Daubechies D8",
          314  +    ORTHOGONAL,
          315  +    &daub8_lowpass_analysis,
          316  +    &daub8_highpass_analysis,
          317  +    &daub8_lowpass_synthesis,
          318  +    &daub8_highpass_synthesis,
          319  +};
          320  +
          321  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          322  + * Communications on Pure and Applied Mathematics, vol. 41,
          323  + * pp. 909-996, 1988. */
          324  +
          325  +static coeff_t daub10_lowpass_analysis_coeffs[] = {
          326  +    0.16010239797419,
          327  +    0.60382926979719,
          328  +    0.72430852843777,
          329  +    0.13842814590132,
          330  +    -0.24229488706638,
          331  +    -0.03224486958464,
          332  +    0.07757149384005,
          333  +    -0.00624149021280,
          334  +    -0.01258075199908,
          335  +    0.00333572528547,
          336  +};
          337  +
          338  +static coeff_t daub10_highpass_analysis_coeffs[] = {
          339  +    0.00333572528547,
          340  +    0.01258075199908,
          341  +    -0.00624149021280,
          342  +    -0.07757149384005,
          343  +    -0.03224486958464,
          344  +    0.24229488706638,
          345  +    0.13842814590132,
          346  +    -0.72430852843777,
          347  +    0.60382926979719,
          348  +    -0.16010239797419,
          349  +};
          350  +
          351  +static coeff_t daub10_lowpass_synthesis_coeffs[] = {
          352  +    0.00333572528547,
          353  +    -0.01258075199908,
          354  +    -0.00624149021280,
          355  +    0.07757149384005,
          356  +    -0.03224486958464,
          357  +    -0.24229488706638,
          358  +    0.13842814590132,
          359  +    0.72430852843777,
          360  +    0.60382926979719,
          361  +    0.16010239797419,
          362  +};
          363  +
          364  +static coeff_t daub10_highpass_synthesis_coeffs[] = {
          365  +    -0.16010239797419,
          366  +    0.60382926979719,
          367  +    -0.72430852843777,
          368  +    0.13842814590132,
          369  +    0.24229488706638,
          370  +    -0.03224486958464,
          371  +    -0.07757149384005,
          372  +    -0.00624149021280,
          373  +    0.01258075199908,
          374  +    0.00333572528547,
          375  +};
          376  +
          377  +static filter_t daub10_lowpass_analysis = {
          378  +    10,
          379  +    ANTICAUSAL,
          380  +    LOWPASS_ANALYSIS,
          381  +    daub10_lowpass_analysis_coeffs,
          382  +};
          383  +
          384  +static filter_t daub10_highpass_analysis = {
          385  +    10,
          386  +    ANTICAUSAL,
          387  +    HIGHPASS_ANALYSIS,
          388  +    daub10_highpass_analysis_coeffs,
          389  +};
          390  +
          391  +static filter_t daub10_lowpass_synthesis = {
          392  +    10,
          393  +    CAUSAL,
          394  +    LOWPASS_SYNTHESIS,
          395  +    daub10_lowpass_synthesis_coeffs,
          396  +};
          397  +
          398  +static filter_t daub10_highpass_synthesis = {
          399  +    10,
          400  +    CAUSAL,
          401  +    HIGHPASS_SYNTHESIS,
          402  +    daub10_highpass_synthesis_coeffs,
          403  +};
          404  +
          405  +static filterbank_t daub10 = {
          406  +    "daub10",
          407  +    "Daubechies D10",
          408  +    ORTHOGONAL,
          409  +    &daub10_lowpass_analysis,
          410  +    &daub10_highpass_analysis,
          411  +    &daub10_lowpass_synthesis,
          412  +    &daub10_highpass_synthesis,
          413  +};
          414  +
          415  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          416  + * Communications on Pure and Applied Mathematics, vol. 41,
          417  + * pp. 909-996, 1988. */
          418  +
          419  +static coeff_t daub12_lowpass_analysis_coeffs[] = {
          420  +    0.111540743350,
          421  +    0.494623890398,
          422  +    0.751133908021,
          423  +    0.315250351709,
          424  +    -0.226264693965,
          425  +    -0.129766867567,
          426  +    0.097501605587,
          427  +    0.027522865530,
          428  +    -0.031582039317,
          429  +    0.000553842201,
          430  +    0.004777257511,
          431  +    -0.001077301085,
          432  +};
          433  +
          434  +static coeff_t daub12_highpass_analysis_coeffs[] = {
          435  +    -0.001077301085,
          436  +    -0.004777257511,
          437  +    0.000553842201,
          438  +    0.031582039317,
          439  +    0.027522865530,
          440  +    -0.097501605587,
          441  +    -0.129766867567,
          442  +    0.226264693965,
          443  +    0.315250351709,
          444  +    -0.751133908021,
          445  +    0.494623890398,
          446  +    -0.111540743350,
          447  +};
          448  +
          449  +static coeff_t daub12_lowpass_synthesis_coeffs[] = {
          450  +    -0.001077301085,
          451  +    0.004777257511,
          452  +    0.000553842201,
          453  +    -0.031582039317,
          454  +    0.027522865530,
          455  +    0.097501605587,
          456  +    -0.129766867567,
          457  +    -0.226264693965,
          458  +    0.315250351709,
          459  +    0.751133908021,
          460  +    0.494623890398,
          461  +    0.111540743350,
          462  +};
          463  +
          464  +static coeff_t daub12_highpass_synthesis_coeffs[] = {
          465  +    -0.111540743350,
          466  +    0.494623890398,
          467  +    -0.751133908021,
          468  +    0.315250351709,
          469  +    0.226264693965,
          470  +    -0.129766867567,
          471  +    -0.097501605587,
          472  +    0.027522865530,
          473  +    0.031582039317,
          474  +    0.000553842201,
          475  +    -0.004777257511,
          476  +    -0.001077301085,
          477  +};
          478  +
          479  +static filter_t daub12_lowpass_analysis = {
          480  +    12,
          481  +    ANTICAUSAL,
          482  +    LOWPASS_ANALYSIS,
          483  +    daub12_lowpass_analysis_coeffs,
          484  +};
          485  +
          486  +static filter_t daub12_highpass_analysis = {
          487  +    12,
          488  +    ANTICAUSAL,
          489  +    HIGHPASS_ANALYSIS,
          490  +    daub12_highpass_analysis_coeffs,
          491  +};
          492  +
          493  +static filter_t daub12_lowpass_synthesis = {
          494  +    12,
          495  +    CAUSAL,
          496  +    LOWPASS_SYNTHESIS,
          497  +    daub12_lowpass_synthesis_coeffs,
          498  +};
          499  +
          500  +static filter_t daub12_highpass_synthesis = {
          501  +    12,
          502  +    CAUSAL,
          503  +    HIGHPASS_SYNTHESIS,
          504  +    daub12_highpass_synthesis_coeffs,
          505  +};
          506  +
          507  +static filterbank_t daub12 = {
          508  +    "daub12",
          509  +    "Daubechies D12",
          510  +    ORTHOGONAL,
          511  +    &daub12_lowpass_analysis,
          512  +    &daub12_highpass_analysis,
          513  +    &daub12_lowpass_synthesis,
          514  +    &daub12_highpass_synthesis,
          515  +};
          516  +
          517  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          518  + * Communications on Pure and Applied Mathematics, vol. 41,
          519  + * pp. 909-996, 1988. */
          520  +
          521  +static coeff_t daub14_lowpass_analysis_coeffs[] = {
          522  +    0.077852054085,
          523  +    0.396539319482,
          524  +    0.729132090846,
          525  +    0.469782287405,
          526  +    -0.143906003929,
          527  +    -0.224036184994,
          528  +    0.071309219267,
          529  +    0.080612609151,
          530  +    -0.038029936935,
          531  +    -0.016574541631,
          532  +    0.012550998556,
          533  +    0.000429577973,
          534  +    -0.001801640704,
          535  +    0.000353713800,
          536  +};
          537  +
          538  +static coeff_t daub14_highpass_analysis_coeffs[] = {
          539  +    0.000353713800,
          540  +    0.001801640704,
          541  +    0.000429577973,
          542  +    -0.012550998556,
          543  +    -0.016574541631,
          544  +    0.038029936935,
          545  +    0.080612609151,
          546  +    -0.071309219267,
          547  +    -0.224036184994,
          548  +    0.143906003929,
          549  +    0.469782287405,
          550  +    -0.729132090846,
          551  +    0.396539319482,
          552  +    -0.077852054085,
          553  +};
          554  +
          555  +static coeff_t daub14_lowpass_synthesis_coeffs[] = {
          556  +    0.000353713800,
          557  +    -0.001801640704,
          558  +    0.000429577973,
          559  +    0.012550998556,
          560  +    -0.016574541631,
          561  +    -0.038029936935,
          562  +    0.080612609151,
          563  +    0.071309219267,
          564  +    -0.224036184994,
          565  +    -0.143906003929,
          566  +    0.469782287405,
          567  +    0.729132090846,
          568  +    0.396539319482,
          569  +    0.077852054085,
          570  +};
          571  +
          572  +static coeff_t daub14_highpass_synthesis_coeffs[] = {
          573  +    -0.077852054085,
          574  +    0.396539319482,
          575  +    -0.729132090846,
          576  +    0.469782287405,
          577  +    0.143906003929,
          578  +    -0.224036184994,
          579  +    -0.071309219267,
          580  +    0.080612609151,
          581  +    0.038029936935,
          582  +    -0.016574541631,
          583  +    -0.012550998556,
          584  +    0.000429577973,
          585  +    0.001801640704,
          586  +    0.000353713800,
          587  +};
          588  +
          589  +static filter_t daub14_lowpass_analysis = {
          590  +    14,
          591  +    ANTICAUSAL,
          592  +    LOWPASS_ANALYSIS,
          593  +    daub14_lowpass_analysis_coeffs,
          594  +};
          595  +
          596  +static filter_t daub14_highpass_analysis = {
          597  +    14,
          598  +    ANTICAUSAL,
          599  +    HIGHPASS_ANALYSIS,
          600  +    daub14_highpass_analysis_coeffs,
          601  +};
          602  +
          603  +static filter_t daub14_lowpass_synthesis = {
          604  +    14,
          605  +    CAUSAL,
          606  +    LOWPASS_SYNTHESIS,
          607  +    daub14_lowpass_synthesis_coeffs,
          608  +};
          609  +
          610  +static filter_t daub14_highpass_synthesis = {
          611  +    14,
          612  +    CAUSAL,
          613  +    HIGHPASS_SYNTHESIS,
          614  +    daub14_highpass_synthesis_coeffs,
          615  +};
          616  +
          617  +static filterbank_t daub14 = {
          618  +    "daub14",
          619  +    "Daubechies D14",
          620  +    ORTHOGONAL,
          621  +    &daub14_lowpass_analysis,
          622  +    &daub14_highpass_analysis,
          623  +    &daub14_lowpass_synthesis,
          624  +    &daub14_highpass_synthesis,
          625  +};
          626  +
          627  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          628  + * Communications on Pure and Applied Mathematics, vol. 41,
          629  + * pp. 909-996, 1988. */
          630  +
          631  +static coeff_t daub16_lowpass_analysis_coeffs[] = {
          632  +    0.054415842243,
          633  +    0.312871590914,
          634  +    0.675630736297,
          635  +    0.585354683654,
          636  +    -0.015829105256,
          637  +    -0.284015542962,
          638  +    0.000472484574,
          639  +    0.128747426620,
          640  +    -0.017369301002,
          641  +    -0.044088253931,
          642  +    0.013981027917,
          643  +    0.008746094047,
          644  +    -0.004870352993,
          645  +    -0.000391740373,
          646  +    0.000675449406,
          647  +    -0.000117476784,
          648  +};
          649  +
          650  +static coeff_t daub16_highpass_analysis_coeffs[] = {
          651  +    -0.000117476784,
          652  +    -0.000675449406,
          653  +    -0.000391740373,
          654  +    0.004870352993,
          655  +    0.008746094047,
          656  +    -0.013981027917,
          657  +    -0.044088253931,
          658  +    0.017369301002,
          659  +    0.128747426620,
          660  +    -0.000472484574,
          661  +    -0.284015542962,
          662  +    0.015829105256,
          663  +    0.585354683654,
          664  +    -0.675630736297,
          665  +    0.312871590914,
          666  +    -0.054415842243,
          667  +};
          668  +
          669  +static coeff_t daub16_lowpass_synthesis_coeffs[] = {
          670  +    -0.000117476784,
          671  +    0.000675449406,
          672  +    -0.000391740373,
          673  +    -0.004870352993,
          674  +    0.008746094047,
          675  +    0.013981027917,
          676  +    -0.044088253931,
          677  +    -0.017369301002,
          678  +    0.128747426620,
          679  +    0.000472484574,
          680  +    -0.284015542962,
          681  +    -0.015829105256,
          682  +    0.585354683654,
          683  +    0.675630736297,
          684  +    0.312871590914,
          685  +    0.054415842243,
          686  +};
          687  +
          688  +static coeff_t daub16_highpass_synthesis_coeffs[] = {
          689  +    -0.054415842243,
          690  +    0.312871590914,
          691  +    -0.675630736297,
          692  +    0.585354683654,
          693  +    0.015829105256,
          694  +    -0.284015542962,
          695  +    -0.000472484574,
          696  +    0.128747426620,
          697  +    0.017369301002,
          698  +    -0.044088253931,
          699  +    -0.013981027917,
          700  +    0.008746094047,
          701  +    0.004870352993,
          702  +    -0.000391740373,
          703  +    -0.000675449406,
          704  +    -0.000117476784,
          705  +};
          706  +
          707  +static filter_t daub16_lowpass_analysis = {
          708  +    16,
          709  +    ANTICAUSAL,
          710  +    LOWPASS_ANALYSIS,
          711  +    daub16_lowpass_analysis_coeffs,
          712  +};
          713  +
          714  +static filter_t daub16_highpass_analysis = {
          715  +    16,
          716  +    ANTICAUSAL,
          717  +    HIGHPASS_ANALYSIS,
          718  +    daub16_highpass_analysis_coeffs,
          719  +};
          720  +
          721  +static filter_t daub16_lowpass_synthesis = {
          722  +    16,
          723  +    CAUSAL,
          724  +    LOWPASS_SYNTHESIS,
          725  +    daub16_lowpass_synthesis_coeffs,
          726  +};
          727  +
          728  +static filter_t daub16_highpass_synthesis = {
          729  +    16,
          730  +    CAUSAL,
          731  +    HIGHPASS_SYNTHESIS,
          732  +    daub16_highpass_synthesis_coeffs,
          733  +};
          734  +
          735  +static filterbank_t daub16 = {
          736  +    "daub16",
          737  +    "Daubechies D16",
          738  +    ORTHOGONAL,
          739  +    &daub16_lowpass_analysis,
          740  +    &daub16_highpass_analysis,
          741  +    &daub16_lowpass_synthesis,
          742  +    &daub16_highpass_synthesis,
          743  +};
          744  +
          745  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          746  + * Communications on Pure and Applied Mathematics, vol. 41,
          747  + * pp. 909-996, 1988. */
          748  +
          749  +static coeff_t daub18_lowpass_analysis_coeffs[] = {
          750  +    0.038077947364,
          751  +    0.243834674613,
          752  +    0.604823123690,
          753  +    0.657288078051,
          754  +    0.133197385825,
          755  +    -0.293273783279,
          756  +    -0.096840783223,
          757  +    0.148540749338,
          758  +    0.030725681479,
          759  +    -0.067632829061,
          760  +    0.000250947115,
          761  +    0.022361662124,
          762  +    -0.004723204758,
          763  +    -0.004281503682,
          764  +    0.001847646883,
          765  +    0.000230385764,
          766  +    -0.000251963189,
          767  +    0.000039347320,
          768  +};
          769  +
          770  +static coeff_t daub18_highpass_analysis_coeffs[] = {
          771  +    0.000039347320,
          772  +    0.000251963189,
          773  +    0.000230385764,
          774  +    -0.001847646883,
          775  +    -0.004281503682,
          776  +    0.004723204758,
          777  +    0.022361662124,
          778  +    -0.000250947115,
          779  +    -0.067632829061,
          780  +    -0.030725681479,
          781  +    0.148540749338,
          782  +    0.096840783223,
          783  +    -0.293273783279,
          784  +    -0.133197385825,
          785  +    0.657288078051,
          786  +    -0.604823123690,
          787  +    0.243834674613,
          788  +    -0.038077947364,
          789  +};
          790  +
          791  +static coeff_t daub18_lowpass_synthesis_coeffs[] = {
          792  +    0.000039347320,
          793  +    -0.000251963189,
          794  +    0.000230385764,
          795  +    0.001847646883,
          796  +    -0.004281503682,
          797  +    -0.004723204758,
          798  +    0.022361662124,
          799  +    0.000250947115,
          800  +    -0.067632829061,
          801  +    0.030725681479,
          802  +    0.148540749338,
          803  +    -0.096840783223,
          804  +    -0.293273783279,
          805  +    0.133197385825,
          806  +    0.657288078051,
          807  +    0.604823123690,
          808  +    0.243834674613,
          809  +    0.038077947364,
          810  +};
          811  +
          812  +static coeff_t daub18_highpass_synthesis_coeffs[] = {
          813  +    -0.038077947364,
          814  +    0.243834674613,
          815  +    -0.604823123690,
          816  +    0.657288078051,
          817  +    -0.133197385825,
          818  +    -0.293273783279,
          819  +    0.096840783223,
          820  +    0.148540749338,
          821  +    -0.030725681479,
          822  +    -0.067632829061,
          823  +    -0.000250947115,
          824  +    0.022361662124,
          825  +    0.004723204758,
          826  +    -0.004281503682,
          827  +    -0.001847646883,
          828  +    0.000230385764,
          829  +    0.000251963189,
          830  +    0.000039347320,
          831  +};
          832  +
          833  +static filter_t daub18_lowpass_analysis = {
          834  +    18,
          835  +    ANTICAUSAL,
          836  +    LOWPASS_ANALYSIS,
          837  +    daub18_lowpass_analysis_coeffs,
          838  +};
          839  +
          840  +static filter_t daub18_highpass_analysis = {
          841  +    18,
          842  +    ANTICAUSAL,
          843  +    HIGHPASS_ANALYSIS,
          844  +    daub18_highpass_analysis_coeffs,
          845  +};
          846  +
          847  +static filter_t daub18_lowpass_synthesis = {
          848  +    18,
          849  +    CAUSAL,
          850  +    LOWPASS_SYNTHESIS,
          851  +    daub18_lowpass_synthesis_coeffs,
          852  +};
          853  +
          854  +static filter_t daub18_highpass_synthesis = {
          855  +    18,
          856  +    CAUSAL,
          857  +    HIGHPASS_SYNTHESIS,
          858  +    daub18_highpass_synthesis_coeffs,
          859  +};
          860  +
          861  +static filterbank_t daub18 = {
          862  +    "daub18",
          863  +    "Daubechies D18",
          864  +    ORTHOGONAL,
          865  +    &daub18_lowpass_analysis,
          866  +    &daub18_highpass_analysis,
          867  +    &daub18_lowpass_synthesis,
          868  +    &daub18_highpass_synthesis,
          869  +};
          870  +
          871  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          872  + * Communications on Pure and Applied Mathematics, vol. 41,
          873  + * pp. 909-996, 1988. */
          874  +
          875  +static coeff_t daub20_lowpass_analysis_coeffs[] = {
          876  +    0.026670057901,
          877  +    0.188176800078,
          878  +    0.527201188932,
          879  +    0.688459039454,
          880  +    0.281172343661,
          881  +    -0.249846424327,
          882  +    -0.195946274377,
          883  +    0.127369340336,
          884  +    0.093057364604,
          885  +    -0.071394147166,
          886  +    -0.029457536822,
          887  +    0.033212674059,
          888  +    0.003606553567,
          889  +    -0.010733175483,
          890  +    0.001395351747,
          891  +    0.001992405295,
          892  +    -0.000685856695,
          893  +    -0.000116466855,
          894  +    0.000093588670,
          895  +    -0.000013264203,
          896  +};
          897  +
          898  +static coeff_t daub20_highpass_analysis_coeffs[] = {
          899  +    -0.000013264203,
          900  +    -0.000093588670,
          901  +    -0.000116466855,
          902  +    0.000685856695,
          903  +    0.001992405295,
          904  +    -0.001395351747,
          905  +    -0.010733175483,
          906  +    -0.003606553567,
          907  +    0.033212674059,
          908  +    0.029457536822,
          909  +    -0.071394147166,
          910  +    -0.093057364604,
          911  +    0.127369340336,
          912  +    0.195946274377,
          913  +    -0.249846424327,
          914  +    -0.281172343661,
          915  +    0.688459039454,
          916  +    -0.527201188932,
          917  +    0.188176800078,
          918  +    -0.026670057901,
          919  +};
          920  +
          921  +static coeff_t daub20_lowpass_synthesis_coeffs[] = {
          922  +    -0.000013264203,
          923  +    0.000093588670,
          924  +    -0.000116466855,
          925  +    -0.000685856695,
          926  +    0.001992405295,
          927  +    0.001395351747,
          928  +    -0.010733175483,
          929  +    0.003606553567,
          930  +    0.033212674059,
          931  +    -0.029457536822,
          932  +    -0.071394147166,
          933  +    0.093057364604,
          934  +    0.127369340336,
          935  +    -0.195946274377,
          936  +    -0.249846424327,
          937  +    0.281172343661,
          938  +    0.688459039454,
          939  +    0.527201188932,
          940  +    0.188176800078,
          941  +    0.026670057901,
          942  +};
          943  +
          944  +static coeff_t daub20_highpass_synthesis_coeffs[] = {
          945  +    -0.026670057901,
          946  +    0.188176800078,
          947  +    -0.527201188932,
          948  +    0.688459039454,
          949  +    -0.281172343661,
          950  +    -0.249846424327,
          951  +    0.195946274377,
          952  +    0.127369340336,
          953  +    -0.093057364604,
          954  +    -0.071394147166,
          955  +    0.029457536822,
          956  +    0.033212674059,
          957  +    -0.003606553567,
          958  +    -0.010733175483,
          959  +    -0.001395351747,
          960  +    0.001992405295,
          961  +    0.000685856695,
          962  +    -0.000116466855,
          963  +    -0.000093588670,
          964  +    -0.000013264203,
          965  +};
          966  +
          967  +static filter_t daub20_lowpass_analysis = {
          968  +    20,
          969  +    ANTICAUSAL,
          970  +    LOWPASS_ANALYSIS,
          971  +    daub20_lowpass_analysis_coeffs,
          972  +};
          973  +
          974  +static filter_t daub20_highpass_analysis = {
          975  +    20,
          976  +    ANTICAUSAL,
          977  +    HIGHPASS_ANALYSIS,
          978  +    daub20_highpass_analysis_coeffs,
          979  +};
          980  +
          981  +static filter_t daub20_lowpass_synthesis = {
          982  +    20,
          983  +    CAUSAL,
          984  +    LOWPASS_SYNTHESIS,
          985  +    daub20_lowpass_synthesis_coeffs,
          986  +};
          987  +
          988  +static filter_t daub20_highpass_synthesis = {
          989  +    20,
          990  +    CAUSAL,
          991  +    HIGHPASS_SYNTHESIS,
          992  +    daub20_highpass_synthesis_coeffs,
          993  +};
          994  +
          995  +static filterbank_t daub20 = {
          996  +    "daub20",
          997  +    "Daubechies D20",
          998  +    ORTHOGONAL,
          999  +    &daub20_lowpass_analysis,
         1000  +    &daub20_highpass_analysis,
         1001  +    &daub20_lowpass_synthesis,
         1002  +    &daub20_highpass_synthesis,
         1003  +};
         1004  +
         1005  +/* The Beylkin filter places roots for the frequency response function
         1006  + * close to the Nyquist frequency on the real axis. */
         1007  +
         1008  +static coeff_t beylkin_lowpass_analysis_coeffs[] = {
         1009  +    0.099305765374,
         1010  +    0.424215360813,
         1011  +    0.699825214057,
         1012  +    0.449718251149,
         1013  +    -0.110927598348,
         1014  +    -0.264497231446,
         1015  +    0.026900308804,
         1016  +    0.155538731877,
         1017  +    -0.017520746267,
         1018  +    -0.088543630623,
         1019  +    0.019679866044,
         1020  +    0.042916387274,
         1021  +    -0.017460408696,
         1022  +    -0.014365807969,
         1023  +    0.010040411845,
         1024  +    0.001484234782,
         1025  +    -0.002736031626,
         1026  +    0.000640485329,
         1027  +};
         1028  +
         1029  +static coeff_t beylkin_highpass_analysis_coeffs[] = {
         1030  +    0.000640485329,
         1031  +    0.002736031626,
         1032  +    0.001484234782,
         1033  +    -0.010040411845,
         1034  +    -0.014365807969,
         1035  +    0.017460408696,
         1036  +    0.042916387274,
         1037  +    -0.019679866044,
         1038  +    -0.088543630623,
         1039  +    0.017520746267,
         1040  +    0.155538731877,
         1041  +    -0.026900308804,
         1042  +    -0.264497231446,
         1043  +    0.110927598348,
         1044  +    0.449718251149,
         1045  +    -0.699825214057,
         1046  +    0.424215360813,
         1047  +    -0.099305765374,
         1048  +};
         1049  +
         1050  +static coeff_t beylkin_lowpass_synthesis_coeffs[] = {
         1051  +    0.000640485329,
         1052  +    -0.002736031626,
         1053  +    0.001484234782,
         1054  +    0.010040411845,
         1055  +    -0.014365807969,
         1056  +    -0.017460408696,
         1057  +    0.042916387274,
         1058  +    0.019679866044,
         1059  +    -0.088543630623,
         1060  +    -0.017520746267,
         1061  +    0.155538731877,
         1062  +    0.026900308804,
         1063  +    -0.264497231446,
         1064  +    -0.110927598348,
         1065  +    0.449718251149,
         1066  +    0.699825214057,
         1067  +    0.424215360813,
         1068  +    0.099305765374,
         1069  +};
         1070  +
         1071  +static coeff_t beylkin_highpass_synthesis_coeffs[] = {
         1072  +    -0.099305765374,
         1073  +    0.424215360813,
         1074  +    -0.699825214057,
         1075  +    0.449718251149,
         1076  +    0.110927598348,
         1077  +    -0.264497231446,
         1078  +    -0.026900308804,
         1079  +    0.155538731877,
         1080  +    0.017520746267,
         1081  +    -0.088543630623,
         1082  +    -0.019679866044,
         1083  +    0.042916387274,
         1084  +    0.017460408696,
         1085  +    -0.014365807969,
         1086  +    -0.010040411845,
         1087  +    0.001484234782,
         1088  +    0.002736031626,
         1089  +    0.000640485329,
         1090  +};
         1091  +
         1092  +static filter_t beylkin_lowpass_analysis = {
         1093  +    18,
         1094  +    ANTICAUSAL,
         1095  +    LOWPASS_ANALYSIS,
         1096  +    beylkin_lowpass_analysis_coeffs,
         1097  +};
         1098  +
         1099  +static filter_t beylkin_highpass_analysis = {
         1100  +    18,
         1101  +    ANTICAUSAL,
         1102  +    HIGHPASS_ANALYSIS,
         1103  +    beylkin_highpass_analysis_coeffs,
         1104  +};
         1105  +
         1106  +static filter_t beylkin_lowpass_synthesis = {
         1107  +    18,
         1108  +    CAUSAL,
         1109  +    LOWPASS_SYNTHESIS,
         1110  +    beylkin_lowpass_synthesis_coeffs,
         1111  +};
         1112  +
         1113  +static filter_t beylkin_highpass_synthesis = {
         1114  +    18,
         1115  +    CAUSAL,
         1116  +    HIGHPASS_SYNTHESIS,
         1117  +    beylkin_highpass_synthesis_coeffs,
         1118  +};
         1119  +
         1120  +static filterbank_t beylkin = {
         1121  +    "beylkin",
         1122  +    "Beylkin",
         1123  +    ORTHOGONAL,
         1124  +    &beylkin_lowpass_analysis,
         1125  +    &beylkin_highpass_analysis,
         1126  +    &beylkin_lowpass_synthesis,
         1127  +    &beylkin_highpass_synthesis,
         1128  +};
         1129  +
         1130  +/* The Vaidyanathan filter gives an exact reconstruction, but does not
         1131  + * satisfy any moment condition.  The filter has been optimized for
         1132  + * speech coding. */
         1133  +
         1134  +static coeff_t vaidyanathan_lowpass_analysis_coeffs[] = {
         1135  +    -0.000062906118,
         1136  +    0.000343631905,
         1137  +    -0.000453956620,
         1138  +    -0.000944897136,
         1139  +    0.002843834547,
         1140  +    0.000708137504,
         1141  +    -0.008839103409,
         1142  +    0.003153847056,
         1143  +    0.019687215010,
         1144  +    -0.014853448005,
         1145  +    -0.035470398607,
         1146  +    0.038742619293,
         1147  +    0.055892523691,
         1148  +    -0.077709750902,
         1149  +    -0.083928884366,
         1150  +    0.131971661417,
         1151  +    0.135084227129,
         1152  +    -0.194450471766,
         1153  +    -0.263494802488,
         1154  +    0.201612161775,
         1155  +    0.635601059872,
         1156  +    0.572797793211,
         1157  +    0.250184129505,
         1158  +    0.045799334111,
         1159  +};
         1160  +
         1161  +static coeff_t vaidyanathan_highpass_analysis_coeffs[] = {
         1162  +    0.045799334111,
         1163  +    -0.250184129505,
         1164  +    0.572797793211,
         1165  +    -0.635601059872,
         1166  +    0.201612161775,
         1167  +    0.263494802488,
         1168  +    -0.194450471766,
         1169  +    -0.135084227129,
         1170  +    0.131971661417,
         1171  +    0.083928884366,
         1172  +    -0.077709750902,
         1173  +    -0.055892523691,
         1174  +    0.038742619293,
         1175  +    0.035470398607,
         1176  +    -0.014853448005,
         1177  +    -0.019687215010,
         1178  +    0.003153847056,
         1179  +    0.008839103409,
         1180  +    0.000708137504,
         1181  +    -0.002843834547,
         1182  +    -0.000944897136,
         1183  +    0.000453956620,
         1184  +    0.000343631905,
         1185  +    0.000062906118,
         1186  +};
         1187  +
         1188  +static coeff_t vaidyanathan_lowpass_synthesis_coeffs[] = {
         1189  +    0.045799334111,
         1190  +    0.250184129505,
         1191  +    0.572797793211,
         1192  +    0.635601059872,
         1193  +    0.201612161775,
         1194  +    -0.263494802488,
         1195  +    -0.194450471766,
         1196  +    0.135084227129,
         1197  +    0.131971661417,
         1198  +    -0.083928884366,
         1199  +    -0.077709750902,
         1200  +    0.055892523691,
         1201  +    0.038742619293,
         1202  +    -0.035470398607,
         1203  +    -0.014853448005,
         1204  +    0.019687215010,
         1205  +    0.003153847056,
         1206  +    -0.008839103409,
         1207  +    0.000708137504,
         1208  +    0.002843834547,
         1209  +    -0.000944897136,
         1210  +    -0.000453956620,
         1211  +    0.000343631905,
         1212  +    -0.000062906118,
         1213  +};
         1214  +
         1215  +static coeff_t vaidyanathan_highpass_synthesis_coeffs[] = {
         1216  +    0.000062906118,
         1217  +    0.000343631905,
         1218  +    0.000453956620,
         1219  +    -0.000944897136,
         1220  +    -0.002843834547,
         1221  +    0.000708137504,
         1222  +    0.008839103409,
         1223  +    0.003153847056,
         1224  +    -0.019687215010,
         1225  +    -0.014853448005,
         1226  +    0.035470398607,
         1227  +    0.038742619293,
         1228  +    -0.055892523691,
         1229  +    -0.077709750902,
         1230  +    0.083928884366,
         1231  +    0.131971661417,
         1232  +    -0.135084227129,
         1233  +    -0.194450471766,
         1234  +    0.263494802488,
         1235  +    0.201612161775,
         1236  +    -0.635601059872,
         1237  +    0.572797793211,
         1238  +    -0.250184129505,
         1239  +    0.045799334111,
         1240  +};
         1241  +
         1242  +static filter_t vaidyanathan_lowpass_analysis = {
         1243  +    24,
         1244  +    ANTICAUSAL,
         1245  +    LOWPASS_ANALYSIS,
         1246  +    vaidyanathan_lowpass_analysis_coeffs,
         1247  +};
         1248  +
         1249  +static filter_t vaidyanathan_highpass_analysis = {
         1250  +    24,
         1251  +    ANTICAUSAL,
         1252  +    HIGHPASS_ANALYSIS,
         1253  +    vaidyanathan_highpass_analysis_coeffs,
         1254  +};
         1255  +
         1256  +static filter_t vaidyanathan_lowpass_synthesis = {
         1257  +    24,
         1258  +    CAUSAL,
         1259  +    LOWPASS_SYNTHESIS,
         1260  +    vaidyanathan_lowpass_synthesis_coeffs,
         1261  +};
         1262  +
         1263  +static filter_t vaidyanathan_highpass_synthesis = {
         1264  +    24,
         1265  +    CAUSAL,
         1266  +    HIGHPASS_SYNTHESIS,
         1267  +    vaidyanathan_highpass_synthesis_coeffs,
         1268  +};
         1269  +
         1270  +static filterbank_t vaidyanathan = {
         1271  +    "vaidyanathan",
         1272  +    "Vaidyanathan",
         1273  +    ORTHOGONAL,
         1274  +    &vaidyanathan_lowpass_analysis,
         1275  +    &vaidyanathan_highpass_analysis,
         1276  +    &vaidyanathan_lowpass_synthesis,
         1277  +    &vaidyanathan_highpass_synthesis,
         1278  +};
         1279  +
         1280  +/* Coeflet �6 filter. */
         1281  +
         1282  +static coeff_t coiflet6_lowpass_analysis_coeffs[] = {
         1283  +    0.038580777748,
         1284  +    -0.126969125396,
         1285  +    -0.077161555496,
         1286  +    0.607491641386,
         1287  +    0.745687558934,
         1288  +    0.226584265197,
         1289  +};
         1290  +
         1291  +static coeff_t coiflet6_highpass_analysis_coeffs[] = {
         1292  +    0.226584265197,
         1293  +    -0.745687558934,
         1294  +    0.607491641386,
         1295  +    0.077161555496,
         1296  +    -0.126969125396,
         1297  +    -0.038580777748,
         1298  +};
         1299  +
         1300  +static coeff_t coiflet6_lowpass_synthesis_coeffs[] = {
         1301  +    0.226584265197,
         1302  +    0.745687558934,
         1303  +    0.607491641386,
         1304  +    -0.077161555496,
         1305  +    -0.126969125396,
         1306  +    0.038580777748,
         1307  +};
         1308  +
         1309  +static coeff_t coiflet6_highpass_synthesis_coeffs[] = {
         1310  +    -0.038580777748,
         1311  +    -0.126969125396,
         1312  +    0.077161555496,
         1313  +    0.607491641386,
         1314  +    -0.745687558934,
         1315  +    0.226584265197,
         1316  +};
         1317  +
         1318  +static filter_t coiflet6_lowpass_analysis = {
         1319  +    6,
         1320  +    ANTICAUSAL,
         1321  +    LOWPASS_ANALYSIS,
         1322  +    coiflet6_lowpass_analysis_coeffs,
         1323  +};
         1324  +
         1325  +static filter_t coiflet6_highpass_analysis = {
         1326  +    6,
         1327  +    ANTICAUSAL,
         1328  +    HIGHPASS_ANALYSIS,
         1329  +    coiflet6_highpass_analysis_coeffs,
         1330  +};
         1331  +
         1332  +static filter_t coiflet6_lowpass_synthesis = {
         1333  +    6,
         1334  +    CAUSAL,
         1335  +    LOWPASS_SYNTHESIS,
         1336  +    coiflet6_lowpass_synthesis_coeffs,
         1337  +};
         1338  +
         1339  +static filter_t coiflet6_highpass_synthesis = {
         1340  +    6,
         1341  +    CAUSAL,
         1342  +    HIGHPASS_SYNTHESIS,
         1343  +    coiflet6_highpass_synthesis_coeffs,
         1344  +};
         1345  +
         1346  +static filterbank_t coiflet6 = {
         1347  +    "coiflet6",
         1348  +    "Coeflet C6",
         1349  +    ORTHOGONAL,
         1350  +    &coiflet6_lowpass_analysis,
         1351  +    &coiflet6_highpass_analysis,
         1352  +    &coiflet6_lowpass_synthesis,
         1353  +    &coiflet6_highpass_synthesis,
         1354  +};
         1355  +
         1356  +/* Coeflet C12 filter. */
         1357  +
         1358  +static coeff_t coiflet12_lowpass_analysis_coeffs[] = {
         1359  +    0.016387336463,
         1360  +    -0.041464936782,
         1361  +    -0.067372554722,
         1362  +    0.386110066823,
         1363  +    0.812723635450,
         1364  +    0.417005184424,
         1365  +    -0.076488599078,
         1366  +    -0.059434418646,
         1367  +    0.023680171947,
         1368  +    0.005611434819,
         1369  +    -0.001823208871,
         1370  +    -0.000720549445,
         1371  +};
         1372  +
         1373  +static coeff_t coiflet12_highpass_analysis_coeffs[] = {
         1374  +    -0.000720549445,
         1375  +    0.001823208871,
         1376  +    0.005611434819,
         1377  +    -0.023680171947,
         1378  +    -0.059434418646,
         1379  +    0.076488599078,
         1380  +    0.417005184424,
         1381  +    -0.812723635450,
         1382  +    0.386110066823,
         1383  +    0.067372554722,
         1384  +    -0.041464936782,
         1385  +    -0.016387336463,
         1386  +};
         1387  +
         1388  +static coeff_t coiflet12_lowpass_synthesis_coeffs[] = {
         1389  +    -0.000720549445,
         1390  +    -0.001823208871,
         1391  +    0.005611434819,
         1392  +    0.023680171947,
         1393  +    -0.059434418646,
         1394  +    -0.076488599078,
         1395  +    0.417005184424,
         1396  +    0.812723635450,
         1397  +    0.386110066823,
         1398  +    -0.067372554722,
         1399  +    -0.041464936782,
         1400  +    0.016387336463,
         1401  +};
         1402  +
         1403  +static coeff_t coiflet12_highpass_synthesis_coeffs[] = {
         1404  +    -0.016387336463,
         1405  +    -0.041464936782,
         1406  +    0.067372554722,
         1407  +    0.386110066823,
         1408  +    -0.812723635450,
         1409  +    0.417005184424,
         1410  +    0.076488599078,
         1411  +    -0.059434418646,
         1412  +    -0.023680171947,
         1413  +    0.005611434819,
         1414  +    0.001823208871,
         1415  +    -0.000720549445,
         1416  +};
         1417  +
         1418  +static filter_t coiflet12_lowpass_analysis = {
         1419  +    12,
         1420  +    ANTICAUSAL,
         1421  +    LOWPASS_ANALYSIS,
         1422  +    coiflet12_lowpass_analysis_coeffs,
         1423  +};
         1424  +
         1425  +static filter_t coiflet12_highpass_analysis = {
         1426  +    12,
         1427  +    ANTICAUSAL,
         1428  +    HIGHPASS_ANALYSIS,
         1429  +    coiflet12_highpass_analysis_coeffs,
         1430  +};
         1431  +
         1432  +static filter_t coiflet12_lowpass_synthesis = {
         1433  +    12,
         1434  +    CAUSAL,
         1435  +    LOWPASS_SYNTHESIS,
         1436  +    coiflet12_lowpass_synthesis_coeffs,
         1437  +};
         1438  +
         1439  +static filter_t coiflet12_highpass_synthesis = {
         1440  +    12,
         1441  +    CAUSAL,
         1442  +    HIGHPASS_SYNTHESIS,
         1443  +    coiflet12_highpass_synthesis_coeffs,
         1444  +};
         1445  +
         1446  +static filterbank_t coiflet12 = {
         1447  +    "coiflet12",
         1448  +    "Coeflet C12",
         1449  +    ORTHOGONAL,
         1450  +    &coiflet12_lowpass_analysis,
         1451  +    &coiflet12_highpass_analysis,
         1452  +    &coiflet12_lowpass_synthesis,
         1453  +    &coiflet12_highpass_synthesis,
         1454  +};
         1455  +
         1456  +/* Coeflet C18 filter. */
         1457  +
         1458  +static coeff_t coiflet18_lowpass_analysis_coeffs[] = {
         1459  +    -0.003793512864,
         1460  +    0.007782596426,
         1461  +    0.023452696142,
         1462  +    -0.065771911281,
         1463  +    -0.061123390003,
         1464  +    0.405176902410,
         1465  +    0.793777222626,
         1466  +    0.428483476378,
         1467  +    -0.071799821619,
         1468  +    -0.082301927106,
         1469  +    0.034555027573,
         1470  +    0.015880544864,
         1471  +    -0.009007976137,
         1472  +    -0.002574517688,
         1473  +    0.001117518771,
         1474  +    0.000466216960,
         1475  +    -0.000070983303,
         1476  +    -0.000034599773,
         1477  +};
         1478  +
         1479  +static coeff_t coiflet18_highpass_analysis_coeffs[] = {
         1480  +    -0.000034599773,
         1481  +    0.000070983303,
         1482  +    0.000466216960,
         1483  +    -0.001117518771,
         1484  +    -0.002574517688,
         1485  +    0.009007976137,
         1486  +    0.015880544864,
         1487  +    -0.034555027573,
         1488  +    -0.082301927106,
         1489  +    0.071799821619,
         1490  +    0.428483476378,
         1491  +    -0.793777222626,
         1492  +    0.405176902410,
         1493  +    0.061123390003,
         1494  +    -0.065771911281,
         1495  +    -0.023452696142,
         1496  +    0.007782596426,
         1497  +    0.003793512864,
         1498  +};
         1499  +
         1500  +static coeff_t coiflet18_lowpass_synthesis_coeffs[] = {
         1501  +    -0.000034599773,
         1502  +    -0.000070983303,
         1503  +    0.000466216960,
         1504  +    0.001117518771,
         1505  +    -0.002574517688,
         1506  +    -0.009007976137,
         1507  +    0.015880544864,
         1508  +    0.034555027573,
         1509  +    -0.082301927106,
         1510  +    -0.071799821619,
         1511  +    0.428483476378,
         1512  +    0.793777222626,
         1513  +    0.405176902410,
         1514  +    -0.061123390003,
         1515  +    -0.065771911281,
         1516  +    0.023452696142,
         1517  +    0.007782596426,
         1518  +    -0.003793512864,
         1519  +};
         1520  +
         1521  +static coeff_t coiflet18_highpass_synthesis_coeffs[] = {
         1522  +    0.003793512864,
         1523  +    0.007782596426,
         1524  +    -0.023452696142,
         1525  +    -0.065771911281,
         1526  +    0.061123390003,
         1527  +    0.405176902410,
         1528  +    -0.793777222626,
         1529  +    0.428483476378,
         1530  +    0.071799821619,
         1531  +    -0.082301927106,
         1532  +    -0.034555027573,
         1533  +    0.015880544864,
         1534  +    0.009007976137,
         1535  +    -0.002574517688,
         1536  +    -0.001117518771,
         1537  +    0.000466216960,
         1538  +    0.000070983303,
         1539  +    -0.000034599773,
         1540  +};
         1541  +
         1542  +static filter_t coiflet18_lowpass_analysis = {
         1543  +    18,
         1544  +    ANTICAUSAL,
         1545  +    LOWPASS_ANALYSIS,
         1546  +    coiflet18_lowpass_analysis_coeffs,
         1547  +};
         1548  +
         1549  +static filter_t coiflet18_highpass_analysis = {
         1550  +    18,
         1551  +    ANTICAUSAL,
         1552  +    HIGHPASS_ANALYSIS,
         1553  +    coiflet18_highpass_analysis_coeffs,
         1554  +};
         1555  +
         1556  +static filter_t coiflet18_lowpass_synthesis = {
         1557  +    18,
         1558  +    CAUSAL,
         1559  +    LOWPASS_SYNTHESIS,
         1560  +    coiflet18_lowpass_synthesis_coeffs,
         1561  +};
         1562  +
         1563  +static filter_t coiflet18_highpass_synthesis = {
         1564  +    18,
         1565  +    CAUSAL,
         1566  +    HIGHPASS_SYNTHESIS,
         1567  +    coiflet18_highpass_synthesis_coeffs,
         1568  +};
         1569  +
         1570  +static filterbank_t coiflet18 = {
         1571  +    "coiflet18",
         1572  +    "Coeflet C18",
         1573  +    ORTHOGONAL,
         1574  +    &coiflet18_lowpass_analysis,
         1575  +    &coiflet18_highpass_analysis,
         1576  +    &coiflet18_lowpass_synthesis,
         1577  +    &coiflet18_highpass_synthesis,
         1578  +};
         1579  +
         1580  +/* Coeflet C24 filter. */
         1581  +
         1582  +static coeff_t coiflet24_lowpass_analysis_coeffs[] = {
         1583  +    0.000892313668,
         1584  +    -0.001629492013,
         1585  +    -0.007346166328,
         1586  +    0.016068943964,
         1587  +    0.026682300156,
         1588  +    -0.081266699680,
         1589  +    -0.056077313316,
         1590  +    0.415308407030,
         1591  +    0.782238930920,
         1592  +    0.434386056491,
         1593  +    -0.066627474263,
         1594  +    -0.096220442034,
         1595  +    0.039334427123,
         1596  +    0.025082261845,
         1597  +    -0.015211731527,
         1598  +    -0.005658286686,
         1599  +    0.003751436157,
         1600  +    0.001266561929,
         1601  +    -0.000589020757,
         1602  +    -0.000259974552,
         1603  +    0.000062339034,
         1604  +    0.000031229876,
         1605  +    -0.000003259680,
         1606  +    -0.000001784985,
         1607  +};
         1608  +
         1609  +static coeff_t coiflet24_highpass_analysis_coeffs[] = {
         1610  +    -0.000001784985,
         1611  +    0.000003259680,
         1612  +    0.000031229876,
         1613  +    -0.000062339034,
         1614  +    -0.000259974552,
         1615  +    0.000589020757,
         1616  +    0.001266561929,
         1617  +    -0.003751436157,
         1618  +    -0.005658286686,
         1619  +    0.015211731527,
         1620  +    0.025082261845,
         1621  +    -0.039334427123,
         1622  +    -0.096220442034,
         1623  +    0.066627474263,
         1624  +    0.434386056491,
         1625  +    -0.782238930920,
         1626  +    0.415308407030,
         1627  +    0.056077313316,
         1628  +    -0.081266699680,
         1629  +    -0.026682300156,
         1630  +    0.016068943964,
         1631  +    0.007346166328,
         1632  +    -0.001629492013,
         1633  +    -0.000892313668,
         1634  +};
         1635  +
         1636  +static coeff_t coiflet24_lowpass_synthesis_coeffs[] = {
         1637  +    -0.000001784985,
         1638  +    -0.000003259680,
         1639  +    0.000031229876,
         1640  +    0.000062339034,
         1641  +    -0.000259974552,
         1642  +    -0.000589020757,
         1643  +    0.001266561929,
         1644  +    0.003751436157,
         1645  +    -0.005658286686,
         1646  +    -0.015211731527,
         1647  +    0.025082261845,
         1648  +    0.039334427123,
         1649  +    -0.096220442034,
         1650  +    -0.066627474263,
         1651  +    0.434386056491,
         1652  +    0.782238930920,
         1653  +    0.415308407030,
         1654  +    -0.056077313316,
         1655  +    -0.081266699680,
         1656  +    0.026682300156,
         1657  +    0.016068943964,
         1658  +    -0.007346166328,
         1659  +    -0.001629492013,
         1660  +    0.000892313668,
         1661  +};
         1662  +
         1663  +static coeff_t coiflet24_highpass_synthesis_coeffs[] = {
         1664  +    -0.000892313668,
         1665  +    -0.001629492013,
         1666  +    0.007346166328,
         1667  +    0.016068943964,
         1668  +    -0.026682300156,
         1669  +    -0.081266699680,
         1670  +    0.056077313316,
         1671  +    0.415308407030,
         1672  +    -0.782238930920,
         1673  +    0.434386056491,
         1674  +    0.066627474263,
         1675  +    -0.096220442034,
         1676  +    -0.039334427123,
         1677  +    0.025082261845,
         1678  +    0.015211731527,
         1679  +    -0.005658286686,
         1680  +    -0.003751436157,
         1681  +    0.001266561929,
         1682  +    0.000589020757,
         1683  +    -0.000259974552,
         1684  +    -0.000062339034,
         1685  +    0.000031229876,
         1686  +    0.000003259680,
         1687  +    -0.000001784985,
         1688  +};
         1689  +
         1690  +static filter_t coiflet24_lowpass_analysis = {
         1691  +    24,
         1692  +    ANTICAUSAL,
         1693  +    LOWPASS_ANALYSIS,
         1694  +    coiflet24_lowpass_analysis_coeffs,
         1695  +};
         1696  +
         1697  +static filter_t coiflet24_highpass_analysis = {
         1698  +    24,
         1699  +    ANTICAUSAL,
         1700  +    HIGHPASS_ANALYSIS,
         1701  +    coiflet24_highpass_analysis_coeffs,
         1702  +};
         1703  +
         1704  +static filter_t coiflet24_lowpass_synthesis = {
         1705  +    24,
         1706  +    CAUSAL,
         1707  +    LOWPASS_SYNTHESIS,
         1708  +    coiflet24_lowpass_synthesis_coeffs,
         1709  +};
         1710  +
         1711  +static filter_t coiflet24_highpass_synthesis = {
         1712  +    24,
         1713  +    CAUSAL,
         1714  +    HIGHPASS_SYNTHESIS,
         1715  +    coiflet24_highpass_synthesis_coeffs,
         1716  +};
         1717  +
         1718  +static filterbank_t coiflet24 = {
         1719  +    "coiflet24",
         1720  +    "Coeflet C24",
         1721  +    ORTHOGONAL,
         1722  +    &coiflet24_lowpass_analysis,
         1723  +    &coiflet24_highpass_analysis,
         1724  +    &coiflet24_lowpass_synthesis,
         1725  +    &coiflet24_highpass_synthesis,
         1726  +};
         1727  +
         1728  +/* Coiflet C30 filter. */
         1729  +
         1730  +static coeff_t coiflet30_lowpass_analysis_coeffs[] = {
         1731  +    -0.000212080863,
         1732  +    0.000358589677,
         1733  +    0.002178236305,
         1734  +    -0.004159358782,
         1735  +    -0.010131117538,
         1736  +    0.023408156762,
         1737  +    0.028168029062,
         1738  +    -0.091920010549,
         1739  +    -0.052043163216,
         1740  +    0.421566206729,
         1741  +    0.774289603740,
         1742  +    0.437991626228,
         1743  +    -0.062035963906,
         1744  +    -0.105574208706,
         1745  +    0.041289208741,
         1746  +    0.032683574283,
         1747  +    -0.019761779012,
         1748  +    -0.009164231153,
         1749  +    0.006764185419,
         1750  +    0.002433373209,
         1751  +    -0.001662863769,
         1752  +    -0.000638131296,
         1753  +    0.000302259520,
         1754  +    0.000140541149,
         1755  +    -0.000041340484,
         1756  +    -0.000021315014,
         1757  +    0.000003734597,
         1758  +    0.000002063806,
         1759  +    -0.000000167408,
         1760  +    -0.000000095158,
         1761  +};
         1762  +
         1763  +static coeff_t coiflet30_highpass_analysis_coeffs[] = {
         1764  +    -0.000000095158,
         1765  +    0.000000167408,
         1766  +    0.000002063806,
         1767  +    -0.000003734597,
         1768  +    -0.000021315014,
         1769  +    0.000041340484,
         1770  +    0.000140541149,
         1771  +    -0.000302259520,
         1772  +    -0.000638131296,
         1773  +    0.001662863769,
         1774  +    0.002433373209,
         1775  +    -0.006764185419,
         1776  +    -0.009164231153,
         1777  +    0.019761779012,
         1778  +    0.032683574283,
         1779  +    -0.041289208741,
         1780  +    -0.105574208706,
         1781  +    0.062035963906,
         1782  +    0.437991626228,
         1783  +    -0.774289603740,
         1784  +    0.421566206729,
         1785  +    0.052043163216,
         1786  +    -0.091920010549,
         1787  +    -0.028168029062,
         1788  +    0.023408156762,
         1789  +    0.010131117538,
         1790  +    -0.004159358782,
         1791  +    -0.002178236305,
         1792  +    0.000358589677,
         1793  +    0.000212080863,
         1794  +};
         1795  +
         1796  +static coeff_t coiflet30_lowpass_synthesis_coeffs[] = {
         1797  +    -0.000000095158,
         1798  +    -0.000000167408,
         1799  +    0.000002063806,
         1800  +    0.000003734597,
         1801  +    -0.000021315014,
         1802  +    -0.000041340484,
         1803  +    0.000140541149,
         1804  +    0.000302259520,
         1805  +    -0.000638131296,
         1806  +    -0.001662863769,
         1807  +    0.002433373209,
         1808  +    0.006764185419,
         1809  +    -0.009164231153,
         1810  +    -0.019761779012,
         1811  +    0.032683574283,
         1812  +    0.041289208741,
         1813  +    -0.105574208706,
         1814  +    -0.062035963906,
         1815  +    0.437991626228,
         1816  +    0.774289603740,
         1817  +    0.421566206729,
         1818  +    -0.052043163216,
         1819  +    -0.091920010549,
         1820  +    0.028168029062,
         1821  +    0.023408156762,
         1822  +    -0.010131117538,
         1823  +    -0.004159358782,
         1824  +    0.002178236305,
         1825  +    0.000358589677,
         1826  +    -0.000212080863,
         1827  +};
         1828  +
         1829  +static coeff_t coiflet30_highpass_synthesis_coeffs[] = {
         1830  +    0.000212080863,
         1831  +    0.000358589677,
         1832  +    -0.002178236305,
         1833  +    -0.004159358782,
         1834  +    0.010131117538,
         1835  +    0.023408156762,
         1836  +    -0.028168029062,
         1837  +    -0.091920010549,
         1838  +    0.052043163216,
         1839  +    0.421566206729,
         1840  +    -0.774289603740,
         1841  +    0.437991626228,
         1842  +    0.062035963906,
         1843  +    -0.105574208706,
         1844  +    -0.041289208741,
         1845  +    0.032683574283,
         1846  +    0.019761779012,
         1847  +    -0.009164231153,
         1848  +    -0.006764185419,
         1849  +    0.002433373209,
         1850  +    0.001662863769,
         1851  +    -0.000638131296,
         1852  +    -0.000302259520,
         1853  +    0.000140541149,
         1854  +    0.000041340484,
         1855  +    -0.000021315014,
         1856  +    -0.000003734597,
         1857  +    0.000002063806,
         1858  +    0.000000167408,
         1859  +    -0.000000095158,
         1860  +};
         1861  +
         1862  +static filter_t coiflet30_lowpass_analysis = {
         1863  +    30,
         1864  +    ANTICAUSAL,
         1865  +    LOWPASS_ANALYSIS,
         1866  +    coiflet30_lowpass_analysis_coeffs,
         1867  +};
         1868  +
         1869  +static filter_t coiflet30_highpass_analysis = {
         1870  +    30,
         1871  +    ANTICAUSAL,
         1872  +    HIGHPASS_ANALYSIS,
         1873  +    coiflet30_highpass_analysis_coeffs,
         1874  +};
         1875  +
         1876  +static filter_t coiflet30_lowpass_synthesis = {
         1877  +    30,
         1878  +    CAUSAL,
         1879  +    LOWPASS_SYNTHESIS,
         1880  +    coiflet30_lowpass_synthesis_coeffs,
         1881  +};
         1882  +
         1883  +static filter_t coiflet30_highpass_synthesis = {
         1884  +    30,
         1885  +    CAUSAL,
         1886  +    HIGHPASS_SYNTHESIS,
         1887  +    coiflet30_highpass_synthesis_coeffs,
         1888  +};
         1889  +
         1890  +static filterbank_t coiflet30 = {
         1891  +    "coiflet30",
         1892  +    "Coiflet C30",
         1893  +    ORTHOGONAL,
         1894  +    &coiflet30_lowpass_analysis,
         1895  +    &coiflet30_highpass_analysis,
         1896  +    &coiflet30_lowpass_synthesis,
         1897  +    &coiflet30_highpass_synthesis,
         1898  +};
         1899  +
         1900  +/* Symmlets are wavelets within a minimum size support for a given
         1901  + * number of vanishing moments, but they are as symmetrical as possible,
         1902  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         1903  +
         1904  +static coeff_t symmlet8_lowpass_analysis_coeffs[] = {
         1905  +    -0.075765714789357,
         1906  +    -0.029635527645960,
         1907  +    0.497618667632563,
         1908  +    0.803738751805386,
         1909  +    0.297857795605605,
         1910  +    -0.099219543576956,
         1911  +    -0.012603967262264,
         1912  +    0.032223100604078,
         1913  +};
         1914  +
         1915  +static coeff_t symmlet8_highpass_analysis_coeffs[] = {
         1916  +    0.032223100604078,
         1917  +    0.012603967262264,
         1918  +    -0.099219543576956,
         1919  +    -0.297857795605605,
         1920  +    0.803738751805386,
         1921  +    -0.497618667632563,
         1922  +    -0.029635527645960,
         1923  +    0.075765714789357,
         1924  +};
         1925  +
         1926  +static coeff_t symmlet8_lowpass_synthesis_coeffs[] = {
         1927  +    0.032223100604078,
         1928  +    -0.012603967262264,
         1929  +    -0.099219543576956,
         1930  +    0.297857795605605,
         1931  +    0.803738751805386,
         1932  +    0.497618667632563,
         1933  +    -0.029635527645960,
         1934  +    -0.075765714789357,
         1935  +};
         1936  +
         1937  +static coeff_t symmlet8_highpass_synthesis_coeffs[] = {
         1938  +    0.075765714789357,
         1939  +    -0.029635527645960,
         1940  +    -0.497618667632563,
         1941  +    0.803738751805386,
         1942  +    -0.297857795605605,
         1943  +    -0.099219543576956,
         1944  +    0.012603967262264,
         1945  +    0.032223100604078,
         1946  +};
         1947  +
         1948  +static filter_t symmlet8_lowpass_analysis = {
         1949  +    8,
         1950  +    ANTICAUSAL,
         1951  +    LOWPASS_ANALYSIS,
         1952  +    symmlet8_lowpass_analysis_coeffs,
         1953  +};
         1954  +
         1955  +static filter_t symmlet8_highpass_analysis = {
         1956  +    8,
         1957  +    ANTICAUSAL,
         1958  +    HIGHPASS_ANALYSIS,
         1959  +    symmlet8_highpass_analysis_coeffs,
         1960  +};
         1961  +
         1962  +static filter_t symmlet8_lowpass_synthesis = {
         1963  +    8,
         1964  +    CAUSAL,
         1965  +    LOWPASS_SYNTHESIS,
         1966  +    symmlet8_lowpass_synthesis_coeffs,
         1967  +};
         1968  +
         1969  +static filter_t symmlet8_highpass_synthesis = {
         1970  +    8,
         1971  +    CAUSAL,
         1972  +    HIGHPASS_SYNTHESIS,
         1973  +    symmlet8_highpass_synthesis_coeffs,
         1974  +};
         1975  +
         1976  +static filterbank_t symmlet8 = {
         1977  +    "symmlet8",
         1978  +    "Symmlet S8",
         1979  +    ORTHOGONAL,
         1980  +    &symmlet8_lowpass_analysis,
         1981  +    &symmlet8_highpass_analysis,
         1982  +    &symmlet8_lowpass_synthesis,
         1983  +    &symmlet8_highpass_synthesis,
         1984  +};
         1985  +
         1986  +/* Symmlets are wavelets within a minimum size support for a given
         1987  + * number of vanishing moments, but they are as symmetrical as possible,
         1988  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         1989  +
         1990  +static coeff_t symmlet10_lowpass_analysis_coeffs[] = {
         1991  +    0.027333068345163,
         1992  +    0.029519490926072,
         1993  +    -0.039134249302581,
         1994  +    0.199397533976983,
         1995  +    0.723407690403764,
         1996  +    0.633978963456911,
         1997  +    0.016602105764423,
         1998  +    -0.175328089908097,
         1999  +    -0.021101834024929,
         2000  +    0.019538882735386,
         2001  +};
         2002  +
         2003  +static coeff_t symmlet10_highpass_analysis_coeffs[] = {
         2004  +    0.019538882735386,
         2005  +    0.021101834024929,
         2006  +    -0.175328089908097,
         2007  +    -0.016602105764423,
         2008  +    0.633978963456911,
         2009  +    -0.723407690403764,
         2010  +    0.199397533976983,
         2011  +    0.039134249302581,
         2012  +    0.029519490926072,
         2013  +    -0.027333068345163,
         2014  +};
         2015  +
         2016  +static coeff_t symmlet10_lowpass_synthesis_coeffs[] = {
         2017  +    0.019538882735386,
         2018  +    -0.021101834024929,
         2019  +    -0.175328089908097,
         2020  +    0.016602105764423,
         2021  +    0.633978963456911,
         2022  +    0.723407690403764,
         2023  +    0.199397533976983,
         2024  +    -0.039134249302581,
         2025  +    0.029519490926072,
         2026  +    0.027333068345163,
         2027  +};
         2028  +
         2029  +static coeff_t symmlet10_highpass_synthesis_coeffs[] = {
         2030  +    -0.027333068345163,
         2031  +    0.029519490926072,
         2032  +    0.039134249302581,
         2033  +    0.199397533976983,
         2034  +    -0.723407690403764,
         2035  +    0.633978963456911,
         2036  +    -0.016602105764423,
         2037  +    -0.175328089908097,
         2038  +    0.021101834024929,
         2039  +    0.019538882735386,
         2040  +};
         2041  +
         2042  +static filter_t symmlet10_lowpass_analysis = {
         2043  +    10,
         2044  +    ANTICAUSAL,
         2045  +    LOWPASS_ANALYSIS,
         2046  +    symmlet10_lowpass_analysis_coeffs,
         2047  +};
         2048  +
         2049  +static filter_t symmlet10_highpass_analysis = {
         2050  +    10,
         2051  +    ANTICAUSAL,
         2052  +    HIGHPASS_ANALYSIS,
         2053  +    symmlet10_highpass_analysis_coeffs,
         2054  +};
         2055  +
         2056  +static filter_t symmlet10_lowpass_synthesis = {
         2057  +    10,
         2058  +    CAUSAL,
         2059  +    LOWPASS_SYNTHESIS,
         2060  +    symmlet10_lowpass_synthesis_coeffs,
         2061  +};
         2062  +
         2063  +static filter_t symmlet10_highpass_synthesis = {
         2064  +    10,
         2065  +    CAUSAL,
         2066  +    HIGHPASS_SYNTHESIS,
         2067  +    symmlet10_highpass_synthesis_coeffs,
         2068  +};
         2069  +
         2070  +static filterbank_t symmlet10 = {
         2071  +    "symmlet10",
         2072  +    "Symmlet S10",
         2073  +    ORTHOGONAL,
         2074  +    &symmlet10_lowpass_analysis,
         2075  +    &symmlet10_highpass_analysis,
         2076  +    &symmlet10_lowpass_synthesis,
         2077  +    &symmlet10_highpass_synthesis,
         2078  +};
         2079  +
         2080  +/* Symmlets are wavelets within a minimum size support for a given
         2081  + * number of vanishing moments, but they are as symmetrical as possible,
         2082  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2083  +
         2084  +static coeff_t symmlet12_lowpass_analysis_coeffs[] = {
         2085  +    0.015404109327339,
         2086  +    0.003490712084331,
         2087  +    -0.117990111148417,
         2088  +    -0.048311742586001,
         2089  +    0.491055941927666,
         2090  +    0.787641141028836,
         2091  +    0.337929421728258,
         2092  +    -0.072637522786604,
         2093  +    -0.021060292512697,
         2094  +    0.044724901770751,
         2095  +    0.001767711864398,
         2096  +    -0.007800708324765,
         2097  +};
         2098  +
         2099  +static coeff_t symmlet12_highpass_analysis_coeffs[] = {
         2100  +    -0.007800708324765,
         2101  +    -0.001767711864398,
         2102  +    0.044724901770751,
         2103  +    0.021060292512697,
         2104  +    -0.072637522786604,
         2105  +    -0.337929421728258,
         2106  +    0.787641141028836,
         2107  +    -0.491055941927666,
         2108  +    -0.048311742586001,
         2109  +    0.117990111148417,
         2110  +    0.003490712084331,
         2111  +    -0.015404109327339,
         2112  +};
         2113  +
         2114  +static coeff_t symmlet12_lowpass_synthesis_coeffs[] = {
         2115  +    -0.007800708324765,
         2116  +    0.001767711864398,
         2117  +    0.044724901770751,
         2118  +    -0.021060292512697,
         2119  +    -0.072637522786604,
         2120  +    0.337929421728258,
         2121  +    0.787641141028836,
         2122  +    0.491055941927666,
         2123  +    -0.048311742586001,
         2124  +    -0.117990111148417,
         2125  +    0.003490712084331,
         2126  +    0.015404109327339,
         2127  +};
         2128  +
         2129  +static coeff_t symmlet12_highpass_synthesis_coeffs[] = {
         2130  +    -0.015404109327339,
         2131  +    0.003490712084331,
         2132  +    0.117990111148417,
         2133  +    -0.048311742586001,
         2134  +    -0.491055941927666,
         2135  +    0.787641141028836,
         2136  +    -0.337929421728258,
         2137  +    -0.072637522786604,
         2138  +    0.021060292512697,
         2139  +    0.044724901770751,
         2140  +    -0.001767711864398,
         2141  +    -0.007800708324765,
         2142  +};
         2143  +
         2144  +static filter_t symmlet12_lowpass_analysis = {
         2145  +    12,
         2146  +    ANTICAUSAL,
         2147  +    LOWPASS_ANALYSIS,
         2148  +    symmlet12_lowpass_analysis_coeffs,
         2149  +};
         2150  +
         2151  +static filter_t symmlet12_highpass_analysis = {
         2152  +    12,
         2153  +    ANTICAUSAL,
         2154  +    HIGHPASS_ANALYSIS,
         2155  +    symmlet12_highpass_analysis_coeffs,
         2156  +};
         2157  +
         2158  +static filter_t symmlet12_lowpass_synthesis = {
         2159  +    12,
         2160  +    CAUSAL,
         2161  +    LOWPASS_SYNTHESIS,
         2162  +    symmlet12_lowpass_synthesis_coeffs,
         2163  +};
         2164  +
         2165  +static filter_t symmlet12_highpass_synthesis = {
         2166  +    12,
         2167  +    CAUSAL,
         2168  +    HIGHPASS_SYNTHESIS,
         2169  +    symmlet12_highpass_synthesis_coeffs,
         2170  +};
         2171  +
         2172  +static filterbank_t symmlet12 = {
         2173  +    "symmlet12",
         2174  +    "Symmlet S12",
         2175  +    ORTHOGONAL,
         2176  +    &symmlet12_lowpass_analysis,
         2177  +    &symmlet12_highpass_analysis,
         2178  +    &symmlet12_lowpass_synthesis,
         2179  +    &symmlet12_highpass_synthesis,
         2180  +};
         2181  +
         2182  +/* Symmlets are wavelets within a minimum size support for a given
         2183  + * number of vanishing moments, but they are as symmetrical as possible,
         2184  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2185  +
         2186  +static coeff_t symmlet14_lowpass_analysis_coeffs[] = {
         2187  +    0.002681814568116,
         2188  +    -0.001047384888965,
         2189  +    -0.012636303403152,
         2190  +    0.030515513165906,
         2191  +    0.067892693501598,
         2192  +    -0.049552834937041,
         2193  +    0.017441255087110,
         2194  +    0.536101917090782,
         2195  +    0.767764317004585,
         2196  +    0.288629631750988,
         2197  +    -0.140047240442706,
         2198  +    -0.107808237703619,
         2199  +    0.004010244871703,
         2200  +    0.010268176708497,
         2201  +};
         2202  +
         2203  +static coeff_t symmlet14_highpass_analysis_coeffs[] = {
         2204  +    0.010268176708497,
         2205  +    -0.004010244871703,
         2206  +    -0.107808237703619,
         2207  +    0.140047240442706,
         2208  +    0.288629631750988,
         2209  +    -0.767764317004585,
         2210  +    0.536101917090782,
         2211  +    -0.017441255087110,
         2212  +    -0.049552834937041,
         2213  +    -0.067892693501598,
         2214  +    0.030515513165906,
         2215  +    0.012636303403152,
         2216  +    -0.001047384888965,
         2217  +    -0.002681814568116,
         2218  +};
         2219  +
         2220  +static coeff_t symmlet14_lowpass_synthesis_coeffs[] = {
         2221  +    0.010268176708497,
         2222  +    0.004010244871703,
         2223  +    -0.107808237703619,
         2224  +    -0.140047240442706,
         2225  +    0.288629631750988,
         2226  +    0.767764317004585,
         2227  +    0.536101917090782,
         2228  +    0.017441255087110,
         2229  +    -0.049552834937041,
         2230  +    0.067892693501598,
         2231  +    0.030515513165906,
         2232  +    -0.012636303403152,
         2233  +    -0.001047384888965,
         2234  +    0.002681814568116,
         2235  +};
         2236  +
         2237  +static coeff_t symmlet14_highpass_synthesis_coeffs[] = {
         2238  +    -0.002681814568116,
         2239  +    -0.001047384888965,
         2240  +    0.012636303403152,
         2241  +    0.030515513165906,
         2242  +    -0.067892693501598,
         2243  +    -0.049552834937041,
         2244  +    -0.017441255087110,
         2245  +    0.536101917090782,
         2246  +    -0.767764317004585,
         2247  +    0.288629631750988,
         2248  +    0.140047240442706,
         2249  +    -0.107808237703619,
         2250  +    -0.004010244871703,
         2251  +    0.010268176708497,
         2252  +};
         2253  +
         2254  +static filter_t symmlet14_lowpass_analysis = {
         2255  +    14,
         2256  +    ANTICAUSAL,
         2257  +    LOWPASS_ANALYSIS,
         2258  +    symmlet14_lowpass_analysis_coeffs,
         2259  +};
         2260  +
         2261  +static filter_t symmlet14_highpass_analysis = {
         2262  +    14,
         2263  +    ANTICAUSAL,
         2264  +    HIGHPASS_ANALYSIS,
         2265  +    symmlet14_highpass_analysis_coeffs,
         2266  +};
         2267  +
         2268  +static filter_t symmlet14_lowpass_synthesis = {
         2269  +    14,
         2270  +    CAUSAL,
         2271  +    LOWPASS_SYNTHESIS,
         2272  +    symmlet14_lowpass_synthesis_coeffs,
         2273  +};
         2274  +
         2275  +static filter_t symmlet14_highpass_synthesis = {
         2276  +    14,
         2277  +    CAUSAL,
         2278  +    HIGHPASS_SYNTHESIS,
         2279  +    symmlet14_highpass_synthesis_coeffs,
         2280  +};
         2281  +
         2282  +static filterbank_t symmlet14 = {
         2283  +    "symmlet14",
         2284  +    "Symmlet S14",
         2285  +    ORTHOGONAL,
         2286  +    &symmlet14_lowpass_analysis,
         2287  +    &symmlet14_highpass_analysis,
         2288  +    &symmlet14_lowpass_synthesis,
         2289  +    &symmlet14_highpass_synthesis,
         2290  +};
         2291  +
         2292  +/* Symmlets are wavelets within a minimum size support for a given
         2293  + * number of vanishing moments, but they are as symmetrical as possible,
         2294  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2295  +
         2296  +static coeff_t symmlet16_lowpass_analysis_coeffs[] = {
         2297  +    0.00188995033291,
         2298  +    -0.00030292051455,
         2299  +    -0.01495225833679,
         2300  +    0.00380875201406,
         2301  +    0.04913717967348,
         2302  +    -0.02721902991682,
         2303  +    -0.05194583810788,
         2304  +    0.36444189483599,
         2305  +    0.77718575169981,
         2306  +    0.48135965125924,
         2307  +    -0.06127335906791,
         2308  +    -0.14329423835107,
         2309  +    0.00760748732529,
         2310  +    0.03169508781035,
         2311  +    -0.00054213233164,
         2312  +    -0.00338241595136,
         2313  +};
         2314  +
         2315  +static coeff_t symmlet16_highpass_analysis_coeffs[] = {
         2316  +    -0.00338241595136,
         2317  +    0.00054213233164,
         2318  +    0.03169508781035,
         2319  +    -0.00760748732529,
         2320  +    -0.14329423835107,
         2321  +    0.06127335906791,
         2322  +    0.48135965125924,
         2323  +    -0.77718575169981,
         2324  +    0.36444189483599,
         2325  +    0.05194583810788,
         2326  +    -0.02721902991682,
         2327  +    -0.04913717967348,
         2328  +    0.00380875201406,
         2329  +    0.01495225833679,
         2330  +    -0.00030292051455,
         2331  +    -0.00188995033291,
         2332  +};
         2333  +
         2334  +static coeff_t symmlet16_lowpass_synthesis_coeffs[] = {
         2335  +    -0.00338241595136,
         2336  +    -0.00054213233164,
         2337  +    0.03169508781035,
         2338  +    0.00760748732529,
         2339  +    -0.14329423835107,
         2340  +    -0.06127335906791,
         2341  +    0.48135965125924,
         2342  +    0.77718575169981,
         2343  +    0.36444189483599,
         2344  +    -0.05194583810788,
         2345  +    -0.02721902991682,
         2346  +    0.04913717967348,
         2347  +    0.00380875201406,
         2348  +    -0.01495225833679,
         2349  +    -0.00030292051455,
         2350  +    0.00188995033291,
         2351  +};
         2352  +
         2353  +static coeff_t symmlet16_highpass_synthesis_coeffs[] = {
         2354  +    -0.00188995033291,
         2355  +    -0.00030292051455,
         2356  +    0.01495225833679,
         2357  +    0.00380875201406,
         2358  +    -0.04913717967348,
         2359  +    -0.02721902991682,
         2360  +    0.05194583810788,
         2361  +    0.36444189483599,
         2362  +    -0.77718575169981,
         2363  +    0.48135965125924,
         2364  +    0.06127335906791,
         2365  +    -0.14329423835107,
         2366  +    -0.00760748732529,
         2367  +    0.03169508781035,
         2368  +    0.00054213233164,
         2369  +    -0.00338241595136,
         2370  +};
         2371  +
         2372  +static filter_t symmlet16_lowpass_analysis = {
         2373  +    16,
         2374  +    ANTICAUSAL,
         2375  +    LOWPASS_ANALYSIS,
         2376  +    symmlet16_lowpass_analysis_coeffs,
         2377  +};
         2378  +
         2379  +static filter_t symmlet16_highpass_analysis = {
         2380  +    16,
         2381  +    ANTICAUSAL,
         2382  +    HIGHPASS_ANALYSIS,
         2383  +    symmlet16_highpass_analysis_coeffs,
         2384  +};
         2385  +
         2386  +static filter_t symmlet16_lowpass_synthesis = {
         2387  +    16,
         2388  +    CAUSAL,
         2389  +    LOWPASS_SYNTHESIS,
         2390  +    symmlet16_lowpass_synthesis_coeffs,
         2391  +};
         2392  +
         2393  +static filter_t symmlet16_highpass_synthesis = {
         2394  +    16,
         2395  +    CAUSAL,
         2396  +    HIGHPASS_SYNTHESIS,
         2397  +    symmlet16_highpass_synthesis_coeffs,
         2398  +};
         2399  +
         2400  +static filterbank_t symmlet16 = {
         2401  +    "symmlet16",
         2402  +    "Symmlet S16",
         2403  +    ORTHOGONAL,
         2404  +    &symmlet16_lowpass_analysis,
         2405  +    &symmlet16_highpass_analysis,
         2406  +    &symmlet16_lowpass_synthesis,
         2407  +    &symmlet16_highpass_synthesis,
         2408  +};
         2409  +
         2410  +/* Symmlets are wavelets within a minimum size support for a given
         2411  + * number of vanishing moments, but they are as symmetrical as possible,
         2412  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2413  +
         2414  +static coeff_t symmlet18_lowpass_analysis_coeffs[] = {
         2415  +    0.001069490032652,
         2416  +    -0.000473154498587,
         2417  +    -0.010264064027672,
         2418  +    0.008859267493501,
         2419  +    0.062077789302687,
         2420  +    -0.018233770779803,
         2421  +    -0.191550831296252,
         2422  +    0.035272488035891,
         2423  +    0.617338449140593,
         2424  +    0.717897082763343,
         2425  +    0.238760914607125,
         2426  +    -0.054568958430509,
         2427  +    0.000583462746330,
         2428  +    0.030224878857952,
         2429  +    -0.011528210207971,
         2430  +    -0.013271967781517,
         2431  +    0.000619780889054,
         2432  +    0.001400915525570,
         2433  +};
         2434  +
         2435  +static coeff_t symmlet18_highpass_analysis_coeffs[] = {
         2436  +    0.001400915525570,
         2437  +    -0.000619780889054,
         2438  +    -0.013271967781517,
         2439  +    0.011528210207971,
         2440  +    0.030224878857952,
         2441  +    -0.000583462746330,
         2442  +    -0.054568958430509,
         2443  +    -0.238760914607125,
         2444  +    0.717897082763343,
         2445  +    -0.617338449140593,
         2446  +    0.035272488035891,
         2447  +    0.191550831296252,
         2448  +    -0.018233770779803,
         2449  +    -0.062077789302687,
         2450  +    0.008859267493501,
         2451  +    0.010264064027672,
         2452  +    -0.000473154498587,
         2453  +    -0.001069490032652,
         2454  +};
         2455  +
         2456  +static coeff_t symmlet18_lowpass_synthesis_coeffs[] = {
         2457  +    0.001400915525570,
         2458  +    0.000619780889054,
         2459  +    -0.013271967781517,
         2460  +    -0.011528210207971,
         2461  +    0.030224878857952,
         2462  +    0.000583462746330,
         2463  +    -0.054568958430509,
         2464  +    0.238760914607125,
         2465  +    0.717897082763343,
         2466  +    0.617338449140593,
         2467  +    0.035272488035891,
         2468  +    -0.191550831296252,
         2469  +    -0.018233770779803,
         2470  +    0.062077789302687,
         2471  +    0.008859267493501,
         2472  +    -0.010264064027672,
         2473  +    -0.000473154498587,
         2474  +    0.001069490032652,
         2475  +};
         2476  +
         2477  +static coeff_t symmlet18_highpass_synthesis_coeffs[] = {
         2478  +    -0.001069490032652,
         2479  +    -0.000473154498587,
         2480  +    0.010264064027672,
         2481  +    0.008859267493501,
         2482  +    -0.062077789302687,
         2483  +    -0.018233770779803,
         2484  +    0.191550831296252,
         2485  +    0.035272488035891,
         2486  +    -0.617338449140593,
         2487  +    0.717897082763343,
         2488  +    -0.238760914607125,
         2489  +    -0.054568958430509,
         2490  +    -0.000583462746330,
         2491  +    0.030224878857952,
         2492  +    0.011528210207971,
         2493  +    -0.013271967781517,
         2494  +    -0.000619780889054,
         2495  +    0.001400915525570,
         2496  +};
         2497  +
         2498  +static filter_t symmlet18_lowpass_analysis = {
         2499  +    18,
         2500  +    ANTICAUSAL,
         2501  +    LOWPASS_ANALYSIS,
         2502  +    symmlet18_lowpass_analysis_coeffs,
         2503  +};
         2504  +
         2505  +static filter_t symmlet18_highpass_analysis = {
         2506  +    18,
         2507  +    ANTICAUSAL,
         2508  +    HIGHPASS_ANALYSIS,
         2509  +    symmlet18_highpass_analysis_coeffs,
         2510  +};
         2511  +
         2512  +static filter_t symmlet18_lowpass_synthesis = {
         2513  +    18,
         2514  +    CAUSAL,
         2515  +    LOWPASS_SYNTHESIS,
         2516  +    symmlet18_lowpass_synthesis_coeffs,
         2517  +};
         2518  +
         2519  +static filter_t symmlet18_highpass_synthesis = {
         2520  +    18,
         2521  +    CAUSAL,
         2522  +    HIGHPASS_SYNTHESIS,
         2523  +    symmlet18_highpass_synthesis_coeffs,
         2524  +};
         2525  +
         2526  +static filterbank_t symmlet18 = {
         2527  +    "symmlet18",
         2528  +    "Symmlet S18",
         2529  +    ORTHOGONAL,
         2530  +    &symmlet18_lowpass_analysis,
         2531  +    &symmlet18_highpass_analysis,
         2532  +    &symmlet18_lowpass_synthesis,
         2533  +    &symmlet18_highpass_synthesis,
         2534  +};
         2535  +
         2536  +/* Symmlets are wavelets within a minimum size support for a given
         2537  + * number of vanishing moments, but they are as symmetrical as possible,
         2538  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2539  +
         2540  +static coeff_t symmlet20_lowpass_analysis_coeffs[] = {
         2541  +    0.0007701598089417,
         2542  +    9.56326707637102e-05,
         2543  +    -0.0086412992741304,
         2544  +    -0.0014653825830397,
         2545  +    0.0459272392141469,
         2546  +    0.0116098939105411,
         2547  +    -0.1594942788241300,
         2548  +    -0.0708805357960178,
         2549  +    0.4716906667438780,
         2550  +    0.7695100368531890,
         2551  +    0.3838267611450020,
         2552  +    -0.0355367402980268,
         2553  +    -0.0319900568214638,
         2554  +    0.0499949720686861,
         2555  +    0.0057649120443445,
         2556  +    -0.0203549397996833,
         2557  +    -0.0008043589343686,
         2558  +    0.0045931735827084,
         2559  +    5.70360843270715e-05,
         2560  +    -0.0004593294204519,
         2561  +};
         2562  +
         2563  +static coeff_t symmlet20_highpass_analysis_coeffs[] = {
         2564  +    -0.0004593294204519,
         2565  +    -5.70360843270715e-05,
         2566  +    0.0045931735827084,
         2567  +    0.0008043589343686,
         2568  +    -0.0203549397996833,
         2569  +    -0.0057649120443445,
         2570  +    0.0499949720686861,
         2571  +    0.0319900568214638,
         2572  +    -0.0355367402980268,
         2573  +    -0.3838267611450020,
         2574  +    0.7695100368531890,
         2575  +    -0.4716906667438780,
         2576  +    -0.0708805357960178,
         2577  +    0.1594942788241300,
         2578  +    0.0116098939105411,
         2579  +    -0.0459272392141469,
         2580  +    -0.0014653825830397,
         2581  +    0.0086412992741304,
         2582  +    9.56326707637102e-05,
         2583  +    -0.0007701598089417,
         2584  +};
         2585  +
         2586  +static coeff_t symmlet20_lowpass_synthesis_coeffs[] = {
         2587  +    -0.0004593294204519,
         2588  +    5.70360843270715e-05,
         2589  +    0.0045931735827084,
         2590  +    -0.0008043589343686,
         2591  +    -0.0203549397996833,
         2592  +    0.0057649120443445,
         2593  +    0.0499949720686861,
         2594  +    -0.0319900568214638,
         2595  +    -0.0355367402980268,
         2596  +    0.3838267611450020,
         2597  +    0.7695100368531890,
         2598  +    0.4716906667438780,
         2599  +    -0.0708805357960178,
         2600  +    -0.1594942788241300,
         2601  +    0.0116098939105411,
         2602  +    0.0459272392141469,
         2603  +    -0.0014653825830397,
         2604  +    -0.0086412992741304,
         2605  +    9.56326707637102e-05,
         2606  +    0.0007701598089417,
         2607  +};
         2608  +
         2609  +static coeff_t symmlet20_highpass_synthesis_coeffs[] = {
         2610  +    -0.0007701598089417,
         2611  +    9.56326707637102e-05,
         2612  +    0.0086412992741304,
         2613  +    -0.0014653825830397,
         2614  +    -0.0459272392141469,
         2615  +    0.0116098939105411,
         2616  +    0.1594942788241300,
         2617  +    -0.0708805357960178,
         2618  +    -0.4716906667438780,
         2619  +    0.7695100368531890,
         2620  +    -0.3838267611450020,
         2621  +    -0.0355367402980268,
         2622  +    0.0319900568214638,
         2623  +    0.0499949720686861,
         2624  +    -0.0057649120443445,
         2625  +    -0.0203549397996833,
         2626  +    0.0008043589343686,
         2627  +    0.0045931735827084,
         2628  +    -5.70360843270715e-05,
         2629  +    -0.0004593294204519,
         2630  +};
         2631  +
         2632  +static filter_t symmlet20_lowpass_analysis = {
         2633  +    20,
         2634  +    ANTICAUSAL,
         2635  +    LOWPASS_ANALYSIS,
         2636  +    symmlet20_lowpass_analysis_coeffs,
         2637  +};
         2638  +
         2639  +static filter_t symmlet20_highpass_analysis = {
         2640  +    20,
         2641  +    ANTICAUSAL,
         2642  +    HIGHPASS_ANALYSIS,
         2643  +    symmlet20_highpass_analysis_coeffs,
         2644  +};
         2645  +
         2646  +static filter_t symmlet20_lowpass_synthesis = {
         2647  +    20,
         2648  +    CAUSAL,
         2649  +    LOWPASS_SYNTHESIS,
         2650  +    symmlet20_lowpass_synthesis_coeffs,
         2651  +};
         2652  +
         2653  +static filter_t symmlet20_highpass_synthesis = {
         2654  +    20,
         2655  +    CAUSAL,
         2656  +    HIGHPASS_SYNTHESIS,
         2657  +    symmlet20_highpass_synthesis_coeffs,
         2658  +};
         2659  +
         2660  +static filterbank_t symmlet20 = {
         2661  +    "symmlet20",
         2662  +    "Symmlet S20",
         2663  +    ORTHOGONAL,
         2664  +    &symmlet20_lowpass_analysis,
         2665  +    &symmlet20_highpass_analysis,
         2666  +    &symmlet20_lowpass_synthesis,
         2667  +    &symmlet20_highpass_synthesis,
         2668  +};
         2669  +
         2670  +/* Odegard's 9/7 filter. */
         2671  +
         2672  +static coeff_t odegard97_lowpass_analysis_coeffs[] = {
         2673  +    0.7875137715277921,
         2674  +    0.3869718638726204,
         2675  +    -0.0930692637035827,
         2676  +    -0.0334184732793468,
         2677  +    0.0528657685329605,
         2678  +};
         2679  +
         2680  +static coeff_t odegard97_highpass_analysis_coeffs[] = {
         2681  +    -0.8167806349921064,
         2682  +    0.4403017067249854,
         2683  +    0.0548369269027794,
         2684  +    -0.0867483161317116,
         2685  +};
         2686  +
         2687  +static coeff_t odegard97_lowpass_synthesis_coeffs[] = {
         2688  +    0.8167806349921064,
         2689  +    0.4403017067249854,
         2690  +    -0.0548369269027794,
         2691  +    -0.0867483161317116,
         2692  +};
         2693  +
         2694  +static coeff_t odegard97_highpass_synthesis_coeffs[] = {
         2695  +    -0.7875137715277921,
         2696  +    0.3869718638726204,
         2697  +    0.0930692637035827,
         2698  +    -0.0334184732793468,
         2699  +    -0.0528657685329605,
         2700  +};
         2701  +
         2702  +static filter_t odegard97_lowpass_analysis = {
         2703  +    5,
         2704  +    SYMMETRIC_WHOLE,
         2705  +    LOWPASS_ANALYSIS,
         2706  +    odegard97_lowpass_analysis_coeffs,
         2707  +};
         2708  +
         2709  +static filter_t odegard97_highpass_analysis = {
         2710  +    4,
         2711  +    SYMMETRIC_WHOLE,
         2712  +    HIGHPASS_ANALYSIS,
         2713  +    odegard97_highpass_analysis_coeffs,
         2714  +};
         2715  +
         2716  +static filter_t odegard97_lowpass_synthesis = {
         2717  +    4,
         2718  +    SYMMETRIC_WHOLE,
         2719  +    LOWPASS_SYNTHESIS,
         2720  +    odegard97_lowpass_synthesis_coeffs,
         2721  +};
         2722  +
         2723  +static filter_t odegard97_highpass_synthesis = {
         2724  +    5,
         2725  +    SYMMETRIC_WHOLE,
         2726  +    HIGHPASS_SYNTHESIS,
         2727  +    odegard97_highpass_synthesis_coeffs,
         2728  +};
         2729  +
         2730  +static filterbank_t odegard97 = {
         2731  +    "odegard97",
         2732  +    "Odegard 9/7",
         2733  +    BIORTHOGONAL,
         2734  +    &odegard97_lowpass_analysis,
         2735  +    &odegard97_highpass_analysis,
         2736  +    &odegard97_lowpass_synthesis,
         2737  +    &odegard97_highpass_synthesis,
         2738  +};
         2739  +
         2740  +/* 9/7 filter from M. Antonini, M. Barlaud, P. Mathieu, and
         2741  + * I. Daubechies, "Image coding using wavelet transform", IEEE
         2742  + * Transactions on Image Processing, Vol. pp. 205-220, 1992. */
         2743  +
         2744  +static coeff_t daub97_lowpass_analysis_coeffs[] = {
         2745  +    0.8526986790088938,
         2746  +    0.3774028556128306,
         2747  +    -0.1106244044184372,
         2748  +    -0.0238494650195568,
         2749  +    0.0378284555072640,
         2750  +};
         2751  +
         2752  +static coeff_t daub97_highpass_analysis_coeffs[] = {
         2753  +    -0.7884856164063712,
         2754  +    0.4180922732220353,
         2755  +    0.0406894176092047,
         2756  +    -0.0645388826287616,
         2757  +};
         2758  +
         2759  +static coeff_t daub97_lowpass_synthesis_coeffs[] = {
         2760  +    0.7884856164063712,
         2761  +    0.4180922732220353,
         2762  +    -0.0406894176092047,
         2763  +    -0.0645388826287616,
         2764  +};
         2765  +
         2766  +static coeff_t daub97_highpass_synthesis_coeffs[] = {
         2767  +    -0.8526986790088938,
         2768  +    0.3774028556128306,
         2769  +    0.1106244044184372,
         2770  +    -0.0238494650195568,
         2771  +    -0.0378284555072640,
         2772  +};
         2773  +
         2774  +static filter_t daub97_lowpass_analysis = {
         2775  +    5,
         2776  +    SYMMETRIC_WHOLE,
         2777  +    LOWPASS_ANALYSIS,
         2778  +    daub97_lowpass_analysis_coeffs,
         2779  +};
         2780  +
         2781  +static filter_t daub97_highpass_analysis = {
         2782  +    4,
         2783  +    SYMMETRIC_WHOLE,
         2784  +    HIGHPASS_ANALYSIS,
         2785  +    daub97_highpass_analysis_coeffs,
         2786  +};
         2787  +
         2788  +static filter_t daub97_lowpass_synthesis = {
         2789  +    4,
         2790  +    SYMMETRIC_WHOLE,
         2791  +    LOWPASS_SYNTHESIS,
         2792  +    daub97_lowpass_synthesis_coeffs,
         2793  +};
         2794  +
         2795  +static filter_t daub97_highpass_synthesis = {
         2796  +    5,
         2797  +    SYMMETRIC_WHOLE,
         2798  +    HIGHPASS_SYNTHESIS,
         2799  +    daub97_highpass_synthesis_coeffs,
         2800  +};
         2801  +
         2802  +static filterbank_t daub97 = {
         2803  +    "daub97",
         2804  +    "Daubechies 9/7",
         2805  +    BIORTHOGONAL,
         2806  +    &daub97_lowpass_analysis,
         2807  +    &daub97_highpass_analysis,
         2808  +    &daub97_lowpass_synthesis,
         2809  +    &daub97_highpass_synthesis,
         2810  +};
         2811  +
         2812  +static filterbank_t daub97lift = {
         2813  +    "daub97lift",
         2814  +    "Daubechies 9/7 (Lifting)",
         2815  +    BIORTHOGONAL,
         2816  +    NULL,
         2817  +    NULL,
         2818  +    NULL,
         2819  +    NULL,
         2820  +};
         2821  +
         2822  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         2823  + * Compactly Supported Wavelets," Communications on Pure and
         2824  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         2825  +
         2826  +static coeff_t cdf53_lowpass_analysis_coeffs[] = {
         2827  +    1.06066017177982,
         2828  +    0.35355339059327,
         2829  +    -0.17677669529664,
         2830  +};
         2831  +
         2832  +static coeff_t cdf53_highpass_analysis_coeffs[] = {
         2833  +    -0.70710678118655,
         2834  +    0.35355339059327,
         2835  +};
         2836  +
         2837  +static coeff_t cdf53_lowpass_synthesis_coeffs[] = {
         2838  +    0.70710678118655,
         2839  +    0.35355339059327,
         2840  +};
         2841  +
         2842  +static coeff_t cdf53_highpass_synthesis_coeffs[] = {
         2843  +    -1.06066017177982,
         2844  +    0.35355339059327,
         2845  +    0.17677669529664,
         2846  +};
         2847  +
         2848  +static filter_t cdf53_lowpass_analysis = {
         2849  +    3,
         2850  +    SYMMETRIC_WHOLE,
         2851  +    LOWPASS_ANALYSIS,
         2852  +    cdf53_lowpass_analysis_coeffs,
         2853  +};
         2854  +
         2855  +static filter_t cdf53_highpass_analysis = {
         2856  +    2,
         2857  +    SYMMETRIC_WHOLE,
         2858  +    HIGHPASS_ANALYSIS,
         2859  +    cdf53_highpass_analysis_coeffs,
         2860  +};
         2861  +
         2862  +static filter_t cdf53_lowpass_synthesis = {
         2863  +    2,
         2864  +    SYMMETRIC_WHOLE,
         2865  +    LOWPASS_SYNTHESIS,
         2866  +    cdf53_lowpass_synthesis_coeffs,
         2867  +};
         2868  +
         2869  +static filter_t cdf53_highpass_synthesis = {
         2870  +    3,
         2871  +    SYMMETRIC_WHOLE,
         2872  +    HIGHPASS_SYNTHESIS,
         2873  +    cdf53_highpass_synthesis_coeffs,
         2874  +};
         2875  +
         2876  +static filterbank_t cdf53 = {
         2877  +    "cdf53",
         2878  +    "Cohen Daubechies Feauveau 5/3",
         2879  +    BIORTHOGONAL,
         2880  +    &cdf53_lowpass_analysis,
         2881  +    &cdf53_highpass_analysis,
         2882  +    &cdf53_lowpass_synthesis,
         2883  +    &cdf53_highpass_synthesis,
         2884  +};
         2885  +
         2886  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         2887  + * Compactly Supported Wavelets," Communications on Pure and
         2888  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         2889  +
         2890  +static coeff_t cdf93_lowpass_analysis_coeffs[] = {
         2891  +    0.99436891104360,
         2892  +    0.41984465132952,
         2893  +    -0.17677669529665,
         2894  +    -0.06629126073624,
         2895  +    0.03314563036812,
         2896  +};
         2897  +
         2898  +static coeff_t cdf93_highpass_analysis_coeffs[] = {
         2899  +    -0.70710678118655,
         2900  +    0.35355339059327,
         2901  +};
         2902  +
         2903  +static coeff_t cdf93_lowpass_synthesis_coeffs[] = {
         2904  +    0.70710678118655,
         2905  +    0.35355339059327,
         2906  +};
         2907  +
         2908  +static coeff_t cdf93_highpass_synthesis_coeffs[] = {
         2909  +    -0.99436891104360,
         2910  +    0.41984465132952,
         2911  +    0.17677669529665,
         2912  +    -0.06629126073624,
         2913  +    -0.03314563036812,
         2914  +};
         2915  +
         2916  +static filter_t cdf93_lowpass_analysis = {
         2917  +    5,
         2918  +    SYMMETRIC_WHOLE,
         2919  +    LOWPASS_ANALYSIS,
         2920  +    cdf93_lowpass_analysis_coeffs,
         2921  +};
         2922  +
         2923  +static filter_t cdf93_highpass_analysis = {
         2924  +    2,
         2925  +    SYMMETRIC_WHOLE,
         2926  +    HIGHPASS_ANALYSIS,
         2927  +    cdf93_highpass_analysis_coeffs,
         2928  +};
         2929  +
         2930  +static filter_t cdf93_lowpass_synthesis = {
         2931  +    2,
         2932  +    SYMMETRIC_WHOLE,
         2933  +    LOWPASS_SYNTHESIS,
         2934  +    cdf93_lowpass_synthesis_coeffs,
         2935  +};
         2936  +
         2937  +static filter_t cdf93_highpass_synthesis = {
         2938  +    5,
         2939  +    SYMMETRIC_WHOLE,
         2940  +    HIGHPASS_SYNTHESIS,
         2941  +    cdf93_highpass_synthesis_coeffs,
         2942  +};
         2943  +
         2944  +static filterbank_t cdf93 = {
         2945  +    "cdf93",
         2946  +    "Cohen Daubechies Feauveau 9/3",
         2947  +    BIORTHOGONAL,
         2948  +    &cdf93_lowpass_analysis,
         2949  +    &cdf93_highpass_analysis,
         2950  +    &cdf93_lowpass_synthesis,
         2951  +    &cdf93_highpass_synthesis,
         2952  +};
         2953  +
         2954  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         2955  + * Compactly Supported Wavelets," Communications on Pure and
         2956  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         2957  +
         2958  +static coeff_t cdf133_lowpass_analysis_coeffs[] = {
         2959  +    0.96674755240348,
         2960  +    0.44746600996961,
         2961  +    -0.16987135563661,
         2962  +    -0.10772329869638,
         2963  +    0.04695630968816,
         2964  +    0.01381067932004,
         2965  +    -0.00690533966002,
         2966  +};
         2967  +
         2968  +static coeff_t cdf133_highpass_analysis_coeffs[] = {
         2969  +    -0.70710678118655,
         2970  +    0.35355339059327,
         2971  +};
         2972  +
         2973  +static coeff_t cdf133_lowpass_synthesis_coeffs[] = {
         2974  +    0.70710678118655,
         2975  +    0.35355339059327,
         2976  +};
         2977  +
         2978  +static coeff_t cdf133_highpass_synthesis_coeffs[] = {
         2979  +    -0.96674755240348,
         2980  +    0.44746600996961,
         2981  +    0.16987135563661,
         2982  +    -0.10772329869638,
         2983  +    -0.04695630968816,
         2984  +    0.01381067932004,
         2985  +    0.00690533966002,
         2986  +};
         2987  +
         2988  +static filter_t cdf133_lowpass_analysis = {
         2989  +    7,
         2990  +    SYMMETRIC_WHOLE,
         2991  +    LOWPASS_ANALYSIS,
         2992  +    cdf133_lowpass_analysis_coeffs,
         2993  +};
         2994  +
         2995  +static filter_t cdf133_highpass_analysis = {
         2996  +    2,
         2997  +    SYMMETRIC_WHOLE,
         2998  +    HIGHPASS_ANALYSIS,
         2999  +    cdf133_highpass_analysis_coeffs,
         3000  +};
         3001  +
         3002  +static filter_t cdf133_lowpass_synthesis = {
         3003  +    2,
         3004  +    SYMMETRIC_WHOLE,
         3005  +    LOWPASS_SYNTHESIS,
         3006  +    cdf133_lowpass_synthesis_coeffs,
         3007  +};
         3008  +
         3009  +static filter_t cdf133_highpass_synthesis = {
         3010  +    7,
         3011  +    SYMMETRIC_WHOLE,
         3012  +    HIGHPASS_SYNTHESIS,
         3013  +    cdf133_highpass_synthesis_coeffs,
         3014  +};
         3015  +
         3016  +static filterbank_t cdf133 = {
         3017  +    "cdf133",
         3018  +    "Cohen Daubechies Feauveau 13/3",
         3019  +    BIORTHOGONAL,
         3020  +    &cdf133_lowpass_analysis,
         3021  +    &cdf133_highpass_analysis,
         3022  +    &cdf133_lowpass_synthesis,
         3023  +    &cdf133_highpass_synthesis,
         3024  +};
         3025  +
         3026  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         3027  + * Compactly Supported Wavelets," Communications on Pure and
         3028  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         3029  +
         3030  +static coeff_t cdf173_lowpass_analysis_coeffs[] = {
         3031  +    0.95164212189717,
         3032  +    0.46257144047591,
         3033  +    -0.16382918343409,
         3034  +    -0.13491307360773,
         3035  +    0.05299848189069,
         3036  +    0.02891610982635,
         3037  +    -0.01294751186254,
         3038  +    -0.00302108610126,
         3039  +    0.00151054305063,
         3040  +};
         3041  +
         3042  +static coeff_t cdf173_highpass_analysis_coeffs[] = {
         3043  +    -0.70710678118655,
         3044  +    0.35355339059327,
         3045  +};
         3046  +
         3047  +static coeff_t cdf173_lowpass_synthesis_coeffs[] = {
         3048  +    0.70710678118655,
         3049  +    0.35355339059327,
         3050  +};
         3051  +
         3052  +static coeff_t cdf173_highpass_synthesis_coeffs[] = {
         3053  +    -0.95164212189717,
         3054  +    0.46257144047591,
         3055  +    0.16382918343409,
         3056  +    -0.13491307360773,
         3057  +    -0.05299848189069,
         3058  +    0.02891610982635,
         3059  +    0.01294751186254,
         3060  +    -0.00302108610126,
         3061  +    -0.00151054305063,
         3062  +};
         3063  +
         3064  +static filter_t cdf173_lowpass_analysis = {
         3065  +    9,
         3066  +    SYMMETRIC_WHOLE,
         3067  +    LOWPASS_ANALYSIS,
         3068  +    cdf173_lowpass_analysis_coeffs,
         3069  +};
         3070  +
         3071  +static filter_t cdf173_highpass_analysis = {
         3072  +    2,
         3073  +    SYMMETRIC_WHOLE,
         3074  +    HIGHPASS_ANALYSIS,
         3075  +    cdf173_highpass_analysis_coeffs,
         3076  +};
         3077  +
         3078  +static filter_t cdf173_lowpass_synthesis = {
         3079  +    2,
         3080  +    SYMMETRIC_WHOLE,
         3081  +    LOWPASS_SYNTHESIS,
         3082  +    cdf173_lowpass_synthesis_coeffs,
         3083  +};
         3084  +
         3085  +static filter_t cdf173_highpass_synthesis = {
         3086  +    9,
         3087  +    SYMMETRIC_WHOLE,
         3088  +    HIGHPASS_SYNTHESIS,
         3089  +    cdf173_highpass_synthesis_coeffs,
         3090  +};
         3091  +
         3092  +static filterbank_t cdf173 = {
         3093  +    "cdf173",
         3094  +    "Cohen Daubechies Feauveau 17/3",
         3095  +    BIORTHOGONAL,
         3096  +    &cdf173_lowpass_analysis,
         3097  +    &cdf173_highpass_analysis,
         3098  +    &cdf173_lowpass_synthesis,
         3099  +    &cdf173_highpass_synthesis,
         3100  +};
         3101  +
         3102  +/* Filter from J. Villasenor, B. Belzer, J. Liao, "Wavelet Filter
         3103  + * Evaluation for Image Compression." IEEE Transactions on Image
         3104  + * Processing, Vol. 2, pp. 1053-1060, August 1995. */
         3105  +
         3106  +static coeff_t villa1311_lowpass_analysis_coeffs[] = {
         3107  +    0.7672451593927493,
         3108  +    0.3832692613243884,
         3109  +    -0.0688781141906103,
         3110  +    -0.0334750810478015,
         3111  +    0.0472817528288275,
         3112  +    0.0037592103166868,
         3113  +    -0.0084728277413181,
         3114  +};
         3115  +
         3116  +static coeff_t villa1311_highpass_analysis_coeffs[] = {
         3117  +    -0.8328475700934288,
         3118  +    0.4481085999263908,
         3119  +    0.0691627101203004,
         3120  +    -0.1087373652243805,
         3121  +    -0.0062923156668598,
         3122  +    0.0141821558912635,
         3123  +};
         3124  +
         3125  +static coeff_t villa1311_lowpass_synthesis_coeffs[] = {
         3126  +    0.8328475700934288,
         3127  +    0.4481085999263908,
         3128  +    -0.0691627101203004,
         3129  +    -0.1087373652243805,
         3130  +    0.0062923156668598,
         3131  +    0.0141821558912635,
         3132  +};
         3133  +
         3134  +static coeff_t villa1311_highpass_synthesis_coeffs[] = {
         3135  +    -0.7672451593927493,
         3136  +    0.3832692613243884,
         3137  +    0.0688781141906103,
         3138  +    -0.0334750810478015,
         3139  +    -0.0472817528288275,
         3140  +    0.0037592103166868,
         3141  +    0.0084728277413181,
         3142  +};
         3143  +
         3144  +static filter_t villa1311_lowpass_analysis = {
         3145  +    7,
         3146  +    SYMMETRIC_WHOLE,
         3147  +    LOWPASS_ANALYSIS,
         3148  +    villa1311_lowpass_analysis_coeffs,
         3149  +};
         3150  +
         3151  +static filter_t villa1311_highpass_analysis = {
         3152  +    6,
         3153  +    SYMMETRIC_WHOLE,
         3154  +    HIGHPASS_ANALYSIS,
         3155  +    villa1311_highpass_analysis_coeffs,
         3156  +};
         3157  +
         3158  +static filter_t villa1311_lowpass_synthesis = {
         3159  +    6,
         3160  +    SYMMETRIC_WHOLE,
         3161  +    LOWPASS_SYNTHESIS,
         3162  +    villa1311_lowpass_synthesis_coeffs,
         3163  +};
         3164  +
         3165  +static filter_t villa1311_highpass_synthesis = {
         3166  +    7,
         3167  +    SYMMETRIC_WHOLE,
         3168  +    HIGHPASS_SYNTHESIS,
         3169  +    villa1311_highpass_synthesis_coeffs,
         3170  +};
         3171  +
         3172  +static filterbank_t villa1311 = {
         3173  +    "villa1311",
         3174  +    "Villasenor 13/11",
         3175  +    BIORTHOGONAL,
         3176  +    &villa1311_lowpass_analysis,
         3177  +    &villa1311_highpass_analysis,
         3178  +    &villa1311_lowpass_synthesis,
         3179  +    &villa1311_highpass_synthesis,
         3180  +};
         3181  +
         3182  +/* Append filterbank reference to this array: this is the only
         3183  + * thing you need to do by hand. The rest of the work will be done
         3184  + * by the make_filterbank.pl utility: just cut-and-paste its output. */
         3185  +
         3186  +filterbank_t *filterbanks[] = {
         3187  +    &haar,
         3188  +    &daub4,
         3189  +    &daub6,
         3190  +    &daub8,
         3191  +    &daub10,
         3192  +    &daub12,
         3193  +    &daub14,
         3194  +    &daub16,
         3195  +    &daub18,
         3196  +    &daub20,
         3197  +    &beylkin,
         3198  +    &vaidyanathan,
         3199  +    &coiflet6,
         3200  +    &coiflet12,
         3201  +    &coiflet18,
         3202  +    &coiflet24,
         3203  +    &coiflet30,
         3204  +    &symmlet8,
         3205  +    &symmlet10,
         3206  +    &symmlet12,
         3207  +    &symmlet14,
         3208  +    &symmlet16,
         3209  +    &symmlet18,
         3210  +    &symmlet20,
         3211  +    &odegard97,
         3212  +    &daub97,
         3213  +    &daub97lift,
         3214  +    &cdf53,
         3215  +    &cdf93,
         3216  +    &cdf133,
         3217  +    &cdf173,
         3218  +    &villa1311,
         3219  +    NULL
         3220  +};

Added epsilon/filterbank.h.

            1  +/*
            2  + * $Id: filterbank.h,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Filter banks
           27  + *
           28  + *  This file holds defines for filter and filterbank
           29  + *  data structures.
           30  + *
           31  + *  \section References
           32  + *
           33  + *  Gilbert Strang, Truong Nguyen "Wavelets and Filter Banks". */
           34  +
           35  +#ifndef __FILTERBANK_H__
           36  +#define __FILTERBANK_H__
           37  +
           38  +#ifdef __cplusplus
           39  +extern "C"
           40  +{
           41  +#endif
           42  +
           43  +/** \addtogroup wavelet Wavelet transform */
           44  +/*@{*/
           45  +
           46  +#include <common.h>
           47  +
           48  +/** Causal filter: h[i] = 0, i < 0 */
           49  +#define CAUSAL                  0
           50  +/** Anticausal filter: h[i] = 0, i > 0 */
           51  +#define ANTICAUSAL              1
           52  +/** Symmetric-whole filter: h[-i] = h[i] */
           53  +#define SYMMETRIC_WHOLE         2
           54  +/** Symmetric-half filter: h[-i] = h[i - 1] */
           55  +#define SYMMETRIC_HALF          3
           56  +
           57  +/** Lowpass analysis filter */
           58  +#define LOWPASS_ANALYSIS        0
           59  +/** Highpass analysis filter */
           60  +#define HIGHPASS_ANALYSIS       1
           61  +/** Lowpass synthesis filter */
           62  +#define LOWPASS_SYNTHESIS       2
           63  +/** Highpass synthesis filter */
           64  +#define HIGHPASS_SYNTHESIS      3
           65  +
           66  +/** Orthogonal filterbank */
           67  +#define ORTHOGONAL              0
           68  +/** Biothogonal filterbank */
           69  +#define BIORTHOGONAL            1
           70  +
           71  +/** Even subsampling phase */
           72  +#define PHASE_EVEN              0
           73  +/** Odd subsampling phase */
           74  +#define PHASE_ODD               1
           75  +
           76  +/** Filter structure
           77  + *
           78  + *  This structure represents a standalone filter.
           79  + *
           80  + *  \note There is no need to keep all coefficients for symmetric
           81  + *  filters. Only half (h[i], i >= 0) of them is kept. */
           82  +    typedef struct filter_t_tag
           83  +    {
           84  +    /** Filter length */
           85  +	int length;
           86  +    /** Filter causality */
           87  +	int causality;
           88  +    /** Filter type */
           89  +	int type;
           90  +    /** Filter coefficients */
           91  +	coeff_t *coeffs;
           92  +    } filter_t;
           93  +
           94  +/** Filterbank structure
           95  + *
           96  + *  Filter bank consists of two filter pairs. */
           97  +    typedef struct filterbank_t_tag
           98  +    {
           99  +    /** Short filter name (for a program) */
          100  +	char *id;
          101  +    /** Long filter name (for a user) */
          102  +	char *name;
          103  +    /** Filterbank type */
          104  +	int type;
          105  +    /** Lowpass analysis filter */
          106  +	filter_t *lowpass_analysis;
          107  +    /** Highpass analysis filter */
          108  +	filter_t *highpass_analysis;
          109  +    /** Lowpass synthesis filter */
          110  +	filter_t *lowpass_synthesis;
          111  +    /** Highpass synthesis filter */
          112  +	filter_t *highpass_synthesis;
          113  +    } filterbank_t;
          114  +
          115  +/** External array of all available filter banks
          116  + *
          117  + *  This array hold pointers to all available filter banks.
          118  + *  Last element is always \c NULL. */
          119  +    extern filterbank_t *filterbanks[];
          120  +
          121  +/*@}*/
          122  +
          123  +#ifdef __cplusplus
          124  +}
          125  +#endif
          126  +
          127  +#endif				/* __FILTERBANK_H__ */

Added epsilon/libmain.c.

            1  +/*
            2  + * $Id: libmain.c,v 1.59 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <epsilon.h>
           25  +#include <libmain.h>
           26  +#include <common.h>
           27  +#include <filter.h>
           28  +#include <filterbank.h>
           29  +#include <cobs.h>
           30  +#include <color.h>
           31  +#include <mem_alloc.h>
           32  +#include <dc_level.h>
           33  +#include <resample.h>
           34  +#include <checksum.h>
           35  +#include <pad.h>
           36  +#include <merge_split.h>
           37  +#include <speck.h>
           38  +#include <string.h>
           39  +
           40  +#if defined(_WIN32) && !defined(__MINGW32__)
           41  +#define snprintf	_snprintf
           42  +#endif /* not using the MSVC compiler */
           43  +
           44  +local void
           45  +round_channel (coeff_t ** in_channel, int **out_channel, int channel_size)
           46  +{
           47  +    int i, j;
           48  +
           49  +    for (i = 0; i < channel_size; i++)
           50  +      {
           51  +	  for (j = 0; j < channel_size; j++)
           52  +	    {
           53  +		out_channel[i][j] = (int) ROUND (in_channel[i][j]);
           54  +	    }
           55  +      }
           56  +}
           57  +
           58  +local void
           59  +copy_channel (int **in_channel, coeff_t ** out_channel, int channel_size)
           60  +{
           61  +    int i, j;
           62  +
           63  +    /* Expand data from int to coeff_t */
           64  +    for (i = 0; i < channel_size; i++)
           65  +      {
           66  +	  for (j = 0; j < channel_size; j++)
           67  +	    {
           68  +		out_channel[i][j] = in_channel[i][j];
           69  +	    }
           70  +      }
           71  +}
           72  +
           73  +local void
           74  +reset_RGB (unsigned char **block_R, unsigned char **block_G,
           75  +	   unsigned char **block_B, int width, int height)
           76  +{
           77  +    int i, j;
           78  +
           79  +    /* Reset everything to zero */
           80  +    for (i = 0; i < height; i++)
           81  +      {
           82  +	  for (j = 0; j < width; j++)
           83  +	    {
           84  +		block_R[i][j] = block_G[i][j] = block_B[i][j] = 0;
           85  +	    }
           86  +      }
           87  +}
           88  +
           89  +local void
           90  +reset_Y (unsigned char **block_Y, int width, int height)
           91  +{
           92  +    int i, j;
           93  +
           94  +    /* Reset everything to zero */
           95  +    for (i = 0; i < height; i++)
           96  +      {
           97  +	  for (j = 0; j < width; j++)
           98  +	    {
           99  +		block_Y[i][j] = 0;
          100  +	    }
          101  +      }
          102  +}
          103  +
          104  +local filterbank_t *
          105  +get_fb (char *id)
          106  +{
          107  +    int i, n;
          108  +
          109  +    /* Get the number of all available filterbanks */
          110  +    for (n = 0; filterbanks[n]; n++);
          111  +
          112  +    /* Find id in the list */
          113  +    for (i = 0; i < n; i++)
          114  +      {
          115  +	  if (strcmp (id, filterbanks[i]->id) == 0)
          116  +	    {
          117  +		return filterbanks[i];
          118  +	    }
          119  +      }
          120  +
          121  +    return NULL;
          122  +}
          123  +
          124  +local int
          125  +get_block_size (int w, int h, int mode, int min)
          126  +{
          127  +    int max = MAX (MAX (w, h), min);
          128  +    int bits = number_of_bits (max);
          129  +
          130  +    if (mode == EPS_MODE_NORMAL)
          131  +      {
          132  +	  /* W = H = 2 ^ N */
          133  +	  if (max == (1 << (bits - 1)))
          134  +	    {
          135  +		return max;
          136  +	    }
          137  +	  else
          138  +	    {
          139  +		return (1 << bits);
          140  +	    }
          141  +      }
          142  +    else
          143  +      {
          144  +	  /* W = H = 2 ^ N + 1 */
          145  +	  if (max == (1 << (bits - 1)) + 1)
          146  +	    {
          147  +		return max;
          148  +	    }
          149  +	  else if (max == (1 << (bits - 1)))
          150  +	    {
          151  +		return max + 1;
          152  +	    }
          153  +	  else
          154  +	    {
          155  +		return (1 << bits) + 1;
          156  +	    }
          157  +      }
          158  +}
          159  +
          160  +local int
          161  +terminate_header (unsigned char *buf, int buf_size, int n_fields)
          162  +{
          163  +    int field, i;
          164  +
          165  +    /* Report an error if data contains at least one zero byte */
          166  +    for (i = 0; i < buf_size; i++)
          167  +      {
          168  +	  if (!buf[i])
          169  +	    {
          170  +		return EPS_FORMAT_ERROR;
          171  +	    }
          172  +      }
          173  +
          174  +    /* Find n-th occurence of ';' symbol and replace it with zero */
          175  +    for (i = 0, field = 1; i < buf_size; i++)
          176  +      {
          177  +	  if (buf[i] == ';')
          178  +	    {
          179  +		if (field == n_fields)
          180  +		  {
          181  +		      buf[i] = 0;
          182  +		      return EPS_OK;
          183  +		  }
          184  +
          185  +		field++;
          186  +	    }
          187  +      }
          188  +
          189  +    return EPS_FORMAT_ERROR;
          190  +}
          191  +
          192  +local void
          193  +unterminate_header (unsigned char *buf)
          194  +{
          195  +    buf[strlen ((char *) buf)] = ';';
          196  +}
          197  +
          198  +local int
          199  +header_sanity_check (unsigned char *buf)
          200  +{
          201  +    int i, len;
          202  +
          203  +    len = strlen ((char *) buf);
          204  +
          205  +    /* Check header for malicious symbols */
          206  +    for (i = 0; i < len; i++)
          207  +      {
          208  +	  if ((buf[i] >= 'A') && (buf[i] <= 'Z'))
          209  +	    {
          210  +		continue;
          211  +	    }
          212  +
          213  +	  if ((buf[i] >= 'a') && (buf[i] <= 'z'))
          214  +	    {
          215  +		continue;
          216  +	    }
          217  +
          218  +	  if ((buf[i] >= '0') && (buf[i] <= '9'))
          219  +	    {
          220  +		continue;
          221  +	    }
          222  +
          223  +	  if ((buf[i] == ';') || (buf[i] == '=') ||
          224  +	      (buf[i] == '-') || (buf[i] == ':'))
          225  +	    {
          226  +		continue;
          227  +	    }
          228  +
          229  +	  return EPS_FORMAT_ERROR;
          230  +      }
          231  +
          232  +    return EPS_OK;
          233  +}
          234  +
          235  +local int
          236  +read_gs_header (unsigned char *buf, int buf_size, eps_block_header * hdr)
          237  +{
          238  +    filterbank_t *fb;
          239  +
          240  +    char fb_id[32];
          241  +
          242  +    crc32_t hdr_crc;
          243  +    crc32_t data_crc;
          244  +
          245  +    int result;
          246  +    int len;
          247  +    int n;
          248  +
          249  +    char *chk_pos;
          250  +    char *str;
          251  +
          252  +    /* Sanity checks */
          253  +    if (!buf || !hdr)
          254  +      {
          255  +	  return EPS_PARAM_ERROR;
          256  +      }
          257  +
          258  +    if (buf_size < 1)
          259  +      {
          260  +	  return EPS_PARAM_ERROR;
          261  +      }
          262  +
          263  +    /* Terminate header for ease of processing */
          264  +    if (terminate_header (buf, buf_size, 12) != EPS_OK)
          265  +      {
          266  +	  return EPS_FORMAT_ERROR;
          267  +      }
          268  +
          269  +    /* Check for maliciuos symbols */
          270  +    if (header_sanity_check (buf) != EPS_OK)
          271  +      {
          272  +	  unterminate_header (buf);
          273  +	  return EPS_FORMAT_ERROR;
          274  +      }
          275  +
          276  +    /* Handle header as a regular null-terminated string */
          277  +    str = (char *) buf;
          278  +    len = strlen (str);
          279  +
          280  +    /* Mark the position of header CRC field */
          281  +    chk_pos = strstr (str, "chk=");
          282  +
          283  +    /* Parse header fields */
          284  +    result = sscanf (str,
          285  +		     "type=gs;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;"
          286  +		     "m=%d;dc=%d;fb=%31[a-z0-9];chk=%x;crc=%x%n",
          287  +		     &hdr->uhdr.gs.W, &hdr->uhdr.gs.H, &hdr->uhdr.gs.w,
          288  +		     &hdr->uhdr.gs.h, &hdr->uhdr.gs.x, &hdr->uhdr.gs.y,
          289  +		     &hdr->uhdr.gs.mode, &hdr->uhdr.gs.dc, fb_id, &hdr->chk,
          290  +		     &hdr->crc, &n);
          291  +
          292  +    unterminate_header (buf);
          293  +
          294  +    /* Check for parsing errors (see also sscanf(3)) */
          295  +    if ((result < 11) || (n != len))
          296  +      {
          297  +	  return EPS_FORMAT_ERROR;
          298  +      }
          299  +
          300  +    /* Compute header & data size */
          301  +    hdr->hdr_size = len + 1;
          302  +    hdr->data_size = buf_size - hdr->hdr_size;
          303  +
          304  +    /* Sanity checks */
          305  +    assert (hdr->data_size >= 0);
          306  +    assert (hdr->hdr_size + hdr->data_size == buf_size);
          307  +
          308  +    /* Check transform mode */
          309  +    if ((hdr->uhdr.gs.mode != EPS_MODE_NORMAL)
          310  +	&& (hdr->uhdr.gs.mode != EPS_MODE_OTLPF))
          311  +      {
          312  +	  return EPS_FORMAT_ERROR;
          313  +      }
          314  +
          315  +    /* Check image (W, H) and block (w, y, w, h) parameters for consistency */
          316  +    if ((hdr->uhdr.gs.W <= 0) || (hdr->uhdr.gs.H <= 0))
          317  +      {
          318  +	  return EPS_FORMAT_ERROR;
          319  +      }
          320  +
          321  +    if ((hdr->uhdr.gs.w < 1) || (hdr->uhdr.gs.h < 1))
          322  +      {
          323  +	  return EPS_FORMAT_ERROR;
          324  +      }
          325  +
          326  +    if (hdr->uhdr.gs.w > EPS_MAX_BLOCK_SIZE + hdr->uhdr.gs.mode ==
          327  +	EPS_MODE_OTLPF)
          328  +      {
          329  +	  return EPS_FORMAT_ERROR;
          330  +      }
          331  +
          332  +    if (hdr->uhdr.gs.h > EPS_MAX_BLOCK_SIZE + hdr->uhdr.gs.mode ==
          333  +	EPS_MODE_OTLPF)
          334  +      {
          335  +	  return EPS_FORMAT_ERROR;
          336  +      }
          337  +
          338  +    if ((hdr->uhdr.gs.x < 0) || (hdr->uhdr.gs.y < 0))
          339  +      {
          340  +	  return EPS_FORMAT_ERROR;
          341  +      }
          342  +
          343  +    if (hdr->uhdr.gs.x + hdr->uhdr.gs.w > hdr->uhdr.gs.W)
          344  +      {
          345  +	  return EPS_FORMAT_ERROR;
          346  +      }
          347  +
          348  +    if (hdr->uhdr.gs.y + hdr->uhdr.gs.h > hdr->uhdr.gs.H)
          349  +      {
          350  +	  return EPS_FORMAT_ERROR;
          351  +      }
          352  +
          353  +    /* Check DC level */
          354  +    if ((hdr->uhdr.gs.dc < 0) || (hdr->uhdr.gs.dc > 255))
          355  +      {
          356  +	  return EPS_FORMAT_ERROR;
          357  +      }
          358  +
          359  +    /* Find filterbank by id */
          360  +    if (fb = get_fb (fb_id))
          361  +      {
          362  +	  hdr->uhdr.gs.fb_id = fb->id;
          363  +      }
          364  +    else
          365  +      {
          366  +	  hdr->uhdr.gs.fb_id = NULL;
          367  +      }
          368  +
          369  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
          370  +    if ((fb->type == ORTHOGONAL) && (hdr->uhdr.gs.mode != EPS_MODE_NORMAL))
          371  +      {
          372  +	  return EPS_FORMAT_ERROR;
          373  +      }
          374  +
          375  +    assert (chk_pos);
          376  +
          377  +    /* Compute header CRC and compare it against stored one */
          378  +    hdr_crc = epsilon_crc32 (buf, chk_pos - (char *) buf);
          379  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
          380  +
          381  +    if (hdr_crc == hdr->chk)
          382  +      {
          383  +	  hdr->chk_flag = EPS_GOOD_CRC;
          384  +      }
          385  +    else
          386  +      {
          387  +	  hdr->chk_flag = EPS_BAD_CRC;
          388  +      }
          389  +
          390  +    /* Compute data CRC and compare it against stored one */
          391  +    data_crc = epsilon_crc32 (buf + hdr->hdr_size, hdr->data_size);
          392  +
          393  +    if (data_crc == hdr->crc)
          394  +      {
          395  +	  hdr->crc_flag = EPS_GOOD_CRC;
          396  +      }
          397  +    else
          398  +      {
          399  +	  hdr->crc_flag = EPS_BAD_CRC;
          400  +      }
          401  +
          402  +    return EPS_OK;
          403  +}
          404  +
          405  +local int
          406  +read_tc_header (unsigned char *buf, int buf_size, eps_block_header * hdr)
          407  +{
          408  +    filterbank_t *fb;
          409  +
          410  +    char fb_id[32];
          411  +
          412  +    crc32_t hdr_crc;
          413  +    crc32_t data_crc;
          414  +
          415  +    int result;
          416  +    int len;
          417  +    int n;
          418  +
          419  +    char *chk_pos;
          420  +    char *str;
          421  +    /* Sanity checks */
          422  +    if (!buf || !hdr)
          423  +      {
          424  +	  return EPS_PARAM_ERROR;
          425  +      }
          426  +
          427  +    if (buf_size < 1)
          428  +      {
          429  +	  return EPS_PARAM_ERROR;
          430  +      }
          431  +
          432  +    /* Terminate header for ease of processing */
          433  +    if (terminate_header (buf, buf_size, 14) != EPS_OK)
          434  +      {
          435  +	  return EPS_FORMAT_ERROR;
          436  +      }
          437  +
          438  +    /* Check for maliciuos symbols */
          439  +    if (header_sanity_check (buf) != EPS_OK)
          440  +      {
          441  +	  unterminate_header (buf);
          442  +	  return EPS_FORMAT_ERROR;
          443  +      }
          444  +
          445  +    /* Handle header as a regular null-terminated string */
          446  +    str = (char *) buf;
          447  +    len = strlen (str);
          448  +
          449  +    /* Mark the position of header CRC field */
          450  +    chk_pos = strstr (str, "chk=");
          451  +    /* Parse header fields */
          452  +    result = sscanf (str,
          453  +		     "type=tc;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;m=%d;"
          454  +		     "r=%d;dc=%d:%d:%d;rt=%d:%d:%d;fb=%31[a-z0-9];"
          455  +		     "chk=%x;crc=%x%n",
          456  +		     &hdr->uhdr.tc.W, &hdr->uhdr.tc.H, &hdr->uhdr.tc.w,
          457  +		     &hdr->uhdr.tc.h, &hdr->uhdr.tc.x, &hdr->uhdr.tc.y,
          458  +		     &hdr->uhdr.tc.mode, &hdr->uhdr.tc.resample,
          459  +		     &hdr->uhdr.tc.dc_Y, &hdr->uhdr.tc.dc_Cb,
          460  +		     &hdr->uhdr.tc.dc_Cr, &hdr->uhdr.tc.Y_rt,
          461  +		     &hdr->uhdr.tc.Cb_rt, &hdr->uhdr.tc.Cr_rt, fb_id, &hdr->chk,
          462  +		     &hdr->crc, &n);
          463  +    unterminate_header (buf);
          464  +
          465  +    /* Check for parsing errors (see also sscanf(3)) */
          466  +    if ((result < 17) || (n != len))
          467  +      {
          468  +	  return EPS_FORMAT_ERROR;
          469  +      }
          470  +
          471  +    /* Compute header & data size */
          472  +    hdr->hdr_size = len + 1;
          473  +    hdr->data_size = buf_size - hdr->hdr_size;
          474  +
          475  +    /* Sanity checks */
          476  +    assert (hdr->data_size >= 0);
          477  +    assert (hdr->hdr_size + hdr->data_size == buf_size);
          478  +
          479  +    /* Check transform mode */
          480  +    if ((hdr->uhdr.tc.mode != EPS_MODE_NORMAL)
          481  +	&& (hdr->uhdr.tc.mode != EPS_MODE_OTLPF))
          482  +      {
          483  +	  return EPS_FORMAT_ERROR;
          484  +      }
          485  +
          486  +    /* Check image (W, H) and block (w, y, w, h) parameters for consistency */
          487  +    if ((hdr->uhdr.tc.W <= 0) || (hdr->uhdr.tc.H <= 0))
          488  +      {
          489  +	  return EPS_FORMAT_ERROR;
          490  +      }
          491  +
          492  +    if ((hdr->uhdr.tc.w < 1) || (hdr->uhdr.tc.h < 1))
          493  +      {
          494  +	  return EPS_FORMAT_ERROR;
          495  +      }
          496  +
          497  +    if (hdr->uhdr.tc.w > EPS_MAX_BLOCK_SIZE + hdr->uhdr.tc.mode ==
          498  +	EPS_MODE_OTLPF)
          499  +      {
          500  +	  return EPS_FORMAT_ERROR;
          501  +      }
          502  +
          503  +    if (hdr->uhdr.tc.h > EPS_MAX_BLOCK_SIZE + hdr->uhdr.tc.mode ==
          504  +	EPS_MODE_OTLPF)
          505  +      {
          506  +	  return EPS_FORMAT_ERROR;
          507  +      }
          508  +
          509  +    if ((hdr->uhdr.tc.x < 0) || (hdr->uhdr.tc.y < 0))
          510  +      {
          511  +	  return EPS_FORMAT_ERROR;
          512  +      }
          513  +
          514  +    if (hdr->uhdr.tc.x + hdr->uhdr.tc.w > hdr->uhdr.tc.W)
          515  +      {
          516  +	  return EPS_FORMAT_ERROR;
          517  +      }
          518  +
          519  +    if (hdr->uhdr.tc.y + hdr->uhdr.tc.h > hdr->uhdr.tc.H)
          520  +      {
          521  +	  return EPS_FORMAT_ERROR;
          522  +      }
          523  +
          524  +    /* Check resampling mode */
          525  +    if ((hdr->uhdr.tc.resample != EPS_RESAMPLE_444) &&
          526  +	(hdr->uhdr.tc.resample != EPS_RESAMPLE_420))
          527  +      {
          528  +	  return EPS_FORMAT_ERROR;
          529  +      }
          530  +
          531  +    /* Check DC level for Y, Cb and Cr channels */
          532  +    if ((hdr->uhdr.tc.dc_Y < 0) || (hdr->uhdr.tc.dc_Y > 255))
          533  +      {
          534  +	  return EPS_FORMAT_ERROR;
          535  +      }
          536  +
          537  +    if ((hdr->uhdr.tc.dc_Cb < 0) || (hdr->uhdr.tc.dc_Cb > 255))
          538  +      {
          539  +	  return EPS_FORMAT_ERROR;
          540  +      }
          541  +
          542  +    if ((hdr->uhdr.tc.dc_Cr < 0) || (hdr->uhdr.tc.dc_Cr > 255))
          543  +      {
          544  +	  return EPS_FORMAT_ERROR;
          545  +      }
          546  +
          547  +    if ((hdr->uhdr.tc.Y_rt <= 0) || (hdr->uhdr.tc.Cb_rt <= 0)
          548  +	|| (hdr->uhdr.tc.Cr_rt <= 0))
          549  +      {
          550  +	  return EPS_FORMAT_ERROR;
          551  +      }
          552  +
          553  +    /* Find filterbank by id */
          554  +    if (fb = get_fb (fb_id))
          555  +      {
          556  +	  hdr->uhdr.tc.fb_id = fb->id;
          557  +      }
          558  +    else
          559  +      {
          560  +	  hdr->uhdr.tc.fb_id = NULL;
          561  +      }
          562  +
          563  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
          564  +    if ((fb->type == ORTHOGONAL) && (hdr->uhdr.tc.mode != EPS_MODE_NORMAL))
          565  +      {
          566  +	  return EPS_FORMAT_ERROR;
          567  +      }
          568  +
          569  +    assert (chk_pos);
          570  +    /* Compute header CRC and compare it against stored one */
          571  +    hdr_crc = epsilon_crc32 (buf, chk_pos - (char *) buf);
          572  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
          573  +
          574  +    if (hdr_crc == hdr->chk)
          575  +      {
          576  +	  hdr->chk_flag = EPS_GOOD_CRC;
          577  +      }
          578  +    else
          579  +      {
          580  +	  hdr->chk_flag = EPS_BAD_CRC;
          581  +      }
          582  +    /* Compute data CRC and compare it against stored one */
          583  +    data_crc = epsilon_crc32 (buf + hdr->hdr_size, hdr->data_size);
          584  +
          585  +    if (data_crc == hdr->crc)
          586  +      {
          587  +	  hdr->crc_flag = EPS_GOOD_CRC;
          588  +      }
          589  +    else
          590  +      {
          591  +	  hdr->crc_flag = EPS_BAD_CRC;
          592  +      }
          593  +    return EPS_OK;
          594  +}
          595  +
          596  +int
          597  +eps_read_block_header (unsigned char *buf, int buf_size, eps_block_header * hdr)
          598  +{
          599  +    char *str;
          600  +    /* Sanity checks */
          601  +    if (!buf || !hdr)
          602  +      {
          603  +	  return EPS_PARAM_ERROR;
          604  +      }
          605  +
          606  +    if (buf_size < 1)
          607  +      {
          608  +	  return EPS_PARAM_ERROR;
          609  +      }
          610  +
          611  +    /* Extract first header field: block type */
          612  +    if (terminate_header (buf, buf_size, 1) != EPS_OK)
          613  +      {
          614  +	  return EPS_FORMAT_ERROR;
          615  +      }
          616  +
          617  +    str = (char *) buf;
          618  +
          619  +    /* Set block type */
          620  +    if ((strlen (str) == 7) && (strcmp (str, "type=gs") == 0))
          621  +      {
          622  +	  hdr->block_type = EPS_GRAYSCALE_BLOCK;
          623  +      }
          624  +    else if ((strlen (str) == 7) && (strcmp (str, "type=tc") == 0))
          625  +      {
          626  +	  hdr->block_type = EPS_TRUECOLOR_BLOCK;
          627  +      }
          628  +    else
          629  +      {
          630  +	  unterminate_header (buf);
          631  +	  return EPS_FORMAT_ERROR;
          632  +      }
          633  +
          634  +    unterminate_header (buf);
          635  +
          636  +    /* Process the block using appropriative function */
          637  +    switch (hdr->block_type)
          638  +      {
          639  +      case EPS_GRAYSCALE_BLOCK:
          640  +	  {
          641  +	      return read_gs_header (buf, buf_size, hdr);
          642  +	      break;
          643  +	  }
          644  +
          645  +      case EPS_TRUECOLOR_BLOCK:
          646  +	  {
          647  +	      return read_tc_header (buf, buf_size, hdr);
          648  +	      break;
          649  +	  }
          650  +
          651  +      default:
          652  +	  {
          653  +	      assert (0);
          654  +	      break;
          655  +	  }
          656  +      }
          657  +    return EPS_OK;
          658  +}
          659  +
          660  +char **
          661  +eps_get_fb_info (int type)
          662  +{
          663  +    char **info;
          664  +    int i, n;
          665  +
          666  +    /* Get the number of all available filterbanks */
          667  +    for (n = 0; filterbanks[n]; n++);
          668  +    info = (char **) xmalloc ((n + 1) * sizeof (char *));
          669  +
          670  +    /* Travels the list and populate `info' with requested information */
          671  +    for (i = 0; i < n; i++)
          672  +      {
          673  +	  if (type == EPS_FB_ID)
          674  +	    {
          675  +		info[i] = filterbanks[i]->id;
          676  +	    }
          677  +	  else if (type == EPS_FB_NAME)
          678  +	    {
          679  +		info[i] = filterbanks[i]->name;
          680  +	    }
          681  +	  else if (type == EPS_FB_TYPE)
          682  +	    {
          683  +		if (filterbanks[i]->type == BIORTHOGONAL)
          684  +		  {
          685  +		      info[i] = "biorthogonal";
          686  +		  }
          687  +		else
          688  +		  {
          689  +		      info[i] = "orthogonal";
          690  +		  }
          691  +	    }
          692  +	  else
          693  +	    {
          694  +		info[i] = NULL;
          695  +	    }
          696  +      }
          697  +
          698  +    /* Terminate list with NULL pointer */
          699  +    info[n] = NULL;
          700  +
          701  +    return info;
          702  +}
          703  +
          704  +void
          705  +eps_free_fb_info (char **info)
          706  +{
          707  +    free (info);
          708  +}
          709  +
          710  +void **
          711  +eps_xmalloc (int size)
          712  +{
          713  +    return xmalloc (size);
          714  +}
          715  +
          716  +void **
          717  +eps_malloc_2D (int width, int height, int size)
          718  +{
          719  +    return malloc_2D (width, height, size);
          720  +}
          721  +
          722  +void
          723  +eps_free_2D (void **ptr, int width, int height)
          724  +{
          725  +    free_2D (ptr, width, height);
          726  +}
          727  +
          728  +int
          729  +eps_encode_grayscale_block (unsigned char **block, int W, int H, int w, int h,
          730  +			    int x, int y, unsigned char *buf, int *buf_size,
          731  +			    char *fb_id, int mode)
          732  +{
          733  +    filterbank_t *fb;
          734  +
          735  +    unsigned char *buf_next;
          736  +    int bytes_left;
          737  +
          738  +    unsigned char *stuff_buf;
          739  +    int stuff_bytes;
          740  +    int stuff_max;
          741  +    int stuff_cut;
          742  +
          743  +    coeff_t **pad_block;
          744  +    coeff_t **dwt_block;
          745  +    int **int_block;
          746  +
          747  +    int speck_bytes;
          748  +    int block_size;
          749  +    int str_len;
          750  +
          751  +    unsigned char dc_int;
          752  +    coeff_t dc;
          753  +
          754  +    crc32_t hdr_crc;
          755  +    crc32_t data_crc;
          756  +
          757  +    unsigned char *crc_pos;
          758  +
          759  +    /* Sanity checks */
          760  +    if (!block || !buf || !buf_size || !fb_id)
          761  +      {
          762  +	  return EPS_PARAM_ERROR;
          763  +      }
          764  +
          765  +    /* Check input parameters for consistency */
          766  +    if ((mode != EPS_MODE_NORMAL) && (mode != EPS_MODE_OTLPF))
          767  +      {
          768  +	  return EPS_PARAM_ERROR;
          769  +      }
          770  +
          771  +    if ((W <= 0) || (H <= 0))
          772  +      {
          773  +	  return EPS_PARAM_ERROR;
          774  +      }
          775  +
          776  +    if ((w < 1) || (h < 1))
          777  +      {
          778  +	  return EPS_PARAM_ERROR;
          779  +      }
          780  +
          781  +    if (w > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
          782  +      {
          783  +	  return EPS_PARAM_ERROR;
          784  +      }
          785  +
          786  +    if (h > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
          787  +      {
          788  +	  return EPS_PARAM_ERROR;
          789  +      }
          790  +
          791  +    if ((x < 0) || (y < 0))
          792  +      {
          793  +	  return EPS_PARAM_ERROR;
          794  +      }
          795  +
          796  +    if ((x + w > W) || (y + h > H))
          797  +      {
          798  +	  return EPS_PARAM_ERROR;
          799  +      }
          800  +
          801  +    if (*buf_size < EPS_MIN_GRAYSCALE_BUF)
          802  +      {
          803  +	  return EPS_PARAM_ERROR;
          804  +      }
          805  +
          806  +    /* Find filterbank from id */
          807  +    if (!(fb = get_fb (fb_id)))
          808  +      {
          809  +	  return EPS_UNSUPPORTED_FB;
          810  +      }
          811  +
          812  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
          813  +    if ((fb->type == ORTHOGONAL) && (mode != EPS_MODE_NORMAL))
          814  +      {
          815  +	  return EPS_PARAM_ERROR;
          816  +      }
          817  +
          818  +    buf_next = buf;
          819  +    bytes_left = *buf_size;
          820  +
          821  +    /* Compute block size */
          822  +    block_size = get_block_size (w, h, mode, 2);
          823  +
          824  +    /* Extend block */
          825  +    pad_block =
          826  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          827  +    extend_channel (block, pad_block, w, h, block_size, block_size);
          828  +
          829  +    /* DC level shift */
          830  +    dc = dc_level_shift (pad_block, block_size, block_size);
          831  +    dc_int = (unsigned char) CLIP (dc);
          832  +
          833  +    /* Wavelet transform */
          834  +    dwt_block =
          835  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          836  +    analysis_2D (pad_block, dwt_block, block_size, mode, fb);
          837  +    free_2D ((void *) pad_block, block_size, block_size);
          838  +
          839  +    /* Round coefficients */
          840  +    int_block = (int **) malloc_2D (block_size, block_size, sizeof (int));
          841  +    round_channel (dwt_block, int_block, block_size);
          842  +    free_2D ((void *) dwt_block, block_size, block_size);
          843  +
          844  +    /* Write block header */
          845  +    str_len = snprintf ((char *) buf_next, bytes_left,
          846  +			"type=gs;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;"
          847  +			"m=%d;dc=%d;fb=%s;",
          848  +			W, H, w, h, x, y, mode, dc_int, fb_id);
          849  +
          850  +    assert (str_len < bytes_left);
          851  +
          852  +    buf_next += str_len;
          853  +    bytes_left -= str_len;
          854  +
          855  +    /* Compute and save block CRC */
          856  +    hdr_crc = epsilon_crc32 (buf, str_len);
          857  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
          858  +
          859  +    str_len = snprintf ((char *) buf_next, bytes_left,
          860  +			"chk=%04x;crc=????????;", hdr_crc);
          861  +
          862  +    assert (str_len < bytes_left);
          863  +
          864  +    buf_next += str_len;
          865  +    bytes_left -= str_len;
          866  +
          867  +    crc_pos = buf_next - 9;
          868  +
          869  +    /* Encode coefficients */
          870  +    speck_bytes = speck_encode (int_block, block_size, buf_next, bytes_left);
          871  +
          872  +    free_2D ((void *) int_block, block_size, block_size);
          873  +
          874  +    /* Byte stuffing */
          875  +    stuff_max = speck_bytes + speck_bytes / 254 + 1;
          876  +    stuff_buf = (unsigned char *) xmalloc (stuff_max);
          877  +    stuff_bytes = stuff_data (buf_next, stuff_buf, speck_bytes, stuff_max);
          878  +
          879  +    assert (stuff_bytes >= speck_bytes);
          880  +
          881  +    /* Cut encoded stream to fit it within available space */
          882  +    stuff_cut = MIN (bytes_left, stuff_bytes);
          883  +    memcpy (buf_next, stuff_buf, stuff_cut);
          884  +
          885  +    free (stuff_buf);
          886  +
          887  +    /* Compute and save data CRC */
          888  +    data_crc = epsilon_crc32 (buf_next, stuff_cut);
          889  +    snprintf ((char *) crc_pos, 9, "%08x", data_crc);
          890  +    crc_pos[8] = ';';
          891  +
          892  +    buf_next += stuff_cut;
          893  +    bytes_left -= stuff_cut;
          894  +
          895  +    /* Compute real amount of available bytes */
          896  +    *buf_size = buf_next - buf;
          897  +
          898  +    return EPS_OK;
          899  +}
          900  +
          901  +int
          902  +eps_decode_grayscale_block (unsigned char **block, unsigned char *buf,
          903  +			    eps_block_header * hdr)
          904  +{
          905  +    filterbank_t *fb;
          906  +
          907  +    unsigned char *unstuff_buf;
          908  +    int unstuff_bytes;
          909  +
          910  +    int **int_block;
          911  +    coeff_t **dwt_block;
          912  +    coeff_t **pad_block;
          913  +
          914  +    unsigned char dc_int;
          915  +    int block_size;
          916  +
          917  +    /* Sanity checks */
          918  +    if (!block || !buf || !hdr)
          919  +      {
          920  +	  return EPS_PARAM_ERROR;
          921  +      }
          922  +
          923  +    if (hdr->data_size < 1)
          924  +      {
          925  +	  return EPS_PARAM_ERROR;
          926  +      }
          927  +
          928  +    if (!hdr->uhdr.gs.fb_id)
          929  +      {
          930  +	  return EPS_UNSUPPORTED_FB;
          931  +      }
          932  +
          933  +    /* Reset Y channel */
          934  +    reset_Y (block, hdr->uhdr.gs.w, hdr->uhdr.gs.h);
          935  +
          936  +    /* Find filterbank from id */
          937  +    fb = get_fb (hdr->uhdr.gs.fb_id);
          938  +    assert (fb);
          939  +
          940  +    /* Unstuff data */
          941  +    unstuff_buf = (unsigned char *) xmalloc (hdr->data_size *
          942  +					     sizeof (unsigned char));
          943  +
          944  +    unstuff_bytes = unstuff_data (buf + hdr->hdr_size, unstuff_buf,
          945  +				  hdr->data_size, hdr->data_size);
          946  +
          947  +    if (unstuff_bytes == 0)
          948  +      {
          949  +	  unstuff_buf[0] = 0;
          950  +	  unstuff_bytes = 1;
          951  +      }
          952  +
          953  +    /* Compute block size */
          954  +    block_size =
          955  +	get_block_size (hdr->uhdr.gs.w, hdr->uhdr.gs.h, hdr->uhdr.gs.mode, 2);
          956  +
          957  +    /* Decode coefficients */
          958  +    int_block = (int **) malloc_2D (block_size, block_size, sizeof (int));
          959  +    speck_decode (unstuff_buf, unstuff_bytes, int_block, block_size);
          960  +    free (unstuff_buf);
          961  +
          962  +    /* Extend values from int to coeff_t */
          963  +    dwt_block =
          964  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          965  +    copy_channel (int_block, dwt_block, block_size);
          966  +    free_2D ((void *) int_block, block_size, block_size);
          967  +
          968  +    /* Inverse wavelet transform */
          969  +    pad_block =
          970  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          971  +    synthesis_2D (dwt_block, pad_block, block_size, hdr->uhdr.gs.mode, fb);
          972  +    free_2D ((void *) dwt_block, block_size, block_size);
          973  +
          974  +    dc_int = (unsigned char) hdr->uhdr.gs.dc;
          975  +
          976  +    /* DC level unshift */
          977  +    dc_level_unshift (pad_block, (coeff_t) dc_int, block_size, block_size);
          978  +
          979  +    /* Extract original data */
          980  +    extract_channel (pad_block, block, block_size, block_size,
          981  +		     hdr->uhdr.gs.w, hdr->uhdr.gs.h);
          982  +
          983  +    free_2D ((void *) pad_block, block_size, block_size);
          984  +
          985  +    return EPS_OK;
          986  +}
          987  +
          988  +int
          989  +eps_encode_truecolor_block (unsigned char **block_R,
          990  +			    unsigned char **block_G,
          991  +			    unsigned char **block_B,
          992  +			    int W, int H, int w, int h,
          993  +			    int x, int y, int resample,
          994  +			    unsigned char *buf, int *buf_size,
          995  +			    int Y_rt, int Cb_rt, int Cr_rt,
          996  +			    char *fb_id, int mode)
          997  +{
          998  +    filterbank_t *fb;
          999  +
         1000  +    unsigned char *buf_next;
         1001  +    int bytes_left;
         1002  +
         1003  +    unsigned char *buf_Y;
         1004  +    unsigned char *buf_Cb;
         1005  +    unsigned char *buf_Cr;
         1006  +
         1007  +    int buf_Y_size;
         1008  +    int buf_Cb_size;
         1009  +    int buf_Cr_size;
         1010  +
         1011  +    unsigned char *buf_Cb_Cr;
         1012  +    unsigned char *buf_Y_Cb_Cr;
         1013  +
         1014  +    unsigned char *stuff_buf;
         1015  +
         1016  +    int stuff_bytes;
         1017  +    int stuff_max;
         1018  +    int stuff_cut;
         1019  +
         1020  +    coeff_t **pad_block_R;
         1021  +    coeff_t **pad_block_G;
         1022  +    coeff_t **pad_block_B;
         1023  +
         1024  +    coeff_t **pad_block_Y;
         1025  +    coeff_t **pad_block_Cb;
         1026  +    coeff_t **pad_block_Cr;
         1027  +
         1028  +    coeff_t **block_Y;
         1029  +    coeff_t **block_Cb;
         1030  +    coeff_t **block_Cr;
         1031  +
         1032  +    coeff_t **dwt_block_Y;
         1033  +    coeff_t **dwt_block_Cb;
         1034  +    coeff_t **dwt_block_Cr;
         1035  +
         1036  +    int **int_block_Y;
         1037  +    int **int_block_Cb;
         1038  +    int **int_block_Cr;
         1039  +
         1040  +    int block_Y_size;
         1041  +    int block_Cb_size;
         1042  +    int block_Cr_size;
         1043  +
         1044  +    int speck_bytes_Y;
         1045  +    int speck_bytes_Cb;
         1046  +    int speck_bytes_Cr;
         1047  +
         1048  +    int speck_bytes;
         1049  +
         1050  +    int full_size;
         1051  +    int half_size;
         1052  +
         1053  +    coeff_t dc_Y;
         1054  +    coeff_t dc_Cb;
         1055  +    coeff_t dc_Cr;
         1056  +
         1057  +    unsigned char dc_Y_int;
         1058  +    unsigned char dc_Cb_int;
         1059  +    unsigned char dc_Cr_int;
         1060  +
         1061  +    crc32_t hdr_crc;
         1062  +    crc32_t data_crc;
         1063  +
         1064  +    unsigned char *crc_pos;
         1065  +    int str_len;
         1066  +
         1067  +    /* Sanity checks */
         1068  +    if (!block_R || !block_G || !block_B)
         1069  +      {
         1070  +	  return EPS_PARAM_ERROR;
         1071  +      }
         1072  +
         1073  +    if (!buf || !buf_size || !fb_id)
         1074  +      {
         1075  +	  return EPS_PARAM_ERROR;
         1076  +      }
         1077  +
         1078  +    /* Check input parameters for consistency */
         1079  +    if ((mode != EPS_MODE_NORMAL) && (mode != EPS_MODE_OTLPF))
         1080  +      {
         1081  +	  return EPS_PARAM_ERROR;
         1082  +      }
         1083  +
         1084  +    if ((W <= 0) || (H <= 0))
         1085  +      {
         1086  +	  return EPS_PARAM_ERROR;
         1087  +      }
         1088  +
         1089  +    if ((w < 1) || (h < 1))
         1090  +      {
         1091  +	  return EPS_PARAM_ERROR;
         1092  +      }
         1093  +
         1094  +    if (w > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
         1095  +      {
         1096  +	  return EPS_PARAM_ERROR;
         1097  +      }
         1098  +
         1099  +    if (h > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
         1100  +      {
         1101  +	  return EPS_PARAM_ERROR;
         1102  +      }
         1103  +
         1104  +    if ((x < 0) || (y < 0))
         1105  +      {
         1106  +	  return EPS_PARAM_ERROR;
         1107  +      }
         1108  +
         1109  +    if ((x + w > W) || (y + h > H))
         1110  +      {
         1111  +	  return EPS_PARAM_ERROR;
         1112  +      }
         1113  +
         1114  +    if ((resample != EPS_RESAMPLE_444) && (resample != EPS_RESAMPLE_420))
         1115  +      {
         1116  +	  return EPS_PARAM_ERROR;
         1117  +      }
         1118  +
         1119  +    if (*buf_size < EPS_MIN_TRUECOLOR_BUF)
         1120  +      {
         1121  +	  return EPS_PARAM_ERROR;
         1122  +      }
         1123  +
         1124  +    if ((Y_rt < EPS_MIN_RT) || (Cb_rt < EPS_MIN_RT) || (Cr_rt < EPS_MIN_RT))
         1125  +      {
         1126  +	  return EPS_PARAM_ERROR;
         1127  +      }
         1128  +
         1129  +    if (Y_rt + Cb_rt + Cr_rt != 100)
         1130  +      {
         1131  +	  return EPS_PARAM_ERROR;
         1132  +      }
         1133  +
         1134  +    /* Find filterbank from id */
         1135  +    if (!(fb = get_fb (fb_id)))
         1136  +      {
         1137  +	  return EPS_UNSUPPORTED_FB;
         1138  +      }
         1139  +
         1140  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
         1141  +    if ((fb->type == ORTHOGONAL) && (mode != EPS_MODE_NORMAL))
         1142  +      {
         1143  +	  return EPS_PARAM_ERROR;
         1144  +      }
         1145  +
         1146  +    buf_next = buf;
         1147  +    bytes_left = *buf_size;
         1148  +
         1149  +    /* Compute bid-budget for each channel */
         1150  +    buf_Cr_size = MAX ((bytes_left / 100) * Cr_rt, 1);
         1151  +    buf_Cb_size = MAX ((bytes_left / 100) * Cb_rt, 1);
         1152  +    buf_Y_size = bytes_left - buf_Cb_size - buf_Cr_size;
         1153  +
         1154  +    /* Ensure that everything is ok */
         1155  +    assert ((buf_Y_size > 0) && (buf_Cb_size > 0) && (buf_Cr_size > 0));
         1156  +    assert (buf_Y_size + buf_Cb_size + buf_Cr_size == bytes_left);
         1157  +
         1158  +    /* Compute block sizes for full and resampled channels */
         1159  +    full_size = get_block_size (w, h, mode, 4);
         1160  +    half_size = full_size / 2 + (mode == EPS_MODE_OTLPF);
         1161  +
         1162  +    /* Allocate memory for extended R,G,B channels */
         1163  +    pad_block_R = (coeff_t **) malloc_2D (full_size, full_size,
         1164  +					  sizeof (coeff_t));
         1165  +    pad_block_G = (coeff_t **) malloc_2D (full_size, full_size,
         1166  +					  sizeof (coeff_t));
         1167  +    pad_block_B = (coeff_t **) malloc_2D (full_size, full_size,
         1168  +					  sizeof (coeff_t));
         1169  +
         1170  +    /* Extend R,G,B channels */
         1171  +    extend_channel (block_R, pad_block_R, w, h, full_size, full_size);
         1172  +    extend_channel (block_G, pad_block_G, w, h, full_size, full_size);
         1173  +    extend_channel (block_B, pad_block_B, w, h, full_size, full_size);
         1174  +
         1175  +    /* Allocate memory for extended Y,Cb,Cr channels */
         1176  +    pad_block_Y = (coeff_t **) malloc_2D (full_size, full_size,
         1177  +					  sizeof (coeff_t));
         1178  +    pad_block_Cb = (coeff_t **) malloc_2D (full_size, full_size,
         1179  +					   sizeof (coeff_t));
         1180  +    pad_block_Cr = (coeff_t **) malloc_2D (full_size, full_size,
         1181  +					   sizeof (coeff_t));
         1182  +
         1183  +    /* Convert from R,G,B to Y,Cb,Cr color space */
         1184  +    convert_RGB_to_YCbCr (pad_block_R, pad_block_G, pad_block_B,
         1185  +			  pad_block_Y, pad_block_Cb, pad_block_Cr,
         1186  +			  full_size, full_size);
         1187  +
         1188  +    /* No longer needed */
         1189  +    free_2D ((void *) pad_block_R, full_size, full_size);
         1190  +    free_2D ((void *) pad_block_G, full_size, full_size);
         1191  +    free_2D ((void *) pad_block_B, full_size, full_size);
         1192  +
         1193  +    if (resample == EPS_RESAMPLE_444)
         1194  +      {
         1195  +	  /* No resampling: all channels are full sized */
         1196  +	  block_Y_size = full_size;
         1197  +	  block_Cb_size = full_size;
         1198  +	  block_Cr_size = full_size;
         1199  +
         1200  +	  /* No changes */
         1201  +	  block_Y = pad_block_Y;
         1202  +	  block_Cb = pad_block_Cb;
         1203  +	  block_Cr = pad_block_Cr;
         1204  +      }
         1205  +    else
         1206  +      {
         1207  +	  /* Resample image using 4:2:0 scheme */
         1208  +	  block_Y_size = full_size;
         1209  +	  block_Cb_size = half_size;
         1210  +	  block_Cr_size = half_size;
         1211  +
         1212  +	  /* No changes in Y channel */
         1213  +	  block_Y = pad_block_Y;
         1214  +
         1215  +	  /* Allocate memory for resampled Cb and Cr channels */
         1216  +	  block_Cb = (coeff_t **) malloc_2D (half_size, half_size,
         1217  +					     sizeof (coeff_t));
         1218  +	  block_Cr = (coeff_t **) malloc_2D (half_size, half_size,
         1219  +					     sizeof (coeff_t));
         1220  +
         1221  +	  /* Resample Cb channel */
         1222  +	  bilinear_resample_channel (pad_block_Cb, block_Cb,
         1223  +				     full_size, full_size,
         1224  +				     half_size, half_size);
         1225  +
         1226  +	  /* Resample Cr channel */
         1227  +	  bilinear_resample_channel (pad_block_Cr, block_Cr,
         1228  +				     full_size, full_size,
         1229  +				     half_size, half_size);
         1230  +
         1231  +	  /* No longer needed */
         1232  +	  free_2D ((void *) pad_block_Cb, full_size, full_size);
         1233  +	  free_2D ((void *) pad_block_Cr, full_size, full_size);
         1234  +      }
         1235  +
         1236  +    /* DC level shift */
         1237  +    dc_Y = dc_level_shift (block_Y, block_Y_size, block_Y_size);
         1238  +    dc_Cb = dc_level_shift (block_Cb, block_Cb_size, block_Cb_size);
         1239  +    dc_Cr = dc_level_shift (block_Cr, block_Cr_size, block_Cr_size);
         1240  +
         1241  +    /* Clip DC values */
         1242  +    dc_Y_int = (unsigned char) CLIP (dc_Y);
         1243  +    dc_Cb_int = (unsigned char) CLIP (dc_Cb);
         1244  +    dc_Cr_int = (unsigned char) CLIP (dc_Cr);
         1245  +
         1246  +    /* Allocate memory for wavelet coefficients */
         1247  +    dwt_block_Y = (coeff_t **) malloc_2D (block_Y_size, block_Y_size,
         1248  +					  sizeof (coeff_t));
         1249  +    dwt_block_Cb = (coeff_t **) malloc_2D (block_Cb_size, block_Cb_size,
         1250  +					   sizeof (coeff_t));
         1251  +    dwt_block_Cr = (coeff_t **) malloc_2D (block_Cr_size, block_Cr_size,
         1252  +					   sizeof (coeff_t));
         1253  +
         1254  +    /* Wavelet transform */
         1255  +    analysis_2D (block_Y, dwt_block_Y, block_Y_size, mode, fb);
         1256  +    analysis_2D (block_Cb, dwt_block_Cb, block_Cb_size, mode, fb);
         1257  +    analysis_2D (block_Cr, dwt_block_Cr, block_Cr_size, mode, fb);
         1258  +
         1259  +    /* No longer needed */
         1260  +    free_2D ((void *) block_Y, block_Y_size, block_Y_size);
         1261  +    free_2D ((void *) block_Cb, block_Cb_size, block_Cb_size);
         1262  +    free_2D ((void *) block_Cr, block_Cr_size, block_Cr_size);
         1263  +
         1264  +    /* Allocate memory for rounded wavelet coefficients */
         1265  +    int_block_Y = (int **) malloc_2D (block_Y_size, block_Y_size, sizeof (int));
         1266  +    int_block_Cb = (int **) malloc_2D (block_Cb_size, block_Cb_size,
         1267  +				       sizeof (int));
         1268  +    int_block_Cr = (int **) malloc_2D (block_Cr_size, block_Cr_size,
         1269  +				       sizeof (int));
         1270  +
         1271  +    /* Round wavelet coefficients */
         1272  +    round_channel (dwt_block_Y, int_block_Y, block_Y_size);
         1273  +    round_channel (dwt_block_Cb, int_block_Cb, block_Cb_size);
         1274  +    round_channel (dwt_block_Cr, int_block_Cr, block_Cr_size);
         1275  +
         1276  +    /* No longer needed */
         1277  +    free_2D ((void *) dwt_block_Y, block_Y_size, block_Y_size);
         1278  +    free_2D ((void *) dwt_block_Cb, block_Cb_size, block_Cb_size);
         1279  +    free_2D ((void *) dwt_block_Cr, block_Cr_size, block_Cr_size);
         1280  +
         1281  +    /* Allocate memory for encoded data */
         1282  +    buf_Y = (unsigned char *) xmalloc (buf_Y_size * sizeof (unsigned char));
         1283  +    buf_Cb = (unsigned char *) xmalloc (buf_Cb_size * sizeof (unsigned char));
         1284  +    buf_Cr = (unsigned char *) xmalloc (buf_Cr_size * sizeof (unsigned char));
         1285  +
         1286  +    /* Encode Y,Cb,Cr channels */
         1287  +    speck_bytes_Y = speck_encode (int_block_Y, block_Y_size, buf_Y, buf_Y_size);
         1288  +
         1289  +    speck_bytes_Cb = speck_encode (int_block_Cb, block_Cb_size,
         1290  +				   buf_Cb, buf_Cb_size);
         1291  +
         1292  +
         1293  +    speck_bytes_Cr = speck_encode (int_block_Cr, block_Cr_size,
         1294  +				   buf_Cr, buf_Cr_size);
         1295  +
         1296  +    /* No longer needed */
         1297  +    free_2D ((void *) int_block_Y, block_Y_size, block_Y_size);
         1298  +    free_2D ((void *) int_block_Cb, block_Cb_size, block_Cb_size);
         1299  +    free_2D ((void *) int_block_Cr, block_Cr_size, block_Cr_size);
         1300  +
         1301  +    /* Total number of encoded bytes */
         1302  +    speck_bytes = speck_bytes_Y + speck_bytes_Cb + speck_bytes_Cr;
         1303  +
         1304  +    /* Allocate memory for mixed Cb + Cr channel */
         1305  +    buf_Cb_Cr = (unsigned char *) xmalloc ((speck_bytes_Cb + speck_bytes_Cr) *
         1306  +					   sizeof (unsigned char));
         1307  +
         1308  +    /* Merge Cb and Cr channels */
         1309  +    merge_channels (buf_Cb, buf_Cr, buf_Cb_Cr, speck_bytes_Cb, speck_bytes_Cr);
         1310  +
         1311  +    /* No longer needed */
         1312  +    free (buf_Cb);
         1313  +    free (buf_Cr);
         1314  +
         1315  +    /* Allocate memory for mixed Y + (Cb + Cr) channel */
         1316  +    buf_Y_Cb_Cr = (unsigned char *) xmalloc (speck_bytes *
         1317  +					     sizeof (unsigned char));
         1318  +
         1319  +    /* Merge Y and (Cb + Cr) channels */
         1320  +    merge_channels (buf_Y, buf_Cb_Cr, buf_Y_Cb_Cr, speck_bytes_Y,
         1321  +		    speck_bytes_Cb + speck_bytes_Cr);
         1322  +
         1323  +    /* No longer needed */
         1324  +    free (buf_Y);
         1325  +    free (buf_Cb_Cr);
         1326  +
         1327  +    /* Byte stuffing */
         1328  +    stuff_max = speck_bytes + speck_bytes / 254 + 1;
         1329  +    stuff_buf = (unsigned char *) xmalloc (stuff_max * sizeof (unsigned char));
         1330  +    stuff_bytes = stuff_data (buf_Y_Cb_Cr, stuff_buf, speck_bytes, stuff_max);
         1331  +
         1332  +    assert (stuff_bytes >= speck_bytes);
         1333  +
         1334  +    free (buf_Y_Cb_Cr);
         1335  +
         1336  +    /* Write block header */
         1337  +    str_len = snprintf ((char *) buf_next, bytes_left,
         1338  +			"type=tc;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;m=%d;r=%d;"
         1339  +			"dc=%d:%d:%d;rt=%d:%d:%d;fb=%s;",
         1340  +			W, H, w, h, x, y, mode, resample,
         1341  +			dc_Y_int, dc_Cb_int, dc_Cr_int,
         1342  +			speck_bytes_Y, speck_bytes_Cb, speck_bytes_Cr, fb_id);
         1343  +
         1344  +    assert (str_len < bytes_left);
         1345  +
         1346  +    buf_next += str_len;
         1347  +    bytes_left -= str_len;
         1348  +
         1349  +    /* Compute and save header CRC */
         1350  +    hdr_crc = epsilon_crc32 (buf, str_len);
         1351  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
         1352  +
         1353  +    str_len = snprintf ((char *) buf_next, bytes_left,
         1354  +			"chk=%04x;crc=????????;", hdr_crc);
         1355  +
         1356  +    assert (str_len < bytes_left);
         1357  +
         1358  +    buf_next += str_len;
         1359  +    bytes_left -= str_len;
         1360  +
         1361  +    crc_pos = buf_next - 9;
         1362  +
         1363  +    /* Cut encoded stream to fit it within available space */
         1364  +    stuff_cut = MIN (bytes_left, stuff_bytes);
         1365  +    memcpy (buf_next, stuff_buf, stuff_cut);
         1366  +
         1367  +    free (stuff_buf);
         1368  +
         1369  +    /* Compute and save data CRC */
         1370  +    data_crc = epsilon_crc32 (buf_next, stuff_cut);
         1371  +    snprintf ((char *) crc_pos, 9, "%08x", data_crc);
         1372  +    crc_pos[8] = ';';
         1373  +
         1374  +    buf_next += stuff_cut;
         1375  +    bytes_left -= stuff_cut;
         1376  +
         1377  +    /* Compute real amount of used bytes */
         1378  +    *buf_size = buf_next - buf;
         1379  +
         1380  +    return EPS_OK;
         1381  +}
         1382  +
         1383  +int
         1384  +eps_decode_truecolor_block (unsigned char **block_R,
         1385  +			    unsigned char **block_G,
         1386  +			    unsigned char **block_B,
         1387  +			    unsigned char *buf, eps_block_header * hdr)
         1388  +{
         1389  +    filterbank_t *fb;
         1390  +
         1391  +    unsigned char *unstuff_buf;
         1392  +    int unstuff_bytes;
         1393  +
         1394  +    unsigned char *buf_Y;
         1395  +    unsigned char *buf_Cb;
         1396  +    unsigned char *buf_Cr;
         1397  +    unsigned char *buf_Cb_Cr;
         1398  +
         1399  +    int speck_bytes_Y;
         1400  +    int speck_bytes_Cb;
         1401  +    int speck_bytes_Cr;
         1402  +    int speck_bytes_Cb_Cr;
         1403  +
         1404  +    int full_size;
         1405  +    int half_size;
         1406  +
         1407  +    int **int_block_Y;
         1408  +    int **int_block_Cb;
         1409  +    int **int_block_Cr;
         1410  +
         1411  +    coeff_t **dwt_block_Y;
         1412  +    coeff_t **dwt_block_Cb;
         1413  +    coeff_t **dwt_block_Cr;
         1414  +
         1415  +    coeff_t **pad_block_Y;
         1416  +    coeff_t **pad_block_Cb;
         1417  +    coeff_t **pad_block_Cr;
         1418  +
         1419  +    coeff_t **pad_block_R;
         1420  +    coeff_t **pad_block_G;
         1421  +    coeff_t **pad_block_B;
         1422  +
         1423  +    coeff_t **block_Y;
         1424  +    coeff_t **block_Cb;
         1425  +    coeff_t **block_Cr;
         1426  +
         1427  +    int block_Y_size;
         1428  +    int block_Cb_size;
         1429  +    int block_Cr_size;
         1430  +
         1431  +    unsigned char dc_Y_int;
         1432  +    unsigned char dc_Cb_int;
         1433  +    unsigned char dc_Cr_int;
         1434  +
         1435  +    /* Sanity checks */
         1436  +    if (!block_R || !block_G || !block_B)
         1437  +      {
         1438  +	  return EPS_PARAM_ERROR;
         1439  +      }
         1440  +
         1441  +    if (!buf || !hdr)
         1442  +      {
         1443  +	  return EPS_PARAM_ERROR;
         1444  +      }
         1445  +
         1446  +    if (hdr->data_size < 1)
         1447  +      {
         1448  +	  return EPS_PARAM_ERROR;
         1449  +      }
         1450  +
         1451  +    /* Reset RGB channels */
         1452  +    reset_RGB (block_R, block_G, block_B, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1453  +
         1454  +    /* Find filterbank by id */
         1455  +    if (!hdr->uhdr.tc.fb_id)
         1456  +      {
         1457  +	  return EPS_UNSUPPORTED_FB;
         1458  +      }
         1459  +
         1460  +    fb = get_fb (hdr->uhdr.tc.fb_id);
         1461  +    assert (fb);
         1462  +
         1463  +    /* Unstaff data */
         1464  +    unstuff_buf = (unsigned char *) xmalloc (hdr->data_size *
         1465  +					     sizeof (unsigned char));
         1466  +
         1467  +    unstuff_bytes = unstuff_data (buf + hdr->hdr_size, unstuff_buf,
         1468  +				  hdr->data_size, hdr->data_size);
         1469  +
         1470  +    /* Consistency check */
         1471  +    if (unstuff_bytes >
         1472  +	hdr->uhdr.tc.Y_rt + hdr->uhdr.tc.Cb_rt + hdr->uhdr.tc.Cr_rt)
         1473  +      {
         1474  +	  free (unstuff_buf);
         1475  +	  return EPS_FORMAT_ERROR;
         1476  +      }
         1477  +
         1478  +    /* Dummy data */
         1479  +    if (unstuff_bytes == 0)
         1480  +      {
         1481  +	  unstuff_buf[0] = 0;
         1482  +	  unstuff_bytes = 1;
         1483  +      }
         1484  +
         1485  +    /* Allocate memory for Y and (Cb + Cr) channels */
         1486  +    buf_Y = (unsigned char *) xmalloc (unstuff_bytes * sizeof (unsigned char));
         1487  +
         1488  +    buf_Cb_Cr = (unsigned char *) xmalloc (unstuff_bytes *
         1489  +					   sizeof (unsigned char));
         1490  +
         1491  +    /* Split stream into Y and (Cb + Cr) channels */
         1492  +    split_channels (unstuff_buf, buf_Y, buf_Cb_Cr, unstuff_bytes,
         1493  +		    hdr->uhdr.tc.Y_rt, hdr->uhdr.tc.Cb_rt + hdr->uhdr.tc.Cr_rt,
         1494  +		    &speck_bytes_Y, &speck_bytes_Cb_Cr);
         1495  +
         1496  +    /* No longer needed */
         1497  +    free (unstuff_buf);
         1498  +
         1499  +    /* Consistency check */
         1500  +    if (speck_bytes_Cb_Cr > hdr->uhdr.tc.Cb_rt + hdr->uhdr.tc.Cr_rt)
         1501  +      {
         1502  +	  free (buf_Y);
         1503  +	  free (buf_Cb_Cr);
         1504  +	  return EPS_FORMAT_ERROR;
         1505  +      }
         1506  +
         1507  +    /* Dummy data */
         1508  +    if (speck_bytes_Y == 0)
         1509  +      {
         1510  +	  buf_Y[0] = 0;
         1511  +	  speck_bytes_Y = 1;
         1512  +      }
         1513  +
         1514  +    /* Dummy data */
         1515  +    if (speck_bytes_Cb_Cr == 0)
         1516  +      {
         1517  +	  buf_Cb_Cr[0] = 0;
         1518  +	  speck_bytes_Cb_Cr = 1;
         1519  +      }
         1520  +
         1521  +    /* Allocate memory for Cb and Cr channels */
         1522  +    buf_Cb = (unsigned char *) xmalloc (speck_bytes_Cb_Cr *
         1523  +					sizeof (unsigned char));
         1524  +
         1525  +    buf_Cr = (unsigned char *) xmalloc (speck_bytes_Cb_Cr *
         1526  +					sizeof (unsigned char));
         1527  +
         1528  +    /* Split merged (Cb + Cr) channel into Cb and Cr channels */
         1529  +    split_channels (buf_Cb_Cr, buf_Cb, buf_Cr, speck_bytes_Cb_Cr,
         1530  +		    hdr->uhdr.tc.Cb_rt, hdr->uhdr.tc.Cr_rt,
         1531  +		    &speck_bytes_Cb, &speck_bytes_Cr);
         1532  +
         1533  +    /* No longer needed */
         1534  +    free (buf_Cb_Cr);
         1535  +
         1536  +    /* Dummy data */
         1537  +    if (speck_bytes_Cb == 0)
         1538  +      {
         1539  +	  buf_Cb[0] = 0;
         1540  +	  speck_bytes_Cb = 1;
         1541  +      }
         1542  +
         1543  +    /* Dummy data */
         1544  +    if (speck_bytes_Cr == 0)
         1545  +      {
         1546  +	  buf_Cr[0] = 0;
         1547  +	  speck_bytes_Cr = 1;
         1548  +      }
         1549  +
         1550  +    /* Compute block sizes for full and resampled channels */
         1551  +    full_size =
         1552  +	get_block_size (hdr->uhdr.tc.w, hdr->uhdr.tc.h, hdr->uhdr.tc.mode, 4);
         1553  +    half_size = full_size / 2 + (hdr->uhdr.tc.mode == EPS_MODE_OTLPF);
         1554  +
         1555  +    if (hdr->uhdr.tc.resample == EPS_RESAMPLE_444)
         1556  +      {
         1557  +	  block_Y_size = full_size;
         1558  +	  block_Cb_size = full_size;
         1559  +	  block_Cr_size = full_size;
         1560  +      }
         1561  +    else
         1562  +      {
         1563  +	  block_Y_size = full_size;
         1564  +	  block_Cb_size = half_size;
         1565  +	  block_Cr_size = half_size;
         1566  +      }
         1567  +
         1568  +    /* Allocate memory for Y,Cb,Cr channels */
         1569  +    int_block_Y = (int **) malloc_2D (block_Y_size, block_Y_size, sizeof (int));
         1570  +    int_block_Cb = (int **) malloc_2D (block_Cb_size, block_Cb_size,
         1571  +				       sizeof (int));
         1572  +    int_block_Cr = (int **) malloc_2D (block_Cr_size, block_Cr_size,
         1573  +				       sizeof (int));
         1574  +
         1575  +    /* Decode data */
         1576  +    speck_decode (buf_Y, speck_bytes_Y, int_block_Y, block_Y_size);
         1577  +    speck_decode (buf_Cb, speck_bytes_Cb, int_block_Cb, block_Cb_size);
         1578  +    speck_decode (buf_Cr, speck_bytes_Cr, int_block_Cr, block_Cr_size);
         1579  +
         1580  +    /* No longer needed */
         1581  +    free (buf_Y);
         1582  +    free (buf_Cb);
         1583  +    free (buf_Cr);
         1584  +
         1585  +    /* Allocate memory for real-valued wavelet coefficients */
         1586  +    dwt_block_Y = (coeff_t **) malloc_2D (block_Y_size, block_Y_size,
         1587  +					  sizeof (coeff_t));
         1588  +    dwt_block_Cb = (coeff_t **) malloc_2D (block_Cb_size, block_Cb_size,
         1589  +					   sizeof (coeff_t));
         1590  +    dwt_block_Cr = (coeff_t **) malloc_2D (block_Cr_size, block_Cr_size,
         1591  +					   sizeof (coeff_t));
         1592  +
         1593  +    /* Copy data with type extension */
         1594  +    copy_channel (int_block_Y, dwt_block_Y, block_Y_size);
         1595  +    copy_channel (int_block_Cb, dwt_block_Cb, block_Cb_size);
         1596  +    copy_channel (int_block_Cr, dwt_block_Cr, block_Cr_size);
         1597  +
         1598  +    /* No longer needed */
         1599  +    free_2D ((void *) int_block_Y, block_Y_size, block_Y_size);
         1600  +    free_2D ((void *) int_block_Cb, block_Cb_size, block_Cb_size);
         1601  +    free_2D ((void *) int_block_Cr, block_Cr_size, block_Cr_size);
         1602  +
         1603  +    /* Allocate memory for restored Y,Cb,Cr channels */
         1604  +    block_Y = (coeff_t **) malloc_2D (block_Y_size, block_Y_size,
         1605  +				      sizeof (coeff_t));
         1606  +    block_Cb = (coeff_t **) malloc_2D (block_Cb_size, block_Cb_size,
         1607  +				       sizeof (coeff_t));
         1608  +    block_Cr = (coeff_t **) malloc_2D (block_Cr_size, block_Cr_size,
         1609  +				       sizeof (coeff_t));
         1610  +
         1611  +    /* Inverse wavelet transform */
         1612  +    synthesis_2D (dwt_block_Y, block_Y, block_Y_size, hdr->uhdr.tc.mode, fb);
         1613  +    synthesis_2D (dwt_block_Cb, block_Cb, block_Cb_size, hdr->uhdr.tc.mode, fb);
         1614  +    synthesis_2D (dwt_block_Cr, block_Cr, block_Cr_size, hdr->uhdr.tc.mode, fb);
         1615  +
         1616  +    /* No longer needed */
         1617  +    free_2D ((void *) dwt_block_Y, block_Y_size, block_Y_size);
         1618  +    free_2D ((void *) dwt_block_Cb, block_Cb_size, block_Cb_size);
         1619  +    free_2D ((void *) dwt_block_Cr, block_Cr_size, block_Cr_size);
         1620  +
         1621  +    /* Get DC values */
         1622  +    dc_Y_int = (unsigned char) hdr->uhdr.tc.dc_Y;
         1623  +    dc_Cb_int = (unsigned char) hdr->uhdr.tc.dc_Cb;
         1624  +    dc_Cr_int = (unsigned char) hdr->uhdr.tc.dc_Cr;
         1625  +
         1626  +    /* DC level unshift */
         1627  +    dc_level_unshift (block_Y, (coeff_t) dc_Y_int, block_Y_size, block_Y_size);
         1628  +    dc_level_unshift (block_Cb, (coeff_t) dc_Cb_int,
         1629  +		      block_Cb_size, block_Cb_size);
         1630  +    dc_level_unshift (block_Cr, (coeff_t) dc_Cr_int,
         1631  +		      block_Cr_size, block_Cr_size);
         1632  +
         1633  +    if (hdr->uhdr.tc.resample == EPS_RESAMPLE_444)
         1634  +      {
         1635  +	  /* No upsampling */
         1636  +	  pad_block_Y = block_Y;
         1637  +	  pad_block_Cb = block_Cb;
         1638  +	  pad_block_Cr = block_Cr;
         1639  +      }
         1640  +    else
         1641  +      {
         1642  +	  pad_block_Y = block_Y;
         1643  +
         1644  +	  /* Allocate memory for full-sized Cb and Cr channels */
         1645  +	  pad_block_Cb = (coeff_t **) malloc_2D (full_size, full_size,
         1646  +						 sizeof (coeff_t));
         1647  +
         1648  +	  pad_block_Cr = (coeff_t **) malloc_2D (full_size, full_size,
         1649  +						 sizeof (coeff_t));
         1650  +
         1651  +	  /* Upsample Cb and Cr channels according to 4:2:0 scheme */
         1652  +	  bilinear_resample_channel (block_Cb, pad_block_Cb,
         1653  +				     block_Cb_size, block_Cb_size,
         1654  +				     full_size, full_size);
         1655  +
         1656  +	  bilinear_resample_channel (block_Cr, pad_block_Cr,
         1657  +				     block_Cr_size, block_Cr_size,
         1658  +				     full_size, full_size);
         1659  +
         1660  +	  /* No longer needed */
         1661  +	  free_2D ((void *) block_Cb, block_Cb_size, block_Cb_size);
         1662  +	  free_2D ((void *) block_Cr, block_Cr_size, block_Cr_size);
         1663  +      }
         1664  +
         1665  +    /* Allocate memory for extended R,G,B channels */
         1666  +    pad_block_R = (coeff_t **) malloc_2D (full_size, full_size,
         1667  +					  sizeof (coeff_t));
         1668  +    pad_block_G = (coeff_t **) malloc_2D (full_size, full_size,
         1669  +					  sizeof (coeff_t));
         1670  +    pad_block_B = (coeff_t **) malloc_2D (full_size, full_size,
         1671  +					  sizeof (coeff_t));
         1672  +
         1673  +    /* Convert from Y,Cb,Cr to R,G,B color space */
         1674  +    convert_YCbCr_to_RGB (pad_block_Y, pad_block_Cb, pad_block_Cr,
         1675  +			  pad_block_R, pad_block_G, pad_block_B,
         1676  +			  full_size, full_size);
         1677  +
         1678  +    /* No longer needed */
         1679  +    free_2D ((void *) pad_block_Y, full_size, full_size);
         1680  +    free_2D ((void *) pad_block_Cb, full_size, full_size);
         1681  +    free_2D ((void *) pad_block_Cr, full_size, full_size);
         1682  +
         1683  +    /* Clip R,G,B channels */
         1684  +    clip_channel (pad_block_R, full_size, full_size);
         1685  +    clip_channel (pad_block_G, full_size, full_size);
         1686  +    clip_channel (pad_block_B, full_size, full_size);
         1687  +
         1688  +    /* Extract original data from R,G,B channels */
         1689  +    extract_channel (pad_block_R, block_R,
         1690  +		     full_size, full_size, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1691  +
         1692  +    extract_channel (pad_block_G, block_G,
         1693  +		     full_size, full_size, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1694  +
         1695  +    extract_channel (pad_block_B, block_B,
         1696  +		     full_size, full_size, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1697  +
         1698  +    /* No longer needed */
         1699  +    free_2D ((void *) pad_block_R, full_size, full_size);
         1700  +    free_2D ((void *) pad_block_G, full_size, full_size);
         1701  +    free_2D ((void *) pad_block_B, full_size, full_size);
         1702  +
         1703  +    return EPS_OK;
         1704  +}
         1705  +
         1706  +int
         1707  +eps_truncate_block (unsigned char *buf_in, unsigned char *buf_out,
         1708  +		    eps_block_header * hdr, int *truncate_size)
         1709  +{
         1710  +    crc32_t data_crc;
         1711  +
         1712  +    /* Sanity checks */
         1713  +    if (!buf_in || !buf_out || !hdr)
         1714  +      {
         1715  +	  return EPS_PARAM_ERROR;
         1716  +      }
         1717  +
         1718  +    if (*truncate_size < MAX (EPS_MIN_GRAYSCALE_BUF, EPS_MIN_TRUECOLOR_BUF))
         1719  +      {
         1720  +	  return EPS_PARAM_ERROR;
         1721  +      }
         1722  +
         1723  +    /* Copy data */
         1724  +    *truncate_size = MIN (*truncate_size, hdr->hdr_size + hdr->data_size);
         1725  +    memcpy (buf_out, buf_in, *truncate_size);
         1726  +
         1727  +    /* Recompute data CRC */
         1728  +    data_crc =
         1729  +	epsilon_crc32 (buf_out + hdr->hdr_size, *truncate_size - hdr->hdr_size);
         1730  +    snprintf ((char *) (buf_out + hdr->hdr_size - 9), 9, "%08x", data_crc);
         1731  +    *(buf_out + hdr->hdr_size - 1) = ';';
         1732  +
         1733  +    return EPS_OK;
         1734  +}

Added epsilon/libmain.h.

            1  +/*
            2  + * $Id: libmain.h,v 1.17 2007/06/15 18:09:16 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Auxiliary support routines
           27  + *
           28  + *  This file contains auxiliary support routines for
           29  + *  the library. While being top-level they are not
           30  + *  intended for direct user access. */
           31  +
           32  +#ifndef __LIBMAIN_H__
           33  +#define __LIBMAIN_H__
           34  +
           35  +#ifdef __cplusplus
           36  +extern "C"
           37  +{
           38  +#endif
           39  +
           40  +/** \addtogroup misc Miscellanea */
           41  +/*@{*/
           42  +
           43  +#include <common.h>
           44  +#include <filterbank.h>
           45  +#include <filter.h>
           46  +
           47  +/** Round a channel
           48  + *
           49  + *  This function rounds each \a in_channel element to the
           50  + *  nearest integer and stores it in the \a out_channel.
           51  + *
           52  + *  \param in_channel Input channel
           53  + *  \param out_channel Output channel
           54  + *  \param channel_size Channel size
           55  + *
           56  + *  \return \c VOID */
           57  +    local void round_channel (coeff_t ** in_channel, int **out_channel,
           58  +			      int channel_size);
           59  +
           60  +/** Copy a channel
           61  + *
           62  + *  This function copies \a in_channel into the \a out_channel.
           63  + *
           64  + *  \param in_channel Input channel
           65  + *  \param out_channel Output channel
           66  + *  \param channel_size Channel size
           67  + *
           68  + *  \return \c VOID */
           69  +    local void copy_channel (int **in_channel, coeff_t ** out_channel,
           70  +			     int channel_size);
           71  +
           72  +/** Reset RGB channels
           73  + *
           74  + *  This function initializes arrays \a block_R, \a block_G
           75  + *  and \a block_B with zero.
           76  + *
           77  + *  \param block_R Red channel
           78  + *  \param block_G Green channel
           79  + *  \param block_B Blue channel
           80  + *  \param width Block width
           81  + *  \param height Block height
           82  + *
           83  + *  \return \c VOID */
           84  +    local void reset_RGB (unsigned char **block_R, unsigned char **block_G,
           85  +			  unsigned char **block_B, int width, int height);
           86  +
           87  +/** Reset Y channel
           88  + *
           89  + *  This function initializes array \a block_Y with zero.
           90  + *
           91  + *  \param block_Y Luma channel
           92  + *  \param width Block width
           93  + *  \param height Block height
           94  + *
           95  + *  \return \c VOID */
           96  +    local void reset_Y (unsigned char **block_Y, int width, int height);
           97  +
           98  +/** Get filterbank pointer from id
           99  + *
          100  + *  This function gets filterbank pointer from \a id.
          101  + *
          102  + *  \param id Filterbank id
          103  + *
          104  + *  \return Filterbank pointer or \c NULL if not found */
          105  +    local filterbank_t *get_fb (char *id);
          106  +
          107  +/** Compute required block size
          108  + *
          109  + *  This function computes block size (width=height) required
          110  + *  for encoding and decoding process. Depending on \a mode
          111  + *  parameter, function returns nearest power of two or
          112  + *  power of two plus one.
          113  + *
          114  + *  \param w Source width
          115  + *  \param h Source height
          116  + *  \param mode Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF
          117  + *  \param min Minimal block size
          118  + *
          119  + *  \return Block size (width = height) */
          120  +    local int get_block_size (int w, int h, int mode, int min);
          121  +
          122  +/** Terminate block header
          123  + *
          124  + *  This function replaces \a n_fields -th occurence of \c ;
          125  + *  symbol with \c 0. In other words, this function zero-terminates
          126  + *  header.
          127  + *
          128  + *  \param buf Data buffer
          129  + *  \param buf_size Buffer size
          130  + *  \param n_fields Number of header fields
          131  + *
          132  + *  \return Either \ref EPS_OK or \ref EPS_FORMAT_ERROR */
          133  +    local int terminate_header (unsigned char *buf, int buf_size, int n_fields);
          134  +
          135  +/** Unterminate header
          136  + *
          137  + *  This function is inverse to the previous one. It
          138  + *  replaces first occurence of \c 0 with \c ; symbol.
          139  + *
          140  + *  \param buf Data buffer
          141  + *
          142  + *  \return \c VOID */
          143  +    local void unterminate_header (unsigned char *buf);
          144  +
          145  +/** Header sanity check
          146  + *
          147  + *  This function ensures that header contains only
          148  + *  legal symbols.
          149  + *
          150  + *  \param buf Data buffer
          151  + *
          152  + *  \return Either \ref EPS_OK or \ref EPS_FORMAT_ERROR */
          153  +    local int header_sanity_check (unsigned char *buf);
          154  +
          155  +/** Read GRAYSCALE header
          156  + *
          157  + *  This function reads and checks block header of type
          158  + *  \ref EPS_GRAYSCALE_BLOCK. Result is stored in the \a hdr
          159  + *  structure.
          160  + *
          161  + *  \note Structure \a hdr is undefined unless function
          162  + *  returns \ref EPS_OK.
          163  + *
          164  + *  \param buf Data buffer
          165  + *  \param buf_size Buffer size
          166  + *  \param hdr Block header
          167  + *
          168  + *  \return Either \ref EPS_OK or \ref EPS_PARAM_ERROR
          169  + *  or \ref EPS_FORMAT_ERROR */
          170  +    local int read_gs_header (unsigned char *buf, int buf_size,
          171  +			      eps_block_header * hdr);
          172  +
          173  +/** Read TRUECOLOR header
          174  + *
          175  + *  This function reads and checks block header of type
          176  + *  \ref EPS_TRUECOLOR_BLOCK. Result is stored in the \a hdr
          177  + *  structure.
          178  + *
          179  + *  \note Structure \a hdr is undefined unless function
          180  + *  returns \ref EPS_OK.
          181  + *
          182  + *  \param buf Data buffer
          183  + *  \param buf_size Buffer size
          184  + *  \param hdr Block header
          185  + *
          186  + *  \return Either \ref EPS_OK or \ref EPS_PARAM_ERROR
          187  + *  or \ref EPS_FORMAT_ERROR */
          188  +    local int read_tc_header (unsigned char *buf, int buf_size,
          189  +			      eps_block_header * hdr);
          190  +
          191  +/*@}*/
          192  +
          193  +#ifdef __cplusplus
          194  +}
          195  +#endif
          196  +
          197  +#endif				/* __LIBMAIN_H__ */

Added epsilon/list.c.

            1  +/*
            2  + * $Id: list.c,v 1.16 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <list.h>
           26  +#include <mem_alloc.h>
           27  +
           28  +linked_list *
           29  +alloc_linked_list (void)
           30  +{
           31  +    linked_list *list;
           32  +
           33  +    list = (linked_list *) xmalloc (sizeof (linked_list));
           34  +    list->first = list->last = NULL;
           35  +
           36  +    return list;
           37  +}
           38  +
           39  +void
           40  +free_linked_list (linked_list * list)
           41  +{
           42  +    list_node *cur_node;
           43  +    list_node *next_node;
           44  +
           45  +    cur_node = list->first;
           46  +
           47  +    while (cur_node)
           48  +      {
           49  +	  next_node = cur_node->next;
           50  +	  free_list_node (cur_node);
           51  +	  cur_node = next_node;
           52  +      }
           53  +
           54  +    free (list);
           55  +}
           56  +
           57  +list_node *
           58  +alloc_list_node (int data_size)
           59  +{
           60  +    list_node *node;
           61  +
           62  +    node = (list_node *) xmalloc (sizeof (list_node));
           63  +    node->data = xmalloc (data_size);
           64  +    node->next = node->prev = NULL;
           65  +
           66  +    return node;
           67  +}
           68  +
           69  +void
           70  +free_list_node (list_node * node)
           71  +{
           72  +    free (node->data);
           73  +    free (node);
           74  +}
           75  +
           76  +void
           77  +append_list_node (linked_list * list, list_node * node)
           78  +{
           79  +    if ((list->first == NULL) && (list->last == NULL))
           80  +      {
           81  +	  node->next = node->prev = NULL;
           82  +	  list->first = list->last = node;
           83  +	  return;
           84  +      }
           85  +
           86  +    node->next = NULL;
           87  +    node->prev = list->last;
           88  +
           89  +    list->last->next = node;
           90  +    list->last = node;
           91  +}
           92  +
           93  +void
           94  +prepend_list_node (linked_list * list, list_node * node)
           95  +{
           96  +    if ((list->first == NULL) && (list->last == NULL))
           97  +      {
           98  +	  node->next = node->prev = NULL;
           99  +	  list->first = list->last = node;
          100  +	  return;
          101  +      }
          102  +
          103  +    node->prev = NULL;
          104  +    node->next = list->first;
          105  +
          106  +    list->first->prev = node;
          107  +    list->first = node;
          108  +}
          109  +
          110  +void
          111  +remove_list_node_link (linked_list * list, list_node * node)
          112  +{
          113  +    if (node->prev)
          114  +      {
          115  +	  node->prev->next = node->next;
          116  +      }
          117  +    else
          118  +      {
          119  +	  list->first = node->next;
          120  +      }
          121  +
          122  +    if (node->next)
          123  +      {
          124  +	  node->next->prev = node->prev;
          125  +      }
          126  +    else
          127  +      {
          128  +	  list->last = node->prev;
          129  +      }
          130  +}
          131  +
          132  +void
          133  +remove_list_node (linked_list * list, list_node * node)
          134  +{
          135  +    remove_list_node_link (list, node);
          136  +    free_list_node (node);
          137  +}
          138  +
          139  +void
          140  +move_list_node (linked_list * src_list, linked_list * dst_list,
          141  +		list_node * node)
          142  +{
          143  +    remove_list_node_link (src_list, node);
          144  +    append_list_node (dst_list, node);
          145  +}
          146  +
          147  +void
          148  +insert_before_list_node (linked_list * list, list_node * node,
          149  +			 list_node * new_node)
          150  +{
          151  +    if (!node)
          152  +      {
          153  +	  prepend_list_node (list, new_node);
          154  +	  return;
          155  +      }
          156  +
          157  +    if (node->prev)
          158  +      {
          159  +	  new_node->next = node;
          160  +	  new_node->prev = node->prev;
          161  +	  node->prev = node->prev->next = new_node;
          162  +      }
          163  +    else
          164  +      {
          165  +	  new_node->prev = NULL;
          166  +	  new_node->next = node;
          167  +	  node->prev = list->first = new_node;
          168  +      }
          169  +}
          170  +
          171  +void
          172  +insert_after_list_node (linked_list * list, list_node * node,
          173  +			list_node * new_node)
          174  +{
          175  +    if (!node)
          176  +      {
          177  +	  append_list_node (list, new_node);
          178  +	  return;
          179  +      }
          180  +
          181  +    if (node->next)
          182  +      {
          183  +	  new_node->prev = node;
          184  +	  new_node->next = node->next;
          185  +	  node->next = node->next->prev = new_node;
          186  +      }
          187  +    else
          188  +      {
          189  +	  new_node->next = NULL;
          190  +	  new_node->prev = node;
          191  +	  node->next = list->last = new_node;
          192  +      }
          193  +}

Added epsilon/list.h.

            1  +/*
            2  + * $Id: list.h,v 1.17 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Doubly-linked lists
           27  + *
           28  + *  This file contains routines to deal with doubly-linked lists. */
           29  +
           30  +#ifndef __LIST_H__
           31  +#define __LIST_H__
           32  +
           33  +#ifdef __cplusplus
           34  +extern "C"
           35  +{
           36  +#endif
           37  +
           38  +/** \addtogroup list Doubly-linked lists */
           39  +/*@{*/
           40  +
           41  +#include <common.h>
           42  +
           43  +/** This macro evaluates to 1 if list \a _x is empty */
           44  +#define LIST_IS_EMPTY(_x)       (_x->first == NULL)
           45  +
           46  +/** List node structure */
           47  +    typedef struct list_node_tag list_node;
           48  +
           49  +/** List node structure
           50  + *
           51  + *  This structure represents a doubly-linked list node. */
           52  +    struct list_node_tag
           53  +    {
           54  +    /** Data block pointer */
           55  +	void *data;
           56  +    /** Next list node */
           57  +	list_node *next;
           58  +    /** Previous list node */
           59  +	list_node *prev;
           60  +    };
           61  +
           62  +/** Doubly-linked list structure
           63  + *
           64  + *  This structure represents a doubly-linked list. */
           65  +    typedef struct linked_list_tag
           66  +    {
           67  +    /** First node */
           68  +	list_node *first;
           69  +    /** Last node */
           70  +	list_node *last;
           71  +    } linked_list;
           72  +
           73  +/** Allocate new doubly-linked list
           74  + *
           75  + *  This function allocates new doubly-linked list.
           76  + *
           77  + *  \return New list pointer */
           78  +    linked_list *alloc_linked_list (void);
           79  +
           80  +/** Release doubly-linked list
           81  + *
           82  + *  This function releases doubly-linked \a list with all
           83  + *  its internal nodes. Data blocks associated with nodes
           84  + *  are also released.
           85  + *
           86  + *  \return \c VOID */
           87  +    void free_linked_list (linked_list * list);
           88  +
           89  +/** Allocate new list node
           90  + *
           91  + *  This function allocates new list node with associated
           92  + *  data block of size \a data_size.
           93  + *
           94  + *  \return New node pointer */
           95  +    list_node *alloc_list_node (int data_size);
           96  +
           97  +/** Release list node
           98  + *
           99  + *  This function releases list \a node and data block
          100  + *  associated with it.
          101  + *
          102  + *  \return \c VOID */
          103  +    void free_list_node (list_node * node);
          104  +
          105  +/** Append list node
          106  + *
          107  + *  This function appends new \a node to the \a list tail.
          108  + *
          109  + *  \note Node must be properly allocated beforehand.
          110  + *
          111  + *  \return \c VOID */
          112  +    void append_list_node (linked_list * list, list_node * node);
          113  +
          114  +/** Prepend list node
          115  + *
          116  + *  This function prepends new \a node to the \a list head.
          117  + *
          118  + *  \note Node must be properly allocated beforehand.
          119  + *
          120  + *  \return \c VOID */
          121  +    void prepend_list_node (linked_list * list, list_node * node);
          122  +
          123  +/** Remove list node
          124  + *
          125  + *  This function removes \a node links from the \a list.
          126  + *
          127  + *  \note The \a node itself is not released and can be added
          128  + *  to another list.
          129  + *
          130  + *  \return \c VOID */
          131  +    void remove_list_node_link (linked_list * list, list_node * node);
          132  +
          133  +/** Remove list node
          134  + *
          135  + *  This function removes \a node from the \a list.
          136  + *
          137  + *  \note The \a node itself is released and cannot be added
          138  + *  to another list.
          139  + *
          140  + *  \return \c VOID */
          141  +    void remove_list_node (linked_list * list, list_node * node);
          142  +
          143  +/** Move node
          144  + *
          145  + *  This function moves \a node from \a src_list to \a dst_list.
          146  + *
          147  + *  \return \c VOID */
          148  +    void move_list_node (linked_list * src_list, linked_list * dst_list,
          149  +			 list_node * node);
          150  +
          151  +/** Insert node
          152  + *
          153  + *  This function inserts \a new_node to the \a list just before \a node.
          154  + *
          155  + *  \return \c VOID */
          156  +    void insert_before_list_node (linked_list * list, list_node * node,
          157  +				  list_node * new_node);
          158  +
          159  +/** Insert node
          160  + *
          161  + *  This function inserts \a new_node to the \a list just after \a node.
          162  + *
          163  + *  \return \c VOID */
          164  +    void insert_after_list_node (linked_list * list, list_node * node,
          165  +				 list_node * new_node);
          166  +
          167  +/*@}*/
          168  +
          169  +#ifdef __cplusplus
          170  +}
          171  +#endif
          172  +
          173  +#endif				/* __LIST_H__ */

Added epsilon/mem_alloc.c.

            1  +/*
            2  + * $Id: mem_alloc.c,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <mem_alloc.h>
           26  +
           27  +void *
           28  +xmalloc (size_t size)
           29  +{
           30  +    void *ptr;
           31  +
           32  +    ptr = malloc (size);
           33  +    assert (ptr);
           34  +
           35  +    return ptr;
           36  +}
           37  +
           38  +void **
           39  +malloc_2D (int width, int height, int size)
           40  +{
           41  +    void **ptr;
           42  +    int i;
           43  +
           44  +    assert ((width > 0) && (height > 0) && (size > 0));
           45  +    ptr = (void **) xmalloc (height * sizeof (void *));
           46  +
           47  +    for (i = 0; i < height; i++)
           48  +      {
           49  +	  ptr[i] = (void *) xmalloc (width * size);
           50  +      }
           51  +
           52  +    return ptr;
           53  +}
           54  +
           55  +void
           56  +free_2D (void **ptr, int width, int height)
           57  +{
           58  +    int i;
           59  +
           60  +    assert ((width > 0) && (height > 0));
           61  +
           62  +    for (i = 0; i < height; i++)
           63  +      {
           64  +	  free (ptr[i]);
           65  +      }
           66  +
           67  +    free (ptr);
           68  +}

Added epsilon/mem_alloc.h.

            1  +/*
            2  + * $Id: mem_alloc.h,v 1.14 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Two-dimensional memory management
           27  + *
           28  + *  This file contains two-dimensional memory management routines. */
           29  +
           30  +#ifndef __MEM_ALLOC_H__
           31  +#define __MEM_ALLOC_H__
           32  +
           33  +#ifdef __cplusplus
           34  +extern "C"
           35  +{
           36  +#endif
           37  +
           38  +/** \addtogroup mem_alloc Two-dimensional memory management */
           39  +/*@{*/
           40  +
           41  +#include <common.h>
           42  +
           43  +/** Memory allocation
           44  + *
           45  + *  This function allocates one-dimensional array of desired size.
           46  + *
           47  + *  \param size Size in bytes
           48  + *
           49  + *  \return Array pointer
           50  + *
           51  + *  \warning This function halts program if all virtual memory
           52  + *  is exhausted. */
           53  +    void *xmalloc (size_t size);
           54  +
           55  +/** Two-dimensional memory allocation
           56  + *
           57  + *  This function allocates two-dimensional array of desired size.
           58  + *
           59  + *  \param width Array width
           60  + *  \param height Array height
           61  + *  \param size Element size
           62  + *
           63  + *  \return Array pointer
           64  + *
           65  + *  \warning This function halts program if all virtual memory
           66  + *  is exhausted. */
           67  +    void **malloc_2D (int width, int height, int size);
           68  +
           69  +/** Two-dimensional memory releasing
           70  + *
           71  + *  This function releases two-dimensional array allocated by #malloc_2D.
           72  + *
           73  + *  \param ptr Array pointer
           74  + *  \param width Array width
           75  + *  \param height Array height
           76  + *
           77  + *  \return \c VOID */
           78  +    void free_2D (void **ptr, int width, int height);
           79  +
           80  +/*@}*/
           81  +
           82  +#ifdef __cplusplus
           83  +}
           84  +#endif
           85  +
           86  +#endif				/* __MEM_ALLOC_H__ */

Added epsilon/merge_split.c.

            1  +/*
            2  + * $Id: merge_split.c,v 1.13 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <merge_split.h>
           26  +
           27  +void
           28  +merge_channels (unsigned char *channel_A, unsigned char *channel_B,
           29  +		unsigned char *channel_AB, int len_A, int len_B)
           30  +{
           31  +    int pkg_A, pkg_B;		/* Real number of bytes in the package */
           32  +    int div_A, div_B;		/* Base number of bytes in the package */
           33  +    int rem_A, rem_B;		/* Instant reminder */
           34  +    int cur_A, cur_B;		/* Current savings */
           35  +    int tr0_A, tr0_B;		/* Lower threshold */
           36  +    int tr1_A, tr1_B;		/* Upper threshold */
           37  +    int i, pkg, min;
           38  +
           39  +    /* Sanity checks. I love them! */
           40  +    assert ((len_A > 0) && (len_B > 0));
           41  +
           42  +    /* Total number of packages */
           43  +    min = MIN (len_A, len_B);
           44  +
           45  +    /* 1-st channel setup */
           46  +    div_A = len_A / min;
           47  +    cur_A = len_A;
           48  +    rem_A = 0;
           49  +    tr0_A = div_A * min;
           50  +    tr1_A = tr0_A + min;
           51  +
           52  +    /* 2-nd channel setup */
           53  +    div_B = len_B / min;
           54  +    cur_B = len_B;
           55  +    rem_B = 0;
           56  +    tr0_B = div_B * min;
           57  +    tr1_B = tr0_B + min;
           58  +
           59  +    /* Loop for all packages */
           60  +    for (pkg = 0; pkg < min; pkg++)
           61  +      {
           62  +	  /* Update current savings */
           63  +	  cur_A = len_A + rem_A;
           64  +
           65  +	  if (cur_A >= tr1_A)
           66  +	    {
           67  +		/* Choose maximal package & update reminder */
           68  +		pkg_A = div_A + 1;
           69  +		rem_A = cur_A - tr1_A;
           70  +	    }
           71  +	  else
           72  +	    {
           73  +		/* Choose minimal package & update reminder */
           74  +		pkg_A = div_A;
           75  +		rem_A = cur_A - tr0_A;
           76  +	    }
           77  +
           78  +	  /* Update current savings */
           79  +	  cur_B = len_B + rem_B;
           80  +
           81  +	  if (cur_B >= tr1_B)
           82  +	    {
           83  +		/* Choose maximal package & update reminder */
           84  +		pkg_B = div_B + 1;
           85  +		rem_B = cur_B - tr1_B;
           86  +	    }
           87  +	  else
           88  +	    {
           89  +		/* Choose minimal package & update reminder */
           90  +		pkg_B = div_B;
           91  +		rem_B = cur_B - tr0_B;
           92  +	    }
           93  +
           94  +	  /* Put bytes from the 1-st channel */
           95  +	  for (i = 0; i < pkg_A; i++)
           96  +	    {
           97  +		*channel_AB++ = *channel_A++;
           98  +	    }
           99  +
          100  +	  /* Put bytes from the 2-nd channel */
          101  +	  for (i = 0; i < pkg_B; i++)
          102  +	    {
          103  +		*channel_AB++ = *channel_B++;
          104  +	    }
          105  +      }
          106  +}
          107  +
          108  +void
          109  +split_channels (unsigned char *channel_AB,
          110  +		unsigned char *channel_A, unsigned char *channel_B,
          111  +		int len_AB, int len_A, int len_B,
          112  +		int *real_len_A, int *real_len_B)
          113  +{
          114  +    int pkg_A, pkg_B;		/* Real number of bytes in the package */
          115  +    int div_A, div_B;		/* Base number of bytes in the package */
          116  +    int rem_A, rem_B;		/* Instant reminder */
          117  +    int cur_A, cur_B;		/* Current savings */
          118  +    int tr0_A, tr0_B;		/* Lower threshold */
          119  +    int tr1_A, tr1_B;		/* Upper threshold */
          120  +    int i, pkg, min;
          121  +
          122  +    unsigned char *end_AB;
          123  +    unsigned char *end_A;
          124  +    unsigned char *end_B;
          125  +
          126  +    /* Sanity checks */
          127  +    assert ((len_A > 0) && (len_B > 0) && (len_AB > 0));
          128  +    assert (real_len_A && real_len_B);
          129  +    assert (len_A + len_B >= len_AB);
          130  +
          131  +    /* Set end-of-buffer pointers */
          132  +    end_AB = channel_AB + len_AB;
          133  +    end_A = channel_A + len_A;
          134  +    end_B = channel_B + len_B;
          135  +
          136  +    /* Real amount of saved bytes */
          137  +    *real_len_A = *real_len_B = 0;
          138  +
          139  +    /* Original number of packages (real stream may be truncated) */
          140  +    min = MIN (len_A, len_B);
          141  +
          142  +    /* 1-st channel setup */
          143  +    div_A = len_A / min;
          144  +    cur_A = len_A;
          145  +    rem_A = 0;
          146  +    tr0_A = div_A * min;
          147  +    tr1_A = tr0_A + min;
          148  +
          149  +    /* 2-nd channel setup */
          150  +    div_B = len_B / min;
          151  +    cur_B = len_B;
          152  +    rem_B = 0;
          153  +    tr0_B = div_B * min;
          154  +    tr1_B = tr0_B + min;
          155  +
          156  +    /* Loop for all packages */
          157  +    for (pkg = 0; pkg < min; pkg++)
          158  +      {
          159  +	  /* Update current savings */
          160  +	  cur_A = len_A + rem_A;
          161  +
          162  +	  if (cur_A >= tr1_A)
          163  +	    {
          164  +		/* Choose maximal package & update reminder */
          165  +		pkg_A = div_A + 1;
          166  +		rem_A = cur_A - tr1_A;
          167  +	    }
          168  +	  else
          169  +	    {
          170  +		/* Choose minimal package & update reminder */
          171  +		pkg_A = div_A;
          172  +		rem_A = cur_A - tr0_A;
          173  +	    }
          174  +
          175  +	  /* Update current savings */
          176  +	  cur_B = len_B + rem_B;
          177  +
          178  +	  if (cur_B >= tr1_B)
          179  +	    {
          180  +		/* Choose maximal package & update reminder */
          181  +		pkg_B = div_B + 1;
          182  +		rem_B = cur_B - tr1_B;
          183  +	    }
          184  +	  else
          185  +	    {
          186  +		/* Choose minimal package & update reminder */
          187  +		pkg_B = div_B;
          188  +		rem_B = cur_B - tr0_B;
          189  +	    }
          190  +
          191  +	  /* Extract pkg_A bytes from the stream into the channel_A */
          192  +	  for (i = 0;
          193  +	       (i < pkg_A) && (channel_A < end_A) && (channel_AB < end_AB); i++)
          194  +	    {
          195  +		*channel_A++ = *channel_AB++;
          196  +		(*real_len_A)++;
          197  +	    }
          198  +
          199  +	  /* Extract pkg_B bytes from the stream into the channel_B */
          200  +	  for (i = 0;
          201  +	       (i < pkg_B) && (channel_B < end_B) && (channel_AB < end_AB); i++)
          202  +	    {
          203  +		*channel_B++ = *channel_AB++;
          204  +		(*real_len_B)++;
          205  +	    }
          206  +
          207  +	  /* All avaiable bytes are processed */
          208  +	  if (channel_AB >= end_AB)
          209  +	    {
          210  +		assert (*real_len_A + *real_len_B == len_AB);
          211  +
          212  +		if ((pkg == min - 1) && (channel_A == end_A)
          213  +		    && (channel_B == end_B))
          214  +		  {
          215  +		      assert ((*real_len_A == len_A) && (*real_len_B == len_B));
          216  +		  }
          217  +
          218  +		return;
          219  +	    }
          220  +      }
          221  +}

Added epsilon/merge_split.h.

            1  +/*
            2  + * $Id: merge_split.h,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Merge and split
           27  + *
           28  + *  The library expects that color image consists of 3 independent
           29  + *  channels: Y, Cb and Cr. In order to provide smooth image scaling
           30  + *  corresponding bitstreams should be merged into a singe bitstream.
           31  + *  On decoding, the inverse operation should be taken. */
           32  +
           33  +#ifndef __MERGE_SPLIT_H__
           34  +#define __MERGE_SPLIT_H__
           35  +
           36  +#ifdef __cplusplus
           37  +extern "C"
           38  +{
           39  +#endif
           40  +
           41  +/** \addtogroup merge_split Merge and split */
           42  +/*@{*/
           43  +
           44  +#include <common.h>
           45  +
           46  +/** Merge two channels
           47  + *
           48  + *  This function merges \a channel_A with \a channel_B. Result is stored
           49  + *  in the \a channel_AB. Note that on return, combined \a channel_AB can
           50  + *  be further merged with another channel.
           51  + *
           52  + *  \param channel_A Channel A
           53  + *  \param channel_B Channel B
           54  + *  \param channel_AB Combined channel AB
           55  + *  \param len_A Length of the \a channel_A
           56  + *  \param len_B Length of the \a channel_B
           57  + *
           58  + *  \note The caller should allocate at least \a len_A + \a len_B
           59  + *  bytes for the \a channel_AB array.
           60  + *
           61  + *  \return \c VOID */
           62  +    void merge_channels (unsigned char *channel_A, unsigned char *channel_B,
           63  +			 unsigned char *channel_AB, int len_A, int len_B);
           64  +
           65  +/** Split combined channel
           66  + *
           67  + *  This function splits combined \a channel_AB into
           68  + *  the \a channel_A and \a channel_B. It is important to note
           69  + *  that \a channel_AB can be truncated at any position beforehand.
           70  + *  In this case \a channel_A and \a channel_B will contain only
           71  + *  part of original data. Real amount of saved bytes will be stored
           72  + *  in the \a real_len_A and \a real_len_B respectively.
           73  + *
           74  + *  \param channel_AB Combined channel AB
           75  + *  \param channel_A Channel A
           76  + *  \param channel_B Channel B
           77  + *  \param len_AB Current length of the \a channel_AB
           78  + *  \param len_A Original length of the \a channel_A
           79  + *  \param len_B Original length of the \a channel_B
           80  + *  \param real_len_A Number of bytes actually used in the \a channel_A
           81  + *  \param real_len_B Number of bytes actually used in the \a channel_B
           82  + *
           83  + *  \note The caller should allocate at least \a len_AB bytes for
           84  + *  \a channel_A and \a channel_B arrays.
           85  + *
           86  + *  \return \c VOID */
           87  +    void split_channels (unsigned char *channel_AB,
           88  +			 unsigned char *channel_A, unsigned char *channel_B,
           89  +			 int len_AB, int len_A, int len_B,
           90  +			 int *real_len_A, int *real_len_B);
           91  +
           92  +/*@}*/
           93  +
           94  +#ifdef __cplusplus
           95  +}
           96  +#endif
           97  +
           98  +#endif				/* __MERGE_SPLIT_H__ */

Added epsilon/msvc/inttypes.h.

            1  +// ISO C9x  compliant inttypes.h for Microsoft Visual Studio
            2  +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
            3  +//
            4  +//  Copyright (c) 2006 Alexander Chemeris
            5  +//
            6  +// Redistribution and use in source and binary forms, with or without
            7  +// modification, are permitted provided that the following conditions are met:
            8  +//
            9  +//   1. Redistributions of source code must retain the above copyright notice,
           10  +//      this list of conditions and the following disclaimer.
           11  +//
           12  +//   2. Redistributions in binary form must reproduce the above copyright
           13  +//      notice, this list of conditions and the following disclaimer in the
           14  +//      documentation and/or other materials provided with the distribution.
           15  +//
           16  +//   3. The name of the author may be used to endorse or promote products
           17  +//      derived from this software without specific prior written permission.
           18  +//
           19  +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
           20  +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
           21  +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
           22  +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
           23  +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
           24  +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
           25  +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
           26  +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
           27  +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
           28  +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
           29  +//
           30  +///////////////////////////////////////////////////////////////////////////////
           31  +
           32  +#ifndef _MSC_VER // [
           33  +#error "Use this header only with Microsoft Visual C++ compilers!"
           34  +#endif // _MSC_VER ]
           35  +
           36  +#ifndef _MSC_INTTYPES_H_ // [
           37  +#define _MSC_INTTYPES_H_
           38  +
           39  +#if _MSC_VER > 1000
           40  +#pragma once
           41  +#endif
           42  +
           43  +#include <stdint.h>
           44  +
           45  +// 7.8 Format conversion of integer types
           46  +
           47  +typedef struct {
           48  +   intmax_t quot;
           49  +   intmax_t rem;
           50  +} imaxdiv_t;
           51  +
           52  +// 7.8.1 Macros for format specifiers
           53  +
           54  +// The fprintf macros for signed integers are:
           55  +#define PRId8       "d"
           56  +#define PRIi8       "i"
           57  +#define PRIdLEAST8  "d"
           58  +#define PRIiLEAST8  "i"
           59  +#define PRIdFAST8   "d"
           60  +#define PRIiFAST8   "i"
           61  +
           62  +#define PRId16       "hd"
           63  +#define PRIi16       "hi"
           64  +#define PRIdLEAST16  "hd"
           65  +#define PRIiLEAST16  "hi"
           66  +#define PRIdFAST16   "hd"
           67  +#define PRIiFAST16   "hi"
           68  +
           69  +#define PRId32       "I32d"
           70  +#define PRIi32       "I32i"
           71  +#define PRIdLEAST32  "I32d"
           72  +#define PRIiLEAST32  "I32i"
           73  +#define PRIdFAST32   "I32d"
           74  +#define PRIiFAST32   "I32i"
           75  +
           76  +#define PRId64       "I64d"
           77  +#define PRIi64       "I64i"
           78  +#define PRIdLEAST64  "I64d"
           79  +#define PRIiLEAST64  "I64i"
           80  +#define PRIdFAST64   "I64d"
           81  +#define PRIiFAST64   "I64i"
           82  +
           83  +#define PRIdMAX     "I64d"
           84  +#define PRIiMAX     "I64i"
           85  +
           86  +#define PRIdPTR     "Id"
           87  +#define PRIiPTR     "Ii"
           88  +
           89  +// The fprintf macros for unsigned integers are:
           90  +#define PRIo8       "o"
           91  +#define PRIu8       "u"
           92  +#define PRIx8       "x"
           93  +#define PRIX8       "X"
           94  +#define PRIoLEAST8  "o"
           95  +#define PRIuLEAST8  "u"
           96  +#define PRIxLEAST8  "x"
           97  +#define PRIXLEAST8  "X"
           98  +#define PRIoFAST8   "o"
           99  +#define PRIuFAST8   "u"
          100  +#define PRIxFAST8   "x"
          101  +#define PRIXFAST8   "X"
          102  +
          103  +#define PRIo16       "ho"
          104  +#define PRIu16       "hu"
          105  +#define PRIx16       "hx"
          106  +#define PRIX16       "hX"
          107  +#define PRIoLEAST16  "ho"
          108  +#define PRIuLEAST16  "hu"
          109  +#define PRIxLEAST16  "hx"
          110  +#define PRIXLEAST16  "hX"
          111  +#define PRIoFAST16   "ho"
          112  +#define PRIuFAST16   "hu"
          113  +#define PRIxFAST16   "hx"
          114  +#define PRIXFAST16   "hX"
          115  +
          116  +#define PRIo32       "I32o"
          117  +#define PRIu32       "I32u"
          118  +#define PRIx32       "I32x"
          119  +#define PRIX32       "I32X"
          120  +#define PRIoLEAST32  "I32o"
          121  +#define PRIuLEAST32  "I32u"
          122  +#define PRIxLEAST32  "I32x"
          123  +#define PRIXLEAST32  "I32X"
          124  +#define PRIoFAST32   "I32o"
          125  +#define PRIuFAST32   "I32u"
          126  +#define PRIxFAST32   "I32x"
          127  +#define PRIXFAST32   "I32X"
          128  +
          129  +#define PRIo64       "I64o"
          130  +#define PRIu64       "I64u"
          131  +#define PRIx64       "I64x"
          132  +#define PRIX64       "I64X"
          133  +#define PRIoLEAST64  "I64o"
          134  +#define PRIuLEAST64  "I64u"
          135  +#define PRIxLEAST64  "I64x"
          136  +#define PRIXLEAST64  "I64X"
          137  +#define PRIoFAST64   "I64o"
          138  +#define PRIuFAST64   "I64u"
          139  +#define PRIxFAST64   "I64x"
          140  +#define PRIXFAST64   "I64X"
          141  +
          142  +#define PRIoMAX     "I64o"
          143  +#define PRIuMAX     "I64u"
          144  +#define PRIxMAX     "I64x"
          145  +#define PRIXMAX     "I64X"
          146  +
          147  +#define PRIoPTR     "Io"
          148  +#define PRIuPTR     "Iu"
          149  +#define PRIxPTR     "Ix"
          150  +#define PRIXPTR     "IX"
          151  +
          152  +// The fscanf macros for signed integers are:
          153  +#define SCNd8       "d"
          154  +#define SCNi8       "i"
          155  +#define SCNdLEAST8  "d"
          156  +#define SCNiLEAST8  "i"
          157  +#define SCNdFAST8   "d"
          158  +#define SCNiFAST8   "i"
          159  +
          160  +#define SCNd16       "hd"
          161  +#define SCNi16       "hi"
          162  +#define SCNdLEAST16  "hd"
          163  +#define SCNiLEAST16  "hi"
          164  +#define SCNdFAST16   "hd"
          165  +#define SCNiFAST16   "hi"
          166  +
          167  +#define SCNd32       "ld"
          168  +#define SCNi32       "li"
          169  +#define SCNdLEAST32  "ld"
          170  +#define SCNiLEAST32  "li"
          171  +#define SCNdFAST32   "ld"
          172  +#define SCNiFAST32   "li"
          173  +
          174  +#define SCNd64       "I64d"
          175  +#define SCNi64       "I64i"
          176  +#define SCNdLEAST64  "I64d"
          177  +#define SCNiLEAST64  "I64i"
          178  +#define SCNdFAST64   "I64d"
          179  +#define SCNiFAST64   "I64i"
          180  +
          181  +#define SCNdMAX     "I64d"
          182  +#define SCNiMAX     "I64i"
          183  +
          184  +#ifdef _WIN64 // [
          185  +#  define SCNdPTR     "I64d"
          186  +#  define SCNiPTR     "I64i"
          187  +#else  // _WIN64 ][
          188  +#  define SCNdPTR     "ld"
          189  +#  define SCNiPTR     "li"
          190  +#endif  // _WIN64 ]
          191  +
          192  +// The fscanf macros for unsigned integers are:
          193  +#define SCNo8       "o"
          194  +#define SCNu8       "u"
          195  +#define SCNx8       "x"
          196  +#define SCNX8       "X"
          197  +#define SCNoLEAST8  "o"
          198  +#define SCNuLEAST8  "u"
          199  +#define SCNxLEAST8  "x"
          200  +#define SCNXLEAST8  "X"
          201  +#define SCNoFAST8   "o"
          202  +#define SCNuFAST8   "u"
          203  +#define SCNxFAST8   "x"
          204  +#define SCNXFAST8   "X"
          205  +
          206  +
          207  +#define SCNo16       "ho"
          208  +#define SCNu16       "hu"
          209  +#define SCNx16       "hx"
          210  +#define SCNX16       "hX"
          211  +#define SCNoLEAST16  "ho"
          212  +#define SCNuLEAST16  "hu"
          213  +#define SCNxLEAST16  "hx"
          214  +#define SCNXLEAST16  "hX"
          215  +#define SCNoFAST16   "ho"
          216  +#define SCNuFAST16   "hu"
          217  +#define SCNxFAST16   "hx"
          218  +#define SCNXFAST16   "hX"
          219  +
          220  +#define SCNo32       "lo"
          221  +#define SCNu32       "lu"
          222  +#define SCNx32       "lx"
          223  +#define SCNX32       "lX"
          224  +#define SCNoLEAST32  "lo"
          225  +#define SCNuLEAST32  "lu"
          226  +#define SCNxLEAST32  "lx"
          227  +#define SCNXLEAST32  "lX"
          228  +#define SCNoFAST32   "lo"
          229  +#define SCNuFAST32   "lu"
          230  +#define SCNxFAST32   "lx"
          231  +#define SCNXFAST32   "lX"
          232  +
          233  +#define SCNo64       "I64o"
          234  +#define SCNu64       "I64u"
          235  +#define SCNx64       "I64x"
          236  +#define SCNX64       "I64X"
          237  +#define SCNoLEAST64  "I64o"
          238  +#define SCNuLEAST64  "I64u"
          239  +#define SCNxLEAST64  "I64x"
          240  +#define SCNXLEAST64  "I64X"
          241  +#define SCNoFAST64   "I64o"
          242  +#define SCNuFAST64   "I64u"
          243  +#define SCNxFAST64   "I64x"
          244  +#define SCNXFAST64   "I64X"
          245  +
          246  +#define SCNoMAX     "I64o"
          247  +#define SCNuMAX     "I64u"
          248  +#define SCNxMAX     "I64x"
          249  +#define SCNXMAX     "I64X"
          250  +
          251  +#ifdef _WIN64 // [
          252  +#  define SCNoPTR     "I64o"
          253  +#  define SCNuPTR     "I64u"
          254  +#  define SCNxPTR     "I64x"
          255  +#  define SCNXPTR     "I64X"
          256  +#else  // _WIN64 ][
          257  +#  define SCNoPTR     "lo"
          258  +#  define SCNuPTR     "lu"
          259  +#  define SCNxPTR     "lx"
          260  +#  define SCNXPTR     "lX"
          261  +#endif  // _WIN64 ]
          262  +
          263  +// 7.8.2 Functions for greatest-width integer types
          264  +
          265  +// 7.8.2.1 The imaxabs function
          266  +#define imaxabs _abs64
          267  +
          268  +// 7.8.2.2 The imaxdiv function
          269  +
          270  +// This is modified version of div() function from Microsoft's div.c found
          271  +// in %MSVC.NET%\crt\src\div.c
          272  +#ifdef STATIC_IMAXDIV // [
          273  +static
          274  +#else // STATIC_IMAXDIV ][
          275  +_inline
          276  +#endif // STATIC_IMAXDIV ]
          277  +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
          278  +{
          279  +   imaxdiv_t result;
          280  +
          281  +   result.quot = numer / denom;
          282  +   result.rem = numer % denom;
          283  +
          284  +   if (numer < 0 && result.rem > 0) {
          285  +      // did division wrong; must fix up
          286  +      ++result.quot;
          287  +      result.rem -= denom;
          288  +   }
          289  +
          290  +   return result;
          291  +}
          292  +
          293  +// 7.8.2.3 The strtoimax and strtoumax functions
          294  +#define strtoimax _strtoi64
          295  +#define strtoumax _strtoui64
          296  +
          297  +// 7.8.2.4 The wcstoimax and wcstoumax functions
          298  +#define wcstoimax _wcstoi64
          299  +#define wcstoumax _wcstoui64
          300  +
          301  +
          302  +#endif // _MSC_INTTYPES_H_ ]

Added epsilon/msvc/stdint.h.

            1  +// ISO C9x  compliant stdint.h for Microsoft Visual Studio
            2  +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
            3  +// 
            4  +//  Copyright (c) 2006-2008 Alexander Chemeris
            5  +// 
            6  +// Redistribution and use in source and binary forms, with or without
            7  +// modification, are permitted provided that the following conditions are met:
            8  +// 
            9  +//   1. Redistributions of source code must retain the above copyright notice,
           10  +//      this list of conditions and the following disclaimer.
           11  +// 
           12  +//   2. Redistributions in binary form must reproduce the above copyright
           13  +//      notice, this list of conditions and the following disclaimer in the
           14  +//      documentation and/or other materials provided with the distribution.
           15  +// 
           16  +//   3. The name of the author may be used to endorse or promote products
           17  +//      derived from this software without specific prior written permission.
           18  +// 
           19  +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
           20  +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
           21  +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
           22  +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
           23  +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
           24  +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
           25  +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
           26  +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
           27  +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
           28  +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
           29  +// 
           30  +///////////////////////////////////////////////////////////////////////////////
           31  +
           32  +#ifndef _MSC_VER // [
           33  +#error "Use this header only with Microsoft Visual C++ compilers!"
           34  +#endif // _MSC_VER ]
           35  +
           36  +#ifndef _MSC_STDINT_H_ // [
           37  +#define _MSC_STDINT_H_
           38  +
           39  +#if _MSC_VER > 1000
           40  +#pragma once
           41  +#endif
           42  +
           43  +#include <limits.h>
           44  +
           45  +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
           46  +// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
           47  +// or compiler give many errors like this:
           48  +//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed
           49  +#ifdef __cplusplus
           50  +extern "C" {
           51  +#endif
           52  +#  include <wchar.h>
           53  +#ifdef __cplusplus
           54  +}
           55  +#endif
           56  +
           57  +// Define _W64 macros to mark types changing their size, like intptr_t.
           58  +#ifndef _W64
           59  +#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
           60  +#     define _W64 __w64
           61  +#  else
           62  +#     define _W64
           63  +#  endif
           64  +#endif
           65  +
           66  +
           67  +// 7.18.1 Integer types
           68  +
           69  +// 7.18.1.1 Exact-width integer types
           70  +
           71  +// Visual Studio 6 and Embedded Visual C++ 4 doesn't
           72  +// realize that, e.g. char has the same size as __int8
           73  +// so we give up on __intX for them.
           74  +#if (_MSC_VER < 1300)
           75  +   typedef signed char       int8_t;
           76  +   typedef signed short      int16_t;
           77  +   typedef signed int        int32_t;
           78  +   typedef unsigned char     uint8_t;
           79  +   typedef unsigned short    uint16_t;
           80  +   typedef unsigned int      uint32_t;
           81  +#else
           82  +   typedef signed __int8     int8_t;
           83  +   typedef signed __int16    int16_t;
           84  +   typedef signed __int32    int32_t;
           85  +   typedef unsigned __int8   uint8_t;
           86  +   typedef unsigned __int16  uint16_t;
           87  +   typedef unsigned __int32  uint32_t;
           88  +#endif
           89  +typedef signed __int64       int64_t;
           90  +typedef unsigned __int64     uint64_t;
           91  +
           92  +
           93  +// 7.18.1.2 Minimum-width integer types
           94  +typedef int8_t    int_least8_t;
           95  +typedef int16_t   int_least16_t;
           96  +typedef int32_t   int_least32_t;
           97  +typedef int64_t   int_least64_t;
           98  +typedef uint8_t   uint_least8_t;
           99  +typedef uint16_t  uint_least16_t;
          100  +typedef uint32_t  uint_least32_t;
          101  +typedef uint64_t  uint_least64_t;
          102  +
          103  +// 7.18.1.3 Fastest minimum-width integer types
          104  +typedef int8_t    int_fast8_t;
          105  +typedef int16_t   int_fast16_t;
          106  +typedef int32_t   int_fast32_t;
          107  +typedef int64_t   int_fast64_t;
          108  +typedef uint8_t   uint_fast8_t;
          109  +typedef uint16_t  uint_fast16_t;
          110  +typedef uint32_t  uint_fast32_t;
          111  +typedef uint64_t  uint_fast64_t;
          112  +
          113  +// 7.18.1.4 Integer types capable of holding object pointers
          114  +#ifdef _WIN64 // [
          115  +   typedef signed __int64    intptr_t;
          116  +   typedef unsigned __int64  uintptr_t;
          117  +#else // _WIN64 ][
          118  +   typedef _W64 signed int   intptr_t;
          119  +   typedef _W64 unsigned int uintptr_t;
          120  +#endif // _WIN64 ]
          121  +
          122  +// 7.18.1.5 Greatest-width integer types
          123  +typedef int64_t   intmax_t;
          124  +typedef uint64_t  uintmax_t;
          125  +
          126  +
          127  +// 7.18.2 Limits of specified-width integer types
          128  +
          129  +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
          130  +
          131  +// 7.18.2.1 Limits of exact-width integer types
          132  +#define INT8_MIN     ((int8_t)_I8_MIN)
          133  +#define INT8_MAX     _I8_MAX
          134  +#define INT16_MIN    ((int16_t)_I16_MIN)
          135  +#define INT16_MAX    _I16_MAX
          136  +#define INT32_MIN    ((int32_t)_I32_MIN)
          137  +#define INT32_MAX    _I32_MAX
          138  +#define INT64_MIN    ((int64_t)_I64_MIN)
          139  +#define INT64_MAX    _I64_MAX
          140  +#define UINT8_MAX    _UI8_MAX
          141  +#define UINT16_MAX   _UI16_MAX
          142  +#define UINT32_MAX   _UI32_MAX
          143  +#define UINT64_MAX   _UI64_MAX
          144  +
          145  +// 7.18.2.2 Limits of minimum-width integer types
          146  +#define INT_LEAST8_MIN    INT8_MIN
          147  +#define INT_LEAST8_MAX    INT8_MAX
          148  +#define INT_LEAST16_MIN   INT16_MIN
          149  +#define INT_LEAST16_MAX   INT16_MAX
          150  +#define INT_LEAST32_MIN   INT32_MIN
          151  +#define INT_LEAST32_MAX   INT32_MAX
          152  +#define INT_LEAST64_MIN   INT64_MIN
          153  +#define INT_LEAST64_MAX   INT64_MAX
          154  +#define UINT_LEAST8_MAX   UINT8_MAX
          155  +#define UINT_LEAST16_MAX  UINT16_MAX
          156  +#define UINT_LEAST32_MAX  UINT32_MAX
          157  +#define UINT_LEAST64_MAX  UINT64_MAX
          158  +
          159  +// 7.18.2.3 Limits of fastest minimum-width integer types
          160  +#define INT_FAST8_MIN    INT8_MIN
          161  +#define INT_FAST8_MAX    INT8_MAX
          162  +#define INT_FAST16_MIN   INT16_MIN
          163  +#define INT_FAST16_MAX   INT16_MAX
          164  +#define INT_FAST32_MIN   INT32_MIN
          165  +#define INT_FAST32_MAX   INT32_MAX
          166  +#define INT_FAST64_MIN   INT64_MIN
          167  +#define INT_FAST64_MAX   INT64_MAX
          168  +#define UINT_FAST8_MAX   UINT8_MAX
          169  +#define UINT_FAST16_MAX  UINT16_MAX
          170  +#define UINT_FAST32_MAX  UINT32_MAX
          171  +#define UINT_FAST64_MAX  UINT64_MAX
          172  +
          173  +// 7.18.2.4 Limits of integer types capable of holding object pointers
          174  +#ifdef _WIN64 // [
          175  +#  define INTPTR_MIN   INT64_MIN
          176  +#  define INTPTR_MAX   INT64_MAX
          177  +#  define UINTPTR_MAX  UINT64_MAX
          178  +#else // _WIN64 ][
          179  +#  define INTPTR_MIN   INT32_MIN
          180  +#  define INTPTR_MAX   INT32_MAX
          181  +#  define UINTPTR_MAX  UINT32_MAX
          182  +#endif // _WIN64 ]
          183  +
          184  +// 7.18.2.5 Limits of greatest-width integer types
          185  +#define INTMAX_MIN   INT64_MIN
          186  +#define INTMAX_MAX   INT64_MAX
          187  +#define UINTMAX_MAX  UINT64_MAX
          188  +
          189  +// 7.18.3 Limits of other integer types
          190  +
          191  +#ifdef _WIN64 // [
          192  +#  define PTRDIFF_MIN  _I64_MIN
          193  +#  define PTRDIFF_MAX  _I64_MAX
          194  +#else  // _WIN64 ][
          195  +#  define PTRDIFF_MIN  _I32_MIN
          196  +#  define PTRDIFF_MAX  _I32_MAX
          197  +#endif  // _WIN64 ]
          198  +
          199  +#define SIG_ATOMIC_MIN  INT_MIN
          200  +#define SIG_ATOMIC_MAX  INT_MAX
          201  +
          202  +#ifndef SIZE_MAX // [
          203  +#  ifdef _WIN64 // [
          204  +#     define SIZE_MAX  _UI64_MAX
          205  +#  else // _WIN64 ][
          206  +#     define SIZE_MAX  _UI32_MAX
          207  +#  endif // _WIN64 ]
          208  +#endif // SIZE_MAX ]
          209  +
          210  +// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
          211  +#ifndef WCHAR_MIN // [
          212  +#  define WCHAR_MIN  0
          213  +#endif  // WCHAR_MIN ]
          214  +#ifndef WCHAR_MAX // [
          215  +#  define WCHAR_MAX  _UI16_MAX
          216  +#endif  // WCHAR_MAX ]
          217  +
          218  +#define WINT_MIN  0
          219  +#define WINT_MAX  _UI16_MAX
          220  +
          221  +#endif // __STDC_LIMIT_MACROS ]
          222  +
          223  +
          224  +// 7.18.4 Limits of other integer types
          225  +
          226  +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
          227  +
          228  +// 7.18.4.1 Macros for minimum-width integer constants
          229  +
          230  +#define INT8_C(val)  val##i8
          231  +#define INT16_C(val) val##i16
          232  +#define INT32_C(val) val##i32
          233  +#define INT64_C(val) val##i64
          234  +
          235  +#define UINT8_C(val)  val##ui8
          236  +#define UINT16_C(val) val##ui16
          237  +#define UINT32_C(val) val##ui32
          238  +#define UINT64_C(val) val##ui64
          239  +
          240  +// 7.18.4.2 Macros for greatest-width integer constants
          241  +#define INTMAX_C   INT64_C
          242  +#define UINTMAX_C  UINT64_C
          243  +
          244  +#endif // __STDC_CONSTANT_MACROS ]
          245  +
          246  +
          247  +#endif // _MSC_STDINT_H_ ]

Added epsilon/pad.c.

            1  +/*
            2  + * $Id: pad.c,v 1.13 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <pad.h>
           26  +#include <color.h>
           27  +
           28  +void
           29  +extend_channel (unsigned char **input_channel,
           30  +		coeff_t ** output_channel,
           31  +		int input_width, int input_height,
           32  +		int output_width, int output_height)
           33  +{
           34  +    int i, j;
           35  +
           36  +    /* Sanity checks */
           37  +    assert ((input_width > 0) && (input_height > 0));
           38  +    assert ((output_width > 0) && (output_height > 0));
           39  +    assert (output_width >= input_width);
           40  +    assert (output_height >= input_height);
           41  +
           42  +    /* Copy original */
           43  +    for (i = 0; i < input_height; i++)
           44  +      {
           45  +	  for (j = 0; j < input_width; j++)
           46  +	    {
           47  +		output_channel[i][j] = input_channel[i][j];
           48  +	    }
           49  +      }
           50  +
           51  +    /* Fill horizontally */
           52  +    for (i = 0; i < input_height; i++)
           53  +      {
           54  +	  for (j = 0; j < output_width - input_width; j++)
           55  +	    {
           56  +		output_channel[i][input_width + j] =
           57  +		    output_channel[i][ABS (input_width - j - 1)];
           58  +	    }
           59  +      }
           60  +
           61  +    /* Fill vertically */
           62  +    for (j = 0; j < output_width; j++)
           63  +      {
           64  +	  for (i = 0; i < output_height - input_height; i++)
           65  +	    {
           66  +		output_channel[i + input_height][j] =
           67  +		    output_channel[ABS (input_height - i - 1)][j];
           68  +	    }
           69  +      }
           70  +}
           71  +
           72  +void
           73  +extract_channel (coeff_t ** input_channel,
           74  +		 unsigned char **output_channel,
           75  +		 int input_width, int input_height,
           76  +		 int output_width, int output_height)
           77  +{
           78  +    int i, j;
           79  +
           80  +    /* Sanity checks */
           81  +    assert ((input_width > 0) && (input_height > 0));
           82  +    assert ((output_width > 0) && (output_height > 0));
           83  +    assert (output_width <= input_width);
           84  +    assert (output_height <= output_height);
           85  +
           86  +    /* Extract & clip original data */
           87  +    for (i = 0; i < output_height; i++)
           88  +      {
           89  +	  for (j = 0; j < output_width; j++)
           90  +	    {
           91  +		output_channel[i][j] = CLIP (input_channel[i][j]);
           92  +	    }
           93  +      }
           94  +}

Added epsilon/pad.h.

            1  +/*
            2  + * $Id: pad.h,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Padding
           27  + *
           28  + *  The library expects that the image consists of square blocks
           29  + *  of certain size. Namely, 2^N or 2^N + 1 depending on selected
           30  + *  wavelet transform mode. Nevertheless, most real-life images
           31  + *  do not meet this strict requirement. That`s why we need to pad
           32  + *  boundary image blocks to the full size. Missing data is obtained
           33  + *  using pixel mirroring. */
           34  +
           35  +#ifndef __PAD_H__
           36  +#define __PAD_H__
           37  +
           38  +#ifdef __cplusplus
           39  +extern "C"
           40  +{
           41  +#endif
           42  +
           43  +/** \addtogroup pad Padding */
           44  +/*@{*/
           45  +
           46  +#include <common.h>
           47  +
           48  +/** Channel extension
           49  + *
           50  + *  This function extends \a input_channel using mirroring
           51  + *  operation. The result is stored in the \a output_channel.
           52  + *  Note that the \a output_channel must be greater than or
           53  + *  equal to the \a input_channel in both width and height.
           54  + *  Minimal channel size allowed is 1x1 pixels. Boundary
           55  + *  pixels are duplicated.
           56  + *
           57  + *  \param input_channel Input channel
           58  + *  \param output_channel Output channel
           59  + *  \param input_width Input channel width
           60  + *  \param input_height Input channel height
           61  + *  \param output_width Output channel width
           62  + *  \param output_height Output channel height
           63  + *
           64  + *  \return \c VOID */
           65  +    void extend_channel (unsigned char **input_channel,
           66  +			 coeff_t ** output_channel,
           67  +			 int input_width, int input_height,
           68  +			 int output_width, int output_height);
           69  +
           70  +/** Channel extraction
           71  + *
           72  + *  This function extracts a block of pixels from the
           73  + *  \a input_channel and stores it in the \a output_channel.
           74  + *  Note that the \a output_channel size must be less than
           75  + *  or equal to the \a input_channel in both width and height.
           76  + *  Minimal channel size allowed is 1x1 pixels.
           77  + *
           78  + *  \param input_channel Input channel
           79  + *  \param output_channel Output channel
           80  + *  \param input_width Input channel width
           81  + *  \param input_height Input channel height
           82  + *  \param output_width Output channel width
           83  + *  \param output_height Output channel height
           84  + *
           85  + *  \return \c VOID */
           86  +    void extract_channel (coeff_t ** input_channel,
           87  +			  unsigned char **output_channel,
           88  +			  int input_width, int input_height,
           89  +			  int output_width, int output_height);
           90  +
           91  +/*@}*/
           92  +
           93  +#ifdef __cplusplus
           94  +}
           95  +#endif
           96  +
           97  +#endif				/* __PAD_H__ */

Added epsilon/resample.c.

            1  +/*
            2  + * $Id: resample.c,v 1.9 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <resample.h>
           26  +
           27  +void
           28  +bilinear_resample_channel (coeff_t ** input_channel, coeff_t ** output_channel,
           29  +			   int input_width, int input_height,
           30  +			   int output_width, int output_height)
           31  +{
           32  +    coeff_t t, u;
           33  +    coeff_t tmp;
           34  +
           35  +    int i, j;
           36  +    int l, c;
           37  +
           38  +    /* Sanity checks */
           39  +    assert ((input_width > 1) && (input_height > 1));
           40  +    assert ((output_width > 1) && (output_height > 1));
           41  +
           42  +    for (i = 0; i < output_height; i++)
           43  +      {
           44  +	  for (j = 0; j < output_width; j++)
           45  +	    {
           46  +		tmp = (double) (input_height - 1) *
           47  +		    ((double) i / (double) (output_height - 1));
           48  +
           49  +		l = (int) tmp;
           50  +
           51  +		if (l < 0)
           52  +		  {
           53  +		      l = 0;
           54  +		  }
           55  +		else if (l >= input_height - 1)
           56  +		  {
           57  +		      l = input_height - 2;
           58  +		  }
           59  +
           60  +		u = tmp - (double) l;
           61  +
           62  +		tmp = (double) (input_width - 1) *
           63  +		    ((double) j / (double) (output_width - 1));
           64  +
           65  +		c = (int) tmp;
           66  +
           67  +		if (c < 0)
           68  +		  {
           69  +		      c = 0;
           70  +		  }
           71  +		else if (c >= input_width - 1)
           72  +		  {
           73  +		      c = input_width - 2;
           74  +		  }
           75  +
           76  +		t = tmp - (double) c;
           77  +
           78  +		output_channel[i][j] =
           79  +		    input_channel[l][c] * (1 - t) * (1 - u) +
           80  +		    input_channel[l + 1][c] * (1 - t) * u +
           81  +		    input_channel[l][c + 1] * t * (1 - u) +
           82  +		    input_channel[l + 1][c + 1] * t * u;
           83  +	    }
           84  +      }
           85  +}

Added epsilon/resample.h.

            1  +/*
            2  + * $Id: resample.h,v 1.12 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Resampling
           27  + *
           28  + *  It is well known that human eye is less sensitive to color
           29  + *  than intensity. It is worthwhile to utilize this fact. We can
           30  + *  store chroma channels with lower resolution than luma. One
           31  + *  can achieve this through channel resampling procedure.
           32  + *  At the moment EPSILON library uses bilinear resampling
           33  + *  algorithm.
           34  + *
           35  + *  \section References
           36  + *
           37  + *  <a href="http://en.wikipedia.org/wiki/Bilinear_interpolation">
           38  + *  Bilinear interpolation (Wikipedia) </a>
           39  + *
           40  + *  <a href="http://alglib.sources.ru/interpolation/bilinearresample.php">
           41  + *  Bilinear resampling (in Russian)</a> */
           42  +
           43  +#ifndef __RESAMPLE_H__
           44  +#define __RESAMPLE_H__
           45  +
           46  +#ifdef __cplusplus
           47  +extern "C"
           48  +{
           49  +#endif
           50  +
           51  +/** \addtogroup resampling Resampling */
           52  +/*@{*/
           53  +
           54  +#include <common.h>
           55  +
           56  +/** Bilinear channel resampling
           57  + *
           58  + *  This function performes bilinear channel resampling.
           59  + *
           60  + *  \param input_channel Input channel
           61  + *  \param output_channel Output channel
           62  + *  \param input_width Input channel width
           63  + *  \param input_height Input channel height
           64  + *  \param output_width Output channel width
           65  + *  \param output_height Output channel height
           66  + *
           67  + *  \return \c VOID
           68  + *
           69  + *  \note Input and output dimensions must be greater than 1. */
           70  +    void bilinear_resample_channel (coeff_t ** input_channel,
           71  +				    coeff_t ** output_channel, int input_width,
           72  +				    int input_height, int output_width,
           73  +				    int output_height);
           74  +/*@}*/
           75  +
           76  +#ifdef __cplusplus
           77  +}
           78  +#endif
           79  +
           80  +#endif				/* __RESAMPLE_H__ */

Added epsilon/speck.c.

            1  +/*
            2  + * $Id: speck.c,v 1.58 2008/03/22 18:04:23 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <speck.h>
           26  +#include <mem_alloc.h>
           27  +#include <list.h>
           28  +#include <bit_io.h>
           29  +#include <filter.h>
           30  +#include <color.h>
           31  +
           32  +/* Before you dive into the sources, note that
           33  + * X and Y axes here are swapped. In other words,
           34  + * X denotes vertical position while Y denotes
           35  + * horizontal position. The origin is the top-left
           36  + * point. Now you a warned. */
           37  +
           38  +local int
           39  +max_coeff (int **channel, int channel_size)
           40  +{
           41  +    int i, j, max = 0;
           42  +
           43  +    for (i = 0; i < channel_size; i++)
           44  +      {
           45  +	  for (j = 0; j < channel_size; j++)
           46  +	    {
           47  +		if (ABS (channel[i][j]) > max)
           48  +		  {
           49  +		      max = ABS (channel[i][j]);
           50  +		  }
           51  +	    }
           52  +      }
           53  +
           54  +    return max;
           55  +}
           56  +
           57  +local int
           58  +validate_set (pixel_set * set, int channel_size)
           59  +{
           60  +    int base_size = channel_size & (~1);
           61  +
           62  +    /* Basic checks */
           63  +    if ((set->type != TYPE_POINT) && (set->type != TYPE_S)
           64  +	&& (set->type != TYPE_I))
           65  +	return 0;
           66  +
           67  +    if ((set->x < 0) || (set->x >= channel_size))
           68  +	return 0;
           69  +
           70  +    if ((set->y < 0) || (set->y >= channel_size))
           71  +	return 0;
           72  +
           73  +    if ((set->width <= 0) || (set->width > channel_size))
           74  +	return 0;
           75  +
           76  +    if ((set->height <= 0) || (set->height > channel_size))
           77  +	return 0;
           78  +
           79  +    if (set->x + set->height > channel_size)
           80  +	return 0;
           81  +
           82  +    if (set->y + set->width > channel_size)
           83  +	return 0;
           84  +
           85  +    switch (set->type)
           86  +      {
           87  +      case TYPE_POINT:
           88  +	  {
           89  +	      /* Single point */
           90  +	      if ((set->width != 1) || (set->height != 1))
           91  +		  return 0;
           92  +
           93  +	      return 1;
           94  +	  }
           95  +      case TYPE_S:
           96  +	  {
           97  +	      /* Set of type 'S' */
           98  +	      int scale;
           99  +
          100  +	      if ((set->width == 1) && (set->height == 1))
          101  +		  return 0;
          102  +
          103  +	      if (channel_size == base_size)
          104  +		{
          105  +		    /* Normal mode */
          106  +		    if (set->width != set->height)
          107  +			return 0;
          108  +
          109  +		    if (!is_power_of_two (set->width))
          110  +			return 0;
          111  +
          112  +		    scale = number_of_bits (set->width) - 1;
          113  +
          114  +		    if ((set->x) & (~(~0 << scale)))
          115  +			return 0;
          116  +
          117  +		    if ((set->y) & (~(~0 << scale)))
          118  +			return 0;
          119  +
          120  +		    return 1;
          121  +		}
          122  +	      else
          123  +		{
          124  +		    /* OTLPF mode */
          125  +		    if ((set->x == 0) && (set->y == 0))
          126  +		      {
          127  +			  /* Origin */
          128  +			  if (set->width != set->height)
          129  +			      return 0;
          130  +
          131  +			  if (!is_power_of_two (set->width - 1))
          132  +			      return 0;
          133  +
          134  +			  return 1;
          135  +		      }
          136  +		    else if ((set->x == 0) && (set->y > 1))
          137  +		      {
          138  +			  /* Top border */
          139  +			  if (set->height - set->width != 1)
          140  +			      return 0;
          141  +
          142  +			  if (!is_power_of_two (set->width))
          143  +			      return 0;
          144  +
          145  +			  scale = number_of_bits (set->width) - 1;
          146  +
          147  +			  if ((set->y - 1) & (~(~0 << scale)))
          148  +			      return 0;
          149  +
          150  +			  return 1;
          151  +		      }
          152  +		    else if ((set->x > 1) && (set->y == 0))
          153  +		      {
          154  +			  /* Left border */
          155  +			  if (set->width - set->height != 1)
          156  +			      return 0;
          157  +
          158  +			  if (!is_power_of_two (set->height))
          159  +			      return 0;
          160  +
          161  +			  scale = number_of_bits (set->height) - 1;
          162  +
          163  +			  if ((set->x - 1) & (~(~0 << scale)))
          164  +			      return 0;
          165  +
          166  +			  return 1;
          167  +		      }
          168  +		    else if ((set->x > 1) && (set->y > 1))
          169  +		      {
          170  +			  /* Internal */
          171  +			  if (set->width != set->height)
          172  +			      return 0;
          173  +
          174  +			  if (!is_power_of_two (set->width))
          175  +			      return 0;
          176  +
          177  +			  scale = number_of_bits (set->width) - 1;
          178  +
          179  +			  if ((set->x - 1) & (~(~0 << scale)))
          180  +			      return 0;
          181  +
          182  +			  if ((set->y - 1) & (~(~0 << scale)))
          183  +			      return 0;
          184  +
          185  +			  return 1;
          186  +		      }
          187  +		    else
          188  +		      {
          189  +			  return 0;
          190  +		      }
          191  +		}
          192  +	  }
          193  +      case TYPE_I:
          194  +	  {
          195  +	      /* Set of type 'I' */
          196  +	      if (set->x != set->y)
          197  +		  return 0;
          198  +
          199  +	      if (set->width != set->height)
          200  +		  return 0;
          201  +
          202  +	      if (set->x + set->width != channel_size)
          203  +		  return 0;
          204  +
          205  +	      if (channel_size == base_size)
          206  +		{
          207  +		    /* Normal mode */
          208  +		    if (!is_power_of_two (set->x))
          209  +			return 0;
          210  +		}
          211  +	      else
          212  +		{
          213  +		    /* OTLPF mode */
          214  +		    if (!is_power_of_two (set->x - 1))
          215  +			return 0;
          216  +		}
          217  +
          218  +	      return 1;
          219  +	  }
          220  +      default:
          221  +	  {
          222  +	      return 0;
          223  +	  }
          224  +      }
          225  +}
          226  +
          227  +local int
          228  +significance_test (pixel_set * set, int threshold,
          229  +		   int **channel, int channel_size)
          230  +{
          231  +#ifdef ENABLE_SET_VALIDATION
          232  +    /* Ensure that the set is valid */
          233  +    assert (validate_set (set, channel_size));
          234  +#endif
          235  +
          236  +    assert (threshold > 0);
          237  +
          238  +    switch (set->type)
          239  +      {
          240  +      case TYPE_POINT:
          241  +	  {
          242  +	      /* Single point */
          243  +	      return (ABS (channel[set->x][set->y]) >= threshold);
          244  +	      break;
          245  +	  }
          246  +      case TYPE_S:
          247  +	  {
          248  +	      /* Set of type 'S' */
          249  +	      int x, y;
          250  +
          251  +	      for (x = set->x; x < set->x + set->height; x++)
          252  +		{
          253  +		    for (y = set->y; y < set->y + set->width; y++)
          254  +		      {
          255  +			  if (ABS (channel[x][y]) >= threshold)
          256  +			    {
          257  +				return 1;
          258  +			    }
          259  +		      }
          260  +		}
          261  +
          262  +	      return 0;
          263  +	      break;
          264  +	  }
          265  +      case TYPE_I:
          266  +	  {
          267  +	      /* Set of type 'I' */
          268  +	      int x, y;
          269  +
          270  +	      for (x = 0; x < channel_size; x++)
          271  +		{
          272  +		    for (y = 0; y < channel_size; y++)
          273  +		      {
          274  +			  if ((x >= set->x) || (y >= set->y))
          275  +			    {
          276  +				if (ABS (channel[x][y]) >= threshold)
          277  +				  {
          278  +				      return 1;
          279  +				  }
          280  +			    }
          281  +		      }
          282  +		}
          283  +
          284  +	      return 0;
          285  +	      break;
          286  +	  }
          287  +      default:
          288  +	  {
          289  +	      assert (0);
          290  +	      break;
          291  +	  }
          292  +      }
          293  +    return -1;
          294  +}
          295  +
          296  +local void
          297  +select_part_type (pixel_set * set)
          298  +{
          299  +    /* Guess the set type after split operation */
          300  +    if ((set->width == 1) && (set->height == 1))
          301  +      {
          302  +	  set->type = TYPE_POINT;
          303  +      }
          304  +    else if ((set->width == 0) || (set->height == 0))
          305  +      {
          306  +	  set->type = TYPE_EMPTY;
          307  +      }
          308  +    else
          309  +      {
          310  +	  set->type = TYPE_S;
          311  +      }
          312  +}
          313  +
          314  +local void
          315  +split_set (pixel_set * set, pixel_set * part1, pixel_set * part2,
          316  +	   pixel_set * part3, pixel_set * part4, int channel_size)
          317  +{
          318  +    int base_size = channel_size & (~1);
          319  +
          320  +#ifdef ENABLE_SET_VALIDATION
          321  +    /* Ensure that the set is valid */
          322  +    assert (validate_set (set, channel_size));
          323  +#endif
          324  +
          325  +    switch (set->type)
          326  +      {
          327  +      case TYPE_S:
          328  +	  {
          329  +	      /* Split parent set of type 'S' */
          330  +	      part1->x = set->x;
          331  +	      part1->y = set->y;
          332  +	      part1->width = (set->width + 1) / 2;
          333  +	      part1->height = (set->height + 1) / 2;
          334  +	      select_part_type (part1);
          335  +
          336  +	      part2->x = set->x;
          337  +	      part2->y = set->y + (set->width + 1) / 2;
          338  +	      part2->width = set->width / 2;
          339  +	      part2->height = (set->height + 1) / 2;
          340  +	      select_part_type (part2);
          341  +
          342  +	      part3->x = set->x + (set->height + 1) / 2;
          343  +	      part3->y = set->y;
          344  +	      part3->width = (set->width + 1) / 2;
          345  +	      part3->height = set->height / 2;
          346  +	      select_part_type (part3);
          347  +
          348  +	      part4->x = set->x + (set->height + 1) / 2;
          349  +	      part4->y = set->y + (set->width + 1) / 2;
          350  +	      part4->width = set->width / 2;
          351  +	      part4->height = set->height / 2;
          352  +	      select_part_type (part4);
          353  +
          354  +	      break;
          355  +	  }
          356  +      case TYPE_I:
          357  +	  {
          358  +	      /* Split parent set of type 'I' */
          359  +	      int p0, p1;
          360  +	      int scale;
          361  +
          362  +	      scale = number_of_bits (set->x - (channel_size != base_size));
          363  +
          364  +	      p0 = set->x;
          365  +	      p1 = (1 << scale) + (channel_size != base_size);
          366  +
          367  +	      part1->x = part1->y = p1;
          368  +	      part1->width = part1->height = channel_size - p1;
          369  +	      part1->type = (p1 == channel_size) ? TYPE_EMPTY : TYPE_I;
          370  +
          371  +	      part2->x = 0;
          372  +	      part2->y = p0;
          373  +	      part2->width = p1 - p0;
          374  +	      part2->height = p0;
          375  +	      select_part_type (part2);
          376  +
          377  +	      part3->x = p0;
          378  +	      part3->y = 0;
          379  +	      part3->width = p0;
          380  +	      part3->height = p1 - p0;
          381  +	      select_part_type (part3);
          382  +
          383  +	      part4->x = part4->y = p0;
          384  +	      part4->width = part4->height = p1 - p0;
          385  +	      select_part_type (part4);
          386  +
          387  +	      break;
          388  +	  }
          389  +      default:
          390  +	  {
          391  +	      assert (0);
          392  +	      break;
          393  +	  }
          394  +      }
          395  +}
          396  +
          397  +local linked_list **
          398  +alloc_LIS_slots (int channel_size)
          399  +{
          400  +    linked_list **LIS_slots;
          401  +    int n_slots;
          402  +    int i;
          403  +
          404  +    /* Think of this structure as a list of lists. Splitting
          405  +     * entire list into several slots speed-ups algorithm:
          406  +     * one slot for each scale. */
          407  +    n_slots = number_of_bits (channel_size);
          408  +    LIS_slots = (linked_list **) xmalloc (n_slots * sizeof (linked_list *));
          409  +
          410  +    for (i = 0; i < n_slots; i++)
          411  +      {
          412  +	  LIS_slots[i] = alloc_linked_list ();
          413  +      }
          414  +
          415  +    return LIS_slots;
          416  +}
          417  +
          418  +local void
          419  +free_LIS_slots (linked_list ** LIS_slots, int channel_size)
          420  +{
          421  +    int n_slots;
          422  +    int i;
          423  +
          424  +    n_slots = number_of_bits (channel_size);
          425  +
          426  +    for (i = 0; i < n_slots; i++)
          427  +      {
          428  +	  free_linked_list (LIS_slots[i]);
          429  +      }
          430  +
          431  +    free (LIS_slots);
          432  +}
          433  +
          434  +local void
          435  +assign_set (list_node * node, pixel_set * set)
          436  +{
          437  +    PIXEL_SET (node)->type = set->type;
          438  +    PIXEL_SET (node)->x = set->x;
          439  +    PIXEL_SET (node)->y = set->y;
          440  +    PIXEL_SET (node)->width = set->width;
          441  +    PIXEL_SET (node)->height = set->height;
          442  +}
          443  +
          444  +local void
          445  +zero_channel (int **channel, int channel_size)
          446  +{
          447  +    int i, j;
          448  +
          449  +    /* Reset everything to zero */
          450  +    for (i = 0; i < channel_size; i++)
          451  +      {
          452  +	  for (j = 0; j < channel_size; j++)
          453  +	    {
          454  +		channel[i][j] = 0;
          455  +	    }
          456  +      }
          457  +}
          458  +
          459  +local int
          460  +speck_encode_S (int **channel, int channel_size,
          461  +		pixel_set * set, linked_list ** LIS_slots,
          462  +		linked_list * LSP, bit_buffer * bb, int threshold)
          463  +{
          464  +    pixel_set new_sets[4];
          465  +    int result;
          466  +    int st[4];
          467  +    int flag;
          468  +    int i;
          469  +
          470  +    /* Split parent set */
          471  +    split_set (set, &new_sets[0], &new_sets[1], &new_sets[2], &new_sets[3],
          472  +	       channel_size);
          473  +
          474  +    /* Test each set for significance skipping over empty sets */
          475  +    for (flag = 0, i = 3; i >= 0; i--)
          476  +      {
          477  +	  if (new_sets[i].type == TYPE_EMPTY)
          478  +	    {
          479  +		continue;
          480  +	    }
          481  +
          482  +	  st[i] =
          483  +	      significance_test (&new_sets[i], threshold, channel,
          484  +				 channel_size);
          485  +
          486  +	  if (i)
          487  +	    {
          488  +		flag |= st[i];
          489  +	    }
          490  +
          491  +	  /* If parent set is significant, but first three
          492  +	   * child sets are not, than undoubtedly fourth
          493  +	   * child set is significant: there is no need
          494  +	   * to code this explicitly. Using this trick
          495  +	   * saves some bit-budget. */
          496  +	  if (i || flag)
          497  +	    {
          498  +		result = st[i] ? write_1 (bb) : write_0 (bb);
          499  +		RETURN_IF_OVERFLOW (result);
          500  +	    }
          501  +      }
          502  +
          503  +    /* Process non-empty sets using their significance information */
          504  +    for (i = 0; i < 4; i++)
          505  +      {
          506  +	  if (new_sets[i].type == TYPE_EMPTY)
          507  +	    {
          508  +		continue;
          509  +	    }
          510  +
          511  +	  if (st[i])
          512  +	    {
          513  +		/* Significant set */
          514  +		if (new_sets[i].type == TYPE_POINT)
          515  +		  {
          516  +		      /* Single point */
          517  +		      list_node *new_node;
          518  +
          519  +		      /* Encode coefficient sign */
          520  +		      result =
          521  +			  channel[new_sets[i].x][new_sets[i].y] >
          522  +			  0 ? write_0 (bb) : write_1 (bb);
          523  +		      RETURN_IF_OVERFLOW (result);
          524  +
          525  +		      new_node = alloc_list_node (sizeof (pixel_set));
          526  +		      assign_set (new_node, &new_sets[i]);
          527  +		      append_list_node (LSP, new_node);
          528  +		  }
          529  +		else
          530  +		  {
          531  +		      /* Encode set of type 'S' */
          532  +		      result =
          533  +			  speck_encode_S (channel, channel_size, &new_sets[i],
          534  +					  LIS_slots, LSP, bb, threshold);
          535  +
          536  +		      RETURN_IF_OVERFLOW (result);
          537  +		  }
          538  +	    }
          539  +	  else
          540  +	    {
          541  +		/* Insignificant set */
          542  +		list_node *new_node = alloc_list_node (sizeof (pixel_set));
          543  +		assign_set (new_node, &new_sets[i]);
          544  +		prepend_list_node (LIS_slots[SLOT_INDEX ((&new_sets[i]))],
          545  +				   new_node);
          546  +	    }
          547  +      }
          548  +
          549  +    return BIT_BUFFER_OK;
          550  +}
          551  +
          552  +local int
          553  +speck_process_S (int **channel, int channel_size,
          554  +		 list_node * node, linked_list * slot,
          555  +		 linked_list ** LIS_slots, linked_list * LSP,
          556  +		 bit_buffer * bb, int threshold, int coding_stage)
          557  +{
          558  +    pixel_set *set;
          559  +    int result;
          560  +    int st;
          561  +
          562  +    /* Test the set for significance */
          563  +    set = PIXEL_SET (node);
          564  +    st = significance_test (set, threshold, channel, channel_size);
          565  +
          566  +    result = st ? write_1 (bb) : write_0 (bb);
          567  +    RETURN_IF_OVERFLOW (result);
          568  +
          569  +    if (st)
          570  +      {
          571  +	  /* Significant set */
          572  +	  if (set->type == TYPE_POINT)
          573  +	    {
          574  +		/* Single point: encode coefficient sign */
          575  +		result =
          576  +		    channel[set->x][set->y] > 0 ? write_0 (bb) : write_1 (bb);
          577  +		RETURN_IF_OVERFLOW (result);
          578  +
          579  +		if (coding_stage == STAGE_S)
          580  +		  {
          581  +		      remove_list_node_link (slot, node);
          582  +		  }
          583  +
          584  +		append_list_node (LSP, node);
          585  +	    }
          586  +	  else
          587  +	    {
          588  +		/* Encode set of type 'S' */
          589  +		result = speck_encode_S (channel, channel_size, set,
          590  +					 LIS_slots, LSP, bb, threshold);
          591  +
          592  +		RETURN_IF_OVERFLOW (result);
          593  +
          594  +		if (coding_stage == STAGE_S)
          595  +		  {
          596  +		      remove_list_node (slot, node);
          597  +		  }
          598  +		else
          599  +		  {
          600  +		      free_list_node (node);
          601  +		  }
          602  +	    }
          603  +      }
          604  +    else
          605  +      {
          606  +	  /* Insignificant set */
          607  +	  if (coding_stage == STAGE_I)
          608  +	    {
          609  +		prepend_list_node (LIS_slots[SLOT_INDEX (set)], node);
          610  +	    }
          611  +      }
          612  +
          613  +    return BIT_BUFFER_OK;
          614  +}
          615  +
          616  +local int
          617  +speck_encode_I (int **channel, int channel_size, pixel_set * I,
          618  +		linked_list ** LIS_slots, linked_list * LSP,
          619  +		bit_buffer * bb, int threshold)
          620  +{
          621  +    pixel_set new_sets[3];
          622  +    int result;
          623  +    int i;
          624  +
          625  +    /* Split parent set */
          626  +    split_set (I, I, &new_sets[0], &new_sets[1], &new_sets[2], channel_size);
          627  +
          628  +    /* Process child sets of type 'S' */
          629  +    for (i = 0; i < 3; i++)
          630  +      {
          631  +	  list_node *node = alloc_list_node (sizeof (pixel_set));
          632  +	  assign_set (node, &new_sets[i]);
          633  +
          634  +	  /* Process child set of type 'S' */
          635  +	  result = speck_process_S (channel, channel_size, node,
          636  +				    NULL, LIS_slots, LSP, bb,
          637  +				    threshold, STAGE_I);
          638  +
          639  +	  if (result == BIT_BUFFER_OVERFLOW)
          640  +	    {
          641  +		free_list_node (node);
          642  +		return result;
          643  +	    }
          644  +      }
          645  +
          646  +    /* Process child set of type 'I' */
          647  +    result = speck_process_I (channel, channel_size, I,
          648  +			      LIS_slots, LSP, bb, threshold);
          649  +
          650  +    return result;
          651  +}
          652  +
          653  +local int
          654  +speck_process_I (int **channel, int channel_size, pixel_set * I,
          655  +		 linked_list ** LIS_slots, linked_list * LSP,
          656  +		 bit_buffer * bb, int threshold)
          657  +{
          658  +    int result;
          659  +    int st;
          660  +
          661  +    /* Skip over empty sets */
          662  +    if (I->type == TYPE_EMPTY)
          663  +      {
          664  +	  return BIT_BUFFER_OK;
          665  +      }
          666  +
          667  +    /* Test the set for significance */
          668  +    st = significance_test (I, threshold, channel, channel_size);
          669  +
          670  +    result = st ? write_1 (bb) : write_0 (bb);
          671  +    RETURN_IF_OVERFLOW (result);
          672  +
          673  +    if (st)
          674  +      {
          675  +	  /* Encode set of type 'I' */
          676  +	  result = speck_encode_I (channel, channel_size, I,
          677  +				   LIS_slots, LSP, bb, threshold);
          678  +
          679  +	  RETURN_IF_OVERFLOW (result);
          680  +      }
          681  +
          682  +    return BIT_BUFFER_OK;
          683  +}
          684  +
          685  +local int
          686  +encode_sorting_pass (int **channel, int channel_size,
          687  +		     linked_list ** LIS_slots, linked_list * LSP,
          688  +		     pixel_set * I, bit_buffer * bb, int threshold)
          689  +{
          690  +    int n_slots;
          691  +    int result;
          692  +    int i;
          693  +
          694  +    n_slots = number_of_bits (channel_size);
          695  +
          696  +    /* Travels through all LIS slots */
          697  +    for (i = 0; i < n_slots; i++)
          698  +      {
          699  +	  linked_list *cur_slot = LIS_slots[i];
          700  +	  list_node *cur_node;
          701  +
          702  +	  /* Skip over empty slots */
          703  +	  CONTINUE_IF_EMPTY (cur_slot);
          704  +
          705  +	  /* Get first slot node */
          706  +	  cur_node = cur_slot->first;
          707  +
          708  +	  /* Process all nodes within this slot */
          709  +	  while (cur_node)
          710  +	    {
          711  +		list_node *next_node = cur_node->next;
          712  +
          713  +		/* Process set of type 'S' */
          714  +		result = speck_process_S (channel, channel_size, cur_node,
          715  +					  cur_slot, LIS_slots, LSP, bb,
          716  +					  threshold, STAGE_S);
          717  +
          718  +		RETURN_IF_OVERFLOW (result);
          719  +
          720  +		/* Next node */
          721  +		cur_node = next_node;
          722  +	    }
          723  +      }
          724  +
          725  +    /* Process set of type 'I' */
          726  +    result = speck_process_I (channel, channel_size, I,
          727  +			      LIS_slots, LSP, bb, threshold);
          728  +
          729  +    return result;
          730  +}
          731  +
          732  +local int
          733  +encode_refinement_pass (int **channel, linked_list * LSP,
          734  +			bit_buffer * bb, int threshold)
          735  +{
          736  +    list_node *node;
          737  +    int result;
          738  +
          739  +    node = LSP->first;
          740  +    threshold <<= 1;
          741  +
          742  +    /* Travels through all nodes in LSP */
          743  +    while (node)
          744  +      {
          745  +	  pixel_set *set = PIXEL_SET (node);
          746  +	  int coeff = ABS (channel[set->x][set->y]);
          747  +
          748  +	  /* Output next bit */
          749  +	  if (coeff >= threshold)
          750  +	    {
          751  +		result = coeff & (threshold >> 1) ? write_1 (bb) : write_0 (bb);
          752  +		RETURN_IF_OVERFLOW (result);
          753  +	    }
          754  +
          755  +	  /* Next node */
          756  +	  node = node->next;
          757  +      }
          758  +
          759  +    return BIT_BUFFER_OK;
          760  +}
          761  +
          762  +local int
          763  +speck_decode_S (int **channel, int channel_size,
          764  +		pixel_set * set, linked_list ** LIS_slots,
          765  +		linked_list * LSP, bit_buffer * bb, int threshold)
          766  +{
          767  +    pixel_set new_sets[4];
          768  +    int result;
          769  +    int st[4];
          770  +    int flag;
          771  +    int i;
          772  +
          773  +    /* Split parent set */
          774  +    split_set (set, &new_sets[0], &new_sets[1], &new_sets[2], &new_sets[3],
          775  +	       channel_size);
          776  +
          777  +    /* Test each set for significance skipping over empty sets */
          778  +    for (flag = 0, i = 3; i >= 0; i--)
          779  +      {
          780  +	  if (new_sets[i].type == TYPE_EMPTY)
          781  +	    {
          782  +		continue;
          783  +	    }
          784  +
          785  +	  if (i)
          786  +	    {
          787  +		result = read_bit (bb, &st[i]);
          788  +		RETURN_IF_UNDERFLOW (result);
          789  +
          790  +		flag |= st[i];
          791  +	    }
          792  +	  else
          793  +	    {
          794  +		if (flag)
          795  +		  {
          796  +		      result = read_bit (bb, &st[i]);
          797  +		      RETURN_IF_UNDERFLOW (result);
          798  +		  }
          799  +		else
          800  +		  {
          801  +		      /* Implicitly significant set */
          802  +		      st[i] = 1;
          803  +		  }
          804  +	    }
          805  +      }
          806  +
          807  +    /* Process non-empty sets using their significance information */
          808  +    for (i = 0; i < 4; i++)
          809  +      {
          810  +	  if (new_sets[i].type == TYPE_EMPTY)
          811  +	    {
          812  +		continue;
          813  +	    }
          814  +
          815  +	  if (st[i])
          816  +	    {
          817  +		/* Significant set */
          818  +		if (new_sets[i].type == TYPE_POINT)
          819  +		  {
          820  +		      /* Single point */
          821  +		      list_node *new_node;
          822  +		      int sign = 0;
          823  +
          824  +		      result = read_bit (bb, &sign);
          825  +		      RETURN_IF_UNDERFLOW (result);
          826  +
          827  +		      /* Decode coefficient sign */
          828  +		      if (sign)
          829  +			{
          830  +			    channel[new_sets[i].x][new_sets[i].y] =
          831  +				-(threshold + (threshold >> 1));
          832  +			}
          833  +		      else
          834  +			{
          835  +			    channel[new_sets[i].x][new_sets[i].y] =
          836  +				(threshold + (threshold >> 1));
          837  +			}
          838  +
          839  +		      new_node = alloc_list_node (sizeof (pixel_set));
          840  +		      assign_set (new_node, &new_sets[i]);
          841  +		      append_list_node (LSP, new_node);
          842  +		  }
          843  +		else
          844  +		  {
          845  +		      /* Decode set of type 'S' */
          846  +		      result =
          847  +			  speck_decode_S (channel, channel_size, &new_sets[i],
          848  +					  LIS_slots, LSP, bb, threshold);
          849  +
          850  +		      RETURN_IF_UNDERFLOW (result);
          851  +		  }
          852  +	    }
          853  +	  else
          854  +	    {
          855  +		/* Insignificant set */
          856  +		list_node *new_node = alloc_list_node (sizeof (pixel_set));
          857  +		assign_set (new_node, &new_sets[i]);
          858  +		prepend_list_node (LIS_slots[SLOT_INDEX ((&new_sets[i]))],
          859  +				   new_node);
          860  +	    }
          861  +      }
          862  +
          863  +    return BIT_BUFFER_OK;
          864  +}
          865  +
          866  +local int
          867  +speck_unprocess_S (int **channel, int channel_size,
          868  +		   list_node * node, linked_list * slot,
          869  +		   linked_list ** LIS_slots, linked_list * LSP,
          870  +		   bit_buffer * bb, int threshold, int coding_stage)
          871  +{
          872  +    pixel_set *set;
          873  +    int result;
          874  +    int st;
          875  +
          876  +    set = PIXEL_SET (node);
          877  +
          878  +    /* Read set significance information */
          879  +    result = read_bit (bb, &st);
          880  +    RETURN_IF_UNDERFLOW (result);
          881  +
          882  +    if (st)
          883  +      {
          884  +	  /* Significant set */
          885  +	  if (set->type == TYPE_POINT)
          886  +	    {
          887  +		int sign = 0;
          888  +
          889  +		/* Single point: read coefficient sign */
          890  +		result = read_bit (bb, &sign);
          891  +		RETURN_IF_UNDERFLOW (result);
          892  +
          893  +		if (sign)
          894  +		  {
          895  +		      channel[set->x][set->y] = -(threshold + (threshold >> 1));
          896  +		  }
          897  +		else
          898  +		  {
          899  +		      channel[set->x][set->y] = (threshold + (threshold >> 1));
          900  +		  }
          901  +
          902  +		if (coding_stage == STAGE_S)
          903  +		  {
          904  +		      remove_list_node_link (slot, node);
          905  +		  }
          906  +
          907  +		append_list_node (LSP, node);
          908  +	    }
          909  +	  else
          910  +	    {
          911  +		/* Decode set of type 'S' */
          912  +		result = speck_decode_S (channel, channel_size, set,
          913  +					 LIS_slots, LSP, bb, threshold);
          914  +
          915  +		RETURN_IF_UNDERFLOW (result);
          916  +
          917  +		if (coding_stage == STAGE_S)
          918  +		  {
          919  +		      remove_list_node (slot, node);
          920  +		  }
          921  +		else
          922  +		  {
          923  +		      free_list_node (node);
          924  +		  }
          925  +	    }
          926  +      }
          927  +    else
          928  +      {
          929  +	  /* Insignificant set */
          930  +	  if (coding_stage == STAGE_I)
          931  +	    {
          932  +		prepend_list_node (LIS_slots[SLOT_INDEX (set)], node);
          933  +	    }
          934  +      }
          935  +
          936  +    return BIT_BUFFER_OK;
          937  +}
          938  +
          939  +local int
          940  +speck_decode_I (int **channel, int channel_size, pixel_set * I,
          941  +		linked_list ** LIS_slots, linked_list * LSP,
          942  +		bit_buffer * bb, int threshold)
          943  +{
          944  +    pixel_set new_sets[3];
          945  +    int result;
          946  +    int i;
          947  +
          948  +    /* Split parent set */
          949  +    split_set (I, I, &new_sets[0], &new_sets[1], &new_sets[2], channel_size);
          950  +
          951  +    /* Unprocess sets of type 'S' */
          952  +    for (i = 0; i < 3; i++)
          953  +      {
          954  +	  list_node *node = alloc_list_node (sizeof (pixel_set));
          955  +	  assign_set (node, &new_sets[i]);
          956  +
          957  +	  result = speck_unprocess_S (channel, channel_size, node,
          958  +				      NULL, LIS_slots, LSP, bb,
          959  +				      threshold, STAGE_I);
          960  +
          961  +	  if (result == BIT_BUFFER_UNDERFLOW)
          962  +	    {
          963  +		free_list_node (node);
          964  +		return result;
          965  +	    }
          966  +      }
          967  +
          968  +    /* Unprocess set of type 'I' */
          969  +    result = speck_unprocess_I (channel, channel_size, I,
          970  +				LIS_slots, LSP, bb, threshold);
          971  +
          972  +    return result;
          973  +}
          974  +
          975  +local int
          976  +speck_unprocess_I (int **channel, int channel_size,
          977  +		   pixel_set * I, linked_list ** LIS_slots,
          978  +		   linked_list * LSP, bit_buffer * bb, int threshold)
          979  +{
          980  +    int result;
          981  +    int st;
          982  +
          983  +    /* Skip over empty sets */
          984  +    if (I->type == TYPE_EMPTY)
          985  +      {
          986  +	  return BIT_BUFFER_OK;
          987  +      }
          988  +
          989  +    /* Read significance information */
          990  +    result = read_bit (bb, &st);
          991  +    RETURN_IF_UNDERFLOW (result);
          992  +
          993  +    if (st)
          994  +      {
          995  +	  result = speck_decode_I (channel, channel_size, I,
          996  +				   LIS_slots, LSP, bb, threshold);
          997  +
          998  +	  RETURN_IF_UNDERFLOW (result);
          999  +      }
         1000  +
         1001  +    return BIT_BUFFER_OK;
         1002  +}
         1003  +
         1004  +local int
         1005  +decode_sorting_pass (int **channel, int channel_size,
         1006  +		     linked_list ** LIS_slots, linked_list * LSP,
         1007  +		     pixel_set * I, bit_buffer * bb, int threshold)
         1008  +{
         1009  +    int n_slots;
         1010  +    int result;
         1011  +    int i;
         1012  +
         1013  +    n_slots = number_of_bits (channel_size);
         1014  +
         1015  +    /* Travels through all LIS slots */
         1016  +    for (i = 0; i < n_slots; i++)
         1017  +      {
         1018  +	  linked_list *cur_slot = LIS_slots[i];
         1019  +	  list_node *cur_node;
         1020  +
         1021  +	  /* Skip over empty slots */
         1022  +	  CONTINUE_IF_EMPTY (cur_slot);
         1023  +
         1024  +	  /* Get first node */
         1025  +	  cur_node = cur_slot->first;
         1026  +
         1027  +	  /* Process all nodes within this slot */
         1028  +	  while (cur_node)
         1029  +	    {
         1030  +		list_node *next_node = cur_node->next;
         1031  +
         1032  +		/* Unprocess set of type 'S' */
         1033  +		result = speck_unprocess_S (channel, channel_size, cur_node,
         1034  +					    cur_slot, LIS_slots, LSP,
         1035  +					    bb, threshold, STAGE_S);
         1036  +
         1037  +		RETURN_IF_UNDERFLOW (result);
         1038  +
         1039  +		/* Next node */
         1040  +		cur_node = next_node;
         1041  +	    }
         1042  +      }
         1043  +
         1044  +    /* Unprocess set of type 'I' */
         1045  +    result = speck_unprocess_I (channel, channel_size, I,
         1046  +				LIS_slots, LSP, bb, threshold);
         1047  +
         1048  +    return result;
         1049  +}
         1050  +
         1051  +local int
         1052  +decode_refinement_pass (int **channel, linked_list * LSP,
         1053  +			bit_buffer * bb, int threshold)
         1054  +{
         1055  +    list_node *node;
         1056  +    int result;
         1057  +    int mask;
         1058  +
         1059  +    node = LSP->first;
         1060  +
         1061  +    mask = threshold;
         1062  +    threshold <<= 1;
         1063  +
         1064  +    /* Travels through all nodes in LSP */
         1065  +    while (node)
         1066  +      {
         1067  +	  pixel_set *set = PIXEL_SET (node);
         1068  +
         1069  +	  int coeff = ABS (channel[set->x][set->y]);
         1070  +	  int sign = channel[set->x][set->y] < 0;
         1071  +
         1072  +	  if (coeff >= threshold)
         1073  +	    {
         1074  +		int bit = 0;
         1075  +
         1076  +		/* Read and shift-in next bit */
         1077  +		result = read_bit (bb, &bit);
         1078  +		RETURN_IF_OVERFLOW (result);
         1079  +
         1080  +		if (bit)
         1081  +		  {
         1082  +		      coeff |= mask;
         1083  +		  }
         1084  +		else
         1085  +		  {
         1086  +		      coeff &= ~mask;
         1087  +		  }
         1088  +
         1089  +		coeff |= (mask >> 1);
         1090  +		channel[set->x][set->y] = sign ? -coeff : coeff;
         1091  +	    }
         1092  +
         1093  +	  /* Next node */
         1094  +	  node = node->next;
         1095  +      }
         1096  +
         1097  +    return BIT_BUFFER_OK;
         1098  +}
         1099  +
         1100  +local void
         1101  +speck_init (linked_list ** LIS_slots, pixel_set * I, int channel_size, int mode)
         1102  +{
         1103  +    list_node *root;
         1104  +
         1105  +    root = alloc_list_node (sizeof (pixel_set));
         1106  +
         1107  +    /* Setup root node */
         1108  +    if (mode == MODE_NORMAL)
         1109  +      {
         1110  +	  PIXEL_SET (root)->type = TYPE_POINT;
         1111  +	  PIXEL_SET (root)->x = PIXEL_SET (root)->y = 0;
         1112  +	  PIXEL_SET (root)->width = PIXEL_SET (root)->height = 1;
         1113  +
         1114  +	  I->type = TYPE_I;
         1115  +	  I->x = I->y = 1;
         1116  +	  I->width = I->height = channel_size - 1;
         1117  +
         1118  +	  prepend_list_node (LIS_slots[0], root);
         1119  +      }
         1120  +    else
         1121  +      {
         1122  +	  PIXEL_SET (root)->type = TYPE_S;
         1123  +	  PIXEL_SET (root)->x = PIXEL_SET (root)->y = 0;
         1124  +	  PIXEL_SET (root)->width = PIXEL_SET (root)->height = 2;
         1125  +
         1126  +	  I->type = TYPE_I;
         1127  +	  I->x = I->y = 2;
         1128  +	  I->width = I->height = channel_size - 2;
         1129  +
         1130  +	  prepend_list_node (LIS_slots[1], root);
         1131  +      }
         1132  +}
         1133  +
         1134  +int
         1135  +speck_encode (int **channel, int channel_size, unsigned char *buf, int buf_size)
         1136  +{
         1137  +    int threshold_bits;
         1138  +    int threshold;
         1139  +    int result;
         1140  +    int mode;
         1141  +    int n_bytes;
         1142  +
         1143  +    linked_list **LIS_slots;
         1144  +    linked_list *LSP;
         1145  +    pixel_set *I;
         1146  +
         1147  +    bit_buffer *bb;
         1148  +
         1149  +    mode = channel_size & 1;
         1150  +
         1151  +    /* Sanity checks */
         1152  +    assert (buf_size >= MIN_SPECK_BUF_SIZE);
         1153  +    assert (channel_size >= 2);
         1154  +
         1155  +    /* Allocate list of significant pixels (LSP),
         1156  +     * list of lists of insignificant sets (LIS_slots),
         1157  +     * and set of type 'I' */
         1158  +    LSP = alloc_linked_list ();
         1159  +    LIS_slots = alloc_LIS_slots (channel_size);
         1160  +    I = (pixel_set *) xmalloc (sizeof (pixel_set));
         1161  +
         1162  +    /* Setup initial encoding threshold */
         1163  +    threshold_bits = number_of_bits (max_coeff (channel, channel_size));
         1164  +    threshold = threshold_bits ? (1 << (threshold_bits - 1)) : 0;
         1165  +
         1166  +    /* Allocate bit-buffer */
         1167  +    bb = (bit_buffer *) xmalloc (sizeof (bit_buffer));
         1168  +
         1169  +    /* Initialize bit-buffer */
         1170  +    init_bits (bb, buf, buf_size);
         1171  +    write_bits (bb, threshold_bits, THRESHOLD_BITS);
         1172  +
         1173  +    /* Setup encoder */
         1174  +    speck_init (LIS_slots, I, channel_size, mode);
         1175  +
         1176  +    /* Travels through all bit planes */
         1177  +    while (threshold > 0)
         1178  +      {
         1179  +	  /* Sorting pass */
         1180  +	  result =
         1181  +	      encode_sorting_pass (channel, channel_size, LIS_slots, LSP, I, bb,
         1182  +				   threshold);
         1183  +	  BREAK_IF_OVERFLOW (result);
         1184  +
         1185  +	  /* Refinement pass */
         1186  +	  result = encode_refinement_pass (channel, LSP, bb, threshold);
         1187  +	  BREAK_IF_OVERFLOW (result);
         1188  +
         1189  +	  /* Proceed to the next bit plane */
         1190  +	  threshold >>= 1;
         1191  +      }
         1192  +
         1193  +    /* Flush bit-buffer */
         1194  +    flush_bits (bb);
         1195  +    n_bytes = bb->next - bb->start;
         1196  +
         1197  +    free (bb);
         1198  +    free (I);
         1199  +    free_LIS_slots (LIS_slots, channel_size);
         1200  +    free_linked_list (LSP);
         1201  +
         1202  +    return n_bytes;
         1203  +}
         1204  +
         1205  +void
         1206  +speck_decode (unsigned char *buf, int buf_size, int **channel, int channel_size)
         1207  +{
         1208  +    int threshold_bits;
         1209  +    int threshold;
         1210  +    int result;
         1211  +    int mode;
         1212  +
         1213  +    linked_list **LIS_slots;
         1214  +    linked_list *LSP;
         1215  +    pixel_set *I;
         1216  +
         1217  +    bit_buffer *bb;
         1218  +
         1219  +    mode = channel_size & 1;
         1220  +
         1221  +    /* Sanity checks */
         1222  +    assert (buf_size >= MIN_SPECK_BUF_SIZE);
         1223  +    assert (channel_size >= 2);
         1224  +
         1225  +    /* Reset output channel */
         1226  +    zero_channel (channel, channel_size);
         1227  +
         1228  +    /* Allocate list of significant pixels (LSP),
         1229  +     * list of lists of insignificant sets (LIS_slots),
         1230  +     * and set of type 'I' */
         1231  +    LSP = alloc_linked_list ();
         1232  +    LIS_slots = alloc_LIS_slots (channel_size);
         1233  +    I = (pixel_set *) xmalloc (sizeof (pixel_set));
         1234  +
         1235  +    /* Allocate bit-buffer */
         1236  +    bb = (bit_buffer *) xmalloc (sizeof (bit_buffer));
         1237  +
         1238  +    /* Initialize bit-buffer */
         1239  +    init_bits (bb, buf, buf_size);
         1240  +    read_bits (bb, &threshold_bits, THRESHOLD_BITS);
         1241  +
         1242  +    /* Read encoding threshold */
         1243  +    threshold = threshold_bits ? (1 << (threshold_bits - 1)) : 0;
         1244  +    speck_init (LIS_slots, I, channel_size, mode);
         1245  +
         1246  +    /* Travels through all bit planes */
         1247  +    while (threshold > 0)
         1248  +      {
         1249  +	  /* Decode sorting pass */
         1250  +	  result =
         1251  +	      decode_sorting_pass (channel, channel_size, LIS_slots, LSP, I, bb,
         1252  +				   threshold);
         1253  +	  BREAK_IF_UNDERFLOW (result);
         1254  +
         1255  +	  /* Decode refinement pass */
         1256  +	  result = decode_refinement_pass (channel, LSP, bb, threshold);
         1257  +	  BREAK_IF_UNDERFLOW (result);
         1258  +
         1259  +	  /* Proceed to the next bit plane */
         1260  +	  threshold >>= 1;
         1261  +      }
         1262  +
         1263  +    free (bb);
         1264  +    free (I);
         1265  +    free_LIS_slots (LIS_slots, channel_size);
         1266  +    free_linked_list (LSP);
         1267  +}

Added epsilon/speck.h.

            1  +/*
            2  + * $Id: speck.h,v 1.48 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief SPECK wavelet codec
           27  + *
           28  + *  This file represents SPECK - The Set-Partitioning Embedded Block
           29  + *  wavelet codec. To understand the algorithm you have to read
           30  + *  original article from William Pearlman and Asad Islam. Also it
           31  + *  is highly recommended to get familar with coding example.
           32  + *
           33  + *  \warning The Set-Partitioning Embedded Block (SPECK) algorithm is
           34  + *  protected by US Patent #6,671,413 and also may be patented in your
           35  + *  country.
           36  + *
           37  + *  \section References
           38  + *
           39  + *  <a href="http://www.cipr.rpi.edu/~pearlman/">William A. Pearlman home page</a>
           40  + *
           41  + *  <a href="http://www.cipr.rpi.edu/~pearlman/papers/vcip99_ip.pdf">
           42  + *  A. Islam and W. A. Pearlman, An Embedded and Efficient Low-Complexity
           43  + *  Hierarchical Image Coder, Visual Communications and Image Processing 99,
           44  + *  Proceedings of SPIE Vol. 3653, pp. 294-305, Jan. 1999.</a>
           45  + *
           46  + *  <a href="http://www.cipr.rpi.edu/~pearlman/papers/speck_example.pdf">
           47  + *  SPECK coding example</a> */
           48  +
           49  +#ifndef __SPECK_H__
           50  +#define __SPECK_H__
           51  +
           52  +#ifdef __cplusplus
           53  +extern "C"
           54  +{
           55  +#endif
           56  +
           57  +/** \addtogroup speck SPECK wavelet codec */
           58  +/*@{*/
           59  +
           60  +#include <common.h>
           61  +#include <list.h>
           62  +#include <bit_io.h>
           63  +
           64  +/** Pixel set of type 'point' */
           65  +#define TYPE_POINT              0
           66  +/** Pixel set of type 'S' */
           67  +#define TYPE_S                  1
           68  +/** Pixel set of type 'I' */
           69  +#define TYPE_I                  2
           70  +/** Empty pixel set */
           71  +#define TYPE_EMPTY              3
           72  +
           73  +/** Processing sets of type 'S' */
           74  +#define STAGE_S                 0
           75  +/** Processing sets of type 'I' */
           76  +#define STAGE_I                 1
           77  +
           78  +/** Minimal SPECK buffer size */
           79  +#define MIN_SPECK_BUF_SIZE      1
           80  +/** Reserve 6 bits for \a theshold_bits parameter */
           81  +#define THRESHOLD_BITS          6
           82  +
           83  +/** Cast data pointer as \ref pixel_set structure */
           84  +#define PIXEL_SET(_set)         ((pixel_set *) (_set->data))
           85  +/** Select inserting index for array of LIS slots */
           86  +#define SLOT_INDEX(_set)        (number_of_bits(MIN(_set->width, _set->height)) - 1)
           87  +
           88  +/** Break if buffer is full */
           89  +#define BREAK_IF_OVERFLOW(_x)   if (_x == BIT_BUFFER_OVERFLOW) break
           90  +/** Return if buffer is full */
           91  +#define RETURN_IF_OVERFLOW(_x)  if (_x == BIT_BUFFER_OVERFLOW) return _x
           92  +/** Break if buffer is empty */
           93  +#define BREAK_IF_UNDERFLOW(_x)  if (_x == BIT_BUFFER_UNDERFLOW) break
           94  +/** Return if buffer is empty */
           95  +#define RETURN_IF_UNDERFLOW(_x) if (_x == BIT_BUFFER_UNDERFLOW) return _x
           96  +/** Contunue if list is empty */
           97  +#define CONTINUE_IF_EMPTY(_x)   if (LIST_IS_EMPTY(_x)) continue
           98  +
           99  +/** This structure represents pixel_set */
          100  +    typedef struct pixel_set_tag
          101  +    {
          102  +    /** Set type */
          103  +	short type;
          104  +    /** X coordinate */
          105  +	short x;
          106  +    /** Y coordinate */
          107  +	short y;
          108  +    /** Set width */
          109  +	short width;
          110  +    /** Set height */
          111  +	short height;
          112  +    } pixel_set;
          113  +
          114  +/** Find maximal coefficient
          115  + *
          116  + *  This function returns absolute value of maximal
          117  + *  wavelet coefficient.
          118  + *
          119  + *  \param channel Channel
          120  + *  \param channel_size Channel size
          121  + *
          122  + *  \return Maximal coefficient value */
          123  +    local int max_coeff (int **channel, int channel_size);
          124  +
          125  +/** Validate set
          126  + *
          127  + *  The process of splitting, moving and testing sets in the SPECK
          128  + *  algorithm is a bit tricky. This function can be thought as a very
          129  + *  strict validation tool.
          130  + *
          131  + *  \param set Set to validate
          132  + *  \param channel_size Channel size
          133  + *
          134  + *  \return \c 1 for valid sets and \c 0 for invalid ones */
          135  +    local int validate_set (pixel_set * set, int channel_size);
          136  +
          137  +/** Significance test
          138  + *
          139  + *  The purpose of this function is to compare \a set against \a threshold.
          140  + *  If the \a set have a coefficient greater than or equal to \a threshold,
          141  + *  then it is said that the \a set is significant. If all coefficients
          142  + *  of the \a set are below \a threshold, then it is said that the \a set
          143  + *  is insignificant.
          144  + *
          145  + *  \param set Set to test
          146  + *  \param threshold Threshold to compare against
          147  + *  \param channel Channel
          148  + *  \param channel_size Channel size
          149  + *
          150  + *  \return \c 1 for significant sets and \c 0 for insignificant ones */
          151  +    local int significance_test (pixel_set * set, int threshold,
          152  +				 int **channel, int channel_size);
          153  +
          154  +/** Select partition type
          155  + *
          156  + *  This function selects type of the \a set.
          157  + *
          158  + *  \param set Set
          159  + *
          160  + *  \return \c VOID */
          161  +    local void select_part_type (pixel_set * set);
          162  +
          163  +/** Split set
          164  + *
          165  + *  This function splits the \a set into pieces. Actual
          166  + *  splitting rule is defined within SPECK algorithm.
          167  + *
          168  + *  \param set Set to split
          169  + *  \param part1 First part
          170  + *  \param part2 Second part
          171  + *  \param part3 Third part
          172  + *  \param part4 Fourth part
          173  + *  \param channel_size Channel size
          174  + *
          175  + *  \return \c VOID */
          176  +    local void split_set (pixel_set * set, pixel_set * part1, pixel_set * part2,
          177  +			  pixel_set * part3, pixel_set * part4,
          178  +			  int channel_size);
          179  +
          180  +/** Allocate array of LIS slots
          181  + *
          182  + *  This function allocates array of LIS slots.
          183  + *
          184  + *  \param channel_size Channel size
          185  + *
          186  + *  \return Pointer to newly allocated structure */
          187  +    local linked_list **alloc_LIS_slots (int channel_size);
          188  +
          189  +/** Release array of LIS slots
          190  + *
          191  + *  This function releases array of LIS slots.
          192  + *
          193  + *  \param LIS_slots Array of LIS slots
          194  + *  \param channel_size Channel size
          195  + *
          196  + *  \return \c VOID */
          197  +    local void free_LIS_slots (linked_list ** LIS_slots, int channel_size);
          198  +
          199  +/** Assign set attributes
          200  + *
          201  + *  This function assigns \a set attributes to the \a node.
          202  + *
          203  + *  \param node Destination node
          204  + *  \param set Source set
          205  + *
          206  + *  \return \c VOID */
          207  +    local void assign_set (list_node * node, pixel_set * set);
          208  +
          209  +/** Reset channel
          210  + *
          211  + *  This function resets all \a channel components to zero.
          212  + *
          213  + *  \param channel Channel
          214  + *  \param channel_size Channel size
          215  + *
          216  + *  \return \c VOID */
          217  +    local void zero_channel (int **channel, int channel_size);
          218  +
          219  +/** Encode set of type 'S'
          220  + *
          221  + *  This function encodes \a set of type 'S'.
          222  + *
          223  + *  \param channel Channel
          224  + *  \param channel_size Channel size
          225  + *  \param set Set to encode
          226  + *  \param LIS_slots Array of LIS slots
          227  + *  \param LSP List of Significant Pixels
          228  + *  \param bb Bit-buffer
          229  + *  \param threshold Threshold
          230  + *
          231  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          232  +    local int speck_encode_S (int **channel, int channel_size,
          233  +			      pixel_set * set, linked_list ** LIS_slots,
          234  +			      linked_list * LSP, bit_buffer * bb,
          235  +			      int threshold);
          236  +
          237  +/** Process set of type 'S'
          238  + *
          239  + *  This function extracts \ref pixel_set structure from the \a node,
          240  + *  and encodes it using \ref speck_encode_S function.
          241  + *
          242  + *  \param channel Channel
          243  + *  \param channel_size Channel size
          244  + *  \param node Current node
          245  + *  \param slot Current LIS slot
          246  + *  \param LIS_slots Array of LIS slots
          247  + *  \param LSP List of Significant Pixels
          248  + *  \param bb Bit-buffer
          249  + *  \param threshold Threshold
          250  + *  \param coding_stage Either \ref STAGE_S or \ref STAGE_I
          251  + *
          252  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          253  +    local int speck_process_S (int **channel, int channel_size,
          254  +			       list_node * node, linked_list * slot,
          255  +			       linked_list ** LIS_slots, linked_list * LSP,
          256  +			       bit_buffer * bb, int threshold,
          257  +			       int coding_stage);
          258  +
          259  +/** Encode set of type 'I'
          260  + *
          261  + *  This function encodes set of type 'I'.
          262  + *
          263  + *  \param channel Channel
          264  + *  \param channel_size Channel size
          265  + *  \param I Set of type I
          266  + *  \param LIS_slots Array of LIS slots
          267  + *  \param LSP List of Significant Pixels
          268  + *  \param bb Bit-buffer
          269  + *  \param threshold Threshold
          270  + *
          271  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          272  +    local int speck_encode_I (int **channel, int channel_size, pixel_set * I,
          273  +			      linked_list ** LIS_slots, linked_list * LSP,
          274  +			      bit_buffer * bb, int threshold);
          275  +
          276  +/** Process set of type 'I'
          277  + *
          278  + *  This function encodes set \a I using \ref speck_encode_I function.
          279  + *
          280  + *  \param channel Channel
          281  + *  \param channel_size Channel size
          282  + *  \param I Set of type I
          283  + *  \param LIS_slots Array of LIS slots
          284  + *  \param LSP List of Significant Pixels
          285  + *  \param bb Bit-buffer
          286  + *  \param threshold Threshold
          287  + *
          288  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          289  +    local int speck_process_I (int **channel, int channel_size, pixel_set * I,
          290  +			       linked_list ** LIS_slots, linked_list * LSP,
          291  +			       bit_buffer * bb, int threshold);
          292  +
          293  +/** Encode sorting pass
          294  + *
          295  + *  The SPECK encoding algorithm alternates two types of passes
          296  + *  through the data: sorting pass and refinement pass. This
          297  + *  function implements the first one.
          298  + *
          299  + *  \param channel Channel
          300  + *  \param channel_size Channel size
          301  + *  \param LIS_slots Array of LIS slots
          302  + *  \param LSP List of Significant Pixels
          303  + *  \param I Set of type I
          304  + *  \param bb Bit-buffer
          305  + *  \param threshold Threshold
          306  + *
          307  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          308  +    local int encode_sorting_pass (int **channel, int channel_size,
          309  +				   linked_list ** LIS_slots, linked_list * LSP,
          310  +				   pixel_set * I, bit_buffer * bb,
          311  +				   int threshold);
          312  +
          313  +/** Encode refinement pass
          314  + *
          315  + *  The SPECK encoding algorithm alternates two types of passes
          316  + *  through the data: sorting pass and refinement pass. This
          317  + *  function implements the second one.
          318  + *
          319  + *  \param channel Channel
          320  + *  \param LSP List of Significant Pixels
          321  + *  \param bb Bit-buffer
          322  + *  \param threshold Threshold
          323  + *
          324  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          325  +    local int encode_refinement_pass (int **channel, linked_list * LSP,
          326  +				      bit_buffer * bb, int threshold);
          327  +
          328  +/** Decode set of type 'S'
          329  + *
          330  + *  This function is inverse to \ref speck_encode_S.
          331  + *
          332  + *  \param channel Channel
          333  + *  \param channel_size Channel size
          334  + *  \param set Set to decode
          335  + *  \param LIS_slots Array of LIS slots
          336  + *  \param LSP List of Significant Pixels
          337  + *  \param bb Bit-buffer
          338  + *  \param threshold Threshold
          339  + *
          340  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          341  +    local int speck_decode_S (int **channel, int channel_size,
          342  +			      pixel_set * set, linked_list ** LIS_slots,
          343  +			      linked_list * LSP, bit_buffer * bb,
          344  +			      int threshold);
          345  +
          346  +/** Unprocess set of type 'S'
          347  + *
          348  + *  This function is inverse to \ref speck_process_S.
          349  + *
          350  + *  \param channel Channel
          351  + *  \param channel_size Channel size
          352  + *  \param node Current node
          353  + *  \param slot Current LIS slot
          354  + *  \param LIS_slots Array of LIS slots
          355  + *  \param LSP List of Significant Pixels
          356  + *  \param bb Bit-buffer
          357  + *  \param threshold Threshold
          358  + *  \param coding_stage Either \ref STAGE_S or \ref STAGE_I
          359  + *
          360  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          361  +    local int speck_unprocess_S (int **channel, int channel_size,
          362  +				 list_node * node, linked_list * slot,
          363  +				 linked_list ** LIS_slots,
          364  +				 linked_list * LSP, bit_buffer * bb,
          365  +				 int threshold, int coding_stage);
          366  +
          367  +/** Decode set of type 'I'
          368  + *
          369  + *  This function is inverse to \ref speck_encode_I.
          370  + *
          371  + *  \param channel Channel
          372  + *  \param channel_size Channel size
          373  + *  \param I Set of type I
          374  + *  \param LIS_slots Array of LIS slots
          375  + *  \param LSP List of Significant Pixels
          376  + *  \param bb Bit-buffer
          377  + *  \param threshold Threshold
          378  + *
          379  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          380  +    local int speck_decode_I (int **channel, int channel_size,
          381  +			      pixel_set * I, linked_list ** LIS_slots,
          382  +			      linked_list * LSP, bit_buffer * bb,
          383  +			      int threshold);
          384  +
          385  +/** Unprocess set of type 'I'
          386  + *
          387  + *  This function is inverse to \ref speck_process_I.
          388  + *
          389  + *  \param channel Channel
          390  + *  \param channel_size Channel size
          391  + *  \param I Set of type I
          392  + *  \param LIS_slots Array of LIS slots
          393  + *  \param LSP List of Significant Pixels
          394  + *  \param bb Bit-buffer
          395  + *  \param threshold Threshold
          396  + *
          397  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          398  +    local int speck_unprocess_I (int **channel, int channel_size,
          399  +				 pixel_set * I, linked_list ** LIS_slots,
          400  +				 linked_list * LSP, bit_buffer * bb,
          401  +				 int threshold);
          402  +
          403  +/** Decode sorting pass
          404  + *
          405  + *  The SPECK decoding algorithm alternates two types of passes
          406  + *  through the data: sorting pass and refinement pass. This
          407  + *  function implements the first one.
          408  + *
          409  + *  \param channel Channel
          410  + *  \param channel_size Channel size
          411  + *  \param LIS_slots Array of LIS slots
          412  + *  \param LSP List of Significant Pixels
          413  + *  \param I Set of type I
          414  + *  \param bb Bit-buffer
          415  + *  \param threshold Threshold
          416  + *
          417  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          418  +    local int decode_sorting_pass (int **channel, int channel_size,
          419  +				   linked_list ** LIS_slots,
          420  +				   linked_list * LSP, pixel_set * I,
          421  +				   bit_buffer * bb, int threshold);
          422  +
          423  +/** Decode refinement pass
          424  + *
          425  + *  The SPECK decoding algorithm alternates two types of passes
          426  + *  through the data: sorting pass and refinement pass. This
          427  + *  function implements the second one.
          428  + *
          429  + *  \param channel Channel
          430  + *  \param LSP List of Significant Pixels
          431  + *  \param bb Bit-buffer
          432  + *  \param threshold Threshold
          433  + *
          434  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          435  +    local int decode_refinement_pass (int **channel, linked_list * LSP,
          436  +				      bit_buffer * bb, int threshold);
          437  +
          438  +/** Initialize SPECK encoder or decoder
          439  + *
          440  + *  This function initializes SPECK encoder or decoder.
          441  + *
          442  + *  \param LIS_slots Array of LIS slots
          443  + *  \param I Set of type I
          444  + *  \param channel_size Channel size
          445  + *  \param mode Either \ref MODE_NORMAL or \ref MODE_OTLPF
          446  + *
          447  + *  \return \c VOID */
          448  +    local void speck_init (linked_list ** LIS_slots, pixel_set * I,
          449  +			   int channel_size, int mode);
          450  +
          451  +/** Encode channel using SPECK algorithm
          452  + *
          453  + *  This function encodes \a channel of size \a channel_size
          454  + *  into the buffer \a buf of size \a buf_size.
          455  + *
          456  + *  \note Depending on encoding mode, minimal channel
          457  + *  size is \c 2 (for \ref MODE_NORMAL) or \c 3
          458  + *  (for \ref MODE_OTLPF).
          459  + *
          460  + *  \note Minimal buffer size is \ref MIN_SPECK_BUF_SIZE
          461  + *
          462  + *  \param channel Channel
          463  + *  \param channel_size Channel size
          464  + *  \param buf Buffer
          465  + *  \param buf_size Buffer size
          466  + *
          467  + *  \return Number of bytes in \a buf actualy used by encoder */
          468  +    int speck_encode (int **channel, int channel_size,
          469  +		      unsigned char *buf, int buf_size);
          470  +
          471  +/** Decode channel using SPECK algorithm
          472  + *
          473  + *  This function decodes \a channel of size \a channel_size
          474  + *  from the buffer \a buf of size \a buf_size.
          475  + *
          476  + *  \note Depending on encoding mode, minimal channel
          477  + *  size is \c 2 (for \ref MODE_NORMAL) or \c 3
          478  + *  (for \ref MODE_OTLPF).
          479  + *
          480  + *  \note Minimal buffer size is \ref MIN_SPECK_BUF_SIZE
          481  + *
          482  + *  \param buf Buffer
          483  + *  \param buf_size Buffer size
          484  + *  \param channel Channel
          485  + *  \param channel_size Channel size
          486  + *
          487  + *  \return \c VOID */
          488  +    void speck_decode (unsigned char *buf, int buf_size,
          489  +		       int **channel, int channel_size);
          490  +
          491  +/*@}*/
          492  +
          493  +#ifdef __cplusplus
          494  +}
          495  +#endif
          496  +
          497  +#endif				/* __SPECK_H__ */

Changes to headers/Makefile.am.

     1      1   
     2         -noinst_HEADERS = rasterlite_tiff_hdrs.h rasterlite_internals.h 
            2  +noinst_HEADERS = rasterlite_internals.h 
     3      3   include_HEADERS = rasterlite.h 
     4      4   

Changes to headers/Makefile.in.

     1         -# Makefile.in generated by automake 1.11.6 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
     6         -# Foundation, Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19         -am__make_dryrun = \
    20         -  { \
    21         -    am__dry=no; \
    22         -    case $$MAKEFLAGS in \
    23         -      *\\[\ \	]*) \
    24         -        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
    25         -          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
    26         -      *) \
    27         -        for am__flg in $$MAKEFLAGS; do \
    28         -          case $$am__flg in \
    29         -            *=*|--*) ;; \
    30         -            *n*) am__dry=yes; break;; \
    31         -          esac; \
    32         -        done;; \
    33         -    esac; \
    34         -    test $$am__dry = yes; \
    35         -  }
    36     18   pkgdatadir = $(datadir)/@PACKAGE@
    37         -pkgincludedir = $(includedir)/@PACKAGE@
    38     19   pkglibdir = $(libdir)/@PACKAGE@
    39         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    40     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    41     22   install_sh_DATA = $(install_sh) -c -m 644
    42     23   install_sh_PROGRAM = $(install_sh) -c
    43     24   install_sh_SCRIPT = $(install_sh) -c
    44     25   INSTALL_HEADER = $(INSTALL_DATA)
    45     26   transform = $(program_transform_name)
    46     27   NORMAL_INSTALL = :
................................................................................
    51     32   POST_UNINSTALL = :
    52     33   build_triplet = @build@
    53     34   host_triplet = @host@
    54     35   subdir = headers
    55     36   DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
    56     37   	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
    57     38   ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    58         -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
    59         -	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
    60         -	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
    61         -	$(top_srcdir)/configure.ac
           39  +am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    62     40   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    63     41   	$(ACLOCAL_M4)
    64     42   mkinstalldirs = $(install_sh) -d
    65         -CONFIG_HEADER = $(top_builddir)/config.h
    66     43   CONFIG_CLEAN_FILES =
    67         -CONFIG_CLEAN_VPATH_FILES =
    68     44   SOURCES =
    69     45   DIST_SOURCES =
    70         -am__can_run_installinfo = \
    71         -  case $$AM_UPDATE_INFO_DIR in \
    72         -    n|no|NO) false;; \
    73         -    *) (install-info --version) >/dev/null 2>&1;; \
    74         -  esac
    75     46   am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    76     47   am__vpath_adj = case $$p in \
    77     48       $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    78     49       *) f=$$p;; \
    79     50     esac;
    80         -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
    81         -am__install_max = 40
    82         -am__nobase_strip_setup = \
    83         -  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
    84         -am__nobase_strip = \
    85         -  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
    86         -am__nobase_list = $(am__nobase_strip_setup); \
    87         -  for p in $$list; do echo "$$p $$p"; done | \
    88         -  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
    89         -  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
    90         -    if (++n[$$2] == $(am__install_max)) \
    91         -      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
    92         -    END { for (dir in files) print dir, files[dir] }'
    93         -am__base_list = \
    94         -  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
    95         -  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
    96         -am__uninstall_files_from_dir = { \
    97         -  test -z "$$files" \
    98         -    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
    99         -    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
   100         -         $(am__cd) "$$dir" && rm -f $$files; }; \
   101         -  }
           51  +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
   102     52   am__installdirs = "$(DESTDIR)$(includedir)"
           53  +includeHEADERS_INSTALL = $(INSTALL_HEADER)
   103     54   HEADERS = $(include_HEADERS) $(noinst_HEADERS)
   104     55   ETAGS = etags
   105     56   CTAGS = ctags
   106     57   DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   107     58   ACLOCAL = @ACLOCAL@
   108     59   AMTAR = @AMTAR@
   109     60   AR = @AR@
................................................................................
   122     73   CXXDEPMODE = @CXXDEPMODE@
   123     74   CXXFLAGS = @CXXFLAGS@
   124     75   CYGPATH_W = @CYGPATH_W@
   125     76   DEFS = @DEFS@
   126     77   DEPDIR = @DEPDIR@
   127     78   DLLTOOL = @DLLTOOL@
   128     79   DSYMUTIL = @DSYMUTIL@
   129         -DUMPBIN = @DUMPBIN@
           80  +ECHO = @ECHO@
   130     81   ECHO_C = @ECHO_C@
   131     82   ECHO_N = @ECHO_N@
   132     83   ECHO_T = @ECHO_T@
   133     84   EGREP = @EGREP@
   134     85   EXEEXT = @EXEEXT@
   135         -FGREP = @FGREP@
           86  +F77 = @F77@
           87  +FFLAGS = @FFLAGS@
   136     88   GREP = @GREP@
   137     89   INSTALL = @INSTALL@
   138     90   INSTALL_DATA = @INSTALL_DATA@
   139     91   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   140     92   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   141     93   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   142         -LD = @LD@
   143     94   LDFLAGS = @LDFLAGS@
   144     95   LIBOBJS = @LIBOBJS@
   145         -LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
   146         -LIBPNG_LIBS = @LIBPNG_LIBS@
   147     96   LIBS = @LIBS@
   148         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   149         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   150     97   LIBTOOL = @LIBTOOL@
   151         -LIPO = @LIPO@
   152     98   LN_S = @LN_S@
   153     99   LTLIBOBJS = @LTLIBOBJS@
   154    100   MAINT = @MAINT@
   155    101   MAKEINFO = @MAKEINFO@
   156         -MANIFEST_TOOL = @MANIFEST_TOOL@
   157    102   MKDIR_P = @MKDIR_P@
   158         -NM = @NM@
   159    103   NMEDIT = @NMEDIT@
   160    104   OBJDUMP = @OBJDUMP@
   161    105   OBJEXT = @OBJEXT@
   162         -OTOOL = @OTOOL@
   163         -OTOOL64 = @OTOOL64@
   164    106   PACKAGE = @PACKAGE@
   165    107   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   166    108   PACKAGE_NAME = @PACKAGE_NAME@
   167    109   PACKAGE_STRING = @PACKAGE_STRING@
   168    110   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   169         -PACKAGE_URL = @PACKAGE_URL@
   170    111   PACKAGE_VERSION = @PACKAGE_VERSION@
   171    112   PATH_SEPARATOR = @PATH_SEPARATOR@
   172         -PKG_CONFIG = @PKG_CONFIG@
   173         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   174         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   175    113   RANLIB = @RANLIB@
   176    114   SED = @SED@
   177    115   SET_MAKE = @SET_MAKE@
   178    116   SHELL = @SHELL@
   179    117   STRIP = @STRIP@
   180    118   VERSION = @VERSION@
   181    119   abs_builddir = @abs_builddir@
   182    120   abs_srcdir = @abs_srcdir@
   183    121   abs_top_builddir = @abs_top_builddir@
   184    122   abs_top_srcdir = @abs_top_srcdir@
   185         -ac_ct_AR = @ac_ct_AR@
   186    123   ac_ct_CC = @ac_ct_CC@
   187    124   ac_ct_CXX = @ac_ct_CXX@
   188         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          125  +ac_ct_F77 = @ac_ct_F77@
   189    126   am__include = @am__include@
   190    127   am__leading_dot = @am__leading_dot@
   191    128   am__quote = @am__quote@
   192    129   am__tar = @am__tar@
   193    130   am__untar = @am__untar@
   194    131   bindir = @bindir@
   195    132   build = @build@
................................................................................
   224    161   program_transform_name = @program_transform_name@
   225    162   psdir = @psdir@
   226    163   sbindir = @sbindir@
   227    164   sharedstatedir = @sharedstatedir@
   228    165   srcdir = @srcdir@
   229    166   sysconfdir = @sysconfdir@
   230    167   target_alias = @target_alias@
   231         -top_build_prefix = @top_build_prefix@
   232    168   top_builddir = @top_builddir@
   233    169   top_srcdir = @top_srcdir@
   234         -noinst_HEADERS = rasterlite_tiff_hdrs.h rasterlite_internals.h 
          170  +noinst_HEADERS = rasterlite_internals.h 
   235    171   include_HEADERS = rasterlite.h 
   236    172   all: all-am
   237    173   
   238    174   .SUFFIXES:
   239    175   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   240    176   	@for dep in $?; do \
   241    177   	  case '$(am__configure_deps)' in \
   242    178   	    *$$dep*) \
   243         -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   244         -	        && { if test -f $@; then exit 0; else break; fi; }; \
          179  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          180  +		&& exit 0; \
   245    181   	      exit 1;; \
   246    182   	  esac; \
   247    183   	done; \
   248         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu headers/Makefile'; \
   249         -	$(am__cd) $(top_srcdir) && \
   250         -	  $(AUTOMAKE) --gnu headers/Makefile
          184  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  headers/Makefile'; \
          185  +	cd $(top_srcdir) && \
          186  +	  $(AUTOMAKE) --foreign  headers/Makefile
   251    187   .PRECIOUS: Makefile
   252    188   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   253    189   	@case '$?' in \
   254    190   	  *config.status*) \
   255    191   	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   256    192   	  *) \
   257    193   	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
................................................................................
   261    197   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   262    198   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   263    199   
   264    200   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   265    201   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   266    202   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   267    203   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   268         -$(am__aclocal_m4_deps):
   269    204   
   270    205   mostlyclean-libtool:
   271    206   	-rm -f *.lo
   272    207   
   273    208   clean-libtool:
   274    209   	-rm -rf .libs _libs
   275    210   install-includeHEADERS: $(include_HEADERS)
   276    211   	@$(NORMAL_INSTALL)
   277         -	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
   278         -	if test -n "$$list"; then \
   279         -	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
   280         -	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
   281         -	fi; \
   282         -	for p in $$list; do \
          212  +	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
          213  +	@list='$(include_HEADERS)'; for p in $$list; do \
   283    214   	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
   284         -	  echo "$$d$$p"; \
   285         -	done | $(am__base_list) | \
   286         -	while read files; do \
   287         -	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
   288         -	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
          215  +	  f=$(am__strip_dir) \
          216  +	  echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
          217  +	  $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
   289    218   	done
   290    219   
   291    220   uninstall-includeHEADERS:
   292    221   	@$(NORMAL_UNINSTALL)
   293         -	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
   294         -	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
   295         -	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
          222  +	@list='$(include_HEADERS)'; for p in $$list; do \
          223  +	  f=$(am__strip_dir) \
          224  +	  echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
          225  +	  rm -f "$(DESTDIR)$(includedir)/$$f"; \
          226  +	done
   296    227   
   297    228   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   298    229   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   299    230   	unique=`for i in $$list; do \
   300    231   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   301    232   	  done | \
   302         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          233  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   303    234   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   304    235   	mkid -fID $$unique
   305    236   tags: TAGS
   306    237   
   307    238   TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   308    239   		$(TAGS_FILES) $(LISP)
   309         -	set x; \
          240  +	tags=; \
   310    241   	here=`pwd`; \
   311    242   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   312    243   	unique=`for i in $$list; do \
   313    244   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   314    245   	  done | \
   315    246   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   316    247   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   317         -	shift; \
   318         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          248  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   319    249   	  test -n "$$unique" || unique=$$empty_fix; \
   320         -	  if test $$# -gt 0; then \
   321         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   322         -	      "$$@" $$unique; \
   323         -	  else \
   324         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   325         -	      $$unique; \
   326         -	  fi; \
          250  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          251  +	    $$tags $$unique; \
   327    252   	fi
   328    253   ctags: CTAGS
   329    254   CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   330    255   		$(TAGS_FILES) $(LISP)
          256  +	tags=; \
   331    257   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   332    258   	unique=`for i in $$list; do \
   333    259   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   334    260   	  done | \
   335    261   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   336    262   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   337         -	test -z "$(CTAGS_ARGS)$$unique" \
          263  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   338    264   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   339         -	     $$unique
          265  +	     $$tags $$unique
   340    266   
   341    267   GTAGS:
   342    268   	here=`$(am__cd) $(top_builddir) && pwd` \
   343         -	  && $(am__cd) $(top_srcdir) \
   344         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          269  +	  && cd $(top_srcdir) \
          270  +	  && gtags -i $(GTAGS_ARGS) $$here
   345    271   
   346    272   distclean-tags:
   347    273   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   348    274   
   349    275   distdir: $(DISTFILES)
   350    276   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   351    277   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
................................................................................
   358    284   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   359    285   			   sort -u` ;; \
   360    286   	esac; \
   361    287   	for file in $$dist_files; do \
   362    288   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   363    289   	  if test -d $$d/$$file; then \
   364    290   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   365         -	    if test -d "$(distdir)/$$file"; then \
   366         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          291  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          292  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   367    293   	    fi; \
   368         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   369         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   370         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   371         -	    fi; \
   372         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          294  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   373    295   	  else \
   374         -	    test -f "$(distdir)/$$file" \
   375         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          296  +	    test -f $(distdir)/$$file \
          297  +	    || cp -p $$d/$$file $(distdir)/$$file \
   376    298   	    || exit 1; \
   377    299   	  fi; \
   378    300   	done
   379    301   check-am: all-am
   380    302   check: check-am
   381    303   all-am: Makefile $(HEADERS)
   382    304   installdirs:
................................................................................
   389    311   uninstall: uninstall-am
   390    312   
   391    313   install-am: all-am
   392    314   	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   393    315   
   394    316   installcheck: installcheck-am
   395    317   install-strip:
   396         -	if test -z '$(STRIP)'; then \
   397         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   398         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   399         -	      install; \
   400         -	else \
   401         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   402         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   403         -	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
   404         -	fi
          318  +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
          319  +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          320  +	  `test -z '$(STRIP)' || \
          321  +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   405    322   mostlyclean-generic:
   406    323   
   407    324   clean-generic:
   408    325   
   409    326   distclean-generic:
   410    327   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   411         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   412    328   
   413    329   maintainer-clean-generic:
   414    330   	@echo "This command is intended for maintainers to use"
   415    331   	@echo "it deletes files that may require special tools to rebuild."
   416    332   clean: clean-am
   417    333   
   418    334   clean-am: clean-generic clean-libtool mostlyclean-am
................................................................................
   423    339   
   424    340   dvi: dvi-am
   425    341   
   426    342   dvi-am:
   427    343   
   428    344   html: html-am
   429    345   
   430         -html-am:
   431         -
   432    346   info: info-am
   433    347   
   434    348   info-am:
   435    349   
   436    350   install-data-am: install-includeHEADERS
   437    351   
   438    352   install-dvi: install-dvi-am
   439    353   
   440         -install-dvi-am:
   441         -
   442    354   install-exec-am:
   443    355   
   444    356   install-html: install-html-am
   445    357   
   446         -install-html-am:
   447         -
   448    358   install-info: install-info-am
   449    359   
   450         -install-info-am:
   451         -
   452    360   install-man:
   453    361   
   454    362   install-pdf: install-pdf-am
   455    363   
   456         -install-pdf-am:
   457         -
   458    364   install-ps: install-ps-am
   459    365   
   460         -install-ps-am:
   461         -
   462    366   installcheck-am:
   463    367   
   464    368   maintainer-clean: maintainer-clean-am
   465    369   	-rm -f Makefile
   466    370   maintainer-clean-am: distclean-am maintainer-clean-generic
   467    371   
   468    372   mostlyclean: mostlyclean-am
................................................................................
   489    393   	install-exec-am install-html install-html-am \
   490    394   	install-includeHEADERS install-info install-info-am \
   491    395   	install-man install-pdf install-pdf-am install-ps \
   492    396   	install-ps-am install-strip installcheck installcheck-am \
   493    397   	installdirs maintainer-clean maintainer-clean-generic \
   494    398   	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
   495    399   	ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS
   496         -
   497    400   
   498    401   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   499    402   # Otherwise a system limit (for SysV at least) may be exceeded.
   500    403   .NOEXPORT:

Changes to headers/rasterlite.h.

     1      1   /* 
     2      2   / rasterlite.h
     3      3   /
     4      4   / public RasterLite declarations
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45     27   #ifdef DLL_EXPORT
    46     28   #define RASTERLITE_DECLARE __declspec(dllexport)
    47     29   #else
    48     30   #define RASTERLITE_DECLARE extern
    49     31   #endif
................................................................................
   147    129       RASTERLITE_DECLARE int rasterliteIsError (void *handle);
   148    130       RASTERLITE_DECLARE const char *rasterliteGetPath (void *handle);
   149    131       RASTERLITE_DECLARE const char *rasterliteGetTablePrefix (void *handle);
   150    132       RASTERLITE_DECLARE const char *rasterliteGetLastError (void *handle);
   151    133       RASTERLITE_DECLARE const char *rasterliteGetSqliteVersion (void *handle);
   152    134       RASTERLITE_DECLARE const char *rasterliteGetSpatialiteVersion (void
   153    135   								   *handle);
   154         -    RASTERLITE_DECLARE const char *rasterliteGetVersion (void);
   155         -
   156    136       RASTERLITE_DECLARE int rasterliteGetLevels (void *handle);
   157    137       RASTERLITE_DECLARE int rasterliteGetResolution (void *handle, int level,
   158    138   						    double *pixel_x_size,
   159    139   						    double *pixel_y_size,
   160    140   						    int *tile_count);
   161    141       RASTERLITE_DECLARE int rasterliteGetSrid (void *handle, int *srid,
   162    142   					      const char **auth_name,
   163    143   					      int *auth_srid,
   164    144   					      const char **ref_sys_name,
   165    145   					      const char **proj4text);
   166    146       RASTERLITE_DECLARE int rasterliteGetExtent (void *handle, double *min_x,
   167    147   						double *min_y, double *max_x,
   168    148   						double *max_y);
          149  +    RASTERLITE_DECLARE int rasterliteWaveletToPng (const void *blob,
          150  +						   int blob_size,
          151  +						   void **png_blob,
          152  +						   int *png_size);
   169    153       RASTERLITE_DECLARE int rasterliteExportGeoTiff (void *handle,
   170    154   						    const char *img_path,
   171    155   						    void *raster, int size,
   172    156   						    double cx, double cy,
   173    157   						    double pixel_x_size,
   174    158   						    double pixel_y_size,
   175    159   						    int width, int height);
................................................................................
   176    160       RASTERLITE_DECLARE int rasterliteGetBestAccess (void *handle,
   177    161   						    double pixel_size,
   178    162   						    double *pixel_x_size,
   179    163   						    double *pixel_y_size,
   180    164   						    sqlite3_stmt ** stmt,
   181    165   						    int *use_rtree);
   182    166   
   183         -/*
   184         -/ utility functions returning a Raw image
   185         -*/
   186         -    RASTERLITE_DECLARE int rasterliteJpegBlobToRawImage (const void *blob,
   187         -							 int blob_size,
   188         -							 int raw_format,
   189         -							 void **raw, int *width,
   190         -							 int *height);
   191         -    RASTERLITE_DECLARE int rasterlitePngBlobToRawImage (const void *blob,
   192         -							int blob_size,
   193         -							int raw_format,
   194         -							void **raw, int *width,
   195         -							int *height);
   196         -    RASTERLITE_DECLARE int rasterliteGifBlobToRawImage (const void *blob,
   197         -							int blob_size,
   198         -							int raw_format,
   199         -							void **raw, int *width,
   200         -							int *height);
   201         -    RASTERLITE_DECLARE int rasterliteTiffBlobToRawImage (const void *blob,
   202         -							 int blob_size,
   203         -							 int raw_format,
   204         -							 void **raw, int *width,
   205         -							 int *height);
   206         -
   207         -/*
   208         -/ utility functions generating an image file from a Raw Image
   209         -*/
   210         -    RASTERLITE_DECLARE int rasterliteRawImageToJpegFile (const void *raw,
   211         -							 int raw_format,
   212         -							 int width, int height,
   213         -							 const char *path,
   214         -							 int quality);
   215         -    RASTERLITE_DECLARE int rasterliteRawImageToPngFile (const void *raw,
   216         -							int raw_format,
   217         -							int width, int height,
   218         -							const char *path);
   219         -    RASTERLITE_DECLARE int rasterliteRawImageToGifFile (const void *raw,
   220         -							int raw_format,
   221         -							int width, int height,
   222         -							const char *path);
   223         -    RASTERLITE_DECLARE int rasterliteRawImageToGeoTiffFile (const void *raw,
   224         -							    int raw_format,
   225         -							    int width,
   226         -							    int height,
   227         -							    const char *path,
   228         -							    double x_size,
   229         -							    double y_size,
   230         -							    double xllcorner,
   231         -							    double yllcorner,
   232         -							    const char
   233         -							    *proj4text);
   234         -
   235         -/*
   236         -/ utility functions generating an image mem-buffer from a Raw Image
   237         -*/
   238         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToJpegMemBuf (const void
   239         -								      *raw,
   240         -								      int
   241         -								      raw_format,
   242         -								      int width,
   243         -								      int
   244         -								      height,
   245         -								      int *size,
   246         -								      int
   247         -								      quality);
   248         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToPngMemBuf (const void
   249         -								     *raw,
   250         -								     int
   251         -								     raw_format,
   252         -								     int width,
   253         -								     int height,
   254         -								     int *size);
   255         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToGifMemBuf (const void
   256         -								     *raw,
   257         -								     int
   258         -								     raw_format,
   259         -								     int width,
   260         -								     int height,
   261         -								     int *size);
   262         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToTiffMemBuf (const void
   263         -								      *raw,
   264         -								      int
   265         -								      raw_format,
   266         -								      int width,
   267         -								      int
   268         -								      height,
   269         -								      int
   270         -								      *size);
   271         -
   272    167   #ifdef __cplusplus
   273    168   }
   274    169   #endif
   275    170   
   276    171   #endif				/* _RASTERLITE_H */

Changes to headers/rasterlite_internals.h.

     1      1   /* 
     2      2   / rasterlite_internals.h
     3      3   /
     4      4   / internal declarations
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45     27   #define COLORSPACE_MONOCHROME	1
    46     28   #define COLORSPACE_PALETTE	2
    47     29   #define COLORSPACE_GRAYSCALE	3
    48     30   #define COLORSPACE_RGB		4
    49     31   
................................................................................
    61     43   #define IMAGE_GIF_PALETTE	111
    62     44   
    63     45   #define NTILES	8192
    64     46   
    65     47   #define STRATEGY_RTREE	1
    66     48   #define STRATEGY_PLAIN	2
    67     49   
    68         -#define RASTERLITE_TRUE	-1
    69         -#define RASTERLITE_FALSE	-2
    70         -
    71     50   #define true_color(r, g, b) (((r) << 16) + ((g) << 8) + (b))
    72     51   #define image_set_pixel(img, x, y, color) 	img->pixels[y][x] = color
    73     52   #define true_color_get_red(c) (((c) & 0xFF0000) >> 16)
    74     53   #define true_color_get_green(c) (((c) & 0x00FF00) >> 8)
    75     54   #define true_color_get_blue(c) ((c) & 0x0000FF)
    76     55   
    77     56   struct tile_info
................................................................................
   108     87       double pixel_y;		/* the Y pixel size [in map units] */
   109     88       int tile_height;		/* the TILE preferred height [in pixels]  */
   110     89       int tile_width;		/* the TILE preferred width [in pixels]  */
   111     90       sqlite3 *handle;		/* SQLite handle */
   112     91       sqlite3_stmt *stmt;		/* SQL preparared statement: INSERT INTO xx_rasters */
   113     92       const char *table;		/* the DB table name */
   114     93       int image_type;		/* the preferred image type [to be used for tiles] */
   115         -    int quality_factor;		/* the quality factor for JPEG compression */
           94  +    int quality_factor;		/* the quality factor for JPEG or Wavelet compression */
   116     95       struct tile_info tiles[NTILES];
   117     96   };
   118     97   
   119     98   struct source_item
   120     99   {
   121    100   /* a raster source item */
   122    101       char *name;
................................................................................
   199    178   /* a generic RGB image  */
   200    179       int **pixels;
   201    180       int sx;
   202    181       int sy;
   203    182       int color_space;
   204    183   } rasterliteImage;
   205    184   
   206         -typedef rasterliteImage *rasterliteImagePtr;
          185  +typedef rasterliteImage *rasterliteImagePrt;
   207    186   
   208         -extern rasterliteImagePtr image_create (int sx, int sy);
   209         -extern void image_destroy (rasterliteImagePtr img);
   210         -extern void image_fill (const rasterliteImagePtr img, int color);
   211         -extern void make_thumbnail (const rasterliteImagePtr thumbnail,
   212         -			    const rasterliteImagePtr image);
   213         -extern void image_resize (const rasterliteImagePtr dst,
   214         -			  const rasterliteImagePtr src);
          187  +extern rasterliteImagePrt image_create (int sx, int sy);
          188  +extern void image_destroy (rasterliteImagePrt img);
          189  +extern void image_fill (const rasterliteImagePrt img, int color);
          190  +extern void make_thumbnail (const rasterliteImagePrt thumbnail,
          191  +			    const rasterliteImagePrt image);
          192  +extern void image_resize (const rasterliteImagePrt dst,
          193  +			  const rasterliteImagePrt src);
   215    194   
   216         -extern void *image_to_jpeg (const rasterliteImagePtr img, int *size,
          195  +extern void *image_to_jpeg (const rasterliteImagePrt img, int *size,
   217    196   			    int quality);
   218         -extern void *image_to_jpeg_grayscale (const rasterliteImagePtr img, int *size,
          197  +extern void *image_to_jpeg_grayscale (const rasterliteImagePrt img, int *size,
   219    198   				      int quality);
   220         -extern void *image_to_png_palette (const rasterliteImagePtr img, int *size);
   221         -extern void *image_to_png_grayscale (const rasterliteImagePtr img, int *size);
   222         -extern void *image_to_png_rgb (const rasterliteImagePtr img, int *size);
   223         -extern void *image_to_gif (const rasterliteImagePtr img, int *size);
   224         -extern void *image_to_tiff_fax4 (const rasterliteImagePtr img, int *size);
   225         -extern void *image_to_tiff_palette (const rasterliteImagePtr img, int *size);
   226         -extern void *image_to_tiff_grayscale (const rasterliteImagePtr img, int *size);
   227         -extern void *image_to_tiff_rgb (const rasterliteImagePtr img, int *size);
   228         -
   229         -extern void *image_to_rgb_array (const rasterliteImagePtr img, int *size);
          199  +extern void *image_to_wavelet (const rasterliteImagePrt img, int *size,
          200  +			       int ratio);
          201  +extern void *image_to_wavelet_grayscale (const rasterliteImagePrt img,
          202  +					 int *size, int ratio);
          203  +extern void *image_to_png_palette (const rasterliteImagePrt img, int *size);
          204  +extern void *image_to_png_grayscale (const rasterliteImagePrt img, int *size);
          205  +extern void *image_to_png_rgb (const rasterliteImagePrt img, int *size);
          206  +extern void *image_to_gif (const rasterliteImagePrt img, int *size);
          207  +extern void *image_to_tiff_fax4 (const rasterliteImagePrt img, int *size);
          208  +extern void *image_to_tiff_palette (const rasterliteImagePrt img, int *size);
          209  +extern void *image_to_tiff_grayscale (const rasterliteImagePrt img, int *size);
          210  +extern void *image_to_tiff_rgb (const rasterliteImagePrt img, int *size);
          211  +extern void *image_to_rgb_array (const rasterliteImagePrt img, int *size);
   230    212   extern void *image_to_rgba_array (int transparent_color,
   231         -				  const rasterliteImagePtr img, int *size);
          213  +				  const rasterliteImagePrt img, int *size);
   232    214   extern void *image_to_argb_array (int transparent_color,
   233         -				  const rasterliteImagePtr img, int *size);
   234         -extern void *image_to_bgr_array (const rasterliteImagePtr img, int *size);
          215  +				  const rasterliteImagePrt img, int *size);
          216  +extern void *image_to_bgr_array (const rasterliteImagePrt img, int *size);
   235    217   extern void *image_to_bgra_array (int transparent_color,
   236         -				  const rasterliteImagePtr img, int *size);
          218  +				  const rasterliteImagePrt img, int *size);
   237    219   
   238         -extern rasterliteImagePtr image_from_rgb_array (const void *raw, int width,
   239         -						int height);
   240         -extern rasterliteImagePtr image_from_rgba_array (const void *raw, int width,
   241         -						 int height);
   242         -extern rasterliteImagePtr image_from_argb_array (const void *raw, int width,
   243         -						 int height);
   244         -extern rasterliteImagePtr image_from_bgr_array (const void *raw, int width,
   245         -						int height);
   246         -extern rasterliteImagePtr image_from_bgra_array (const void *raw, int width,
   247         -						 int height);
   248         -
   249         -extern rasterliteImagePtr image_from_jpeg (int size, const void *data);
   250         -extern rasterliteImagePtr image_from_png (int size, const void *data);
   251         -extern rasterliteImagePtr image_from_gif (int size, const void *data);
   252         -extern rasterliteImagePtr image_from_tiff (int size, const void *data);
   253         -
   254         -extern int is_image_monochrome (const rasterliteImagePtr img);
   255         -extern int is_image_grayscale (const rasterliteImagePtr img);
   256         -extern int is_image_palette256 (const rasterliteImagePtr img);
   257         -extern void image_resample_as_palette256 (const rasterliteImagePtr img);
          220  +extern rasterliteImagePrt image_from_jpeg (int size, const void *data);
          221  +extern rasterliteImagePrt image_from_png (int size, const void *data);
          222  +extern rasterliteImagePrt image_from_gif (int size, const void *data);
          223  +extern rasterliteImagePrt image_from_tiff (int size, const void *data);
          224  +extern rasterliteImagePrt image_from_wavelet (int size, const void *data);
   258    225   
   259    226   extern int write_geotiff (const char *path, const void *raster, int size,
   260    227   			  double xsize, double ysize, double xllcorner,
   261    228   			  double yllcorner, const char *proj4text);
   262    229   
   263    230   /* 
   264    231   /

Deleted headers/rasterlite_tiff_hdrs.h.

     1         -/*
     2         -/ rasterlite_tiff_hrds.h
     3         -/
     4         -/ internal declarations supporting geotiff
     5         -/
     6         -/ version 1.1a, 2011 November 12
     7         -/
     8         -/ Author: Brad Hards bradh@frogmouth.net
     9         -/
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
    23         -/
    24         -/ The Original Code is the RasterLite library
    25         -/
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2011
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43         -*/
    44         -
    45         -#ifndef _RASTERLITE_TIFF_HDRS_H
    46         -#define _RASTERLITE_TIFF_HDRS_H
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef HAVE_GEOTIFF_GEOTIFF_H
    51         -#include <geotiff/geotiff.h>
    52         -#include <geotiff/xtiffio.h>
    53         -#include <geotiff/geo_tiffp.h>
    54         -#include <geotiff/geo_keyp.h>
    55         -#include <geotiff/geovalues.h>
    56         -#include <geotiff/geo_normalize.h>
    57         -#elif HAVE_LIBGEOTIFF_GEOTIFF_H
    58         -#include <libgeotiff/geotiff.h>
    59         -#include <libgeotiff/xtiffio.h>
    60         -#include <libgeotiff/geo_tiffp.h>
    61         -#include <libgeotiff/geo_keyp.h>
    62         -#include <libgeotiff/geovalues.h>
    63         -#include <libgeotiff/geo_normalize.h>
    64         -#else
    65         -#include <geotiff.h>
    66         -#include <xtiffio.h>
    67         -#include <geo_tiffp.h>
    68         -#include <geo_keyp.h>
    69         -#include <geovalues.h>
    70         -#include <geo_normalize.h>
    71         -#endif
    72         -
    73         -#endif

Changes to install-sh.

     1      1   #!/bin/sh
     2      2   # install - install a program, script, or datafile
     3      3   
     4         -scriptversion=2009-04-28.21; # UTC
            4  +scriptversion=2006-12-25.00
     5      5   
     6      6   # This originates from X11R5 (mit/util/scripts/install.sh), which was
     7      7   # later released in X11R6 (xc/config/util/install.sh) with the
     8      8   # following copyright and license.
     9      9   #
    10     10   # Copyright (C) 1994 X Consortium
    11     11   #
................................................................................
   511    511     fi
   512    512   done
   513    513   
   514    514   # Local variables:
   515    515   # eval: (add-hook 'write-file-hooks 'time-stamp)
   516    516   # time-stamp-start: "scriptversion="
   517    517   # time-stamp-format: "%:y-%02m-%02d.%02H"
   518         -# time-stamp-time-zone: "UTC"
   519         -# time-stamp-end: "; # UTC"
          518  +# time-stamp-end: "$"
   520    519   # End:

Changes to lib/Makefile.am.

     1      1   
     2         -AM_CFLAGS = $(GCOV_FLAGS)
            2  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 
     3      3   
     4      4   INCLUDES = @CFLAGS@
     5      5   INCLUDES += -I$(top_srcdir)/headers
            6  +INCLUDES += -I$(top_srcdir)/epsilon
     6      7   
     7      8   lib_LTLIBRARIES = librasterlite.la 
     8      9   
     9     10   librasterlite_la_SOURCES = \
    10     11        rasterlite_io.c \
    11     12        rasterlite_image.c \
    12         -     rasterlite_aux.c \
    13         -     rasterlite_quantize.c \
    14     13        rasterlite_gif.c \
    15     14        rasterlite_png.c \
    16     15        rasterlite_jpeg.c \
    17     16        rasterlite_tiff.c \
    18         -     rasterlite_version.c \
           17  +     rasterlite_wavelet.c \
    19     18        rasterlite.c
    20     19   
    21         -librasterlite_la_LDFLAGS = -version-info 2:0:0 -no-undefined
           20  +librasterlite_la_LDFLAGS = -version-info 1:0:0 -no-undefined
    22     21   
    23         -librasterlite_la_LIBADD = @LIBSPATIALITE_LIBS@ @LIBPNG_LIBS@ \
    24         -	-lgeotiff -ltiff -ljpeg -lspatialite -lproj
           22  +librasterlite_la_LIBADD = \
           23  +	../epsilon/libepsilon.la \
           24  +	-lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
    25     25   
    26         -MOSTLYCLEANFILES = *.gcna *.gcno *.gcda

Changes to lib/Makefile.in.

     1         -# Makefile.in generated by automake 1.11.6 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
     6         -# Foundation, Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19         -am__make_dryrun = \
    20         -  { \
    21         -    am__dry=no; \
    22         -    case $$MAKEFLAGS in \
    23         -      *\\[\ \	]*) \
    24         -        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
    25         -          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
    26         -      *) \
    27         -        for am__flg in $$MAKEFLAGS; do \
    28         -          case $$am__flg in \
    29         -            *=*|--*) ;; \
    30         -            *n*) am__dry=yes; break;; \
    31         -          esac; \
    32         -        done;; \
    33         -    esac; \
    34         -    test $$am__dry = yes; \
    35         -  }
    36     18   pkgdatadir = $(datadir)/@PACKAGE@
    37         -pkgincludedir = $(includedir)/@PACKAGE@
    38     19   pkglibdir = $(libdir)/@PACKAGE@
    39         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    40     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    41     22   install_sh_DATA = $(install_sh) -c -m 644
    42     23   install_sh_PROGRAM = $(install_sh) -c
    43     24   install_sh_SCRIPT = $(install_sh) -c
    44     25   INSTALL_HEADER = $(INSTALL_DATA)
    45     26   transform = $(program_transform_name)
    46     27   NORMAL_INSTALL = :
................................................................................
    50     31   PRE_UNINSTALL = :
    51     32   POST_UNINSTALL = :
    52     33   build_triplet = @build@
    53     34   host_triplet = @host@
    54     35   subdir = lib
    55     36   DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    56     37   ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    57         -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
    58         -	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
    59         -	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
    60         -	$(top_srcdir)/configure.ac
           38  +am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    61     39   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    62     40   	$(ACLOCAL_M4)
    63     41   mkinstalldirs = $(install_sh) -d
    64         -CONFIG_HEADER = $(top_builddir)/config.h
    65     42   CONFIG_CLEAN_FILES =
    66         -CONFIG_CLEAN_VPATH_FILES =
    67     43   am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    68     44   am__vpath_adj = case $$p in \
    69     45       $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    70     46       *) f=$$p;; \
    71     47     esac;
    72         -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
    73         -am__install_max = 40
    74         -am__nobase_strip_setup = \
    75         -  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
    76         -am__nobase_strip = \
    77         -  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
    78         -am__nobase_list = $(am__nobase_strip_setup); \
    79         -  for p in $$list; do echo "$$p $$p"; done | \
    80         -  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
    81         -  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
    82         -    if (++n[$$2] == $(am__install_max)) \
    83         -      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
    84         -    END { for (dir in files) print dir, files[dir] }'
    85         -am__base_list = \
    86         -  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
    87         -  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
    88         -am__uninstall_files_from_dir = { \
    89         -  test -z "$$files" \
    90         -    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
    91         -    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
    92         -         $(am__cd) "$$dir" && rm -f $$files; }; \
    93         -  }
           48  +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
    94     49   am__installdirs = "$(DESTDIR)$(libdir)"
           50  +libLTLIBRARIES_INSTALL = $(INSTALL)
    95     51   LTLIBRARIES = $(lib_LTLIBRARIES)
    96         -librasterlite_la_DEPENDENCIES =
           52  +librasterlite_la_DEPENDENCIES = ../epsilon/libepsilon.la
    97     53   am_librasterlite_la_OBJECTS = rasterlite_io.lo rasterlite_image.lo \
    98         -	rasterlite_aux.lo rasterlite_quantize.lo rasterlite_gif.lo \
    99         -	rasterlite_png.lo rasterlite_jpeg.lo rasterlite_tiff.lo \
   100         -	rasterlite_version.lo rasterlite.lo
           54  +	rasterlite_gif.lo rasterlite_png.lo rasterlite_jpeg.lo \
           55  +	rasterlite_tiff.lo rasterlite_wavelet.lo rasterlite.lo
   101     56   librasterlite_la_OBJECTS = $(am_librasterlite_la_OBJECTS)
   102     57   librasterlite_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
   103     58   	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
   104     59   	$(librasterlite_la_LDFLAGS) $(LDFLAGS) -o $@
   105         -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
           60  +DEFAULT_INCLUDES = -I.@am__isrc@
   106     61   depcomp = $(SHELL) $(top_srcdir)/depcomp
   107     62   am__depfiles_maybe = depfiles
   108         -am__mv = mv -f
   109     63   COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
   110     64   	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
   111     65   LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
   112     66   	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
   113     67   	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
   114     68   CCLD = $(CC)
   115     69   LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
   116     70   	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
   117     71   	$(LDFLAGS) -o $@
   118     72   SOURCES = $(librasterlite_la_SOURCES)
   119     73   DIST_SOURCES = $(librasterlite_la_SOURCES)
   120         -am__can_run_installinfo = \
   121         -  case $$AM_UPDATE_INFO_DIR in \
   122         -    n|no|NO) false;; \
   123         -    *) (install-info --version) >/dev/null 2>&1;; \
   124         -  esac
   125     74   ETAGS = etags
   126     75   CTAGS = ctags
   127     76   DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   128     77   ACLOCAL = @ACLOCAL@
   129     78   AMTAR = @AMTAR@
   130     79   AR = @AR@
   131     80   AS = @AS@
................................................................................
   143     92   CXXDEPMODE = @CXXDEPMODE@
   144     93   CXXFLAGS = @CXXFLAGS@
   145     94   CYGPATH_W = @CYGPATH_W@
   146     95   DEFS = @DEFS@
   147     96   DEPDIR = @DEPDIR@
   148     97   DLLTOOL = @DLLTOOL@
   149     98   DSYMUTIL = @DSYMUTIL@
   150         -DUMPBIN = @DUMPBIN@
           99  +ECHO = @ECHO@
   151    100   ECHO_C = @ECHO_C@
   152    101   ECHO_N = @ECHO_N@
   153    102   ECHO_T = @ECHO_T@
   154    103   EGREP = @EGREP@
   155    104   EXEEXT = @EXEEXT@
   156         -FGREP = @FGREP@
          105  +F77 = @F77@
          106  +FFLAGS = @FFLAGS@
   157    107   GREP = @GREP@
   158    108   INSTALL = @INSTALL@
   159    109   INSTALL_DATA = @INSTALL_DATA@
   160    110   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   161    111   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   162    112   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   163         -LD = @LD@
   164    113   LDFLAGS = @LDFLAGS@
   165    114   LIBOBJS = @LIBOBJS@
   166         -LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
   167         -LIBPNG_LIBS = @LIBPNG_LIBS@
   168    115   LIBS = @LIBS@
   169         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   170         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   171    116   LIBTOOL = @LIBTOOL@
   172         -LIPO = @LIPO@
   173    117   LN_S = @LN_S@
   174    118   LTLIBOBJS = @LTLIBOBJS@
   175    119   MAINT = @MAINT@
   176    120   MAKEINFO = @MAKEINFO@
   177         -MANIFEST_TOOL = @MANIFEST_TOOL@
   178    121   MKDIR_P = @MKDIR_P@
   179         -NM = @NM@
   180    122   NMEDIT = @NMEDIT@
   181    123   OBJDUMP = @OBJDUMP@
   182    124   OBJEXT = @OBJEXT@
   183         -OTOOL = @OTOOL@
   184         -OTOOL64 = @OTOOL64@
   185    125   PACKAGE = @PACKAGE@
   186    126   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   187    127   PACKAGE_NAME = @PACKAGE_NAME@
   188    128   PACKAGE_STRING = @PACKAGE_STRING@
   189    129   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   190         -PACKAGE_URL = @PACKAGE_URL@
   191    130   PACKAGE_VERSION = @PACKAGE_VERSION@
   192    131   PATH_SEPARATOR = @PATH_SEPARATOR@
   193         -PKG_CONFIG = @PKG_CONFIG@
   194         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   195         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   196    132   RANLIB = @RANLIB@
   197    133   SED = @SED@
   198    134   SET_MAKE = @SET_MAKE@
   199    135   SHELL = @SHELL@
   200    136   STRIP = @STRIP@
   201    137   VERSION = @VERSION@
   202    138   abs_builddir = @abs_builddir@
   203    139   abs_srcdir = @abs_srcdir@
   204    140   abs_top_builddir = @abs_top_builddir@
   205    141   abs_top_srcdir = @abs_top_srcdir@
   206         -ac_ct_AR = @ac_ct_AR@
   207    142   ac_ct_CC = @ac_ct_CC@
   208    143   ac_ct_CXX = @ac_ct_CXX@
   209         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          144  +ac_ct_F77 = @ac_ct_F77@
   210    145   am__include = @am__include@
   211    146   am__leading_dot = @am__leading_dot@
   212    147   am__quote = @am__quote@
   213    148   am__tar = @am__tar@
   214    149   am__untar = @am__untar@
   215    150   bindir = @bindir@
   216    151   build = @build@
................................................................................
   245    180   program_transform_name = @program_transform_name@
   246    181   psdir = @psdir@
   247    182   sbindir = @sbindir@
   248    183   sharedstatedir = @sharedstatedir@
   249    184   srcdir = @srcdir@
   250    185   sysconfdir = @sysconfdir@
   251    186   target_alias = @target_alias@
   252         -top_build_prefix = @top_build_prefix@
   253    187   top_builddir = @top_builddir@
   254    188   top_srcdir = @top_srcdir@
   255         -AM_CFLAGS = $(GCOV_FLAGS)
   256         -INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers
          189  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 
          190  +INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers -I$(top_srcdir)/epsilon
   257    191   lib_LTLIBRARIES = librasterlite.la 
   258    192   librasterlite_la_SOURCES = \
   259    193        rasterlite_io.c \
   260    194        rasterlite_image.c \
   261         -     rasterlite_aux.c \
   262         -     rasterlite_quantize.c \
   263    195        rasterlite_gif.c \
   264    196        rasterlite_png.c \
   265    197        rasterlite_jpeg.c \
   266    198        rasterlite_tiff.c \
   267         -     rasterlite_version.c \
          199  +     rasterlite_wavelet.c \
   268    200        rasterlite.c
   269    201   
   270         -librasterlite_la_LDFLAGS = -version-info 2:0:0 -no-undefined
   271         -librasterlite_la_LIBADD = @LIBSPATIALITE_LIBS@ @LIBPNG_LIBS@ \
   272         -	-lgeotiff -ltiff -ljpeg -lspatialite -lproj
          202  +librasterlite_la_LDFLAGS = -version-info 1:0:0 -no-undefined
          203  +librasterlite_la_LIBADD = \
          204  +	../epsilon/libepsilon.la \
          205  +	-lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
   273    206   
   274         -MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
   275    207   all: all-am
   276    208   
   277    209   .SUFFIXES:
   278    210   .SUFFIXES: .c .lo .o .obj
   279    211   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   280    212   	@for dep in $?; do \
   281    213   	  case '$(am__configure_deps)' in \
   282    214   	    *$$dep*) \
   283         -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   284         -	        && { if test -f $@; then exit 0; else break; fi; }; \
          215  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          216  +		&& exit 0; \
   285    217   	      exit 1;; \
   286    218   	  esac; \
   287    219   	done; \
   288         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \
   289         -	$(am__cd) $(top_srcdir) && \
   290         -	  $(AUTOMAKE) --gnu lib/Makefile
          220  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  lib/Makefile'; \
          221  +	cd $(top_srcdir) && \
          222  +	  $(AUTOMAKE) --foreign  lib/Makefile
   291    223   .PRECIOUS: Makefile
   292    224   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   293    225   	@case '$?' in \
   294    226   	  *config.status*) \
   295    227   	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   296    228   	  *) \
   297    229   	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
................................................................................
   301    233   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   302    234   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   303    235   
   304    236   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   305    237   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   306    238   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   307    239   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   308         -$(am__aclocal_m4_deps):
   309    240   install-libLTLIBRARIES: $(lib_LTLIBRARIES)
   310    241   	@$(NORMAL_INSTALL)
   311         -	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
   312         -	list2=; for p in $$list; do \
          242  +	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
          243  +	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
   313    244   	  if test -f $$p; then \
   314         -	    list2="$$list2 $$p"; \
          245  +	    f=$(am__strip_dir) \
          246  +	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
          247  +	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
   315    248   	  else :; fi; \
   316         -	done; \
   317         -	test -z "$$list2" || { \
   318         -	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
   319         -	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
   320         -	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
   321         -	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
   322         -	}
          249  +	done
   323    250   
   324    251   uninstall-libLTLIBRARIES:
   325    252   	@$(NORMAL_UNINSTALL)
   326         -	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
   327         -	for p in $$list; do \
   328         -	  $(am__strip_dir) \
   329         -	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
   330         -	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
          253  +	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
          254  +	  p=$(am__strip_dir) \
          255  +	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
          256  +	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
   331    257   	done
   332    258   
   333    259   clean-libLTLIBRARIES:
   334    260   	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
   335    261   	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
   336    262   	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
   337    263   	  test "$$dir" != "$$p" || dir=.; \
   338    264   	  echo "rm -f \"$${dir}/so_locations\""; \
   339    265   	  rm -f "$${dir}/so_locations"; \
   340    266   	done
   341         -librasterlite.la: $(librasterlite_la_OBJECTS) $(librasterlite_la_DEPENDENCIES) $(EXTRA_librasterlite_la_DEPENDENCIES) 
          267  +librasterlite.la: $(librasterlite_la_OBJECTS) $(librasterlite_la_DEPENDENCIES) 
   342    268   	$(librasterlite_la_LINK) -rpath $(libdir) $(librasterlite_la_OBJECTS) $(librasterlite_la_LIBADD) $(LIBS)
   343    269   
   344    270   mostlyclean-compile:
   345    271   	-rm -f *.$(OBJEXT)
   346    272   
   347    273   distclean-compile:
   348    274   	-rm -f *.tab.c
   349    275   
   350    276   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite.Plo@am__quote@
   351         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_aux.Plo@am__quote@
   352    277   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_gif.Plo@am__quote@
   353    278   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_image.Plo@am__quote@
   354    279   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_io.Plo@am__quote@
   355    280   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_jpeg.Plo@am__quote@
   356    281   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_png.Plo@am__quote@
   357         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_quantize.Plo@am__quote@
   358    282   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_tiff.Plo@am__quote@
   359         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_version.Plo@am__quote@
          283  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_wavelet.Plo@am__quote@
   360    284   
   361    285   .c.o:
   362    286   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   363         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          287  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   364    288   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   365    289   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   366    290   @am__fastdepCC_FALSE@	$(COMPILE) -c $<
   367    291   
   368    292   .c.obj:
   369    293   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
   370         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          294  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   371    295   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   372    296   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   373    297   @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
   374    298   
   375    299   .c.lo:
   376    300   @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   377         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
          301  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
   378    302   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
   379    303   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   380    304   @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
   381    305   
   382    306   mostlyclean-libtool:
   383    307   	-rm -f *.lo
   384    308   
................................................................................
   386    310   	-rm -rf .libs _libs
   387    311   
   388    312   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   389    313   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   390    314   	unique=`for i in $$list; do \
   391    315   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   392    316   	  done | \
   393         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          317  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   394    318   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   395    319   	mkid -fID $$unique
   396    320   tags: TAGS
   397    321   
   398    322   TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   399    323   		$(TAGS_FILES) $(LISP)
   400         -	set x; \
          324  +	tags=; \
   401    325   	here=`pwd`; \
   402    326   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   403    327   	unique=`for i in $$list; do \
   404    328   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   405    329   	  done | \
   406    330   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   407    331   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   408         -	shift; \
   409         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          332  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   410    333   	  test -n "$$unique" || unique=$$empty_fix; \
   411         -	  if test $$# -gt 0; then \
   412         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   413         -	      "$$@" $$unique; \
   414         -	  else \
   415         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   416         -	      $$unique; \
   417         -	  fi; \
          334  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          335  +	    $$tags $$unique; \
   418    336   	fi
   419    337   ctags: CTAGS
   420    338   CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   421    339   		$(TAGS_FILES) $(LISP)
          340  +	tags=; \
   422    341   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   423    342   	unique=`for i in $$list; do \
   424    343   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   425    344   	  done | \
   426    345   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   427    346   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   428         -	test -z "$(CTAGS_ARGS)$$unique" \
          347  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   429    348   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   430         -	     $$unique
          349  +	     $$tags $$unique
   431    350   
   432    351   GTAGS:
   433    352   	here=`$(am__cd) $(top_builddir) && pwd` \
   434         -	  && $(am__cd) $(top_srcdir) \
   435         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          353  +	  && cd $(top_srcdir) \
          354  +	  && gtags -i $(GTAGS_ARGS) $$here
   436    355   
   437    356   distclean-tags:
   438    357   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   439    358   
   440    359   distdir: $(DISTFILES)
   441    360   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   442    361   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
................................................................................
   449    368   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   450    369   			   sort -u` ;; \
   451    370   	esac; \
   452    371   	for file in $$dist_files; do \
   453    372   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   454    373   	  if test -d $$d/$$file; then \
   455    374   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   456         -	    if test -d "$(distdir)/$$file"; then \
   457         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          375  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          376  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   458    377   	    fi; \
   459         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   460         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   461         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   462         -	    fi; \
   463         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          378  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   464    379   	  else \
   465         -	    test -f "$(distdir)/$$file" \
   466         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          380  +	    test -f $(distdir)/$$file \
          381  +	    || cp -p $$d/$$file $(distdir)/$$file \
   467    382   	    || exit 1; \
   468    383   	  fi; \
   469    384   	done
   470    385   check-am: all-am
   471    386   check: check-am
   472    387   all-am: Makefile $(LTLIBRARIES)
   473    388   installdirs:
................................................................................
   480    395   uninstall: uninstall-am
   481    396   
   482    397   install-am: all-am
   483    398   	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   484    399   
   485    400   installcheck: installcheck-am
   486    401   install-strip:
   487         -	if test -z '$(STRIP)'; then \
   488         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   489         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   490         -	      install; \
   491         -	else \
   492         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   493         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   494         -	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
   495         -	fi
          402  +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
          403  +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          404  +	  `test -z '$(STRIP)' || \
          405  +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   496    406   mostlyclean-generic:
   497         -	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
   498    407   
   499    408   clean-generic:
   500    409   
   501    410   distclean-generic:
   502    411   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   503         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   504    412   
   505    413   maintainer-clean-generic:
   506    414   	@echo "This command is intended for maintainers to use"
   507    415   	@echo "it deletes files that may require special tools to rebuild."
   508    416   clean: clean-am
   509    417   
   510    418   clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
................................................................................
   518    426   
   519    427   dvi: dvi-am
   520    428   
   521    429   dvi-am:
   522    430   
   523    431   html: html-am
   524    432   
   525         -html-am:
   526         -
   527    433   info: info-am
   528    434   
   529    435   info-am:
   530    436   
   531    437   install-data-am:
   532    438   
   533    439   install-dvi: install-dvi-am
   534    440   
   535         -install-dvi-am:
   536         -
   537    441   install-exec-am: install-libLTLIBRARIES
   538    442   
   539    443   install-html: install-html-am
   540    444   
   541         -install-html-am:
   542         -
   543    445   install-info: install-info-am
   544    446   
   545         -install-info-am:
   546         -
   547    447   install-man:
   548    448   
   549    449   install-pdf: install-pdf-am
   550    450   
   551         -install-pdf-am:
   552         -
   553    451   install-ps: install-ps-am
   554    452   
   555         -install-ps-am:
   556         -
   557    453   installcheck-am:
   558    454   
   559    455   maintainer-clean: maintainer-clean-am
   560    456   	-rm -rf ./$(DEPDIR)
   561    457   	-rm -f Makefile
   562    458   maintainer-clean-am: distclean-am maintainer-clean-generic
   563    459   
................................................................................
   587    483   	install-html-am install-info install-info-am \
   588    484   	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
   589    485   	install-ps install-ps-am install-strip installcheck \
   590    486   	installcheck-am installdirs maintainer-clean \
   591    487   	maintainer-clean-generic mostlyclean mostlyclean-compile \
   592    488   	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
   593    489   	tags uninstall uninstall-am uninstall-libLTLIBRARIES
   594         -
   595    490   
   596    491   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   597    492   # Otherwise a system limit (for SysV at least) may be exceeded.
   598    493   .NOEXPORT:

Changes to lib/rasterlite.c.

     1      1   /* 
     2      2   / rasterlite.c
     3      3   /
     4      4   / the RasterLite library core 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50     27   #include <stdlib.h>
    51     28   #include <stdio.h>
    52     29   #include <string.h>
    53     30   #include <float.h>
    54     31   #include <math.h>
    55     32   
    56         -#include "rasterlite_tiff_hdrs.h"
           33  +#include <geotiff.h>
           34  +#include <xtiffio.h>
           35  +#include <geo_normalize.h>
           36  +#include <geovalues.h>
    57     37   #include <tiffio.h>
    58     38   
    59         -#ifdef SPATIALITE_AMALGAMATION
    60     39   #include <spatialite/sqlite3.h>
    61         -#else
    62         -#include <sqlite3.h>
    63         -#endif
    64         -
    65     40   #include <spatialite/gaiaexif.h>
    66     41   #include <spatialite/gaiageo.h>
    67     42   #include <spatialite.h>
    68     43   
    69     44   #include "rasterlite.h"
    70     45   #include "rasterlite_internals.h"
    71     46   
................................................................................
   353    328   /* trying to connect SpatiaLite DB */
   354    329       sqlite3 *handle = NULL;
   355    330       int ret;
   356    331       char rasters[512];
   357    332       char meta[512];
   358    333       char sql[1024];
   359    334       int spatialite_rs = 0;
   360         -    int spatialite_legacy_gc = 0;
   361    335       int spatialite_gc = 0;
   362    336       int rs_srid = 0;
   363    337       int auth_name = 0;
   364    338       int auth_srid = 0;
   365    339       int ref_sys_name = 0;
   366    340       int proj4text = 0;
   367    341       int f_table_name = 0;
   368    342       int f_geometry_column = 0;
   369    343       int coord_dimension = 0;
   370    344       int gc_srid = 0;
   371    345       int type = 0;
   372         -    int geometry_type = 0;
   373    346       int spatial_index_enabled = 0;
   374    347       int tbl_rasters = 0;
   375    348       int tbl_meta = 0;
   376    349       const char *name;
   377    350       int i;
   378    351       char **results;
   379    352       int rows;
................................................................................
   405    378   		    f_geometry_column = 1;
   406    379   		if (strcasecmp (name, "coord_dimension") == 0)
   407    380   		    coord_dimension = 1;
   408    381   		if (strcasecmp (name, "srid") == 0)
   409    382   		    gc_srid = 1;
   410    383   		if (strcasecmp (name, "type") == 0)
   411    384   		    type = 1;
   412         -		if (strcasecmp (name, "geometry_type") == 0)
   413         -		    geometry_type = 1;
   414    385   		if (strcasecmp (name, "spatial_index_enabled") == 0)
   415    386   		    spatial_index_enabled = 1;
   416    387   	    }
   417    388         }
   418    389       sqlite3_free_table (results);
   419    390       if (f_table_name && f_geometry_column && type && coord_dimension && gc_srid
   420    391   	&& spatial_index_enabled)
   421         -	spatialite_legacy_gc = 1;
   422         -    if (f_table_name && f_geometry_column && geometry_type && coord_dimension
   423         -	&& gc_srid && spatial_index_enabled)
   424    392   	spatialite_gc = 1;
   425    393   
   426    394   /* checking the SPATIAL_REF_SYS table */
   427    395       strcpy (sql, "PRAGMA table_info(spatial_ref_sys)");
   428    396       ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
   429    397       if (ret != SQLITE_OK)
   430    398   	goto unknown;
................................................................................
   448    416   	    }
   449    417         }
   450    418       sqlite3_free_table (results);
   451    419       if (rs_srid && auth_name && auth_srid && ref_sys_name && proj4text)
   452    420   	spatialite_rs = 1;
   453    421   
   454    422   /* verifying the MetaData format */
   455         -    if ((spatialite_legacy_gc || spatialite_gc) && spatialite_rs)
          423  +    if (spatialite_gc && spatialite_rs)
   456    424   	goto check_tables;
   457    425   
   458    426     unknown:
   459    427       if (handle)
   460    428   	sqlite3_close (handle);
   461    429       sprintf (error, "this DB doesn't seems to contain valid Spatial Metadata");
   462    430       return NULL;
................................................................................
   640    608   	free (handle->pixel_y_size);
   641    609       if (handle->tile_count)
   642    610   	free (handle->tile_count);
   643    611       if (handle->stmt_rtree)
   644    612   	sqlite3_finalize (handle->stmt_rtree);
   645    613       if (handle->stmt_plain)
   646    614   	sqlite3_finalize (handle->stmt_plain);
   647         -    if (handle->sqlite_version)
   648         -	free (handle->sqlite_version);
   649         -    if (handle->spatialite_version)
   650         -	free (handle->spatialite_version);
   651    615       if (handle->handle)
   652    616   	sqlite3_close (handle->handle);
   653    617       free (handle);
   654         -    spatialite_cleanup ();
   655    618   }
   656    619   
   657    620   RASTERLITE_DECLARE int
   658    621   rasterliteHasTransparentColor (void *ext_handle)
   659    622   {
   660    623   /* return 1 if the TransparentColor is set; otherwise 0 */
   661    624       rasterlitePtr handle = (rasterlitePtr) ext_handle;
................................................................................
   757    720   	  /* best access strategy: TABLE SCAN */
   758    721   	  *strategy = STRATEGY_PLAIN;
   759    722         }
   760    723       return RASTERLITE_OK;
   761    724   }
   762    725   
   763    726   static void
   764         -mark_gray_rectangle (rasterliteImagePtr output, int base_x, int base_y,
          727  +mark_gray_rectangle (rasterliteImagePrt output, int base_x, int base_y,
   765    728   		     int width, int height)
   766    729   {
   767    730   /* marking a gray rectangle */
   768    731       int x;
   769    732       int y;
   770    733       int dst_x;
   771    734       int dst_y;
................................................................................
   790    753   		else
   791    754   		    image_set_pixel (output, dst_x, dst_y, fill_color);
   792    755   	    }
   793    756         }
   794    757   }
   795    758   
   796    759   static void
   797         -copy_rectangle (rasterliteImagePtr output, rasterliteImagePtr input,
          760  +copy_rectangle (rasterliteImagePrt output, rasterliteImagePrt input,
   798    761   		int transparent_color, int base_x, int base_y)
   799    762   {
   800    763   /* copying a raster rectangle */
   801    764       int x;
   802    765       int y;
   803    766       int dst_x;
   804    767       int dst_y;
................................................................................
   863    826       sqlite3_stmt *stmt;
   864    827       double map_width = (double) width * ext_pixel_x_size;
   865    828       double map_height = (double) height * ext_pixel_y_size;
   866    829       double min_x = cx - (map_width / 2.0);
   867    830       double max_x = cx + (map_width / 2.0);
   868    831       double min_y = cy - (map_height / 2.0);
   869    832       double max_y = cy + (map_height / 2.0);
   870         -    rasterliteImagePtr output = NULL;
          833  +    rasterliteImagePrt output = NULL;
   871    834       reset_error (handle);
   872    835       if (handle->handle == NULL || handle->stmt_rtree == NULL
   873    836   	|| handle->stmt_plain == NULL)
   874    837         {
   875    838   	  sprintf (error, "invalid datasource");
   876    839   	  set_error (handle, error);
   877    840   	  *raster = NULL;
................................................................................
   929    892   	  ret = sqlite3_step (stmt);
   930    893   	  if (ret == SQLITE_DONE)
   931    894   	      break;		/* end of result set */
   932    895   	  if (ret == SQLITE_ROW)
   933    896   	    {
   934    897   		/* retrieving query values */
   935    898   		gaiaGeomCollPtr geom = NULL;
   936         -		rasterliteImagePtr img = NULL;
          899  +		rasterliteImagePrt img = NULL;
   937    900   		if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
   938    901   		  {
   939    902   		      /* fetching Geometry */
   940    903   		      const void *blob = sqlite3_column_blob (stmt, 0);
   941    904   		      int blob_size = sqlite3_column_bytes (stmt, 0);
   942    905   		      geom =
   943    906   			  gaiaFromSpatiaLiteBlobWkb ((const unsigned char *)
................................................................................
   970    933   					  ext_pixel_y_size);
   971    934   		      int new_width = (int) pre_width + 1;
   972    935   		      int new_height = (int) pre_height + 1;
   973    936   		      double x = (geom->MinX - min_x) / ext_pixel_x_size;
   974    937   		      double y =
   975    938   			  (double) height -
   976    939   			  ((geom->MaxY - min_y) / ext_pixel_y_size);
   977         -		      if (new_width > (img->sx * 16)
   978         -			  || new_height > (img->sy * 16))
          940  +		      if (new_width > (img->sx * 2)
          941  +			  || new_height > (img->sy * 2))
   979    942   			{
   980    943   			    /* TOO BIG: drawing a gray rectangle */
   981    944   			    mark_gray_rectangle (output, int_round (x),
   982    945   						 int_round (y), new_width,
   983    946   						 new_height);
   984    947   			}
   985    948   		      else
   986    949   			{
   987    950   			    /* resizing the raster tile */
   988    951   			    if (new_width == img->sx && new_height == img->sy)
   989    952   				;
   990    953   			    else
   991    954   			      {
   992         -				  rasterliteImagePtr img2 = img;
          955  +				  rasterliteImagePrt img2 = img;
   993    956   				  img = image_create (new_width, new_height);
   994    957   				  image_resize (img, img2);
   995    958   				  image_destroy (img2);
   996    959   			      }
   997    960   			    /* drawing the raster tile */
   998    961   			    copy_rectangle (output, img,
   999    962   					    handle->transparent_color,
................................................................................
  1204   1167       sqlite3_stmt *stmt;
  1205   1168       double map_width = (double) width * ext_pixel_x_size;
  1206   1169       double map_height = (double) height * ext_pixel_y_size;
  1207   1170       double min_x = cx - (map_width / 2.0);
  1208   1171       double max_x = cx + (map_width / 2.0);
  1209   1172       double min_y = cy - (map_height / 2.0);
  1210   1173       double max_y = cy + (map_height / 2.0);
  1211         -    rasterliteImagePtr output = NULL;
         1174  +    rasterliteImagePrt output = NULL;
  1212   1175       reset_error (handle);
  1213   1176       if (handle->handle == NULL || handle->stmt_rtree == NULL
  1214   1177   	|| handle->stmt_plain == NULL)
  1215   1178         {
  1216   1179   	  sprintf (error, "invalid datasource");
  1217   1180   	  set_error (handle, error);
  1218   1181   	  *raster = NULL;
................................................................................
  1282   1245   	  ret = sqlite3_step (stmt);
  1283   1246   	  if (ret == SQLITE_DONE)
  1284   1247   	      break;		/* end of result set */
  1285   1248   	  if (ret == SQLITE_ROW)
  1286   1249   	    {
  1287   1250   		/* retrieving query values */
  1288   1251   		gaiaGeomCollPtr geom = NULL;
  1289         -		rasterliteImagePtr img = NULL;
         1252  +		rasterliteImagePrt img = NULL;
  1290   1253   		if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
  1291   1254   		  {
  1292   1255   		      /* fetching Geometry */
  1293   1256   		      const void *blob = sqlite3_column_blob (stmt, 0);
  1294   1257   		      int blob_size = sqlite3_column_bytes (stmt, 0);
  1295   1258   		      geom =
  1296   1259   			  gaiaFromSpatiaLiteBlobWkb ((const unsigned char *)
................................................................................
  1323   1286   					  ext_pixel_y_size);
  1324   1287   		      int new_width = (int) pre_width + 1;
  1325   1288   		      int new_height = (int) pre_height + 1;
  1326   1289   		      double x = (geom->MinX - min_x) / ext_pixel_x_size;
  1327   1290   		      double y =
  1328   1291   			  (double) height -
  1329   1292   			  ((geom->MaxY - min_y) / ext_pixel_y_size);
  1330         -		      if (new_width > (img->sx * 16)
  1331         -			  || new_height > (img->sy * 16))
         1293  +		      if (new_width > (img->sx * 2)
         1294  +			  || new_height > (img->sy * 2))
  1332   1295   			{
  1333   1296   			    /* TOO BIG: drawing a gray rectangle */
  1334   1297   			    mark_gray_rectangle (output, int_round (x),
  1335   1298   						 int_round (y), new_width,
  1336   1299   						 new_height);
  1337   1300   			}
  1338   1301   		      else
  1339   1302   			{
  1340   1303   			    /* resizing the raster tile */
  1341   1304   			    if (new_width == img->sx && new_height == img->sy)
  1342   1305   				;
  1343   1306   			    else
  1344   1307   			      {
  1345         -				  rasterliteImagePtr img2 = img;
         1308  +				  rasterliteImagePrt img2 = img;
  1346   1309   				  img = image_create (new_width, new_height);
  1347   1310   				  image_resize (img, img2);
  1348   1311   				  image_destroy (img2);
  1349   1312   			      }
  1350   1313   			    /* drawing the raster tile */
  1351   1314   			    copy_rectangle (output, img,
  1352   1315   					    handle->transparent_color,
................................................................................
  1600   1563   
  1601   1564   RASTERLITE_DECLARE const char *
  1602   1565   rasterliteGetSpatialiteVersion (void *ext_handle)
  1603   1566   {
  1604   1567       rasterlitePtr handle = (rasterlitePtr) ext_handle;
  1605   1568       return handle->spatialite_version;
  1606   1569   }
         1570  +
         1571  +RASTERLITE_DECLARE int
         1572  +rasterliteWaveletToPng (const void *blob, int blob_size, void **png_blob,
         1573  +			int *png_size)
         1574  +{
         1575  +/* transforming a Wavelet compressed image into a PNG */
         1576  +    rasterliteImagePrt img;
         1577  +    void *png;
         1578  +    int sz;
         1579  +    img = image_from_wavelet (blob_size, blob);
         1580  +    if (!img)
         1581  +      {
         1582  +	  *png_size = 0;
         1583  +	  *png_blob = NULL;
         1584  +	  return RASTERLITE_ERROR;
         1585  +      }
         1586  +    if (img->color_space == COLORSPACE_GRAYSCALE)
         1587  +	png = image_to_png_grayscale (img, &sz);
         1588  +    else
         1589  +	png = image_to_png_rgb (img, &sz);
         1590  +    *png_size = sz;
         1591  +    *png_blob = png;
         1592  +    return RASTERLITE_OK;
         1593  +}
  1607   1594   
  1608   1595   RASTERLITE_DECLARE int
  1609   1596   rasterliteExportGeoTiff (void *handle, const char *img_path, void *raster,
  1610   1597   			 int size, double cx, double cy, double pixel_x_size,
  1611   1598   			 double pixel_y_size, int width, int height)
  1612   1599   {
  1613   1600   /* exporting a TIFF as a GeoTIFF */

Deleted lib/rasterlite_aux.c.

     1         -/* 
     2         -/ rasterlite_aux.c
     3         -/
     4         -/ RAW image helpers
     5         -/
     6         -/ version 1.1a, 2011 November 12
     7         -/
     8         -/ Author: Sandro Furieri a.furieri@lqt.it
     9         -/
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
    23         -/
    24         -/ The Original Code is the RasterLite library
    25         -/
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43         -*/
    44         -
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50         -#include <stdlib.h>
    51         -#include <stdio.h>
    52         -#include <string.h>
    53         -#include <float.h>
    54         -#include <math.h>
    55         -
    56         -#ifdef _WIN32
    57         -#include <io.h>
    58         -#else
    59         -#include <unistd.h>
    60         -#endif
    61         -
    62         -#include "rasterlite_tiff_hdrs.h"
    63         -#include <tiffio.h>
    64         -
    65         -#ifdef SPATIALITE_AMALGAMATION
    66         -#include <spatialite/sqlite3.h>
    67         -#else
    68         -#include <sqlite3.h>
    69         -#endif
    70         -
    71         -#include <spatialite/gaiaexif.h>
    72         -#include <spatialite/gaiageo.h>
    73         -#include <spatialite.h>
    74         -
    75         -#include "rasterlite.h"
    76         -#include "rasterlite_internals.h"
    77         -
    78         -RASTERLITE_DECLARE int
    79         -rasterliteJpegBlobToRawImage (const void *blob, int blob_size, int raw_format,
    80         -			      void **raw, int *width, int *height)
    81         -{
    82         -/* decompressing a Jpeg compressed image and returning a RAW image */
    83         -    void *raw_array;
    84         -    int size;
    85         -    rasterliteImagePtr img = NULL;
    86         -    char *errmsg;
    87         -
    88         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
    89         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
    90         -	|| raw_format == GAIA_BGRA_ARRAY)
    91         -	;
    92         -    else
    93         -      {
    94         -	  errmsg = "invalid raster RAW format";
    95         -	  goto error;
    96         -      }
    97         -
    98         -    img = image_from_jpeg (blob_size, blob);
    99         -    if (!img)
   100         -      {
   101         -	  errmsg = "Jpeg decoder error";
   102         -	  goto error;
   103         -      }
   104         -
   105         -    if (raw_format == GAIA_RGB_ARRAY)
   106         -      {
   107         -	  raw_array = image_to_rgb_array (img, &size);
   108         -	  if (!raw_array)
   109         -	    {
   110         -		errmsg = "RGB ARRAY generation error";
   111         -		goto error;
   112         -	    }
   113         -      }
   114         -    if (raw_format == GAIA_RGBA_ARRAY)
   115         -      {
   116         -	  raw_array = image_to_rgba_array (-1, img, &size);
   117         -	  if (!raw_array)
   118         -	    {
   119         -		errmsg = "RGBA ARRAY generation error";
   120         -		goto error;
   121         -	    }
   122         -      }
   123         -    if (raw_format == GAIA_ARGB_ARRAY)
   124         -      {
   125         -	  raw_array = image_to_argb_array (-1, img, &size);
   126         -	  if (!raw_array)
   127         -	    {
   128         -		errmsg = "ARGB ARRAY generation error";
   129         -		goto error;
   130         -	    }
   131         -      }
   132         -    if (raw_format == GAIA_BGR_ARRAY)
   133         -      {
   134         -	  raw_array = image_to_bgr_array (img, &size);
   135         -	  if (!raw_array)
   136         -	    {
   137         -		errmsg = "BGR ARRAY generation error";
   138         -		goto error;
   139         -	    }
   140         -      }
   141         -    if (raw_format == GAIA_BGRA_ARRAY)
   142         -      {
   143         -	  raw_array = image_to_bgra_array (-1, img, &size);
   144         -	  if (!raw_array)
   145         -	    {
   146         -		errmsg = "BGRA ARRAY generation error";
   147         -		goto error;
   148         -	    }
   149         -      }
   150         -
   151         -    image_destroy (img);
   152         -    *raw = raw_array;
   153         -    *width = img->sx;
   154         -    *height = img->sy;
   155         -    return RASTERLITE_OK;
   156         -
   157         -  error:
   158         -    fprintf (stderr, "%s\n", errmsg);
   159         -    if (img)
   160         -	image_destroy (img);
   161         -    *raw = NULL;
   162         -    *width = 0;
   163         -    *height = 0;
   164         -    return RASTERLITE_ERROR;
   165         -}
   166         -
   167         -RASTERLITE_DECLARE int
   168         -rasterlitePngBlobToRawImage (const void *blob, int blob_size, int raw_format,
   169         -			     void **raw, int *width, int *height)
   170         -{
   171         -/* decompressing a Png compressed image and returning a RAW image*/
   172         -    void *raw_array;
   173         -    int size;
   174         -    rasterliteImagePtr img = NULL;
   175         -    char *errmsg;
   176         -
   177         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   178         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   179         -	|| raw_format == GAIA_BGRA_ARRAY)
   180         -	;
   181         -    else
   182         -      {
   183         -	  errmsg = "invalid raster RAW format";
   184         -	  goto error;
   185         -      }
   186         -
   187         -    img = image_from_png (blob_size, blob);
   188         -    if (!img)
   189         -      {
   190         -	  errmsg = "Png decoder error";
   191         -	  goto error;
   192         -      }
   193         -
   194         -    if (raw_format == GAIA_RGB_ARRAY)
   195         -      {
   196         -	  raw_array = image_to_rgb_array (img, &size);
   197         -	  if (!raw_array)
   198         -	    {
   199         -		errmsg = "RGB ARRAY generation error";
   200         -		goto error;
   201         -	    }
   202         -      }
   203         -    if (raw_format == GAIA_RGBA_ARRAY)
   204         -      {
   205         -	  raw_array = image_to_rgba_array (-1, img, &size);
   206         -	  if (!raw_array)
   207         -	    {
   208         -		errmsg = "RGBA ARRAY generation error";
   209         -		goto error;
   210         -	    }
   211         -      }
   212         -    if (raw_format == GAIA_ARGB_ARRAY)
   213         -      {
   214         -	  raw_array = image_to_argb_array (-1, img, &size);
   215         -	  if (!raw_array)
   216         -	    {
   217         -		errmsg = "ARGB ARRAY generation error";
   218         -		goto error;
   219         -	    }
   220         -      }
   221         -    if (raw_format == GAIA_BGR_ARRAY)
   222         -      {
   223         -	  raw_array = image_to_bgr_array (img, &size);
   224         -	  if (!raw_array)
   225         -	    {
   226         -		errmsg = "BGR ARRAY generation error";
   227         -		goto error;
   228         -	    }
   229         -      }
   230         -    if (raw_format == GAIA_BGRA_ARRAY)
   231         -      {
   232         -	  raw_array = image_to_bgra_array (-1, img, &size);
   233         -	  if (!raw_array)
   234         -	    {
   235         -		errmsg = "BGRA ARRAY generation error";
   236         -		goto error;
   237         -	    }
   238         -      }
   239         -
   240         -    image_destroy (img);
   241         -    *raw = raw_array;
   242         -    *width = img->sx;
   243         -    *height = img->sy;
   244         -    return RASTERLITE_OK;
   245         -
   246         -  error:
   247         -    fprintf (stderr, "%s\n", errmsg);
   248         -    if (img)
   249         -	image_destroy (img);
   250         -    *raw = NULL;
   251         -    *width = 0;
   252         -    *height = 0;
   253         -    return RASTERLITE_ERROR;
   254         -}
   255         -
   256         -RASTERLITE_DECLARE int
   257         -rasterliteGifBlobToRawImage (const void *blob, int blob_size, int raw_format,
   258         -			     void **raw, int *width, int *height)
   259         -{
   260         -/* decompressing a GIF compressed image and returning a RAW image */
   261         -    void *raw_array;
   262         -    int size;
   263         -    rasterliteImagePtr img = NULL;
   264         -    char *errmsg;
   265         -
   266         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   267         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   268         -	|| raw_format == GAIA_BGRA_ARRAY)
   269         -	;
   270         -    else
   271         -      {
   272         -	  errmsg = "invalid raster RAW format";
   273         -	  goto error;
   274         -      }
   275         -
   276         -    img = image_from_gif (blob_size, blob);
   277         -    if (!img)
   278         -      {
   279         -	  errmsg = "Gif decoder error";
   280         -	  goto error;
   281         -      }
   282         -
   283         -    if (raw_format == GAIA_RGB_ARRAY)
   284         -      {
   285         -	  raw_array = image_to_rgb_array (img, &size);
   286         -	  if (!raw_array)
   287         -	    {
   288         -		errmsg = "RGB ARRAY generation error";
   289         -		goto error;
   290         -	    }
   291         -      }
   292         -    if (raw_format == GAIA_RGBA_ARRAY)
   293         -      {
   294         -	  raw_array = image_to_rgba_array (-1, img, &size);
   295         -	  if (!raw_array)
   296         -	    {
   297         -		errmsg = "RGBA ARRAY generation error";
   298         -		goto error;
   299         -	    }
   300         -      }
   301         -    if (raw_format == GAIA_ARGB_ARRAY)
   302         -      {
   303         -	  raw_array = image_to_argb_array (-1, img, &size);
   304         -	  if (!raw_array)
   305         -	    {
   306         -		errmsg = "ARGB ARRAY generation error";
   307         -		goto error;
   308         -	    }
   309         -      }
   310         -    if (raw_format == GAIA_BGR_ARRAY)
   311         -      {
   312         -	  raw_array = image_to_bgr_array (img, &size);
   313         -	  if (!raw_array)
   314         -	    {
   315         -		errmsg = "BGR ARRAY generation error";
   316         -		goto error;
   317         -	    }
   318         -      }
   319         -    if (raw_format == GAIA_BGRA_ARRAY)
   320         -      {
   321         -	  raw_array = image_to_bgra_array (-1, img, &size);
   322         -	  if (!raw_array)
   323         -	    {
   324         -		errmsg = "BGRA ARRAY generation error";
   325         -		goto error;
   326         -	    }
   327         -      }
   328         -
   329         -    image_destroy (img);
   330         -    *raw = raw_array;
   331         -    *width = img->sx;
   332         -    *height = img->sy;
   333         -    return RASTERLITE_OK;
   334         -
   335         -  error:
   336         -    fprintf (stderr, "%s\n", errmsg);
   337         -    if (img)
   338         -	image_destroy (img);
   339         -    *raw = NULL;
   340         -    *width = 0;
   341         -    *height = 0;
   342         -    return RASTERLITE_ERROR;
   343         -}
   344         -
   345         -RASTERLITE_DECLARE int
   346         -rasterliteTiffBlobToRawImage (const void *blob, int blob_size, int raw_format,
   347         -			      void **raw, int *width, int *height)
   348         -{
   349         -/* decoding a TIFF encoded image and returning a RAW image */
   350         -    void *raw_array;
   351         -    int size;
   352         -    rasterliteImagePtr img = NULL;
   353         -    char *errmsg;
   354         -
   355         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   356         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   357         -	|| raw_format == GAIA_BGRA_ARRAY)
   358         -	;
   359         -    else
   360         -      {
   361         -	  errmsg = "invalid raster RAW format";
   362         -	  goto error;
   363         -      }
   364         -
   365         -    img = image_from_tiff (blob_size, blob);
   366         -    if (!img)
   367         -      {
   368         -	  errmsg = "Tiff decoder error";
   369         -	  goto error;
   370         -      }
   371         -
   372         -    if (raw_format == GAIA_RGB_ARRAY)
   373         -      {
   374         -	  raw_array = image_to_rgb_array (img, &size);
   375         -	  if (!raw_array)
   376         -	    {
   377         -		errmsg = "RGB ARRAY generation error";
   378         -		goto error;
   379         -	    }
   380         -      }
   381         -    if (raw_format == GAIA_RGBA_ARRAY)
   382         -      {
   383         -	  raw_array = image_to_rgba_array (-1, img, &size);
   384         -	  if (!raw_array)
   385         -	    {
   386         -		errmsg = "RGBA ARRAY generation error";
   387         -		goto error;
   388         -	    }
   389         -      }
   390         -    if (raw_format == GAIA_ARGB_ARRAY)
   391         -      {
   392         -	  raw_array = image_to_argb_array (-1, img, &size);
   393         -	  if (!raw_array)
   394         -	    {
   395         -		errmsg = "ARGB ARRAY generation error";
   396         -		goto error;
   397         -	    }
   398         -      }
   399         -    if (raw_format == GAIA_BGR_ARRAY)
   400         -      {
   401         -	  raw_array = image_to_bgr_array (img, &size);
   402         -	  if (!raw_array)
   403         -	    {
   404         -		errmsg = "BGR ARRAY generation error";
   405         -		goto error;
   406         -	    }
   407         -      }
   408         -    if (raw_format == GAIA_BGRA_ARRAY)
   409         -      {
   410         -	  raw_array = image_to_bgra_array (-1, img, &size);
   411         -	  if (!raw_array)
   412         -	    {
   413         -		errmsg = "BGRA ARRAY generation error";
   414         -		goto error;
   415         -	    }
   416         -      }
   417         -
   418         -    image_destroy (img);
   419         -    *raw = raw_array;
   420         -    *width = img->sx;
   421         -    *height = img->sy;
   422         -    return RASTERLITE_OK;
   423         -
   424         -  error:
   425         -    fprintf (stderr, "%s\n", errmsg);
   426         -    if (img)
   427         -	image_destroy (img);
   428         -    *raw = NULL;
   429         -    *width = 0;
   430         -    *height = 0;
   431         -    return RASTERLITE_ERROR;
   432         -}
   433         -
   434         -RASTERLITE_DECLARE int
   435         -rasterliteRawImageToJpegFile (const void *raw, int raw_format, int width,
   436         -			      int height, const char *path, int quality)
   437         -{
   438         -/* exports a RAW image into a JPEG compressed file */
   439         -    rasterliteImagePtr img = NULL;
   440         -    void *blob = NULL;
   441         -    int blob_size;
   442         -    char *errmsg;
   443         -    int err = 0;
   444         -    FILE *out;
   445         -
   446         -    if (raw == NULL)
   447         -      {
   448         -	  errmsg = "NULL RAW image";
   449         -	  goto error;
   450         -      }
   451         -    if (width <= 0 || height <= 0)
   452         -      {
   453         -	  errmsg = "invalid RAW image width/height";
   454         -	  goto error;
   455         -      }
   456         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   457         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   458         -	|| raw_format == GAIA_BGRA_ARRAY)
   459         -	;
   460         -    else
   461         -      {
   462         -	  errmsg = "invalid raster RAW format";
   463         -	  goto error;
   464         -      }
   465         -    if (raw_format == GAIA_RGB_ARRAY)
   466         -      {
   467         -	  img = image_from_rgb_array (raw, width, height);
   468         -	  if (!img)
   469         -	    {
   470         -		errmsg = "unable to get an image from RGB ARRAY";
   471         -		goto error;
   472         -	    }
   473         -      }
   474         -    if (raw_format == GAIA_RGBA_ARRAY)
   475         -      {
   476         -	  img = image_from_rgba_array (raw, width, height);
   477         -	  if (!img)
   478         -	    {
   479         -		errmsg = "unable to get an image from RGBA ARRAY";
   480         -		goto error;
   481         -	    }
   482         -      }
   483         -    if (raw_format == GAIA_ARGB_ARRAY)
   484         -      {
   485         -	  img = image_from_argb_array (raw, width, height);
   486         -	  if (!img)
   487         -	    {
   488         -		errmsg = "unable to get an image from ARGB ARRAY";
   489         -		goto error;
   490         -	    }
   491         -      }
   492         -    if (raw_format == GAIA_BGR_ARRAY)
   493         -      {
   494         -	  img = image_from_bgr_array (raw, width, height);
   495         -	  if (!img)
   496         -	    {
   497         -		errmsg = "unable to get an image from BGR ARRAY";
   498         -		goto error;
   499         -	    }
   500         -      }
   501         -    if (raw_format == GAIA_BGRA_ARRAY)
   502         -      {
   503         -	  img = image_from_bgra_array (raw, width, height);
   504         -	  if (!img)
   505         -	    {
   506         -		errmsg = "unable to get an image from BGRA ARRAY";
   507         -		goto error;
   508         -	    }
   509         -      }
   510         -
   511         -/* compressing as JPEG */
   512         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   513         -	blob = image_to_jpeg_grayscale (img, &blob_size, quality);
   514         -    else
   515         -	blob = image_to_jpeg (img, &blob_size, quality);
   516         -    if (!blob)
   517         -      {
   518         -	  errmsg = "Jpeg encoder error";
   519         -	  goto error;
   520         -      }
   521         -
   522         -/* exporting to file */
   523         -    out = fopen (path, "wb");
   524         -    if (out == NULL)
   525         -      {
   526         -	  errmsg = "Unable to create output image";
   527         -	  goto error;
   528         -      }
   529         -    if (fwrite (blob, 1, blob_size, out) != (size_t) blob_size)
   530         -	err = 1;
   531         -    fclose (out);
   532         -    if (err)
   533         -      {
   534         -	  unlink (path);
   535         -	  goto error;
   536         -      }
   537         -    free (blob);
   538         -    image_destroy (img);
   539         -    return RASTERLITE_OK;
   540         -
   541         -  error:
   542         -    fprintf (stderr, "%s\n", errmsg);
   543         -    if (img)
   544         -	image_destroy (img);
   545         -    if (blob)
   546         -	free (blob);
   547         -    return RASTERLITE_ERROR;
   548         -}
   549         -
   550         -RASTERLITE_DECLARE unsigned char *
   551         -rasterliteRawImageToJpegMemBuf (const void *raw, int raw_format, int width,
   552         -				int height, int *size, int quality)
   553         -{
   554         -/* exports a RAW image into a JPEG compressed memory buffer */
   555         -    rasterliteImagePtr img = NULL;
   556         -    void *blob = NULL;
   557         -    int blob_size;
   558         -    char *errmsg;
   559         -
   560         -    if (raw == NULL)
   561         -      {
   562         -	  errmsg = "NULL RAW image";
   563         -	  goto error;
   564         -      }
   565         -    if (width <= 0 || height <= 0)
   566         -      {
   567         -	  errmsg = "invalid RAW image width/height";
   568         -	  goto error;
   569         -      }
   570         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   571         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   572         -	|| raw_format == GAIA_BGRA_ARRAY)
   573         -	;
   574         -    else
   575         -      {
   576         -	  errmsg = "invalid raster RAW format";
   577         -	  goto error;
   578         -      }
   579         -    if (raw_format == GAIA_RGB_ARRAY)
   580         -      {
   581         -	  img = image_from_rgb_array (raw, width, height);
   582         -	  if (!img)
   583         -	    {
   584         -		errmsg = "unable to get an image from RGB ARRAY";
   585         -		goto error;
   586         -	    }
   587         -      }
   588         -    if (raw_format == GAIA_RGBA_ARRAY)
   589         -      {
   590         -	  img = image_from_rgba_array (raw, width, height);
   591         -	  if (!img)
   592         -	    {
   593         -		errmsg = "unable to get an image from RGBA ARRAY";
   594         -		goto error;
   595         -	    }
   596         -      }
   597         -    if (raw_format == GAIA_ARGB_ARRAY)
   598         -      {
   599         -	  img = image_from_argb_array (raw, width, height);
   600         -	  if (!img)
   601         -	    {
   602         -		errmsg = "unable to get an image from ARGB ARRAY";
   603         -		goto error;
   604         -	    }
   605         -      }
   606         -    if (raw_format == GAIA_BGR_ARRAY)
   607         -      {
   608         -	  img = image_from_bgr_array (raw, width, height);
   609         -	  if (!img)
   610         -	    {
   611         -		errmsg = "unable to get an image from BGR ARRAY";
   612         -		goto error;
   613         -	    }
   614         -      }
   615         -    if (raw_format == GAIA_BGRA_ARRAY)
   616         -      {
   617         -	  img = image_from_bgra_array (raw, width, height);
   618         -	  if (!img)
   619         -	    {
   620         -		errmsg = "unable to get an image from BGRA ARRAY";
   621         -		goto error;
   622         -	    }
   623         -      }
   624         -
   625         -/* compressing as JPEG */
   626         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   627         -	blob = image_to_jpeg_grayscale (img, &blob_size, quality);
   628         -    else
   629         -	blob = image_to_jpeg (img, &blob_size, quality);
   630         -    if (!blob)
   631         -      {
   632         -	  errmsg = "Jpeg encoder error";
   633         -	  goto error;
   634         -      }
   635         -
   636         -/* exporting the memory buffer */
   637         -    image_destroy (img);
   638         -    *size = blob_size;
   639         -    return blob;
   640         -
   641         -  error:
   642         -    fprintf (stderr, "%s\n", errmsg);
   643         -    if (img)
   644         -	image_destroy (img);
   645         -    if (blob)
   646         -	free (blob);
   647         -    *size = 0;
   648         -    return NULL;
   649         -}
   650         -
   651         -RASTERLITE_DECLARE int
   652         -rasterliteRawImageToPngFile (const void *raw, int raw_format, int width,
   653         -			     int height, const char *path)
   654         -{
   655         -/* exports a RAW image into a PNG compressed file */
   656         -    rasterliteImagePtr img = NULL;
   657         -    void *blob = NULL;
   658         -    int blob_size;
   659         -    char *errmsg;
   660         -    int err = 0;
   661         -    FILE *out;
   662         -
   663         -    if (raw == NULL)
   664         -      {
   665         -	  errmsg = "NULL RAW image";
   666         -	  goto error;
   667         -      }
   668         -    if (width <= 0 || height <= 0)
   669         -      {
   670         -	  errmsg = "invalid RAW image width/height";
   671         -	  goto error;
   672         -      }
   673         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   674         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   675         -	|| raw_format == GAIA_BGRA_ARRAY)
   676         -	;
   677         -    else
   678         -      {
   679         -	  errmsg = "invalid raster RAW format";
   680         -	  goto error;
   681         -      }
   682         -    if (raw_format == GAIA_RGB_ARRAY)
   683         -      {
   684         -	  img = image_from_rgb_array (raw, width, height);
   685         -	  if (!img)
   686         -	    {
   687         -		errmsg = "unable to get an image from RGB ARRAY";
   688         -		goto error;
   689         -	    }
   690         -      }
   691         -    if (raw_format == GAIA_RGBA_ARRAY)
   692         -      {
   693         -	  img = image_from_rgba_array (raw, width, height);
   694         -	  if (!img)
   695         -	    {
   696         -		errmsg = "unable to get an image from RGBA ARRAY";
   697         -		goto error;
   698         -	    }
   699         -      }
   700         -    if (raw_format == GAIA_ARGB_ARRAY)
   701         -      {
   702         -	  img = image_from_argb_array (raw, width, height);
   703         -	  if (!img)
   704         -	    {
   705         -		errmsg = "unable to get an image from ARGB ARRAY";
   706         -		goto error;
   707         -	    }
   708         -      }
   709         -    if (raw_format == GAIA_BGR_ARRAY)
   710         -      {
   711         -	  img = image_from_bgr_array (raw, width, height);
   712         -	  if (!img)
   713         -	    {
   714         -		errmsg = "unable to get an image from BGR ARRAY";
   715         -		goto error;
   716         -	    }
   717         -      }
   718         -    if (raw_format == GAIA_BGRA_ARRAY)
   719         -      {
   720         -	  img = image_from_bgra_array (raw, width, height);
   721         -	  if (!img)
   722         -	    {
   723         -		errmsg = "unable to get an image from BGRA ARRAY";
   724         -		goto error;
   725         -	    }
   726         -      }
   727         -
   728         -/* compressing as PNG */
   729         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   730         -	blob = image_to_png_grayscale (img, &blob_size);
   731         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
   732         -	blob = image_to_png_palette (img, &blob_size);
   733         -    else
   734         -	blob = image_to_png_rgb (img, &blob_size);
   735         -    if (!blob)
   736         -      {
   737         -	  errmsg = "Png encoder error";
   738         -	  goto error;
   739         -      }
   740         -
   741         -/* exporting to file */
   742         -    out = fopen (path, "wb");
   743         -    if (out == NULL)
   744         -      {
   745         -	  errmsg = "Unable to create output image";
   746         -	  goto error;
   747         -      }
   748         -    if (fwrite (blob, 1, blob_size, out) != (size_t) blob_size)
   749         -	err = 1;
   750         -    fclose (out);
   751         -    if (err)
   752         -      {
   753         -	  unlink (path);
   754         -	  goto error;
   755         -      }
   756         -    free (blob);
   757         -    image_destroy (img);
   758         -    return RASTERLITE_OK;
   759         -
   760         -  error:
   761         -    fprintf (stderr, "%s\n", errmsg);
   762         -    if (img)
   763         -	image_destroy (img);
   764         -    if (blob)
   765         -	free (blob);
   766         -    return RASTERLITE_ERROR;
   767         -}
   768         -
   769         -RASTERLITE_DECLARE unsigned char *
   770         -rasterliteRawImageToPngMemBuf (const void *raw, int raw_format, int width,
   771         -			       int height, int *size)
   772         -{
   773         -/* exports a RAW image into a PNG compressed memory buffer */
   774         -    rasterliteImagePtr img = NULL;
   775         -    void *blob = NULL;
   776         -    int blob_size;
   777         -    char *errmsg;
   778         -
   779         -    if (raw == NULL)
   780         -      {
   781         -	  errmsg = "NULL RAW image";
   782         -	  goto error;
   783         -      }
   784         -    if (width <= 0 || height <= 0)
   785         -      {
   786         -	  errmsg = "invalid RAW image width/height";
   787         -	  goto error;
   788         -      }
   789         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   790         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   791         -	|| raw_format == GAIA_BGRA_ARRAY)
   792         -	;
   793         -    else
   794         -      {
   795         -	  errmsg = "invalid raster RAW format";
   796         -	  goto error;
   797         -      }
   798         -    if (raw_format == GAIA_RGB_ARRAY)
   799         -      {
   800         -	  img = image_from_rgb_array (raw, width, height);
   801         -	  if (!img)
   802         -	    {
   803         -		errmsg = "unable to get an image from RGB ARRAY";
   804         -		goto error;
   805         -	    }
   806         -      }
   807         -    if (raw_format == GAIA_RGBA_ARRAY)
   808         -      {
   809         -	  img = image_from_rgba_array (raw, width, height);
   810         -	  if (!img)
   811         -	    {
   812         -		errmsg = "unable to get an image from RGBA ARRAY";
   813         -		goto error;
   814         -	    }
   815         -      }
   816         -    if (raw_format == GAIA_ARGB_ARRAY)
   817         -      {
   818         -	  img = image_from_argb_array (raw, width, height);
   819         -	  if (!img)
   820         -	    {
   821         -		errmsg = "unable to get an image from ARGB ARRAY";
   822         -		goto error;
   823         -	    }
   824         -      }
   825         -    if (raw_format == GAIA_BGR_ARRAY)
   826         -      {
   827         -	  img = image_from_bgr_array (raw, width, height);
   828         -	  if (!img)
   829         -	    {
   830         -		errmsg = "unable to get an image from BGR ARRAY";
   831         -		goto error;
   832         -	    }
   833         -      }
   834         -    if (raw_format == GAIA_BGRA_ARRAY)
   835         -      {
   836         -	  img = image_from_bgra_array (raw, width, height);
   837         -	  if (!img)
   838         -	    {
   839         -		errmsg = "unable to get an image from BGRA ARRAY";
   840         -		goto error;
   841         -	    }
   842         -      }
   843         -
   844         -/* compressing as PNG */
   845         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   846         -	blob = image_to_png_grayscale (img, &blob_size);
   847         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
   848         -	blob = image_to_png_palette (img, &blob_size);
   849         -    else
   850         -	blob = image_to_png_rgb (img, &blob_size);
   851         -    if (!blob)
   852         -      {
   853         -	  errmsg = "Png encoder error";
   854         -	  goto error;
   855         -      }
   856         -
   857         -/* exporting the memory buffer */
   858         -    image_destroy (img);
   859         -    *size = blob_size;
   860         -    return blob;
   861         -
   862         -  error:
   863         -    fprintf (stderr, "%s\n", errmsg);
   864         -    if (img)
   865         -	image_destroy (img);
   866         -    if (blob)
   867         -	free (blob);
   868         -    *size = 0;
   869         -    return NULL;
   870         -}
   871         -
   872         -RASTERLITE_DECLARE int
   873         -rasterliteRawImageToGifFile (const void *raw, int raw_format, int width,
   874         -			     int height, const char *path)
   875         -{
   876         -/* exports a RAW image into a GIF compressed file */
   877         -    rasterliteImagePtr img = NULL;
   878         -    void *blob = NULL;
   879         -    int blob_size;
   880         -    char *errmsg;
   881         -    int err = 0;
   882         -    FILE *out;
   883         -
   884         -    if (raw == NULL)
   885         -      {
   886         -	  errmsg = "NULL RAW image";
   887         -	  goto error;
   888         -      }
   889         -    if (width <= 0 || height <= 0)
   890         -      {
   891         -	  errmsg = "invalid RAW image width/height";
   892         -	  goto error;
   893         -      }
   894         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   895         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   896         -	|| raw_format == GAIA_BGRA_ARRAY)
   897         -	;
   898         -    else
   899         -      {
   900         -	  errmsg = "invalid raster RAW format";
   901         -	  goto error;
   902         -      }
   903         -    if (raw_format == GAIA_RGB_ARRAY)
   904         -      {
   905         -	  img = image_from_rgb_array (raw, width, height);
   906         -	  if (!img)
   907         -	    {
   908         -		errmsg = "unable to get an image from RGB ARRAY";
   909         -		goto error;
   910         -	    }
   911         -      }
   912         -    if (raw_format == GAIA_RGBA_ARRAY)
   913         -      {
   914         -	  img = image_from_rgba_array (raw, width, height);
   915         -	  if (!img)
   916         -	    {
   917         -		errmsg = "unable to get an image from RGBA ARRAY";
   918         -		goto error;
   919         -	    }
   920         -      }
   921         -    if (raw_format == GAIA_ARGB_ARRAY)
   922         -      {
   923         -	  img = image_from_argb_array (raw, width, height);
   924         -	  if (!img)
   925         -	    {
   926         -		errmsg = "unable to get an image from ARGB ARRAY";
   927         -		goto error;
   928         -	    }
   929         -      }
   930         -    if (raw_format == GAIA_BGR_ARRAY)
   931         -      {
   932         -	  img = image_from_bgr_array (raw, width, height);
   933         -	  if (!img)
   934         -	    {
   935         -		errmsg = "unable to get an image from BGR ARRAY";
   936         -		goto error;
   937         -	    }
   938         -      }
   939         -    if (raw_format == GAIA_BGRA_ARRAY)
   940         -      {
   941         -	  img = image_from_bgra_array (raw, width, height);
   942         -	  if (!img)
   943         -	    {
   944         -		errmsg = "unable to get an image from BGRA ARRAY";
   945         -		goto error;
   946         -	    }
   947         -      }
   948         -
   949         -/* compressing as GIF */
   950         -    if (is_image_palette256 (img) == RASTERLITE_FALSE)
   951         -	image_resample_as_palette256 (img);
   952         -
   953         -    blob = image_to_gif (img, &blob_size);
   954         -    if (!blob)
   955         -      {
   956         -	  errmsg = "Gif encoder error";
   957         -	  goto error;
   958         -      }
   959         -
   960         -/* exporting to file */
   961         -    out = fopen (path, "wb");
   962         -    if (out == NULL)
   963         -      {
   964         -	  errmsg = "Unable to create output image";
   965         -	  goto error;
   966         -      }
   967         -    if (fwrite (blob, 1, blob_size, out) != (size_t) blob_size)
   968         -	err = 1;
   969         -    fclose (out);
   970         -    if (err)
   971         -      {
   972         -	  unlink (path);
   973         -	  goto error;
   974         -      }
   975         -    free (blob);
   976         -    image_destroy (img);
   977         -    return RASTERLITE_OK;
   978         -
   979         -  error:
   980         -    fprintf (stderr, "%s\n", errmsg);
   981         -    if (img)
   982         -	image_destroy (img);
   983         -    if (blob)
   984         -	free (blob);
   985         -    return RASTERLITE_ERROR;
   986         -}
   987         -
   988         -RASTERLITE_DECLARE unsigned char *
   989         -rasterliteRawImageToGifMemBuf (const void *raw, int raw_format, int width,
   990         -			       int height, int *size)
   991         -{
   992         -/* exports a RAW image into a GIF compressed memory buffer */
   993         -    rasterliteImagePtr img = NULL;
   994         -    void *blob = NULL;
   995         -    int blob_size;
   996         -    char *errmsg;
   997         -
   998         -    if (raw == NULL)
   999         -      {
  1000         -	  errmsg = "NULL RAW image";
  1001         -	  goto error;
  1002         -      }
  1003         -    if (width <= 0 || height <= 0)
  1004         -      {
  1005         -	  errmsg = "invalid RAW image width/height";
  1006         -	  goto error;
  1007         -      }
  1008         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
  1009         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
  1010         -	|| raw_format == GAIA_BGRA_ARRAY)
  1011         -	;
  1012         -    else
  1013         -      {
  1014         -	  errmsg = "invalid raster RAW format";
  1015         -	  goto error;
  1016         -      }
  1017         -    if (raw_format == GAIA_RGB_ARRAY)
  1018         -      {
  1019         -	  img = image_from_rgb_array (raw, width, height);
  1020         -	  if (!img)
  1021         -	    {
  1022         -		errmsg = "unable to get an image from RGB ARRAY";
  1023         -		goto error;
  1024         -	    }
  1025         -      }
  1026         -    if (raw_format == GAIA_RGBA_ARRAY)
  1027         -      {
  1028         -	  img = image_from_rgba_array (raw, width, height);
  1029         -	  if (!img)
  1030         -	    {
  1031         -		errmsg = "unable to get an image from RGBA ARRAY";
  1032         -		goto error;
  1033         -	    }
  1034         -      }
  1035         -    if (raw_format == GAIA_ARGB_ARRAY)
  1036         -      {
  1037         -	  img = image_from_argb_array (raw, width, height);
  1038         -	  if (!img)
  1039         -	    {
  1040         -		errmsg = "unable to get an image from ARGB ARRAY";
  1041         -		goto error;
  1042         -	    }
  1043         -      }
  1044         -    if (raw_format == GAIA_BGR_ARRAY)
  1045         -      {
  1046         -	  img = image_from_bgr_array (raw, width, height);
  1047         -	  if (!img)
  1048         -	    {
  1049         -		errmsg = "unable to get an image from BGR ARRAY";
  1050         -		goto error;
  1051         -	    }
  1052         -      }
  1053         -    if (raw_format == GAIA_BGRA_ARRAY)
  1054         -      {
  1055         -	  img = image_from_bgra_array (raw, width, height);
  1056         -	  if (!img)
  1057         -	    {
  1058         -		errmsg = "unable to get an image from BGRA ARRAY";
  1059         -		goto error;
  1060         -	    }
  1061         -      }
  1062         -
  1063         -/* compressing as GIF */
  1064         -    if (is_image_palette256 (img) == RASTERLITE_FALSE)
  1065         -	image_resample_as_palette256 (img);
  1066         -
  1067         -    blob = image_to_gif (img, &blob_size);
  1068         -    if (!blob)
  1069         -      {
  1070         -	  errmsg = "Gif encoder error";
  1071         -	  goto error;
  1072         -      }
  1073         -
  1074         -/* exporting the memory buffer */
  1075         -    image_destroy (img);
  1076         -    *size = blob_size;
  1077         -    return blob;
  1078         -
  1079         -  error:
  1080         -    fprintf (stderr, "%s\n", errmsg);
  1081         -    if (img)
  1082         -	image_destroy (img);
  1083         -    if (blob)
  1084         -	free (blob);
  1085         -    *size = 0;
  1086         -    return NULL;
  1087         -}
  1088         -
  1089         -RASTERLITE_DECLARE int
  1090         -rasterliteRawImageToGeoTiffFile (const void *raw, int raw_format, int width,
  1091         -				 int height, const char *path, double x_size,
  1092         -				 double y_size, double xllcorner,
  1093         -				 double yllcorner, const char *proj4text)
  1094         -{
  1095         -/* exports a RAW image into a TIFF encoded file */
  1096         -    rasterliteImagePtr img = NULL;
  1097         -    void *blob = NULL;
  1098         -    int blob_size;
  1099         -    char *errmsg;
  1100         -
  1101         -    if (raw == NULL)
  1102         -      {
  1103         -	  errmsg = "NULL RAW image";
  1104         -	  goto error;
  1105         -      }
  1106         -    if (width <= 0 || height <= 0)
  1107         -      {
  1108         -	  errmsg = "invalid RAW image width/height";
  1109         -	  goto error;
  1110         -      }
  1111         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
  1112         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
  1113         -	|| raw_format == GAIA_BGRA_ARRAY)
  1114         -	;
  1115         -    else
  1116         -      {
  1117         -	  errmsg = "invalid raster RAW format";
  1118         -	  goto error;
  1119         -      }
  1120         -    if (raw_format == GAIA_RGB_ARRAY)
  1121         -      {
  1122         -	  img = image_from_rgb_array (raw, width, height);
  1123         -	  if (!img)
  1124         -	    {
  1125         -		errmsg = "unable to get an image from RGB ARRAY";
  1126         -		goto error;
  1127         -	    }
  1128         -      }
  1129         -    if (raw_format == GAIA_RGBA_ARRAY)
  1130         -      {
  1131         -	  img = image_from_rgba_array (raw, width, height);
  1132         -	  if (!img)
  1133         -	    {
  1134         -		errmsg = "unable to get an image from RGBA ARRAY";
  1135         -		goto error;
  1136         -	    }
  1137         -      }
  1138         -    if (raw_format == GAIA_ARGB_ARRAY)
  1139         -      {
  1140         -	  img = image_from_argb_array (raw, width, height);
  1141         -	  if (!img)
  1142         -	    {
  1143         -		errmsg = "unable to get an image from ARGB ARRAY";
  1144         -		goto error;
  1145         -	    }
  1146         -      }
  1147         -    if (raw_format == GAIA_BGR_ARRAY)
  1148         -      {
  1149         -	  img = image_from_bgr_array (raw, width, height);
  1150         -	  if (!img)
  1151         -	    {
  1152         -		errmsg = "unable to get an image from BGR ARRAY";
  1153         -		goto error;
  1154         -	    }
  1155         -      }
  1156         -    if (raw_format == GAIA_BGRA_ARRAY)
  1157         -      {
  1158         -	  img = image_from_bgra_array (raw, width, height);
  1159         -	  if (!img)
  1160         -	    {
  1161         -		errmsg = "unable to get an image from BGRA ARRAY";
  1162         -		goto error;
  1163         -	    }
  1164         -      }
  1165         -
  1166         -/* encoding as TIFF */
  1167         -    if (is_image_monochrome (img) == RASTERLITE_TRUE)
  1168         -	blob = image_to_tiff_fax4 (img, &blob_size);
  1169         -    else if (is_image_grayscale (img) == RASTERLITE_TRUE)
  1170         -	blob = image_to_tiff_grayscale (img, &blob_size);
  1171         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
  1172         -	blob = image_to_tiff_palette (img, &blob_size);
  1173         -    else
  1174         -	blob = image_to_tiff_rgb (img, &blob_size);
  1175         -    if (!blob)
  1176         -      {
  1177         -	  errmsg = "Tiff encoder error";
  1178         -	  goto error;
  1179         -      }
  1180         -
  1181         -/* exporting to file as GeoTiff */
  1182         -    if (!write_geotiff
  1183         -	(path, blob, blob_size, x_size, y_size, xllcorner, yllcorner,
  1184         -	 proj4text))
  1185         -      {
  1186         -	  errmsg = "Unable to create output image";
  1187         -	  goto error;
  1188         -      }
  1189         -    free (blob);
  1190         -    image_destroy (img);
  1191         -    return RASTERLITE_OK;
  1192         -
  1193         -  error:
  1194         -    fprintf (stderr, "%s\n", errmsg);
  1195         -    if (img)
  1196         -	image_destroy (img);
  1197         -    if (blob)
  1198         -	free (blob);
  1199         -    return RASTERLITE_ERROR;
  1200         -}
  1201         -
  1202         -RASTERLITE_DECLARE unsigned char *
  1203         -rasterliteRawImageToTiffMemBuf (const void *raw, int raw_format, int width,
  1204         -				int height, int *size)
  1205         -{
  1206         -/* exports a RAW image into a TIFF encoded memory buffer */
  1207         -    rasterliteImagePtr img = NULL;
  1208         -    void *blob = NULL;
  1209         -    int blob_size;
  1210         -    char *errmsg;
  1211         -
  1212         -    if (raw == NULL)
  1213         -      {
  1214         -	  errmsg = "NULL RAW image";
  1215         -	  goto error;
  1216         -      }
  1217         -    if (width <= 0 || height <= 0)
  1218         -      {
  1219         -	  errmsg = "invalid RAW image width/height";
  1220         -	  goto error;
  1221         -      }
  1222         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
  1223         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
  1224         -	|| raw_format == GAIA_BGRA_ARRAY)
  1225         -	;
  1226         -    else
  1227         -      {
  1228         -	  errmsg = "invalid raster RAW format";
  1229         -	  goto error;
  1230         -      }
  1231         -    if (raw_format == GAIA_RGB_ARRAY)
  1232         -      {
  1233         -	  img = image_from_rgb_array (raw, width, height);
  1234         -	  if (!img)
  1235         -	    {
  1236         -		errmsg = "unable to get an image from RGB ARRAY";
  1237         -		goto error;
  1238         -	    }
  1239         -      }
  1240         -    if (raw_format == GAIA_RGBA_ARRAY)
  1241         -      {
  1242         -	  img = image_from_rgba_array (raw, width, height);
  1243         -	  if (!img)
  1244         -	    {
  1245         -		errmsg = "unable to get an image from RGBA ARRAY";
  1246         -		goto error;
  1247         -	    }
  1248         -      }
  1249         -    if (raw_format == GAIA_ARGB_ARRAY)
  1250         -      {
  1251         -	  img = image_from_argb_array (raw, width, height);
  1252         -	  if (!img)
  1253         -	    {
  1254         -		errmsg = "unable to get an image from ARGB ARRAY";
  1255         -		goto error;
  1256         -	    }
  1257         -      }
  1258         -    if (raw_format == GAIA_BGR_ARRAY)
  1259         -      {
  1260         -	  img = image_from_bgr_array (raw, width, height);
  1261         -	  if (!img)
  1262         -	    {
  1263         -		errmsg = "unable to get an image from BGR ARRAY";
  1264         -		goto error;
  1265         -	    }
  1266         -      }
  1267         -    if (raw_format == GAIA_BGRA_ARRAY)
  1268         -      {
  1269         -	  img = image_from_bgra_array (raw, width, height);
  1270         -	  if (!img)
  1271         -	    {
  1272         -		errmsg = "unable to get an image from BGRA ARRAY";
  1273         -		goto error;
  1274         -	    }
  1275         -      }
  1276         -
  1277         -/* encoding as TIFF */
  1278         -    if (is_image_monochrome (img) == RASTERLITE_TRUE)
  1279         -	blob = image_to_tiff_fax4 (img, &blob_size);
  1280         -    else if (is_image_grayscale (img) == RASTERLITE_TRUE)
  1281         -	blob = image_to_tiff_grayscale (img, &blob_size);
  1282         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
  1283         -	blob = image_to_tiff_palette (img, &blob_size);
  1284         -    else
  1285         -	blob = image_to_tiff_rgb (img, &blob_size);
  1286         -    if (!blob)
  1287         -      {
  1288         -	  errmsg = "Tiff encoder error";
  1289         -	  goto error;
  1290         -      }
  1291         -
  1292         -/* exporting the memory buffer */
  1293         -    image_destroy (img);
  1294         -    *size = blob_size;
  1295         -    return blob;
  1296         -
  1297         -  error:
  1298         -    fprintf (stderr, "%s\n", errmsg);
  1299         -    if (img)
  1300         -	image_destroy (img);
  1301         -    if (blob)
  1302         -	free (blob);
  1303         -    *size = 0;
  1304         -    return NULL;
  1305         -}

Changes to lib/rasterlite_gif.c.

     1      1   /* 
     2      2   / rasterlite_gif.c
     3      3   /
     4      4   / GIF auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50     27   #include <stdio.h>
    51     28   #include <math.h>
    52     29   #include <string.h>
    53     30   #include <stdlib.h>
    54     31   
    55         -#include <tiffio.h>
    56         -
    57         -#ifdef SPATIALITE_AMALGAMATION
    58     32   #include <spatialite/sqlite3.h>
    59         -#else
    60         -#include <sqlite3.h>
    61         -#endif
    62         -
    63     33   #include <spatialite/gaiageo.h>
           34  +
           35  +#include <tiffio.h>
    64     36   
    65     37   #include "rasterlite_internals.h"
    66     38   
    67     39   /* 
    68     40   /
    69     41   / DISCLAIMER:
    70     42   / all the following code merely is an 'ad hoc' adaption
................................................................................
   108     80   
   109     81   #define maxmaxcode ((code_int)1 << GIFBITS)
   110     82   
   111     83   #define HSIZE  5003
   112     84   #define hsize HSIZE
   113     85   
   114     86   #ifdef COMPATIBLE
   115         -#define MAXCODE(n_bits)        ((code_int) 1 << (n_bits) - 1)
           87  +# define MAXCODE(n_bits)        ((code_int) 1 << (n_bits) - 1)
   116     88   #else /*COMPATIBLE*/
   117         -#define MAXCODE(n_bits)        (((code_int) 1 << (n_bits)) - 1)
           89  +# define MAXCODE(n_bits)        (((code_int) 1 << (n_bits)) - 1)
   118     90   #endif /*COMPATIBLE*/
   119     91   #define HashTabOf(i)       ctx->htab[i]
   120     92   #define CodeTabOf(i)    ctx->codetab[i]
   121     93       typedef struct
   122     94   {
   123     95       int Width, Height;
   124     96       int curx, cury;
................................................................................
   392    364   {
   393    365       int rv;
   394    366       rv = LWZReadByte_ (fd, sd, flag, input_code_size, ZeroDataBlockP);
   395    367       return (rv);
   396    368   }
   397    369   
   398    370   static void
   399         -ReadImage (rasterliteImagePtr im, xgdIOCtx * fd, int len, int height,
          371  +ReadImage (rasterliteImagePrt im, xgdIOCtx * fd, int len, int height,
   400    372   	   unsigned char (*cmap)[256], int interlace, int *ZeroDataBlockP)
   401    373   {
   402    374       unsigned char c;
   403    375       int v;
   404    376       int xpos = 0, ypos = 0, pass = 0;
   405    377       int i;
   406    378       int red[256];
................................................................................
   549    521   		      break;
   550    522   		  }
   551    523   	    }
   552    524         }
   553    525   }
   554    526   
   555    527   static int
   556         -GIFNextPixel (rasterliteImagePtr img, GifCtx * ctx)
          528  +GIFNextPixel (rasterliteImagePrt img, GifCtx * ctx)
   557    529   {
   558    530       int r;
   559    531       int **ptpixels = img->pixels;
   560    532       int *pThisRow;
   561    533       if (ctx->CountDown == 0)
   562    534   	return EOF;
   563    535       --(ctx->CountDown);
   564    536   
   565    537       pThisRow = *(ptpixels + ctx->cury);
   566    538       r = *(pThisRow + ctx->curx);
   567    539       BumpPixel (ctx);
   568    540       return r;
   569    541   }
   570         -
   571    542   static void
   572    543   xgdPutC (const unsigned char c, xgdIOCtx * ctx)
   573    544   {
   574    545       (ctx->putC) (ctx, c);
   575    546   }
   576    547   
   577    548   static void
................................................................................
   698    669   {
   699    670       xgdPutC (w & 0xFF, out);
   700    671       xgdPutC ((w >> 8) & 0xFF, out);
   701    672       return 0;
   702    673   }
   703    674   
   704    675   static void
   705         -GIFcompress (int init_bits, xgdIOCtxPtr outfile, rasterliteImagePtr img,
          676  +GIFcompress (int init_bits, xgdIOCtxPtr outfile, rasterliteImagePrt img,
   706    677   	     GifCtx * ctx)
   707    678   {
   708    679   /*
   709    680    * compress stdin to stdout
   710    681    *
   711    682    * Algorithm:  use open addressing double hashing (no chaining) on the
   712    683    * prefix code / next character combination.  We do a variant of Knuth's
................................................................................
   797    768       ++(ctx->out_count);
   798    769       output ((code_int) ctx->EOFCode, ctx);
   799    770   }
   800    771   
   801    772   static void
   802    773   GIFEncode (xgdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace,
   803    774   	   int Background, int Transparent, int BitsPerPixel, int *Red,
   804         -	   int *Green, int *Blue, rasterliteImagePtr img)
          775  +	   int *Green, int *Blue, rasterliteImagePrt img)
   805    776   {
   806    777       int B;
   807    778       int RWidth, RHeight;
   808    779       int LeftOfs, TopOfs;
   809    780       int Resolution;
   810    781       int ColorMapSize;
   811    782       int InitCodeSize;
................................................................................
   887    858       else if (colors <= 128)
   888    859   	bpp = 7;
   889    860       else if (colors <= 256)
   890    861   	bpp = 8;
   891    862       return bpp;
   892    863   }
   893    864   
   894         -static rasterliteImagePtr
          865  +static rasterliteImagePrt
   895    866   xgdImageCreateFromGifCtx (xgdIOCtxPtr fd)
   896    867   {
   897    868       int BitPixel;
   898    869       int Transparent = (-1);
   899    870       unsigned char buf[16];
   900    871       unsigned char c;
   901    872       unsigned char ColorMap[3][MAXCOLORMAPSIZE];
   902    873       unsigned char localColorMap[3][MAXCOLORMAPSIZE];
   903    874       int imw, imh, screen_width, screen_height;
   904    875       int gif87a, useGlobalColormap;
   905    876       int bitPixel;
   906    877       int ZeroDataBlock = FALSE;
   907    878       int haveGlobalColormap;
   908         -    rasterliteImagePtr im = 0;
          879  +    rasterliteImagePrt im = 0;
   909    880       if (!ReadOK (fd, buf, 6))
   910    881         {
   911    882   	  return 0;
   912    883         }
   913    884       if (strncmp ((char *) buf, "GIF", 3) != 0)
   914    885         {
   915    886   	  return 0;
................................................................................
  1013    984         {
  1014    985   	  return 0;
  1015    986         }
  1016    987       return im;
  1017    988   }
  1018    989   
  1019    990   static void
  1020         -xgdImageGifCtx (rasterliteImagePtr img, xgdIOCtxPtr out)
          991  +xgdImageGifCtx (rasterliteImagePrt img, xgdIOCtxPtr out)
  1021    992   {
  1022    993       int BitsPerPixel;
  1023    994       int mapping[256];
  1024    995       int Red[256];
  1025    996       int Green[256];
  1026    997       int Blue[256];
  1027    998       int i, j, colors;
................................................................................
  1053   1024         }
  1054   1025       BitsPerPixel = colorstobpp (colors);
  1055   1026       GIFEncode (out, img->sx, img->sy, 0, 0, -1, BitsPerPixel, Red, Green, Blue,
  1056   1027   	       img);
  1057   1028   }
  1058   1029   
  1059   1030   extern void *
  1060         -image_to_gif (const rasterliteImagePtr img, int *size)
         1031  +image_to_gif (const rasterliteImagePrt img, int *size)
  1061   1032   {
  1062   1033   /* compressing an image as GIF */
  1063   1034       void *rv;
  1064   1035       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
  1065   1036       xgdImageGifCtx (img, out);
  1066   1037       rv = xgdDPExtractData (out, size);
  1067   1038       out->xgd_free (out);
  1068   1039       return rv;
  1069   1040   }
  1070   1041   
  1071         -extern rasterliteImagePtr
         1042  +extern rasterliteImagePrt
  1072   1043   image_from_gif (int size, const void *data)
  1073   1044   {
  1074   1045   /* uncompressing a GIF */
  1075         -    rasterliteImagePtr img;
         1046  +    rasterliteImagePrt img;
  1076   1047       xgdIOCtx *in = xgdNewDynamicCtxEx (size, data, 0);
  1077   1048       img = xgdImageCreateFromGifCtx (in);
  1078   1049       img->color_space = COLORSPACE_PALETTE;
  1079   1050       in->xgd_free (in);
  1080   1051       return img;
  1081   1052   }

Changes to lib/rasterlite_image.c.

     1      1   /* 
     2      2   / rasterlite_image.c
     3      3   /
     4      4   / image methods
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50     27   #include <stdio.h>
    51     28   #include <stdlib.h>
    52     29   #include <string.h>
    53         -#include <float.h>
    54     30   #include <limits.h>
    55     31   
    56     32   #include <tiffio.h>
    57         -
    58         -#ifdef SPATIALITE_AMALGAMATION
    59     33   #include <spatialite/sqlite3.h>
    60         -#else
    61         -#include <sqlite3.h>
    62         -#endif
    63         -
    64     34   #include <spatialite/gaiageo.h>
    65     35   
    66     36   #include "rasterlite_internals.h"
    67     37   
    68         -extern rasterliteImagePtr
           38  +extern rasterliteImagePrt
    69     39   image_create (int sx, int sy)
    70     40   {
    71     41   /*
    72     42   / creating a generic RGB image
    73     43   / vaguely inspired by GD lib
    74     44   */
    75     45       int i;
    76     46       int i2;
    77         -    rasterliteImagePtr img;
           47  +    rasterliteImagePrt img;
    78     48       img = malloc (sizeof (rasterliteImage));
    79     49       if (!img)
    80     50   	return NULL;
    81     51       img->pixels = NULL;
    82     52       img->sx = sx;
    83     53       img->sy = sy;
    84     54       img->color_space = COLORSPACE_RGB;
................................................................................
   100     70   		return NULL;
   101     71   	    }
   102     72         }
   103     73       return img;
   104     74   }
   105     75   
   106     76   extern void
   107         -image_destroy (rasterliteImagePtr img)
           77  +image_destroy (rasterliteImagePrt img)
   108     78   {
   109     79   /*
   110     80   / destroying a generic RGB image
   111     81   / vaguely inspired by GD lib
   112     82   */
   113     83       int i;
   114     84       if (img->pixels)
................................................................................
   117     87   	      free (img->pixels[i]);
   118     88   	  free (img->pixels);
   119     89         }
   120     90       free (img);
   121     91   }
   122     92   
   123     93   extern void
   124         -image_fill (const rasterliteImagePtr img, int color)
           94  +image_fill (const rasterliteImagePrt img, int color)
   125     95   {
   126     96   /* filling the image with given color */
   127     97       int x;
   128     98       int y;
   129     99       if (img->pixels)
   130    100         {
   131    101   	  for (y = 0; y < img->sy; y++)
................................................................................
   133    103   		for (x = 0; x < img->sx; x++)
   134    104   		    img->pixels[y][x] = color;
   135    105   	    }
   136    106         }
   137    107   }
   138    108   
   139    109   static void
   140         -shrink_by (const rasterliteImagePtr dst, const rasterliteImagePtr src)
          110  +shrink_by (const rasterliteImagePrt dst, const rasterliteImagePrt src)
   141    111   {
   142    112   /*
   143    113   / this code is widely base upon the original wxWidgets gwxImage wxImage::ShrinkBy(() function
   144    114   */
   145    115       int xFactor = src->sx / dst->sx;
   146    116       int yFactor = src->sy / dst->sy;
   147    117       int x;
   148    118       int y;
   149    119       int x1;
   150    120       int y1;
   151    121       int y_offset;
   152         -    int x_offset;
          122  +    unsigned int avgRed = 0;
          123  +    unsigned int avgGreen = 0;
          124  +    unsigned int avgBlue = 0;
          125  +    unsigned int counter = 0;
   153    126       int pixel;
          127  +    printf ("shrink\n");
          128  +    fflush (stdout);
   154    129       for (y = 0; y < dst->sy; y++)
   155    130         {
   156    131   	  for (x = 0; x < dst->sx; x++)
   157    132   	    {
   158    133   		/* determine average */
   159         -		unsigned int avgRed = 0;
   160         -		unsigned int avgGreen = 0;
   161         -		unsigned int avgBlue = 0;
   162         -		unsigned int counter = 0;
   163    134   		for (y1 = 0; y1 < yFactor; ++y1)
   164    135   		  {
   165    136   		      y_offset = (y * yFactor + y1) * src->sx;
   166    137   		      for (x1 = 0; x1 < xFactor; ++x1)
   167    138   			{
   168         -			    x_offset = (x * xFactor) + x1;
   169         -			    pixel = src->pixels[y_offset][x_offset];
          139  +			    pixel = src->pixels[y1][x1];
   170    140   			    avgRed += true_color_get_red (pixel);
   171    141   			    avgGreen += true_color_get_green (pixel);
   172    142   			    avgBlue += true_color_get_blue (pixel);
   173    143   			    counter++;
   174    144   			}
   175    145   		  }
   176    146   		pixel =
................................................................................
   178    148   				(avgBlue / counter));
   179    149   		dst->pixels[y][x] = pixel;
   180    150   	    }
   181    151         }
   182    152   }
   183    153   
   184    154   extern void
   185         -image_resize (const rasterliteImagePtr dst, const rasterliteImagePtr src)
          155  +image_resize (const rasterliteImagePrt dst, const rasterliteImagePrt src)
   186    156   {
   187    157   /*
   188    158   / this function builds an ordinary quality resized image, applying pixel replication
   189    159   /
   190    160   / this code is widely base upon the original wxWidgets gwxImage wxImage::Scale(() function
   191    161   / wxIMAGE_QUALITY_NORMAL
   192    162   */
................................................................................
   218    188   	  y += y_delta;
   219    189         }
   220    190   }
   221    191   
   222    192   #define floor2(exp) ((long) exp)
   223    193   
   224    194   extern void
   225         -make_thumbnail (const rasterliteImagePtr thumbnail,
   226         -		const rasterliteImagePtr image)
          195  +make_thumbnail (const rasterliteImagePrt thumbnail,
          196  +		const rasterliteImagePrt image)
   227    197   {
   228    198   /*
   229    199   / this function builds an high quality thumbnail image, applying pixel interpolation
   230    200   /
   231    201   / this code is widely base upon the original GD gdImageCopyResampled() function
   232    202   */
   233    203       int x, y;
................................................................................
   319    289   				 true_color ((int) red, (int) green,
   320    290   					     (int) blue));
   321    291   	    }
   322    292         }
   323    293   }
   324    294   
   325    295   extern void *
   326         -image_to_rgb_array (const rasterliteImagePtr img, int *size)
          296  +image_to_rgb_array (const rasterliteImagePrt img, int *size)
   327    297   {
   328    298   /* building a flat RGB array from this image */
   329    299       int x;
   330    300       int y;
   331    301       int pixel;
   332    302       unsigned char *data = NULL;
   333    303       unsigned char *p;
................................................................................
   347    317   	    }
   348    318         }
   349    319       *size = sz;
   350    320       return data;
   351    321   }
   352    322   
   353    323   extern void *
   354         -image_to_rgba_array (int transparent_color, const rasterliteImagePtr img,
          324  +image_to_rgba_array (int transparent_color, const rasterliteImagePrt img,
   355    325   		     int *size)
   356    326   {
   357    327   /* building a flat RGBA array from this image */
   358    328       int x;
   359    329       int y;
   360    330       int pixel;
   361    331       int r;
................................................................................
   388    358   	    }
   389    359         }
   390    360       *size = sz;
   391    361       return data;
   392    362   }
   393    363   
   394    364   extern void *
   395         -image_to_argb_array (int transparent_color, const rasterliteImagePtr img,
          365  +image_to_argb_array (int transparent_color, const rasterliteImagePrt img,
   396    366   		     int *size)
   397    367   {
   398    368   /* building a flat ARGB array from this image */
   399    369       int x;
   400    370       int y;
   401    371       int pixel;
   402    372       int r;
................................................................................
   429    399   	    }
   430    400         }
   431    401       *size = sz;
   432    402       return data;
   433    403   }
   434    404   
   435    405   extern void *
   436         -image_to_bgr_array (const rasterliteImagePtr img, int *size)
          406  +image_to_bgr_array (const rasterliteImagePrt img, int *size)
   437    407   {
   438    408   /* building a flat BGR array from this image */
   439    409       int x;
   440    410       int y;
   441    411       int pixel;
   442    412       unsigned char *data = NULL;
   443    413       unsigned char *p;
................................................................................
   457    427   	    }
   458    428         }
   459    429       *size = sz;
   460    430       return data;
   461    431   }
   462    432   
   463    433   extern void *
   464         -image_to_bgra_array (int transparent_color, const rasterliteImagePtr img,
          434  +image_to_bgra_array (int transparent_color, const rasterliteImagePrt img,
   465    435   		     int *size)
   466    436   {
   467    437   /* building a flat BGRA array from this image */
   468    438       int x;
   469    439       int y;
   470    440       int pixel;
   471    441       int r;
................................................................................
   496    466   		*p++ = r;
   497    467   		*p++ = a;
   498    468   	    }
   499    469         }
   500    470       *size = sz;
   501    471       return data;
   502    472   }
   503         -
   504         -extern rasterliteImagePtr
   505         -image_from_rgb_array (const void *raw, int width, int height)
   506         -{
   507         -/* building an image form this flat RGB array */
   508         -    int x;
   509         -    int y;
   510         -    int r;
   511         -    int g;
   512         -    int b;
   513         -    int pixel;
   514         -    const unsigned char *data = raw;
   515         -    const unsigned char *p;
   516         -    rasterliteImagePtr img = image_create (width, height);
   517         -    if (!img)
   518         -	return NULL;
   519         -    for (y = 0; y < img->sy; y++)
   520         -      {
   521         -	  p = data + (y * (width * 3));
   522         -	  for (x = 0; x < img->sx; x++)
   523         -	    {
   524         -		r = *p++;
   525         -		g = *p++;
   526         -		b = *p++;
   527         -		pixel = true_color (r, g, b);
   528         -		img->pixels[y][x] = pixel;
   529         -	    }
   530         -      }
   531         -    return img;
   532         -}
   533         -
   534         -extern rasterliteImagePtr
   535         -image_from_rgba_array (const void *raw, int width, int height)
   536         -{
   537         -/* building an image form this flat RGBA array */
   538         -    int x;
   539         -    int y;
   540         -    int r;
   541         -    int g;
   542         -    int b;
   543         -    int alpha;
   544         -    int pixel;
   545         -    const unsigned char *data = raw;
   546         -    const unsigned char *p;
   547         -    rasterliteImagePtr img = image_create (width, height);
   548         -    if (!img)
   549         -	return NULL;
   550         -    for (y = 0; y < img->sy; y++)
   551         -      {
   552         -	  p = data + (y * (width * 4));
   553         -	  for (x = 0; x < img->sx; x++)
   554         -	    {
   555         -		r = *p++;
   556         -		g = *p++;
   557         -		b = *p++;
   558         -		alpha = *p++;
   559         -		pixel = true_color (r, g, b);
   560         -		img->pixels[y][x] = pixel;
   561         -	    }
   562         -      }
   563         -    return img;
   564         -}
   565         -
   566         -extern rasterliteImagePtr
   567         -image_from_argb_array (const void *raw, int width, int height)
   568         -{
   569         -/* building an image form this flat ARGB array */
   570         -    int x;
   571         -    int y;
   572         -    int r;
   573         -    int g;
   574         -    int b;
   575         -    int alpha;
   576         -    int pixel;
   577         -    const unsigned char *data = raw;
   578         -    const unsigned char *p;
   579         -    rasterliteImagePtr img = image_create (width, height);
   580         -    if (!img)
   581         -	return NULL;
   582         -    for (y = 0; y < img->sy; y++)
   583         -      {
   584         -	  p = data + (y * (width * 4));
   585         -	  for (x = 0; x < img->sx; x++)
   586         -	    {
   587         -
   588         -		alpha = *p++;
   589         -		r = *p++;
   590         -		g = *p++;
   591         -		b = *p++;
   592         -		pixel = true_color (r, g, b);
   593         -		img->pixels[y][x] = pixel;
   594         -	    }
   595         -      }
   596         -    return img;
   597         -}
   598         -
   599         -extern rasterliteImagePtr
   600         -image_from_bgr_array (const void *raw, int width, int height)
   601         -{
   602         -/* building an image form this flat BGR array */
   603         -    int x;
   604         -    int y;
   605         -    int r;
   606         -    int g;
   607         -    int b;
   608         -    int pixel;
   609         -    const unsigned char *data = raw;
   610         -    const unsigned char *p;
   611         -    rasterliteImagePtr img = image_create (width, height);
   612         -    if (!img)
   613         -	return NULL;
   614         -    for (y = 0; y < img->sy; y++)
   615         -      {
   616         -	  p = data + (y * (width * 3));
   617         -	  for (x = 0; x < img->sx; x++)
   618         -	    {
   619         -		b = *p++;
   620         -		g = *p++;
   621         -		r = *p++;
   622         -		pixel = true_color (r, g, b);
   623         -		img->pixels[y][x] = pixel;
   624         -	    }
   625         -      }
   626         -    return img;
   627         -}
   628         -
   629         -extern rasterliteImagePtr
   630         -image_from_bgra_array (const void *raw, int width, int height)
   631         -{
   632         -/* building an image form this flat BGRA array */
   633         -    int x;
   634         -    int y;
   635         -    int r;
   636         -    int g;
   637         -    int b;
   638         -    int alpha;
   639         -    int pixel;
   640         -    const unsigned char *data = raw;
   641         -    const unsigned char *p;
   642         -    rasterliteImagePtr img = image_create (width, height);
   643         -    if (!img)
   644         -	return NULL;
   645         -    for (y = 0; y < img->sy; y++)
   646         -      {
   647         -	  p = data + (y * (width * 4));
   648         -	  for (x = 0; x < img->sx; x++)
   649         -	    {
   650         -		b = *p++;
   651         -		g = *p++;
   652         -		r = *p++;
   653         -		alpha = *p++;
   654         -		pixel = true_color (r, g, b);
   655         -		img->pixels[y][x] = pixel;
   656         -	    }
   657         -      }
   658         -    return img;
   659         -}
   660         -
   661         -extern int
   662         -is_image_monochrome (const rasterliteImagePtr img)
   663         -{
   664         -/* checking if this Image is into the Monochrome colorspace */
   665         -    int x;
   666         -    int y;
   667         -    int pixel;
   668         -    int r;
   669         -    int g;
   670         -    int b;
   671         -    for (y = 0; y < img->sy; y++)
   672         -      {
   673         -	  for (x = 0; x < img->sx; x++)
   674         -	    {
   675         -		pixel = img->pixels[y][x];
   676         -		r = true_color_get_red (pixel);
   677         -		g = true_color_get_green (pixel);
   678         -		b = true_color_get_blue (pixel);
   679         -		if (r == 0 && g == 0 && b == 0)
   680         -		    continue;
   681         -		if (r == 255 && g == 255 && b == 255)
   682         -		    continue;
   683         -		return RASTERLITE_FALSE;
   684         -	    }
   685         -      }
   686         -    return RASTERLITE_TRUE;
   687         -}
   688         -
   689         -extern int
   690         -is_image_grayscale (const rasterliteImagePtr img)
   691         -{
   692         -/* checking if this Image is into the GrayScale colorspace */
   693         -    int x;
   694         -    int y;
   695         -    int pixel;
   696         -    int r;
   697         -    int g;
   698         -    int b;
   699         -    for (y = 0; y < img->sy; y++)
   700         -      {
   701         -	  for (x = 0; x < img->sx; x++)
   702         -	    {
   703         -		pixel = img->pixels[y][x];
   704         -		r = true_color_get_red (pixel);
   705         -		g = true_color_get_green (pixel);
   706         -		b = true_color_get_blue (pixel);
   707         -		if (r == g && r == b)
   708         -		    continue;
   709         -		return RASTERLITE_FALSE;
   710         -	    }
   711         -      }
   712         -    return RASTERLITE_TRUE;
   713         -}
   714         -
   715         -static void
   716         -palette_init (int *palette)
   717         -{
   718         -/* initializing an empty palette */
   719         -    int x;
   720         -    for (x = 0; x < 256; x++)
   721         -	palette[x] = INT_MAX;
   722         -}
   723         -
   724         -static int
   725         -palette_check (int *palette, int pixel)
   726         -{
   727         -    int x;
   728         -    for (x = 0; x < 256; x++)
   729         -      {
   730         -	  if (palette[x] == pixel)
   731         -	      return RASTERLITE_TRUE;
   732         -	  if (palette[x] == INT_MAX)
   733         -	    {
   734         -		palette[x] = pixel;
   735         -		return RASTERLITE_TRUE;
   736         -	    }
   737         -      }
   738         -    return RASTERLITE_FALSE;
   739         -}
   740         -
   741         -extern int
   742         -is_image_palette256 (const rasterliteImagePtr img)
   743         -{
   744         -/* checking if this Image may be represented using a 256 colors palette */
   745         -    int x;
   746         -    int y;
   747         -    int pixel;
   748         -    int palette[256];
   749         -    palette_init (palette);
   750         -    for (y = 0; y < img->sy; y++)
   751         -      {
   752         -	  for (x = 0; x < img->sx; x++)
   753         -	    {
   754         -		pixel = img->pixels[y][x];
   755         -		if (palette_check (palette, pixel) == RASTERLITE_TRUE)
   756         -		    continue;
   757         -		return RASTERLITE_FALSE;
   758         -	    }
   759         -      }
   760         -    return RASTERLITE_TRUE;
   761         -}

Changes to lib/rasterlite_io.c.

     1      1   /* 
     2      2   / rasterlite_io.c
     3      3   /
     4      4   / IO helper methods
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50     27   #include <stdio.h>
    51     28   #include <stdlib.h>
    52     29   #include <string.h>
    53     30   #include <limits.h>
    54     31   
    55     32   #include <tiffio.h>
    56         -
    57         -#ifdef SPATIALITE_AMALGAMATION
    58     33   #include <spatialite/sqlite3.h>
    59         -#else
    60         -#include <sqlite3.h>
    61         -#endif
    62         -
    63     34   #include <spatialite/gaiageo.h>
    64     35   
    65     36   #include "rasterlite_internals.h"
    66     37   
    67     38   #define TRUE 1
    68     39   #define FALSE 0
    69     40   

Changes to lib/rasterlite_jpeg.c.

     1      1   /* 
     2      2   / rasterlite_jpeg.c
     3      3   /
     4      4   / JPEG auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50     27   #include <stdio.h>
    51     28   #include <stdlib.h>
    52     29   #include <setjmp.h>
    53     30   #include <limits.h>
    54     31   #include <string.h>
    55     32   
           33  +#include <spatialite/sqlite3.h>
           34  +#include <spatialite/gaiageo.h>
           35  +
    56     36   #include <tiffio.h>
           37  +
    57     38   #include <jpeglib.h>
    58     39   #include <jerror.h>
    59     40   
    60         -#ifdef SPATIALITE_AMALGAMATION
    61         -#include <spatialite/sqlite3.h>
    62         -#else
    63         -#include <sqlite3.h>
    64         -#endif
    65         -
    66         -#include <spatialite/gaiageo.h>
    67         -
    68     41   #include "rasterlite_internals.h"
    69     42   
    70     43   /* 
    71     44   /
    72     45   / DISCLAIMER:
    73     46   / all the following code merely is an 'ad hoc' adaption
    74     47   / deriving from the original GD lib code
................................................................................
   134    107   	  fprintf (stderr, "jpeg-wrappeg: EXTREMELY fatal error: jmpbuf"
   135    108   		   " unrecoverable; terminating\n");
   136    109         }
   137    110       fflush (stderr);
   138    111       exit (99);
   139    112   }
   140    113   
   141         -static void
          114  +void
   142    115   init_source (j_decompress_ptr cinfo)
   143    116   {
   144    117       my_src_ptr src = (my_src_ptr) cinfo->src;
   145    118       src->start_of_file = TRUE;
   146    119   }
   147    120   
   148    121   #define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n"
   149         -static safeboolean
          122  +safeboolean
   150    123   fill_input_buffer (j_decompress_ptr cinfo)
   151    124   {
   152    125       my_src_ptr src = (my_src_ptr) cinfo->src;
   153    126       int nbytes = 0;
   154    127       memset (src->buffer, 0, INPUT_BUF_SIZE);
   155    128       while (nbytes < INPUT_BUF_SIZE)
   156    129         {
................................................................................
   178    151         }
   179    152       src->pub.next_input_byte = src->buffer;
   180    153       src->pub.bytes_in_buffer = nbytes;
   181    154       src->start_of_file = FALSE;
   182    155       return TRUE;
   183    156   }
   184    157   
   185         -static void
          158  +void
   186    159   skip_input_data (j_decompress_ptr cinfo, long num_bytes)
   187    160   {
   188    161       my_src_ptr src = (my_src_ptr) cinfo->src;
   189    162       if (num_bytes > 0)
   190    163         {
   191    164   	  while (num_bytes > (long) src->pub.bytes_in_buffer)
   192    165   	    {
................................................................................
   194    167   		(void) fill_input_buffer (cinfo);
   195    168   	    }
   196    169   	  src->pub.next_input_byte += (size_t) num_bytes;
   197    170   	  src->pub.bytes_in_buffer -= (size_t) num_bytes;
   198    171         }
   199    172   }
   200    173   
   201         -static void
          174  +void
   202    175   term_source (j_decompress_ptr cinfo)
   203    176   {
   204    177       if (cinfo)
   205    178   	return;			/* does absolutely nothing - required in order to suppress warnings */
   206    179   }
   207    180   
   208    181   static void
................................................................................
   282    255       dest->pub.init_destination = init_destination;
   283    256       dest->pub.empty_output_buffer = empty_output_buffer;
   284    257       dest->pub.term_destination = term_destination;
   285    258       dest->outfile = outfile;
   286    259   }
   287    260   
   288    261   static void
   289         -xgdImageJpegCtx (rasterliteImagePtr img, xgdIOCtx * outfile, int quality,
          262  +xgdImageJpegCtx (rasterliteImagePrt img, xgdIOCtx * outfile, int quality,
   290    263   		 int mode)
   291    264   {
   292    265       struct jpeg_compress_struct cinfo;
   293    266       struct jpeg_error_mgr jerr;
   294    267       int i, j, jidx;
   295    268       volatile JSAMPROW row = 0;
   296    269       JSAMPROW rowptr[1];
................................................................................
   395    368   	  k = 255 - k;
   396    369         }
   397    370       return true_color ((255 - c) * (255 - k) / 255,
   398    371   		       (255 - m) * (255 - k) / 255,
   399    372   		       (255 - y) * (255 - k) / 255);
   400    373   }
   401    374   
   402         -static rasterliteImagePtr
          375  +static rasterliteImagePrt
   403    376   xgdImageCreateFromJpegCtx (xgdIOCtx * infile)
   404    377   {
   405    378       struct jpeg_decompress_struct cinfo;
   406    379       struct jpeg_error_mgr jerr;
   407    380       jmpbuf_wrapper jmpbufw;
   408    381       volatile JSAMPROW row = 0;
   409         -    volatile rasterliteImagePtr img = 0;
          382  +    volatile rasterliteImagePrt img = 0;
   410    383       JSAMPROW rowptr[1];
   411    384       int i, j, retval;
   412    385       JDIMENSION nrows;
   413    386       int channels = 3;
   414    387       int inverted = 0;
   415    388       memset (&cinfo, 0, sizeof (cinfo));
   416    389       memset (&jerr, 0, sizeof (jerr));
................................................................................
   417    390       cinfo.err = jpeg_std_error (&jerr);
   418    391       cinfo.client_data = &jmpbufw;
   419    392       if (setjmp (jmpbufw.jmpbuf) != 0)
   420    393         {
   421    394   	  if (row)
   422    395   	      free (row);
   423    396   	  if (img)
   424         -	      image_destroy ((rasterliteImagePtr) img);
          397  +	      image_destroy ((rasterliteImagePrt) img);
   425    398   	  return 0;
   426    399         }
   427    400       cinfo.err->error_exit = fatal_jpeg_error;
   428    401       jpeg_create_decompress (&cinfo);
   429    402       jpeg_xgdIOCtx_src (&cinfo, infile);
   430    403       jpeg_save_markers (&cinfo, JPEG_APP0 + 14, 256);
   431    404       retval = jpeg_read_header (&cinfo, TRUE);
................................................................................
   596    569   	    }
   597    570         }
   598    571       if (jpeg_finish_decompress (&cinfo) != TRUE)
   599    572   	fprintf (stderr,
   600    573   		 "jpeg-wrapper: warning: jpeg_finish_decompress reports suspended data source\n");
   601    574       jpeg_destroy_decompress (&cinfo);
   602    575       free (row);
   603         -    return (rasterliteImagePtr) img;
          576  +    return (rasterliteImagePrt) img;
   604    577     error:
   605    578       jpeg_destroy_decompress (&cinfo);
   606    579       if (row)
   607    580   	free (row);
   608    581       if (img)
   609         -	image_destroy ((rasterliteImagePtr) img);
          582  +	image_destroy ((rasterliteImagePrt) img);
   610    583       return 0;
   611    584   }
   612    585   
   613    586   extern void *
   614         -image_to_jpeg (const rasterliteImagePtr img, int *size, int quality)
          587  +image_to_jpeg (const rasterliteImagePrt img, int *size, int quality)
   615    588   {
   616    589   /* compressing an image as JPEG RGB */
   617    590       void *rv;
   618    591       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   619    592       xgdImageJpegCtx (img, out, quality, IMAGE_JPEG_RGB);
   620    593       rv = xgdDPExtractData (out, size);
   621    594       out->xgd_free (out);
   622    595       return rv;
   623    596   }
   624    597   
   625    598   extern void *
   626         -image_to_jpeg_grayscale (const rasterliteImagePtr img, int *size, int quality)
          599  +image_to_jpeg_grayscale (const rasterliteImagePrt img, int *size, int quality)
   627    600   {
   628    601   /* compressing an image as JPEG GRAYSCALE */
   629    602       void *rv;
   630    603       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   631    604       xgdImageJpegCtx (img, out, quality, IMAGE_JPEG_BW);
   632    605       rv = xgdDPExtractData (out, size);
   633    606       out->xgd_free (out);
   634    607       return rv;
   635    608   }
   636    609   
   637         -extern rasterliteImagePtr
          610  +extern rasterliteImagePrt
   638    611   image_from_jpeg (int size, const void *data)
   639    612   {
   640    613   /* uncompressing a JPEG */
   641         -    rasterliteImagePtr img;
          614  +    rasterliteImagePrt img;
   642    615       xgdIOCtx *in = xgdNewDynamicCtxEx (size, data, 0);
   643    616       img = xgdImageCreateFromJpegCtx (in);
   644    617       in->xgd_free (in);
   645    618       return img;
   646    619   }

Changes to lib/rasterlite_png.c.

     1      1   /* 
     2      2   / rasterlite_png.c
     3      3   /
     4      4   / PNG auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45     27   #include <stdio.h>
    46     28   #include <math.h>
    47     29   #include <string.h>
    48     30   #include <stdlib.h>
    49     31   
    50         -#include <tiffio.h>
    51         -#include <png.h>
    52         -
    53         -#ifdef SPATIALITE_AMALGAMATION
    54     32   #include <spatialite/sqlite3.h>
    55         -#else
    56         -#include <sqlite3.h>
    57         -#endif
    58         -
    59     33   #include <spatialite/gaiageo.h>
           34  +
           35  +#include <tiffio.h>
           36  +
           37  +#include <png.h>
    60     38   
    61     39   #define TRUE 1
    62     40   #define FALSE 0
    63     41   
    64     42   #include "rasterlite_internals.h"
    65     43   
    66     44   /* 
................................................................................
   118     96   static void
   119     97   xgdPngFlushData (png_structp png_ptr)
   120     98   {
   121     99       if (png_ptr)
   122    100   	return;			/* does absolutely nothing - required in order to suppress warnings */
   123    101   }
   124    102   
   125         -static rasterliteImagePtr
          103  +static rasterliteImagePrt
   126    104   xgdImageCreateFromPngCtx (xgdIOCtx * infile)
   127    105   {
   128    106       png_byte sig[8];
   129    107       png_structp png_ptr;
   130    108       png_infop info_ptr;
   131    109       png_uint_32 width, height, rowbytes, w, h;
   132    110       int bit_depth, color_type, interlace_type;
................................................................................
   133    111       int num_palette;
   134    112       png_colorp palette;
   135    113       int red[256];
   136    114       int green[256];
   137    115       int blue[256];
   138    116       png_bytep image_data = NULL;
   139    117       png_bytepp row_pointers = NULL;
   140         -    rasterliteImagePtr im = NULL;
          118  +    rasterliteImagePrt im = NULL;
   141    119       int i, j;
   142    120       volatile int palette_allocated = FALSE;
   143    121       memset (sig, 0, sizeof (sig));
   144    122       if (xgdGetBuf (sig, 8, infile) < 8)
   145    123         {
   146    124   	  return NULL;
   147    125         }
   148         -    if (png_sig_cmp (sig, 0, 8))
          126  +    if (!png_check_sig (sig, 8))
   149    127         {
   150    128   	  return NULL;
   151    129         }
   152    130   #ifndef PNG_SETJMP_NOT_SUPPORTED
   153    131       png_ptr =
   154    132   	png_create_read_struct (PNG_LIBPNG_VER_STRING, &xgdPngJmpbufStruct,
   155    133   				xgdPngErrorHandler, NULL);
................................................................................
   368    346         }
   369    347       free (image_data);
   370    348       free (row_pointers);
   371    349       return im;
   372    350   }
   373    351   
   374    352   static void
   375         -xgdImagePngCtxPalette (rasterliteImagePtr img, xgdIOCtx * outfile, int level)
          353  +xgdImagePngCtxPalette (rasterliteImagePrt img, xgdIOCtx * outfile, int level)
   376    354   {
   377    355       int i, j, bit_depth = 0, interlace_type;
   378    356       int width = img->sx;
   379    357       int height = img->sy;
   380    358       int mapping[256];
   381    359       int colors;
   382    360       png_color palette[256];
................................................................................
   490    468       for (j = 0; j < height; ++j)
   491    469   	free (row_pointers[j]);
   492    470       free (row_pointers);
   493    471       png_destroy_write_struct (&png_ptr, &info_ptr);
   494    472   }
   495    473   
   496    474   static void
   497         -xgdImagePngCtxGrayscale (rasterliteImagePtr img, xgdIOCtx * outfile, int level)
          475  +xgdImagePngCtxGrayscale (rasterliteImagePrt img, xgdIOCtx * outfile, int level)
   498    476   {
   499    477       int i, j, bit_depth = 0, interlace_type;
   500    478       int width = img->sx;
   501    479       int height = img->sy;
   502    480       png_structp png_ptr;
   503    481       png_infop info_ptr;
   504    482       png_bytep *row_pointers;
................................................................................
   574    552       for (j = 0; j < height; ++j)
   575    553   	free (row_pointers[j]);
   576    554       free (row_pointers);
   577    555       png_destroy_write_struct (&png_ptr, &info_ptr);
   578    556   }
   579    557   
   580    558   static void
   581         -xgdImagePngCtxRgb (rasterliteImagePtr img, xgdIOCtx * outfile, int level)
          559  +xgdImagePngCtxRgb (rasterliteImagePrt img, xgdIOCtx * outfile, int level)
   582    560   {
   583    561       int i, j, bit_depth = 0, interlace_type;
   584    562       int width = img->sx;
   585    563       int height = img->sy;
   586    564       png_structp png_ptr;
   587    565       png_infop info_ptr;
   588    566       png_bytep *row_pointers;
................................................................................
   666    644       for (j = 0; j < height; ++j)
   667    645   	free (row_pointers[j]);
   668    646       free (row_pointers);
   669    647       png_destroy_write_struct (&png_ptr, &info_ptr);
   670    648   }
   671    649   
   672    650   extern void *
   673         -image_to_png_palette (const rasterliteImagePtr img, int *size)
          651  +image_to_png_palette (const rasterliteImagePrt img, int *size)
   674    652   {
   675    653   /* compressing an image as PNG PALETTE */
   676    654       void *rv;
   677    655       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   678    656       xgdImagePngCtxPalette (img, out, -1);
   679    657       rv = xgdDPExtractData (out, size);
   680    658       out->xgd_free (out);
   681    659       return rv;
   682    660   }
   683    661   
   684    662   extern void *
   685         -image_to_png_grayscale (const rasterliteImagePtr img, int *size)
          663  +image_to_png_grayscale (const rasterliteImagePrt img, int *size)
   686    664   {
   687    665   /* compressing an image as PNG GRAYSCALE */
   688    666       void *rv;
   689    667       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   690    668       xgdImagePngCtxGrayscale (img, out, -1);
   691    669       rv = xgdDPExtractData (out, size);
   692    670       out->xgd_free (out);
   693    671       return rv;
   694    672   }
   695    673   
   696    674   extern void *
   697         -image_to_png_rgb (const rasterliteImagePtr img, int *size)
          675  +image_to_png_rgb (const rasterliteImagePrt img, int *size)
   698    676   {
   699    677   /* compressing an image as PNG RGB */
   700    678       void *rv;
   701    679       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   702    680       xgdImagePngCtxRgb (img, out, -1);
   703    681       rv = xgdDPExtractData (out, size);
   704    682       out->xgd_free (out);
   705    683       return rv;
   706    684   }
   707    685   
   708         -extern rasterliteImagePtr
          686  +extern rasterliteImagePrt
   709    687   image_from_png (int size, const void *data)
   710    688   {
   711    689   /* uncompressing a PNG */
   712         -    rasterliteImagePtr img;
          690  +    rasterliteImagePrt img;
   713    691       xgdIOCtx *in = xgdNewDynamicCtxEx (size, data, 0);
   714    692       img = xgdImageCreateFromPngCtx (in);
   715    693       in->xgd_free (in);
   716    694       return img;
   717    695   }

Deleted lib/rasterlite_quantize.c.

     1         -/* 
     2         -/ rasterlite_quantize.c
     3         -/
     4         -/ quantization methods
     5         -/
     6         -/ version 1.1a, 2011 November 12
     7         -/
     8         -/ Author: Sandro Furieri a.furieri@lqt.it
     9         -/
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
    23         -/
    24         -/ The Original Code is the RasterLite library
    25         -/
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43         -*/
    44         -
    45         -/* 
    46         -/
    47         -/ DISCLAIMER:
    48         -/ all the following code merely is an 'ad hoc' adaption
    49         -/ of the following LGPLed code:
    50         -/
    51         -//////////////////////////////////////////////////////////////////////////////
    52         -/
    53         - median.c: median cut - reducing a high color bitmap to certain number of colors
    54         -
    55         -   Copyright (C) 2001, 2002 Martin Weber
    56         -
    57         -   This library is free software; you can redistribute it and/or
    58         -   modify it under the terms of the GNU Lesser General Public License
    59         -   as published by the Free Software Foundation; either version 2.1 of
    60         -   the License, or (at your option) any later version.
    61         -
    62         -   This library is distributed in the hope that it will be useful, but
    63         -   WITHOUT ANY WARRANTY; without even the implied warranty of
    64         -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    65         -   Lesser General Public License for more details.
    66         -
    67         -   You should have received a copy of the GNU Lesser General Public
    68         -   License along with this library; if not, write to the Free Software
    69         -   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    70         -   USA. 
    71         -*/
    72         -
    73         -#if defined(_WIN32) && !defined(__MINGW32__)
    74         -/* MSVC strictly requires this include [off_t] */
    75         -#include <sys/types.h>
    76         -#endif
    77         -
    78         -#include <stdlib.h>
    79         -
    80         -#include <tiffio.h>
    81         -
    82         -#ifdef SPATIALITE_AMALGAMATION
    83         -#include <spatialite/sqlite3.h>
    84         -#else
    85         -#include <sqlite3.h>
    86         -#endif
    87         -
    88         -#include <spatialite/gaiageo.h>
    89         -
    90         -#include "rasterlite_internals.h"
    91         -
    92         -#define MAXNUMCOLORS 256
    93         -
    94         -/* scale RGB distances by *2,*3,*1 */
    95         -#define R_SCALE  <<1
    96         -#define G_SCALE  *3
    97         -#define B_SCALE
    98         -
    99         -#define BITS_IN_SAMPLE 	8
   100         -
   101         -#define R_SHIFT  	(BITS_IN_SAMPLE - PRECISION_R)
   102         -#define G_SHIFT  	(BITS_IN_SAMPLE - PRECISION_G)
   103         -#define B_SHIFT  	(BITS_IN_SAMPLE - PRECISION_B)
   104         -
   105         -#define PRECISION_R 	7
   106         -#define PRECISION_G 	7
   107         -#define PRECISION_B 	7
   108         -
   109         -#define HIST_R_ELEMS 	(1<<PRECISION_R)
   110         -#define HIST_G_ELEMS 	(1<<PRECISION_G)
   111         -#define HIST_B_ELEMS 	(1<<PRECISION_B)
   112         -
   113         -#define MR 		HIST_G_ELEMS*HIST_B_ELEMS
   114         -#define MG 		HIST_B_ELEMS
   115         -
   116         -typedef unsigned long ColorFreq;
   117         -typedef ColorFreq *Histogram;
   118         -
   119         -typedef struct
   120         -{
   121         -    int desired_number_of_colors;	/* Number of colors we will allow */
   122         -    int actual_number_of_colors;	/* Number of colors actually needed */
   123         -    int cmap[256];		/* colormap created by quantization */
   124         -    ColorFreq freq[256];
   125         -    Histogram histogram;	/* holds the histogram */
   126         -} QuantizeObj;
   127         -
   128         -typedef struct
   129         -{
   130         -    /* The bounds of the box (inclusive); expressed as histogram indexes */
   131         -    int Rmin, Rmax;
   132         -    int Gmin, Gmax;
   133         -    int Bmin, Bmax;
   134         -    /* The volume (actually 2-norm) of the box */
   135         -    int volume;
   136         -    /* The number of nonzero histogram cells within this box */
   137         -    long colorcount;
   138         -} box, *boxptr;
   139         -
   140         -static void
   141         -zero_histogram_rgb (Histogram histogram)
   142         -{
   143         -    int r, g, b;
   144         -    for (r = 0; r < HIST_R_ELEMS; r++)
   145         -	for (g = 0; g < HIST_G_ELEMS; g++)
   146         -	    for (b = 0; b < HIST_B_ELEMS; b++)
   147         -		histogram[r * MR + g * MG + b] = 0;
   148         -}
   149         -
   150         -static void
   151         -generate_histogram_rgb (Histogram histogram, rasterliteImagePtr image)
   152         -{
   153         -    int pixel;
   154         -    int x;
   155         -    int y;
   156         -    int r;
   157         -    int g;
   158         -    int b;
   159         -    ColorFreq *col;
   160         -
   161         -    zero_histogram_rgb (histogram);
   162         -
   163         -    for (y = 0; y < image->sy; y++)
   164         -      {
   165         -	  for (x = 0; x < image->sx; x++)
   166         -	    {
   167         -		pixel = image->pixels[y][x];
   168         -		r = true_color_get_red (pixel);
   169         -		g = true_color_get_green (pixel);
   170         -		b = true_color_get_blue (pixel);
   171         -		col = &histogram[(r >> R_SHIFT) * MR
   172         -				 + (g >> G_SHIFT) * MG + (b >> B_SHIFT)];
   173         -		(*col)++;
   174         -	    }
   175         -      }
   176         -}
   177         -
   178         -
   179         -static boxptr
   180         -find_biggest_volume (boxptr boxlist, int numboxes)
   181         -/* Find the splittable box with the largest (scaled) volume */
   182         -/* Returns 0 if no splittable boxes remain */
   183         -{
   184         -    boxptr boxp;
   185         -    int i;
   186         -    int maxv = 0;
   187         -    boxptr which = 0;
   188         -
   189         -    for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++)
   190         -      {
   191         -	  if (boxp->volume > maxv)
   192         -	    {
   193         -		which = boxp;
   194         -		maxv = boxp->volume;
   195         -	    }
   196         -      }
   197         -
   198         -    return which;
   199         -}
   200         -
   201         -
   202         -static void
   203         -update_box_rgb (Histogram histogram, boxptr boxp)
   204         -/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
   205         -/* and recompute its volume and population */
   206         -{
   207         -    ColorFreq *histp;
   208         -    int R, G, B;
   209         -    int Rmin, Rmax, Gmin, Gmax, Bmin, Bmax;
   210         -    int dist0, dist1, dist2;
   211         -    long ccount;
   212         -
   213         -    Rmin = boxp->Rmin;
   214         -    Rmax = boxp->Rmax;
   215         -    Gmin = boxp->Gmin;
   216         -    Gmax = boxp->Gmax;
   217         -    Bmin = boxp->Bmin;
   218         -    Bmax = boxp->Bmax;
   219         -
   220         -    if (Rmax > Rmin)
   221         -	for (R = Rmin; R <= Rmax; R++)
   222         -	    for (G = Gmin; G <= Gmax; G++)
   223         -	      {
   224         -		  histp = histogram + R * MR + G * MG + Bmin;
   225         -		  for (B = Bmin; B <= Bmax; B++)
   226         -		      if (*histp++ != 0)
   227         -			{
   228         -			    boxp->Rmin = Rmin = R;
   229         -			    goto have_Rmin;
   230         -			}
   231         -	      }
   232         -  have_Rmin:
   233         -    if (Rmax > Rmin)
   234         -	for (R = Rmax; R >= Rmin; R--)
   235         -	    for (G = Gmin; G <= Gmax; G++)
   236         -	      {
   237         -		  histp = histogram + R * MR + G * MG + Bmin;
   238         -		  for (B = Bmin; B <= Bmax; B++)
   239         -		      if (*histp++ != 0)
   240         -			{
   241         -			    boxp->Rmax = Rmax = R;
   242         -			    goto have_Rmax;
   243         -			}
   244         -	      }
   245         -  have_Rmax:
   246         -    if (Gmax > Gmin)
   247         -	for (G = Gmin; G <= Gmax; G++)
   248         -	    for (R = Rmin; R <= Rmax; R++)
   249         -	      {
   250         -		  histp = histogram + R * MR + G * MG + Bmin;
   251         -		  for (B = Bmin; B <= Bmax; B++)
   252         -		      if (*histp++ != 0)
   253         -			{
   254         -			    boxp->Gmin = Gmin = G;
   255         -			    goto have_Gmin;
   256         -			}
   257         -	      }
   258         -  have_Gmin:
   259         -    if (Gmax > Gmin)
   260         -	for (G = Gmax; G >= Gmin; G--)
   261         -	    for (R = Rmin; R <= Rmax; R++)
   262         -	      {
   263         -		  histp = histogram + R * MR + G * MG + Bmin;
   264         -		  for (B = Bmin; B <= Bmax; B++)
   265         -		      if (*histp++ != 0)
   266         -			{
   267         -			    boxp->Gmax = Gmax = G;
   268         -			    goto have_Gmax;
   269         -			}
   270         -	      }
   271         -  have_Gmax:
   272         -    if (Bmax > Bmin)
   273         -	for (B = Bmin; B <= Bmax; B++)
   274         -	    for (R = Rmin; R <= Rmax; R++)
   275         -	      {
   276         -		  histp = histogram + R * MR + Gmin * MG + B;
   277         -		  for (G = Gmin; G <= Gmax; G++, histp += MG)
   278         -		      if (*histp != 0)
   279         -			{
   280         -			    boxp->Bmin = Bmin = B;
   281         -			    goto have_Bmin;
   282         -			}
   283         -	      }
   284         -  have_Bmin:
   285         -    if (Bmax > Bmin)
   286         -	for (B = Bmax; B >= Bmin; B--)
   287         -	    for (R = Rmin; R <= Rmax; R++)
   288         -	      {
   289         -		  histp = histogram + R * MR + Gmin * MG + B;
   290         -		  for (G = Gmin; G <= Gmax; G++, histp += MG)
   291         -		      if (*histp != 0)
   292         -			{
   293         -			    boxp->Bmax = Bmax = B;
   294         -			    goto have_Bmax;
   295         -			}
   296         -	      }
   297         -  have_Bmax:
   298         -
   299         -    /* Update box volume.
   300         -     * We use 2-norm rather than real volume here; this biases the method
   301         -     * against making long narrow boxes, and it has the side benefit that
   302         -     * a box is splittable iff norm > 0.
   303         -     * Since the differences are expressed in histogram-cell units,
   304         -     * we have to shift back to JSAMPLE units to get consistent distances;
   305         -     * after which, we scale according to the selected distance scale factors.
   306         -     */
   307         -    dist0 = Rmax - Rmin;
   308         -    dist1 = Gmax - Gmin;
   309         -    dist2 = Bmax - Bmin;
   310         -    boxp->volume = dist0 * dist0 + dist1 * dist1 + dist2 * dist2;
   311         -
   312         -    /* Now scan remaining volume of box and compute population */
   313         -    ccount = 0;
   314         -    for (R = Rmin; R <= Rmax; R++)
   315         -	for (G = Gmin; G <= Gmax; G++)
   316         -	  {
   317         -	      histp = histogram + R * MR + G * MG + Bmin;
   318         -	      for (B = Bmin; B <= Bmax; B++, histp++)
   319         -		  if (*histp != 0)
   320         -		    {
   321         -			ccount++;
   322         -		    }
   323         -	  }
   324         -
   325         -    boxp->colorcount = ccount;
   326         -}
   327         -
   328         -
   329         -static int
   330         -median_cut_rgb (Histogram histogram, boxptr boxlist, int numboxes,
   331         -		int desired_colors)
   332         -/* Repeatedly select and split the largest box until we have enough boxes */
   333         -{
   334         -    int n, lb;
   335         -    int R, G, B, cmax;
   336         -    boxptr b1, b2;
   337         -
   338         -    while (numboxes < desired_colors)
   339         -      {
   340         -	  /* Select box to split.
   341         -	   * Current algorithm: by population for first half, then by volume.
   342         -	   */
   343         -	  b1 = find_biggest_volume (boxlist, numboxes);
   344         -
   345         -	  if (b1 == 0)		/* no splittable boxes left! */
   346         -	      break;
   347         -	  b2 = boxlist + numboxes;	/* where new box will go */
   348         -	  /* Copy the color bounds to the new box. */
   349         -	  b2->Rmax = b1->Rmax;
   350         -	  b2->Gmax = b1->Gmax;
   351         -	  b2->Bmax = b1->Bmax;
   352         -	  b2->Rmin = b1->Rmin;
   353         -	  b2->Gmin = b1->Gmin;
   354         -	  b2->Bmin = b1->Bmin;
   355         -	  /* Choose which axis to split the box on.
   356         -	   * Current algorithm: longest scaled axis.
   357         -	   * See notes in update_box about scaling distances.
   358         -	   */
   359         -	  R = b1->Rmax - b1->Rmin;
   360         -	  G = b1->Gmax - b1->Gmin;
   361         -	  B = b1->Bmax - b1->Bmin;
   362         -	  /* We want to break any ties in favor of green, then red, blue last.
   363         -	   */
   364         -	  cmax = G;
   365         -	  n = 1;
   366         -	  if (R > cmax)
   367         -	    {
   368         -		cmax = R;
   369         -		n = 0;
   370         -	    }
   371         -	  if (B > cmax)
   372         -	    {
   373         -		n = 2;
   374         -	    }
   375         -	  /* Choose split point along selected axis, and update box bounds.
   376         -	   * Current algorithm: split at halfway point.
   377         -	   * (Since the box has been shrunk to minimum volume,
   378         -	   * any split will produce two nonempty subboxes.)
   379         -	   * Note that lb value is max for lower box, so must be < old max.
   380         -	   */
   381         -	  switch (n)
   382         -	    {
   383         -	    case 0:
   384         -		lb = (b1->Rmax + b1->Rmin) / 2;
   385         -		b1->Rmax = lb;
   386         -		b2->Rmin = lb + 1;
   387         -		break;
   388         -	    case 1:
   389         -		lb = (b1->Gmax + b1->Gmin) / 2;
   390         -		b1->Gmax = lb;
   391         -		b2->Gmin = lb + 1;
   392         -		break;
   393         -	    case 2:
   394         -		lb = (b1->Bmax + b1->Bmin) / 2;
   395         -		b1->Bmax = lb;
   396         -		b2->Bmin = lb + 1;
   397         -		break;
   398         -	    }
   399         -	  /* Update stats for boxes */
   400         -	  update_box_rgb (histogram, b1);
   401         -	  update_box_rgb (histogram, b2);
   402         -	  numboxes++;
   403         -      }
   404         -    return numboxes;
   405         -}
   406         -
   407         -
   408         -static void
   409         -compute_color_rgb (QuantizeObj * quantobj, Histogram histogram,
   410         -		   boxptr boxp, int icolor)
   411         -/* Compute representative color for a box, put it in colormap[icolor] */
   412         -{
   413         -    /* Current algorithm: mean weighted by pixels (not colors) */
   414         -    /* Note it is important to get the rounding correct! */
   415         -    ColorFreq *histp;
   416         -    int R, G, B;
   417         -    int Rmin, Rmax;
   418         -    int Gmin, Gmax;
   419         -    int Bmin, Bmax;
   420         -    unsigned long count;
   421         -    unsigned long total = 0;
   422         -    unsigned long Rtotal = 0;
   423         -    unsigned long Gtotal = 0;
   424         -    unsigned long Btotal = 0;
   425         -    int pixel;
   426         -    int r;
   427         -    int g;
   428         -    int b;
   429         -
   430         -    Rmin = boxp->Rmin;
   431         -    Rmax = boxp->Rmax;
   432         -    Gmin = boxp->Gmin;
   433         -    Gmax = boxp->Gmax;
   434         -    Bmin = boxp->Bmin;
   435         -    Bmax = boxp->Bmax;
   436         -
   437         -    for (R = Rmin; R <= Rmax; R++)
   438         -	for (G = Gmin; G <= Gmax; G++)
   439         -	  {
   440         -	      histp = histogram + R * MR + G * MG + Bmin;
   441         -	      for (B = Bmin; B <= Bmax; B++)
   442         -		{
   443         -		    if ((count = *histp++) != 0)
   444         -		      {
   445         -			  total += count;
   446         -			  Rtotal +=
   447         -			      ((R << R_SHIFT) + ((1 << R_SHIFT) >> 1)) * count;
   448         -			  Gtotal +=
   449         -			      ((G << G_SHIFT) + ((1 << G_SHIFT) >> 1)) * count;
   450         -			  Btotal +=
   451         -			      ((B << B_SHIFT) + ((1 << B_SHIFT) >> 1)) * count;
   452         -		      }
   453         -		}
   454         -	  }
   455         -
   456         -    r = (unsigned char) ((Rtotal + (total >> 1)) / total);
   457         -    g = (unsigned char) ((Gtotal + (total >> 1)) / total);
   458         -    b = (unsigned char) ((Btotal + (total >> 1)) / total);
   459         -    pixel = true_color (r, g, b);
   460         -    quantobj->cmap[icolor] = pixel;
   461         -    quantobj->freq[icolor] = total;
   462         -}
   463         -
   464         -
   465         -static void
   466         -select_colors_rgb (QuantizeObj * quantobj, Histogram histogram)
   467         -/* Master routine for color selection */
   468         -{
   469         -    boxptr boxlist;
   470         -    int numboxes;
   471         -    int desired = quantobj->desired_number_of_colors;
   472         -    int i;
   473         -
   474         -    /* Allocate workspace for box list */
   475         -    boxlist = malloc (desired * sizeof (box));
   476         -
   477         -    /* Initialize one box containing whole space */
   478         -    numboxes = 1;
   479         -    boxlist[0].Rmin = 0;
   480         -    boxlist[0].Rmax = (1 << PRECISION_R) - 1;
   481         -    boxlist[0].Gmin = 0;
   482         -    boxlist[0].Gmax = (1 << PRECISION_G) - 1;
   483         -    boxlist[0].Bmin = 0;
   484         -    boxlist[0].Bmax = (1 << PRECISION_B) - 1;
   485         -    /* Shrink it to actually-used volume and set its statistics */
   486         -    update_box_rgb (histogram, boxlist);
   487         -    /* Perform median-cut to produce final box list */
   488         -    numboxes = median_cut_rgb (histogram, boxlist, numboxes, desired);
   489         -    quantobj->actual_number_of_colors = numboxes;
   490         -    /* Compute the representative color for each box, fill colormap */
   491         -    for (i = 0; i < numboxes; i++)
   492         -	compute_color_rgb (quantobj, histogram, boxlist + i, i);
   493         -    free (boxlist);
   494         -}
   495         -
   496         -
   497         -/*
   498         - * These routines are concerned with the time-critical task of mapping input
   499         - * colors to the nearest color in the selected colormap.
   500         - *
   501         - * We re-use the histogram space as an "inverse color map", essentially a
   502         - * cache for the results of nearest-color searches.  All colors within a
   503         - * histogram cell will be mapped to the same colormap entry, namely the one
   504         - * closest to the cell's center.  This may not be quite the closest entry to
   505         - * the actual input color, but it's almost as good.  A zero in the cache
   506         - * indicates we haven't found the nearest color for that cell yet; the array
   507         - * is cleared to zeroes before starting the mapping pass.  When we find the
   508         - * nearest color for a cell, its colormap index plus one is recorded in the
   509         - * cache for future use.  The pass2 scanning routines call fill_inverse_cmap
   510         - * when they need to use an unfilled entry in the cache.
   511         - *
   512         - * Our method of efficiently finding nearest colors is based on the "locally
   513         - * sorted search" idea described by Heckbert and on the incremental distance
   514         - * calculation described by Spencer W. Thomas in chapter III.1 of Graphics
   515         - * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that
   516         - * the distances from a given colormap entry to each cell of the histogram can
   517         - * be computed quickly using an incremental method: the differences between
   518         - * distances to adjacent cells themselves differ by a constant.  This allows a
   519         - * fairly fast implementation of the "brute force" approach of computing the
   520         - * distance from every colormap entry to every histogram cell.  Unfortunately,
   521         - * it needs a work array to hold the best-distance-so-far for each histogram
   522         - * cell (because the inner loop has to be over cells, not colormap entries).
   523         - * The work array elements have to be ints, so the work array would need
   524         - * 256Kb at our recommended precision.  This is not feasible in DOS machines.
   525         -
   526         -[ 256*1024/4 = 65,536 ]
   527         -
   528         - * To get around these problems, we apply Thomas' method to compute the
   529         - * nearest colors for only the cells within a small subbox of the histogram.
   530         - * The work array need be only as big as the subbox, so the memory usage
   531         - * problem is solved.  Furthermore, we need not fill subboxes that are never
   532         - * referenced in pass2; many images use only part of the color gamut, so a
   533         - * fair amount of work is saved.  An additional advantage of this
   534         - * approach is that we can apply Heckbert's locality criterion to quickly
   535         - * eliminate colormap entries that are far away from the subbox; typically
   536         - * three-fourths of the colormap entries are rejected by Heckbert's criterion,
   537         - * and we need not compute their distances to individual cells in the subbox.
   538         - * The speed of this approach is heavily influenced by the subbox size: too
   539         - * small means too much overhead, too big loses because Heckbert's criterion
   540         - * can't eliminate as many colormap entries.  Empirically the best subbox
   541         - * size seems to be about 1/512th of the histogram (1/8th in each direction).
   542         - *
   543         - * Thomas' article also describes a refined method which is asymptotically
   544         - * faster than the brute-force method, but it is also far more complex and
   545         - * cannot efficiently be applied to small subboxes.  It is therefore not
   546         - * useful for programs intended to be portable to DOS machines.  On machines
   547         - * with plenty of memory, filling the whole histogram in one shot with Thomas'
   548         - * refined method might be faster than the present code --- but then again,
   549         - * it might not be any faster, and it's certainly more complicated.
   550         - */
   551         -
   552         -/* log2(histogram cells in update box) for each axis; this can be adjusted */
   553         -#define BOX_R_LOG  (PRECISION_R-3)
   554         -#define BOX_G_LOG  (PRECISION_G-3)
   555         -#define BOX_B_LOG  (PRECISION_B-3)
   556         -
   557         -#define BOX_R_ELEMS  (1<<BOX_R_LOG)	/* # of hist cells in update box */
   558         -#define BOX_G_ELEMS  (1<<BOX_G_LOG)
   559         -#define BOX_B_ELEMS  (1<<BOX_B_LOG)
   560         -
   561         -#define BOX_R_SHIFT  (R_SHIFT + BOX_R_LOG)
   562         -#define BOX_G_SHIFT  (G_SHIFT + BOX_G_LOG)
   563         -#define BOX_B_SHIFT  (B_SHIFT + BOX_B_LOG)
   564         -
   565         -/*
   566         - * The next three routines implement inverse colormap filling.  They could
   567         - * all be folded into one big routine, but splitting them up this way saves
   568         - * some stack space (the mindist[] and bestdist[] arrays need not coexist)
   569         - * and may allow some compilers to produce better code by registerizing more
   570         - * inner-loop variables.
   571         - */
   572         -
   573         -static int
   574         -find_nearby_colors (QuantizeObj * quantobj, int minR, int minG,
   575         -		    int minB, int *colorlist)
   576         -/* Locate the colormap entries close enough to an update box to be candidates
   577         - * for the nearest entry to some cell(s) in the update box.  The update box
   578         - * is specified by the center coordinates of its first cell.  The number of
   579         - * candidate colormap entries is returned, and their colormap indexes are
   580         - * placed in colorlist[].
   581         - * This routine uses Heckbert's "locally sorted search" criterion to select
   582         - * the colors that need further consideration.
   583         - */
   584         -{
   585         -    int numcolors = quantobj->actual_number_of_colors;
   586         -    int maxR, maxG, maxB;
   587         -    int centerR, centerG, centerB;
   588         -    int i, x, ncolors;
   589         -    int minmaxdist, min_dist = 0, max_dist, tdist;
   590         -    int mindist[MAXNUMCOLORS];	/* min distance to colormap entry i */
   591         -    int pixel;
   592         -    int r;
   593         -    int g;
   594         -    int b;
   595         -
   596         -    /* Compute TRUE coordinates of update box's upper corner and center.
   597         -     * Actually we compute the coordinates of the center of the upper-corner
   598         -     * histogram cell, which are the upper bounds of the volume we care about.
   599         -     * Note that since ">>" rounds down, the "center" values may be closer to
   600         -     * min than to max; hence comparisons to them must be "<=", not "<".
   601         -     */
   602         -    maxR = minR + ((1 << BOX_R_SHIFT) - (1 << R_SHIFT));
   603         -    centerR = (minR + maxR) >> 1;
   604         -    maxG = minG + ((1 << BOX_G_SHIFT) - (1 << G_SHIFT));
   605         -    centerG = (minG + maxG) >> 1;
   606         -    maxB = minB + ((1 << BOX_B_SHIFT) - (1 << B_SHIFT));
   607         -    centerB = (minB + maxB) >> 1;
   608         -
   609         -    /* For each color in colormap, find:
   610         -     *  1. its minimum squared-distance to any point in the update box
   611         -     *     (zero if color is within update box);
   612         -     *  2. its maximum squared-distance to any point in the update box.
   613         -     * Both of these can be found by considering only the corners of the box.
   614         -     * We save the minimum distance for each color in mindist[];
   615         -     * only the smallest maximum distance is of interest.
   616         -     */
   617         -    minmaxdist = 0x7FFFFFFFL;
   618         -
   619         -    for (i = 0; i < numcolors; i++)
   620         -      {
   621         -	  /* We compute the squared-R-distance term, then add in the other two. */
   622         -	  pixel = quantobj->cmap[i];
   623         -	  r = true_color_get_red (pixel);
   624         -	  g = true_color_get_green (pixel);
   625         -	  b = true_color_get_blue (pixel);
   626         -	  x = r;
   627         -	  if (x < minR)
   628         -	    {
   629         -		tdist = (x - minR) R_SCALE;
   630         -		min_dist = tdist * tdist;
   631         -		tdist = (x - maxR) R_SCALE;
   632         -		max_dist = tdist * tdist;
   633         -	    }
   634         -	  else if (x > maxR)
   635         -	    {
   636         -		tdist = (x - maxR) R_SCALE;
   637         -		min_dist = tdist * tdist;
   638         -		tdist = (x - minR) R_SCALE;
   639         -		max_dist = tdist * tdist;
   640         -	    }
   641         -	  else
   642         -	    {
   643         -		/* within cell range so no contribution to min_dist */
   644         -		min_dist = 0;
   645         -		if (x <= centerR)
   646         -		  {
   647         -		      tdist = (x - maxR) R_SCALE;
   648         -		      max_dist = tdist * tdist;
   649         -		  }
   650         -		else
   651         -		  {
   652         -		      tdist = (x - minR) R_SCALE;
   653         -		      max_dist = tdist * tdist;
   654         -		  }
   655         -	    }
   656         -
   657         -	  x = g;
   658         -	  if (x < minG)
   659         -	    {
   660         -		tdist = (x - minG) G_SCALE;
   661         -		min_dist += tdist * tdist;
   662         -		tdist = (x - maxG) G_SCALE;
   663         -		max_dist += tdist * tdist;
   664         -	    }
   665         -	  else if (x > maxG)
   666         -	    {
   667         -		tdist = (x - maxG) G_SCALE;
   668         -		min_dist += tdist * tdist;
   669         -		tdist = (x - minG) G_SCALE;
   670         -		max_dist += tdist * tdist;
   671         -	    }
   672         -	  else
   673         -	    {
   674         -		/* within cell range so no contribution to min_dist */
   675         -		if (x <= centerG)
   676         -		  {
   677         -		      tdist = (x - maxG) G_SCALE;
   678         -		      max_dist += tdist * tdist;
   679         -		  }
   680         -		else
   681         -		  {
   682         -		      tdist = (x - minG) G_SCALE;
   683         -		      max_dist += tdist * tdist;
   684         -		  }
   685         -	    }
   686         -
   687         -	  x = b;
   688         -	  if (x < minB)
   689         -	    {
   690         -		tdist = (x - minB) B_SCALE;
   691         -		min_dist += tdist * tdist;
   692         -		tdist = (x - maxB) B_SCALE;
   693         -		max_dist += tdist * tdist;
   694         -	    }
   695         -	  else if (x > maxB)
   696         -	    {
   697         -		tdist = (x - maxB) B_SCALE;
   698         -		min_dist += tdist * tdist;
   699         -		tdist = (x - minB) B_SCALE;
   700         -		max_dist += tdist * tdist;
   701         -	    }
   702         -	  else
   703         -	    {
   704         -		/* within cell range so no contribution to min_dist */
   705         -		if (x <= centerB)
   706         -		  {
   707         -		      tdist = (x - maxB) B_SCALE;
   708         -		      max_dist += tdist * tdist;
   709         -		  }
   710         -		else
   711         -		  {
   712         -		      tdist = (x - minB) B_SCALE;
   713         -		      max_dist += tdist * tdist;
   714         -		  }
   715         -	    }
   716         -
   717         -	  mindist[i] = min_dist;	/* save away the results */
   718         -	  if (max_dist < minmaxdist)
   719         -	      minmaxdist = max_dist;
   720         -      }
   721         -
   722         -    /* Now we know that no cell in the update box is more than minmaxdist
   723         -     * away from some colormap entry.  Therefore, only colors that are
   724         -     * within minmaxdist of some part of the box need be considered.
   725         -     */
   726         -    ncolors = 0;
   727         -    for (i = 0; i < numcolors; i++)
   728         -      {
   729         -	  if (mindist[i] <= minmaxdist)
   730         -	      colorlist[ncolors++] = i;
   731         -      }
   732         -    return ncolors;
   733         -}
   734         -
   735         -
   736         -static void
   737         -find_best_colors (QuantizeObj * quantobj, int minR, int minG,
   738         -		  int minB, int numcolors, int *colorlist, int *bestcolor)
   739         -/* Find the closest colormap entry for each cell in the update box,
   740         -  given the list of candidate colors prepared by find_nearby_colors.
   741         -  Return the indexes of the closest entries in the bestcolor[] array.
   742         -  This routine uses Thomas' incremental distance calculation method to
   743         -  find the distance from a colormap entry to successive cells in the box.
   744         - */
   745         -{
   746         -    int iR, iG, iB;
   747         -    int i, icolor;
   748         -    int *bptr;			/* pointer into bestdist[] array */
   749         -    int *cptr;			/* pointer into bestcolor[] array */
   750         -    int dist0, dist1;		/* initial distance values */
   751         -    int dist2;			/* current distance in inner loop */
   752         -    int xx0, xx1;		/* distance increments */
   753         -    int xx2;
   754         -    int inR, inG, inB;		/* initial values for increments */
   755         -    int pixel;
   756         -    int r;
   757         -    int g;
   758         -    int b;
   759         -
   760         -    /* This array holds the distance to the nearest-so-far color for each cell */
   761         -    int bestdist[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS];
   762         -
   763         -    /* Initialize best-distance for each cell of the update box */
   764         -    bptr = bestdist;
   765         -    for (i = BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS - 1; i >= 0; i--)
   766         -	*bptr++ = 0x7FFFFFFFL;
   767         -
   768         -    /* For each color selected by find_nearby_colors,
   769         -     * compute its distance to the center of each cell in the box.
   770         -     * If that's less than best-so-far, update best distance and color number.
   771         -     */
   772         -
   773         -    /* Nominal steps between cell centers ("x" in Thomas article) */
   774         -#define STEP_R  ((1 << R_SHIFT) R_SCALE)
   775         -#define STEP_G  ((1 << G_SHIFT) G_SCALE)
   776         -#define STEP_B  ((1 << B_SHIFT) B_SCALE)
   777         -
   778         -    for (i = 0; i < numcolors; i++)
   779         -      {
   780         -	  icolor = colorlist[i];
   781         -	  /* Compute (square of) distance from minR/G/B to this color */
   782         -	  pixel = quantobj->cmap[icolor];
   783         -	  r = true_color_get_red (pixel);
   784         -	  g = true_color_get_green (pixel);
   785         -	  b = true_color_get_blue (pixel);
   786         -	  inR = (minR - r) R_SCALE;
   787         -	  dist0 = inR * inR;
   788         -	  inG = (minG - g) G_SCALE;
   789         -	  dist0 += inG * inG;
   790         -	  inB = (minB - b) B_SCALE;
   791         -	  dist0 += inB * inB;
   792         -	  /* Form the initial difference increments */
   793         -	  inR = inR * (2 * STEP_R) + STEP_R * STEP_R;
   794         -	  inG = inG * (2 * STEP_G) + STEP_G * STEP_G;
   795         -	  inB = inB * (2 * STEP_B) + STEP_B * STEP_B;
   796         -	  /* Now loop over all cells in box, updating distance per Thomas method */
   797         -	  bptr = bestdist;
   798         -	  cptr = bestcolor;
   799         -	  xx0 = inR;
   800         -	  for (iR = BOX_R_ELEMS - 1; iR >= 0; iR--)
   801         -	    {
   802         -		dist1 = dist0;
   803         -		xx1 = inG;
   804         -		for (iG = BOX_G_ELEMS - 1; iG >= 0; iG--)
   805         -		  {
   806         -		      dist2 = dist1;
   807         -		      xx2 = inB;
   808         -		      for (iB = BOX_B_ELEMS - 1; iB >= 0; iB--)
   809         -			{
   810         -			    if (dist2 < *bptr)
   811         -			      {
   812         -				  *bptr = dist2;
   813         -				  *cptr = icolor;
   814         -			      }
   815         -			    dist2 += xx2;
   816         -			    xx2 += 2 * STEP_B * STEP_B;
   817         -			    bptr++;
   818         -			    cptr++;
   819         -			}
   820         -		      dist1 += xx1;
   821         -		      xx1 += 2 * STEP_G * STEP_G;
   822         -		  }
   823         -		dist0 += xx0;
   824         -		xx0 += 2 * STEP_R * STEP_R;
   825         -	    }
   826         -      }
   827         -}
   828         -
   829         -static void
   830         -fill_inverse_cmap_rgb (QuantizeObj * quantobj, Histogram histogram,
   831         -		       int R, int G, int B)
   832         -/* Fill the inverse-colormap entries in the update box that contains
   833         - histogram cell R/G/B.  (Only that one cell MUST be filled, but
   834         - we can fill as many others as we wish.) */
   835         -{
   836         -    int minR, minG, minB;	/* lower left corner of update box */
   837         -    int iR, iG, iB;
   838         -    int *cptr;			/* pointer into bestcolor[] array */
   839         -    ColorFreq *cachep;		/* pointer into main cache array */
   840         -    /* This array lists the candidate colormap indexes. */
   841         -    int colorlist[MAXNUMCOLORS];
   842         -    int numcolors;		/* number of candidate colors */
   843         -    /* This array holds the actually closest colormap index for each cell. */
   844         -    int bestcolor[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS];
   845         -
   846         -    /* Convert cell coordinates to update box ID */
   847         -    R >>= BOX_R_LOG;
   848         -    G >>= BOX_G_LOG;
   849         -    B >>= BOX_B_LOG;
   850         -
   851         -    /* Compute TRUE coordinates of update box's origin corner.
   852         -     * Actually we compute the coordinates of the center of the corner
   853         -     * histogram cell, which are the lower bounds of the volume we care about.
   854         -     */
   855         -    minR = (R << BOX_R_SHIFT) + ((1 << R_SHIFT) >> 1);
   856         -    minG = (G << BOX_G_SHIFT) + ((1 << G_SHIFT) >> 1);
   857         -    minB = (B << BOX_B_SHIFT) + ((1 << B_SHIFT) >> 1);
   858         -
   859         -    /* Determine which colormap entries are close enough to be candidates
   860         -     * for the nearest entry to some cell in the update box.
   861         -     */
   862         -    numcolors = find_nearby_colors (quantobj, minR, minG, minB, colorlist);
   863         -
   864         -    /* Determine the actually nearest colors. */
   865         -    find_best_colors (quantobj, minR, minG, minB, numcolors, colorlist,
   866         -		      bestcolor);
   867         -
   868         -    /* Save the best color numbers (plus 1) in the main cache array */
   869         -    R <<= BOX_R_LOG;		/* convert ID back to base cell indexes */
   870         -    G <<= BOX_G_LOG;
   871         -    B <<= BOX_B_LOG;
   872         -    cptr = bestcolor;
   873         -    for (iR = 0; iR < BOX_R_ELEMS; iR++)
   874         -      {
   875         -	  for (iG = 0; iG < BOX_G_ELEMS; iG++)
   876         -	    {
   877         -		cachep = &histogram[(R + iR) * MR + (G + iG) * MG + B];
   878         -		for (iB = 0; iB < BOX_B_ELEMS; iB++)
   879         -		  {
   880         -		      *cachep++ = (*cptr++) + 1;
   881         -		  }
   882         -	    }
   883         -      }
   884         -}
   885         -
   886         -/*  This is pass 1  */
   887         -static void
   888         -median_cut_pass1_rgb (QuantizeObj * quantobj, rasterliteImagePtr image)
   889         -{
   890         -    generate_histogram_rgb (quantobj->histogram, image);
   891         -    select_colors_rgb (quantobj, quantobj->histogram);
   892         -}
   893         -
   894         -
   895         -/* Map some rows of pixels to the output colormapped representation. */
   896         -static void
   897         -median_cut_pass2_rgb (QuantizeObj * quantobj, rasterliteImagePtr image)
   898         - /* This version performs no dithering */
   899         -{
   900         -    Histogram histogram = quantobj->histogram;
   901         -    ColorFreq *cachep;
   902         -    int R, G, B;
   903         -    int origR, origG, origB;
   904         -    int row, col;
   905         -    int width = image->sx;
   906         -    int height = image->sy;
   907         -    int pixel;
   908         -
   909         -    zero_histogram_rgb (histogram);
   910         -
   911         -    for (row = 0; row < height; row++)
   912         -      {
   913         -	  for (col = 0; col < width; col++)
   914         -	    {
   915         -		/* get pixel value and index into the cache */
   916         -		pixel = image->pixels[row][col];
   917         -		origR = true_color_get_red (pixel);
   918         -		origG = true_color_get_green (pixel);
   919         -		origB = true_color_get_blue (pixel);
   920         -
   921         -		/* get pixel value and index into the cache */
   922         -		R = origR >> R_SHIFT;
   923         -		G = origG >> G_SHIFT;
   924         -		B = origB >> B_SHIFT;
   925         -		cachep = &histogram[R * MR + G * MG + B];
   926         -		/* If we have not seen this color before, find nearest
   927         -		   colormap entry and update the cache */
   928         -		if (*cachep == 0)
   929         -		  {
   930         -		      fill_inverse_cmap_rgb (quantobj, histogram, R, G, B);
   931         -		  }
   932         -		/* Now emit the colormap index for this cell */
   933         -		pixel = quantobj->cmap[*cachep - 1];
   934         -		image->pixels[row][col] = pixel;
   935         -	    }
   936         -      }
   937         -}
   938         -
   939         -static QuantizeObj *
   940         -initialize_median_cut (int num_colors)
   941         -{
   942         -    QuantizeObj *quantobj;
   943         -
   944         -    /* Initialize the data structures */
   945         -    quantobj = malloc (sizeof (QuantizeObj));
   946         -
   947         -    quantobj->histogram = malloc (sizeof (ColorFreq) *
   948         -				  HIST_R_ELEMS * HIST_G_ELEMS * HIST_B_ELEMS);
   949         -    quantobj->desired_number_of_colors = num_colors;
   950         -
   951         -    return quantobj;
   952         -}
   953         -
   954         -static void
   955         -quantize_object_free (QuantizeObj * quantobj)
   956         -{
   957         -    free (quantobj->histogram);
   958         -    free (quantobj);
   959         -}
   960         -
   961         -extern void
   962         -image_resample_as_palette256 (const rasterliteImagePtr img)
   963         -{
   964         -/* applies quantization to the current image, so to get 256 colors */
   965         -    QuantizeObj *quantobj;
   966         -
   967         -    /* If a pointer was sent in, let's use it. */
   968         -    quantobj = initialize_median_cut (256);
   969         -    median_cut_pass1_rgb (quantobj, img);
   970         -    median_cut_pass2_rgb (quantobj, img);
   971         -    quantize_object_free (quantobj);
   972         -}

Changes to lib/rasterlite_tiff.c.

     1      1   /* 
     2      2   / rasterlite_tiff.c
     3      3   /
     4      4   / TIFF auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50     27   #include <stdio.h>
    51     28   #include <math.h>
    52     29   #include <string.h>
    53     30   #include <stdlib.h>
    54     31   
    55         -#include "rasterlite_tiff_hdrs.h"
           32  +#include <geotiff.h>
           33  +#include <xtiffio.h>
           34  +#include <geo_tiffp.h>
           35  +#include <geo_keyp.h>
           36  +#include <geovalues.h>
           37  +#include <geo_normalize.h>
    56     38   
    57         -#ifdef SPATIALITE_AMALGAMATION
    58     39   #include <spatialite/sqlite3.h>
    59         -#else
    60         -#include <sqlite3.h>
    61         -#endif
    62         -
    63     40   #include <spatialite/gaiageo.h>
    64     41   
    65     42   #include "rasterlite_internals.h"
    66     43   
    67     44   struct memfile
    68     45   {
    69     46   /* a struct emulating a file [memory mapped] */
................................................................................
   166    143   {
   167    144       if (clientdata || data || offset)
   168    145   	return;			/* does absolutely nothing - required in order to suppress warnings */
   169    146       return;
   170    147   }
   171    148   
   172    149   extern void *
   173         -image_to_tiff_fax4 (const rasterliteImagePtr img, int *size)
          150  +image_to_tiff_fax4 (const rasterliteImagePrt img, int *size)
   174    151   {
   175    152   /* compressing a bi-level (monocrhome) image as TIFF FAX-4 */
   176    153       unsigned char *tiff_image = NULL;
   177    154       TIFF *out;
   178    155       int row;
   179    156       int col;
   180    157       int strip_rows;
................................................................................
   295    272   	  *size = clientdata.eof;
   296    273         }
   297    274       free (clientdata.buffer);
   298    275       return tiff_image;
   299    276   }
   300    277   
   301    278   extern void *
   302         -image_to_tiff_palette (const rasterliteImagePtr img, int *size)
          279  +image_to_tiff_palette (const rasterliteImagePrt img, int *size)
   303    280   {
   304    281   /* compressing a palettte image as TIFF  PALETTE */
   305    282       unsigned char *tiff_image = NULL;
   306    283       TIFF *out;
   307    284       int row;
   308    285       int col;
   309    286       int extimated_size;
................................................................................
   392    369   	  *size = clientdata.eof;
   393    370         }
   394    371       free (clientdata.buffer);
   395    372       return tiff_image;
   396    373   }
   397    374   
   398    375   extern void *
   399         -image_to_tiff_grayscale (const rasterliteImagePtr img, int *size)
          376  +image_to_tiff_grayscale (const rasterliteImagePrt img, int *size)
   400    377   {
   401    378   /* compressing a grayscale image as TIFF  GRAYSCALE */
   402    379       unsigned char *tiff_image = NULL;
   403    380       TIFF *out;
   404    381       int row;
   405    382       int col;
   406    383       int extimated_size;
................................................................................
   458    435   	  *size = clientdata.eof;
   459    436         }
   460    437       free (clientdata.buffer);
   461    438       return tiff_image;
   462    439   }
   463    440   
   464    441   extern void *
   465         -image_to_tiff_rgb (const rasterliteImagePtr img, int *size)
          442  +image_to_tiff_rgb (const rasterliteImagePrt img, int *size)
   466    443   {
   467    444   /* compressing an RGBimage as TIFF  RGB */
   468    445       unsigned char *tiff_image = NULL;
   469    446       TIFF *out;
   470    447       int row;
   471    448       int col;
   472    449       int extimated_size;
................................................................................
   525    502   	  memcpy (tiff_image, clientdata.buffer, clientdata.eof);
   526    503   	  *size = clientdata.eof;
   527    504         }
   528    505       free (clientdata.buffer);
   529    506       return tiff_image;
   530    507   }
   531    508   
   532         -extern rasterliteImagePtr
          509  +extern rasterliteImagePrt
   533    510   image_from_tiff (int size, const void *data)
   534    511   {
   535    512   /* uncompressing a TIFF */
   536         -    rasterliteImagePtr img;
          513  +    rasterliteImagePrt img;
   537    514       uint16 bits_per_sample;
   538    515       uint16 samples_per_pixel;
   539    516       uint16 photometric;
   540    517       uint32 width = 0;
   541    518       uint32 height = 0;
   542    519       uint32 rows_strip = 0;
   543    520       uint32 *raster = NULL;

Deleted lib/rasterlite_version.c.

     1         -/* 
     2         -/ rasterlite_version.c
     3         -/
     4         -/ Version numbers
     5         -/
     6         -/ version 1.1a, 2011 November 12
     7         -/
     8         -/ Author: Sandro Furieri a.furieri@lqt.it
     9         -/
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
    23         -/
    24         -/ The Original Code is the RasterLite library
    25         -/
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43         -*/
    44         -#include "config.h"
    45         -
    46         -#ifdef SPATIALITE_AMALGAMATION
    47         -#include <spatialite/sqlite3.h>
    48         -#else
    49         -#include <sqlite3.h>
    50         -#endif
    51         -
    52         -#include "rasterlite.h"
    53         -
    54         -const char rasterliteversion[] = VERSION;
    55         -
    56         -RASTERLITE_DECLARE const char *
    57         -rasterliteGetVersion (void)
    58         -{
    59         -    return rasterliteversion;
    60         -}

Added lib/rasterlite_wavelet.c.

            1  +/* 
            2  +/ rasterlite_wavelet.c
            3  +/
            4  +/ WAVELET auxiliary helpers
            5  +/
            6  +/ version 1.0, 2009 June 5
            7  +/
            8  +/ Author: Sandro Furieri a.furieri@lqt.it
            9  +/
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
           21  +/
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
           24  +/
           25  +*/
           26  +
           27  +#include <stdio.h>
           28  +#include <math.h>
           29  +#include <string.h>
           30  +#include <stdlib.h>
           31  +
           32  +#include <epsilon.h>
           33  +
           34  +#include <spatialite/sqlite3.h>
           35  +#include <spatialite/gaiageo.h>
           36  +
           37  +#include <tiffio.h>
           38  +
           39  +#include "rasterlite_internals.h"
           40  +
           41  +/* 
           42  +/
           43  +/ this code is widely based upon the cmd_encode_file.c 
           44  +/ source from the 'epsilon' library
           45  +/
           46  +*/
           47  +
           48  +#define BIORTHOGONAL	1
           49  +
           50  +#define MAX(_x, _y)		((_x) > (_y) ? (_x) : (_y))
           51  +
           52  +typedef struct decode_ctx_tag
           53  +{
           54  +    int buf_size;
           55  +    int n_blocks;
           56  +    int *done_blocks;
           57  +    int W;
           58  +    int H;
           59  +    int max_block_w;
           60  +    int max_block_h;
           61  +    rasterliteImagePrt img;
           62  +    int image_type;
           63  +    unsigned char *input;
           64  +    int in_size;
           65  +    int in_base;
           66  +    int in_current;
           67  +    int *clear_len;
           68  +    int *stop_flag;
           69  +} decode_ctx;
           70  +
           71  +typedef struct encode_ctx_tag
           72  +{
           73  +    char *filter_id;
           74  +    int block_size;
           75  +    int mode;
           76  +    int bytes_per_block;
           77  +    double Y_ratio;
           78  +    double Cb_ratio;
           79  +    double Cr_ratio;
           80  +    int resample;
           81  +    int W;
           82  +    int H;
           83  +    rasterliteImagePrt img;
           84  +    int image_type;
           85  +    unsigned char *output;
           86  +    int out_size;
           87  +    int out_current;
           88  +    int n_blocks;
           89  +    int *done_blocks;
           90  +    int *clear_len;
           91  +    int *stop_flag;
           92  +} encode_ctx;
           93  +
           94  +static int
           95  +get_byte (decode_ctx * ctx)
           96  +{
           97  +/* fetching the next byte from the input source */
           98  +    if (ctx->in_current < ctx->in_size)
           99  +	return *(ctx->input + ctx->in_current++);
          100  +    return EOF;
          101  +}
          102  +
          103  +static int
          104  +decoder_read_next_block (decode_ctx * ctx, unsigned char *buf, int *buf_size)
          105  +{
          106  +/* inserting input into the input buffer [decompressed image] */
          107  +    unsigned char *next_byte;
          108  +    int bytes_left;
          109  +    int ch;
          110  +/* Copy no more than *buf_size bytes */
          111  +    bytes_left = *buf_size;
          112  +    next_byte = buf;
          113  +/* Find first non-marker byte */
          114  +    for (;;)
          115  +      {
          116  +	  ch = get_byte (ctx);
          117  +	  if (ch == EOF)
          118  +	      return 0;
          119  +	  if (ch != EPS_MARKER)
          120  +	    {
          121  +		*next_byte++ = (unsigned char) ch;
          122  +		bytes_left--;
          123  +		break;
          124  +	    }
          125  +      }
          126  +/* Copy data until next marker, EOF or buffer end */
          127  +    for (;;)
          128  +      {
          129  +	  ch = get_byte (ctx);
          130  +	  if ((ch == EOF) || (ch == EPS_MARKER))
          131  +	      break;
          132  +/* No more space in the buffer or currupted data. Continue until EOF or syncronization marker */
          133  +	  if (!bytes_left)
          134  +	      continue;
          135  +	  *next_byte++ = (unsigned char) ch;
          136  +	  bytes_left--;
          137  +      }
          138  +/* Actual number of read bytes */
          139  +    *buf_size = next_byte - buf;
          140  +    return 1;
          141  +}
          142  +
          143  +static int
          144  +guess_wavelet_type (decode_ctx * ctx, int *ext_type, int *width, int *height,
          145  +		    int *max_block_w, int *max_block_h)
          146  +{
          147  +/* Block buffer */
          148  +    unsigned char *buf;
          149  +    int buf_size;
          150  +/* Image characteristics */
          151  +    int W;
          152  +    int H;
          153  +    int w;
          154  +    int h;
          155  +    int type;
          156  +/* Allocate block buffer */
          157  +    buf_size = MAX (EPS_MAX_GRAYSCALE_BUF, EPS_MAX_TRUECOLOR_BUF);
          158  +    buf = (unsigned char *) eps_xmalloc (buf_size);
          159  +    W = H = w = h = type = -1;
          160  +/* For all blocks */
          161  +    while (1)
          162  +      {
          163  +	  eps_block_header hdr;
          164  +	  /* Read next block */
          165  +	  if (!decoder_read_next_block (ctx, buf, &buf_size))
          166  +	      break;
          167  +/* Parse block header */
          168  +	  if (eps_read_block_header (buf, buf_size, &hdr) != EPS_OK)
          169  +	      continue;
          170  +/* Check block header CRC */
          171  +	  if (hdr.chk_flag == EPS_BAD_CRC)
          172  +	      continue;
          173  +/* Image type */
          174  +	  if (type == -1)
          175  +	      type = hdr.block_type;
          176  +	  else
          177  +	    {
          178  +		if (type != hdr.block_type)
          179  +		    return 0;
          180  +	    }
          181  +/* Image width */
          182  +	  if (W == -1)
          183  +	      W = type == EPS_GRAYSCALE_BLOCK ? hdr.uhdr.gs.W : hdr.uhdr.tc.W;
          184  +	  else
          185  +	    {
          186  +		if (type == EPS_GRAYSCALE_BLOCK ? W != hdr.uhdr.gs.W : W !=
          187  +		    hdr.uhdr.tc.W)
          188  +		    return 0;
          189  +	    }
          190  +/* Image height */
          191  +	  if (H == -1)
          192  +	      H = type == EPS_GRAYSCALE_BLOCK ? hdr.uhdr.gs.H : hdr.uhdr.tc.H;
          193  +	  else
          194  +	    {
          195  +		if (type == EPS_GRAYSCALE_BLOCK ? H != hdr.uhdr.gs.H : H !=
          196  +		    hdr.uhdr.tc.H)
          197  +		    return 0;
          198  +	    }
          199  +/* Maximal block width and height */
          200  +	  if (type == EPS_GRAYSCALE_BLOCK)
          201  +	    {
          202  +		if (hdr.uhdr.gs.w > w)
          203  +		    w = hdr.uhdr.gs.w;
          204  +		if (hdr.uhdr.gs.h > h)
          205  +		    h = hdr.uhdr.gs.h;
          206  +	    }
          207  +	  else
          208  +	    {
          209  +		if (hdr.uhdr.tc.w > w)
          210  +		    w = hdr.uhdr.tc.w;
          211  +		if (hdr.uhdr.tc.h > h)
          212  +		    h = hdr.uhdr.tc.h;
          213  +	    }
          214  +      }
          215  +/* Rewind file and free buffer */
          216  +    ctx->in_current = ctx->in_base;
          217  +    free (buf);
          218  +/* Buggy file */
          219  +    if (type == -1 || W == -1 || H == -1 || w == -1 || h == -1)
          220  +	return 0;
          221  +/* Save results */
          222  +    *ext_type =
          223  +	(type == EPS_GRAYSCALE_BLOCK) ? IMAGE_WAVELET_BW : IMAGE_WAVELET_RGB;
          224  +    *width = W;
          225  +    *height = H;
          226  +    *max_block_w = w;
          227  +    *max_block_h = h;
          228  +    return 1;
          229  +}
          230  +
          231  +static int
          232  +encoder_read_grayscale (rasterliteImagePrt img, unsigned char **Y, int x,
          233  +			int y, int width, int height)
          234  +{
          235  +/* fetching GRAYSCALE pixels from the uncompressed image */
          236  +    int j;
          237  +    int i;
          238  +    int pixel;
          239  +    int *p_scan;
          240  +/* Check params for consistency */
          241  +    if (x < 0 || y < 0)
          242  +	return 0;
          243  +    if (x >= img->sx || y >= img->sy)
          244  +	return 0;
          245  +    if (width <= 0 || height <= 0)
          246  +	return 0;
          247  +    if (x + width > img->sx)
          248  +	return 0;
          249  +    if (y + height > img->sy)
          250  +	return 0;
          251  +    for (j = 0; j < height; j++)
          252  +      {
          253  +	  /* fetching image rows */
          254  +	  p_scan = img->pixels[y + j];
          255  +	  p_scan += x;
          256  +	  for (i = 0; i < width; i++)
          257  +	    {
          258  +		/* fetching pixel by scanline */
          259  +		pixel = *p_scan++;
          260  +		Y[j][i] = true_color_get_red (pixel);
          261  +	    }
          262  +      }
          263  +    return 1;
          264  +}
          265  +
          266  +static int
          267  +encoder_read_rgb (rasterliteImagePrt img, unsigned char **R, unsigned char **G,
          268  +		  unsigned char **B, int x, int y, int width, int height)
          269  +{
          270  +/* fetching RGB pixels from the uncompressed image */
          271  +    int j;
          272  +    int i;
          273  +    int pixel;
          274  +    int *p_scan;
          275  +/* Check params for consistency */
          276  +    if (x < 0 || y < 0)
          277  +	return 0;
          278  +    if (x >= img->sx || y >= img->sy)
          279  +	return 0;
          280  +    if (width <= 0 || height <= 0)
          281  +	return 0;
          282  +    if (x + width > img->sx)
          283  +	return 0;
          284  +    if (y + height > img->sy)
          285  +	return 0;
          286  +    for (j = 0; j < height; j++)
          287  +      {
          288  +	  /* fetching image rows */
          289  +	  p_scan = img->pixels[y + j];
          290  +	  p_scan += x;
          291  +	  for (i = 0; i < width; i++)
          292  +	    {
          293  +		/* fetching pixel by scanline */
          294  +		pixel = *p_scan++;
          295  +		R[j][i] = true_color_get_red (pixel);
          296  +		G[j][i] = true_color_get_green (pixel);
          297  +		B[j][i] = true_color_get_blue (pixel);
          298  +	    }
          299  +      }
          300  +    return 1;
          301  +}
          302  +
          303  +static int
          304  +decoder_write_grayscale (rasterliteImagePrt img, unsigned char **Y, int x,
          305  +			 int y, int width, int height)
          306  +{
          307  +/* feeding grayscale pixels into the uncompressed image */
          308  +    int i;
          309  +    int j;
          310  +    int gray;
          311  +    int *p_scan;
          312  +/* Check params for consistency */
          313  +    if ((x < 0) || (y < 0))
          314  +	return 0;
          315  +    if (x >= img->sx || y >= img->sy)
          316  +	return 0;
          317  +    if (width <= 0 || height <= 0)
          318  +	return 0;
          319  +    if (x + width > img->sx)
          320  +	return 0;
          321  +    if (y + height > img->sy)
          322  +	return 0;
          323  +    for (j = 0; j < height; j++)
          324  +      {
          325  +	  p_scan = img->pixels[y + j];
          326  +	  p_scan += x;
          327  +	  for (i = 0; i < width; i++)
          328  +	    {
          329  +		gray = Y[j][i];
          330  +		*p_scan++ = true_color (gray, gray, gray);
          331  +	    }
          332  +      }
          333  +    return 1;
          334  +}
          335  +
          336  +static int
          337  +decoder_write_rgb (rasterliteImagePrt img, unsigned char **R,
          338  +		   unsigned char **G, unsigned char **B, int x, int y,
          339  +		   int width, int height)
          340  +{
          341  +/* feeding RGB pixels into the uncompressed image */
          342  +    int i;
          343  +    int j;
          344  +    int red;
          345  +    int green;
          346  +    int blue;
          347  +    int *p_scan;
          348  +/* Check params for consistency */
          349  +    if ((x < 0) || (y < 0))
          350  +	return 0;
          351  +    if (x >= img->sx || y >= img->sy)
          352  +	return 0;
          353  +    if (width <= 0 || height <= 0)
          354  +	return 0;
          355  +    if (x + width > img->sx)
          356  +	return 0;
          357  +    if (y + height > img->sy)
          358  +	return 0;
          359  +    for (j = 0; j < height; j++)
          360  +      {
          361  +	  p_scan = img->pixels[y + j];
          362  +	  p_scan += x;
          363  +	  for (i = 0; i < width; i++)
          364  +	    {
          365  +		red = R[j][i];
          366  +		green = G[j][i];
          367  +		blue = B[j][i];
          368  +		*p_scan++ = true_color (red, green, blue);
          369  +	    }
          370  +      }
          371  +    return 1;
          372  +}
          373  +
          374  +static int
          375  +encoder_write_next_block (encode_ctx * ctx, unsigned char *buf, int buf_size)
          376  +{
          377  +/* inserting output into the output buffer [compressed image] */
          378  +    if (ctx->out_current + buf_size + 1 > ctx->out_size)
          379  +	return 0;
          380  +/* Write data */
          381  +    memcpy (ctx->output + ctx->out_current, buf, buf_size);
          382  +    ctx->out_current += buf_size;
          383  +/* Write syncronization marker */
          384  +    *(ctx->output + ctx->out_current) = EPS_MARKER;
          385  +    ctx->out_current++;
          386  +    return 1;
          387  +}
          388  +
          389  +static int
          390  +encode_blocks (encode_ctx * ctx)
          391  +{
          392  +/* Input buffers */
          393  +    unsigned char **Y;
          394  +    unsigned char **R;
          395  +    unsigned char **G;
          396  +    unsigned char **B;
          397  +/* Output buffer */
          398  +    unsigned char *buf;
          399  +    int buf_size;
          400  +    int x;
          401  +    int y;
          402  +    int w;
          403  +    int h;
          404  +    char header[128];
          405  +/* Handy shortcuts */
          406  +    int block_size = ctx->block_size;
          407  +    int W = ctx->W;
          408  +    int H = ctx->H;
          409  +/* Error flag */
          410  +    int error_flag = 0;
          411  +/* Write wavelet image header */
          412  +    strcpy (header, "StartWaveletsImage$$");
          413  +    if (!encoder_write_next_block
          414  +	(ctx, (unsigned char *) header, strlen (header)))
          415  +      {
          416  +	  error_flag = 1;
          417  +	  fprintf (stderr, "Waveletets-wrapper: Cannot write header\n");
          418  +	  goto error;
          419  +      }
          420  +/* Allocate input buffers */
          421  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          422  +	Y = (unsigned char **) eps_malloc_2D (block_size, block_size,
          423  +					      sizeof (unsigned char));
          424  +    else
          425  +      {
          426  +	  R = (unsigned char **) eps_malloc_2D (block_size, block_size,
          427  +						sizeof (unsigned char));
          428  +	  G = (unsigned char **) eps_malloc_2D (block_size, block_size,
          429  +						sizeof (unsigned char));
          430  +	  B = (unsigned char **) eps_malloc_2D (block_size, block_size,
          431  +						sizeof (unsigned char));
          432  +      }
          433  +/* Allocate output buffer */
          434  +    buf = (unsigned char *) eps_xmalloc (ctx->bytes_per_block);
          435  +/* Process all blocks */
          436  +    for (y = 0; y < H; y += block_size)
          437  +      {
          438  +	  for (x = 0; x < W; x += block_size)
          439  +	    {
          440  +		/* Block width */
          441  +		if (x + block_size > W)
          442  +		    w = W - x;
          443  +		else
          444  +		    w = block_size;
          445  +		/* Block height */
          446  +		if (y + block_size > H)
          447  +		    h = H - y;
          448  +		else
          449  +		    h = block_size;
          450  +		/* Output buffer size (not including marker) */
          451  +		buf_size = ctx->bytes_per_block - 1;
          452  +		if (ctx->image_type == IMAGE_WAVELET_BW)
          453  +		  {
          454  +		      /* Read next block */
          455  +		      if (!encoder_read_grayscale (ctx->img, Y, x, y, w, h))
          456  +			{
          457  +			    error_flag = 1;
          458  +			    fprintf (stderr,
          459  +				     "Waveletets-wrapper: Cannot read block\n");
          460  +			    goto error;
          461  +			}
          462  +		      /* Encode block */
          463  +		      if (eps_encode_grayscale_block
          464  +			  (Y, W, H, w, h, x, y, buf, &buf_size, ctx->filter_id,
          465  +			   ctx->mode) != EPS_OK)
          466  +			{
          467  +			    /* All function parameters are checked at the moment,  so everything except EPS_OK is a logical error. */
          468  +			    error_flag = 1;
          469  +			    fprintf (stderr,
          470  +				     "Waveletets-wrapper: encoder error\n");
          471  +			    goto error;
          472  +			}
          473  +		      /* Write encoded block */
          474  +		      if (!encoder_write_next_block (ctx, buf, buf_size))
          475  +			{
          476  +			    error_flag = 1;
          477  +			    fprintf (stderr,
          478  +				     "Waveletets-wrapper: Cannot write block\n");
          479  +			    goto error;
          480  +			}
          481  +		  }
          482  +		else
          483  +		  {
          484  +		      /* Read next block */
          485  +		      if (!encoder_read_rgb (ctx->img, R, G, B, x, y, w, h))
          486  +			{
          487  +			    error_flag = 1;
          488  +			    fprintf (stderr,
          489  +				     "Waveletets-wrapper: Cannot read block\n");
          490  +			    goto error;
          491  +			}
          492  +		      /* Encode block */
          493  +		      if (eps_encode_truecolor_block
          494  +			  (R, G, B, W, H, w, h, x, y, ctx->resample, buf,
          495  +			   &buf_size, (int) (ctx->Y_ratio),
          496  +			   (int) (ctx->Cb_ratio), (int) (ctx->Cr_ratio),
          497  +			   ctx->filter_id, ctx->mode) != EPS_OK)
          498  +			{
          499  +			    /* All function parameters are checked at the moment,  so everything except EPS_OK is a logical error. */
          500  +			    error_flag = 1;
          501  +			    fprintf (stderr,
          502  +				     "Waveletets-wrapper: encoder error\n");
          503  +			    goto error;
          504  +			}
          505  +		      /* Write encoded block */
          506  +		      if (!encoder_write_next_block (ctx, buf, buf_size))
          507  +			{
          508  +			    error_flag = 1;
          509  +			    fprintf (stderr,
          510  +				     "Waveletets-wrapper: Cannot write block\n");
          511  +			    goto error;
          512  +			}
          513  +		  }
          514  +	    }
          515  +      }
          516  +/* Write wavelet image footer */
          517  +    strcpy (header, "$$EndWaveletsImage");
          518  +    if (!encoder_write_next_block
          519  +	(ctx, (unsigned char *) header, strlen (header)))
          520  +      {
          521  +	  error_flag = 1;
          522  +	  fprintf (stderr, "Waveletets-wrapper: Cannot write footer\n");
          523  +	  goto error;
          524  +      }
          525  +  error:
          526  +/* Free input buffers */
          527  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          528  +	eps_free_2D ((void **) Y, block_size, block_size);
          529  +    else
          530  +      {
          531  +	  eps_free_2D ((void **) R, block_size, block_size);
          532  +	  eps_free_2D ((void **) G, block_size, block_size);
          533  +	  eps_free_2D ((void **) B, block_size, block_size);
          534  +      }
          535  +/* Free output buffer */
          536  +    free (buf);
          537  +/* Return 0 for success or 1 for error */
          538  +    return error_flag;
          539  +}
          540  +
          541  +static void *
          542  +wavelet_compress (rasterliteImagePrt img, int *size, int ratio, int image_type)
          543  +{
          544  +/* preparing the compression */
          545  +    int W;
          546  +    int H;
          547  +    int bytes_per_block;
          548  +    int x_blocks;
          549  +    int y_blocks;
          550  +    int n_blocks;
          551  +    int block_size = 257;
          552  +    int data_size;
          553  +    int done_blocks = 0;
          554  +    int clear_len = 0;
          555  +    int stop_flag = 0;
          556  +    encode_ctx ctx;
          557  +    int ret;
          558  +/* Get image width and height */
          559  +    W = img->sx;
          560  +    H = img->sy;
          561  +    data_size = img->sx * img->sy;
          562  +    if (image_type != IMAGE_WAVELET_BW)
          563  +	data_size *= 3;
          564  +/* Compute number of blocks */
          565  +    if (W % block_size)
          566  +	x_blocks = W / block_size + 1;
          567  +    else
          568  +	x_blocks = W / block_size;
          569  +    if (H % block_size)
          570  +	y_blocks = H / block_size + 1;
          571  +    else
          572  +	y_blocks = H / block_size;
          573  +/* Compute number of bytes per block */
          574  +    n_blocks = x_blocks * y_blocks;
          575  +    bytes_per_block = (int) ((double) data_size / (ratio * n_blocks));
          576  +/* Clip buffer size if needed */
          577  +    if (image_type == IMAGE_WAVELET_BW)
          578  +	bytes_per_block = MAX (bytes_per_block, EPS_MIN_GRAYSCALE_BUF + 1);
          579  +    else
          580  +	bytes_per_block = MAX (bytes_per_block, EPS_MIN_TRUECOLOR_BUF + 1);
          581  +    /* Prepare CTXs */
          582  +    ctx.filter_id = malloc (strlen ("daub97lift") + 1);
          583  +    strcpy (ctx.filter_id, "daub97lift");
          584  +    ctx.block_size = block_size;
          585  +    ctx.mode = EPS_MODE_OTLPF;
          586  +    ctx.bytes_per_block = bytes_per_block;
          587  +    ctx.Y_ratio = EPS_Y_RT;
          588  +    ctx.Cb_ratio = EPS_Cb_RT;
          589  +    ctx.Cr_ratio = EPS_Cr_RT;
          590  +    ctx.resample = EPS_RESAMPLE_420;
          591  +    ctx.W = W;
          592  +    ctx.H = H;
          593  +    ctx.img = img;
          594  +    ctx.image_type = image_type;
          595  +    ctx.output = malloc (1024 * 1024);
          596  +    ctx.out_size = 1024 * 1024;
          597  +    ctx.out_current = 0;
          598  +    ctx.n_blocks = n_blocks;
          599  +    ctx.done_blocks = &done_blocks;
          600  +    ctx.clear_len = &clear_len;
          601  +    ctx.stop_flag = &stop_flag;
          602  +/* performing actual encoding */
          603  +    ret = encode_blocks (&ctx);
          604  +/* memory clean-up */
          605  +    free (ctx.filter_id);
          606  +    if (ret)
          607  +      {
          608  +	  /* error case */
          609  +	  free (ctx.output);
          610  +	  *size = 0;
          611  +	  return NULL;
          612  +      }
          613  +    *size = ctx.out_current;
          614  +    return ctx.output;
          615  +}
          616  +
          617  +static int
          618  +decode_blocks (decode_ctx * ctx)
          619  +{
          620  +/* Input buffer */
          621  +    unsigned char *buf;
          622  +/* Output buffers */
          623  +    unsigned char **Y;
          624  +    unsigned char **R;
          625  +    unsigned char **G;
          626  +    unsigned char **B;
          627  +/* Handy shortcuts */
          628  +    int max_block_w = ctx->max_block_w;
          629  +    int max_block_h = ctx->max_block_h;
          630  +    int W = ctx->W;
          631  +    int H = ctx->H;
          632  +/* Error flag */
          633  +    int error_flag = 0;
          634  +/* Allocate input buffer */
          635  +    buf = (unsigned char *) eps_xmalloc (ctx->buf_size);
          636  +/* Allocate output buffers */
          637  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          638  +	Y = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          639  +					      sizeof (unsigned char));
          640  +    else
          641  +      {
          642  +	  R = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          643  +						sizeof (unsigned char));
          644  +	  G = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          645  +						sizeof (unsigned char));
          646  +	  B = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          647  +						sizeof (unsigned char));
          648  +      }
          649  +/* Process blocks */
          650  +    while (1)
          651  +      {
          652  +	  eps_block_header hdr;
          653  +	  int real_buf_size = ctx->buf_size;
          654  +	  int rc;
          655  +	  /* Are there any unprocessed blocks? */
          656  +	  if (*ctx->done_blocks == ctx->n_blocks)
          657  +	      break;
          658  +	  else
          659  +	      (*ctx->done_blocks)++;
          660  +	  /* Read next input block */
          661  +	  if (!decoder_read_next_block (ctx, buf, &real_buf_size))
          662  +	    {
          663  +		error_flag = 1;
          664  +		fprintf (stderr, "Waveletets-wrapper: Cannot read block\n");
          665  +		goto error;
          666  +	    }
          667  +	  /* Parse and check block header */
          668  +	  rc = eps_read_block_header (buf, real_buf_size, &hdr);
          669  +	  if (rc != EPS_OK)
          670  +	    {
          671  +		error_flag = 1;
          672  +		fprintf (stderr, "Waveletets-wrapper: Malformed block\n");
          673  +		goto error;
          674  +	    }
          675  +	  /* Check header CRC flag */
          676  +	  if (hdr.chk_flag == EPS_BAD_CRC)
          677  +	    {
          678  +		error_flag = 1;
          679  +		fprintf (stderr, "Wavelet-wrapper: Incorrect header CRC\n");
          680  +		goto error;
          681  +	    }
          682  +	  /* Check data CRC flag */
          683  +	  if (hdr.crc_flag == EPS_BAD_CRC)
          684  +	    {
          685  +		error_flag = 1;
          686  +		fprintf (stderr, "Wavelet-wrapper: Incorrect data CRC\n");
          687  +		goto error;
          688  +	    }
          689  +	  if (ctx->image_type == IMAGE_WAVELET_BW)
          690  +	    {
          691  +		/* Skip over broken blocks */
          692  +		if ((hdr.uhdr.gs.W != W) || (hdr.uhdr.gs.H != H))
          693  +		    continue;
          694  +		/* All function parameters are checked at the moment so everything except EPS_OK is a logical error. */
          695  +		rc = eps_decode_grayscale_block (Y, buf, &hdr);
          696  +		if (rc != EPS_OK)
          697  +		  {
          698  +		      error_flag = 1;
          699  +		      fprintf (stderr, "Wavelet-wrapper: decode error\n");
          700  +		      goto error;
          701  +		  }
          702  +		if (!decoder_write_grayscale
          703  +		    (ctx->img, Y, hdr.uhdr.gs.x, hdr.uhdr.gs.y, hdr.uhdr.gs.w,
          704  +		     hdr.uhdr.gs.h))
          705  +		  {
          706  +		      error_flag = 1;
          707  +		      fprintf (stderr, "Wavelet-wrapper: cannot write block\n");
          708  +		      goto error;
          709  +		  }
          710  +	    }
          711  +	  else
          712  +	    {
          713  +		/* Skip over broken blocks */
          714  +		if ((hdr.uhdr.tc.W != W) || (hdr.uhdr.tc.H != H))
          715  +		    continue;
          716  +		/* Decode block */
          717  +		rc = eps_decode_truecolor_block (R, G, B, buf, &hdr);
          718  +		if (rc != EPS_OK)
          719  +		  {
          720  +		      error_flag = 1;
          721  +		      fprintf (stderr, "Wavelet-wrapper: decode error\n");
          722  +		      goto error;
          723  +		  }
          724  +		/* Write encoded block */
          725  +		if (!decoder_write_rgb
          726  +		    (ctx->img, R, G, B, hdr.uhdr.tc.x, hdr.uhdr.tc.y,
          727  +		     hdr.uhdr.tc.w, hdr.uhdr.tc.h))
          728  +		  {
          729  +		      error_flag = 1;
          730  +		      fprintf (stderr, "Wavelet-wrapper: cannot write block\n");
          731  +		      goto error;
          732  +		  }
          733  +	    }
          734  +      }
          735  +  error:
          736  +/* Free input buffer */
          737  +    free (buf);
          738  +/* Free output buffers */
          739  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          740  +	eps_free_2D ((void **) Y, max_block_w, max_block_h);
          741  +    else
          742  +      {
          743  +	  eps_free_2D ((void **) R, max_block_w, max_block_h);
          744  +	  eps_free_2D ((void **) G, max_block_w, max_block_h);
          745  +	  eps_free_2D ((void **) B, max_block_w, max_block_h);
          746  +      }
          747  +/* Return 0 for success or 1 for error */
          748  +    return error_flag;
          749  +}
          750  +
          751  +static int
          752  +check_header (const void *data, int size)
          753  +{
          754  +/* checking the SpatiaLite header */
          755  +    int len;
          756  +    char to_check[64];
          757  +    strcpy (to_check, "StartWaveletsImage$$");
          758  +    len = strlen (to_check) + 1;
          759  +    if (size > len)
          760  +      {
          761  +	  if (memcmp ((char *) data, to_check, len) == 0)
          762  +	      return len;
          763  +      }
          764  +    return 0;
          765  +}
          766  +
          767  +static int
          768  +check_footer (const void *data, int size)
          769  +{
          770  +/* checking the SpatiaLite footer */
          771  +    int len;
          772  +    char to_check[64];
          773  +    strcpy (to_check, "$$EndWaveletsImage");
          774  +    len = strlen (to_check) + 1;
          775  +    if (size > len)
          776  +      {
          777  +	  if (memcmp ((char *) data + (size - len), to_check, len) == 0)
          778  +	      return len;
          779  +      }
          780  +    return 0;
          781  +}
          782  +
          783  +static rasterliteImagePrt
          784  +wavelet_uncompress (int size, const void *data)
          785  +{
          786  +/* preparing the decompression */
          787  +    rasterliteImagePrt img;
          788  +    int ret;
          789  +    decode_ctx ctx;
          790  +/* Input buffer size */
          791  +    int buf_size;
          792  +/* Miscellaneous block stuff */
          793  +    int max_block_w;
          794  +    int max_block_h;
          795  +    int x_blocks;
          796  +    int y_blocks;
          797  +    int n_blocks;
          798  +    int done_blocks = 0;
          799  +    int clear_len = 0;
          800  +    int stop_flag = 0;
          801  +    int W;
          802  +    int H;
          803  +    int ext_type;
          804  +    int len;
          805  +/* checking the SpatiaLite header and footer */
          806  +    ctx.input = (unsigned char *) data;
          807  +    ctx.in_size = size;
          808  +    ctx.in_current = 0;
          809  +    len = check_header (data, size);
          810  +    if (len)
          811  +	ctx.in_current += len;
          812  +    else
          813  +	return NULL;
          814  +    len = check_footer (data, size);
          815  +    if (len)
          816  +	ctx.in_size -= len;
          817  +    else
          818  +	return NULL;
          819  +    ctx.in_base = ctx.in_current;
          820  +    if (!guess_wavelet_type
          821  +	(&ctx, &ext_type, &W, &H, &max_block_w, &max_block_h))
          822  +	return NULL;
          823  +    img = image_create (W, H);
          824  +/* Compute number of blocks */
          825  +    if (W % max_block_w)
          826  +	x_blocks = W / max_block_w + 1;
          827  +    else
          828  +	x_blocks = W / max_block_w;
          829  +    if (H % max_block_h)
          830  +	y_blocks = H / max_block_h + 1;
          831  +    else
          832  +	y_blocks = H / max_block_h;
          833  +/* Compute total number of blocks in the file */
          834  +    n_blocks = x_blocks * y_blocks;
          835  +    stop_flag = 0;
          836  +/* Prepare CTXs */
          837  +    if (ext_type == IMAGE_WAVELET_RGB)
          838  +      {
          839  +	  img->color_space = COLORSPACE_RGB;
          840  +	  buf_size = EPS_MAX_GRAYSCALE_BUF;
          841  +      }
          842  +    else
          843  +      {
          844  +	  img->color_space = COLORSPACE_GRAYSCALE;
          845  +	  buf_size = EPS_MAX_TRUECOLOR_BUF;
          846  +      }
          847  +    ctx.buf_size = buf_size;
          848  +    ctx.n_blocks = n_blocks;
          849  +    ctx.done_blocks = &done_blocks;
          850  +    ctx.clear_len = &clear_len;
          851  +    ctx.W = W;
          852  +    ctx.H = H;
          853  +    ctx.img = img;
          854  +    ctx.max_block_w = max_block_w;
          855  +    ctx.max_block_h = max_block_h;
          856  +    ctx.stop_flag = &stop_flag;
          857  +/* Decode blocks */
          858  +    ret = decode_blocks (&ctx);
          859  +    if (ret == 0)
          860  +	return img;
          861  +    image_destroy (img);
          862  +    return NULL;
          863  +}
          864  +
          865  +extern void *
          866  +image_to_wavelet (const rasterliteImagePrt img, int *size, int ratio)
          867  +{
          868  +/* compressing an image as WAVELET RGB */
          869  +    return wavelet_compress (img, size, ratio, IMAGE_WAVELET_RGB);
          870  +}
          871  +
          872  +extern void *
          873  +image_to_wavelet_grayscale (const rasterliteImagePrt img, int *size, int ratio)
          874  +{
          875  +/* compressing an image as JPEG WAVELET GRAYSCALE */
          876  +    return wavelet_compress (img, size, ratio, IMAGE_WAVELET_BW);
          877  +}
          878  +
          879  +extern rasterliteImagePrt
          880  +image_from_wavelet (int size, const void *data)
          881  +{
          882  +/* uncompressing a WAVELET compressed image */
          883  +    rasterliteImagePrt img;
          884  +    img = wavelet_uncompress (size, data);
          885  +    return img;
          886  +}

Added librasterlite.def.

            1  +LIBRARY rasterlite.dll
            2  +EXPORTS
            3  +rasterliteClose
            4  +rasterliteExportGeoTiff
            5  +rasterliteGetBackgroundColor
            6  +rasterliteGetBestAccess
            7  +rasterliteGetExtent
            8  +rasterliteGetLastError
            9  +rasterliteGetLevels
           10  +rasterliteGetPath
           11  +rasterliteGetRaster
           12  +rasterliteGetRaster2
           13  +rasterliteGetRasterByRect
           14  +rasterliteGetRasterByRect2
           15  +rasterliteGetResolution
           16  +rasterliteGetSpatialiteVersion
           17  +rasterliteGetSqliteVersion
           18  +rasterliteGetSrid
           19  +rasterliteGetTablePrefix
           20  +rasterliteGetTransparentColor
           21  +rasterliteHasTransparentColor
           22  +rasterliteIsError
           23  +rasterliteOpen
           24  +rasterliteSetBackgroundColor
           25  +rasterliteSetTransparentColor
           26  +rasterliteWaveletToPng

Changes to ltmain.sh.

more than 10,000 changes

Deleted m4/libtool.m4.

     1         -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
     2         -#
     3         -#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
     4         -#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
     5         -#                 Inc.
     6         -#   Written by Gordon Matzigkeit, 1996
     7         -#
     8         -# This file is free software; the Free Software Foundation gives
     9         -# unlimited permission to copy and/or distribute it, with or without
    10         -# modifications, as long as this notice is preserved.
    11         -
    12         -m4_define([_LT_COPYING], [dnl
    13         -#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
    14         -#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
    15         -#                 Inc.
    16         -#   Written by Gordon Matzigkeit, 1996
    17         -#
    18         -#   This file is part of GNU Libtool.
    19         -#
    20         -# GNU Libtool is free software; you can redistribute it and/or
    21         -# modify it under the terms of the GNU General Public License as
    22         -# published by the Free Software Foundation; either version 2 of
    23         -# the License, or (at your option) any later version.
    24         -#
    25         -# As a special exception to the GNU General Public License,
    26         -# if you distribute this file as part of a program or library that
    27         -# is built using GNU Libtool, you may include this file under the
    28         -# same distribution terms that you use for the rest of that program.
    29         -#
    30         -# GNU Libtool is distributed in the hope that it will be useful,
    31         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    32         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    33         -# GNU General Public License for more details.
    34         -#
    35         -# You should have received a copy of the GNU General Public License
    36         -# along with GNU Libtool; see the file COPYING.  If not, a copy
    37         -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
    38         -# obtained by writing to the Free Software Foundation, Inc.,
    39         -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    40         -])
    41         -
    42         -# serial 57 LT_INIT
    43         -
    44         -
    45         -# LT_PREREQ(VERSION)
    46         -# ------------------
    47         -# Complain and exit if this libtool version is less that VERSION.
    48         -m4_defun([LT_PREREQ],
    49         -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
    50         -       [m4_default([$3],
    51         -		   [m4_fatal([Libtool version $1 or higher is required],
    52         -		             63)])],
    53         -       [$2])])
    54         -
    55         -
    56         -# _LT_CHECK_BUILDDIR
    57         -# ------------------
    58         -# Complain if the absolute build directory name contains unusual characters
    59         -m4_defun([_LT_CHECK_BUILDDIR],
    60         -[case `pwd` in
    61         -  *\ * | *\	*)
    62         -    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
    63         -esac
    64         -])
    65         -
    66         -
    67         -# LT_INIT([OPTIONS])
    68         -# ------------------
    69         -AC_DEFUN([LT_INIT],
    70         -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
    71         -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
    72         -AC_BEFORE([$0], [LT_LANG])dnl
    73         -AC_BEFORE([$0], [LT_OUTPUT])dnl
    74         -AC_BEFORE([$0], [LTDL_INIT])dnl
    75         -m4_require([_LT_CHECK_BUILDDIR])dnl
    76         -
    77         -dnl Autoconf doesn't catch unexpanded LT_ macros by default:
    78         -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
    79         -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
    80         -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
    81         -dnl unless we require an AC_DEFUNed macro:
    82         -AC_REQUIRE([LTOPTIONS_VERSION])dnl
    83         -AC_REQUIRE([LTSUGAR_VERSION])dnl
    84         -AC_REQUIRE([LTVERSION_VERSION])dnl
    85         -AC_REQUIRE([LTOBSOLETE_VERSION])dnl
    86         -m4_require([_LT_PROG_LTMAIN])dnl
    87         -
    88         -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
    89         -
    90         -dnl Parse OPTIONS
    91         -_LT_SET_OPTIONS([$0], [$1])
    92         -
    93         -# This can be used to rebuild libtool when needed
    94         -LIBTOOL_DEPS="$ltmain"
    95         -
    96         -# Always use our own libtool.
    97         -LIBTOOL='$(SHELL) $(top_builddir)/libtool'
    98         -AC_SUBST(LIBTOOL)dnl
    99         -
   100         -_LT_SETUP
   101         -
   102         -# Only expand once:
   103         -m4_define([LT_INIT])
   104         -])# LT_INIT
   105         -
   106         -# Old names:
   107         -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
   108         -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
   109         -dnl aclocal-1.4 backwards compatibility:
   110         -dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
   111         -dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
   112         -
   113         -
   114         -# _LT_CC_BASENAME(CC)
   115         -# -------------------
   116         -# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
   117         -m4_defun([_LT_CC_BASENAME],
   118         -[for cc_temp in $1""; do
   119         -  case $cc_temp in
   120         -    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
   121         -    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
   122         -    \-*) ;;
   123         -    *) break;;
   124         -  esac
   125         -done
   126         -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
   127         -])
   128         -
   129         -
   130         -# _LT_FILEUTILS_DEFAULTS
   131         -# ----------------------
   132         -# It is okay to use these file commands and assume they have been set
   133         -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
   134         -m4_defun([_LT_FILEUTILS_DEFAULTS],
   135         -[: ${CP="cp -f"}
   136         -: ${MV="mv -f"}
   137         -: ${RM="rm -f"}
   138         -])# _LT_FILEUTILS_DEFAULTS
   139         -
   140         -
   141         -# _LT_SETUP
   142         -# ---------
   143         -m4_defun([_LT_SETUP],
   144         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
   145         -AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   146         -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
   147         -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
   148         -
   149         -_LT_DECL([], [host_alias], [0], [The host system])dnl
   150         -_LT_DECL([], [host], [0])dnl
   151         -_LT_DECL([], [host_os], [0])dnl
   152         -dnl
   153         -_LT_DECL([], [build_alias], [0], [The build system])dnl
   154         -_LT_DECL([], [build], [0])dnl
   155         -_LT_DECL([], [build_os], [0])dnl
   156         -dnl
   157         -AC_REQUIRE([AC_PROG_CC])dnl
   158         -AC_REQUIRE([LT_PATH_LD])dnl
   159         -AC_REQUIRE([LT_PATH_NM])dnl
   160         -dnl
   161         -AC_REQUIRE([AC_PROG_LN_S])dnl
   162         -test -z "$LN_S" && LN_S="ln -s"
   163         -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
   164         -dnl
   165         -AC_REQUIRE([LT_CMD_MAX_LEN])dnl
   166         -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
   167         -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
   168         -dnl
   169         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
   170         -m4_require([_LT_CHECK_SHELL_FEATURES])dnl
   171         -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
   172         -m4_require([_LT_CMD_RELOAD])dnl
   173         -m4_require([_LT_CHECK_MAGIC_METHOD])dnl
   174         -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
   175         -m4_require([_LT_CMD_OLD_ARCHIVE])dnl
   176         -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
   177         -m4_require([_LT_WITH_SYSROOT])dnl
   178         -
   179         -_LT_CONFIG_LIBTOOL_INIT([
   180         -# See if we are running on zsh, and set the options which allow our
   181         -# commands through without removal of \ escapes INIT.
   182         -if test -n "\${ZSH_VERSION+set}" ; then
   183         -   setopt NO_GLOB_SUBST
   184         -fi
   185         -])
   186         -if test -n "${ZSH_VERSION+set}" ; then
   187         -   setopt NO_GLOB_SUBST
   188         -fi
   189         -
   190         -_LT_CHECK_OBJDIR
   191         -
   192         -m4_require([_LT_TAG_COMPILER])dnl
   193         -
   194         -case $host_os in
   195         -aix3*)
   196         -  # AIX sometimes has problems with the GCC collect2 program.  For some
   197         -  # reason, if we set the COLLECT_NAMES environment variable, the problems
   198         -  # vanish in a puff of smoke.
   199         -  if test "X${COLLECT_NAMES+set}" != Xset; then
   200         -    COLLECT_NAMES=
   201         -    export COLLECT_NAMES
   202         -  fi
   203         -  ;;
   204         -esac
   205         -
   206         -# Global variables:
   207         -ofile=libtool
   208         -can_build_shared=yes
   209         -
   210         -# All known linkers require a `.a' archive for static linking (except MSVC,
   211         -# which needs '.lib').
   212         -libext=a
   213         -
   214         -with_gnu_ld="$lt_cv_prog_gnu_ld"
   215         -
   216         -old_CC="$CC"
   217         -old_CFLAGS="$CFLAGS"
   218         -
   219         -# Set sane defaults for various variables
   220         -test -z "$CC" && CC=cc
   221         -test -z "$LTCC" && LTCC=$CC
   222         -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
   223         -test -z "$LD" && LD=ld
   224         -test -z "$ac_objext" && ac_objext=o
   225         -
   226         -_LT_CC_BASENAME([$compiler])
   227         -
   228         -# Only perform the check for file, if the check method requires it
   229         -test -z "$MAGIC_CMD" && MAGIC_CMD=file
   230         -case $deplibs_check_method in
   231         -file_magic*)
   232         -  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
   233         -    _LT_PATH_MAGIC
   234         -  fi
   235         -  ;;
   236         -esac
   237         -
   238         -# Use C for the default configuration in the libtool script
   239         -LT_SUPPORTED_TAG([CC])
   240         -_LT_LANG_C_CONFIG
   241         -_LT_LANG_DEFAULT_CONFIG
   242         -_LT_CONFIG_COMMANDS
   243         -])# _LT_SETUP
   244         -
   245         -
   246         -# _LT_PREPARE_SED_QUOTE_VARS
   247         -# --------------------------
   248         -# Define a few sed substitution that help us do robust quoting.
   249         -m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
   250         -[# Backslashify metacharacters that are still active within
   251         -# double-quoted strings.
   252         -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
   253         -
   254         -# Same as above, but do not quote variable references.
   255         -double_quote_subst='s/\([["`\\]]\)/\\\1/g'
   256         -
   257         -# Sed substitution to delay expansion of an escaped shell variable in a
   258         -# double_quote_subst'ed string.
   259         -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
   260         -
   261         -# Sed substitution to delay expansion of an escaped single quote.
   262         -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
   263         -
   264         -# Sed substitution to avoid accidental globbing in evaled expressions
   265         -no_glob_subst='s/\*/\\\*/g'
   266         -])
   267         -
   268         -# _LT_PROG_LTMAIN
   269         -# ---------------
   270         -# Note that this code is called both from `configure', and `config.status'
   271         -# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
   272         -# `config.status' has no value for ac_aux_dir unless we are using Automake,
   273         -# so we pass a copy along to make sure it has a sensible value anyway.
   274         -m4_defun([_LT_PROG_LTMAIN],
   275         -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
   276         -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
   277         -ltmain="$ac_aux_dir/ltmain.sh"
   278         -])# _LT_PROG_LTMAIN
   279         -
   280         -
   281         -## ------------------------------------- ##
   282         -## Accumulate code for creating libtool. ##
   283         -## ------------------------------------- ##
   284         -
   285         -# So that we can recreate a full libtool script including additional
   286         -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
   287         -# in macros and then make a single call at the end using the `libtool'
   288         -# label.
   289         -
   290         -
   291         -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
   292         -# ----------------------------------------
   293         -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
   294         -m4_define([_LT_CONFIG_LIBTOOL_INIT],
   295         -[m4_ifval([$1],
   296         -          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
   297         -                     [$1
   298         -])])])
   299         -
   300         -# Initialize.
   301         -m4_define([_LT_OUTPUT_LIBTOOL_INIT])
   302         -
   303         -
   304         -# _LT_CONFIG_LIBTOOL([COMMANDS])
   305         -# ------------------------------
   306         -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
   307         -m4_define([_LT_CONFIG_LIBTOOL],
   308         -[m4_ifval([$1],
   309         -          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
   310         -                     [$1
   311         -])])])
   312         -
   313         -# Initialize.
   314         -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
   315         -
   316         -
   317         -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
   318         -# -----------------------------------------------------
   319         -m4_defun([_LT_CONFIG_SAVE_COMMANDS],
   320         -[_LT_CONFIG_LIBTOOL([$1])
   321         -_LT_CONFIG_LIBTOOL_INIT([$2])
   322         -])
   323         -
   324         -
   325         -# _LT_FORMAT_COMMENT([COMMENT])
   326         -# -----------------------------
   327         -# Add leading comment marks to the start of each line, and a trailing
   328         -# full-stop to the whole comment if one is not present already.
   329         -m4_define([_LT_FORMAT_COMMENT],
   330         -[m4_ifval([$1], [
   331         -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
   332         -              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
   333         -)])
   334         -
   335         -
   336         -
   337         -## ------------------------ ##
   338         -## FIXME: Eliminate VARNAME ##
   339         -## ------------------------ ##
   340         -
   341         -
   342         -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
   343         -# -------------------------------------------------------------------
   344         -# CONFIGNAME is the name given to the value in the libtool script.
   345         -# VARNAME is the (base) name used in the configure script.
   346         -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
   347         -# VARNAME.  Any other value will be used directly.
   348         -m4_define([_LT_DECL],
   349         -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
   350         -    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
   351         -	[m4_ifval([$1], [$1], [$2])])
   352         -    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
   353         -    m4_ifval([$4],
   354         -	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
   355         -    lt_dict_add_subkey([lt_decl_dict], [$2],
   356         -	[tagged?], [m4_ifval([$5], [yes], [no])])])
   357         -])
   358         -
   359         -
   360         -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
   361         -# --------------------------------------------------------
   362         -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
   363         -
   364         -
   365         -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
   366         -# ------------------------------------------------
   367         -m4_define([lt_decl_tag_varnames],
   368         -[_lt_decl_filter([tagged?], [yes], $@)])
   369         -
   370         -
   371         -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
   372         -# ---------------------------------------------------------
   373         -m4_define([_lt_decl_filter],
   374         -[m4_case([$#],
   375         -  [0], [m4_fatal([$0: too few arguments: $#])],
   376         -  [1], [m4_fatal([$0: too few arguments: $#: $1])],
   377         -  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
   378         -  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
   379         -  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
   380         -])
   381         -
   382         -
   383         -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
   384         -# --------------------------------------------------
   385         -m4_define([lt_decl_quote_varnames],
   386         -[_lt_decl_filter([value], [1], $@)])
   387         -
   388         -
   389         -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
   390         -# ---------------------------------------------------
   391         -m4_define([lt_decl_dquote_varnames],
   392         -[_lt_decl_filter([value], [2], $@)])
   393         -
   394         -
   395         -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
   396         -# ---------------------------------------------------
   397         -m4_define([lt_decl_varnames_tagged],
   398         -[m4_assert([$# <= 2])dnl
   399         -_$0(m4_quote(m4_default([$1], [[, ]])),
   400         -    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
   401         -    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
   402         -m4_define([_lt_decl_varnames_tagged],
   403         -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
   404         -
   405         -
   406         -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
   407         -# ------------------------------------------------
   408         -m4_define([lt_decl_all_varnames],
   409         -[_$0(m4_quote(m4_default([$1], [[, ]])),
   410         -     m4_if([$2], [],
   411         -	   m4_quote(lt_decl_varnames),
   412         -	m4_quote(m4_shift($@))))[]dnl
   413         -])
   414         -m4_define([_lt_decl_all_varnames],
   415         -[lt_join($@, lt_decl_varnames_tagged([$1],
   416         -			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
   417         -])
   418         -
   419         -
   420         -# _LT_CONFIG_STATUS_DECLARE([VARNAME])
   421         -# ------------------------------------
   422         -# Quote a variable value, and forward it to `config.status' so that its
   423         -# declaration there will have the same value as in `configure'.  VARNAME
   424         -# must have a single quote delimited value for this to work.
   425         -m4_define([_LT_CONFIG_STATUS_DECLARE],
   426         -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
   427         -
   428         -
   429         -# _LT_CONFIG_STATUS_DECLARATIONS
   430         -# ------------------------------
   431         -# We delimit libtool config variables with single quotes, so when
   432         -# we write them to config.status, we have to be sure to quote all
   433         -# embedded single quotes properly.  In configure, this macro expands
   434         -# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
   435         -#
   436         -#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
   437         -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
   438         -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
   439         -    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
   440         -
   441         -
   442         -# _LT_LIBTOOL_TAGS
   443         -# ----------------
   444         -# Output comment and list of tags supported by the script
   445         -m4_defun([_LT_LIBTOOL_TAGS],
   446         -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
   447         -available_tags="_LT_TAGS"dnl
   448         -])
   449         -
   450         -
   451         -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
   452         -# -----------------------------------
   453         -# Extract the dictionary values for VARNAME (optionally with TAG) and
   454         -# expand to a commented shell variable setting:
   455         -#
   456         -#    # Some comment about what VAR is for.
   457         -#    visible_name=$lt_internal_name
   458         -m4_define([_LT_LIBTOOL_DECLARE],
   459         -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
   460         -					   [description])))[]dnl
   461         -m4_pushdef([_libtool_name],
   462         -    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
   463         -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
   464         -    [0], [_libtool_name=[$]$1],
   465         -    [1], [_libtool_name=$lt_[]$1],
   466         -    [2], [_libtool_name=$lt_[]$1],
   467         -    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
   468         -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
   469         -])
   470         -
   471         -
   472         -# _LT_LIBTOOL_CONFIG_VARS
   473         -# -----------------------
   474         -# Produce commented declarations of non-tagged libtool config variables
   475         -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
   476         -# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
   477         -# section) are produced by _LT_LIBTOOL_TAG_VARS.
   478         -m4_defun([_LT_LIBTOOL_CONFIG_VARS],
   479         -[m4_foreach([_lt_var],
   480         -    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
   481         -    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
   482         -
   483         -
   484         -# _LT_LIBTOOL_TAG_VARS(TAG)
   485         -# -------------------------
   486         -m4_define([_LT_LIBTOOL_TAG_VARS],
   487         -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
   488         -    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
   489         -
   490         -
   491         -# _LT_TAGVAR(VARNAME, [TAGNAME])
   492         -# ------------------------------
   493         -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
   494         -
   495         -
   496         -# _LT_CONFIG_COMMANDS
   497         -# -------------------
   498         -# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
   499         -# variables for single and double quote escaping we saved from calls
   500         -# to _LT_DECL, we can put quote escaped variables declarations
   501         -# into `config.status', and then the shell code to quote escape them in
   502         -# for loops in `config.status'.  Finally, any additional code accumulated
   503         -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
   504         -m4_defun([_LT_CONFIG_COMMANDS],
   505         -[AC_PROVIDE_IFELSE([LT_OUTPUT],
   506         -	dnl If the libtool generation code has been placed in $CONFIG_LT,
   507         -	dnl instead of duplicating it all over again into config.status,
   508         -	dnl then we will have config.status run $CONFIG_LT later, so it
   509         -	dnl needs to know what name is stored there:
   510         -        [AC_CONFIG_COMMANDS([libtool],
   511         -            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
   512         -    dnl If the libtool generation code is destined for config.status,
   513         -    dnl expand the accumulated commands and init code now:
   514         -    [AC_CONFIG_COMMANDS([libtool],
   515         -        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
   516         -])#_LT_CONFIG_COMMANDS
   517         -
   518         -
   519         -# Initialize.
   520         -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
   521         -[
   522         -
   523         -# The HP-UX ksh and POSIX shell print the target directory to stdout
   524         -# if CDPATH is set.
   525         -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
   526         -
   527         -sed_quote_subst='$sed_quote_subst'
   528         -double_quote_subst='$double_quote_subst'
   529         -delay_variable_subst='$delay_variable_subst'
   530         -_LT_CONFIG_STATUS_DECLARATIONS
   531         -LTCC='$LTCC'
   532         -LTCFLAGS='$LTCFLAGS'
   533         -compiler='$compiler_DEFAULT'
   534         -
   535         -# A function that is used when there is no print builtin or printf.
   536         -func_fallback_echo ()
   537         -{
   538         -  eval 'cat <<_LTECHO_EOF
   539         -\$[]1
   540         -_LTECHO_EOF'
   541         -}
   542         -
   543         -# Quote evaled strings.
   544         -for var in lt_decl_all_varnames([[ \
   545         -]], lt_decl_quote_varnames); do
   546         -    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
   547         -    *[[\\\\\\\`\\"\\\$]]*)
   548         -      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
   549         -      ;;
   550         -    *)
   551         -      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
   552         -      ;;
   553         -    esac
   554         -done
   555         -
   556         -# Double-quote double-evaled strings.
   557         -for var in lt_decl_all_varnames([[ \
   558         -]], lt_decl_dquote_varnames); do
   559         -    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
   560         -    *[[\\\\\\\`\\"\\\$]]*)
   561         -      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
   562         -      ;;
   563         -    *)
   564         -      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
   565         -      ;;
   566         -    esac
   567         -done
   568         -
   569         -_LT_OUTPUT_LIBTOOL_INIT
   570         -])
   571         -
   572         -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
   573         -# ------------------------------------
   574         -# Generate a child script FILE with all initialization necessary to
   575         -# reuse the environment learned by the parent script, and make the
   576         -# file executable.  If COMMENT is supplied, it is inserted after the
   577         -# `#!' sequence but before initialization text begins.  After this
   578         -# macro, additional text can be appended to FILE to form the body of
   579         -# the child script.  The macro ends with non-zero status if the
   580         -# file could not be fully written (such as if the disk is full).
   581         -m4_ifdef([AS_INIT_GENERATED],
   582         -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
   583         -[m4_defun([_LT_GENERATED_FILE_INIT],
   584         -[m4_require([AS_PREPARE])]dnl
   585         -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
   586         -[lt_write_fail=0
   587         -cat >$1 <<_ASEOF || lt_write_fail=1
   588         -#! $SHELL
   589         -# Generated by $as_me.
   590         -$2
   591         -SHELL=\${CONFIG_SHELL-$SHELL}
   592         -export SHELL
   593         -_ASEOF
   594         -cat >>$1 <<\_ASEOF || lt_write_fail=1
   595         -AS_SHELL_SANITIZE
   596         -_AS_PREPARE
   597         -exec AS_MESSAGE_FD>&1
   598         -_ASEOF
   599         -test $lt_write_fail = 0 && chmod +x $1[]dnl
   600         -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
   601         -
   602         -# LT_OUTPUT
   603         -# ---------
   604         -# This macro allows early generation of the libtool script (before
   605         -# AC_OUTPUT is called), incase it is used in configure for compilation
   606         -# tests.
   607         -AC_DEFUN([LT_OUTPUT],
   608         -[: ${CONFIG_LT=./config.lt}
   609         -AC_MSG_NOTICE([creating $CONFIG_LT])
   610         -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
   611         -[# Run this file to recreate a libtool stub with the current configuration.])
   612         -
   613         -cat >>"$CONFIG_LT" <<\_LTEOF
   614         -lt_cl_silent=false
   615         -exec AS_MESSAGE_LOG_FD>>config.log
   616         -{
   617         -  echo
   618         -  AS_BOX([Running $as_me.])
   619         -} >&AS_MESSAGE_LOG_FD
   620         -
   621         -lt_cl_help="\
   622         -\`$as_me' creates a local libtool stub from the current configuration,
   623         -for use in further configure time tests before the real libtool is
   624         -generated.
   625         -
   626         -Usage: $[0] [[OPTIONS]]
   627         -
   628         -  -h, --help      print this help, then exit
   629         -  -V, --version   print version number, then exit
   630         -  -q, --quiet     do not print progress messages
   631         -  -d, --debug     don't remove temporary files
   632         -
   633         -Report bugs to <bug-libtool@gnu.org>."
   634         -
   635         -lt_cl_version="\
   636         -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
   637         -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
   638         -configured by $[0], generated by m4_PACKAGE_STRING.
   639         -
   640         -Copyright (C) 2010 Free Software Foundation, Inc.
   641         -This config.lt script is free software; the Free Software Foundation
   642         -gives unlimited permision to copy, distribute and modify it."
   643         -
   644         -while test $[#] != 0
   645         -do
   646         -  case $[1] in
   647         -    --version | --v* | -V )
   648         -      echo "$lt_cl_version"; exit 0 ;;
   649         -    --help | --h* | -h )
   650         -      echo "$lt_cl_help"; exit 0 ;;
   651         -    --debug | --d* | -d )
   652         -      debug=: ;;
   653         -    --quiet | --q* | --silent | --s* | -q )
   654         -      lt_cl_silent=: ;;
   655         -
   656         -    -*) AC_MSG_ERROR([unrecognized option: $[1]
   657         -Try \`$[0] --help' for more information.]) ;;
   658         -
   659         -    *) AC_MSG_ERROR([unrecognized argument: $[1]
   660         -Try \`$[0] --help' for more information.]) ;;
   661         -  esac
   662         -  shift
   663         -done
   664         -
   665         -if $lt_cl_silent; then
   666         -  exec AS_MESSAGE_FD>/dev/null
   667         -fi
   668         -_LTEOF
   669         -
   670         -cat >>"$CONFIG_LT" <<_LTEOF
   671         -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
   672         -_LTEOF
   673         -
   674         -cat >>"$CONFIG_LT" <<\_LTEOF
   675         -AC_MSG_NOTICE([creating $ofile])
   676         -_LT_OUTPUT_LIBTOOL_COMMANDS
   677         -AS_EXIT(0)
   678         -_LTEOF
   679         -chmod +x "$CONFIG_LT"
   680         -
   681         -# configure is writing to config.log, but config.lt does its own redirection,
   682         -# appending to config.log, which fails on DOS, as config.log is still kept
   683         -# open by configure.  Here we exec the FD to /dev/null, effectively closing
   684         -# config.log, so it can be properly (re)opened and appended to by config.lt.
   685         -lt_cl_success=:
   686         -test "$silent" = yes &&
   687         -  lt_config_lt_args="$lt_config_lt_args --quiet"
   688         -exec AS_MESSAGE_LOG_FD>/dev/null
   689         -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
   690         -exec AS_MESSAGE_LOG_FD>>config.log
   691         -$lt_cl_success || AS_EXIT(1)
   692         -])# LT_OUTPUT
   693         -
   694         -
   695         -# _LT_CONFIG(TAG)
   696         -# ---------------
   697         -# If TAG is the built-in tag, create an initial libtool script with a
   698         -# default configuration from the untagged config vars.  Otherwise add code
   699         -# to config.status for appending the configuration named by TAG from the
   700         -# matching tagged config vars.
   701         -m4_defun([_LT_CONFIG],
   702         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
   703         -_LT_CONFIG_SAVE_COMMANDS([
   704         -  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   705         -  m4_if(_LT_TAG, [C], [
   706         -    # See if we are running on zsh, and set the options which allow our
   707         -    # commands through without removal of \ escapes.
   708         -    if test -n "${ZSH_VERSION+set}" ; then
   709         -      setopt NO_GLOB_SUBST
   710         -    fi
   711         -
   712         -    cfgfile="${ofile}T"
   713         -    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
   714         -    $RM "$cfgfile"
   715         -
   716         -    cat <<_LT_EOF >> "$cfgfile"
   717         -#! $SHELL
   718         -
   719         -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
   720         -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
   721         -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
   722         -# NOTE: Changes made to this file will be lost: look at ltmain.sh.
   723         -#
   724         -_LT_COPYING
   725         -_LT_LIBTOOL_TAGS
   726         -
   727         -# ### BEGIN LIBTOOL CONFIG
   728         -_LT_LIBTOOL_CONFIG_VARS
   729         -_LT_LIBTOOL_TAG_VARS
   730         -# ### END LIBTOOL CONFIG
   731         -
   732         -_LT_EOF
   733         -
   734         -  case $host_os in
   735         -  aix3*)
   736         -    cat <<\_LT_EOF >> "$cfgfile"
   737         -# AIX sometimes has problems with the GCC collect2 program.  For some
   738         -# reason, if we set the COLLECT_NAMES environment variable, the problems
   739         -# vanish in a puff of smoke.
   740         -if test "X${COLLECT_NAMES+set}" != Xset; then
   741         -  COLLECT_NAMES=
   742         -  export COLLECT_NAMES
   743         -fi
   744         -_LT_EOF
   745         -    ;;
   746         -  esac
   747         -
   748         -  _LT_PROG_LTMAIN
   749         -
   750         -  # We use sed instead of cat because bash on DJGPP gets confused if
   751         -  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
   752         -  # text mode, it properly converts lines to CR/LF.  This bash problem
   753         -  # is reportedly fixed, but why not run on old versions too?
   754         -  sed '$q' "$ltmain" >> "$cfgfile" \
   755         -     || (rm -f "$cfgfile"; exit 1)
   756         -
   757         -  _LT_PROG_REPLACE_SHELLFNS
   758         -
   759         -   mv -f "$cfgfile" "$ofile" ||
   760         -    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   761         -  chmod +x "$ofile"
   762         -],
   763         -[cat <<_LT_EOF >> "$ofile"
   764         -
   765         -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
   766         -dnl in a comment (ie after a #).
   767         -# ### BEGIN LIBTOOL TAG CONFIG: $1
   768         -_LT_LIBTOOL_TAG_VARS(_LT_TAG)
   769         -# ### END LIBTOOL TAG CONFIG: $1
   770         -_LT_EOF
   771         -])dnl /m4_if
   772         -],
   773         -[m4_if([$1], [], [
   774         -    PACKAGE='$PACKAGE'
   775         -    VERSION='$VERSION'
   776         -    TIMESTAMP='$TIMESTAMP'
   777         -    RM='$RM'
   778         -    ofile='$ofile'], [])
   779         -])dnl /_LT_CONFIG_SAVE_COMMANDS
   780         -])# _LT_CONFIG
   781         -
   782         -
   783         -# LT_SUPPORTED_TAG(TAG)
   784         -# ---------------------
   785         -# Trace this macro to discover what tags are supported by the libtool
   786         -# --tag option, using:
   787         -#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
   788         -AC_DEFUN([LT_SUPPORTED_TAG], [])
   789         -
   790         -
   791         -# C support is built-in for now
   792         -m4_define([_LT_LANG_C_enabled], [])
   793         -m4_define([_LT_TAGS], [])
   794         -
   795         -
   796         -# LT_LANG(LANG)
   797         -# -------------
   798         -# Enable libtool support for the given language if not already enabled.
   799         -AC_DEFUN([LT_LANG],
   800         -[AC_BEFORE([$0], [LT_OUTPUT])dnl
   801         -m4_case([$1],
   802         -  [C],			[_LT_LANG(C)],
   803         -  [C++],		[_LT_LANG(CXX)],
   804         -  [Java],		[_LT_LANG(GCJ)],
   805         -  [Fortran 77],		[_LT_LANG(F77)],
   806         -  [Fortran],		[_LT_LANG(FC)],
   807         -  [Windows Resource],	[_LT_LANG(RC)],
   808         -  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
   809         -    [_LT_LANG($1)],
   810         -    [m4_fatal([$0: unsupported language: "$1"])])])dnl
   811         -])# LT_LANG
   812         -
   813         -
   814         -# _LT_LANG(LANGNAME)
   815         -# ------------------
   816         -m4_defun([_LT_LANG],
   817         -[m4_ifdef([_LT_LANG_]$1[_enabled], [],
   818         -  [LT_SUPPORTED_TAG([$1])dnl
   819         -  m4_append([_LT_TAGS], [$1 ])dnl
   820         -  m4_define([_LT_LANG_]$1[_enabled], [])dnl
   821         -  _LT_LANG_$1_CONFIG($1)])dnl
   822         -])# _LT_LANG
   823         -
   824         -
   825         -# _LT_LANG_DEFAULT_CONFIG
   826         -# -----------------------
   827         -m4_defun([_LT_LANG_DEFAULT_CONFIG],
   828         -[AC_PROVIDE_IFELSE([AC_PROG_CXX],
   829         -  [LT_LANG(CXX)],
   830         -  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
   831         -
   832         -AC_PROVIDE_IFELSE([AC_PROG_F77],
   833         -  [LT_LANG(F77)],
   834         -  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
   835         -
   836         -AC_PROVIDE_IFELSE([AC_PROG_FC],
   837         -  [LT_LANG(FC)],
   838         -  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
   839         -
   840         -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
   841         -dnl pulling things in needlessly.
   842         -AC_PROVIDE_IFELSE([AC_PROG_GCJ],
   843         -  [LT_LANG(GCJ)],
   844         -  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
   845         -    [LT_LANG(GCJ)],
   846         -    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
   847         -      [LT_LANG(GCJ)],
   848         -      [m4_ifdef([AC_PROG_GCJ],
   849         -	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
   850         -       m4_ifdef([A][M_PROG_GCJ],
   851         -	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
   852         -       m4_ifdef([LT_PROG_GCJ],
   853         -	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
   854         -
   855         -AC_PROVIDE_IFELSE([LT_PROG_RC],
   856         -  [LT_LANG(RC)],
   857         -  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
   858         -])# _LT_LANG_DEFAULT_CONFIG
   859         -
   860         -# Obsolete macros:
   861         -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
   862         -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
   863         -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
   864         -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
   865         -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
   866         -dnl aclocal-1.4 backwards compatibility:
   867         -dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
   868         -dnl AC_DEFUN([AC_LIBTOOL_F77], [])
   869         -dnl AC_DEFUN([AC_LIBTOOL_FC], [])
   870         -dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
   871         -dnl AC_DEFUN([AC_LIBTOOL_RC], [])
   872         -
   873         -
   874         -# _LT_TAG_COMPILER
   875         -# ----------------
   876         -m4_defun([_LT_TAG_COMPILER],
   877         -[AC_REQUIRE([AC_PROG_CC])dnl
   878         -
   879         -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
   880         -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
   881         -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
   882         -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
   883         -
   884         -# If no C compiler was specified, use CC.
   885         -LTCC=${LTCC-"$CC"}
   886         -
   887         -# If no C compiler flags were specified, use CFLAGS.
   888         -LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
   889         -
   890         -# Allow CC to be a program name with arguments.
   891         -compiler=$CC
   892         -])# _LT_TAG_COMPILER
   893         -
   894         -
   895         -# _LT_COMPILER_BOILERPLATE
   896         -# ------------------------
   897         -# Check for compiler boilerplate output or warnings with
   898         -# the simple compiler test code.
   899         -m4_defun([_LT_COMPILER_BOILERPLATE],
   900         -[m4_require([_LT_DECL_SED])dnl
   901         -ac_outfile=conftest.$ac_objext
   902         -echo "$lt_simple_compile_test_code" >conftest.$ac_ext
   903         -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
   904         -_lt_compiler_boilerplate=`cat conftest.err`
   905         -$RM conftest*
   906         -])# _LT_COMPILER_BOILERPLATE
   907         -
   908         -
   909         -# _LT_LINKER_BOILERPLATE
   910         -# ----------------------
   911         -# Check for linker boilerplate output or warnings with
   912         -# the simple link test code.
   913         -m4_defun([_LT_LINKER_BOILERPLATE],
   914         -[m4_require([_LT_DECL_SED])dnl
   915         -ac_outfile=conftest.$ac_objext
   916         -echo "$lt_simple_link_test_code" >conftest.$ac_ext
   917         -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
   918         -_lt_linker_boilerplate=`cat conftest.err`
   919         -$RM -r conftest*
   920         -])# _LT_LINKER_BOILERPLATE
   921         -
   922         -# _LT_REQUIRED_DARWIN_CHECKS
   923         -# -------------------------
   924         -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
   925         -  case $host_os in
   926         -    rhapsody* | darwin*)
   927         -    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
   928         -    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
   929         -    AC_CHECK_TOOL([LIPO], [lipo], [:])
   930         -    AC_CHECK_TOOL([OTOOL], [otool], [:])
   931         -    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
   932         -    _LT_DECL([], [DSYMUTIL], [1],
   933         -      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
   934         -    _LT_DECL([], [NMEDIT], [1],
   935         -      [Tool to change global to local symbols on Mac OS X])
   936         -    _LT_DECL([], [LIPO], [1],
   937         -      [Tool to manipulate fat objects and archives on Mac OS X])
   938         -    _LT_DECL([], [OTOOL], [1],
   939         -      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
   940         -    _LT_DECL([], [OTOOL64], [1],
   941         -      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
   942         -
   943         -    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
   944         -      [lt_cv_apple_cc_single_mod=no
   945         -      if test -z "${LT_MULTI_MODULE}"; then
   946         -	# By default we will add the -single_module flag. You can override
   947         -	# by either setting the environment variable LT_MULTI_MODULE
   948         -	# non-empty at configure time, or by adding -multi_module to the
   949         -	# link flags.
   950         -	rm -rf libconftest.dylib*
   951         -	echo "int foo(void){return 1;}" > conftest.c
   952         -	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
   953         --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
   954         -	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
   955         -	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
   956         -        _lt_result=$?
   957         -	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
   958         -	  lt_cv_apple_cc_single_mod=yes
   959         -	else
   960         -	  cat conftest.err >&AS_MESSAGE_LOG_FD
   961         -	fi
   962         -	rm -rf libconftest.dylib*
   963         -	rm -f conftest.*
   964         -      fi])
   965         -    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
   966         -      [lt_cv_ld_exported_symbols_list],
   967         -      [lt_cv_ld_exported_symbols_list=no
   968         -      save_LDFLAGS=$LDFLAGS
   969         -      echo "_main" > conftest.sym
   970         -      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
   971         -      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
   972         -	[lt_cv_ld_exported_symbols_list=yes],
   973         -	[lt_cv_ld_exported_symbols_list=no])
   974         -	LDFLAGS="$save_LDFLAGS"
   975         -    ])
   976         -    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
   977         -      [lt_cv_ld_force_load=no
   978         -      cat > conftest.c << _LT_EOF
   979         -int forced_loaded() { return 2;}
   980         -_LT_EOF
   981         -      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
   982         -      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
   983         -      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
   984         -      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
   985         -      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
   986         -      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
   987         -      cat > conftest.c << _LT_EOF
   988         -int main() { return 0;}
   989         -_LT_EOF
   990         -      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
   991         -      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
   992         -      _lt_result=$?
   993         -      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
   994         -	lt_cv_ld_force_load=yes
   995         -      else
   996         -	cat conftest.err >&AS_MESSAGE_LOG_FD
   997         -      fi
   998         -        rm -f conftest.err libconftest.a conftest conftest.c
   999         -        rm -rf conftest.dSYM
  1000         -    ])
  1001         -    case $host_os in
  1002         -    rhapsody* | darwin1.[[012]])
  1003         -      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
  1004         -    darwin1.*)
  1005         -      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
  1006         -    darwin*) # darwin 5.x on
  1007         -      # if running on 10.5 or later, the deployment target defaults
  1008         -      # to the OS version, if on x86, and 10.4, the deployment
  1009         -      # target defaults to 10.4. Don't you love it?
  1010         -      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
  1011         -	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
  1012         -	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
  1013         -	10.[[012]]*)
  1014         -	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
  1015         -	10.*)
  1016         -	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
  1017         -      esac
  1018         -    ;;
  1019         -  esac
  1020         -    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
  1021         -      _lt_dar_single_mod='$single_module'
  1022         -    fi
  1023         -    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
  1024         -      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
  1025         -    else
  1026         -      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
  1027         -    fi
  1028         -    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
  1029         -      _lt_dsymutil='~$DSYMUTIL $lib || :'
  1030         -    else
  1031         -      _lt_dsymutil=
  1032         -    fi
  1033         -    ;;
  1034         -  esac
  1035         -])
  1036         -
  1037         -
  1038         -# _LT_DARWIN_LINKER_FEATURES
  1039         -# --------------------------
  1040         -# Checks for linker and compiler features on darwin
  1041         -m4_defun([_LT_DARWIN_LINKER_FEATURES],
  1042         -[
  1043         -  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
  1044         -  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  1045         -  _LT_TAGVAR(hardcode_direct, $1)=no
  1046         -  _LT_TAGVAR(hardcode_automatic, $1)=yes
  1047         -  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  1048         -  if test "$lt_cv_ld_force_load" = "yes"; then
  1049         -    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
  1050         -  else
  1051         -    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
  1052         -  fi
  1053         -  _LT_TAGVAR(link_all_deplibs, $1)=yes
  1054         -  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
  1055         -  case $cc_basename in
  1056         -     ifort*) _lt_dar_can_shared=yes ;;
  1057         -     *) _lt_dar_can_shared=$GCC ;;
  1058         -  esac
  1059         -  if test "$_lt_dar_can_shared" = "yes"; then
  1060         -    output_verbose_link_cmd=func_echo_all
  1061         -    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
  1062         -    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
  1063         -    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
  1064         -    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
  1065         -    m4_if([$1], [CXX],
  1066         -[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
  1067         -      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
  1068         -      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
  1069         -    fi
  1070         -],[])
  1071         -  else
  1072         -  _LT_TAGVAR(ld_shlibs, $1)=no
  1073         -  fi
  1074         -])
  1075         -
  1076         -# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
  1077         -# ----------------------------------
  1078         -# Links a minimal program and checks the executable
  1079         -# for the system default hardcoded library path. In most cases,
  1080         -# this is /usr/lib:/lib, but when the MPI compilers are used
  1081         -# the location of the communication and MPI libs are included too.
  1082         -# If we don't find anything, use the default library path according
  1083         -# to the aix ld manual.
  1084         -# Store the results from the different compilers for each TAGNAME.
  1085         -# Allow to override them for all tags through lt_cv_aix_libpath.
  1086         -m4_defun([_LT_SYS_MODULE_PATH_AIX],
  1087         -[m4_require([_LT_DECL_SED])dnl
  1088         -if test "${lt_cv_aix_libpath+set}" = set; then
  1089         -  aix_libpath=$lt_cv_aix_libpath
  1090         -else
  1091         -  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
  1092         -  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
  1093         -  lt_aix_libpath_sed='[
  1094         -      /Import File Strings/,/^$/ {
  1095         -	  /^0/ {
  1096         -	      s/^0  *\([^ ]*\) *$/\1/
  1097         -	      p
  1098         -	  }
  1099         -      }]'
  1100         -  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  1101         -  # Check for a 64-bit object if we didn't find anything.
  1102         -  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
  1103         -    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  1104         -  fi],[])
  1105         -  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
  1106         -    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
  1107         -  fi
  1108         -  ])
  1109         -  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
  1110         -fi
  1111         -])# _LT_SYS_MODULE_PATH_AIX
  1112         -
  1113         -
  1114         -# _LT_SHELL_INIT(ARG)
  1115         -# -------------------
  1116         -m4_define([_LT_SHELL_INIT],
  1117         -[m4_divert_text([M4SH-INIT], [$1
  1118         -])])# _LT_SHELL_INIT
  1119         -
  1120         -
  1121         -
  1122         -# _LT_PROG_ECHO_BACKSLASH
  1123         -# -----------------------
  1124         -# Find how we can fake an echo command that does not interpret backslash.
  1125         -# In particular, with Autoconf 2.60 or later we add some code to the start
  1126         -# of the generated configure script which will find a shell with a builtin
  1127         -# printf (which we can use as an echo command).
  1128         -m4_defun([_LT_PROG_ECHO_BACKSLASH],
  1129         -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
  1130         -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
  1131         -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
  1132         -
  1133         -AC_MSG_CHECKING([how to print strings])
  1134         -# Test print first, because it will be a builtin if present.
  1135         -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
  1136         -   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
  1137         -  ECHO='print -r --'
  1138         -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
  1139         -  ECHO='printf %s\n'
  1140         -else
  1141         -  # Use this function as a fallback that always works.
  1142         -  func_fallback_echo ()
  1143         -  {
  1144         -    eval 'cat <<_LTECHO_EOF
  1145         -$[]1
  1146         -_LTECHO_EOF'
  1147         -  }
  1148         -  ECHO='func_fallback_echo'
  1149         -fi
  1150         -
  1151         -# func_echo_all arg...
  1152         -# Invoke $ECHO with all args, space-separated.
  1153         -func_echo_all ()
  1154         -{
  1155         -    $ECHO "$*" 
  1156         -}
  1157         -
  1158         -case "$ECHO" in
  1159         -  printf*) AC_MSG_RESULT([printf]) ;;
  1160         -  print*) AC_MSG_RESULT([print -r]) ;;
  1161         -  *) AC_MSG_RESULT([cat]) ;;
  1162         -esac
  1163         -
  1164         -m4_ifdef([_AS_DETECT_SUGGESTED],
  1165         -[_AS_DETECT_SUGGESTED([
  1166         -  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
  1167         -    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
  1168         -    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
  1169         -    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
  1170         -    PATH=/empty FPATH=/empty; export PATH FPATH
  1171         -    test "X`printf %s $ECHO`" = "X$ECHO" \
  1172         -      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
  1173         -
  1174         -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
  1175         -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
  1176         -])# _LT_PROG_ECHO_BACKSLASH
  1177         -
  1178         -
  1179         -# _LT_WITH_SYSROOT
  1180         -# ----------------
  1181         -AC_DEFUN([_LT_WITH_SYSROOT],
  1182         -[AC_MSG_CHECKING([for sysroot])
  1183         -AC_ARG_WITH([sysroot],
  1184         -[  --with-sysroot[=DIR] Search for dependent libraries within DIR
  1185         -                        (or the compiler's sysroot if not specified).],
  1186         -[], [with_sysroot=no])
  1187         -
  1188         -dnl lt_sysroot will always be passed unquoted.  We quote it here
  1189         -dnl in case the user passed a directory name.
  1190         -lt_sysroot=
  1191         -case ${with_sysroot} in #(
  1192         - yes)
  1193         -   if test "$GCC" = yes; then
  1194         -     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
  1195         -   fi
  1196         -   ;; #(
  1197         - /*)
  1198         -   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
  1199         -   ;; #(
  1200         - no|'')
  1201         -   ;; #(
  1202         - *)
  1203         -   AC_MSG_RESULT([${with_sysroot}])
  1204         -   AC_MSG_ERROR([The sysroot must be an absolute path.])
  1205         -   ;;
  1206         -esac
  1207         -
  1208         - AC_MSG_RESULT([${lt_sysroot:-no}])
  1209         -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
  1210         -[dependent libraries, and in which our libraries should be installed.])])
  1211         -
  1212         -# _LT_ENABLE_LOCK
  1213         -# ---------------
  1214         -m4_defun([_LT_ENABLE_LOCK],
  1215         -[AC_ARG_ENABLE([libtool-lock],
  1216         -  [AS_HELP_STRING([--disable-libtool-lock],
  1217         -    [avoid locking (might break parallel builds)])])
  1218         -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  1219         -
  1220         -# Some flags need to be propagated to the compiler or linker for good
  1221         -# libtool support.
  1222         -case $host in
  1223         -ia64-*-hpux*)
  1224         -  # Find out which ABI we are using.
  1225         -  echo 'int i;' > conftest.$ac_ext
  1226         -  if AC_TRY_EVAL(ac_compile); then
  1227         -    case `/usr/bin/file conftest.$ac_objext` in
  1228         -      *ELF-32*)
  1229         -	HPUX_IA64_MODE="32"
  1230         -	;;
  1231         -      *ELF-64*)
  1232         -	HPUX_IA64_MODE="64"
  1233         -	;;
  1234         -    esac
  1235         -  fi
  1236         -  rm -rf conftest*
  1237         -  ;;
  1238         -*-*-irix6*)
  1239         -  # Find out which ABI we are using.
  1240         -  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
  1241         -  if AC_TRY_EVAL(ac_compile); then
  1242         -    if test "$lt_cv_prog_gnu_ld" = yes; then
  1243         -      case `/usr/bin/file conftest.$ac_objext` in
  1244         -	*32-bit*)
  1245         -	  LD="${LD-ld} -melf32bsmip"
  1246         -	  ;;
  1247         -	*N32*)
  1248         -	  LD="${LD-ld} -melf32bmipn32"
  1249         -	  ;;
  1250         -	*64-bit*)
  1251         -	  LD="${LD-ld} -melf64bmip"
  1252         -	;;
  1253         -      esac
  1254         -    else
  1255         -      case `/usr/bin/file conftest.$ac_objext` in
  1256         -	*32-bit*)
  1257         -	  LD="${LD-ld} -32"
  1258         -	  ;;
  1259         -	*N32*)
  1260         -	  LD="${LD-ld} -n32"
  1261         -	  ;;
  1262         -	*64-bit*)
  1263         -	  LD="${LD-ld} -64"
  1264         -	  ;;
  1265         -      esac
  1266         -    fi
  1267         -  fi
  1268         -  rm -rf conftest*
  1269         -  ;;
  1270         -
  1271         -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
  1272         -s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
  1273         -  # Find out which ABI we are using.
  1274         -  echo 'int i;' > conftest.$ac_ext
  1275         -  if AC_TRY_EVAL(ac_compile); then
  1276         -    case `/usr/bin/file conftest.o` in
  1277         -      *32-bit*)
  1278         -	case $host in
  1279         -	  x86_64-*kfreebsd*-gnu)
  1280         -	    LD="${LD-ld} -m elf_i386_fbsd"
  1281         -	    ;;
  1282         -	  x86_64-*linux*)
  1283         -	    LD="${LD-ld} -m elf_i386"
  1284         -	    ;;
  1285         -	  ppc64-*linux*|powerpc64-*linux*)
  1286         -	    LD="${LD-ld} -m elf32ppclinux"
  1287         -	    ;;
  1288         -	  s390x-*linux*)
  1289         -	    LD="${LD-ld} -m elf_s390"
  1290         -	    ;;
  1291         -	  sparc64-*linux*)
  1292         -	    LD="${LD-ld} -m elf32_sparc"
  1293         -	    ;;
  1294         -	esac
  1295         -	;;
  1296         -      *64-bit*)
  1297         -	case $host in
  1298         -	  x86_64-*kfreebsd*-gnu)
  1299         -	    LD="${LD-ld} -m elf_x86_64_fbsd"
  1300         -	    ;;
  1301         -	  x86_64-*linux*)
  1302         -	    LD="${LD-ld} -m elf_x86_64"
  1303         -	    ;;
  1304         -	  ppc*-*linux*|powerpc*-*linux*)
  1305         -	    LD="${LD-ld} -m elf64ppc"
  1306         -	    ;;
  1307         -	  s390*-*linux*|s390*-*tpf*)
  1308         -	    LD="${LD-ld} -m elf64_s390"
  1309         -	    ;;
  1310         -	  sparc*-*linux*)
  1311         -	    LD="${LD-ld} -m elf64_sparc"
  1312         -	    ;;
  1313         -	esac
  1314         -	;;
  1315         -    esac
  1316         -  fi
  1317         -  rm -rf conftest*
  1318         -  ;;
  1319         -
  1320         -*-*-sco3.2v5*)
  1321         -  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  1322         -  SAVE_CFLAGS="$CFLAGS"
  1323         -  CFLAGS="$CFLAGS -belf"
  1324         -  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  1325         -    [AC_LANG_PUSH(C)
  1326         -     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  1327         -     AC_LANG_POP])
  1328         -  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  1329         -    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  1330         -    CFLAGS="$SAVE_CFLAGS"
  1331         -  fi
  1332         -  ;;
  1333         -sparc*-*solaris*)
  1334         -  # Find out which ABI we are using.
  1335         -  echo 'int i;' > conftest.$ac_ext
  1336         -  if AC_TRY_EVAL(ac_compile); then
  1337         -    case `/usr/bin/file conftest.o` in
  1338         -    *64-bit*)
  1339         -      case $lt_cv_prog_gnu_ld in
  1340         -      yes*) LD="${LD-ld} -m elf64_sparc" ;;
  1341         -      *)
  1342         -	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
  1343         -	  LD="${LD-ld} -64"
  1344         -	fi
  1345         -	;;
  1346         -      esac
  1347         -      ;;
  1348         -    esac
  1349         -  fi
  1350         -  rm -rf conftest*
  1351         -  ;;
  1352         -esac
  1353         -
  1354         -need_locks="$enable_libtool_lock"
  1355         -])# _LT_ENABLE_LOCK
  1356         -
  1357         -
  1358         -# _LT_PROG_AR
  1359         -# -----------
  1360         -m4_defun([_LT_PROG_AR],
  1361         -[AC_CHECK_TOOLS(AR, [ar], false)
  1362         -: ${AR=ar}
  1363         -: ${AR_FLAGS=cru}
  1364         -_LT_DECL([], [AR], [1], [The archiver])
  1365         -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
  1366         -
  1367         -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
  1368         -  [lt_cv_ar_at_file=no
  1369         -   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
  1370         -     [echo conftest.$ac_objext > conftest.lst
  1371         -      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
  1372         -      AC_TRY_EVAL([lt_ar_try])
  1373         -      if test "$ac_status" -eq 0; then
  1374         -	# Ensure the archiver fails upon bogus file names.
  1375         -	rm -f conftest.$ac_objext libconftest.a
  1376         -	AC_TRY_EVAL([lt_ar_try])
  1377         -	if test "$ac_status" -ne 0; then
  1378         -          lt_cv_ar_at_file=@
  1379         -        fi
  1380         -      fi
  1381         -      rm -f conftest.* libconftest.a
  1382         -     ])
  1383         -  ])
  1384         -
  1385         -if test "x$lt_cv_ar_at_file" = xno; then
  1386         -  archiver_list_spec=
  1387         -else
  1388         -  archiver_list_spec=$lt_cv_ar_at_file
  1389         -fi
  1390         -_LT_DECL([], [archiver_list_spec], [1],
  1391         -  [How to feed a file listing to the archiver])
  1392         -])# _LT_PROG_AR
  1393         -
  1394         -
  1395         -# _LT_CMD_OLD_ARCHIVE
  1396         -# -------------------
  1397         -m4_defun([_LT_CMD_OLD_ARCHIVE],
  1398         -[_LT_PROG_AR
  1399         -
  1400         -AC_CHECK_TOOL(STRIP, strip, :)
  1401         -test -z "$STRIP" && STRIP=:
  1402         -_LT_DECL([], [STRIP], [1], [A symbol stripping program])
  1403         -
  1404         -AC_CHECK_TOOL(RANLIB, ranlib, :)
  1405         -test -z "$RANLIB" && RANLIB=:
  1406         -_LT_DECL([], [RANLIB], [1],
  1407         -    [Commands used to install an old-style archive])
  1408         -
  1409         -# Determine commands to create old-style static archives.
  1410         -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
  1411         -old_postinstall_cmds='chmod 644 $oldlib'
  1412         -old_postuninstall_cmds=
  1413         -
  1414         -if test -n "$RANLIB"; then
  1415         -  case $host_os in
  1416         -  openbsd*)
  1417         -    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
  1418         -    ;;
  1419         -  *)
  1420         -    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
  1421         -    ;;
  1422         -  esac
  1423         -  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  1424         -fi
  1425         -
  1426         -case $host_os in
  1427         -  darwin*)
  1428         -    lock_old_archive_extraction=yes ;;
  1429         -  *)
  1430         -    lock_old_archive_extraction=no ;;
  1431         -esac
  1432         -_LT_DECL([], [old_postinstall_cmds], [2])
  1433         -_LT_DECL([], [old_postuninstall_cmds], [2])
  1434         -_LT_TAGDECL([], [old_archive_cmds], [2],
  1435         -    [Commands used to build an old-style archive])
  1436         -_LT_DECL([], [lock_old_archive_extraction], [0],
  1437         -    [Whether to use a lock for old archive extraction])
  1438         -])# _LT_CMD_OLD_ARCHIVE
  1439         -
  1440         -
  1441         -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  1442         -#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
  1443         -# ----------------------------------------------------------------
  1444         -# Check whether the given compiler option works
  1445         -AC_DEFUN([_LT_COMPILER_OPTION],
  1446         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1447         -m4_require([_LT_DECL_SED])dnl
  1448         -AC_CACHE_CHECK([$1], [$2],
  1449         -  [$2=no
  1450         -   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
  1451         -   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  1452         -   lt_compiler_flag="$3"
  1453         -   # Insert the option either (1) after the last *FLAGS variable, or
  1454         -   # (2) before a word containing "conftest.", or (3) at the end.
  1455         -   # Note that $ac_compile itself does not contain backslashes and begins
  1456         -   # with a dollar sign (not a hyphen), so the echo should work correctly.
  1457         -   # The option is referenced via a variable to avoid confusing sed.
  1458         -   lt_compile=`echo "$ac_compile" | $SED \
  1459         -   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  1460         -   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  1461         -   -e 's:$: $lt_compiler_flag:'`
  1462         -   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  1463         -   (eval "$lt_compile" 2>conftest.err)
  1464         -   ac_status=$?
  1465         -   cat conftest.err >&AS_MESSAGE_LOG_FD
  1466         -   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  1467         -   if (exit $ac_status) && test -s "$ac_outfile"; then
  1468         -     # The compiler can only warn and ignore the option if not recognized
  1469         -     # So say no if there are warnings other than the usual output.
  1470         -     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
  1471         -     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  1472         -     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  1473         -       $2=yes
  1474         -     fi
  1475         -   fi
  1476         -   $RM conftest*
  1477         -])
  1478         -
  1479         -if test x"[$]$2" = xyes; then
  1480         -    m4_if([$5], , :, [$5])
  1481         -else
  1482         -    m4_if([$6], , :, [$6])
  1483         -fi
  1484         -])# _LT_COMPILER_OPTION
  1485         -
  1486         -# Old name:
  1487         -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
  1488         -dnl aclocal-1.4 backwards compatibility:
  1489         -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
  1490         -
  1491         -
  1492         -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  1493         -#                  [ACTION-SUCCESS], [ACTION-FAILURE])
  1494         -# ----------------------------------------------------
  1495         -# Check whether the given linker option works
  1496         -AC_DEFUN([_LT_LINKER_OPTION],
  1497         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1498         -m4_require([_LT_DECL_SED])dnl
  1499         -AC_CACHE_CHECK([$1], [$2],
  1500         -  [$2=no
  1501         -   save_LDFLAGS="$LDFLAGS"
  1502         -   LDFLAGS="$LDFLAGS $3"
  1503         -   echo "$lt_simple_link_test_code" > conftest.$ac_ext
  1504         -   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
  1505         -     # The linker can only warn and ignore the option if not recognized
  1506         -     # So say no if there are warnings
  1507         -     if test -s conftest.err; then
  1508         -       # Append any errors to the config.log.
  1509         -       cat conftest.err 1>&AS_MESSAGE_LOG_FD
  1510         -       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
  1511         -       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  1512         -       if diff conftest.exp conftest.er2 >/dev/null; then
  1513         -         $2=yes
  1514         -       fi
  1515         -     else
  1516         -       $2=yes
  1517         -     fi
  1518         -   fi
  1519         -   $RM -r conftest*
  1520         -   LDFLAGS="$save_LDFLAGS"
  1521         -])
  1522         -
  1523         -if test x"[$]$2" = xyes; then
  1524         -    m4_if([$4], , :, [$4])
  1525         -else
  1526         -    m4_if([$5], , :, [$5])
  1527         -fi
  1528         -])# _LT_LINKER_OPTION
  1529         -
  1530         -# Old name:
  1531         -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
  1532         -dnl aclocal-1.4 backwards compatibility:
  1533         -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
  1534         -
  1535         -
  1536         -# LT_CMD_MAX_LEN
  1537         -#---------------
  1538         -AC_DEFUN([LT_CMD_MAX_LEN],
  1539         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  1540         -# find the maximum length of command line arguments
  1541         -AC_MSG_CHECKING([the maximum length of command line arguments])
  1542         -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  1543         -  i=0
  1544         -  teststring="ABCD"
  1545         -
  1546         -  case $build_os in
  1547         -  msdosdjgpp*)
  1548         -    # On DJGPP, this test can blow up pretty badly due to problems in libc
  1549         -    # (any single argument exceeding 2000 bytes causes a buffer overrun
  1550         -    # during glob expansion).  Even if it were fixed, the result of this
  1551         -    # check would be larger than it should be.
  1552         -    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
  1553         -    ;;
  1554         -
  1555         -  gnu*)
  1556         -    # Under GNU Hurd, this test is not required because there is
  1557         -    # no limit to the length of command line arguments.
  1558         -    # Libtool will interpret -1 as no limit whatsoever
  1559         -    lt_cv_sys_max_cmd_len=-1;
  1560         -    ;;
  1561         -
  1562         -  cygwin* | mingw* | cegcc*)
  1563         -    # On Win9x/ME, this test blows up -- it succeeds, but takes
  1564         -    # about 5 minutes as the teststring grows exponentially.
  1565         -    # Worse, since 9x/ME are not pre-emptively multitasking,
  1566         -    # you end up with a "frozen" computer, even though with patience
  1567         -    # the test eventually succeeds (with a max line length of 256k).
  1568         -    # Instead, let's just punt: use the minimum linelength reported by
  1569         -    # all of the supported platforms: 8192 (on NT/2K/XP).
  1570         -    lt_cv_sys_max_cmd_len=8192;
  1571         -    ;;
  1572         -
  1573         -  mint*)
  1574         -    # On MiNT this can take a long time and run out of memory.
  1575         -    lt_cv_sys_max_cmd_len=8192;
  1576         -    ;;
  1577         -
  1578         -  amigaos*)
  1579         -    # On AmigaOS with pdksh, this test takes hours, literally.
  1580         -    # So we just punt and use a minimum line length of 8192.
  1581         -    lt_cv_sys_max_cmd_len=8192;
  1582         -    ;;
  1583         -
  1584         -  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  1585         -    # This has been around since 386BSD, at least.  Likely further.
  1586         -    if test -x /sbin/sysctl; then
  1587         -      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  1588         -    elif test -x /usr/sbin/sysctl; then
  1589         -      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
  1590         -    else
  1591         -      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
  1592         -    fi
  1593         -    # And add a safety zone
  1594         -    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
  1595         -    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
  1596         -    ;;
  1597         -
  1598         -  interix*)
  1599         -    # We know the value 262144 and hardcode it with a safety zone (like BSD)
  1600         -    lt_cv_sys_max_cmd_len=196608
  1601         -    ;;
  1602         -
  1603         -  osf*)
  1604         -    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
  1605         -    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
  1606         -    # nice to cause kernel panics so lets avoid the loop below.
  1607         -    # First set a reasonable default.
  1608         -    lt_cv_sys_max_cmd_len=16384
  1609         -    #
  1610         -    if test -x /sbin/sysconfig; then
  1611         -      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
  1612         -        *1*) lt_cv_sys_max_cmd_len=-1 ;;
  1613         -      esac
  1614         -    fi
  1615         -    ;;
  1616         -  sco3.2v5*)
  1617         -    lt_cv_sys_max_cmd_len=102400
  1618         -    ;;
  1619         -  sysv5* | sco5v6* | sysv4.2uw2*)
  1620         -    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
  1621         -    if test -n "$kargmax"; then
  1622         -      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
  1623         -    else
  1624         -      lt_cv_sys_max_cmd_len=32768
  1625         -    fi
  1626         -    ;;
  1627         -  *)
  1628         -    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
  1629         -    if test -n "$lt_cv_sys_max_cmd_len"; then
  1630         -      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
  1631         -      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
  1632         -    else
  1633         -      # Make teststring a little bigger before we do anything with it.
  1634         -      # a 1K string should be a reasonable start.
  1635         -      for i in 1 2 3 4 5 6 7 8 ; do
  1636         -        teststring=$teststring$teststring
  1637         -      done
  1638         -      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
  1639         -      # If test is not a shell built-in, we'll probably end up computing a
  1640         -      # maximum length that is only half of the actual maximum length, but
  1641         -      # we can't tell.
  1642         -      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
  1643         -	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
  1644         -	      test $i != 17 # 1/2 MB should be enough
  1645         -      do
  1646         -        i=`expr $i + 1`
  1647         -        teststring=$teststring$teststring
  1648         -      done
  1649         -      # Only check the string length outside the loop.
  1650         -      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
  1651         -      teststring=
  1652         -      # Add a significant safety factor because C++ compilers can tack on
  1653         -      # massive amounts of additional arguments before passing them to the
  1654         -      # linker.  It appears as though 1/2 is a usable value.
  1655         -      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
  1656         -    fi
  1657         -    ;;
  1658         -  esac
  1659         -])
  1660         -if test -n $lt_cv_sys_max_cmd_len ; then
  1661         -  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
  1662         -else
  1663         -  AC_MSG_RESULT(none)
  1664         -fi
  1665         -max_cmd_len=$lt_cv_sys_max_cmd_len
  1666         -_LT_DECL([], [max_cmd_len], [0],
  1667         -    [What is the maximum length of a command?])
  1668         -])# LT_CMD_MAX_LEN
  1669         -
  1670         -# Old name:
  1671         -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
  1672         -dnl aclocal-1.4 backwards compatibility:
  1673         -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
  1674         -
  1675         -
  1676         -# _LT_HEADER_DLFCN
  1677         -# ----------------
  1678         -m4_defun([_LT_HEADER_DLFCN],
  1679         -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
  1680         -])# _LT_HEADER_DLFCN
  1681         -
  1682         -
  1683         -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  1684         -#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  1685         -# ----------------------------------------------------------------
  1686         -m4_defun([_LT_TRY_DLOPEN_SELF],
  1687         -[m4_require([_LT_HEADER_DLFCN])dnl
  1688         -if test "$cross_compiling" = yes; then :
  1689         -  [$4]
  1690         -else
  1691         -  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  1692         -  lt_status=$lt_dlunknown
  1693         -  cat > conftest.$ac_ext <<_LT_EOF
  1694         -[#line $LINENO "configure"
  1695         -#include "confdefs.h"
  1696         -
  1697         -#if HAVE_DLFCN_H
  1698         -#include <dlfcn.h>
  1699         -#endif
  1700         -
  1701         -#include <stdio.h>
  1702         -
  1703         -#ifdef RTLD_GLOBAL
  1704         -#  define LT_DLGLOBAL		RTLD_GLOBAL
  1705         -#else
  1706         -#  ifdef DL_GLOBAL
  1707         -#    define LT_DLGLOBAL		DL_GLOBAL
  1708         -#  else
  1709         -#    define LT_DLGLOBAL		0
  1710         -#  endif
  1711         -#endif
  1712         -
  1713         -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
  1714         -   find out it does not work in some platform. */
  1715         -#ifndef LT_DLLAZY_OR_NOW
  1716         -#  ifdef RTLD_LAZY
  1717         -#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
  1718         -#  else
  1719         -#    ifdef DL_LAZY
  1720         -#      define LT_DLLAZY_OR_NOW		DL_LAZY
  1721         -#    else
  1722         -#      ifdef RTLD_NOW
  1723         -#        define LT_DLLAZY_OR_NOW	RTLD_NOW
  1724         -#      else
  1725         -#        ifdef DL_NOW
  1726         -#          define LT_DLLAZY_OR_NOW	DL_NOW
  1727         -#        else
  1728         -#          define LT_DLLAZY_OR_NOW	0
  1729         -#        endif
  1730         -#      endif
  1731         -#    endif
  1732         -#  endif
  1733         -#endif
  1734         -
  1735         -/* When -fvisbility=hidden is used, assume the code has been annotated
  1736         -   correspondingly for the symbols needed.  */
  1737         -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
  1738         -int fnord () __attribute__((visibility("default")));
  1739         -#endif
  1740         -
  1741         -int fnord () { return 42; }
  1742         -int main ()
  1743         -{
  1744         -  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  1745         -  int status = $lt_dlunknown;
  1746         -
  1747         -  if (self)
  1748         -    {
  1749         -      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
  1750         -      else
  1751         -        {
  1752         -	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
  1753         -          else puts (dlerror ());
  1754         -	}
  1755         -      /* dlclose (self); */
  1756         -    }
  1757         -  else
  1758         -    puts (dlerror ());
  1759         -
  1760         -  return status;
  1761         -}]
  1762         -_LT_EOF
  1763         -  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  1764         -    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
  1765         -    lt_status=$?
  1766         -    case x$lt_status in
  1767         -      x$lt_dlno_uscore) $1 ;;
  1768         -      x$lt_dlneed_uscore) $2 ;;
  1769         -      x$lt_dlunknown|x*) $3 ;;
  1770         -    esac
  1771         -  else :
  1772         -    # compilation failed
  1773         -    $3
  1774         -  fi
  1775         -fi
  1776         -rm -fr conftest*
  1777         -])# _LT_TRY_DLOPEN_SELF
  1778         -
  1779         -
  1780         -# LT_SYS_DLOPEN_SELF
  1781         -# ------------------
  1782         -AC_DEFUN([LT_SYS_DLOPEN_SELF],
  1783         -[m4_require([_LT_HEADER_DLFCN])dnl
  1784         -if test "x$enable_dlopen" != xyes; then
  1785         -  enable_dlopen=unknown
  1786         -  enable_dlopen_self=unknown
  1787         -  enable_dlopen_self_static=unknown
  1788         -else
  1789         -  lt_cv_dlopen=no
  1790         -  lt_cv_dlopen_libs=
  1791         -
  1792         -  case $host_os in
  1793         -  beos*)
  1794         -    lt_cv_dlopen="load_add_on"
  1795         -    lt_cv_dlopen_libs=
  1796         -    lt_cv_dlopen_self=yes
  1797         -    ;;
  1798         -
  1799         -  mingw* | pw32* | cegcc*)
  1800         -    lt_cv_dlopen="LoadLibrary"
  1801         -    lt_cv_dlopen_libs=
  1802         -    ;;
  1803         -
  1804         -  cygwin*)
  1805         -    lt_cv_dlopen="dlopen"
  1806         -    lt_cv_dlopen_libs=
  1807         -    ;;
  1808         -
  1809         -  darwin*)
  1810         -  # if libdl is installed we need to link against it
  1811         -    AC_CHECK_LIB([dl], [dlopen],
  1812         -		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
  1813         -    lt_cv_dlopen="dyld"
  1814         -    lt_cv_dlopen_libs=
  1815         -    lt_cv_dlopen_self=yes
  1816         -    ])
  1817         -    ;;
  1818         -
  1819         -  *)
  1820         -    AC_CHECK_FUNC([shl_load],
  1821         -	  [lt_cv_dlopen="shl_load"],
  1822         -      [AC_CHECK_LIB([dld], [shl_load],
  1823         -	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
  1824         -	[AC_CHECK_FUNC([dlopen],
  1825         -	      [lt_cv_dlopen="dlopen"],
  1826         -	  [AC_CHECK_LIB([dl], [dlopen],
  1827         -		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
  1828         -	    [AC_CHECK_LIB([svld], [dlopen],
  1829         -		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
  1830         -	      [AC_CHECK_LIB([dld], [dld_link],
  1831         -		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
  1832         -	      ])
  1833         -	    ])
  1834         -	  ])
  1835         -	])
  1836         -      ])
  1837         -    ;;
  1838         -  esac
  1839         -
  1840         -  if test "x$lt_cv_dlopen" != xno; then
  1841         -    enable_dlopen=yes
  1842         -  else
  1843         -    enable_dlopen=no
  1844         -  fi
  1845         -
  1846         -  case $lt_cv_dlopen in
  1847         -  dlopen)
  1848         -    save_CPPFLAGS="$CPPFLAGS"
  1849         -    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  1850         -
  1851         -    save_LDFLAGS="$LDFLAGS"
  1852         -    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  1853         -
  1854         -    save_LIBS="$LIBS"
  1855         -    LIBS="$lt_cv_dlopen_libs $LIBS"
  1856         -
  1857         -    AC_CACHE_CHECK([whether a program can dlopen itself],
  1858         -	  lt_cv_dlopen_self, [dnl
  1859         -	  _LT_TRY_DLOPEN_SELF(
  1860         -	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  1861         -	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  1862         -    ])
  1863         -
  1864         -    if test "x$lt_cv_dlopen_self" = xyes; then
  1865         -      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
  1866         -      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  1867         -	  lt_cv_dlopen_self_static, [dnl
  1868         -	  _LT_TRY_DLOPEN_SELF(
  1869         -	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  1870         -	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
  1871         -      ])
  1872         -    fi
  1873         -
  1874         -    CPPFLAGS="$save_CPPFLAGS"
  1875         -    LDFLAGS="$save_LDFLAGS"
  1876         -    LIBS="$save_LIBS"
  1877         -    ;;
  1878         -  esac
  1879         -
  1880         -  case $lt_cv_dlopen_self in
  1881         -  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  1882         -  *) enable_dlopen_self=unknown ;;
  1883         -  esac
  1884         -
  1885         -  case $lt_cv_dlopen_self_static in
  1886         -  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  1887         -  *) enable_dlopen_self_static=unknown ;;
  1888         -  esac
  1889         -fi
  1890         -_LT_DECL([dlopen_support], [enable_dlopen], [0],
  1891         -	 [Whether dlopen is supported])
  1892         -_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
  1893         -	 [Whether dlopen of programs is supported])
  1894         -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
  1895         -	 [Whether dlopen of statically linked programs is supported])
  1896         -])# LT_SYS_DLOPEN_SELF
  1897         -
  1898         -# Old name:
  1899         -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
  1900         -dnl aclocal-1.4 backwards compatibility:
  1901         -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
  1902         -
  1903         -
  1904         -# _LT_COMPILER_C_O([TAGNAME])
  1905         -# ---------------------------
  1906         -# Check to see if options -c and -o are simultaneously supported by compiler.
  1907         -# This macro does not hard code the compiler like AC_PROG_CC_C_O.
  1908         -m4_defun([_LT_COMPILER_C_O],
  1909         -[m4_require([_LT_DECL_SED])dnl
  1910         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1911         -m4_require([_LT_TAG_COMPILER])dnl
  1912         -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
  1913         -  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
  1914         -  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
  1915         -   $RM -r conftest 2>/dev/null
  1916         -   mkdir conftest
  1917         -   cd conftest
  1918         -   mkdir out
  1919         -   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  1920         -
  1921         -   lt_compiler_flag="-o out/conftest2.$ac_objext"
  1922         -   # Insert the option either (1) after the last *FLAGS variable, or
  1923         -   # (2) before a word containing "conftest.", or (3) at the end.
  1924         -   # Note that $ac_compile itself does not contain backslashes and begins
  1925         -   # with a dollar sign (not a hyphen), so the echo should work correctly.
  1926         -   lt_compile=`echo "$ac_compile" | $SED \
  1927         -   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  1928         -   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  1929         -   -e 's:$: $lt_compiler_flag:'`
  1930         -   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  1931         -   (eval "$lt_compile" 2>out/conftest.err)
  1932         -   ac_status=$?
  1933         -   cat out/conftest.err >&AS_MESSAGE_LOG_FD
  1934         -   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  1935         -   if (exit $ac_status) && test -s out/conftest2.$ac_objext
  1936         -   then
  1937         -     # The compiler can only warn and ignore the option if not recognized
  1938         -     # So say no if there are warnings
  1939         -     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
  1940         -     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  1941         -     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
  1942         -       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  1943         -     fi
  1944         -   fi
  1945         -   chmod u+w . 2>&AS_MESSAGE_LOG_FD
  1946         -   $RM conftest*
  1947         -   # SGI C++ compiler will create directory out/ii_files/ for
  1948         -   # template instantiation
  1949         -   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
  1950         -   $RM out/* && rmdir out
  1951         -   cd ..
  1952         -   $RM -r conftest
  1953         -   $RM conftest*
  1954         -])
  1955         -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
  1956         -	[Does compiler simultaneously support -c and -o options?])
  1957         -])# _LT_COMPILER_C_O
  1958         -
  1959         -
  1960         -# _LT_COMPILER_FILE_LOCKS([TAGNAME])
  1961         -# ----------------------------------
  1962         -# Check to see if we can do hard links to lock some files if needed
  1963         -m4_defun([_LT_COMPILER_FILE_LOCKS],
  1964         -[m4_require([_LT_ENABLE_LOCK])dnl
  1965         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1966         -_LT_COMPILER_C_O([$1])
  1967         -
  1968         -hard_links="nottested"
  1969         -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
  1970         -  # do not overwrite the value of need_locks provided by the user
  1971         -  AC_MSG_CHECKING([if we can lock with hard links])
  1972         -  hard_links=yes
  1973         -  $RM conftest*
  1974         -  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  1975         -  touch conftest.a
  1976         -  ln conftest.a conftest.b 2>&5 || hard_links=no
  1977         -  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  1978         -  AC_MSG_RESULT([$hard_links])
  1979         -  if test "$hard_links" = no; then
  1980         -    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
  1981         -    need_locks=warn
  1982         -  fi
  1983         -else
  1984         -  need_locks=no
  1985         -fi
  1986         -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
  1987         -])# _LT_COMPILER_FILE_LOCKS
  1988         -
  1989         -
  1990         -# _LT_CHECK_OBJDIR
  1991         -# ----------------
  1992         -m4_defun([_LT_CHECK_OBJDIR],
  1993         -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
  1994         -[rm -f .libs 2>/dev/null
  1995         -mkdir .libs 2>/dev/null
  1996         -if test -d .libs; then
  1997         -  lt_cv_objdir=.libs
  1998         -else
  1999         -  # MS-DOS does not allow filenames that begin with a dot.
  2000         -  lt_cv_objdir=_libs
  2001         -fi
  2002         -rmdir .libs 2>/dev/null])
  2003         -objdir=$lt_cv_objdir
  2004         -_LT_DECL([], [objdir], [0],
  2005         -         [The name of the directory that contains temporary libtool files])dnl
  2006         -m4_pattern_allow([LT_OBJDIR])dnl
  2007         -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
  2008         -  [Define to the sub-directory in which libtool stores uninstalled libraries.])
  2009         -])# _LT_CHECK_OBJDIR
  2010         -
  2011         -
  2012         -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
  2013         -# --------------------------------------
  2014         -# Check hardcoding attributes.
  2015         -m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
  2016         -[AC_MSG_CHECKING([how to hardcode library paths into programs])
  2017         -_LT_TAGVAR(hardcode_action, $1)=
  2018         -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
  2019         -   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
  2020         -   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
  2021         -
  2022         -  # We can hardcode non-existent directories.
  2023         -  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
  2024         -     # If the only mechanism to avoid hardcoding is shlibpath_var, we
  2025         -     # have to relink, otherwise we might link with an installed library
  2026         -     # when we should be linking with a yet-to-be-installed one
  2027         -     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
  2028         -     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
  2029         -    # Linking always hardcodes the temporary library directory.
  2030         -    _LT_TAGVAR(hardcode_action, $1)=relink
  2031         -  else
  2032         -    # We can link without hardcoding, and we can hardcode nonexisting dirs.
  2033         -    _LT_TAGVAR(hardcode_action, $1)=immediate
  2034         -  fi
  2035         -else
  2036         -  # We cannot hardcode anything, or else we can only hardcode existing
  2037         -  # directories.
  2038         -  _LT_TAGVAR(hardcode_action, $1)=unsupported
  2039         -fi
  2040         -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
  2041         -
  2042         -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
  2043         -   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
  2044         -  # Fast installation is not supported
  2045         -  enable_fast_install=no
  2046         -elif test "$shlibpath_overrides_runpath" = yes ||
  2047         -     test "$enable_shared" = no; then
  2048         -  # Fast installation is not necessary
  2049         -  enable_fast_install=needless
  2050         -fi
  2051         -_LT_TAGDECL([], [hardcode_action], [0],
  2052         -    [How to hardcode a shared library path into an executable])
  2053         -])# _LT_LINKER_HARDCODE_LIBPATH
  2054         -
  2055         -
  2056         -# _LT_CMD_STRIPLIB
  2057         -# ----------------
  2058         -m4_defun([_LT_CMD_STRIPLIB],
  2059         -[m4_require([_LT_DECL_EGREP])
  2060         -striplib=
  2061         -old_striplib=
  2062         -AC_MSG_CHECKING([whether stripping libraries is possible])
  2063         -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
  2064         -  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  2065         -  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  2066         -  AC_MSG_RESULT([yes])
  2067         -else
  2068         -# FIXME - insert some real tests, host_os isn't really good enough
  2069         -  case $host_os in
  2070         -  darwin*)
  2071         -    if test -n "$STRIP" ; then
  2072         -      striplib="$STRIP -x"
  2073         -      old_striplib="$STRIP -S"
  2074         -      AC_MSG_RESULT([yes])
  2075         -    else
  2076         -      AC_MSG_RESULT([no])
  2077         -    fi
  2078         -    ;;
  2079         -  *)
  2080         -    AC_MSG_RESULT([no])
  2081         -    ;;
  2082         -  esac
  2083         -fi
  2084         -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
  2085         -_LT_DECL([], [striplib], [1])
  2086         -])# _LT_CMD_STRIPLIB
  2087         -
  2088         -
  2089         -# _LT_SYS_DYNAMIC_LINKER([TAG])
  2090         -# -----------------------------
  2091         -# PORTME Fill in your ld.so characteristics
  2092         -m4_defun([_LT_SYS_DYNAMIC_LINKER],
  2093         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  2094         -m4_require([_LT_DECL_EGREP])dnl
  2095         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  2096         -m4_require([_LT_DECL_OBJDUMP])dnl
  2097         -m4_require([_LT_DECL_SED])dnl
  2098         -m4_require([_LT_CHECK_SHELL_FEATURES])dnl
  2099         -AC_MSG_CHECKING([dynamic linker characteristics])
  2100         -m4_if([$1],
  2101         -	[], [
  2102         -if test "$GCC" = yes; then
  2103         -  case $host_os in
  2104         -    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
  2105         -    *) lt_awk_arg="/^libraries:/" ;;
  2106         -  esac
  2107         -  case $host_os in
  2108         -    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
  2109         -    *) lt_sed_strip_eq="s,=/,/,g" ;;
  2110         -  esac
  2111         -  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
  2112         -  case $lt_search_path_spec in
  2113         -  *\;*)
  2114         -    # if the path contains ";" then we assume it to be the separator
  2115         -    # otherwise default to the standard path separator (i.e. ":") - it is
  2116         -    # assumed that no part of a normal pathname contains ";" but that should
  2117         -    # okay in the real world where ";" in dirpaths is itself problematic.
  2118         -    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
  2119         -    ;;
  2120         -  *)
  2121         -    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
  2122         -    ;;
  2123         -  esac
  2124         -  # Ok, now we have the path, separated by spaces, we can step through it
  2125         -  # and add multilib dir if necessary.
  2126         -  lt_tmp_lt_search_path_spec=
  2127         -  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
  2128         -  for lt_sys_path in $lt_search_path_spec; do
  2129         -    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
  2130         -      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
  2131         -    else
  2132         -      test -d "$lt_sys_path" && \
  2133         -	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
  2134         -    fi
  2135         -  done
  2136         -  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
  2137         -BEGIN {RS=" "; FS="/|\n";} {
  2138         -  lt_foo="";
  2139         -  lt_count=0;
  2140         -  for (lt_i = NF; lt_i > 0; lt_i--) {
  2141         -    if ($lt_i != "" && $lt_i != ".") {
  2142         -      if ($lt_i == "..") {
  2143         -        lt_count++;
  2144         -      } else {
  2145         -        if (lt_count == 0) {
  2146         -          lt_foo="/" $lt_i lt_foo;
  2147         -        } else {
  2148         -          lt_count--;
  2149         -        }
  2150         -      }
  2151         -    }
  2152         -  }
  2153         -  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
  2154         -  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
  2155         -}'`
  2156         -  # AWK program above erroneously prepends '/' to C:/dos/paths
  2157         -  # for these hosts.
  2158         -  case $host_os in
  2159         -    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
  2160         -      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
  2161         -  esac
  2162         -  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
  2163         -else
  2164         -  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  2165         -fi])
  2166         -library_names_spec=
  2167         -libname_spec='lib$name'
  2168         -soname_spec=
  2169         -shrext_cmds=".so"
  2170         -postinstall_cmds=
  2171         -postuninstall_cmds=
  2172         -finish_cmds=
  2173         -finish_eval=
  2174         -shlibpath_var=
  2175         -shlibpath_overrides_runpath=unknown
  2176         -version_type=none
  2177         -dynamic_linker="$host_os ld.so"
  2178         -sys_lib_dlsearch_path_spec="/lib /usr/lib"
  2179         -need_lib_prefix=unknown
  2180         -hardcode_into_libs=no
  2181         -
  2182         -# when you set need_version to no, make sure it does not cause -set_version
  2183         -# flags to be left without arguments
  2184         -need_version=unknown
  2185         -
  2186         -case $host_os in
  2187         -aix3*)
  2188         -  version_type=linux
  2189         -  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
  2190         -  shlibpath_var=LIBPATH
  2191         -
  2192         -  # AIX 3 has no versioning support, so we append a major version to the name.
  2193         -  soname_spec='${libname}${release}${shared_ext}$major'
  2194         -  ;;
  2195         -
  2196         -aix[[4-9]]*)
  2197         -  version_type=linux
  2198         -  need_lib_prefix=no
  2199         -  need_version=no
  2200         -  hardcode_into_libs=yes
  2201         -  if test "$host_cpu" = ia64; then
  2202         -    # AIX 5 supports IA64
  2203         -    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
  2204         -    shlibpath_var=LD_LIBRARY_PATH
  2205         -  else
  2206         -    # With GCC up to 2.95.x, collect2 would create an import file
  2207         -    # for dependence libraries.  The import file would start with
  2208         -    # the line `#! .'.  This would cause the generated library to
  2209         -    # depend on `.', always an invalid library.  This was fixed in
  2210         -    # development snapshots of GCC prior to 3.0.
  2211         -    case $host_os in
  2212         -      aix4 | aix4.[[01]] | aix4.[[01]].*)
  2213         -      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
  2214         -	   echo ' yes '
  2215         -	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
  2216         -	:
  2217         -      else
  2218         -	can_build_shared=no
  2219         -      fi
  2220         -      ;;
  2221         -    esac
  2222         -    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
  2223         -    # soname into executable. Probably we can add versioning support to
  2224         -    # collect2, so additional links can be useful in future.
  2225         -    if test "$aix_use_runtimelinking" = yes; then
  2226         -      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
  2227         -      # instead of lib<name>.a to let people know that these are not
  2228         -      # typical AIX shared libraries.
  2229         -      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2230         -    else
  2231         -      # We preserve .a as extension for shared libraries through AIX4.2
  2232         -      # and later when we are not doing run time linking.
  2233         -      library_names_spec='${libname}${release}.a $libname.a'
  2234         -      soname_spec='${libname}${release}${shared_ext}$major'
  2235         -    fi
  2236         -    shlibpath_var=LIBPATH
  2237         -  fi
  2238         -  ;;
  2239         -
  2240         -amigaos*)
  2241         -  case $host_cpu in
  2242         -  powerpc)
  2243         -    # Since July 2007 AmigaOS4 officially supports .so libraries.
  2244         -    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
  2245         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2246         -    ;;
  2247         -  m68k)
  2248         -    library_names_spec='$libname.ixlibrary $libname.a'
  2249         -    # Create ${libname}_ixlibrary.a entries in /sys/libs.
  2250         -    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
  2251         -    ;;
  2252         -  esac
  2253         -  ;;
  2254         -
  2255         -beos*)
  2256         -  library_names_spec='${libname}${shared_ext}'
  2257         -  dynamic_linker="$host_os ld.so"
  2258         -  shlibpath_var=LIBRARY_PATH
  2259         -  ;;
  2260         -
  2261         -bsdi[[45]]*)
  2262         -  version_type=linux
  2263         -  need_version=no
  2264         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2265         -  soname_spec='${libname}${release}${shared_ext}$major'
  2266         -  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  2267         -  shlibpath_var=LD_LIBRARY_PATH
  2268         -  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  2269         -  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  2270         -  # the default ld.so.conf also contains /usr/contrib/lib and
  2271         -  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  2272         -  # libtool to hard-code these into programs
  2273         -  ;;
  2274         -
  2275         -cygwin* | mingw* | pw32* | cegcc*)
  2276         -  version_type=windows
  2277         -  shrext_cmds=".dll"
  2278         -  need_version=no
  2279         -  need_lib_prefix=no
  2280         -
  2281         -  case $GCC,$cc_basename in
  2282         -  yes,*)
  2283         -    # gcc
  2284         -    library_names_spec='$libname.dll.a'
  2285         -    # DLL is installed to $(libdir)/../bin by postinstall_cmds
  2286         -    postinstall_cmds='base_file=`basename \${file}`~
  2287         -      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
  2288         -      dldir=$destdir/`dirname \$dlpath`~
  2289         -      test -d \$dldir || mkdir -p \$dldir~
  2290         -      $install_prog $dir/$dlname \$dldir/$dlname~
  2291         -      chmod a+x \$dldir/$dlname~
  2292         -      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
  2293         -        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
  2294         -      fi'
  2295         -    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
  2296         -      dlpath=$dir/\$dldll~
  2297         -       $RM \$dlpath'
  2298         -    shlibpath_overrides_runpath=yes
  2299         -
  2300         -    case $host_os in
  2301         -    cygwin*)
  2302         -      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
  2303         -      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  2304         -m4_if([$1], [],[
  2305         -      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
  2306         -      ;;
  2307         -    mingw* | cegcc*)
  2308         -      # MinGW DLLs use traditional 'lib' prefix
  2309         -      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  2310         -      ;;
  2311         -    pw32*)
  2312         -      # pw32 DLLs use 'pw' prefix rather than 'lib'
  2313         -      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  2314         -      ;;
  2315         -    esac
  2316         -    dynamic_linker='Win32 ld.exe'
  2317         -    ;;
  2318         -
  2319         -  *,cl*)
  2320         -    # Native MSVC
  2321         -    libname_spec='$name'
  2322         -    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  2323         -    library_names_spec='${libname}.dll.lib'
  2324         -
  2325         -    case $build_os in
  2326         -    mingw*)
  2327         -      sys_lib_search_path_spec=
  2328         -      lt_save_ifs=$IFS
  2329         -      IFS=';'
  2330         -      for lt_path in $LIB
  2331         -      do
  2332         -        IFS=$lt_save_ifs
  2333         -        # Let DOS variable expansion print the short 8.3 style file name.
  2334         -        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
  2335         -        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
  2336         -      done
  2337         -      IFS=$lt_save_ifs
  2338         -      # Convert to MSYS style.
  2339         -      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
  2340         -      ;;
  2341         -    cygwin*)
  2342         -      # Convert to unix form, then to dos form, then back to unix form
  2343         -      # but this time dos style (no spaces!) so that the unix form looks
  2344         -      # like /cygdrive/c/PROGRA~1:/cygdr...
  2345         -      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
  2346         -      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
  2347         -      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
  2348         -      ;;
  2349         -    *)
  2350         -      sys_lib_search_path_spec="$LIB"
  2351         -      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
  2352         -        # It is most probably a Windows format PATH.
  2353         -        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
  2354         -      else
  2355         -        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
  2356         -      fi
  2357         -      # FIXME: find the short name or the path components, as spaces are
  2358         -      # common. (e.g. "Program Files" -> "PROGRA~1")
  2359         -      ;;
  2360         -    esac
  2361         -
  2362         -    # DLL is installed to $(libdir)/../bin by postinstall_cmds
  2363         -    postinstall_cmds='base_file=`basename \${file}`~
  2364         -      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
  2365         -      dldir=$destdir/`dirname \$dlpath`~
  2366         -      test -d \$dldir || mkdir -p \$dldir~
  2367         -      $install_prog $dir/$dlname \$dldir/$dlname'
  2368         -    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
  2369         -      dlpath=$dir/\$dldll~
  2370         -       $RM \$dlpath'
  2371         -    shlibpath_overrides_runpath=yes
  2372         -    dynamic_linker='Win32 link.exe'
  2373         -    ;;
  2374         -
  2375         -  *)
  2376         -    # Assume MSVC wrapper
  2377         -    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
  2378         -    dynamic_linker='Win32 ld.exe'
  2379         -    ;;
  2380         -  esac
  2381         -  # FIXME: first we should search . and the directory the executable is in
  2382         -  shlibpath_var=PATH
  2383         -  ;;
  2384         -
  2385         -darwin* | rhapsody*)
  2386         -  dynamic_linker="$host_os dyld"
  2387         -  version_type=darwin
  2388         -  need_lib_prefix=no
  2389         -  need_version=no
  2390         -  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
  2391         -  soname_spec='${libname}${release}${major}$shared_ext'
  2392         -  shlibpath_overrides_runpath=yes
  2393         -  shlibpath_var=DYLD_LIBRARY_PATH
  2394         -  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
  2395         -m4_if([$1], [],[
  2396         -  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
  2397         -  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
  2398         -  ;;
  2399         -
  2400         -dgux*)
  2401         -  version_type=linux
  2402         -  need_lib_prefix=no
  2403         -  need_version=no
  2404         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
  2405         -  soname_spec='${libname}${release}${shared_ext}$major'
  2406         -  shlibpath_var=LD_LIBRARY_PATH
  2407         -  ;;
  2408         -
  2409         -freebsd1*)
  2410         -  dynamic_linker=no
  2411         -  ;;
  2412         -
  2413         -freebsd* | dragonfly*)
  2414         -  # DragonFly does not have aout.  When/if they implement a new
  2415         -  # versioning mechanism, adjust this.
  2416         -  if test -x /usr/bin/objformat; then
  2417         -    objformat=`/usr/bin/objformat`
  2418         -  else
  2419         -    case $host_os in
  2420         -    freebsd[[123]]*) objformat=aout ;;
  2421         -    *) objformat=elf ;;
  2422         -    esac
  2423         -  fi
  2424         -  version_type=freebsd-$objformat
  2425         -  case $version_type in
  2426         -    freebsd-elf*)
  2427         -      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  2428         -      need_version=no
  2429         -      need_lib_prefix=no
  2430         -      ;;
  2431         -    freebsd-*)
  2432         -      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
  2433         -      need_version=yes
  2434         -      ;;
  2435         -  esac
  2436         -  shlibpath_var=LD_LIBRARY_PATH
  2437         -  case $host_os in
  2438         -  freebsd2*)
  2439         -    shlibpath_overrides_runpath=yes
  2440         -    ;;
  2441         -  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
  2442         -    shlibpath_overrides_runpath=yes
  2443         -    hardcode_into_libs=yes
  2444         -    ;;
  2445         -  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
  2446         -  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
  2447         -    shlibpath_overrides_runpath=no
  2448         -    hardcode_into_libs=yes
  2449         -    ;;
  2450         -  *) # from 4.6 on, and DragonFly
  2451         -    shlibpath_overrides_runpath=yes
  2452         -    hardcode_into_libs=yes
  2453         -    ;;
  2454         -  esac
  2455         -  ;;
  2456         -
  2457         -gnu*)
  2458         -  version_type=linux
  2459         -  need_lib_prefix=no
  2460         -  need_version=no
  2461         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
  2462         -  soname_spec='${libname}${release}${shared_ext}$major'
  2463         -  shlibpath_var=LD_LIBRARY_PATH
  2464         -  hardcode_into_libs=yes
  2465         -  ;;
  2466         -
  2467         -haiku*)
  2468         -  version_type=linux
  2469         -  need_lib_prefix=no
  2470         -  need_version=no
  2471         -  dynamic_linker="$host_os runtime_loader"
  2472         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
  2473         -  soname_spec='${libname}${release}${shared_ext}$major'
  2474         -  shlibpath_var=LIBRARY_PATH
  2475         -  shlibpath_overrides_runpath=yes
  2476         -  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
  2477         -  hardcode_into_libs=yes
  2478         -  ;;
  2479         -
  2480         -hpux9* | hpux10* | hpux11*)
  2481         -  # Give a soname corresponding to the major version so that dld.sl refuses to
  2482         -  # link against other versions.
  2483         -  version_type=sunos
  2484         -  need_lib_prefix=no
  2485         -  need_version=no
  2486         -  case $host_cpu in
  2487         -  ia64*)
  2488         -    shrext_cmds='.so'
  2489         -    hardcode_into_libs=yes
  2490         -    dynamic_linker="$host_os dld.so"
  2491         -    shlibpath_var=LD_LIBRARY_PATH
  2492         -    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  2493         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2494         -    soname_spec='${libname}${release}${shared_ext}$major'
  2495         -    if test "X$HPUX_IA64_MODE" = X32; then
  2496         -      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
  2497         -    else
  2498         -      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
  2499         -    fi
  2500         -    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  2501         -    ;;
  2502         -  hppa*64*)
  2503         -    shrext_cmds='.sl'
  2504         -    hardcode_into_libs=yes
  2505         -    dynamic_linker="$host_os dld.sl"
  2506         -    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
  2507         -    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  2508         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2509         -    soname_spec='${libname}${release}${shared_ext}$major'
  2510         -    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
  2511         -    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  2512         -    ;;
  2513         -  *)
  2514         -    shrext_cmds='.sl'
  2515         -    dynamic_linker="$host_os dld.sl"
  2516         -    shlibpath_var=SHLIB_PATH
  2517         -    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  2518         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2519         -    soname_spec='${libname}${release}${shared_ext}$major'
  2520         -    ;;
  2521         -  esac
  2522         -  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
  2523         -  postinstall_cmds='chmod 555 $lib'
  2524         -  # or fails outright, so override atomically:
  2525         -  install_override_mode=555
  2526         -  ;;
  2527         -
  2528         -interix[[3-9]]*)
  2529         -  version_type=linux
  2530         -  need_lib_prefix=no
  2531         -  need_version=no
  2532         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  2533         -  soname_spec='${libname}${release}${shared_ext}$major'
  2534         -  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
  2535         -  shlibpath_var=LD_LIBRARY_PATH
  2536         -  shlibpath_overrides_runpath=no
  2537         -  hardcode_into_libs=yes
  2538         -  ;;
  2539         -
  2540         -irix5* | irix6* | nonstopux*)
  2541         -  case $host_os in
  2542         -    nonstopux*) version_type=nonstopux ;;
  2543         -    *)
  2544         -	if test "$lt_cv_prog_gnu_ld" = yes; then
  2545         -		version_type=linux
  2546         -	else
  2547         -		version_type=irix
  2548         -	fi ;;
  2549         -  esac
  2550         -  need_lib_prefix=no
  2551         -  need_version=no
  2552         -  soname_spec='${libname}${release}${shared_ext}$major'
  2553         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
  2554         -  case $host_os in
  2555         -  irix5* | nonstopux*)
  2556         -    libsuff= shlibsuff=
  2557         -    ;;
  2558         -  *)
  2559         -    case $LD in # libtool.m4 will add one of these switches to LD
  2560         -    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
  2561         -      libsuff= shlibsuff= libmagic=32-bit;;
  2562         -    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
  2563         -      libsuff=32 shlibsuff=N32 libmagic=N32;;
  2564         -    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
  2565         -      libsuff=64 shlibsuff=64 libmagic=64-bit;;
  2566         -    *) libsuff= shlibsuff= libmagic=never-match;;
  2567         -    esac
  2568         -    ;;
  2569         -  esac
  2570         -  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  2571         -  shlibpath_overrides_runpath=no
  2572         -  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  2573         -  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  2574         -  hardcode_into_libs=yes
  2575         -  ;;
  2576         -
  2577         -# No shared lib support for Linux oldld, aout, or coff.
  2578         -linux*oldld* | linux*aout* | linux*coff*)
  2579         -  dynamic_linker=no
  2580         -  ;;
  2581         -
  2582         -# This must be Linux ELF.
  2583         -linux* | k*bsd*-gnu | kopensolaris*-gnu)
  2584         -  version_type=linux
  2585         -  need_lib_prefix=no
  2586         -  need_version=no
  2587         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2588         -  soname_spec='${libname}${release}${shared_ext}$major'
  2589         -  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  2590         -  shlibpath_var=LD_LIBRARY_PATH
  2591         -  shlibpath_overrides_runpath=no
  2592         -
  2593         -  # Some binutils ld are patched to set DT_RUNPATH
  2594         -  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
  2595         -    [lt_cv_shlibpath_overrides_runpath=no
  2596         -    save_LDFLAGS=$LDFLAGS
  2597         -    save_libdir=$libdir
  2598         -    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
  2599         -	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
  2600         -    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
  2601         -      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
  2602         -	 [lt_cv_shlibpath_overrides_runpath=yes])])
  2603         -    LDFLAGS=$save_LDFLAGS
  2604         -    libdir=$save_libdir
  2605         -    ])
  2606         -  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
  2607         -
  2608         -  # This implies no fast_install, which is unacceptable.
  2609         -  # Some rework will be needed to allow for fast_install
  2610         -  # before this can be enabled.
  2611         -  hardcode_into_libs=yes
  2612         -
  2613         -  # Add ABI-specific directories to the system library path.
  2614         -  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
  2615         -
  2616         -  # Append ld.so.conf contents to the search path
  2617         -  if test -f /etc/ld.so.conf; then
  2618         -    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
  2619         -    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
  2620         -
  2621         -  fi
  2622         -
  2623         -  # We used to test for /lib/ld.so.1 and disable shared libraries on
  2624         -  # powerpc, because MkLinux only supported shared libraries with the
  2625         -  # GNU dynamic linker.  Since this was broken with cross compilers,
  2626         -  # most powerpc-linux boxes support dynamic linking these days and
  2627         -  # people can always --disable-shared, the test was removed, and we
  2628         -  # assume the GNU/Linux dynamic linker is in use.
  2629         -  dynamic_linker='GNU/Linux ld.so'
  2630         -  ;;
  2631         -
  2632         -netbsd*)
  2633         -  version_type=sunos
  2634         -  need_lib_prefix=no
  2635         -  need_version=no
  2636         -  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
  2637         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2638         -    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2639         -    dynamic_linker='NetBSD (a.out) ld.so'
  2640         -  else
  2641         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  2642         -    soname_spec='${libname}${release}${shared_ext}$major'
  2643         -    dynamic_linker='NetBSD ld.elf_so'
  2644         -  fi
  2645         -  shlibpath_var=LD_LIBRARY_PATH
  2646         -  shlibpath_overrides_runpath=yes
  2647         -  hardcode_into_libs=yes
  2648         -  ;;
  2649         -
  2650         -newsos6)
  2651         -  version_type=linux
  2652         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2653         -  shlibpath_var=LD_LIBRARY_PATH
  2654         -  shlibpath_overrides_runpath=yes
  2655         -  ;;
  2656         -
  2657         -*nto* | *qnx*)
  2658         -  version_type=qnx
  2659         -  need_lib_prefix=no
  2660         -  need_version=no
  2661         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2662         -  soname_spec='${libname}${release}${shared_ext}$major'
  2663         -  shlibpath_var=LD_LIBRARY_PATH
  2664         -  shlibpath_overrides_runpath=no
  2665         -  hardcode_into_libs=yes
  2666         -  dynamic_linker='ldqnx.so'
  2667         -  ;;
  2668         -
  2669         -openbsd*)
  2670         -  version_type=sunos
  2671         -  sys_lib_dlsearch_path_spec="/usr/lib"
  2672         -  need_lib_prefix=no
  2673         -  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
  2674         -  case $host_os in
  2675         -    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
  2676         -    *)				need_version=no  ;;
  2677         -  esac
  2678         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2679         -  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2680         -  shlibpath_var=LD_LIBRARY_PATH
  2681         -  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  2682         -    case $host_os in
  2683         -      openbsd2.[[89]] | openbsd2.[[89]].*)
  2684         -	shlibpath_overrides_runpath=no
  2685         -	;;
  2686         -      *)
  2687         -	shlibpath_overrides_runpath=yes
  2688         -	;;
  2689         -      esac
  2690         -  else
  2691         -    shlibpath_overrides_runpath=yes
  2692         -  fi
  2693         -  ;;
  2694         -
  2695         -os2*)
  2696         -  libname_spec='$name'
  2697         -  shrext_cmds=".dll"
  2698         -  need_lib_prefix=no
  2699         -  library_names_spec='$libname${shared_ext} $libname.a'
  2700         -  dynamic_linker='OS/2 ld.exe'
  2701         -  shlibpath_var=LIBPATH
  2702         -  ;;
  2703         -
  2704         -osf3* | osf4* | osf5*)
  2705         -  version_type=osf
  2706         -  need_lib_prefix=no
  2707         -  need_version=no
  2708         -  soname_spec='${libname}${release}${shared_ext}$major'
  2709         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2710         -  shlibpath_var=LD_LIBRARY_PATH
  2711         -  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  2712         -  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  2713         -  ;;
  2714         -
  2715         -rdos*)
  2716         -  dynamic_linker=no
  2717         -  ;;
  2718         -
  2719         -solaris*)
  2720         -  version_type=linux
  2721         -  need_lib_prefix=no
  2722         -  need_version=no
  2723         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2724         -  soname_spec='${libname}${release}${shared_ext}$major'
  2725         -  shlibpath_var=LD_LIBRARY_PATH
  2726         -  shlibpath_overrides_runpath=yes
  2727         -  hardcode_into_libs=yes
  2728         -  # ldd complains unless libraries are executable
  2729         -  postinstall_cmds='chmod +x $lib'
  2730         -  ;;
  2731         -
  2732         -sunos4*)
  2733         -  version_type=sunos
  2734         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2735         -  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  2736         -  shlibpath_var=LD_LIBRARY_PATH
  2737         -  shlibpath_overrides_runpath=yes
  2738         -  if test "$with_gnu_ld" = yes; then
  2739         -    need_lib_prefix=no
  2740         -  fi
  2741         -  need_version=yes
  2742         -  ;;
  2743         -
  2744         -sysv4 | sysv4.3*)
  2745         -  version_type=linux
  2746         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2747         -  soname_spec='${libname}${release}${shared_ext}$major'
  2748         -  shlibpath_var=LD_LIBRARY_PATH
  2749         -  case $host_vendor in
  2750         -    sni)
  2751         -      shlibpath_overrides_runpath=no
  2752         -      need_lib_prefix=no
  2753         -      runpath_var=LD_RUN_PATH
  2754         -      ;;
  2755         -    siemens)
  2756         -      need_lib_prefix=no
  2757         -      ;;
  2758         -    motorola)
  2759         -      need_lib_prefix=no
  2760         -      need_version=no
  2761         -      shlibpath_overrides_runpath=no
  2762         -      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  2763         -      ;;
  2764         -  esac
  2765         -  ;;
  2766         -
  2767         -sysv4*MP*)
  2768         -  if test -d /usr/nec ;then
  2769         -    version_type=linux
  2770         -    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
  2771         -    soname_spec='$libname${shared_ext}.$major'
  2772         -    shlibpath_var=LD_LIBRARY_PATH
  2773         -  fi
  2774         -  ;;
  2775         -
  2776         -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  2777         -  version_type=freebsd-elf
  2778         -  need_lib_prefix=no
  2779         -  need_version=no
  2780         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  2781         -  soname_spec='${libname}${release}${shared_ext}$major'
  2782         -  shlibpath_var=LD_LIBRARY_PATH
  2783         -  shlibpath_overrides_runpath=yes
  2784         -  hardcode_into_libs=yes
  2785         -  if test "$with_gnu_ld" = yes; then
  2786         -    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
  2787         -  else
  2788         -    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
  2789         -    case $host_os in
  2790         -      sco3.2v5*)
  2791         -        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
  2792         -	;;
  2793         -    esac
  2794         -  fi
  2795         -  sys_lib_dlsearch_path_spec='/usr/lib'
  2796         -  ;;
  2797         -
  2798         -tpf*)
  2799         -  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
  2800         -  version_type=linux
  2801         -  need_lib_prefix=no
  2802         -  need_version=no
  2803         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2804         -  shlibpath_var=LD_LIBRARY_PATH
  2805         -  shlibpath_overrides_runpath=no
  2806         -  hardcode_into_libs=yes
  2807         -  ;;
  2808         -
  2809         -uts4*)
  2810         -  version_type=linux
  2811         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2812         -  soname_spec='${libname}${release}${shared_ext}$major'
  2813         -  shlibpath_var=LD_LIBRARY_PATH
  2814         -  ;;
  2815         -
  2816         -*)
  2817         -  dynamic_linker=no
  2818         -  ;;
  2819         -esac
  2820         -AC_MSG_RESULT([$dynamic_linker])
  2821         -test "$dynamic_linker" = no && can_build_shared=no
  2822         -
  2823         -variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
  2824         -if test "$GCC" = yes; then
  2825         -  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  2826         -fi
  2827         -
  2828         -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
  2829         -  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
  2830         -fi
  2831         -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
  2832         -  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
  2833         -fi
  2834         -
  2835         -_LT_DECL([], [variables_saved_for_relink], [1],
  2836         -    [Variables whose values should be saved in libtool wrapper scripts and
  2837         -    restored at link time])
  2838         -_LT_DECL([], [need_lib_prefix], [0],
  2839         -    [Do we need the "lib" prefix for modules?])
  2840         -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
  2841         -_LT_DECL([], [version_type], [0], [Library versioning type])
  2842         -_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
  2843         -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
  2844         -_LT_DECL([], [shlibpath_overrides_runpath], [0],
  2845         -    [Is shlibpath searched before the hard-coded library search path?])
  2846         -_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
  2847         -_LT_DECL([], [library_names_spec], [1],
  2848         -    [[List of archive names.  First name is the real one, the rest are links.
  2849         -    The last name is the one that the linker finds with -lNAME]])
  2850         -_LT_DECL([], [soname_spec], [1],
  2851         -    [[The coded name of the library, if different from the real name]])
  2852         -_LT_DECL([], [install_override_mode], [1],
  2853         -    [Permission mode override for installation of shared libraries])
  2854         -_LT_DECL([], [postinstall_cmds], [2],
  2855         -    [Command to use after installation of a shared archive])
  2856         -_LT_DECL([], [postuninstall_cmds], [2],
  2857         -    [Command to use after uninstallation of a shared archive])
  2858         -_LT_DECL([], [finish_cmds], [2],
  2859         -    [Commands used to finish a libtool library installation in a directory])
  2860         -_LT_DECL([], [finish_eval], [1],
  2861         -    [[As "finish_cmds", except a single script fragment to be evaled but
  2862         -    not shown]])
  2863         -_LT_DECL([], [hardcode_into_libs], [0],
  2864         -    [Whether we should hardcode library paths into libraries])
  2865         -_LT_DECL([], [sys_lib_search_path_spec], [2],
  2866         -    [Compile-time system search path for libraries])
  2867         -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
  2868         -    [Run-time system search path for libraries])
  2869         -])# _LT_SYS_DYNAMIC_LINKER
  2870         -
  2871         -
  2872         -# _LT_PATH_TOOL_PREFIX(TOOL)
  2873         -# --------------------------
  2874         -# find a file program which can recognize shared library
  2875         -AC_DEFUN([_LT_PATH_TOOL_PREFIX],
  2876         -[m4_require([_LT_DECL_EGREP])dnl
  2877         -AC_MSG_CHECKING([for $1])
  2878         -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  2879         -[case $MAGIC_CMD in
  2880         -[[\\/*] |  ?:[\\/]*])
  2881         -  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  2882         -  ;;
  2883         -*)
  2884         -  lt_save_MAGIC_CMD="$MAGIC_CMD"
  2885         -  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  2886         -dnl $ac_dummy forces splitting on constant user-supplied paths.
  2887         -dnl POSIX.2 word splitting is done only on the output of word expansions,
  2888         -dnl not every word.  This closes a longstanding sh security hole.
  2889         -  ac_dummy="m4_if([$2], , $PATH, [$2])"
  2890         -  for ac_dir in $ac_dummy; do
  2891         -    IFS="$lt_save_ifs"
  2892         -    test -z "$ac_dir" && ac_dir=.
  2893         -    if test -f $ac_dir/$1; then
  2894         -      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  2895         -      if test -n "$file_magic_test_file"; then
  2896         -	case $deplibs_check_method in
  2897         -	"file_magic "*)
  2898         -	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
  2899         -	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  2900         -	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  2901         -	    $EGREP "$file_magic_regex" > /dev/null; then
  2902         -	    :
  2903         -	  else
  2904         -	    cat <<_LT_EOF 1>&2
  2905         -
  2906         -*** Warning: the command libtool uses to detect shared libraries,
  2907         -*** $file_magic_cmd, produces output that libtool cannot recognize.
  2908         -*** The result is that libtool may fail to recognize shared libraries
  2909         -*** as such.  This will affect the creation of libtool libraries that
  2910         -*** depend on shared libraries, but programs linked with such libtool
  2911         -*** libraries will work regardless of this problem.  Nevertheless, you
  2912         -*** may want to report the problem to your system manager and/or to
  2913         -*** bug-libtool@gnu.org
  2914         -
  2915         -_LT_EOF
  2916         -	  fi ;;
  2917         -	esac
  2918         -      fi
  2919         -      break
  2920         -    fi
  2921         -  done
  2922         -  IFS="$lt_save_ifs"
  2923         -  MAGIC_CMD="$lt_save_MAGIC_CMD"
  2924         -  ;;
  2925         -esac])
  2926         -MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  2927         -if test -n "$MAGIC_CMD"; then
  2928         -  AC_MSG_RESULT($MAGIC_CMD)
  2929         -else
  2930         -  AC_MSG_RESULT(no)
  2931         -fi
  2932         -_LT_DECL([], [MAGIC_CMD], [0],
  2933         -	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
  2934         -])# _LT_PATH_TOOL_PREFIX
  2935         -
  2936         -# Old name:
  2937         -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
  2938         -dnl aclocal-1.4 backwards compatibility:
  2939         -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
  2940         -
  2941         -
  2942         -# _LT_PATH_MAGIC
  2943         -# --------------
  2944         -# find a file program which can recognize a shared library
  2945         -m4_defun([_LT_PATH_MAGIC],
  2946         -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
  2947         -if test -z "$lt_cv_path_MAGIC_CMD"; then
  2948         -  if test -n "$ac_tool_prefix"; then
  2949         -    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
  2950         -  else
  2951         -    MAGIC_CMD=:
  2952         -  fi
  2953         -fi
  2954         -])# _LT_PATH_MAGIC
  2955         -
  2956         -
  2957         -# LT_PATH_LD
  2958         -# ----------
  2959         -# find the pathname to the GNU or non-GNU linker
  2960         -AC_DEFUN([LT_PATH_LD],
  2961         -[AC_REQUIRE([AC_PROG_CC])dnl
  2962         -AC_REQUIRE([AC_CANONICAL_HOST])dnl
  2963         -AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  2964         -m4_require([_LT_DECL_SED])dnl
  2965         -m4_require([_LT_DECL_EGREP])dnl
  2966         -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
  2967         -
  2968         -AC_ARG_WITH([gnu-ld],
  2969         -    [AS_HELP_STRING([--with-gnu-ld],
  2970         -	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
  2971         -    [test "$withval" = no || with_gnu_ld=yes],
  2972         -    [with_gnu_ld=no])dnl
  2973         -
  2974         -ac_prog=ld
  2975         -if test "$GCC" = yes; then
  2976         -  # Check if gcc -print-prog-name=ld gives a path.
  2977         -  AC_MSG_CHECKING([for ld used by $CC])
  2978         -  case $host in
  2979         -  *-*-mingw*)
  2980         -    # gcc leaves a trailing carriage return which upsets mingw
  2981         -    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  2982         -  *)
  2983         -    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  2984         -  esac
  2985         -  case $ac_prog in
  2986         -    # Accept absolute paths.
  2987         -    [[\\/]]* | ?:[[\\/]]*)
  2988         -      re_direlt='/[[^/]][[^/]]*/\.\./'
  2989         -      # Canonicalize the pathname of ld
  2990         -      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
  2991         -      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
  2992         -	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
  2993         -      done
  2994         -      test -z "$LD" && LD="$ac_prog"
  2995         -      ;;
  2996         -  "")
  2997         -    # If it fails, then pretend we aren't using GCC.
  2998         -    ac_prog=ld
  2999         -    ;;
  3000         -  *)
  3001         -    # If it is relative, then search for the first ld in PATH.
  3002         -    with_gnu_ld=unknown
  3003         -    ;;
  3004         -  esac
  3005         -elif test "$with_gnu_ld" = yes; then
  3006         -  AC_MSG_CHECKING([for GNU ld])
  3007         -else
  3008         -  AC_MSG_CHECKING([for non-GNU ld])
  3009         -fi
  3010         -AC_CACHE_VAL(lt_cv_path_LD,
  3011         -[if test -z "$LD"; then
  3012         -  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  3013         -  for ac_dir in $PATH; do
  3014         -    IFS="$lt_save_ifs"
  3015         -    test -z "$ac_dir" && ac_dir=.
  3016         -    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  3017         -      lt_cv_path_LD="$ac_dir/$ac_prog"
  3018         -      # Check to see if the program is GNU ld.  I'd rather use --version,
  3019         -      # but apparently some variants of GNU ld only accept -v.
  3020         -      # Break only if it was the GNU/non-GNU ld that we prefer.
  3021         -      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
  3022         -      *GNU* | *'with BFD'*)
  3023         -	test "$with_gnu_ld" != no && break
  3024         -	;;
  3025         -      *)
  3026         -	test "$with_gnu_ld" != yes && break
  3027         -	;;
  3028         -      esac
  3029         -    fi
  3030         -  done
  3031         -  IFS="$lt_save_ifs"
  3032         -else
  3033         -  lt_cv_path_LD="$LD" # Let the user override the test with a path.
  3034         -fi])
  3035         -LD="$lt_cv_path_LD"
  3036         -if test -n "$LD"; then
  3037         -  AC_MSG_RESULT($LD)
  3038         -else
  3039         -  AC_MSG_RESULT(no)
  3040         -fi
  3041         -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  3042         -_LT_PATH_LD_GNU
  3043         -AC_SUBST([LD])
  3044         -
  3045         -_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
  3046         -])# LT_PATH_LD
  3047         -
  3048         -# Old names:
  3049         -AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
  3050         -AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
  3051         -dnl aclocal-1.4 backwards compatibility:
  3052         -dnl AC_DEFUN([AM_PROG_LD], [])
  3053         -dnl AC_DEFUN([AC_PROG_LD], [])
  3054         -
  3055         -
  3056         -# _LT_PATH_LD_GNU
  3057         -#- --------------
  3058         -m4_defun([_LT_PATH_LD_GNU],
  3059         -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  3060         -[# I'd rather use --version here, but apparently some GNU lds only accept -v.
  3061         -case `$LD -v 2>&1 </dev/null` in
  3062         -*GNU* | *'with BFD'*)
  3063         -  lt_cv_prog_gnu_ld=yes
  3064         -  ;;
  3065         -*)
  3066         -  lt_cv_prog_gnu_ld=no
  3067         -  ;;
  3068         -esac])
  3069         -with_gnu_ld=$lt_cv_prog_gnu_ld
  3070         -])# _LT_PATH_LD_GNU
  3071         -
  3072         -
  3073         -# _LT_CMD_RELOAD
  3074         -# --------------
  3075         -# find reload flag for linker
  3076         -#   -- PORTME Some linkers may need a different reload flag.
  3077         -m4_defun([_LT_CMD_RELOAD],
  3078         -[AC_CACHE_CHECK([for $LD option to reload object files],
  3079         -  lt_cv_ld_reload_flag,
  3080         -  [lt_cv_ld_reload_flag='-r'])
  3081         -reload_flag=$lt_cv_ld_reload_flag
  3082         -case $reload_flag in
  3083         -"" | " "*) ;;
  3084         -*) reload_flag=" $reload_flag" ;;
  3085         -esac
  3086         -reload_cmds='$LD$reload_flag -o $output$reload_objs'
  3087         -case $host_os in
  3088         -  cygwin* | mingw* | pw32* | cegcc*)
  3089         -    if test "$GCC" != yes; then
  3090         -      reload_cmds=false
  3091         -    fi
  3092         -    ;;
  3093         -  darwin*)
  3094         -    if test "$GCC" = yes; then
  3095         -      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
  3096         -    else
  3097         -      reload_cmds='$LD$reload_flag -o $output$reload_objs'
  3098         -    fi
  3099         -    ;;
  3100         -esac
  3101         -_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
  3102         -_LT_TAGDECL([], [reload_cmds], [2])dnl
  3103         -])# _LT_CMD_RELOAD
  3104         -
  3105         -
  3106         -# _LT_CHECK_MAGIC_METHOD
  3107         -# ----------------------
  3108         -# how to check for library dependencies
  3109         -#  -- PORTME fill in with the dynamic library characteristics
  3110         -m4_defun([_LT_CHECK_MAGIC_METHOD],
  3111         -[m4_require([_LT_DECL_EGREP])
  3112         -m4_require([_LT_DECL_OBJDUMP])
  3113         -AC_CACHE_CHECK([how to recognize dependent libraries],
  3114         -lt_cv_deplibs_check_method,
  3115         -[lt_cv_file_magic_cmd='$MAGIC_CMD'
  3116         -lt_cv_file_magic_test_file=
  3117         -lt_cv_deplibs_check_method='unknown'
  3118         -# Need to set the preceding variable on all platforms that support
  3119         -# interlibrary dependencies.
  3120         -# 'none' -- dependencies not supported.
  3121         -# `unknown' -- same as none, but documents that we really don't know.
  3122         -# 'pass_all' -- all dependencies passed with no checks.
  3123         -# 'test_compile' -- check by making test program.
  3124         -# 'file_magic [[regex]]' -- check by looking for files in library path
  3125         -# which responds to the $file_magic_cmd with a given extended regex.
  3126         -# If you have `file' or equivalent on your system and you're not sure
  3127         -# whether `pass_all' will *always* work, you probably want this one.
  3128         -
  3129         -case $host_os in
  3130         -aix[[4-9]]*)
  3131         -  lt_cv_deplibs_check_method=pass_all
  3132         -  ;;
  3133         -
  3134         -beos*)
  3135         -  lt_cv_deplibs_check_method=pass_all
  3136         -  ;;
  3137         -
  3138         -bsdi[[45]]*)
  3139         -  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
  3140         -  lt_cv_file_magic_cmd='/usr/bin/file -L'
  3141         -  lt_cv_file_magic_test_file=/shlib/libc.so
  3142         -  ;;
  3143         -
  3144         -cygwin*)
  3145         -  # func_win32_libid is a shell function defined in ltmain.sh
  3146         -  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
  3147         -  lt_cv_file_magic_cmd='func_win32_libid'
  3148         -  ;;
  3149         -
  3150         -mingw* | pw32*)
  3151         -  # Base MSYS/MinGW do not provide the 'file' command needed by
  3152         -  # func_win32_libid shell function, so use a weaker test based on 'objdump',
  3153         -  # unless we find 'file', for example because we are cross-compiling.
  3154         -  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
  3155         -  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
  3156         -    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
  3157         -    lt_cv_file_magic_cmd='func_win32_libid'
  3158         -  else
  3159         -    # Keep this pattern in sync with the one in func_win32_libid.
  3160         -    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
  3161         -    lt_cv_file_magic_cmd='$OBJDUMP -f'
  3162         -  fi
  3163         -  ;;
  3164         -
  3165         -cegcc*)
  3166         -  # use the weaker test based on 'objdump'. See mingw*.
  3167         -  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
  3168         -  lt_cv_file_magic_cmd='$OBJDUMP -f'
  3169         -  ;;
  3170         -
  3171         -darwin* | rhapsody*)
  3172         -  lt_cv_deplibs_check_method=pass_all
  3173         -  ;;
  3174         -
  3175         -freebsd* | dragonfly*)
  3176         -  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
  3177         -    case $host_cpu in
  3178         -    i*86 )
  3179         -      # Not sure whether the presence of OpenBSD here was a mistake.
  3180         -      # Let's accept both of them until this is cleared up.
  3181         -      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
  3182         -      lt_cv_file_magic_cmd=/usr/bin/file
  3183         -      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  3184         -      ;;
  3185         -    esac
  3186         -  else
  3187         -    lt_cv_deplibs_check_method=pass_all
  3188         -  fi
  3189         -  ;;
  3190         -
  3191         -gnu*)
  3192         -  lt_cv_deplibs_check_method=pass_all
  3193         -  ;;
  3194         -
  3195         -haiku*)
  3196         -  lt_cv_deplibs_check_method=pass_all
  3197         -  ;;
  3198         -
  3199         -hpux10.20* | hpux11*)
  3200         -  lt_cv_file_magic_cmd=/usr/bin/file
  3201         -  case $host_cpu in
  3202         -  ia64*)
  3203         -    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
  3204         -    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
  3205         -    ;;
  3206         -  hppa*64*)
  3207         -    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
  3208         -    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
  3209         -    ;;
  3210         -  *)
  3211         -    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
  3212         -    lt_cv_file_magic_test_file=/usr/lib/libc.sl
  3213         -    ;;
  3214         -  esac
  3215         -  ;;
  3216         -
  3217         -interix[[3-9]]*)
  3218         -  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
  3219         -  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
  3220         -  ;;
  3221         -
  3222         -irix5* | irix6* | nonstopux*)
  3223         -  case $LD in
  3224         -  *-32|*"-32 ") libmagic=32-bit;;
  3225         -  *-n32|*"-n32 ") libmagic=N32;;
  3226         -  *-64|*"-64 ") libmagic=64-bit;;
  3227         -  *) libmagic=never-match;;
  3228         -  esac
  3229         -  lt_cv_deplibs_check_method=pass_all
  3230         -  ;;
  3231         -
  3232         -# This must be Linux ELF.
  3233         -linux* | k*bsd*-gnu | kopensolaris*-gnu)
  3234         -  lt_cv_deplibs_check_method=pass_all
  3235         -  ;;
  3236         -
  3237         -netbsd*)
  3238         -  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
  3239         -    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  3240         -  else
  3241         -    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
  3242         -  fi
  3243         -  ;;
  3244         -
  3245         -newos6*)
  3246         -  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
  3247         -  lt_cv_file_magic_cmd=/usr/bin/file
  3248         -  lt_cv_file_magic_test_file=/usr/lib/libnls.so
  3249         -  ;;
  3250         -
  3251         -*nto* | *qnx*)
  3252         -  lt_cv_deplibs_check_method=pass_all
  3253         -  ;;
  3254         -
  3255         -openbsd*)
  3256         -  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  3257         -    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
  3258         -  else
  3259         -    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  3260         -  fi
  3261         -  ;;
  3262         -
  3263         -osf3* | osf4* | osf5*)
  3264         -  lt_cv_deplibs_check_method=pass_all
  3265         -  ;;
  3266         -
  3267         -rdos*)
  3268         -  lt_cv_deplibs_check_method=pass_all
  3269         -  ;;
  3270         -
  3271         -solaris*)
  3272         -  lt_cv_deplibs_check_method=pass_all
  3273         -  ;;
  3274         -
  3275         -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  3276         -  lt_cv_deplibs_check_method=pass_all
  3277         -  ;;
  3278         -
  3279         -sysv4 | sysv4.3*)
  3280         -  case $host_vendor in
  3281         -  motorola)
  3282         -    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
  3283         -    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  3284         -    ;;
  3285         -  ncr)
  3286         -    lt_cv_deplibs_check_method=pass_all
  3287         -    ;;
  3288         -  sequent)
  3289         -    lt_cv_file_magic_cmd='/bin/file'
  3290         -    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
  3291         -    ;;
  3292         -  sni)
  3293         -    lt_cv_file_magic_cmd='/bin/file'
  3294         -    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
  3295         -    lt_cv_file_magic_test_file=/lib/libc.so
  3296         -    ;;
  3297         -  siemens)
  3298         -    lt_cv_deplibs_check_method=pass_all
  3299         -    ;;
  3300         -  pc)
  3301         -    lt_cv_deplibs_check_method=pass_all
  3302         -    ;;
  3303         -  esac
  3304         -  ;;
  3305         -
  3306         -tpf*)
  3307         -  lt_cv_deplibs_check_method=pass_all
  3308         -  ;;
  3309         -esac
  3310         -])
  3311         -
  3312         -file_magic_glob=
  3313         -want_nocaseglob=no
  3314         -if test "$build" = "$host"; then
  3315         -  case $host_os in
  3316         -  mingw* | pw32*)
  3317         -    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
  3318         -      want_nocaseglob=yes
  3319         -    else
  3320         -      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
  3321         -    fi
  3322         -    ;;
  3323         -  esac
  3324         -fi
  3325         -
  3326         -file_magic_cmd=$lt_cv_file_magic_cmd
  3327         -deplibs_check_method=$lt_cv_deplibs_check_method
  3328         -test -z "$deplibs_check_method" && deplibs_check_method=unknown
  3329         -
  3330         -_LT_DECL([], [deplibs_check_method], [1],
  3331         -    [Method to check whether dependent libraries are shared objects])
  3332         -_LT_DECL([], [file_magic_cmd], [1],
  3333         -    [Command to use when deplibs_check_method = "file_magic"])
  3334         -_LT_DECL([], [file_magic_glob], [1],
  3335         -    [How to find potential files when deplibs_check_method = "file_magic"])
  3336         -_LT_DECL([], [want_nocaseglob], [1],
  3337         -    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
  3338         -])# _LT_CHECK_MAGIC_METHOD
  3339         -
  3340         -
  3341         -# LT_PATH_NM
  3342         -# ----------
  3343         -# find the pathname to a BSD- or MS-compatible name lister
  3344         -AC_DEFUN([LT_PATH_NM],
  3345         -[AC_REQUIRE([AC_PROG_CC])dnl
  3346         -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
  3347         -[if test -n "$NM"; then
  3348         -  # Let the user override the test.
  3349         -  lt_cv_path_NM="$NM"
  3350         -else
  3351         -  lt_nm_to_check="${ac_tool_prefix}nm"
  3352         -  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
  3353         -    lt_nm_to_check="$lt_nm_to_check nm"
  3354         -  fi
  3355         -  for lt_tmp_nm in $lt_nm_to_check; do
  3356         -    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  3357         -    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
  3358         -      IFS="$lt_save_ifs"
  3359         -      test -z "$ac_dir" && ac_dir=.
  3360         -      tmp_nm="$ac_dir/$lt_tmp_nm"
  3361         -      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
  3362         -	# Check to see if the nm accepts a BSD-compat flag.
  3363         -	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
  3364         -	#   nm: unknown option "B" ignored
  3365         -	# Tru64's nm complains that /dev/null is an invalid object file
  3366         -	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
  3367         -	*/dev/null* | *'Invalid file or object type'*)
  3368         -	  lt_cv_path_NM="$tmp_nm -B"
  3369         -	  break
  3370         -	  ;;
  3371         -	*)
  3372         -	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
  3373         -	  */dev/null*)
  3374         -	    lt_cv_path_NM="$tmp_nm -p"
  3375         -	    break
  3376         -	    ;;
  3377         -	  *)
  3378         -	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
  3379         -	    continue # so that we can try to find one that supports BSD flags
  3380         -	    ;;
  3381         -	  esac
  3382         -	  ;;
  3383         -	esac
  3384         -      fi
  3385         -    done
  3386         -    IFS="$lt_save_ifs"
  3387         -  done
  3388         -  : ${lt_cv_path_NM=no}
  3389         -fi])
  3390         -if test "$lt_cv_path_NM" != "no"; then
  3391         -  NM="$lt_cv_path_NM"
  3392         -else
  3393         -  # Didn't find any BSD compatible name lister, look for dumpbin.
  3394         -  if test -n "$DUMPBIN"; then :
  3395         -    # Let the user override the test.
  3396         -  else
  3397         -    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
  3398         -    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
  3399         -    *COFF*)
  3400         -      DUMPBIN="$DUMPBIN -symbols"
  3401         -      ;;
  3402         -    *)
  3403         -      DUMPBIN=:
  3404         -      ;;
  3405         -    esac
  3406         -  fi
  3407         -  AC_SUBST([DUMPBIN])
  3408         -  if test "$DUMPBIN" != ":"; then
  3409         -    NM="$DUMPBIN"
  3410         -  fi
  3411         -fi
  3412         -test -z "$NM" && NM=nm
  3413         -AC_SUBST([NM])
  3414         -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
  3415         -
  3416         -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
  3417         -  [lt_cv_nm_interface="BSD nm"
  3418         -  echo "int some_variable = 0;" > conftest.$ac_ext
  3419         -  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
  3420         -  (eval "$ac_compile" 2>conftest.err)
  3421         -  cat conftest.err >&AS_MESSAGE_LOG_FD
  3422         -  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
  3423         -  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
  3424         -  cat conftest.err >&AS_MESSAGE_LOG_FD
  3425         -  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
  3426         -  cat conftest.out >&AS_MESSAGE_LOG_FD
  3427         -  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
  3428         -    lt_cv_nm_interface="MS dumpbin"
  3429         -  fi
  3430         -  rm -f conftest*])
  3431         -])# LT_PATH_NM
  3432         -
  3433         -# Old names:
  3434         -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
  3435         -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
  3436         -dnl aclocal-1.4 backwards compatibility:
  3437         -dnl AC_DEFUN([AM_PROG_NM], [])
  3438         -dnl AC_DEFUN([AC_PROG_NM], [])
  3439         -
  3440         -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
  3441         -# --------------------------------
  3442         -# how to determine the name of the shared library
  3443         -# associated with a specific link library.
  3444         -#  -- PORTME fill in with the dynamic library characteristics
  3445         -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
  3446         -[m4_require([_LT_DECL_EGREP])
  3447         -m4_require([_LT_DECL_OBJDUMP])
  3448         -m4_require([_LT_DECL_DLLTOOL])
  3449         -AC_CACHE_CHECK([how to associate runtime and link libraries],
  3450         -lt_cv_sharedlib_from_linklib_cmd,
  3451         -[lt_cv_sharedlib_from_linklib_cmd='unknown'
  3452         -
  3453         -case $host_os in
  3454         -cygwin* | mingw* | pw32* | cegcc*)
  3455         -  # two different shell functions defined in ltmain.sh
  3456         -  # decide which to use based on capabilities of $DLLTOOL
  3457         -  case `$DLLTOOL --help 2>&1` in
  3458         -  *--identify-strict*)
  3459         -    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
  3460         -    ;;
  3461         -  *)
  3462         -    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
  3463         -    ;;
  3464         -  esac
  3465         -  ;;
  3466         -*)
  3467         -  # fallback: assume linklib IS sharedlib
  3468         -  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
  3469         -  ;;
  3470         -esac
  3471         -])
  3472         -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
  3473         -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
  3474         -
  3475         -_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
  3476         -    [Command to associate shared and link libraries])
  3477         -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
  3478         -
  3479         -
  3480         -# _LT_PATH_MANIFEST_TOOL
  3481         -# ----------------------
  3482         -# locate the manifest tool
  3483         -m4_defun([_LT_PATH_MANIFEST_TOOL],
  3484         -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
  3485         -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
  3486         -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
  3487         -  [lt_cv_path_mainfest_tool=no
  3488         -  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
  3489         -  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
  3490         -  cat conftest.err >&AS_MESSAGE_LOG_FD
  3491         -  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
  3492         -    lt_cv_path_mainfest_tool=yes
  3493         -  fi
  3494         -  rm -f conftest*])
  3495         -if test "x$lt_cv_path_mainfest_tool" != xyes; then
  3496         -  MANIFEST_TOOL=:
  3497         -fi
  3498         -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
  3499         -])# _LT_PATH_MANIFEST_TOOL
  3500         -
  3501         -
  3502         -# LT_LIB_M
  3503         -# --------
  3504         -# check for math library
  3505         -AC_DEFUN([LT_LIB_M],
  3506         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3507         -LIBM=
  3508         -case $host in
  3509         -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
  3510         -  # These system don't have libm, or don't need it
  3511         -  ;;
  3512         -*-ncr-sysv4.3*)
  3513         -  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  3514         -  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
  3515         -  ;;
  3516         -*)
  3517         -  AC_CHECK_LIB(m, cos, LIBM="-lm")
  3518         -  ;;
  3519         -esac
  3520         -AC_SUBST([LIBM])
  3521         -])# LT_LIB_M
  3522         -
  3523         -# Old name:
  3524         -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
  3525         -dnl aclocal-1.4 backwards compatibility:
  3526         -dnl AC_DEFUN([AC_CHECK_LIBM], [])
  3527         -
  3528         -
  3529         -# _LT_COMPILER_NO_RTTI([TAGNAME])
  3530         -# -------------------------------
  3531         -m4_defun([_LT_COMPILER_NO_RTTI],
  3532         -[m4_require([_LT_TAG_COMPILER])dnl
  3533         -
  3534         -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  3535         -
  3536         -if test "$GCC" = yes; then
  3537         -  case $cc_basename in
  3538         -  nvcc*)
  3539         -    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
  3540         -  *)
  3541         -    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
  3542         -  esac
  3543         -
  3544         -  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
  3545         -    lt_cv_prog_compiler_rtti_exceptions,
  3546         -    [-fno-rtti -fno-exceptions], [],
  3547         -    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
  3548         -fi
  3549         -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
  3550         -	[Compiler flag to turn off builtin functions])
  3551         -])# _LT_COMPILER_NO_RTTI
  3552         -
  3553         -
  3554         -# _LT_CMD_GLOBAL_SYMBOLS
  3555         -# ----------------------
  3556         -m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
  3557         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3558         -AC_REQUIRE([AC_PROG_CC])dnl
  3559         -AC_REQUIRE([AC_PROG_AWK])dnl
  3560         -AC_REQUIRE([LT_PATH_NM])dnl
  3561         -AC_REQUIRE([LT_PATH_LD])dnl
  3562         -m4_require([_LT_DECL_SED])dnl
  3563         -m4_require([_LT_DECL_EGREP])dnl
  3564         -m4_require([_LT_TAG_COMPILER])dnl
  3565         -
  3566         -# Check for command to grab the raw symbol name followed by C symbol from nm.
  3567         -AC_MSG_CHECKING([command to parse $NM output from $compiler object])
  3568         -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
  3569         -[
  3570         -# These are sane defaults that work on at least a few old systems.
  3571         -# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
  3572         -
  3573         -# Character class describing NM global symbol codes.
  3574         -symcode='[[BCDEGRST]]'
  3575         -
  3576         -# Regexp to match symbols that can be accessed directly from C.
  3577         -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
  3578         -
  3579         -# Define system-specific variables.
  3580         -case $host_os in
  3581         -aix*)
  3582         -  symcode='[[BCDT]]'
  3583         -  ;;
  3584         -cygwin* | mingw* | pw32* | cegcc*)
  3585         -  symcode='[[ABCDGISTW]]'
  3586         -  ;;
  3587         -hpux*)
  3588         -  if test "$host_cpu" = ia64; then
  3589         -    symcode='[[ABCDEGRST]]'
  3590         -  fi
  3591         -  ;;
  3592         -irix* | nonstopux*)
  3593         -  symcode='[[BCDEGRST]]'
  3594         -  ;;
  3595         -osf*)
  3596         -  symcode='[[BCDEGQRST]]'
  3597         -  ;;
  3598         -solaris*)
  3599         -  symcode='[[BDRT]]'
  3600         -  ;;
  3601         -sco3.2v5*)
  3602         -  symcode='[[DT]]'
  3603         -  ;;
  3604         -sysv4.2uw2*)
  3605         -  symcode='[[DT]]'
  3606         -  ;;
  3607         -sysv5* | sco5v6* | unixware* | OpenUNIX*)
  3608         -  symcode='[[ABDT]]'
  3609         -  ;;
  3610         -sysv4)
  3611         -  symcode='[[DFNSTU]]'
  3612         -  ;;
  3613         -esac
  3614         -
  3615         -# If we're using GNU nm, then use its standard symbol codes.
  3616         -case `$NM -V 2>&1` in
  3617         -*GNU* | *'with BFD'*)
  3618         -  symcode='[[ABCDGIRSTW]]' ;;
  3619         -esac
  3620         -
  3621         -# Transform an extracted symbol line into a proper C declaration.
  3622         -# Some systems (esp. on ia64) link data and code symbols differently,
  3623         -# so use this general approach.
  3624         -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
  3625         -
  3626         -# Transform an extracted symbol line into symbol name and symbol address
  3627         -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
  3628         -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
  3629         -
  3630         -# Handle CRLF in mingw tool chain
  3631         -opt_cr=
  3632         -case $build_os in
  3633         -mingw*)
  3634         -  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
  3635         -  ;;
  3636         -esac
  3637         -
  3638         -# Try without a prefix underscore, then with it.
  3639         -for ac_symprfx in "" "_"; do
  3640         -
  3641         -  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
  3642         -  symxfrm="\\1 $ac_symprfx\\2 \\2"
  3643         -
  3644         -  # Write the raw and C identifiers.
  3645         -  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
  3646         -    # Fake it for dumpbin and say T for any non-static function
  3647         -    # and D for any global variable.
  3648         -    # Also find C++ and __fastcall symbols from MSVC++,
  3649         -    # which start with @ or ?.
  3650         -    lt_cv_sys_global_symbol_pipe="$AWK ['"\
  3651         -"     {last_section=section; section=\$ 3};"\
  3652         -"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
  3653         -"     \$ 0!~/External *\|/{next};"\
  3654         -"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
  3655         -"     {if(hide[section]) next};"\
  3656         -"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
  3657         -"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
  3658         -"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
  3659         -"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
  3660         -"     ' prfx=^$ac_symprfx]"
  3661         -  else
  3662         -    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
  3663         -  fi
  3664         -  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
  3665         -
  3666         -  # Check to see that the pipe works correctly.
  3667         -  pipe_works=no
  3668         -
  3669         -  rm -f conftest*
  3670         -  cat > conftest.$ac_ext <<_LT_EOF
  3671         -#ifdef __cplusplus
  3672         -extern "C" {
  3673         -#endif
  3674         -char nm_test_var;
  3675         -void nm_test_func(void);
  3676         -void nm_test_func(void){}
  3677         -#ifdef __cplusplus
  3678         -}
  3679         -#endif
  3680         -int main(){nm_test_var='a';nm_test_func();return(0);}
  3681         -_LT_EOF
  3682         -
  3683         -  if AC_TRY_EVAL(ac_compile); then
  3684         -    # Now try to grab the symbols.
  3685         -    nlist=conftest.nm
  3686         -    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
  3687         -      # Try sorting and uniquifying the output.
  3688         -      if sort "$nlist" | uniq > "$nlist"T; then
  3689         -	mv -f "$nlist"T "$nlist"
  3690         -      else
  3691         -	rm -f "$nlist"T
  3692         -      fi
  3693         -
  3694         -      # Make sure that we snagged all the symbols we need.
  3695         -      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
  3696         -	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
  3697         -	  cat <<_LT_EOF > conftest.$ac_ext
  3698         -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
  3699         -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
  3700         -/* DATA imports from DLLs on WIN32 con't be const, because runtime
  3701         -   relocations are performed -- see ld's documentation on pseudo-relocs.  */
  3702         -# define LT@&t@_DLSYM_CONST
  3703         -#elif defined(__osf__)
  3704         -/* This system does not cope well with relocations in const data.  */
  3705         -# define LT@&t@_DLSYM_CONST
  3706         -#else
  3707         -# define LT@&t@_DLSYM_CONST const
  3708         -#endif
  3709         -
  3710         -#ifdef __cplusplus
  3711         -extern "C" {
  3712         -#endif
  3713         -
  3714         -_LT_EOF
  3715         -	  # Now generate the symbol file.
  3716         -	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
  3717         -
  3718         -	  cat <<_LT_EOF >> conftest.$ac_ext
  3719         -
  3720         -/* The mapping between symbol names and symbols.  */
  3721         -LT@&t@_DLSYM_CONST struct {
  3722         -  const char *name;
  3723         -  void       *address;
  3724         -}
  3725         -lt__PROGRAM__LTX_preloaded_symbols[[]] =
  3726         -{
  3727         -  { "@PROGRAM@", (void *) 0 },
  3728         -_LT_EOF
  3729         -	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
  3730         -	  cat <<\_LT_EOF >> conftest.$ac_ext
  3731         -  {0, (void *) 0}
  3732         -};
  3733         -
  3734         -/* This works around a problem in FreeBSD linker */
  3735         -#ifdef FREEBSD_WORKAROUND
  3736         -static const void *lt_preloaded_setup() {
  3737         -  return lt__PROGRAM__LTX_preloaded_symbols;
  3738         -}
  3739         -#endif
  3740         -
  3741         -#ifdef __cplusplus
  3742         -}
  3743         -#endif
  3744         -_LT_EOF
  3745         -	  # Now try linking the two files.
  3746         -	  mv conftest.$ac_objext conftstm.$ac_objext
  3747         -	  lt_globsym_save_LIBS=$LIBS
  3748         -	  lt_globsym_save_CFLAGS=$CFLAGS
  3749         -	  LIBS="conftstm.$ac_objext"
  3750         -	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
  3751         -	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
  3752         -	    pipe_works=yes
  3753         -	  fi
  3754         -	  LIBS=$lt_globsym_save_LIBS
  3755         -	  CFLAGS=$lt_globsym_save_CFLAGS
  3756         -	else
  3757         -	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
  3758         -	fi
  3759         -      else
  3760         -	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
  3761         -      fi
  3762         -    else
  3763         -      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
  3764         -    fi
  3765         -  else
  3766         -    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
  3767         -    cat conftest.$ac_ext >&5
  3768         -  fi
  3769         -  rm -rf conftest* conftst*
  3770         -
  3771         -  # Do not use the global_symbol_pipe unless it works.
  3772         -  if test "$pipe_works" = yes; then
  3773         -    break
  3774         -  else
  3775         -    lt_cv_sys_global_symbol_pipe=
  3776         -  fi
  3777         -done
  3778         -])
  3779         -if test -z "$lt_cv_sys_global_symbol_pipe"; then
  3780         -  lt_cv_sys_global_symbol_to_cdecl=
  3781         -fi
  3782         -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
  3783         -  AC_MSG_RESULT(failed)
  3784         -else
  3785         -  AC_MSG_RESULT(ok)
  3786         -fi
  3787         -
  3788         -# Response file support.
  3789         -if test "$lt_cv_nm_interface" = "MS dumpbin"; then
  3790         -  nm_file_list_spec='@'
  3791         -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
  3792         -  nm_file_list_spec='@'
  3793         -fi
  3794         -
  3795         -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
  3796         -    [Take the output of nm and produce a listing of raw symbols and C names])
  3797         -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
  3798         -    [Transform the output of nm in a proper C declaration])
  3799         -_LT_DECL([global_symbol_to_c_name_address],
  3800         -    [lt_cv_sys_global_symbol_to_c_name_address], [1],
  3801         -    [Transform the output of nm in a C name address pair])
  3802         -_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
  3803         -    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
  3804         -    [Transform the output of nm in a C name address pair when lib prefix is needed])
  3805         -_LT_DECL([], [nm_file_list_spec], [1],
  3806         -    [Specify filename containing input files for $NM])
  3807         -]) # _LT_CMD_GLOBAL_SYMBOLS
  3808         -
  3809         -
  3810         -# _LT_COMPILER_PIC([TAGNAME])
  3811         -# ---------------------------
  3812         -m4_defun([_LT_COMPILER_PIC],
  3813         -[m4_require([_LT_TAG_COMPILER])dnl
  3814         -_LT_TAGVAR(lt_prog_compiler_wl, $1)=
  3815         -_LT_TAGVAR(lt_prog_compiler_pic, $1)=
  3816         -_LT_TAGVAR(lt_prog_compiler_static, $1)=
  3817         -
  3818         -m4_if([$1], [CXX], [
  3819         -  # C++ specific cases for pic, static, wl, etc.
  3820         -  if test "$GXX" = yes; then
  3821         -    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3822         -    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  3823         -
  3824         -    case $host_os in
  3825         -    aix*)
  3826         -      # All AIX code is PIC.
  3827         -      if test "$host_cpu" = ia64; then
  3828         -	# AIX 5 now supports IA64 processor
  3829         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3830         -      fi
  3831         -      ;;
  3832         -
  3833         -    amigaos*)
  3834         -      case $host_cpu in
  3835         -      powerpc)
  3836         -            # see comment about AmigaOS4 .so support
  3837         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3838         -        ;;
  3839         -      m68k)
  3840         -            # FIXME: we need at least 68020 code to build shared libraries, but
  3841         -            # adding the `-m68020' flag to GCC prevents building anything better,
  3842         -            # like `-m68040'.
  3843         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  3844         -        ;;
  3845         -      esac
  3846         -      ;;
  3847         -
  3848         -    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
  3849         -      # PIC is the default for these OSes.
  3850         -      ;;
  3851         -    mingw* | cygwin* | os2* | pw32* | cegcc*)
  3852         -      # This hack is so that the source file can tell whether it is being
  3853         -      # built for inclusion in a dll (and should export symbols for example).
  3854         -      # Although the cygwin gcc ignores -fPIC, still need this for old-style
  3855         -      # (--disable-auto-import) libraries
  3856         -      m4_if([$1], [GCJ], [],
  3857         -	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
  3858         -      ;;
  3859         -    darwin* | rhapsody*)
  3860         -      # PIC is the default on this platform
  3861         -      # Common symbols not allowed in MH_DYLIB files
  3862         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
  3863         -      ;;
  3864         -    *djgpp*)
  3865         -      # DJGPP does not support shared libraries at all
  3866         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
  3867         -      ;;
  3868         -    haiku*)
  3869         -      # PIC is the default for Haiku.
  3870         -      # The "-static" flag exists, but is broken.
  3871         -      _LT_TAGVAR(lt_prog_compiler_static, $1)=
  3872         -      ;;
  3873         -    interix[[3-9]]*)
  3874         -      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
  3875         -      # Instead, we relocate shared libraries at runtime.
  3876         -      ;;
  3877         -    sysv4*MP*)
  3878         -      if test -d /usr/nec; then
  3879         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
  3880         -      fi
  3881         -      ;;
  3882         -    hpux*)
  3883         -      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
  3884         -      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
  3885         -      # sets the default TLS model and affects inlining.
  3886         -      case $host_cpu in
  3887         -      hppa*64*)
  3888         -	;;
  3889         -      *)
  3890         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3891         -	;;
  3892         -      esac
  3893         -      ;;
  3894         -    *qnx* | *nto*)
  3895         -      # QNX uses GNU C++, but need to define -shared option too, otherwise
  3896         -      # it will coredump.
  3897         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  3898         -      ;;
  3899         -    *)
  3900         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3901         -      ;;
  3902         -    esac
  3903         -  else
  3904         -    case $host_os in
  3905         -      aix[[4-9]]*)
  3906         -	# All AIX code is PIC.
  3907         -	if test "$host_cpu" = ia64; then
  3908         -	  # AIX 5 now supports IA64 processor
  3909         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3910         -	else
  3911         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
  3912         -	fi
  3913         -	;;
  3914         -      chorus*)
  3915         -	case $cc_basename in
  3916         -	cxch68*)
  3917         -	  # Green Hills C++ Compiler
  3918         -	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
  3919         -	  ;;
  3920         -	esac
  3921         -	;;
  3922         -      mingw* | cygwin* | os2* | pw32* | cegcc*)
  3923         -	# This hack is so that the source file can tell whether it is being
  3924         -	# built for inclusion in a dll (and should export symbols for example).
  3925         -	m4_if([$1], [GCJ], [],
  3926         -	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
  3927         -	;;
  3928         -      dgux*)
  3929         -	case $cc_basename in
  3930         -	  ec++*)
  3931         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3932         -	    ;;
  3933         -	  ghcx*)
  3934         -	    # Green Hills C++ Compiler
  3935         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  3936         -	    ;;
  3937         -	  *)
  3938         -	    ;;
  3939         -	esac
  3940         -	;;
  3941         -      freebsd* | dragonfly*)
  3942         -	# FreeBSD uses GNU C++
  3943         -	;;
  3944         -      hpux9* | hpux10* | hpux11*)
  3945         -	case $cc_basename in
  3946         -	  CC*)
  3947         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3948         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  3949         -	    if test "$host_cpu" != ia64; then
  3950         -	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  3951         -	    fi
  3952         -	    ;;
  3953         -	  aCC*)
  3954         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3955         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  3956         -	    case $host_cpu in
  3957         -	    hppa*64*|ia64*)
  3958         -	      # +Z the default
  3959         -	      ;;
  3960         -	    *)
  3961         -	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  3962         -	      ;;
  3963         -	    esac
  3964         -	    ;;
  3965         -	  *)
  3966         -	    ;;
  3967         -	esac
  3968         -	;;
  3969         -      interix*)
  3970         -	# This is c89, which is MS Visual C++ (no shared libs)
  3971         -	# Anyone wants to do a port?
  3972         -	;;
  3973         -      irix5* | irix6* | nonstopux*)
  3974         -	case $cc_basename in
  3975         -	  CC*)
  3976         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3977         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  3978         -	    # CC pic flag -KPIC is the default.
  3979         -	    ;;
  3980         -	  *)
  3981         -	    ;;
  3982         -	esac
  3983         -	;;
  3984         -      linux* | k*bsd*-gnu | kopensolaris*-gnu)
  3985         -	case $cc_basename in
  3986         -	  KCC*)
  3987         -	    # KAI C++ Compiler
  3988         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
  3989         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3990         -	    ;;
  3991         -	  ecpc* )
  3992         -	    # old Intel C++ for x86_64 which still supported -KPIC.
  3993         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3994         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3995         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  3996         -	    ;;
  3997         -	  icpc* )
  3998         -	    # Intel C++, used to be incompatible with GCC.
  3999         -	    # ICC 10 doesn't accept -KPIC any more.
  4000         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4001         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  4002         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  4003         -	    ;;
  4004         -	  pgCC* | pgcpp*)
  4005         -	    # Portland Group C++ compiler
  4006         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4007         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
  4008         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4009         -	    ;;
  4010         -	  cxx*)
  4011         -	    # Compaq C++
  4012         -	    # Make sure the PIC flag is empty.  It appears that all Alpha
  4013         -	    # Linux and Compaq Tru64 Unix objects are PIC.
  4014         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
  4015         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4016         -	    ;;
  4017         -	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
  4018         -	    # IBM XL 8.0, 9.0 on PPC and BlueGene
  4019         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4020         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
  4021         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
  4022         -	    ;;
  4023         -	  *)
  4024         -	    case `$CC -V 2>&1 | sed 5q` in
  4025         -	    *Sun\ C*)
  4026         -	      # Sun C++ 5.9
  4027         -	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4028         -	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4029         -	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  4030         -	      ;;
  4031         -	    esac
  4032         -	    ;;
  4033         -	esac
  4034         -	;;
  4035         -      lynxos*)
  4036         -	;;
  4037         -      m88k*)
  4038         -	;;
  4039         -      mvs*)
  4040         -	case $cc_basename in
  4041         -	  cxx*)
  4042         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
  4043         -	    ;;
  4044         -	  *)
  4045         -	    ;;
  4046         -	esac
  4047         -	;;
  4048         -      netbsd*)
  4049         -	;;
  4050         -      *qnx* | *nto*)
  4051         -        # QNX uses GNU C++, but need to define -shared option too, otherwise
  4052         -        # it will coredump.
  4053         -        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  4054         -        ;;
  4055         -      osf3* | osf4* | osf5*)
  4056         -	case $cc_basename in
  4057         -	  KCC*)
  4058         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
  4059         -	    ;;
  4060         -	  RCC*)
  4061         -	    # Rational C++ 2.4.1
  4062         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  4063         -	    ;;
  4064         -	  cxx*)
  4065         -	    # Digital/Compaq C++
  4066         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4067         -	    # Make sure the PIC flag is empty.  It appears that all Alpha
  4068         -	    # Linux and Compaq Tru64 Unix objects are PIC.
  4069         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
  4070         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4071         -	    ;;
  4072         -	  *)
  4073         -	    ;;
  4074         -	esac
  4075         -	;;
  4076         -      psos*)
  4077         -	;;
  4078         -      solaris*)
  4079         -	case $cc_basename in
  4080         -	  CC* | sunCC*)
  4081         -	    # Sun C++ 4.2, 5.x and Centerline C++
  4082         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4083         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4084         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  4085         -	    ;;
  4086         -	  gcx*)
  4087         -	    # Green Hills C++ Compiler
  4088         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
  4089         -	    ;;
  4090         -	  *)
  4091         -	    ;;
  4092         -	esac
  4093         -	;;
  4094         -      sunos4*)
  4095         -	case $cc_basename in
  4096         -	  CC*)
  4097         -	    # Sun C++ 4.x
  4098         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  4099         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4100         -	    ;;
  4101         -	  lcc*)
  4102         -	    # Lucid
  4103         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  4104         -	    ;;
  4105         -	  *)
  4106         -	    ;;
  4107         -	esac
  4108         -	;;
  4109         -      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
  4110         -	case $cc_basename in
  4111         -	  CC*)
  4112         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4113         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4114         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4115         -	    ;;
  4116         -	esac
  4117         -	;;
  4118         -      tandem*)
  4119         -	case $cc_basename in
  4120         -	  NCC*)
  4121         -	    # NonStop-UX NCC 3.20
  4122         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4123         -	    ;;
  4124         -	  *)
  4125         -	    ;;
  4126         -	esac
  4127         -	;;
  4128         -      vxworks*)
  4129         -	;;
  4130         -      *)
  4131         -	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  4132         -	;;
  4133         -    esac
  4134         -  fi
  4135         -],
  4136         -[
  4137         -  if test "$GCC" = yes; then
  4138         -    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4139         -    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  4140         -
  4141         -    case $host_os in
  4142         -      aix*)
  4143         -      # All AIX code is PIC.
  4144         -      if test "$host_cpu" = ia64; then
  4145         -	# AIX 5 now supports IA64 processor
  4146         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4147         -      fi
  4148         -      ;;
  4149         -
  4150         -    amigaos*)
  4151         -      case $host_cpu in
  4152         -      powerpc)
  4153         -            # see comment about AmigaOS4 .so support
  4154         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  4155         -        ;;
  4156         -      m68k)
  4157         -            # FIXME: we need at least 68020 code to build shared libraries, but
  4158         -            # adding the `-m68020' flag to GCC prevents building anything better,
  4159         -            # like `-m68040'.
  4160         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  4161         -        ;;
  4162         -      esac
  4163         -      ;;
  4164         -
  4165         -    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
  4166         -      # PIC is the default for these OSes.
  4167         -      ;;
  4168         -
  4169         -    mingw* | cygwin* | pw32* | os2* | cegcc*)
  4170         -      # This hack is so that the source file can tell whether it is being
  4171         -      # built for inclusion in a dll (and should export symbols for example).
  4172         -      # Although the cygwin gcc ignores -fPIC, still need this for old-style
  4173         -      # (--disable-auto-import) libraries
  4174         -      m4_if([$1], [GCJ], [],
  4175         -	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
  4176         -      ;;
  4177         -
  4178         -    darwin* | rhapsody*)
  4179         -      # PIC is the default on this platform
  4180         -      # Common symbols not allowed in MH_DYLIB files
  4181         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
  4182         -      ;;
  4183         -
  4184         -    haiku*)
  4185         -      # PIC is the default for Haiku.
  4186         -      # The "-static" flag exists, but is broken.
  4187         -      _LT_TAGVAR(lt_prog_compiler_static, $1)=
  4188         -      ;;
  4189         -
  4190         -    hpux*)
  4191         -      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
  4192         -      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
  4193         -      # sets the default TLS model and affects inlining.
  4194         -      case $host_cpu in
  4195         -      hppa*64*)
  4196         -	# +Z the default
  4197         -	;;
  4198         -      *)
  4199         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  4200         -	;;
  4201         -      esac
  4202         -      ;;
  4203         -
  4204         -    interix[[3-9]]*)
  4205         -      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
  4206         -      # Instead, we relocate shared libraries at runtime.
  4207         -      ;;
  4208         -
  4209         -    msdosdjgpp*)
  4210         -      # Just because we use GCC doesn't mean we suddenly get shared libraries
  4211         -      # on systems that don't support them.
  4212         -      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  4213         -      enable_shared=no
  4214         -      ;;
  4215         -
  4216         -    *nto* | *qnx*)
  4217         -      # QNX uses GNU C++, but need to define -shared option too, otherwise
  4218         -      # it will coredump.
  4219         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  4220         -      ;;
  4221         -
  4222         -    sysv4*MP*)
  4223         -      if test -d /usr/nec; then
  4224         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
  4225         -      fi
  4226         -      ;;
  4227         -
  4228         -    *)
  4229         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  4230         -      ;;
  4231         -    esac
  4232         -
  4233         -    case $cc_basename in
  4234         -    nvcc*) # Cuda Compiler Driver 2.2
  4235         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
  4236         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
  4237         -      ;;
  4238         -    esac
  4239         -  else
  4240         -    # PORTME Check for flag to pass linker flags through the system compiler.
  4241         -    case $host_os in
  4242         -    aix*)
  4243         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4244         -      if test "$host_cpu" = ia64; then
  4245         -	# AIX 5 now supports IA64 processor
  4246         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4247         -      else
  4248         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
  4249         -      fi
  4250         -      ;;
  4251         -
  4252         -    mingw* | cygwin* | pw32* | os2* | cegcc*)
  4253         -      # This hack is so that the source file can tell whether it is being
  4254         -      # built for inclusion in a dll (and should export symbols for example).
  4255         -      m4_if([$1], [GCJ], [],
  4256         -	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
  4257         -      ;;
  4258         -
  4259         -    hpux9* | hpux10* | hpux11*)
  4260         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4261         -      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
  4262         -      # not for PA HP-UX.
  4263         -      case $host_cpu in
  4264         -      hppa*64*|ia64*)
  4265         -	# +Z the default
  4266         -	;;
  4267         -      *)
  4268         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  4269         -	;;
  4270         -      esac
  4271         -      # Is there a better lt_prog_compiler_static that works with the bundled CC?
  4272         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  4273         -      ;;
  4274         -
  4275         -    irix5* | irix6* | nonstopux*)
  4276         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4277         -      # PIC (with -KPIC) is the default.
  4278         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4279         -      ;;
  4280         -
  4281         -    linux* | k*bsd*-gnu | kopensolaris*-gnu)
  4282         -      case $cc_basename in
  4283         -      # old Intel for x86_64 which still supported -KPIC.
  4284         -      ecc*)
  4285         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4286         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4287         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  4288         -        ;;
  4289         -      # icc used to be incompatible with GCC.
  4290         -      # ICC 10 doesn't accept -KPIC any more.
  4291         -      icc* | ifort*)
  4292         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4293         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  4294         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  4295         -        ;;
  4296         -      # Lahey Fortran 8.1.
  4297         -      lf95*)
  4298         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4299         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
  4300         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
  4301         -	;;
  4302         -      nagfor*)
  4303         -	# NAG Fortran compiler
  4304         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
  4305         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
  4306         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4307         -	;;
  4308         -      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
  4309         -        # Portland Group compilers (*not* the Pentium gcc compiler,
  4310         -	# which looks to be a dead project)
  4311         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4312         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
  4313         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4314         -        ;;
  4315         -      ccc*)
  4316         -        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4317         -        # All Alpha code is PIC.
  4318         -        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4319         -        ;;
  4320         -      xl* | bgxl* | bgf* | mpixl*)
  4321         -	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
  4322         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4323         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
  4324         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
  4325         -	;;
  4326         -      *)
  4327         -	case `$CC -V 2>&1 | sed 5q` in
  4328         -	*Sun\ F* | *Sun*Fortran*)
  4329         -	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
  4330         -	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4331         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4332         -	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
  4333         -	  ;;
  4334         -	*Sun\ C*)
  4335         -	  # Sun C 5.9
  4336         -	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4337         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4338         -	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4339         -	  ;;
  4340         -	esac
  4341         -	;;
  4342         -      esac
  4343         -      ;;
  4344         -
  4345         -    newsos6)
  4346         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4347         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4348         -      ;;
  4349         -
  4350         -    *nto* | *qnx*)
  4351         -      # QNX uses GNU C++, but need to define -shared option too, otherwise
  4352         -      # it will coredump.
  4353         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  4354         -      ;;
  4355         -
  4356         -    osf3* | osf4* | osf5*)
  4357         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4358         -      # All OSF/1 code is PIC.
  4359         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4360         -      ;;
  4361         -
  4362         -    rdos*)
  4363         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4364         -      ;;
  4365         -
  4366         -    solaris*)
  4367         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4368         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4369         -      case $cc_basename in
  4370         -      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
  4371         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
  4372         -      *)
  4373         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
  4374         -      esac
  4375         -      ;;
  4376         -
  4377         -    sunos4*)
  4378         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  4379         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
  4380         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4381         -      ;;
  4382         -
  4383         -    sysv4 | sysv4.2uw2* | sysv4.3*)
  4384         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4385         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4386         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4387         -      ;;
  4388         -
  4389         -    sysv4*MP*)
  4390         -      if test -d /usr/nec ;then
  4391         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
  4392         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4393         -      fi
  4394         -      ;;
  4395         -
  4396         -    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
  4397         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4398         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4399         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4400         -      ;;
  4401         -
  4402         -    unicos*)
  4403         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4404         -      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  4405         -      ;;
  4406         -
  4407         -    uts4*)
  4408         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  4409         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4410         -      ;;
  4411         -
  4412         -    *)
  4413         -      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  4414         -      ;;
  4415         -    esac
  4416         -  fi
  4417         -])
  4418         -case $host_os in
  4419         -  # For platforms which do not support PIC, -DPIC is meaningless:
  4420         -  *djgpp*)
  4421         -    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
  4422         -    ;;
  4423         -  *)
  4424         -    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
  4425         -    ;;
  4426         -esac
  4427         -
  4428         -AC_CACHE_CHECK([for $compiler option to produce PIC],
  4429         -  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
  4430         -  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
  4431         -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
  4432         -
  4433         -#
  4434         -# Check to make sure the PIC flag actually works.
  4435         -#
  4436         -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
  4437         -  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
  4438         -    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
  4439         -    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
  4440         -    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
  4441         -     "" | " "*) ;;
  4442         -     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
  4443         -     esac],
  4444         -    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
  4445         -     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
  4446         -fi
  4447         -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
  4448         -	[Additional compiler flags for building library objects])
  4449         -
  4450         -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
  4451         -	[How to pass a linker flag through the compiler])
  4452         -#
  4453         -# Check to make sure the static flag actually works.
  4454         -#
  4455         -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
  4456         -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
  4457         -  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
  4458         -  $lt_tmp_static_flag,
  4459         -  [],
  4460         -  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
  4461         -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
  4462         -	[Compiler flag to prevent dynamic linking])
  4463         -])# _LT_COMPILER_PIC
  4464         -
  4465         -
  4466         -# _LT_LINKER_SHLIBS([TAGNAME])
  4467         -# ----------------------------
  4468         -# See if the linker supports building shared libraries.
  4469         -m4_defun([_LT_LINKER_SHLIBS],
  4470         -[AC_REQUIRE([LT_PATH_LD])dnl
  4471         -AC_REQUIRE([LT_PATH_NM])dnl
  4472         -m4_require([_LT_PATH_MANIFEST_TOOL])dnl
  4473         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  4474         -m4_require([_LT_DECL_EGREP])dnl
  4475         -m4_require([_LT_DECL_SED])dnl
  4476         -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
  4477         -m4_require([_LT_TAG_COMPILER])dnl
  4478         -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  4479         -m4_if([$1], [CXX], [
  4480         -  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4481         -  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
  4482         -  case $host_os in
  4483         -  aix[[4-9]]*)
  4484         -    # If we're using GNU nm, then we don't want the "-C" option.
  4485         -    # -C means demangle to AIX nm, but means don't demangle with GNU nm
  4486         -    # Also, AIX nm treats weak defined symbols like other global defined
  4487         -    # symbols, whereas GNU nm marks them as "W".
  4488         -    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
  4489         -      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
  4490         -    else
  4491         -      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
  4492         -    fi
  4493         -    ;;
  4494         -  pw32*)
  4495         -    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
  4496         -    ;;
  4497         -  cygwin* | mingw* | cegcc*)
  4498         -    case $cc_basename in
  4499         -    cl*) ;;
  4500         -    *)
  4501         -      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
  4502         -      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
  4503         -      ;;
  4504         -    esac
  4505         -    ;;
  4506         -  *)
  4507         -    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4508         -    ;;
  4509         -  esac
  4510         -], [
  4511         -  runpath_var=
  4512         -  _LT_TAGVAR(allow_undefined_flag, $1)=
  4513         -  _LT_TAGVAR(always_export_symbols, $1)=no
  4514         -  _LT_TAGVAR(archive_cmds, $1)=
  4515         -  _LT_TAGVAR(archive_expsym_cmds, $1)=
  4516         -  _LT_TAGVAR(compiler_needs_object, $1)=no
  4517         -  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  4518         -  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
  4519         -  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4520         -  _LT_TAGVAR(hardcode_automatic, $1)=no
  4521         -  _LT_TAGVAR(hardcode_direct, $1)=no
  4522         -  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
  4523         -  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  4524         -  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  4525         -  _LT_TAGVAR(hardcode_libdir_separator, $1)=
  4526         -  _LT_TAGVAR(hardcode_minus_L, $1)=no
  4527         -  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  4528         -  _LT_TAGVAR(inherit_rpath, $1)=no
  4529         -  _LT_TAGVAR(link_all_deplibs, $1)=unknown
  4530         -  _LT_TAGVAR(module_cmds, $1)=
  4531         -  _LT_TAGVAR(module_expsym_cmds, $1)=
  4532         -  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
  4533         -  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
  4534         -  _LT_TAGVAR(thread_safe_flag_spec, $1)=
  4535         -  _LT_TAGVAR(whole_archive_flag_spec, $1)=
  4536         -  # include_expsyms should be a list of space-separated symbols to be *always*
  4537         -  # included in the symbol list
  4538         -  _LT_TAGVAR(include_expsyms, $1)=
  4539         -  # exclude_expsyms can be an extended regexp of symbols to exclude
  4540         -  # it will be wrapped by ` (' and `)$', so one must not match beginning or
  4541         -  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  4542         -  # as well as any symbol that contains `d'.
  4543         -  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
  4544         -  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  4545         -  # platforms (ab)use it in PIC code, but their linkers get confused if
  4546         -  # the symbol is explicitly referenced.  Since portable code cannot
  4547         -  # rely on this symbol name, it's probably fine to never include it in
  4548         -  # preloaded symbol tables.
  4549         -  # Exclude shared library initialization/finalization symbols.
  4550         -dnl Note also adjust exclude_expsyms for C++ above.
  4551         -  extract_expsyms_cmds=
  4552         -
  4553         -  case $host_os in
  4554         -  cygwin* | mingw* | pw32* | cegcc*)
  4555         -    # FIXME: the MSVC++ port hasn't been tested in a loooong time
  4556         -    # When not using gcc, we currently assume that we are using
  4557         -    # Microsoft Visual C++.
  4558         -    if test "$GCC" != yes; then
  4559         -      with_gnu_ld=no
  4560         -    fi
  4561         -    ;;
  4562         -  interix*)
  4563         -    # we just hope/assume this is gcc and not c89 (= MSVC++)
  4564         -    with_gnu_ld=yes
  4565         -    ;;
  4566         -  openbsd*)
  4567         -    with_gnu_ld=no
  4568         -    ;;
  4569         -  esac
  4570         -
  4571         -  _LT_TAGVAR(ld_shlibs, $1)=yes
  4572         -
  4573         -  # On some targets, GNU ld is compatible enough with the native linker
  4574         -  # that we're better off using the native interface for both.
  4575         -  lt_use_gnu_ld_interface=no
  4576         -  if test "$with_gnu_ld" = yes; then
  4577         -    case $host_os in
  4578         -      aix*)
  4579         -	# The AIX port of GNU ld has always aspired to compatibility
  4580         -	# with the native linker.  However, as the warning in the GNU ld
  4581         -	# block says, versions before 2.19.5* couldn't really create working
  4582         -	# shared libraries, regardless of the interface used.
  4583         -	case `$LD -v 2>&1` in
  4584         -	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
  4585         -	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
  4586         -	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
  4587         -	  *)
  4588         -	    lt_use_gnu_ld_interface=yes
  4589         -	    ;;
  4590         -	esac
  4591         -	;;
  4592         -      *)
  4593         -	lt_use_gnu_ld_interface=yes
  4594         -	;;
  4595         -    esac
  4596         -  fi
  4597         -
  4598         -  if test "$lt_use_gnu_ld_interface" = yes; then
  4599         -    # If archive_cmds runs LD, not CC, wlarc should be empty
  4600         -    wlarc='${wl}'
  4601         -
  4602         -    # Set some defaults for GNU ld with shared library support. These
  4603         -    # are reset later if shared libraries are not supported. Putting them
  4604         -    # here allows them to be overridden if necessary.
  4605         -    runpath_var=LD_RUN_PATH
  4606         -    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4607         -    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  4608         -    # ancient GNU ld didn't support --whole-archive et. al.
  4609         -    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
  4610         -      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  4611         -    else
  4612         -      _LT_TAGVAR(whole_archive_flag_spec, $1)=
  4613         -    fi
  4614         -    supports_anon_versioning=no
  4615         -    case `$LD -v 2>&1` in
  4616         -      *GNU\ gold*) supports_anon_versioning=yes ;;
  4617         -      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
  4618         -      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
  4619         -      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
  4620         -      *\ 2.11.*) ;; # other 2.11 versions
  4621         -      *) supports_anon_versioning=yes ;;
  4622         -    esac
  4623         -
  4624         -    # See if GNU ld supports shared libraries.
  4625         -    case $host_os in
  4626         -    aix[[3-9]]*)
  4627         -      # On AIX/PPC, the GNU linker is very broken
  4628         -      if test "$host_cpu" != ia64; then
  4629         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4630         -	cat <<_LT_EOF 1>&2
  4631         -
  4632         -*** Warning: the GNU linker, at least up to release 2.19, is reported
  4633         -*** to be unable to reliably create shared libraries on AIX.
  4634         -*** Therefore, libtool is disabling shared libraries support.  If you
  4635         -*** really care for shared libraries, you may want to install binutils
  4636         -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
  4637         -*** You will then need to restart the configuration process.
  4638         -
  4639         -_LT_EOF
  4640         -      fi
  4641         -      ;;
  4642         -
  4643         -    amigaos*)
  4644         -      case $host_cpu in
  4645         -      powerpc)
  4646         -            # see comment about AmigaOS4 .so support
  4647         -            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4648         -            _LT_TAGVAR(archive_expsym_cmds, $1)=''
  4649         -        ;;
  4650         -      m68k)
  4651         -            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  4652         -            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4653         -            _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4654         -        ;;
  4655         -      esac
  4656         -      ;;
  4657         -
  4658         -    beos*)
  4659         -      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4660         -	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  4661         -	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  4662         -	# support --undefined.  This deserves some investigation.  FIXME
  4663         -	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4664         -      else
  4665         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4666         -      fi
  4667         -      ;;
  4668         -
  4669         -    cygwin* | mingw* | pw32* | cegcc*)
  4670         -      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
  4671         -      # as there is no search path for DLLs.
  4672         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4673         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
  4674         -      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  4675         -      _LT_TAGVAR(always_export_symbols, $1)=no
  4676         -      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  4677         -      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
  4678         -      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
  4679         -
  4680         -      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
  4681         -        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  4682         -	# If the export-symbols file already is a .def file (1st line
  4683         -	# is EXPORTS), use it as is; otherwise, prepend...
  4684         -	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  4685         -	  cp $export_symbols $output_objdir/$soname.def;
  4686         -	else
  4687         -	  echo EXPORTS > $output_objdir/$soname.def;
  4688         -	  cat $export_symbols >> $output_objdir/$soname.def;
  4689         -	fi~
  4690         -	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  4691         -      else
  4692         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4693         -      fi
  4694         -      ;;
  4695         -
  4696         -    haiku*)
  4697         -      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4698         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
  4699         -      ;;
  4700         -
  4701         -    interix[[3-9]]*)
  4702         -      _LT_TAGVAR(hardcode_direct, $1)=no
  4703         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  4704         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  4705         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  4706         -      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
  4707         -      # Instead, shared libraries are loaded at an image base (0x10000000 by
  4708         -      # default) and relocated if they conflict, which is a slow very memory
  4709         -      # consuming and fragmenting process.  To avoid this, we pick a random,
  4710         -      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
  4711         -      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
  4712         -      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  4713         -      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  4714         -      ;;
  4715         -
  4716         -    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
  4717         -      tmp_diet=no
  4718         -      if test "$host_os" = linux-dietlibc; then
  4719         -	case $cc_basename in
  4720         -	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
  4721         -	esac
  4722         -      fi
  4723         -      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
  4724         -	 && test "$tmp_diet" = no
  4725         -      then
  4726         -	tmp_addflag=' $pic_flag'
  4727         -	tmp_sharedflag='-shared'
  4728         -	case $cc_basename,$host_cpu in
  4729         -        pgcc*)				# Portland Group C compiler
  4730         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
  4731         -	  tmp_addflag=' $pic_flag'
  4732         -	  ;;
  4733         -	pgf77* | pgf90* | pgf95* | pgfortran*)
  4734         -					# Portland Group f77 and f90 compilers
  4735         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
  4736         -	  tmp_addflag=' $pic_flag -Mnomain' ;;
  4737         -	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
  4738         -	  tmp_addflag=' -i_dynamic' ;;
  4739         -	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
  4740         -	  tmp_addflag=' -i_dynamic -nofor_main' ;;
  4741         -	ifc* | ifort*)			# Intel Fortran compiler
  4742         -	  tmp_addflag=' -nofor_main' ;;
  4743         -	lf95*)				# Lahey Fortran 8.1
  4744         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
  4745         -	  tmp_sharedflag='--shared' ;;
  4746         -	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
  4747         -	  tmp_sharedflag='-qmkshrobj'
  4748         -	  tmp_addflag= ;;
  4749         -	nvcc*)	# Cuda Compiler Driver 2.2
  4750         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
  4751         -	  _LT_TAGVAR(compiler_needs_object, $1)=yes
  4752         -	  ;;
  4753         -	esac
  4754         -	case `$CC -V 2>&1 | sed 5q` in
  4755         -	*Sun\ C*)			# Sun C 5.9
  4756         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
  4757         -	  _LT_TAGVAR(compiler_needs_object, $1)=yes
  4758         -	  tmp_sharedflag='-G' ;;
  4759         -	*Sun\ F*)			# Sun Fortran 8.3
  4760         -	  tmp_sharedflag='-G' ;;
  4761         -	esac
  4762         -	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4763         -
  4764         -        if test "x$supports_anon_versioning" = xyes; then
  4765         -          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
  4766         -	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
  4767         -	    echo "local: *; };" >> $output_objdir/$libname.ver~
  4768         -	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
  4769         -        fi
  4770         -
  4771         -	case $cc_basename in
  4772         -	xlf* | bgf* | bgxlf* | mpixlf*)
  4773         -	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
  4774         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
  4775         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  4776         -	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
  4777         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
  4778         -	  if test "x$supports_anon_versioning" = xyes; then
  4779         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
  4780         -	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
  4781         -	      echo "local: *; };" >> $output_objdir/$libname.ver~
  4782         -	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
  4783         -	  fi
  4784         -	  ;;
  4785         -	esac
  4786         -      else
  4787         -        _LT_TAGVAR(ld_shlibs, $1)=no
  4788         -      fi
  4789         -      ;;
  4790         -
  4791         -    netbsd*)
  4792         -      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
  4793         -	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
  4794         -	wlarc=
  4795         -      else
  4796         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4797         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4798         -      fi
  4799         -      ;;
  4800         -
  4801         -    solaris*)
  4802         -      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  4803         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4804         -	cat <<_LT_EOF 1>&2
  4805         -
  4806         -*** Warning: The releases 2.8.* of the GNU linker cannot reliably
  4807         -*** create shared libraries on Solaris systems.  Therefore, libtool
  4808         -*** is disabling shared libraries support.  We urge you to upgrade GNU
  4809         -*** binutils to release 2.9.1 or newer.  Another option is to modify
  4810         -*** your PATH or compiler configuration so that the native linker is
  4811         -*** used, and then restart.
  4812         -
  4813         -_LT_EOF
  4814         -      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4815         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4816         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4817         -      else
  4818         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4819         -      fi
  4820         -      ;;
  4821         -
  4822         -    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
  4823         -      case `$LD -v 2>&1` in
  4824         -        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
  4825         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4826         -	cat <<_LT_EOF 1>&2
  4827         -
  4828         -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
  4829         -*** reliably create shared libraries on SCO systems.  Therefore, libtool
  4830         -*** is disabling shared libraries support.  We urge you to upgrade GNU
  4831         -*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
  4832         -*** your PATH or compiler configuration so that the native linker is
  4833         -*** used, and then restart.
  4834         -
  4835         -_LT_EOF
  4836         -	;;
  4837         -	*)
  4838         -	  # For security reasons, it is highly recommended that you always
  4839         -	  # use absolute paths for naming shared libraries, and exclude the
  4840         -	  # DT_RUNPATH tag from executables and libraries.  But doing so
  4841         -	  # requires that you compile everything twice, which is a pain.
  4842         -	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4843         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4844         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4845         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4846         -	  else
  4847         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  4848         -	  fi
  4849         -	;;
  4850         -      esac
  4851         -      ;;
  4852         -
  4853         -    sunos4*)
  4854         -      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  4855         -      wlarc=
  4856         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4857         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  4858         -      ;;
  4859         -
  4860         -    *)
  4861         -      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4862         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4863         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4864         -      else
  4865         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4866         -      fi
  4867         -      ;;
  4868         -    esac
  4869         -
  4870         -    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
  4871         -      runpath_var=
  4872         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  4873         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
  4874         -      _LT_TAGVAR(whole_archive_flag_spec, $1)=
  4875         -    fi
  4876         -  else
  4877         -    # PORTME fill in a description of your system's linker (not GNU ld)
  4878         -    case $host_os in
  4879         -    aix3*)
  4880         -      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  4881         -      _LT_TAGVAR(always_export_symbols, $1)=yes
  4882         -      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
  4883         -      # Note: this linker hardcodes the directories in LIBPATH if there
  4884         -      # are no directories specified by -L.
  4885         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4886         -      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
  4887         -	# Neither direct hardcoding nor static linking is supported with a
  4888         -	# broken collect2.
  4889         -	_LT_TAGVAR(hardcode_direct, $1)=unsupported
  4890         -      fi
  4891         -      ;;
  4892         -
  4893         -    aix[[4-9]]*)
  4894         -      if test "$host_cpu" = ia64; then
  4895         -	# On IA64, the linker does run time linking by default, so we don't
  4896         -	# have to do anything special.
  4897         -	aix_use_runtimelinking=no
  4898         -	exp_sym_flag='-Bexport'
  4899         -	no_entry_flag=""
  4900         -      else
  4901         -	# If we're using GNU nm, then we don't want the "-C" option.
  4902         -	# -C means demangle to AIX nm, but means don't demangle with GNU nm
  4903         -	# Also, AIX nm treats weak defined symbols like other global
  4904         -	# defined symbols, whereas GNU nm marks them as "W".
  4905         -	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
  4906         -	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
  4907         -	else
  4908         -	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
  4909         -	fi
  4910         -	aix_use_runtimelinking=no
  4911         -
  4912         -	# Test if we are trying to use run time linking or normal
  4913         -	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
  4914         -	# need to do runtime linking.
  4915         -	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
  4916         -	  for ld_flag in $LDFLAGS; do
  4917         -	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
  4918         -	    aix_use_runtimelinking=yes
  4919         -	    break
  4920         -	  fi
  4921         -	  done
  4922         -	  ;;
  4923         -	esac
  4924         -
  4925         -	exp_sym_flag='-bexport'
  4926         -	no_entry_flag='-bnoentry'
  4927         -      fi
  4928         -
  4929         -      # When large executables or shared objects are built, AIX ld can
  4930         -      # have problems creating the table of contents.  If linking a library
  4931         -      # or program results in "error TOC overflow" add -mminimal-toc to
  4932         -      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
  4933         -      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  4934         -
  4935         -      _LT_TAGVAR(archive_cmds, $1)=''
  4936         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4937         -      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  4938         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  4939         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
  4940         -      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
  4941         -
  4942         -      if test "$GCC" = yes; then
  4943         -	case $host_os in aix4.[[012]]|aix4.[[012]].*)
  4944         -	# We only want to do this on AIX 4.2 and lower, the check
  4945         -	# below for broken collect2 doesn't work under 4.3+
  4946         -	  collect2name=`${CC} -print-prog-name=collect2`
  4947         -	  if test -f "$collect2name" &&
  4948         -	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
  4949         -	  then
  4950         -	  # We have reworked collect2
  4951         -	  :
  4952         -	  else
  4953         -	  # We have old collect2
  4954         -	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
  4955         -	  # It fails to find uninstalled libraries when the uninstalled
  4956         -	  # path is not listed in the libpath.  Setting hardcode_minus_L
  4957         -	  # to unsupported forces relinking
  4958         -	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4959         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4960         -	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
  4961         -	  fi
  4962         -	  ;;
  4963         -	esac
  4964         -	shared_flag='-shared'
  4965         -	if test "$aix_use_runtimelinking" = yes; then
  4966         -	  shared_flag="$shared_flag "'${wl}-G'
  4967         -	fi
  4968         -      else
  4969         -	# not using gcc
  4970         -	if test "$host_cpu" = ia64; then
  4971         -	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  4972         -	# chokes on -Wl,-G. The following line is correct:
  4973         -	  shared_flag='-G'
  4974         -	else
  4975         -	  if test "$aix_use_runtimelinking" = yes; then
  4976         -	    shared_flag='${wl}-G'
  4977         -	  else
  4978         -	    shared_flag='${wl}-bM:SRE'
  4979         -	  fi
  4980         -	fi
  4981         -      fi
  4982         -
  4983         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
  4984         -      # It seems that -bexpall does not export symbols beginning with
  4985         -      # underscore (_), so it is better to generate a list of symbols to export.
  4986         -      _LT_TAGVAR(always_export_symbols, $1)=yes
  4987         -      if test "$aix_use_runtimelinking" = yes; then
  4988         -	# Warning - without using the other runtime loading flags (-brtl),
  4989         -	# -berok will link without error, but may produce a broken library.
  4990         -	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
  4991         -        # Determine the default libpath from the value encoded in an
  4992         -        # empty executable.
  4993         -        _LT_SYS_MODULE_PATH_AIX([$1])
  4994         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  4995         -        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
  4996         -      else
  4997         -	if test "$host_cpu" = ia64; then
  4998         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  4999         -	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  5000         -	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
  5001         -	else
  5002         -	 # Determine the default libpath from the value encoded in an
  5003         -	 # empty executable.
  5004         -	 _LT_SYS_MODULE_PATH_AIX([$1])
  5005         -	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  5006         -	  # Warning - without using the other run time loading flags,
  5007         -	  # -berok will link without error, but may produce a broken library.
  5008         -	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  5009         -	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  5010         -	  if test "$with_gnu_ld" = yes; then
  5011         -	    # We only use this code for GNU lds that support --whole-archive.
  5012         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  5013         -	  else
  5014         -	    # Exported symbols can be pulled into shared objects from archives
  5015         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
  5016         -	  fi
  5017         -	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
  5018         -	  # This is similar to how AIX traditionally builds its shared libraries.
  5019         -	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  5020         -	fi
  5021         -      fi
  5022         -      ;;
  5023         -
  5024         -    amigaos*)
  5025         -      case $host_cpu in
  5026         -      powerpc)
  5027         -            # see comment about AmigaOS4 .so support
  5028         -            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5029         -            _LT_TAGVAR(archive_expsym_cmds, $1)=''
  5030         -        ;;
  5031         -      m68k)
  5032         -            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  5033         -            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5034         -            _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5035         -        ;;
  5036         -      esac
  5037         -      ;;
  5038         -
  5039         -    bsdi[[45]]*)
  5040         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
  5041         -      ;;
  5042         -
  5043         -    cygwin* | mingw* | pw32* | cegcc*)
  5044         -      # When not using gcc, we currently assume that we are using
  5045         -      # Microsoft Visual C++.
  5046         -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  5047         -      # no search path for DLLs.
  5048         -      case $cc_basename in
  5049         -      cl*)
  5050         -	# Native MSVC
  5051         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
  5052         -	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  5053         -	_LT_TAGVAR(always_export_symbols, $1)=yes
  5054         -	_LT_TAGVAR(file_list_spec, $1)='@'
  5055         -	# Tell ltmain to make .lib files, not .a files.
  5056         -	libext=lib
  5057         -	# Tell ltmain to make .dll files, not .so files.
  5058         -	shrext_cmds=".dll"
  5059         -	# FIXME: Setting linknames here is a bad hack.
  5060         -	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
  5061         -	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  5062         -	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
  5063         -	  else
  5064         -	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
  5065         -	  fi~
  5066         -	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
  5067         -	  linknames='
  5068         -	# The linker will not automatically build a static lib if we build a DLL.
  5069         -	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
  5070         -	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  5071         -	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
  5072         -	# Don't use ranlib
  5073         -	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
  5074         -	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
  5075         -	  lt_tool_outputfile="@TOOL_OUTPUT@"~
  5076         -	  case $lt_outputfile in
  5077         -	    *.exe|*.EXE) ;;
  5078         -	    *)
  5079         -	      lt_outputfile="$lt_outputfile.exe"
  5080         -	      lt_tool_outputfile="$lt_tool_outputfile.exe"
  5081         -	      ;;
  5082         -	  esac~
  5083         -	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
  5084         -	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
  5085         -	    $RM "$lt_outputfile.manifest";
  5086         -	  fi'
  5087         -	;;
  5088         -      *)
  5089         -	# Assume MSVC wrapper
  5090         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
  5091         -	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  5092         -	# Tell ltmain to make .lib files, not .a files.
  5093         -	libext=lib
  5094         -	# Tell ltmain to make .dll files, not .so files.
  5095         -	shrext_cmds=".dll"
  5096         -	# FIXME: Setting linknames here is a bad hack.
  5097         -	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
  5098         -	# The linker will automatically build a .lib file if we build a DLL.
  5099         -	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
  5100         -	# FIXME: Should let the user specify the lib program.
  5101         -	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
  5102         -	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  5103         -	;;
  5104         -      esac
  5105         -      ;;
  5106         -
  5107         -    darwin* | rhapsody*)
  5108         -      _LT_DARWIN_LINKER_FEATURES($1)
  5109         -      ;;
  5110         -
  5111         -    dgux*)
  5112         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5113         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5114         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5115         -      ;;
  5116         -
  5117         -    freebsd1*)
  5118         -      _LT_TAGVAR(ld_shlibs, $1)=no
  5119         -      ;;
  5120         -
  5121         -    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  5122         -    # support.  Future versions do this automatically, but an explicit c++rt0.o
  5123         -    # does not break anything, and helps significantly (at the cost of a little
  5124         -    # extra space).
  5125         -    freebsd2.2*)
  5126         -      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
  5127         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  5128         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5129         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5130         -      ;;
  5131         -
  5132         -    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  5133         -    freebsd2*)
  5134         -      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  5135         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5136         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5137         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5138         -      ;;
  5139         -
  5140         -    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  5141         -    freebsd* | dragonfly*)
  5142         -      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  5143         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  5144         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5145         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5146         -      ;;
  5147         -
  5148         -    hpux9*)
  5149         -      if test "$GCC" = yes; then
  5150         -	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  5151         -      else
  5152         -	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  5153         -      fi
  5154         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  5155         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5156         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5157         -
  5158         -      # hardcode_minus_L: Not really in the search PATH,
  5159         -      # but as the default location of the library.
  5160         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5161         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  5162         -      ;;
  5163         -
  5164         -    hpux10*)
  5165         -      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
  5166         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
  5167         -      else
  5168         -	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
  5169         -      fi
  5170         -      if test "$with_gnu_ld" = no; then
  5171         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  5172         -	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
  5173         -	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5174         -	_LT_TAGVAR(hardcode_direct, $1)=yes
  5175         -	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  5176         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  5177         -	# hardcode_minus_L: Not really in the search PATH,
  5178         -	# but as the default location of the library.
  5179         -	_LT_TAGVAR(hardcode_minus_L, $1)=yes
  5180         -      fi
  5181         -      ;;
  5182         -
  5183         -    hpux11*)
  5184         -      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
  5185         -	case $host_cpu in
  5186         -	hppa*64*)
  5187         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  5188         -	  ;;
  5189         -	ia64*)
  5190         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
  5191         -	  ;;
  5192         -	*)
  5193         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
  5194         -	  ;;
  5195         -	esac
  5196         -      else
  5197         -	case $host_cpu in
  5198         -	hppa*64*)
  5199         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  5200         -	  ;;
  5201         -	ia64*)
  5202         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
  5203         -	  ;;
  5204         -	*)
  5205         -	m4_if($1, [], [
  5206         -	  # Older versions of the 11.00 compiler do not understand -b yet
  5207         -	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
  5208         -	  _LT_LINKER_OPTION([if $CC understands -b],
  5209         -	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
  5210         -	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
  5211         -	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
  5212         -	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
  5213         -	  ;;
  5214         -	esac
  5215         -      fi
  5216         -      if test "$with_gnu_ld" = no; then
  5217         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  5218         -	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5219         -
  5220         -	case $host_cpu in
  5221         -	hppa*64*|ia64*)
  5222         -	  _LT_TAGVAR(hardcode_direct, $1)=no
  5223         -	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5224         -	  ;;
  5225         -	*)
  5226         -	  _LT_TAGVAR(hardcode_direct, $1)=yes
  5227         -	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  5228         -	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  5229         -
  5230         -	  # hardcode_minus_L: Not really in the search PATH,
  5231         -	  # but as the default location of the library.
  5232         -	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5233         -	  ;;
  5234         -	esac
  5235         -      fi
  5236         -      ;;
  5237         -
  5238         -    irix5* | irix6* | nonstopux*)
  5239         -      if test "$GCC" = yes; then
  5240         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  5241         -	# Try to use the -exported_symbol ld option, if it does not
  5242         -	# work, assume that -exports_file does not work either and
  5243         -	# implicitly export all symbols.
  5244         -	# This should be the same for all languages, so no per-tag cache variable.
  5245         -	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
  5246         -	  [lt_cv_irix_exported_symbol],
  5247         -	  [save_LDFLAGS="$LDFLAGS"
  5248         -	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
  5249         -	   AC_LINK_IFELSE(
  5250         -	     [AC_LANG_SOURCE(
  5251         -	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
  5252         -			      [C++], [[int foo (void) { return 0; }]],
  5253         -			      [Fortran 77], [[
  5254         -      subroutine foo
  5255         -      end]],
  5256         -			      [Fortran], [[
  5257         -      subroutine foo
  5258         -      end]])])],
  5259         -	      [lt_cv_irix_exported_symbol=yes],
  5260         -	      [lt_cv_irix_exported_symbol=no])
  5261         -           LDFLAGS="$save_LDFLAGS"])
  5262         -	if test "$lt_cv_irix_exported_symbol" = yes; then
  5263         -          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
  5264         -	fi
  5265         -      else
  5266         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
  5267         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
  5268         -      fi
  5269         -      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
  5270         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5271         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5272         -      _LT_TAGVAR(inherit_rpath, $1)=yes
  5273         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
  5274         -      ;;
  5275         -
  5276         -    netbsd*)
  5277         -      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
  5278         -	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
  5279         -      else
  5280         -	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
  5281         -      fi
  5282         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  5283         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5284         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5285         -      ;;
  5286         -
  5287         -    newsos6)
  5288         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5289         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5290         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5291         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5292         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5293         -      ;;
  5294         -
  5295         -    *nto* | *qnx*)
  5296         -      ;;
  5297         -
  5298         -    openbsd*)
  5299         -      if test -f /usr/libexec/ld.so; then
  5300         -	_LT_TAGVAR(hardcode_direct, $1)=yes
  5301         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5302         -	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  5303         -	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  5304         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  5305         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
  5306         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  5307         -	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  5308         -	else
  5309         -	  case $host_os in
  5310         -	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
  5311         -	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  5312         -	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  5313         -	     ;;
  5314         -	   *)
  5315         -	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  5316         -	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  5317         -	     ;;
  5318         -	  esac
  5319         -	fi
  5320         -      else
  5321         -	_LT_TAGVAR(ld_shlibs, $1)=no
  5322         -      fi
  5323         -      ;;
  5324         -
  5325         -    os2*)
  5326         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5327         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5328         -      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  5329         -      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
  5330         -      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
  5331         -      ;;
  5332         -
  5333         -    osf3*)
  5334         -      if test "$GCC" = yes; then
  5335         -	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  5336         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  5337         -      else
  5338         -	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  5339         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
  5340         -      fi
  5341         -      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
  5342         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5343         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5344         -      ;;
  5345         -
  5346         -    osf4* | osf5*)	# as osf3* with the addition of -msym flag
  5347         -      if test "$GCC" = yes; then
  5348         -	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  5349         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  5350         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5351         -      else
  5352         -	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  5353         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
  5354         -	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
  5355         -	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
  5356         -
  5357         -	# Both c and cxx compiler support -rpath directly
  5358         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  5359         -      fi
  5360         -      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
  5361         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5362         -      ;;
  5363         -
  5364         -    solaris*)
  5365         -      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
  5366         -      if test "$GCC" = yes; then
  5367         -	wlarc='${wl}'
  5368         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  5369         -	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  5370         -	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
  5371         -      else
  5372         -	case `$CC -V 2>&1` in
  5373         -	*"Compilers 5.0"*)
  5374         -	  wlarc=''
  5375         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5376         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  5377         -	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
  5378         -	  ;;
  5379         -	*)
  5380         -	  wlarc='${wl}'
  5381         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
  5382         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  5383         -	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
  5384         -	  ;;
  5385         -	esac
  5386         -      fi
  5387         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  5388         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5389         -      case $host_os in
  5390         -      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  5391         -      *)
  5392         -	# The compiler driver will combine and reorder linker options,
  5393         -	# but understands `-z linker_flag'.  GCC discards it without `$wl',
  5394         -	# but is careful enough not to reorder.
  5395         -	# Supported since Solaris 2.6 (maybe 2.5.1?)
  5396         -	if test "$GCC" = yes; then
  5397         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
  5398         -	else
  5399         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
  5400         -	fi
  5401         -	;;
  5402         -      esac
  5403         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
  5404         -      ;;
  5405         -
  5406         -    sunos4*)
  5407         -      if test "x$host_vendor" = xsequent; then
  5408         -	# Use $CC to link under sequent, because it throws in some extra .o
  5409         -	# files that make .init and .fini sections work.
  5410         -	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
  5411         -      else
  5412         -	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
  5413         -      fi
  5414         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5415         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5416         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5417         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5418         -      ;;
  5419         -
  5420         -    sysv4)
  5421         -      case $host_vendor in
  5422         -	sni)
  5423         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5424         -	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
  5425         -	;;
  5426         -	siemens)
  5427         -	  ## LD is ld it makes a PLAMLIB
  5428         -	  ## CC just makes a GrossModule.
  5429         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
  5430         -	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
  5431         -	  _LT_TAGVAR(hardcode_direct, $1)=no
  5432         -        ;;
  5433         -	motorola)
  5434         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5435         -	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
  5436         -	;;
  5437         -      esac
  5438         -      runpath_var='LD_RUN_PATH'
  5439         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5440         -      ;;
  5441         -
  5442         -    sysv4.3*)
  5443         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5444         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5445         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
  5446         -      ;;
  5447         -
  5448         -    sysv4*MP*)
  5449         -      if test -d /usr/nec; then
  5450         -	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5451         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5452         -	runpath_var=LD_RUN_PATH
  5453         -	hardcode_runpath_var=yes
  5454         -	_LT_TAGVAR(ld_shlibs, $1)=yes
  5455         -      fi
  5456         -      ;;
  5457         -
  5458         -    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
  5459         -      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  5460         -      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5461         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5462         -      runpath_var='LD_RUN_PATH'
  5463         -
  5464         -      if test "$GCC" = yes; then
  5465         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5466         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5467         -      else
  5468         -	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5469         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5470         -      fi
  5471         -      ;;
  5472         -
  5473         -    sysv5* | sco3.2v5* | sco5v6*)
  5474         -      # Note: We can NOT use -z defs as we might desire, because we do not
  5475         -      # link with -lc, and that would cause any symbols used from libc to
  5476         -      # always be unresolved, which means just about no library would
  5477         -      # ever link correctly.  If we're not using GNU ld we use -z text
  5478         -      # though, which does catch some bad symbols but isn't as heavy-handed
  5479         -      # as -z defs.
  5480         -      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  5481         -      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
  5482         -      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5483         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5484         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
  5485         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  5486         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
  5487         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
  5488         -      runpath_var='LD_RUN_PATH'
  5489         -
  5490         -      if test "$GCC" = yes; then
  5491         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5492         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5493         -      else
  5494         -	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5495         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5496         -      fi
  5497         -      ;;
  5498         -
  5499         -    uts4*)
  5500         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5501         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5502         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5503         -      ;;
  5504         -
  5505         -    *)
  5506         -      _LT_TAGVAR(ld_shlibs, $1)=no
  5507         -      ;;
  5508         -    esac
  5509         -
  5510         -    if test x$host_vendor = xsni; then
  5511         -      case $host in
  5512         -      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  5513         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
  5514         -	;;
  5515         -      esac
  5516         -    fi
  5517         -  fi
  5518         -])
  5519         -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
  5520         -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  5521         -
  5522         -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
  5523         -
  5524         -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
  5525         -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
  5526         -_LT_DECL([], [extract_expsyms_cmds], [2],
  5527         -    [The commands to extract the exported symbol list from a shared archive])
  5528         -
  5529         -#
  5530         -# Do we need to explicitly link libc?
  5531         -#
  5532         -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
  5533         -x|xyes)
  5534         -  # Assume -lc should be added
  5535         -  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
  5536         -
  5537         -  if test "$enable_shared" = yes && test "$GCC" = yes; then
  5538         -    case $_LT_TAGVAR(archive_cmds, $1) in
  5539         -    *'~'*)
  5540         -      # FIXME: we may have to deal with multi-command sequences.
  5541         -      ;;
  5542         -    '$CC '*)
  5543         -      # Test whether the compiler implicitly links with -lc since on some
  5544         -      # systems, -lgcc has to come before -lc. If gcc already passes -lc
  5545         -      # to ld, don't add -lc before -lgcc.
  5546         -      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
  5547         -	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
  5548         -	[$RM conftest*
  5549         -	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  5550         -
  5551         -	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
  5552         -	  soname=conftest
  5553         -	  lib=conftest
  5554         -	  libobjs=conftest.$ac_objext
  5555         -	  deplibs=
  5556         -	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
  5557         -	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
  5558         -	  compiler_flags=-v
  5559         -	  linker_flags=-v
  5560         -	  verstring=
  5561         -	  output_objdir=.
  5562         -	  libname=conftest
  5563         -	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
  5564         -	  _LT_TAGVAR(allow_undefined_flag, $1)=
  5565         -	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
  5566         -	  then
  5567         -	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5568         -	  else
  5569         -	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
  5570         -	  fi
  5571         -	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
  5572         -	else
  5573         -	  cat conftest.err 1>&5
  5574         -	fi
  5575         -	$RM conftest*
  5576         -	])
  5577         -      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
  5578         -      ;;
  5579         -    esac
  5580         -  fi
  5581         -  ;;
  5582         -esac
  5583         -
  5584         -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
  5585         -    [Whether or not to add -lc for building shared libraries])
  5586         -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
  5587         -    [enable_shared_with_static_runtimes], [0],
  5588         -    [Whether or not to disallow shared libs when runtime libs are static])
  5589         -_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
  5590         -    [Compiler flag to allow reflexive dlopens])
  5591         -_LT_TAGDECL([], [whole_archive_flag_spec], [1],
  5592         -    [Compiler flag to generate shared objects directly from archives])
  5593         -_LT_TAGDECL([], [compiler_needs_object], [1],
  5594         -    [Whether the compiler copes with passing no objects directly])
  5595         -_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
  5596         -    [Create an old-style archive from a shared archive])
  5597         -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
  5598         -    [Create a temporary old-style archive to link instead of a shared archive])
  5599         -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
  5600         -_LT_TAGDECL([], [archive_expsym_cmds], [2])
  5601         -_LT_TAGDECL([], [module_cmds], [2],
  5602         -    [Commands used to build a loadable module if different from building
  5603         -    a shared archive.])
  5604         -_LT_TAGDECL([], [module_expsym_cmds], [2])
  5605         -_LT_TAGDECL([], [with_gnu_ld], [1],
  5606         -    [Whether we are building with GNU ld or not])
  5607         -_LT_TAGDECL([], [allow_undefined_flag], [1],
  5608         -    [Flag that allows shared libraries with undefined symbols to be built])
  5609         -_LT_TAGDECL([], [no_undefined_flag], [1],
  5610         -    [Flag that enforces no undefined symbols])
  5611         -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
  5612         -    [Flag to hardcode $libdir into a binary during linking.
  5613         -    This must work even if $libdir does not exist])
  5614         -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
  5615         -    [[If ld is used when linking, flag to hardcode $libdir into a binary
  5616         -    during linking.  This must work even if $libdir does not exist]])
  5617         -_LT_TAGDECL([], [hardcode_libdir_separator], [1],
  5618         -    [Whether we need a single "-rpath" flag with a separated argument])
  5619         -_LT_TAGDECL([], [hardcode_direct], [0],
  5620         -    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  5621         -    DIR into the resulting binary])
  5622         -_LT_TAGDECL([], [hardcode_direct_absolute], [0],
  5623         -    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  5624         -    DIR into the resulting binary and the resulting library dependency is
  5625         -    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
  5626         -    library is relocated])
  5627         -_LT_TAGDECL([], [hardcode_minus_L], [0],
  5628         -    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  5629         -    into the resulting binary])
  5630         -_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
  5631         -    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  5632         -    into the resulting binary])
  5633         -_LT_TAGDECL([], [hardcode_automatic], [0],
  5634         -    [Set to "yes" if building a shared library automatically hardcodes DIR
  5635         -    into the library and all subsequent libraries and executables linked
  5636         -    against it])
  5637         -_LT_TAGDECL([], [inherit_rpath], [0],
  5638         -    [Set to yes if linker adds runtime paths of dependent libraries
  5639         -    to runtime path list])
  5640         -_LT_TAGDECL([], [link_all_deplibs], [0],
  5641         -    [Whether libtool must link a program against all its dependency libraries])
  5642         -_LT_TAGDECL([], [always_export_symbols], [0],
  5643         -    [Set to "yes" if exported symbols are required])
  5644         -_LT_TAGDECL([], [export_symbols_cmds], [2],
  5645         -    [The commands to list exported symbols])
  5646         -_LT_TAGDECL([], [exclude_expsyms], [1],
  5647         -    [Symbols that should not be listed in the preloaded symbols])
  5648         -_LT_TAGDECL([], [include_expsyms], [1],
  5649         -    [Symbols that must always be exported])
  5650         -_LT_TAGDECL([], [prelink_cmds], [2],
  5651         -    [Commands necessary for linking programs (against libraries) with templates])
  5652         -_LT_TAGDECL([], [postlink_cmds], [2],
  5653         -    [Commands necessary for finishing linking programs])
  5654         -_LT_TAGDECL([], [file_list_spec], [1],
  5655         -    [Specify filename containing input files])
  5656         -dnl FIXME: Not yet implemented
  5657         -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
  5658         -dnl    [Compiler flag to generate thread safe objects])
  5659         -])# _LT_LINKER_SHLIBS
  5660         -
  5661         -
  5662         -# _LT_LANG_C_CONFIG([TAG])
  5663         -# ------------------------
  5664         -# Ensure that the configuration variables for a C compiler are suitably
  5665         -# defined.  These variables are subsequently used by _LT_CONFIG to write
  5666         -# the compiler configuration to `libtool'.
  5667         -m4_defun([_LT_LANG_C_CONFIG],
  5668         -[m4_require([_LT_DECL_EGREP])dnl
  5669         -lt_save_CC="$CC"
  5670         -AC_LANG_PUSH(C)
  5671         -
  5672         -# Source file extension for C test sources.
  5673         -ac_ext=c
  5674         -
  5675         -# Object file extension for compiled C test sources.
  5676         -objext=o
  5677         -_LT_TAGVAR(objext, $1)=$objext
  5678         -
  5679         -# Code to be used in simple compile tests
  5680         -lt_simple_compile_test_code="int some_variable = 0;"
  5681         -
  5682         -# Code to be used in simple link tests
  5683         -lt_simple_link_test_code='int main(){return(0);}'
  5684         -
  5685         -_LT_TAG_COMPILER
  5686         -# Save the default compiler, since it gets overwritten when the other
  5687         -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
  5688         -compiler_DEFAULT=$CC
  5689         -
  5690         -# save warnings/boilerplate of simple test code
  5691         -_LT_COMPILER_BOILERPLATE
  5692         -_LT_LINKER_BOILERPLATE
  5693         -
  5694         -## CAVEAT EMPTOR:
  5695         -## There is no encapsulation within the following macros, do not change
  5696         -## the running order or otherwise move them around unless you know exactly
  5697         -## what you are doing...
  5698         -if test -n "$compiler"; then
  5699         -  _LT_COMPILER_NO_RTTI($1)
  5700         -  _LT_COMPILER_PIC($1)
  5701         -  _LT_COMPILER_C_O($1)
  5702         -  _LT_COMPILER_FILE_LOCKS($1)
  5703         -  _LT_LINKER_SHLIBS($1)
  5704         -  _LT_SYS_DYNAMIC_LINKER($1)
  5705         -  _LT_LINKER_HARDCODE_LIBPATH($1)
  5706         -  LT_SYS_DLOPEN_SELF
  5707         -  _LT_CMD_STRIPLIB
  5708         -
  5709         -  # Report which library types will actually be built
  5710         -  AC_MSG_CHECKING([if libtool supports shared libraries])
  5711         -  AC_MSG_RESULT([$can_build_shared])
  5712         -
  5713         -  AC_MSG_CHECKING([whether to build shared libraries])
  5714         -  test "$can_build_shared" = "no" && enable_shared=no
  5715         -
  5716         -  # On AIX, shared libraries and static libraries use the same namespace, and
  5717         -  # are all built from PIC.
  5718         -  case $host_os in
  5719         -  aix3*)
  5720         -    test "$enable_shared" = yes && enable_static=no
  5721         -    if test -n "$RANLIB"; then
  5722         -      archive_cmds="$archive_cmds~\$RANLIB \$lib"
  5723         -      postinstall_cmds='$RANLIB $lib'
  5724         -    fi
  5725         -    ;;
  5726         -
  5727         -  aix[[4-9]]*)
  5728         -    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  5729         -      test "$enable_shared" = yes && enable_static=no
  5730         -    fi
  5731         -    ;;
  5732         -  esac
  5733         -  AC_MSG_RESULT([$enable_shared])
  5734         -
  5735         -  AC_MSG_CHECKING([whether to build static libraries])
  5736         -  # Make sure either enable_shared or enable_static is yes.
  5737         -  test "$enable_shared" = yes || enable_static=yes
  5738         -  AC_MSG_RESULT([$enable_static])
  5739         -
  5740         -  _LT_CONFIG($1)
  5741         -fi
  5742         -AC_LANG_POP
  5743         -CC="$lt_save_CC"
  5744         -])# _LT_LANG_C_CONFIG
  5745         -
  5746         -
  5747         -# _LT_LANG_CXX_CONFIG([TAG])
  5748         -# --------------------------
  5749         -# Ensure that the configuration variables for a C++ compiler are suitably
  5750         -# defined.  These variables are subsequently used by _LT_CONFIG to write
  5751         -# the compiler configuration to `libtool'.
  5752         -m4_defun([_LT_LANG_CXX_CONFIG],
  5753         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  5754         -m4_require([_LT_DECL_EGREP])dnl
  5755         -m4_require([_LT_PATH_MANIFEST_TOOL])dnl
  5756         -if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
  5757         -    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
  5758         -    (test "X$CXX" != "Xg++"))) ; then
  5759         -  AC_PROG_CXXCPP
  5760         -else
  5761         -  _lt_caught_CXX_error=yes
  5762         -fi
  5763         -
  5764         -AC_LANG_PUSH(C++)
  5765         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5766         -_LT_TAGVAR(allow_undefined_flag, $1)=
  5767         -_LT_TAGVAR(always_export_symbols, $1)=no
  5768         -_LT_TAGVAR(archive_expsym_cmds, $1)=
  5769         -_LT_TAGVAR(compiler_needs_object, $1)=no
  5770         -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
  5771         -_LT_TAGVAR(hardcode_direct, $1)=no
  5772         -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
  5773         -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  5774         -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  5775         -_LT_TAGVAR(hardcode_libdir_separator, $1)=
  5776         -_LT_TAGVAR(hardcode_minus_L, $1)=no
  5777         -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  5778         -_LT_TAGVAR(hardcode_automatic, $1)=no
  5779         -_LT_TAGVAR(inherit_rpath, $1)=no
  5780         -_LT_TAGVAR(module_cmds, $1)=
  5781         -_LT_TAGVAR(module_expsym_cmds, $1)=
  5782         -_LT_TAGVAR(link_all_deplibs, $1)=unknown
  5783         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  5784         -_LT_TAGVAR(reload_flag, $1)=$reload_flag
  5785         -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
  5786         -_LT_TAGVAR(no_undefined_flag, $1)=
  5787         -_LT_TAGVAR(whole_archive_flag_spec, $1)=
  5788         -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  5789         -
  5790         -# Source file extension for C++ test sources.
  5791         -ac_ext=cpp
  5792         -
  5793         -# Object file extension for compiled C++ test sources.
  5794         -objext=o
  5795         -_LT_TAGVAR(objext, $1)=$objext
  5796         -
  5797         -# No sense in running all these tests if we already determined that
  5798         -# the CXX compiler isn't working.  Some variables (like enable_shared)
  5799         -# are currently assumed to apply to all compilers on this platform,
  5800         -# and will be corrupted by setting them based on a non-working compiler.
  5801         -if test "$_lt_caught_CXX_error" != yes; then
  5802         -  # Code to be used in simple compile tests
  5803         -  lt_simple_compile_test_code="int some_variable = 0;"
  5804         -
  5805         -  # Code to be used in simple link tests
  5806         -  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
  5807         -
  5808         -  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  5809         -  _LT_TAG_COMPILER
  5810         -
  5811         -  # save warnings/boilerplate of simple test code
  5812         -  _LT_COMPILER_BOILERPLATE
  5813         -  _LT_LINKER_BOILERPLATE
  5814         -
  5815         -  # Allow CC to be a program name with arguments.
  5816         -  lt_save_CC=$CC
  5817         -  lt_save_CFLAGS=$CFLAGS
  5818         -  lt_save_LD=$LD
  5819         -  lt_save_GCC=$GCC
  5820         -  GCC=$GXX
  5821         -  lt_save_with_gnu_ld=$with_gnu_ld
  5822         -  lt_save_path_LD=$lt_cv_path_LD
  5823         -  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
  5824         -    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
  5825         -  else
  5826         -    $as_unset lt_cv_prog_gnu_ld
  5827         -  fi
  5828         -  if test -n "${lt_cv_path_LDCXX+set}"; then
  5829         -    lt_cv_path_LD=$lt_cv_path_LDCXX
  5830         -  else
  5831         -    $as_unset lt_cv_path_LD
  5832         -  fi
  5833         -  test -z "${LDCXX+set}" || LD=$LDCXX
  5834         -  CC=${CXX-"c++"}
  5835         -  CFLAGS=$CXXFLAGS
  5836         -  compiler=$CC
  5837         -  _LT_TAGVAR(compiler, $1)=$CC
  5838         -  _LT_CC_BASENAME([$compiler])
  5839         -
  5840         -  if test -n "$compiler"; then
  5841         -    # We don't want -fno-exception when compiling C++ code, so set the
  5842         -    # no_builtin_flag separately
  5843         -    if test "$GXX" = yes; then
  5844         -      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
  5845         -    else
  5846         -      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  5847         -    fi
  5848         -
  5849         -    if test "$GXX" = yes; then
  5850         -      # Set up default GNU C++ configuration
  5851         -
  5852         -      LT_PATH_LD
  5853         -
  5854         -      # Check if GNU C++ uses GNU ld as the underlying linker, since the
  5855         -      # archiving commands below assume that GNU ld is being used.
  5856         -      if test "$with_gnu_ld" = yes; then
  5857         -        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5858         -        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  5859         -
  5860         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5861         -        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  5862         -
  5863         -        # If archive_cmds runs LD, not CC, wlarc should be empty
  5864         -        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
  5865         -        #     investigate it a little bit more. (MM)
  5866         -        wlarc='${wl}'
  5867         -
  5868         -        # ancient GNU ld didn't support --whole-archive et. al.
  5869         -        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
  5870         -	  $GREP 'no-whole-archive' > /dev/null; then
  5871         -          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  5872         -        else
  5873         -          _LT_TAGVAR(whole_archive_flag_spec, $1)=
  5874         -        fi
  5875         -      else
  5876         -        with_gnu_ld=no
  5877         -        wlarc=
  5878         -
  5879         -        # A generic and very simple default shared library creation
  5880         -        # command for GNU C++ for the case where it uses the native
  5881         -        # linker, instead of GNU ld.  If possible, this setting should
  5882         -        # overridden to take advantage of the native linker features on
  5883         -        # the platform it is being used on.
  5884         -        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  5885         -      fi
  5886         -
  5887         -      # Commands to make compiler produce verbose output that lists
  5888         -      # what "hidden" libraries, object files and flags are used when
  5889         -      # linking a shared library.
  5890         -      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
  5891         -
  5892         -    else
  5893         -      GXX=no
  5894         -      with_gnu_ld=no
  5895         -      wlarc=
  5896         -    fi
  5897         -
  5898         -    # PORTME: fill in a description of your system's C++ link characteristics
  5899         -    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  5900         -    _LT_TAGVAR(ld_shlibs, $1)=yes
  5901         -    case $host_os in
  5902         -      aix3*)
  5903         -        # FIXME: insert proper C++ library support
  5904         -        _LT_TAGVAR(ld_shlibs, $1)=no
  5905         -        ;;
  5906         -      aix[[4-9]]*)
  5907         -        if test "$host_cpu" = ia64; then
  5908         -          # On IA64, the linker does run time linking by default, so we don't
  5909         -          # have to do anything special.
  5910         -          aix_use_runtimelinking=no
  5911         -          exp_sym_flag='-Bexport'
  5912         -          no_entry_flag=""
  5913         -        else
  5914         -          aix_use_runtimelinking=no
  5915         -
  5916         -          # Test if we are trying to use run time linking or normal
  5917         -          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  5918         -          # need to do runtime linking.
  5919         -          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
  5920         -	    for ld_flag in $LDFLAGS; do
  5921         -	      case $ld_flag in
  5922         -	      *-brtl*)
  5923         -	        aix_use_runtimelinking=yes
  5924         -	        break
  5925         -	        ;;
  5926         -	      esac
  5927         -	    done
  5928         -	    ;;
  5929         -          esac
  5930         -
  5931         -          exp_sym_flag='-bexport'
  5932         -          no_entry_flag='-bnoentry'
  5933         -        fi
  5934         -
  5935         -        # When large executables or shared objects are built, AIX ld can
  5936         -        # have problems creating the table of contents.  If linking a library
  5937         -        # or program results in "error TOC overflow" add -mminimal-toc to
  5938         -        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
  5939         -        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  5940         -
  5941         -        _LT_TAGVAR(archive_cmds, $1)=''
  5942         -        _LT_TAGVAR(hardcode_direct, $1)=yes
  5943         -        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  5944         -        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  5945         -        _LT_TAGVAR(link_all_deplibs, $1)=yes
  5946         -        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
  5947         -
  5948         -        if test "$GXX" = yes; then
  5949         -          case $host_os in aix4.[[012]]|aix4.[[012]].*)
  5950         -          # We only want to do this on AIX 4.2 and lower, the check
  5951         -          # below for broken collect2 doesn't work under 4.3+
  5952         -	  collect2name=`${CC} -print-prog-name=collect2`
  5953         -	  if test -f "$collect2name" &&
  5954         -	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
  5955         -	  then
  5956         -	    # We have reworked collect2
  5957         -	    :
  5958         -	  else
  5959         -	    # We have old collect2
  5960         -	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
  5961         -	    # It fails to find uninstalled libraries when the uninstalled
  5962         -	    # path is not listed in the libpath.  Setting hardcode_minus_L
  5963         -	    # to unsupported forces relinking
  5964         -	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5965         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5966         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
  5967         -	  fi
  5968         -          esac
  5969         -          shared_flag='-shared'
  5970         -	  if test "$aix_use_runtimelinking" = yes; then
  5971         -	    shared_flag="$shared_flag "'${wl}-G'
  5972         -	  fi
  5973         -        else
  5974         -          # not using gcc
  5975         -          if test "$host_cpu" = ia64; then
  5976         -	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  5977         -	  # chokes on -Wl,-G. The following line is correct:
  5978         -	  shared_flag='-G'
  5979         -          else
  5980         -	    if test "$aix_use_runtimelinking" = yes; then
  5981         -	      shared_flag='${wl}-G'
  5982         -	    else
  5983         -	      shared_flag='${wl}-bM:SRE'
  5984         -	    fi
  5985         -          fi
  5986         -        fi
  5987         -
  5988         -        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
  5989         -        # It seems that -bexpall does not export symbols beginning with
  5990         -        # underscore (_), so it is better to generate a list of symbols to
  5991         -	# export.
  5992         -        _LT_TAGVAR(always_export_symbols, $1)=yes
  5993         -        if test "$aix_use_runtimelinking" = yes; then
  5994         -          # Warning - without using the other runtime loading flags (-brtl),
  5995         -          # -berok will link without error, but may produce a broken library.
  5996         -          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
  5997         -          # Determine the default libpath from the value encoded in an empty
  5998         -          # executable.
  5999         -          _LT_SYS_MODULE_PATH_AIX([$1])
  6000         -          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  6001         -
  6002         -          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
  6003         -        else
  6004         -          if test "$host_cpu" = ia64; then
  6005         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  6006         -	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  6007         -	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
  6008         -          else
  6009         -	    # Determine the default libpath from the value encoded in an
  6010         -	    # empty executable.
  6011         -	    _LT_SYS_MODULE_PATH_AIX([$1])
  6012         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  6013         -	    # Warning - without using the other run time loading flags,
  6014         -	    # -berok will link without error, but may produce a broken library.
  6015         -	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  6016         -	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  6017         -	    if test "$with_gnu_ld" = yes; then
  6018         -	      # We only use this code for GNU lds that support --whole-archive.
  6019         -	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  6020         -	    else
  6021         -	      # Exported symbols can be pulled into shared objects from archives
  6022         -	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
  6023         -	    fi
  6024         -	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
  6025         -	    # This is similar to how AIX traditionally builds its shared
  6026         -	    # libraries.
  6027         -	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  6028         -          fi
  6029         -        fi
  6030         -        ;;
  6031         -
  6032         -      beos*)
  6033         -	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  6034         -	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  6035         -	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  6036         -	  # support --undefined.  This deserves some investigation.  FIXME
  6037         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  6038         -	else
  6039         -	  _LT_TAGVAR(ld_shlibs, $1)=no
  6040         -	fi
  6041         -	;;
  6042         -
  6043         -      chorus*)
  6044         -        case $cc_basename in
  6045         -          *)
  6046         -	  # FIXME: insert proper C++ library support
  6047         -	  _LT_TAGVAR(ld_shlibs, $1)=no
  6048         -	  ;;
  6049         -        esac
  6050         -        ;;
  6051         -
  6052         -      cygwin* | mingw* | pw32* | cegcc*)
  6053         -	case $GXX,$cc_basename in
  6054         -	,cl* | no,cl*)
  6055         -	  # Native MSVC
  6056         -	  # hardcode_libdir_flag_spec is actually meaningless, as there is
  6057         -	  # no search path for DLLs.
  6058         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
  6059         -	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  6060         -	  _LT_TAGVAR(always_export_symbols, $1)=yes
  6061         -	  _LT_TAGVAR(file_list_spec, $1)='@'
  6062         -	  # Tell ltmain to make .lib files, not .a files.
  6063         -	  libext=lib
  6064         -	  # Tell ltmain to make .dll files, not .so files.
  6065         -	  shrext_cmds=".dll"
  6066         -	  # FIXME: Setting linknames here is a bad hack.
  6067         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
  6068         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  6069         -	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
  6070         -	    else
  6071         -	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
  6072         -	    fi~
  6073         -	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
  6074         -	    linknames='
  6075         -	  # The linker will not automatically build a static lib if we build a DLL.
  6076         -	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
  6077         -	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  6078         -	  # Don't use ranlib
  6079         -	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
  6080         -	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
  6081         -	    lt_tool_outputfile="@TOOL_OUTPUT@"~
  6082         -	    case $lt_outputfile in
  6083         -	      *.exe|*.EXE) ;;
  6084         -	      *)
  6085         -		lt_outputfile="$lt_outputfile.exe"
  6086         -		lt_tool_outputfile="$lt_tool_outputfile.exe"
  6087         -		;;
  6088         -	    esac~
  6089         -	    func_to_tool_file "$lt_outputfile"~
  6090         -	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
  6091         -	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
  6092         -	      $RM "$lt_outputfile.manifest";
  6093         -	    fi'
  6094         -	  ;;
  6095         -	*)
  6096         -	  # g++
  6097         -	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
  6098         -	  # as there is no search path for DLLs.
  6099         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  6100         -	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
  6101         -	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  6102         -	  _LT_TAGVAR(always_export_symbols, $1)=no
  6103         -	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  6104         -
  6105         -	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
  6106         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  6107         -	    # If the export-symbols file already is a .def file (1st line
  6108         -	    # is EXPORTS), use it as is; otherwise, prepend...
  6109         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  6110         -	      cp $export_symbols $output_objdir/$soname.def;
  6111         -	    else
  6112         -	      echo EXPORTS > $output_objdir/$soname.def;
  6113         -	      cat $export_symbols >> $output_objdir/$soname.def;
  6114         -	    fi~
  6115         -	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  6116         -	  else
  6117         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6118         -	  fi
  6119         -	  ;;
  6120         -	esac
  6121         -	;;
  6122         -      darwin* | rhapsody*)
  6123         -        _LT_DARWIN_LINKER_FEATURES($1)
  6124         -	;;
  6125         -
  6126         -      dgux*)
  6127         -        case $cc_basename in
  6128         -          ec++*)
  6129         -	    # FIXME: insert proper C++ library support
  6130         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6131         -	    ;;
  6132         -          ghcx*)
  6133         -	    # Green Hills C++ Compiler
  6134         -	    # FIXME: insert proper C++ library support
  6135         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6136         -	    ;;
  6137         -          *)
  6138         -	    # FIXME: insert proper C++ library support
  6139         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6140         -	    ;;
  6141         -        esac
  6142         -        ;;
  6143         -
  6144         -      freebsd[[12]]*)
  6145         -        # C++ shared libraries reported to be fairly broken before
  6146         -	# switch to ELF
  6147         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6148         -        ;;
  6149         -
  6150         -      freebsd-elf*)
  6151         -        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6152         -        ;;
  6153         -
  6154         -      freebsd* | dragonfly*)
  6155         -        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
  6156         -        # conventions
  6157         -        _LT_TAGVAR(ld_shlibs, $1)=yes
  6158         -        ;;
  6159         -
  6160         -      gnu*)
  6161         -        ;;
  6162         -
  6163         -      haiku*)
  6164         -        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  6165         -        _LT_TAGVAR(link_all_deplibs, $1)=yes
  6166         -        ;;
  6167         -
  6168         -      hpux9*)
  6169         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  6170         -        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6171         -        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  6172         -        _LT_TAGVAR(hardcode_direct, $1)=yes
  6173         -        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  6174         -				             # but as the default
  6175         -				             # location of the library.
  6176         -
  6177         -        case $cc_basename in
  6178         -          CC*)
  6179         -            # FIXME: insert proper C++ library support
  6180         -            _LT_TAGVAR(ld_shlibs, $1)=no
  6181         -            ;;
  6182         -          aCC*)
  6183         -            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  6184         -            # Commands to make compiler produce verbose output that lists
  6185         -            # what "hidden" libraries, object files and flags are used when
  6186         -            # linking a shared library.
  6187         -            #
  6188         -            # There doesn't appear to be a way to prevent this compiler from
  6189         -            # explicitly linking system object files so we need to strip them
  6190         -            # from the output so that they don't get included in the library
  6191         -            # dependencies.
  6192         -            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
  6193         -            ;;
  6194         -          *)
  6195         -            if test "$GXX" = yes; then
  6196         -              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  6197         -            else
  6198         -              # FIXME: insert proper C++ library support
  6199         -              _LT_TAGVAR(ld_shlibs, $1)=no
  6200         -            fi
  6201         -            ;;
  6202         -        esac
  6203         -        ;;
  6204         -
  6205         -      hpux10*|hpux11*)
  6206         -        if test $with_gnu_ld = no; then
  6207         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  6208         -	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6209         -
  6210         -          case $host_cpu in
  6211         -            hppa*64*|ia64*)
  6212         -              ;;
  6213         -            *)
  6214         -	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  6215         -              ;;
  6216         -          esac
  6217         -        fi
  6218         -        case $host_cpu in
  6219         -          hppa*64*|ia64*)
  6220         -            _LT_TAGVAR(hardcode_direct, $1)=no
  6221         -            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6222         -            ;;
  6223         -          *)
  6224         -            _LT_TAGVAR(hardcode_direct, $1)=yes
  6225         -            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  6226         -            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  6227         -					         # but as the default
  6228         -					         # location of the library.
  6229         -            ;;
  6230         -        esac
  6231         -
  6232         -        case $cc_basename in
  6233         -          CC*)
  6234         -	    # FIXME: insert proper C++ library support
  6235         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6236         -	    ;;
  6237         -          aCC*)
  6238         -	    case $host_cpu in
  6239         -	      hppa*64*)
  6240         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6241         -	        ;;
  6242         -	      ia64*)
  6243         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6244         -	        ;;
  6245         -	      *)
  6246         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6247         -	        ;;
  6248         -	    esac
  6249         -	    # Commands to make compiler produce verbose output that lists
  6250         -	    # what "hidden" libraries, object files and flags are used when
  6251         -	    # linking a shared library.
  6252         -	    #
  6253         -	    # There doesn't appear to be a way to prevent this compiler from
  6254         -	    # explicitly linking system object files so we need to strip them
  6255         -	    # from the output so that they don't get included in the library
  6256         -	    # dependencies.
  6257         -	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
  6258         -	    ;;
  6259         -          *)
  6260         -	    if test "$GXX" = yes; then
  6261         -	      if test $with_gnu_ld = no; then
  6262         -	        case $host_cpu in
  6263         -	          hppa*64*)
  6264         -	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6265         -	            ;;
  6266         -	          ia64*)
  6267         -	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6268         -	            ;;
  6269         -	          *)
  6270         -	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6271         -	            ;;
  6272         -	        esac
  6273         -	      fi
  6274         -	    else
  6275         -	      # FIXME: insert proper C++ library support
  6276         -	      _LT_TAGVAR(ld_shlibs, $1)=no
  6277         -	    fi
  6278         -	    ;;
  6279         -        esac
  6280         -        ;;
  6281         -
  6282         -      interix[[3-9]]*)
  6283         -	_LT_TAGVAR(hardcode_direct, $1)=no
  6284         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6285         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  6286         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  6287         -	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
  6288         -	# Instead, shared libraries are loaded at an image base (0x10000000 by
  6289         -	# default) and relocated if they conflict, which is a slow very memory
  6290         -	# consuming and fragmenting process.  To avoid this, we pick a random,
  6291         -	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
  6292         -	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
  6293         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  6294         -	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  6295         -	;;
  6296         -      irix5* | irix6*)
  6297         -        case $cc_basename in
  6298         -          CC*)
  6299         -	    # SGI C++
  6300         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
  6301         -
  6302         -	    # Archives containing C++ object files must be created using
  6303         -	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
  6304         -	    # necessary to make sure instantiated templates are included
  6305         -	    # in the archive.
  6306         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
  6307         -	    ;;
  6308         -          *)
  6309         -	    if test "$GXX" = yes; then
  6310         -	      if test "$with_gnu_ld" = no; then
  6311         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  6312         -	      else
  6313         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
  6314         -	      fi
  6315         -	    fi
  6316         -	    _LT_TAGVAR(link_all_deplibs, $1)=yes
  6317         -	    ;;
  6318         -        esac
  6319         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  6320         -        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6321         -        _LT_TAGVAR(inherit_rpath, $1)=yes
  6322         -        ;;
  6323         -
  6324         -      linux* | k*bsd*-gnu | kopensolaris*-gnu)
  6325         -        case $cc_basename in
  6326         -          KCC*)
  6327         -	    # Kuck and Associates, Inc. (KAI) C++ Compiler
  6328         -
  6329         -	    # KCC will only create a shared library if the output file
  6330         -	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
  6331         -	    # to its proper name (with version) after linking.
  6332         -	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  6333         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
  6334         -	    # Commands to make compiler produce verbose output that lists
  6335         -	    # what "hidden" libraries, object files and flags are used when
  6336         -	    # linking a shared library.
  6337         -	    #
  6338         -	    # There doesn't appear to be a way to prevent this compiler from
  6339         -	    # explicitly linking system object files so we need to strip them
  6340         -	    # from the output so that they don't get included in the library
  6341         -	    # dependencies.
  6342         -	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
  6343         -
  6344         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  6345         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  6346         -
  6347         -	    # Archives containing C++ object files must be created using
  6348         -	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  6349         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  6350         -	    ;;
  6351         -	  icpc* | ecpc* )
  6352         -	    # Intel C++
  6353         -	    with_gnu_ld=yes
  6354         -	    # version 8.0 and above of icpc choke on multiply defined symbols
  6355         -	    # if we add $predep_objects and $postdep_objects, however 7.1 and
  6356         -	    # earlier do not add the objects themselves.
  6357         -	    case `$CC -V 2>&1` in
  6358         -	      *"Version 7."*)
  6359         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  6360         -		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  6361         -		;;
  6362         -	      *)  # Version 8.0 or newer
  6363         -	        tmp_idyn=
  6364         -	        case $host_cpu in
  6365         -		  ia64*) tmp_idyn=' -i_dynamic';;
  6366         -		esac
  6367         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  6368         -		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  6369         -		;;
  6370         -	    esac
  6371         -	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6372         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  6373         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  6374         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  6375         -	    ;;
  6376         -          pgCC* | pgcpp*)
  6377         -            # Portland Group C++ compiler
  6378         -	    case `$CC -V` in
  6379         -	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
  6380         -	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
  6381         -		rm -rf $tpldir~
  6382         -		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
  6383         -		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
  6384         -	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
  6385         -		rm -rf $tpldir~
  6386         -		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
  6387         -		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
  6388         -		$RANLIB $oldlib'
  6389         -	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
  6390         -		rm -rf $tpldir~
  6391         -		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
  6392         -		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  6393         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
  6394         -		rm -rf $tpldir~
  6395         -		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
  6396         -		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
  6397         -	      ;;
  6398         -	    *) # Version 6 and above use weak symbols
  6399         -	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  6400         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
  6401         -	      ;;
  6402         -	    esac
  6403         -
  6404         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  6405         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  6406         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
  6407         -            ;;
  6408         -	  cxx*)
  6409         -	    # Compaq C++
  6410         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  6411         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
  6412         -
  6413         -	    runpath_var=LD_RUN_PATH
  6414         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  6415         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6416         -
  6417         -	    # Commands to make compiler produce verbose output that lists
  6418         -	    # what "hidden" libraries, object files and flags are used when
  6419         -	    # linking a shared library.
  6420         -	    #
  6421         -	    # There doesn't appear to be a way to prevent this compiler from
  6422         -	    # explicitly linking system object files so we need to strip them
  6423         -	    # from the output so that they don't get included in the library
  6424         -	    # dependencies.
  6425         -	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
  6426         -	    ;;
  6427         -	  xl* | mpixl* | bgxl*)
  6428         -	    # IBM XL 8.0 on PPC, with GNU ld
  6429         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  6430         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  6431         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  6432         -	    if test "x$supports_anon_versioning" = xyes; then
  6433         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
  6434         -		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
  6435         -		echo "local: *; };" >> $output_objdir/$libname.ver~
  6436         -		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
  6437         -	    fi
  6438         -	    ;;
  6439         -	  *)
  6440         -	    case `$CC -V 2>&1 | sed 5q` in
  6441         -	    *Sun\ C*)
  6442         -	      # Sun C++ 5.9
  6443         -	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
  6444         -	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6445         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
  6446         -	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  6447         -	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
  6448         -	      _LT_TAGVAR(compiler_needs_object, $1)=yes
  6449         -
  6450         -	      # Not sure whether something based on
  6451         -	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
  6452         -	      # would be better.
  6453         -	      output_verbose_link_cmd='func_echo_all'
  6454         -
  6455         -	      # Archives containing C++ object files must be created using
  6456         -	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
  6457         -	      # necessary to make sure instantiated templates are included
  6458         -	      # in the archive.
  6459         -	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
  6460         -	      ;;
  6461         -	    esac
  6462         -	    ;;
  6463         -	esac
  6464         -	;;
  6465         -
  6466         -      lynxos*)
  6467         -        # FIXME: insert proper C++ library support
  6468         -	_LT_TAGVAR(ld_shlibs, $1)=no
  6469         -	;;
  6470         -
  6471         -      m88k*)
  6472         -        # FIXME: insert proper C++ library support
  6473         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6474         -	;;
  6475         -
  6476         -      mvs*)
  6477         -        case $cc_basename in
  6478         -          cxx*)
  6479         -	    # FIXME: insert proper C++ library support
  6480         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6481         -	    ;;
  6482         -	  *)
  6483         -	    # FIXME: insert proper C++ library support
  6484         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6485         -	    ;;
  6486         -	esac
  6487         -	;;
  6488         -
  6489         -      netbsd*)
  6490         -        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
  6491         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
  6492         -	  wlarc=
  6493         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  6494         -	  _LT_TAGVAR(hardcode_direct, $1)=yes
  6495         -	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6496         -	fi
  6497         -	# Workaround some broken pre-1.5 toolchains
  6498         -	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
  6499         -	;;
  6500         -
  6501         -      *nto* | *qnx*)
  6502         -        _LT_TAGVAR(ld_shlibs, $1)=yes
  6503         -	;;
  6504         -
  6505         -      openbsd2*)
  6506         -        # C++ shared libraries are fairly broken
  6507         -	_LT_TAGVAR(ld_shlibs, $1)=no
  6508         -	;;
  6509         -
  6510         -      openbsd*)
  6511         -	if test -f /usr/libexec/ld.so; then
  6512         -	  _LT_TAGVAR(hardcode_direct, $1)=yes
  6513         -	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6514         -	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  6515         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  6516         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  6517         -	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  6518         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
  6519         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  6520         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  6521         -	  fi
  6522         -	  output_verbose_link_cmd=func_echo_all
  6523         -	else
  6524         -	  _LT_TAGVAR(ld_shlibs, $1)=no
  6525         -	fi
  6526         -	;;
  6527         -
  6528         -      osf3* | osf4* | osf5*)
  6529         -        case $cc_basename in
  6530         -          KCC*)
  6531         -	    # Kuck and Associates, Inc. (KAI) C++ Compiler
  6532         -
  6533         -	    # KCC will only create a shared library if the output file
  6534         -	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
  6535         -	    # to its proper name (with version) after linking.
  6536         -	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  6537         -
  6538         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  6539         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6540         -
  6541         -	    # Archives containing C++ object files must be created using
  6542         -	    # the KAI C++ compiler.
  6543         -	    case $host in
  6544         -	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
  6545         -	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
  6546         -	    esac
  6547         -	    ;;
  6548         -          RCC*)
  6549         -	    # Rational C++ 2.4.1
  6550         -	    # FIXME: insert proper C++ library support
  6551         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6552         -	    ;;
  6553         -          cxx*)
  6554         -	    case $host in
  6555         -	      osf3*)
  6556         -	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  6557         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
  6558         -	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  6559         -		;;
  6560         -	      *)
  6561         -	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  6562         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
  6563         -	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
  6564         -	          echo "-hidden">> $lib.exp~
  6565         -	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
  6566         -	          $RM $lib.exp'
  6567         -	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  6568         -		;;
  6569         -	    esac
  6570         -
  6571         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6572         -
  6573         -	    # Commands to make compiler produce verbose output that lists
  6574         -	    # what "hidden" libraries, object files and flags are used when
  6575         -	    # linking a shared library.
  6576         -	    #
  6577         -	    # There doesn't appear to be a way to prevent this compiler from
  6578         -	    # explicitly linking system object files so we need to strip them
  6579         -	    # from the output so that they don't get included in the library
  6580         -	    # dependencies.
  6581         -	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
  6582         -	    ;;
  6583         -	  *)
  6584         -	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  6585         -	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  6586         -	      case $host in
  6587         -	        osf3*)
  6588         -	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  6589         -		  ;;
  6590         -	        *)
  6591         -	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  6592         -		  ;;
  6593         -	      esac
  6594         -
  6595         -	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  6596         -	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6597         -
  6598         -	      # Commands to make compiler produce verbose output that lists
  6599         -	      # what "hidden" libraries, object files and flags are used when
  6600         -	      # linking a shared library.
  6601         -	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
  6602         -
  6603         -	    else
  6604         -	      # FIXME: insert proper C++ library support
  6605         -	      _LT_TAGVAR(ld_shlibs, $1)=no
  6606         -	    fi
  6607         -	    ;;
  6608         -        esac
  6609         -        ;;
  6610         -
  6611         -      psos*)
  6612         -        # FIXME: insert proper C++ library support
  6613         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6614         -        ;;
  6615         -
  6616         -      sunos4*)
  6617         -        case $cc_basename in
  6618         -          CC*)
  6619         -	    # Sun C++ 4.x
  6620         -	    # FIXME: insert proper C++ library support
  6621         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6622         -	    ;;
  6623         -          lcc*)
  6624         -	    # Lucid
  6625         -	    # FIXME: insert proper C++ library support
  6626         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6627         -	    ;;
  6628         -          *)
  6629         -	    # FIXME: insert proper C++ library support
  6630         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6631         -	    ;;
  6632         -        esac
  6633         -        ;;
  6634         -
  6635         -      solaris*)
  6636         -        case $cc_basename in
  6637         -          CC* | sunCC*)
  6638         -	    # Sun C++ 4.2, 5.x and Centerline C++
  6639         -            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
  6640         -	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
  6641         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6642         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  6643         -	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
  6644         -
  6645         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  6646         -	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6647         -	    case $host_os in
  6648         -	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  6649         -	      *)
  6650         -		# The compiler driver will combine and reorder linker options,
  6651         -		# but understands `-z linker_flag'.
  6652         -	        # Supported since Solaris 2.6 (maybe 2.5.1?)
  6653         -		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
  6654         -	        ;;
  6655         -	    esac
  6656         -	    _LT_TAGVAR(link_all_deplibs, $1)=yes
  6657         -
  6658         -	    output_verbose_link_cmd='func_echo_all'
  6659         -
  6660         -	    # Archives containing C++ object files must be created using
  6661         -	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
  6662         -	    # necessary to make sure instantiated templates are included
  6663         -	    # in the archive.
  6664         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
  6665         -	    ;;
  6666         -          gcx*)
  6667         -	    # Green Hills C++ Compiler
  6668         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  6669         -
  6670         -	    # The C++ compiler must be used to create the archive.
  6671         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
  6672         -	    ;;
  6673         -          *)
  6674         -	    # GNU C++ compiler with Solaris linker
  6675         -	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  6676         -	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
  6677         -	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
  6678         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  6679         -	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  6680         -		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
  6681         -
  6682         -	        # Commands to make compiler produce verbose output that lists
  6683         -	        # what "hidden" libraries, object files and flags are used when
  6684         -	        # linking a shared library.
  6685         -	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
  6686         -	      else
  6687         -	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
  6688         -	        # platform.
  6689         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  6690         -	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  6691         -		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
  6692         -
  6693         -	        # Commands to make compiler produce verbose output that lists
  6694         -	        # what "hidden" libraries, object files and flags are used when
  6695         -	        # linking a shared library.
  6696         -	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
  6697         -	      fi
  6698         -
  6699         -	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
  6700         -	      case $host_os in
  6701         -		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  6702         -		*)
  6703         -		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
  6704         -		  ;;
  6705         -	      esac
  6706         -	    fi
  6707         -	    ;;
  6708         -        esac
  6709         -        ;;
  6710         -
  6711         -    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
  6712         -      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  6713         -      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6714         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6715         -      runpath_var='LD_RUN_PATH'
  6716         -
  6717         -      case $cc_basename in
  6718         -        CC*)
  6719         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6720         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6721         -	  ;;
  6722         -	*)
  6723         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6724         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6725         -	  ;;
  6726         -      esac
  6727         -      ;;
  6728         -
  6729         -      sysv5* | sco3.2v5* | sco5v6*)
  6730         -	# Note: We can NOT use -z defs as we might desire, because we do not
  6731         -	# link with -lc, and that would cause any symbols used from libc to
  6732         -	# always be unresolved, which means just about no library would
  6733         -	# ever link correctly.  If we're not using GNU ld we use -z text
  6734         -	# though, which does catch some bad symbols but isn't as heavy-handed
  6735         -	# as -z defs.
  6736         -	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  6737         -	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
  6738         -	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6739         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6740         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
  6741         -	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  6742         -	_LT_TAGVAR(link_all_deplibs, $1)=yes
  6743         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
  6744         -	runpath_var='LD_RUN_PATH'
  6745         -
  6746         -	case $cc_basename in
  6747         -          CC*)
  6748         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6749         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6750         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
  6751         -	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
  6752         -	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
  6753         -	      '"$_LT_TAGVAR(reload_cmds, $1)"
  6754         -	    ;;
  6755         -	  *)
  6756         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6757         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6758         -	    ;;
  6759         -	esac
  6760         -      ;;
  6761         -
  6762         -      tandem*)
  6763         -        case $cc_basename in
  6764         -          NCC*)
  6765         -	    # NonStop-UX NCC 3.20
  6766         -	    # FIXME: insert proper C++ library support
  6767         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6768         -	    ;;
  6769         -          *)
  6770         -	    # FIXME: insert proper C++ library support
  6771         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6772         -	    ;;
  6773         -        esac
  6774         -        ;;
  6775         -
  6776         -      vxworks*)
  6777         -        # FIXME: insert proper C++ library support
  6778         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6779         -        ;;
  6780         -
  6781         -      *)
  6782         -        # FIXME: insert proper C++ library support
  6783         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6784         -        ;;
  6785         -    esac
  6786         -
  6787         -    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
  6788         -    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  6789         -
  6790         -    _LT_TAGVAR(GCC, $1)="$GXX"
  6791         -    _LT_TAGVAR(LD, $1)="$LD"
  6792         -
  6793         -    ## CAVEAT EMPTOR:
  6794         -    ## There is no encapsulation within the following macros, do not change
  6795         -    ## the running order or otherwise move them around unless you know exactly
  6796         -    ## what you are doing...
  6797         -    _LT_SYS_HIDDEN_LIBDEPS($1)
  6798         -    _LT_COMPILER_PIC($1)
  6799         -    _LT_COMPILER_C_O($1)
  6800         -    _LT_COMPILER_FILE_LOCKS($1)
  6801         -    _LT_LINKER_SHLIBS($1)
  6802         -    _LT_SYS_DYNAMIC_LINKER($1)
  6803         -    _LT_LINKER_HARDCODE_LIBPATH($1)
  6804         -
  6805         -    _LT_CONFIG($1)
  6806         -  fi # test -n "$compiler"
  6807         -
  6808         -  CC=$lt_save_CC
  6809         -  CFLAGS=$lt_save_CFLAGS
  6810         -  LDCXX=$LD
  6811         -  LD=$lt_save_LD
  6812         -  GCC=$lt_save_GCC
  6813         -  with_gnu_ld=$lt_save_with_gnu_ld
  6814         -  lt_cv_path_LDCXX=$lt_cv_path_LD
  6815         -  lt_cv_path_LD=$lt_save_path_LD
  6816         -  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
  6817         -  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
  6818         -fi # test "$_lt_caught_CXX_error" != yes
  6819         -
  6820         -AC_LANG_POP
  6821         -])# _LT_LANG_CXX_CONFIG
  6822         -
  6823         -
  6824         -# _LT_FUNC_STRIPNAME_CNF
  6825         -# ----------------------
  6826         -# func_stripname_cnf prefix suffix name
  6827         -# strip PREFIX and SUFFIX off of NAME.
  6828         -# PREFIX and SUFFIX must not contain globbing or regex special
  6829         -# characters, hashes, percent signs, but SUFFIX may contain a leading
  6830         -# dot (in which case that matches only a dot).
  6831         -#
  6832         -# This function is identical to the (non-XSI) version of func_stripname,
  6833         -# except this one can be used by m4 code that may be executed by configure,
  6834         -# rather than the libtool script.
  6835         -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
  6836         -AC_REQUIRE([_LT_DECL_SED])
  6837         -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
  6838         -func_stripname_cnf ()
  6839         -{
  6840         -  case ${2} in
  6841         -  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
  6842         -  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
  6843         -  esac
  6844         -} # func_stripname_cnf
  6845         -])# _LT_FUNC_STRIPNAME_CNF
  6846         -
  6847         -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
  6848         -# ---------------------------------
  6849         -# Figure out "hidden" library dependencies from verbose
  6850         -# compiler output when linking a shared library.
  6851         -# Parse the compiler output and extract the necessary
  6852         -# objects, libraries and library flags.
  6853         -m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
  6854         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  6855         -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
  6856         -# Dependencies to place before and after the object being linked:
  6857         -_LT_TAGVAR(predep_objects, $1)=
  6858         -_LT_TAGVAR(postdep_objects, $1)=
  6859         -_LT_TAGVAR(predeps, $1)=
  6860         -_LT_TAGVAR(postdeps, $1)=
  6861         -_LT_TAGVAR(compiler_lib_search_path, $1)=
  6862         -
  6863         -dnl we can't use the lt_simple_compile_test_code here,
  6864         -dnl because it contains code intended for an executable,
  6865         -dnl not a library.  It's possible we should let each
  6866         -dnl tag define a new lt_????_link_test_code variable,
  6867         -dnl but it's only used here...
  6868         -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
  6869         -int a;
  6870         -void foo (void) { a = 0; }
  6871         -_LT_EOF
  6872         -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
  6873         -class Foo
  6874         -{
  6875         -public:
  6876         -  Foo (void) { a = 0; }
  6877         -private:
  6878         -  int a;
  6879         -};
  6880         -_LT_EOF
  6881         -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
  6882         -      subroutine foo
  6883         -      implicit none
  6884         -      integer*4 a
  6885         -      a=0
  6886         -      return
  6887         -      end
  6888         -_LT_EOF
  6889         -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
  6890         -      subroutine foo
  6891         -      implicit none
  6892         -      integer a
  6893         -      a=0
  6894         -      return
  6895         -      end
  6896         -_LT_EOF
  6897         -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
  6898         -public class foo {
  6899         -  private int a;
  6900         -  public void bar (void) {
  6901         -    a = 0;
  6902         -  }
  6903         -};
  6904         -_LT_EOF
  6905         -])
  6906         -
  6907         -_lt_libdeps_save_CFLAGS=$CFLAGS
  6908         -case "$CC $CFLAGS " in #(
  6909         -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
  6910         -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
  6911         -esac
  6912         -
  6913         -dnl Parse the compiler output and extract the necessary
  6914         -dnl objects, libraries and library flags.
  6915         -if AC_TRY_EVAL(ac_compile); then
  6916         -  # Parse the compiler output and extract the necessary
  6917         -  # objects, libraries and library flags.
  6918         -
  6919         -  # Sentinel used to keep track of whether or not we are before
  6920         -  # the conftest object file.
  6921         -  pre_test_object_deps_done=no
  6922         -
  6923         -  for p in `eval "$output_verbose_link_cmd"`; do
  6924         -    case ${prev}${p} in
  6925         -
  6926         -    -L* | -R* | -l*)
  6927         -       # Some compilers place space between "-{L,R}" and the path.
  6928         -       # Remove the space.
  6929         -       if test $p = "-L" ||
  6930         -          test $p = "-R"; then
  6931         -	 prev=$p
  6932         -	 continue
  6933         -       fi
  6934         -
  6935         -       # Expand the sysroot to ease extracting the directories later.
  6936         -       if test -z "$prev"; then
  6937         -         case $p in
  6938         -         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
  6939         -         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
  6940         -         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
  6941         -         esac
  6942         -       fi
  6943         -       case $p in
  6944         -       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
  6945         -       esac
  6946         -       if test "$pre_test_object_deps_done" = no; then
  6947         -	 case ${prev} in
  6948         -	 -L | -R)
  6949         -	   # Internal compiler library paths should come after those
  6950         -	   # provided the user.  The postdeps already come after the
  6951         -	   # user supplied libs so there is no need to process them.
  6952         -	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
  6953         -	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
  6954         -	   else
  6955         -	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
  6956         -	   fi
  6957         -	   ;;
  6958         -	 # The "-l" case would never come before the object being
  6959         -	 # linked, so don't bother handling this case.
  6960         -	 esac
  6961         -       else
  6962         -	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
  6963         -	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
  6964         -	 else
  6965         -	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
  6966         -	 fi
  6967         -       fi
  6968         -       prev=
  6969         -       ;;
  6970         -
  6971         -    *.lto.$objext) ;; # Ignore GCC LTO objects
  6972         -    *.$objext)
  6973         -       # This assumes that the test object file only shows up
  6974         -       # once in the compiler output.
  6975         -       if test "$p" = "conftest.$objext"; then
  6976         -	 pre_test_object_deps_done=yes
  6977         -	 continue
  6978         -       fi
  6979         -
  6980         -       if test "$pre_test_object_deps_done" = no; then
  6981         -	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
  6982         -	   _LT_TAGVAR(predep_objects, $1)="$p"
  6983         -	 else
  6984         -	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
  6985         -	 fi
  6986         -       else
  6987         -	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
  6988         -	   _LT_TAGVAR(postdep_objects, $1)="$p"
  6989         -	 else
  6990         -	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
  6991         -	 fi
  6992         -       fi
  6993         -       ;;
  6994         -
  6995         -    *) ;; # Ignore the rest.
  6996         -
  6997         -    esac
  6998         -  done
  6999         -
  7000         -  # Clean up.
  7001         -  rm -f a.out a.exe
  7002         -else
  7003         -  echo "libtool.m4: error: problem compiling $1 test program"
  7004         -fi
  7005         -
  7006         -$RM -f confest.$objext
  7007         -CFLAGS=$_lt_libdeps_save_CFLAGS
  7008         -
  7009         -# PORTME: override above test on systems where it is broken
  7010         -m4_if([$1], [CXX],
  7011         -[case $host_os in
  7012         -interix[[3-9]]*)
  7013         -  # Interix 3.5 installs completely hosed .la files for C++, so rather than
  7014         -  # hack all around it, let's just trust "g++" to DTRT.
  7015         -  _LT_TAGVAR(predep_objects,$1)=
  7016         -  _LT_TAGVAR(postdep_objects,$1)=
  7017         -  _LT_TAGVAR(postdeps,$1)=
  7018         -  ;;
  7019         -
  7020         -linux*)
  7021         -  case `$CC -V 2>&1 | sed 5q` in
  7022         -  *Sun\ C*)
  7023         -    # Sun C++ 5.9
  7024         -
  7025         -    # The more standards-conforming stlport4 library is
  7026         -    # incompatible with the Cstd library. Avoid specifying
  7027         -    # it if it's in CXXFLAGS. Ignore libCrun as
  7028         -    # -library=stlport4 depends on it.
  7029         -    case " $CXX $CXXFLAGS " in
  7030         -    *" -library=stlport4 "*)
  7031         -      solaris_use_stlport4=yes
  7032         -      ;;
  7033         -    esac
  7034         -
  7035         -    if test "$solaris_use_stlport4" != yes; then
  7036         -      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
  7037         -    fi
  7038         -    ;;
  7039         -  esac
  7040         -  ;;
  7041         -
  7042         -solaris*)
  7043         -  case $cc_basename in
  7044         -  CC* | sunCC*)
  7045         -    # The more standards-conforming stlport4 library is
  7046         -    # incompatible with the Cstd library. Avoid specifying
  7047         -    # it if it's in CXXFLAGS. Ignore libCrun as
  7048         -    # -library=stlport4 depends on it.
  7049         -    case " $CXX $CXXFLAGS " in
  7050         -    *" -library=stlport4 "*)
  7051         -      solaris_use_stlport4=yes
  7052         -      ;;
  7053         -    esac
  7054         -
  7055         -    # Adding this requires a known-good setup of shared libraries for
  7056         -    # Sun compiler versions before 5.6, else PIC objects from an old
  7057         -    # archive will be linked into the output, leading to subtle bugs.
  7058         -    if test "$solaris_use_stlport4" != yes; then
  7059         -      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
  7060         -    fi
  7061         -    ;;
  7062         -  esac
  7063         -  ;;
  7064         -esac
  7065         -])
  7066         -
  7067         -case " $_LT_TAGVAR(postdeps, $1) " in
  7068         -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
  7069         -esac
  7070         - _LT_TAGVAR(compiler_lib_search_dirs, $1)=
  7071         -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
  7072         - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
  7073         -fi
  7074         -_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
  7075         -    [The directories searched by this compiler when creating a shared library])
  7076         -_LT_TAGDECL([], [predep_objects], [1],
  7077         -    [Dependencies to place before and after the objects being linked to
  7078         -    create a shared library])
  7079         -_LT_TAGDECL([], [postdep_objects], [1])
  7080         -_LT_TAGDECL([], [predeps], [1])
  7081         -_LT_TAGDECL([], [postdeps], [1])
  7082         -_LT_TAGDECL([], [compiler_lib_search_path], [1],
  7083         -    [The library search path used internally by the compiler when linking
  7084         -    a shared library])
  7085         -])# _LT_SYS_HIDDEN_LIBDEPS
  7086         -
  7087         -
  7088         -# _LT_LANG_F77_CONFIG([TAG])
  7089         -# --------------------------
  7090         -# Ensure that the configuration variables for a Fortran 77 compiler are
  7091         -# suitably defined.  These variables are subsequently used by _LT_CONFIG
  7092         -# to write the compiler configuration to `libtool'.
  7093         -m4_defun([_LT_LANG_F77_CONFIG],
  7094         -[AC_LANG_PUSH(Fortran 77)
  7095         -if test -z "$F77" || test "X$F77" = "Xno"; then
  7096         -  _lt_disable_F77=yes
  7097         -fi
  7098         -
  7099         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  7100         -_LT_TAGVAR(allow_undefined_flag, $1)=
  7101         -_LT_TAGVAR(always_export_symbols, $1)=no
  7102         -_LT_TAGVAR(archive_expsym_cmds, $1)=
  7103         -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
  7104         -_LT_TAGVAR(hardcode_direct, $1)=no
  7105         -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
  7106         -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  7107         -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  7108         -_LT_TAGVAR(hardcode_libdir_separator, $1)=
  7109         -_LT_TAGVAR(hardcode_minus_L, $1)=no
  7110         -_LT_TAGVAR(hardcode_automatic, $1)=no
  7111         -_LT_TAGVAR(inherit_rpath, $1)=no
  7112         -_LT_TAGVAR(module_cmds, $1)=
  7113         -_LT_TAGVAR(module_expsym_cmds, $1)=
  7114         -_LT_TAGVAR(link_all_deplibs, $1)=unknown
  7115         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  7116         -_LT_TAGVAR(reload_flag, $1)=$reload_flag
  7117         -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
  7118         -_LT_TAGVAR(no_undefined_flag, $1)=
  7119         -_LT_TAGVAR(whole_archive_flag_spec, $1)=
  7120         -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  7121         -
  7122         -# Source file extension for f77 test sources.
  7123         -ac_ext=f
  7124         -
  7125         -# Object file extension for compiled f77 test sources.
  7126         -objext=o
  7127         -_LT_TAGVAR(objext, $1)=$objext
  7128         -
  7129         -# No sense in running all these tests if we already determined that
  7130         -# the F77 compiler isn't working.  Some variables (like enable_shared)
  7131         -# are currently assumed to apply to all compilers on this platform,
  7132         -# and will be corrupted by setting them based on a non-working compiler.
  7133         -if test "$_lt_disable_F77" != yes; then
  7134         -  # Code to be used in simple compile tests
  7135         -  lt_simple_compile_test_code="\
  7136         -      subroutine t
  7137         -      return
  7138         -      end
  7139         -"
  7140         -
  7141         -  # Code to be used in simple link tests
  7142         -  lt_simple_link_test_code="\
  7143         -      program t
  7144         -      end
  7145         -"
  7146         -
  7147         -  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7148         -  _LT_TAG_COMPILER
  7149         -
  7150         -  # save warnings/boilerplate of simple test code
  7151         -  _LT_COMPILER_BOILERPLATE
  7152         -  _LT_LINKER_BOILERPLATE
  7153         -
  7154         -  # Allow CC to be a program name with arguments.
  7155         -  lt_save_CC="$CC"
  7156         -  lt_save_GCC=$GCC
  7157         -  lt_save_CFLAGS=$CFLAGS
  7158         -  CC=${F77-"f77"}
  7159         -  CFLAGS=$FFLAGS
  7160         -  compiler=$CC
  7161         -  _LT_TAGVAR(compiler, $1)=$CC
  7162         -  _LT_CC_BASENAME([$compiler])
  7163         -  GCC=$G77
  7164         -  if test -n "$compiler"; then
  7165         -    AC_MSG_CHECKING([if libtool supports shared libraries])
  7166         -    AC_MSG_RESULT([$can_build_shared])
  7167         -
  7168         -    AC_MSG_CHECKING([whether to build shared libraries])
  7169         -    test "$can_build_shared" = "no" && enable_shared=no
  7170         -
  7171         -    # On AIX, shared libraries and static libraries use the same namespace, and
  7172         -    # are all built from PIC.
  7173         -    case $host_os in
  7174         -      aix3*)
  7175         -        test "$enable_shared" = yes && enable_static=no
  7176         -        if test -n "$RANLIB"; then
  7177         -          archive_cmds="$archive_cmds~\$RANLIB \$lib"
  7178         -          postinstall_cmds='$RANLIB $lib'
  7179         -        fi
  7180         -        ;;
  7181         -      aix[[4-9]]*)
  7182         -	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  7183         -	  test "$enable_shared" = yes && enable_static=no
  7184         -	fi
  7185         -        ;;
  7186         -    esac
  7187         -    AC_MSG_RESULT([$enable_shared])
  7188         -
  7189         -    AC_MSG_CHECKING([whether to build static libraries])
  7190         -    # Make sure either enable_shared or enable_static is yes.
  7191         -    test "$enable_shared" = yes || enable_static=yes
  7192         -    AC_MSG_RESULT([$enable_static])
  7193         -
  7194         -    _LT_TAGVAR(GCC, $1)="$G77"
  7195         -    _LT_TAGVAR(LD, $1)="$LD"
  7196         -
  7197         -    ## CAVEAT EMPTOR:
  7198         -    ## There is no encapsulation within the following macros, do not change
  7199         -    ## the running order or otherwise move them around unless you know exactly
  7200         -    ## what you are doing...
  7201         -    _LT_COMPILER_PIC($1)
  7202         -    _LT_COMPILER_C_O($1)
  7203         -    _LT_COMPILER_FILE_LOCKS($1)
  7204         -    _LT_LINKER_SHLIBS($1)
  7205         -    _LT_SYS_DYNAMIC_LINKER($1)
  7206         -    _LT_LINKER_HARDCODE_LIBPATH($1)
  7207         -
  7208         -    _LT_CONFIG($1)
  7209         -  fi # test -n "$compiler"
  7210         -
  7211         -  GCC=$lt_save_GCC
  7212         -  CC="$lt_save_CC"
  7213         -  CFLAGS="$lt_save_CFLAGS"
  7214         -fi # test "$_lt_disable_F77" != yes
  7215         -
  7216         -AC_LANG_POP
  7217         -])# _LT_LANG_F77_CONFIG
  7218         -
  7219         -
  7220         -# _LT_LANG_FC_CONFIG([TAG])
  7221         -# -------------------------
  7222         -# Ensure that the configuration variables for a Fortran compiler are
  7223         -# suitably defined.  These variables are subsequently used by _LT_CONFIG
  7224         -# to write the compiler configuration to `libtool'.
  7225         -m4_defun([_LT_LANG_FC_CONFIG],
  7226         -[AC_LANG_PUSH(Fortran)
  7227         -
  7228         -if test -z "$FC" || test "X$FC" = "Xno"; then
  7229         -  _lt_disable_FC=yes
  7230         -fi
  7231         -
  7232         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  7233         -_LT_TAGVAR(allow_undefined_flag, $1)=
  7234         -_LT_TAGVAR(always_export_symbols, $1)=no
  7235         -_LT_TAGVAR(archive_expsym_cmds, $1)=
  7236         -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
  7237         -_LT_TAGVAR(hardcode_direct, $1)=no
  7238         -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
  7239         -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  7240         -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  7241         -_LT_TAGVAR(hardcode_libdir_separator, $1)=
  7242         -_LT_TAGVAR(hardcode_minus_L, $1)=no
  7243         -_LT_TAGVAR(hardcode_automatic, $1)=no
  7244         -_LT_TAGVAR(inherit_rpath, $1)=no
  7245         -_LT_TAGVAR(module_cmds, $1)=
  7246         -_LT_TAGVAR(module_expsym_cmds, $1)=
  7247         -_LT_TAGVAR(link_all_deplibs, $1)=unknown
  7248         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  7249         -_LT_TAGVAR(reload_flag, $1)=$reload_flag
  7250         -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
  7251         -_LT_TAGVAR(no_undefined_flag, $1)=
  7252         -_LT_TAGVAR(whole_archive_flag_spec, $1)=
  7253         -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  7254         -
  7255         -# Source file extension for fc test sources.
  7256         -ac_ext=${ac_fc_srcext-f}
  7257         -
  7258         -# Object file extension for compiled fc test sources.
  7259         -objext=o
  7260         -_LT_TAGVAR(objext, $1)=$objext
  7261         -
  7262         -# No sense in running all these tests if we already determined that
  7263         -# the FC compiler isn't working.  Some variables (like enable_shared)
  7264         -# are currently assumed to apply to all compilers on this platform,
  7265         -# and will be corrupted by setting them based on a non-working compiler.
  7266         -if test "$_lt_disable_FC" != yes; then
  7267         -  # Code to be used in simple compile tests
  7268         -  lt_simple_compile_test_code="\
  7269         -      subroutine t
  7270         -      return
  7271         -      end
  7272         -"
  7273         -
  7274         -  # Code to be used in simple link tests
  7275         -  lt_simple_link_test_code="\
  7276         -      program t
  7277         -      end
  7278         -"
  7279         -
  7280         -  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7281         -  _LT_TAG_COMPILER
  7282         -
  7283         -  # save warnings/boilerplate of simple test code
  7284         -  _LT_COMPILER_BOILERPLATE
  7285         -  _LT_LINKER_BOILERPLATE
  7286         -
  7287         -  # Allow CC to be a program name with arguments.
  7288         -  lt_save_CC="$CC"
  7289         -  lt_save_GCC=$GCC
  7290         -  lt_save_CFLAGS=$CFLAGS
  7291         -  CC=${FC-"f95"}
  7292         -  CFLAGS=$FCFLAGS
  7293         -  compiler=$CC
  7294         -  GCC=$ac_cv_fc_compiler_gnu
  7295         -
  7296         -  _LT_TAGVAR(compiler, $1)=$CC
  7297         -  _LT_CC_BASENAME([$compiler])
  7298         -
  7299         -  if test -n "$compiler"; then
  7300         -    AC_MSG_CHECKING([if libtool supports shared libraries])
  7301         -    AC_MSG_RESULT([$can_build_shared])
  7302         -
  7303         -    AC_MSG_CHECKING([whether to build shared libraries])
  7304         -    test "$can_build_shared" = "no" && enable_shared=no
  7305         -
  7306         -    # On AIX, shared libraries and static libraries use the same namespace, and
  7307         -    # are all built from PIC.
  7308         -    case $host_os in
  7309         -      aix3*)
  7310         -        test "$enable_shared" = yes && enable_static=no
  7311         -        if test -n "$RANLIB"; then
  7312         -          archive_cmds="$archive_cmds~\$RANLIB \$lib"
  7313         -          postinstall_cmds='$RANLIB $lib'
  7314         -        fi
  7315         -        ;;
  7316         -      aix[[4-9]]*)
  7317         -	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  7318         -	  test "$enable_shared" = yes && enable_static=no
  7319         -	fi
  7320         -        ;;
  7321         -    esac
  7322         -    AC_MSG_RESULT([$enable_shared])
  7323         -
  7324         -    AC_MSG_CHECKING([whether to build static libraries])
  7325         -    # Make sure either enable_shared or enable_static is yes.
  7326         -    test "$enable_shared" = yes || enable_static=yes
  7327         -    AC_MSG_RESULT([$enable_static])
  7328         -
  7329         -    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
  7330         -    _LT_TAGVAR(LD, $1)="$LD"
  7331         -
  7332         -    ## CAVEAT EMPTOR:
  7333         -    ## There is no encapsulation within the following macros, do not change
  7334         -    ## the running order or otherwise move them around unless you know exactly
  7335         -    ## what you are doing...
  7336         -    _LT_SYS_HIDDEN_LIBDEPS($1)
  7337         -    _LT_COMPILER_PIC($1)
  7338         -    _LT_COMPILER_C_O($1)
  7339         -    _LT_COMPILER_FILE_LOCKS($1)
  7340         -    _LT_LINKER_SHLIBS($1)
  7341         -    _LT_SYS_DYNAMIC_LINKER($1)
  7342         -    _LT_LINKER_HARDCODE_LIBPATH($1)
  7343         -
  7344         -    _LT_CONFIG($1)
  7345         -  fi # test -n "$compiler"
  7346         -
  7347         -  GCC=$lt_save_GCC
  7348         -  CC=$lt_save_CC
  7349         -  CFLAGS=$lt_save_CFLAGS
  7350         -fi # test "$_lt_disable_FC" != yes
  7351         -
  7352         -AC_LANG_POP
  7353         -])# _LT_LANG_FC_CONFIG
  7354         -
  7355         -
  7356         -# _LT_LANG_GCJ_CONFIG([TAG])
  7357         -# --------------------------
  7358         -# Ensure that the configuration variables for the GNU Java Compiler compiler
  7359         -# are suitably defined.  These variables are subsequently used by _LT_CONFIG
  7360         -# to write the compiler configuration to `libtool'.
  7361         -m4_defun([_LT_LANG_GCJ_CONFIG],
  7362         -[AC_REQUIRE([LT_PROG_GCJ])dnl
  7363         -AC_LANG_SAVE
  7364         -
  7365         -# Source file extension for Java test sources.
  7366         -ac_ext=java
  7367         -
  7368         -# Object file extension for compiled Java test sources.
  7369         -objext=o
  7370         -_LT_TAGVAR(objext, $1)=$objext
  7371         -
  7372         -# Code to be used in simple compile tests
  7373         -lt_simple_compile_test_code="class foo {}"
  7374         -
  7375         -# Code to be used in simple link tests
  7376         -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
  7377         -
  7378         -# ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7379         -_LT_TAG_COMPILER
  7380         -
  7381         -# save warnings/boilerplate of simple test code
  7382         -_LT_COMPILER_BOILERPLATE
  7383         -_LT_LINKER_BOILERPLATE
  7384         -
  7385         -# Allow CC to be a program name with arguments.
  7386         -lt_save_CC=$CC
  7387         -lt_save_CFLAGS=$CFLAGS
  7388         -lt_save_GCC=$GCC
  7389         -GCC=yes
  7390         -CC=${GCJ-"gcj"}
  7391         -CFLAGS=$GCJFLAGS
  7392         -compiler=$CC
  7393         -_LT_TAGVAR(compiler, $1)=$CC
  7394         -_LT_TAGVAR(LD, $1)="$LD"
  7395         -_LT_CC_BASENAME([$compiler])
  7396         -
  7397         -# GCJ did not exist at the time GCC didn't implicitly link libc in.
  7398         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  7399         -
  7400         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  7401         -_LT_TAGVAR(reload_flag, $1)=$reload_flag
  7402         -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
  7403         -
  7404         -## CAVEAT EMPTOR:
  7405         -## There is no encapsulation within the following macros, do not change
  7406         -## the running order or otherwise move them around unless you know exactly
  7407         -## what you are doing...
  7408         -if test -n "$compiler"; then
  7409         -  _LT_COMPILER_NO_RTTI($1)
  7410         -  _LT_COMPILER_PIC($1)
  7411         -  _LT_COMPILER_C_O($1)
  7412         -  _LT_COMPILER_FILE_LOCKS($1)
  7413         -  _LT_LINKER_SHLIBS($1)
  7414         -  _LT_LINKER_HARDCODE_LIBPATH($1)
  7415         -
  7416         -  _LT_CONFIG($1)
  7417         -fi
  7418         -
  7419         -AC_LANG_RESTORE
  7420         -
  7421         -GCC=$lt_save_GCC
  7422         -CC=$lt_save_CC
  7423         -CFLAGS=$lt_save_CFLAGS
  7424         -])# _LT_LANG_GCJ_CONFIG
  7425         -
  7426         -
  7427         -# _LT_LANG_RC_CONFIG([TAG])
  7428         -# -------------------------
  7429         -# Ensure that the configuration variables for the Windows resource compiler
  7430         -# are suitably defined.  These variables are subsequently used by _LT_CONFIG
  7431         -# to write the compiler configuration to `libtool'.
  7432         -m4_defun([_LT_LANG_RC_CONFIG],
  7433         -[AC_REQUIRE([LT_PROG_RC])dnl
  7434         -AC_LANG_SAVE
  7435         -
  7436         -# Source file extension for RC test sources.
  7437         -ac_ext=rc
  7438         -
  7439         -# Object file extension for compiled RC test sources.
  7440         -objext=o
  7441         -_LT_TAGVAR(objext, $1)=$objext
  7442         -
  7443         -# Code to be used in simple compile tests
  7444         -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
  7445         -
  7446         -# Code to be used in simple link tests
  7447         -lt_simple_link_test_code="$lt_simple_compile_test_code"
  7448         -
  7449         -# ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7450         -_LT_TAG_COMPILER
  7451         -
  7452         -# save warnings/boilerplate of simple test code
  7453         -_LT_COMPILER_BOILERPLATE
  7454         -_LT_LINKER_BOILERPLATE
  7455         -
  7456         -# Allow CC to be a program name with arguments.
  7457         -lt_save_CC="$CC"
  7458         -lt_save_CFLAGS=$CFLAGS
  7459         -lt_save_GCC=$GCC
  7460         -GCC=
  7461         -CC=${RC-"windres"}
  7462         -CFLAGS=
  7463         -compiler=$CC
  7464         -_LT_TAGVAR(compiler, $1)=$CC
  7465         -_LT_CC_BASENAME([$compiler])
  7466         -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  7467         -
  7468         -if test -n "$compiler"; then
  7469         -  :
  7470         -  _LT_CONFIG($1)
  7471         -fi
  7472         -
  7473         -GCC=$lt_save_GCC
  7474         -AC_LANG_RESTORE
  7475         -CC=$lt_save_CC
  7476         -CFLAGS=$lt_save_CFLAGS
  7477         -])# _LT_LANG_RC_CONFIG
  7478         -
  7479         -
  7480         -# LT_PROG_GCJ
  7481         -# -----------
  7482         -AC_DEFUN([LT_PROG_GCJ],
  7483         -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
  7484         -  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
  7485         -    [AC_CHECK_TOOL(GCJ, gcj,)
  7486         -      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
  7487         -      AC_SUBST(GCJFLAGS)])])[]dnl
  7488         -])
  7489         -
  7490         -# Old name:
  7491         -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
  7492         -dnl aclocal-1.4 backwards compatibility:
  7493         -dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
  7494         -
  7495         -
  7496         -# LT_PROG_RC
  7497         -# ----------
  7498         -AC_DEFUN([LT_PROG_RC],
  7499         -[AC_CHECK_TOOL(RC, windres,)
  7500         -])
  7501         -
  7502         -# Old name:
  7503         -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
  7504         -dnl aclocal-1.4 backwards compatibility:
  7505         -dnl AC_DEFUN([LT_AC_PROG_RC], [])
  7506         -
  7507         -
  7508         -# _LT_DECL_EGREP
  7509         -# --------------
  7510         -# If we don't have a new enough Autoconf to choose the best grep
  7511         -# available, choose the one first in the user's PATH.
  7512         -m4_defun([_LT_DECL_EGREP],
  7513         -[AC_REQUIRE([AC_PROG_EGREP])dnl
  7514         -AC_REQUIRE([AC_PROG_FGREP])dnl
  7515         -test -z "$GREP" && GREP=grep
  7516         -_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
  7517         -_LT_DECL([], [EGREP], [1], [An ERE matcher])
  7518         -_LT_DECL([], [FGREP], [1], [A literal string matcher])
  7519         -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
  7520         -AC_SUBST([GREP])
  7521         -])
  7522         -
  7523         -
  7524         -# _LT_DECL_OBJDUMP
  7525         -# --------------
  7526         -# If we don't have a new enough Autoconf to choose the best objdump
  7527         -# available, choose the one first in the user's PATH.
  7528         -m4_defun([_LT_DECL_OBJDUMP],
  7529         -[AC_CHECK_TOOL(OBJDUMP, objdump, false)
  7530         -test -z "$OBJDUMP" && OBJDUMP=objdump
  7531         -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
  7532         -AC_SUBST([OBJDUMP])
  7533         -])
  7534         -
  7535         -# _LT_DECL_DLLTOOL
  7536         -# ----------------
  7537         -# Ensure DLLTOOL variable is set.
  7538         -m4_defun([_LT_DECL_DLLTOOL],
  7539         -[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  7540         -test -z "$DLLTOOL" && DLLTOOL=dlltool
  7541         -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
  7542         -AC_SUBST([DLLTOOL])
  7543         -])
  7544         -
  7545         -# _LT_DECL_SED
  7546         -# ------------
  7547         -# Check for a fully-functional sed program, that truncates
  7548         -# as few characters as possible.  Prefer GNU sed if found.
  7549         -m4_defun([_LT_DECL_SED],
  7550         -[AC_PROG_SED
  7551         -test -z "$SED" && SED=sed
  7552         -Xsed="$SED -e 1s/^X//"
  7553         -_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
  7554         -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
  7555         -    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
  7556         -])# _LT_DECL_SED
  7557         -
  7558         -m4_ifndef([AC_PROG_SED], [
  7559         -############################################################
  7560         -# NOTE: This macro has been submitted for inclusion into   #
  7561         -#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
  7562         -#  a released version of Autoconf we should remove this    #
  7563         -#  macro and use it instead.                               #
  7564         -############################################################
  7565         -
  7566         -m4_defun([AC_PROG_SED],
  7567         -[AC_MSG_CHECKING([for a sed that does not truncate output])
  7568         -AC_CACHE_VAL(lt_cv_path_SED,
  7569         -[# Loop through the user's path and test for sed and gsed.
  7570         -# Then use that list of sed's as ones to test for truncation.
  7571         -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  7572         -for as_dir in $PATH
  7573         -do
  7574         -  IFS=$as_save_IFS
  7575         -  test -z "$as_dir" && as_dir=.
  7576         -  for lt_ac_prog in sed gsed; do
  7577         -    for ac_exec_ext in '' $ac_executable_extensions; do
  7578         -      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
  7579         -        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
  7580         -      fi
  7581         -    done
  7582         -  done
  7583         -done
  7584         -IFS=$as_save_IFS
  7585         -lt_ac_max=0
  7586         -lt_ac_count=0
  7587         -# Add /usr/xpg4/bin/sed as it is typically found on Solaris
  7588         -# along with /bin/sed that truncates output.
  7589         -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
  7590         -  test ! -f $lt_ac_sed && continue
  7591         -  cat /dev/null > conftest.in
  7592         -  lt_ac_count=0
  7593         -  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
  7594         -  # Check for GNU sed and select it if it is found.
  7595         -  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
  7596         -    lt_cv_path_SED=$lt_ac_sed
  7597         -    break
  7598         -  fi
  7599         -  while true; do
  7600         -    cat conftest.in conftest.in >conftest.tmp
  7601         -    mv conftest.tmp conftest.in
  7602         -    cp conftest.in conftest.nl
  7603         -    echo >>conftest.nl
  7604         -    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
  7605         -    cmp -s conftest.out conftest.nl || break
  7606         -    # 10000 chars as input seems more than enough
  7607         -    test $lt_ac_count -gt 10 && break
  7608         -    lt_ac_count=`expr $lt_ac_count + 1`
  7609         -    if test $lt_ac_count -gt $lt_ac_max; then
  7610         -      lt_ac_max=$lt_ac_count
  7611         -      lt_cv_path_SED=$lt_ac_sed
  7612         -    fi
  7613         -  done
  7614         -done
  7615         -])
  7616         -SED=$lt_cv_path_SED
  7617         -AC_SUBST([SED])
  7618         -AC_MSG_RESULT([$SED])
  7619         -])#AC_PROG_SED
  7620         -])#m4_ifndef
  7621         -
  7622         -# Old name:
  7623         -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
  7624         -dnl aclocal-1.4 backwards compatibility:
  7625         -dnl AC_DEFUN([LT_AC_PROG_SED], [])
  7626         -
  7627         -
  7628         -# _LT_CHECK_SHELL_FEATURES
  7629         -# ------------------------
  7630         -# Find out whether the shell is Bourne or XSI compatible,
  7631         -# or has some other useful features.
  7632         -m4_defun([_LT_CHECK_SHELL_FEATURES],
  7633         -[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
  7634         -# Try some XSI features
  7635         -xsi_shell=no
  7636         -( _lt_dummy="a/b/c"
  7637         -  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
  7638         -      = c,a/b,b/c, \
  7639         -    && eval 'test $(( 1 + 1 )) -eq 2 \
  7640         -    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
  7641         -  && xsi_shell=yes
  7642         -AC_MSG_RESULT([$xsi_shell])
  7643         -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
  7644         -
  7645         -AC_MSG_CHECKING([whether the shell understands "+="])
  7646         -lt_shell_append=no
  7647         -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
  7648         -    >/dev/null 2>&1 \
  7649         -  && lt_shell_append=yes
  7650         -AC_MSG_RESULT([$lt_shell_append])
  7651         -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
  7652         -
  7653         -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  7654         -  lt_unset=unset
  7655         -else
  7656         -  lt_unset=false
  7657         -fi
  7658         -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
  7659         -
  7660         -# test EBCDIC or ASCII
  7661         -case `echo X|tr X '\101'` in
  7662         - A) # ASCII based system
  7663         -    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
  7664         -  lt_SP2NL='tr \040 \012'
  7665         -  lt_NL2SP='tr \015\012 \040\040'
  7666         -  ;;
  7667         - *) # EBCDIC based system
  7668         -  lt_SP2NL='tr \100 \n'
  7669         -  lt_NL2SP='tr \r\n \100\100'
  7670         -  ;;
  7671         -esac
  7672         -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
  7673         -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
  7674         -])# _LT_CHECK_SHELL_FEATURES
  7675         -
  7676         -
  7677         -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
  7678         -# ------------------------------------------------------
  7679         -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
  7680         -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
  7681         -m4_defun([_LT_PROG_FUNCTION_REPLACE],
  7682         -[dnl {
  7683         -sed -e '/^$1 ()$/,/^} # $1 /c\
  7684         -$1 ()\
  7685         -{\
  7686         -m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
  7687         -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
  7688         -  && mv -f "$cfgfile.tmp" "$cfgfile" \
  7689         -    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
  7690         -test 0 -eq $? || _lt_function_replace_fail=:
  7691         -])
  7692         -
  7693         -
  7694         -# _LT_PROG_REPLACE_SHELLFNS
  7695         -# -------------------------
  7696         -# Replace existing portable implementations of several shell functions with
  7697         -# equivalent extended shell implementations where those features are available..
  7698         -m4_defun([_LT_PROG_REPLACE_SHELLFNS],
  7699         -[if test x"$xsi_shell" = xyes; then
  7700         -  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
  7701         -    case ${1} in
  7702         -      */*) func_dirname_result="${1%/*}${2}" ;;
  7703         -      *  ) func_dirname_result="${3}" ;;
  7704         -    esac])
  7705         -
  7706         -  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
  7707         -    func_basename_result="${1##*/}"])
  7708         -
  7709         -  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
  7710         -    case ${1} in
  7711         -      */*) func_dirname_result="${1%/*}${2}" ;;
  7712         -      *  ) func_dirname_result="${3}" ;;
  7713         -    esac
  7714         -    func_basename_result="${1##*/}"])
  7715         -
  7716         -  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
  7717         -    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  7718         -    # positional parameters, so assign one to ordinary parameter first.
  7719         -    func_stripname_result=${3}
  7720         -    func_stripname_result=${func_stripname_result#"${1}"}
  7721         -    func_stripname_result=${func_stripname_result%"${2}"}])
  7722         -
  7723         -  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
  7724         -    func_split_long_opt_name=${1%%=*}
  7725         -    func_split_long_opt_arg=${1#*=}])
  7726         -
  7727         -  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
  7728         -    func_split_short_opt_arg=${1#??}
  7729         -    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
  7730         -
  7731         -  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
  7732         -    case ${1} in
  7733         -      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
  7734         -      *)    func_lo2o_result=${1} ;;
  7735         -    esac])
  7736         -
  7737         -  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
  7738         -
  7739         -  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
  7740         -
  7741         -  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
  7742         -fi
  7743         -
  7744         -if test x"$lt_shell_append" = xyes; then
  7745         -  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
  7746         -
  7747         -  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
  7748         -    func_quote_for_eval "${2}"
  7749         -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
  7750         -    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
  7751         -
  7752         -  # Save a `func_append' function call where possible by direct use of '+='
  7753         -  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
  7754         -    && mv -f "$cfgfile.tmp" "$cfgfile" \
  7755         -      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
  7756         -  test 0 -eq $? || _lt_function_replace_fail=:
  7757         -else
  7758         -  # Save a `func_append' function call even when '+=' is not available
  7759         -  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
  7760         -    && mv -f "$cfgfile.tmp" "$cfgfile" \
  7761         -      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
  7762         -  test 0 -eq $? || _lt_function_replace_fail=:
  7763         -fi
  7764         -
  7765         -if test x"$_lt_function_replace_fail" = x":"; then
  7766         -  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
  7767         -fi
  7768         -])
  7769         -
  7770         -# _LT_PATH_CONVERSION_FUNCTIONS
  7771         -# -----------------------------
  7772         -# Determine which file name conversion functions should be used by
  7773         -# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
  7774         -# for certain cross-compile configurations and native mingw.
  7775         -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
  7776         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7777         -AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  7778         -AC_MSG_CHECKING([how to convert $build file names to $host format])
  7779         -AC_CACHE_VAL(lt_cv_to_host_file_cmd,
  7780         -[case $host in
  7781         -  *-*-mingw* )
  7782         -    case $build in
  7783         -      *-*-mingw* ) # actually msys
  7784         -        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
  7785         -        ;;
  7786         -      *-*-cygwin* )
  7787         -        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
  7788         -        ;;
  7789         -      * ) # otherwise, assume *nix
  7790         -        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
  7791         -        ;;
  7792         -    esac
  7793         -    ;;
  7794         -  *-*-cygwin* )
  7795         -    case $build in
  7796         -      *-*-mingw* ) # actually msys
  7797         -        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
  7798         -        ;;
  7799         -      *-*-cygwin* )
  7800         -        lt_cv_to_host_file_cmd=func_convert_file_noop
  7801         -        ;;
  7802         -      * ) # otherwise, assume *nix
  7803         -        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
  7804         -        ;;
  7805         -    esac
  7806         -    ;;
  7807         -  * ) # unhandled hosts (and "normal" native builds)
  7808         -    lt_cv_to_host_file_cmd=func_convert_file_noop
  7809         -    ;;
  7810         -esac
  7811         -])
  7812         -to_host_file_cmd=$lt_cv_to_host_file_cmd
  7813         -AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
  7814         -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
  7815         -         [0], [convert $build file names to $host format])dnl
  7816         -
  7817         -AC_MSG_CHECKING([how to convert $build file names to toolchain format])
  7818         -AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
  7819         -[#assume ordinary cross tools, or native build.
  7820         -lt_cv_to_tool_file_cmd=func_convert_file_noop
  7821         -case $host in
  7822         -  *-*-mingw* )
  7823         -    case $build in
  7824         -      *-*-mingw* ) # actually msys
  7825         -        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
  7826         -        ;;
  7827         -    esac
  7828         -    ;;
  7829         -esac
  7830         -])
  7831         -to_tool_file_cmd=$lt_cv_to_tool_file_cmd
  7832         -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
  7833         -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
  7834         -         [0], [convert $build files to toolchain format])dnl
  7835         -])# _LT_PATH_CONVERSION_FUNCTIONS

Deleted m4/ltoptions.m4.

     1         -# Helper functions for option handling.                    -*- Autoconf -*-
     2         -#
     3         -#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
     4         -#   Inc.
     5         -#   Written by Gary V. Vaughan, 2004
     6         -#
     7         -# This file is free software; the Free Software Foundation gives
     8         -# unlimited permission to copy and/or distribute it, with or without
     9         -# modifications, as long as this notice is preserved.
    10         -
    11         -# serial 7 ltoptions.m4
    12         -
    13         -# This is to help aclocal find these macros, as it can't see m4_define.
    14         -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
    15         -
    16         -
    17         -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
    18         -# ------------------------------------------
    19         -m4_define([_LT_MANGLE_OPTION],
    20         -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
    21         -
    22         -
    23         -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
    24         -# ---------------------------------------
    25         -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
    26         -# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
    27         -# saved as a flag.
    28         -m4_define([_LT_SET_OPTION],
    29         -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
    30         -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
    31         -        _LT_MANGLE_DEFUN([$1], [$2]),
    32         -    [m4_warning([Unknown $1 option `$2'])])[]dnl
    33         -])
    34         -
    35         -
    36         -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
    37         -# ------------------------------------------------------------
    38         -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
    39         -m4_define([_LT_IF_OPTION],
    40         -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
    41         -
    42         -
    43         -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
    44         -# -------------------------------------------------------
    45         -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
    46         -# are set.
    47         -m4_define([_LT_UNLESS_OPTIONS],
    48         -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
    49         -	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
    50         -		      [m4_define([$0_found])])])[]dnl
    51         -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
    52         -])[]dnl
    53         -])
    54         -
    55         -
    56         -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
    57         -# ----------------------------------------
    58         -# OPTION-LIST is a space-separated list of Libtool options associated
    59         -# with MACRO-NAME.  If any OPTION has a matching handler declared with
    60         -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
    61         -# the unknown option and exit.
    62         -m4_defun([_LT_SET_OPTIONS],
    63         -[# Set options
    64         -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
    65         -    [_LT_SET_OPTION([$1], _LT_Option)])
    66         -
    67         -m4_if([$1],[LT_INIT],[
    68         -  dnl
    69         -  dnl Simply set some default values (i.e off) if boolean options were not
    70         -  dnl specified:
    71         -  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
    72         -  ])
    73         -  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
    74         -  ])
    75         -  dnl
    76         -  dnl If no reference was made to various pairs of opposing options, then
    77         -  dnl we run the default mode handler for the pair.  For example, if neither
    78         -  dnl `shared' nor `disable-shared' was passed, we enable building of shared
    79         -  dnl archives by default:
    80         -  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
    81         -  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
    82         -  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
    83         -  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
    84         -  		   [_LT_ENABLE_FAST_INSTALL])
    85         -  ])
    86         -])# _LT_SET_OPTIONS
    87         -
    88         -
    89         -## --------------------------------- ##
    90         -## Macros to handle LT_INIT options. ##
    91         -## --------------------------------- ##
    92         -
    93         -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
    94         -# -----------------------------------------
    95         -m4_define([_LT_MANGLE_DEFUN],
    96         -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
    97         -
    98         -
    99         -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
   100         -# -----------------------------------------------
   101         -m4_define([LT_OPTION_DEFINE],
   102         -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
   103         -])# LT_OPTION_DEFINE
   104         -
   105         -
   106         -# dlopen
   107         -# ------
   108         -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
   109         -])
   110         -
   111         -AU_DEFUN([AC_LIBTOOL_DLOPEN],
   112         -[_LT_SET_OPTION([LT_INIT], [dlopen])
   113         -AC_DIAGNOSE([obsolete],
   114         -[$0: Remove this warning and the call to _LT_SET_OPTION when you
   115         -put the `dlopen' option into LT_INIT's first parameter.])
   116         -])
   117         -
   118         -dnl aclocal-1.4 backwards compatibility:
   119         -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
   120         -
   121         -
   122         -# win32-dll
   123         -# ---------
   124         -# Declare package support for building win32 dll's.
   125         -LT_OPTION_DEFINE([LT_INIT], [win32-dll],
   126         -[enable_win32_dll=yes
   127         -
   128         -case $host in
   129         -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
   130         -  AC_CHECK_TOOL(AS, as, false)
   131         -  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   132         -  AC_CHECK_TOOL(OBJDUMP, objdump, false)
   133         -  ;;
   134         -esac
   135         -
   136         -test -z "$AS" && AS=as
   137         -_LT_DECL([], [AS],      [1], [Assembler program])dnl
   138         -
   139         -test -z "$DLLTOOL" && DLLTOOL=dlltool
   140         -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
   141         -
   142         -test -z "$OBJDUMP" && OBJDUMP=objdump
   143         -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
   144         -])# win32-dll
   145         -
   146         -AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
   147         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
   148         -_LT_SET_OPTION([LT_INIT], [win32-dll])
   149         -AC_DIAGNOSE([obsolete],
   150         -[$0: Remove this warning and the call to _LT_SET_OPTION when you
   151         -put the `win32-dll' option into LT_INIT's first parameter.])
   152         -])
   153         -
   154         -dnl aclocal-1.4 backwards compatibility:
   155         -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
   156         -
   157         -
   158         -# _LT_ENABLE_SHARED([DEFAULT])
   159         -# ----------------------------
   160         -# implement the --enable-shared flag, and supports the `shared' and
   161         -# `disable-shared' LT_INIT options.
   162         -# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
   163         -m4_define([_LT_ENABLE_SHARED],
   164         -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
   165         -AC_ARG_ENABLE([shared],
   166         -    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
   167         -	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
   168         -    [p=${PACKAGE-default}
   169         -    case $enableval in
   170         -    yes) enable_shared=yes ;;
   171         -    no) enable_shared=no ;;
   172         -    *)
   173         -      enable_shared=no
   174         -      # Look at the argument we got.  We use all the common list separators.
   175         -      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
   176         -      for pkg in $enableval; do
   177         -	IFS="$lt_save_ifs"
   178         -	if test "X$pkg" = "X$p"; then
   179         -	  enable_shared=yes
   180         -	fi
   181         -      done
   182         -      IFS="$lt_save_ifs"
   183         -      ;;
   184         -    esac],
   185         -    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
   186         -
   187         -    _LT_DECL([build_libtool_libs], [enable_shared], [0],
   188         -	[Whether or not to build shared libraries])
   189         -])# _LT_ENABLE_SHARED
   190         -
   191         -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
   192         -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
   193         -
   194         -# Old names:
   195         -AC_DEFUN([AC_ENABLE_SHARED],
   196         -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
   197         -])
   198         -
   199         -AC_DEFUN([AC_DISABLE_SHARED],
   200         -[_LT_SET_OPTION([LT_INIT], [disable-shared])
   201         -])
   202         -
   203         -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
   204         -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
   205         -
   206         -dnl aclocal-1.4 backwards compatibility:
   207         -dnl AC_DEFUN([AM_ENABLE_SHARED], [])
   208         -dnl AC_DEFUN([AM_DISABLE_SHARED], [])
   209         -
   210         -
   211         -
   212         -# _LT_ENABLE_STATIC([DEFAULT])
   213         -# ----------------------------
   214         -# implement the --enable-static flag, and support the `static' and
   215         -# `disable-static' LT_INIT options.
   216         -# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
   217         -m4_define([_LT_ENABLE_STATIC],
   218         -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
   219         -AC_ARG_ENABLE([static],
   220         -    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
   221         -	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
   222         -    [p=${PACKAGE-default}
   223         -    case $enableval in
   224         -    yes) enable_static=yes ;;
   225         -    no) enable_static=no ;;
   226         -    *)
   227         -     enable_static=no
   228         -      # Look at the argument we got.  We use all the common list separators.
   229         -      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
   230         -      for pkg in $enableval; do
   231         -	IFS="$lt_save_ifs"
   232         -	if test "X$pkg" = "X$p"; then
   233         -	  enable_static=yes
   234         -	fi
   235         -      done
   236         -      IFS="$lt_save_ifs"
   237         -      ;;
   238         -    esac],
   239         -    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
   240         -
   241         -    _LT_DECL([build_old_libs], [enable_static], [0],
   242         -	[Whether or not to build static libraries])
   243         -])# _LT_ENABLE_STATIC
   244         -
   245         -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
   246         -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
   247         -
   248         -# Old names:
   249         -AC_DEFUN([AC_ENABLE_STATIC],
   250         -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
   251         -])
   252         -
   253         -AC_DEFUN([AC_DISABLE_STATIC],
   254         -[_LT_SET_OPTION([LT_INIT], [disable-static])
   255         -])
   256         -
   257         -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
   258         -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
   259         -
   260         -dnl aclocal-1.4 backwards compatibility:
   261         -dnl AC_DEFUN([AM_ENABLE_STATIC], [])
   262         -dnl AC_DEFUN([AM_DISABLE_STATIC], [])
   263         -
   264         -
   265         -
   266         -# _LT_ENABLE_FAST_INSTALL([DEFAULT])
   267         -# ----------------------------------
   268         -# implement the --enable-fast-install flag, and support the `fast-install'
   269         -# and `disable-fast-install' LT_INIT options.
   270         -# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
   271         -m4_define([_LT_ENABLE_FAST_INSTALL],
   272         -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
   273         -AC_ARG_ENABLE([fast-install],
   274         -    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
   275         -    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
   276         -    [p=${PACKAGE-default}
   277         -    case $enableval in
   278         -    yes) enable_fast_install=yes ;;
   279         -    no) enable_fast_install=no ;;
   280         -    *)
   281         -      enable_fast_install=no
   282         -      # Look at the argument we got.  We use all the common list separators.
   283         -      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
   284         -      for pkg in $enableval; do
   285         -	IFS="$lt_save_ifs"
   286         -	if test "X$pkg" = "X$p"; then
   287         -	  enable_fast_install=yes
   288         -	fi
   289         -      done
   290         -      IFS="$lt_save_ifs"
   291         -      ;;
   292         -    esac],
   293         -    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
   294         -
   295         -_LT_DECL([fast_install], [enable_fast_install], [0],
   296         -	 [Whether or not to optimize for fast installation])dnl
   297         -])# _LT_ENABLE_FAST_INSTALL
   298         -
   299         -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
   300         -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
   301         -
   302         -# Old names:
   303         -AU_DEFUN([AC_ENABLE_FAST_INSTALL],
   304         -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
   305         -AC_DIAGNOSE([obsolete],
   306         -[$0: Remove this warning and the call to _LT_SET_OPTION when you put
   307         -the `fast-install' option into LT_INIT's first parameter.])
   308         -])
   309         -
   310         -AU_DEFUN([AC_DISABLE_FAST_INSTALL],
   311         -[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
   312         -AC_DIAGNOSE([obsolete],
   313         -[$0: Remove this warning and the call to _LT_SET_OPTION when you put
   314         -the `disable-fast-install' option into LT_INIT's first parameter.])
   315         -])
   316         -
   317         -dnl aclocal-1.4 backwards compatibility:
   318         -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
   319         -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
   320         -
   321         -
   322         -# _LT_WITH_PIC([MODE])
   323         -# --------------------
   324         -# implement the --with-pic flag, and support the `pic-only' and `no-pic'
   325         -# LT_INIT options.
   326         -# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
   327         -m4_define([_LT_WITH_PIC],
   328         -[AC_ARG_WITH([pic],
   329         -    [AS_HELP_STRING([--with-pic],
   330         -	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
   331         -    [pic_mode="$withval"],
   332         -    [pic_mode=default])
   333         -
   334         -test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
   335         -
   336         -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
   337         -])# _LT_WITH_PIC
   338         -
   339         -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
   340         -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
   341         -
   342         -# Old name:
   343         -AU_DEFUN([AC_LIBTOOL_PICMODE],
   344         -[_LT_SET_OPTION([LT_INIT], [pic-only])
   345         -AC_DIAGNOSE([obsolete],
   346         -[$0: Remove this warning and the call to _LT_SET_OPTION when you
   347         -put the `pic-only' option into LT_INIT's first parameter.])
   348         -])
   349         -
   350         -dnl aclocal-1.4 backwards compatibility:
   351         -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
   352         -
   353         -## ----------------- ##
   354         -## LTDL_INIT Options ##
   355         -## ----------------- ##
   356         -
   357         -m4_define([_LTDL_MODE], [])
   358         -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
   359         -		 [m4_define([_LTDL_MODE], [nonrecursive])])
   360         -LT_OPTION_DEFINE([LTDL_INIT], [recursive],
   361         -		 [m4_define([_LTDL_MODE], [recursive])])
   362         -LT_OPTION_DEFINE([LTDL_INIT], [subproject],
   363         -		 [m4_define([_LTDL_MODE], [subproject])])
   364         -
   365         -m4_define([_LTDL_TYPE], [])
   366         -LT_OPTION_DEFINE([LTDL_INIT], [installable],
   367         -		 [m4_define([_LTDL_TYPE], [installable])])
   368         -LT_OPTION_DEFINE([LTDL_INIT], [convenience],
   369         -		 [m4_define([_LTDL_TYPE], [convenience])])

Deleted m4/ltsugar.m4.

     1         -# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
     2         -#
     3         -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
     4         -# Written by Gary V. Vaughan, 2004
     5         -#
     6         -# This file is free software; the Free Software Foundation gives
     7         -# unlimited permission to copy and/or distribute it, with or without
     8         -# modifications, as long as this notice is preserved.
     9         -
    10         -# serial 6 ltsugar.m4
    11         -
    12         -# This is to help aclocal find these macros, as it can't see m4_define.
    13         -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
    14         -
    15         -
    16         -# lt_join(SEP, ARG1, [ARG2...])
    17         -# -----------------------------
    18         -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
    19         -# associated separator.
    20         -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
    21         -# versions in m4sugar had bugs.
    22         -m4_define([lt_join],
    23         -[m4_if([$#], [1], [],
    24         -       [$#], [2], [[$2]],
    25         -       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
    26         -m4_define([_lt_join],
    27         -[m4_if([$#$2], [2], [],
    28         -       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
    29         -
    30         -
    31         -# lt_car(LIST)
    32         -# lt_cdr(LIST)
    33         -# ------------
    34         -# Manipulate m4 lists.
    35         -# These macros are necessary as long as will still need to support
    36         -# Autoconf-2.59 which quotes differently.
    37         -m4_define([lt_car], [[$1]])
    38         -m4_define([lt_cdr],
    39         -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
    40         -       [$#], 1, [],
    41         -       [m4_dquote(m4_shift($@))])])
    42         -m4_define([lt_unquote], $1)
    43         -
    44         -
    45         -# lt_append(MACRO-NAME, STRING, [SEPARATOR])
    46         -# ------------------------------------------
    47         -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
    48         -# Note that neither SEPARATOR nor STRING are expanded; they are appended
    49         -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
    50         -# No SEPARATOR is output if MACRO-NAME was previously undefined (different
    51         -# than defined and empty).
    52         -#
    53         -# This macro is needed until we can rely on Autoconf 2.62, since earlier
    54         -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
    55         -m4_define([lt_append],
    56         -[m4_define([$1],
    57         -	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
    58         -
    59         -
    60         -
    61         -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
    62         -# ----------------------------------------------------------
    63         -# Produce a SEP delimited list of all paired combinations of elements of
    64         -# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
    65         -# has the form PREFIXmINFIXSUFFIXn.
    66         -# Needed until we can rely on m4_combine added in Autoconf 2.62.
    67         -m4_define([lt_combine],
    68         -[m4_if(m4_eval([$# > 3]), [1],
    69         -       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
    70         -[[m4_foreach([_Lt_prefix], [$2],
    71         -	     [m4_foreach([_Lt_suffix],
    72         -		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
    73         -	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
    74         -
    75         -
    76         -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
    77         -# -----------------------------------------------------------------------
    78         -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
    79         -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
    80         -m4_define([lt_if_append_uniq],
    81         -[m4_ifdef([$1],
    82         -	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
    83         -		 [lt_append([$1], [$2], [$3])$4],
    84         -		 [$5])],
    85         -	  [lt_append([$1], [$2], [$3])$4])])
    86         -
    87         -
    88         -# lt_dict_add(DICT, KEY, VALUE)
    89         -# -----------------------------
    90         -m4_define([lt_dict_add],
    91         -[m4_define([$1($2)], [$3])])
    92         -
    93         -
    94         -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
    95         -# --------------------------------------------
    96         -m4_define([lt_dict_add_subkey],
    97         -[m4_define([$1($2:$3)], [$4])])
    98         -
    99         -
   100         -# lt_dict_fetch(DICT, KEY, [SUBKEY])
   101         -# ----------------------------------
   102         -m4_define([lt_dict_fetch],
   103         -[m4_ifval([$3],
   104         -	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
   105         -    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
   106         -
   107         -
   108         -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
   109         -# -----------------------------------------------------------------
   110         -m4_define([lt_if_dict_fetch],
   111         -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
   112         -	[$5],
   113         -    [$6])])
   114         -
   115         -
   116         -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
   117         -# --------------------------------------------------------------
   118         -m4_define([lt_dict_filter],
   119         -[m4_if([$5], [], [],
   120         -  [lt_join(m4_quote(m4_default([$4], [[, ]])),
   121         -           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
   122         -		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
   123         -])

Deleted m4/ltversion.m4.

     1         -# ltversion.m4 -- version numbers			-*- Autoconf -*-
     2         -#
     3         -#   Copyright (C) 2004 Free Software Foundation, Inc.
     4         -#   Written by Scott James Remnant, 2004
     5         -#
     6         -# This file is free software; the Free Software Foundation gives
     7         -# unlimited permission to copy and/or distribute it, with or without
     8         -# modifications, as long as this notice is preserved.
     9         -
    10         -# @configure_input@
    11         -
    12         -# serial 3337 ltversion.m4
    13         -# This file is part of GNU Libtool
    14         -
    15         -m4_define([LT_PACKAGE_VERSION], [2.4.2])
    16         -m4_define([LT_PACKAGE_REVISION], [1.3337])
    17         -
    18         -AC_DEFUN([LTVERSION_VERSION],
    19         -[macro_version='2.4.2'
    20         -macro_revision='1.3337'
    21         -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
    22         -_LT_DECL(, macro_revision, 0)
    23         -])

Deleted m4/lt~obsolete.m4.

     1         -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
     2         -#
     3         -#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
     4         -#   Written by Scott James Remnant, 2004.
     5         -#
     6         -# This file is free software; the Free Software Foundation gives
     7         -# unlimited permission to copy and/or distribute it, with or without
     8         -# modifications, as long as this notice is preserved.
     9         -
    10         -# serial 5 lt~obsolete.m4
    11         -
    12         -# These exist entirely to fool aclocal when bootstrapping libtool.
    13         -#
    14         -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
    15         -# which have later been changed to m4_define as they aren't part of the
    16         -# exported API, or moved to Autoconf or Automake where they belong.
    17         -#
    18         -# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
    19         -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
    20         -# using a macro with the same name in our local m4/libtool.m4 it'll
    21         -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
    22         -# and doesn't know about Autoconf macros at all.)
    23         -#
    24         -# So we provide this file, which has a silly filename so it's always
    25         -# included after everything else.  This provides aclocal with the
    26         -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
    27         -# because those macros already exist, or will be overwritten later.
    28         -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
    29         -#
    30         -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
    31         -# Yes, that means every name once taken will need to remain here until
    32         -# we give up compatibility with versions before 1.7, at which point
    33         -# we need to keep only those names which we still refer to.
    34         -
    35         -# This is to help aclocal find these macros, as it can't see m4_define.
    36         -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
    37         -
    38         -m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
    39         -m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
    40         -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
    41         -m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
    42         -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
    43         -m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
    44         -m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
    45         -m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
    46         -m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
    47         -m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
    48         -m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
    49         -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
    50         -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
    51         -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
    52         -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
    53         -m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
    54         -m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
    55         -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
    56         -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
    57         -m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
    58         -m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
    59         -m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
    60         -m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
    61         -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
    62         -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
    63         -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
    64         -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
    65         -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
    66         -m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
    67         -m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
    68         -m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
    69         -m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
    70         -m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
    71         -m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
    72         -m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
    73         -m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
    74         -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
    75         -m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
    76         -m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
    77         -m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
    78         -m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
    79         -m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
    80         -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
    81         -m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
    82         -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
    83         -m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
    84         -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
    85         -m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
    86         -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
    87         -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
    88         -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
    89         -m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
    90         -m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
    91         -m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
    92         -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
    93         -m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
    94         -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
    95         -m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
    96         -m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
    97         -m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
    98         -m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])

Changes to makefile.vc.

     5      5   !INCLUDE nmake.opt
     6      6   
     7      7   OBJ_EXT = obj
     8      8   EXT = $(OBJ_EXT)
     9      9   
    10     10   LIBOBJ = lib\rasterlite.$(EXT) lib\rasterlite_gif.$(EXT) \
    11     11   	lib\rasterlite_png.$(EXT) lib\rasterlite_jpeg.$(EXT) \
           12  +	lib\rasterlite_tiff.$(EXT) lib\rasterlite_wavelet.$(EXT) \
    12     13   	lib\rasterlite_io.$(EXT) lib\rasterlite_image.$(EXT) \
    13         -	lib\rasterlite_tiff.$(EXT) lib\rasterlite_aux.$(EXT) \
    14         -	lib\rasterlite_quantize.$(EXT)
           14  +	epsilon\bit_io.$(EXT) epsilon\checksum.$(EXT) \
           15  +	epsilon\cobs.$(EXT) epsilon\color.$(EXT) epsilon\common.$(EXT) \
           16  +	epsilon\dc_level.$(EXT) epsilon\filter.$(EXT) \
           17  +	epsilon\filterbank.$(EXT) epsilon\libmain.$(EXT) \
           18  +	epsilon\list.$(EXT) epsilon\mem_alloc.$(EXT) \
           19  +	epsilon\merge_split.$(EXT) epsilon\pad.$(EXT) \
           20  +	epsilon\resample.$(EXT) epsilon\speck.$(EXT)
    15     21   RASTERLITE_DLL 	       =	rasterlite$(VERSION).dll
    16     22   
    17         -CFLAGS	=	/nologo -IC:\OSGeo4W\include -I.\headers $(OPTFLAGS)
    18         -
    19         -CFLAGS2	=	/nologo -IC:\OSGeo4W\include -I.\headers $(OPTFLAGS2)
           23  +CFLAGS	=	/nologo -IC:\OSGeo4W\include -I.\headers -I.\epsilon -I.\epsilon\msvc $(OPTFLAGS)
    20     24   
    21     25   default:	all
    22     26   
    23     27   all: rasterlite.lib rasterlite_i.lib rasterlite_grid.exe rasterlite_load.exe \
    24     28   	rasterlite_pyramid.exe rasterlite_tool.exe rasterlite_topmost.exe
    25     29   
    26     30   rasterlite.lib:	$(LIBOBJ)
    27     31   	if exist rasterlite.lib del rasterlite.lib
    28     32   	lib /out:rasterlite.lib $(LIBOBJ)
    29     33   
    30     34   $(RASTERLITE_DLL):	rasterlite_i.lib
    31     35   
    32     36   rasterlite_i.lib:	$(LIBOBJ)
    33         -	link /debug /dll /out:$(RASTERLITE_DLL) \
           37  +	link /debug /dll /def:librasterlite.def /out:$(RASTERLITE_DLL) \
    34     38   		/implib:rasterlite_i.lib $(LIBOBJ) \
    35     39   		C:\OSGeo4W\lib\jpeg_i.lib C:\OSGeo4W\lib\libtiff_i.lib \
    36     40   		C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \
    37     41   		C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib
    38     42   	if exist $(RASTERLITE_DLL).manifest mt -manifest \
    39     43   		$(RASTERLITE_DLL).manifest -outputresource:$(RASTERLITE_DLL);2
    40     44   
    41         -rasterlite_grid.exe: $(LIBOBJ) src\rasterlite_grid.obj
    42         -	cl src\rasterlite_grid.obj .\rasterlite.lib \
           45  +rasterlite_grid.exe: $(RASTERLITE_DLL) src\rasterlite_grid.obj
           46  +	link /debug src\rasterlite_grid.obj $(LIBOBJ) \
    43     47   	C:\OSGeo4W\lib\jpeg_i.lib C:\OSGeo4W\lib\libtiff_i.lib \
    44     48   	C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \
    45     49   	C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib
    46     50   
    47         -rasterlite_load.exe: $(LIBOBJ) src\rasterlite_load.obj
    48         -	cl src\rasterlite_load.obj .\rasterlite.lib \
           51  +rasterlite_load.exe: $(RASTERLITE_DLL) src\rasterlite_load.obj
           52  +	link /debug src\rasterlite_load.obj $(LIBOBJ) \
    49     53   	C:\OSGeo4W\lib\jpeg_i.lib C:\OSGeo4W\lib\libtiff_i.lib \
    50     54   	C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \
    51     55   	C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib
    52     56   
    53         -rasterlite_pyramid.exe: $(LIBOBJ) src\rasterlite_pyramid.obj
    54         -	cl src\rasterlite_pyramid.obj .\rasterlite.lib \
           57  +rasterlite_pyramid.exe: $(RASTERLITE_DLL) src\rasterlite_pyramid.obj
           58  +	link /debug src\rasterlite_pyramid.obj $(LIBOBJ) \
    55     59   	C:\OSGeo4W\lib\jpeg_i.lib C:\OSGeo4W\lib\libtiff_i.lib \
    56     60   	C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \
    57     61   	C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib
    58     62   
    59         -rasterlite_tool.exe: $(LIBOBJ) src\rasterlite_tool.obj
    60         -	cl src\rasterlite_tool.obj .\rasterlite.lib \
           63  +rasterlite_tool.exe: $(RASTERLITE_DLL) src\rasterlite_tool.obj
           64  +	link /debug src\rasterlite_tool.obj $(LIBOBJ) \
    61     65   	C:\OSGeo4W\lib\jpeg_i.lib C:\OSGeo4W\lib\libtiff_i.lib \
    62     66   	C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \
    63     67   	C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib
    64     68   	
    65         -rasterlite_topmost.exe: $(LIBOBJ) src\rasterlite_topmost.obj
    66         -	cl src\rasterlite_topmost.obj .\rasterlite.lib \
           69  +rasterlite_topmost.exe: $(RASTERLITE_DLL) src\rasterlite_topmost.obj
           70  +	link /debug src\rasterlite_topmost.obj $(LIBOBJ) \
    67     71   	C:\OSGeo4W\lib\jpeg_i.lib C:\OSGeo4W\lib\libtiff_i.lib \
    68     72   	C:\OSGeo4W\lib\libpng13.lib C:\OSGeo4W\lib\zlib.lib \
    69     73   	C:\OSGeo4W\lib\geotiff_i.lib C:\OSGeo4W\lib\spatialite_i.lib
    70     74   		
    71         -lib\rasterlite.$(EXT): lib\rasterlite.c
    72         -	$(CC) $(CFLAGS2) /c lib\rasterlite.c /Fo$@
    73         -	
    74         -lib\rasterlite_gif.$(EXT): lib\rasterlite_gif.c
    75         -	$(CC) $(CFLAGS2) /c lib\rasterlite_gif.c /Fo$@
    76         -	
    77         -lib\rasterlite_png.$(EXT): lib\rasterlite_png.c
    78         -	$(CC) $(CFLAGS2) /c lib\rasterlite_png.c /Fo$@
    79         -	
    80         -lib\rasterlite_jpeg.$(EXT): lib\rasterlite_jpeg.c
    81         -	$(CC) $(CFLAGS2) /c lib\rasterlite_jpeg.c /Fo$@
    82         -
    83         -lib\rasterlite_io.$(EXT): lib\rasterlite_io.c
    84         -	$(CC) $(CFLAGS2) /c lib\rasterlite_io.c /Fo$@
    85         -	
    86         -lib\rasterlite_image.$(EXT): lib\rasterlite_image.c
    87         -	$(CC) $(CFLAGS2) /c lib\rasterlite_image.c /Fo$@
    88         -	
    89         -lib\rasterlite_aux.$(EXT): lib\rasterlite_aux.c
    90         -	$(CC) $(CFLAGS2) /c lib\rasterlite_aux.c /Fo$@
    91         -	
    92         -lib\rasterlite_tiff.$(EXT): lib\rasterlite_tiff.c
    93         -	$(CC) $(CFLAGS2) /c lib\rasterlite_tiff.c /Fo$@
    94         -	
    95         -lib\rasterlite_quantize.$(EXT): lib\rasterlite_quantize.c
    96         -	$(CC) $(CFLAGS2) /c lib\rasterlite_quantize.c /Fo$@
    97         -	
    98         -	
    99     75   .c.obj:
   100     76   	$(CC) $(CFLAGS) /c $*.c /Fo$@
   101     77   
   102     78   clean:
   103     79   	del *.dll
   104     80   	del *.exp
   105     81   	del *.manifest

Changes to missing.

     1         -/usr/share/automake-1.11/missing
            1  +#! /bin/sh
            2  +# Common stub for a few missing GNU programs while installing.
            3  +
            4  +scriptversion=2006-05-10.23
            5  +
            6  +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
            7  +#   Free Software Foundation, Inc.
            8  +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
            9  +
           10  +# This program is free software; you can redistribute it and/or modify
           11  +# it under the terms of the GNU General Public License as published by
           12  +# the Free Software Foundation; either version 2, or (at your option)
           13  +# any later version.
           14  +
           15  +# This program is distributed in the hope that it will be useful,
           16  +# but WITHOUT ANY WARRANTY; without even the implied warranty of
           17  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           18  +# GNU General Public License for more details.
           19  +
           20  +# You should have received a copy of the GNU General Public License
           21  +# along with this program; if not, write to the Free Software
           22  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
           23  +# 02110-1301, USA.
           24  +
           25  +# As a special exception to the GNU General Public License, if you
           26  +# distribute this file as part of a program that contains a
           27  +# configuration script generated by Autoconf, you may include it under
           28  +# the same distribution terms that you use for the rest of that program.
           29  +
           30  +if test $# -eq 0; then
           31  +  echo 1>&2 "Try \`$0 --help' for more information"
           32  +  exit 1
           33  +fi
           34  +
           35  +run=:
           36  +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
           37  +sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
           38  +
           39  +# In the cases where this matters, `missing' is being run in the
           40  +# srcdir already.
           41  +if test -f configure.ac; then
           42  +  configure_ac=configure.ac
           43  +else
           44  +  configure_ac=configure.in
           45  +fi
           46  +
           47  +msg="missing on your system"
           48  +
           49  +case $1 in
           50  +--run)
           51  +  # Try to run requested program, and just exit if it succeeds.
           52  +  run=
           53  +  shift
           54  +  "$@" && exit 0
           55  +  # Exit code 63 means version mismatch.  This often happens
           56  +  # when the user try to use an ancient version of a tool on
           57  +  # a file that requires a minimum version.  In this case we
           58  +  # we should proceed has if the program had been absent, or
           59  +  # if --run hadn't been passed.
           60  +  if test $? = 63; then
           61  +    run=:
           62  +    msg="probably too old"
           63  +  fi
           64  +  ;;
           65  +
           66  +  -h|--h|--he|--hel|--help)
           67  +    echo "\
           68  +$0 [OPTION]... PROGRAM [ARGUMENT]...
           69  +
           70  +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
           71  +error status if there is no known handling for PROGRAM.
           72  +
           73  +Options:
           74  +  -h, --help      display this help and exit
           75  +  -v, --version   output version information and exit
           76  +  --run           try to run the given command, and emulate it if it fails
           77  +
           78  +Supported PROGRAM values:
           79  +  aclocal      touch file \`aclocal.m4'
           80  +  autoconf     touch file \`configure'
           81  +  autoheader   touch file \`config.h.in'
           82  +  autom4te     touch the output file, or create a stub one
           83  +  automake     touch all \`Makefile.in' files
           84  +  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
           85  +  flex         create \`lex.yy.c', if possible, from existing .c
           86  +  help2man     touch the output file
           87  +  lex          create \`lex.yy.c', if possible, from existing .c
           88  +  makeinfo     touch the output file
           89  +  tar          try tar, gnutar, gtar, then tar without non-portable flags
           90  +  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
           91  +
           92  +Send bug reports to <bug-automake@gnu.org>."
           93  +    exit $?
           94  +    ;;
           95  +
           96  +  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
           97  +    echo "missing $scriptversion (GNU Automake)"
           98  +    exit $?
           99  +    ;;
          100  +
          101  +  -*)
          102  +    echo 1>&2 "$0: Unknown \`$1' option"
          103  +    echo 1>&2 "Try \`$0 --help' for more information"
          104  +    exit 1
          105  +    ;;
          106  +
          107  +esac
          108  +
          109  +# Now exit if we have it, but it failed.  Also exit now if we
          110  +# don't have it and --version was passed (most likely to detect
          111  +# the program).
          112  +case $1 in
          113  +  lex|yacc)
          114  +    # Not GNU programs, they don't have --version.
          115  +    ;;
          116  +
          117  +  tar)
          118  +    if test -n "$run"; then
          119  +       echo 1>&2 "ERROR: \`tar' requires --run"
          120  +       exit 1
          121  +    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
          122  +       exit 1
          123  +    fi
          124  +    ;;
          125  +
          126  +  *)
          127  +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
          128  +       # We have it, but it failed.
          129  +       exit 1
          130  +    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
          131  +       # Could not run --version or --help.  This is probably someone
          132  +       # running `$TOOL --version' or `$TOOL --help' to check whether
          133  +       # $TOOL exists and not knowing $TOOL uses missing.
          134  +       exit 1
          135  +    fi
          136  +    ;;
          137  +esac
          138  +
          139  +# If it does not exist, or fails to run (possibly an outdated version),
          140  +# try to emulate it.
          141  +case $1 in
          142  +  aclocal*)
          143  +    echo 1>&2 "\
          144  +WARNING: \`$1' is $msg.  You should only need it if
          145  +         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
          146  +         to install the \`Automake' and \`Perl' packages.  Grab them from
          147  +         any GNU archive site."
          148  +    touch aclocal.m4
          149  +    ;;
          150  +
          151  +  autoconf)
          152  +    echo 1>&2 "\
          153  +WARNING: \`$1' is $msg.  You should only need it if
          154  +         you modified \`${configure_ac}'.  You might want to install the
          155  +         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
          156  +         archive site."
          157  +    touch configure
          158  +    ;;
          159  +
          160  +  autoheader)
          161  +    echo 1>&2 "\
          162  +WARNING: \`$1' is $msg.  You should only need it if
          163  +         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
          164  +         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
          165  +         from any GNU archive site."
          166  +    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
          167  +    test -z "$files" && files="config.h"
          168  +    touch_files=
          169  +    for f in $files; do
          170  +      case $f in
          171  +      *:*) touch_files="$touch_files "`echo "$f" |
          172  +				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
          173  +      *) touch_files="$touch_files $f.in";;
          174  +      esac
          175  +    done
          176  +    touch $touch_files
          177  +    ;;
          178  +
          179  +  automake*)
          180  +    echo 1>&2 "\
          181  +WARNING: \`$1' is $msg.  You should only need it if
          182  +         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
          183  +         You might want to install the \`Automake' and \`Perl' packages.
          184  +         Grab them from any GNU archive site."
          185  +    find . -type f -name Makefile.am -print |
          186  +	   sed 's/\.am$/.in/' |
          187  +	   while read f; do touch "$f"; done
          188  +    ;;
          189  +
          190  +  autom4te)
          191  +    echo 1>&2 "\
          192  +WARNING: \`$1' is needed, but is $msg.
          193  +         You might have modified some files without having the
          194  +         proper tools for further handling them.
          195  +         You can get \`$1' as part of \`Autoconf' from any GNU
          196  +         archive site."
          197  +
          198  +    file=`echo "$*" | sed -n "$sed_output"`
          199  +    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
          200  +    if test -f "$file"; then
          201  +	touch $file
          202  +    else
          203  +	test -z "$file" || exec >$file
          204  +	echo "#! /bin/sh"
          205  +	echo "# Created by GNU Automake missing as a replacement of"
          206  +	echo "#  $ $@"
          207  +	echo "exit 0"
          208  +	chmod +x $file
          209  +	exit 1
          210  +    fi
          211  +    ;;
          212  +
          213  +  bison|yacc)
          214  +    echo 1>&2 "\
          215  +WARNING: \`$1' $msg.  You should only need it if
          216  +         you modified a \`.y' file.  You may need the \`Bison' package
          217  +         in order for those modifications to take effect.  You can get
          218  +         \`Bison' from any GNU archive site."
          219  +    rm -f y.tab.c y.tab.h
          220  +    if test $# -ne 1; then
          221  +        eval LASTARG="\${$#}"
          222  +	case $LASTARG in
          223  +	*.y)
          224  +	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
          225  +	    if test -f "$SRCFILE"; then
          226  +	         cp "$SRCFILE" y.tab.c
          227  +	    fi
          228  +	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
          229  +	    if test -f "$SRCFILE"; then
          230  +	         cp "$SRCFILE" y.tab.h
          231  +	    fi
          232  +	  ;;
          233  +	esac
          234  +    fi
          235  +    if test ! -f y.tab.h; then
          236  +	echo >y.tab.h
          237  +    fi
          238  +    if test ! -f y.tab.c; then
          239  +	echo 'main() { return 0; }' >y.tab.c
          240  +    fi
          241  +    ;;
          242  +
          243  +  lex|flex)
          244  +    echo 1>&2 "\
          245  +WARNING: \`$1' is $msg.  You should only need it if
          246  +         you modified a \`.l' file.  You may need the \`Flex' package
          247  +         in order for those modifications to take effect.  You can get
          248  +         \`Flex' from any GNU archive site."
          249  +    rm -f lex.yy.c
          250  +    if test $# -ne 1; then
          251  +        eval LASTARG="\${$#}"
          252  +	case $LASTARG in
          253  +	*.l)
          254  +	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
          255  +	    if test -f "$SRCFILE"; then
          256  +	         cp "$SRCFILE" lex.yy.c
          257  +	    fi
          258  +	  ;;
          259  +	esac
          260  +    fi
          261  +    if test ! -f lex.yy.c; then
          262  +	echo 'main() { return 0; }' >lex.yy.c
          263  +    fi
          264  +    ;;
          265  +
          266  +  help2man)
          267  +    echo 1>&2 "\
          268  +WARNING: \`$1' is $msg.  You should only need it if
          269  +	 you modified a dependency of a manual page.  You may need the
          270  +	 \`Help2man' package in order for those modifications to take
          271  +	 effect.  You can get \`Help2man' from any GNU archive site."
          272  +
          273  +    file=`echo "$*" | sed -n "$sed_output"`
          274  +    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
          275  +    if test -f "$file"; then
          276  +	touch $file
          277  +    else
          278  +	test -z "$file" || exec >$file
          279  +	echo ".ab help2man is required to generate this page"
          280  +	exit 1
          281  +    fi
          282  +    ;;
          283  +
          284  +  makeinfo)
          285  +    echo 1>&2 "\
          286  +WARNING: \`$1' is $msg.  You should only need it if
          287  +         you modified a \`.texi' or \`.texinfo' file, or any other file
          288  +         indirectly affecting the aspect of the manual.  The spurious
          289  +         call might also be the consequence of using a buggy \`make' (AIX,
          290  +         DU, IRIX).  You might want to install the \`Texinfo' package or
          291  +         the \`GNU make' package.  Grab either from any GNU archive site."
          292  +    # The file to touch is that specified with -o ...
          293  +    file=`echo "$*" | sed -n "$sed_output"`
          294  +    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
          295  +    if test -z "$file"; then
          296  +      # ... or it is the one specified with @setfilename ...
          297  +      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
          298  +      file=`sed -n '
          299  +	/^@setfilename/{
          300  +	  s/.* \([^ ]*\) *$/\1/
          301  +	  p
          302  +	  q
          303  +	}' $infile`
          304  +      # ... or it is derived from the source name (dir/f.texi becomes f.info)
          305  +      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
          306  +    fi
          307  +    # If the file does not exist, the user really needs makeinfo;
          308  +    # let's fail without touching anything.
          309  +    test -f $file || exit 1
          310  +    touch $file
          311  +    ;;
          312  +
          313  +  tar)
          314  +    shift
          315  +
          316  +    # We have already tried tar in the generic part.
          317  +    # Look for gnutar/gtar before invocation to avoid ugly error
          318  +    # messages.
          319  +    if (gnutar --version > /dev/null 2>&1); then
          320  +       gnutar "$@" && exit 0
          321  +    fi
          322  +    if (gtar --version > /dev/null 2>&1); then
          323  +       gtar "$@" && exit 0
          324  +    fi
          325  +    firstarg="$1"
          326  +    if shift; then
          327  +	case $firstarg in
          328  +	*o*)
          329  +	    firstarg=`echo "$firstarg" | sed s/o//`
          330  +	    tar "$firstarg" "$@" && exit 0
          331  +	    ;;
          332  +	esac
          333  +	case $firstarg in
          334  +	*h*)
          335  +	    firstarg=`echo "$firstarg" | sed s/h//`
          336  +	    tar "$firstarg" "$@" && exit 0
          337  +	    ;;
          338  +	esac
          339  +    fi
          340  +
          341  +    echo 1>&2 "\
          342  +WARNING: I can't seem to be able to run \`tar' with the given arguments.
          343  +         You may want to install GNU tar or Free paxutils, or check the
          344  +         command line arguments."
          345  +    exit 1
          346  +    ;;
          347  +
          348  +  *)
          349  +    echo 1>&2 "\
          350  +WARNING: \`$1' is needed, and is $msg.
          351  +         You might have modified some files without having the
          352  +         proper tools for further handling them.  Check the \`README' file,
          353  +         it often tells you about the needed prerequisites for installing
          354  +         this package.  You may also peek at any GNU archive site, in case
          355  +         some other package would contain this missing \`$1' program."
          356  +    exit 1
          357  +    ;;
          358  +esac
          359  +
          360  +exit 0
          361  +
          362  +# Local variables:
          363  +# eval: (add-hook 'write-file-hooks 'time-stamp)
          364  +# time-stamp-start: "scriptversion="
          365  +# time-stamp-format: "%:y-%02m-%02d.%02H"
          366  +# time-stamp-end: "$"
          367  +# End:

Changes to nmake.opt.

     1      1   # Directory tree where RasterLite will be installed.
     2      2   INSTDIR=C:\OSGeo4W
     3      3   
     4      4   # Uncomment the first for an optimized build, or the second for debug.
     5      5   OPTFLAGS=	/nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \
     6         -		/D_LARGE_FILE=1 /D_FILE_OFFSET_BITS=64 /D_LARGEFILE_SOURCE=1 \
     7         -		/DSPATIALITE_AMALGAMATION=1 /D_USE_MATH_DEFINES
     8         -OPTFLAGS2=	/nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \
     9         -		/D_LARGE_FILE=1 /D_FILE_OFFSET_BITS=64 /D_LARGEFILE_SOURCE=1 \
    10         -		/DSPATIALITE_AMALGAMATION=1 /D_USE_MATH_DEFINES /DDLL_EXPORT
            6  +		/D_LARGE_FILE=1 /D_FILE_OFFSET_BITS=64 /D_LARGEFILE_SOURCE=1 
    11      7   #OPTFLAGS=	/nologo /Zi /MD /Fdrasterlite.pdb
    12      8   
    13      9   # Set the version number for the DLL.  Normally we leave this blank since
    14     10   # we want software that is dynamically loading the DLL to have no problem
    15     11   # with version numbers.
    16     12   VERSION=

Changes to src/Makefile.am.

     1      1   
            2  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
            3  +
     2      4   bin_PROGRAMS =rasterlite_load \
     3      5   	rasterlite_pyramid \
     4      6   	rasterlite_topmost \
     5      7   	rasterlite_grid \
     6      8   	rasterlite_tool
     7      9   
     8     10   INCLUDES = @CFLAGS@
     9     11   INCLUDES += -I$(top_srcdir)/headers
           12  +INCLUDES += -I$(top_srcdir)/epsilon
    10     13   
    11     14   rasterlite_load_SOURCES = rasterlite_load.c
    12     15   rasterlite_pyramid_SOURCES = rasterlite_pyramid.c
    13     16   rasterlite_topmost_SOURCES = rasterlite_topmost.c
    14     17   rasterlite_grid_SOURCES = rasterlite_grid.c
    15     18   rasterlite_tool_SOURCES = rasterlite_tool.c
    16     19   
    17     20   LDADD = ../lib/.libs/librasterlite.a \
    18         -	@LIBSPATIALITE_LIBS@ @LIBPNG_LIBS@ \
    19         -        -lgeotiff -ltiff -ljpeg -lspatialite -lproj
           21  +        -lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
    20     22   
    21         -MOSTLYCLEANFILES = *.gcna *.gcno *.gcda

Changes to src/Makefile.in.

     1         -# Makefile.in generated by automake 1.11.6 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
     6         -# Foundation, Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19         -am__make_dryrun = \
    20         -  { \
    21         -    am__dry=no; \
    22         -    case $$MAKEFLAGS in \
    23         -      *\\[\ \	]*) \
    24         -        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
    25         -          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
    26         -      *) \
    27         -        for am__flg in $$MAKEFLAGS; do \
    28         -          case $$am__flg in \
    29         -            *=*|--*) ;; \
    30         -            *n*) am__dry=yes; break;; \
    31         -          esac; \
    32         -        done;; \
    33         -    esac; \
    34         -    test $$am__dry = yes; \
    35         -  }
    36     18   pkgdatadir = $(datadir)/@PACKAGE@
    37         -pkgincludedir = $(includedir)/@PACKAGE@
    38     19   pkglibdir = $(libdir)/@PACKAGE@
    39         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    40     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    41     22   install_sh_DATA = $(install_sh) -c -m 644
    42     23   install_sh_PROGRAM = $(install_sh) -c
    43     24   install_sh_SCRIPT = $(install_sh) -c
    44     25   INSTALL_HEADER = $(INSTALL_DATA)
    45     26   transform = $(program_transform_name)
    46     27   NORMAL_INSTALL = :
................................................................................
    53     34   host_triplet = @host@
    54     35   bin_PROGRAMS = rasterlite_load$(EXEEXT) rasterlite_pyramid$(EXEEXT) \
    55     36   	rasterlite_topmost$(EXEEXT) rasterlite_grid$(EXEEXT) \
    56     37   	rasterlite_tool$(EXEEXT)
    57     38   subdir = src
    58     39   DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    59     40   ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    60         -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
    61         -	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
    62         -	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
    63         -	$(top_srcdir)/configure.ac
           41  +am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    64     42   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    65     43   	$(ACLOCAL_M4)
    66     44   mkinstalldirs = $(install_sh) -d
    67         -CONFIG_HEADER = $(top_builddir)/config.h
    68     45   CONFIG_CLEAN_FILES =
    69         -CONFIG_CLEAN_VPATH_FILES =
    70     46   am__installdirs = "$(DESTDIR)$(bindir)"
           47  +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    71     48   PROGRAMS = $(bin_PROGRAMS)
    72     49   am_rasterlite_grid_OBJECTS = rasterlite_grid.$(OBJEXT)
    73     50   rasterlite_grid_OBJECTS = $(am_rasterlite_grid_OBJECTS)
    74     51   rasterlite_grid_LDADD = $(LDADD)
    75     52   rasterlite_grid_DEPENDENCIES = ../lib/.libs/librasterlite.a
    76     53   am_rasterlite_load_OBJECTS = rasterlite_load.$(OBJEXT)
    77     54   rasterlite_load_OBJECTS = $(am_rasterlite_load_OBJECTS)
................................................................................
    85     62   rasterlite_tool_OBJECTS = $(am_rasterlite_tool_OBJECTS)
    86     63   rasterlite_tool_LDADD = $(LDADD)
    87     64   rasterlite_tool_DEPENDENCIES = ../lib/.libs/librasterlite.a
    88     65   am_rasterlite_topmost_OBJECTS = rasterlite_topmost.$(OBJEXT)
    89     66   rasterlite_topmost_OBJECTS = $(am_rasterlite_topmost_OBJECTS)
    90     67   rasterlite_topmost_LDADD = $(LDADD)
    91     68   rasterlite_topmost_DEPENDENCIES = ../lib/.libs/librasterlite.a
    92         -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
           69  +DEFAULT_INCLUDES = -I.@am__isrc@
    93     70   depcomp = $(SHELL) $(top_srcdir)/depcomp
    94     71   am__depfiles_maybe = depfiles
    95         -am__mv = mv -f
    96     72   COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    97     73   	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    98     74   LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
    99     75   	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
   100     76   	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
   101     77   CCLD = $(CC)
   102     78   LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
................................................................................
   104     80   	$(LDFLAGS) -o $@
   105     81   SOURCES = $(rasterlite_grid_SOURCES) $(rasterlite_load_SOURCES) \
   106     82   	$(rasterlite_pyramid_SOURCES) $(rasterlite_tool_SOURCES) \
   107     83   	$(rasterlite_topmost_SOURCES)
   108     84   DIST_SOURCES = $(rasterlite_grid_SOURCES) $(rasterlite_load_SOURCES) \
   109     85   	$(rasterlite_pyramid_SOURCES) $(rasterlite_tool_SOURCES) \
   110     86   	$(rasterlite_topmost_SOURCES)
   111         -am__can_run_installinfo = \
   112         -  case $$AM_UPDATE_INFO_DIR in \
   113         -    n|no|NO) false;; \
   114         -    *) (install-info --version) >/dev/null 2>&1;; \
   115         -  esac
   116     87   ETAGS = etags
   117     88   CTAGS = ctags
   118     89   DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   119     90   ACLOCAL = @ACLOCAL@
   120     91   AMTAR = @AMTAR@
   121     92   AR = @AR@
   122     93   AS = @AS@
................................................................................
   134    105   CXXDEPMODE = @CXXDEPMODE@
   135    106   CXXFLAGS = @CXXFLAGS@
   136    107   CYGPATH_W = @CYGPATH_W@
   137    108   DEFS = @DEFS@
   138    109   DEPDIR = @DEPDIR@
   139    110   DLLTOOL = @DLLTOOL@
   140    111   DSYMUTIL = @DSYMUTIL@
   141         -DUMPBIN = @DUMPBIN@
          112  +ECHO = @ECHO@
   142    113   ECHO_C = @ECHO_C@
   143    114   ECHO_N = @ECHO_N@
   144    115   ECHO_T = @ECHO_T@
   145    116   EGREP = @EGREP@
   146    117   EXEEXT = @EXEEXT@
   147         -FGREP = @FGREP@
          118  +F77 = @F77@
          119  +FFLAGS = @FFLAGS@
   148    120   GREP = @GREP@
   149    121   INSTALL = @INSTALL@
   150    122   INSTALL_DATA = @INSTALL_DATA@
   151    123   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   152    124   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   153    125   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   154         -LD = @LD@
   155    126   LDFLAGS = @LDFLAGS@
   156    127   LIBOBJS = @LIBOBJS@
   157         -LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
   158         -LIBPNG_LIBS = @LIBPNG_LIBS@
   159    128   LIBS = @LIBS@
   160         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   161         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   162    129   LIBTOOL = @LIBTOOL@
   163         -LIPO = @LIPO@
   164    130   LN_S = @LN_S@
   165    131   LTLIBOBJS = @LTLIBOBJS@
   166    132   MAINT = @MAINT@
   167    133   MAKEINFO = @MAKEINFO@
   168         -MANIFEST_TOOL = @MANIFEST_TOOL@
   169    134   MKDIR_P = @MKDIR_P@
   170         -NM = @NM@
   171    135   NMEDIT = @NMEDIT@
   172    136   OBJDUMP = @OBJDUMP@
   173    137   OBJEXT = @OBJEXT@
   174         -OTOOL = @OTOOL@
   175         -OTOOL64 = @OTOOL64@
   176    138   PACKAGE = @PACKAGE@
   177    139   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   178    140   PACKAGE_NAME = @PACKAGE_NAME@
   179    141   PACKAGE_STRING = @PACKAGE_STRING@
   180    142   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   181         -PACKAGE_URL = @PACKAGE_URL@
   182    143   PACKAGE_VERSION = @PACKAGE_VERSION@
   183    144   PATH_SEPARATOR = @PATH_SEPARATOR@
   184         -PKG_CONFIG = @PKG_CONFIG@
   185         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   186         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   187    145   RANLIB = @RANLIB@
   188    146   SED = @SED@
   189    147   SET_MAKE = @SET_MAKE@
   190    148   SHELL = @SHELL@
   191    149   STRIP = @STRIP@
   192    150   VERSION = @VERSION@
   193    151   abs_builddir = @abs_builddir@
   194    152   abs_srcdir = @abs_srcdir@
   195    153   abs_top_builddir = @abs_top_builddir@
   196    154   abs_top_srcdir = @abs_top_srcdir@
   197         -ac_ct_AR = @ac_ct_AR@
   198    155   ac_ct_CC = @ac_ct_CC@
   199    156   ac_ct_CXX = @ac_ct_CXX@
   200         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          157  +ac_ct_F77 = @ac_ct_F77@
   201    158   am__include = @am__include@
   202    159   am__leading_dot = @am__leading_dot@
   203    160   am__quote = @am__quote@
   204    161   am__tar = @am__tar@
   205    162   am__untar = @am__untar@
   206    163   bindir = @bindir@
   207    164   build = @build@
................................................................................
   236    193   program_transform_name = @program_transform_name@
   237    194   psdir = @psdir@
   238    195   sbindir = @sbindir@
   239    196   sharedstatedir = @sharedstatedir@
   240    197   srcdir = @srcdir@
   241    198   sysconfdir = @sysconfdir@
   242    199   target_alias = @target_alias@
   243         -top_build_prefix = @top_build_prefix@
   244    200   top_builddir = @top_builddir@
   245    201   top_srcdir = @top_srcdir@
   246         -INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers
          202  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
          203  +INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers -I$(top_srcdir)/epsilon
   247    204   rasterlite_load_SOURCES = rasterlite_load.c
   248    205   rasterlite_pyramid_SOURCES = rasterlite_pyramid.c
   249    206   rasterlite_topmost_SOURCES = rasterlite_topmost.c
   250    207   rasterlite_grid_SOURCES = rasterlite_grid.c
   251    208   rasterlite_tool_SOURCES = rasterlite_tool.c
   252    209   LDADD = ../lib/.libs/librasterlite.a \
   253         -	@LIBSPATIALITE_LIBS@ @LIBPNG_LIBS@ \
   254         -        -lgeotiff -ltiff -ljpeg -lspatialite -lproj
          210  +        -lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
   255    211   
   256         -MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
   257    212   all: all-am
   258    213   
   259    214   .SUFFIXES:
   260    215   .SUFFIXES: .c .lo .o .obj
   261    216   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   262    217   	@for dep in $?; do \
   263    218   	  case '$(am__configure_deps)' in \
   264    219   	    *$$dep*) \
   265         -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   266         -	        && { if test -f $@; then exit 0; else break; fi; }; \
          220  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          221  +		&& exit 0; \
   267    222   	      exit 1;; \
   268    223   	  esac; \
   269    224   	done; \
   270         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
   271         -	$(am__cd) $(top_srcdir) && \
   272         -	  $(AUTOMAKE) --gnu src/Makefile
          225  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
          226  +	cd $(top_srcdir) && \
          227  +	  $(AUTOMAKE) --foreign  src/Makefile
   273    228   .PRECIOUS: Makefile
   274    229   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   275    230   	@case '$?' in \
   276    231   	  *config.status*) \
   277    232   	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   278    233   	  *) \
   279    234   	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
................................................................................
   283    238   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   284    239   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   285    240   
   286    241   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   287    242   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   288    243   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   289    244   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   290         -$(am__aclocal_m4_deps):
   291    245   install-binPROGRAMS: $(bin_PROGRAMS)
   292    246   	@$(NORMAL_INSTALL)
   293         -	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
   294         -	if test -n "$$list"; then \
   295         -	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
   296         -	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
   297         -	fi; \
   298         -	for p in $$list; do echo "$$p $$p"; done | \
   299         -	sed 's/$(EXEEXT)$$//' | \
   300         -	while read p p1; do if test -f $$p || test -f $$p1; \
   301         -	  then echo "$$p"; echo "$$p"; else :; fi; \
   302         -	done | \
   303         -	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
   304         -	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
   305         -	sed 'N;N;N;s,\n, ,g' | \
   306         -	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
   307         -	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
   308         -	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
   309         -	    else { print "f", $$3 "/" $$4, $$1; } } \
   310         -	  END { for (d in files) print "f", d, files[d] }' | \
   311         -	while read type dir files; do \
   312         -	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
   313         -	    test -z "$$files" || { \
   314         -	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
   315         -	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
   316         -	    } \
   317         -	; done
          247  +	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
          248  +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
          249  +	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          250  +	  if test -f $$p \
          251  +	     || test -f $$p1 \
          252  +	  ; then \
          253  +	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
          254  +	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
          255  +	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
          256  +	  else :; fi; \
          257  +	done
   318    258   
   319    259   uninstall-binPROGRAMS:
   320    260   	@$(NORMAL_UNINSTALL)
   321         -	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
   322         -	files=`for p in $$list; do echo "$$p"; done | \
   323         -	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
   324         -	      -e 's/$$/$(EXEEXT)/' `; \
   325         -	test -n "$$list" || exit 0; \
   326         -	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
   327         -	cd "$(DESTDIR)$(bindir)" && rm -f $$files
          261  +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
          262  +	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
          263  +	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
          264  +	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
          265  +	done
   328    266   
   329    267   clean-binPROGRAMS:
   330         -	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
   331         -	echo " rm -f" $$list; \
   332         -	rm -f $$list || exit $$?; \
   333         -	test -n "$(EXEEXT)" || exit 0; \
   334         -	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
   335         -	echo " rm -f" $$list; \
   336         -	rm -f $$list
   337         -rasterlite_grid$(EXEEXT): $(rasterlite_grid_OBJECTS) $(rasterlite_grid_DEPENDENCIES) $(EXTRA_rasterlite_grid_DEPENDENCIES) 
          268  +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
          269  +	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          270  +	  echo " rm -f $$p $$f"; \
          271  +	  rm -f $$p $$f ; \
          272  +	done
          273  +rasterlite_grid$(EXEEXT): $(rasterlite_grid_OBJECTS) $(rasterlite_grid_DEPENDENCIES) 
   338    274   	@rm -f rasterlite_grid$(EXEEXT)
   339    275   	$(LINK) $(rasterlite_grid_OBJECTS) $(rasterlite_grid_LDADD) $(LIBS)
   340         -rasterlite_load$(EXEEXT): $(rasterlite_load_OBJECTS) $(rasterlite_load_DEPENDENCIES) $(EXTRA_rasterlite_load_DEPENDENCIES) 
          276  +rasterlite_load$(EXEEXT): $(rasterlite_load_OBJECTS) $(rasterlite_load_DEPENDENCIES) 
   341    277   	@rm -f rasterlite_load$(EXEEXT)
   342    278   	$(LINK) $(rasterlite_load_OBJECTS) $(rasterlite_load_LDADD) $(LIBS)
   343         -rasterlite_pyramid$(EXEEXT): $(rasterlite_pyramid_OBJECTS) $(rasterlite_pyramid_DEPENDENCIES) $(EXTRA_rasterlite_pyramid_DEPENDENCIES) 
          279  +rasterlite_pyramid$(EXEEXT): $(rasterlite_pyramid_OBJECTS) $(rasterlite_pyramid_DEPENDENCIES) 
   344    280   	@rm -f rasterlite_pyramid$(EXEEXT)
   345    281   	$(LINK) $(rasterlite_pyramid_OBJECTS) $(rasterlite_pyramid_LDADD) $(LIBS)
   346         -rasterlite_tool$(EXEEXT): $(rasterlite_tool_OBJECTS) $(rasterlite_tool_DEPENDENCIES) $(EXTRA_rasterlite_tool_DEPENDENCIES) 
          282  +rasterlite_tool$(EXEEXT): $(rasterlite_tool_OBJECTS) $(rasterlite_tool_DEPENDENCIES) 
   347    283   	@rm -f rasterlite_tool$(EXEEXT)
   348    284   	$(LINK) $(rasterlite_tool_OBJECTS) $(rasterlite_tool_LDADD) $(LIBS)
   349         -rasterlite_topmost$(EXEEXT): $(rasterlite_topmost_OBJECTS) $(rasterlite_topmost_DEPENDENCIES) $(EXTRA_rasterlite_topmost_DEPENDENCIES) 
          285  +rasterlite_topmost$(EXEEXT): $(rasterlite_topmost_OBJECTS) $(rasterlite_topmost_DEPENDENCIES) 
   350    286   	@rm -f rasterlite_topmost$(EXEEXT)
   351    287   	$(LINK) $(rasterlite_topmost_OBJECTS) $(rasterlite_topmost_LDADD) $(LIBS)
   352    288   
   353    289   mostlyclean-compile:
   354    290   	-rm -f *.$(OBJEXT)
   355    291   
   356    292   distclean-compile:
................................................................................
   360    296   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_load.Po@am__quote@
   361    297   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_pyramid.Po@am__quote@
   362    298   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_tool.Po@am__quote@
   363    299   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_topmost.Po@am__quote@
   364    300   
   365    301   .c.o:
   366    302   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   367         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          303  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   368    304   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   369    305   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   370    306   @am__fastdepCC_FALSE@	$(COMPILE) -c $<
   371    307   
   372    308   .c.obj:
   373    309   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
   374         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          310  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   375    311   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   376    312   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   377    313   @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
   378    314   
   379    315   .c.lo:
   380    316   @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   381         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
          317  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
   382    318   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
   383    319   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   384    320   @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
   385    321   
   386    322   mostlyclean-libtool:
   387    323   	-rm -f *.lo
   388    324   
................................................................................
   390    326   	-rm -rf .libs _libs
   391    327   
   392    328   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   393    329   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   394    330   	unique=`for i in $$list; do \
   395    331   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   396    332   	  done | \
   397         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          333  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   398    334   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   399    335   	mkid -fID $$unique
   400    336   tags: TAGS
   401    337   
   402    338   TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   403    339   		$(TAGS_FILES) $(LISP)
   404         -	set x; \
          340  +	tags=; \
   405    341   	here=`pwd`; \
   406    342   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   407    343   	unique=`for i in $$list; do \
   408    344   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   409    345   	  done | \
   410    346   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   411    347   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   412         -	shift; \
   413         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          348  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   414    349   	  test -n "$$unique" || unique=$$empty_fix; \
   415         -	  if test $$# -gt 0; then \
   416         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   417         -	      "$$@" $$unique; \
   418         -	  else \
   419         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   420         -	      $$unique; \
   421         -	  fi; \
          350  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          351  +	    $$tags $$unique; \
   422    352   	fi
   423    353   ctags: CTAGS
   424    354   CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   425    355   		$(TAGS_FILES) $(LISP)
          356  +	tags=; \
   426    357   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   427    358   	unique=`for i in $$list; do \
   428    359   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   429    360   	  done | \
   430    361   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   431    362   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   432         -	test -z "$(CTAGS_ARGS)$$unique" \
          363  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   433    364   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   434         -	     $$unique
          365  +	     $$tags $$unique
   435    366   
   436    367   GTAGS:
   437    368   	here=`$(am__cd) $(top_builddir) && pwd` \
   438         -	  && $(am__cd) $(top_srcdir) \
   439         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          369  +	  && cd $(top_srcdir) \
          370  +	  && gtags -i $(GTAGS_ARGS) $$here
   440    371   
   441    372   distclean-tags:
   442    373   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   443    374   
   444    375   distdir: $(DISTFILES)
   445    376   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   446    377   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
................................................................................
   453    384   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   454    385   			   sort -u` ;; \
   455    386   	esac; \
   456    387   	for file in $$dist_files; do \
   457    388   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   458    389   	  if test -d $$d/$$file; then \
   459    390   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   460         -	    if test -d "$(distdir)/$$file"; then \
   461         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          391  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          392  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   462    393   	    fi; \
   463         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   464         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   465         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   466         -	    fi; \
   467         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          394  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   468    395   	  else \
   469         -	    test -f "$(distdir)/$$file" \
   470         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          396  +	    test -f $(distdir)/$$file \
          397  +	    || cp -p $$d/$$file $(distdir)/$$file \
   471    398   	    || exit 1; \
   472    399   	  fi; \
   473    400   	done
   474    401   check-am: all-am
   475    402   check: check-am
   476    403   all-am: Makefile $(PROGRAMS)
   477    404   installdirs:
................................................................................
   484    411   uninstall: uninstall-am
   485    412   
   486    413   install-am: all-am
   487    414   	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   488    415   
   489    416   installcheck: installcheck-am
   490    417   install-strip:
   491         -	if test -z '$(STRIP)'; then \
   492         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   493         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   494         -	      install; \
   495         -	else \
   496         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   497         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   498         -	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
   499         -	fi
          418  +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
          419  +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          420  +	  `test -z '$(STRIP)' || \
          421  +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   500    422   mostlyclean-generic:
   501         -	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
   502    423   
   503    424   clean-generic:
   504    425   
   505    426   distclean-generic:
   506    427   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   507         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   508    428   
   509    429   maintainer-clean-generic:
   510    430   	@echo "This command is intended for maintainers to use"
   511    431   	@echo "it deletes files that may require special tools to rebuild."
   512    432   clean: clean-am
   513    433   
   514    434   clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
................................................................................
   521    441   
   522    442   dvi: dvi-am
   523    443   
   524    444   dvi-am:
   525    445   
   526    446   html: html-am
   527    447   
   528         -html-am:
   529         -
   530    448   info: info-am
   531    449   
   532    450   info-am:
   533    451   
   534    452   install-data-am:
   535    453   
   536    454   install-dvi: install-dvi-am
   537    455   
   538         -install-dvi-am:
   539         -
   540    456   install-exec-am: install-binPROGRAMS
   541    457   
   542    458   install-html: install-html-am
   543    459   
   544         -install-html-am:
   545         -
   546    460   install-info: install-info-am
   547    461   
   548         -install-info-am:
   549         -
   550    462   install-man:
   551    463   
   552    464   install-pdf: install-pdf-am
   553    465   
   554         -install-pdf-am:
   555         -
   556    466   install-ps: install-ps-am
   557    467   
   558         -install-ps-am:
   559         -
   560    468   installcheck-am:
   561    469   
   562    470   maintainer-clean: maintainer-clean-am
   563    471   	-rm -rf ./$(DEPDIR)
   564    472   	-rm -f Makefile
   565    473   maintainer-clean-am: distclean-am maintainer-clean-generic
   566    474   
................................................................................
   590    498   	install-html-am install-info install-info-am install-man \
   591    499   	install-pdf install-pdf-am install-ps install-ps-am \
   592    500   	install-strip installcheck installcheck-am installdirs \
   593    501   	maintainer-clean maintainer-clean-generic mostlyclean \
   594    502   	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
   595    503   	pdf pdf-am ps ps-am tags uninstall uninstall-am \
   596    504   	uninstall-binPROGRAMS
   597         -
   598    505   
   599    506   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   600    507   # Otherwise a system limit (for SysV at least) may be exceeded.
   601    508   .NOEXPORT:

Changes to src/rasterlite_grid.c.

     1      1   /* 
     2      2   / rasterlite_grid.c
     3      3   /
     4      4   / a tool generating a GeoTIFF from am ASCII or BINARY Grid 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 28
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45     27   #include <stdlib.h>
    46     28   #include <stdio.h>
    47     29   #include <string.h>
    48     30   #include <float.h>
    49         -#include <math.h>
    50     31   #include <errno.h>
    51     32   #include <sys/types.h>
    52     33   
    53         -#include "rasterlite_tiff_hdrs.h"
           34  +#include <geotiff.h>
           35  +#include <xtiffio.h>
           36  +#include <geo_tiffp.h>
           37  +#include <geo_keyp.h>
           38  +#include <geovalues.h>
           39  +#include <geo_normalize.h>
    54     40   
    55     41   #if defined(_WIN32) && !defined(__MINGW32__)
    56     42   #include <io.h>
    57     43   #include <direct.h>
    58     44   #else
    59     45   #include <dirent.h>
    60     46   #endif
................................................................................
    67     53   #define ARG_GRID_PATH		1
    68     54   #define ARG_COLOR_PATH		2
    69     55   #define ARG_TIFF_PATH		3
    70     56   #define ARG_GRID_TYPE		4
    71     57   #define ARG_EPSG_CODE		5
    72     58   #define ARG_NODATA_COLOR	6
    73     59   #define ARG_PROJ4TEXT		7
    74         -#define ARG_MONO_COLOR		9
    75         -#define ARG_Z_FACTOR		10
    76         -#define ARG_SCALE			11
    77         -#define ARG_AZIMUTH			12
    78         -#define ARG_ALTITUDE		13
    79     60   
    80     61   #define ASCII_GRID	100
    81     62   #define FLOAT_GRID	101
    82     63   
    83     64   #define BYTE_ORDER_NONE	0
    84     65   #define BYTE_ORDER_BIG	1
    85     66   #define BYTE_ORDER_LITTLE	2
    86     67   
    87     68   struct colorTable
    88     69   {
    89         -/* a color table value range */
    90     70       double min;
    91     71       double max;
    92     72       unsigned char red;
    93     73       unsigned char green;
    94     74       unsigned char blue;
    95     75   };
    96     76   
    97         -struct triple_scan
    98         -{
    99         -/* the 3-scanlines object for Shaded Relief */
   100         -    int ncols;
   101         -    double z_factor;
   102         -    double scale_factor;
   103         -    double altitude;
   104         -    double azimuth;
   105         -    int mono_color;
   106         -    unsigned char mono_red;
   107         -    unsigned char mono_green;
   108         -    unsigned char mono_blue;
   109         -    float no_data_value;
   110         -    unsigned char no_red;
   111         -    unsigned char no_green;
   112         -    unsigned char no_blue;
   113         -    float *row1;
   114         -    float *row2;
   115         -    float *row3;
   116         -    float *current_row;
   117         -};
   118         -
   119         -static int
   120         -cmp_color_qsort (const void *p1, const void *p2)
   121         -{
   122         -/* compares two colorTable entries [for QSORT] */
   123         -    struct colorTable *pc1 = (struct colorTable *) p1;
   124         -    struct colorTable *pc2 = (struct colorTable *) p2;
   125         -    if (pc1->min > pc2->min)
   126         -	return 1;
   127         -    if (pc1->min < pc2->min)
   128         -	return -1;
   129         -    if (pc1->max > pc2->max)
   130         -	return 1;
   131         -    if (pc1->max < pc2->max)
   132         -	return -1;
   133         -    return 0;
   134         -}
   135         -
   136         -static int
   137         -cmp_color_bsearch (const void *p1, const void *p2)
   138         -{
   139         -/* compares two colorTable entries [for BSEARCH] */
   140         -    struct colorTable *pc1 = (struct colorTable *) p1;
   141         -    struct colorTable *pc2 = (struct colorTable *) p2;
   142         -    if (pc1->min >= pc2->min && pc1->min <= pc2->max)
   143         -	return 0;
   144         -    if (pc1->min > pc2->min)
   145         -	return 1;
   146         -    if (pc1->min < pc2->min)
   147         -	return -1;
   148         -    if (pc1->min > pc2->max)
   149         -	return 1;
   150         -    if (pc1->min < pc2->max)
   151         -	return -1;
   152         -    return 0;
   153         -}
   154         -
   155         -static int
   156         -match_color (struct colorTable *color_table, int colors, double value,
   157         -	     unsigned char *red, unsigned char *green, unsigned char *blue)
   158         -{
   159         -/* mapping a value into the corresponding color */
   160         -    struct colorTable *ret;
   161         -    struct colorTable src;
   162         -    src.min = value;
   163         -    ret =
   164         -	bsearch (&src, color_table, colors, sizeof (struct colorTable),
   165         -		 cmp_color_bsearch);
   166         -    if (ret)
   167         -      {
   168         -	  *red = ret->red;
   169         -	  *green = ret->green;
   170         -	  *blue = ret->blue;
   171         -	  return 1;
   172         -      }
   173         -    return 0;
   174         -}
   175         -
   176         -static struct triple_scan *
   177         -triple_alloc (int ncols)
   178         -{
   179         -/* allocating the 3-scanlines object */
   180         -    struct triple_scan *p = malloc (sizeof (struct triple_scan));
   181         -    p->ncols = ncols;
   182         -    p->row1 = malloc (sizeof (float) * ncols);
   183         -    p->row2 = malloc (sizeof (float) * ncols);
   184         -    p->row3 = malloc (sizeof (float) * ncols);
   185         -    p->current_row = p->row1;
   186         -    p->mono_color = 0;
   187         -    p->mono_red = 0;
   188         -    p->mono_green = 0;
   189         -    p->mono_blue = 0;
   190         -    p->no_data_value = 0.0;
   191         -    p->no_red = 0;
   192         -    p->no_green = 0;
   193         -    p->no_blue = 0;
   194         -    p->z_factor = 1.0;
   195         -    p->scale_factor = 1.0;
   196         -    p->altitude = 45.0;
   197         -    p->azimuth = 315.0;
   198         -    return p;
   199         -}
   200         -
   201         -static void
   202         -triple_free (struct triple_scan *p)
   203         -{
   204         -/* freeing the 3-scanlines object */
   205         -    free (p->row1);
   206         -    free (p->row2);
   207         -    free (p->row3);
   208         -    free (p);
   209         -}
   210         -
   211         -static void
   212         -triple_set_no_data (struct triple_scan *p, float no_data_value,
   213         -		    unsigned char no_red, unsigned char no_green,
   214         -		    unsigned char no_blue)
   215         -{
   216         -/* setting NODATA params */
   217         -    p->no_data_value = no_data_value;
   218         -    p->no_red = no_red;
   219         -    p->no_green = no_green;
   220         -    p->no_blue = no_blue;
   221         -}
   222         -
   223         -static void
   224         -triple_set_monochrome_params (struct triple_scan *p, int mono_color,
   225         -			      unsigned char mono_red, unsigned char mono_green,
   226         -			      unsigned char mono_blue)
   227         -{
   228         -/* setting ShadedRelief params */
   229         -    p->mono_color = mono_color;
   230         -    p->mono_red = mono_red;
   231         -    p->mono_green = mono_green;
   232         -    p->mono_blue = mono_blue;
   233         -}
   234         -
   235         -static void
   236         -triple_set_shaded_relief_params (struct triple_scan *p, double z, double scale,
   237         -				 double alt, double az)
   238         -{
   239         -/* setting ShadedRelief params */
   240         -    p->z_factor = z;
   241         -    p->scale_factor = scale;
   242         -    p->altitude = alt;
   243         -    p->azimuth = az;
   244         -}
   245         -
   246         -static void
   247         -triple_rotate (struct triple_scan *p)
   248         -{
   249         -/* rotating the 3-scanlines */
   250         -    if (p->current_row == p->row1)
   251         -      {
   252         -	  p->current_row = p->row2;
   253         -	  goto zero_init;
   254         -      }
   255         -    if (p->current_row == p->row2)
   256         -      {
   257         -	  p->current_row = p->row3;
   258         -	  goto zero_init;
   259         -      }
   260         -    p->current_row = p->row1;
   261         -    p->row1 = p->row2;
   262         -    p->row2 = p->row3;
   263         -    p->row3 = p->current_row;
   264         -  zero_init:
   265         -    memset (p->current_row, 0, sizeof (float) * p->ncols);
   266         -}
   267         -
   268         -static void
   269         -triple_store_cell (struct triple_scan *p, int icol, float value)
   270         -{
   271         -/* storing a cell value into 3-scanlines */
   272         -    if (icol < 0 || icol >= p->ncols)
   273         -	return;
   274         -    *(p->current_row + icol) = value;
   275         -}
   276         -
   277         -static int
   278         -triple_is_valid (struct triple_scan *p)
   279         -{
   280         -/* checking for validitity */
   281         -    if (p->current_row == p->row3)
   282         -	return 1;
   283         -    return 0;
   284         -}
   285         -
   286         -static void
   287         -triple_shaded_relief (struct triple_scan *p, unsigned char *raster)
   288         -{
   289         -/* creating a shaded relief scanline */
   290         -    int j;
   291         -    int n;
   292         -    double x;
   293         -    double y;
   294         -    double aspect;
   295         -    double slope;
   296         -    double cang;
   297         -    int gray;
   298         -    float afWin[9];
   299         -    const double degreesToRadians = M_PI / 180.0;
   300         -    const double altRadians = p->altitude * degreesToRadians;
   301         -    const double azRadians = p->azimuth * degreesToRadians;
   302         -    double red;
   303         -    double green;
   304         -    double blue;
   305         -    double alpha;
   306         -    int bContainsNull;
   307         -    unsigned char *p_raster = raster;
   308         -    unsigned char r;
   309         -    unsigned char g;
   310         -    unsigned char b;
   311         -
   312         -/*
   313         -/ Move a 3x3 pafWindow over each cell 
   314         -/ (where the cell in question is #4)
   315         -/ 
   316         -/      0 1 2
   317         -/      3 4 5
   318         -/      6 7 8
   319         -*/
   320         -    for (j = 0; j < p->ncols; j++)
   321         -      {
   322         -	  /* Exclude the edges */
   323         -	  if (j == 0 || j == p->ncols - 1)
   324         -	      continue;
   325         -
   326         -	  bContainsNull = 0;
   327         -
   328         -	  afWin[0] = p->row1[j - 1];
   329         -	  afWin[1] = p->row1[j];
   330         -	  afWin[2] = p->row1[j + 1];
   331         -	  afWin[3] = p->row2[j - 1];
   332         -	  afWin[4] = p->row2[j];
   333         -	  afWin[5] = p->row2[j + 1];
   334         -	  afWin[6] = p->row3[j - 1];
   335         -	  afWin[7] = p->row3[j];
   336         -	  afWin[8] = p->row3[j + 1];
   337         -
   338         -	  for (n = 0; n <= 8; n++)
   339         -	    {
   340         -		if (afWin[n] == p->no_data_value)
   341         -		  {
   342         -		      bContainsNull = 1;
   343         -		      break;
   344         -		  }
   345         -	    }
   346         -
   347         -	  if (bContainsNull)
   348         -	    {
   349         -		/* We have nulls so write nullValue and move on */
   350         -		r = p->no_red;
   351         -		g = p->no_green;
   352         -		b = p->no_blue;
   353         -	    }
   354         -	  else
   355         -	    {
   356         -		/* We have a valid 3x3 window. */
   357         -
   358         -		/* ---------------------------------------
   359         -		 * Compute Hillshade
   360         -		 */
   361         -
   362         -		/* First Slope ... */
   363         -		x = p->z_factor * ((afWin[0] + afWin[3] + afWin[3] + afWin[6]) -
   364         -				   (afWin[2] + afWin[5] + afWin[5] +
   365         -				    afWin[8])) / (8.0 * p->scale_factor);
   366         -
   367         -		y = p->z_factor * ((afWin[6] + afWin[7] + afWin[7] + afWin[8]) -
   368         -				   (afWin[0] + afWin[1] + afWin[1] +
   369         -				    afWin[2])) / (8.0 * p->scale_factor);
   370         -
   371         -		slope = M_PI / 2 - atan (sqrt (x * x + y * y));
   372         -
   373         -		/* ... then aspect... */
   374         -		aspect = atan2 (x, y);
   375         -
   376         -		/* ... then the shade value */
   377         -		cang = sin (altRadians) * sin (slope) +
   378         -		    cos (altRadians) * cos (slope) *
   379         -		    cos (azRadians - M_PI / 2 - aspect);
   380         -
   381         -		if (cang <= 0.0)
   382         -		    cang = 1.0;
   383         -		else
   384         -		    cang = 1.0 + (254.0 * cang);
   385         -
   386         -		if (p->mono_color)
   387         -		  {
   388         -		      /* using the monochrome base color + ALPHA */
   389         -		      alpha = cang / 255.0;
   390         -		      red = (double) (p->mono_red) * alpha;
   391         -		      green = (double) (p->mono_green) * alpha;
   392         -		      blue = (double) (p->mono_blue) * alpha;
   393         -		      if (red < 0.0)
   394         -			  red = 0.0;
   395         -		      if (green < 0.0)
   396         -			  green = 0.0;
   397         -		      if (blue < 0.0)
   398         -			  blue = 0.0;
   399         -		      if (red > 255.0)
   400         -			  red = 255.0;
   401         -		      if (green > 255.0)
   402         -			  green = 255.0;
   403         -		      if (blue > 255.0)
   404         -			  blue = 255.0;
   405         -		      r = (unsigned char) red;
   406         -		      g = (unsigned char) green;
   407         -		      b = (unsigned) blue;
   408         -		  }
   409         -		else
   410         -		  {
   411         -		      /* plain gray-scale */
   412         -		      gray = (int) cang;
   413         -		      r = (unsigned char) gray;
   414         -		      g = (unsigned char) gray;
   415         -		      b = (unsigned) gray;
   416         -		  }
   417         -	    }
   418         -	  *p_raster++ = r;
   419         -	  *p_raster++ = g;
   420         -	  *p_raster++ = b;
   421         -      }
   422         -}
   423         -
   424         -static int
   425         -triple_shaded_relief_color (struct colorTable *color_table, int colors,
   426         -			    struct triple_scan *p, unsigned char *raster,
   427         -			    int row)
   428         -{
   429         -/* creating a shaded relief color scanline */
   430         -    int j;
   431         -    int n;
   432         -    double x;
   433         -    double y;
   434         -    double aspect;
   435         -    double slope;
   436         -    double cang;
   437         -    float afWin[9];
   438         -    const double degreesToRadians = M_PI / 180.0;
   439         -    const double altRadians = p->altitude * degreesToRadians;
   440         -    const double azRadians = p->azimuth * degreesToRadians;
   441         -    double red;
   442         -    double green;
   443         -    double blue;
   444         -    double alpha;
   445         -    double thisValue;
   446         -    int bContainsNull;
   447         -    unsigned char *p_raster = raster;
   448         -    unsigned char r;
   449         -    unsigned char g;
   450         -    unsigned char b;
   451         -
   452         -/*
   453         -/ Move a 3x3 pafWindow over each cell 
   454         -/ (where the cell in question is #4)
   455         -/ 
   456         -/      0 1 2
   457         -/      3 4 5
   458         -/      6 7 8
   459         -*/
   460         -    for (j = 0; j < p->ncols; j++)
   461         -      {
   462         -	  /* Exclude the edges */
   463         -	  if (j == 0 || j == p->ncols - 1)
   464         -	      continue;
   465         -
   466         -	  bContainsNull = 0;
   467         -
   468         -	  afWin[0] = p->row1[j - 1];
   469         -	  afWin[1] = p->row1[j];
   470         -	  afWin[2] = p->row1[j + 1];
   471         -	  afWin[3] = p->row2[j - 1];
   472         -	  afWin[4] = p->row2[j];
   473         -	  afWin[5] = p->row2[j + 1];
   474         -	  afWin[6] = p->row3[j - 1];
   475         -	  afWin[7] = p->row3[j];
   476         -	  afWin[8] = p->row3[j + 1];
   477         -
   478         -	  thisValue = afWin[4];
   479         -
   480         -	  for (n = 0; n <= 8; n++)
   481         -	    {
   482         -		if (afWin[n] == p->no_data_value)
   483         -		  {
   484         -		      bContainsNull = 1;
   485         -		      break;
   486         -		  }
   487         -	    }
   488         -
   489         -	  if (bContainsNull)
   490         -	    {
   491         -		/* We have nulls so write nullValue and move on */
   492         -		r = p->no_red;
   493         -		g = p->no_green;
   494         -		b = p->no_blue;
   495         -	    }
   496         -	  else
   497         -	    {
   498         -		/* We have a valid 3x3 window. */
   499         -
   500         -		/* ---------------------------------------
   501         -		 * Compute Hillshade
   502         -		 */
   503         -
   504         -		/* First Slope ... */
   505         -		x = p->z_factor * ((afWin[0] + afWin[3] + afWin[3] + afWin[6]) -
   506         -				   (afWin[2] + afWin[5] + afWin[5] +
   507         -				    afWin[8])) / (8.0 * p->scale_factor);
   508         -
   509         -		y = p->z_factor * ((afWin[6] + afWin[7] + afWin[7] + afWin[8]) -
   510         -				   (afWin[0] + afWin[1] + afWin[1] +
   511         -				    afWin[2])) / (8.0 * p->scale_factor);
   512         -
   513         -		slope = M_PI / 2 - atan (sqrt (x * x + y * y));
   514         -
   515         -		/* ... then aspect... */
   516         -		aspect = atan2 (x, y);
   517         -
   518         -		/* ... then the shade value */
   519         -		cang = sin (altRadians) * sin (slope) +
   520         -		    cos (altRadians) * cos (slope) *
   521         -		    cos (azRadians - M_PI / 2 - aspect);
   522         -
   523         -		if (cang <= 0.0)
   524         -		    cang = 1.0;
   525         -		else
   526         -		    cang = 1.0 + (254.0 * cang);
   527         -
   528         -		/* merging the color + ALPHA */
   529         -		if (!match_color (color_table, colors, thisValue, &r, &g, &b))
   530         -		  {
   531         -		      printf
   532         -			  ("Grid row %d: unmatched value %1.8f; color not found\n",
   533         -			   row, thisValue);
   534         -		      return 0;
   535         -		  }
   536         -		alpha = cang / 255.0;
   537         -		red = (double) r *alpha;
   538         -		green = (double) g *alpha;
   539         -		blue = (double) b *alpha;
   540         -		if (red < 0.0)
   541         -		    red = 0.0;
   542         -		if (green < 0.0)
   543         -		    green = 0.0;
   544         -		if (blue < 0.0)
   545         -		    blue = 0.0;
   546         -		if (red > 255.0)
   547         -		    red = 255.0;
   548         -		if (green > 255.0)
   549         -		    green = 255.0;
   550         -		if (blue > 255.0)
   551         -		    blue = 255.0;
   552         -		r = (unsigned char) red;
   553         -		g = (unsigned char) green;
   554         -		b = (unsigned) blue;
   555         -	    }
   556         -	  *p_raster++ = r;
   557         -	  *p_raster++ = g;
   558         -	  *p_raster++ = b;
   559         -      }
   560         -    return 1;
   561         -}
   562         -
   563     77   static int
   564     78   parse_hex (const char hi, const char lo)
   565     79   {
   566     80   /* parsing an hexedecimal value XX */
   567     81       int hex;
   568     82       switch (hi)
   569     83         {
................................................................................
   836    350   	    }
   837    351   	  return 1;
   838    352         }
   839    353       return 0;
   840    354   }
   841    355   
   842    356   static struct colorTable *
   843         -parse_color_table (const char *path, int *count)
          357  +parse_color_table (const char *path)
   844    358   {
   845    359   /* parsing the Color Table */
   846    360       double min;
   847    361       double max;
   848    362       unsigned char red;
   849    363       unsigned char green;
   850    364       unsigned char blue;
................................................................................
   886    400   		ptr = buf;
   887    401   		continue;
   888    402   	    }
   889    403   	  *ptr++ = c;
   890    404         }
   891    405       if (lines == 0 || error > 0)
   892    406   	return NULL;
   893         -    table = malloc (sizeof (struct colorTable) * (lines));
          407  +    table = malloc (sizeof (struct colorTable) * (lines + 1));
          408  +/* marking the last (stop) table item */
          409  +    (table + lines)->min = DBL_MAX;
          410  +    (table + lines)->max = DBL_MAX;
          411  +    (table + lines)->red = 0;
          412  +    (table + lines)->green = 0;
          413  +    (table + lines)->blue = 0;
   894    414   /* closing and reopening the Color Table file */
   895    415       fclose (in);
   896    416       in = fopen (path, "rb");
   897    417       if (!in)
   898    418         {
   899    419   	  printf ("Re-Open error: %s\n", path);
   900    420   	  return NULL;
................................................................................
   937    457         {
   938    458   	  /* unexected error */
   939    459   	  fprintf (stderr, "ColorTable: unexpected read error\n");
   940    460   	  free (table);
   941    461   	  table = NULL;
   942    462         }
   943    463       fclose (in);
   944         -/* sorting the color table */
   945         -    *count = lines;
   946         -    qsort (table, lines, sizeof (struct colorTable), cmp_color_qsort);
   947    464       return table;
   948    465   }
   949    466   
   950    467   static int
   951    468   parseIntHeader (const char *row, const char *tag, int *value)
   952    469   {
   953    470   /* parsing an Integer value Header */
................................................................................
   987    504   	  *value = BYTE_ORDER_BIG;
   988    505   	  return 1;
   989    506         }
   990    507       return 0;
   991    508   }
   992    509   
   993    510   static int
   994         -fetch_scanline (int row, struct colorTable *color_table, int colors, FILE * asc,
          511  +match_color (struct colorTable *color_table, double value, unsigned char *red,
          512  +	     unsigned char *green, unsigned char *blue)
          513  +{
          514  +/* mapping a value into the corresponding color */
          515  +    struct colorTable *p = color_table;
          516  +    while (p)
          517  +      {
          518  +	  if (p->min == DBL_MAX)
          519  +	      return 0;
          520  +	  if (value >= p->min && value <= p->max)
          521  +	    {
          522  +		*red = p->red;
          523  +		*green = p->green;
          524  +		*blue = p->blue;
          525  +		return 1;
          526  +	    }
          527  +	  p++;
          528  +      }
          529  +    return 0;
          530  +}
          531  +
          532  +static int
          533  +fetch_scanline (int row, struct colorTable *color_table, FILE * asc,
   995    534   		unsigned char *raster, int columns, double nodata,
   996    535   		unsigned char no_red, unsigned char no_green,
   997    536   		unsigned char no_blue)
   998    537   {
   999    538   /* feeding a TIFF scanline from an ASCII Grid */
  1000    539       int c;
  1001    540       int cell = 0;
................................................................................
  1026    565   		  {
  1027    566   		      *p_raster++ = no_red;
  1028    567   		      *p_raster++ = no_green;
  1029    568   		      *p_raster++ = no_blue;
  1030    569   		  }
  1031    570   		else
  1032    571   		  {
  1033         -		      if (match_color
  1034         -			  (color_table, colors, value, &red, &green, &blue))
          572  +		      if (match_color (color_table, value, &red, &green, &blue))
  1035    573   			{
  1036    574   			    *p_raster++ = red;
  1037    575   			    *p_raster++ = green;
  1038    576   			    *p_raster++ = blue;
  1039    577   			}
  1040    578   		      else
  1041    579   			{
................................................................................
  1115    653       convert.int_value = 1;
  1116    654       if (convert.byte[0] == 0)
  1117    655   	return 0;
  1118    656       return 1;
  1119    657   }
  1120    658   
  1121    659   static int
  1122         -fetch_float_scanline (int row, struct colorTable *color_table, int colors,
          660  +fetch_float_scanline (int row, struct colorTable *color_table,
  1123    661   		      unsigned char *floats, unsigned char *raster, int columns,
  1124    662   		      double nodata, unsigned char no_red,
  1125    663   		      unsigned char no_green, unsigned char no_blue,
  1126    664   		      int byteorder)
  1127    665   {
  1128    666   /* feeding a TIFF scanline from a FLOAT Grid */
  1129    667       int cell = 0;
................................................................................
  1141    679   	    {
  1142    680   		*p_raster++ = no_red;
  1143    681   		*p_raster++ = no_green;
  1144    682   		*p_raster++ = no_blue;
  1145    683   	    }
  1146    684   	  else
  1147    685   	    {
  1148         -		if (match_color
  1149         -		    (color_table, colors, value, &red, &green, &blue))
          686  +		if (match_color (color_table, value, &red, &green, &blue))
  1150    687   		  {
  1151    688   		      *p_raster++ = red;
  1152    689   		      *p_raster++ = green;
  1153    690   		      *p_raster++ = blue;
  1154    691   		  }
  1155    692   		else
  1156    693   		  {
................................................................................
  1162    699   	    }
  1163    700   	  ptr += sizeof (float);
  1164    701         }
  1165    702       return 1;
  1166    703   }
  1167    704   
  1168    705   static void
  1169         -export_geoTiff_float (struct colorTable *color_table, int colors,
  1170         -		      const char *proj4text, const char *grid_path,
  1171         -		      const char *tiff_path, unsigned char no_red,
  1172         -		      unsigned char no_green, unsigned char no_blue,
  1173         -		      int verbose)
          706  +export_geoTiff_float (struct colorTable *color_table, const char *proj4text,
          707  +		      const char *grid_path, const char *tiff_path,
          708  +		      unsigned char no_red, unsigned char no_green,
          709  +		      unsigned char no_blue, int verbose)
  1174    710   {
  1175    711   /* exporting a FLOAT GRID as GeoTIFF */
  1176    712       TIFF *tiff = NULL;
  1177    713       GTIF *gtif = NULL;
  1178    714       int byteorder = BYTE_ORDER_NONE;
  1179    715       int c;
  1180    716       int row = 0;
................................................................................
  1320    856   	  if (rd != (sizeof (float) * ncols))
  1321    857   	    {
  1322    858   		printf ("*** Grid read error ***\n");
  1323    859   		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1324    860   		goto stop;
  1325    861   	    }
  1326    862   	  if (fetch_float_scanline
  1327         -	      (row + 1, color_table, colors, flt_buf, raster, ncols, nodata,
  1328         -	       no_red, no_green, no_blue, byteorder))
          863  +	      (row + 1, color_table, flt_buf, raster, ncols, nodata, no_red,
          864  +	       no_green, no_blue, byteorder))
  1329    865   	    {
  1330    866   		if (TIFFWriteScanline (tiff, raster, row, 0) < 0)
  1331    867   		  {
  1332    868   		      printf ("\tTIFF write error @ row=%d\n", row);
  1333    869   		      printf
  1334    870   			  ("An invalid GeoTIFF was generated ... aborting ...\n");
  1335    871   		      goto stop;
................................................................................
  1352    888   	free (raster);
  1353    889       if (flt_buf)
  1354    890   	free (flt_buf);
  1355    891       fclose (grid);
  1356    892   }
  1357    893   
  1358    894   static void
  1359         -export_geoTiff_ascii (struct colorTable *color_table, int colors,
  1360         -		      const char *proj4text, const char *grid_path,
  1361         -		      const char *tiff_path, unsigned char no_red,
  1362         -		      unsigned char no_green, unsigned char no_blue,
  1363         -		      int verbose)
          895  +export_geoTiff_ascii (struct colorTable *color_table, const char *proj4text,
          896  +		      const char *grid_path, const char *tiff_path,
          897  +		      unsigned char no_red, unsigned char no_green,
          898  +		      unsigned char no_blue, int verbose)
  1364    899   {
  1365    900   /* exporting an ASCII GRID as GeoTIFF */
  1366    901       TIFF *tiff = NULL;
  1367    902       GTIF *gtif = NULL;
  1368    903       int c;
  1369    904       int row = 0;
  1370    905       char buf[1024];
................................................................................
  1480   1015         {
  1481   1016   	  if (verbose)
  1482   1017   	    {
  1483   1018   		fprintf (stderr, "writing scanline %d of %d\n", row + 1, nrows);
  1484   1019   		fflush (stderr);
  1485   1020   	    }
  1486   1021   	  if (fetch_scanline
  1487         -	      (row + 1, color_table, colors, asc, raster, ncols, nodata, no_red,
         1022  +	      (row + 1, color_table, asc, raster, ncols, nodata, no_red,
  1488   1023   	       no_green, no_blue))
  1489   1024   	    {
  1490   1025   		if (TIFFWriteScanline (tiff, raster, row, 0) < 0)
  1491   1026   		  {
  1492   1027   		      printf ("\tTIFF write error @ row=%d\n", row);
  1493   1028   		      printf
  1494   1029   			  ("An invalid GeoTIFF was generated ... aborting ...\n");
................................................................................
  1509   1044       if (tiff)
  1510   1045   	XTIFFClose (tiff);
  1511   1046       if (raster)
  1512   1047   	free (raster);
  1513   1048       fclose (asc);
  1514   1049   }
  1515   1050   
  1516         -static int
  1517         -fetch_float_scanline_shaded (unsigned char *floats, int columns,
  1518         -			     int byteorder, struct triple_scan *triplet)
  1519         -{
  1520         -/* feeding a TIFF scanline from a FLOAT Grid */
  1521         -    int cell = 0;
  1522         -    double value;
  1523         -    unsigned char *ptr = floats;
  1524         -    int endian_arch = check_endian_arch ();
  1525         -    for (cell = 0; cell < columns; cell++)
  1526         -      {
  1527         -	  value = fetch_float (ptr, byteorder, endian_arch);
  1528         -	  triple_store_cell (triplet, cell, (float) value);
  1529         -	  ptr += sizeof (float);
  1530         -      }
  1531         -    return 1;
  1532         -}
  1533         -
  1534         -static void
  1535         -export_geoTiff_shaded_float (struct colorTable *color_table, int colors,
  1536         -			     const char *proj4text, const char *grid_path,
  1537         -			     const char *tiff_path, unsigned char no_red,
  1538         -			     unsigned char no_green, unsigned char no_blue,
  1539         -			     int mono_color, unsigned char mono_red,
  1540         -			     unsigned char mono_green, unsigned char mono_blue,
  1541         -			     double z_factor, double scale_factor,
  1542         -			     double azimuth, double altitude, int verbose)
  1543         -{
  1544         -/* exporting a FLOAT GRID as GeoTIFF */
  1545         -    TIFF *tiff = NULL;
  1546         -    GTIF *gtif = NULL;
  1547         -    int byteorder = BYTE_ORDER_NONE;
  1548         -    int c;
  1549         -    int row = 0;
  1550         -    char buf[1024];
  1551         -    char path[1024];
  1552         -    char *ptr = buf;
  1553         -    int err = 0;
  1554         -    int ncols = -1;
  1555         -    int nrows = -1;
  1556         -    double xllcorner = 0.0;
  1557         -    double yllcorner = 0.0;
  1558         -    double cellsize = 0.0;
  1559         -    double nodata = 0.0;
  1560         -    double tiepoint[6];
  1561         -    double pixsize[3];
  1562         -    struct triple_scan *triplet = NULL;
  1563         -    unsigned char *raster = NULL;
  1564         -    unsigned char *flt_buf = NULL;
  1565         -    size_t rd;
  1566         -    FILE *grid;
  1567         -
  1568         -/* parsing the Grid Header .hdr */
  1569         -    sprintf (path, "%s.hdr", grid_path);
  1570         -    grid = fopen (path, "rb");
  1571         -    if (!grid)
  1572         -      {
  1573         -	  printf ("Open error: %s\n", path);
  1574         -	  return;
  1575         -      }
  1576         -    while ((c = getc (grid)) != EOF)
  1577         -      {
  1578         -	  if (c == '\r')
  1579         -	    {
  1580         -		/* ignoring Return chars */
  1581         -		continue;
  1582         -	    }
  1583         -	  if (c == '\n')
  1584         -	    {
  1585         -		*ptr = '\0';
  1586         -		switch (row)
  1587         -		  {
  1588         -		  case 0:
  1589         -		      if (!parseIntHeader (buf, "ncols ", &ncols))
  1590         -			  err = 1;
  1591         -		      break;
  1592         -		  case 1:
  1593         -		      if (!parseIntHeader (buf, "nrows ", &nrows))
  1594         -			  err = 1;
  1595         -		      break;
  1596         -		  case 2:
  1597         -		      if (!parseDblHeader (buf, "xllcorner ", &xllcorner))
  1598         -			  err = 1;
  1599         -		      break;
  1600         -		  case 3:
  1601         -		      if (!parseDblHeader (buf, "yllcorner ", &yllcorner))
  1602         -			  err = 1;
  1603         -		      break;
  1604         -		  case 4:
  1605         -		      if (!parseDblHeader (buf, "cellsize ", &cellsize))
  1606         -			  err = 1;
  1607         -		      break;
  1608         -		  case 5:
  1609         -		      if (!parseDblHeader (buf, "NODATA_value ", &nodata))
  1610         -			  err = 1;
  1611         -		      break;
  1612         -		  case 6:
  1613         -		      if (!parseOrderHeader (buf, "byteorder ", &byteorder))
  1614         -			  err = 1;
  1615         -		      break;
  1616         -		  };
  1617         -		ptr = buf;
  1618         -		row++;
  1619         -		if (row == 7)
  1620         -		    break;
  1621         -		continue;
  1622         -	    }
  1623         -	  *ptr++ = c;
  1624         -      }
  1625         -    if (err)
  1626         -      {
  1627         -	  /* there was some error */
  1628         -	  printf ("Invalid FLOAT Grid Header format in: %s\n", path);
  1629         -	  goto stop;
  1630         -      }
  1631         -    fclose (grid);
  1632         -
  1633         -/* resizing CellSize */
  1634         -    cellsize = (cellsize * (double) ncols) / (double) (ncols - 2);
  1635         -
  1636         -/* parsing the Grid Cells .flt */
  1637         -    sprintf (path, "%s.flt", grid_path);
  1638         -    grid = fopen (path, "rb");
  1639         -    if (!grid)
  1640         -      {
  1641         -	  printf ("Open error: %s\n", path);
  1642         -	  return;
  1643         -      }
  1644         -/* creating the GeoTIFF file */
  1645         -    tiff = XTIFFOpen (tiff_path, "w");
  1646         -    if (!tiff)
  1647         -      {
  1648         -	  printf ("\tCould not open TIFF image '%s'\n", tiff_path);
  1649         -	  goto stop;
  1650         -      }
  1651         -    gtif = GTIFNew (tiff);
  1652         -    if (!gtif)
  1653         -      {
  1654         -	  printf ("\tCould not open GeoTIFF image '%s'\n", tiff_path);
  1655         -	  goto stop;
  1656         -      }
  1657         -
  1658         -/* writing the TIFF Tags */
  1659         -    TIFFSetField (tiff, TIFFTAG_IMAGEWIDTH, ncols - 2);
  1660         -    TIFFSetField (tiff, TIFFTAG_IMAGELENGTH, nrows - 2);
  1661         -    TIFFSetField (tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
  1662         -    TIFFSetField (tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
  1663         -    TIFFSetField (tiff, TIFFTAG_ROWSPERSTRIP, 1);
  1664         -    TIFFSetField (tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
  1665         -    TIFFSetField (tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
  1666         -    TIFFSetField (tiff, TIFFTAG_BITSPERSAMPLE, 8);
  1667         -    TIFFSetField (tiff, TIFFTAG_SAMPLESPERPIXEL, 3);
  1668         -
  1669         -/* writing the GeoTIFF Tags */
  1670         -    pixsize[0] = cellsize;
  1671         -    pixsize[1] = cellsize;
  1672         -    pixsize[2] = 0.0;
  1673         -    TIFFSetField (tiff, GTIFF_PIXELSCALE, 3, pixsize);
  1674         -    tiepoint[0] = 0.0;
  1675         -    tiepoint[1] = 0.0;
  1676         -    tiepoint[2] = 0.0;
  1677         -    tiepoint[3] = xllcorner;
  1678         -    tiepoint[4] = yllcorner + (cellsize * nrows);
  1679         -    tiepoint[5] = 0.0;
  1680         -    TIFFSetField (tiff, GTIFF_TIEPOINTS, 6, tiepoint);
  1681         -    GTIFSetFromProj4 (gtif, proj4text);
  1682         -    GTIFWriteKeys (gtif);
  1683         -    raster = malloc (ncols * 3);
  1684         -    flt_buf = malloc (sizeof (float) * ncols);
  1685         -
  1686         -/* initializing the TripleRow object */
  1687         -    triplet = triple_alloc (ncols);
  1688         -    triple_set_shaded_relief_params (triplet, z_factor, scale_factor, altitude,
  1689         -				     azimuth);
  1690         -    triple_set_monochrome_params (triplet, mono_color, mono_red, mono_green,
  1691         -				  mono_blue);
  1692         -    triple_set_no_data (triplet, (float) nodata, no_red, no_green, no_blue);
  1693         -
  1694         -    for (row = 0; row < nrows; row++)
  1695         -      {
  1696         -	  if (verbose)
  1697         -	    {
  1698         -		fprintf (stderr, "writing scanline %d of %d\n", row + 1, nrows);
  1699         -		fflush (stderr);
  1700         -	    }
  1701         -	  rd = fread (flt_buf, 1, ncols * sizeof (float), grid);
  1702         -	  if (rd != (sizeof (float) * ncols))
  1703         -	    {
  1704         -		printf ("*** Grid read error ***\n");
  1705         -		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1706         -		goto stop;
  1707         -	    }
  1708         -	  if (fetch_float_scanline_shaded (flt_buf, ncols, byteorder, triplet))
  1709         -	    {
  1710         -		if (triple_is_valid (triplet))
  1711         -		  {
  1712         -		      int ret = 1;
  1713         -		      if (!color_table)
  1714         -			  triple_shaded_relief (triplet, raster);
  1715         -		      else
  1716         -			  ret =
  1717         -			      triple_shaded_relief_color (color_table, colors,
  1718         -							  triplet, raster,
  1719         -							  row + 1);
  1720         -		      if (!ret)
  1721         -			  goto stop;
  1722         -		      if (TIFFWriteScanline (tiff, raster, row - 2, 0) < 0)
  1723         -			{
  1724         -			    printf ("\tTIFF write error @ row=%d\n", row);
  1725         -			    printf
  1726         -				("An invalid GeoTIFF was generated ... aborting ...\n");
  1727         -			    goto stop;
  1728         -			}
  1729         -		  }
  1730         -		triple_rotate (triplet);
  1731         -	    }
  1732         -	  else
  1733         -	    {
  1734         -		printf ("*** Grid read error ***\n");
  1735         -		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1736         -		goto stop;
  1737         -	    }
  1738         -      }
  1739         -
  1740         -  stop:
  1741         -    if (gtif)
  1742         -	GTIFFree (gtif);
  1743         -    if (tiff)
  1744         -	XTIFFClose (tiff);
  1745         -    if (raster)
  1746         -	free (raster);
  1747         -    if (flt_buf)
  1748         -	free (flt_buf);
  1749         -    fclose (grid);
  1750         -    if (triplet)
  1751         -	triple_free (triplet);
  1752         -}
  1753         -
  1754         -static int
  1755         -fetch_scanline_shaded (int row, FILE * asc, int columns,
  1756         -		       struct triple_scan *triplet)
  1757         -{
  1758         -/* feeding a TIFF scanline from an ASCII Grid */
  1759         -    int c;
  1760         -    int cell = 0;
  1761         -    char buf[1024];
  1762         -    char *ptr = buf;
  1763         -    double value;
  1764         -    while ((c = getc (asc)) != EOF)
  1765         -      {
  1766         -	  if (c == '\n')
  1767         -	      break;
  1768         -	  *ptr++ = c;
  1769         -	  if (c == ' ')
  1770         -	    {
  1771         -		/* value delimiter */
  1772         -		*ptr = '\0';
  1773         -		cell++;
  1774         -		if (cell > columns)
  1775         -		  {
  1776         -		      printf ("Grid row %d: exceding column\n", row);
  1777         -		      return 0;
  1778         -		  }
  1779         -		value = atof (buf);
  1780         -		triple_store_cell (triplet, cell, (float) value);
  1781         -		ptr = buf;
  1782         -	    }
  1783         -      }
  1784         -    return 1;
  1785         -}
  1786         -
  1787         -static void
  1788         -export_geoTiff_shaded_ascii (struct colorTable *color_table, int colors,
  1789         -			     const char *proj4text, const char *grid_path,
  1790         -			     const char *tiff_path, unsigned char no_red,
  1791         -			     unsigned char no_green, unsigned char no_blue,
  1792         -			     int mono_color, unsigned char mono_red,
  1793         -			     unsigned char mono_green, unsigned char mono_blue,
  1794         -			     double z_factor, double scale_factor,
  1795         -			     double azimuth, double altitude, int verbose)
  1796         -{
  1797         -/* exporting an ASCII GRID as GeoTIFF */
  1798         -    TIFF *tiff = NULL;
  1799         -    GTIF *gtif = NULL;
  1800         -    int c;
  1801         -    int row = 0;
  1802         -    char buf[1024];
  1803         -    char *ptr = buf;
  1804         -    int err = 0;
  1805         -    int ncols = -1;
  1806         -    int nrows = -1;
  1807         -    double xllcorner = 0.0;
  1808         -    double yllcorner = 0.0;
  1809         -    double cellsize = 0.0;
  1810         -    double nodata = 0.0;
  1811         -    double tiepoint[6];
  1812         -    double pixsize[3];
  1813         -    unsigned char *raster = NULL;
  1814         -    struct triple_scan *triplet = NULL;
  1815         -    FILE *asc = fopen (grid_path, "rb");
  1816         -    if (!asc)
  1817         -      {
  1818         -	  printf ("Open error: %s\n", grid_path);
  1819         -	  return;
  1820         -      }
  1821         -    while ((c = getc (asc)) != EOF)
  1822         -      {
  1823         -	  if (c == '\r')
  1824         -	    {
  1825         -		/* ignoring Return chars */
  1826         -		continue;
  1827         -	    }
  1828         -	  if (c == '\n')
  1829         -	    {
  1830         -		*ptr = '\0';
  1831         -		switch (row)
  1832         -		  {
  1833         -		  case 0:
  1834         -		      if (!parseIntHeader (buf, "ncols ", &ncols))
  1835         -			  err = 1;
  1836         -		      break;
  1837         -		  case 1:
  1838         -		      if (!parseIntHeader (buf, "nrows ", &nrows))
  1839         -			  err = 1;
  1840         -		      break;
  1841         -		  case 2:
  1842         -		      if (!parseDblHeader (buf, "xllcorner ", &xllcorner))
  1843         -			  err = 1;
  1844         -		      break;
  1845         -		  case 3:
  1846         -		      if (!parseDblHeader (buf, "yllcorner ", &yllcorner))
  1847         -			  err = 1;
  1848         -		      break;
  1849         -		  case 4:
  1850         -		      if (!parseDblHeader (buf, "cellsize ", &cellsize))
  1851         -			  err = 1;
  1852         -		      break;
  1853         -		  case 5:
  1854         -		      if (!parseDblHeader (buf, "NODATA_value ", &nodata))
  1855         -			  err = 1;
  1856         -		      break;
  1857         -		  };
  1858         -		ptr = buf;
  1859         -		row++;
  1860         -		if (row == 6)
  1861         -		    break;
  1862         -		continue;
  1863         -	    }
  1864         -	  *ptr++ = c;
  1865         -      }
  1866         -    if (err)
  1867         -      {
  1868         -	  /* there was some error */
  1869         -	  printf ("Invalid ASCII Grid format in: %s\n", grid_path);
  1870         -	  goto stop;
  1871         -      }
  1872         -
  1873         -/* resizing CellSize */
  1874         -    cellsize = (cellsize * (double) ncols) / (double) (ncols - 2);
  1875         -
  1876         -/* creating the GeoTIFF file */
  1877         -    tiff = XTIFFOpen (tiff_path, "w");
  1878         -    if (!tiff)
  1879         -      {
  1880         -	  printf ("\tCould not open TIFF image '%s'\n", tiff_path);
  1881         -	  goto stop;
  1882         -      }
  1883         -    gtif = GTIFNew (tiff);
  1884         -    if (!gtif)
  1885         -      {
  1886         -	  printf ("\tCould not open GeoTIFF image '%s'\n", tiff_path);
  1887         -	  goto stop;
  1888         -      }
  1889         -
  1890         -/* writing the TIFF Tags */
  1891         -    TIFFSetField (tiff, TIFFTAG_IMAGEWIDTH, ncols - 2);
  1892         -    TIFFSetField (tiff, TIFFTAG_IMAGELENGTH, nrows - 2);
  1893         -    TIFFSetField (tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
  1894         -    TIFFSetField (tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
  1895         -    TIFFSetField (tiff, TIFFTAG_ROWSPERSTRIP, 1);
  1896         -    TIFFSetField (tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
  1897         -    TIFFSetField (tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
  1898         -    TIFFSetField (tiff, TIFFTAG_BITSPERSAMPLE, 8);
  1899         -    TIFFSetField (tiff, TIFFTAG_SAMPLESPERPIXEL, 3);
  1900         -
  1901         -/* writing the GeoTIFF Tags */
  1902         -    pixsize[0] = cellsize;
  1903         -    pixsize[1] = cellsize;
  1904         -    pixsize[2] = 0.0;
  1905         -    TIFFSetField (tiff, GTIFF_PIXELSCALE, 3, pixsize);
  1906         -    tiepoint[0] = 0.0;
  1907         -    tiepoint[1] = 0.0;
  1908         -    tiepoint[2] = 0.0;
  1909         -    tiepoint[3] = xllcorner;
  1910         -    tiepoint[4] = yllcorner + (cellsize * nrows);
  1911         -    tiepoint[5] = 0.0;
  1912         -    TIFFSetField (tiff, GTIFF_TIEPOINTS, 6, tiepoint);
  1913         -    GTIFSetFromProj4 (gtif, proj4text);
  1914         -    GTIFWriteKeys (gtif);
  1915         -    raster = malloc (ncols * 3);
  1916         -
  1917         -/* initializing the TripleRow object */
  1918         -    triplet = triple_alloc (ncols);
  1919         -    triple_set_shaded_relief_params (triplet, z_factor, scale_factor, altitude,
  1920         -				     azimuth);
  1921         -    triple_set_monochrome_params (triplet, mono_color, mono_red, mono_green,
  1922         -				  mono_blue);
  1923         -    triple_set_no_data (triplet, (float) nodata, no_red, no_green, no_blue);
  1924         -
  1925         -    for (row = 0; row < nrows; row++)
  1926         -      {
  1927         -	  if (verbose)
  1928         -	    {
  1929         -		fprintf (stderr, "writing scanline %d of %d\n", row + 1, nrows);
  1930         -		fflush (stderr);
  1931         -	    }
  1932         -	  if (fetch_scanline_shaded (row + 1, asc, ncols, triplet))
  1933         -	    {
  1934         -		if (triple_is_valid (triplet))
  1935         -		  {
  1936         -		      int ret = 1;
  1937         -		      if (!color_table)
  1938         -			  triple_shaded_relief (triplet, raster);
  1939         -		      else
  1940         -			  ret =
  1941         -			      triple_shaded_relief_color (color_table, colors,
  1942         -							  triplet, raster,
  1943         -							  row + 1);
  1944         -		      if (!ret)
  1945         -			  goto stop;
  1946         -		      if (TIFFWriteScanline (tiff, raster, row - 2, 0) < 0)
  1947         -			{
  1948         -			    printf ("\tTIFF write error @ row=%d\n", row);
  1949         -			    printf
  1950         -				("An invalid GeoTIFF was generated ... aborting ...\n");
  1951         -			    goto stop;
  1952         -			}
  1953         -		  }
  1954         -		triple_rotate (triplet);
  1955         -	    }
  1956         -	  else
  1957         -	    {
  1958         -		printf ("*** Grid read error ***\n");
  1959         -		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1960         -		goto stop;
  1961         -	    }
  1962         -      }
  1963         -
  1964         -  stop:
  1965         -    if (gtif)
  1966         -	GTIFFree (gtif);
  1967         -    if (tiff)
  1968         -	XTIFFClose (tiff);
  1969         -    if (raster)
  1970         -	free (raster);
  1971         -    fclose (asc);
  1972         -    if (triplet)
  1973         -	triple_free (triplet);
  1974         -}
  1975         -
  1976   1051   static void
  1977   1052   do_help ()
  1978   1053   {
  1979   1054   /* printing the argument list */
  1980   1055       fprintf (stderr, "\n\nusage: rasterlite_grid ARGLIST\n");
  1981   1056       fprintf (stderr,
  1982   1057   	     "==============================================================\n");
................................................................................
  1989   1064       fprintf (stderr,
  1990   1065   	     "-t or --tiff-path     pathname    the GeoTIFF path (output)\n");
  1991   1066       fprintf (stderr,
  1992   1067   	     "-p or --proj4text     proj4text   the PROJ.4 parameters\n");
  1993   1068       fprintf (stderr, "-f or --grid-format   grid-type   [ASCII | FLOAT]\n");
  1994   1069       fprintf (stderr,
  1995   1070   	     "-n or --nodata-color  0xRRGGBB    [default = 0x000000]\n");
  1996         -    fprintf (stderr, "-v or --verbose                   verbose output\n\n");
  1997         -    fprintf (stderr, "Shaded Relief specific arguments:\n");
  1998         -    fprintf (stderr, "---------------------------------\n");
  1999         -    fprintf (stderr,
  2000         -	     "-sr or --shaded-relief            *disabled by default*\n");
  2001         -    fprintf (stderr, "-m or --monochrome    0xRRGGBB    [default = none]\n");
  2002         -    fprintf (stderr, "-z or --z-factor      numeric     [default = 1.0]\n");
  2003         -    fprintf (stderr, "-s or --scale-factor  numeric     [default = 1.0]\n");
  2004         -    fprintf (stderr, "-az or --azimuth      numeric     [default = 315.0]\n");
  2005         -    fprintf (stderr, "-al or --altitude     numeric     [default = 45.0]\n\n");
  2006         -    fprintf (stderr, "Please note: --monochrome and --color-path are\n");
  2007         -    fprintf (stderr, "mutually exclusive options\n");
         1071  +    fprintf (stderr, "-v or --verbose                   verbose output\n");
  2008   1072   }
  2009   1073   
  2010   1074   int
  2011   1075   main (int argc, char *argv[])
  2012   1076   {
  2013   1077   /* the MAIN function simply perform arguments checking */
  2014   1078       int i;
................................................................................
  2021   1085       int verbose = 0;
  2022   1086       int error = 0;
  2023   1087       struct colorTable *color_table = NULL;
  2024   1088       unsigned char no_red = 0;
  2025   1089       unsigned char no_green = 0;
  2026   1090       unsigned char no_blue = 0;
  2027   1091       char error_nodata_color[1024];
  2028         -    int shaded_relief = 0;
  2029         -    int mono_color = 0;
  2030         -    unsigned char mono_red = 0;
  2031         -    unsigned char mono_green = 0;
  2032         -    unsigned char mono_blue = 0;
  2033         -    char error_mono_color[1024];
  2034         -    double z_factor = 1.0;
  2035         -    double scale_factor = 1.0;
  2036         -    double azimuth = 315.0;
  2037         -    double altitude = 45.0;
  2038         -    int colors;
  2039   1092       *error_nodata_color = '\0';
  2040         -    *error_mono_color = '\0';
  2041   1093       for (i = 1; i < argc; i++)
  2042   1094         {
  2043   1095   	  /* parsing the invocation arguments */
  2044   1096   	  if (next_arg != ARG_NONE)
  2045   1097   	    {
  2046   1098   		switch (next_arg)
  2047   1099   		  {
................................................................................
  2063   1115   		      if (strcasecmp (argv[i], "FLOAT") == 0)
  2064   1116   			  grid_type = FLOAT_GRID;
  2065   1117   		      break;
  2066   1118   		  case ARG_NODATA_COLOR:
  2067   1119   		      if (!parse_rgb (argv[i], &no_red, &no_green, &no_blue))
  2068   1120   			  strcpy (error_nodata_color, argv[i]);
  2069   1121   		      break;
  2070         -		  case ARG_MONO_COLOR:
  2071         -		      if (!parse_rgb
  2072         -			  (argv[i], &mono_red, &mono_green, &mono_blue))
  2073         -			  strcpy (error_mono_color, argv[i]);
  2074         -		      else
  2075         -			  mono_color = 1;
  2076         -		      break;
  2077         -		  case ARG_Z_FACTOR:
  2078         -		      z_factor = atof (argv[i]);
  2079         -		      break;
  2080         -		  case ARG_SCALE:
  2081         -		      scale_factor = atof (argv[i]);
  2082         -		      break;
  2083         -		  case ARG_AZIMUTH:
  2084         -		      azimuth = atof (argv[i]);
  2085         -		      break;
  2086         -		  case ARG_ALTITUDE:
  2087         -		      altitude = atof (argv[i]);
  2088         -		      break;
  2089   1122   		  };
  2090   1123   		next_arg = ARG_NONE;
  2091   1124   		continue;
  2092   1125   	    }
  2093   1126   	  if (strcasecmp (argv[i], "--help") == 0
  2094   1127   	      || strcmp (argv[i], "-?") == 0)
  2095   1128   	    {
................................................................................
  2162   1195   		continue;
  2163   1196   	    }
  2164   1197   	  if (strcmp (argv[i], "-v") == 0)
  2165   1198   	    {
  2166   1199   		verbose = 1;
  2167   1200   		continue;
  2168   1201   	    }
  2169         -	  if (strcasecmp (argv[i], "--shared-relief") == 0)
  2170         -	    {
  2171         -		shaded_relief = 1;
  2172         -		continue;
  2173         -	    }
  2174         -	  if (strcmp (argv[i], "-sr") == 0)
  2175         -	    {
  2176         -		shaded_relief = 1;
  2177         -		continue;
  2178         -	    }
  2179         -	  if (strcmp (argv[i], "-m") == 0)
  2180         -	    {
  2181         -		next_arg = ARG_MONO_COLOR;
  2182         -		continue;
  2183         -	    }
  2184         -	  if (strcasecmp (argv[i], "--monochrome") == 0)
  2185         -	    {
  2186         -		next_arg = ARG_MONO_COLOR;
  2187         -		continue;
  2188         -	    }
  2189         -	  if (strcmp (argv[i], "-z") == 0)
  2190         -	    {
  2191         -		next_arg = ARG_Z_FACTOR;
  2192         -		continue;
  2193         -	    }
  2194         -	  if (strcasecmp (argv[i], "--z-factor") == 0)
  2195         -	    {
  2196         -		next_arg = ARG_Z_FACTOR;
  2197         -		continue;
  2198         -	    }
  2199         -	  if (strcmp (argv[i], "-s") == 0)
  2200         -	    {
  2201         -		next_arg = ARG_SCALE;
  2202         -		continue;
  2203         -	    }
  2204         -	  if (strcasecmp (argv[i], "--scale-factor") == 0)
  2205         -	    {
  2206         -		next_arg = ARG_SCALE;
  2207         -		continue;
  2208         -	    }
  2209         -	  if (strcmp (argv[i], "-az") == 0)
  2210         -	    {
  2211         -		next_arg = ARG_AZIMUTH;
  2212         -		continue;
  2213         -	    }
  2214         -	  if (strcasecmp (argv[i], "--azimuth") == 0)
  2215         -	    {
  2216         -		next_arg = ARG_AZIMUTH;
  2217         -		continue;
  2218         -	    }
  2219         -	  if (strcmp (argv[i], "-al") == 0)
  2220         -	    {
  2221         -		next_arg = ARG_ALTITUDE;
  2222         -		continue;
  2223         -	    }
  2224         -	  if (strcasecmp (argv[i], "--altitude") == 0)
  2225         -	    {
  2226         -		next_arg = ARG_ALTITUDE;
  2227         -		continue;
  2228         -	    }
  2229   1202   	  fprintf (stderr, "unknown argument: %s\n", argv[i]);
  2230   1203   	  error = 1;
  2231   1204         }
  2232   1205       if (error)
  2233   1206         {
  2234   1207   	  do_help ();
  2235   1208   	  return -1;
................................................................................
  2237   1210   /* checking the arguments */
  2238   1211       if (!grid_path)
  2239   1212         {
  2240   1213   	  fprintf (stderr,
  2241   1214   		   "did you forget setting the --grid-path argument ?\n");
  2242   1215   	  error = 1;
  2243   1216         }
  2244         -    if (!shaded_relief)
         1217  +    if (!color_path)
  2245   1218         {
  2246         -	  if (!color_path)
  2247         -	    {
  2248         -		fprintf (stderr,
  2249         -			 "did you forget setting the --color-path argument ?\n");
  2250         -		error = 1;
  2251         -	    }
         1219  +	  fprintf (stderr,
         1220  +		   "did you forget setting the --color-path argument ?\n");
         1221  +	  error = 1;
  2252   1222         }
  2253   1223       if (!tiff_path)
  2254   1224         {
  2255   1225   	  fprintf (stderr,
  2256   1226   		   "did you forget setting the --tiff-path argument ?\n");
  2257   1227   	  error = 1;
  2258   1228         }
................................................................................
  2269   1239   	  error = 1;
  2270   1240         }
  2271   1241       if (strlen (error_nodata_color))
  2272   1242         {
  2273   1243   	  printf ("invalid NODATA color '%s'\n", error_nodata_color);
  2274   1244   	  error = 1;
  2275   1245         }
  2276         -    if (strlen (error_mono_color))
  2277         -      {
  2278         -	  printf ("invalid Shaded Relief Monochrome color '%s'\n",
  2279         -		  error_mono_color);
  2280         -	  error = 1;
  2281         -      }
  2282         -    if (color_path && mono_color)
  2283         -      {
  2284         -	  printf ("--monochrome and --color-path are mutually exclusive\n");
  2285         -	  error = 1;
  2286         -      }
  2287   1246       if (error)
  2288   1247         {
  2289   1248   	  do_help ();
  2290   1249   	  return -1;
  2291   1250         }
  2292   1251       printf ("=====================================================\n");
  2293   1252       printf ("             Arguments Summary\n");
  2294   1253       printf ("=====================================================\n");
  2295   1254       printf ("Grid       pathname: '%s'\n", grid_path);
  2296         -    if (color_path)
  2297         -	printf ("ColorTable pathname: '%s'\n", color_path);
         1255  +    printf ("ColorTable pathname: '%s'\n", color_path);
  2298   1256       printf ("GeoTIFF    pathname: '%s'\n", tiff_path);
  2299   1257       printf ("PROJ.4       string: '%s'\n", proj4text);
  2300         -    printf ("NoData        color: 0x%02x%02x%02x\n", no_red, no_green, no_blue);
  2301   1258       switch (grid_type)
  2302   1259         {
  2303   1260         case ASCII_GRID:
  2304   1261   	  printf ("Grid Format: ASCII\n");
  2305   1262   	  break;
  2306   1263         case FLOAT_GRID:
  2307   1264   	  printf ("Grid Format: FLOAT\n");
  2308   1265   	  break;
  2309   1266         default:
  2310   1267   	  printf ("Grid Format: UNKNOWN\n");
  2311   1268   	  break;
  2312   1269         }
  2313         -    if (shaded_relief)
         1270  +    printf ("=====================================================\n\n");
         1271  +    color_table = parse_color_table (color_path);
         1272  +    if (!color_table)
  2314   1273         {
  2315         -	  printf ("\n           Shaded Relief arguments:\n");
  2316         -	  printf ("-----------------------------------------------------\n");
  2317         -	  printf ("Z-factor     : %1.4f\n", z_factor);
  2318         -	  printf ("Scale-factor : %1.4f\n", scale_factor);
  2319         -	  printf ("Azimuth      : %1.4f\n", azimuth);
  2320         -	  printf ("Altitude     : %1.4f\n", altitude);
  2321         -	  if (mono_color)
  2322         -	      printf ("Monochrome   : 0x%02x%02x%02x\n", mono_red, mono_green,
  2323         -		      mono_blue);
         1274  +	  fprintf (stderr, "\n*********** Invalid Color Table\n");
         1275  +	  return -1;
  2324   1276         }
  2325         -    printf ("=====================================================\n\n");
  2326         -    if (color_path)
  2327         -      {
  2328         -	  color_table = parse_color_table (color_path, &colors);
  2329         -	  if (!color_table)
  2330         -	    {
  2331         -		fprintf (stderr, "\n*********** Invalid Color Table\n");
  2332         -		return -1;
  2333         -	    }
  2334         -      }
  2335         -    if (shaded_relief)
  2336         -      {
  2337         -	  if (grid_type == FLOAT_GRID)
  2338         -	      export_geoTiff_shaded_float (color_table, colors, proj4text,
  2339         -					   grid_path, tiff_path, no_red,
  2340         -					   no_green, no_blue, mono_color,
  2341         -					   mono_red, mono_green, mono_blue,
  2342         -					   z_factor, scale_factor, azimuth,
  2343         -					   altitude, verbose);
  2344         -	  else
  2345         -	      export_geoTiff_shaded_ascii (color_table, colors, proj4text,
  2346         -					   grid_path, tiff_path, no_red,
  2347         -					   no_green, no_blue, mono_color,
  2348         -					   mono_red, mono_green, mono_blue,
  2349         -					   z_factor, scale_factor, azimuth,
  2350         -					   altitude, verbose);
  2351         -      }
         1277  +    if (grid_type == FLOAT_GRID)
         1278  +	export_geoTiff_float (color_table, proj4text, grid_path, tiff_path,
         1279  +			      no_red, no_green, no_blue, verbose);
  2352   1280       else
  2353         -      {
  2354         -	  if (grid_type == FLOAT_GRID)
  2355         -	      export_geoTiff_float (color_table, colors, proj4text, grid_path,
  2356         -				    tiff_path, no_red, no_green, no_blue,
  2357         -				    verbose);
  2358         -	  else
  2359         -	      export_geoTiff_ascii (color_table, colors, proj4text, grid_path,
  2360         -				    tiff_path, no_red, no_green, no_blue,
  2361         -				    verbose);
  2362         -      }
  2363         -    if (color_table)
  2364         -	free (color_table);
         1281  +	export_geoTiff_ascii (color_table, proj4text, grid_path, tiff_path,
         1282  +			      no_red, no_green, no_blue, verbose);
         1283  +    free (color_table);
  2365   1284       return 0;
  2366   1285   }

Changes to src/rasterlite_load.c.

     1      1   /* 
     2      2   / rasterlite_load.c
     3      3   /
     4      4   / a tool for uploading GeoTIFF rasters into a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45     27   #include <stdlib.h>
    46     28   #include <stdio.h>
    47     29   #include <string.h>
    48     30   #include <errno.h>
    49     31   #include <sys/types.h>
    50     32   
    51         -#include "rasterlite_tiff_hdrs.h"
           33  +#include <geotiff.h>
           34  +#include <xtiffio.h>
           35  +#include <geo_normalize.h>
           36  +#include <geovalues.h>
    52     37   #include <tiffio.h>
    53     38   
    54     39   #if defined(_WIN32) && !defined(__MINGW32__)
    55     40   #include <io.h>
    56     41   #include <direct.h>
    57     42   #else
    58     43   #include <dirent.h>
    59     44   #endif
    60     45   
    61         -#ifdef SPATIALITE_AMALGAMATION
    62     46   #include <spatialite/sqlite3.h>
    63         -#else
    64         -#include <sqlite3.h>
    65         -#endif
    66         -
    67     47   #include <spatialite/gaiaexif.h>
    68     48   #include <spatialite/gaiageo.h>
    69     49   #include <spatialite.h>
    70     50   
    71     51   #include "rasterlite.h"
    72     52   #include "rasterlite_internals.h"
    73     53   
................................................................................
    82     62   #define ARG_FILE			4
    83     63   #define ARG_TILE_SIZE		5
    84     64   #define ARG_IMAGE_TYPE		6
    85     65   #define ARG_QUALITY_FACTOR	7
    86     66   #define ARG_EPSG_CODE		8
    87     67   
    88     68   static int
    89         -read_by_tile (TIFF * tif, rasterliteImagePtr img, struct geo_info *infos,
           69  +read_by_tile (TIFF * tif, rasterliteImagePrt img, struct geo_info *infos,
    90     70   	      int baseVert, int baseHorz)
    91     71   {
    92     72   /* reading from a TIFF using TILES */
    93     73       uint32 *raster = NULL;
    94     74       int x;
    95     75       int y;
    96     76       int img_x;
    97     77       int img_y;
    98         -    int dst_x;
    99         -    int dst_y;
   100         -    int width;
   101         -    int height;
           78  +    int effective_width;
           79  +    int effective_height;
   102     80       uint32 pixel;
   103     81       int color;
   104     82       uint32 *scanline;
   105     83       int current_row;
   106     84       int current_col;
   107     85       int current_col_save;
           86  +    int current_x;
           87  +    int current_y;
           88  +    int max_y;
           89  +    int max_x;
   108     90   /* allocating the tile raster */
   109         -    height = infos->tif_tile_height;
   110         -    width = infos->tif_tile_width;
   111         -    raster = malloc (sizeof (uint32) * (width * height));
           91  +    raster =
           92  +	malloc (sizeof (uint32) *
           93  +		(infos->tif_tile_width * infos->tif_tile_height));
   112     94   
   113     95   /* determining the first tile to be read */
   114         -    for (y = 0; y < (int) infos->height; y += height)
           96  +    for (y = 0; y < (int) infos->height; y += infos->tif_tile_height)
   115     97         {
   116         -	  if (y <= baseVert && baseVert < (int) (y + height))
           98  +	  if (y <= baseVert && baseVert < (int) (y + infos->tif_tile_height))
   117     99   	    {
   118    100   		current_row = y;
   119         -		for (x = 0; x < (int) infos->width; x += width)
          101  +		for (x = 0; x < (int) infos->width; x += infos->tif_tile_width)
   120    102   		  {
   121         -		      if (x <= baseHorz && baseHorz < (x + (int) width))
          103  +		      if (x <= baseHorz
          104  +			  && baseHorz < (x + (int) infos->tif_tile_width))
   122    105   			{
   123    106   			    current_col = x;
   124    107   			    goto done;
   125    108   			}
   126    109   		  }
   127    110   	    }
   128    111         }
   129    112     done:
   130    113       current_col_save = current_col;
   131    114   /* feeding tile pixels */
   132         -    while (current_row < infos->height)
          115  +    y = 0;
          116  +    while (y < img->sy)
   133    117         {
   134         -	  if (current_row > (baseVert + img->sy))
   135         -	      break;
   136         -	  while (current_col < infos->width)
          118  +	  x = 0;
          119  +	  max_y = 0;
          120  +	  while (x < img->sx)
   137    121   	    {
   138    122   		/* reading a TIFF tile */
   139         -		if (current_col > (baseHorz + img->sx))
   140         -		    break;
   141    123   		if (!TIFFReadRGBATile (tif, current_col, current_row, raster))
   142    124   		    goto error;
   143         -		for (y = 0; y < height; y++)
          125  +		effective_height = infos->tif_tile_height;
          126  +		effective_width = infos->tif_tile_width;
          127  +		if ((current_col + infos->tif_tile_width) > infos->width)
          128  +		    effective_width = infos->width - current_col;
          129  +		max_x = 0;
          130  +		for (current_y = 0; current_y < (int) effective_height;
          131  +		     current_y++)
   144    132   		  {
   145         -		      img_y = current_row + (height - y) - 1;
   146         -		      dst_y = img_y - baseVert;
   147         -		      if (dst_y < 0)
   148         -			  continue;
   149         -		      if (dst_y >= (int) img->sy)
          133  +		      img_y =
          134  +			  (current_row - baseVert) +
          135  +			  ((effective_height - current_y) - 1);
          136  +		      if (img_y >= img->sy || img_y < 0)
   150    137   			  continue;
   151         -		      scanline = raster + (width * y);
   152         -		      for (x = 0; x < width; x++)
          138  +		      scanline = raster + (infos->tif_tile_width * current_y);
          139  +		      for (current_x = 0;
          140  +			   current_x < (int) effective_width; current_x++)
   153    141   			{
   154         -			    img_x = current_col + x;
   155         -			    dst_x = img_x - baseHorz;
   156         -			    if (dst_x < 0)
          142  +			    img_x = current_col - baseHorz + current_x;
          143  +			    if (img_x < 0)
   157    144   				continue;
   158         -			    if (dst_x >= (int) img->sx)
          145  +			    if (img_x >= img->sx)
   159    146   				break;
   160         -			    pixel = scanline[x];
          147  +			    pixel = scanline[current_x];
   161    148   			    color =
   162    149   				true_color (TIFFGetR (pixel), TIFFGetG (pixel),
   163    150   					    TIFFGetB (pixel));
   164         -			    image_set_pixel (img, dst_x, dst_y, color);
          151  +			    image_set_pixel (img, img_x, img_y, color);
          152  +			    if ((img_y + 1) > max_y)
          153  +				max_y = img_y + 1;
          154  +			    if ((img_x + 1) > max_x)
          155  +				max_x = img_x + 1;
   165    156   			}
   166    157   		  }
   167         -		current_col += width;
          158  +		current_col += effective_width;
          159  +		x += max_x;
   168    160   	    }
   169         -	  current_row += height;
          161  +	  y += max_y;
          162  +	  current_row += infos->tif_tile_height;
   170    163   	  current_col = current_col_save;
   171    164         }
   172    165   
   173    166       if (raster)
   174    167   	free (raster);
   175    168       return 1;
   176    169     error:
   177    170       if (raster)
   178    171   	free (raster);
   179    172       return 0;
   180    173   }
   181    174   
   182    175   static int
   183         -read_by_strip (TIFF * tif, rasterliteImagePtr img, struct geo_info *infos,
          176  +read_by_strip (TIFF * tif, rasterliteImagePrt img, struct geo_info *infos,
   184    177   	       int baseVert, int baseHorz)
   185    178   {
   186    179   /* reading from a TIFF using STRIPS */
   187    180       uint32 *raster = NULL;
   188    181       int x;
   189    182       int y;
   190    183       int img_y;
................................................................................
   269    262   /* accessing the TIFF by strips or tiles */
   270    263       int retval = 0;
   271    264       void *image;
   272    265       int image_size;
   273    266       int ret;
   274    267       double xx;
   275    268       double yy;
   276         -    rasterliteImagePtr img = NULL;
          269  +    rasterliteImagePrt img = NULL;
   277    270       gaiaPolygonPtr polyg;
   278    271       tile->geometry = gaiaAllocGeomColl ();
   279    272       tile->tileNo = tileNo;
   280    273   
   281    274   /* computing actual tile dims */
   282    275       tile->raster_horz = infos->tile_width;
   283    276       tile->raster_vert = infos->tile_height;
................................................................................
   404    397   	  /* compressing the section image as TIFF RGB */
   405    398   	  image = image_to_tiff_rgb (img, &image_size);
   406    399   	  if (!image)
   407    400   	    {
   408    401   		printf ("TIFF RGB compression error\n");
   409    402   		goto stop;
   410    403   	    }
          404  +      }
          405  +    else if (infos->image_type == IMAGE_WAVELET_BW)
          406  +      {
          407  +	  /* compressing the section image as WAVELET GRAYSCALE */
          408  +	  image =
          409  +	      image_to_wavelet_grayscale (img, &image_size,
          410  +					  infos->quality_factor);
          411  +	  if (!image)
          412  +	    {
          413  +		printf ("WAVELET compression error\n");
          414  +		goto stop;
          415  +	    }
          416  +      }
          417  +    else if (infos->image_type == IMAGE_WAVELET_RGB)
          418  +      {
          419  +	  /* compressing the section image as WAVELET RGB */
          420  +	  image = image_to_wavelet (img, &image_size, infos->quality_factor);
          421  +	  if (!image)
          422  +	    {
          423  +		printf ("WAVELET compression error\n");
          424  +		goto stop;
          425  +	    }
   411    426         }
   412    427       else if (infos->image_type == IMAGE_JPEG_BW)
   413    428         {
   414    429   	  /* compressing the section image as JPEG GRAYSCALE */
   415    430   	  image =
   416    431   	      image_to_jpeg_grayscale (img, &image_size, infos->quality_factor);
   417    432   	  if (!image)
................................................................................
   577    592   	  printf
   578    593   	      ("table \"%s_metadata\" already exists, but has an invalid column layout\n",
   579    594   	       infos->table);
   580    595   	  return 0;
   581    596         }
   582    597   
   583    598       sprintf (sql,
   584         -	     "SELECT f_geometry_column FROM geometry_columns WHERE "
   585         -	     "Lower(f_table_name) = Lower('%s_metadata')", infos->table);
          599  +	     "SELECT f_geometry_column FROM geometry_columns WHERE f_table_name = '%s_metadata'",
          600  +	     infos->table);
   586    601       ret =
   587    602   	sqlite3_get_table (infos->handle, sql, &results, &rows, &columns,
   588    603   			   &errMsg);
   589    604       if (ret != SQLITE_OK)
   590    605         {
   591    606   	  printf ("SQL error: %s\n", errMsg);
   592    607   	  sqlite3_free (errMsg);
................................................................................
   829    844   		actual_format = (const char *) "GIF";
   830    845   		infos.image_type = IMAGE_GIF_PALETTE;
   831    846   	    }
   832    847         }
   833    848       if (bits_per_sample == 8 && samples_per_pixel == 1 && photometric < 2)
   834    849         {
   835    850   	  colorspace_name = (const char *) "GrayScale - 256 levels";
   836         -	  format_hint = (const char *) "JPEG / PNG / TIFF";
          851  +	  format_hint = (const char *) "JPEG / WAVELET / PNG / TIFF";
   837    852   	  if (image_type == GAIA_TIFF_BLOB)
   838    853   	    {
   839    854   		strcpy (dummy, "TIFF [GRAYSCALE]");
   840    855   		infos.image_type = IMAGE_TIFF_GRAYSCALE;
   841    856   	    }
   842    857   	  else if (image_type == GAIA_PNG_BLOB)
   843    858   	    {
   844    859   		strcpy (dummy, "PNG [GRAYSCALE]");
   845    860   		infos.image_type = IMAGE_PNG_GRAYSCALE;
          861  +	    }
          862  +	  else if (image_type == IMAGE_WAVELET_RGB)
          863  +	    {
          864  +		sprintf (dummy, "WAVELET [GRAYSCALE] compression ratio 1:%d",
          865  +			 quality_factor);
          866  +		infos.image_type = IMAGE_WAVELET_BW;
   846    867   	    }
   847    868   	  else
   848    869   	    {
   849    870   		sprintf (dummy, "JPEG [GRAYSCALE] quality=%d", quality_factor);
   850    871   		infos.image_type = IMAGE_JPEG_BW;
   851    872   	    }
   852    873   	  actual_format = (const char *) dummy;
   853    874         }
   854    875       if (samples_per_pixel >= 3)
   855    876         {
   856    877   	  colorspace_name = (const char *) "RGB - TrueColor";
   857         -	  format_hint = (const char *) "JPEG / TIFF";
          878  +	  format_hint = (const char *) "JPEG / WAVELET / TIFF";
   858    879   	  if (image_type == GAIA_TIFF_BLOB)
   859    880   	    {
   860    881   		sprintf (dummy, "TIFF [RGB]");
   861    882   		infos.image_type = IMAGE_TIFF_RGB;
   862    883   	    }
   863    884   	  else if (image_type == GAIA_PNG_BLOB)
   864    885   	    {
   865    886   		sprintf (dummy, "PNG [RGB]");
   866    887   		infos.image_type = IMAGE_PNG_RGB;
          888  +	    }
          889  +	  else if (image_type == GAIA_WAVELET_BLOB)
          890  +	    {
          891  +		sprintf (dummy, "WAVELET [RGB] compression ratio 1:%d",
          892  +			 quality_factor);
          893  +		infos.image_type = IMAGE_WAVELET_RGB;
   867    894   	    }
   868    895   	  else
   869    896   	    {
   870    897   		sprintf (dummy, "JPEG [RGB] quality=%d", quality_factor);
   871    898   		infos.image_type = IMAGE_JPEG_RGB;
   872    899   	    }
   873    900   	  actual_format = (const char *) dummy;
................................................................................
   947    974         case COMPRESSION_JP2000:
   948    975   	  compression_name = (const char *) "JPEG-2000";
   949    976   	  break;
   950    977         default:
   951    978   	  compression_name = (const char *) "UNKNOWN";
   952    979   	  break;
   953    980         };
   954         -
   955         -/* retrieving the EPSG code: Sandro 2012-12-15 */
   956         -    if (definition.PCS == 32767)
   957         -      {
   958         -	  if (definition.GCS != 32767)
   959         -	      infos.epsg = definition.GCS;
   960         -      }
   961         -    else
   962         -	infos.epsg = definition.PCS;
   963         -
          981  +/* retrieving the EPSG code */
          982  +    infos.epsg = definition.GCS;
   964    983   /* computing the corners coords */
   965    984       cx = 0.0;
   966    985       cy = 0.0;
   967    986       GTIFImageToPCS (gtif, &cx, &cy);
   968    987       infos.upper_left_x = cx;
   969    988       infos.upper_left_y = cy;
   970    989       cx = 0.0;
................................................................................
  1057   1076         }
  1058   1077       extra_width = tile_width * sect;
  1059   1078       extra_height = tile_height * sect;
  1060   1079       baseHorz = 0;
  1061   1080       baseVert = 0;
  1062   1081       while (1)
  1063   1082         {
  1064         -	  /* computing the total tiles # */
         1083  +	  /* computing the totale tiles # */
  1065   1084   	  maxTile++;
  1066   1085   	  baseHorz += tile_width;
  1067   1086   	  if (baseHorz >= extra_width)
  1068   1087   	    {
  1069   1088   		baseHorz = 0;
  1070   1089   		baseVert += tile_height;
  1071   1090   		if (baseVert >= extra_height)
................................................................................
  1086   1105       if (ret != SQLITE_OK)
  1087   1106         {
  1088   1107   	  printf ("BEGIN TRANSACTION error: %s\n", sql_err);
  1089   1108   	  sqlite3_free (sql_err);
  1090   1109   	  goto stop;
  1091   1110         }
  1092   1111   
  1093         -/* just in case it doesn't exist, we'll try anyway to create the table */
         1112  +/* just in case it doesn't exists, we'll try anyway to create the table */
  1094   1113       if (!create_raster_table (&infos))
  1095   1114   	goto stop;
  1096   1115   
  1097   1116   /* creating the INSERT INTO xx_rasters prepared statement */
  1098   1117       sprintf (sql, "INSERT INTO \"%s_rasters\" ", infos.table);
  1099   1118       strcat (sql, "(id, raster) ");
  1100   1119       strcat (sql, " VALUES (NULL, ?)");
................................................................................
  1184   1203       if (ret != SQLITE_OK)
  1185   1204         {
  1186   1205   	  printf ("COMMIT TRANSACTION error: %s\n", sql_err);
  1187   1206   	  sqlite3_free (sql_err);
  1188   1207   	  goto stop;
  1189   1208         }
  1190   1209   
  1191         -    if (tif)
  1192         -	XTIFFClose (tif);
  1193         -    if (gtif)
  1194         -	GTIFFree (gtif);
  1195   1210       for (i = 0; i < NTILES; i++)
  1196   1211         {
  1197   1212   	  tile = &(infos.tiles[i]);
  1198   1213   	  if (tile->geometry)
  1199   1214   	      gaiaFreeGeomColl (tile->geometry);
  1200   1215         }
  1201   1216   
................................................................................
  1236   1251       if (_chdir (dir_path) < 0)
  1237   1252         {
  1238   1253   	  fprintf (stderr, "rasterlite_load: cannot access dir '%s'", dir_path);
  1239   1254   	  return 0;
  1240   1255         }
  1241   1256       if ((hFile = _findfirst ("*.*", &c_file)) == -1L)
  1242   1257   	fprintf (stderr,
  1243         -		 "rasterlite_load: cannot access dir '%s' [or empty dir]\n",
         1258  +		 "rastererlite_load: cannot access dir '%s' [or empty dir]\n",
  1244   1259   		 dir_path);
  1245   1260       else
  1246   1261         {
  1247   1262   	  while (1)
  1248   1263   	    {
  1249   1264   		if ((c_file.attrib & _A_RDONLY) == _A_RDONLY
  1250   1265   		    || (c_file.attrib & _A_NORMAL) == _A_NORMAL)
................................................................................
  1294   1309   db_connect (const char *path)
  1295   1310   {
  1296   1311   /* trying to connect SpatiaLite DB */
  1297   1312       sqlite3 *handle = NULL;
  1298   1313       int ret;
  1299   1314       char sql[1024];
  1300   1315       int spatialite_rs = 0;
  1301         -    int spatialite_legacy_gc = 0;
  1302   1316       int spatialite_gc = 0;
  1303   1317       int rs_srid = 0;
  1304   1318       int auth_name = 0;
  1305   1319       int auth_srid = 0;
  1306   1320       int ref_sys_name = 0;
  1307   1321       int proj4text = 0;
  1308   1322       int f_table_name = 0;
  1309   1323       int f_geometry_column = 0;
  1310   1324       int coord_dimension = 0;
  1311   1325       int gc_srid = 0;
  1312   1326       int type = 0;
  1313         -    int geometry_type = 0;
  1314   1327       int spatial_index_enabled = 0;
  1315   1328       const char *name;
  1316   1329       int i;
  1317   1330       char **results;
  1318   1331       int rows;
  1319   1332       int columns;
  1320   1333   
................................................................................
  1348   1361   		    f_geometry_column = 1;
  1349   1362   		if (strcasecmp (name, "coord_dimension") == 0)
  1350   1363   		    coord_dimension = 1;
  1351   1364   		if (strcasecmp (name, "srid") == 0)
  1352   1365   		    gc_srid = 1;
  1353   1366   		if (strcasecmp (name, "type") == 0)
  1354   1367   		    type = 1;
  1355         -		if (strcasecmp (name, "geometry_type") == 0)
  1356         -		    geometry_type = 1;
  1357   1368   		if (strcasecmp (name, "spatial_index_enabled") == 0)
  1358   1369   		    spatial_index_enabled = 1;
  1359   1370   	    }
  1360   1371         }
  1361   1372       sqlite3_free_table (results);
  1362   1373       if (f_table_name && f_geometry_column && type && coord_dimension && gc_srid
  1363   1374   	&& spatial_index_enabled)
  1364         -	spatialite_legacy_gc = 1;
  1365         -    if (f_table_name && f_geometry_column && geometry_type && coord_dimension
  1366         -	&& gc_srid && spatial_index_enabled)
  1367   1375   	spatialite_gc = 1;
  1368   1376   
  1369   1377   /* checking the SPATIAL_REF_SYS table */
  1370   1378       strcpy (sql, "PRAGMA table_info(spatial_ref_sys)");
  1371   1379       ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
  1372   1380       if (ret != SQLITE_OK)
  1373   1381   	goto unknown;
................................................................................
  1391   1399   	    }
  1392   1400         }
  1393   1401       sqlite3_free_table (results);
  1394   1402       if (rs_srid && auth_name && auth_srid && ref_sys_name && proj4text)
  1395   1403   	spatialite_rs = 1;
  1396   1404   
  1397   1405   /* verifying the MetaData format */
  1398         -    if ((spatialite_legacy_gc || spatialite_gc) && spatialite_rs)
         1406  +    if (spatialite_gc && spatialite_rs)
  1399   1407   	return handle;
  1400   1408   
  1401   1409     unknown:
  1402   1410       if (handle)
  1403   1411   	sqlite3_close (handle);
  1404   1412       printf ("DB '%s'\n", path);
  1405   1413       printf ("doesn't seems to contain valid Spatial Metadata ...\n\n");
................................................................................
  1426   1434       fprintf (stderr,
  1427   1435   	     "-D or --dir         dir_path      the DIR path containing GeoTIFF files\n");
  1428   1436       fprintf (stderr,
  1429   1437   	     "-f or --file        file_name     a single GeoTIFF file\n");
  1430   1438       fprintf (stderr, "-s or --tile-size   num           [default = 512]\n");
  1431   1439       fprintf (stderr,
  1432   1440   	     "-e or --epsg-code   num           [optional: EPSG code]\n");
  1433         -    fprintf (stderr, "-i or --image-type  type          [JPEG|PNG|GIF|TIFF]\n");
         1441  +    fprintf (stderr,
         1442  +	     "-i or --image-type  type          [JPEG|PNG|GIF|TIFF|WAVELET]\n");
  1434   1443       fprintf (stderr,
  1435         -	     "-q or --quality     num           [default = 75(JPEG)]\n");
         1444  +	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
  1436   1445   }
  1437   1446   
  1438   1447   int
  1439   1448   main (int argc, char *argv[])
  1440   1449   {
  1441   1450   /* the MAIN function simply perform arguments checking */
  1442   1451       sqlite3 *handle;
................................................................................
  1485   1494   			  image_type = GAIA_JPEG_BLOB;
  1486   1495   		      if (strcasecmp (argv[i], "PNG") == 0)
  1487   1496   			  image_type = GAIA_PNG_BLOB;
  1488   1497   		      if (strcasecmp (argv[i], "GIF") == 0)
  1489   1498   			  image_type = GAIA_GIF_BLOB;
  1490   1499   		      if (strcasecmp (argv[i], "TIFF") == 0)
  1491   1500   			  image_type = GAIA_TIFF_BLOB;
         1501  +		      if (strcasecmp (argv[i], "WAVELET") == 0)
         1502  +			  image_type = GAIA_WAVELET_BLOB;
  1492   1503   		      break;
  1493   1504   		  case ARG_QUALITY_FACTOR:
  1494   1505   		      quality_factor = atoi (argv[i]);
  1495   1506   		      break;
  1496   1507   		  case ARG_EPSG_CODE:
  1497   1508   		      epsg_code = atoi (argv[i]);
  1498   1509   		      break;
................................................................................
  1616   1627         }
  1617   1628   /* checking the arguments */
  1618   1629       if (!test_mode)
  1619   1630         {
  1620   1631   	  if (!path)
  1621   1632   	    {
  1622   1633   		fprintf (stderr,
  1623         -			 "did you forget to set the --db-path argument ?\n");
         1634  +			 "did you forget setting the --db-path argument ?\n");
  1624   1635   		error = 1;
  1625   1636   	    }
  1626   1637   	  if (!table)
  1627   1638   	    {
  1628         -		printf ("did you forget to set the --table-name argument ?\n");
         1639  +		printf ("did you forget setting the --table-name argument ?\n");
  1629   1640   		error = 1;
  1630   1641   	    }
  1631   1642         }
  1632   1643       if (!dir_path && !file_path)
  1633   1644         {
  1634   1645   	  fprintf (stderr,
  1635         -		   "did you forget to set the --dir-path OR --file-path argument ?\n");
         1646  +		   "did you forget setting the --dir-path OR --file-path argument ?\n");
  1636   1647   	  error = 1;
  1637   1648         }
  1638   1649       if (dir_path && file_path)
  1639   1650         {
  1640   1651   	  fprintf (stderr,
  1641         -		   "--dir_path AND --file_path arguments are mutually exclusive\n");
         1652  +		   "--dir_path AND --file_path argument are mutually exclusive\n");
  1642   1653   	  error = 1;
  1643   1654         }
  1644   1655       if (error)
  1645   1656         {
  1646   1657   	  do_help ();
  1647   1658   	  return -1;
  1648   1659         }
................................................................................
  1651   1662   	  /* normalizing the quality factor */
  1652   1663   	  if (quality_factor == -999999)
  1653   1664   	      quality_factor = 75;
  1654   1665   	  if (quality_factor < 10)
  1655   1666   	      quality_factor = 10;
  1656   1667   	  if (quality_factor > 90)
  1657   1668   	      quality_factor = 90;
         1669  +      }
         1670  +    if (image_type == GAIA_WAVELET_BLOB)
         1671  +      {
         1672  +	  /* normalizing the commpression factor */
         1673  +	  if (quality_factor == -999999)
         1674  +	      quality_factor = 25;
         1675  +	  if (quality_factor < 10)
         1676  +	      quality_factor = 10;
         1677  +	  if (quality_factor > 200)
         1678  +	      quality_factor = 200;
  1658   1679         }
  1659   1680       printf ("=====================================================\n");
  1660   1681       printf ("             Arguments Summary\n");
  1661   1682       printf ("=====================================================\n");
  1662   1683       if (test_mode)
  1663   1684         {
  1664   1685   	  printf ("TEST mode: no actual action will be performed\n");
................................................................................
  1687   1708   	  printf ("Tile image type: PNG\n");
  1688   1709   	  break;
  1689   1710         case GAIA_GIF_BLOB:
  1690   1711   	  printf ("Tile image type: GIF\n");
  1691   1712   	  break;
  1692   1713         case GAIA_TIFF_BLOB:
  1693   1714   	  printf ("Tile image type: TIFF\n");
         1715  +	  break;
         1716  +      case GAIA_WAVELET_BLOB:
         1717  +	  printf ("Tile image type: WAVELET compression ratio 1:%d\n",
         1718  +		  quality_factor);
  1694   1719   	  break;
  1695   1720         default:
  1696   1721   	  printf ("Tile image type: UNKNOWN\n");
  1697   1722   	  break;
  1698   1723         };
  1699   1724       printf ("=====================================================\n\n");
  1700   1725       if (!test_mode)

Changes to src/rasterlite_pyramid.c.

     1      1   /* 
     2      2   / rasterlite_pyramid.c
     3      3   /
     4      4   / a tool building raster pyramids into a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45     27   #include <stdlib.h>
    46     28   #include <stdio.h>
    47     29   #include <string.h>
    48     30   #include <errno.h>
    49     31   #include <sys/types.h>
    50     32   #include <float.h>
    51     33   
    52         -#include "rasterlite_tiff_hdrs.h"
           34  +#include <geotiff.h>
           35  +#include <xtiffio.h>
           36  +#include <geo_normalize.h>
           37  +#include <geovalues.h>
    53     38   #include <tiffio.h>
    54     39   
    55         -#ifdef SPATIALITE_AMALGAMATION
    56     40   #include <spatialite/sqlite3.h>
    57         -#else
    58         -#include <sqlite3.h>
    59         -#endif
    60         -
    61     41   #include <spatialite/gaiaexif.h>
    62     42   #include <spatialite/gaiageo.h>
    63     43   #include <spatialite.h>
    64     44   
    65     45   #include "rasterlite.h"
    66     46   #include "rasterlite_internals.h"
    67     47   
    68         -#ifdef _WIN32
           48  +#ifdef _WIN32 
    69     49   #define strcasecmp	_stricmp
    70     50   #endif /* not WIN32 */
    71     51   
    72     52   #if defined(_WIN32) || defined (__MINGW32__)
    73     53   #define FORMAT_64	"%I64d"
    74     54   #else
    75     55   #define FORMAT_64	"%lld"
................................................................................
   277    257   		break;
   278    258   	    }
   279    259   	  p = p->next;
   280    260         }
   281    261       return NULL;
   282    262   }
   283    263   
   284         -static rasterliteImagePtr
          264  +static rasterliteImagePrt
   285    265   raster_decode (const void *blob, int blob_size)
   286    266   {
   287    267   /* trying to decode a BLOB as an image */
   288         -    rasterliteImagePtr img = NULL;
          268  +    rasterliteImagePrt img = NULL;
   289    269       int type = gaiaGuessBlobType (blob, blob_size);
   290    270       if (type == GAIA_JPEG_BLOB || type == GAIA_EXIF_BLOB
   291    271   	|| type == GAIA_EXIF_GPS_BLOB)
   292    272   	img = image_from_jpeg (blob_size, (void *) blob);
   293    273       else if (type == GAIA_PNG_BLOB)
   294    274   	img = image_from_png (blob_size, (void *) blob);
   295    275       else if (type == GAIA_GIF_BLOB)
   296    276   	img = image_from_gif (blob_size, (void *) blob);
   297    277       else if (type == GAIA_TIFF_BLOB)
   298    278   	img = image_from_tiff (blob_size, (void *) blob);
          279  +    else if (type == GAIA_WAVELET_BLOB)
          280  +	img = image_from_wavelet (blob_size, (void *) blob);
   299    281       return img;
   300    282   }
   301    283   
   302    284   static int
   303         -get_tile (sqlite3 * handle, rasterliteImagePtr img, const char *table,
          285  +get_tile (sqlite3 * handle, rasterliteImagePrt img, const char *table,
   304    286   	  sqlite3_int64 tile_id, int declared_x, int declared_y, int where)
   305    287   {
   306    288   /* fetching a raster tile */
   307    289       sqlite3_stmt *stmt;
   308    290       int ret;
   309    291       char sql[1024];
   310    292       char dummy64[64];
................................................................................
   311    293       const void *blob;
   312    294       int blob_size;
   313    295       int row;
   314    296       int col;
   315    297       int x;
   316    298       int y;
   317    299       int pixel;
   318         -    rasterliteImagePtr tile_img = NULL;
          300  +    rasterliteImagePrt tile_img = NULL;
   319    301       sprintf (sql, "SELECT raster FROM \"%s_rasters\" WHERE id = ?", table);
   320    302       ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
   321    303       if (ret != SQLITE_OK)
   322    304         {
   323    305   	  printf ("SQL error: %s\n", sqlite3_errmsg (handle));
   324    306   	  return 0;
   325    307         }
................................................................................
   438    420       image_destroy (tile_img);
   439    421   
   440    422       return 1;
   441    423   }
   442    424   
   443    425   static void
   444    426   thumbnail_export (sqlite3 * handle, sqlite3_stmt * stmt,
   445         -		  rasterliteImagePtr img, int image_type, int quality_factor,
          427  +		  rasterliteImagePrt img, int image_type, int quality_factor,
   446    428   		  struct thumbnail_tile *tile)
   447    429   {
   448    430   /* saving the thumbnail into the DB */
   449    431       int ret;
   450    432       void *blob;
   451    433       int blob_size;
   452    434       int width = img->sx / 2;
   453    435       int height = img->sy / 2;
   454         -    rasterliteImagePtr thumbnail = image_create (width, height);
          436  +    rasterliteImagePrt thumbnail = image_create (width, height);
   455    437       make_thumbnail (thumbnail, img);
   456    438       if (image_type == GAIA_TIFF_BLOB)
   457    439         {
   458    440   	  blob = image_to_tiff_rgb (thumbnail, &blob_size);
   459    441   	  if (!blob)
   460    442   	    {
   461    443   		printf ("TIFF RGB compression error\n");
................................................................................
   466    448         {
   467    449   	  blob = image_to_png_rgb (thumbnail, &blob_size);
   468    450   	  if (!blob)
   469    451   	    {
   470    452   		printf ("PNG RGB compression error\n");
   471    453   		goto end;
   472    454   	    }
          455  +      }
          456  +    else if (image_type == GAIA_WAVELET_BLOB)
          457  +      {
          458  +	  blob = image_to_wavelet (thumbnail, &blob_size, quality_factor);
          459  +	  if (!blob)
          460  +	    {
          461  +		printf ("WAVELET compression error\n");
          462  +		goto end;
          463  +	    }
   473    464         }
   474    465       else
   475    466         {
   476    467   	  blob = image_to_jpeg (thumbnail, &blob_size, quality_factor);
   477    468   	  if (!blob)
   478    469   	    {
   479    470   		printf ("JPEG compression error\n");
................................................................................
   593    584       struct tiles_list tiles;
   594    585       struct tile_item *tile_1;
   595    586       struct tile_item *tile_2;
   596    587       struct tile_item *tile_3;
   597    588       struct tile_item *tile_4;
   598    589       double x;
   599    590       double y;
   600         -    rasterliteImagePtr img = NULL;
          591  +    rasterliteImagePrt img = NULL;
   601    592       struct thumbnail_tile thumb_tiles[NTILES];
   602    593       struct thumbnail_tile *thumb_tile;
   603    594       int max_tile;
   604    595       gaiaPolygonPtr polyg;
   605    596       int raster_ok = 0;
   606    597       int metadata_ok = 0;
   607    598       int i;
................................................................................
  1477   1468   /* trying to connect SpatiaLite DB */
  1478   1469       sqlite3 *handle = NULL;
  1479   1470       int ret;
  1480   1471       char rasters[512];
  1481   1472       char meta[512];
  1482   1473       char sql[1024];
  1483   1474       int spatialite_rs = 0;
  1484         -    int spatialite_legacy_gc = 0;
  1485   1475       int spatialite_gc = 0;
  1486   1476       int rs_srid = 0;
  1487   1477       int auth_name = 0;
  1488   1478       int auth_srid = 0;
  1489   1479       int ref_sys_name = 0;
  1490   1480       int proj4text = 0;
  1491   1481       int f_table_name = 0;
  1492   1482       int f_geometry_column = 0;
  1493   1483       int coord_dimension = 0;
  1494   1484       int gc_srid = 0;
  1495   1485       int type = 0;
  1496         -    int geometry_type = 0;
  1497   1486       int spatial_index_enabled = 0;
  1498   1487       int tbl_rasters = 0;
  1499   1488       int tbl_meta = 0;
  1500   1489       const char *name;
  1501   1490       int i;
  1502   1491       char **results;
  1503   1492       int rows;
................................................................................
  1533   1522   		    f_geometry_column = 1;
  1534   1523   		if (strcasecmp (name, "coord_dimension") == 0)
  1535   1524   		    coord_dimension = 1;
  1536   1525   		if (strcasecmp (name, "srid") == 0)
  1537   1526   		    gc_srid = 1;
  1538   1527   		if (strcasecmp (name, "type") == 0)
  1539   1528   		    type = 1;
  1540         -		if (strcasecmp (name, "geometry_type") == 0)
  1541         -		    geometry_type = 1;
  1542   1529   		if (strcasecmp (name, "spatial_index_enabled") == 0)
  1543   1530   		    spatial_index_enabled = 1;
  1544   1531   	    }
  1545   1532         }
  1546   1533       sqlite3_free_table (results);
  1547   1534       if (f_table_name && f_geometry_column && type && coord_dimension && gc_srid
  1548   1535   	&& spatial_index_enabled)
  1549         -	spatialite_legacy_gc = 1;
  1550         -    if (f_table_name && f_geometry_column && geometry_type && coord_dimension
  1551         -	&& gc_srid && spatial_index_enabled)
  1552   1536   	spatialite_gc = 1;
  1553   1537   
  1554   1538   /* checking the SPATIAL_REF_SYS table */
  1555   1539       strcpy (sql, "PRAGMA table_info(spatial_ref_sys)");
  1556   1540       ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
  1557   1541       if (ret != SQLITE_OK)
  1558   1542   	goto unknown;
................................................................................
  1576   1560   	    }
  1577   1561         }
  1578   1562       sqlite3_free_table (results);
  1579   1563       if (rs_srid && auth_name && auth_srid && ref_sys_name && proj4text)
  1580   1564   	spatialite_rs = 1;
  1581   1565   
  1582   1566   /* verifying the MetaData format */
  1583         -    if ((spatialite_legacy_gc || spatialite_gc) && spatialite_rs)
         1567  +    if (spatialite_gc && spatialite_rs)
  1584   1568   	goto check_tables;
  1585   1569   
  1586   1570     unknown:
  1587   1571       if (handle)
  1588   1572   	sqlite3_close (handle);
  1589   1573       printf ("DB '%s'\n", path);
  1590   1574       printf ("doesn't seems to contain valid Spatial Metadata ...\n\n");
................................................................................
  1637   1621   	     "-? or --help                      print this help message\n");
  1638   1622       fprintf (stderr,
  1639   1623   	     "-t or --test                      test only - no actual action\n");
  1640   1624       fprintf (stderr, "-v or --verbose                   verbose output\n");
  1641   1625       fprintf (stderr,
  1642   1626   	     "-d or --db-path     pathname      the SpatiaLite db path\n");
  1643   1627       fprintf (stderr, "-T or --table-name  name          DB table name\n");
  1644         -    fprintf (stderr, "-i or --image-type  type          [JPEG|TIFF]\n");
         1628  +    fprintf (stderr, "-i or --image-type  type          [JPEG|WAVELET|TIFF]\n");
  1645   1629       fprintf (stderr,
  1646         -	     "-q or --quality     num           [default = 75(JPEG)]\n");
         1630  +	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
  1647   1631   }
  1648   1632   
  1649   1633   int
  1650   1634   main (int argc, char *argv[])
  1651   1635   {
  1652   1636   /* the MAIN function simply perform arguments checking */
  1653   1637       sqlite3 *handle;
................................................................................
  1673   1657   		      break;
  1674   1658   		  case ARG_TABLE_NAME:
  1675   1659   		      table = argv[i];
  1676   1660   		      break;
  1677   1661   		  case ARG_IMAGE_TYPE:
  1678   1662   		      if (strcasecmp (argv[i], "JPEG") == 0)
  1679   1663   			  image_type = GAIA_JPEG_BLOB;
         1664  +		      if (strcasecmp (argv[i], "WAVELET") == 0)
         1665  +			  image_type = GAIA_WAVELET_BLOB;
  1680   1666   		      if (strcasecmp (argv[i], "PNG") == 0)
  1681   1667   			  image_type = GAIA_PNG_BLOB;
  1682   1668   		      if (strcasecmp (argv[i], "TIFF") == 0)
  1683   1669   			  image_type = GAIA_TIFF_BLOB;
  1684   1670   		      break;
  1685   1671   		  case ARG_QUALITY_FACTOR:
  1686   1672   		      quality_factor = atoi (argv[i]);
................................................................................
  1784   1770   	  /* normalizing the quality factor */
  1785   1771   	  if (quality_factor == -999999)
  1786   1772   	      quality_factor = 75;
  1787   1773   	  if (quality_factor < 10)
  1788   1774   	      quality_factor = 10;
  1789   1775   	  if (quality_factor > 90)
  1790   1776   	      quality_factor = 90;
         1777  +      }
         1778  +    if (image_type == GAIA_WAVELET_BLOB)
         1779  +      {
         1780  +	  /* normalizing the commpression factor */
         1781  +	  if (quality_factor == -999999)
         1782  +	      quality_factor = 25;
         1783  +	  if (quality_factor < 10)
         1784  +	      quality_factor = 10;
         1785  +	  if (quality_factor > 200)
         1786  +	      quality_factor = 200;
  1791   1787         }
  1792   1788       printf ("=====================================================\n");
  1793   1789       printf ("             Arguments Summary\n");
  1794   1790       printf ("=====================================================\n");
  1795   1791       if (test_mode)
  1796   1792   	printf ("TEST mode: no actual action will be performed\n");
  1797   1793       printf ("SpatiaLite DB path: '%s'\n", path);
................................................................................
  1798   1794       printf ("Table prefix: '%s'\n", table);
  1799   1795       printf ("\ttable '%s_rasters' is assumed to store raster tiles\n", table);
  1800   1796       printf ("\ttable '%s_metadata' is assumed to store tile metadata\n", table);
  1801   1797       switch (image_type)
  1802   1798         {
  1803   1799         case GAIA_JPEG_BLOB:
  1804   1800   	  printf ("Pyramid Tile image type: JPEG quality=%d\n", quality_factor);
         1801  +	  break;
         1802  +      case GAIA_WAVELET_BLOB:
         1803  +	  printf ("Pyramid Tile image type: WAVELET compression ratio 1:%d\n",
         1804  +		  quality_factor);
  1805   1805   	  break;
  1806   1806         case GAIA_PNG_BLOB:
  1807   1807   	  printf ("Pyramid Tile image type: PNG [RGB]\n");
  1808   1808   	  break;
  1809   1809         case GAIA_TIFF_BLOB:
  1810   1810   	  printf ("Pyramid Tile image type: TIFF [RGB]\n");
  1811   1811   	  break;

Changes to src/rasterlite_tool.c.

     1      1   /* 
     2      2   / rasterlite_tool.c
     3      3   /
     4      4   / a tool generating rasters from a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49         -
    50     27   #include <stdlib.h>
    51     28   #include <stdio.h>
    52     29   #include <string.h>
    53     30   #include <float.h>
    54     31   
    55     32   #include <tiffio.h>
    56     33   
    57         -#ifdef SPATIALITE_AMALGAMATION
    58     34   #include <spatialite/sqlite3.h>
    59         -#else
    60         -#include <sqlite3.h>
    61         -#endif
    62         -
    63     35   #include <spatialite/gaiaexif.h>
    64     36   #include <spatialite/gaiageo.h>
    65     37   #include <spatialite.h>
    66     38   
    67     39   #include "rasterlite.h"
    68     40   #include "rasterlite_internals.h"
    69     41   

Changes to src/rasterlite_topmost.c.

     1      1   /* 
     2      2   / rasterlite_topmpst.c
     3      3   /
     4      4   / a tool building raster topmost pyramid's levels into a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 25
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10         -/ ------------------------------------------------------------------------------
    11         -/ 
    12         -/ Version: MPL 1.1/GPL 2.0/LGPL 2.1
    13         -/ 
    14         -/ The contents of this file are subject to the Mozilla Public License Version
    15         -/ 1.1 (the "License"); you may not use this file except in compliance with
    16         -/ the License. You may obtain a copy of the License at
    17         -/ http://www.mozilla.org/MPL/
    18         -/ 
    19         -/ Software distributed under the License is distributed on an "AS IS" basis,
    20         -/ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    21         -/ for the specific language governing rights and limitations under the
    22         -/ License.
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
    23     21   /
    24         -/ The Original Code is the RasterLite library
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    25     24   /
    26         -/ The Initial Developer of the Original Code is Alessandro Furieri
    27         -/ 
    28         -/ Portions created by the Initial Developer are Copyright (C) 2009
    29         -/ the Initial Developer. All Rights Reserved.
    30         -/
    31         -/ Alternatively, the contents of this file may be used under the terms of
    32         -/ either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -/ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -/ in which case the provisions of the GPL or the LGPL are applicable instead
    35         -/ of those above. If you wish to allow use of your version of this file only
    36         -/ under the terms of either the GPL or the LGPL, and not to allow others to
    37         -/ use your version of this file under the terms of the MPL, indicate your
    38         -/ decision by deleting the provisions above and replace them with the notice
    39         -/ and other provisions required by the GPL or the LGPL. If you do not delete
    40         -/ the provisions above, a recipient may use your version of this file under
    41         -/ the terms of any one of the MPL, the GPL or the LGPL.
    42         -/ 
    43     25   */
    44     26   
    45         -#if defined(_WIN32) && !defined(__MINGW32__)
    46         -/* MSVC strictly requires this include [off_t] */
    47         -#include <sys/types.h>
    48         -#endif
    49     27   
    50     28   #include <stdlib.h>
    51     29   #include <stdio.h>
    52     30   #include <string.h>
    53     31   #include <float.h>
    54     32   #include <math.h>
    55     33   
    56     34   #include <tiffio.h>
    57     35   
    58         -#ifdef SPATIALITE_AMALGAMATION
    59     36   #include <spatialite/sqlite3.h>
    60         -#else
    61         -#include <sqlite3.h>
    62         -#endif
    63         -
    64     37   #include <spatialite/gaiaexif.h>
    65     38   #include <spatialite/gaiageo.h>
    66     39   #include <spatialite.h>
    67     40   
    68     41   #include "rasterlite.h"
    69     42   #include "rasterlite_internals.h"
    70     43   
................................................................................
   306    279   	list->first = p;
   307    280       if (list->last != NULL)
   308    281   	list->last->next = p;
   309    282       list->last = p;
   310    283   }
   311    284   
   312    285   static void
   313         -copy_rectangle (rasterliteImagePtr output, rasterliteImagePtr input,
          286  +copy_rectangle (rasterliteImagePrt output, rasterliteImagePrt input,
   314    287   		int transparent_color, int base_x, int base_y)
   315    288   {
   316    289   /* copying a raster rectangle */
   317    290       int x;
   318    291       int y;
   319    292       int dst_x;
   320    293       int dst_y;
................................................................................
   359    332       int ret;
   360    333       int hits = 0;
   361    334       void *blob;
   362    335       int blob_size;
   363    336       int new_tile_width;
   364    337       int new_tile_height;
   365    338       gaiaPolygonPtr polyg;
   366         -    rasterliteImagePtr full_size = NULL;
   367         -    rasterliteImagePtr thumbnail = NULL;
          339  +    rasterliteImagePrt full_size = NULL;
          340  +    rasterliteImagePrt thumbnail = NULL;
   368    341       int srid;
   369    342   /* creating the full size image */
   370    343       full_size = image_create (tile_width, tile_height);
   371    344       image_fill (full_size, info->background_color);
   372    345   /* binding query params */
   373    346       sqlite3_reset (info->stmt_query);
   374    347       sqlite3_clear_bindings (info->stmt_query);
................................................................................
   384    357   	  ret = sqlite3_step (info->stmt_query);
   385    358   	  if (ret == SQLITE_DONE)
   386    359   	      break;		/* end of result set */
   387    360   	  if (ret == SQLITE_ROW)
   388    361   	    {
   389    362   		/* retrieving query values */
   390    363   		gaiaGeomCollPtr geom = NULL;
   391         -		rasterliteImagePtr img = NULL;
          364  +		rasterliteImagePrt img = NULL;
   392    365   		if (sqlite3_column_type (info->stmt_query, 0) == SQLITE_BLOB)
   393    366   		  {
   394    367   		      /* fetching Geometry */
   395    368   		      const void *blob =
   396    369   			  sqlite3_column_blob (info->stmt_query, 0);
   397    370   		      int blob_size =
   398    371   			  sqlite3_column_bytes (info->stmt_query, 0);
................................................................................
   439    412   	    {
   440    413   		printf ("SQL error: %s\n", sqlite3_errmsg (info->handle));
   441    414   		image_destroy (full_size);
   442    415   		return 0;
   443    416   	    }
   444    417         }
   445    418       if (!hits)
   446         -      {
   447         -	  image_destroy (full_size);	/* 2011-11-18 ASAHI Kosuke */
   448         -	  return -1;
   449         -      }
          419  +	return -1;
   450    420   /* saving the tile params */
   451    421       new_tile_width = tile_width / 2;
   452    422       if ((new_tile_width * 2) < tile_width)
   453    423   	new_tile_width++;
   454    424       new_tile_height = tile_height / 2;
   455    425       if ((new_tile_height * 2) < tile_height)
   456    426   	new_tile_height++;
................................................................................
   486    456         {
   487    457   	  blob = image_to_png_rgb (thumbnail, &blob_size);
   488    458   	  if (!blob)
   489    459   	    {
   490    460   		printf ("PNG RGB compression error\n");
   491    461   		return 0;
   492    462   	    }
          463  +      }
          464  +    else if (info->image_type == GAIA_WAVELET_BLOB)
          465  +      {
          466  +	  blob = image_to_wavelet (thumbnail, &blob_size, info->quality_factor);
          467  +	  if (!blob)
          468  +	    {
          469  +		printf ("WAVELET compression error\n");
          470  +		return 0;
          471  +	    }
   493    472         }
   494    473       else
   495    474         {
   496    475   	  blob = image_to_jpeg (thumbnail, &blob_size, info->quality_factor);
   497    476   	  if (!blob)
   498    477   	    {
   499    478   		printf ("JPEG compression error\n");
................................................................................
   510    489       else
   511    490         {
   512    491   	  printf ("sqlite3_step() error: %s\n", sqlite3_errmsg (info->handle));
   513    492   	  return 0;
   514    493         }
   515    494       tile->id_raster = sqlite3_last_insert_rowid (info->handle);
   516    495       tile->valid = 1;
   517         -    image_destroy (full_size);	/* 2011-11-18 ASAHI Kosuke */
   518         -    image_destroy (thumbnail);	/* 2011-11-18 ASAHI Kosuke */
   519    496       return 1;
   520    497   }
   521    498   
   522    499   static int
   523    500   build_pyramid_topmost_level (sqlite3 * handle, const char *table,
   524    501   			     int image_type, int quality_factor, int level,
   525    502   			     int tile_size, double x_size, double y_size,
................................................................................
  1201   1178   /* trying to connect SpatiaLite DB */
  1202   1179       sqlite3 *handle = NULL;
  1203   1180       int ret;
  1204   1181       char rasters[512];
  1205   1182       char meta[512];
  1206   1183       char sql[1024];
  1207   1184       int spatialite_rs = 0;
  1208         -    int spatialite_legacy_gc = 0;
  1209   1185       int spatialite_gc = 0;
  1210   1186       int rs_srid = 0;
  1211   1187       int auth_name = 0;
  1212   1188       int auth_srid = 0;
  1213   1189       int ref_sys_name = 0;
  1214   1190       int proj4text = 0;
  1215   1191       int f_table_name = 0;
  1216   1192       int f_geometry_column = 0;
  1217   1193       int coord_dimension = 0;
  1218   1194       int gc_srid = 0;
  1219   1195       int type = 0;
  1220         -    int geometry_type = 0;
  1221   1196       int spatial_index_enabled = 0;
  1222   1197       int tbl_rasters = 0;
  1223   1198       int tbl_meta = 0;
  1224   1199       const char *name;
  1225   1200       int i;
  1226   1201       char **results;
  1227   1202       int rows;
................................................................................
  1257   1232   		    f_geometry_column = 1;
  1258   1233   		if (strcasecmp (name, "coord_dimension") == 0)
  1259   1234   		    coord_dimension = 1;
  1260   1235   		if (strcasecmp (name, "srid") == 0)
  1261   1236   		    gc_srid = 1;
  1262   1237   		if (strcasecmp (name, "type") == 0)
  1263   1238   		    type = 1;
  1264         -		if (strcasecmp (name, "geometry_type") == 0)
  1265         -		    geometry_type = 1;
  1266   1239   		if (strcasecmp (name, "spatial_index_enabled") == 0)
  1267   1240   		    spatial_index_enabled = 1;
  1268   1241   	    }
  1269   1242         }
  1270   1243       sqlite3_free_table (results);
  1271   1244       if (f_table_name && f_geometry_column && type && coord_dimension && gc_srid
  1272   1245   	&& spatial_index_enabled)
  1273         -	spatialite_legacy_gc = 1;
  1274         -    if (f_table_name && f_geometry_column && geometry_type && coord_dimension
  1275         -	&& gc_srid && spatial_index_enabled)
  1276   1246   	spatialite_gc = 1;
  1277   1247   
  1278   1248   /* checking the SPATIAL_REF_SYS table */
  1279   1249       strcpy (sql, "PRAGMA table_info(spatial_ref_sys)");
  1280   1250       ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
  1281   1251       if (ret != SQLITE_OK)
  1282   1252   	goto unknown;
................................................................................
  1300   1270   	    }
  1301   1271         }
  1302   1272       sqlite3_free_table (results);
  1303   1273       if (rs_srid && auth_name && auth_srid && ref_sys_name && proj4text)
  1304   1274   	spatialite_rs = 1;
  1305   1275   
  1306   1276   /* verifying the MetaData format */
  1307         -    if ((spatialite_legacy_gc || spatialite_gc) && spatialite_rs)
         1277  +    if (spatialite_gc && spatialite_rs)
  1308   1278   	goto check_tables;
  1309   1279   
  1310   1280     unknown:
  1311   1281       if (handle)
  1312   1282   	sqlite3_close (handle);
  1313   1283       printf ("DB '%s'\n", path);
  1314   1284       printf ("doesn't seems to contain valid Spatial Metadata ...\n\n");
................................................................................
  1403   1373   	     "-? or --help                      print this help message\n");
  1404   1374       fprintf (stderr,
  1405   1375   	     "-t or --test                      test only - no actual action\n");
  1406   1376       fprintf (stderr, "-v or --verbose                   verbose output\n");
  1407   1377       fprintf (stderr,
  1408   1378   	     "-d or --db-path     pathname      the SpatiaLite db path\n");
  1409   1379       fprintf (stderr, "-T or --table-name  name          DB table name\n");
  1410         -    fprintf (stderr, "-i or --image-type  type          [JPEG|TIFF]\n");
         1380  +    fprintf (stderr, "-i or --image-type  type          [JPEG|WAVELET|TIFF]\n");
  1411   1381       fprintf (stderr,
  1412         -	     "-q or --quality     num           [default = 75(JPEG)]\n");
         1382  +	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
  1413   1383       fprintf (stderr, "-c or --transparent-color 0xRRGGBB [default = NONE]\n");
  1414   1384       fprintf (stderr,
  1415   1385   	     "-b or --background-color  0xRRGGBB [default = 0x000000]\n");
  1416   1386   }
  1417   1387   
  1418   1388   int
  1419   1389   main (int argc, char *argv[])
................................................................................
  1447   1417   		      break;
  1448   1418   		  case ARG_TABLE_NAME:
  1449   1419   		      table = argv[i];
  1450   1420   		      break;
  1451   1421   		  case ARG_IMAGE_TYPE:
  1452   1422   		      if (strcasecmp (argv[i], "JPEG") == 0)
  1453   1423   			  image_type = GAIA_JPEG_BLOB;
         1424  +		      if (strcasecmp (argv[i], "WAVELET") == 0)
         1425  +			  image_type = GAIA_WAVELET_BLOB;
  1454   1426   		      if (strcasecmp (argv[i], "PNG") == 0)
  1455   1427   			  image_type = GAIA_PNG_BLOB;
  1456   1428   		      if (strcasecmp (argv[i], "TIFF") == 0)
  1457   1429   			  image_type = GAIA_TIFF_BLOB;
  1458   1430   		      break;
  1459   1431   		  case ARG_QUALITY_FACTOR:
  1460   1432   		      quality_factor = atoi (argv[i]);
................................................................................
  1615   1587   	  /* normalizing the quality factor */
  1616   1588   	  if (quality_factor == -999999)
  1617   1589   	      quality_factor = 75;
  1618   1590   	  if (quality_factor < 10)
  1619   1591   	      quality_factor = 10;
  1620   1592   	  if (quality_factor > 90)
  1621   1593   	      quality_factor = 90;
         1594  +      }
         1595  +    if (image_type == GAIA_WAVELET_BLOB)
         1596  +      {
         1597  +	  /* normalizing the commpression factor */
         1598  +	  if (quality_factor == -999999)
         1599  +	      quality_factor = 25;
         1600  +	  if (quality_factor < 10)
         1601  +	      quality_factor = 10;
         1602  +	  if (quality_factor > 200)
         1603  +	      quality_factor = 200;
  1622   1604         }
  1623   1605       printf ("=====================================================\n");
  1624   1606       printf ("             Arguments Summary\n");
  1625   1607       printf ("=====================================================\n");
  1626   1608       if (test_mode)
  1627   1609   	printf ("TEST mode: no actual action will be performed\n");
  1628   1610       printf ("SpatiaLite DB path: '%s'\n", path);
................................................................................
  1631   1613       printf ("\ttable '%s_metadata' is assumed to store tile metadata\n", table);
  1632   1614       printf ("Tile preferred max size: %d pixels\n", tile_size);
  1633   1615       switch (image_type)
  1634   1616         {
  1635   1617         case GAIA_JPEG_BLOB:
  1636   1618   	  printf ("Topmost Pyramid Tile image type: JPEG quality=%d\n",
  1637   1619   		  quality_factor);
         1620  +	  break;
         1621  +      case GAIA_WAVELET_BLOB:
         1622  +	  printf
         1623  +	      ("Topmost Pyramid Tile image type: WAVELET compression ratio 1:%d\n",
         1624  +	       quality_factor);
  1638   1625   	  break;
  1639   1626         case GAIA_PNG_BLOB:
  1640   1627   	  printf ("Topmost Pyramid Tile image type: PNG [RGB]\n");
  1641   1628   	  break;
  1642   1629         case GAIA_TIFF_BLOB:
  1643   1630   	  printf ("Topmost Pyramid Tile image type: TIFF [RGB]\n");
  1644   1631   	  break;

Added svn-commit.2.tmp.

            1  +Creating 'librasterlite' SVN
            2  +--Questa linea, e quelle sotto di essa, saranno ignorate--
            3  +
            4  +A    .

Added svn-commit.3.tmp.

            1  +Initial load for 'librasterlite'
            2  +--Questa linea, e quelle sotto di essa, saranno ignorate--
            3  +
            4  +A    .

Added svn-commit.tmp.

            1  +Creating the 'librasterlite' SVN
            2  +--Questa linea, e quelle sotto di essa, saranno ignorate--
            3  +
            4  +A    https://www.gaia-gis.it/svn/librasterlite

Deleted test/Makefile.am.

     1         -check_PROGRAMS = check_version \
     2         -		check_openclose \
     3         -		check_badopen \
     4         -		check_metadata \
     5         -		check_resolution \
     6         -		check_colours \
     7         -		check_rastergen
     8         -
     9         -AM_CFLAGS = -I$(top_srcdir)/headers
    10         -AM_LDFLAGS = -L../lib @LIBSPATIALITE_LIBS@  -lrasterlite -lm $(GCOV_FLAGS)
    11         -
    12         -TESTS = $(check_PROGRAMS)
    13         -
    14         -MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
    15         -
    16         -EXTRA_DIST = globe.sqlite jpeg50ref.jpg

Deleted test/Makefile.in.

     1         -# Makefile.in generated by automake 1.11.6 from Makefile.am.
     2         -# @configure_input@
     3         -
     4         -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
     6         -# Foundation, Inc.
     7         -# This Makefile.in is free software; the Free Software Foundation
     8         -# gives unlimited permission to copy and/or distribute it,
     9         -# with or without modifications, as long as this notice is preserved.
    10         -
    11         -# This program is distributed in the hope that it will be useful,
    12         -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13         -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14         -# PARTICULAR PURPOSE.
    15         -
    16         -@SET_MAKE@
    17         -VPATH = @srcdir@
    18         -am__make_dryrun = \
    19         -  { \
    20         -    am__dry=no; \
    21         -    case $$MAKEFLAGS in \
    22         -      *\\[\ \	]*) \
    23         -        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
    24         -          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
    25         -      *) \
    26         -        for am__flg in $$MAKEFLAGS; do \
    27         -          case $$am__flg in \
    28         -            *=*|--*) ;; \
    29         -            *n*) am__dry=yes; break;; \
    30         -          esac; \
    31         -        done;; \
    32         -    esac; \
    33         -    test $$am__dry = yes; \
    34         -  }
    35         -pkgdatadir = $(datadir)/@PACKAGE@
    36         -pkgincludedir = $(includedir)/@PACKAGE@
    37         -pkglibdir = $(libdir)/@PACKAGE@
    38         -pkglibexecdir = $(libexecdir)/@PACKAGE@
    39         -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    40         -install_sh_DATA = $(install_sh) -c -m 644
    41         -install_sh_PROGRAM = $(install_sh) -c
    42         -install_sh_SCRIPT = $(install_sh) -c
    43         -INSTALL_HEADER = $(INSTALL_DATA)
    44         -transform = $(program_transform_name)
    45         -NORMAL_INSTALL = :
    46         -PRE_INSTALL = :
    47         -POST_INSTALL = :
    48         -NORMAL_UNINSTALL = :
    49         -PRE_UNINSTALL = :
    50         -POST_UNINSTALL = :
    51         -build_triplet = @build@
    52         -host_triplet = @host@
    53         -check_PROGRAMS = check_version$(EXEEXT) check_openclose$(EXEEXT) \
    54         -	check_badopen$(EXEEXT) check_metadata$(EXEEXT) \
    55         -	check_resolution$(EXEEXT) check_colours$(EXEEXT) \
    56         -	check_rastergen$(EXEEXT)
    57         -subdir = test
    58         -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    59         -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    60         -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
    61         -	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
    62         -	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
    63         -	$(top_srcdir)/configure.ac
    64         -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    65         -	$(ACLOCAL_M4)
    66         -mkinstalldirs = $(install_sh) -d
    67         -CONFIG_HEADER = $(top_builddir)/config.h
    68         -CONFIG_CLEAN_FILES =
    69         -CONFIG_CLEAN_VPATH_FILES =
    70         -check_badopen_SOURCES = check_badopen.c
    71         -check_badopen_OBJECTS = check_badopen.$(OBJEXT)
    72         -check_badopen_LDADD = $(LDADD)
    73         -check_colours_SOURCES = check_colours.c
    74         -check_colours_OBJECTS = check_colours.$(OBJEXT)
    75         -check_colours_LDADD = $(LDADD)
    76         -check_metadata_SOURCES = check_metadata.c
    77         -check_metadata_OBJECTS = check_metadata.$(OBJEXT)
    78         -check_metadata_LDADD = $(LDADD)
    79         -check_openclose_SOURCES = check_openclose.c
    80         -check_openclose_OBJECTS = check_openclose.$(OBJEXT)
    81         -check_openclose_LDADD = $(LDADD)
    82         -check_rastergen_SOURCES = check_rastergen.c
    83         -check_rastergen_OBJECTS = check_rastergen.$(OBJEXT)
    84         -check_rastergen_LDADD = $(LDADD)
    85         -check_resolution_SOURCES = check_resolution.c
    86         -check_resolution_OBJECTS = check_resolution.$(OBJEXT)
    87         -check_resolution_LDADD = $(LDADD)
    88         -check_version_SOURCES = check_version.c
    89         -check_version_OBJECTS = check_version.$(OBJEXT)
    90         -check_version_LDADD = $(LDADD)
    91         -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
    92         -depcomp = $(SHELL) $(top_srcdir)/depcomp
    93         -am__depfiles_maybe = depfiles
    94         -am__mv = mv -f
    95         -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    96         -	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    97         -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
    98         -	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    99         -	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
   100         -CCLD = $(CC)
   101         -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
   102         -	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
   103         -	$(LDFLAGS) -o $@
   104         -SOURCES = check_badopen.c check_colours.c check_metadata.c \
   105         -	check_openclose.c check_rastergen.c check_resolution.c \
   106         -	check_version.c
   107         -DIST_SOURCES = check_badopen.c check_colours.c check_metadata.c \
   108         -	check_openclose.c check_rastergen.c check_resolution.c \
   109         -	check_version.c
   110         -am__can_run_installinfo = \
   111         -  case $$AM_UPDATE_INFO_DIR in \
   112         -    n|no|NO) false;; \
   113         -    *) (install-info --version) >/dev/null 2>&1;; \
   114         -  esac
   115         -ETAGS = etags
   116         -CTAGS = ctags
   117         -am__tty_colors = \
   118         -red=; grn=; lgn=; blu=; std=
   119         -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   120         -ACLOCAL = @ACLOCAL@
   121         -AMTAR = @AMTAR@
   122         -AR = @AR@
   123         -AS = @AS@
   124         -AUTOCONF = @AUTOCONF@
   125         -AUTOHEADER = @AUTOHEADER@
   126         -AUTOMAKE = @AUTOMAKE@
   127         -AWK = @AWK@
   128         -CC = @CC@
   129         -CCDEPMODE = @CCDEPMODE@
   130         -CFLAGS = @CFLAGS@
   131         -CPP = @CPP@
   132         -CPPFLAGS = @CPPFLAGS@
   133         -CXX = @CXX@
   134         -CXXCPP = @CXXCPP@
   135         -CXXDEPMODE = @CXXDEPMODE@
   136         -CXXFLAGS = @CXXFLAGS@
   137         -CYGPATH_W = @CYGPATH_W@
   138         -DEFS = @DEFS@
   139         -DEPDIR = @DEPDIR@
   140         -DLLTOOL = @DLLTOOL@
   141         -DSYMUTIL = @DSYMUTIL@
   142         -DUMPBIN = @DUMPBIN@
   143         -ECHO_C = @ECHO_C@
   144         -ECHO_N = @ECHO_N@
   145         -ECHO_T = @ECHO_T@
   146         -EGREP = @EGREP@
   147         -EXEEXT = @EXEEXT@
   148         -FGREP = @FGREP@
   149         -GREP = @GREP@
   150         -INSTALL = @INSTALL@
   151         -INSTALL_DATA = @INSTALL_DATA@
   152         -INSTALL_PROGRAM = @INSTALL_PROGRAM@
   153         -INSTALL_SCRIPT = @INSTALL_SCRIPT@
   154         -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   155         -LD = @LD@
   156         -LDFLAGS = @LDFLAGS@
   157         -LIBOBJS = @LIBOBJS@
   158         -LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
   159         -LIBPNG_LIBS = @LIBPNG_LIBS@
   160         -LIBS = @LIBS@
   161         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   162         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   163         -LIBTOOL = @LIBTOOL@
   164         -LIPO = @LIPO@
   165         -LN_S = @LN_S@
   166         -LTLIBOBJS = @LTLIBOBJS@
   167         -MAINT = @MAINT@
   168         -MAKEINFO = @MAKEINFO@
   169         -MANIFEST_TOOL = @MANIFEST_TOOL@
   170         -MKDIR_P = @MKDIR_P@
   171         -NM = @NM@
   172         -NMEDIT = @NMEDIT@
   173         -OBJDUMP = @OBJDUMP@
   174         -OBJEXT = @OBJEXT@
   175         -OTOOL = @OTOOL@
   176         -OTOOL64 = @OTOOL64@
   177         -PACKAGE = @PACKAGE@
   178         -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   179         -PACKAGE_NAME = @PACKAGE_NAME@
   180         -PACKAGE_STRING = @PACKAGE_STRING@
   181         -PACKAGE_TARNAME = @PACKAGE_TARNAME@
   182         -PACKAGE_URL = @PACKAGE_URL@
   183         -PACKAGE_VERSION = @PACKAGE_VERSION@
   184         -PATH_SEPARATOR = @PATH_SEPARATOR@
   185         -PKG_CONFIG = @PKG_CONFIG@
   186         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   187         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   188         -RANLIB = @RANLIB@
   189         -SED = @SED@
   190         -SET_MAKE = @SET_MAKE@
   191         -SHELL = @SHELL@
   192         -STRIP = @STRIP@
   193         -VERSION = @VERSION@
   194         -abs_builddir = @abs_builddir@
   195         -abs_srcdir = @abs_srcdir@
   196         -abs_top_builddir = @abs_top_builddir@
   197         -abs_top_srcdir = @abs_top_srcdir@
   198         -ac_ct_AR = @ac_ct_AR@
   199         -ac_ct_CC = @ac_ct_CC@
   200         -ac_ct_CXX = @ac_ct_CXX@
   201         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
   202         -am__include = @am__include@
   203         -am__leading_dot = @am__leading_dot@
   204         -am__quote = @am__quote@
   205         -am__tar = @am__tar@
   206         -am__untar = @am__untar@
   207         -bindir = @bindir@
   208         -build = @build@
   209         -build_alias = @build_alias@
   210         -build_cpu = @build_cpu@
   211         -build_os = @build_os@
   212         -build_vendor = @build_vendor@
   213         -builddir = @builddir@
   214         -datadir = @datadir@
   215         -datarootdir = @datarootdir@
   216         -docdir = @docdir@
   217         -dvidir = @dvidir@
   218         -exec_prefix = @exec_prefix@
   219         -host = @host@
   220         -host_alias = @host_alias@
   221         -host_cpu = @host_cpu@
   222         -host_os = @host_os@
   223         -host_vendor = @host_vendor@
   224         -htmldir = @htmldir@
   225         -includedir = @includedir@
   226         -infodir = @infodir@
   227         -install_sh = @install_sh@
   228         -libdir = @libdir@
   229         -libexecdir = @libexecdir@
   230         -localedir = @localedir@
   231         -localstatedir = @localstatedir@
   232         -mandir = @mandir@
   233         -mkdir_p = @mkdir_p@
   234         -oldincludedir = @oldincludedir@
   235         -pdfdir = @pdfdir@
   236         -prefix = @prefix@
   237         -program_transform_name = @program_transform_name@
   238         -psdir = @psdir@
   239         -sbindir = @sbindir@
   240         -sharedstatedir = @sharedstatedir@
   241         -srcdir = @srcdir@
   242         -sysconfdir = @sysconfdir@
   243         -target_alias = @target_alias@
   244         -top_build_prefix = @top_build_prefix@
   245         -top_builddir = @top_builddir@
   246         -top_srcdir = @top_srcdir@
   247         -AM_CFLAGS = -I$(top_srcdir)/headers
   248         -AM_LDFLAGS = -L../lib @LIBSPATIALITE_LIBS@  -lrasterlite -lm $(GCOV_FLAGS)
   249         -TESTS = $(check_PROGRAMS)
   250         -MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
   251         -EXTRA_DIST = globe.sqlite jpeg50ref.jpg
   252         -all: all-am
   253         -
   254         -.SUFFIXES:
   255         -.SUFFIXES: .c .lo .o .obj
   256         -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   257         -	@for dep in $?; do \
   258         -	  case '$(am__configure_deps)' in \
   259         -	    *$$dep*) \
   260         -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   261         -	        && { if test -f $@; then exit 0; else break; fi; }; \
   262         -	      exit 1;; \
   263         -	  esac; \
   264         -	done; \
   265         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
   266         -	$(am__cd) $(top_srcdir) && \
   267         -	  $(AUTOMAKE) --gnu test/Makefile
   268         -.PRECIOUS: Makefile
   269         -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   270         -	@case '$?' in \
   271         -	  *config.status*) \
   272         -	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   273         -	  *) \
   274         -	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
   275         -	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
   276         -	esac;
   277         -
   278         -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   279         -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   280         -
   281         -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   282         -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   283         -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   284         -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   285         -$(am__aclocal_m4_deps):
   286         -
   287         -clean-checkPROGRAMS:
   288         -	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
   289         -	echo " rm -f" $$list; \
   290         -	rm -f $$list || exit $$?; \
   291         -	test -n "$(EXEEXT)" || exit 0; \
   292         -	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
   293         -	echo " rm -f" $$list; \
   294         -	rm -f $$list
   295         -check_badopen$(EXEEXT): $(check_badopen_OBJECTS) $(check_badopen_DEPENDENCIES) $(EXTRA_check_badopen_DEPENDENCIES) 
   296         -	@rm -f check_badopen$(EXEEXT)
   297         -	$(LINK) $(check_badopen_OBJECTS) $(check_badopen_LDADD) $(LIBS)
   298         -check_colours$(EXEEXT): $(check_colours_OBJECTS) $(check_colours_DEPENDENCIES) $(EXTRA_check_colours_DEPENDENCIES) 
   299         -	@rm -f check_colours$(EXEEXT)
   300         -	$(LINK) $(check_colours_OBJECTS) $(check_colours_LDADD) $(LIBS)
   301         -check_metadata$(EXEEXT): $(check_metadata_OBJECTS) $(check_metadata_DEPENDENCIES) $(EXTRA_check_metadata_DEPENDENCIES) 
   302         -	@rm -f check_metadata$(EXEEXT)
   303         -	$(LINK) $(check_metadata_OBJECTS) $(check_metadata_LDADD) $(LIBS)
   304         -check_openclose$(EXEEXT): $(check_openclose_OBJECTS) $(check_openclose_DEPENDENCIES) $(EXTRA_check_openclose_DEPENDENCIES) 
   305         -	@rm -f check_openclose$(EXEEXT)
   306         -	$(LINK) $(check_openclose_OBJECTS) $(check_openclose_LDADD) $(LIBS)
   307         -check_rastergen$(EXEEXT): $(check_rastergen_OBJECTS) $(check_rastergen_DEPENDENCIES) $(EXTRA_check_rastergen_DEPENDENCIES) 
   308         -	@rm -f check_rastergen$(EXEEXT)
   309         -	$(LINK) $(check_rastergen_OBJECTS) $(check_rastergen_LDADD) $(LIBS)
   310         -check_resolution$(EXEEXT): $(check_resolution_OBJECTS) $(check_resolution_DEPENDENCIES) $(EXTRA_check_resolution_DEPENDENCIES) 
   311         -	@rm -f check_resolution$(EXEEXT)
   312         -	$(LINK) $(check_resolution_OBJECTS) $(check_resolution_LDADD) $(LIBS)
   313         -check_version$(EXEEXT): $(check_version_OBJECTS) $(check_version_DEPENDENCIES) $(EXTRA_check_version_DEPENDENCIES) 
   314         -	@rm -f check_version$(EXEEXT)
   315         -	$(LINK) $(check_version_OBJECTS) $(check_version_LDADD) $(LIBS)
   316         -
   317         -mostlyclean-compile:
   318         -	-rm -f *.$(OBJEXT)
   319         -
   320         -distclean-compile:
   321         -	-rm -f *.tab.c
   322         -
   323         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_badopen.Po@am__quote@
   324         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_colours.Po@am__quote@
   325         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_metadata.Po@am__quote@
   326         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_openclose.Po@am__quote@
   327         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_rastergen.Po@am__quote@
   328         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_resolution.Po@am__quote@
   329         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_version.Po@am__quote@
   330         -
   331         -.c.o:
   332         -@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   333         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   334         -@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   335         -@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   336         -@am__fastdepCC_FALSE@	$(COMPILE) -c $<
   337         -
   338         -.c.obj:
   339         -@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
   340         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   341         -@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   342         -@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   343         -@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
   344         -
   345         -.c.lo:
   346         -@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   347         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
   348         -@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
   349         -@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   350         -@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
   351         -
   352         -mostlyclean-libtool:
   353         -	-rm -f *.lo
   354         -
   355         -clean-libtool:
   356         -	-rm -rf .libs _libs
   357         -
   358         -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   359         -	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   360         -	unique=`for i in $$list; do \
   361         -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   362         -	  done | \
   363         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   364         -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   365         -	mkid -fID $$unique
   366         -tags: TAGS
   367         -
   368         -TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   369         -		$(TAGS_FILES) $(LISP)
   370         -	set x; \
   371         -	here=`pwd`; \
   372         -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   373         -	unique=`for i in $$list; do \
   374         -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   375         -	  done | \
   376         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   377         -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   378         -	shift; \
   379         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
   380         -	  test -n "$$unique" || unique=$$empty_fix; \
   381         -	  if test $$# -gt 0; then \
   382         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   383         -	      "$$@" $$unique; \
   384         -	  else \
   385         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   386         -	      $$unique; \
   387         -	  fi; \
   388         -	fi
   389         -ctags: CTAGS
   390         -CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   391         -		$(TAGS_FILES) $(LISP)
   392         -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   393         -	unique=`for i in $$list; do \
   394         -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   395         -	  done | \
   396         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   397         -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   398         -	test -z "$(CTAGS_ARGS)$$unique" \
   399         -	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   400         -	     $$unique
   401         -
   402         -GTAGS:
   403         -	here=`$(am__cd) $(top_builddir) && pwd` \
   404         -	  && $(am__cd) $(top_srcdir) \
   405         -	  && gtags -i $(GTAGS_ARGS) "$$here"
   406         -
   407         -distclean-tags:
   408         -	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   409         -
   410         -check-TESTS: $(TESTS)
   411         -	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
   412         -	srcdir=$(srcdir); export srcdir; \
   413         -	list=' $(TESTS) '; \
   414         -	$(am__tty_colors); \
   415         -	if test -n "$$list"; then \
   416         -	  for tst in $$list; do \
   417         -	    if test -f ./$$tst; then dir=./; \
   418         -	    elif test -f $$tst; then dir=; \
   419         -	    else dir="$(srcdir)/"; fi; \
   420         -	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
   421         -	      all=`expr $$all + 1`; \
   422         -	      case " $(XFAIL_TESTS) " in \
   423         -	      *[\ \	]$$tst[\ \	]*) \
   424         -		xpass=`expr $$xpass + 1`; \
   425         -		failed=`expr $$failed + 1`; \
   426         -		col=$$red; res=XPASS; \
   427         -	      ;; \
   428         -	      *) \
   429         -		col=$$grn; res=PASS; \
   430         -	      ;; \
   431         -	      esac; \
   432         -	    elif test $$? -ne 77; then \
   433         -	      all=`expr $$all + 1`; \
   434         -	      case " $(XFAIL_TESTS) " in \
   435         -	      *[\ \	]$$tst[\ \	]*) \
   436         -		xfail=`expr $$xfail + 1`; \
   437         -		col=$$lgn; res=XFAIL; \
   438         -	      ;; \
   439         -	      *) \
   440         -		failed=`expr $$failed + 1`; \
   441         -		col=$$red; res=FAIL; \
   442         -	      ;; \
   443         -	      esac; \
   444         -	    else \
   445         -	      skip=`expr $$skip + 1`; \
   446         -	      col=$$blu; res=SKIP; \
   447         -	    fi; \
   448         -	    echo "$${col}$$res$${std}: $$tst"; \
   449         -	  done; \
   450         -	  if test "$$all" -eq 1; then \
   451         -	    tests="test"; \
   452         -	    All=""; \
   453         -	  else \
   454         -	    tests="tests"; \
   455         -	    All="All "; \
   456         -	  fi; \
   457         -	  if test "$$failed" -eq 0; then \
   458         -	    if test "$$xfail" -eq 0; then \
   459         -	      banner="$$All$$all $$tests passed"; \
   460         -	    else \
   461         -	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
   462         -	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
   463         -	    fi; \
   464         -	  else \
   465         -	    if test "$$xpass" -eq 0; then \
   466         -	      banner="$$failed of $$all $$tests failed"; \
   467         -	    else \
   468         -	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
   469         -	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
   470         -	    fi; \
   471         -	  fi; \
   472         -	  dashes="$$banner"; \
   473         -	  skipped=""; \
   474         -	  if test "$$skip" -ne 0; then \
   475         -	    if test "$$skip" -eq 1; then \
   476         -	      skipped="($$skip test was not run)"; \
   477         -	    else \
   478         -	      skipped="($$skip tests were not run)"; \
   479         -	    fi; \
   480         -	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
   481         -	      dashes="$$skipped"; \
   482         -	  fi; \
   483         -	  report=""; \
   484         -	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
   485         -	    report="Please report to $(PACKAGE_BUGREPORT)"; \
   486         -	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
   487         -	      dashes="$$report"; \
   488         -	  fi; \
   489         -	  dashes=`echo "$$dashes" | sed s/./=/g`; \
   490         -	  if test "$$failed" -eq 0; then \
   491         -	    col="$$grn"; \
   492         -	  else \
   493         -	    col="$$red"; \
   494         -	  fi; \
   495         -	  echo "$${col}$$dashes$${std}"; \
   496         -	  echo "$${col}$$banner$${std}"; \
   497         -	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
   498         -	  test -z "$$report" || echo "$${col}$$report$${std}"; \
   499         -	  echo "$${col}$$dashes$${std}"; \
   500         -	  test "$$failed" -eq 0; \
   501         -	else :; fi
   502         -
   503         -distdir: $(DISTFILES)
   504         -	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   505         -	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   506         -	list='$(DISTFILES)'; \
   507         -	  dist_files=`for file in $$list; do echo $$file; done | \
   508         -	  sed -e "s|^$$srcdirstrip/||;t" \
   509         -	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
   510         -	case $$dist_files in \
   511         -	  */*) $(MKDIR_P) `echo "$$dist_files" | \
   512         -			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   513         -			   sort -u` ;; \
   514         -	esac; \
   515         -	for file in $$dist_files; do \
   516         -	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   517         -	  if test -d $$d/$$file; then \
   518         -	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   519         -	    if test -d "$(distdir)/$$file"; then \
   520         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   521         -	    fi; \
   522         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   523         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   524         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   525         -	    fi; \
   526         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
   527         -	  else \
   528         -	    test -f "$(distdir)/$$file" \
   529         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
   530         -	    || exit 1; \
   531         -	  fi; \
   532         -	done
   533         -check-am: all-am
   534         -	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
   535         -	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
   536         -check: check-am
   537         -all-am: Makefile
   538         -installdirs:
   539         -install: install-am
   540         -install-exec: install-exec-am
   541         -install-data: install-data-am
   542         -uninstall: uninstall-am
   543         -
   544         -install-am: all-am
   545         -	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   546         -
   547         -installcheck: installcheck-am
   548         -install-strip:
   549         -	if test -z '$(STRIP)'; then \
   550         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   551         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   552         -	      install; \
   553         -	else \
   554         -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   555         -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   556         -	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
   557         -	fi
   558         -mostlyclean-generic:
   559         -	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
   560         -
   561         -clean-generic:
   562         -
   563         -distclean-generic:
   564         -	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   565         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   566         -
   567         -maintainer-clean-generic:
   568         -	@echo "This command is intended for maintainers to use"
   569         -	@echo "it deletes files that may require special tools to rebuild."
   570         -clean: clean-am
   571         -
   572         -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
   573         -	mostlyclean-am
   574         -
   575         -distclean: distclean-am
   576         -	-rm -rf ./$(DEPDIR)
   577         -	-rm -f Makefile
   578         -distclean-am: clean-am distclean-compile distclean-generic \
   579         -	distclean-tags
   580         -
   581         -dvi: dvi-am
   582         -
   583         -dvi-am:
   584         -
   585         -html: html-am
   586         -
   587         -html-am:
   588         -
   589         -info: info-am
   590         -
   591         -info-am:
   592         -
   593         -install-data-am:
   594         -
   595         -install-dvi: install-dvi-am
   596         -
   597         -install-dvi-am:
   598         -
   599         -install-exec-am:
   600         -
   601         -install-html: install-html-am
   602         -
   603         -install-html-am:
   604         -
   605         -install-info: install-info-am
   606         -
   607         -install-info-am:
   608         -
   609         -install-man:
   610         -
   611         -install-pdf: install-pdf-am
   612         -
   613         -install-pdf-am:
   614         -
   615         -install-ps: install-ps-am
   616         -
   617         -install-ps-am:
   618         -
   619         -installcheck-am:
   620         -
   621         -maintainer-clean: maintainer-clean-am
   622         -	-rm -rf ./$(DEPDIR)
   623         -	-rm -f Makefile
   624         -maintainer-clean-am: distclean-am maintainer-clean-generic
   625         -
   626         -mostlyclean: mostlyclean-am
   627         -
   628         -mostlyclean-am: mostlyclean-compile mostlyclean-generic \
   629         -	mostlyclean-libtool
   630         -
   631         -pdf: pdf-am
   632         -
   633         -pdf-am:
   634         -
   635         -ps: ps-am
   636         -
   637         -ps-am:
   638         -
   639         -uninstall-am:
   640         -
   641         -.MAKE: check-am install-am install-strip
   642         -
   643         -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
   644         -	clean-checkPROGRAMS clean-generic clean-libtool ctags \
   645         -	distclean distclean-compile distclean-generic \
   646         -	distclean-libtool distclean-tags distdir dvi dvi-am html \
   647         -	html-am info info-am install install-am install-data \
   648         -	install-data-am install-dvi install-dvi-am install-exec \
   649         -	install-exec-am install-html install-html-am install-info \
   650         -	install-info-am install-man install-pdf install-pdf-am \
   651         -	install-ps install-ps-am install-strip installcheck \
   652         -	installcheck-am installdirs maintainer-clean \
   653         -	maintainer-clean-generic mostlyclean mostlyclean-compile \
   654         -	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
   655         -	tags uninstall uninstall-am
   656         -
   657         -
   658         -# Tell versions [3.59,3.63) of GNU make to not export all variables.
   659         -# Otherwise a system limit (for SysV at least) may be exceeded.
   660         -.NOEXPORT:

Deleted test/check_badopen.c.

     1         -/*
     2         -
     3         - check_badopen.c -- RasterLite Test Case
     4         -
     5         - Author: Brad Hards <bradh@frogmouth.net>
     6         -
     7         - ------------------------------------------------------------------------------
     8         - 
     9         - Version: MPL 1.1/GPL 2.0/LGPL 2.1
    10         - 
    11         - The contents of this file are subject to the Mozilla Public License Version
    12         - 1.1 (the "License"); you may not use this file except in compliance with
    13         - the License. You may obtain a copy of the License at
    14         - http://www.mozilla.org/MPL/
    15         - 
    16         -Software distributed under the License is distributed on an "AS IS" basis,
    17         -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    18         -for the specific language governing rights and limitations under the
    19         -License.
    20         -
    21         -The Original Code is the SpatiaLite library
    22         -
    23         -The Initial Developer of the Original Code is Alessandro Furieri
    24         - 
    25         -Portions created by the Initial Developer are Copyright (C) 2011
    26         -the Initial Developer. All Rights Reserved.
    27         -
    28         -Contributor(s):
    29         -Brad Hards <bradh@frogmouth.net>
    30         -
    31         -Alternatively, the contents of this file may be used under the terms of
    32         -either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -in which case the provisions of the GPL or the LGPL are applicable instead
    35         -of those above. If you wish to allow use of your version of this file only
    36         -under the terms of either the GPL or the LGPL, and not to allow others to
    37         -use your version of this file under the terms of the MPL, indicate your
    38         -decision by deleting the provisions above and replace them with the notice
    39         -and other provisions required by the GPL or the LGPL. If you do not delete
    40         -the provisions above, a recipient may use your version of this file under
    41         -the terms of any one of the MPL, the GPL or the LGPL.
    42         - 
    43         -*/
    44         -#include <stdlib.h>
    45         -#include <stdio.h>
    46         -#include <string.h>
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef SPATIALITE_AMALGAMATION
    51         -#include <spatialite/sqlite3.h>
    52         -#else
    53         -#include <sqlite3.h>
    54         -#endif
    55         -
    56         -#include <spatialite/gaiaexif.h>
    57         -
    58         -#include "../headers/rasterlite.h"
    59         -
    60         -int main (void)
    61         -{
    62         -    void *handle = NULL;
    63         -    int result;
    64         -    unsigned char *raster;
    65         -    int size;
    66         -    
    67         -    handle = rasterliteOpen ("no such file.sqlite", "globe");
    68         -    if ( ! rasterliteIsError(handle))
    69         -    {
    70         -	/* some unexpected error occurred */
    71         -	printf("ERROR: expected failure for bad filename\n");
    72         -	return -1;
    73         -    }
    74         -    rasterliteClose(handle);
    75         -
    76         -    handle = rasterliteOpen ("globe.sqlite", "no such entries");
    77         -    if ( ! rasterliteIsError(handle))
    78         -    {
    79         -	/* some unexpected error occurred */
    80         -	printf("ERROR: expected failure for bad table\n");
    81         -	return -2;
    82         -    }
    83         -    
    84         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_JPEG_BLOB, 50, (void**)&raster, &size);
    85         -    if (result != RASTERLITE_ERROR)
    86         -    {
    87         -	printf("ERROR: GetRaster bad handle unexpected result: %i\n", result);
    88         -	rasterliteClose(handle);
    89         -	return -3;
    90         -    }
    91         -    if (strcmp(rasterliteGetLastError(handle), "invalid datasource") != 0)
    92         -    {
    93         -	printf("ERROR: last error mismatch: %s\n", rasterliteGetLastError(handle));
    94         -	rasterliteClose(handle);
    95         -	return -4;
    96         -    }
    97         -    
    98         -    rasterliteClose(handle);
    99         -    
   100         -    return 0;
   101         -}

Deleted test/check_colours.c.

     1         -/*
     2         -
     3         - check_colours.c -- RasterLite Test Case
     4         -
     5         - Author: Brad Hards <bradh@frogmouth.net>
     6         -
     7         - ------------------------------------------------------------------------------
     8         - 
     9         - Version: MPL 1.1/GPL 2.0/LGPL 2.1
    10         - 
    11         - The contents of this file are subject to the Mozilla Public License Version
    12         - 1.1 (the "License"); you may not use this file except in compliance with
    13         - the License. You may obtain a copy of the License at
    14         - http://www.mozilla.org/MPL/
    15         - 
    16         -Software distributed under the License is distributed on an "AS IS" basis,
    17         -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    18         -for the specific language governing rights and limitations under the
    19         -License.
    20         -
    21         -The Original Code is the SpatiaLite library
    22         -
    23         -The Initial Developer of the Original Code is Alessandro Furieri
    24         - 
    25         -Portions created by the Initial Developer are Copyright (C) 2011
    26         -the Initial Developer. All Rights Reserved.
    27         -
    28         -Contributor(s):
    29         -Brad Hards <bradh@frogmouth.net>
    30         -
    31         -Alternatively, the contents of this file may be used under the terms of
    32         -either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -in which case the provisions of the GPL or the LGPL are applicable instead
    35         -of those above. If you wish to allow use of your version of this file only
    36         -under the terms of either the GPL or the LGPL, and not to allow others to
    37         -use your version of this file under the terms of the MPL, indicate your
    38         -decision by deleting the provisions above and replace them with the notice
    39         -and other provisions required by the GPL or the LGPL. If you do not delete
    40         -the provisions above, a recipient may use your version of this file under
    41         -the terms of any one of the MPL, the GPL or the LGPL.
    42         - 
    43         -*/
    44         -#include <stdlib.h>
    45         -#include <stdio.h>
    46         -#include <string.h>
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef SPATIALITE_AMALGAMATION
    51         -#include <spatialite/sqlite3.h>
    52         -#else
    53         -#include <sqlite3.h>
    54         -#endif
    55         -
    56         -#include "../headers/rasterlite.h"
    57         -
    58         -int main (void)
    59         -{
    60         -    void *handle = NULL;
    61         -    int hasTransparentColour = RASTERLITE_OK;
    62         -    int hasBackgroundColour = RASTERLITE_OK;
    63         -    unsigned char red = 128;
    64         -    unsigned char green = 128;
    65         -    unsigned char blue = 128;
    66         -    
    67         -    handle = rasterliteOpen ("globe.sqlite", "globe");
    68         -    if (rasterliteIsError(handle))
    69         -    {
    70         -	/* some unexpected error occurred */
    71         -	printf("ERROR: rasterliteOpen %s\n", rasterliteGetLastError(handle));
    72         -	rasterliteClose(handle);
    73         -	return -1;
    74         -    }
    75         -    
    76         -    hasTransparentColour = rasterliteHasTransparentColor(handle);
    77         -    if (hasTransparentColour != RASTERLITE_ERROR)
    78         -    {
    79         -	printf("ERROR: unexpected transparent colour result: %i\n", hasTransparentColour);
    80         -	rasterliteClose(handle);
    81         -	return -2;
    82         -    }
    83         -    
    84         -    /* no colour yet, so we expect defaults */
    85         -    hasTransparentColour = rasterliteGetTransparentColor(handle, &red, &green, &blue);
    86         -    if (hasTransparentColour != RASTERLITE_ERROR)
    87         -    {
    88         -	printf("ERROR: unexpected default get transparent colour result: %i\n", hasTransparentColour);
    89         -	rasterliteClose(handle);
    90         -	return -3;
    91         -    }
    92         -    if ((red != 0) || (green != 0) || (blue != 0))
    93         -    {
    94         -	printf("ERROR: unexpected default values, red = %i, green = %i, blue = %i\n", red, green, blue);
    95         -	rasterliteClose(handle);
    96         -	return -4;
    97         -    }
    98         -    
    99         -    /* set the colour */
   100         -    rasterliteSetTransparentColor(handle, 64, 128, 172);
   101         -    
   102         -    /* check again */
   103         -    hasTransparentColour = rasterliteHasTransparentColor(handle);
   104         -    if (hasTransparentColour != RASTERLITE_OK)
   105         -    {
   106         -	printf("ERROR: unexpected transparent colour result2: %i\n", hasTransparentColour);
   107         -	rasterliteClose(handle);
   108         -	return -5;
   109         -    }
   110         -    hasTransparentColour = rasterliteGetTransparentColor(handle, &red, &green, &blue);
   111         -    if (hasTransparentColour != RASTERLITE_OK)
   112         -    {
   113         -	printf("ERROR: unexpected default get transparent colour result2: %i\n", hasTransparentColour);
   114         -	rasterliteClose(handle);
   115         -	return -6;
   116         -    }
   117         -    if ((red != 64) || (green != 128) || (blue != 172))
   118         -    {
   119         -	printf("ERROR: unexpected default values2, red = %i, green = %i, blue = %i\n", red, green, blue);
   120         -	rasterliteClose(handle);
   121         -	return -7;
   122         -    }
   123         -    
   124         -    /* check default background */
   125         -    hasBackgroundColour = rasterliteGetBackgroundColor(handle, &red, &green, &blue);
   126         -    if (hasBackgroundColour != RASTERLITE_OK)
   127         -    {
   128         -	printf("ERROR: unexpected default get background colour result: %i\n", hasBackgroundColour);
   129         -	rasterliteClose(handle);
   130         -	return -8;
   131         -    }
   132         -    if ((red != 0) || (green != 0) || (blue != 0))
   133         -    {
   134         -	printf("ERROR: unexpected background default values, red = %i, green = %i, blue = %i\n", red, green, blue);
   135         -	rasterliteClose(handle);
   136         -	return -9;
   137         -    }
   138         -    
   139         -    /* set background colour */
   140         -    rasterliteSetBackgroundColor(handle, 56, 103, 202);
   141         -
   142         -    /* check again */
   143         -    hasBackgroundColour = rasterliteGetBackgroundColor(handle, &red, &green, &blue);
   144         -    if (hasBackgroundColour != RASTERLITE_OK)
   145         -    {
   146         -	printf("ERROR: unexpected default get background colour result2: %i\n", hasBackgroundColour);
   147         -	rasterliteClose(handle);
   148         -	return -10;
   149         -    }
   150         -    if ((red != 56) || (green != 103) || (blue != 202))
   151         -    {
   152         -	printf("ERROR: unexpected background values, red = %i, green = %i, blue = %i\n", red, green, blue);
   153         -	rasterliteClose(handle);
   154         -	return -11;
   155         -    }
   156         -    
   157         -    rasterliteClose(handle);
   158         -    return 0;
   159         -}

Deleted test/check_metadata.c.

     1         -/*
     2         -
     3         - check_metadata.c -- RasterLite Test Case
     4         -
     5         - Author: Brad Hards <bradh@frogmouth.net>
     6         -
     7         - ------------------------------------------------------------------------------
     8         - 
     9         - Version: MPL 1.1/GPL 2.0/LGPL 2.1
    10         - 
    11         - The contents of this file are subject to the Mozilla Public License Version
    12         - 1.1 (the "License"); you may not use this file except in compliance with
    13         - the License. You may obtain a copy of the License at
    14         - http://www.mozilla.org/MPL/
    15         - 
    16         -Software distributed under the License is distributed on an "AS IS" basis,
    17         -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    18         -for the specific language governing rights and limitations under the
    19         -License.
    20         -
    21         -The Original Code is the SpatiaLite library
    22         -
    23         -The Initial Developer of the Original Code is Alessandro Furieri
    24         - 
    25         -Portions created by the Initial Developer are Copyright (C) 2011
    26         -the Initial Developer. All Rights Reserved.
    27         -
    28         -Contributor(s):
    29         -Brad Hards <bradh@frogmouth.net>
    30         -
    31         -Alternatively, the contents of this file may be used under the terms of
    32         -either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -in which case the provisions of the GPL or the LGPL are applicable instead
    35         -of those above. If you wish to allow use of your version of this file only
    36         -under the terms of either the GPL or the LGPL, and not to allow others to
    37         -use your version of this file under the terms of the MPL, indicate your
    38         -decision by deleting the provisions above and replace them with the notice
    39         -and other provisions required by the GPL or the LGPL. If you do not delete
    40         -the provisions above, a recipient may use your version of this file under
    41         -the terms of any one of the MPL, the GPL or the LGPL.
    42         - 
    43         -*/
    44         -#include <stdlib.h>
    45         -#include <stdio.h>
    46         -#include <string.h>
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef SPATIALITE_AMALGAMATION
    51         -#include <spatialite/sqlite3.h>
    52         -#else
    53         -#include <sqlite3.h>
    54         -#endif
    55         -
    56         -#include <spatialite.h>
    57         -
    58         -#include "../headers/rasterlite.h"
    59         -
    60         -int main (void)
    61         -{
    62         -    void *handle = NULL;
    63         -    int levels = 0;
    64         -    const char *prefixName = NULL;
    65         -    double min_x;
    66         -    double min_y;
    67         -    double max_x;
    68         -    double max_y;
    69         -    int srid;
    70         -    const char *auth_name;
    71         -    int auth_srid;
    72         -    const char *ref_sys_name;
    73         -    const char *proj4text;
    74         -	
    75         -    handle = rasterliteOpen ("globe.sqlite", "globe");
    76         -    if (rasterliteIsError(handle))
    77         -    {
    78         -	/* some unexpected error occurred */
    79         -	printf("ERROR: rasterliteOpen %s\n", rasterliteGetLastError(handle));
    80         -	rasterliteClose(handle);
    81         -	return -1;
    82         -    }
    83         -    
    84         -    levels = rasterliteGetLevels(handle);
    85         -    if (levels != 4)
    86         -    {
    87         -	printf("ERROR: unexpected levels count: %i\n", levels);
    88         -	rasterliteClose(handle);
    89         -	return -2;
    90         -    }
    91         -
    92         -    prefixName = rasterliteGetTablePrefix(handle);
    93         -    if (strcmp(prefixName, "globe") != 0)
    94         -    {
    95         -	printf("ERROR: unexpected prefix: %s\n", prefixName);
    96         -	rasterliteClose(handle);
    97         -	return -3;
    98         -    }
    99         -    
   100         -    if (rasterliteGetExtent(handle, &min_x, &min_y, &max_x, &max_y) != RASTERLITE_OK)
   101         -    {
   102         -	printf("ERROR: rasterliteGetExtent %s\n", rasterliteGetLastError(handle));
   103         -	rasterliteClose(handle);
   104         -	return -4;
   105         -    }
   106         -    if (min_x != -180.0)
   107         -    {
   108         -	printf("ERROR: bad minimum X extent: %f", min_x);
   109         -	rasterliteClose(handle);
   110         -	return -5;
   111         -    }
   112         -    if (max_x != 180.0)
   113         -    {
   114         -	printf("ERROR: bad maximum X extent: %f", max_x);
   115         -	rasterliteClose(handle);
   116         -	return -6;
   117         -    }
   118         -    if (min_y != -90.0)
   119         -    {
   120         -	printf("ERROR: bad minimum Y extent: %f", min_y);
   121         -	rasterliteClose(handle);
   122         -	return -7;
   123         -    }
   124         -    if (max_x != 180.0)
   125         -    {
   126         -	printf("ERROR: bad maximum Y extent: %f", max_y);
   127         -	rasterliteClose(handle);
   128         -	return -8;
   129         -    }
   130         -    
   131         -    if (rasterliteGetSrid(handle, &srid, &auth_name, &auth_srid, &ref_sys_name, &proj4text) != RASTERLITE_OK)
   132         -    {
   133         -	printf("ERROR: rasterliteGetSrid %s\n", rasterliteGetLastError(handle));
   134         -	rasterliteClose(handle);
   135         -	return -9;
   136         -    }
   137         -    if (srid != 4326)
   138         -    {
   139         -	printf("ERROR: unexpected SRID: %i\n", srid);
   140         -	rasterliteClose(handle);
   141         -	return -10;
   142         -    }
   143         -    if (strcmp(auth_name, "epsg") !=0)
   144         -    {
   145         -	printf("ERROR: unexpected SRID authority: %s\n", auth_name);
   146         -	rasterliteClose(handle);
   147         -	return -11;
   148         -    }
   149         -    if (auth_srid != 4326)
   150         -    {
   151         -	printf("ERROR: unexpected Authority SRID: %i\n", auth_srid);
   152         -	rasterliteClose(handle);
   153         -	return -12;
   154         -    }
   155         -    if (strcmp(ref_sys_name, "WGS 84") != 0)
   156         -    {
   157         -	printf("ERROR: unexpected Ref System name: %s\n", ref_sys_name);
   158         -	rasterliteClose(handle);
   159         -	return -13;
   160         -    }
   161         -    if (strcmp(proj4text, "+proj=longlat +datum=WGS84 +no_defs") != 0)
   162         -    {
   163         -	printf("ERROR: unexpected PROJ.4 text: %s\n", proj4text);
   164         -	rasterliteClose(handle);
   165         -	return -14;
   166         -    }
   167         -    
   168         -    if (strcmp(rasterliteGetSqliteVersion(handle), sqlite3_libversion()) != 0)
   169         -    {
   170         -	printf("ERROR: unexpected sqlite version: %s\n", rasterliteGetSqliteVersion(handle));
   171         -	rasterliteClose(handle);
   172         -	return -15;
   173         -    }
   174         -    
   175         -    if (strcmp(rasterliteGetSpatialiteVersion(handle), spatialite_version()) != 0)
   176         -    {
   177         -	printf("ERROR: unexpected spatialite version: %s\n", rasterliteGetSpatialiteVersion(handle));
   178         -	rasterliteClose(handle);
   179         -	return -16;
   180         -    }
   181         -    
   182         -    if (strcmp(rasterliteGetPath(handle), "globe.sqlite") != 0)
   183         -    {
   184         -	printf("ERROR: unexpected path: %s\n", rasterliteGetPath(handle));
   185         -	rasterliteClose(handle);
   186         -	return -17;
   187         -    }
   188         -    
   189         -    rasterliteClose(handle);
   190         -    return 0;
   191         -}

Deleted test/check_openclose.c.

     1         -/*
     2         -
     3         - check_openclose.c -- RasterLite Test Case
     4         -
     5         - Author: Brad Hards <bradh@frogmouth.net>
     6         -
     7         - ------------------------------------------------------------------------------
     8         - 
     9         - Version: MPL 1.1/GPL 2.0/LGPL 2.1
    10         - 
    11         - The contents of this file are subject to the Mozilla Public License Version
    12         - 1.1 (the "License"); you may not use this file except in compliance with
    13         - the License. You may obtain a copy of the License at
    14         - http://www.mozilla.org/MPL/
    15         - 
    16         -Software distributed under the License is distributed on an "AS IS" basis,
    17         -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    18         -for the specific language governing rights and limitations under the
    19         -License.
    20         -
    21         -The Original Code is the SpatiaLite library
    22         -
    23         -The Initial Developer of the Original Code is Alessandro Furieri
    24         - 
    25         -Portions created by the Initial Developer are Copyright (C) 2011
    26         -the Initial Developer. All Rights Reserved.
    27         -
    28         -Contributor(s):
    29         -Brad Hards <bradh@frogmouth.net>
    30         -
    31         -Alternatively, the contents of this file may be used under the terms of
    32         -either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -in which case the provisions of the GPL or the LGPL are applicable instead
    35         -of those above. If you wish to allow use of your version of this file only
    36         -under the terms of either the GPL or the LGPL, and not to allow others to
    37         -use your version of this file under the terms of the MPL, indicate your
    38         -decision by deleting the provisions above and replace them with the notice
    39         -and other provisions required by the GPL or the LGPL. If you do not delete
    40         -the provisions above, a recipient may use your version of this file under
    41         -the terms of any one of the MPL, the GPL or the LGPL.
    42         - 
    43         -*/
    44         -#include <stdlib.h>
    45         -#include <stdio.h>
    46         -#include <string.h>
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef SPATIALITE_AMALGAMATION
    51         -#include <spatialite/sqlite3.h>
    52         -#else
    53         -#include <sqlite3.h>
    54         -#endif
    55         -
    56         -#include "../headers/rasterlite.h"
    57         -
    58         -int main (void)
    59         -{
    60         -    void *handle = NULL;
    61         -    handle = rasterliteOpen ("globe.sqlite", "globe");
    62         -    if (rasterliteIsError(handle))
    63         -    {
    64         -	/* some unexpected error occurred */
    65         -	printf("ERROR: %s\n", rasterliteGetLastError(handle));
    66         -	rasterliteClose(handle);
    67         -	return -1;
    68         -    }
    69         -    
    70         -    rasterliteClose(handle);
    71         -    return 0;
    72         -}

Deleted test/check_rastergen.c.

     1         -/*
     2         -
     3         - check_rastergen.c -- RasterLite Test Case
     4         -
     5         - Author: Brad Hards <bradh@frogmouth.net>
     6         -
     7         - ------------------------------------------------------------------------------
     8         - 
     9         - Version: MPL 1.1/GPL 2.0/LGPL 2.1
    10         - 
    11         - The contents of this file are subject to the Mozilla Public License Version
    12         - 1.1 (the "License"); you may not use this file except in compliance with
    13         - the License. You may obtain a copy of the License at
    14         - http://www.mozilla.org/MPL/
    15         - 
    16         -Software distributed under the License is distributed on an "AS IS" basis,
    17         -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    18         -for the specific language governing rights and limitations under the
    19         -License.
    20         -
    21         -The Original Code is the SpatiaLite library
    22         -
    23         -The Initial Developer of the Original Code is Alessandro Furieri
    24         - 
    25         -Portions created by the Initial Developer are Copyright (C) 2011
    26         -the Initial Developer. All Rights Reserved.
    27         -
    28         -Contributor(s):
    29         -Brad Hards <bradh@frogmouth.net>
    30         -
    31         -Alternatively, the contents of this file may be used under the terms of
    32         -either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -in which case the provisions of the GPL or the LGPL are applicable instead
    35         -of those above. If you wish to allow use of your version of this file only
    36         -under the terms of either the GPL or the LGPL, and not to allow others to
    37         -use your version of this file under the terms of the MPL, indicate your
    38         -decision by deleting the provisions above and replace them with the notice
    39         -and other provisions required by the GPL or the LGPL. If you do not delete
    40         -the provisions above, a recipient may use your version of this file under
    41         -the terms of any one of the MPL, the GPL or the LGPL.
    42         - 
    43         -*/
    44         -#include <stdlib.h>
    45         -#include <stdio.h>
    46         -#include <string.h>
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef SPATIALITE_AMALGAMATION
    51         -#include <spatialite/sqlite3.h>
    52         -#else
    53         -#include <sqlite3.h>
    54         -#endif
    55         -
    56         -#include <spatialite/gaiaexif.h>
    57         -
    58         -#include "../headers/rasterlite.h"
    59         -
    60         -int main (void)
    61         -{
    62         -    void *handle = NULL;
    63         -    int result;
    64         -    unsigned char *raster;
    65         -    unsigned char *refraster;
    66         -    int size;
    67         -    int sizeref = 4540;
    68         -    int sizemin = sizeref;
    69         -    FILE *reffilestream;
    70         -    int i;
    71         -    
    72         -    handle = rasterliteOpen ("globe.sqlite", "globe");
    73         -    if (rasterliteIsError(handle))
    74         -    {
    75         -	/* some unexpected error occurred */
    76         -	printf("ERROR: rasterliteOpen %s\n", rasterliteGetLastError(handle));
    77         -	rasterliteClose(handle);
    78         -	return -1;
    79         -    }
    80         -    
    81         -    
    82         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_JPEG_BLOB, 50, (void**)&raster, &size);
    83         -    if (result != RASTERLITE_OK)
    84         -    {
    85         -	printf("ERROR: GetRaster JPEG 50 %s\n", rasterliteGetLastError(handle));
    86         -	rasterliteClose(handle);
    87         -	return -2;
    88         -    }
    89         -    if (sizemin > size)
    90         -        sizemin = size;
    91         - 
    92         -    reffilestream = fopen("jpeg50ref.jpg", "rb");
    93         -    refraster = malloc(sizeref);
    94         -    if ((int) fread (refraster, 1, sizeref, reffilestream) != sizeref)
    95         -    {
    96         -	fprintf (stderr, "read error on jpeg50ref.jpg reference file\n");
    97         -	rasterliteClose(handle);
    98         -	return -3;
    99         -    }
   100         -    fclose (reffilestream);
   101         -    
   102         -    for (i = 0; i < sizemin; i++)
   103         -    {
   104         -        if (i == 63 || i == 64)
   105         -        {
   106         -        /* skipping libjpeg version number */
   107         -            continue;
   108         -        }
   109         -	if (refraster[i] != raster[i])
   110         -	{
   111         -	    printf("ERROR: jpeg50 reference image mismatch at offset %i\n", i);
   112         -	    rasterliteClose(handle);
   113         -	    free(raster);
   114         -	    free(refraster);
   115         -	    return -4;
   116         -	}
   117         -    }
   118         -    free(raster);
   119         -    free(refraster);
   120         -  
   121         -    /* TODO: we could generate reference images and do the comparison for each case */
   122         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_EXIF_BLOB, 50, (void**)&raster, &size);
   123         -    if ((result != RASTERLITE_OK) || (size != 4540))
   124         -    {
   125         -	printf("ERROR: GetRaster EXIF 50 %s, %i bytes\n", rasterliteGetLastError(handle), size);
   126         -	rasterliteClose(handle);
   127         -	return -5;
   128         -    }
   129         -    free(raster);
   130         -	
   131         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_EXIF_GPS_BLOB, 50, (void**)&raster, &size);
   132         -    if ((result != RASTERLITE_OK) || (size != 4540))
   133         -    {
   134         -	printf("ERROR: GetRaster EXIF GPS 50 %s, %i bytes\n", rasterliteGetLastError(handle), size);
   135         -	rasterliteClose(handle);
   136         -	return -6;
   137         -    }
   138         -    free(raster);
   139         -    
   140         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_PNG_BLOB, 0, (void**)&raster, &size);
   141         -    if ((result != RASTERLITE_OK) || (size != 43280))
   142         -    {
   143         -	printf("ERROR: GetRaster PNG %s, %i bytes\n", rasterliteGetLastError(handle), size);
   144         -	rasterliteClose(handle);
   145         -	return -7;
   146         -    }
   147         -    free(raster);
   148         -    
   149         -    /* very small blob */
   150         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 64, 64, GAIA_PNG_BLOB, 0, (void**)&raster, &size);
   151         -    if ((result != RASTERLITE_OK) || (size != 3955))
   152         -    {
   153         -	printf("ERROR: GetRaster PNG 64 x 64 %s, %i bytes\n", rasterliteGetLastError(handle), size);
   154         -	rasterliteClose(handle);
   155         -	return -8;
   156         -    }
   157         -    free(raster);
   158         -    
   159         -    /* too small */
   160         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 63, 63, GAIA_PNG_BLOB, 0, (void**)&raster, &size);
   161         -    if (result != RASTERLITE_ERROR)
   162         -    {
   163         -	printf("ERROR: unexpected result for GetRaster PNG 63 x 63\n");
   164         -	rasterliteClose(handle);
   165         -	return -9;
   166         -    }
   167         -    free(raster);
   168         -    
   169         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 64, 63, GAIA_PNG_BLOB, 0, (void**)&raster, &size);
   170         -    if (result != RASTERLITE_ERROR)
   171         -    {
   172         -	printf("ERROR: unexpected result for GetRaster PNG 63 x 63\n");
   173         -	rasterliteClose(handle);
   174         -	return -10;
   175         -    }
   176         -    free(raster);
   177         -    
   178         -    /* too big */
   179         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 32769, 64, GAIA_PNG_BLOB, 0, (void**)&raster, &size);
   180         -    if (result != RASTERLITE_ERROR)
   181         -    {
   182         -	printf("ERROR: unexpected result for GetRaster PNG 32769 x 64\n");
   183         -	rasterliteClose(handle);
   184         -	return -11;
   185         -    }
   186         -    free(raster);
   187         -    
   188         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 1024, 32769, GAIA_PNG_BLOB, 0, (void**)&raster, &size);
   189         -    if (result != RASTERLITE_ERROR)
   190         -    {
   191         -	printf("ERROR: unexpected result for GetRaster PNG 64 x 32769\n");
   192         -	rasterliteClose(handle);
   193         -	return -12;
   194         -    }
   195         -    free(raster);
   196         -
   197         -    /* pretty big - you may wish to disable this test if you don't have much RAM */
   198         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 8192, 8192, GAIA_PNG_BLOB, 0, (void**)&raster, &size);
   199         -    if (result != RASTERLITE_OK)
   200         -    {
   201         -	printf("ERROR: unexpected result for GetRaster PNG 8192 x 8192\n");
   202         -	rasterliteClose(handle);
   203         -	return -13;
   204         -    }
   205         -    free(raster);
   206         -    
   207         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_RGB_ARRAY, 50, (void**)&raster, &size);
   208         -    if ((result != RASTERLITE_OK) || (size != (256*256*3)))
   209         -    {
   210         -	printf("ERROR: GetRaster RGB ARRAY 256 x 256 %s, %i bytes\n", rasterliteGetLastError(handle), size);
   211         -	rasterliteClose(handle);
   212         -	return -14;
   213         -    }
   214         -    free(raster);
   215         -    
   216         -#if 0
   217         -    /* this returns a "GIF compression error" */
   218         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_GIF_BLOB, 50, (void**)&raster, &size);
   219         -    if ((result != RASTERLITE_OK) || (size != 5000))
   220         -    {
   221         -	printf("ERROR: GetRaster GIF BLOB 256 x 256 %s, %i bytes\n", rasterliteGetLastError(handle), size);
   222         -	rasterliteClose(handle);
   223         -	return -15;
   224         -    }
   225         -    free(raster);
   226         -#endif
   227         -
   228         -    result = rasterliteGetRaster(handle, 133.0, -40.0, 0.36, 256, 256, GAIA_TIFF_BLOB, 50, (void**)&raster, &size);
   229         -    if ((result != RASTERLITE_OK) || (size != 198901))
   230         -    {
   231         -	printf("ERROR: GetRaster TIFF BLOB 256 x 256 %s, %i bytes\n", rasterliteGetLastError(handle), size);
   232         -	rasterliteClose(handle);
   233         -	return -15;
   234         -    }
   235         -    free(raster);
   236         -    rasterliteClose(handle);
   237         -    
   238         -    return 0;
   239         -}

Deleted test/check_resolution.c.

     1         -/*
     2         -
     3         - check_resolution.c -- RasterLite Test Case
     4         -
     5         - Author: Brad Hards <bradh@frogmouth.net>
     6         -
     7         - ------------------------------------------------------------------------------
     8         - 
     9         - Version: MPL 1.1/GPL 2.0/LGPL 2.1
    10         - 
    11         - The contents of this file are subject to the Mozilla Public License Version
    12         - 1.1 (the "License"); you may not use this file except in compliance with
    13         - the License. You may obtain a copy of the License at
    14         - http://www.mozilla.org/MPL/
    15         - 
    16         -Software distributed under the License is distributed on an "AS IS" basis,
    17         -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    18         -for the specific language governing rights and limitations under the
    19         -License.
    20         -
    21         -The Original Code is the SpatiaLite library
    22         -
    23         -The Initial Developer of the Original Code is Alessandro Furieri
    24         - 
    25         -Portions created by the Initial Developer are Copyright (C) 2011
    26         -the Initial Developer. All Rights Reserved.
    27         -
    28         -Contributor(s):
    29         -Brad Hards <bradh@frogmouth.net>
    30         -
    31         -Alternatively, the contents of this file may be used under the terms of
    32         -either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -in which case the provisions of the GPL or the LGPL are applicable instead
    35         -of those above. If you wish to allow use of your version of this file only
    36         -under the terms of either the GPL or the LGPL, and not to allow others to
    37         -use your version of this file under the terms of the MPL, indicate your
    38         -decision by deleting the provisions above and replace them with the notice
    39         -and other provisions required by the GPL or the LGPL. If you do not delete
    40         -the provisions above, a recipient may use your version of this file under
    41         -the terms of any one of the MPL, the GPL or the LGPL.
    42         - 
    43         -*/
    44         -#include <stdlib.h>
    45         -#include <stdio.h>
    46         -#include <string.h>
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef SPATIALITE_AMALGAMATION
    51         -#include <spatialite/sqlite3.h>
    52         -#else
    53         -#include <sqlite3.h>
    54         -#endif
    55         -
    56         -#include "../headers/rasterlite.h"
    57         -
    58         -int main (void)
    59         -{
    60         -    void *handle = NULL;
    61         -    int levels = 0;
    62         -    double x_size = 0.0;
    63         -    double y_size = 0.0;
    64         -    int tile_count = 0;
    65         -
    66         -    handle = rasterliteOpen ("globe.sqlite", "globe");
    67         -    if (rasterliteIsError(handle))
    68         -    {
    69         -	/* some unexpected error occurred */
    70         -	printf("ERROR: rasterliteOpen %s\n", rasterliteGetLastError(handle));
    71         -	rasterliteClose(handle);
    72         -	return -1;
    73         -    }
    74         -    
    75         -    levels = rasterliteGetLevels(handle);
    76         -    if (levels != 4)
    77         -    {
    78         -	printf("ERROR: unexpected levels count: %i\n", levels);
    79         -	rasterliteClose(handle);
    80         -	return -2;
    81         -    }
    82         -
    83         -    rasterliteGetResolution(handle, 0, &x_size, &y_size, &tile_count);
    84         -    if ((x_size != 1.44) || (y_size != 1.44) || (tile_count != 1))
    85         -    {
    86         -	printf("ERROR: unexpected resolution at level 0: x_size = %f, y_size = %f, tiles = %i\n", x_size, y_size, tile_count);
    87         -	rasterliteClose(handle);
    88         -	return -3;
    89         -    }
    90         -    
    91         -    rasterliteGetResolution(handle, 1, &x_size, &y_size, &tile_count);
    92         -    if ((x_size != 0.72) || (y_size != 0.72) || (tile_count != 1))
    93         -    {
    94         -	printf("ERROR: unexpected resolution at level 1: x_size = %f, y_size = %f, tiles = %i\n", x_size, y_size, tile_count);
    95         -	rasterliteClose(handle);
    96         -	return -4;
    97         -    }
    98         -    
    99         -    rasterliteGetResolution(handle, 2, &x_size, &y_size, &tile_count);
   100         -    if ((x_size != 0.36) || (y_size != 0.36) || (tile_count != 4))
   101         -    {
   102         -	printf("ERROR: unexpected resolution at level 2: x_size = %f, y_size = %f, tiles = %i\n", x_size, y_size, tile_count);
   103         -	rasterliteClose(handle);
   104         -	return -5;
   105         -    }
   106         -
   107         -    rasterliteGetResolution(handle, 3, &x_size, &y_size, &tile_count);
   108         -    if ((x_size != 0.18) || (y_size != 0.18) || (tile_count != 16))
   109         -    {
   110         -	printf("ERROR: unexpected resolution at level 3: x_size = %f, y_size = %f, tiles = %i\n", x_size, y_size, tile_count);
   111         -	rasterliteClose(handle);
   112         -	return -6;
   113         -    }
   114         -    
   115         -    rasterliteClose(handle);
   116         -    return 0;
   117         -}

Deleted test/check_version.c.

     1         -/*
     2         -
     3         - check_version.c -- RasterLite Test Case
     4         -
     5         - Author: Brad Hards <bradh@frogmouth.net>
     6         -
     7         - ------------------------------------------------------------------------------
     8         - 
     9         - Version: MPL 1.1/GPL 2.0/LGPL 2.1
    10         - 
    11         - The contents of this file are subject to the Mozilla Public License Version
    12         - 1.1 (the "License"); you may not use this file except in compliance with
    13         - the License. You may obtain a copy of the License at
    14         - http://www.mozilla.org/MPL/
    15         - 
    16         -Software distributed under the License is distributed on an "AS IS" basis,
    17         -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    18         -for the specific language governing rights and limitations under the
    19         -License.
    20         -
    21         -The Original Code is the SpatiaLite library
    22         -
    23         -The Initial Developer of the Original Code is Alessandro Furieri
    24         - 
    25         -Portions created by the Initial Developer are Copyright (C) 2011
    26         -the Initial Developer. All Rights Reserved.
    27         -
    28         -Contributor(s):
    29         -Brad Hards <bradh@frogmouth.net>
    30         -
    31         -Alternatively, the contents of this file may be used under the terms of
    32         -either the GNU General Public License Version 2 or later (the "GPL"), or
    33         -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    34         -in which case the provisions of the GPL or the LGPL are applicable instead
    35         -of those above. If you wish to allow use of your version of this file only
    36         -under the terms of either the GPL or the LGPL, and not to allow others to
    37         -use your version of this file under the terms of the MPL, indicate your
    38         -decision by deleting the provisions above and replace them with the notice
    39         -and other provisions required by the GPL or the LGPL. If you do not delete
    40         -the provisions above, a recipient may use your version of this file under
    41         -the terms of any one of the MPL, the GPL or the LGPL.
    42         - 
    43         -*/
    44         -#include <stdlib.h>
    45         -#include <stdio.h>
    46         -#include <string.h>
    47         -
    48         -#include "config.h"
    49         -
    50         -#ifdef SPATIALITE_AMALGAMATION
    51         -#include <spatialite/sqlite3.h>
    52         -#else
    53         -#include <sqlite3.h>
    54         -#endif
    55         -
    56         -#include "../headers/rasterlite.h"
    57         -
    58         -int main (void)
    59         -{
    60         -    if (strcmp(rasterliteGetVersion(), VERSION) != 0) {
    61         -	fprintf(stderr, "RasterLite version mismatch: %s and %s\n",
    62         -		VERSION, rasterliteGetVersion());
    63         -	return -1;
    64         -    }
    65         -    
    66         -    return 0;
    67         -}

Deleted test/globe.sqlite.

cannot compute difference between binary files

Deleted test/jpeg50ref.jpg.

cannot compute difference between binary files