summaryrefslogtreecommitdiffstats
path: root/recipes-security/clamav/clamav-0.98.5/0011-Add-libmspack-library-from-upstream-without-unnecess.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/clamav/clamav-0.98.5/0011-Add-libmspack-library-from-upstream-without-unnecess.patch')
-rw-r--r--recipes-security/clamav/clamav-0.98.5/0011-Add-libmspack-library-from-upstream-without-unnecess.patch56090
1 files changed, 0 insertions, 56090 deletions
diff --git a/recipes-security/clamav/clamav-0.98.5/0011-Add-libmspack-library-from-upstream-without-unnecess.patch b/recipes-security/clamav/clamav-0.98.5/0011-Add-libmspack-library-from-upstream-without-unnecess.patch
deleted file mode 100644
index b6df9c2..0000000
--- a/recipes-security/clamav/clamav-0.98.5/0011-Add-libmspack-library-from-upstream-without-unnecess.patch
+++ /dev/null
@@ -1,56090 +0,0 @@
1From e61759267dd586ead646ac7717edf73cf04fe4f3 Mon Sep 17 00:00:00 2001
2From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
3Date: Wed, 30 Jul 2014 21:01:09 +0200
4Subject: Add libmspack library from upstream without unnecessary files
5
6this is from http://www.cabextract.org.uk/libmspack/libmspack-0.4alpha.tar.gz
7
8Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
9---
10 libclamav/libmspack-0.4alpha/AUTHORS | 12 +
11 libclamav/libmspack-0.4alpha/COPYING.LIB | 504 +
12 libclamav/libmspack-0.4alpha/ChangeLog | 491 +
13 libclamav/libmspack-0.4alpha/INSTALL | 370 +
14 libclamav/libmspack-0.4alpha/Makefile.am | 100 +
15 libclamav/libmspack-0.4alpha/Makefile.in | 1371 ++
16 libclamav/libmspack-0.4alpha/NEWS | 0
17 libclamav/libmspack-0.4alpha/README | 130 +
18 libclamav/libmspack-0.4alpha/TODO | 8 +
19 libclamav/libmspack-0.4alpha/aclocal.m4 | 1033 ++
20 libclamav/libmspack-0.4alpha/config.guess | 1530 +++
21 libclamav/libmspack-0.4alpha/config.h.in | 113 +
22 libclamav/libmspack-0.4alpha/config.sub | 1773 +++
23 libclamav/libmspack-0.4alpha/configure | 14567 ++++++++++++++++++++++
24 libclamav/libmspack-0.4alpha/configure.ac | 50 +
25 libclamav/libmspack-0.4alpha/depcomp | 688 +
26 libclamav/libmspack-0.4alpha/install-sh | 520 +
27 libclamav/libmspack-0.4alpha/libmspack.pc.in | 10 +
28 libclamav/libmspack-0.4alpha/ltmain.sh | 9661 ++++++++++++++
29 libclamav/libmspack-0.4alpha/m4/libtool.m4 | 8001 ++++++++++++
30 libclamav/libmspack-0.4alpha/m4/ltoptions.m4 | 384 +
31 libclamav/libmspack-0.4alpha/m4/ltsugar.m4 | 123 +
32 libclamav/libmspack-0.4alpha/m4/ltversion.m4 | 23 +
33 libclamav/libmspack-0.4alpha/m4/lt~obsolete.m4 | 98 +
34 libclamav/libmspack-0.4alpha/missing | 331 +
35 libclamav/libmspack-0.4alpha/mspack/cab.h | 127 +
36 libclamav/libmspack-0.4alpha/mspack/cabc.c | 24 +
37 libclamav/libmspack-0.4alpha/mspack/cabd.c | 1444 +++
38 libclamav/libmspack-0.4alpha/mspack/chm.h | 122 +
39 libclamav/libmspack-0.4alpha/mspack/chmc.c | 24 +
40 libclamav/libmspack-0.4alpha/mspack/chmd.c | 1392 +++
41 libclamav/libmspack-0.4alpha/mspack/crc32.c | 95 +
42 libclamav/libmspack-0.4alpha/mspack/crc32.h | 17 +
43 libclamav/libmspack-0.4alpha/mspack/des.h | 15 +
44 libclamav/libmspack-0.4alpha/mspack/hlp.h | 33 +
45 libclamav/libmspack-0.4alpha/mspack/hlpc.c | 24 +
46 libclamav/libmspack-0.4alpha/mspack/hlpd.c | 24 +
47 libclamav/libmspack-0.4alpha/mspack/kwaj.h | 118 +
48 libclamav/libmspack-0.4alpha/mspack/kwajc.c | 24 +
49 libclamav/libmspack-0.4alpha/mspack/kwajd.c | 561 +
50 libclamav/libmspack-0.4alpha/mspack/lit.h | 35 +
51 libclamav/libmspack-0.4alpha/mspack/litc.c | 24 +
52 libclamav/libmspack-0.4alpha/mspack/litd.c | 24 +
53 libclamav/libmspack-0.4alpha/mspack/lzss.h | 66 +
54 libclamav/libmspack-0.4alpha/mspack/lzssd.c | 93 +
55 libclamav/libmspack-0.4alpha/mspack/lzx.h | 221 +
56 libclamav/libmspack-0.4alpha/mspack/lzxc.c | 18 +
57 libclamav/libmspack-0.4alpha/mspack/lzxd.c | 895 ++
58 libclamav/libmspack-0.4alpha/mspack/mspack.h | 2353 ++++
59 libclamav/libmspack-0.4alpha/mspack/mszip.h | 126 +
60 libclamav/libmspack-0.4alpha/mspack/mszipc.c | 18 +
61 libclamav/libmspack-0.4alpha/mspack/mszipd.c | 514 +
62 libclamav/libmspack-0.4alpha/mspack/oab.h | 60 +
63 libclamav/libmspack-0.4alpha/mspack/oabc.c | 24 +
64 libclamav/libmspack-0.4alpha/mspack/oabd.c | 408 +
65 libclamav/libmspack-0.4alpha/mspack/qtm.h | 128 +
66 libclamav/libmspack-0.4alpha/mspack/qtmd.c | 489 +
67 libclamav/libmspack-0.4alpha/mspack/readbits.h | 207 +
68 libclamav/libmspack-0.4alpha/mspack/readhuff.h | 173 +
69 libclamav/libmspack-0.4alpha/mspack/sha.h | 15 +
70 libclamav/libmspack-0.4alpha/mspack/system.c | 239 +
71 libclamav/libmspack-0.4alpha/mspack/system.h | 124 +
72 libclamav/libmspack-0.4alpha/mspack/szdd.h | 39 +
73 libclamav/libmspack-0.4alpha/mspack/szddc.c | 24 +
74 libclamav/libmspack-0.4alpha/mspack/szddd.c | 247 +
75 libclamav/libmspack-0.4alpha/test/cabd_md5.c | 161 +
76 libclamav/libmspack-0.4alpha/test/cabd_memory.c | 179 +
77 libclamav/libmspack-0.4alpha/test/cabd_test.c | 386 +
78 libclamav/libmspack-0.4alpha/test/cabrip.c | 81 +
79 libclamav/libmspack-0.4alpha/test/chmd_find.c | 95 +
80 libclamav/libmspack-0.4alpha/test/chmd_md5.c | 67 +
81 libclamav/libmspack-0.4alpha/test/chmd_order.c | 144 +
82 libclamav/libmspack-0.4alpha/test/chminfo.c | 284 +
83 libclamav/libmspack-0.4alpha/test/chmx.c | 216 +
84 libclamav/libmspack-0.4alpha/test/error.h | 22 +
85 libclamav/libmspack-0.4alpha/test/expand.c | 79 +
86 libclamav/libmspack-0.4alpha/test/md5.c | 457 +
87 libclamav/libmspack-0.4alpha/test/md5.h | 165 +
88 libclamav/libmspack-0.4alpha/test/md5_fh.h | 123 +
89 libclamav/libmspack-0.4alpha/test/multifh.c | 435 +
90 libclamav/libmspack-0.4alpha/test/oabx.c | 41 +
91 81 files changed, 55434 insertions(+)
92 create mode 100644 libclamav/libmspack-0.4alpha/AUTHORS
93 create mode 100644 libclamav/libmspack-0.4alpha/COPYING.LIB
94 create mode 100644 libclamav/libmspack-0.4alpha/ChangeLog
95 create mode 100644 libclamav/libmspack-0.4alpha/INSTALL
96 create mode 100644 libclamav/libmspack-0.4alpha/Makefile.am
97 create mode 100644 libclamav/libmspack-0.4alpha/Makefile.in
98 create mode 100644 libclamav/libmspack-0.4alpha/NEWS
99 create mode 100644 libclamav/libmspack-0.4alpha/README
100 create mode 100644 libclamav/libmspack-0.4alpha/TODO
101 create mode 100644 libclamav/libmspack-0.4alpha/aclocal.m4
102 create mode 100755 libclamav/libmspack-0.4alpha/config.guess
103 create mode 100644 libclamav/libmspack-0.4alpha/config.h.in
104 create mode 100755 libclamav/libmspack-0.4alpha/config.sub
105 create mode 100755 libclamav/libmspack-0.4alpha/configure
106 create mode 100644 libclamav/libmspack-0.4alpha/configure.ac
107 create mode 100755 libclamav/libmspack-0.4alpha/depcomp
108 create mode 100755 libclamav/libmspack-0.4alpha/install-sh
109 create mode 100644 libclamav/libmspack-0.4alpha/libmspack.pc.in
110 create mode 100644 libclamav/libmspack-0.4alpha/ltmain.sh
111 create mode 100644 libclamav/libmspack-0.4alpha/m4/libtool.m4
112 create mode 100644 libclamav/libmspack-0.4alpha/m4/ltoptions.m4
113 create mode 100644 libclamav/libmspack-0.4alpha/m4/ltsugar.m4
114 create mode 100644 libclamav/libmspack-0.4alpha/m4/ltversion.m4
115 create mode 100644 libclamav/libmspack-0.4alpha/m4/lt~obsolete.m4
116 create mode 100755 libclamav/libmspack-0.4alpha/missing
117 create mode 100644 libclamav/libmspack-0.4alpha/mspack/cab.h
118 create mode 100644 libclamav/libmspack-0.4alpha/mspack/cabc.c
119 create mode 100644 libclamav/libmspack-0.4alpha/mspack/cabd.c
120 create mode 100644 libclamav/libmspack-0.4alpha/mspack/chm.h
121 create mode 100644 libclamav/libmspack-0.4alpha/mspack/chmc.c
122 create mode 100644 libclamav/libmspack-0.4alpha/mspack/chmd.c
123 create mode 100644 libclamav/libmspack-0.4alpha/mspack/crc32.c
124 create mode 100644 libclamav/libmspack-0.4alpha/mspack/crc32.h
125 create mode 100644 libclamav/libmspack-0.4alpha/mspack/des.h
126 create mode 100644 libclamav/libmspack-0.4alpha/mspack/hlp.h
127 create mode 100644 libclamav/libmspack-0.4alpha/mspack/hlpc.c
128 create mode 100644 libclamav/libmspack-0.4alpha/mspack/hlpd.c
129 create mode 100644 libclamav/libmspack-0.4alpha/mspack/kwaj.h
130 create mode 100644 libclamav/libmspack-0.4alpha/mspack/kwajc.c
131 create mode 100644 libclamav/libmspack-0.4alpha/mspack/kwajd.c
132 create mode 100644 libclamav/libmspack-0.4alpha/mspack/lit.h
133 create mode 100644 libclamav/libmspack-0.4alpha/mspack/litc.c
134 create mode 100644 libclamav/libmspack-0.4alpha/mspack/litd.c
135 create mode 100644 libclamav/libmspack-0.4alpha/mspack/lzss.h
136 create mode 100644 libclamav/libmspack-0.4alpha/mspack/lzssd.c
137 create mode 100644 libclamav/libmspack-0.4alpha/mspack/lzx.h
138 create mode 100644 libclamav/libmspack-0.4alpha/mspack/lzxc.c
139 create mode 100644 libclamav/libmspack-0.4alpha/mspack/lzxd.c
140 create mode 100755 libclamav/libmspack-0.4alpha/mspack/mspack.h
141 create mode 100644 libclamav/libmspack-0.4alpha/mspack/mszip.h
142 create mode 100644 libclamav/libmspack-0.4alpha/mspack/mszipc.c
143 create mode 100644 libclamav/libmspack-0.4alpha/mspack/mszipd.c
144 create mode 100644 libclamav/libmspack-0.4alpha/mspack/oab.h
145 create mode 100644 libclamav/libmspack-0.4alpha/mspack/oabc.c
146 create mode 100644 libclamav/libmspack-0.4alpha/mspack/oabd.c
147 create mode 100644 libclamav/libmspack-0.4alpha/mspack/qtm.h
148 create mode 100644 libclamav/libmspack-0.4alpha/mspack/qtmd.c
149 create mode 100644 libclamav/libmspack-0.4alpha/mspack/readbits.h
150 create mode 100644 libclamav/libmspack-0.4alpha/mspack/readhuff.h
151 create mode 100644 libclamav/libmspack-0.4alpha/mspack/sha.h
152 create mode 100644 libclamav/libmspack-0.4alpha/mspack/system.c
153 create mode 100644 libclamav/libmspack-0.4alpha/mspack/system.h
154 create mode 100644 libclamav/libmspack-0.4alpha/mspack/szdd.h
155 create mode 100644 libclamav/libmspack-0.4alpha/mspack/szddc.c
156 create mode 100644 libclamav/libmspack-0.4alpha/mspack/szddd.c
157 create mode 100644 libclamav/libmspack-0.4alpha/test/cabd_md5.c
158 create mode 100644 libclamav/libmspack-0.4alpha/test/cabd_memory.c
159 create mode 100644 libclamav/libmspack-0.4alpha/test/cabd_test.c
160 create mode 100644 libclamav/libmspack-0.4alpha/test/cabrip.c
161 create mode 100644 libclamav/libmspack-0.4alpha/test/chmd_find.c
162 create mode 100644 libclamav/libmspack-0.4alpha/test/chmd_md5.c
163 create mode 100644 libclamav/libmspack-0.4alpha/test/chmd_order.c
164 create mode 100644 libclamav/libmspack-0.4alpha/test/chminfo.c
165 create mode 100644 libclamav/libmspack-0.4alpha/test/chmx.c
166 create mode 100644 libclamav/libmspack-0.4alpha/test/error.h
167 create mode 100644 libclamav/libmspack-0.4alpha/test/expand.c
168 create mode 100644 libclamav/libmspack-0.4alpha/test/md5.c
169 create mode 100644 libclamav/libmspack-0.4alpha/test/md5.h
170 create mode 100644 libclamav/libmspack-0.4alpha/test/md5_fh.h
171 create mode 100644 libclamav/libmspack-0.4alpha/test/multifh.c
172 create mode 100644 libclamav/libmspack-0.4alpha/test/oabx.c
173
174diff --git a/libclamav/libmspack-0.4alpha/AUTHORS b/libclamav/libmspack-0.4alpha/AUTHORS
175new file mode 100644
176index 000000000000..be28722a8075
177--- /dev/null
178+++ b/libclamav/libmspack-0.4alpha/AUTHORS
179@@ -0,0 +1,12 @@
180+Principal author: Stuart Caie
181+
182+Based on specification documents from Microsoft Corporation and PKWARE.
183+
184+Contributors:
185+- LZX compressor by Matthew Russotto
186+- Quantum decompressor by Matthew Russotto
187+- old inflate decompressor by Dirk Stoecker / InfoZIP team
188+- Huffman table builder adapted from unlzx by Dave Tritscher
189+- LZX decompressor fixes by Jae Jung and Igor Glucksmann
190+- Debianisation by Markus Sinner
191+- Quantum decompressor fix by Larry Frieson
192diff --git a/libclamav/libmspack-0.4alpha/COPYING.LIB b/libclamav/libmspack-0.4alpha/COPYING.LIB
193new file mode 100644
194index 000000000000..b1e3f5a26387
195--- /dev/null
196+++ b/libclamav/libmspack-0.4alpha/COPYING.LIB
197@@ -0,0 +1,504 @@
198+ GNU LESSER GENERAL PUBLIC LICENSE
199+ Version 2.1, February 1999
200+
201+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
202+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
203+ Everyone is permitted to copy and distribute verbatim copies
204+ of this license document, but changing it is not allowed.
205+
206+[This is the first released version of the Lesser GPL. It also counts
207+ as the successor of the GNU Library Public License, version 2, hence
208+ the version number 2.1.]
209+
210+ Preamble
211+
212+ The licenses for most software are designed to take away your
213+freedom to share and change it. By contrast, the GNU General Public
214+Licenses are intended to guarantee your freedom to share and change
215+free software--to make sure the software is free for all its users.
216+
217+ This license, the Lesser General Public License, applies to some
218+specially designated software packages--typically libraries--of the
219+Free Software Foundation and other authors who decide to use it. You
220+can use it too, but we suggest you first think carefully about whether
221+this license or the ordinary General Public License is the better
222+strategy to use in any particular case, based on the explanations below.
223+
224+ When we speak of free software, we are referring to freedom of use,
225+not price. Our General Public Licenses are designed to make sure that
226+you have the freedom to distribute copies of free software (and charge
227+for this service if you wish); that you receive source code or can get
228+it if you want it; that you can change the software and use pieces of
229+it in new free programs; and that you are informed that you can do
230+these things.
231+
232+ To protect your rights, we need to make restrictions that forbid
233+distributors to deny you these rights or to ask you to surrender these
234+rights. These restrictions translate to certain responsibilities for
235+you if you distribute copies of the library or if you modify it.
236+
237+ For example, if you distribute copies of the library, whether gratis
238+or for a fee, you must give the recipients all the rights that we gave
239+you. You must make sure that they, too, receive or can get the source
240+code. If you link other code with the library, you must provide
241+complete object files to the recipients, so that they can relink them
242+with the library after making changes to the library and recompiling
243+it. And you must show them these terms so they know their rights.
244+
245+ We protect your rights with a two-step method: (1) we copyright the
246+library, and (2) we offer you this license, which gives you legal
247+permission to copy, distribute and/or modify the library.
248+
249+ To protect each distributor, we want to make it very clear that
250+there is no warranty for the free library. Also, if the library is
251+modified by someone else and passed on, the recipients should know
252+that what they have is not the original version, so that the original
253+author's reputation will not be affected by problems that might be
254+introduced by others.
255+
256+ Finally, software patents pose a constant threat to the existence of
257+any free program. We wish to make sure that a company cannot
258+effectively restrict the users of a free program by obtaining a
259+restrictive license from a patent holder. Therefore, we insist that
260+any patent license obtained for a version of the library must be
261+consistent with the full freedom of use specified in this license.
262+
263+ Most GNU software, including some libraries, is covered by the
264+ordinary GNU General Public License. This license, the GNU Lesser
265+General Public License, applies to certain designated libraries, and
266+is quite different from the ordinary General Public License. We use
267+this license for certain libraries in order to permit linking those
268+libraries into non-free programs.
269+
270+ When a program is linked with a library, whether statically or using
271+a shared library, the combination of the two is legally speaking a
272+combined work, a derivative of the original library. The ordinary
273+General Public License therefore permits such linking only if the
274+entire combination fits its criteria of freedom. The Lesser General
275+Public License permits more lax criteria for linking other code with
276+the library.
277+
278+ We call this license the "Lesser" General Public License because it
279+does Less to protect the user's freedom than the ordinary General
280+Public License. It also provides other free software developers Less
281+of an advantage over competing non-free programs. These disadvantages
282+are the reason we use the ordinary General Public License for many
283+libraries. However, the Lesser license provides advantages in certain
284+special circumstances.
285+
286+ For example, on rare occasions, there may be a special need to
287+encourage the widest possible use of a certain library, so that it becomes
288+a de-facto standard. To achieve this, non-free programs must be
289+allowed to use the library. A more frequent case is that a free
290+library does the same job as widely used non-free libraries. In this
291+case, there is little to gain by limiting the free library to free
292+software only, so we use the Lesser General Public License.
293+
294+ In other cases, permission to use a particular library in non-free
295+programs enables a greater number of people to use a large body of
296+free software. For example, permission to use the GNU C Library in
297+non-free programs enables many more people to use the whole GNU
298+operating system, as well as its variant, the GNU/Linux operating
299+system.
300+
301+ Although the Lesser General Public License is Less protective of the
302+users' freedom, it does ensure that the user of a program that is
303+linked with the Library has the freedom and the wherewithal to run
304+that program using a modified version of the Library.
305+
306+ The precise terms and conditions for copying, distribution and
307+modification follow. Pay close attention to the difference between a
308+"work based on the library" and a "work that uses the library". The
309+former contains code derived from the library, whereas the latter must
310+be combined with the library in order to run.
311+
312+ GNU LESSER GENERAL PUBLIC LICENSE
313+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
314+
315+ 0. This License Agreement applies to any software library or other
316+program which contains a notice placed by the copyright holder or
317+other authorized party saying it may be distributed under the terms of
318+this Lesser General Public License (also called "this License").
319+Each licensee is addressed as "you".
320+
321+ A "library" means a collection of software functions and/or data
322+prepared so as to be conveniently linked with application programs
323+(which use some of those functions and data) to form executables.
324+
325+ The "Library", below, refers to any such software library or work
326+which has been distributed under these terms. A "work based on the
327+Library" means either the Library or any derivative work under
328+copyright law: that is to say, a work containing the Library or a
329+portion of it, either verbatim or with modifications and/or translated
330+straightforwardly into another language. (Hereinafter, translation is
331+included without limitation in the term "modification".)
332+
333+ "Source code" for a work means the preferred form of the work for
334+making modifications to it. For a library, complete source code means
335+all the source code for all modules it contains, plus any associated
336+interface definition files, plus the scripts used to control compilation
337+and installation of the library.
338+
339+ Activities other than copying, distribution and modification are not
340+covered by this License; they are outside its scope. The act of
341+running a program using the Library is not restricted, and output from
342+such a program is covered only if its contents constitute a work based
343+on the Library (independent of the use of the Library in a tool for
344+writing it). Whether that is true depends on what the Library does
345+and what the program that uses the Library does.
346+
347+ 1. You may copy and distribute verbatim copies of the Library's
348+complete source code as you receive it, in any medium, provided that
349+you conspicuously and appropriately publish on each copy an
350+appropriate copyright notice and disclaimer of warranty; keep intact
351+all the notices that refer to this License and to the absence of any
352+warranty; and distribute a copy of this License along with the
353+Library.
354+
355+ You may charge a fee for the physical act of transferring a copy,
356+and you may at your option offer warranty protection in exchange for a
357+fee.
358+
359+ 2. You may modify your copy or copies of the Library or any portion
360+of it, thus forming a work based on the Library, and copy and
361+distribute such modifications or work under the terms of Section 1
362+above, provided that you also meet all of these conditions:
363+
364+ a) The modified work must itself be a software library.
365+
366+ b) You must cause the files modified to carry prominent notices
367+ stating that you changed the files and the date of any change.
368+
369+ c) You must cause the whole of the work to be licensed at no
370+ charge to all third parties under the terms of this License.
371+
372+ d) If a facility in the modified Library refers to a function or a
373+ table of data to be supplied by an application program that uses
374+ the facility, other than as an argument passed when the facility
375+ is invoked, then you must make a good faith effort to ensure that,
376+ in the event an application does not supply such function or
377+ table, the facility still operates, and performs whatever part of
378+ its purpose remains meaningful.
379+
380+ (For example, a function in a library to compute square roots has
381+ a purpose that is entirely well-defined independent of the
382+ application. Therefore, Subsection 2d requires that any
383+ application-supplied function or table used by this function must
384+ be optional: if the application does not supply it, the square
385+ root function must still compute square roots.)
386+
387+These requirements apply to the modified work as a whole. If
388+identifiable sections of that work are not derived from the Library,
389+and can be reasonably considered independent and separate works in
390+themselves, then this License, and its terms, do not apply to those
391+sections when you distribute them as separate works. But when you
392+distribute the same sections as part of a whole which is a work based
393+on the Library, the distribution of the whole must be on the terms of
394+this License, whose permissions for other licensees extend to the
395+entire whole, and thus to each and every part regardless of who wrote
396+it.
397+
398+Thus, it is not the intent of this section to claim rights or contest
399+your rights to work written entirely by you; rather, the intent is to
400+exercise the right to control the distribution of derivative or
401+collective works based on the Library.
402+
403+In addition, mere aggregation of another work not based on the Library
404+with the Library (or with a work based on the Library) on a volume of
405+a storage or distribution medium does not bring the other work under
406+the scope of this License.
407+
408+ 3. You may opt to apply the terms of the ordinary GNU General Public
409+License instead of this License to a given copy of the Library. To do
410+this, you must alter all the notices that refer to this License, so
411+that they refer to the ordinary GNU General Public License, version 2,
412+instead of to this License. (If a newer version than version 2 of the
413+ordinary GNU General Public License has appeared, then you can specify
414+that version instead if you wish.) Do not make any other change in
415+these notices.
416+
417+ Once this change is made in a given copy, it is irreversible for
418+that copy, so the ordinary GNU General Public License applies to all
419+subsequent copies and derivative works made from that copy.
420+
421+ This option is useful when you wish to copy part of the code of
422+the Library into a program that is not a library.
423+
424+ 4. You may copy and distribute the Library (or a portion or
425+derivative of it, under Section 2) in object code or executable form
426+under the terms of Sections 1 and 2 above provided that you accompany
427+it with the complete corresponding machine-readable source code, which
428+must be distributed under the terms of Sections 1 and 2 above on a
429+medium customarily used for software interchange.
430+
431+ If distribution of object code is made by offering access to copy
432+from a designated place, then offering equivalent access to copy the
433+source code from the same place satisfies the requirement to
434+distribute the source code, even though third parties are not
435+compelled to copy the source along with the object code.
436+
437+ 5. A program that contains no derivative of any portion of the
438+Library, but is designed to work with the Library by being compiled or
439+linked with it, is called a "work that uses the Library". Such a
440+work, in isolation, is not a derivative work of the Library, and
441+therefore falls outside the scope of this License.
442+
443+ However, linking a "work that uses the Library" with the Library
444+creates an executable that is a derivative of the Library (because it
445+contains portions of the Library), rather than a "work that uses the
446+library". The executable is therefore covered by this License.
447+Section 6 states terms for distribution of such executables.
448+
449+ When a "work that uses the Library" uses material from a header file
450+that is part of the Library, the object code for the work may be a
451+derivative work of the Library even though the source code is not.
452+Whether this is true is especially significant if the work can be
453+linked without the Library, or if the work is itself a library. The
454+threshold for this to be true is not precisely defined by law.
455+
456+ If such an object file uses only numerical parameters, data
457+structure layouts and accessors, and small macros and small inline
458+functions (ten lines or less in length), then the use of the object
459+file is unrestricted, regardless of whether it is legally a derivative
460+work. (Executables containing this object code plus portions of the
461+Library will still fall under Section 6.)
462+
463+ Otherwise, if the work is a derivative of the Library, you may
464+distribute the object code for the work under the terms of Section 6.
465+Any executables containing that work also fall under Section 6,
466+whether or not they are linked directly with the Library itself.
467+
468+ 6. As an exception to the Sections above, you may also combine or
469+link a "work that uses the Library" with the Library to produce a
470+work containing portions of the Library, and distribute that work
471+under terms of your choice, provided that the terms permit
472+modification of the work for the customer's own use and reverse
473+engineering for debugging such modifications.
474+
475+ You must give prominent notice with each copy of the work that the
476+Library is used in it and that the Library and its use are covered by
477+this License. You must supply a copy of this License. If the work
478+during execution displays copyright notices, you must include the
479+copyright notice for the Library among them, as well as a reference
480+directing the user to the copy of this License. Also, you must do one
481+of these things:
482+
483+ a) Accompany the work with the complete corresponding
484+ machine-readable source code for the Library including whatever
485+ changes were used in the work (which must be distributed under
486+ Sections 1 and 2 above); and, if the work is an executable linked
487+ with the Library, with the complete machine-readable "work that
488+ uses the Library", as object code and/or source code, so that the
489+ user can modify the Library and then relink to produce a modified
490+ executable containing the modified Library. (It is understood
491+ that the user who changes the contents of definitions files in the
492+ Library will not necessarily be able to recompile the application
493+ to use the modified definitions.)
494+
495+ b) Use a suitable shared library mechanism for linking with the
496+ Library. A suitable mechanism is one that (1) uses at run time a
497+ copy of the library already present on the user's computer system,
498+ rather than copying library functions into the executable, and (2)
499+ will operate properly with a modified version of the library, if
500+ the user installs one, as long as the modified version is
501+ interface-compatible with the version that the work was made with.
502+
503+ c) Accompany the work with a written offer, valid for at
504+ least three years, to give the same user the materials
505+ specified in Subsection 6a, above, for a charge no more
506+ than the cost of performing this distribution.
507+
508+ d) If distribution of the work is made by offering access to copy
509+ from a designated place, offer equivalent access to copy the above
510+ specified materials from the same place.
511+
512+ e) Verify that the user has already received a copy of these
513+ materials or that you have already sent this user a copy.
514+
515+ For an executable, the required form of the "work that uses the
516+Library" must include any data and utility programs needed for
517+reproducing the executable from it. However, as a special exception,
518+the materials to be distributed need not include anything that is
519+normally distributed (in either source or binary form) with the major
520+components (compiler, kernel, and so on) of the operating system on
521+which the executable runs, unless that component itself accompanies
522+the executable.
523+
524+ It may happen that this requirement contradicts the license
525+restrictions of other proprietary libraries that do not normally
526+accompany the operating system. Such a contradiction means you cannot
527+use both them and the Library together in an executable that you
528+distribute.
529+
530+ 7. You may place library facilities that are a work based on the
531+Library side-by-side in a single library together with other library
532+facilities not covered by this License, and distribute such a combined
533+library, provided that the separate distribution of the work based on
534+the Library and of the other library facilities is otherwise
535+permitted, and provided that you do these two things:
536+
537+ a) Accompany the combined library with a copy of the same work
538+ based on the Library, uncombined with any other library
539+ facilities. This must be distributed under the terms of the
540+ Sections above.
541+
542+ b) Give prominent notice with the combined library of the fact
543+ that part of it is a work based on the Library, and explaining
544+ where to find the accompanying uncombined form of the same work.
545+
546+ 8. You may not copy, modify, sublicense, link with, or distribute
547+the Library except as expressly provided under this License. Any
548+attempt otherwise to copy, modify, sublicense, link with, or
549+distribute the Library is void, and will automatically terminate your
550+rights under this License. However, parties who have received copies,
551+or rights, from you under this License will not have their licenses
552+terminated so long as such parties remain in full compliance.
553+
554+ 9. You are not required to accept this License, since you have not
555+signed it. However, nothing else grants you permission to modify or
556+distribute the Library or its derivative works. These actions are
557+prohibited by law if you do not accept this License. Therefore, by
558+modifying or distributing the Library (or any work based on the
559+Library), you indicate your acceptance of this License to do so, and
560+all its terms and conditions for copying, distributing or modifying
561+the Library or works based on it.
562+
563+ 10. Each time you redistribute the Library (or any work based on the
564+Library), the recipient automatically receives a license from the
565+original licensor to copy, distribute, link with or modify the Library
566+subject to these terms and conditions. You may not impose any further
567+restrictions on the recipients' exercise of the rights granted herein.
568+You are not responsible for enforcing compliance by third parties with
569+this License.
570+
571+ 11. If, as a consequence of a court judgment or allegation of patent
572+infringement or for any other reason (not limited to patent issues),
573+conditions are imposed on you (whether by court order, agreement or
574+otherwise) that contradict the conditions of this License, they do not
575+excuse you from the conditions of this License. If you cannot
576+distribute so as to satisfy simultaneously your obligations under this
577+License and any other pertinent obligations, then as a consequence you
578+may not distribute the Library at all. For example, if a patent
579+license would not permit royalty-free redistribution of the Library by
580+all those who receive copies directly or indirectly through you, then
581+the only way you could satisfy both it and this License would be to
582+refrain entirely from distribution of the Library.
583+
584+If any portion of this section is held invalid or unenforceable under any
585+particular circumstance, the balance of the section is intended to apply,
586+and the section as a whole is intended to apply in other circumstances.
587+
588+It is not the purpose of this section to induce you to infringe any
589+patents or other property right claims or to contest validity of any
590+such claims; this section has the sole purpose of protecting the
591+integrity of the free software distribution system which is
592+implemented by public license practices. Many people have made
593+generous contributions to the wide range of software distributed
594+through that system in reliance on consistent application of that
595+system; it is up to the author/donor to decide if he or she is willing
596+to distribute software through any other system and a licensee cannot
597+impose that choice.
598+
599+This section is intended to make thoroughly clear what is believed to
600+be a consequence of the rest of this License.
601+
602+ 12. If the distribution and/or use of the Library is restricted in
603+certain countries either by patents or by copyrighted interfaces, the
604+original copyright holder who places the Library under this License may add
605+an explicit geographical distribution limitation excluding those countries,
606+so that distribution is permitted only in or among countries not thus
607+excluded. In such case, this License incorporates the limitation as if
608+written in the body of this License.
609+
610+ 13. The Free Software Foundation may publish revised and/or new
611+versions of the Lesser General Public License from time to time.
612+Such new versions will be similar in spirit to the present version,
613+but may differ in detail to address new problems or concerns.
614+
615+Each version is given a distinguishing version number. If the Library
616+specifies a version number of this License which applies to it and
617+"any later version", you have the option of following the terms and
618+conditions either of that version or of any later version published by
619+the Free Software Foundation. If the Library does not specify a
620+license version number, you may choose any version ever published by
621+the Free Software Foundation.
622+
623+ 14. If you wish to incorporate parts of the Library into other free
624+programs whose distribution conditions are incompatible with these,
625+write to the author to ask for permission. For software which is
626+copyrighted by the Free Software Foundation, write to the Free
627+Software Foundation; we sometimes make exceptions for this. Our
628+decision will be guided by the two goals of preserving the free status
629+of all derivatives of our free software and of promoting the sharing
630+and reuse of software generally.
631+
632+ NO WARRANTY
633+
634+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
635+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
636+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
637+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
638+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
639+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
640+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
641+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
642+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
643+
644+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
645+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
646+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
647+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
648+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
649+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
650+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
651+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
652+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
653+DAMAGES.
654+
655+ END OF TERMS AND CONDITIONS
656+
657+ How to Apply These Terms to Your New Libraries
658+
659+ If you develop a new library, and you want it to be of the greatest
660+possible use to the public, we recommend making it free software that
661+everyone can redistribute and change. You can do so by permitting
662+redistribution under these terms (or, alternatively, under the terms of the
663+ordinary General Public License).
664+
665+ To apply these terms, attach the following notices to the library. It is
666+safest to attach them to the start of each source file to most effectively
667+convey the exclusion of warranty; and each file should have at least the
668+"copyright" line and a pointer to where the full notice is found.
669+
670+ <one line to give the library's name and a brief idea of what it does.>
671+ Copyright (C) <year> <name of author>
672+
673+ This library is free software; you can redistribute it and/or
674+ modify it under the terms of the GNU Lesser General Public
675+ License as published by the Free Software Foundation; either
676+ version 2.1 of the License, or (at your option) any later version.
677+
678+ This library is distributed in the hope that it will be useful,
679+ but WITHOUT ANY WARRANTY; without even the implied warranty of
680+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
681+ Lesser General Public License for more details.
682+
683+ You should have received a copy of the GNU Lesser General Public
684+ License along with this library; if not, write to the Free Software
685+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
686+
687+Also add information on how to contact you by electronic and paper mail.
688+
689+You should also get your employer (if you work as a programmer) or your
690+school, if any, to sign a "copyright disclaimer" for the library, if
691+necessary. Here is a sample; alter the names:
692+
693+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
694+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
695+
696+ <signature of Ty Coon>, 1 April 1990
697+ Ty Coon, President of Vice
698+
699+That's all there is to it!
700+
701+
702diff --git a/libclamav/libmspack-0.4alpha/ChangeLog b/libclamav/libmspack-0.4alpha/ChangeLog
703new file mode 100644
704index 000000000000..2d3cf198d499
705--- /dev/null
706+++ b/libclamav/libmspack-0.4alpha/ChangeLog
707@@ -0,0 +1,491 @@
708+2013-05-27 Stuart Caie <kyzer@4u.net>
709+
710+ * test/oabx.c: added new example command for unpacking OAB files.
711+
712+2013-05-17 Stuart Caie <kyzer@4u.net>
713+
714+ * mspack.h: Support for decompressing a new file format, the Exchange
715+ Offline Address Book (OAB). Thanks to David Woodhouse for writing
716+ the implementation. I've bumped the version to 0.4alpha in celebration.
717+
718+2012-04-15 Stuart Caie <kyzer@4u.net>
719+
720+ * chmd_read_headers(): More thorough validation of CHM header values.
721+ Thanks to Sergei Trofimovich for finding sample files.
722+
723+ * read_reset_table(): Better test for overflow. Thanks again to
724+ Sergei Trofimovich for generating a good example.
725+
726+ * test/chminfo.c: this test program reads the reset table by itself
727+ and was also susceptible to the same overflow problems.
728+
729+2012-03-16 Stuart Caie <kyzer@4u.net>
730+
731+ * Makefile.am, configure.ac: make the GCC warning flags conditional
732+ on using the GCC compiler. Thanks to Dagobert Michelsen for letting
733+ me know.
734+
735+2011-11-25 Stuart Caie <kyzer@4u.net>
736+
737+ * lzxd_decompress(): Prevent matches that go beyond the start
738+ of the LZX stream. Thanks to Sergei Trofimovich for testing
739+ with valgrind and finding a corrupt sample file that exercises
740+ this scenario.
741+
742+2011-11-23 Stuart Caie <kyzer@4u.net>
743+
744+ * chmd_fast_find(): add a simple check against infinite PGML
745+ loops. Thanks to Sergei Trofimovich for finding sample files.
746+ Multi-step PGML or PGMI infinite loops remain possible.
747+
748+2011-06-17 Stuart Caie <kyzer@4u.net>
749+
750+ * read_reset_table(): wasn't reading the right offset for getting
751+ the LZX uncompressed length. Thanks to Sergei Trofimovich for
752+ finding the bug.
753+
754+2011-05-31 Stuart Caie <kyzer@4u.net>
755+
756+ * kwajd.c, mszipd.c: KWAJ type 4 files (MSZIP) are now supported.
757+ Thanks to Clive Turvey for sending me the format details.
758+
759+ * doc/szdd_kwaj_format.html: Updated documentation to cover
760+ KWAJ's MSZIP compression.
761+
762+2011-05-11 Stuart Caie <kyzer@4u.net>
763+
764+ * cabd_find(): rethought how large vs small file support is
765+ handled, as users were getting "library not compiled to support
766+ large files" message on some small files. Now checks for actual
767+ off_t overflow, rather than trying to preempt it.
768+
769+2011-05-10: Stuart Caie <kyzer@4u.net>
770+
771+ * chmd.c: implemented fast_find()
772+
773+ * test/chmx.c: removed the multiple extraction orders, now it just
774+ extracts in the fastest order
775+
776+ * test/chmd_order.c: new program added to test that different
777+ extraction orders don't affect the results of extraction
778+
779+ * test/chmd_find.c: new program to test that fast_find() works.
780+ Either supply your own filename to find, or it will try finding
781+ every file in the CHM.
782+
783+ * configure.ac: because CHM fast find requires case-insensitive
784+ comparisons, tolower() or towlower() are used where possible.
785+ These functions and their headers are checked for.
786+
787+ * mspack.h: exposed struct mschmd_sec_mscompressed's spaninfo
788+ and struct mschmd_header's first_pmgl, last_pmgl and chunk_cache
789+ to the world. Check that the CHM decoder version is v2 or higher
790+ before using them.
791+
792+ * system.c: set CHM decoder version to v2
793+
794+2011-04-27: Stuart Caie <kyzer@4u.net>
795+
796+ * many files: Made C++ compilers much happier with libmspack.
797+ Changed char * to const char * where possible.
798+
799+ * mspack.h: Changed user-supplied char * to const char *.
800+ Unless you've written your own mspack_system implementation,
801+ you will likely be unaffected.
802+ If you have written your own mspack_system implementation:
803+ 1: change open() so it takes a const char *filename
804+ 2: change message() so it takes a const char *format
805+ If you cast your function into the mspack_system struct,
806+ you can change the cast instead of the function.
807+
808+2011-04-27: Stuart Caie <kyzer@4u.net>
809+
810+ * Makefile.am: changed CFLAGS from "-Wsign-compare -Wconversion
811+ -pedantic" to "-W -Wno-unused". This enables more warnings, and
812+ disables these specific warnings which are now a hinderance.
813+
814+2011-04-27: Stuart Caie <kyzer@4u.net>
815+
816+ * test/cabrip.c, test/chminfo.c: used macros from system.h for
817+ printing offsets and reading 64-bit values, rather than
818+ reinvent the wheel.
819+
820+ * cabd_can_merge_folders(): declare variables at the start of
821+ a block so older C compilers won't choke.
822+
823+ * cabd_find(): avoid compiler complaints about non-initialised
824+ variables. We know they'll get initialised before use, but the
825+ compiler can't reverse a state machine to draw the same conclusion.
826+
827+2011-04-26: Stuart Caie <kyzer@4u.net>
828+
829+ * configure.ac, mspack/system.h: Added a configure test to get
830+ the size of off_t. If off_t is 8 bytes or more, we presume this
831+ system has large file support. This fixes LFS detection for Fedora
832+ x86_64 and Darwin/Mac OS X, neither of which declare FILESIZEBITS in
833+ <limits.h>. It's not against the POSIX standard to do this: "A
834+ definition of [FILESIZEBITS] shall be omitted from the <limits.h>
835+ header on specific implementations where the corresponding value is
836+ equal to or greater than the stated minimum, but where the value can
837+ vary depending on the file to which it is applied."
838+ (http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html)
839+ Thanks to Edward Sheldrake for the patch.
840+
841+2011-04-26: Stuart Caie <kyzer@4u.net>
842+
843+ * chmd.c: all 64-bit integer reads are now consolidated into
844+ the read_off64() function
845+
846+ * chmd_read_headers(): this function has been made resilient
847+ against accessing memory past the end of a chunk. Thanks to
848+ Sergei Trofimovich for sending me examples and analysis.
849+
850+ * chmd_init_decomp(): this function now reads the SpanInfo file
851+ if the ResetTable file isn't available, it also checks that each
852+ system file it needs is large enough before accessing it, and
853+ some of its code has been split into several new functions:
854+ find_sys_file(), read_reset_table() and read_spaninfo()
855+
856+2011-04-26: Stuart Caie <kyzer@4u.net>
857+
858+ * mspack.h, chmd.c: now reads the SpanInfo system file if the
859+ ResetTable file isn't available. This adds a new spaninfo pointer
860+ into struct mschmd_sec_mscompressed
861+
862+2011-04-26: Stuart Caie <kyzer@4u.net>
863+
864+ * test/chminfo.c: more sanity checks for corrupted CHM files where
865+ entries go past the end of a PGML/PGMI chunk, thanks to
866+ Sergei Trofimovich for sending me examples and analysis.
867+
868+2011-04-25: Stuart Caie <kyzer@4u.net>
869+
870+ * cabd_merge(): Drew D'Addesio showed me spanning cabinets which
871+ don't have all the CFFILE entries they should, but otherwise have
872+ all necessary data for extraction. Changed the merging folders
873+ test to be less strict; if folders don't exactly match, warn which
874+ files are missing, but allow merging if at least one necessary
875+ file is present.
876+
877+2010-09-24: Stuart Caie <kyzer@4u.net>
878+
879+ * readhuff.h: Don't let build_decode_table() allow empty trees.
880+ It's meant to be special case just for the LZX length tree, so
881+ move that logic out to the LZX code. Thanks to Danny Kroshin for
882+ discovering the bug.
883+
884+ * lzxd.c: Allow empty length trees, but not other trees. If
885+ the length tree is empty, fail if asked to decode a length symbol.
886+ Again, thanks to Danny Kroshin for discovering the bug.
887+
888+2010-09-20: Stuart Caie <kyzer@4u.net>
889+
890+ * Makefile.am: Set EXTRA_DIST so it doesn't include .svn
891+ directories in the distribution, but does include docs.
892+
893+2010-09-20: Stuart Caie <kyzer@4u.net>
894+
895+ * Makefile.am, configure.ac: Use modern auto* practises; turn on
896+ automake silent rules where possible, use "m4" directory for libtool
897+ macros, use LT_INIT instead of AC_PROG_LIBTOOL and use AM_CPPFLAGS
898+ instead of INCLUDES. Thanks to Sergei Trofimovich for the patch.
899+
900+2010-09-15: Stuart Caie <kyzer@4u.net>
901+
902+ * many files: Made the code compile with C++
903+ - Renamed all 'this' variables/parameters to 'self'
904+ - Added casts to all memory allocations.
905+ - Added extern "C" to header files with extern declarations.
906+ - Made system.c include system.h.
907+ - Changed the K&R-style headers to ANSI-style headers in md5.c
908+
909+2010-08-04: Stuart Caie <kyzer@4u.net>
910+
911+ * many files: removed unnecessary <unistd.h> include
912+
913+2010-07-19: Stuart Caie <kyzer@4u.net>
914+
915+ * cabd_md5.c, chmd_md5.c: Replace writing files to disk then
916+ MD5summing them, with an MD5summer built into mspack_system.
917+ Much, much faster results.
918+
919+ * qtmd_decompress(): Robert Riebisch pointed out a Quantum
920+ data integrity check that could never be tripped, because
921+ frame_todo is unsigned, so it will never be decremented
922+ below zero. Replaced the check with one that assumes that
923+ decrementing past zero wraps frame_todo round to a number
924+ more than its maximum value (QTM_FRAME_SIZE).
925+
926+2010-07-18: Stuart Caie <kyzer@4u.net>
927+
928+ * cabd.c: Special logic to pass cabd_sys_read() errors back
929+ to cabd_extract() wasn't compatible with the decompressor
930+ logic of returning the same error repeatedly once unpacking
931+ fails. This meant that if decompressing failed because of
932+ a read error, then the next file in the same folder would
933+ come back as "no error", but the decompressed wouldn't have
934+ even attempted to decompress the file. Added a new state
935+ variable, read_error, with the same lifespan as a decompressor,
936+ to pass the underlying reason for MSPACK_ERR_READ errors back.
937+
938+ * mszipd.c: improve MS-ZIP recovery by saving all the bytes
939+ decoded prior to a block failing. This requires remembering
940+ how far we got through the block, so the code has been made
941+ slightly slower (about 0.003 seconds slower per gigabyte
942+ unpacked) by removing the local variable window_posn
943+ and keeping it in the state structure instead.
944+
945+2010-07-16: Stuart Caie <kyzer@4u.net>
946+
947+ * Makefile.am: strange interactions. When -std=c99 is used,
948+ my Ubuntu's <stdio.h> (libc6-dev 2.11.1-0ubuntu7.2) does NOT
949+ define fseeko() unless _LARGEFILE_SOURCE is also defined. But
950+ configure always uses -std=gnu99, not -std=c99, so its test
951+ determines _LARGEFILE_SOURCE isn't needed but HAVE_FSEEKO is
952+ true. The implicit fseeko definition has a 32-bit rather than
953+ 64-bit offset, which means the mode parameter is interpreted
954+ as part of the offset, and the mode is taken from the stack,
955+ which is generally 0 (SEEK_SET). This breaks all SEEK_CURs.
956+ The code works fine when -std=c99 is not set, so just remove
957+ it for the time being.
958+
959+2010-07-12: Stuart Caie <kyzer@4u.net>
960+
961+ * system.c: Reject reading/writing a negative number of bytes.
962+
963+ * chmd.c: allow zero-length files to be seen. Previously they were
964+ skipped because they were mistaken for directory entries.
965+
966+2010-07-08: Stuart Caie <kyzer@4u.net>
967+
968+ * qtmd.c: Larry Frieson found an important bug in the Quantum
969+ decoder. Window wraps flush all unwritten data to disk.
970+ However, sometimes less data is needed, which makes
971+ out_bytes negative, which is then passed to write(). Some
972+ write() implementations treat negative sizes it as a large
973+ positive integer and segfault trying to write the buffer.
974+
975+ * Makefile.am, test/*.c: fixed automake file so that the
976+ package passes a "make distcheck".
977+
978+2010-07-07: Stuart Caie <kyzer@4u.net>
979+
980+ * doc/szdd_kwaj_format.html: explain SZDD/KWAJ file format.
981+
982+ * lzssd.c: fixed SZDD decompression bugs.
983+
984+ * test/chmd_compare: Add scripts for comparing chmd_md5 against
985+ Microsoft's own code.
986+
987+ * test/chmd_md5.c: remove the need to decompress everything
988+ twice, as this is already in chmx.c if needed.
989+
990+2010-07-06: Stuart Caie <kyzer@4u.net>
991+
992+ * many files: added SZDD and KWAJ decompression support.
993+
994+2010-06-18: Stuart Caie <kyzer@4u.net>
995+
996+ * system.h: expanded the test for 64-bit largefile support so
997+ it also works on 64-bit native operating systems where you
998+ don't have to define _FILE_OFFSET_BITS.
999+
1000+2010-06-17: Stuart Caie <kyzer@4u.net>
1001+
1002+ * libmspack.pc.in: Added pkg-config support. Thanks to
1003+ Patrice Dumas for the patch.
1004+
1005+2010-06-14: Stuart Caie <kyzer@4u.net>
1006+
1007+ * qtmd.c, lzxd.c, mszipd.c: created new headers, readbits.h and
1008+ readhuff.h, which bundle up the bit-reading and huffman-reading
1009+ code found in the MSZIP, LZX and Quantum decoders.
1010+
1011+2010-06-11: Stuart Caie <kyzer@4u.net>
1012+
1013+ * qtmd_static_init(): Removed function in favour of static const
1014+ tables, same rationale as for lzxd_static_init().
1015+
1016+ * qtmd_read_input(), zipd_read_input(): After testing against my
1017+ set of CABs from the wild, I've found both these functions _need_
1018+ an extra EOF flag, like lzxd_read_input() has. So I've added
1019+ it. This means CABs get decoded properly AND there's no reading
1020+ fictional bytes.
1021+
1022+2010-06-03: Stuart Caie <kyzer@4u.net>
1023+
1024+ * test/cabd_md5.c: updated this so it has better output and
1025+ doesn't need to be in the same directory as the files for multi-
1026+ part sets.
1027+
1028+2010-05-20: Stuart Caie <kyzer@4u.net>
1029+
1030+ * qtmd_read_input(), zipd_read_input(): Both these functions are
1031+ essentially copies of lzxd_read_input(), but that has a feature
1032+ they don't have - an extra EOF flag. So if EOF is
1033+ encountered (sys->read() returns 0 bytes), these don't pass on the
1034+ error. Their respective bit-reading functions that called them
1035+ then go on to access at least one byte of the input buffer, which
1036+ doesn't exist as sys->read() returned 0. Thanks to Michael
1037+ Vidrevich for spotting this and providing a test case.
1038+
1039+2010-05-20: Stuart Caie <kyzer@4u.net>
1040+
1041+ * system.h: It turns out no configure.ac tests are needed to
1042+ decide between __func__ and __FUNCTION__, so I put the standard
1043+ one (__func__) back into the D() macro, along with some
1044+ special-case ifdefs for old versions of GCC.
1045+
1046+ * lzxd_static_init(): Removed function in favour of static const
1047+ tables. Jorge Lodos thinks it causes multithreading problems, I
1048+ disagree. However, there are speed benefits to declaring the
1049+ tables as static const.
1050+
1051+ * cabd_init_decomp(): Fixed code which never runs but would write
1052+ to a null pointer if it could. Changed it to an assert() as it
1053+ will only trip if someone rewrites the internals of cabd.c. Thanks
1054+ to Jorge Lodos for finding it.
1055+
1056+ * inflate(): Fixed an off-by-one error: if the LITERAL table
1057+ emitted code 286, this would read one byte past the end of
1058+ lit_extrabits[]. Thanks to Jorge Lodos for finding it.
1059+
1060+2010-05-06: Stuart Caie <kyzer@4u.net>
1061+
1062+ * test/cabrip.c, test/chminfo.c: add fseeko() support
1063+
1064+2009-06-01: Stuart Caie <kyzer@4u.net>
1065+
1066+ * README: clarify the extended license terms
1067+
1068+ * doc, Makefile.am: make the doxygen makefile work when using
1069+ an alternate build directory
1070+
1071+2006-09-20: Stuart Caie <kyzer@4u.net>
1072+
1073+ * system.h: I had a choice of adding more to configure.ac to
1074+ test for __func__ and __FUNCTION__, or just removing __FUNCTION__
1075+ from the D() macro. I chose the latter.
1076+
1077+ * Makefile.am: Now the --enable-debug in configure will actually
1078+ apply -DDEBUG to the sources.
1079+
1080+2006-09-20: Stuart Caie <kyzer@4u.net>
1081+
1082+ * qtmd_decompress(): Fixed a major bug in the QTM decoder, as
1083+ reported by Tomasz Kojm last year. Removed the restriction on
1084+ window sizes as a result. Correctly decodes the XLVIEW cabinets.
1085+
1086+2006-08-31: Stuart Caie <kyzer@4u.net>
1087+
1088+ * lzxd_decompress(): Two major bugs fixed. Firstly, the R0/R1/R2
1089+ local variables weren't set to 1 after lzxd_reset_state().
1090+ Secondly, the LZX decompression stream can sometimes become
1091+ odd-aligned (after an uncompressed block) and the next 16 bit
1092+ fetch needs to be split across two input buffers, ENSURE_BITS()
1093+ didn't cover this case. Many thanks to Igor Glucksmann for
1094+ discovering both these bugs.
1095+
1096+2005-06-30: Stuart Caie <kyzer@4u.net>
1097+
1098+ * cabd_search(): fixed problems with searching files > 4GB for
1099+ cabinets.
1100+
1101+2005-06-23: Stuart Caie <kyzer@4u.net>
1102+
1103+ * qtmd_init(): The QTM decoder is broken for QTM streams with a
1104+ window size less than the frame size. Until this is fixed, fail
1105+ to initialise QTM window sizes less than 15. Thanks to Tomasz Kojm
1106+ for finding the bug.
1107+
1108+2005-03-22: Stuart Caie <kyzer@4u.net>
1109+
1110+ * system.h: now undefs "read", as the latest glibc defines read()
1111+ as a macro which messes everything up. Thanks to Ville Skyttä for
1112+ the update.
1113+
1114+2005-03-14: Stuart Caie <kyzer@4u.net>
1115+
1116+ * test/multifh.c: write an mspack_system implementation that can
1117+ handle normal disk files, open file handles, open file descriptors
1118+ and raw memory all at the same time.
1119+
1120+2005-02-24: Stuart Caie <kyzer@4u.net>
1121+
1122+ * chmd_read_headers(): avoid infinite loop when chmhs1_ChunkSize is
1123+ zero. Thanks to Serge Semashko for the research and discovery.
1124+
1125+2005-02-18: Stuart Caie <kyzer@4u.net>
1126+
1127+ * mspack.h: renamed the "interface" parameter of mspack_version() to
1128+ "entity", as interface is a reserved word in C++. Thanks to Yuriy Z
1129+ for the discovery.
1130+
1131+2004-12-09: Stuart Caie <kyzer@4u.net>
1132+
1133+ * lzss.h, szdd.h, szddd.h: more work on the SZDD/LZSS design.
1134+
1135+2004-06-12: Stuart Caie <kyzer@4u.net>
1136+
1137+ * lzxd_static_init(): removed write to lzxd_extra_bits[52], thanks
1138+ to Nigel Horne from the ClamAV project.
1139+
1140+2004-04-23: Stuart Caie <kyzer@4u.net>
1141+
1142+ * mspack.h: changed 'this' parameters to 'self' to allow compiling in
1143+ C++ compilers, thanks to Michal Cihar for the suggestion.
1144+
1145+ * mspack.h, system.h, mspack.def, winbuild.sh: integrated some changes
1146+ from Petr Blahos to let libmspack build as a Win32 DLL.
1147+
1148+ * chmd_fast_find(): added the first part of this code, and comments
1149+ sufficient to finish it :)
1150+
1151+2004-04-08 Stuart Caie <kyzer@4u.net>
1152+
1153+ * test/chminfo.c: added a program for dumping useful data from CHM
1154+ files, e.g. index entries and reset tables. I wrote this a while ago
1155+ for investigating a corrupt cabinet, but I never committed it.
1156+
1157+2004-03-26 Stuart Caie <kyzer@4u.net>
1158+
1159+ * test/cabd_memory.c: added a new test example which shows an
1160+ mspack_system implementation that reads and writes from memory only,
1161+ no file I/O. Even the source code has a little cab file embedded in it.
1162+
1163+2004-03-10 Stuart Caie <kyzer@4u.net>
1164+
1165+ * cabd.c: updated the location of the CAB SDK.
1166+
1167+ * cabd.c: changed a couple of MSPACK_ERR_READ errors not based on
1168+ read() failures into MSPACK_ERR_DATAFORMAT errors.
1169+
1170+ * mszipd_decompress(): repair mode now aborts after writing a
1171+ repaired block if the error was a hard error (e.g. read error, out
1172+ of blocks, etc)
1173+
1174+2004-03-08 Stuart Caie <kyzer@4u.net>
1175+
1176+ * Makefile.am: now builds and installs a versioned library.
1177+
1178+ * mszipd.c: completed a new MS-ZIP and inflate implementation.
1179+
1180+ * system.c: added mspack_version() and committed to a versioned
1181+ ABI for the library.
1182+
1183+ * cabd.c: made mszip repair functionality work correctly.
1184+
1185+ * cabd.c: now identifies invalid block headers
1186+
1187+ * doc/: API documentation is now included with the library, not
1188+ just on the web.
1189+
1190+ * chmd.c: fixed error messages and 64-bit debug output.
1191+
1192+ * chmd.c: now also catches NULL files in section 1.
1193+
1194+ * test/chmx.c: now acts more like cabextract.
1195+
1196+2003-08-29 Stuart Caie <kyzer@4u.net>
1197+
1198+ * ChangeLog: started keeping a ChangeLog :)
1199diff --git a/libclamav/libmspack-0.4alpha/INSTALL b/libclamav/libmspack-0.4alpha/INSTALL
1200new file mode 100644
1201index 000000000000..a1e89e18ad20
1202--- /dev/null
1203+++ b/libclamav/libmspack-0.4alpha/INSTALL
1204@@ -0,0 +1,370 @@
1205+Installation Instructions
1206+*************************
1207+
1208+Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
1209+Inc.
1210+
1211+ Copying and distribution of this file, with or without modification,
1212+are permitted in any medium without royalty provided the copyright
1213+notice and this notice are preserved. This file is offered as-is,
1214+without warranty of any kind.
1215+
1216+Basic Installation
1217+==================
1218+
1219+ Briefly, the shell commands `./configure; make; make install' should
1220+configure, build, and install this package. The following
1221+more-detailed instructions are generic; see the `README' file for
1222+instructions specific to this package. Some packages provide this
1223+`INSTALL' file but do not implement all of the features documented
1224+below. The lack of an optional feature in a given package is not
1225+necessarily a bug. More recommendations for GNU packages can be found
1226+in *note Makefile Conventions: (standards)Makefile Conventions.
1227+
1228+ The `configure' shell script attempts to guess correct values for
1229+various system-dependent variables used during compilation. It uses
1230+those values to create a `Makefile' in each directory of the package.
1231+It may also create one or more `.h' files containing system-dependent
1232+definitions. Finally, it creates a shell script `config.status' that
1233+you can run in the future to recreate the current configuration, and a
1234+file `config.log' containing compiler output (useful mainly for
1235+debugging `configure').
1236+
1237+ It can also use an optional file (typically called `config.cache'
1238+and enabled with `--cache-file=config.cache' or simply `-C') that saves
1239+the results of its tests to speed up reconfiguring. Caching is
1240+disabled by default to prevent problems with accidental use of stale
1241+cache files.
1242+
1243+ If you need to do unusual things to compile the package, please try
1244+to figure out how `configure' could check whether to do them, and mail
1245+diffs or instructions to the address given in the `README' so they can
1246+be considered for the next release. If you are using the cache, and at
1247+some point `config.cache' contains results you don't want to keep, you
1248+may remove or edit it.
1249+
1250+ The file `configure.ac' (or `configure.in') is used to create
1251+`configure' by a program called `autoconf'. You need `configure.ac' if
1252+you want to change it or regenerate `configure' using a newer version
1253+of `autoconf'.
1254+
1255+ The simplest way to compile this package is:
1256+
1257+ 1. `cd' to the directory containing the package's source code and type
1258+ `./configure' to configure the package for your system.
1259+
1260+ Running `configure' might take a while. While running, it prints
1261+ some messages telling which features it is checking for.
1262+
1263+ 2. Type `make' to compile the package.
1264+
1265+ 3. Optionally, type `make check' to run any self-tests that come with
1266+ the package, generally using the just-built uninstalled binaries.
1267+
1268+ 4. Type `make install' to install the programs and any data files and
1269+ documentation. When installing into a prefix owned by root, it is
1270+ recommended that the package be configured and built as a regular
1271+ user, and only the `make install' phase executed with root
1272+ privileges.
1273+
1274+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
1275+ this time using the binaries in their final installed location.
1276+ This target does not install anything. Running this target as a
1277+ regular user, particularly if the prior `make install' required
1278+ root privileges, verifies that the installation completed
1279+ correctly.
1280+
1281+ 6. You can remove the program binaries and object files from the
1282+ source code directory by typing `make clean'. To also remove the
1283+ files that `configure' created (so you can compile the package for
1284+ a different kind of computer), type `make distclean'. There is
1285+ also a `make maintainer-clean' target, but that is intended mainly
1286+ for the package's developers. If you use it, you may have to get
1287+ all sorts of other programs in order to regenerate files that came
1288+ with the distribution.
1289+
1290+ 7. Often, you can also type `make uninstall' to remove the installed
1291+ files again. In practice, not all packages have tested that
1292+ uninstallation works correctly, even though it is required by the
1293+ GNU Coding Standards.
1294+
1295+ 8. Some packages, particularly those that use Automake, provide `make
1296+ distcheck', which can by used by developers to test that all other
1297+ targets like `make install' and `make uninstall' work correctly.
1298+ This target is generally not run by end users.
1299+
1300+Compilers and Options
1301+=====================
1302+
1303+ Some systems require unusual options for compilation or linking that
1304+the `configure' script does not know about. Run `./configure --help'
1305+for details on some of the pertinent environment variables.
1306+
1307+ You can give `configure' initial values for configuration parameters
1308+by setting variables in the command line or in the environment. Here
1309+is an example:
1310+
1311+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
1312+
1313+ *Note Defining Variables::, for more details.
1314+
1315+Compiling For Multiple Architectures
1316+====================================
1317+
1318+ You can compile the package for more than one kind of computer at the
1319+same time, by placing the object files for each architecture in their
1320+own directory. To do this, you can use GNU `make'. `cd' to the
1321+directory where you want the object files and executables to go and run
1322+the `configure' script. `configure' automatically checks for the
1323+source code in the directory that `configure' is in and in `..'. This
1324+is known as a "VPATH" build.
1325+
1326+ With a non-GNU `make', it is safer to compile the package for one
1327+architecture at a time in the source code directory. After you have
1328+installed the package for one architecture, use `make distclean' before
1329+reconfiguring for another architecture.
1330+
1331+ On MacOS X 10.5 and later systems, you can create libraries and
1332+executables that work on multiple system types--known as "fat" or
1333+"universal" binaries--by specifying multiple `-arch' options to the
1334+compiler but only a single `-arch' option to the preprocessor. Like
1335+this:
1336+
1337+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
1338+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
1339+ CPP="gcc -E" CXXCPP="g++ -E"
1340+
1341+ This is not guaranteed to produce working output in all cases, you
1342+may have to build one architecture at a time and combine the results
1343+using the `lipo' tool if you have problems.
1344+
1345+Installation Names
1346+==================
1347+
1348+ By default, `make install' installs the package's commands under
1349+`/usr/local/bin', include files under `/usr/local/include', etc. You
1350+can specify an installation prefix other than `/usr/local' by giving
1351+`configure' the option `--prefix=PREFIX', where PREFIX must be an
1352+absolute file name.
1353+
1354+ You can specify separate installation prefixes for
1355+architecture-specific files and architecture-independent files. If you
1356+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
1357+PREFIX as the prefix for installing programs and libraries.
1358+Documentation and other data files still use the regular prefix.
1359+
1360+ In addition, if you use an unusual directory layout you can give
1361+options like `--bindir=DIR' to specify different values for particular
1362+kinds of files. Run `configure --help' for a list of the directories
1363+you can set and what kinds of files go in them. In general, the
1364+default for these options is expressed in terms of `${prefix}', so that
1365+specifying just `--prefix' will affect all of the other directory
1366+specifications that were not explicitly provided.
1367+
1368+ The most portable way to affect installation locations is to pass the
1369+correct locations to `configure'; however, many packages provide one or
1370+both of the following shortcuts of passing variable assignments to the
1371+`make install' command line to change installation locations without
1372+having to reconfigure or recompile.
1373+
1374+ The first method involves providing an override variable for each
1375+affected directory. For example, `make install
1376+prefix=/alternate/directory' will choose an alternate location for all
1377+directory configuration variables that were expressed in terms of
1378+`${prefix}'. Any directories that were specified during `configure',
1379+but not in terms of `${prefix}', must each be overridden at install
1380+time for the entire installation to be relocated. The approach of
1381+makefile variable overrides for each directory variable is required by
1382+the GNU Coding Standards, and ideally causes no recompilation.
1383+However, some platforms have known limitations with the semantics of
1384+shared libraries that end up requiring recompilation when using this
1385+method, particularly noticeable in packages that use GNU Libtool.
1386+
1387+ The second method involves providing the `DESTDIR' variable. For
1388+example, `make install DESTDIR=/alternate/directory' will prepend
1389+`/alternate/directory' before all installation names. The approach of
1390+`DESTDIR' overrides is not required by the GNU Coding Standards, and
1391+does not work on platforms that have drive letters. On the other hand,
1392+it does better at avoiding recompilation issues, and works well even
1393+when some directory options were not specified in terms of `${prefix}'
1394+at `configure' time.
1395+
1396+Optional Features
1397+=================
1398+
1399+ If the package supports it, you can cause programs to be installed
1400+with an extra prefix or suffix on their names by giving `configure' the
1401+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
1402+
1403+ Some packages pay attention to `--enable-FEATURE' options to
1404+`configure', where FEATURE indicates an optional part of the package.
1405+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
1406+is something like `gnu-as' or `x' (for the X Window System). The
1407+`README' should mention any `--enable-' and `--with-' options that the
1408+package recognizes.
1409+
1410+ For packages that use the X Window System, `configure' can usually
1411+find the X include and library files automatically, but if it doesn't,
1412+you can use the `configure' options `--x-includes=DIR' and
1413+`--x-libraries=DIR' to specify their locations.
1414+
1415+ Some packages offer the ability to configure how verbose the
1416+execution of `make' will be. For these packages, running `./configure
1417+--enable-silent-rules' sets the default to minimal output, which can be
1418+overridden with `make V=1'; while running `./configure
1419+--disable-silent-rules' sets the default to verbose, which can be
1420+overridden with `make V=0'.
1421+
1422+Particular systems
1423+==================
1424+
1425+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
1426+CC is not installed, it is recommended to use the following options in
1427+order to use an ANSI C compiler:
1428+
1429+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
1430+
1431+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
1432+
1433+ HP-UX `make' updates targets which have the same time stamps as
1434+their prerequisites, which makes it generally unusable when shipped
1435+generated files such as `configure' are involved. Use GNU `make'
1436+instead.
1437+
1438+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
1439+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
1440+a workaround. If GNU CC is not installed, it is therefore recommended
1441+to try
1442+
1443+ ./configure CC="cc"
1444+
1445+and if that doesn't work, try
1446+
1447+ ./configure CC="cc -nodtk"
1448+
1449+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
1450+directory contains several dysfunctional programs; working variants of
1451+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
1452+in your `PATH', put it _after_ `/usr/bin'.
1453+
1454+ On Haiku, software installed for all users goes in `/boot/common',
1455+not `/usr/local'. It is recommended to use the following options:
1456+
1457+ ./configure --prefix=/boot/common
1458+
1459+Specifying the System Type
1460+==========================
1461+
1462+ There may be some features `configure' cannot figure out
1463+automatically, but needs to determine by the type of machine the package
1464+will run on. Usually, assuming the package is built to be run on the
1465+_same_ architectures, `configure' can figure that out, but if it prints
1466+a message saying it cannot guess the machine type, give it the
1467+`--build=TYPE' option. TYPE can either be a short name for the system
1468+type, such as `sun4', or a canonical name which has the form:
1469+
1470+ CPU-COMPANY-SYSTEM
1471+
1472+where SYSTEM can have one of these forms:
1473+
1474+ OS
1475+ KERNEL-OS
1476+
1477+ See the file `config.sub' for the possible values of each field. If
1478+`config.sub' isn't included in this package, then this package doesn't
1479+need to know the machine type.
1480+
1481+ If you are _building_ compiler tools for cross-compiling, you should
1482+use the option `--target=TYPE' to select the type of system they will
1483+produce code for.
1484+
1485+ If you want to _use_ a cross compiler, that generates code for a
1486+platform different from the build platform, you should specify the
1487+"host" platform (i.e., that on which the generated programs will
1488+eventually be run) with `--host=TYPE'.
1489+
1490+Sharing Defaults
1491+================
1492+
1493+ If you want to set default values for `configure' scripts to share,
1494+you can create a site shell script called `config.site' that gives
1495+default values for variables like `CC', `cache_file', and `prefix'.
1496+`configure' looks for `PREFIX/share/config.site' if it exists, then
1497+`PREFIX/etc/config.site' if it exists. Or, you can set the
1498+`CONFIG_SITE' environment variable to the location of the site script.
1499+A warning: not all `configure' scripts look for a site script.
1500+
1501+Defining Variables
1502+==================
1503+
1504+ Variables not defined in a site shell script can be set in the
1505+environment passed to `configure'. However, some packages may run
1506+configure again during the build, and the customized values of these
1507+variables may be lost. In order to avoid this problem, you should set
1508+them in the `configure' command line, using `VAR=value'. For example:
1509+
1510+ ./configure CC=/usr/local2/bin/gcc
1511+
1512+causes the specified `gcc' to be used as the C compiler (unless it is
1513+overridden in the site shell script).
1514+
1515+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
1516+an Autoconf bug. Until the bug is fixed you can use this workaround:
1517+
1518+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
1519+
1520+`configure' Invocation
1521+======================
1522+
1523+ `configure' recognizes the following options to control how it
1524+operates.
1525+
1526+`--help'
1527+`-h'
1528+ Print a summary of all of the options to `configure', and exit.
1529+
1530+`--help=short'
1531+`--help=recursive'
1532+ Print a summary of the options unique to this package's
1533+ `configure', and exit. The `short' variant lists options used
1534+ only in the top level, while the `recursive' variant lists options
1535+ also present in any nested packages.
1536+
1537+`--version'
1538+`-V'
1539+ Print the version of Autoconf used to generate the `configure'
1540+ script, and exit.
1541+
1542+`--cache-file=FILE'
1543+ Enable the cache: use and save the results of the tests in FILE,
1544+ traditionally `config.cache'. FILE defaults to `/dev/null' to
1545+ disable caching.
1546+
1547+`--config-cache'
1548+`-C'
1549+ Alias for `--cache-file=config.cache'.
1550+
1551+`--quiet'
1552+`--silent'
1553+`-q'
1554+ Do not print messages saying which checks are being made. To
1555+ suppress all normal output, redirect it to `/dev/null' (any error
1556+ messages will still be shown).
1557+
1558+`--srcdir=DIR'
1559+ Look for the package's source code in directory DIR. Usually
1560+ `configure' can determine that directory automatically.
1561+
1562+`--prefix=DIR'
1563+ Use DIR as the installation prefix. *note Installation Names::
1564+ for more details, including other options available for fine-tuning
1565+ the installation locations.
1566+
1567+`--no-create'
1568+`-n'
1569+ Run the configure checks, but stop before creating any output
1570+ files.
1571+
1572+`configure' also accepts some other, not widely useful, options. Run
1573+`configure --help' for more details.
1574+
1575diff --git a/libclamav/libmspack-0.4alpha/Makefile.am b/libclamav/libmspack-0.4alpha/Makefile.am
1576new file mode 100644
1577index 000000000000..4f249275001a
1578--- /dev/null
1579+++ b/libclamav/libmspack-0.4alpha/Makefile.am
1580@@ -0,0 +1,100 @@
1581+EXTRA_DIST = $(srcdir)/debian/* $(srcdir)/doc/* $(srcdir)/test/test_files/*/*
1582+pkgconfigdir = $(libdir)/pkgconfig
1583+pkgconfig_DATA = libmspack.pc
1584+
1585+dist-hook:
1586+ -rm -f $(distdir)/*.la
1587+
1588+ACLOCAL_AMFLAGS = -I m4
1589+AM_CFLAGS =
1590+# add "-DMSPACK_NO_DEFAULT_SYSTEM" to remove default mspack_system
1591+if DEBUG
1592+AM_CFLAGS += -DDEBUG
1593+endif
1594+if GCC
1595+AM_CFLAGS += -Wall -W -Wno-unused
1596+endif
1597+AM_CPPFLAGS = -I$(top_srcdir)/mspack -I$(top_srcdir)/test
1598+
1599+lib_LTLIBRARIES = libmspack.la
1600+include_HEADERS = mspack/mspack.h
1601+
1602+noinst_LTLIBRARIES = libmscabd.la libmschmd.la
1603+noinst_PROGRAMS = test/cabd_md5 test/cabd_memory test/cabd_test \
1604+ test/cabrip test/chmd_md5 test/chmx test/chminfo \
1605+ test/multifh test/expand test/chmd_find \
1606+ test/chmd_order test/oabx
1607+
1608+libmspack_la_SOURCES = mspack/mspack.h \
1609+ mspack/system.h mspack/system.c \
1610+ mspack/cab.h mspack/cabc.c mspack/cabd.c \
1611+ mspack/chm.h mspack/chmc.c mspack/chmd.c \
1612+ mspack/hlp.h mspack/hlpc.c mspack/hlpd.c \
1613+ mspack/lit.h mspack/litc.c mspack/litd.c \
1614+ mspack/kwaj.h mspack/kwajc.c mspack/kwajd.c \
1615+ mspack/szdd.h mspack/szddc.c mspack/szddd.c \
1616+ mspack/oab.h mspack/oabc.c mspack/oabd.c \
1617+ mspack/lzx.h mspack/lzxc.c mspack/lzxd.c \
1618+ mspack/mszip.h mspack/mszipc.c mspack/mszipd.c \
1619+ mspack/qtm.h mspack/qtmd.c \
1620+ mspack/readbits.h mspack/readhuff.h \
1621+ mspack/lzss.h mspack/lzssd.c \
1622+ mspack/des.h mspack/sha.h \
1623+ mspack/crc32.c mspack/crc32.h
1624+libmspack_la_LDFLAGS = -export-symbols-regex '^mspack_' -version-info 1:0:1
1625+
1626+libmscabd_la_SOURCES = mspack/mspack.h \
1627+ mspack/system.h mspack/system.c \
1628+ mspack/cab.h mspack/cabd.c \
1629+ mspack/lzx.h mspack/lzxd.c \
1630+ mspack/mszip.h mspack/mszipd.c \
1631+ mspack/qtm.h mspack/qtmd.c \
1632+ mspack/readbits.h mspack/readhuff.h
1633+libmscabd_la_LDFLAGS = -export-symbols-regex '^mspack_'
1634+
1635+libmschmd_la_SOURCES = mspack/mspack.h \
1636+ mspack/system.h mspack/system.c \
1637+ mspack/chm.h mspack/chmd.c \
1638+ mspack/lzx.h mspack/lzxd.c \
1639+ mspack/readbits.h mspack/readhuff.h
1640+libmschmd_la_LDFLAGS = -export-symbols-regex '^mspack_'
1641+
1642+test_chmx_SOURCES = test/chmx.c test/error.h libmschmd.la
1643+test_chmx_LDADD = libmschmd.la
1644+
1645+test_chmd_md5_SOURCES = test/chmd_md5.c test/md5.c test/md5.h test/md5_fh.h \
1646+ test/error.h libmschmd.la
1647+test_chmd_md5_LDADD = libmschmd.la
1648+
1649+test_cabd_md5_SOURCES = test/cabd_md5.c test/md5.c test/md5.h test/md5_fh.h \
1650+ test/error.h libmscabd.la
1651+test_cabd_md5_LDADD = libmscabd.la
1652+
1653+test_cabd_test_SOURCES= test/cabd_test.c libmscabd.la
1654+test_cabd_test_LDADD = libmscabd.la
1655+
1656+test_cabrip_SOURCES = test/cabrip.c libmscabd.la
1657+test_cabrip_LDADD = libmscabd.la
1658+
1659+test_cabd_memory_SOURCES = test/cabd_memory.c libmscabd.la
1660+test_cabd_memory_LDADD = libmscabd.la
1661+
1662+test_chminfo_SOURCES = test/chminfo.c libmschmd.la
1663+test_chminfo_LDADD = libmschmd.la
1664+
1665+test_multifh_SOURCES = test/multifh.c libmscabd.la
1666+test_multifh_LDADD = libmscabd.la
1667+
1668+test_expand_SOURCES = test/expand.c test/error.h libmspack.la
1669+test_expand_LDADD = libmspack.la
1670+
1671+test_chmd_find_SOURCES = test/chmd_find.c test/error.h libmschmd.la
1672+test_chmd_find_LDADD = libmschmd.la
1673+
1674+test_chmd_order_SOURCES = test/chmd_order.c test/md5.c test/md5.h test/md5_fh.h \
1675+ test/error.h libmschmd.la
1676+test_chmd_order_LDADD = libmschmd.la
1677+
1678+test_oabx_SOURCES = test/oabx.c test/md5.c test/md5.h test/md5_fh.h \
1679+ test/error.h libmspack.la
1680+test_oabx_LDADD = libmspack.la
1681diff --git a/libclamav/libmspack-0.4alpha/Makefile.in b/libclamav/libmspack-0.4alpha/Makefile.in
1682new file mode 100644
1683index 000000000000..2c1e02e9aa9c
1684--- /dev/null
1685+++ b/libclamav/libmspack-0.4alpha/Makefile.in
1686@@ -0,0 +1,1371 @@
1687+# Makefile.in generated by automake 1.11.3 from Makefile.am.
1688+# @configure_input@
1689+
1690+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
1691+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1692+# Foundation, Inc.
1693+# This Makefile.in is free software; the Free Software Foundation
1694+# gives unlimited permission to copy and/or distribute it,
1695+# with or without modifications, as long as this notice is preserved.
1696+
1697+# This program is distributed in the hope that it will be useful,
1698+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1699+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1700+# PARTICULAR PURPOSE.
1701+
1702+@SET_MAKE@
1703+
1704+
1705+
1706+
1707+VPATH = @srcdir@
1708+pkgdatadir = $(datadir)/@PACKAGE@
1709+pkgincludedir = $(includedir)/@PACKAGE@
1710+pkglibdir = $(libdir)/@PACKAGE@
1711+pkglibexecdir = $(libexecdir)/@PACKAGE@
1712+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
1713+install_sh_DATA = $(install_sh) -c -m 644
1714+install_sh_PROGRAM = $(install_sh) -c
1715+install_sh_SCRIPT = $(install_sh) -c
1716+INSTALL_HEADER = $(INSTALL_DATA)
1717+transform = $(program_transform_name)
1718+NORMAL_INSTALL = :
1719+PRE_INSTALL = :
1720+POST_INSTALL = :
1721+NORMAL_UNINSTALL = :
1722+PRE_UNINSTALL = :
1723+POST_UNINSTALL = :
1724+build_triplet = @build@
1725+host_triplet = @host@
1726+# add "-DMSPACK_NO_DEFAULT_SYSTEM" to remove default mspack_system
1727+@DEBUG_TRUE@am__append_1 = -DDEBUG
1728+@GCC_TRUE@am__append_2 = -Wall -W -Wno-unused
1729+noinst_PROGRAMS = test/cabd_md5$(EXEEXT) test/cabd_memory$(EXEEXT) \
1730+ test/cabd_test$(EXEEXT) test/cabrip$(EXEEXT) \
1731+ test/chmd_md5$(EXEEXT) test/chmx$(EXEEXT) \
1732+ test/chminfo$(EXEEXT) test/multifh$(EXEEXT) \
1733+ test/expand$(EXEEXT) test/chmd_find$(EXEEXT) \
1734+ test/chmd_order$(EXEEXT) test/oabx$(EXEEXT)
1735+subdir = .
1736+DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
1737+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
1738+ $(srcdir)/config.h.in $(srcdir)/libmspack.pc.in \
1739+ $(top_srcdir)/configure $(top_srcdir)/doc/Doxyfile.in \
1740+ $(top_srcdir)/doc/Makefile.in AUTHORS COPYING.LIB ChangeLog \
1741+ INSTALL NEWS TODO config.guess config.sub depcomp install-sh \
1742+ ltmain.sh missing
1743+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1744+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
1745+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
1746+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
1747+ $(top_srcdir)/configure.ac
1748+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
1749+ $(ACLOCAL_M4)
1750+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
1751+ configure.lineno config.status.lineno
1752+mkinstalldirs = $(install_sh) -d
1753+CONFIG_HEADER = config.h
1754+CONFIG_CLEAN_FILES = doc/Makefile doc/Doxyfile libmspack.pc
1755+CONFIG_CLEAN_VPATH_FILES =
1756+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
1757+am__vpath_adj = case $$p in \
1758+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
1759+ *) f=$$p;; \
1760+ esac;
1761+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
1762+am__install_max = 40
1763+am__nobase_strip_setup = \
1764+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
1765+am__nobase_strip = \
1766+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
1767+am__nobase_list = $(am__nobase_strip_setup); \
1768+ for p in $$list; do echo "$$p $$p"; done | \
1769+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
1770+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
1771+ if (++n[$$2] == $(am__install_max)) \
1772+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
1773+ END { for (dir in files) print dir, files[dir] }'
1774+am__base_list = \
1775+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
1776+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
1777+am__uninstall_files_from_dir = { \
1778+ test -z "$$files" \
1779+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
1780+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
1781+ $(am__cd) "$$dir" && rm -f $$files; }; \
1782+ }
1783+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
1784+ "$(DESTDIR)$(includedir)"
1785+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
1786+libmscabd_la_LIBADD =
1787+am_libmscabd_la_OBJECTS = system.lo cabd.lo lzxd.lo mszipd.lo qtmd.lo
1788+libmscabd_la_OBJECTS = $(am_libmscabd_la_OBJECTS)
1789+AM_V_lt = $(am__v_lt_@AM_V@)
1790+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
1791+am__v_lt_0 = --silent
1792+libmscabd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
1793+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
1794+ $(libmscabd_la_LDFLAGS) $(LDFLAGS) -o $@
1795+libmschmd_la_LIBADD =
1796+am_libmschmd_la_OBJECTS = system.lo chmd.lo lzxd.lo
1797+libmschmd_la_OBJECTS = $(am_libmschmd_la_OBJECTS)
1798+libmschmd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
1799+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
1800+ $(libmschmd_la_LDFLAGS) $(LDFLAGS) -o $@
1801+libmspack_la_LIBADD =
1802+am_libmspack_la_OBJECTS = system.lo cabc.lo cabd.lo chmc.lo chmd.lo \
1803+ hlpc.lo hlpd.lo litc.lo litd.lo kwajc.lo kwajd.lo szddc.lo \
1804+ szddd.lo oabc.lo oabd.lo lzxc.lo lzxd.lo mszipc.lo mszipd.lo \
1805+ qtmd.lo lzssd.lo crc32.lo
1806+libmspack_la_OBJECTS = $(am_libmspack_la_OBJECTS)
1807+libmspack_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
1808+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
1809+ $(libmspack_la_LDFLAGS) $(LDFLAGS) -o $@
1810+PROGRAMS = $(noinst_PROGRAMS)
1811+am_test_cabd_md5_OBJECTS = cabd_md5.$(OBJEXT) md5.$(OBJEXT)
1812+test_cabd_md5_OBJECTS = $(am_test_cabd_md5_OBJECTS)
1813+test_cabd_md5_DEPENDENCIES = libmscabd.la
1814+am__dirstamp = $(am__leading_dot)dirstamp
1815+am_test_cabd_memory_OBJECTS = cabd_memory.$(OBJEXT)
1816+test_cabd_memory_OBJECTS = $(am_test_cabd_memory_OBJECTS)
1817+test_cabd_memory_DEPENDENCIES = libmscabd.la
1818+am_test_cabd_test_OBJECTS = cabd_test.$(OBJEXT)
1819+test_cabd_test_OBJECTS = $(am_test_cabd_test_OBJECTS)
1820+test_cabd_test_DEPENDENCIES = libmscabd.la
1821+am_test_cabrip_OBJECTS = cabrip.$(OBJEXT)
1822+test_cabrip_OBJECTS = $(am_test_cabrip_OBJECTS)
1823+test_cabrip_DEPENDENCIES = libmscabd.la
1824+am_test_chmd_find_OBJECTS = chmd_find.$(OBJEXT)
1825+test_chmd_find_OBJECTS = $(am_test_chmd_find_OBJECTS)
1826+test_chmd_find_DEPENDENCIES = libmschmd.la
1827+am_test_chmd_md5_OBJECTS = chmd_md5.$(OBJEXT) md5.$(OBJEXT)
1828+test_chmd_md5_OBJECTS = $(am_test_chmd_md5_OBJECTS)
1829+test_chmd_md5_DEPENDENCIES = libmschmd.la
1830+am_test_chmd_order_OBJECTS = chmd_order.$(OBJEXT) md5.$(OBJEXT)
1831+test_chmd_order_OBJECTS = $(am_test_chmd_order_OBJECTS)
1832+test_chmd_order_DEPENDENCIES = libmschmd.la
1833+am_test_chminfo_OBJECTS = chminfo.$(OBJEXT)
1834+test_chminfo_OBJECTS = $(am_test_chminfo_OBJECTS)
1835+test_chminfo_DEPENDENCIES = libmschmd.la
1836+am_test_chmx_OBJECTS = chmx.$(OBJEXT)
1837+test_chmx_OBJECTS = $(am_test_chmx_OBJECTS)
1838+test_chmx_DEPENDENCIES = libmschmd.la
1839+am_test_expand_OBJECTS = expand.$(OBJEXT)
1840+test_expand_OBJECTS = $(am_test_expand_OBJECTS)
1841+test_expand_DEPENDENCIES = libmspack.la
1842+am_test_multifh_OBJECTS = multifh.$(OBJEXT)
1843+test_multifh_OBJECTS = $(am_test_multifh_OBJECTS)
1844+test_multifh_DEPENDENCIES = libmscabd.la
1845+am_test_oabx_OBJECTS = oabx.$(OBJEXT) md5.$(OBJEXT)
1846+test_oabx_OBJECTS = $(am_test_oabx_OBJECTS)
1847+test_oabx_DEPENDENCIES = libmspack.la
1848+DEFAULT_INCLUDES = -I.@am__isrc@
1849+depcomp = $(SHELL) $(top_srcdir)/depcomp
1850+am__depfiles_maybe = depfiles
1851+am__mv = mv -f
1852+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
1853+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
1854+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
1855+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
1856+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
1857+ $(AM_CFLAGS) $(CFLAGS)
1858+AM_V_CC = $(am__v_CC_@AM_V@)
1859+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
1860+am__v_CC_0 = @echo " CC " $@;
1861+AM_V_at = $(am__v_at_@AM_V@)
1862+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
1863+am__v_at_0 = @
1864+CCLD = $(CC)
1865+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
1866+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
1867+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
1868+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
1869+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
1870+am__v_CCLD_0 = @echo " CCLD " $@;
1871+AM_V_GEN = $(am__v_GEN_@AM_V@)
1872+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
1873+am__v_GEN_0 = @echo " GEN " $@;
1874+SOURCES = $(libmscabd_la_SOURCES) $(libmschmd_la_SOURCES) \
1875+ $(libmspack_la_SOURCES) $(test_cabd_md5_SOURCES) \
1876+ $(test_cabd_memory_SOURCES) $(test_cabd_test_SOURCES) \
1877+ $(test_cabrip_SOURCES) $(test_chmd_find_SOURCES) \
1878+ $(test_chmd_md5_SOURCES) $(test_chmd_order_SOURCES) \
1879+ $(test_chminfo_SOURCES) $(test_chmx_SOURCES) \
1880+ $(test_expand_SOURCES) $(test_multifh_SOURCES) \
1881+ $(test_oabx_SOURCES)
1882+DIST_SOURCES = $(libmscabd_la_SOURCES) $(libmschmd_la_SOURCES) \
1883+ $(libmspack_la_SOURCES) $(test_cabd_md5_SOURCES) \
1884+ $(test_cabd_memory_SOURCES) $(test_cabd_test_SOURCES) \
1885+ $(test_cabrip_SOURCES) $(test_chmd_find_SOURCES) \
1886+ $(test_chmd_md5_SOURCES) $(test_chmd_order_SOURCES) \
1887+ $(test_chminfo_SOURCES) $(test_chmx_SOURCES) \
1888+ $(test_expand_SOURCES) $(test_multifh_SOURCES) \
1889+ $(test_oabx_SOURCES)
1890+DATA = $(pkgconfig_DATA)
1891+HEADERS = $(include_HEADERS)
1892+ETAGS = etags
1893+CTAGS = ctags
1894+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
1895+distdir = $(PACKAGE)-$(VERSION)
1896+top_distdir = $(distdir)
1897+am__remove_distdir = \
1898+ if test -d "$(distdir)"; then \
1899+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
1900+ && rm -rf "$(distdir)" \
1901+ || { sleep 5 && rm -rf "$(distdir)"; }; \
1902+ else :; fi
1903+DIST_ARCHIVES = $(distdir).tar.gz
1904+GZIP_ENV = --best
1905+distuninstallcheck_listfiles = find . -type f -print
1906+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
1907+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
1908+distcleancheck_listfiles = find . -type f -print
1909+ACLOCAL = @ACLOCAL@
1910+AMTAR = @AMTAR@
1911+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
1912+AR = @AR@
1913+AUTOCONF = @AUTOCONF@
1914+AUTOHEADER = @AUTOHEADER@
1915+AUTOMAKE = @AUTOMAKE@
1916+AWK = @AWK@
1917+CC = @CC@
1918+CCDEPMODE = @CCDEPMODE@
1919+CFLAGS = @CFLAGS@
1920+CPP = @CPP@
1921+CPPFLAGS = @CPPFLAGS@
1922+CYGPATH_W = @CYGPATH_W@
1923+DEFS = @DEFS@
1924+DEPDIR = @DEPDIR@
1925+DLLTOOL = @DLLTOOL@
1926+DSYMUTIL = @DSYMUTIL@
1927+DUMPBIN = @DUMPBIN@
1928+ECHO_C = @ECHO_C@
1929+ECHO_N = @ECHO_N@
1930+ECHO_T = @ECHO_T@
1931+EGREP = @EGREP@
1932+EXEEXT = @EXEEXT@
1933+FGREP = @FGREP@
1934+GREP = @GREP@
1935+INSTALL = @INSTALL@
1936+INSTALL_DATA = @INSTALL_DATA@
1937+INSTALL_PROGRAM = @INSTALL_PROGRAM@
1938+INSTALL_SCRIPT = @INSTALL_SCRIPT@
1939+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1940+LD = @LD@
1941+LDFLAGS = @LDFLAGS@
1942+LIBOBJS = @LIBOBJS@
1943+LIBS = @LIBS@
1944+LIBTOOL = @LIBTOOL@
1945+LIPO = @LIPO@
1946+LN_S = @LN_S@
1947+LTLIBOBJS = @LTLIBOBJS@
1948+MAKEINFO = @MAKEINFO@
1949+MANIFEST_TOOL = @MANIFEST_TOOL@
1950+MKDIR_P = @MKDIR_P@
1951+NM = @NM@
1952+NMEDIT = @NMEDIT@
1953+OBJDUMP = @OBJDUMP@
1954+OBJEXT = @OBJEXT@
1955+OTOOL = @OTOOL@
1956+OTOOL64 = @OTOOL64@
1957+PACKAGE = @PACKAGE@
1958+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
1959+PACKAGE_NAME = @PACKAGE_NAME@
1960+PACKAGE_STRING = @PACKAGE_STRING@
1961+PACKAGE_TARNAME = @PACKAGE_TARNAME@
1962+PACKAGE_URL = @PACKAGE_URL@
1963+PACKAGE_VERSION = @PACKAGE_VERSION@
1964+PATH_SEPARATOR = @PATH_SEPARATOR@
1965+RANLIB = @RANLIB@
1966+SED = @SED@
1967+SET_MAKE = @SET_MAKE@
1968+SHELL = @SHELL@
1969+STRIP = @STRIP@
1970+VERSION = @VERSION@
1971+abs_builddir = @abs_builddir@
1972+abs_srcdir = @abs_srcdir@
1973+abs_top_builddir = @abs_top_builddir@
1974+abs_top_srcdir = @abs_top_srcdir@
1975+ac_ct_AR = @ac_ct_AR@
1976+ac_ct_CC = @ac_ct_CC@
1977+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
1978+am__include = @am__include@
1979+am__leading_dot = @am__leading_dot@
1980+am__quote = @am__quote@
1981+am__tar = @am__tar@
1982+am__untar = @am__untar@
1983+bindir = @bindir@
1984+build = @build@
1985+build_alias = @build_alias@
1986+build_cpu = @build_cpu@
1987+build_os = @build_os@
1988+build_vendor = @build_vendor@
1989+builddir = @builddir@
1990+datadir = @datadir@
1991+datarootdir = @datarootdir@
1992+docdir = @docdir@
1993+dvidir = @dvidir@
1994+exec_prefix = @exec_prefix@
1995+host = @host@
1996+host_alias = @host_alias@
1997+host_cpu = @host_cpu@
1998+host_os = @host_os@
1999+host_vendor = @host_vendor@
2000+htmldir = @htmldir@
2001+includedir = @includedir@
2002+infodir = @infodir@
2003+install_sh = @install_sh@
2004+libdir = @libdir@
2005+libexecdir = @libexecdir@
2006+localedir = @localedir@
2007+localstatedir = @localstatedir@
2008+mandir = @mandir@
2009+mkdir_p = @mkdir_p@
2010+oldincludedir = @oldincludedir@
2011+pdfdir = @pdfdir@
2012+prefix = @prefix@
2013+program_transform_name = @program_transform_name@
2014+psdir = @psdir@
2015+sbindir = @sbindir@
2016+sharedstatedir = @sharedstatedir@
2017+srcdir = @srcdir@
2018+sysconfdir = @sysconfdir@
2019+target_alias = @target_alias@
2020+top_build_prefix = @top_build_prefix@
2021+top_builddir = @top_builddir@
2022+top_srcdir = @top_srcdir@
2023+EXTRA_DIST = $(srcdir)/debian/* $(srcdir)/doc/* $(srcdir)/test/test_files/*/*
2024+pkgconfigdir = $(libdir)/pkgconfig
2025+pkgconfig_DATA = libmspack.pc
2026+ACLOCAL_AMFLAGS = -I m4
2027+AM_CFLAGS = $(am__append_1) $(am__append_2)
2028+AM_CPPFLAGS = -I$(top_srcdir)/mspack -I$(top_srcdir)/test
2029+lib_LTLIBRARIES = libmspack.la
2030+include_HEADERS = mspack/mspack.h
2031+noinst_LTLIBRARIES = libmscabd.la libmschmd.la
2032+libmspack_la_SOURCES = mspack/mspack.h \
2033+ mspack/system.h mspack/system.c \
2034+ mspack/cab.h mspack/cabc.c mspack/cabd.c \
2035+ mspack/chm.h mspack/chmc.c mspack/chmd.c \
2036+ mspack/hlp.h mspack/hlpc.c mspack/hlpd.c \
2037+ mspack/lit.h mspack/litc.c mspack/litd.c \
2038+ mspack/kwaj.h mspack/kwajc.c mspack/kwajd.c \
2039+ mspack/szdd.h mspack/szddc.c mspack/szddd.c \
2040+ mspack/oab.h mspack/oabc.c mspack/oabd.c \
2041+ mspack/lzx.h mspack/lzxc.c mspack/lzxd.c \
2042+ mspack/mszip.h mspack/mszipc.c mspack/mszipd.c \
2043+ mspack/qtm.h mspack/qtmd.c \
2044+ mspack/readbits.h mspack/readhuff.h \
2045+ mspack/lzss.h mspack/lzssd.c \
2046+ mspack/des.h mspack/sha.h \
2047+ mspack/crc32.c mspack/crc32.h
2048+
2049+libmspack_la_LDFLAGS = -export-symbols-regex '^mspack_' -version-info 1:0:1
2050+libmscabd_la_SOURCES = mspack/mspack.h \
2051+ mspack/system.h mspack/system.c \
2052+ mspack/cab.h mspack/cabd.c \
2053+ mspack/lzx.h mspack/lzxd.c \
2054+ mspack/mszip.h mspack/mszipd.c \
2055+ mspack/qtm.h mspack/qtmd.c \
2056+ mspack/readbits.h mspack/readhuff.h
2057+
2058+libmscabd_la_LDFLAGS = -export-symbols-regex '^mspack_'
2059+libmschmd_la_SOURCES = mspack/mspack.h \
2060+ mspack/system.h mspack/system.c \
2061+ mspack/chm.h mspack/chmd.c \
2062+ mspack/lzx.h mspack/lzxd.c \
2063+ mspack/readbits.h mspack/readhuff.h
2064+
2065+libmschmd_la_LDFLAGS = -export-symbols-regex '^mspack_'
2066+test_chmx_SOURCES = test/chmx.c test/error.h libmschmd.la
2067+test_chmx_LDADD = libmschmd.la
2068+test_chmd_md5_SOURCES = test/chmd_md5.c test/md5.c test/md5.h test/md5_fh.h \
2069+ test/error.h libmschmd.la
2070+
2071+test_chmd_md5_LDADD = libmschmd.la
2072+test_cabd_md5_SOURCES = test/cabd_md5.c test/md5.c test/md5.h test/md5_fh.h \
2073+ test/error.h libmscabd.la
2074+
2075+test_cabd_md5_LDADD = libmscabd.la
2076+test_cabd_test_SOURCES = test/cabd_test.c libmscabd.la
2077+test_cabd_test_LDADD = libmscabd.la
2078+test_cabrip_SOURCES = test/cabrip.c libmscabd.la
2079+test_cabrip_LDADD = libmscabd.la
2080+test_cabd_memory_SOURCES = test/cabd_memory.c libmscabd.la
2081+test_cabd_memory_LDADD = libmscabd.la
2082+test_chminfo_SOURCES = test/chminfo.c libmschmd.la
2083+test_chminfo_LDADD = libmschmd.la
2084+test_multifh_SOURCES = test/multifh.c libmscabd.la
2085+test_multifh_LDADD = libmscabd.la
2086+test_expand_SOURCES = test/expand.c test/error.h libmspack.la
2087+test_expand_LDADD = libmspack.la
2088+test_chmd_find_SOURCES = test/chmd_find.c test/error.h libmschmd.la
2089+test_chmd_find_LDADD = libmschmd.la
2090+test_chmd_order_SOURCES = test/chmd_order.c test/md5.c test/md5.h test/md5_fh.h \
2091+ test/error.h libmschmd.la
2092+
2093+test_chmd_order_LDADD = libmschmd.la
2094+test_oabx_SOURCES = test/oabx.c test/md5.c test/md5.h test/md5_fh.h \
2095+ test/error.h libmspack.la
2096+
2097+test_oabx_LDADD = libmspack.la
2098+all: config.h
2099+ $(MAKE) $(AM_MAKEFLAGS) all-am
2100+
2101+.SUFFIXES:
2102+.SUFFIXES: .c .lo .o .obj
2103+am--refresh: Makefile
2104+ @:
2105+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
2106+ @for dep in $?; do \
2107+ case '$(am__configure_deps)' in \
2108+ *$$dep*) \
2109+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
2110+ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
2111+ && exit 0; \
2112+ exit 1;; \
2113+ esac; \
2114+ done; \
2115+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
2116+ $(am__cd) $(top_srcdir) && \
2117+ $(AUTOMAKE) --gnu Makefile
2118+.PRECIOUS: Makefile
2119+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
2120+ @case '$?' in \
2121+ *config.status*) \
2122+ echo ' $(SHELL) ./config.status'; \
2123+ $(SHELL) ./config.status;; \
2124+ *) \
2125+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
2126+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
2127+ esac;
2128+
2129+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
2130+ $(SHELL) ./config.status --recheck
2131+
2132+$(top_srcdir)/configure: $(am__configure_deps)
2133+ $(am__cd) $(srcdir) && $(AUTOCONF)
2134+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
2135+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
2136+$(am__aclocal_m4_deps):
2137+
2138+config.h: stamp-h1
2139+ @if test ! -f $@; then rm -f stamp-h1; else :; fi
2140+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
2141+
2142+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
2143+ @rm -f stamp-h1
2144+ cd $(top_builddir) && $(SHELL) ./config.status config.h
2145+$(srcdir)/config.h.in: $(am__configure_deps)
2146+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
2147+ rm -f stamp-h1
2148+ touch $@
2149+
2150+distclean-hdr:
2151+ -rm -f config.h stamp-h1
2152+doc/Makefile: $(top_builddir)/config.status $(top_srcdir)/doc/Makefile.in
2153+ cd $(top_builddir) && $(SHELL) ./config.status $@
2154+doc/Doxyfile: $(top_builddir)/config.status $(top_srcdir)/doc/Doxyfile.in
2155+ cd $(top_builddir) && $(SHELL) ./config.status $@
2156+libmspack.pc: $(top_builddir)/config.status $(srcdir)/libmspack.pc.in
2157+ cd $(top_builddir) && $(SHELL) ./config.status $@
2158+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
2159+ @$(NORMAL_INSTALL)
2160+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
2161+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
2162+ list2=; for p in $$list; do \
2163+ if test -f $$p; then \
2164+ list2="$$list2 $$p"; \
2165+ else :; fi; \
2166+ done; \
2167+ test -z "$$list2" || { \
2168+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
2169+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
2170+ }
2171+
2172+uninstall-libLTLIBRARIES:
2173+ @$(NORMAL_UNINSTALL)
2174+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
2175+ for p in $$list; do \
2176+ $(am__strip_dir) \
2177+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
2178+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
2179+ done
2180+
2181+clean-libLTLIBRARIES:
2182+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
2183+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
2184+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
2185+ test "$$dir" != "$$p" || dir=.; \
2186+ echo "rm -f \"$${dir}/so_locations\""; \
2187+ rm -f "$${dir}/so_locations"; \
2188+ done
2189+
2190+clean-noinstLTLIBRARIES:
2191+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
2192+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
2193+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
2194+ test "$$dir" != "$$p" || dir=.; \
2195+ echo "rm -f \"$${dir}/so_locations\""; \
2196+ rm -f "$${dir}/so_locations"; \
2197+ done
2198+libmscabd.la: $(libmscabd_la_OBJECTS) $(libmscabd_la_DEPENDENCIES) $(EXTRA_libmscabd_la_DEPENDENCIES)
2199+ $(AM_V_CCLD)$(libmscabd_la_LINK) $(libmscabd_la_OBJECTS) $(libmscabd_la_LIBADD) $(LIBS)
2200+libmschmd.la: $(libmschmd_la_OBJECTS) $(libmschmd_la_DEPENDENCIES) $(EXTRA_libmschmd_la_DEPENDENCIES)
2201+ $(AM_V_CCLD)$(libmschmd_la_LINK) $(libmschmd_la_OBJECTS) $(libmschmd_la_LIBADD) $(LIBS)
2202+libmspack.la: $(libmspack_la_OBJECTS) $(libmspack_la_DEPENDENCIES) $(EXTRA_libmspack_la_DEPENDENCIES)
2203+ $(AM_V_CCLD)$(libmspack_la_LINK) -rpath $(libdir) $(libmspack_la_OBJECTS) $(libmspack_la_LIBADD) $(LIBS)
2204+
2205+clean-noinstPROGRAMS:
2206+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
2207+ echo " rm -f" $$list; \
2208+ rm -f $$list || exit $$?; \
2209+ test -n "$(EXEEXT)" || exit 0; \
2210+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
2211+ echo " rm -f" $$list; \
2212+ rm -f $$list
2213+test/$(am__dirstamp):
2214+ @$(MKDIR_P) test
2215+ @: > test/$(am__dirstamp)
2216+test/cabd_md5$(EXEEXT): $(test_cabd_md5_OBJECTS) $(test_cabd_md5_DEPENDENCIES) $(EXTRA_test_cabd_md5_DEPENDENCIES) test/$(am__dirstamp)
2217+ @rm -f test/cabd_md5$(EXEEXT)
2218+ $(AM_V_CCLD)$(LINK) $(test_cabd_md5_OBJECTS) $(test_cabd_md5_LDADD) $(LIBS)
2219+test/cabd_memory$(EXEEXT): $(test_cabd_memory_OBJECTS) $(test_cabd_memory_DEPENDENCIES) $(EXTRA_test_cabd_memory_DEPENDENCIES) test/$(am__dirstamp)
2220+ @rm -f test/cabd_memory$(EXEEXT)
2221+ $(AM_V_CCLD)$(LINK) $(test_cabd_memory_OBJECTS) $(test_cabd_memory_LDADD) $(LIBS)
2222+test/cabd_test$(EXEEXT): $(test_cabd_test_OBJECTS) $(test_cabd_test_DEPENDENCIES) $(EXTRA_test_cabd_test_DEPENDENCIES) test/$(am__dirstamp)
2223+ @rm -f test/cabd_test$(EXEEXT)
2224+ $(AM_V_CCLD)$(LINK) $(test_cabd_test_OBJECTS) $(test_cabd_test_LDADD) $(LIBS)
2225+test/cabrip$(EXEEXT): $(test_cabrip_OBJECTS) $(test_cabrip_DEPENDENCIES) $(EXTRA_test_cabrip_DEPENDENCIES) test/$(am__dirstamp)
2226+ @rm -f test/cabrip$(EXEEXT)
2227+ $(AM_V_CCLD)$(LINK) $(test_cabrip_OBJECTS) $(test_cabrip_LDADD) $(LIBS)
2228+test/chmd_find$(EXEEXT): $(test_chmd_find_OBJECTS) $(test_chmd_find_DEPENDENCIES) $(EXTRA_test_chmd_find_DEPENDENCIES) test/$(am__dirstamp)
2229+ @rm -f test/chmd_find$(EXEEXT)
2230+ $(AM_V_CCLD)$(LINK) $(test_chmd_find_OBJECTS) $(test_chmd_find_LDADD) $(LIBS)
2231+test/chmd_md5$(EXEEXT): $(test_chmd_md5_OBJECTS) $(test_chmd_md5_DEPENDENCIES) $(EXTRA_test_chmd_md5_DEPENDENCIES) test/$(am__dirstamp)
2232+ @rm -f test/chmd_md5$(EXEEXT)
2233+ $(AM_V_CCLD)$(LINK) $(test_chmd_md5_OBJECTS) $(test_chmd_md5_LDADD) $(LIBS)
2234+test/chmd_order$(EXEEXT): $(test_chmd_order_OBJECTS) $(test_chmd_order_DEPENDENCIES) $(EXTRA_test_chmd_order_DEPENDENCIES) test/$(am__dirstamp)
2235+ @rm -f test/chmd_order$(EXEEXT)
2236+ $(AM_V_CCLD)$(LINK) $(test_chmd_order_OBJECTS) $(test_chmd_order_LDADD) $(LIBS)
2237+test/chminfo$(EXEEXT): $(test_chminfo_OBJECTS) $(test_chminfo_DEPENDENCIES) $(EXTRA_test_chminfo_DEPENDENCIES) test/$(am__dirstamp)
2238+ @rm -f test/chminfo$(EXEEXT)
2239+ $(AM_V_CCLD)$(LINK) $(test_chminfo_OBJECTS) $(test_chminfo_LDADD) $(LIBS)
2240+test/chmx$(EXEEXT): $(test_chmx_OBJECTS) $(test_chmx_DEPENDENCIES) $(EXTRA_test_chmx_DEPENDENCIES) test/$(am__dirstamp)
2241+ @rm -f test/chmx$(EXEEXT)
2242+ $(AM_V_CCLD)$(LINK) $(test_chmx_OBJECTS) $(test_chmx_LDADD) $(LIBS)
2243+test/expand$(EXEEXT): $(test_expand_OBJECTS) $(test_expand_DEPENDENCIES) $(EXTRA_test_expand_DEPENDENCIES) test/$(am__dirstamp)
2244+ @rm -f test/expand$(EXEEXT)
2245+ $(AM_V_CCLD)$(LINK) $(test_expand_OBJECTS) $(test_expand_LDADD) $(LIBS)
2246+test/multifh$(EXEEXT): $(test_multifh_OBJECTS) $(test_multifh_DEPENDENCIES) $(EXTRA_test_multifh_DEPENDENCIES) test/$(am__dirstamp)
2247+ @rm -f test/multifh$(EXEEXT)
2248+ $(AM_V_CCLD)$(LINK) $(test_multifh_OBJECTS) $(test_multifh_LDADD) $(LIBS)
2249+test/oabx$(EXEEXT): $(test_oabx_OBJECTS) $(test_oabx_DEPENDENCIES) $(EXTRA_test_oabx_DEPENDENCIES) test/$(am__dirstamp)
2250+ @rm -f test/oabx$(EXEEXT)
2251+ $(AM_V_CCLD)$(LINK) $(test_oabx_OBJECTS) $(test_oabx_LDADD) $(LIBS)
2252+
2253+mostlyclean-compile:
2254+ -rm -f *.$(OBJEXT)
2255+
2256+distclean-compile:
2257+ -rm -f *.tab.c
2258+
2259+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cabc.Plo@am__quote@
2260+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cabd.Plo@am__quote@
2261+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cabd_md5.Po@am__quote@
2262+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cabd_memory.Po@am__quote@
2263+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cabd_test.Po@am__quote@
2264+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cabrip.Po@am__quote@
2265+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmc.Plo@am__quote@
2266+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmd.Plo@am__quote@
2267+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmd_find.Po@am__quote@
2268+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmd_md5.Po@am__quote@
2269+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmd_order.Po@am__quote@
2270+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chminfo.Po@am__quote@
2271+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmx.Po@am__quote@
2272+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Plo@am__quote@
2273+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expand.Po@am__quote@
2274+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hlpc.Plo@am__quote@
2275+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hlpd.Plo@am__quote@
2276+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kwajc.Plo@am__quote@
2277+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kwajd.Plo@am__quote@
2278+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/litc.Plo@am__quote@
2279+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/litd.Plo@am__quote@
2280+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzssd.Plo@am__quote@
2281+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzxc.Plo@am__quote@
2282+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzxd.Plo@am__quote@
2283+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@
2284+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mszipc.Plo@am__quote@
2285+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mszipd.Plo@am__quote@
2286+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multifh.Po@am__quote@
2287+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oabc.Plo@am__quote@
2288+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oabd.Plo@am__quote@
2289+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oabx.Po@am__quote@
2290+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qtmd.Plo@am__quote@
2291+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system.Plo@am__quote@
2292+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/szddc.Plo@am__quote@
2293+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/szddd.Plo@am__quote@
2294+
2295+.c.o:
2296+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
2297+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
2298+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
2299+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2300+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
2301+
2302+.c.obj:
2303+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
2304+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
2305+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
2306+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2307+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
2308+
2309+.c.lo:
2310+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
2311+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
2312+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
2313+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2314+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
2315+
2316+system.lo: mspack/system.c
2317+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT system.lo -MD -MP -MF $(DEPDIR)/system.Tpo -c -o system.lo `test -f 'mspack/system.c' || echo '$(srcdir)/'`mspack/system.c
2318+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/system.Tpo $(DEPDIR)/system.Plo
2319+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/system.c' object='system.lo' libtool=yes @AMDEPBACKSLASH@
2320+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2321+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o system.lo `test -f 'mspack/system.c' || echo '$(srcdir)/'`mspack/system.c
2322+
2323+cabd.lo: mspack/cabd.c
2324+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabd.lo -MD -MP -MF $(DEPDIR)/cabd.Tpo -c -o cabd.lo `test -f 'mspack/cabd.c' || echo '$(srcdir)/'`mspack/cabd.c
2325+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabd.Tpo $(DEPDIR)/cabd.Plo
2326+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/cabd.c' object='cabd.lo' libtool=yes @AMDEPBACKSLASH@
2327+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2328+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd.lo `test -f 'mspack/cabd.c' || echo '$(srcdir)/'`mspack/cabd.c
2329+
2330+lzxd.lo: mspack/lzxd.c
2331+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lzxd.lo -MD -MP -MF $(DEPDIR)/lzxd.Tpo -c -o lzxd.lo `test -f 'mspack/lzxd.c' || echo '$(srcdir)/'`mspack/lzxd.c
2332+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lzxd.Tpo $(DEPDIR)/lzxd.Plo
2333+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/lzxd.c' object='lzxd.lo' libtool=yes @AMDEPBACKSLASH@
2334+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2335+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lzxd.lo `test -f 'mspack/lzxd.c' || echo '$(srcdir)/'`mspack/lzxd.c
2336+
2337+mszipd.lo: mspack/mszipd.c
2338+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mszipd.lo -MD -MP -MF $(DEPDIR)/mszipd.Tpo -c -o mszipd.lo `test -f 'mspack/mszipd.c' || echo '$(srcdir)/'`mspack/mszipd.c
2339+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mszipd.Tpo $(DEPDIR)/mszipd.Plo
2340+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/mszipd.c' object='mszipd.lo' libtool=yes @AMDEPBACKSLASH@
2341+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2342+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mszipd.lo `test -f 'mspack/mszipd.c' || echo '$(srcdir)/'`mspack/mszipd.c
2343+
2344+qtmd.lo: mspack/qtmd.c
2345+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT qtmd.lo -MD -MP -MF $(DEPDIR)/qtmd.Tpo -c -o qtmd.lo `test -f 'mspack/qtmd.c' || echo '$(srcdir)/'`mspack/qtmd.c
2346+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/qtmd.Tpo $(DEPDIR)/qtmd.Plo
2347+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/qtmd.c' object='qtmd.lo' libtool=yes @AMDEPBACKSLASH@
2348+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2349+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o qtmd.lo `test -f 'mspack/qtmd.c' || echo '$(srcdir)/'`mspack/qtmd.c
2350+
2351+chmd.lo: mspack/chmd.c
2352+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmd.lo -MD -MP -MF $(DEPDIR)/chmd.Tpo -c -o chmd.lo `test -f 'mspack/chmd.c' || echo '$(srcdir)/'`mspack/chmd.c
2353+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmd.Tpo $(DEPDIR)/chmd.Plo
2354+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/chmd.c' object='chmd.lo' libtool=yes @AMDEPBACKSLASH@
2355+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2356+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmd.lo `test -f 'mspack/chmd.c' || echo '$(srcdir)/'`mspack/chmd.c
2357+
2358+cabc.lo: mspack/cabc.c
2359+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabc.lo -MD -MP -MF $(DEPDIR)/cabc.Tpo -c -o cabc.lo `test -f 'mspack/cabc.c' || echo '$(srcdir)/'`mspack/cabc.c
2360+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabc.Tpo $(DEPDIR)/cabc.Plo
2361+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/cabc.c' object='cabc.lo' libtool=yes @AMDEPBACKSLASH@
2362+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2363+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabc.lo `test -f 'mspack/cabc.c' || echo '$(srcdir)/'`mspack/cabc.c
2364+
2365+chmc.lo: mspack/chmc.c
2366+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmc.lo -MD -MP -MF $(DEPDIR)/chmc.Tpo -c -o chmc.lo `test -f 'mspack/chmc.c' || echo '$(srcdir)/'`mspack/chmc.c
2367+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmc.Tpo $(DEPDIR)/chmc.Plo
2368+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/chmc.c' object='chmc.lo' libtool=yes @AMDEPBACKSLASH@
2369+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2370+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmc.lo `test -f 'mspack/chmc.c' || echo '$(srcdir)/'`mspack/chmc.c
2371+
2372+hlpc.lo: mspack/hlpc.c
2373+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hlpc.lo -MD -MP -MF $(DEPDIR)/hlpc.Tpo -c -o hlpc.lo `test -f 'mspack/hlpc.c' || echo '$(srcdir)/'`mspack/hlpc.c
2374+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hlpc.Tpo $(DEPDIR)/hlpc.Plo
2375+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/hlpc.c' object='hlpc.lo' libtool=yes @AMDEPBACKSLASH@
2376+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2377+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hlpc.lo `test -f 'mspack/hlpc.c' || echo '$(srcdir)/'`mspack/hlpc.c
2378+
2379+hlpd.lo: mspack/hlpd.c
2380+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hlpd.lo -MD -MP -MF $(DEPDIR)/hlpd.Tpo -c -o hlpd.lo `test -f 'mspack/hlpd.c' || echo '$(srcdir)/'`mspack/hlpd.c
2381+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hlpd.Tpo $(DEPDIR)/hlpd.Plo
2382+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/hlpd.c' object='hlpd.lo' libtool=yes @AMDEPBACKSLASH@
2383+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2384+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hlpd.lo `test -f 'mspack/hlpd.c' || echo '$(srcdir)/'`mspack/hlpd.c
2385+
2386+litc.lo: mspack/litc.c
2387+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT litc.lo -MD -MP -MF $(DEPDIR)/litc.Tpo -c -o litc.lo `test -f 'mspack/litc.c' || echo '$(srcdir)/'`mspack/litc.c
2388+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/litc.Tpo $(DEPDIR)/litc.Plo
2389+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/litc.c' object='litc.lo' libtool=yes @AMDEPBACKSLASH@
2390+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2391+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o litc.lo `test -f 'mspack/litc.c' || echo '$(srcdir)/'`mspack/litc.c
2392+
2393+litd.lo: mspack/litd.c
2394+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT litd.lo -MD -MP -MF $(DEPDIR)/litd.Tpo -c -o litd.lo `test -f 'mspack/litd.c' || echo '$(srcdir)/'`mspack/litd.c
2395+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/litd.Tpo $(DEPDIR)/litd.Plo
2396+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/litd.c' object='litd.lo' libtool=yes @AMDEPBACKSLASH@
2397+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2398+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o litd.lo `test -f 'mspack/litd.c' || echo '$(srcdir)/'`mspack/litd.c
2399+
2400+kwajc.lo: mspack/kwajc.c
2401+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kwajc.lo -MD -MP -MF $(DEPDIR)/kwajc.Tpo -c -o kwajc.lo `test -f 'mspack/kwajc.c' || echo '$(srcdir)/'`mspack/kwajc.c
2402+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/kwajc.Tpo $(DEPDIR)/kwajc.Plo
2403+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/kwajc.c' object='kwajc.lo' libtool=yes @AMDEPBACKSLASH@
2404+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2405+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kwajc.lo `test -f 'mspack/kwajc.c' || echo '$(srcdir)/'`mspack/kwajc.c
2406+
2407+kwajd.lo: mspack/kwajd.c
2408+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kwajd.lo -MD -MP -MF $(DEPDIR)/kwajd.Tpo -c -o kwajd.lo `test -f 'mspack/kwajd.c' || echo '$(srcdir)/'`mspack/kwajd.c
2409+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/kwajd.Tpo $(DEPDIR)/kwajd.Plo
2410+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/kwajd.c' object='kwajd.lo' libtool=yes @AMDEPBACKSLASH@
2411+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2412+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kwajd.lo `test -f 'mspack/kwajd.c' || echo '$(srcdir)/'`mspack/kwajd.c
2413+
2414+szddc.lo: mspack/szddc.c
2415+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT szddc.lo -MD -MP -MF $(DEPDIR)/szddc.Tpo -c -o szddc.lo `test -f 'mspack/szddc.c' || echo '$(srcdir)/'`mspack/szddc.c
2416+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/szddc.Tpo $(DEPDIR)/szddc.Plo
2417+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/szddc.c' object='szddc.lo' libtool=yes @AMDEPBACKSLASH@
2418+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2419+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o szddc.lo `test -f 'mspack/szddc.c' || echo '$(srcdir)/'`mspack/szddc.c
2420+
2421+szddd.lo: mspack/szddd.c
2422+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT szddd.lo -MD -MP -MF $(DEPDIR)/szddd.Tpo -c -o szddd.lo `test -f 'mspack/szddd.c' || echo '$(srcdir)/'`mspack/szddd.c
2423+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/szddd.Tpo $(DEPDIR)/szddd.Plo
2424+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/szddd.c' object='szddd.lo' libtool=yes @AMDEPBACKSLASH@
2425+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2426+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o szddd.lo `test -f 'mspack/szddd.c' || echo '$(srcdir)/'`mspack/szddd.c
2427+
2428+oabc.lo: mspack/oabc.c
2429+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT oabc.lo -MD -MP -MF $(DEPDIR)/oabc.Tpo -c -o oabc.lo `test -f 'mspack/oabc.c' || echo '$(srcdir)/'`mspack/oabc.c
2430+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/oabc.Tpo $(DEPDIR)/oabc.Plo
2431+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/oabc.c' object='oabc.lo' libtool=yes @AMDEPBACKSLASH@
2432+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2433+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o oabc.lo `test -f 'mspack/oabc.c' || echo '$(srcdir)/'`mspack/oabc.c
2434+
2435+oabd.lo: mspack/oabd.c
2436+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT oabd.lo -MD -MP -MF $(DEPDIR)/oabd.Tpo -c -o oabd.lo `test -f 'mspack/oabd.c' || echo '$(srcdir)/'`mspack/oabd.c
2437+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/oabd.Tpo $(DEPDIR)/oabd.Plo
2438+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/oabd.c' object='oabd.lo' libtool=yes @AMDEPBACKSLASH@
2439+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2440+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o oabd.lo `test -f 'mspack/oabd.c' || echo '$(srcdir)/'`mspack/oabd.c
2441+
2442+lzxc.lo: mspack/lzxc.c
2443+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lzxc.lo -MD -MP -MF $(DEPDIR)/lzxc.Tpo -c -o lzxc.lo `test -f 'mspack/lzxc.c' || echo '$(srcdir)/'`mspack/lzxc.c
2444+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lzxc.Tpo $(DEPDIR)/lzxc.Plo
2445+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/lzxc.c' object='lzxc.lo' libtool=yes @AMDEPBACKSLASH@
2446+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2447+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lzxc.lo `test -f 'mspack/lzxc.c' || echo '$(srcdir)/'`mspack/lzxc.c
2448+
2449+mszipc.lo: mspack/mszipc.c
2450+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mszipc.lo -MD -MP -MF $(DEPDIR)/mszipc.Tpo -c -o mszipc.lo `test -f 'mspack/mszipc.c' || echo '$(srcdir)/'`mspack/mszipc.c
2451+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mszipc.Tpo $(DEPDIR)/mszipc.Plo
2452+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/mszipc.c' object='mszipc.lo' libtool=yes @AMDEPBACKSLASH@
2453+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2454+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mszipc.lo `test -f 'mspack/mszipc.c' || echo '$(srcdir)/'`mspack/mszipc.c
2455+
2456+lzssd.lo: mspack/lzssd.c
2457+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lzssd.lo -MD -MP -MF $(DEPDIR)/lzssd.Tpo -c -o lzssd.lo `test -f 'mspack/lzssd.c' || echo '$(srcdir)/'`mspack/lzssd.c
2458+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lzssd.Tpo $(DEPDIR)/lzssd.Plo
2459+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/lzssd.c' object='lzssd.lo' libtool=yes @AMDEPBACKSLASH@
2460+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2461+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lzssd.lo `test -f 'mspack/lzssd.c' || echo '$(srcdir)/'`mspack/lzssd.c
2462+
2463+crc32.lo: mspack/crc32.c
2464+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crc32.lo -MD -MP -MF $(DEPDIR)/crc32.Tpo -c -o crc32.lo `test -f 'mspack/crc32.c' || echo '$(srcdir)/'`mspack/crc32.c
2465+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/crc32.Tpo $(DEPDIR)/crc32.Plo
2466+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mspack/crc32.c' object='crc32.lo' libtool=yes @AMDEPBACKSLASH@
2467+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2468+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crc32.lo `test -f 'mspack/crc32.c' || echo '$(srcdir)/'`mspack/crc32.c
2469+
2470+cabd_md5.o: test/cabd_md5.c
2471+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabd_md5.o -MD -MP -MF $(DEPDIR)/cabd_md5.Tpo -c -o cabd_md5.o `test -f 'test/cabd_md5.c' || echo '$(srcdir)/'`test/cabd_md5.c
2472+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabd_md5.Tpo $(DEPDIR)/cabd_md5.Po
2473+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabd_md5.c' object='cabd_md5.o' libtool=no @AMDEPBACKSLASH@
2474+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2475+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd_md5.o `test -f 'test/cabd_md5.c' || echo '$(srcdir)/'`test/cabd_md5.c
2476+
2477+cabd_md5.obj: test/cabd_md5.c
2478+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabd_md5.obj -MD -MP -MF $(DEPDIR)/cabd_md5.Tpo -c -o cabd_md5.obj `if test -f 'test/cabd_md5.c'; then $(CYGPATH_W) 'test/cabd_md5.c'; else $(CYGPATH_W) '$(srcdir)/test/cabd_md5.c'; fi`
2479+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabd_md5.Tpo $(DEPDIR)/cabd_md5.Po
2480+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabd_md5.c' object='cabd_md5.obj' libtool=no @AMDEPBACKSLASH@
2481+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2482+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd_md5.obj `if test -f 'test/cabd_md5.c'; then $(CYGPATH_W) 'test/cabd_md5.c'; else $(CYGPATH_W) '$(srcdir)/test/cabd_md5.c'; fi`
2483+
2484+md5.o: test/md5.c
2485+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.o -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.o `test -f 'test/md5.c' || echo '$(srcdir)/'`test/md5.c
2486+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po
2487+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/md5.c' object='md5.o' libtool=no @AMDEPBACKSLASH@
2488+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2489+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.o `test -f 'test/md5.c' || echo '$(srcdir)/'`test/md5.c
2490+
2491+md5.obj: test/md5.c
2492+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.obj -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.obj `if test -f 'test/md5.c'; then $(CYGPATH_W) 'test/md5.c'; else $(CYGPATH_W) '$(srcdir)/test/md5.c'; fi`
2493+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po
2494+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/md5.c' object='md5.obj' libtool=no @AMDEPBACKSLASH@
2495+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2496+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.obj `if test -f 'test/md5.c'; then $(CYGPATH_W) 'test/md5.c'; else $(CYGPATH_W) '$(srcdir)/test/md5.c'; fi`
2497+
2498+cabd_memory.o: test/cabd_memory.c
2499+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabd_memory.o -MD -MP -MF $(DEPDIR)/cabd_memory.Tpo -c -o cabd_memory.o `test -f 'test/cabd_memory.c' || echo '$(srcdir)/'`test/cabd_memory.c
2500+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabd_memory.Tpo $(DEPDIR)/cabd_memory.Po
2501+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabd_memory.c' object='cabd_memory.o' libtool=no @AMDEPBACKSLASH@
2502+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2503+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd_memory.o `test -f 'test/cabd_memory.c' || echo '$(srcdir)/'`test/cabd_memory.c
2504+
2505+cabd_memory.obj: test/cabd_memory.c
2506+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabd_memory.obj -MD -MP -MF $(DEPDIR)/cabd_memory.Tpo -c -o cabd_memory.obj `if test -f 'test/cabd_memory.c'; then $(CYGPATH_W) 'test/cabd_memory.c'; else $(CYGPATH_W) '$(srcdir)/test/cabd_memory.c'; fi`
2507+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabd_memory.Tpo $(DEPDIR)/cabd_memory.Po
2508+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabd_memory.c' object='cabd_memory.obj' libtool=no @AMDEPBACKSLASH@
2509+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2510+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd_memory.obj `if test -f 'test/cabd_memory.c'; then $(CYGPATH_W) 'test/cabd_memory.c'; else $(CYGPATH_W) '$(srcdir)/test/cabd_memory.c'; fi`
2511+
2512+cabd_test.o: test/cabd_test.c
2513+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabd_test.o -MD -MP -MF $(DEPDIR)/cabd_test.Tpo -c -o cabd_test.o `test -f 'test/cabd_test.c' || echo '$(srcdir)/'`test/cabd_test.c
2514+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabd_test.Tpo $(DEPDIR)/cabd_test.Po
2515+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabd_test.c' object='cabd_test.o' libtool=no @AMDEPBACKSLASH@
2516+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2517+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd_test.o `test -f 'test/cabd_test.c' || echo '$(srcdir)/'`test/cabd_test.c
2518+
2519+cabd_test.obj: test/cabd_test.c
2520+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabd_test.obj -MD -MP -MF $(DEPDIR)/cabd_test.Tpo -c -o cabd_test.obj `if test -f 'test/cabd_test.c'; then $(CYGPATH_W) 'test/cabd_test.c'; else $(CYGPATH_W) '$(srcdir)/test/cabd_test.c'; fi`
2521+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabd_test.Tpo $(DEPDIR)/cabd_test.Po
2522+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabd_test.c' object='cabd_test.obj' libtool=no @AMDEPBACKSLASH@
2523+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2524+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd_test.obj `if test -f 'test/cabd_test.c'; then $(CYGPATH_W) 'test/cabd_test.c'; else $(CYGPATH_W) '$(srcdir)/test/cabd_test.c'; fi`
2525+
2526+cabrip.o: test/cabrip.c
2527+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabrip.o -MD -MP -MF $(DEPDIR)/cabrip.Tpo -c -o cabrip.o `test -f 'test/cabrip.c' || echo '$(srcdir)/'`test/cabrip.c
2528+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabrip.Tpo $(DEPDIR)/cabrip.Po
2529+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabrip.c' object='cabrip.o' libtool=no @AMDEPBACKSLASH@
2530+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2531+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabrip.o `test -f 'test/cabrip.c' || echo '$(srcdir)/'`test/cabrip.c
2532+
2533+cabrip.obj: test/cabrip.c
2534+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cabrip.obj -MD -MP -MF $(DEPDIR)/cabrip.Tpo -c -o cabrip.obj `if test -f 'test/cabrip.c'; then $(CYGPATH_W) 'test/cabrip.c'; else $(CYGPATH_W) '$(srcdir)/test/cabrip.c'; fi`
2535+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cabrip.Tpo $(DEPDIR)/cabrip.Po
2536+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/cabrip.c' object='cabrip.obj' libtool=no @AMDEPBACKSLASH@
2537+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2538+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabrip.obj `if test -f 'test/cabrip.c'; then $(CYGPATH_W) 'test/cabrip.c'; else $(CYGPATH_W) '$(srcdir)/test/cabrip.c'; fi`
2539+
2540+chmd_find.o: test/chmd_find.c
2541+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmd_find.o -MD -MP -MF $(DEPDIR)/chmd_find.Tpo -c -o chmd_find.o `test -f 'test/chmd_find.c' || echo '$(srcdir)/'`test/chmd_find.c
2542+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmd_find.Tpo $(DEPDIR)/chmd_find.Po
2543+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmd_find.c' object='chmd_find.o' libtool=no @AMDEPBACKSLASH@
2544+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2545+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmd_find.o `test -f 'test/chmd_find.c' || echo '$(srcdir)/'`test/chmd_find.c
2546+
2547+chmd_find.obj: test/chmd_find.c
2548+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmd_find.obj -MD -MP -MF $(DEPDIR)/chmd_find.Tpo -c -o chmd_find.obj `if test -f 'test/chmd_find.c'; then $(CYGPATH_W) 'test/chmd_find.c'; else $(CYGPATH_W) '$(srcdir)/test/chmd_find.c'; fi`
2549+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmd_find.Tpo $(DEPDIR)/chmd_find.Po
2550+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmd_find.c' object='chmd_find.obj' libtool=no @AMDEPBACKSLASH@
2551+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2552+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmd_find.obj `if test -f 'test/chmd_find.c'; then $(CYGPATH_W) 'test/chmd_find.c'; else $(CYGPATH_W) '$(srcdir)/test/chmd_find.c'; fi`
2553+
2554+chmd_md5.o: test/chmd_md5.c
2555+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmd_md5.o -MD -MP -MF $(DEPDIR)/chmd_md5.Tpo -c -o chmd_md5.o `test -f 'test/chmd_md5.c' || echo '$(srcdir)/'`test/chmd_md5.c
2556+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmd_md5.Tpo $(DEPDIR)/chmd_md5.Po
2557+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmd_md5.c' object='chmd_md5.o' libtool=no @AMDEPBACKSLASH@
2558+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2559+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmd_md5.o `test -f 'test/chmd_md5.c' || echo '$(srcdir)/'`test/chmd_md5.c
2560+
2561+chmd_md5.obj: test/chmd_md5.c
2562+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmd_md5.obj -MD -MP -MF $(DEPDIR)/chmd_md5.Tpo -c -o chmd_md5.obj `if test -f 'test/chmd_md5.c'; then $(CYGPATH_W) 'test/chmd_md5.c'; else $(CYGPATH_W) '$(srcdir)/test/chmd_md5.c'; fi`
2563+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmd_md5.Tpo $(DEPDIR)/chmd_md5.Po
2564+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmd_md5.c' object='chmd_md5.obj' libtool=no @AMDEPBACKSLASH@
2565+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2566+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmd_md5.obj `if test -f 'test/chmd_md5.c'; then $(CYGPATH_W) 'test/chmd_md5.c'; else $(CYGPATH_W) '$(srcdir)/test/chmd_md5.c'; fi`
2567+
2568+chmd_order.o: test/chmd_order.c
2569+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmd_order.o -MD -MP -MF $(DEPDIR)/chmd_order.Tpo -c -o chmd_order.o `test -f 'test/chmd_order.c' || echo '$(srcdir)/'`test/chmd_order.c
2570+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmd_order.Tpo $(DEPDIR)/chmd_order.Po
2571+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmd_order.c' object='chmd_order.o' libtool=no @AMDEPBACKSLASH@
2572+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2573+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmd_order.o `test -f 'test/chmd_order.c' || echo '$(srcdir)/'`test/chmd_order.c
2574+
2575+chmd_order.obj: test/chmd_order.c
2576+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmd_order.obj -MD -MP -MF $(DEPDIR)/chmd_order.Tpo -c -o chmd_order.obj `if test -f 'test/chmd_order.c'; then $(CYGPATH_W) 'test/chmd_order.c'; else $(CYGPATH_W) '$(srcdir)/test/chmd_order.c'; fi`
2577+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmd_order.Tpo $(DEPDIR)/chmd_order.Po
2578+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmd_order.c' object='chmd_order.obj' libtool=no @AMDEPBACKSLASH@
2579+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2580+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmd_order.obj `if test -f 'test/chmd_order.c'; then $(CYGPATH_W) 'test/chmd_order.c'; else $(CYGPATH_W) '$(srcdir)/test/chmd_order.c'; fi`
2581+
2582+chminfo.o: test/chminfo.c
2583+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chminfo.o -MD -MP -MF $(DEPDIR)/chminfo.Tpo -c -o chminfo.o `test -f 'test/chminfo.c' || echo '$(srcdir)/'`test/chminfo.c
2584+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chminfo.Tpo $(DEPDIR)/chminfo.Po
2585+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chminfo.c' object='chminfo.o' libtool=no @AMDEPBACKSLASH@
2586+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2587+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chminfo.o `test -f 'test/chminfo.c' || echo '$(srcdir)/'`test/chminfo.c
2588+
2589+chminfo.obj: test/chminfo.c
2590+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chminfo.obj -MD -MP -MF $(DEPDIR)/chminfo.Tpo -c -o chminfo.obj `if test -f 'test/chminfo.c'; then $(CYGPATH_W) 'test/chminfo.c'; else $(CYGPATH_W) '$(srcdir)/test/chminfo.c'; fi`
2591+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chminfo.Tpo $(DEPDIR)/chminfo.Po
2592+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chminfo.c' object='chminfo.obj' libtool=no @AMDEPBACKSLASH@
2593+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2594+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chminfo.obj `if test -f 'test/chminfo.c'; then $(CYGPATH_W) 'test/chminfo.c'; else $(CYGPATH_W) '$(srcdir)/test/chminfo.c'; fi`
2595+
2596+chmx.o: test/chmx.c
2597+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmx.o -MD -MP -MF $(DEPDIR)/chmx.Tpo -c -o chmx.o `test -f 'test/chmx.c' || echo '$(srcdir)/'`test/chmx.c
2598+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmx.Tpo $(DEPDIR)/chmx.Po
2599+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmx.c' object='chmx.o' libtool=no @AMDEPBACKSLASH@
2600+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2601+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmx.o `test -f 'test/chmx.c' || echo '$(srcdir)/'`test/chmx.c
2602+
2603+chmx.obj: test/chmx.c
2604+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chmx.obj -MD -MP -MF $(DEPDIR)/chmx.Tpo -c -o chmx.obj `if test -f 'test/chmx.c'; then $(CYGPATH_W) 'test/chmx.c'; else $(CYGPATH_W) '$(srcdir)/test/chmx.c'; fi`
2605+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/chmx.Tpo $(DEPDIR)/chmx.Po
2606+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/chmx.c' object='chmx.obj' libtool=no @AMDEPBACKSLASH@
2607+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2608+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chmx.obj `if test -f 'test/chmx.c'; then $(CYGPATH_W) 'test/chmx.c'; else $(CYGPATH_W) '$(srcdir)/test/chmx.c'; fi`
2609+
2610+expand.o: test/expand.c
2611+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT expand.o -MD -MP -MF $(DEPDIR)/expand.Tpo -c -o expand.o `test -f 'test/expand.c' || echo '$(srcdir)/'`test/expand.c
2612+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/expand.Tpo $(DEPDIR)/expand.Po
2613+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/expand.c' object='expand.o' libtool=no @AMDEPBACKSLASH@
2614+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2615+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o expand.o `test -f 'test/expand.c' || echo '$(srcdir)/'`test/expand.c
2616+
2617+expand.obj: test/expand.c
2618+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT expand.obj -MD -MP -MF $(DEPDIR)/expand.Tpo -c -o expand.obj `if test -f 'test/expand.c'; then $(CYGPATH_W) 'test/expand.c'; else $(CYGPATH_W) '$(srcdir)/test/expand.c'; fi`
2619+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/expand.Tpo $(DEPDIR)/expand.Po
2620+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/expand.c' object='expand.obj' libtool=no @AMDEPBACKSLASH@
2621+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2622+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o expand.obj `if test -f 'test/expand.c'; then $(CYGPATH_W) 'test/expand.c'; else $(CYGPATH_W) '$(srcdir)/test/expand.c'; fi`
2623+
2624+multifh.o: test/multifh.c
2625+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT multifh.o -MD -MP -MF $(DEPDIR)/multifh.Tpo -c -o multifh.o `test -f 'test/multifh.c' || echo '$(srcdir)/'`test/multifh.c
2626+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/multifh.Tpo $(DEPDIR)/multifh.Po
2627+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/multifh.c' object='multifh.o' libtool=no @AMDEPBACKSLASH@
2628+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2629+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o multifh.o `test -f 'test/multifh.c' || echo '$(srcdir)/'`test/multifh.c
2630+
2631+multifh.obj: test/multifh.c
2632+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT multifh.obj -MD -MP -MF $(DEPDIR)/multifh.Tpo -c -o multifh.obj `if test -f 'test/multifh.c'; then $(CYGPATH_W) 'test/multifh.c'; else $(CYGPATH_W) '$(srcdir)/test/multifh.c'; fi`
2633+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/multifh.Tpo $(DEPDIR)/multifh.Po
2634+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/multifh.c' object='multifh.obj' libtool=no @AMDEPBACKSLASH@
2635+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2636+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o multifh.obj `if test -f 'test/multifh.c'; then $(CYGPATH_W) 'test/multifh.c'; else $(CYGPATH_W) '$(srcdir)/test/multifh.c'; fi`
2637+
2638+oabx.o: test/oabx.c
2639+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT oabx.o -MD -MP -MF $(DEPDIR)/oabx.Tpo -c -o oabx.o `test -f 'test/oabx.c' || echo '$(srcdir)/'`test/oabx.c
2640+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/oabx.Tpo $(DEPDIR)/oabx.Po
2641+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/oabx.c' object='oabx.o' libtool=no @AMDEPBACKSLASH@
2642+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2643+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o oabx.o `test -f 'test/oabx.c' || echo '$(srcdir)/'`test/oabx.c
2644+
2645+oabx.obj: test/oabx.c
2646+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT oabx.obj -MD -MP -MF $(DEPDIR)/oabx.Tpo -c -o oabx.obj `if test -f 'test/oabx.c'; then $(CYGPATH_W) 'test/oabx.c'; else $(CYGPATH_W) '$(srcdir)/test/oabx.c'; fi`
2647+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/oabx.Tpo $(DEPDIR)/oabx.Po
2648+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/oabx.c' object='oabx.obj' libtool=no @AMDEPBACKSLASH@
2649+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2650+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o oabx.obj `if test -f 'test/oabx.c'; then $(CYGPATH_W) 'test/oabx.c'; else $(CYGPATH_W) '$(srcdir)/test/oabx.c'; fi`
2651+
2652+mostlyclean-libtool:
2653+ -rm -f *.lo
2654+
2655+clean-libtool:
2656+ -rm -rf .libs _libs
2657+ -rm -rf test/.libs test/_libs
2658+
2659+distclean-libtool:
2660+ -rm -f libtool config.lt
2661+install-pkgconfigDATA: $(pkgconfig_DATA)
2662+ @$(NORMAL_INSTALL)
2663+ test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
2664+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
2665+ for p in $$list; do \
2666+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
2667+ echo "$$d$$p"; \
2668+ done | $(am__base_list) | \
2669+ while read files; do \
2670+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
2671+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
2672+ done
2673+
2674+uninstall-pkgconfigDATA:
2675+ @$(NORMAL_UNINSTALL)
2676+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
2677+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
2678+ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
2679+install-includeHEADERS: $(include_HEADERS)
2680+ @$(NORMAL_INSTALL)
2681+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
2682+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
2683+ for p in $$list; do \
2684+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
2685+ echo "$$d$$p"; \
2686+ done | $(am__base_list) | \
2687+ while read files; do \
2688+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
2689+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
2690+ done
2691+
2692+uninstall-includeHEADERS:
2693+ @$(NORMAL_UNINSTALL)
2694+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
2695+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
2696+ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
2697+
2698+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
2699+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
2700+ unique=`for i in $$list; do \
2701+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
2702+ done | \
2703+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
2704+ END { if (nonempty) { for (i in files) print i; }; }'`; \
2705+ mkid -fID $$unique
2706+tags: TAGS
2707+
2708+TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
2709+ $(TAGS_FILES) $(LISP)
2710+ set x; \
2711+ here=`pwd`; \
2712+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
2713+ unique=`for i in $$list; do \
2714+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
2715+ done | \
2716+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
2717+ END { if (nonempty) { for (i in files) print i; }; }'`; \
2718+ shift; \
2719+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
2720+ test -n "$$unique" || unique=$$empty_fix; \
2721+ if test $$# -gt 0; then \
2722+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
2723+ "$$@" $$unique; \
2724+ else \
2725+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
2726+ $$unique; \
2727+ fi; \
2728+ fi
2729+ctags: CTAGS
2730+CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
2731+ $(TAGS_FILES) $(LISP)
2732+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
2733+ unique=`for i in $$list; do \
2734+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
2735+ done | \
2736+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
2737+ END { if (nonempty) { for (i in files) print i; }; }'`; \
2738+ test -z "$(CTAGS_ARGS)$$unique" \
2739+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
2740+ $$unique
2741+
2742+GTAGS:
2743+ here=`$(am__cd) $(top_builddir) && pwd` \
2744+ && $(am__cd) $(top_srcdir) \
2745+ && gtags -i $(GTAGS_ARGS) "$$here"
2746+
2747+distclean-tags:
2748+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
2749+
2750+distdir: $(DISTFILES)
2751+ $(am__remove_distdir)
2752+ test -d "$(distdir)" || mkdir "$(distdir)"
2753+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
2754+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
2755+ list='$(DISTFILES)'; \
2756+ dist_files=`for file in $$list; do echo $$file; done | \
2757+ sed -e "s|^$$srcdirstrip/||;t" \
2758+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
2759+ case $$dist_files in \
2760+ */*) $(MKDIR_P) `echo "$$dist_files" | \
2761+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
2762+ sort -u` ;; \
2763+ esac; \
2764+ for file in $$dist_files; do \
2765+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
2766+ if test -d $$d/$$file; then \
2767+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
2768+ if test -d "$(distdir)/$$file"; then \
2769+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
2770+ fi; \
2771+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
2772+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
2773+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
2774+ fi; \
2775+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
2776+ else \
2777+ test -f "$(distdir)/$$file" \
2778+ || cp -p $$d/$$file "$(distdir)/$$file" \
2779+ || exit 1; \
2780+ fi; \
2781+ done
2782+ $(MAKE) $(AM_MAKEFLAGS) \
2783+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
2784+ dist-hook
2785+ -test -n "$(am__skip_mode_fix)" \
2786+ || find "$(distdir)" -type d ! -perm -755 \
2787+ -exec chmod u+rwx,go+rx {} \; -o \
2788+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
2789+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
2790+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
2791+ || chmod -R a+r "$(distdir)"
2792+dist-gzip: distdir
2793+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
2794+ $(am__remove_distdir)
2795+
2796+dist-bzip2: distdir
2797+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
2798+ $(am__remove_distdir)
2799+
2800+dist-lzip: distdir
2801+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
2802+ $(am__remove_distdir)
2803+
2804+dist-lzma: distdir
2805+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
2806+ $(am__remove_distdir)
2807+
2808+dist-xz: distdir
2809+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
2810+ $(am__remove_distdir)
2811+
2812+dist-tarZ: distdir
2813+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
2814+ $(am__remove_distdir)
2815+
2816+dist-shar: distdir
2817+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
2818+ $(am__remove_distdir)
2819+
2820+dist-zip: distdir
2821+ -rm -f $(distdir).zip
2822+ zip -rq $(distdir).zip $(distdir)
2823+ $(am__remove_distdir)
2824+
2825+dist dist-all: distdir
2826+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
2827+ $(am__remove_distdir)
2828+
2829+# This target untars the dist file and tries a VPATH configuration. Then
2830+# it guarantees that the distribution is self-contained by making another
2831+# tarfile.
2832+distcheck: dist
2833+ case '$(DIST_ARCHIVES)' in \
2834+ *.tar.gz*) \
2835+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
2836+ *.tar.bz2*) \
2837+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
2838+ *.tar.lzma*) \
2839+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
2840+ *.tar.lz*) \
2841+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
2842+ *.tar.xz*) \
2843+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
2844+ *.tar.Z*) \
2845+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
2846+ *.shar.gz*) \
2847+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
2848+ *.zip*) \
2849+ unzip $(distdir).zip ;;\
2850+ esac
2851+ chmod -R a-w $(distdir); chmod a+w $(distdir)
2852+ mkdir $(distdir)/_build
2853+ mkdir $(distdir)/_inst
2854+ chmod a-w $(distdir)
2855+ test -d $(distdir)/_build || exit 0; \
2856+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
2857+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
2858+ && am__cwd=`pwd` \
2859+ && $(am__cd) $(distdir)/_build \
2860+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
2861+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
2862+ $(DISTCHECK_CONFIGURE_FLAGS) \
2863+ && $(MAKE) $(AM_MAKEFLAGS) \
2864+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
2865+ && $(MAKE) $(AM_MAKEFLAGS) check \
2866+ && $(MAKE) $(AM_MAKEFLAGS) install \
2867+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
2868+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
2869+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
2870+ distuninstallcheck \
2871+ && chmod -R a-w "$$dc_install_base" \
2872+ && ({ \
2873+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
2874+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
2875+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
2876+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
2877+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
2878+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
2879+ && rm -rf "$$dc_destdir" \
2880+ && $(MAKE) $(AM_MAKEFLAGS) dist \
2881+ && rm -rf $(DIST_ARCHIVES) \
2882+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
2883+ && cd "$$am__cwd" \
2884+ || exit 1
2885+ $(am__remove_distdir)
2886+ @(echo "$(distdir) archives ready for distribution: "; \
2887+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
2888+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
2889+distuninstallcheck:
2890+ @test -n '$(distuninstallcheck_dir)' || { \
2891+ echo 'ERROR: trying to run $@ with an empty' \
2892+ '$$(distuninstallcheck_dir)' >&2; \
2893+ exit 1; \
2894+ }; \
2895+ $(am__cd) '$(distuninstallcheck_dir)' || { \
2896+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
2897+ exit 1; \
2898+ }; \
2899+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
2900+ || { echo "ERROR: files left after uninstall:" ; \
2901+ if test -n "$(DESTDIR)"; then \
2902+ echo " (check DESTDIR support)"; \
2903+ fi ; \
2904+ $(distuninstallcheck_listfiles) ; \
2905+ exit 1; } >&2
2906+distcleancheck: distclean
2907+ @if test '$(srcdir)' = . ; then \
2908+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
2909+ exit 1 ; \
2910+ fi
2911+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
2912+ || { echo "ERROR: files left in build directory after distclean:" ; \
2913+ $(distcleancheck_listfiles) ; \
2914+ exit 1; } >&2
2915+check-am: all-am
2916+check: check-am
2917+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \
2918+ config.h
2919+installdirs:
2920+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
2921+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
2922+ done
2923+install: install-am
2924+install-exec: install-exec-am
2925+install-data: install-data-am
2926+uninstall: uninstall-am
2927+
2928+install-am: all-am
2929+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
2930+
2931+installcheck: installcheck-am
2932+install-strip:
2933+ if test -z '$(STRIP)'; then \
2934+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
2935+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
2936+ install; \
2937+ else \
2938+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
2939+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
2940+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
2941+ fi
2942+mostlyclean-generic:
2943+
2944+clean-generic:
2945+
2946+distclean-generic:
2947+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
2948+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
2949+ -rm -f test/$(am__dirstamp)
2950+
2951+maintainer-clean-generic:
2952+ @echo "This command is intended for maintainers to use"
2953+ @echo "it deletes files that may require special tools to rebuild."
2954+clean: clean-am
2955+
2956+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
2957+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
2958+
2959+distclean: distclean-am
2960+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
2961+ -rm -rf ./$(DEPDIR)
2962+ -rm -f Makefile
2963+distclean-am: clean-am distclean-compile distclean-generic \
2964+ distclean-hdr distclean-libtool distclean-tags
2965+
2966+dvi: dvi-am
2967+
2968+dvi-am:
2969+
2970+html: html-am
2971+
2972+html-am:
2973+
2974+info: info-am
2975+
2976+info-am:
2977+
2978+install-data-am: install-includeHEADERS install-pkgconfigDATA
2979+
2980+install-dvi: install-dvi-am
2981+
2982+install-dvi-am:
2983+
2984+install-exec-am: install-libLTLIBRARIES
2985+
2986+install-html: install-html-am
2987+
2988+install-html-am:
2989+
2990+install-info: install-info-am
2991+
2992+install-info-am:
2993+
2994+install-man:
2995+
2996+install-pdf: install-pdf-am
2997+
2998+install-pdf-am:
2999+
3000+install-ps: install-ps-am
3001+
3002+install-ps-am:
3003+
3004+installcheck-am:
3005+
3006+maintainer-clean: maintainer-clean-am
3007+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
3008+ -rm -rf $(top_srcdir)/autom4te.cache
3009+ -rm -rf ./$(DEPDIR)
3010+ -rm -f Makefile
3011+maintainer-clean-am: distclean-am maintainer-clean-generic
3012+
3013+mostlyclean: mostlyclean-am
3014+
3015+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
3016+ mostlyclean-libtool
3017+
3018+pdf: pdf-am
3019+
3020+pdf-am:
3021+
3022+ps: ps-am
3023+
3024+ps-am:
3025+
3026+uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
3027+ uninstall-pkgconfigDATA
3028+
3029+.MAKE: all install-am install-strip
3030+
3031+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
3032+ clean-generic clean-libLTLIBRARIES clean-libtool \
3033+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags dist \
3034+ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma \
3035+ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
3036+ distclean-compile distclean-generic distclean-hdr \
3037+ distclean-libtool distclean-tags distcleancheck distdir \
3038+ distuninstallcheck dvi dvi-am html html-am info info-am \
3039+ install install-am install-data install-data-am install-dvi \
3040+ install-dvi-am install-exec install-exec-am install-html \
3041+ install-html-am install-includeHEADERS install-info \
3042+ install-info-am install-libLTLIBRARIES install-man install-pdf \
3043+ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
3044+ install-strip installcheck installcheck-am installdirs \
3045+ maintainer-clean maintainer-clean-generic mostlyclean \
3046+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
3047+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
3048+ uninstall-includeHEADERS uninstall-libLTLIBRARIES \
3049+ uninstall-pkgconfigDATA
3050+
3051+
3052+dist-hook:
3053+ -rm -f $(distdir)/*.la
3054+
3055+# Tell versions [3.59,3.63) of GNU make to not export all variables.
3056+# Otherwise a system limit (for SysV at least) may be exceeded.
3057+.NOEXPORT:
3058diff --git a/libclamav/libmspack-0.4alpha/NEWS b/libclamav/libmspack-0.4alpha/NEWS
3059new file mode 100644
3060index 000000000000..e69de29bb2d1
3061diff --git a/libclamav/libmspack-0.4alpha/README b/libclamav/libmspack-0.4alpha/README
3062new file mode 100644
3063index 000000000000..4361b5516e75
3064--- /dev/null
3065+++ b/libclamav/libmspack-0.4alpha/README
3066@@ -0,0 +1,130 @@
3067+libmspack 0.4alpha
3068+
3069+The purpose of libmspack is to provide compressors and decompressors,
3070+archivers and dearchivers for Microsoft compression formats: CAB, CHM, WIM,
3071+LIT, HLP, KWAJ and SZDD. It is also designed to be easily embeddable,
3072+stable, robust and resource-efficient.
3073+
3074+The library is not intended as a generalised "any archiver" interface.
3075+Users of the library must explicitly choose the format they intend to work
3076+with.
3077+
3078+All special features of the above formats will be covered as fully as
3079+possible -- for example, CAB's multi-part cabinet sets, or CHM's fast
3080+lookup indices. All compression methods used by the formats will be
3081+implemented as completely as possible.
3082+
3083+However, other than what is required for access to these formats and their
3084+features, no other functionality is intended. There is no file metadata
3085+translation functionality. All file I/O is abstracted, although a default
3086+implementation using the standard C library is provided.
3087+
3088+
3089+DOCUMENTATION
3090+
3091+The API documentation is stored in the doc/ directory. It is generated
3092+automatically from mspack.h with doxygen. It is also available online at
3093+http://www.cabextract.org.uk/libmspack/doc/
3094+
3095+
3096+BUILDING / INSTALLING
3097+
3098+./configure
3099+make
3100+make install
3101+
3102+This will install the main libmspack library and mspack.h header file.
3103+Some other libraries and executables are built, but not installed.
3104+
3105+If building from the Subversion repository, running rebuild.sh will create
3106+all the automatically generated files like the configure script, and will
3107+then ./configure, make and make distcheck. Running cleanup.sh will perform
3108+a thorough clean, deleting all automatically generated files.
3109+
3110+In addition to gcc, you also need the following for building from Subversion:
3111+
3112+- at least autoconf 2.57
3113+- at least automake 1.7
3114+- libtool
3115+
3116+This is an alpha release. Unless you are in a position to package the
3117+libmspack library for the environment you intend to run your application,
3118+it is recommended that you do not rely on users of your software having
3119+the binary library installed and instead you should include the libmspack
3120+source files directly in your application's build environment.
3121+
3122+
3123+LEGAL ISSUES
3124+
3125+The the best of my knowledge, libmspack does not infringe on any
3126+compression or decompression patents. However, this is not legal
3127+advice, and it is recommended that you perform your own patent search.
3128+
3129+libmspack is licensed under the LGPL - see COPYING.LIB in this directory.
3130+
3131+The LGPL requires you to build libmspack as a stand alone library then link
3132+your code to it using a linker. I personally grant you some extra rights:
3133+you can incorporate libmspack's source code wholly or partially in your own
3134+code, without having to build and link libmspack as an independent library,
3135+provided you meet ALL of the following conditions:
3136+
3137+1. ANY modifications to the existing libmspack source code are published and
3138+ distributed under the LGPL license.
3139+2. You MUST NOT use libmspack function calls, structures or definitions unless
3140+ they are defined in the public library interface "mspack.h".
3141+3. When distributing your code, you MUST make clear your code uses libmspack,
3142+ and either include the full libmspack distribution with your code, or
3143+ provide access to it as per clause 4 of the LGPL.
3144+
3145+EXAMPLE CODE
3146+
3147+There are a number of useful programs in the test/ directory which
3148+exercise and demonstrate libmspack's features.
3149+
3150+cabd_c10 - Tests the CAB decompressor on the C10 collection.
3151+cabd_compare - Compares the CAB decompressor with Microsoft's EXTRACT.EXE
3152+cabd_md5 - Prints the MD5 checksums of all files within a CAB file/set.
3153+cabd_memory - An mspack_system implementation that reads/writes to memory.
3154+cabd_test - Regression tests for libmspack's CAB decompression.
3155+cabrip - Extracts any CAB files embedded in another file.
3156+chmd_compare - Compares the CHM decompressor to Microsoft's HH.EXE
3157+chmd_find - Fast-finds a file within a CHM file.
3158+chmd_md5 - Prints the MD5 checksums of all files within a CHM file.
3159+chmd_order - Tests extracting files in a CHM file in four different ways.
3160+chminfo - Prints verbose information about CHM file structures.
3161+chmx - Extracts all files in a CHM file to disk.
3162+expand - Extracts an SZDD or KWAJ file.
3163+msdecompile_md5- Runs Microsoft's HH.EXE -DECOMPILE via WINE.
3164+msexpand_md5 - Runs Microsoft's EXTRACT.EXE via WINE.
3165+multifh - An mspack_system implementation that can simultaneously work
3166+ on in-memory images, raw file descriptors, open file handles
3167+ and regular disk files.
3168+
3169+Here is a simple example of usage, which will create a CAB decompressor,
3170+then use that to open an existing Microsoft CAB file called "example.cab",
3171+and list the names of all the files contained in that cab.
3172+
3173+#include <stdio.h>
3174+#include <unistd.h>
3175+#include <mspack.h>
3176+
3177+int main() {
3178+ struct mscab_decompressor *cabd;
3179+ struct mscabd_cabinet *cab;
3180+ struct mscabd_file *file;
3181+ int test;
3182+
3183+ MSPACK_SYS_SELFTEST(test);
3184+ if (test != MSPACK_ERR_OK) exit(0);
3185+
3186+ if ((cabd = mspack_create_cab_decompressor(NULL))) {
3187+ if ((cab = cabd->open(cabd, "example.cab"))) {
3188+ for (file = cab->files; file; file = file->next) {
3189+ printf("%s\n", file->filename);
3190+ }
3191+ cabd->close(cabd, cab);
3192+ }
3193+ mspack_destroy_cab_decompressor(cabd);
3194+ }
3195+ return 0;
3196+}
3197diff --git a/libclamav/libmspack-0.4alpha/TODO b/libclamav/libmspack-0.4alpha/TODO
3198new file mode 100644
3199index 000000000000..df1095d66332
3200--- /dev/null
3201+++ b/libclamav/libmspack-0.4alpha/TODO
3202@@ -0,0 +1,8 @@
3203+* CAB compression
3204+* cabd_find(): if many bytes are missing from the end of a cabinet, it should still find it
3205+* CHM compression
3206+* HLP: everything
3207+* LIT: everything
3208+* SZDD/KWAJ: compression
3209+* WIM: everything
3210+* chm: make chunk cache size user-controllable
3211diff --git a/libclamav/libmspack-0.4alpha/aclocal.m4 b/libclamav/libmspack-0.4alpha/aclocal.m4
3212new file mode 100644
3213index 000000000000..22b5a662417c
3214--- /dev/null
3215+++ b/libclamav/libmspack-0.4alpha/aclocal.m4
3216@@ -0,0 +1,1033 @@
3217+# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
3218+
3219+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3220+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
3221+# Inc.
3222+# This file is free software; the Free Software Foundation
3223+# gives unlimited permission to copy and/or distribute it,
3224+# with or without modifications, as long as this notice is preserved.
3225+
3226+# This program is distributed in the hope that it will be useful,
3227+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3228+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3229+# PARTICULAR PURPOSE.
3230+
3231+m4_ifndef([AC_AUTOCONF_VERSION],
3232+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
3233+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
3234+[m4_warning([this file was generated for autoconf 2.68.
3235+You have another version of autoconf. It may work, but is not guaranteed to.
3236+If you have problems, you may need to regenerate the build system entirely.
3237+To do so, use the procedure documented by the package, typically `autoreconf'.])])
3238+
3239+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
3240+# Foundation, Inc.
3241+#
3242+# This file is free software; the Free Software Foundation
3243+# gives unlimited permission to copy and/or distribute it,
3244+# with or without modifications, as long as this notice is preserved.
3245+
3246+# serial 1
3247+
3248+# AM_AUTOMAKE_VERSION(VERSION)
3249+# ----------------------------
3250+# Automake X.Y traces this macro to ensure aclocal.m4 has been
3251+# generated from the m4 files accompanying Automake X.Y.
3252+# (This private macro should not be called outside this file.)
3253+AC_DEFUN([AM_AUTOMAKE_VERSION],
3254+[am__api_version='1.11'
3255+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3256+dnl require some minimum version. Point them to the right macro.
3257+m4_if([$1], [1.11.3], [],
3258+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3259+])
3260+
3261+# _AM_AUTOCONF_VERSION(VERSION)
3262+# -----------------------------
3263+# aclocal traces this macro to find the Autoconf version.
3264+# This is a private macro too. Using m4_define simplifies
3265+# the logic in aclocal, which can simply ignore this definition.
3266+m4_define([_AM_AUTOCONF_VERSION], [])
3267+
3268+# AM_SET_CURRENT_AUTOMAKE_VERSION
3269+# -------------------------------
3270+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
3271+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
3272+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
3273+[AM_AUTOMAKE_VERSION([1.11.3])dnl
3274+m4_ifndef([AC_AUTOCONF_VERSION],
3275+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
3276+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
3277+
3278+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
3279+
3280+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
3281+#
3282+# This file is free software; the Free Software Foundation
3283+# gives unlimited permission to copy and/or distribute it,
3284+# with or without modifications, as long as this notice is preserved.
3285+
3286+# serial 1
3287+
3288+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
3289+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
3290+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
3291+#
3292+# Of course, Automake must honor this variable whenever it calls a
3293+# tool from the auxiliary directory. The problem is that $srcdir (and
3294+# therefore $ac_aux_dir as well) can be either absolute or relative,
3295+# depending on how configure is run. This is pretty annoying, since
3296+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
3297+# source directory, any form will work fine, but in subdirectories a
3298+# relative path needs to be adjusted first.
3299+#
3300+# $ac_aux_dir/missing
3301+# fails when called from a subdirectory if $ac_aux_dir is relative
3302+# $top_srcdir/$ac_aux_dir/missing
3303+# fails if $ac_aux_dir is absolute,
3304+# fails when called from a subdirectory in a VPATH build with
3305+# a relative $ac_aux_dir
3306+#
3307+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
3308+# are both prefixed by $srcdir. In an in-source build this is usually
3309+# harmless because $srcdir is `.', but things will broke when you
3310+# start a VPATH build or use an absolute $srcdir.
3311+#
3312+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
3313+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
3314+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
3315+# and then we would define $MISSING as
3316+# MISSING="\${SHELL} $am_aux_dir/missing"
3317+# This will work as long as MISSING is not called from configure, because
3318+# unfortunately $(top_srcdir) has no meaning in configure.
3319+# However there are other variables, like CC, which are often used in
3320+# configure, and could therefore not use this "fixed" $ac_aux_dir.
3321+#
3322+# Another solution, used here, is to always expand $ac_aux_dir to an
3323+# absolute PATH. The drawback is that using absolute paths prevent a
3324+# configured tree to be moved without reconfiguration.
3325+
3326+AC_DEFUN([AM_AUX_DIR_EXPAND],
3327+[dnl Rely on autoconf to set up CDPATH properly.
3328+AC_PREREQ([2.50])dnl
3329+# expand $ac_aux_dir to an absolute path
3330+am_aux_dir=`cd $ac_aux_dir && pwd`
3331+])
3332+
3333+# AM_CONDITIONAL -*- Autoconf -*-
3334+
3335+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
3336+# Free Software Foundation, Inc.
3337+#
3338+# This file is free software; the Free Software Foundation
3339+# gives unlimited permission to copy and/or distribute it,
3340+# with or without modifications, as long as this notice is preserved.
3341+
3342+# serial 9
3343+
3344+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
3345+# -------------------------------------
3346+# Define a conditional.
3347+AC_DEFUN([AM_CONDITIONAL],
3348+[AC_PREREQ(2.52)dnl
3349+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
3350+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
3351+AC_SUBST([$1_TRUE])dnl
3352+AC_SUBST([$1_FALSE])dnl
3353+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
3354+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
3355+m4_define([_AM_COND_VALUE_$1], [$2])dnl
3356+if $2; then
3357+ $1_TRUE=
3358+ $1_FALSE='#'
3359+else
3360+ $1_TRUE='#'
3361+ $1_FALSE=
3362+fi
3363+AC_CONFIG_COMMANDS_PRE(
3364+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
3365+ AC_MSG_ERROR([[conditional "$1" was never defined.
3366+Usually this means the macro was only invoked conditionally.]])
3367+fi])])
3368+
3369+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
3370+# 2010, 2011 Free Software Foundation, Inc.
3371+#
3372+# This file is free software; the Free Software Foundation
3373+# gives unlimited permission to copy and/or distribute it,
3374+# with or without modifications, as long as this notice is preserved.
3375+
3376+# serial 12
3377+
3378+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
3379+# written in clear, in which case automake, when reading aclocal.m4,
3380+# will think it sees a *use*, and therefore will trigger all it's
3381+# C support machinery. Also note that it means that autoscan, seeing
3382+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
3383+
3384+
3385+# _AM_DEPENDENCIES(NAME)
3386+# ----------------------
3387+# See how the compiler implements dependency checking.
3388+# NAME is "CC", "CXX", "GCJ", or "OBJC".
3389+# We try a few techniques and use that to set a single cache variable.
3390+#
3391+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
3392+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
3393+# dependency, and given that the user is not expected to run this macro,
3394+# just rely on AC_PROG_CC.
3395+AC_DEFUN([_AM_DEPENDENCIES],
3396+[AC_REQUIRE([AM_SET_DEPDIR])dnl
3397+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
3398+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
3399+AC_REQUIRE([AM_DEP_TRACK])dnl
3400+
3401+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
3402+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
3403+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
3404+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
3405+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
3406+ [depcc="$$1" am_compiler_list=])
3407+
3408+AC_CACHE_CHECK([dependency style of $depcc],
3409+ [am_cv_$1_dependencies_compiler_type],
3410+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3411+ # We make a subdir and do the tests there. Otherwise we can end up
3412+ # making bogus files that we don't know about and never remove. For
3413+ # instance it was reported that on HP-UX the gcc test will end up
3414+ # making a dummy file named `D' -- because `-MD' means `put the output
3415+ # in D'.
3416+ rm -rf conftest.dir
3417+ mkdir conftest.dir
3418+ # Copy depcomp to subdir because otherwise we won't find it if we're
3419+ # using a relative directory.
3420+ cp "$am_depcomp" conftest.dir
3421+ cd conftest.dir
3422+ # We will build objects and dependencies in a subdirectory because
3423+ # it helps to detect inapplicable dependency modes. For instance
3424+ # both Tru64's cc and ICC support -MD to output dependencies as a
3425+ # side effect of compilation, but ICC will put the dependencies in
3426+ # the current directory while Tru64 will put them in the object
3427+ # directory.
3428+ mkdir sub
3429+
3430+ am_cv_$1_dependencies_compiler_type=none
3431+ if test "$am_compiler_list" = ""; then
3432+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
3433+ fi
3434+ am__universal=false
3435+ m4_case([$1], [CC],
3436+ [case " $depcc " in #(
3437+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
3438+ esac],
3439+ [CXX],
3440+ [case " $depcc " in #(
3441+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
3442+ esac])
3443+
3444+ for depmode in $am_compiler_list; do
3445+ # Setup a source with many dependencies, because some compilers
3446+ # like to wrap large dependency lists on column 80 (with \), and
3447+ # we should not choose a depcomp mode which is confused by this.
3448+ #
3449+ # We need to recreate these files for each test, as the compiler may
3450+ # overwrite some of them when testing with obscure command lines.
3451+ # This happens at least with the AIX C compiler.
3452+ : > sub/conftest.c
3453+ for i in 1 2 3 4 5 6; do
3454+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
3455+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3456+ # Solaris 8's {/usr,}/bin/sh.
3457+ touch sub/conftst$i.h
3458+ done
3459+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3460+
3461+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
3462+ # mode. It turns out that the SunPro C++ compiler does not properly
3463+ # handle `-M -o', and we need to detect this. Also, some Intel
3464+ # versions had trouble with output in subdirs
3465+ am__obj=sub/conftest.${OBJEXT-o}
3466+ am__minus_obj="-o $am__obj"
3467+ case $depmode in
3468+ gcc)
3469+ # This depmode causes a compiler race in universal mode.
3470+ test "$am__universal" = false || continue
3471+ ;;
3472+ nosideeffect)
3473+ # after this tag, mechanisms are not by side-effect, so they'll
3474+ # only be used when explicitly requested
3475+ if test "x$enable_dependency_tracking" = xyes; then
3476+ continue
3477+ else
3478+ break
3479+ fi
3480+ ;;
3481+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
3482+ # This compiler won't grok `-c -o', but also, the minuso test has
3483+ # not run yet. These depmodes are late enough in the game, and
3484+ # so weak that their functioning should not be impacted.
3485+ am__obj=conftest.${OBJEXT-o}
3486+ am__minus_obj=
3487+ ;;
3488+ none) break ;;
3489+ esac
3490+ if depmode=$depmode \
3491+ source=sub/conftest.c object=$am__obj \
3492+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3493+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3494+ >/dev/null 2>conftest.err &&
3495+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3496+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3497+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3498+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3499+ # icc doesn't choke on unknown options, it will just issue warnings
3500+ # or remarks (even with -Werror). So we grep stderr for any message
3501+ # that says an option was ignored or not supported.
3502+ # When given -MP, icc 7.0 and 7.1 complain thusly:
3503+ # icc: Command line warning: ignoring option '-M'; no argument required
3504+ # The diagnosis changed in icc 8.0:
3505+ # icc: Command line remark: option '-MP' not supported
3506+ if (grep 'ignoring option' conftest.err ||
3507+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3508+ am_cv_$1_dependencies_compiler_type=$depmode
3509+ break
3510+ fi
3511+ fi
3512+ done
3513+
3514+ cd ..
3515+ rm -rf conftest.dir
3516+else
3517+ am_cv_$1_dependencies_compiler_type=none
3518+fi
3519+])
3520+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
3521+AM_CONDITIONAL([am__fastdep$1], [
3522+ test "x$enable_dependency_tracking" != xno \
3523+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3524+])
3525+
3526+
3527+# AM_SET_DEPDIR
3528+# -------------
3529+# Choose a directory name for dependency files.
3530+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3531+AC_DEFUN([AM_SET_DEPDIR],
3532+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3533+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3534+])
3535+
3536+
3537+# AM_DEP_TRACK
3538+# ------------
3539+AC_DEFUN([AM_DEP_TRACK],
3540+[AC_ARG_ENABLE(dependency-tracking,
3541+[ --disable-dependency-tracking speeds up one-time build
3542+ --enable-dependency-tracking do not reject slow dependency extractors])
3543+if test "x$enable_dependency_tracking" != xno; then
3544+ am_depcomp="$ac_aux_dir/depcomp"
3545+ AMDEPBACKSLASH='\'
3546+ am__nodep='_no'
3547+fi
3548+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3549+AC_SUBST([AMDEPBACKSLASH])dnl
3550+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3551+AC_SUBST([am__nodep])dnl
3552+_AM_SUBST_NOTMAKE([am__nodep])dnl
3553+])
3554+
3555+# Generate code to set up dependency tracking. -*- Autoconf -*-
3556+
3557+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3558+# Free Software Foundation, Inc.
3559+#
3560+# This file is free software; the Free Software Foundation
3561+# gives unlimited permission to copy and/or distribute it,
3562+# with or without modifications, as long as this notice is preserved.
3563+
3564+#serial 5
3565+
3566+# _AM_OUTPUT_DEPENDENCY_COMMANDS
3567+# ------------------------------
3568+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3569+[{
3570+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
3571+ # are listed without --file. Let's play safe and only enable the eval
3572+ # if we detect the quoting.
3573+ case $CONFIG_FILES in
3574+ *\'*) eval set x "$CONFIG_FILES" ;;
3575+ *) set x $CONFIG_FILES ;;
3576+ esac
3577+ shift
3578+ for mf
3579+ do
3580+ # Strip MF so we end up with the name of the file.
3581+ mf=`echo "$mf" | sed -e 's/:.*$//'`
3582+ # Check whether this is an Automake generated Makefile or not.
3583+ # We used to match only the files named `Makefile.in', but
3584+ # some people rename them; so instead we look at the file content.
3585+ # Grep'ing the first line is not enough: some people post-process
3586+ # each Makefile.in and add a new line on top of each file to say so.
3587+ # Grep'ing the whole file is not good either: AIX grep has a line
3588+ # limit of 2048, but all sed's we know have understand at least 4000.
3589+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3590+ dirpart=`AS_DIRNAME("$mf")`
3591+ else
3592+ continue
3593+ fi
3594+ # Extract the definition of DEPDIR, am__include, and am__quote
3595+ # from the Makefile without running `make'.
3596+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3597+ test -z "$DEPDIR" && continue
3598+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
3599+ test -z "am__include" && continue
3600+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3601+ # When using ansi2knr, U may be empty or an underscore; expand it
3602+ U=`sed -n 's/^U = //p' < "$mf"`
3603+ # Find all dependency output files, they are included files with
3604+ # $(DEPDIR) in their names. We invoke sed twice because it is the
3605+ # simplest approach to changing $(DEPDIR) to its actual value in the
3606+ # expansion.
3607+ for file in `sed -n "
3608+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3609+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3610+ # Make sure the directory exists.
3611+ test -f "$dirpart/$file" && continue
3612+ fdir=`AS_DIRNAME(["$file"])`
3613+ AS_MKDIR_P([$dirpart/$fdir])
3614+ # echo "creating $dirpart/$file"
3615+ echo '# dummy' > "$dirpart/$file"
3616+ done
3617+ done
3618+}
3619+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3620+
3621+
3622+# AM_OUTPUT_DEPENDENCY_COMMANDS
3623+# -----------------------------
3624+# This macro should only be invoked once -- use via AC_REQUIRE.
3625+#
3626+# This code is only required when automatic dependency tracking
3627+# is enabled. FIXME. This creates each `.P' file that we will
3628+# need in order to bootstrap the dependency handling code.
3629+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3630+[AC_CONFIG_COMMANDS([depfiles],
3631+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3632+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3633+])
3634+
3635+# Do all the work for Automake. -*- Autoconf -*-
3636+
3637+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3638+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
3639+#
3640+# This file is free software; the Free Software Foundation
3641+# gives unlimited permission to copy and/or distribute it,
3642+# with or without modifications, as long as this notice is preserved.
3643+
3644+# serial 16
3645+
3646+# This macro actually does too much. Some checks are only needed if
3647+# your package does certain things. But this isn't really a big deal.
3648+
3649+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3650+# AM_INIT_AUTOMAKE([OPTIONS])
3651+# -----------------------------------------------
3652+# The call with PACKAGE and VERSION arguments is the old style
3653+# call (pre autoconf-2.50), which is being phased out. PACKAGE
3654+# and VERSION should now be passed to AC_INIT and removed from
3655+# the call to AM_INIT_AUTOMAKE.
3656+# We support both call styles for the transition. After
3657+# the next Automake release, Autoconf can make the AC_INIT
3658+# arguments mandatory, and then we can depend on a new Autoconf
3659+# release and drop the old call support.
3660+AC_DEFUN([AM_INIT_AUTOMAKE],
3661+[AC_PREREQ([2.62])dnl
3662+dnl Autoconf wants to disallow AM_ names. We explicitly allow
3663+dnl the ones we care about.
3664+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
3665+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
3666+AC_REQUIRE([AC_PROG_INSTALL])dnl
3667+if test "`cd $srcdir && pwd`" != "`pwd`"; then
3668+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
3669+ # is not polluted with repeated "-I."
3670+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
3671+ # test to see if srcdir already configured
3672+ if test -f $srcdir/config.status; then
3673+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
3674+ fi
3675+fi
3676+
3677+# test whether we have cygpath
3678+if test -z "$CYGPATH_W"; then
3679+ if (cygpath --version) >/dev/null 2>/dev/null; then
3680+ CYGPATH_W='cygpath -w'
3681+ else
3682+ CYGPATH_W=echo
3683+ fi
3684+fi
3685+AC_SUBST([CYGPATH_W])
3686+
3687+# Define the identity of the package.
3688+dnl Distinguish between old-style and new-style calls.
3689+m4_ifval([$2],
3690+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
3691+ AC_SUBST([PACKAGE], [$1])dnl
3692+ AC_SUBST([VERSION], [$2])],
3693+[_AM_SET_OPTIONS([$1])dnl
3694+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
3695+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
3696+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
3697+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
3698+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
3699+
3700+_AM_IF_OPTION([no-define],,
3701+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
3702+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
3703+
3704+# Some tools Automake needs.
3705+AC_REQUIRE([AM_SANITY_CHECK])dnl
3706+AC_REQUIRE([AC_ARG_PROGRAM])dnl
3707+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
3708+AM_MISSING_PROG(AUTOCONF, autoconf)
3709+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
3710+AM_MISSING_PROG(AUTOHEADER, autoheader)
3711+AM_MISSING_PROG(MAKEINFO, makeinfo)
3712+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3713+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
3714+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
3715+# We need awk for the "check" target. The system "awk" is bad on
3716+# some platforms.
3717+AC_REQUIRE([AC_PROG_AWK])dnl
3718+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3719+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3720+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
3721+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
3722+ [_AM_PROG_TAR([v7])])])
3723+_AM_IF_OPTION([no-dependencies],,
3724+[AC_PROVIDE_IFELSE([AC_PROG_CC],
3725+ [_AM_DEPENDENCIES(CC)],
3726+ [define([AC_PROG_CC],
3727+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
3728+AC_PROVIDE_IFELSE([AC_PROG_CXX],
3729+ [_AM_DEPENDENCIES(CXX)],
3730+ [define([AC_PROG_CXX],
3731+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
3732+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
3733+ [_AM_DEPENDENCIES(OBJC)],
3734+ [define([AC_PROG_OBJC],
3735+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
3736+])
3737+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
3738+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
3739+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
3740+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
3741+AC_CONFIG_COMMANDS_PRE(dnl
3742+[m4_provide_if([_AM_COMPILER_EXEEXT],
3743+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
3744+])
3745+
3746+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
3747+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
3748+dnl mangled by Autoconf and run in a shell conditional statement.
3749+m4_define([_AC_COMPILER_EXEEXT],
3750+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
3751+
3752+
3753+# When config.status generates a header, we must update the stamp-h file.
3754+# This file resides in the same directory as the config header
3755+# that is generated. The stamp files are numbered to have different names.
3756+
3757+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
3758+# loop where config.status creates the headers, so we can generate
3759+# our stamp files there.
3760+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
3761+[# Compute $1's index in $config_headers.
3762+_am_arg=$1
3763+_am_stamp_count=1
3764+for _am_header in $config_headers :; do
3765+ case $_am_header in
3766+ $_am_arg | $_am_arg:* )
3767+ break ;;
3768+ * )
3769+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
3770+ esac
3771+done
3772+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
3773+
3774+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
3775+# Inc.
3776+#
3777+# This file is free software; the Free Software Foundation
3778+# gives unlimited permission to copy and/or distribute it,
3779+# with or without modifications, as long as this notice is preserved.
3780+
3781+# serial 1
3782+
3783+# AM_PROG_INSTALL_SH
3784+# ------------------
3785+# Define $install_sh.
3786+AC_DEFUN([AM_PROG_INSTALL_SH],
3787+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3788+if test x"${install_sh}" != xset; then
3789+ case $am_aux_dir in
3790+ *\ * | *\ *)
3791+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
3792+ *)
3793+ install_sh="\${SHELL} $am_aux_dir/install-sh"
3794+ esac
3795+fi
3796+AC_SUBST(install_sh)])
3797+
3798+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
3799+#
3800+# This file is free software; the Free Software Foundation
3801+# gives unlimited permission to copy and/or distribute it,
3802+# with or without modifications, as long as this notice is preserved.
3803+
3804+# serial 2
3805+
3806+# Check whether the underlying file-system supports filenames
3807+# with a leading dot. For instance MS-DOS doesn't.
3808+AC_DEFUN([AM_SET_LEADING_DOT],
3809+[rm -rf .tst 2>/dev/null
3810+mkdir .tst 2>/dev/null
3811+if test -d .tst; then
3812+ am__leading_dot=.
3813+else
3814+ am__leading_dot=_
3815+fi
3816+rmdir .tst 2>/dev/null
3817+AC_SUBST([am__leading_dot])])
3818+
3819+# Check to see how 'make' treats includes. -*- Autoconf -*-
3820+
3821+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
3822+#
3823+# This file is free software; the Free Software Foundation
3824+# gives unlimited permission to copy and/or distribute it,
3825+# with or without modifications, as long as this notice is preserved.
3826+
3827+# serial 4
3828+
3829+# AM_MAKE_INCLUDE()
3830+# -----------------
3831+# Check to see how make treats includes.
3832+AC_DEFUN([AM_MAKE_INCLUDE],
3833+[am_make=${MAKE-make}
3834+cat > confinc << 'END'
3835+am__doit:
3836+ @echo this is the am__doit target
3837+.PHONY: am__doit
3838+END
3839+# If we don't find an include directive, just comment out the code.
3840+AC_MSG_CHECKING([for style of include used by $am_make])
3841+am__include="#"
3842+am__quote=
3843+_am_result=none
3844+# First try GNU make style include.
3845+echo "include confinc" > confmf
3846+# Ignore all kinds of additional output from `make'.
3847+case `$am_make -s -f confmf 2> /dev/null` in #(
3848+*the\ am__doit\ target*)
3849+ am__include=include
3850+ am__quote=
3851+ _am_result=GNU
3852+ ;;
3853+esac
3854+# Now try BSD make style include.
3855+if test "$am__include" = "#"; then
3856+ echo '.include "confinc"' > confmf
3857+ case `$am_make -s -f confmf 2> /dev/null` in #(
3858+ *the\ am__doit\ target*)
3859+ am__include=.include
3860+ am__quote="\""
3861+ _am_result=BSD
3862+ ;;
3863+ esac
3864+fi
3865+AC_SUBST([am__include])
3866+AC_SUBST([am__quote])
3867+AC_MSG_RESULT([$_am_result])
3868+rm -f confinc confmf
3869+])
3870+
3871+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
3872+
3873+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
3874+# Free Software Foundation, Inc.
3875+#
3876+# This file is free software; the Free Software Foundation
3877+# gives unlimited permission to copy and/or distribute it,
3878+# with or without modifications, as long as this notice is preserved.
3879+
3880+# serial 6
3881+
3882+# AM_MISSING_PROG(NAME, PROGRAM)
3883+# ------------------------------
3884+AC_DEFUN([AM_MISSING_PROG],
3885+[AC_REQUIRE([AM_MISSING_HAS_RUN])
3886+$1=${$1-"${am_missing_run}$2"}
3887+AC_SUBST($1)])
3888+
3889+
3890+# AM_MISSING_HAS_RUN
3891+# ------------------
3892+# Define MISSING if not defined so far and test if it supports --run.
3893+# If it does, set am_missing_run to use it, otherwise, to nothing.
3894+AC_DEFUN([AM_MISSING_HAS_RUN],
3895+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3896+AC_REQUIRE_AUX_FILE([missing])dnl
3897+if test x"${MISSING+set}" != xset; then
3898+ case $am_aux_dir in
3899+ *\ * | *\ *)
3900+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
3901+ *)
3902+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
3903+ esac
3904+fi
3905+# Use eval to expand $SHELL
3906+if eval "$MISSING --run true"; then
3907+ am_missing_run="$MISSING --run "
3908+else
3909+ am_missing_run=
3910+ AC_MSG_WARN([`missing' script is too old or missing])
3911+fi
3912+])
3913+
3914+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
3915+# Inc.
3916+#
3917+# This file is free software; the Free Software Foundation
3918+# gives unlimited permission to copy and/or distribute it,
3919+# with or without modifications, as long as this notice is preserved.
3920+
3921+# serial 1
3922+
3923+# AM_PROG_MKDIR_P
3924+# ---------------
3925+# Check for `mkdir -p'.
3926+AC_DEFUN([AM_PROG_MKDIR_P],
3927+[AC_PREREQ([2.60])dnl
3928+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3929+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
3930+dnl while keeping a definition of mkdir_p for backward compatibility.
3931+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
3932+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
3933+dnl Makefile.ins that do not define MKDIR_P, so we do our own
3934+dnl adjustment using top_builddir (which is defined more often than
3935+dnl MKDIR_P).
3936+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
3937+case $mkdir_p in
3938+ [[\\/$]]* | ?:[[\\/]]*) ;;
3939+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
3940+esac
3941+])
3942+
3943+# Helper functions for option handling. -*- Autoconf -*-
3944+
3945+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
3946+# Foundation, Inc.
3947+#
3948+# This file is free software; the Free Software Foundation
3949+# gives unlimited permission to copy and/or distribute it,
3950+# with or without modifications, as long as this notice is preserved.
3951+
3952+# serial 5
3953+
3954+# _AM_MANGLE_OPTION(NAME)
3955+# -----------------------
3956+AC_DEFUN([_AM_MANGLE_OPTION],
3957+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
3958+
3959+# _AM_SET_OPTION(NAME)
3960+# --------------------
3961+# Set option NAME. Presently that only means defining a flag for this option.
3962+AC_DEFUN([_AM_SET_OPTION],
3963+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
3964+
3965+# _AM_SET_OPTIONS(OPTIONS)
3966+# ------------------------
3967+# OPTIONS is a space-separated list of Automake options.
3968+AC_DEFUN([_AM_SET_OPTIONS],
3969+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
3970+
3971+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
3972+# -------------------------------------------
3973+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
3974+AC_DEFUN([_AM_IF_OPTION],
3975+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
3976+
3977+# Check to make sure that the build environment is sane. -*- Autoconf -*-
3978+
3979+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
3980+# Free Software Foundation, Inc.
3981+#
3982+# This file is free software; the Free Software Foundation
3983+# gives unlimited permission to copy and/or distribute it,
3984+# with or without modifications, as long as this notice is preserved.
3985+
3986+# serial 5
3987+
3988+# AM_SANITY_CHECK
3989+# ---------------
3990+AC_DEFUN([AM_SANITY_CHECK],
3991+[AC_MSG_CHECKING([whether build environment is sane])
3992+# Just in case
3993+sleep 1
3994+echo timestamp > conftest.file
3995+# Reject unsafe characters in $srcdir or the absolute working directory
3996+# name. Accept space and tab only in the latter.
3997+am_lf='
3998+'
3999+case `pwd` in
4000+ *[[\\\"\#\$\&\'\`$am_lf]]*)
4001+ AC_MSG_ERROR([unsafe absolute working directory name]);;
4002+esac
4003+case $srcdir in
4004+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
4005+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
4006+esac
4007+
4008+# Do `set' in a subshell so we don't clobber the current shell's
4009+# arguments. Must try -L first in case configure is actually a
4010+# symlink; some systems play weird games with the mod time of symlinks
4011+# (eg FreeBSD returns the mod time of the symlink's containing
4012+# directory).
4013+if (
4014+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
4015+ if test "$[*]" = "X"; then
4016+ # -L didn't work.
4017+ set X `ls -t "$srcdir/configure" conftest.file`
4018+ fi
4019+ rm -f conftest.file
4020+ if test "$[*]" != "X $srcdir/configure conftest.file" \
4021+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
4022+
4023+ # If neither matched, then we have a broken ls. This can happen
4024+ # if, for instance, CONFIG_SHELL is bash and it inherits a
4025+ # broken ls alias from the environment. This has actually
4026+ # happened. Such a system could not be considered "sane".
4027+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
4028+alias in your environment])
4029+ fi
4030+
4031+ test "$[2]" = conftest.file
4032+ )
4033+then
4034+ # Ok.
4035+ :
4036+else
4037+ AC_MSG_ERROR([newly created file is older than distributed files!
4038+Check your system clock])
4039+fi
4040+AC_MSG_RESULT(yes)])
4041+
4042+# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
4043+#
4044+# This file is free software; the Free Software Foundation
4045+# gives unlimited permission to copy and/or distribute it,
4046+# with or without modifications, as long as this notice is preserved.
4047+
4048+# serial 2
4049+
4050+# AM_SILENT_RULES([DEFAULT])
4051+# --------------------------
4052+# Enable less verbose build rules; with the default set to DEFAULT
4053+# (`yes' being less verbose, `no' or empty being verbose).
4054+AC_DEFUN([AM_SILENT_RULES],
4055+[AC_ARG_ENABLE([silent-rules],
4056+[ --enable-silent-rules less verbose build output (undo: `make V=1')
4057+ --disable-silent-rules verbose build output (undo: `make V=0')])
4058+case $enable_silent_rules in
4059+yes) AM_DEFAULT_VERBOSITY=0;;
4060+no) AM_DEFAULT_VERBOSITY=1;;
4061+*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
4062+esac
4063+dnl
4064+dnl A few `make' implementations (e.g., NonStop OS and NextStep)
4065+dnl do not support nested variable expansions.
4066+dnl See automake bug#9928 and bug#10237.
4067+am_make=${MAKE-make}
4068+AC_CACHE_CHECK([whether $am_make supports nested variables],
4069+ [am_cv_make_support_nested_variables],
4070+ [if AS_ECHO([['TRUE=$(BAR$(V))
4071+BAR0=false
4072+BAR1=true
4073+V=1
4074+am__doit:
4075+ @$(TRUE)
4076+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
4077+ am_cv_make_support_nested_variables=yes
4078+else
4079+ am_cv_make_support_nested_variables=no
4080+fi])
4081+if test $am_cv_make_support_nested_variables = yes; then
4082+ dnl Using `$V' instead of `$(V)' breaks IRIX make.
4083+ AM_V='$(V)'
4084+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
4085+else
4086+ AM_V=$AM_DEFAULT_VERBOSITY
4087+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
4088+fi
4089+AC_SUBST([AM_V])dnl
4090+AM_SUBST_NOTMAKE([AM_V])dnl
4091+AC_SUBST([AM_DEFAULT_V])dnl
4092+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
4093+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
4094+AM_BACKSLASH='\'
4095+AC_SUBST([AM_BACKSLASH])dnl
4096+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
4097+])
4098+
4099+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
4100+#
4101+# This file is free software; the Free Software Foundation
4102+# gives unlimited permission to copy and/or distribute it,
4103+# with or without modifications, as long as this notice is preserved.
4104+
4105+# serial 1
4106+
4107+# AM_PROG_INSTALL_STRIP
4108+# ---------------------
4109+# One issue with vendor `install' (even GNU) is that you can't
4110+# specify the program used to strip binaries. This is especially
4111+# annoying in cross-compiling environments, where the build's strip
4112+# is unlikely to handle the host's binaries.
4113+# Fortunately install-sh will honor a STRIPPROG variable, so we
4114+# always use install-sh in `make install-strip', and initialize
4115+# STRIPPROG with the value of the STRIP variable (set by the user).
4116+AC_DEFUN([AM_PROG_INSTALL_STRIP],
4117+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4118+# Installed binaries are usually stripped using `strip' when the user
4119+# run `make install-strip'. However `strip' might not be the right
4120+# tool to use in cross-compilation environments, therefore Automake
4121+# will honor the `STRIP' environment variable to overrule this program.
4122+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
4123+if test "$cross_compiling" != no; then
4124+ AC_CHECK_TOOL([STRIP], [strip], :)
4125+fi
4126+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
4127+AC_SUBST([INSTALL_STRIP_PROGRAM])])
4128+
4129+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
4130+#
4131+# This file is free software; the Free Software Foundation
4132+# gives unlimited permission to copy and/or distribute it,
4133+# with or without modifications, as long as this notice is preserved.
4134+
4135+# serial 3
4136+
4137+# _AM_SUBST_NOTMAKE(VARIABLE)
4138+# ---------------------------
4139+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
4140+# This macro is traced by Automake.
4141+AC_DEFUN([_AM_SUBST_NOTMAKE])
4142+
4143+# AM_SUBST_NOTMAKE(VARIABLE)
4144+# --------------------------
4145+# Public sister of _AM_SUBST_NOTMAKE.
4146+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
4147+
4148+# Check how to create a tarball. -*- Autoconf -*-
4149+
4150+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
4151+#
4152+# This file is free software; the Free Software Foundation
4153+# gives unlimited permission to copy and/or distribute it,
4154+# with or without modifications, as long as this notice is preserved.
4155+
4156+# serial 2
4157+
4158+# _AM_PROG_TAR(FORMAT)
4159+# --------------------
4160+# Check how to create a tarball in format FORMAT.
4161+# FORMAT should be one of `v7', `ustar', or `pax'.
4162+#
4163+# Substitute a variable $(am__tar) that is a command
4164+# writing to stdout a FORMAT-tarball containing the directory
4165+# $tardir.
4166+# tardir=directory && $(am__tar) > result.tar
4167+#
4168+# Substitute a variable $(am__untar) that extract such
4169+# a tarball read from stdin.
4170+# $(am__untar) < result.tar
4171+AC_DEFUN([_AM_PROG_TAR],
4172+[# Always define AMTAR for backward compatibility. Yes, it's still used
4173+# in the wild :-( We should find a proper way to deprecate it ...
4174+AC_SUBST([AMTAR], ['$${TAR-tar}'])
4175+m4_if([$1], [v7],
4176+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
4177+ [m4_case([$1], [ustar],, [pax],,
4178+ [m4_fatal([Unknown tar format])])
4179+AC_MSG_CHECKING([how to create a $1 tar archive])
4180+# Loop over all known methods to create a tar archive until one works.
4181+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
4182+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
4183+# Do not fold the above two line into one, because Tru64 sh and
4184+# Solaris sh will not grok spaces in the rhs of `-'.
4185+for _am_tool in $_am_tools
4186+do
4187+ case $_am_tool in
4188+ gnutar)
4189+ for _am_tar in tar gnutar gtar;
4190+ do
4191+ AM_RUN_LOG([$_am_tar --version]) && break
4192+ done
4193+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
4194+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
4195+ am__untar="$_am_tar -xf -"
4196+ ;;
4197+ plaintar)
4198+ # Must skip GNU tar: if it does not support --format= it doesn't create
4199+ # ustar tarball either.
4200+ (tar --version) >/dev/null 2>&1 && continue
4201+ am__tar='tar chf - "$$tardir"'
4202+ am__tar_='tar chf - "$tardir"'
4203+ am__untar='tar xf -'
4204+ ;;
4205+ pax)
4206+ am__tar='pax -L -x $1 -w "$$tardir"'
4207+ am__tar_='pax -L -x $1 -w "$tardir"'
4208+ am__untar='pax -r'
4209+ ;;
4210+ cpio)
4211+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
4212+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
4213+ am__untar='cpio -i -H $1 -d'
4214+ ;;
4215+ none)
4216+ am__tar=false
4217+ am__tar_=false
4218+ am__untar=false
4219+ ;;
4220+ esac
4221+
4222+ # If the value was cached, stop now. We just wanted to have am__tar
4223+ # and am__untar set.
4224+ test -n "${am_cv_prog_tar_$1}" && break
4225+
4226+ # tar/untar a dummy directory, and stop if the command works
4227+ rm -rf conftest.dir
4228+ mkdir conftest.dir
4229+ echo GrepMe > conftest.dir/file
4230+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
4231+ rm -rf conftest.dir
4232+ if test -s conftest.tar; then
4233+ AM_RUN_LOG([$am__untar <conftest.tar])
4234+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
4235+ fi
4236+done
4237+rm -rf conftest.dir
4238+
4239+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
4240+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
4241+AC_SUBST([am__tar])
4242+AC_SUBST([am__untar])
4243+]) # _AM_PROG_TAR
4244+
4245+m4_include([m4/libtool.m4])
4246+m4_include([m4/ltoptions.m4])
4247+m4_include([m4/ltsugar.m4])
4248+m4_include([m4/ltversion.m4])
4249+m4_include([m4/lt~obsolete.m4])
4250diff --git a/libclamav/libmspack-0.4alpha/config.guess b/libclamav/libmspack-0.4alpha/config.guess
4251new file mode 100755
4252index 000000000000..d622a44e551f
4253--- /dev/null
4254+++ b/libclamav/libmspack-0.4alpha/config.guess
4255@@ -0,0 +1,1530 @@
4256+#! /bin/sh
4257+# Attempt to guess a canonical system name.
4258+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4259+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4260+# 2011, 2012 Free Software Foundation, Inc.
4261+
4262+timestamp='2012-02-10'
4263+
4264+# This file is free software; you can redistribute it and/or modify it
4265+# under the terms of the GNU General Public License as published by
4266+# the Free Software Foundation; either version 2 of the License, or
4267+# (at your option) any later version.
4268+#
4269+# This program is distributed in the hope that it will be useful, but
4270+# WITHOUT ANY WARRANTY; without even the implied warranty of
4271+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4272+# General Public License for more details.
4273+#
4274+# You should have received a copy of the GNU General Public License
4275+# along with this program; if not, see <http://www.gnu.org/licenses/>.
4276+#
4277+# As a special exception to the GNU General Public License, if you
4278+# distribute this file as part of a program that contains a
4279+# configuration script generated by Autoconf, you may include it under
4280+# the same distribution terms that you use for the rest of that program.
4281+
4282+
4283+# Originally written by Per Bothner. Please send patches (context
4284+# diff format) to <config-patches@gnu.org> and include a ChangeLog
4285+# entry.
4286+#
4287+# This script attempts to guess a canonical system name similar to
4288+# config.sub. If it succeeds, it prints the system name on stdout, and
4289+# exits with 0. Otherwise, it exits with 1.
4290+#
4291+# You can get the latest version of this script from:
4292+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
4293+
4294+me=`echo "$0" | sed -e 's,.*/,,'`
4295+
4296+usage="\
4297+Usage: $0 [OPTION]
4298+
4299+Output the configuration name of the system \`$me' is run on.
4300+
4301+Operation modes:
4302+ -h, --help print this help, then exit
4303+ -t, --time-stamp print date of last modification, then exit
4304+ -v, --version print version number, then exit
4305+
4306+Report bugs and patches to <config-patches@gnu.org>."
4307+
4308+version="\
4309+GNU config.guess ($timestamp)
4310+
4311+Originally written by Per Bothner.
4312+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
4313+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4314+Free Software Foundation, Inc.
4315+
4316+This is free software; see the source for copying conditions. There is NO
4317+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
4318+
4319+help="
4320+Try \`$me --help' for more information."
4321+
4322+# Parse command line
4323+while test $# -gt 0 ; do
4324+ case $1 in
4325+ --time-stamp | --time* | -t )
4326+ echo "$timestamp" ; exit ;;
4327+ --version | -v )
4328+ echo "$version" ; exit ;;
4329+ --help | --h* | -h )
4330+ echo "$usage"; exit ;;
4331+ -- ) # Stop option processing
4332+ shift; break ;;
4333+ - ) # Use stdin as input.
4334+ break ;;
4335+ -* )
4336+ echo "$me: invalid option $1$help" >&2
4337+ exit 1 ;;
4338+ * )
4339+ break ;;
4340+ esac
4341+done
4342+
4343+if test $# != 0; then
4344+ echo "$me: too many arguments$help" >&2
4345+ exit 1
4346+fi
4347+
4348+trap 'exit 1' 1 2 15
4349+
4350+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
4351+# compiler to aid in system detection is discouraged as it requires
4352+# temporary files to be created and, as you can see below, it is a
4353+# headache to deal with in a portable fashion.
4354+
4355+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
4356+# use `HOST_CC' if defined, but it is deprecated.
4357+
4358+# Portable tmp directory creation inspired by the Autoconf team.
4359+
4360+set_cc_for_build='
4361+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
4362+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
4363+: ${TMPDIR=/tmp} ;
4364+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
4365+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
4366+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
4367+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
4368+dummy=$tmp/dummy ;
4369+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
4370+case $CC_FOR_BUILD,$HOST_CC,$CC in
4371+ ,,) echo "int x;" > $dummy.c ;
4372+ for c in cc gcc c89 c99 ; do
4373+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
4374+ CC_FOR_BUILD="$c"; break ;
4375+ fi ;
4376+ done ;
4377+ if test x"$CC_FOR_BUILD" = x ; then
4378+ CC_FOR_BUILD=no_compiler_found ;
4379+ fi
4380+ ;;
4381+ ,,*) CC_FOR_BUILD=$CC ;;
4382+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
4383+esac ; set_cc_for_build= ;'
4384+
4385+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
4386+# (ghazi@noc.rutgers.edu 1994-08-24)
4387+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
4388+ PATH=$PATH:/.attbin ; export PATH
4389+fi
4390+
4391+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
4392+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
4393+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
4394+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
4395+
4396+# Note: order is significant - the case branches are not exclusive.
4397+
4398+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
4399+ *:NetBSD:*:*)
4400+ # NetBSD (nbsd) targets should (where applicable) match one or
4401+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
4402+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
4403+ # switched to ELF, *-*-netbsd* would select the old
4404+ # object file format. This provides both forward
4405+ # compatibility and a consistent mechanism for selecting the
4406+ # object file format.
4407+ #
4408+ # Note: NetBSD doesn't particularly care about the vendor
4409+ # portion of the name. We always set it to "unknown".
4410+ sysctl="sysctl -n hw.machine_arch"
4411+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
4412+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
4413+ case "${UNAME_MACHINE_ARCH}" in
4414+ armeb) machine=armeb-unknown ;;
4415+ arm*) machine=arm-unknown ;;
4416+ sh3el) machine=shl-unknown ;;
4417+ sh3eb) machine=sh-unknown ;;
4418+ sh5el) machine=sh5le-unknown ;;
4419+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
4420+ esac
4421+ # The Operating System including object format, if it has switched
4422+ # to ELF recently, or will in the future.
4423+ case "${UNAME_MACHINE_ARCH}" in
4424+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
4425+ eval $set_cc_for_build
4426+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
4427+ | grep -q __ELF__
4428+ then
4429+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
4430+ # Return netbsd for either. FIX?
4431+ os=netbsd
4432+ else
4433+ os=netbsdelf
4434+ fi
4435+ ;;
4436+ *)
4437+ os=netbsd
4438+ ;;
4439+ esac
4440+ # The OS release
4441+ # Debian GNU/NetBSD machines have a different userland, and
4442+ # thus, need a distinct triplet. However, they do not need
4443+ # kernel version information, so it can be replaced with a
4444+ # suitable tag, in the style of linux-gnu.
4445+ case "${UNAME_VERSION}" in
4446+ Debian*)
4447+ release='-gnu'
4448+ ;;
4449+ *)
4450+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
4451+ ;;
4452+ esac
4453+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
4454+ # contains redundant information, the shorter form:
4455+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
4456+ echo "${machine}-${os}${release}"
4457+ exit ;;
4458+ *:OpenBSD:*:*)
4459+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
4460+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
4461+ exit ;;
4462+ *:ekkoBSD:*:*)
4463+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
4464+ exit ;;
4465+ *:SolidBSD:*:*)
4466+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
4467+ exit ;;
4468+ macppc:MirBSD:*:*)
4469+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
4470+ exit ;;
4471+ *:MirBSD:*:*)
4472+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
4473+ exit ;;
4474+ alpha:OSF1:*:*)
4475+ case $UNAME_RELEASE in
4476+ *4.0)
4477+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
4478+ ;;
4479+ *5.*)
4480+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
4481+ ;;
4482+ esac
4483+ # According to Compaq, /usr/sbin/psrinfo has been available on
4484+ # OSF/1 and Tru64 systems produced since 1995. I hope that
4485+ # covers most systems running today. This code pipes the CPU
4486+ # types through head -n 1, so we only detect the type of CPU 0.
4487+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
4488+ case "$ALPHA_CPU_TYPE" in
4489+ "EV4 (21064)")
4490+ UNAME_MACHINE="alpha" ;;
4491+ "EV4.5 (21064)")
4492+ UNAME_MACHINE="alpha" ;;
4493+ "LCA4 (21066/21068)")
4494+ UNAME_MACHINE="alpha" ;;
4495+ "EV5 (21164)")
4496+ UNAME_MACHINE="alphaev5" ;;
4497+ "EV5.6 (21164A)")
4498+ UNAME_MACHINE="alphaev56" ;;
4499+ "EV5.6 (21164PC)")
4500+ UNAME_MACHINE="alphapca56" ;;
4501+ "EV5.7 (21164PC)")
4502+ UNAME_MACHINE="alphapca57" ;;
4503+ "EV6 (21264)")
4504+ UNAME_MACHINE="alphaev6" ;;
4505+ "EV6.7 (21264A)")
4506+ UNAME_MACHINE="alphaev67" ;;
4507+ "EV6.8CB (21264C)")
4508+ UNAME_MACHINE="alphaev68" ;;
4509+ "EV6.8AL (21264B)")
4510+ UNAME_MACHINE="alphaev68" ;;
4511+ "EV6.8CX (21264D)")
4512+ UNAME_MACHINE="alphaev68" ;;
4513+ "EV6.9A (21264/EV69A)")
4514+ UNAME_MACHINE="alphaev69" ;;
4515+ "EV7 (21364)")
4516+ UNAME_MACHINE="alphaev7" ;;
4517+ "EV7.9 (21364A)")
4518+ UNAME_MACHINE="alphaev79" ;;
4519+ esac
4520+ # A Pn.n version is a patched version.
4521+ # A Vn.n version is a released version.
4522+ # A Tn.n version is a released field test version.
4523+ # A Xn.n version is an unreleased experimental baselevel.
4524+ # 1.2 uses "1.2" for uname -r.
4525+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
4526+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
4527+ exitcode=$?
4528+ trap '' 0
4529+ exit $exitcode ;;
4530+ Alpha\ *:Windows_NT*:*)
4531+ # How do we know it's Interix rather than the generic POSIX subsystem?
4532+ # Should we change UNAME_MACHINE based on the output of uname instead
4533+ # of the specific Alpha model?
4534+ echo alpha-pc-interix
4535+ exit ;;
4536+ 21064:Windows_NT:50:3)
4537+ echo alpha-dec-winnt3.5
4538+ exit ;;
4539+ Amiga*:UNIX_System_V:4.0:*)
4540+ echo m68k-unknown-sysv4
4541+ exit ;;
4542+ *:[Aa]miga[Oo][Ss]:*:*)
4543+ echo ${UNAME_MACHINE}-unknown-amigaos
4544+ exit ;;
4545+ *:[Mm]orph[Oo][Ss]:*:*)
4546+ echo ${UNAME_MACHINE}-unknown-morphos
4547+ exit ;;
4548+ *:OS/390:*:*)
4549+ echo i370-ibm-openedition
4550+ exit ;;
4551+ *:z/VM:*:*)
4552+ echo s390-ibm-zvmoe
4553+ exit ;;
4554+ *:OS400:*:*)
4555+ echo powerpc-ibm-os400
4556+ exit ;;
4557+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
4558+ echo arm-acorn-riscix${UNAME_RELEASE}
4559+ exit ;;
4560+ arm:riscos:*:*|arm:RISCOS:*:*)
4561+ echo arm-unknown-riscos
4562+ exit ;;
4563+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
4564+ echo hppa1.1-hitachi-hiuxmpp
4565+ exit ;;
4566+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
4567+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
4568+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
4569+ echo pyramid-pyramid-sysv3
4570+ else
4571+ echo pyramid-pyramid-bsd
4572+ fi
4573+ exit ;;
4574+ NILE*:*:*:dcosx)
4575+ echo pyramid-pyramid-svr4
4576+ exit ;;
4577+ DRS?6000:unix:4.0:6*)
4578+ echo sparc-icl-nx6
4579+ exit ;;
4580+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
4581+ case `/usr/bin/uname -p` in
4582+ sparc) echo sparc-icl-nx7; exit ;;
4583+ esac ;;
4584+ s390x:SunOS:*:*)
4585+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
4586+ exit ;;
4587+ sun4H:SunOS:5.*:*)
4588+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
4589+ exit ;;
4590+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
4591+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
4592+ exit ;;
4593+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
4594+ echo i386-pc-auroraux${UNAME_RELEASE}
4595+ exit ;;
4596+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
4597+ eval $set_cc_for_build
4598+ SUN_ARCH="i386"
4599+ # If there is a compiler, see if it is configured for 64-bit objects.
4600+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
4601+ # This test works for both compilers.
4602+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
4603+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
4604+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
4605+ grep IS_64BIT_ARCH >/dev/null
4606+ then
4607+ SUN_ARCH="x86_64"
4608+ fi
4609+ fi
4610+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
4611+ exit ;;
4612+ sun4*:SunOS:6*:*)
4613+ # According to config.sub, this is the proper way to canonicalize
4614+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
4615+ # it's likely to be more like Solaris than SunOS4.
4616+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
4617+ exit ;;
4618+ sun4*:SunOS:*:*)
4619+ case "`/usr/bin/arch -k`" in
4620+ Series*|S4*)
4621+ UNAME_RELEASE=`uname -v`
4622+ ;;
4623+ esac
4624+ # Japanese Language versions have a version number like `4.1.3-JL'.
4625+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
4626+ exit ;;
4627+ sun3*:SunOS:*:*)
4628+ echo m68k-sun-sunos${UNAME_RELEASE}
4629+ exit ;;
4630+ sun*:*:4.2BSD:*)
4631+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
4632+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
4633+ case "`/bin/arch`" in
4634+ sun3)
4635+ echo m68k-sun-sunos${UNAME_RELEASE}
4636+ ;;
4637+ sun4)
4638+ echo sparc-sun-sunos${UNAME_RELEASE}
4639+ ;;
4640+ esac
4641+ exit ;;
4642+ aushp:SunOS:*:*)
4643+ echo sparc-auspex-sunos${UNAME_RELEASE}
4644+ exit ;;
4645+ # The situation for MiNT is a little confusing. The machine name
4646+ # can be virtually everything (everything which is not
4647+ # "atarist" or "atariste" at least should have a processor
4648+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
4649+ # to the lowercase version "mint" (or "freemint"). Finally
4650+ # the system name "TOS" denotes a system which is actually not
4651+ # MiNT. But MiNT is downward compatible to TOS, so this should
4652+ # be no problem.
4653+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4654+ echo m68k-atari-mint${UNAME_RELEASE}
4655+ exit ;;
4656+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4657+ echo m68k-atari-mint${UNAME_RELEASE}
4658+ exit ;;
4659+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4660+ echo m68k-atari-mint${UNAME_RELEASE}
4661+ exit ;;
4662+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4663+ echo m68k-milan-mint${UNAME_RELEASE}
4664+ exit ;;
4665+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4666+ echo m68k-hades-mint${UNAME_RELEASE}
4667+ exit ;;
4668+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4669+ echo m68k-unknown-mint${UNAME_RELEASE}
4670+ exit ;;
4671+ m68k:machten:*:*)
4672+ echo m68k-apple-machten${UNAME_RELEASE}
4673+ exit ;;
4674+ powerpc:machten:*:*)
4675+ echo powerpc-apple-machten${UNAME_RELEASE}
4676+ exit ;;
4677+ RISC*:Mach:*:*)
4678+ echo mips-dec-mach_bsd4.3
4679+ exit ;;
4680+ RISC*:ULTRIX:*:*)
4681+ echo mips-dec-ultrix${UNAME_RELEASE}
4682+ exit ;;
4683+ VAX*:ULTRIX*:*:*)
4684+ echo vax-dec-ultrix${UNAME_RELEASE}
4685+ exit ;;
4686+ 2020:CLIX:*:* | 2430:CLIX:*:*)
4687+ echo clipper-intergraph-clix${UNAME_RELEASE}
4688+ exit ;;
4689+ mips:*:*:UMIPS | mips:*:*:RISCos)
4690+ eval $set_cc_for_build
4691+ sed 's/^ //' << EOF >$dummy.c
4692+#ifdef __cplusplus
4693+#include <stdio.h> /* for printf() prototype */
4694+ int main (int argc, char *argv[]) {
4695+#else
4696+ int main (argc, argv) int argc; char *argv[]; {
4697+#endif
4698+ #if defined (host_mips) && defined (MIPSEB)
4699+ #if defined (SYSTYPE_SYSV)
4700+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4701+ #endif
4702+ #if defined (SYSTYPE_SVR4)
4703+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4704+ #endif
4705+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4706+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4707+ #endif
4708+ #endif
4709+ exit (-1);
4710+ }
4711+EOF
4712+ $CC_FOR_BUILD -o $dummy $dummy.c &&
4713+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4714+ SYSTEM_NAME=`$dummy $dummyarg` &&
4715+ { echo "$SYSTEM_NAME"; exit; }
4716+ echo mips-mips-riscos${UNAME_RELEASE}
4717+ exit ;;
4718+ Motorola:PowerMAX_OS:*:*)
4719+ echo powerpc-motorola-powermax
4720+ exit ;;
4721+ Motorola:*:4.3:PL8-*)
4722+ echo powerpc-harris-powermax
4723+ exit ;;
4724+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4725+ echo powerpc-harris-powermax
4726+ exit ;;
4727+ Night_Hawk:Power_UNIX:*:*)
4728+ echo powerpc-harris-powerunix
4729+ exit ;;
4730+ m88k:CX/UX:7*:*)
4731+ echo m88k-harris-cxux7
4732+ exit ;;
4733+ m88k:*:4*:R4*)
4734+ echo m88k-motorola-sysv4
4735+ exit ;;
4736+ m88k:*:3*:R3*)
4737+ echo m88k-motorola-sysv3
4738+ exit ;;
4739+ AViiON:dgux:*:*)
4740+ # DG/UX returns AViiON for all architectures
4741+ UNAME_PROCESSOR=`/usr/bin/uname -p`
4742+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
4743+ then
4744+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
4745+ [ ${TARGET_BINARY_INTERFACE}x = x ]
4746+ then
4747+ echo m88k-dg-dgux${UNAME_RELEASE}
4748+ else
4749+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
4750+ fi
4751+ else
4752+ echo i586-dg-dgux${UNAME_RELEASE}
4753+ fi
4754+ exit ;;
4755+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
4756+ echo m88k-dolphin-sysv3
4757+ exit ;;
4758+ M88*:*:R3*:*)
4759+ # Delta 88k system running SVR3
4760+ echo m88k-motorola-sysv3
4761+ exit ;;
4762+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
4763+ echo m88k-tektronix-sysv3
4764+ exit ;;
4765+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
4766+ echo m68k-tektronix-bsd
4767+ exit ;;
4768+ *:IRIX*:*:*)
4769+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
4770+ exit ;;
4771+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
4772+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
4773+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
4774+ i*86:AIX:*:*)
4775+ echo i386-ibm-aix
4776+ exit ;;
4777+ ia64:AIX:*:*)
4778+ if [ -x /usr/bin/oslevel ] ; then
4779+ IBM_REV=`/usr/bin/oslevel`
4780+ else
4781+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
4782+ fi
4783+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
4784+ exit ;;
4785+ *:AIX:2:3)
4786+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
4787+ eval $set_cc_for_build
4788+ sed 's/^ //' << EOF >$dummy.c
4789+ #include <sys/systemcfg.h>
4790+
4791+ main()
4792+ {
4793+ if (!__power_pc())
4794+ exit(1);
4795+ puts("powerpc-ibm-aix3.2.5");
4796+ exit(0);
4797+ }
4798+EOF
4799+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
4800+ then
4801+ echo "$SYSTEM_NAME"
4802+ else
4803+ echo rs6000-ibm-aix3.2.5
4804+ fi
4805+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
4806+ echo rs6000-ibm-aix3.2.4
4807+ else
4808+ echo rs6000-ibm-aix3.2
4809+ fi
4810+ exit ;;
4811+ *:AIX:*:[4567])
4812+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
4813+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
4814+ IBM_ARCH=rs6000
4815+ else
4816+ IBM_ARCH=powerpc
4817+ fi
4818+ if [ -x /usr/bin/oslevel ] ; then
4819+ IBM_REV=`/usr/bin/oslevel`
4820+ else
4821+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
4822+ fi
4823+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
4824+ exit ;;
4825+ *:AIX:*:*)
4826+ echo rs6000-ibm-aix
4827+ exit ;;
4828+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
4829+ echo romp-ibm-bsd4.4
4830+ exit ;;
4831+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
4832+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
4833+ exit ;; # report: romp-ibm BSD 4.3
4834+ *:BOSX:*:*)
4835+ echo rs6000-bull-bosx
4836+ exit ;;
4837+ DPX/2?00:B.O.S.:*:*)
4838+ echo m68k-bull-sysv3
4839+ exit ;;
4840+ 9000/[34]??:4.3bsd:1.*:*)
4841+ echo m68k-hp-bsd
4842+ exit ;;
4843+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
4844+ echo m68k-hp-bsd4.4
4845+ exit ;;
4846+ 9000/[34678]??:HP-UX:*:*)
4847+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
4848+ case "${UNAME_MACHINE}" in
4849+ 9000/31? ) HP_ARCH=m68000 ;;
4850+ 9000/[34]?? ) HP_ARCH=m68k ;;
4851+ 9000/[678][0-9][0-9])
4852+ if [ -x /usr/bin/getconf ]; then
4853+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
4854+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
4855+ case "${sc_cpu_version}" in
4856+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
4857+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
4858+ 532) # CPU_PA_RISC2_0
4859+ case "${sc_kernel_bits}" in
4860+ 32) HP_ARCH="hppa2.0n" ;;
4861+ 64) HP_ARCH="hppa2.0w" ;;
4862+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
4863+ esac ;;
4864+ esac
4865+ fi
4866+ if [ "${HP_ARCH}" = "" ]; then
4867+ eval $set_cc_for_build
4868+ sed 's/^ //' << EOF >$dummy.c
4869+
4870+ #define _HPUX_SOURCE
4871+ #include <stdlib.h>
4872+ #include <unistd.h>
4873+
4874+ int main ()
4875+ {
4876+ #if defined(_SC_KERNEL_BITS)
4877+ long bits = sysconf(_SC_KERNEL_BITS);
4878+ #endif
4879+ long cpu = sysconf (_SC_CPU_VERSION);
4880+
4881+ switch (cpu)
4882+ {
4883+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
4884+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
4885+ case CPU_PA_RISC2_0:
4886+ #if defined(_SC_KERNEL_BITS)
4887+ switch (bits)
4888+ {
4889+ case 64: puts ("hppa2.0w"); break;
4890+ case 32: puts ("hppa2.0n"); break;
4891+ default: puts ("hppa2.0"); break;
4892+ } break;
4893+ #else /* !defined(_SC_KERNEL_BITS) */
4894+ puts ("hppa2.0"); break;
4895+ #endif
4896+ default: puts ("hppa1.0"); break;
4897+ }
4898+ exit (0);
4899+ }
4900+EOF
4901+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
4902+ test -z "$HP_ARCH" && HP_ARCH=hppa
4903+ fi ;;
4904+ esac
4905+ if [ ${HP_ARCH} = "hppa2.0w" ]
4906+ then
4907+ eval $set_cc_for_build
4908+
4909+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
4910+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
4911+ # generating 64-bit code. GNU and HP use different nomenclature:
4912+ #
4913+ # $ CC_FOR_BUILD=cc ./config.guess
4914+ # => hppa2.0w-hp-hpux11.23
4915+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
4916+ # => hppa64-hp-hpux11.23
4917+
4918+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
4919+ grep -q __LP64__
4920+ then
4921+ HP_ARCH="hppa2.0w"
4922+ else
4923+ HP_ARCH="hppa64"
4924+ fi
4925+ fi
4926+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
4927+ exit ;;
4928+ ia64:HP-UX:*:*)
4929+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
4930+ echo ia64-hp-hpux${HPUX_REV}
4931+ exit ;;
4932+ 3050*:HI-UX:*:*)
4933+ eval $set_cc_for_build
4934+ sed 's/^ //' << EOF >$dummy.c
4935+ #include <unistd.h>
4936+ int
4937+ main ()
4938+ {
4939+ long cpu = sysconf (_SC_CPU_VERSION);
4940+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
4941+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
4942+ results, however. */
4943+ if (CPU_IS_PA_RISC (cpu))
4944+ {
4945+ switch (cpu)
4946+ {
4947+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
4948+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
4949+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
4950+ default: puts ("hppa-hitachi-hiuxwe2"); break;
4951+ }
4952+ }
4953+ else if (CPU_IS_HP_MC68K (cpu))
4954+ puts ("m68k-hitachi-hiuxwe2");
4955+ else puts ("unknown-hitachi-hiuxwe2");
4956+ exit (0);
4957+ }
4958+EOF
4959+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
4960+ { echo "$SYSTEM_NAME"; exit; }
4961+ echo unknown-hitachi-hiuxwe2
4962+ exit ;;
4963+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
4964+ echo hppa1.1-hp-bsd
4965+ exit ;;
4966+ 9000/8??:4.3bsd:*:*)
4967+ echo hppa1.0-hp-bsd
4968+ exit ;;
4969+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
4970+ echo hppa1.0-hp-mpeix
4971+ exit ;;
4972+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
4973+ echo hppa1.1-hp-osf
4974+ exit ;;
4975+ hp8??:OSF1:*:*)
4976+ echo hppa1.0-hp-osf
4977+ exit ;;
4978+ i*86:OSF1:*:*)
4979+ if [ -x /usr/sbin/sysversion ] ; then
4980+ echo ${UNAME_MACHINE}-unknown-osf1mk
4981+ else
4982+ echo ${UNAME_MACHINE}-unknown-osf1
4983+ fi
4984+ exit ;;
4985+ parisc*:Lites*:*:*)
4986+ echo hppa1.1-hp-lites
4987+ exit ;;
4988+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
4989+ echo c1-convex-bsd
4990+ exit ;;
4991+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
4992+ if getsysinfo -f scalar_acc
4993+ then echo c32-convex-bsd
4994+ else echo c2-convex-bsd
4995+ fi
4996+ exit ;;
4997+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
4998+ echo c34-convex-bsd
4999+ exit ;;
5000+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
5001+ echo c38-convex-bsd
5002+ exit ;;
5003+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
5004+ echo c4-convex-bsd
5005+ exit ;;
5006+ CRAY*Y-MP:*:*:*)
5007+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
5008+ exit ;;
5009+ CRAY*[A-Z]90:*:*:*)
5010+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
5011+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
5012+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
5013+ -e 's/\.[^.]*$/.X/'
5014+ exit ;;
5015+ CRAY*TS:*:*:*)
5016+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
5017+ exit ;;
5018+ CRAY*T3E:*:*:*)
5019+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
5020+ exit ;;
5021+ CRAY*SV1:*:*:*)
5022+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
5023+ exit ;;
5024+ *:UNICOS/mp:*:*)
5025+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
5026+ exit ;;
5027+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
5028+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
5029+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
5030+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
5031+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
5032+ exit ;;
5033+ 5000:UNIX_System_V:4.*:*)
5034+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
5035+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
5036+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
5037+ exit ;;
5038+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
5039+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
5040+ exit ;;
5041+ sparc*:BSD/OS:*:*)
5042+ echo sparc-unknown-bsdi${UNAME_RELEASE}
5043+ exit ;;
5044+ *:BSD/OS:*:*)
5045+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
5046+ exit ;;
5047+ *:FreeBSD:*:*)
5048+ UNAME_PROCESSOR=`/usr/bin/uname -p`
5049+ case ${UNAME_PROCESSOR} in
5050+ amd64)
5051+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
5052+ *)
5053+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
5054+ esac
5055+ exit ;;
5056+ i*:CYGWIN*:*)
5057+ echo ${UNAME_MACHINE}-pc-cygwin
5058+ exit ;;
5059+ *:MINGW*:*)
5060+ echo ${UNAME_MACHINE}-pc-mingw32
5061+ exit ;;
5062+ i*:MSYS*:*)
5063+ echo ${UNAME_MACHINE}-pc-msys
5064+ exit ;;
5065+ i*:windows32*:*)
5066+ # uname -m includes "-pc" on this system.
5067+ echo ${UNAME_MACHINE}-mingw32
5068+ exit ;;
5069+ i*:PW*:*)
5070+ echo ${UNAME_MACHINE}-pc-pw32
5071+ exit ;;
5072+ *:Interix*:*)
5073+ case ${UNAME_MACHINE} in
5074+ x86)
5075+ echo i586-pc-interix${UNAME_RELEASE}
5076+ exit ;;
5077+ authenticamd | genuineintel | EM64T)
5078+ echo x86_64-unknown-interix${UNAME_RELEASE}
5079+ exit ;;
5080+ IA64)
5081+ echo ia64-unknown-interix${UNAME_RELEASE}
5082+ exit ;;
5083+ esac ;;
5084+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
5085+ echo i${UNAME_MACHINE}-pc-mks
5086+ exit ;;
5087+ 8664:Windows_NT:*)
5088+ echo x86_64-pc-mks
5089+ exit ;;
5090+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
5091+ # How do we know it's Interix rather than the generic POSIX subsystem?
5092+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
5093+ # UNAME_MACHINE based on the output of uname instead of i386?
5094+ echo i586-pc-interix
5095+ exit ;;
5096+ i*:UWIN*:*)
5097+ echo ${UNAME_MACHINE}-pc-uwin
5098+ exit ;;
5099+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
5100+ echo x86_64-unknown-cygwin
5101+ exit ;;
5102+ p*:CYGWIN*:*)
5103+ echo powerpcle-unknown-cygwin
5104+ exit ;;
5105+ prep*:SunOS:5.*:*)
5106+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
5107+ exit ;;
5108+ *:GNU:*:*)
5109+ # the GNU system
5110+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
5111+ exit ;;
5112+ *:GNU/*:*:*)
5113+ # other systems with GNU libc and userland
5114+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
5115+ exit ;;
5116+ i*86:Minix:*:*)
5117+ echo ${UNAME_MACHINE}-pc-minix
5118+ exit ;;
5119+ aarch64:Linux:*:*)
5120+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5121+ exit ;;
5122+ aarch64_be:Linux:*:*)
5123+ UNAME_MACHINE=aarch64_be
5124+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5125+ exit ;;
5126+ alpha:Linux:*:*)
5127+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
5128+ EV5) UNAME_MACHINE=alphaev5 ;;
5129+ EV56) UNAME_MACHINE=alphaev56 ;;
5130+ PCA56) UNAME_MACHINE=alphapca56 ;;
5131+ PCA57) UNAME_MACHINE=alphapca56 ;;
5132+ EV6) UNAME_MACHINE=alphaev6 ;;
5133+ EV67) UNAME_MACHINE=alphaev67 ;;
5134+ EV68*) UNAME_MACHINE=alphaev68 ;;
5135+ esac
5136+ objdump --private-headers /bin/sh | grep -q ld.so.1
5137+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
5138+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
5139+ exit ;;
5140+ arm*:Linux:*:*)
5141+ eval $set_cc_for_build
5142+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
5143+ | grep -q __ARM_EABI__
5144+ then
5145+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5146+ else
5147+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
5148+ | grep -q __ARM_PCS_VFP
5149+ then
5150+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
5151+ else
5152+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
5153+ fi
5154+ fi
5155+ exit ;;
5156+ avr32*:Linux:*:*)
5157+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5158+ exit ;;
5159+ cris:Linux:*:*)
5160+ echo ${UNAME_MACHINE}-axis-linux-gnu
5161+ exit ;;
5162+ crisv32:Linux:*:*)
5163+ echo ${UNAME_MACHINE}-axis-linux-gnu
5164+ exit ;;
5165+ frv:Linux:*:*)
5166+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5167+ exit ;;
5168+ hexagon:Linux:*:*)
5169+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5170+ exit ;;
5171+ i*86:Linux:*:*)
5172+ LIBC=gnu
5173+ eval $set_cc_for_build
5174+ sed 's/^ //' << EOF >$dummy.c
5175+ #ifdef __dietlibc__
5176+ LIBC=dietlibc
5177+ #endif
5178+EOF
5179+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
5180+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
5181+ exit ;;
5182+ ia64:Linux:*:*)
5183+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5184+ exit ;;
5185+ m32r*:Linux:*:*)
5186+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5187+ exit ;;
5188+ m68*:Linux:*:*)
5189+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5190+ exit ;;
5191+ mips:Linux:*:* | mips64:Linux:*:*)
5192+ eval $set_cc_for_build
5193+ sed 's/^ //' << EOF >$dummy.c
5194+ #undef CPU
5195+ #undef ${UNAME_MACHINE}
5196+ #undef ${UNAME_MACHINE}el
5197+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
5198+ CPU=${UNAME_MACHINE}el
5199+ #else
5200+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
5201+ CPU=${UNAME_MACHINE}
5202+ #else
5203+ CPU=
5204+ #endif
5205+ #endif
5206+EOF
5207+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
5208+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
5209+ ;;
5210+ or32:Linux:*:*)
5211+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5212+ exit ;;
5213+ padre:Linux:*:*)
5214+ echo sparc-unknown-linux-gnu
5215+ exit ;;
5216+ parisc64:Linux:*:* | hppa64:Linux:*:*)
5217+ echo hppa64-unknown-linux-gnu
5218+ exit ;;
5219+ parisc:Linux:*:* | hppa:Linux:*:*)
5220+ # Look for CPU level
5221+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
5222+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
5223+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
5224+ *) echo hppa-unknown-linux-gnu ;;
5225+ esac
5226+ exit ;;
5227+ ppc64:Linux:*:*)
5228+ echo powerpc64-unknown-linux-gnu
5229+ exit ;;
5230+ ppc:Linux:*:*)
5231+ echo powerpc-unknown-linux-gnu
5232+ exit ;;
5233+ s390:Linux:*:* | s390x:Linux:*:*)
5234+ echo ${UNAME_MACHINE}-ibm-linux
5235+ exit ;;
5236+ sh64*:Linux:*:*)
5237+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5238+ exit ;;
5239+ sh*:Linux:*:*)
5240+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5241+ exit ;;
5242+ sparc:Linux:*:* | sparc64:Linux:*:*)
5243+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5244+ exit ;;
5245+ tile*:Linux:*:*)
5246+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5247+ exit ;;
5248+ vax:Linux:*:*)
5249+ echo ${UNAME_MACHINE}-dec-linux-gnu
5250+ exit ;;
5251+ x86_64:Linux:*:*)
5252+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5253+ exit ;;
5254+ xtensa*:Linux:*:*)
5255+ echo ${UNAME_MACHINE}-unknown-linux-gnu
5256+ exit ;;
5257+ i*86:DYNIX/ptx:4*:*)
5258+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
5259+ # earlier versions are messed up and put the nodename in both
5260+ # sysname and nodename.
5261+ echo i386-sequent-sysv4
5262+ exit ;;
5263+ i*86:UNIX_SV:4.2MP:2.*)
5264+ # Unixware is an offshoot of SVR4, but it has its own version
5265+ # number series starting with 2...
5266+ # I am not positive that other SVR4 systems won't match this,
5267+ # I just have to hope. -- rms.
5268+ # Use sysv4.2uw... so that sysv4* matches it.
5269+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
5270+ exit ;;
5271+ i*86:OS/2:*:*)
5272+ # If we were able to find `uname', then EMX Unix compatibility
5273+ # is probably installed.
5274+ echo ${UNAME_MACHINE}-pc-os2-emx
5275+ exit ;;
5276+ i*86:XTS-300:*:STOP)
5277+ echo ${UNAME_MACHINE}-unknown-stop
5278+ exit ;;
5279+ i*86:atheos:*:*)
5280+ echo ${UNAME_MACHINE}-unknown-atheos
5281+ exit ;;
5282+ i*86:syllable:*:*)
5283+ echo ${UNAME_MACHINE}-pc-syllable
5284+ exit ;;
5285+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
5286+ echo i386-unknown-lynxos${UNAME_RELEASE}
5287+ exit ;;
5288+ i*86:*DOS:*:*)
5289+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
5290+ exit ;;
5291+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
5292+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
5293+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
5294+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
5295+ else
5296+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
5297+ fi
5298+ exit ;;
5299+ i*86:*:5:[678]*)
5300+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
5301+ case `/bin/uname -X | grep "^Machine"` in
5302+ *486*) UNAME_MACHINE=i486 ;;
5303+ *Pentium) UNAME_MACHINE=i586 ;;
5304+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
5305+ esac
5306+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
5307+ exit ;;
5308+ i*86:*:3.2:*)
5309+ if test -f /usr/options/cb.name; then
5310+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
5311+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
5312+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
5313+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
5314+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
5315+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
5316+ && UNAME_MACHINE=i586
5317+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
5318+ && UNAME_MACHINE=i686
5319+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
5320+ && UNAME_MACHINE=i686
5321+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
5322+ else
5323+ echo ${UNAME_MACHINE}-pc-sysv32
5324+ fi
5325+ exit ;;
5326+ pc:*:*:*)
5327+ # Left here for compatibility:
5328+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
5329+ # the processor, so we play safe by assuming i586.
5330+ # Note: whatever this is, it MUST be the same as what config.sub
5331+ # prints for the "djgpp" host, or else GDB configury will decide that
5332+ # this is a cross-build.
5333+ echo i586-pc-msdosdjgpp
5334+ exit ;;
5335+ Intel:Mach:3*:*)
5336+ echo i386-pc-mach3
5337+ exit ;;
5338+ paragon:*:*:*)
5339+ echo i860-intel-osf1
5340+ exit ;;
5341+ i860:*:4.*:*) # i860-SVR4
5342+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
5343+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
5344+ else # Add other i860-SVR4 vendors below as they are discovered.
5345+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
5346+ fi
5347+ exit ;;
5348+ mini*:CTIX:SYS*5:*)
5349+ # "miniframe"
5350+ echo m68010-convergent-sysv
5351+ exit ;;
5352+ mc68k:UNIX:SYSTEM5:3.51m)
5353+ echo m68k-convergent-sysv
5354+ exit ;;
5355+ M680?0:D-NIX:5.3:*)
5356+ echo m68k-diab-dnix
5357+ exit ;;
5358+ M68*:*:R3V[5678]*:*)
5359+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
5360+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
5361+ OS_REL=''
5362+ test -r /etc/.relid \
5363+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
5364+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
5365+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
5366+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
5367+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
5368+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
5369+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
5370+ && { echo i486-ncr-sysv4; exit; } ;;
5371+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
5372+ OS_REL='.3'
5373+ test -r /etc/.relid \
5374+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
5375+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
5376+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
5377+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
5378+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
5379+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
5380+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
5381+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
5382+ echo m68k-unknown-lynxos${UNAME_RELEASE}
5383+ exit ;;
5384+ mc68030:UNIX_System_V:4.*:*)
5385+ echo m68k-atari-sysv4
5386+ exit ;;
5387+ TSUNAMI:LynxOS:2.*:*)
5388+ echo sparc-unknown-lynxos${UNAME_RELEASE}
5389+ exit ;;
5390+ rs6000:LynxOS:2.*:*)
5391+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
5392+ exit ;;
5393+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
5394+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
5395+ exit ;;
5396+ SM[BE]S:UNIX_SV:*:*)
5397+ echo mips-dde-sysv${UNAME_RELEASE}
5398+ exit ;;
5399+ RM*:ReliantUNIX-*:*:*)
5400+ echo mips-sni-sysv4
5401+ exit ;;
5402+ RM*:SINIX-*:*:*)
5403+ echo mips-sni-sysv4
5404+ exit ;;
5405+ *:SINIX-*:*:*)
5406+ if uname -p 2>/dev/null >/dev/null ; then
5407+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
5408+ echo ${UNAME_MACHINE}-sni-sysv4
5409+ else
5410+ echo ns32k-sni-sysv
5411+ fi
5412+ exit ;;
5413+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
5414+ # says <Richard.M.Bartel@ccMail.Census.GOV>
5415+ echo i586-unisys-sysv4
5416+ exit ;;
5417+ *:UNIX_System_V:4*:FTX*)
5418+ # From Gerald Hewes <hewes@openmarket.com>.
5419+ # How about differentiating between stratus architectures? -djm
5420+ echo hppa1.1-stratus-sysv4
5421+ exit ;;
5422+ *:*:*:FTX*)
5423+ # From seanf@swdc.stratus.com.
5424+ echo i860-stratus-sysv4
5425+ exit ;;
5426+ i*86:VOS:*:*)
5427+ # From Paul.Green@stratus.com.
5428+ echo ${UNAME_MACHINE}-stratus-vos
5429+ exit ;;
5430+ *:VOS:*:*)
5431+ # From Paul.Green@stratus.com.
5432+ echo hppa1.1-stratus-vos
5433+ exit ;;
5434+ mc68*:A/UX:*:*)
5435+ echo m68k-apple-aux${UNAME_RELEASE}
5436+ exit ;;
5437+ news*:NEWS-OS:6*:*)
5438+ echo mips-sony-newsos6
5439+ exit ;;
5440+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
5441+ if [ -d /usr/nec ]; then
5442+ echo mips-nec-sysv${UNAME_RELEASE}
5443+ else
5444+ echo mips-unknown-sysv${UNAME_RELEASE}
5445+ fi
5446+ exit ;;
5447+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
5448+ echo powerpc-be-beos
5449+ exit ;;
5450+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
5451+ echo powerpc-apple-beos
5452+ exit ;;
5453+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
5454+ echo i586-pc-beos
5455+ exit ;;
5456+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
5457+ echo i586-pc-haiku
5458+ exit ;;
5459+ SX-4:SUPER-UX:*:*)
5460+ echo sx4-nec-superux${UNAME_RELEASE}
5461+ exit ;;
5462+ SX-5:SUPER-UX:*:*)
5463+ echo sx5-nec-superux${UNAME_RELEASE}
5464+ exit ;;
5465+ SX-6:SUPER-UX:*:*)
5466+ echo sx6-nec-superux${UNAME_RELEASE}
5467+ exit ;;
5468+ SX-7:SUPER-UX:*:*)
5469+ echo sx7-nec-superux${UNAME_RELEASE}
5470+ exit ;;
5471+ SX-8:SUPER-UX:*:*)
5472+ echo sx8-nec-superux${UNAME_RELEASE}
5473+ exit ;;
5474+ SX-8R:SUPER-UX:*:*)
5475+ echo sx8r-nec-superux${UNAME_RELEASE}
5476+ exit ;;
5477+ Power*:Rhapsody:*:*)
5478+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
5479+ exit ;;
5480+ *:Rhapsody:*:*)
5481+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
5482+ exit ;;
5483+ *:Darwin:*:*)
5484+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
5485+ case $UNAME_PROCESSOR in
5486+ i386)
5487+ eval $set_cc_for_build
5488+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
5489+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
5490+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
5491+ grep IS_64BIT_ARCH >/dev/null
5492+ then
5493+ UNAME_PROCESSOR="x86_64"
5494+ fi
5495+ fi ;;
5496+ unknown) UNAME_PROCESSOR=powerpc ;;
5497+ esac
5498+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
5499+ exit ;;
5500+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
5501+ UNAME_PROCESSOR=`uname -p`
5502+ if test "$UNAME_PROCESSOR" = "x86"; then
5503+ UNAME_PROCESSOR=i386
5504+ UNAME_MACHINE=pc
5505+ fi
5506+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
5507+ exit ;;
5508+ *:QNX:*:4*)
5509+ echo i386-pc-qnx
5510+ exit ;;
5511+ NEO-?:NONSTOP_KERNEL:*:*)
5512+ echo neo-tandem-nsk${UNAME_RELEASE}
5513+ exit ;;
5514+ NSE-?:NONSTOP_KERNEL:*:*)
5515+ echo nse-tandem-nsk${UNAME_RELEASE}
5516+ exit ;;
5517+ NSR-?:NONSTOP_KERNEL:*:*)
5518+ echo nsr-tandem-nsk${UNAME_RELEASE}
5519+ exit ;;
5520+ *:NonStop-UX:*:*)
5521+ echo mips-compaq-nonstopux
5522+ exit ;;
5523+ BS2000:POSIX*:*:*)
5524+ echo bs2000-siemens-sysv
5525+ exit ;;
5526+ DS/*:UNIX_System_V:*:*)
5527+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
5528+ exit ;;
5529+ *:Plan9:*:*)
5530+ # "uname -m" is not consistent, so use $cputype instead. 386
5531+ # is converted to i386 for consistency with other x86
5532+ # operating systems.
5533+ if test "$cputype" = "386"; then
5534+ UNAME_MACHINE=i386
5535+ else
5536+ UNAME_MACHINE="$cputype"
5537+ fi
5538+ echo ${UNAME_MACHINE}-unknown-plan9
5539+ exit ;;
5540+ *:TOPS-10:*:*)
5541+ echo pdp10-unknown-tops10
5542+ exit ;;
5543+ *:TENEX:*:*)
5544+ echo pdp10-unknown-tenex
5545+ exit ;;
5546+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
5547+ echo pdp10-dec-tops20
5548+ exit ;;
5549+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
5550+ echo pdp10-xkl-tops20
5551+ exit ;;
5552+ *:TOPS-20:*:*)
5553+ echo pdp10-unknown-tops20
5554+ exit ;;
5555+ *:ITS:*:*)
5556+ echo pdp10-unknown-its
5557+ exit ;;
5558+ SEI:*:*:SEIUX)
5559+ echo mips-sei-seiux${UNAME_RELEASE}
5560+ exit ;;
5561+ *:DragonFly:*:*)
5562+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
5563+ exit ;;
5564+ *:*VMS:*:*)
5565+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
5566+ case "${UNAME_MACHINE}" in
5567+ A*) echo alpha-dec-vms ; exit ;;
5568+ I*) echo ia64-dec-vms ; exit ;;
5569+ V*) echo vax-dec-vms ; exit ;;
5570+ esac ;;
5571+ *:XENIX:*:SysV)
5572+ echo i386-pc-xenix
5573+ exit ;;
5574+ i*86:skyos:*:*)
5575+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
5576+ exit ;;
5577+ i*86:rdos:*:*)
5578+ echo ${UNAME_MACHINE}-pc-rdos
5579+ exit ;;
5580+ i*86:AROS:*:*)
5581+ echo ${UNAME_MACHINE}-pc-aros
5582+ exit ;;
5583+ x86_64:VMkernel:*:*)
5584+ echo ${UNAME_MACHINE}-unknown-esx
5585+ exit ;;
5586+esac
5587+
5588+#echo '(No uname command or uname output not recognized.)' 1>&2
5589+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
5590+
5591+eval $set_cc_for_build
5592+cat >$dummy.c <<EOF
5593+#ifdef _SEQUENT_
5594+# include <sys/types.h>
5595+# include <sys/utsname.h>
5596+#endif
5597+main ()
5598+{
5599+#if defined (sony)
5600+#if defined (MIPSEB)
5601+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
5602+ I don't know.... */
5603+ printf ("mips-sony-bsd\n"); exit (0);
5604+#else
5605+#include <sys/param.h>
5606+ printf ("m68k-sony-newsos%s\n",
5607+#ifdef NEWSOS4
5608+ "4"
5609+#else
5610+ ""
5611+#endif
5612+ ); exit (0);
5613+#endif
5614+#endif
5615+
5616+#if defined (__arm) && defined (__acorn) && defined (__unix)
5617+ printf ("arm-acorn-riscix\n"); exit (0);
5618+#endif
5619+
5620+#if defined (hp300) && !defined (hpux)
5621+ printf ("m68k-hp-bsd\n"); exit (0);
5622+#endif
5623+
5624+#if defined (NeXT)
5625+#if !defined (__ARCHITECTURE__)
5626+#define __ARCHITECTURE__ "m68k"
5627+#endif
5628+ int version;
5629+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
5630+ if (version < 4)
5631+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
5632+ else
5633+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
5634+ exit (0);
5635+#endif
5636+
5637+#if defined (MULTIMAX) || defined (n16)
5638+#if defined (UMAXV)
5639+ printf ("ns32k-encore-sysv\n"); exit (0);
5640+#else
5641+#if defined (CMU)
5642+ printf ("ns32k-encore-mach\n"); exit (0);
5643+#else
5644+ printf ("ns32k-encore-bsd\n"); exit (0);
5645+#endif
5646+#endif
5647+#endif
5648+
5649+#if defined (__386BSD__)
5650+ printf ("i386-pc-bsd\n"); exit (0);
5651+#endif
5652+
5653+#if defined (sequent)
5654+#if defined (i386)
5655+ printf ("i386-sequent-dynix\n"); exit (0);
5656+#endif
5657+#if defined (ns32000)
5658+ printf ("ns32k-sequent-dynix\n"); exit (0);
5659+#endif
5660+#endif
5661+
5662+#if defined (_SEQUENT_)
5663+ struct utsname un;
5664+
5665+ uname(&un);
5666+
5667+ if (strncmp(un.version, "V2", 2) == 0) {
5668+ printf ("i386-sequent-ptx2\n"); exit (0);
5669+ }
5670+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
5671+ printf ("i386-sequent-ptx1\n"); exit (0);
5672+ }
5673+ printf ("i386-sequent-ptx\n"); exit (0);
5674+
5675+#endif
5676+
5677+#if defined (vax)
5678+# if !defined (ultrix)
5679+# include <sys/param.h>
5680+# if defined (BSD)
5681+# if BSD == 43
5682+ printf ("vax-dec-bsd4.3\n"); exit (0);
5683+# else
5684+# if BSD == 199006
5685+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
5686+# else
5687+ printf ("vax-dec-bsd\n"); exit (0);
5688+# endif
5689+# endif
5690+# else
5691+ printf ("vax-dec-bsd\n"); exit (0);
5692+# endif
5693+# else
5694+ printf ("vax-dec-ultrix\n"); exit (0);
5695+# endif
5696+#endif
5697+
5698+#if defined (alliant) && defined (i860)
5699+ printf ("i860-alliant-bsd\n"); exit (0);
5700+#endif
5701+
5702+ exit (1);
5703+}
5704+EOF
5705+
5706+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
5707+ { echo "$SYSTEM_NAME"; exit; }
5708+
5709+# Apollos put the system type in the environment.
5710+
5711+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
5712+
5713+# Convex versions that predate uname can use getsysinfo(1)
5714+
5715+if [ -x /usr/convex/getsysinfo ]
5716+then
5717+ case `getsysinfo -f cpu_type` in
5718+ c1*)
5719+ echo c1-convex-bsd
5720+ exit ;;
5721+ c2*)
5722+ if getsysinfo -f scalar_acc
5723+ then echo c32-convex-bsd
5724+ else echo c2-convex-bsd
5725+ fi
5726+ exit ;;
5727+ c34*)
5728+ echo c34-convex-bsd
5729+ exit ;;
5730+ c38*)
5731+ echo c38-convex-bsd
5732+ exit ;;
5733+ c4*)
5734+ echo c4-convex-bsd
5735+ exit ;;
5736+ esac
5737+fi
5738+
5739+cat >&2 <<EOF
5740+$0: unable to guess system type
5741+
5742+This script, last modified $timestamp, has failed to recognize
5743+the operating system you are using. It is advised that you
5744+download the most up to date version of the config scripts from
5745+
5746+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
5747+and
5748+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
5749+
5750+If the version you run ($0) is already up to date, please
5751+send the following data and any information you think might be
5752+pertinent to <config-patches@gnu.org> in order to provide the needed
5753+information to handle your system.
5754+
5755+config.guess timestamp = $timestamp
5756+
5757+uname -m = `(uname -m) 2>/dev/null || echo unknown`
5758+uname -r = `(uname -r) 2>/dev/null || echo unknown`
5759+uname -s = `(uname -s) 2>/dev/null || echo unknown`
5760+uname -v = `(uname -v) 2>/dev/null || echo unknown`
5761+
5762+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
5763+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
5764+
5765+hostinfo = `(hostinfo) 2>/dev/null`
5766+/bin/universe = `(/bin/universe) 2>/dev/null`
5767+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
5768+/bin/arch = `(/bin/arch) 2>/dev/null`
5769+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
5770+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
5771+
5772+UNAME_MACHINE = ${UNAME_MACHINE}
5773+UNAME_RELEASE = ${UNAME_RELEASE}
5774+UNAME_SYSTEM = ${UNAME_SYSTEM}
5775+UNAME_VERSION = ${UNAME_VERSION}
5776+EOF
5777+
5778+exit 1
5779+
5780+# Local variables:
5781+# eval: (add-hook 'write-file-hooks 'time-stamp)
5782+# time-stamp-start: "timestamp='"
5783+# time-stamp-format: "%:y-%02m-%02d"
5784+# time-stamp-end: "'"
5785+# End:
5786diff --git a/libclamav/libmspack-0.4alpha/config.h.in b/libclamav/libmspack-0.4alpha/config.h.in
5787new file mode 100644
5788index 000000000000..3c763df74f7a
5789--- /dev/null
5790+++ b/libclamav/libmspack-0.4alpha/config.h.in
5791@@ -0,0 +1,113 @@
5792+/* config.h.in. Generated from configure.ac by autoheader. */
5793+
5794+/* Turn debugging mode on? */
5795+#undef DEBUG
5796+
5797+/* Define to 1 if you have the <ctype.h> header file. */
5798+#undef HAVE_CTYPE_H
5799+
5800+/* Define to 1 if you have the <dlfcn.h> header file. */
5801+#undef HAVE_DLFCN_H
5802+
5803+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
5804+#undef HAVE_FSEEKO
5805+
5806+/* Define to 1 if you have the <inttypes.h> header file. */
5807+#undef HAVE_INTTYPES_H
5808+
5809+/* Define to 1 if you have the <limits.h> header file. */
5810+#undef HAVE_LIMITS_H
5811+
5812+/* Define to 1 if you have the <memory.h> header file. */
5813+#undef HAVE_MEMORY_H
5814+
5815+/* Define to 1 if you have the <stdint.h> header file. */
5816+#undef HAVE_STDINT_H
5817+
5818+/* Define to 1 if you have the <stdlib.h> header file. */
5819+#undef HAVE_STDLIB_H
5820+
5821+/* Define to 1 if you have the <strings.h> header file. */
5822+#undef HAVE_STRINGS_H
5823+
5824+/* Define to 1 if you have the <string.h> header file. */
5825+#undef HAVE_STRING_H
5826+
5827+/* Define to 1 if you have the <sys/stat.h> header file. */
5828+#undef HAVE_SYS_STAT_H
5829+
5830+/* Define to 1 if you have the <sys/types.h> header file. */
5831+#undef HAVE_SYS_TYPES_H
5832+
5833+/* Define to 1 if you have the `tolower' function. */
5834+#undef HAVE_TOLOWER
5835+
5836+/* Define to 1 if you have the `towlower' function. */
5837+#undef HAVE_TOWLOWER
5838+
5839+/* Define to 1 if you have the <unistd.h> header file. */
5840+#undef HAVE_UNISTD_H
5841+
5842+/* Define to 1 if you have the <wctype.h> header file. */
5843+#undef HAVE_WCTYPE_H
5844+
5845+/* Define to the sub-directory in which libtool stores uninstalled libraries.
5846+ */
5847+#undef LT_OBJDIR
5848+
5849+/* Name of package */
5850+#undef PACKAGE
5851+
5852+/* Define to the address where bug reports for this package should be sent. */
5853+#undef PACKAGE_BUGREPORT
5854+
5855+/* Define to the full name of this package. */
5856+#undef PACKAGE_NAME
5857+
5858+/* Define to the full name and version of this package. */
5859+#undef PACKAGE_STRING
5860+
5861+/* Define to the one symbol short name of this package. */
5862+#undef PACKAGE_TARNAME
5863+
5864+/* Define to the home page for this package. */
5865+#undef PACKAGE_URL
5866+
5867+/* Define to the version of this package. */
5868+#undef PACKAGE_VERSION
5869+
5870+/* The size of `off_t', as computed by sizeof. */
5871+#undef SIZEOF_OFF_T
5872+
5873+/* Define to 1 if you have the ANSI C header files. */
5874+#undef STDC_HEADERS
5875+
5876+/* Version number of package */
5877+#undef VERSION
5878+
5879+/* Number of bits in a file offset, on hosts where this is settable. */
5880+#undef _FILE_OFFSET_BITS
5881+
5882+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
5883+#undef _LARGEFILE_SOURCE
5884+
5885+/* Define for large files, on AIX-style hosts. */
5886+#undef _LARGE_FILES
5887+
5888+/* Define to empty if `const' does not conform to ANSI C. */
5889+#undef const
5890+
5891+/* Define to `__inline__' or `__inline' if that's what the C compiler
5892+ calls it, or to nothing if 'inline' is not supported under any name. */
5893+#ifndef __cplusplus
5894+#undef inline
5895+#endif
5896+
5897+/* Define to `int' if <sys/types.h> does not define. */
5898+#undef mode_t
5899+
5900+/* Define to `long int' if <sys/types.h> does not define. */
5901+#undef off_t
5902+
5903+/* Define to `unsigned int' if <sys/types.h> does not define. */
5904+#undef size_t
5905diff --git a/libclamav/libmspack-0.4alpha/config.sub b/libclamav/libmspack-0.4alpha/config.sub
5906new file mode 100755
5907index 000000000000..c894da45500c
5908--- /dev/null
5909+++ b/libclamav/libmspack-0.4alpha/config.sub
5910@@ -0,0 +1,1773 @@
5911+#! /bin/sh
5912+# Configuration validation subroutine script.
5913+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
5914+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5915+# 2011, 2012 Free Software Foundation, Inc.
5916+
5917+timestamp='2012-02-10'
5918+
5919+# This file is (in principle) common to ALL GNU software.
5920+# The presence of a machine in this file suggests that SOME GNU software
5921+# can handle that machine. It does not imply ALL GNU software can.
5922+#
5923+# This file is free software; you can redistribute it and/or modify
5924+# it under the terms of the GNU General Public License as published by
5925+# the Free Software Foundation; either version 2 of the License, or
5926+# (at your option) any later version.
5927+#
5928+# This program is distributed in the hope that it will be useful,
5929+# but WITHOUT ANY WARRANTY; without even the implied warranty of
5930+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5931+# GNU General Public License for more details.
5932+#
5933+# You should have received a copy of the GNU General Public License
5934+# along with this program; if not, see <http://www.gnu.org/licenses/>.
5935+#
5936+# As a special exception to the GNU General Public License, if you
5937+# distribute this file as part of a program that contains a
5938+# configuration script generated by Autoconf, you may include it under
5939+# the same distribution terms that you use for the rest of that program.
5940+
5941+
5942+# Please send patches to <config-patches@gnu.org>. Submit a context
5943+# diff and a properly formatted GNU ChangeLog entry.
5944+#
5945+# Configuration subroutine to validate and canonicalize a configuration type.
5946+# Supply the specified configuration type as an argument.
5947+# If it is invalid, we print an error message on stderr and exit with code 1.
5948+# Otherwise, we print the canonical config type on stdout and succeed.
5949+
5950+# You can get the latest version of this script from:
5951+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
5952+
5953+# This file is supposed to be the same for all GNU packages
5954+# and recognize all the CPU types, system types and aliases
5955+# that are meaningful with *any* GNU software.
5956+# Each package is responsible for reporting which valid configurations
5957+# it does not support. The user should be able to distinguish
5958+# a failure to support a valid configuration from a meaningless
5959+# configuration.
5960+
5961+# The goal of this file is to map all the various variations of a given
5962+# machine specification into a single specification in the form:
5963+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5964+# or in some cases, the newer four-part form:
5965+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5966+# It is wrong to echo any other type of specification.
5967+
5968+me=`echo "$0" | sed -e 's,.*/,,'`
5969+
5970+usage="\
5971+Usage: $0 [OPTION] CPU-MFR-OPSYS
5972+ $0 [OPTION] ALIAS
5973+
5974+Canonicalize a configuration name.
5975+
5976+Operation modes:
5977+ -h, --help print this help, then exit
5978+ -t, --time-stamp print date of last modification, then exit
5979+ -v, --version print version number, then exit
5980+
5981+Report bugs and patches to <config-patches@gnu.org>."
5982+
5983+version="\
5984+GNU config.sub ($timestamp)
5985+
5986+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
5987+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
5988+Free Software Foundation, Inc.
5989+
5990+This is free software; see the source for copying conditions. There is NO
5991+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
5992+
5993+help="
5994+Try \`$me --help' for more information."
5995+
5996+# Parse command line
5997+while test $# -gt 0 ; do
5998+ case $1 in
5999+ --time-stamp | --time* | -t )
6000+ echo "$timestamp" ; exit ;;
6001+ --version | -v )
6002+ echo "$version" ; exit ;;
6003+ --help | --h* | -h )
6004+ echo "$usage"; exit ;;
6005+ -- ) # Stop option processing
6006+ shift; break ;;
6007+ - ) # Use stdin as input.
6008+ break ;;
6009+ -* )
6010+ echo "$me: invalid option $1$help"
6011+ exit 1 ;;
6012+
6013+ *local*)
6014+ # First pass through any local machine types.
6015+ echo $1
6016+ exit ;;
6017+
6018+ * )
6019+ break ;;
6020+ esac
6021+done
6022+
6023+case $# in
6024+ 0) echo "$me: missing argument$help" >&2
6025+ exit 1;;
6026+ 1) ;;
6027+ *) echo "$me: too many arguments$help" >&2
6028+ exit 1;;
6029+esac
6030+
6031+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
6032+# Here we must recognize all the valid KERNEL-OS combinations.
6033+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
6034+case $maybe_os in
6035+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
6036+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
6037+ knetbsd*-gnu* | netbsd*-gnu* | \
6038+ kopensolaris*-gnu* | \
6039+ storm-chaos* | os2-emx* | rtmk-nova*)
6040+ os=-$maybe_os
6041+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
6042+ ;;
6043+ android-linux)
6044+ os=-linux-android
6045+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
6046+ ;;
6047+ *)
6048+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
6049+ if [ $basic_machine != $1 ]
6050+ then os=`echo $1 | sed 's/.*-/-/'`
6051+ else os=; fi
6052+ ;;
6053+esac
6054+
6055+### Let's recognize common machines as not being operating systems so
6056+### that things like config.sub decstation-3100 work. We also
6057+### recognize some manufacturers as not being operating systems, so we
6058+### can provide default operating systems below.
6059+case $os in
6060+ -sun*os*)
6061+ # Prevent following clause from handling this invalid input.
6062+ ;;
6063+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
6064+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
6065+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
6066+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
6067+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
6068+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
6069+ -apple | -axis | -knuth | -cray | -microblaze)
6070+ os=
6071+ basic_machine=$1
6072+ ;;
6073+ -bluegene*)
6074+ os=-cnk
6075+ ;;
6076+ -sim | -cisco | -oki | -wec | -winbond)
6077+ os=
6078+ basic_machine=$1
6079+ ;;
6080+ -scout)
6081+ ;;
6082+ -wrs)
6083+ os=-vxworks
6084+ basic_machine=$1
6085+ ;;
6086+ -chorusos*)
6087+ os=-chorusos
6088+ basic_machine=$1
6089+ ;;
6090+ -chorusrdb)
6091+ os=-chorusrdb
6092+ basic_machine=$1
6093+ ;;
6094+ -hiux*)
6095+ os=-hiuxwe2
6096+ ;;
6097+ -sco6)
6098+ os=-sco5v6
6099+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6100+ ;;
6101+ -sco5)
6102+ os=-sco3.2v5
6103+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6104+ ;;
6105+ -sco4)
6106+ os=-sco3.2v4
6107+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6108+ ;;
6109+ -sco3.2.[4-9]*)
6110+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
6111+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6112+ ;;
6113+ -sco3.2v[4-9]*)
6114+ # Don't forget version if it is 3.2v4 or newer.
6115+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6116+ ;;
6117+ -sco5v6*)
6118+ # Don't forget version if it is 3.2v4 or newer.
6119+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6120+ ;;
6121+ -sco*)
6122+ os=-sco3.2v2
6123+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6124+ ;;
6125+ -udk*)
6126+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6127+ ;;
6128+ -isc)
6129+ os=-isc2.2
6130+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6131+ ;;
6132+ -clix*)
6133+ basic_machine=clipper-intergraph
6134+ ;;
6135+ -isc*)
6136+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
6137+ ;;
6138+ -lynx*)
6139+ os=-lynxos
6140+ ;;
6141+ -ptx*)
6142+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
6143+ ;;
6144+ -windowsnt*)
6145+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
6146+ ;;
6147+ -psos*)
6148+ os=-psos
6149+ ;;
6150+ -mint | -mint[0-9]*)
6151+ basic_machine=m68k-atari
6152+ os=-mint
6153+ ;;
6154+esac
6155+
6156+# Decode aliases for certain CPU-COMPANY combinations.
6157+case $basic_machine in
6158+ # Recognize the basic CPU types without company name.
6159+ # Some are omitted here because they have special meanings below.
6160+ 1750a | 580 \
6161+ | a29k \
6162+ | aarch64 | aarch64_be \
6163+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
6164+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
6165+ | am33_2.0 \
6166+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
6167+ | be32 | be64 \
6168+ | bfin \
6169+ | c4x | clipper \
6170+ | d10v | d30v | dlx | dsp16xx \
6171+ | epiphany \
6172+ | fido | fr30 | frv \
6173+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
6174+ | hexagon \
6175+ | i370 | i860 | i960 | ia64 \
6176+ | ip2k | iq2000 \
6177+ | le32 | le64 \
6178+ | lm32 \
6179+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
6180+ | maxq | mb | microblaze | mcore | mep | metag \
6181+ | mips | mipsbe | mipseb | mipsel | mipsle \
6182+ | mips16 \
6183+ | mips64 | mips64el \
6184+ | mips64octeon | mips64octeonel \
6185+ | mips64orion | mips64orionel \
6186+ | mips64r5900 | mips64r5900el \
6187+ | mips64vr | mips64vrel \
6188+ | mips64vr4100 | mips64vr4100el \
6189+ | mips64vr4300 | mips64vr4300el \
6190+ | mips64vr5000 | mips64vr5000el \
6191+ | mips64vr5900 | mips64vr5900el \
6192+ | mipsisa32 | mipsisa32el \
6193+ | mipsisa32r2 | mipsisa32r2el \
6194+ | mipsisa64 | mipsisa64el \
6195+ | mipsisa64r2 | mipsisa64r2el \
6196+ | mipsisa64sb1 | mipsisa64sb1el \
6197+ | mipsisa64sr71k | mipsisa64sr71kel \
6198+ | mipstx39 | mipstx39el \
6199+ | mn10200 | mn10300 \
6200+ | moxie \
6201+ | mt \
6202+ | msp430 \
6203+ | nds32 | nds32le | nds32be \
6204+ | nios | nios2 \
6205+ | ns16k | ns32k \
6206+ | open8 \
6207+ | or32 \
6208+ | pdp10 | pdp11 | pj | pjl \
6209+ | powerpc | powerpc64 | powerpc64le | powerpcle \
6210+ | pyramid \
6211+ | rl78 | rx \
6212+ | score \
6213+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
6214+ | sh64 | sh64le \
6215+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
6216+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
6217+ | spu \
6218+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
6219+ | ubicom32 \
6220+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
6221+ | we32k \
6222+ | x86 | xc16x | xstormy16 | xtensa \
6223+ | z8k | z80)
6224+ basic_machine=$basic_machine-unknown
6225+ ;;
6226+ c54x)
6227+ basic_machine=tic54x-unknown
6228+ ;;
6229+ c55x)
6230+ basic_machine=tic55x-unknown
6231+ ;;
6232+ c6x)
6233+ basic_machine=tic6x-unknown
6234+ ;;
6235+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
6236+ basic_machine=$basic_machine-unknown
6237+ os=-none
6238+ ;;
6239+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
6240+ ;;
6241+ ms1)
6242+ basic_machine=mt-unknown
6243+ ;;
6244+
6245+ strongarm | thumb | xscale)
6246+ basic_machine=arm-unknown
6247+ ;;
6248+ xgate)
6249+ basic_machine=$basic_machine-unknown
6250+ os=-none
6251+ ;;
6252+ xscaleeb)
6253+ basic_machine=armeb-unknown
6254+ ;;
6255+
6256+ xscaleel)
6257+ basic_machine=armel-unknown
6258+ ;;
6259+
6260+ # We use `pc' rather than `unknown'
6261+ # because (1) that's what they normally are, and
6262+ # (2) the word "unknown" tends to confuse beginning users.
6263+ i*86 | x86_64)
6264+ basic_machine=$basic_machine-pc
6265+ ;;
6266+ # Object if more than one company name word.
6267+ *-*-*)
6268+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
6269+ exit 1
6270+ ;;
6271+ # Recognize the basic CPU types with company name.
6272+ 580-* \
6273+ | a29k-* \
6274+ | aarch64-* | aarch64_be-* \
6275+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
6276+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
6277+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
6278+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
6279+ | avr-* | avr32-* \
6280+ | be32-* | be64-* \
6281+ | bfin-* | bs2000-* \
6282+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
6283+ | clipper-* | craynv-* | cydra-* \
6284+ | d10v-* | d30v-* | dlx-* \
6285+ | elxsi-* \
6286+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
6287+ | h8300-* | h8500-* \
6288+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
6289+ | hexagon-* \
6290+ | i*86-* | i860-* | i960-* | ia64-* \
6291+ | ip2k-* | iq2000-* \
6292+ | le32-* | le64-* \
6293+ | lm32-* \
6294+ | m32c-* | m32r-* | m32rle-* \
6295+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
6296+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
6297+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
6298+ | mips16-* \
6299+ | mips64-* | mips64el-* \
6300+ | mips64octeon-* | mips64octeonel-* \
6301+ | mips64orion-* | mips64orionel-* \
6302+ | mips64r5900-* | mips64r5900el-* \
6303+ | mips64vr-* | mips64vrel-* \
6304+ | mips64vr4100-* | mips64vr4100el-* \
6305+ | mips64vr4300-* | mips64vr4300el-* \
6306+ | mips64vr5000-* | mips64vr5000el-* \
6307+ | mips64vr5900-* | mips64vr5900el-* \
6308+ | mipsisa32-* | mipsisa32el-* \
6309+ | mipsisa32r2-* | mipsisa32r2el-* \
6310+ | mipsisa64-* | mipsisa64el-* \
6311+ | mipsisa64r2-* | mipsisa64r2el-* \
6312+ | mipsisa64sb1-* | mipsisa64sb1el-* \
6313+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
6314+ | mipstx39-* | mipstx39el-* \
6315+ | mmix-* \
6316+ | mt-* \
6317+ | msp430-* \
6318+ | nds32-* | nds32le-* | nds32be-* \
6319+ | nios-* | nios2-* \
6320+ | none-* | np1-* | ns16k-* | ns32k-* \
6321+ | open8-* \
6322+ | orion-* \
6323+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
6324+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
6325+ | pyramid-* \
6326+ | rl78-* | romp-* | rs6000-* | rx-* \
6327+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
6328+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
6329+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
6330+ | sparclite-* \
6331+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
6332+ | tahoe-* \
6333+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
6334+ | tile*-* \
6335+ | tron-* \
6336+ | ubicom32-* \
6337+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
6338+ | vax-* \
6339+ | we32k-* \
6340+ | x86-* | x86_64-* | xc16x-* | xps100-* \
6341+ | xstormy16-* | xtensa*-* \
6342+ | ymp-* \
6343+ | z8k-* | z80-*)
6344+ ;;
6345+ # Recognize the basic CPU types without company name, with glob match.
6346+ xtensa*)
6347+ basic_machine=$basic_machine-unknown
6348+ ;;
6349+ # Recognize the various machine names and aliases which stand
6350+ # for a CPU type and a company and sometimes even an OS.
6351+ 386bsd)
6352+ basic_machine=i386-unknown
6353+ os=-bsd
6354+ ;;
6355+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
6356+ basic_machine=m68000-att
6357+ ;;
6358+ 3b*)
6359+ basic_machine=we32k-att
6360+ ;;
6361+ a29khif)
6362+ basic_machine=a29k-amd
6363+ os=-udi
6364+ ;;
6365+ abacus)
6366+ basic_machine=abacus-unknown
6367+ ;;
6368+ adobe68k)
6369+ basic_machine=m68010-adobe
6370+ os=-scout
6371+ ;;
6372+ alliant | fx80)
6373+ basic_machine=fx80-alliant
6374+ ;;
6375+ altos | altos3068)
6376+ basic_machine=m68k-altos
6377+ ;;
6378+ am29k)
6379+ basic_machine=a29k-none
6380+ os=-bsd
6381+ ;;
6382+ amd64)
6383+ basic_machine=x86_64-pc
6384+ ;;
6385+ amd64-*)
6386+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
6387+ ;;
6388+ amdahl)
6389+ basic_machine=580-amdahl
6390+ os=-sysv
6391+ ;;
6392+ amiga | amiga-*)
6393+ basic_machine=m68k-unknown
6394+ ;;
6395+ amigaos | amigados)
6396+ basic_machine=m68k-unknown
6397+ os=-amigaos
6398+ ;;
6399+ amigaunix | amix)
6400+ basic_machine=m68k-unknown
6401+ os=-sysv4
6402+ ;;
6403+ apollo68)
6404+ basic_machine=m68k-apollo
6405+ os=-sysv
6406+ ;;
6407+ apollo68bsd)
6408+ basic_machine=m68k-apollo
6409+ os=-bsd
6410+ ;;
6411+ aros)
6412+ basic_machine=i386-pc
6413+ os=-aros
6414+ ;;
6415+ aux)
6416+ basic_machine=m68k-apple
6417+ os=-aux
6418+ ;;
6419+ balance)
6420+ basic_machine=ns32k-sequent
6421+ os=-dynix
6422+ ;;
6423+ blackfin)
6424+ basic_machine=bfin-unknown
6425+ os=-linux
6426+ ;;
6427+ blackfin-*)
6428+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
6429+ os=-linux
6430+ ;;
6431+ bluegene*)
6432+ basic_machine=powerpc-ibm
6433+ os=-cnk
6434+ ;;
6435+ c54x-*)
6436+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
6437+ ;;
6438+ c55x-*)
6439+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
6440+ ;;
6441+ c6x-*)
6442+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
6443+ ;;
6444+ c90)
6445+ basic_machine=c90-cray
6446+ os=-unicos
6447+ ;;
6448+ cegcc)
6449+ basic_machine=arm-unknown
6450+ os=-cegcc
6451+ ;;
6452+ convex-c1)
6453+ basic_machine=c1-convex
6454+ os=-bsd
6455+ ;;
6456+ convex-c2)
6457+ basic_machine=c2-convex
6458+ os=-bsd
6459+ ;;
6460+ convex-c32)
6461+ basic_machine=c32-convex
6462+ os=-bsd
6463+ ;;
6464+ convex-c34)
6465+ basic_machine=c34-convex
6466+ os=-bsd
6467+ ;;
6468+ convex-c38)
6469+ basic_machine=c38-convex
6470+ os=-bsd
6471+ ;;
6472+ cray | j90)
6473+ basic_machine=j90-cray
6474+ os=-unicos
6475+ ;;
6476+ craynv)
6477+ basic_machine=craynv-cray
6478+ os=-unicosmp
6479+ ;;
6480+ cr16 | cr16-*)
6481+ basic_machine=cr16-unknown
6482+ os=-elf
6483+ ;;
6484+ crds | unos)
6485+ basic_machine=m68k-crds
6486+ ;;
6487+ crisv32 | crisv32-* | etraxfs*)
6488+ basic_machine=crisv32-axis
6489+ ;;
6490+ cris | cris-* | etrax*)
6491+ basic_machine=cris-axis
6492+ ;;
6493+ crx)
6494+ basic_machine=crx-unknown
6495+ os=-elf
6496+ ;;
6497+ da30 | da30-*)
6498+ basic_machine=m68k-da30
6499+ ;;
6500+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
6501+ basic_machine=mips-dec
6502+ ;;
6503+ decsystem10* | dec10*)
6504+ basic_machine=pdp10-dec
6505+ os=-tops10
6506+ ;;
6507+ decsystem20* | dec20*)
6508+ basic_machine=pdp10-dec
6509+ os=-tops20
6510+ ;;
6511+ delta | 3300 | motorola-3300 | motorola-delta \
6512+ | 3300-motorola | delta-motorola)
6513+ basic_machine=m68k-motorola
6514+ ;;
6515+ delta88)
6516+ basic_machine=m88k-motorola
6517+ os=-sysv3
6518+ ;;
6519+ dicos)
6520+ basic_machine=i686-pc
6521+ os=-dicos
6522+ ;;
6523+ djgpp)
6524+ basic_machine=i586-pc
6525+ os=-msdosdjgpp
6526+ ;;
6527+ dpx20 | dpx20-*)
6528+ basic_machine=rs6000-bull
6529+ os=-bosx
6530+ ;;
6531+ dpx2* | dpx2*-bull)
6532+ basic_machine=m68k-bull
6533+ os=-sysv3
6534+ ;;
6535+ ebmon29k)
6536+ basic_machine=a29k-amd
6537+ os=-ebmon
6538+ ;;
6539+ elxsi)
6540+ basic_machine=elxsi-elxsi
6541+ os=-bsd
6542+ ;;
6543+ encore | umax | mmax)
6544+ basic_machine=ns32k-encore
6545+ ;;
6546+ es1800 | OSE68k | ose68k | ose | OSE)
6547+ basic_machine=m68k-ericsson
6548+ os=-ose
6549+ ;;
6550+ fx2800)
6551+ basic_machine=i860-alliant
6552+ ;;
6553+ genix)
6554+ basic_machine=ns32k-ns
6555+ ;;
6556+ gmicro)
6557+ basic_machine=tron-gmicro
6558+ os=-sysv
6559+ ;;
6560+ go32)
6561+ basic_machine=i386-pc
6562+ os=-go32
6563+ ;;
6564+ h3050r* | hiux*)
6565+ basic_machine=hppa1.1-hitachi
6566+ os=-hiuxwe2
6567+ ;;
6568+ h8300hms)
6569+ basic_machine=h8300-hitachi
6570+ os=-hms
6571+ ;;
6572+ h8300xray)
6573+ basic_machine=h8300-hitachi
6574+ os=-xray
6575+ ;;
6576+ h8500hms)
6577+ basic_machine=h8500-hitachi
6578+ os=-hms
6579+ ;;
6580+ harris)
6581+ basic_machine=m88k-harris
6582+ os=-sysv3
6583+ ;;
6584+ hp300-*)
6585+ basic_machine=m68k-hp
6586+ ;;
6587+ hp300bsd)
6588+ basic_machine=m68k-hp
6589+ os=-bsd
6590+ ;;
6591+ hp300hpux)
6592+ basic_machine=m68k-hp
6593+ os=-hpux
6594+ ;;
6595+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
6596+ basic_machine=hppa1.0-hp
6597+ ;;
6598+ hp9k2[0-9][0-9] | hp9k31[0-9])
6599+ basic_machine=m68000-hp
6600+ ;;
6601+ hp9k3[2-9][0-9])
6602+ basic_machine=m68k-hp
6603+ ;;
6604+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
6605+ basic_machine=hppa1.0-hp
6606+ ;;
6607+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
6608+ basic_machine=hppa1.1-hp
6609+ ;;
6610+ hp9k78[0-9] | hp78[0-9])
6611+ # FIXME: really hppa2.0-hp
6612+ basic_machine=hppa1.1-hp
6613+ ;;
6614+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
6615+ # FIXME: really hppa2.0-hp
6616+ basic_machine=hppa1.1-hp
6617+ ;;
6618+ hp9k8[0-9][13679] | hp8[0-9][13679])
6619+ basic_machine=hppa1.1-hp
6620+ ;;
6621+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
6622+ basic_machine=hppa1.0-hp
6623+ ;;
6624+ hppa-next)
6625+ os=-nextstep3
6626+ ;;
6627+ hppaosf)
6628+ basic_machine=hppa1.1-hp
6629+ os=-osf
6630+ ;;
6631+ hppro)
6632+ basic_machine=hppa1.1-hp
6633+ os=-proelf
6634+ ;;
6635+ i370-ibm* | ibm*)
6636+ basic_machine=i370-ibm
6637+ ;;
6638+ i*86v32)
6639+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6640+ os=-sysv32
6641+ ;;
6642+ i*86v4*)
6643+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6644+ os=-sysv4
6645+ ;;
6646+ i*86v)
6647+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6648+ os=-sysv
6649+ ;;
6650+ i*86sol2)
6651+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6652+ os=-solaris2
6653+ ;;
6654+ i386mach)
6655+ basic_machine=i386-mach
6656+ os=-mach
6657+ ;;
6658+ i386-vsta | vsta)
6659+ basic_machine=i386-unknown
6660+ os=-vsta
6661+ ;;
6662+ iris | iris4d)
6663+ basic_machine=mips-sgi
6664+ case $os in
6665+ -irix*)
6666+ ;;
6667+ *)
6668+ os=-irix4
6669+ ;;
6670+ esac
6671+ ;;
6672+ isi68 | isi)
6673+ basic_machine=m68k-isi
6674+ os=-sysv
6675+ ;;
6676+ m68knommu)
6677+ basic_machine=m68k-unknown
6678+ os=-linux
6679+ ;;
6680+ m68knommu-*)
6681+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
6682+ os=-linux
6683+ ;;
6684+ m88k-omron*)
6685+ basic_machine=m88k-omron
6686+ ;;
6687+ magnum | m3230)
6688+ basic_machine=mips-mips
6689+ os=-sysv
6690+ ;;
6691+ merlin)
6692+ basic_machine=ns32k-utek
6693+ os=-sysv
6694+ ;;
6695+ microblaze)
6696+ basic_machine=microblaze-xilinx
6697+ ;;
6698+ mingw32)
6699+ basic_machine=i386-pc
6700+ os=-mingw32
6701+ ;;
6702+ mingw32ce)
6703+ basic_machine=arm-unknown
6704+ os=-mingw32ce
6705+ ;;
6706+ miniframe)
6707+ basic_machine=m68000-convergent
6708+ ;;
6709+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
6710+ basic_machine=m68k-atari
6711+ os=-mint
6712+ ;;
6713+ mips3*-*)
6714+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
6715+ ;;
6716+ mips3*)
6717+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
6718+ ;;
6719+ monitor)
6720+ basic_machine=m68k-rom68k
6721+ os=-coff
6722+ ;;
6723+ morphos)
6724+ basic_machine=powerpc-unknown
6725+ os=-morphos
6726+ ;;
6727+ msdos)
6728+ basic_machine=i386-pc
6729+ os=-msdos
6730+ ;;
6731+ ms1-*)
6732+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
6733+ ;;
6734+ msys)
6735+ basic_machine=i386-pc
6736+ os=-msys
6737+ ;;
6738+ mvs)
6739+ basic_machine=i370-ibm
6740+ os=-mvs
6741+ ;;
6742+ nacl)
6743+ basic_machine=le32-unknown
6744+ os=-nacl
6745+ ;;
6746+ ncr3000)
6747+ basic_machine=i486-ncr
6748+ os=-sysv4
6749+ ;;
6750+ netbsd386)
6751+ basic_machine=i386-unknown
6752+ os=-netbsd
6753+ ;;
6754+ netwinder)
6755+ basic_machine=armv4l-rebel
6756+ os=-linux
6757+ ;;
6758+ news | news700 | news800 | news900)
6759+ basic_machine=m68k-sony
6760+ os=-newsos
6761+ ;;
6762+ news1000)
6763+ basic_machine=m68030-sony
6764+ os=-newsos
6765+ ;;
6766+ news-3600 | risc-news)
6767+ basic_machine=mips-sony
6768+ os=-newsos
6769+ ;;
6770+ necv70)
6771+ basic_machine=v70-nec
6772+ os=-sysv
6773+ ;;
6774+ next | m*-next )
6775+ basic_machine=m68k-next
6776+ case $os in
6777+ -nextstep* )
6778+ ;;
6779+ -ns2*)
6780+ os=-nextstep2
6781+ ;;
6782+ *)
6783+ os=-nextstep3
6784+ ;;
6785+ esac
6786+ ;;
6787+ nh3000)
6788+ basic_machine=m68k-harris
6789+ os=-cxux
6790+ ;;
6791+ nh[45]000)
6792+ basic_machine=m88k-harris
6793+ os=-cxux
6794+ ;;
6795+ nindy960)
6796+ basic_machine=i960-intel
6797+ os=-nindy
6798+ ;;
6799+ mon960)
6800+ basic_machine=i960-intel
6801+ os=-mon960
6802+ ;;
6803+ nonstopux)
6804+ basic_machine=mips-compaq
6805+ os=-nonstopux
6806+ ;;
6807+ np1)
6808+ basic_machine=np1-gould
6809+ ;;
6810+ neo-tandem)
6811+ basic_machine=neo-tandem
6812+ ;;
6813+ nse-tandem)
6814+ basic_machine=nse-tandem
6815+ ;;
6816+ nsr-tandem)
6817+ basic_machine=nsr-tandem
6818+ ;;
6819+ op50n-* | op60c-*)
6820+ basic_machine=hppa1.1-oki
6821+ os=-proelf
6822+ ;;
6823+ openrisc | openrisc-*)
6824+ basic_machine=or32-unknown
6825+ ;;
6826+ os400)
6827+ basic_machine=powerpc-ibm
6828+ os=-os400
6829+ ;;
6830+ OSE68000 | ose68000)
6831+ basic_machine=m68000-ericsson
6832+ os=-ose
6833+ ;;
6834+ os68k)
6835+ basic_machine=m68k-none
6836+ os=-os68k
6837+ ;;
6838+ pa-hitachi)
6839+ basic_machine=hppa1.1-hitachi
6840+ os=-hiuxwe2
6841+ ;;
6842+ paragon)
6843+ basic_machine=i860-intel
6844+ os=-osf
6845+ ;;
6846+ parisc)
6847+ basic_machine=hppa-unknown
6848+ os=-linux
6849+ ;;
6850+ parisc-*)
6851+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
6852+ os=-linux
6853+ ;;
6854+ pbd)
6855+ basic_machine=sparc-tti
6856+ ;;
6857+ pbb)
6858+ basic_machine=m68k-tti
6859+ ;;
6860+ pc532 | pc532-*)
6861+ basic_machine=ns32k-pc532
6862+ ;;
6863+ pc98)
6864+ basic_machine=i386-pc
6865+ ;;
6866+ pc98-*)
6867+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
6868+ ;;
6869+ pentium | p5 | k5 | k6 | nexgen | viac3)
6870+ basic_machine=i586-pc
6871+ ;;
6872+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
6873+ basic_machine=i686-pc
6874+ ;;
6875+ pentiumii | pentium2 | pentiumiii | pentium3)
6876+ basic_machine=i686-pc
6877+ ;;
6878+ pentium4)
6879+ basic_machine=i786-pc
6880+ ;;
6881+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
6882+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
6883+ ;;
6884+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
6885+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
6886+ ;;
6887+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
6888+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
6889+ ;;
6890+ pentium4-*)
6891+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
6892+ ;;
6893+ pn)
6894+ basic_machine=pn-gould
6895+ ;;
6896+ power) basic_machine=power-ibm
6897+ ;;
6898+ ppc | ppcbe) basic_machine=powerpc-unknown
6899+ ;;
6900+ ppc-* | ppcbe-*)
6901+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
6902+ ;;
6903+ ppcle | powerpclittle | ppc-le | powerpc-little)
6904+ basic_machine=powerpcle-unknown
6905+ ;;
6906+ ppcle-* | powerpclittle-*)
6907+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
6908+ ;;
6909+ ppc64) basic_machine=powerpc64-unknown
6910+ ;;
6911+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
6912+ ;;
6913+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
6914+ basic_machine=powerpc64le-unknown
6915+ ;;
6916+ ppc64le-* | powerpc64little-*)
6917+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
6918+ ;;
6919+ ps2)
6920+ basic_machine=i386-ibm
6921+ ;;
6922+ pw32)
6923+ basic_machine=i586-unknown
6924+ os=-pw32
6925+ ;;
6926+ rdos)
6927+ basic_machine=i386-pc
6928+ os=-rdos
6929+ ;;
6930+ rom68k)
6931+ basic_machine=m68k-rom68k
6932+ os=-coff
6933+ ;;
6934+ rm[46]00)
6935+ basic_machine=mips-siemens
6936+ ;;
6937+ rtpc | rtpc-*)
6938+ basic_machine=romp-ibm
6939+ ;;
6940+ s390 | s390-*)
6941+ basic_machine=s390-ibm
6942+ ;;
6943+ s390x | s390x-*)
6944+ basic_machine=s390x-ibm
6945+ ;;
6946+ sa29200)
6947+ basic_machine=a29k-amd
6948+ os=-udi
6949+ ;;
6950+ sb1)
6951+ basic_machine=mipsisa64sb1-unknown
6952+ ;;
6953+ sb1el)
6954+ basic_machine=mipsisa64sb1el-unknown
6955+ ;;
6956+ sde)
6957+ basic_machine=mipsisa32-sde
6958+ os=-elf
6959+ ;;
6960+ sei)
6961+ basic_machine=mips-sei
6962+ os=-seiux
6963+ ;;
6964+ sequent)
6965+ basic_machine=i386-sequent
6966+ ;;
6967+ sh)
6968+ basic_machine=sh-hitachi
6969+ os=-hms
6970+ ;;
6971+ sh5el)
6972+ basic_machine=sh5le-unknown
6973+ ;;
6974+ sh64)
6975+ basic_machine=sh64-unknown
6976+ ;;
6977+ sparclite-wrs | simso-wrs)
6978+ basic_machine=sparclite-wrs
6979+ os=-vxworks
6980+ ;;
6981+ sps7)
6982+ basic_machine=m68k-bull
6983+ os=-sysv2
6984+ ;;
6985+ spur)
6986+ basic_machine=spur-unknown
6987+ ;;
6988+ st2000)
6989+ basic_machine=m68k-tandem
6990+ ;;
6991+ stratus)
6992+ basic_machine=i860-stratus
6993+ os=-sysv4
6994+ ;;
6995+ strongarm-* | thumb-*)
6996+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
6997+ ;;
6998+ sun2)
6999+ basic_machine=m68000-sun
7000+ ;;
7001+ sun2os3)
7002+ basic_machine=m68000-sun
7003+ os=-sunos3
7004+ ;;
7005+ sun2os4)
7006+ basic_machine=m68000-sun
7007+ os=-sunos4
7008+ ;;
7009+ sun3os3)
7010+ basic_machine=m68k-sun
7011+ os=-sunos3
7012+ ;;
7013+ sun3os4)
7014+ basic_machine=m68k-sun
7015+ os=-sunos4
7016+ ;;
7017+ sun4os3)
7018+ basic_machine=sparc-sun
7019+ os=-sunos3
7020+ ;;
7021+ sun4os4)
7022+ basic_machine=sparc-sun
7023+ os=-sunos4
7024+ ;;
7025+ sun4sol2)
7026+ basic_machine=sparc-sun
7027+ os=-solaris2
7028+ ;;
7029+ sun3 | sun3-*)
7030+ basic_machine=m68k-sun
7031+ ;;
7032+ sun4)
7033+ basic_machine=sparc-sun
7034+ ;;
7035+ sun386 | sun386i | roadrunner)
7036+ basic_machine=i386-sun
7037+ ;;
7038+ sv1)
7039+ basic_machine=sv1-cray
7040+ os=-unicos
7041+ ;;
7042+ symmetry)
7043+ basic_machine=i386-sequent
7044+ os=-dynix
7045+ ;;
7046+ t3e)
7047+ basic_machine=alphaev5-cray
7048+ os=-unicos
7049+ ;;
7050+ t90)
7051+ basic_machine=t90-cray
7052+ os=-unicos
7053+ ;;
7054+ tile*)
7055+ basic_machine=$basic_machine-unknown
7056+ os=-linux-gnu
7057+ ;;
7058+ tx39)
7059+ basic_machine=mipstx39-unknown
7060+ ;;
7061+ tx39el)
7062+ basic_machine=mipstx39el-unknown
7063+ ;;
7064+ toad1)
7065+ basic_machine=pdp10-xkl
7066+ os=-tops20
7067+ ;;
7068+ tower | tower-32)
7069+ basic_machine=m68k-ncr
7070+ ;;
7071+ tpf)
7072+ basic_machine=s390x-ibm
7073+ os=-tpf
7074+ ;;
7075+ udi29k)
7076+ basic_machine=a29k-amd
7077+ os=-udi
7078+ ;;
7079+ ultra3)
7080+ basic_machine=a29k-nyu
7081+ os=-sym1
7082+ ;;
7083+ v810 | necv810)
7084+ basic_machine=v810-nec
7085+ os=-none
7086+ ;;
7087+ vaxv)
7088+ basic_machine=vax-dec
7089+ os=-sysv
7090+ ;;
7091+ vms)
7092+ basic_machine=vax-dec
7093+ os=-vms
7094+ ;;
7095+ vpp*|vx|vx-*)
7096+ basic_machine=f301-fujitsu
7097+ ;;
7098+ vxworks960)
7099+ basic_machine=i960-wrs
7100+ os=-vxworks
7101+ ;;
7102+ vxworks68)
7103+ basic_machine=m68k-wrs
7104+ os=-vxworks
7105+ ;;
7106+ vxworks29k)
7107+ basic_machine=a29k-wrs
7108+ os=-vxworks
7109+ ;;
7110+ w65*)
7111+ basic_machine=w65-wdc
7112+ os=-none
7113+ ;;
7114+ w89k-*)
7115+ basic_machine=hppa1.1-winbond
7116+ os=-proelf
7117+ ;;
7118+ xbox)
7119+ basic_machine=i686-pc
7120+ os=-mingw32
7121+ ;;
7122+ xps | xps100)
7123+ basic_machine=xps100-honeywell
7124+ ;;
7125+ xscale-* | xscalee[bl]-*)
7126+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
7127+ ;;
7128+ ymp)
7129+ basic_machine=ymp-cray
7130+ os=-unicos
7131+ ;;
7132+ z8k-*-coff)
7133+ basic_machine=z8k-unknown
7134+ os=-sim
7135+ ;;
7136+ z80-*-coff)
7137+ basic_machine=z80-unknown
7138+ os=-sim
7139+ ;;
7140+ none)
7141+ basic_machine=none-none
7142+ os=-none
7143+ ;;
7144+
7145+# Here we handle the default manufacturer of certain CPU types. It is in
7146+# some cases the only manufacturer, in others, it is the most popular.
7147+ w89k)
7148+ basic_machine=hppa1.1-winbond
7149+ ;;
7150+ op50n)
7151+ basic_machine=hppa1.1-oki
7152+ ;;
7153+ op60c)
7154+ basic_machine=hppa1.1-oki
7155+ ;;
7156+ romp)
7157+ basic_machine=romp-ibm
7158+ ;;
7159+ mmix)
7160+ basic_machine=mmix-knuth
7161+ ;;
7162+ rs6000)
7163+ basic_machine=rs6000-ibm
7164+ ;;
7165+ vax)
7166+ basic_machine=vax-dec
7167+ ;;
7168+ pdp10)
7169+ # there are many clones, so DEC is not a safe bet
7170+ basic_machine=pdp10-unknown
7171+ ;;
7172+ pdp11)
7173+ basic_machine=pdp11-dec
7174+ ;;
7175+ we32k)
7176+ basic_machine=we32k-att
7177+ ;;
7178+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
7179+ basic_machine=sh-unknown
7180+ ;;
7181+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
7182+ basic_machine=sparc-sun
7183+ ;;
7184+ cydra)
7185+ basic_machine=cydra-cydrome
7186+ ;;
7187+ orion)
7188+ basic_machine=orion-highlevel
7189+ ;;
7190+ orion105)
7191+ basic_machine=clipper-highlevel
7192+ ;;
7193+ mac | mpw | mac-mpw)
7194+ basic_machine=m68k-apple
7195+ ;;
7196+ pmac | pmac-mpw)
7197+ basic_machine=powerpc-apple
7198+ ;;
7199+ *-unknown)
7200+ # Make sure to match an already-canonicalized machine name.
7201+ ;;
7202+ *)
7203+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
7204+ exit 1
7205+ ;;
7206+esac
7207+
7208+# Here we canonicalize certain aliases for manufacturers.
7209+case $basic_machine in
7210+ *-digital*)
7211+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
7212+ ;;
7213+ *-commodore*)
7214+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
7215+ ;;
7216+ *)
7217+ ;;
7218+esac
7219+
7220+# Decode manufacturer-specific aliases for certain operating systems.
7221+
7222+if [ x"$os" != x"" ]
7223+then
7224+case $os in
7225+ # First match some system type aliases
7226+ # that might get confused with valid system types.
7227+ # -solaris* is a basic system type, with this one exception.
7228+ -auroraux)
7229+ os=-auroraux
7230+ ;;
7231+ -solaris1 | -solaris1.*)
7232+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
7233+ ;;
7234+ -solaris)
7235+ os=-solaris2
7236+ ;;
7237+ -svr4*)
7238+ os=-sysv4
7239+ ;;
7240+ -unixware*)
7241+ os=-sysv4.2uw
7242+ ;;
7243+ -gnu/linux*)
7244+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
7245+ ;;
7246+ # First accept the basic system types.
7247+ # The portable systems comes first.
7248+ # Each alternative MUST END IN A *, to match a version number.
7249+ # -sysv* is not here because it comes later, after sysvr4.
7250+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
7251+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
7252+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
7253+ | -sym* | -kopensolaris* \
7254+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
7255+ | -aos* | -aros* \
7256+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
7257+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
7258+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
7259+ | -openbsd* | -solidbsd* \
7260+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
7261+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
7262+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
7263+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
7264+ | -chorusos* | -chorusrdb* | -cegcc* \
7265+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
7266+ | -mingw32* | -linux-gnu* | -linux-android* \
7267+ | -linux-newlib* | -linux-uclibc* \
7268+ | -uxpv* | -beos* | -mpeix* | -udk* \
7269+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
7270+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
7271+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
7272+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
7273+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
7274+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
7275+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
7276+ # Remember, each alternative MUST END IN *, to match a version number.
7277+ ;;
7278+ -qnx*)
7279+ case $basic_machine in
7280+ x86-* | i*86-*)
7281+ ;;
7282+ *)
7283+ os=-nto$os
7284+ ;;
7285+ esac
7286+ ;;
7287+ -nto-qnx*)
7288+ ;;
7289+ -nto*)
7290+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
7291+ ;;
7292+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
7293+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
7294+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
7295+ ;;
7296+ -mac*)
7297+ os=`echo $os | sed -e 's|mac|macos|'`
7298+ ;;
7299+ -linux-dietlibc)
7300+ os=-linux-dietlibc
7301+ ;;
7302+ -linux*)
7303+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
7304+ ;;
7305+ -sunos5*)
7306+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
7307+ ;;
7308+ -sunos6*)
7309+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
7310+ ;;
7311+ -opened*)
7312+ os=-openedition
7313+ ;;
7314+ -os400*)
7315+ os=-os400
7316+ ;;
7317+ -wince*)
7318+ os=-wince
7319+ ;;
7320+ -osfrose*)
7321+ os=-osfrose
7322+ ;;
7323+ -osf*)
7324+ os=-osf
7325+ ;;
7326+ -utek*)
7327+ os=-bsd
7328+ ;;
7329+ -dynix*)
7330+ os=-bsd
7331+ ;;
7332+ -acis*)
7333+ os=-aos
7334+ ;;
7335+ -atheos*)
7336+ os=-atheos
7337+ ;;
7338+ -syllable*)
7339+ os=-syllable
7340+ ;;
7341+ -386bsd)
7342+ os=-bsd
7343+ ;;
7344+ -ctix* | -uts*)
7345+ os=-sysv
7346+ ;;
7347+ -nova*)
7348+ os=-rtmk-nova
7349+ ;;
7350+ -ns2 )
7351+ os=-nextstep2
7352+ ;;
7353+ -nsk*)
7354+ os=-nsk
7355+ ;;
7356+ # Preserve the version number of sinix5.
7357+ -sinix5.*)
7358+ os=`echo $os | sed -e 's|sinix|sysv|'`
7359+ ;;
7360+ -sinix*)
7361+ os=-sysv4
7362+ ;;
7363+ -tpf*)
7364+ os=-tpf
7365+ ;;
7366+ -triton*)
7367+ os=-sysv3
7368+ ;;
7369+ -oss*)
7370+ os=-sysv3
7371+ ;;
7372+ -svr4)
7373+ os=-sysv4
7374+ ;;
7375+ -svr3)
7376+ os=-sysv3
7377+ ;;
7378+ -sysvr4)
7379+ os=-sysv4
7380+ ;;
7381+ # This must come after -sysvr4.
7382+ -sysv*)
7383+ ;;
7384+ -ose*)
7385+ os=-ose
7386+ ;;
7387+ -es1800*)
7388+ os=-ose
7389+ ;;
7390+ -xenix)
7391+ os=-xenix
7392+ ;;
7393+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
7394+ os=-mint
7395+ ;;
7396+ -aros*)
7397+ os=-aros
7398+ ;;
7399+ -kaos*)
7400+ os=-kaos
7401+ ;;
7402+ -zvmoe)
7403+ os=-zvmoe
7404+ ;;
7405+ -dicos*)
7406+ os=-dicos
7407+ ;;
7408+ -nacl*)
7409+ ;;
7410+ -none)
7411+ ;;
7412+ *)
7413+ # Get rid of the `-' at the beginning of $os.
7414+ os=`echo $os | sed 's/[^-]*-//'`
7415+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
7416+ exit 1
7417+ ;;
7418+esac
7419+else
7420+
7421+# Here we handle the default operating systems that come with various machines.
7422+# The value should be what the vendor currently ships out the door with their
7423+# machine or put another way, the most popular os provided with the machine.
7424+
7425+# Note that if you're going to try to match "-MANUFACTURER" here (say,
7426+# "-sun"), then you have to tell the case statement up towards the top
7427+# that MANUFACTURER isn't an operating system. Otherwise, code above
7428+# will signal an error saying that MANUFACTURER isn't an operating
7429+# system, and we'll never get to this point.
7430+
7431+case $basic_machine in
7432+ score-*)
7433+ os=-elf
7434+ ;;
7435+ spu-*)
7436+ os=-elf
7437+ ;;
7438+ *-acorn)
7439+ os=-riscix1.2
7440+ ;;
7441+ arm*-rebel)
7442+ os=-linux
7443+ ;;
7444+ arm*-semi)
7445+ os=-aout
7446+ ;;
7447+ c4x-* | tic4x-*)
7448+ os=-coff
7449+ ;;
7450+ tic54x-*)
7451+ os=-coff
7452+ ;;
7453+ tic55x-*)
7454+ os=-coff
7455+ ;;
7456+ tic6x-*)
7457+ os=-coff
7458+ ;;
7459+ # This must come before the *-dec entry.
7460+ pdp10-*)
7461+ os=-tops20
7462+ ;;
7463+ pdp11-*)
7464+ os=-none
7465+ ;;
7466+ *-dec | vax-*)
7467+ os=-ultrix4.2
7468+ ;;
7469+ m68*-apollo)
7470+ os=-domain
7471+ ;;
7472+ i386-sun)
7473+ os=-sunos4.0.2
7474+ ;;
7475+ m68000-sun)
7476+ os=-sunos3
7477+ ;;
7478+ m68*-cisco)
7479+ os=-aout
7480+ ;;
7481+ mep-*)
7482+ os=-elf
7483+ ;;
7484+ mips*-cisco)
7485+ os=-elf
7486+ ;;
7487+ mips*-*)
7488+ os=-elf
7489+ ;;
7490+ or32-*)
7491+ os=-coff
7492+ ;;
7493+ *-tti) # must be before sparc entry or we get the wrong os.
7494+ os=-sysv3
7495+ ;;
7496+ sparc-* | *-sun)
7497+ os=-sunos4.1.1
7498+ ;;
7499+ *-be)
7500+ os=-beos
7501+ ;;
7502+ *-haiku)
7503+ os=-haiku
7504+ ;;
7505+ *-ibm)
7506+ os=-aix
7507+ ;;
7508+ *-knuth)
7509+ os=-mmixware
7510+ ;;
7511+ *-wec)
7512+ os=-proelf
7513+ ;;
7514+ *-winbond)
7515+ os=-proelf
7516+ ;;
7517+ *-oki)
7518+ os=-proelf
7519+ ;;
7520+ *-hp)
7521+ os=-hpux
7522+ ;;
7523+ *-hitachi)
7524+ os=-hiux
7525+ ;;
7526+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
7527+ os=-sysv
7528+ ;;
7529+ *-cbm)
7530+ os=-amigaos
7531+ ;;
7532+ *-dg)
7533+ os=-dgux
7534+ ;;
7535+ *-dolphin)
7536+ os=-sysv3
7537+ ;;
7538+ m68k-ccur)
7539+ os=-rtu
7540+ ;;
7541+ m88k-omron*)
7542+ os=-luna
7543+ ;;
7544+ *-next )
7545+ os=-nextstep
7546+ ;;
7547+ *-sequent)
7548+ os=-ptx
7549+ ;;
7550+ *-crds)
7551+ os=-unos
7552+ ;;
7553+ *-ns)
7554+ os=-genix
7555+ ;;
7556+ i370-*)
7557+ os=-mvs
7558+ ;;
7559+ *-next)
7560+ os=-nextstep3
7561+ ;;
7562+ *-gould)
7563+ os=-sysv
7564+ ;;
7565+ *-highlevel)
7566+ os=-bsd
7567+ ;;
7568+ *-encore)
7569+ os=-bsd
7570+ ;;
7571+ *-sgi)
7572+ os=-irix
7573+ ;;
7574+ *-siemens)
7575+ os=-sysv4
7576+ ;;
7577+ *-masscomp)
7578+ os=-rtu
7579+ ;;
7580+ f30[01]-fujitsu | f700-fujitsu)
7581+ os=-uxpv
7582+ ;;
7583+ *-rom68k)
7584+ os=-coff
7585+ ;;
7586+ *-*bug)
7587+ os=-coff
7588+ ;;
7589+ *-apple)
7590+ os=-macos
7591+ ;;
7592+ *-atari*)
7593+ os=-mint
7594+ ;;
7595+ *)
7596+ os=-none
7597+ ;;
7598+esac
7599+fi
7600+
7601+# Here we handle the case where we know the os, and the CPU type, but not the
7602+# manufacturer. We pick the logical manufacturer.
7603+vendor=unknown
7604+case $basic_machine in
7605+ *-unknown)
7606+ case $os in
7607+ -riscix*)
7608+ vendor=acorn
7609+ ;;
7610+ -sunos*)
7611+ vendor=sun
7612+ ;;
7613+ -cnk*|-aix*)
7614+ vendor=ibm
7615+ ;;
7616+ -beos*)
7617+ vendor=be
7618+ ;;
7619+ -hpux*)
7620+ vendor=hp
7621+ ;;
7622+ -mpeix*)
7623+ vendor=hp
7624+ ;;
7625+ -hiux*)
7626+ vendor=hitachi
7627+ ;;
7628+ -unos*)
7629+ vendor=crds
7630+ ;;
7631+ -dgux*)
7632+ vendor=dg
7633+ ;;
7634+ -luna*)
7635+ vendor=omron
7636+ ;;
7637+ -genix*)
7638+ vendor=ns
7639+ ;;
7640+ -mvs* | -opened*)
7641+ vendor=ibm
7642+ ;;
7643+ -os400*)
7644+ vendor=ibm
7645+ ;;
7646+ -ptx*)
7647+ vendor=sequent
7648+ ;;
7649+ -tpf*)
7650+ vendor=ibm
7651+ ;;
7652+ -vxsim* | -vxworks* | -windiss*)
7653+ vendor=wrs
7654+ ;;
7655+ -aux*)
7656+ vendor=apple
7657+ ;;
7658+ -hms*)
7659+ vendor=hitachi
7660+ ;;
7661+ -mpw* | -macos*)
7662+ vendor=apple
7663+ ;;
7664+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
7665+ vendor=atari
7666+ ;;
7667+ -vos*)
7668+ vendor=stratus
7669+ ;;
7670+ esac
7671+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
7672+ ;;
7673+esac
7674+
7675+echo $basic_machine$os
7676+exit
7677+
7678+# Local variables:
7679+# eval: (add-hook 'write-file-hooks 'time-stamp)
7680+# time-stamp-start: "timestamp='"
7681+# time-stamp-format: "%:y-%02m-%02d"
7682+# time-stamp-end: "'"
7683+# End:
7684diff --git a/libclamav/libmspack-0.4alpha/configure b/libclamav/libmspack-0.4alpha/configure
7685new file mode 100755
7686index 000000000000..5f03b36c49ac
7687--- /dev/null
7688+++ b/libclamav/libmspack-0.4alpha/configure
7689@@ -0,0 +1,14567 @@
7690+#! /bin/sh
7691+# Guess values for system-dependent variables and create Makefiles.
7692+# Generated by GNU Autoconf 2.68 for libmspack 0.4alpha.
7693+#
7694+# Report bugs to <kyzer@4u.net>.
7695+#
7696+#
7697+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
7698+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
7699+# Foundation, Inc.
7700+#
7701+#
7702+# This configure script is free software; the Free Software Foundation
7703+# gives unlimited permission to copy, distribute and modify it.
7704+## -------------------- ##
7705+## M4sh Initialization. ##
7706+## -------------------- ##
7707+
7708+# Be more Bourne compatible
7709+DUALCASE=1; export DUALCASE # for MKS sh
7710+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
7711+ emulate sh
7712+ NULLCMD=:
7713+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
7714+ # is contrary to our usage. Disable this feature.
7715+ alias -g '${1+"$@"}'='"$@"'
7716+ setopt NO_GLOB_SUBST
7717+else
7718+ case `(set -o) 2>/dev/null` in #(
7719+ *posix*) :
7720+ set -o posix ;; #(
7721+ *) :
7722+ ;;
7723+esac
7724+fi
7725+
7726+
7727+as_nl='
7728+'
7729+export as_nl
7730+# Printing a long string crashes Solaris 7 /usr/bin/printf.
7731+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
7732+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
7733+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
7734+# Prefer a ksh shell builtin over an external printf program on Solaris,
7735+# but without wasting forks for bash or zsh.
7736+if test -z "$BASH_VERSION$ZSH_VERSION" \
7737+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
7738+ as_echo='print -r --'
7739+ as_echo_n='print -rn --'
7740+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
7741+ as_echo='printf %s\n'
7742+ as_echo_n='printf %s'
7743+else
7744+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
7745+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
7746+ as_echo_n='/usr/ucb/echo -n'
7747+ else
7748+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
7749+ as_echo_n_body='eval
7750+ arg=$1;
7751+ case $arg in #(
7752+ *"$as_nl"*)
7753+ expr "X$arg" : "X\\(.*\\)$as_nl";
7754+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
7755+ esac;
7756+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
7757+ '
7758+ export as_echo_n_body
7759+ as_echo_n='sh -c $as_echo_n_body as_echo'
7760+ fi
7761+ export as_echo_body
7762+ as_echo='sh -c $as_echo_body as_echo'
7763+fi
7764+
7765+# The user is always right.
7766+if test "${PATH_SEPARATOR+set}" != set; then
7767+ PATH_SEPARATOR=:
7768+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
7769+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
7770+ PATH_SEPARATOR=';'
7771+ }
7772+fi
7773+
7774+
7775+# IFS
7776+# We need space, tab and new line, in precisely that order. Quoting is
7777+# there to prevent editors from complaining about space-tab.
7778+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
7779+# splitting by setting IFS to empty value.)
7780+IFS=" "" $as_nl"
7781+
7782+# Find who we are. Look in the path if we contain no directory separator.
7783+as_myself=
7784+case $0 in #((
7785+ *[\\/]* ) as_myself=$0 ;;
7786+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7787+for as_dir in $PATH
7788+do
7789+ IFS=$as_save_IFS
7790+ test -z "$as_dir" && as_dir=.
7791+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
7792+ done
7793+IFS=$as_save_IFS
7794+
7795+ ;;
7796+esac
7797+# We did not find ourselves, most probably we were run as `sh COMMAND'
7798+# in which case we are not to be found in the path.
7799+if test "x$as_myself" = x; then
7800+ as_myself=$0
7801+fi
7802+if test ! -f "$as_myself"; then
7803+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
7804+ exit 1
7805+fi
7806+
7807+# Unset variables that we do not need and which cause bugs (e.g. in
7808+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
7809+# suppresses any "Segmentation fault" message there. '((' could
7810+# trigger a bug in pdksh 5.2.14.
7811+for as_var in BASH_ENV ENV MAIL MAILPATH
7812+do eval test x\${$as_var+set} = xset \
7813+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
7814+done
7815+PS1='$ '
7816+PS2='> '
7817+PS4='+ '
7818+
7819+# NLS nuisances.
7820+LC_ALL=C
7821+export LC_ALL
7822+LANGUAGE=C
7823+export LANGUAGE
7824+
7825+# CDPATH.
7826+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
7827+
7828+if test "x$CONFIG_SHELL" = x; then
7829+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
7830+ emulate sh
7831+ NULLCMD=:
7832+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
7833+ # is contrary to our usage. Disable this feature.
7834+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
7835+ setopt NO_GLOB_SUBST
7836+else
7837+ case \`(set -o) 2>/dev/null\` in #(
7838+ *posix*) :
7839+ set -o posix ;; #(
7840+ *) :
7841+ ;;
7842+esac
7843+fi
7844+"
7845+ as_required="as_fn_return () { (exit \$1); }
7846+as_fn_success () { as_fn_return 0; }
7847+as_fn_failure () { as_fn_return 1; }
7848+as_fn_ret_success () { return 0; }
7849+as_fn_ret_failure () { return 1; }
7850+
7851+exitcode=0
7852+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
7853+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
7854+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
7855+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
7856+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
7857+
7858+else
7859+ exitcode=1; echo positional parameters were not saved.
7860+fi
7861+test x\$exitcode = x0 || exit 1"
7862+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
7863+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
7864+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
7865+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
7866+
7867+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
7868+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
7869+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
7870+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
7871+ PATH=/empty FPATH=/empty; export PATH FPATH
7872+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
7873+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
7874+test \$(( 1 + 1 )) = 2 || exit 1"
7875+ if (eval "$as_required") 2>/dev/null; then :
7876+ as_have_required=yes
7877+else
7878+ as_have_required=no
7879+fi
7880+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
7881+
7882+else
7883+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7884+as_found=false
7885+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
7886+do
7887+ IFS=$as_save_IFS
7888+ test -z "$as_dir" && as_dir=.
7889+ as_found=:
7890+ case $as_dir in #(
7891+ /*)
7892+ for as_base in sh bash ksh sh5; do
7893+ # Try only shells that exist, to save several forks.
7894+ as_shell=$as_dir/$as_base
7895+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
7896+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
7897+ CONFIG_SHELL=$as_shell as_have_required=yes
7898+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
7899+ break 2
7900+fi
7901+fi
7902+ done;;
7903+ esac
7904+ as_found=false
7905+done
7906+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
7907+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
7908+ CONFIG_SHELL=$SHELL as_have_required=yes
7909+fi; }
7910+IFS=$as_save_IFS
7911+
7912+
7913+ if test "x$CONFIG_SHELL" != x; then :
7914+ # We cannot yet assume a decent shell, so we have to provide a
7915+ # neutralization value for shells without unset; and this also
7916+ # works around shells that cannot unset nonexistent variables.
7917+ # Preserve -v and -x to the replacement shell.
7918+ BASH_ENV=/dev/null
7919+ ENV=/dev/null
7920+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
7921+ export CONFIG_SHELL
7922+ case $- in # ((((
7923+ *v*x* | *x*v* ) as_opts=-vx ;;
7924+ *v* ) as_opts=-v ;;
7925+ *x* ) as_opts=-x ;;
7926+ * ) as_opts= ;;
7927+ esac
7928+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
7929+fi
7930+
7931+ if test x$as_have_required = xno; then :
7932+ $as_echo "$0: This script requires a shell more modern than all"
7933+ $as_echo "$0: the shells that I found on your system."
7934+ if test x${ZSH_VERSION+set} = xset ; then
7935+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
7936+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
7937+ else
7938+ $as_echo "$0: Please tell bug-autoconf@gnu.org and kyzer@4u.net about
7939+$0: your system, including any error possibly output before
7940+$0: this message. Then install a modern shell, or manually
7941+$0: run the script under such a shell if you do have one."
7942+ fi
7943+ exit 1
7944+fi
7945+fi
7946+fi
7947+SHELL=${CONFIG_SHELL-/bin/sh}
7948+export SHELL
7949+# Unset more variables known to interfere with behavior of common tools.
7950+CLICOLOR_FORCE= GREP_OPTIONS=
7951+unset CLICOLOR_FORCE GREP_OPTIONS
7952+
7953+## --------------------- ##
7954+## M4sh Shell Functions. ##
7955+## --------------------- ##
7956+# as_fn_unset VAR
7957+# ---------------
7958+# Portably unset VAR.
7959+as_fn_unset ()
7960+{
7961+ { eval $1=; unset $1;}
7962+}
7963+as_unset=as_fn_unset
7964+
7965+# as_fn_set_status STATUS
7966+# -----------------------
7967+# Set $? to STATUS, without forking.
7968+as_fn_set_status ()
7969+{
7970+ return $1
7971+} # as_fn_set_status
7972+
7973+# as_fn_exit STATUS
7974+# -----------------
7975+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
7976+as_fn_exit ()
7977+{
7978+ set +e
7979+ as_fn_set_status $1
7980+ exit $1
7981+} # as_fn_exit
7982+
7983+# as_fn_mkdir_p
7984+# -------------
7985+# Create "$as_dir" as a directory, including parents if necessary.
7986+as_fn_mkdir_p ()
7987+{
7988+
7989+ case $as_dir in #(
7990+ -*) as_dir=./$as_dir;;
7991+ esac
7992+ test -d "$as_dir" || eval $as_mkdir_p || {
7993+ as_dirs=
7994+ while :; do
7995+ case $as_dir in #(
7996+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
7997+ *) as_qdir=$as_dir;;
7998+ esac
7999+ as_dirs="'$as_qdir' $as_dirs"
8000+ as_dir=`$as_dirname -- "$as_dir" ||
8001+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
8002+ X"$as_dir" : 'X\(//\)[^/]' \| \
8003+ X"$as_dir" : 'X\(//\)$' \| \
8004+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
8005+$as_echo X"$as_dir" |
8006+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
8007+ s//\1/
8008+ q
8009+ }
8010+ /^X\(\/\/\)[^/].*/{
8011+ s//\1/
8012+ q
8013+ }
8014+ /^X\(\/\/\)$/{
8015+ s//\1/
8016+ q
8017+ }
8018+ /^X\(\/\).*/{
8019+ s//\1/
8020+ q
8021+ }
8022+ s/.*/./; q'`
8023+ test -d "$as_dir" && break
8024+ done
8025+ test -z "$as_dirs" || eval "mkdir $as_dirs"
8026+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
8027+
8028+
8029+} # as_fn_mkdir_p
8030+# as_fn_append VAR VALUE
8031+# ----------------------
8032+# Append the text in VALUE to the end of the definition contained in VAR. Take
8033+# advantage of any shell optimizations that allow amortized linear growth over
8034+# repeated appends, instead of the typical quadratic growth present in naive
8035+# implementations.
8036+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
8037+ eval 'as_fn_append ()
8038+ {
8039+ eval $1+=\$2
8040+ }'
8041+else
8042+ as_fn_append ()
8043+ {
8044+ eval $1=\$$1\$2
8045+ }
8046+fi # as_fn_append
8047+
8048+# as_fn_arith ARG...
8049+# ------------------
8050+# Perform arithmetic evaluation on the ARGs, and store the result in the
8051+# global $as_val. Take advantage of shells that can avoid forks. The arguments
8052+# must be portable across $(()) and expr.
8053+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
8054+ eval 'as_fn_arith ()
8055+ {
8056+ as_val=$(( $* ))
8057+ }'
8058+else
8059+ as_fn_arith ()
8060+ {
8061+ as_val=`expr "$@" || test $? -eq 1`
8062+ }
8063+fi # as_fn_arith
8064+
8065+
8066+# as_fn_error STATUS ERROR [LINENO LOG_FD]
8067+# ----------------------------------------
8068+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
8069+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
8070+# script with STATUS, using 1 if that was 0.
8071+as_fn_error ()
8072+{
8073+ as_status=$1; test $as_status -eq 0 && as_status=1
8074+ if test "$4"; then
8075+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
8076+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
8077+ fi
8078+ $as_echo "$as_me: error: $2" >&2
8079+ as_fn_exit $as_status
8080+} # as_fn_error
8081+
8082+if expr a : '\(a\)' >/dev/null 2>&1 &&
8083+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
8084+ as_expr=expr
8085+else
8086+ as_expr=false
8087+fi
8088+
8089+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
8090+ as_basename=basename
8091+else
8092+ as_basename=false
8093+fi
8094+
8095+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
8096+ as_dirname=dirname
8097+else
8098+ as_dirname=false
8099+fi
8100+
8101+as_me=`$as_basename -- "$0" ||
8102+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
8103+ X"$0" : 'X\(//\)$' \| \
8104+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
8105+$as_echo X/"$0" |
8106+ sed '/^.*\/\([^/][^/]*\)\/*$/{
8107+ s//\1/
8108+ q
8109+ }
8110+ /^X\/\(\/\/\)$/{
8111+ s//\1/
8112+ q
8113+ }
8114+ /^X\/\(\/\).*/{
8115+ s//\1/
8116+ q
8117+ }
8118+ s/.*/./; q'`
8119+
8120+# Avoid depending upon Character Ranges.
8121+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
8122+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
8123+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
8124+as_cr_digits='0123456789'
8125+as_cr_alnum=$as_cr_Letters$as_cr_digits
8126+
8127+
8128+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
8129+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
8130+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
8131+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
8132+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
8133+ sed -n '
8134+ p
8135+ /[$]LINENO/=
8136+ ' <$as_myself |
8137+ sed '
8138+ s/[$]LINENO.*/&-/
8139+ t lineno
8140+ b
8141+ :lineno
8142+ N
8143+ :loop
8144+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
8145+ t loop
8146+ s/-\n.*//
8147+ ' >$as_me.lineno &&
8148+ chmod +x "$as_me.lineno" ||
8149+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
8150+
8151+ # Don't try to exec as it changes $[0], causing all sort of problems
8152+ # (the dirname of $[0] is not the place where we might find the
8153+ # original and so on. Autoconf is especially sensitive to this).
8154+ . "./$as_me.lineno"
8155+ # Exit status is that of the last command.
8156+ exit
8157+}
8158+
8159+ECHO_C= ECHO_N= ECHO_T=
8160+case `echo -n x` in #(((((
8161+-n*)
8162+ case `echo 'xy\c'` in
8163+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
8164+ xy) ECHO_C='\c';;
8165+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
8166+ ECHO_T=' ';;
8167+ esac;;
8168+*)
8169+ ECHO_N='-n';;
8170+esac
8171+
8172+rm -f conf$$ conf$$.exe conf$$.file
8173+if test -d conf$$.dir; then
8174+ rm -f conf$$.dir/conf$$.file
8175+else
8176+ rm -f conf$$.dir
8177+ mkdir conf$$.dir 2>/dev/null
8178+fi
8179+if (echo >conf$$.file) 2>/dev/null; then
8180+ if ln -s conf$$.file conf$$ 2>/dev/null; then
8181+ as_ln_s='ln -s'
8182+ # ... but there are two gotchas:
8183+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
8184+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
8185+ # In both cases, we have to default to `cp -p'.
8186+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
8187+ as_ln_s='cp -p'
8188+ elif ln conf$$.file conf$$ 2>/dev/null; then
8189+ as_ln_s=ln
8190+ else
8191+ as_ln_s='cp -p'
8192+ fi
8193+else
8194+ as_ln_s='cp -p'
8195+fi
8196+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
8197+rmdir conf$$.dir 2>/dev/null
8198+
8199+if mkdir -p . 2>/dev/null; then
8200+ as_mkdir_p='mkdir -p "$as_dir"'
8201+else
8202+ test -d ./-p && rmdir ./-p
8203+ as_mkdir_p=false
8204+fi
8205+
8206+if test -x / >/dev/null 2>&1; then
8207+ as_test_x='test -x'
8208+else
8209+ if ls -dL / >/dev/null 2>&1; then
8210+ as_ls_L_option=L
8211+ else
8212+ as_ls_L_option=
8213+ fi
8214+ as_test_x='
8215+ eval sh -c '\''
8216+ if test -d "$1"; then
8217+ test -d "$1/.";
8218+ else
8219+ case $1 in #(
8220+ -*)set "./$1";;
8221+ esac;
8222+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
8223+ ???[sx]*):;;*)false;;esac;fi
8224+ '\'' sh
8225+ '
8226+fi
8227+as_executable_p=$as_test_x
8228+
8229+# Sed expression to map a string onto a valid CPP name.
8230+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
8231+
8232+# Sed expression to map a string onto a valid variable name.
8233+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
8234+
8235+SHELL=${CONFIG_SHELL-/bin/sh}
8236+
8237+
8238+test -n "$DJDIR" || exec 7<&0 </dev/null
8239+exec 6>&1
8240+
8241+# Name of the host.
8242+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
8243+# so uname gets run too.
8244+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
8245+
8246+#
8247+# Initializations.
8248+#
8249+ac_default_prefix=/usr/local
8250+ac_clean_files=
8251+ac_config_libobj_dir=.
8252+LIBOBJS=
8253+cross_compiling=no
8254+subdirs=
8255+MFLAGS=
8256+MAKEFLAGS=
8257+
8258+# Identity of this package.
8259+PACKAGE_NAME='libmspack'
8260+PACKAGE_TARNAME='libmspack'
8261+PACKAGE_VERSION='0.4alpha'
8262+PACKAGE_STRING='libmspack 0.4alpha'
8263+PACKAGE_BUGREPORT='kyzer@4u.net'
8264+PACKAGE_URL=''
8265+
8266+ac_unique_file="mspack/mspack.h"
8267+# Factoring default headers for most tests.
8268+ac_includes_default="\
8269+#include <stdio.h>
8270+#ifdef HAVE_SYS_TYPES_H
8271+# include <sys/types.h>
8272+#endif
8273+#ifdef HAVE_SYS_STAT_H
8274+# include <sys/stat.h>
8275+#endif
8276+#ifdef STDC_HEADERS
8277+# include <stdlib.h>
8278+# include <stddef.h>
8279+#else
8280+# ifdef HAVE_STDLIB_H
8281+# include <stdlib.h>
8282+# endif
8283+#endif
8284+#ifdef HAVE_STRING_H
8285+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
8286+# include <memory.h>
8287+# endif
8288+# include <string.h>
8289+#endif
8290+#ifdef HAVE_STRINGS_H
8291+# include <strings.h>
8292+#endif
8293+#ifdef HAVE_INTTYPES_H
8294+# include <inttypes.h>
8295+#endif
8296+#ifdef HAVE_STDINT_H
8297+# include <stdint.h>
8298+#endif
8299+#ifdef HAVE_UNISTD_H
8300+# include <unistd.h>
8301+#endif"
8302+
8303+ac_subst_vars='am__EXEEXT_FALSE
8304+am__EXEEXT_TRUE
8305+LTLIBOBJS
8306+LIBOBJS
8307+CPP
8308+OTOOL64
8309+OTOOL
8310+LIPO
8311+NMEDIT
8312+DSYMUTIL
8313+MANIFEST_TOOL
8314+RANLIB
8315+ac_ct_AR
8316+AR
8317+DLLTOOL
8318+OBJDUMP
8319+LN_S
8320+NM
8321+ac_ct_DUMPBIN
8322+DUMPBIN
8323+LD
8324+FGREP
8325+EGREP
8326+GREP
8327+SED
8328+host_os
8329+host_vendor
8330+host_cpu
8331+host
8332+build_os
8333+build_vendor
8334+build_cpu
8335+build
8336+LIBTOOL
8337+GCC_FALSE
8338+GCC_TRUE
8339+am__fastdepCC_FALSE
8340+am__fastdepCC_TRUE
8341+CCDEPMODE
8342+am__nodep
8343+AMDEPBACKSLASH
8344+AMDEP_FALSE
8345+AMDEP_TRUE
8346+am__quote
8347+am__include
8348+DEPDIR
8349+OBJEXT
8350+EXEEXT
8351+ac_ct_CC
8352+CPPFLAGS
8353+LDFLAGS
8354+CFLAGS
8355+CC
8356+DEBUG_FALSE
8357+DEBUG_TRUE
8358+AM_BACKSLASH
8359+AM_DEFAULT_VERBOSITY
8360+AM_DEFAULT_V
8361+AM_V
8362+am__untar
8363+am__tar
8364+AMTAR
8365+am__leading_dot
8366+SET_MAKE
8367+AWK
8368+mkdir_p
8369+MKDIR_P
8370+INSTALL_STRIP_PROGRAM
8371+STRIP
8372+install_sh
8373+MAKEINFO
8374+AUTOHEADER
8375+AUTOMAKE
8376+AUTOCONF
8377+ACLOCAL
8378+VERSION
8379+PACKAGE
8380+CYGPATH_W
8381+am__isrc
8382+INSTALL_DATA
8383+INSTALL_SCRIPT
8384+INSTALL_PROGRAM
8385+target_alias
8386+host_alias
8387+build_alias
8388+LIBS
8389+ECHO_T
8390+ECHO_N
8391+ECHO_C
8392+DEFS
8393+mandir
8394+localedir
8395+libdir
8396+psdir
8397+pdfdir
8398+dvidir
8399+htmldir
8400+infodir
8401+docdir
8402+oldincludedir
8403+includedir
8404+localstatedir
8405+sharedstatedir
8406+sysconfdir
8407+datadir
8408+datarootdir
8409+libexecdir
8410+sbindir
8411+bindir
8412+program_transform_name
8413+prefix
8414+exec_prefix
8415+PACKAGE_URL
8416+PACKAGE_BUGREPORT
8417+PACKAGE_STRING
8418+PACKAGE_VERSION
8419+PACKAGE_TARNAME
8420+PACKAGE_NAME
8421+PATH_SEPARATOR
8422+SHELL'
8423+ac_subst_files=''
8424+ac_user_opts='
8425+enable_option_checking
8426+enable_silent_rules
8427+enable_debug
8428+enable_dependency_tracking
8429+enable_shared
8430+enable_static
8431+with_pic
8432+enable_fast_install
8433+with_gnu_ld
8434+with_sysroot
8435+enable_libtool_lock
8436+enable_largefile
8437+'
8438+ ac_precious_vars='build_alias
8439+host_alias
8440+target_alias
8441+CC
8442+CFLAGS
8443+LDFLAGS
8444+LIBS
8445+CPPFLAGS
8446+CPP'
8447+
8448+
8449+# Initialize some variables set by options.
8450+ac_init_help=
8451+ac_init_version=false
8452+ac_unrecognized_opts=
8453+ac_unrecognized_sep=
8454+# The variables have the same names as the options, with
8455+# dashes changed to underlines.
8456+cache_file=/dev/null
8457+exec_prefix=NONE
8458+no_create=
8459+no_recursion=
8460+prefix=NONE
8461+program_prefix=NONE
8462+program_suffix=NONE
8463+program_transform_name=s,x,x,
8464+silent=
8465+site=
8466+srcdir=
8467+verbose=
8468+x_includes=NONE
8469+x_libraries=NONE
8470+
8471+# Installation directory options.
8472+# These are left unexpanded so users can "make install exec_prefix=/foo"
8473+# and all the variables that are supposed to be based on exec_prefix
8474+# by default will actually change.
8475+# Use braces instead of parens because sh, perl, etc. also accept them.
8476+# (The list follows the same order as the GNU Coding Standards.)
8477+bindir='${exec_prefix}/bin'
8478+sbindir='${exec_prefix}/sbin'
8479+libexecdir='${exec_prefix}/libexec'
8480+datarootdir='${prefix}/share'
8481+datadir='${datarootdir}'
8482+sysconfdir='${prefix}/etc'
8483+sharedstatedir='${prefix}/com'
8484+localstatedir='${prefix}/var'
8485+includedir='${prefix}/include'
8486+oldincludedir='/usr/include'
8487+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
8488+infodir='${datarootdir}/info'
8489+htmldir='${docdir}'
8490+dvidir='${docdir}'
8491+pdfdir='${docdir}'
8492+psdir='${docdir}'
8493+libdir='${exec_prefix}/lib'
8494+localedir='${datarootdir}/locale'
8495+mandir='${datarootdir}/man'
8496+
8497+ac_prev=
8498+ac_dashdash=
8499+for ac_option
8500+do
8501+ # If the previous option needs an argument, assign it.
8502+ if test -n "$ac_prev"; then
8503+ eval $ac_prev=\$ac_option
8504+ ac_prev=
8505+ continue
8506+ fi
8507+
8508+ case $ac_option in
8509+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
8510+ *=) ac_optarg= ;;
8511+ *) ac_optarg=yes ;;
8512+ esac
8513+
8514+ # Accept the important Cygnus configure options, so we can diagnose typos.
8515+
8516+ case $ac_dashdash$ac_option in
8517+ --)
8518+ ac_dashdash=yes ;;
8519+
8520+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
8521+ ac_prev=bindir ;;
8522+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
8523+ bindir=$ac_optarg ;;
8524+
8525+ -build | --build | --buil | --bui | --bu)
8526+ ac_prev=build_alias ;;
8527+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
8528+ build_alias=$ac_optarg ;;
8529+
8530+ -cache-file | --cache-file | --cache-fil | --cache-fi \
8531+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
8532+ ac_prev=cache_file ;;
8533+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
8534+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
8535+ cache_file=$ac_optarg ;;
8536+
8537+ --config-cache | -C)
8538+ cache_file=config.cache ;;
8539+
8540+ -datadir | --datadir | --datadi | --datad)
8541+ ac_prev=datadir ;;
8542+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
8543+ datadir=$ac_optarg ;;
8544+
8545+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
8546+ | --dataroo | --dataro | --datar)
8547+ ac_prev=datarootdir ;;
8548+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
8549+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
8550+ datarootdir=$ac_optarg ;;
8551+
8552+ -disable-* | --disable-*)
8553+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
8554+ # Reject names that are not valid shell variable names.
8555+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
8556+ as_fn_error $? "invalid feature name: $ac_useropt"
8557+ ac_useropt_orig=$ac_useropt
8558+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
8559+ case $ac_user_opts in
8560+ *"
8561+"enable_$ac_useropt"
8562+"*) ;;
8563+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
8564+ ac_unrecognized_sep=', ';;
8565+ esac
8566+ eval enable_$ac_useropt=no ;;
8567+
8568+ -docdir | --docdir | --docdi | --doc | --do)
8569+ ac_prev=docdir ;;
8570+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
8571+ docdir=$ac_optarg ;;
8572+
8573+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
8574+ ac_prev=dvidir ;;
8575+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
8576+ dvidir=$ac_optarg ;;
8577+
8578+ -enable-* | --enable-*)
8579+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
8580+ # Reject names that are not valid shell variable names.
8581+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
8582+ as_fn_error $? "invalid feature name: $ac_useropt"
8583+ ac_useropt_orig=$ac_useropt
8584+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
8585+ case $ac_user_opts in
8586+ *"
8587+"enable_$ac_useropt"
8588+"*) ;;
8589+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
8590+ ac_unrecognized_sep=', ';;
8591+ esac
8592+ eval enable_$ac_useropt=\$ac_optarg ;;
8593+
8594+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
8595+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
8596+ | --exec | --exe | --ex)
8597+ ac_prev=exec_prefix ;;
8598+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
8599+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
8600+ | --exec=* | --exe=* | --ex=*)
8601+ exec_prefix=$ac_optarg ;;
8602+
8603+ -gas | --gas | --ga | --g)
8604+ # Obsolete; use --with-gas.
8605+ with_gas=yes ;;
8606+
8607+ -help | --help | --hel | --he | -h)
8608+ ac_init_help=long ;;
8609+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
8610+ ac_init_help=recursive ;;
8611+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
8612+ ac_init_help=short ;;
8613+
8614+ -host | --host | --hos | --ho)
8615+ ac_prev=host_alias ;;
8616+ -host=* | --host=* | --hos=* | --ho=*)
8617+ host_alias=$ac_optarg ;;
8618+
8619+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
8620+ ac_prev=htmldir ;;
8621+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
8622+ | --ht=*)
8623+ htmldir=$ac_optarg ;;
8624+
8625+ -includedir | --includedir | --includedi | --included | --include \
8626+ | --includ | --inclu | --incl | --inc)
8627+ ac_prev=includedir ;;
8628+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
8629+ | --includ=* | --inclu=* | --incl=* | --inc=*)
8630+ includedir=$ac_optarg ;;
8631+
8632+ -infodir | --infodir | --infodi | --infod | --info | --inf)
8633+ ac_prev=infodir ;;
8634+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
8635+ infodir=$ac_optarg ;;
8636+
8637+ -libdir | --libdir | --libdi | --libd)
8638+ ac_prev=libdir ;;
8639+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
8640+ libdir=$ac_optarg ;;
8641+
8642+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
8643+ | --libexe | --libex | --libe)
8644+ ac_prev=libexecdir ;;
8645+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
8646+ | --libexe=* | --libex=* | --libe=*)
8647+ libexecdir=$ac_optarg ;;
8648+
8649+ -localedir | --localedir | --localedi | --localed | --locale)
8650+ ac_prev=localedir ;;
8651+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
8652+ localedir=$ac_optarg ;;
8653+
8654+ -localstatedir | --localstatedir | --localstatedi | --localstated \
8655+ | --localstate | --localstat | --localsta | --localst | --locals)
8656+ ac_prev=localstatedir ;;
8657+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
8658+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
8659+ localstatedir=$ac_optarg ;;
8660+
8661+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
8662+ ac_prev=mandir ;;
8663+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
8664+ mandir=$ac_optarg ;;
8665+
8666+ -nfp | --nfp | --nf)
8667+ # Obsolete; use --without-fp.
8668+ with_fp=no ;;
8669+
8670+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
8671+ | --no-cr | --no-c | -n)
8672+ no_create=yes ;;
8673+
8674+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
8675+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
8676+ no_recursion=yes ;;
8677+
8678+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
8679+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
8680+ | --oldin | --oldi | --old | --ol | --o)
8681+ ac_prev=oldincludedir ;;
8682+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
8683+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
8684+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
8685+ oldincludedir=$ac_optarg ;;
8686+
8687+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
8688+ ac_prev=prefix ;;
8689+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
8690+ prefix=$ac_optarg ;;
8691+
8692+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
8693+ | --program-pre | --program-pr | --program-p)
8694+ ac_prev=program_prefix ;;
8695+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
8696+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
8697+ program_prefix=$ac_optarg ;;
8698+
8699+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
8700+ | --program-suf | --program-su | --program-s)
8701+ ac_prev=program_suffix ;;
8702+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
8703+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
8704+ program_suffix=$ac_optarg ;;
8705+
8706+ -program-transform-name | --program-transform-name \
8707+ | --program-transform-nam | --program-transform-na \
8708+ | --program-transform-n | --program-transform- \
8709+ | --program-transform | --program-transfor \
8710+ | --program-transfo | --program-transf \
8711+ | --program-trans | --program-tran \
8712+ | --progr-tra | --program-tr | --program-t)
8713+ ac_prev=program_transform_name ;;
8714+ -program-transform-name=* | --program-transform-name=* \
8715+ | --program-transform-nam=* | --program-transform-na=* \
8716+ | --program-transform-n=* | --program-transform-=* \
8717+ | --program-transform=* | --program-transfor=* \
8718+ | --program-transfo=* | --program-transf=* \
8719+ | --program-trans=* | --program-tran=* \
8720+ | --progr-tra=* | --program-tr=* | --program-t=*)
8721+ program_transform_name=$ac_optarg ;;
8722+
8723+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
8724+ ac_prev=pdfdir ;;
8725+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
8726+ pdfdir=$ac_optarg ;;
8727+
8728+ -psdir | --psdir | --psdi | --psd | --ps)
8729+ ac_prev=psdir ;;
8730+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
8731+ psdir=$ac_optarg ;;
8732+
8733+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
8734+ | -silent | --silent | --silen | --sile | --sil)
8735+ silent=yes ;;
8736+
8737+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
8738+ ac_prev=sbindir ;;
8739+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
8740+ | --sbi=* | --sb=*)
8741+ sbindir=$ac_optarg ;;
8742+
8743+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
8744+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
8745+ | --sharedst | --shareds | --shared | --share | --shar \
8746+ | --sha | --sh)
8747+ ac_prev=sharedstatedir ;;
8748+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
8749+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
8750+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
8751+ | --sha=* | --sh=*)
8752+ sharedstatedir=$ac_optarg ;;
8753+
8754+ -site | --site | --sit)
8755+ ac_prev=site ;;
8756+ -site=* | --site=* | --sit=*)
8757+ site=$ac_optarg ;;
8758+
8759+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
8760+ ac_prev=srcdir ;;
8761+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
8762+ srcdir=$ac_optarg ;;
8763+
8764+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
8765+ | --syscon | --sysco | --sysc | --sys | --sy)
8766+ ac_prev=sysconfdir ;;
8767+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
8768+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
8769+ sysconfdir=$ac_optarg ;;
8770+
8771+ -target | --target | --targe | --targ | --tar | --ta | --t)
8772+ ac_prev=target_alias ;;
8773+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
8774+ target_alias=$ac_optarg ;;
8775+
8776+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
8777+ verbose=yes ;;
8778+
8779+ -version | --version | --versio | --versi | --vers | -V)
8780+ ac_init_version=: ;;
8781+
8782+ -with-* | --with-*)
8783+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
8784+ # Reject names that are not valid shell variable names.
8785+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
8786+ as_fn_error $? "invalid package name: $ac_useropt"
8787+ ac_useropt_orig=$ac_useropt
8788+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
8789+ case $ac_user_opts in
8790+ *"
8791+"with_$ac_useropt"
8792+"*) ;;
8793+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
8794+ ac_unrecognized_sep=', ';;
8795+ esac
8796+ eval with_$ac_useropt=\$ac_optarg ;;
8797+
8798+ -without-* | --without-*)
8799+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
8800+ # Reject names that are not valid shell variable names.
8801+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
8802+ as_fn_error $? "invalid package name: $ac_useropt"
8803+ ac_useropt_orig=$ac_useropt
8804+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
8805+ case $ac_user_opts in
8806+ *"
8807+"with_$ac_useropt"
8808+"*) ;;
8809+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
8810+ ac_unrecognized_sep=', ';;
8811+ esac
8812+ eval with_$ac_useropt=no ;;
8813+
8814+ --x)
8815+ # Obsolete; use --with-x.
8816+ with_x=yes ;;
8817+
8818+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
8819+ | --x-incl | --x-inc | --x-in | --x-i)
8820+ ac_prev=x_includes ;;
8821+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
8822+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
8823+ x_includes=$ac_optarg ;;
8824+
8825+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
8826+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
8827+ ac_prev=x_libraries ;;
8828+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
8829+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
8830+ x_libraries=$ac_optarg ;;
8831+
8832+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
8833+Try \`$0 --help' for more information"
8834+ ;;
8835+
8836+ *=*)
8837+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
8838+ # Reject names that are not valid shell variable names.
8839+ case $ac_envvar in #(
8840+ '' | [0-9]* | *[!_$as_cr_alnum]* )
8841+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
8842+ esac
8843+ eval $ac_envvar=\$ac_optarg
8844+ export $ac_envvar ;;
8845+
8846+ *)
8847+ # FIXME: should be removed in autoconf 3.0.
8848+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
8849+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
8850+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
8851+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
8852+ ;;
8853+
8854+ esac
8855+done
8856+
8857+if test -n "$ac_prev"; then
8858+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
8859+ as_fn_error $? "missing argument to $ac_option"
8860+fi
8861+
8862+if test -n "$ac_unrecognized_opts"; then
8863+ case $enable_option_checking in
8864+ no) ;;
8865+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
8866+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
8867+ esac
8868+fi
8869+
8870+# Check all directory arguments for consistency.
8871+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
8872+ datadir sysconfdir sharedstatedir localstatedir includedir \
8873+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
8874+ libdir localedir mandir
8875+do
8876+ eval ac_val=\$$ac_var
8877+ # Remove trailing slashes.
8878+ case $ac_val in
8879+ */ )
8880+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
8881+ eval $ac_var=\$ac_val;;
8882+ esac
8883+ # Be sure to have absolute directory names.
8884+ case $ac_val in
8885+ [\\/$]* | ?:[\\/]* ) continue;;
8886+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
8887+ esac
8888+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
8889+done
8890+
8891+# There might be people who depend on the old broken behavior: `$host'
8892+# used to hold the argument of --host etc.
8893+# FIXME: To remove some day.
8894+build=$build_alias
8895+host=$host_alias
8896+target=$target_alias
8897+
8898+# FIXME: To remove some day.
8899+if test "x$host_alias" != x; then
8900+ if test "x$build_alias" = x; then
8901+ cross_compiling=maybe
8902+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
8903+ If a cross compiler is detected then cross compile mode will be used" >&2
8904+ elif test "x$build_alias" != "x$host_alias"; then
8905+ cross_compiling=yes
8906+ fi
8907+fi
8908+
8909+ac_tool_prefix=
8910+test -n "$host_alias" && ac_tool_prefix=$host_alias-
8911+
8912+test "$silent" = yes && exec 6>/dev/null
8913+
8914+
8915+ac_pwd=`pwd` && test -n "$ac_pwd" &&
8916+ac_ls_di=`ls -di .` &&
8917+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
8918+ as_fn_error $? "working directory cannot be determined"
8919+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
8920+ as_fn_error $? "pwd does not report name of working directory"
8921+
8922+
8923+# Find the source files, if location was not specified.
8924+if test -z "$srcdir"; then
8925+ ac_srcdir_defaulted=yes
8926+ # Try the directory containing this script, then the parent directory.
8927+ ac_confdir=`$as_dirname -- "$as_myself" ||
8928+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
8929+ X"$as_myself" : 'X\(//\)[^/]' \| \
8930+ X"$as_myself" : 'X\(//\)$' \| \
8931+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
8932+$as_echo X"$as_myself" |
8933+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
8934+ s//\1/
8935+ q
8936+ }
8937+ /^X\(\/\/\)[^/].*/{
8938+ s//\1/
8939+ q
8940+ }
8941+ /^X\(\/\/\)$/{
8942+ s//\1/
8943+ q
8944+ }
8945+ /^X\(\/\).*/{
8946+ s//\1/
8947+ q
8948+ }
8949+ s/.*/./; q'`
8950+ srcdir=$ac_confdir
8951+ if test ! -r "$srcdir/$ac_unique_file"; then
8952+ srcdir=..
8953+ fi
8954+else
8955+ ac_srcdir_defaulted=no
8956+fi
8957+if test ! -r "$srcdir/$ac_unique_file"; then
8958+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
8959+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
8960+fi
8961+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
8962+ac_abs_confdir=`(
8963+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
8964+ pwd)`
8965+# When building in place, set srcdir=.
8966+if test "$ac_abs_confdir" = "$ac_pwd"; then
8967+ srcdir=.
8968+fi
8969+# Remove unnecessary trailing slashes from srcdir.
8970+# Double slashes in file names in object file debugging info
8971+# mess up M-x gdb in Emacs.
8972+case $srcdir in
8973+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
8974+esac
8975+for ac_var in $ac_precious_vars; do
8976+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
8977+ eval ac_env_${ac_var}_value=\$${ac_var}
8978+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
8979+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
8980+done
8981+
8982+#
8983+# Report the --help message.
8984+#
8985+if test "$ac_init_help" = "long"; then
8986+ # Omit some internal or obsolete options to make the list less imposing.
8987+ # This message is too long to be a string in the A/UX 3.1 sh.
8988+ cat <<_ACEOF
8989+\`configure' configures libmspack 0.4alpha to adapt to many kinds of systems.
8990+
8991+Usage: $0 [OPTION]... [VAR=VALUE]...
8992+
8993+To assign environment variables (e.g., CC, CFLAGS...), specify them as
8994+VAR=VALUE. See below for descriptions of some of the useful variables.
8995+
8996+Defaults for the options are specified in brackets.
8997+
8998+Configuration:
8999+ -h, --help display this help and exit
9000+ --help=short display options specific to this package
9001+ --help=recursive display the short help of all the included packages
9002+ -V, --version display version information and exit
9003+ -q, --quiet, --silent do not print \`checking ...' messages
9004+ --cache-file=FILE cache test results in FILE [disabled]
9005+ -C, --config-cache alias for \`--cache-file=config.cache'
9006+ -n, --no-create do not create output files
9007+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
9008+
9009+Installation directories:
9010+ --prefix=PREFIX install architecture-independent files in PREFIX
9011+ [$ac_default_prefix]
9012+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
9013+ [PREFIX]
9014+
9015+By default, \`make install' will install all the files in
9016+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
9017+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
9018+for instance \`--prefix=\$HOME'.
9019+
9020+For better control, use the options below.
9021+
9022+Fine tuning of the installation directories:
9023+ --bindir=DIR user executables [EPREFIX/bin]
9024+ --sbindir=DIR system admin executables [EPREFIX/sbin]
9025+ --libexecdir=DIR program executables [EPREFIX/libexec]
9026+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
9027+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
9028+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
9029+ --libdir=DIR object code libraries [EPREFIX/lib]
9030+ --includedir=DIR C header files [PREFIX/include]
9031+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
9032+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
9033+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
9034+ --infodir=DIR info documentation [DATAROOTDIR/info]
9035+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
9036+ --mandir=DIR man documentation [DATAROOTDIR/man]
9037+ --docdir=DIR documentation root [DATAROOTDIR/doc/libmspack]
9038+ --htmldir=DIR html documentation [DOCDIR]
9039+ --dvidir=DIR dvi documentation [DOCDIR]
9040+ --pdfdir=DIR pdf documentation [DOCDIR]
9041+ --psdir=DIR ps documentation [DOCDIR]
9042+_ACEOF
9043+
9044+ cat <<\_ACEOF
9045+
9046+Program names:
9047+ --program-prefix=PREFIX prepend PREFIX to installed program names
9048+ --program-suffix=SUFFIX append SUFFIX to installed program names
9049+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
9050+
9051+System types:
9052+ --build=BUILD configure for building on BUILD [guessed]
9053+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
9054+_ACEOF
9055+fi
9056+
9057+if test -n "$ac_init_help"; then
9058+ case $ac_init_help in
9059+ short | recursive ) echo "Configuration of libmspack 0.4alpha:";;
9060+ esac
9061+ cat <<\_ACEOF
9062+
9063+Optional Features:
9064+ --disable-option-checking ignore unrecognized --enable/--with options
9065+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
9066+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
9067+ --enable-silent-rules less verbose build output (undo: `make V=1')
9068+ --disable-silent-rules verbose build output (undo: `make V=0')
9069+ --enable-debug enable debugging
9070+ --disable-dependency-tracking speeds up one-time build
9071+ --enable-dependency-tracking do not reject slow dependency extractors
9072+ --enable-shared[=PKGS] build shared libraries [default=yes]
9073+ --enable-static[=PKGS] build static libraries [default=yes]
9074+ --enable-fast-install[=PKGS]
9075+ optimize for fast installation [default=yes]
9076+ --disable-libtool-lock avoid locking (might break parallel builds)
9077+ --disable-largefile omit support for large files
9078+
9079+Optional Packages:
9080+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
9081+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
9082+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
9083+ both]
9084+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
9085+ --with-sysroot=DIR Search for dependent libraries within DIR
9086+ (or the compiler's sysroot if not specified).
9087+
9088+Some influential environment variables:
9089+ CC C compiler command
9090+ CFLAGS C compiler flags
9091+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
9092+ nonstandard directory <lib dir>
9093+ LIBS libraries to pass to the linker, e.g. -l<library>
9094+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
9095+ you have headers in a nonstandard directory <include dir>
9096+ CPP C preprocessor
9097+
9098+Use these variables to override the choices made by `configure' or to help
9099+it to find libraries and programs with nonstandard names/locations.
9100+
9101+Report bugs to <kyzer@4u.net>.
9102+_ACEOF
9103+ac_status=$?
9104+fi
9105+
9106+if test "$ac_init_help" = "recursive"; then
9107+ # If there are subdirs, report their specific --help.
9108+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
9109+ test -d "$ac_dir" ||
9110+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
9111+ continue
9112+ ac_builddir=.
9113+
9114+case "$ac_dir" in
9115+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
9116+*)
9117+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
9118+ # A ".." for each directory in $ac_dir_suffix.
9119+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
9120+ case $ac_top_builddir_sub in
9121+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
9122+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
9123+ esac ;;
9124+esac
9125+ac_abs_top_builddir=$ac_pwd
9126+ac_abs_builddir=$ac_pwd$ac_dir_suffix
9127+# for backward compatibility:
9128+ac_top_builddir=$ac_top_build_prefix
9129+
9130+case $srcdir in
9131+ .) # We are building in place.
9132+ ac_srcdir=.
9133+ ac_top_srcdir=$ac_top_builddir_sub
9134+ ac_abs_top_srcdir=$ac_pwd ;;
9135+ [\\/]* | ?:[\\/]* ) # Absolute name.
9136+ ac_srcdir=$srcdir$ac_dir_suffix;
9137+ ac_top_srcdir=$srcdir
9138+ ac_abs_top_srcdir=$srcdir ;;
9139+ *) # Relative name.
9140+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
9141+ ac_top_srcdir=$ac_top_build_prefix$srcdir
9142+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
9143+esac
9144+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
9145+
9146+ cd "$ac_dir" || { ac_status=$?; continue; }
9147+ # Check for guested configure.
9148+ if test -f "$ac_srcdir/configure.gnu"; then
9149+ echo &&
9150+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
9151+ elif test -f "$ac_srcdir/configure"; then
9152+ echo &&
9153+ $SHELL "$ac_srcdir/configure" --help=recursive
9154+ else
9155+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
9156+ fi || ac_status=$?
9157+ cd "$ac_pwd" || { ac_status=$?; break; }
9158+ done
9159+fi
9160+
9161+test -n "$ac_init_help" && exit $ac_status
9162+if $ac_init_version; then
9163+ cat <<\_ACEOF
9164+libmspack configure 0.4alpha
9165+generated by GNU Autoconf 2.68
9166+
9167+Copyright (C) 2010 Free Software Foundation, Inc.
9168+This configure script is free software; the Free Software Foundation
9169+gives unlimited permission to copy, distribute and modify it.
9170+_ACEOF
9171+ exit
9172+fi
9173+
9174+## ------------------------ ##
9175+## Autoconf initialization. ##
9176+## ------------------------ ##
9177+
9178+# ac_fn_c_try_compile LINENO
9179+# --------------------------
9180+# Try to compile conftest.$ac_ext, and return whether this succeeded.
9181+ac_fn_c_try_compile ()
9182+{
9183+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9184+ rm -f conftest.$ac_objext
9185+ if { { ac_try="$ac_compile"
9186+case "(($ac_try" in
9187+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9188+ *) ac_try_echo=$ac_try;;
9189+esac
9190+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
9191+$as_echo "$ac_try_echo"; } >&5
9192+ (eval "$ac_compile") 2>conftest.err
9193+ ac_status=$?
9194+ if test -s conftest.err; then
9195+ grep -v '^ *+' conftest.err >conftest.er1
9196+ cat conftest.er1 >&5
9197+ mv -f conftest.er1 conftest.err
9198+ fi
9199+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9200+ test $ac_status = 0; } && {
9201+ test -z "$ac_c_werror_flag" ||
9202+ test ! -s conftest.err
9203+ } && test -s conftest.$ac_objext; then :
9204+ ac_retval=0
9205+else
9206+ $as_echo "$as_me: failed program was:" >&5
9207+sed 's/^/| /' conftest.$ac_ext >&5
9208+
9209+ ac_retval=1
9210+fi
9211+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9212+ as_fn_set_status $ac_retval
9213+
9214+} # ac_fn_c_try_compile
9215+
9216+# ac_fn_c_try_link LINENO
9217+# -----------------------
9218+# Try to link conftest.$ac_ext, and return whether this succeeded.
9219+ac_fn_c_try_link ()
9220+{
9221+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9222+ rm -f conftest.$ac_objext conftest$ac_exeext
9223+ if { { ac_try="$ac_link"
9224+case "(($ac_try" in
9225+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9226+ *) ac_try_echo=$ac_try;;
9227+esac
9228+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
9229+$as_echo "$ac_try_echo"; } >&5
9230+ (eval "$ac_link") 2>conftest.err
9231+ ac_status=$?
9232+ if test -s conftest.err; then
9233+ grep -v '^ *+' conftest.err >conftest.er1
9234+ cat conftest.er1 >&5
9235+ mv -f conftest.er1 conftest.err
9236+ fi
9237+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9238+ test $ac_status = 0; } && {
9239+ test -z "$ac_c_werror_flag" ||
9240+ test ! -s conftest.err
9241+ } && test -s conftest$ac_exeext && {
9242+ test "$cross_compiling" = yes ||
9243+ $as_test_x conftest$ac_exeext
9244+ }; then :
9245+ ac_retval=0
9246+else
9247+ $as_echo "$as_me: failed program was:" >&5
9248+sed 's/^/| /' conftest.$ac_ext >&5
9249+
9250+ ac_retval=1
9251+fi
9252+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
9253+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
9254+ # interfere with the next link command; also delete a directory that is
9255+ # left behind by Apple's compiler. We do this before executing the actions.
9256+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
9257+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9258+ as_fn_set_status $ac_retval
9259+
9260+} # ac_fn_c_try_link
9261+
9262+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
9263+# -------------------------------------------------------
9264+# Tests whether HEADER exists and can be compiled using the include files in
9265+# INCLUDES, setting the cache variable VAR accordingly.
9266+ac_fn_c_check_header_compile ()
9267+{
9268+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9269+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
9270+$as_echo_n "checking for $2... " >&6; }
9271+if eval \${$3+:} false; then :
9272+ $as_echo_n "(cached) " >&6
9273+else
9274+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9275+/* end confdefs.h. */
9276+$4
9277+#include <$2>
9278+_ACEOF
9279+if ac_fn_c_try_compile "$LINENO"; then :
9280+ eval "$3=yes"
9281+else
9282+ eval "$3=no"
9283+fi
9284+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9285+fi
9286+eval ac_res=\$$3
9287+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
9288+$as_echo "$ac_res" >&6; }
9289+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9290+
9291+} # ac_fn_c_check_header_compile
9292+
9293+# ac_fn_c_try_cpp LINENO
9294+# ----------------------
9295+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
9296+ac_fn_c_try_cpp ()
9297+{
9298+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9299+ if { { ac_try="$ac_cpp conftest.$ac_ext"
9300+case "(($ac_try" in
9301+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9302+ *) ac_try_echo=$ac_try;;
9303+esac
9304+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
9305+$as_echo "$ac_try_echo"; } >&5
9306+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
9307+ ac_status=$?
9308+ if test -s conftest.err; then
9309+ grep -v '^ *+' conftest.err >conftest.er1
9310+ cat conftest.er1 >&5
9311+ mv -f conftest.er1 conftest.err
9312+ fi
9313+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9314+ test $ac_status = 0; } > conftest.i && {
9315+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
9316+ test ! -s conftest.err
9317+ }; then :
9318+ ac_retval=0
9319+else
9320+ $as_echo "$as_me: failed program was:" >&5
9321+sed 's/^/| /' conftest.$ac_ext >&5
9322+
9323+ ac_retval=1
9324+fi
9325+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9326+ as_fn_set_status $ac_retval
9327+
9328+} # ac_fn_c_try_cpp
9329+
9330+# ac_fn_c_try_run LINENO
9331+# ----------------------
9332+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
9333+# that executables *can* be run.
9334+ac_fn_c_try_run ()
9335+{
9336+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9337+ if { { ac_try="$ac_link"
9338+case "(($ac_try" in
9339+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9340+ *) ac_try_echo=$ac_try;;
9341+esac
9342+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
9343+$as_echo "$ac_try_echo"; } >&5
9344+ (eval "$ac_link") 2>&5
9345+ ac_status=$?
9346+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9347+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
9348+ { { case "(($ac_try" in
9349+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9350+ *) ac_try_echo=$ac_try;;
9351+esac
9352+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
9353+$as_echo "$ac_try_echo"; } >&5
9354+ (eval "$ac_try") 2>&5
9355+ ac_status=$?
9356+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9357+ test $ac_status = 0; }; }; then :
9358+ ac_retval=0
9359+else
9360+ $as_echo "$as_me: program exited with status $ac_status" >&5
9361+ $as_echo "$as_me: failed program was:" >&5
9362+sed 's/^/| /' conftest.$ac_ext >&5
9363+
9364+ ac_retval=$ac_status
9365+fi
9366+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
9367+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9368+ as_fn_set_status $ac_retval
9369+
9370+} # ac_fn_c_try_run
9371+
9372+# ac_fn_c_check_func LINENO FUNC VAR
9373+# ----------------------------------
9374+# Tests whether FUNC exists, setting the cache variable VAR accordingly
9375+ac_fn_c_check_func ()
9376+{
9377+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9378+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
9379+$as_echo_n "checking for $2... " >&6; }
9380+if eval \${$3+:} false; then :
9381+ $as_echo_n "(cached) " >&6
9382+else
9383+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9384+/* end confdefs.h. */
9385+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
9386+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
9387+#define $2 innocuous_$2
9388+
9389+/* System header to define __stub macros and hopefully few prototypes,
9390+ which can conflict with char $2 (); below.
9391+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
9392+ <limits.h> exists even on freestanding compilers. */
9393+
9394+#ifdef __STDC__
9395+# include <limits.h>
9396+#else
9397+# include <assert.h>
9398+#endif
9399+
9400+#undef $2
9401+
9402+/* Override any GCC internal prototype to avoid an error.
9403+ Use char because int might match the return type of a GCC
9404+ builtin and then its argument prototype would still apply. */
9405+#ifdef __cplusplus
9406+extern "C"
9407+#endif
9408+char $2 ();
9409+/* The GNU C library defines this for functions which it implements
9410+ to always fail with ENOSYS. Some functions are actually named
9411+ something starting with __ and the normal name is an alias. */
9412+#if defined __stub_$2 || defined __stub___$2
9413+choke me
9414+#endif
9415+
9416+int
9417+main ()
9418+{
9419+return $2 ();
9420+ ;
9421+ return 0;
9422+}
9423+_ACEOF
9424+if ac_fn_c_try_link "$LINENO"; then :
9425+ eval "$3=yes"
9426+else
9427+ eval "$3=no"
9428+fi
9429+rm -f core conftest.err conftest.$ac_objext \
9430+ conftest$ac_exeext conftest.$ac_ext
9431+fi
9432+eval ac_res=\$$3
9433+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
9434+$as_echo "$ac_res" >&6; }
9435+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9436+
9437+} # ac_fn_c_check_func
9438+
9439+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
9440+# -------------------------------------------------------
9441+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
9442+# the include files in INCLUDES and setting the cache variable VAR
9443+# accordingly.
9444+ac_fn_c_check_header_mongrel ()
9445+{
9446+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9447+ if eval \${$3+:} false; then :
9448+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
9449+$as_echo_n "checking for $2... " >&6; }
9450+if eval \${$3+:} false; then :
9451+ $as_echo_n "(cached) " >&6
9452+fi
9453+eval ac_res=\$$3
9454+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
9455+$as_echo "$ac_res" >&6; }
9456+else
9457+ # Is the header compilable?
9458+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
9459+$as_echo_n "checking $2 usability... " >&6; }
9460+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9461+/* end confdefs.h. */
9462+$4
9463+#include <$2>
9464+_ACEOF
9465+if ac_fn_c_try_compile "$LINENO"; then :
9466+ ac_header_compiler=yes
9467+else
9468+ ac_header_compiler=no
9469+fi
9470+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9471+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
9472+$as_echo "$ac_header_compiler" >&6; }
9473+
9474+# Is the header present?
9475+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
9476+$as_echo_n "checking $2 presence... " >&6; }
9477+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9478+/* end confdefs.h. */
9479+#include <$2>
9480+_ACEOF
9481+if ac_fn_c_try_cpp "$LINENO"; then :
9482+ ac_header_preproc=yes
9483+else
9484+ ac_header_preproc=no
9485+fi
9486+rm -f conftest.err conftest.i conftest.$ac_ext
9487+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
9488+$as_echo "$ac_header_preproc" >&6; }
9489+
9490+# So? What about this header?
9491+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
9492+ yes:no: )
9493+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
9494+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
9495+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
9496+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
9497+ ;;
9498+ no:yes:* )
9499+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
9500+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
9501+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
9502+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
9503+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
9504+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
9505+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
9506+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
9507+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
9508+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
9509+( $as_echo "## --------------------------- ##
9510+## Report this to kyzer@4u.net ##
9511+## --------------------------- ##"
9512+ ) | sed "s/^/$as_me: WARNING: /" >&2
9513+ ;;
9514+esac
9515+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
9516+$as_echo_n "checking for $2... " >&6; }
9517+if eval \${$3+:} false; then :
9518+ $as_echo_n "(cached) " >&6
9519+else
9520+ eval "$3=\$ac_header_compiler"
9521+fi
9522+eval ac_res=\$$3
9523+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
9524+$as_echo "$ac_res" >&6; }
9525+fi
9526+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9527+
9528+} # ac_fn_c_check_header_mongrel
9529+
9530+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
9531+# -------------------------------------------
9532+# Tests whether TYPE exists after having included INCLUDES, setting cache
9533+# variable VAR accordingly.
9534+ac_fn_c_check_type ()
9535+{
9536+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9537+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
9538+$as_echo_n "checking for $2... " >&6; }
9539+if eval \${$3+:} false; then :
9540+ $as_echo_n "(cached) " >&6
9541+else
9542+ eval "$3=no"
9543+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9544+/* end confdefs.h. */
9545+$4
9546+int
9547+main ()
9548+{
9549+if (sizeof ($2))
9550+ return 0;
9551+ ;
9552+ return 0;
9553+}
9554+_ACEOF
9555+if ac_fn_c_try_compile "$LINENO"; then :
9556+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9557+/* end confdefs.h. */
9558+$4
9559+int
9560+main ()
9561+{
9562+if (sizeof (($2)))
9563+ return 0;
9564+ ;
9565+ return 0;
9566+}
9567+_ACEOF
9568+if ac_fn_c_try_compile "$LINENO"; then :
9569+
9570+else
9571+ eval "$3=yes"
9572+fi
9573+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9574+fi
9575+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9576+fi
9577+eval ac_res=\$$3
9578+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
9579+$as_echo "$ac_res" >&6; }
9580+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9581+
9582+} # ac_fn_c_check_type
9583+
9584+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
9585+# --------------------------------------------
9586+# Tries to find the compile-time value of EXPR in a program that includes
9587+# INCLUDES, setting VAR accordingly. Returns whether the value could be
9588+# computed
9589+ac_fn_c_compute_int ()
9590+{
9591+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9592+ if test "$cross_compiling" = yes; then
9593+ # Depending upon the size, compute the lo and hi bounds.
9594+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9595+/* end confdefs.h. */
9596+$4
9597+int
9598+main ()
9599+{
9600+static int test_array [1 - 2 * !(($2) >= 0)];
9601+test_array [0] = 0
9602+
9603+ ;
9604+ return 0;
9605+}
9606+_ACEOF
9607+if ac_fn_c_try_compile "$LINENO"; then :
9608+ ac_lo=0 ac_mid=0
9609+ while :; do
9610+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9611+/* end confdefs.h. */
9612+$4
9613+int
9614+main ()
9615+{
9616+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
9617+test_array [0] = 0
9618+
9619+ ;
9620+ return 0;
9621+}
9622+_ACEOF
9623+if ac_fn_c_try_compile "$LINENO"; then :
9624+ ac_hi=$ac_mid; break
9625+else
9626+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
9627+ if test $ac_lo -le $ac_mid; then
9628+ ac_lo= ac_hi=
9629+ break
9630+ fi
9631+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
9632+fi
9633+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9634+ done
9635+else
9636+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9637+/* end confdefs.h. */
9638+$4
9639+int
9640+main ()
9641+{
9642+static int test_array [1 - 2 * !(($2) < 0)];
9643+test_array [0] = 0
9644+
9645+ ;
9646+ return 0;
9647+}
9648+_ACEOF
9649+if ac_fn_c_try_compile "$LINENO"; then :
9650+ ac_hi=-1 ac_mid=-1
9651+ while :; do
9652+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9653+/* end confdefs.h. */
9654+$4
9655+int
9656+main ()
9657+{
9658+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
9659+test_array [0] = 0
9660+
9661+ ;
9662+ return 0;
9663+}
9664+_ACEOF
9665+if ac_fn_c_try_compile "$LINENO"; then :
9666+ ac_lo=$ac_mid; break
9667+else
9668+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
9669+ if test $ac_mid -le $ac_hi; then
9670+ ac_lo= ac_hi=
9671+ break
9672+ fi
9673+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
9674+fi
9675+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9676+ done
9677+else
9678+ ac_lo= ac_hi=
9679+fi
9680+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9681+fi
9682+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9683+# Binary search between lo and hi bounds.
9684+while test "x$ac_lo" != "x$ac_hi"; do
9685+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
9686+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9687+/* end confdefs.h. */
9688+$4
9689+int
9690+main ()
9691+{
9692+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
9693+test_array [0] = 0
9694+
9695+ ;
9696+ return 0;
9697+}
9698+_ACEOF
9699+if ac_fn_c_try_compile "$LINENO"; then :
9700+ ac_hi=$ac_mid
9701+else
9702+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
9703+fi
9704+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9705+done
9706+case $ac_lo in #((
9707+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
9708+'') ac_retval=1 ;;
9709+esac
9710+ else
9711+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9712+/* end confdefs.h. */
9713+$4
9714+static long int longval () { return $2; }
9715+static unsigned long int ulongval () { return $2; }
9716+#include <stdio.h>
9717+#include <stdlib.h>
9718+int
9719+main ()
9720+{
9721+
9722+ FILE *f = fopen ("conftest.val", "w");
9723+ if (! f)
9724+ return 1;
9725+ if (($2) < 0)
9726+ {
9727+ long int i = longval ();
9728+ if (i != ($2))
9729+ return 1;
9730+ fprintf (f, "%ld", i);
9731+ }
9732+ else
9733+ {
9734+ unsigned long int i = ulongval ();
9735+ if (i != ($2))
9736+ return 1;
9737+ fprintf (f, "%lu", i);
9738+ }
9739+ /* Do not output a trailing newline, as this causes \r\n confusion
9740+ on some platforms. */
9741+ return ferror (f) || fclose (f) != 0;
9742+
9743+ ;
9744+ return 0;
9745+}
9746+_ACEOF
9747+if ac_fn_c_try_run "$LINENO"; then :
9748+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
9749+else
9750+ ac_retval=1
9751+fi
9752+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9753+ conftest.$ac_objext conftest.beam conftest.$ac_ext
9754+rm -f conftest.val
9755+
9756+ fi
9757+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
9758+ as_fn_set_status $ac_retval
9759+
9760+} # ac_fn_c_compute_int
9761+cat >config.log <<_ACEOF
9762+This file contains any messages produced by compilers while
9763+running configure, to aid debugging if configure makes a mistake.
9764+
9765+It was created by libmspack $as_me 0.4alpha, which was
9766+generated by GNU Autoconf 2.68. Invocation command line was
9767+
9768+ $ $0 $@
9769+
9770+_ACEOF
9771+exec 5>>config.log
9772+{
9773+cat <<_ASUNAME
9774+## --------- ##
9775+## Platform. ##
9776+## --------- ##
9777+
9778+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
9779+uname -m = `(uname -m) 2>/dev/null || echo unknown`
9780+uname -r = `(uname -r) 2>/dev/null || echo unknown`
9781+uname -s = `(uname -s) 2>/dev/null || echo unknown`
9782+uname -v = `(uname -v) 2>/dev/null || echo unknown`
9783+
9784+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
9785+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
9786+
9787+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
9788+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
9789+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
9790+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
9791+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
9792+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
9793+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
9794+
9795+_ASUNAME
9796+
9797+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9798+for as_dir in $PATH
9799+do
9800+ IFS=$as_save_IFS
9801+ test -z "$as_dir" && as_dir=.
9802+ $as_echo "PATH: $as_dir"
9803+ done
9804+IFS=$as_save_IFS
9805+
9806+} >&5
9807+
9808+cat >&5 <<_ACEOF
9809+
9810+
9811+## ----------- ##
9812+## Core tests. ##
9813+## ----------- ##
9814+
9815+_ACEOF
9816+
9817+
9818+# Keep a trace of the command line.
9819+# Strip out --no-create and --no-recursion so they do not pile up.
9820+# Strip out --silent because we don't want to record it for future runs.
9821+# Also quote any args containing shell meta-characters.
9822+# Make two passes to allow for proper duplicate-argument suppression.
9823+ac_configure_args=
9824+ac_configure_args0=
9825+ac_configure_args1=
9826+ac_must_keep_next=false
9827+for ac_pass in 1 2
9828+do
9829+ for ac_arg
9830+ do
9831+ case $ac_arg in
9832+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
9833+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
9834+ | -silent | --silent | --silen | --sile | --sil)
9835+ continue ;;
9836+ *\'*)
9837+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
9838+ esac
9839+ case $ac_pass in
9840+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
9841+ 2)
9842+ as_fn_append ac_configure_args1 " '$ac_arg'"
9843+ if test $ac_must_keep_next = true; then
9844+ ac_must_keep_next=false # Got value, back to normal.
9845+ else
9846+ case $ac_arg in
9847+ *=* | --config-cache | -C | -disable-* | --disable-* \
9848+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
9849+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
9850+ | -with-* | --with-* | -without-* | --without-* | --x)
9851+ case "$ac_configure_args0 " in
9852+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
9853+ esac
9854+ ;;
9855+ -* ) ac_must_keep_next=true ;;
9856+ esac
9857+ fi
9858+ as_fn_append ac_configure_args " '$ac_arg'"
9859+ ;;
9860+ esac
9861+ done
9862+done
9863+{ ac_configure_args0=; unset ac_configure_args0;}
9864+{ ac_configure_args1=; unset ac_configure_args1;}
9865+
9866+# When interrupted or exit'd, cleanup temporary files, and complete
9867+# config.log. We remove comments because anyway the quotes in there
9868+# would cause problems or look ugly.
9869+# WARNING: Use '\'' to represent an apostrophe within the trap.
9870+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
9871+trap 'exit_status=$?
9872+ # Save into config.log some information that might help in debugging.
9873+ {
9874+ echo
9875+
9876+ $as_echo "## ---------------- ##
9877+## Cache variables. ##
9878+## ---------------- ##"
9879+ echo
9880+ # The following way of writing the cache mishandles newlines in values,
9881+(
9882+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
9883+ eval ac_val=\$$ac_var
9884+ case $ac_val in #(
9885+ *${as_nl}*)
9886+ case $ac_var in #(
9887+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
9888+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
9889+ esac
9890+ case $ac_var in #(
9891+ _ | IFS | as_nl) ;; #(
9892+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
9893+ *) { eval $ac_var=; unset $ac_var;} ;;
9894+ esac ;;
9895+ esac
9896+ done
9897+ (set) 2>&1 |
9898+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
9899+ *${as_nl}ac_space=\ *)
9900+ sed -n \
9901+ "s/'\''/'\''\\\\'\'''\''/g;
9902+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
9903+ ;; #(
9904+ *)
9905+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
9906+ ;;
9907+ esac |
9908+ sort
9909+)
9910+ echo
9911+
9912+ $as_echo "## ----------------- ##
9913+## Output variables. ##
9914+## ----------------- ##"
9915+ echo
9916+ for ac_var in $ac_subst_vars
9917+ do
9918+ eval ac_val=\$$ac_var
9919+ case $ac_val in
9920+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
9921+ esac
9922+ $as_echo "$ac_var='\''$ac_val'\''"
9923+ done | sort
9924+ echo
9925+
9926+ if test -n "$ac_subst_files"; then
9927+ $as_echo "## ------------------- ##
9928+## File substitutions. ##
9929+## ------------------- ##"
9930+ echo
9931+ for ac_var in $ac_subst_files
9932+ do
9933+ eval ac_val=\$$ac_var
9934+ case $ac_val in
9935+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
9936+ esac
9937+ $as_echo "$ac_var='\''$ac_val'\''"
9938+ done | sort
9939+ echo
9940+ fi
9941+
9942+ if test -s confdefs.h; then
9943+ $as_echo "## ----------- ##
9944+## confdefs.h. ##
9945+## ----------- ##"
9946+ echo
9947+ cat confdefs.h
9948+ echo
9949+ fi
9950+ test "$ac_signal" != 0 &&
9951+ $as_echo "$as_me: caught signal $ac_signal"
9952+ $as_echo "$as_me: exit $exit_status"
9953+ } >&5
9954+ rm -f core *.core core.conftest.* &&
9955+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
9956+ exit $exit_status
9957+' 0
9958+for ac_signal in 1 2 13 15; do
9959+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
9960+done
9961+ac_signal=0
9962+
9963+# confdefs.h avoids OS command line length limits that DEFS can exceed.
9964+rm -f -r conftest* confdefs.h
9965+
9966+$as_echo "/* confdefs.h */" > confdefs.h
9967+
9968+# Predefined preprocessor variables.
9969+
9970+cat >>confdefs.h <<_ACEOF
9971+#define PACKAGE_NAME "$PACKAGE_NAME"
9972+_ACEOF
9973+
9974+cat >>confdefs.h <<_ACEOF
9975+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
9976+_ACEOF
9977+
9978+cat >>confdefs.h <<_ACEOF
9979+#define PACKAGE_VERSION "$PACKAGE_VERSION"
9980+_ACEOF
9981+
9982+cat >>confdefs.h <<_ACEOF
9983+#define PACKAGE_STRING "$PACKAGE_STRING"
9984+_ACEOF
9985+
9986+cat >>confdefs.h <<_ACEOF
9987+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
9988+_ACEOF
9989+
9990+cat >>confdefs.h <<_ACEOF
9991+#define PACKAGE_URL "$PACKAGE_URL"
9992+_ACEOF
9993+
9994+
9995+# Let the site file select an alternate cache file if it wants to.
9996+# Prefer an explicitly selected file to automatically selected ones.
9997+ac_site_file1=NONE
9998+ac_site_file2=NONE
9999+if test -n "$CONFIG_SITE"; then
10000+ # We do not want a PATH search for config.site.
10001+ case $CONFIG_SITE in #((
10002+ -*) ac_site_file1=./$CONFIG_SITE;;
10003+ */*) ac_site_file1=$CONFIG_SITE;;
10004+ *) ac_site_file1=./$CONFIG_SITE;;
10005+ esac
10006+elif test "x$prefix" != xNONE; then
10007+ ac_site_file1=$prefix/share/config.site
10008+ ac_site_file2=$prefix/etc/config.site
10009+else
10010+ ac_site_file1=$ac_default_prefix/share/config.site
10011+ ac_site_file2=$ac_default_prefix/etc/config.site
10012+fi
10013+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
10014+do
10015+ test "x$ac_site_file" = xNONE && continue
10016+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
10017+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
10018+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
10019+ sed 's/^/| /' "$ac_site_file" >&5
10020+ . "$ac_site_file" \
10021+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
10022+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
10023+as_fn_error $? "failed to load site script $ac_site_file
10024+See \`config.log' for more details" "$LINENO" 5; }
10025+ fi
10026+done
10027+
10028+if test -r "$cache_file"; then
10029+ # Some versions of bash will fail to source /dev/null (special files
10030+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
10031+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
10032+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
10033+$as_echo "$as_me: loading cache $cache_file" >&6;}
10034+ case $cache_file in
10035+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
10036+ *) . "./$cache_file";;
10037+ esac
10038+ fi
10039+else
10040+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
10041+$as_echo "$as_me: creating cache $cache_file" >&6;}
10042+ >$cache_file
10043+fi
10044+
10045+# Check that the precious variables saved in the cache have kept the same
10046+# value.
10047+ac_cache_corrupted=false
10048+for ac_var in $ac_precious_vars; do
10049+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
10050+ eval ac_new_set=\$ac_env_${ac_var}_set
10051+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
10052+ eval ac_new_val=\$ac_env_${ac_var}_value
10053+ case $ac_old_set,$ac_new_set in
10054+ set,)
10055+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
10056+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
10057+ ac_cache_corrupted=: ;;
10058+ ,set)
10059+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
10060+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
10061+ ac_cache_corrupted=: ;;
10062+ ,);;
10063+ *)
10064+ if test "x$ac_old_val" != "x$ac_new_val"; then
10065+ # differences in whitespace do not lead to failure.
10066+ ac_old_val_w=`echo x $ac_old_val`
10067+ ac_new_val_w=`echo x $ac_new_val`
10068+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
10069+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
10070+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
10071+ ac_cache_corrupted=:
10072+ else
10073+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
10074+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
10075+ eval $ac_var=\$ac_old_val
10076+ fi
10077+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
10078+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
10079+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
10080+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
10081+ fi;;
10082+ esac
10083+ # Pass precious variables to config.status.
10084+ if test "$ac_new_set" = set; then
10085+ case $ac_new_val in
10086+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
10087+ *) ac_arg=$ac_var=$ac_new_val ;;
10088+ esac
10089+ case " $ac_configure_args " in
10090+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
10091+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
10092+ esac
10093+ fi
10094+done
10095+if $ac_cache_corrupted; then
10096+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
10097+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
10098+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
10099+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
10100+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
10101+fi
10102+## -------------------- ##
10103+## Main body of script. ##
10104+## -------------------- ##
10105+
10106+ac_ext=c
10107+ac_cpp='$CPP $CPPFLAGS'
10108+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10109+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10110+ac_compiler_gnu=$ac_cv_c_compiler_gnu
10111+
10112+
10113+
10114+am__api_version='1.11'
10115+
10116+ac_aux_dir=
10117+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
10118+ if test -f "$ac_dir/install-sh"; then
10119+ ac_aux_dir=$ac_dir
10120+ ac_install_sh="$ac_aux_dir/install-sh -c"
10121+ break
10122+ elif test -f "$ac_dir/install.sh"; then
10123+ ac_aux_dir=$ac_dir
10124+ ac_install_sh="$ac_aux_dir/install.sh -c"
10125+ break
10126+ elif test -f "$ac_dir/shtool"; then
10127+ ac_aux_dir=$ac_dir
10128+ ac_install_sh="$ac_aux_dir/shtool install -c"
10129+ break
10130+ fi
10131+done
10132+if test -z "$ac_aux_dir"; then
10133+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
10134+fi
10135+
10136+# These three variables are undocumented and unsupported,
10137+# and are intended to be withdrawn in a future Autoconf release.
10138+# They can cause serious problems if a builder's source tree is in a directory
10139+# whose full name contains unusual characters.
10140+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
10141+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
10142+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
10143+
10144+
10145+# Find a good install program. We prefer a C program (faster),
10146+# so one script is as good as another. But avoid the broken or
10147+# incompatible versions:
10148+# SysV /etc/install, /usr/sbin/install
10149+# SunOS /usr/etc/install
10150+# IRIX /sbin/install
10151+# AIX /bin/install
10152+# AmigaOS /C/install, which installs bootblocks on floppy discs
10153+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
10154+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
10155+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
10156+# OS/2's system install, which has a completely different semantic
10157+# ./install, which can be erroneously created by make from ./install.sh.
10158+# Reject install programs that cannot install multiple files.
10159+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
10160+$as_echo_n "checking for a BSD-compatible install... " >&6; }
10161+if test -z "$INSTALL"; then
10162+if ${ac_cv_path_install+:} false; then :
10163+ $as_echo_n "(cached) " >&6
10164+else
10165+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10166+for as_dir in $PATH
10167+do
10168+ IFS=$as_save_IFS
10169+ test -z "$as_dir" && as_dir=.
10170+ # Account for people who put trailing slashes in PATH elements.
10171+case $as_dir/ in #((
10172+ ./ | .// | /[cC]/* | \
10173+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
10174+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
10175+ /usr/ucb/* ) ;;
10176+ *)
10177+ # OSF1 and SCO ODT 3.0 have their own names for install.
10178+ # Don't use installbsd from OSF since it installs stuff as root
10179+ # by default.
10180+ for ac_prog in ginstall scoinst install; do
10181+ for ac_exec_ext in '' $ac_executable_extensions; do
10182+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
10183+ if test $ac_prog = install &&
10184+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
10185+ # AIX install. It has an incompatible calling convention.
10186+ :
10187+ elif test $ac_prog = install &&
10188+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
10189+ # program-specific install script used by HP pwplus--don't use.
10190+ :
10191+ else
10192+ rm -rf conftest.one conftest.two conftest.dir
10193+ echo one > conftest.one
10194+ echo two > conftest.two
10195+ mkdir conftest.dir
10196+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
10197+ test -s conftest.one && test -s conftest.two &&
10198+ test -s conftest.dir/conftest.one &&
10199+ test -s conftest.dir/conftest.two
10200+ then
10201+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
10202+ break 3
10203+ fi
10204+ fi
10205+ fi
10206+ done
10207+ done
10208+ ;;
10209+esac
10210+
10211+ done
10212+IFS=$as_save_IFS
10213+
10214+rm -rf conftest.one conftest.two conftest.dir
10215+
10216+fi
10217+ if test "${ac_cv_path_install+set}" = set; then
10218+ INSTALL=$ac_cv_path_install
10219+ else
10220+ # As a last resort, use the slow shell script. Don't cache a
10221+ # value for INSTALL within a source directory, because that will
10222+ # break other packages using the cache if that directory is
10223+ # removed, or if the value is a relative name.
10224+ INSTALL=$ac_install_sh
10225+ fi
10226+fi
10227+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
10228+$as_echo "$INSTALL" >&6; }
10229+
10230+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
10231+# It thinks the first close brace ends the variable substitution.
10232+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
10233+
10234+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
10235+
10236+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
10237+
10238+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
10239+$as_echo_n "checking whether build environment is sane... " >&6; }
10240+# Just in case
10241+sleep 1
10242+echo timestamp > conftest.file
10243+# Reject unsafe characters in $srcdir or the absolute working directory
10244+# name. Accept space and tab only in the latter.
10245+am_lf='
10246+'
10247+case `pwd` in
10248+ *[\\\"\#\$\&\'\`$am_lf]*)
10249+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
10250+esac
10251+case $srcdir in
10252+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
10253+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
10254+esac
10255+
10256+# Do `set' in a subshell so we don't clobber the current shell's
10257+# arguments. Must try -L first in case configure is actually a
10258+# symlink; some systems play weird games with the mod time of symlinks
10259+# (eg FreeBSD returns the mod time of the symlink's containing
10260+# directory).
10261+if (
10262+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
10263+ if test "$*" = "X"; then
10264+ # -L didn't work.
10265+ set X `ls -t "$srcdir/configure" conftest.file`
10266+ fi
10267+ rm -f conftest.file
10268+ if test "$*" != "X $srcdir/configure conftest.file" \
10269+ && test "$*" != "X conftest.file $srcdir/configure"; then
10270+
10271+ # If neither matched, then we have a broken ls. This can happen
10272+ # if, for instance, CONFIG_SHELL is bash and it inherits a
10273+ # broken ls alias from the environment. This has actually
10274+ # happened. Such a system could not be considered "sane".
10275+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
10276+alias in your environment" "$LINENO" 5
10277+ fi
10278+
10279+ test "$2" = conftest.file
10280+ )
10281+then
10282+ # Ok.
10283+ :
10284+else
10285+ as_fn_error $? "newly created file is older than distributed files!
10286+Check your system clock" "$LINENO" 5
10287+fi
10288+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10289+$as_echo "yes" >&6; }
10290+test "$program_prefix" != NONE &&
10291+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
10292+# Use a double $ so make ignores it.
10293+test "$program_suffix" != NONE &&
10294+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
10295+# Double any \ or $.
10296+# By default was `s,x,x', remove it if useless.
10297+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
10298+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
10299+
10300+# expand $ac_aux_dir to an absolute path
10301+am_aux_dir=`cd $ac_aux_dir && pwd`
10302+
10303+if test x"${MISSING+set}" != xset; then
10304+ case $am_aux_dir in
10305+ *\ * | *\ *)
10306+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
10307+ *)
10308+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
10309+ esac
10310+fi
10311+# Use eval to expand $SHELL
10312+if eval "$MISSING --run true"; then
10313+ am_missing_run="$MISSING --run "
10314+else
10315+ am_missing_run=
10316+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
10317+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
10318+fi
10319+
10320+if test x"${install_sh}" != xset; then
10321+ case $am_aux_dir in
10322+ *\ * | *\ *)
10323+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
10324+ *)
10325+ install_sh="\${SHELL} $am_aux_dir/install-sh"
10326+ esac
10327+fi
10328+
10329+# Installed binaries are usually stripped using `strip' when the user
10330+# run `make install-strip'. However `strip' might not be the right
10331+# tool to use in cross-compilation environments, therefore Automake
10332+# will honor the `STRIP' environment variable to overrule this program.
10333+if test "$cross_compiling" != no; then
10334+ if test -n "$ac_tool_prefix"; then
10335+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
10336+set dummy ${ac_tool_prefix}strip; ac_word=$2
10337+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10338+$as_echo_n "checking for $ac_word... " >&6; }
10339+if ${ac_cv_prog_STRIP+:} false; then :
10340+ $as_echo_n "(cached) " >&6
10341+else
10342+ if test -n "$STRIP"; then
10343+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
10344+else
10345+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10346+for as_dir in $PATH
10347+do
10348+ IFS=$as_save_IFS
10349+ test -z "$as_dir" && as_dir=.
10350+ for ac_exec_ext in '' $ac_executable_extensions; do
10351+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10352+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
10353+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10354+ break 2
10355+ fi
10356+done
10357+ done
10358+IFS=$as_save_IFS
10359+
10360+fi
10361+fi
10362+STRIP=$ac_cv_prog_STRIP
10363+if test -n "$STRIP"; then
10364+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
10365+$as_echo "$STRIP" >&6; }
10366+else
10367+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10368+$as_echo "no" >&6; }
10369+fi
10370+
10371+
10372+fi
10373+if test -z "$ac_cv_prog_STRIP"; then
10374+ ac_ct_STRIP=$STRIP
10375+ # Extract the first word of "strip", so it can be a program name with args.
10376+set dummy strip; ac_word=$2
10377+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10378+$as_echo_n "checking for $ac_word... " >&6; }
10379+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
10380+ $as_echo_n "(cached) " >&6
10381+else
10382+ if test -n "$ac_ct_STRIP"; then
10383+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
10384+else
10385+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10386+for as_dir in $PATH
10387+do
10388+ IFS=$as_save_IFS
10389+ test -z "$as_dir" && as_dir=.
10390+ for ac_exec_ext in '' $ac_executable_extensions; do
10391+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10392+ ac_cv_prog_ac_ct_STRIP="strip"
10393+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10394+ break 2
10395+ fi
10396+done
10397+ done
10398+IFS=$as_save_IFS
10399+
10400+fi
10401+fi
10402+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
10403+if test -n "$ac_ct_STRIP"; then
10404+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
10405+$as_echo "$ac_ct_STRIP" >&6; }
10406+else
10407+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10408+$as_echo "no" >&6; }
10409+fi
10410+
10411+ if test "x$ac_ct_STRIP" = x; then
10412+ STRIP=":"
10413+ else
10414+ case $cross_compiling:$ac_tool_warned in
10415+yes:)
10416+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
10417+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
10418+ac_tool_warned=yes ;;
10419+esac
10420+ STRIP=$ac_ct_STRIP
10421+ fi
10422+else
10423+ STRIP="$ac_cv_prog_STRIP"
10424+fi
10425+
10426+fi
10427+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10428+
10429+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
10430+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
10431+if test -z "$MKDIR_P"; then
10432+ if ${ac_cv_path_mkdir+:} false; then :
10433+ $as_echo_n "(cached) " >&6
10434+else
10435+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10436+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
10437+do
10438+ IFS=$as_save_IFS
10439+ test -z "$as_dir" && as_dir=.
10440+ for ac_prog in mkdir gmkdir; do
10441+ for ac_exec_ext in '' $ac_executable_extensions; do
10442+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
10443+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
10444+ 'mkdir (GNU coreutils) '* | \
10445+ 'mkdir (coreutils) '* | \
10446+ 'mkdir (fileutils) '4.1*)
10447+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
10448+ break 3;;
10449+ esac
10450+ done
10451+ done
10452+ done
10453+IFS=$as_save_IFS
10454+
10455+fi
10456+
10457+ test -d ./--version && rmdir ./--version
10458+ if test "${ac_cv_path_mkdir+set}" = set; then
10459+ MKDIR_P="$ac_cv_path_mkdir -p"
10460+ else
10461+ # As a last resort, use the slow shell script. Don't cache a
10462+ # value for MKDIR_P within a source directory, because that will
10463+ # break other packages using the cache if that directory is
10464+ # removed, or if the value is a relative name.
10465+ MKDIR_P="$ac_install_sh -d"
10466+ fi
10467+fi
10468+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
10469+$as_echo "$MKDIR_P" >&6; }
10470+
10471+mkdir_p="$MKDIR_P"
10472+case $mkdir_p in
10473+ [\\/$]* | ?:[\\/]*) ;;
10474+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
10475+esac
10476+
10477+for ac_prog in gawk mawk nawk awk
10478+do
10479+ # Extract the first word of "$ac_prog", so it can be a program name with args.
10480+set dummy $ac_prog; ac_word=$2
10481+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10482+$as_echo_n "checking for $ac_word... " >&6; }
10483+if ${ac_cv_prog_AWK+:} false; then :
10484+ $as_echo_n "(cached) " >&6
10485+else
10486+ if test -n "$AWK"; then
10487+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
10488+else
10489+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10490+for as_dir in $PATH
10491+do
10492+ IFS=$as_save_IFS
10493+ test -z "$as_dir" && as_dir=.
10494+ for ac_exec_ext in '' $ac_executable_extensions; do
10495+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10496+ ac_cv_prog_AWK="$ac_prog"
10497+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10498+ break 2
10499+ fi
10500+done
10501+ done
10502+IFS=$as_save_IFS
10503+
10504+fi
10505+fi
10506+AWK=$ac_cv_prog_AWK
10507+if test -n "$AWK"; then
10508+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
10509+$as_echo "$AWK" >&6; }
10510+else
10511+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10512+$as_echo "no" >&6; }
10513+fi
10514+
10515+
10516+ test -n "$AWK" && break
10517+done
10518+
10519+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
10520+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
10521+set x ${MAKE-make}
10522+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
10523+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
10524+ $as_echo_n "(cached) " >&6
10525+else
10526+ cat >conftest.make <<\_ACEOF
10527+SHELL = /bin/sh
10528+all:
10529+ @echo '@@@%%%=$(MAKE)=@@@%%%'
10530+_ACEOF
10531+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
10532+case `${MAKE-make} -f conftest.make 2>/dev/null` in
10533+ *@@@%%%=?*=@@@%%%*)
10534+ eval ac_cv_prog_make_${ac_make}_set=yes;;
10535+ *)
10536+ eval ac_cv_prog_make_${ac_make}_set=no;;
10537+esac
10538+rm -f conftest.make
10539+fi
10540+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
10541+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10542+$as_echo "yes" >&6; }
10543+ SET_MAKE=
10544+else
10545+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10546+$as_echo "no" >&6; }
10547+ SET_MAKE="MAKE=${MAKE-make}"
10548+fi
10549+
10550+rm -rf .tst 2>/dev/null
10551+mkdir .tst 2>/dev/null
10552+if test -d .tst; then
10553+ am__leading_dot=.
10554+else
10555+ am__leading_dot=_
10556+fi
10557+rmdir .tst 2>/dev/null
10558+
10559+if test "`cd $srcdir && pwd`" != "`pwd`"; then
10560+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
10561+ # is not polluted with repeated "-I."
10562+ am__isrc=' -I$(srcdir)'
10563+ # test to see if srcdir already configured
10564+ if test -f $srcdir/config.status; then
10565+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
10566+ fi
10567+fi
10568+
10569+# test whether we have cygpath
10570+if test -z "$CYGPATH_W"; then
10571+ if (cygpath --version) >/dev/null 2>/dev/null; then
10572+ CYGPATH_W='cygpath -w'
10573+ else
10574+ CYGPATH_W=echo
10575+ fi
10576+fi
10577+
10578+
10579+# Define the identity of the package.
10580+ PACKAGE='libmspack'
10581+ VERSION='0.4alpha'
10582+
10583+
10584+cat >>confdefs.h <<_ACEOF
10585+#define PACKAGE "$PACKAGE"
10586+_ACEOF
10587+
10588+
10589+cat >>confdefs.h <<_ACEOF
10590+#define VERSION "$VERSION"
10591+_ACEOF
10592+
10593+# Some tools Automake needs.
10594+
10595+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
10596+
10597+
10598+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
10599+
10600+
10601+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
10602+
10603+
10604+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
10605+
10606+
10607+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
10608+
10609+# We need awk for the "check" target. The system "awk" is bad on
10610+# some platforms.
10611+# Always define AMTAR for backward compatibility. Yes, it's still used
10612+# in the wild :-( We should find a proper way to deprecate it ...
10613+AMTAR='$${TAR-tar}'
10614+
10615+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
10616+
10617+
10618+
10619+
10620+
10621+
10622+ac_config_headers="$ac_config_headers config.h"
10623+
10624+
10625+# Check whether --enable-silent-rules was given.
10626+if test "${enable_silent_rules+set}" = set; then :
10627+ enableval=$enable_silent_rules;
10628+fi
10629+
10630+case $enable_silent_rules in
10631+yes) AM_DEFAULT_VERBOSITY=0;;
10632+no) AM_DEFAULT_VERBOSITY=1;;
10633+*) AM_DEFAULT_VERBOSITY=0;;
10634+esac
10635+am_make=${MAKE-make}
10636+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
10637+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
10638+if ${am_cv_make_support_nested_variables+:} false; then :
10639+ $as_echo_n "(cached) " >&6
10640+else
10641+ if $as_echo 'TRUE=$(BAR$(V))
10642+BAR0=false
10643+BAR1=true
10644+V=1
10645+am__doit:
10646+ @$(TRUE)
10647+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
10648+ am_cv_make_support_nested_variables=yes
10649+else
10650+ am_cv_make_support_nested_variables=no
10651+fi
10652+fi
10653+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
10654+$as_echo "$am_cv_make_support_nested_variables" >&6; }
10655+if test $am_cv_make_support_nested_variables = yes; then
10656+ AM_V='$(V)'
10657+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
10658+else
10659+ AM_V=$AM_DEFAULT_VERBOSITY
10660+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
10661+fi
10662+AM_BACKSLASH='\'
10663+
10664+
10665+# --enable-debug option
10666+# Check whether --enable-debug was given.
10667+if test "${enable_debug+set}" = set; then :
10668+ enableval=$enable_debug; enable_debug=$enableval
10669+else
10670+ enable_debug=no
10671+fi
10672+
10673+if test x$enable_debug = xyes; then
10674+
10675+$as_echo "#define DEBUG 1" >>confdefs.h
10676+
10677+fi
10678+ if test x$enable_debug = 'xyes'; then
10679+ DEBUG_TRUE=
10680+ DEBUG_FALSE='#'
10681+else
10682+ DEBUG_TRUE='#'
10683+ DEBUG_FALSE=
10684+fi
10685+
10686+
10687+# Checks for programs.
10688+ac_ext=c
10689+ac_cpp='$CPP $CPPFLAGS'
10690+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10691+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10692+ac_compiler_gnu=$ac_cv_c_compiler_gnu
10693+if test -n "$ac_tool_prefix"; then
10694+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
10695+set dummy ${ac_tool_prefix}gcc; ac_word=$2
10696+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10697+$as_echo_n "checking for $ac_word... " >&6; }
10698+if ${ac_cv_prog_CC+:} false; then :
10699+ $as_echo_n "(cached) " >&6
10700+else
10701+ if test -n "$CC"; then
10702+ ac_cv_prog_CC="$CC" # Let the user override the test.
10703+else
10704+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10705+for as_dir in $PATH
10706+do
10707+ IFS=$as_save_IFS
10708+ test -z "$as_dir" && as_dir=.
10709+ for ac_exec_ext in '' $ac_executable_extensions; do
10710+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10711+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
10712+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10713+ break 2
10714+ fi
10715+done
10716+ done
10717+IFS=$as_save_IFS
10718+
10719+fi
10720+fi
10721+CC=$ac_cv_prog_CC
10722+if test -n "$CC"; then
10723+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
10724+$as_echo "$CC" >&6; }
10725+else
10726+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10727+$as_echo "no" >&6; }
10728+fi
10729+
10730+
10731+fi
10732+if test -z "$ac_cv_prog_CC"; then
10733+ ac_ct_CC=$CC
10734+ # Extract the first word of "gcc", so it can be a program name with args.
10735+set dummy gcc; ac_word=$2
10736+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10737+$as_echo_n "checking for $ac_word... " >&6; }
10738+if ${ac_cv_prog_ac_ct_CC+:} false; then :
10739+ $as_echo_n "(cached) " >&6
10740+else
10741+ if test -n "$ac_ct_CC"; then
10742+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
10743+else
10744+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10745+for as_dir in $PATH
10746+do
10747+ IFS=$as_save_IFS
10748+ test -z "$as_dir" && as_dir=.
10749+ for ac_exec_ext in '' $ac_executable_extensions; do
10750+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10751+ ac_cv_prog_ac_ct_CC="gcc"
10752+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10753+ break 2
10754+ fi
10755+done
10756+ done
10757+IFS=$as_save_IFS
10758+
10759+fi
10760+fi
10761+ac_ct_CC=$ac_cv_prog_ac_ct_CC
10762+if test -n "$ac_ct_CC"; then
10763+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
10764+$as_echo "$ac_ct_CC" >&6; }
10765+else
10766+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10767+$as_echo "no" >&6; }
10768+fi
10769+
10770+ if test "x$ac_ct_CC" = x; then
10771+ CC=""
10772+ else
10773+ case $cross_compiling:$ac_tool_warned in
10774+yes:)
10775+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
10776+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
10777+ac_tool_warned=yes ;;
10778+esac
10779+ CC=$ac_ct_CC
10780+ fi
10781+else
10782+ CC="$ac_cv_prog_CC"
10783+fi
10784+
10785+if test -z "$CC"; then
10786+ if test -n "$ac_tool_prefix"; then
10787+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
10788+set dummy ${ac_tool_prefix}cc; ac_word=$2
10789+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10790+$as_echo_n "checking for $ac_word... " >&6; }
10791+if ${ac_cv_prog_CC+:} false; then :
10792+ $as_echo_n "(cached) " >&6
10793+else
10794+ if test -n "$CC"; then
10795+ ac_cv_prog_CC="$CC" # Let the user override the test.
10796+else
10797+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10798+for as_dir in $PATH
10799+do
10800+ IFS=$as_save_IFS
10801+ test -z "$as_dir" && as_dir=.
10802+ for ac_exec_ext in '' $ac_executable_extensions; do
10803+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10804+ ac_cv_prog_CC="${ac_tool_prefix}cc"
10805+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10806+ break 2
10807+ fi
10808+done
10809+ done
10810+IFS=$as_save_IFS
10811+
10812+fi
10813+fi
10814+CC=$ac_cv_prog_CC
10815+if test -n "$CC"; then
10816+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
10817+$as_echo "$CC" >&6; }
10818+else
10819+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10820+$as_echo "no" >&6; }
10821+fi
10822+
10823+
10824+ fi
10825+fi
10826+if test -z "$CC"; then
10827+ # Extract the first word of "cc", so it can be a program name with args.
10828+set dummy cc; ac_word=$2
10829+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10830+$as_echo_n "checking for $ac_word... " >&6; }
10831+if ${ac_cv_prog_CC+:} false; then :
10832+ $as_echo_n "(cached) " >&6
10833+else
10834+ if test -n "$CC"; then
10835+ ac_cv_prog_CC="$CC" # Let the user override the test.
10836+else
10837+ ac_prog_rejected=no
10838+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10839+for as_dir in $PATH
10840+do
10841+ IFS=$as_save_IFS
10842+ test -z "$as_dir" && as_dir=.
10843+ for ac_exec_ext in '' $ac_executable_extensions; do
10844+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10845+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
10846+ ac_prog_rejected=yes
10847+ continue
10848+ fi
10849+ ac_cv_prog_CC="cc"
10850+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10851+ break 2
10852+ fi
10853+done
10854+ done
10855+IFS=$as_save_IFS
10856+
10857+if test $ac_prog_rejected = yes; then
10858+ # We found a bogon in the path, so make sure we never use it.
10859+ set dummy $ac_cv_prog_CC
10860+ shift
10861+ if test $# != 0; then
10862+ # We chose a different compiler from the bogus one.
10863+ # However, it has the same basename, so the bogon will be chosen
10864+ # first if we set CC to just the basename; use the full file name.
10865+ shift
10866+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
10867+ fi
10868+fi
10869+fi
10870+fi
10871+CC=$ac_cv_prog_CC
10872+if test -n "$CC"; then
10873+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
10874+$as_echo "$CC" >&6; }
10875+else
10876+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10877+$as_echo "no" >&6; }
10878+fi
10879+
10880+
10881+fi
10882+if test -z "$CC"; then
10883+ if test -n "$ac_tool_prefix"; then
10884+ for ac_prog in cl.exe
10885+ do
10886+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10887+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10888+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10889+$as_echo_n "checking for $ac_word... " >&6; }
10890+if ${ac_cv_prog_CC+:} false; then :
10891+ $as_echo_n "(cached) " >&6
10892+else
10893+ if test -n "$CC"; then
10894+ ac_cv_prog_CC="$CC" # Let the user override the test.
10895+else
10896+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10897+for as_dir in $PATH
10898+do
10899+ IFS=$as_save_IFS
10900+ test -z "$as_dir" && as_dir=.
10901+ for ac_exec_ext in '' $ac_executable_extensions; do
10902+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10903+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
10904+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10905+ break 2
10906+ fi
10907+done
10908+ done
10909+IFS=$as_save_IFS
10910+
10911+fi
10912+fi
10913+CC=$ac_cv_prog_CC
10914+if test -n "$CC"; then
10915+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
10916+$as_echo "$CC" >&6; }
10917+else
10918+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10919+$as_echo "no" >&6; }
10920+fi
10921+
10922+
10923+ test -n "$CC" && break
10924+ done
10925+fi
10926+if test -z "$CC"; then
10927+ ac_ct_CC=$CC
10928+ for ac_prog in cl.exe
10929+do
10930+ # Extract the first word of "$ac_prog", so it can be a program name with args.
10931+set dummy $ac_prog; ac_word=$2
10932+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10933+$as_echo_n "checking for $ac_word... " >&6; }
10934+if ${ac_cv_prog_ac_ct_CC+:} false; then :
10935+ $as_echo_n "(cached) " >&6
10936+else
10937+ if test -n "$ac_ct_CC"; then
10938+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
10939+else
10940+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10941+for as_dir in $PATH
10942+do
10943+ IFS=$as_save_IFS
10944+ test -z "$as_dir" && as_dir=.
10945+ for ac_exec_ext in '' $ac_executable_extensions; do
10946+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
10947+ ac_cv_prog_ac_ct_CC="$ac_prog"
10948+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10949+ break 2
10950+ fi
10951+done
10952+ done
10953+IFS=$as_save_IFS
10954+
10955+fi
10956+fi
10957+ac_ct_CC=$ac_cv_prog_ac_ct_CC
10958+if test -n "$ac_ct_CC"; then
10959+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
10960+$as_echo "$ac_ct_CC" >&6; }
10961+else
10962+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10963+$as_echo "no" >&6; }
10964+fi
10965+
10966+
10967+ test -n "$ac_ct_CC" && break
10968+done
10969+
10970+ if test "x$ac_ct_CC" = x; then
10971+ CC=""
10972+ else
10973+ case $cross_compiling:$ac_tool_warned in
10974+yes:)
10975+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
10976+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
10977+ac_tool_warned=yes ;;
10978+esac
10979+ CC=$ac_ct_CC
10980+ fi
10981+fi
10982+
10983+fi
10984+
10985+
10986+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
10987+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
10988+as_fn_error $? "no acceptable C compiler found in \$PATH
10989+See \`config.log' for more details" "$LINENO" 5; }
10990+
10991+# Provide some information about the compiler.
10992+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
10993+set X $ac_compile
10994+ac_compiler=$2
10995+for ac_option in --version -v -V -qversion; do
10996+ { { ac_try="$ac_compiler $ac_option >&5"
10997+case "(($ac_try" in
10998+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10999+ *) ac_try_echo=$ac_try;;
11000+esac
11001+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
11002+$as_echo "$ac_try_echo"; } >&5
11003+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
11004+ ac_status=$?
11005+ if test -s conftest.err; then
11006+ sed '10a\
11007+... rest of stderr output deleted ...
11008+ 10q' conftest.err >conftest.er1
11009+ cat conftest.er1 >&5
11010+ fi
11011+ rm -f conftest.er1 conftest.err
11012+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11013+ test $ac_status = 0; }
11014+done
11015+
11016+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11017+/* end confdefs.h. */
11018+
11019+int
11020+main ()
11021+{
11022+
11023+ ;
11024+ return 0;
11025+}
11026+_ACEOF
11027+ac_clean_files_save=$ac_clean_files
11028+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
11029+# Try to create an executable without -o first, disregard a.out.
11030+# It will help us diagnose broken compilers, and finding out an intuition
11031+# of exeext.
11032+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
11033+$as_echo_n "checking whether the C compiler works... " >&6; }
11034+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
11035+
11036+# The possible output files:
11037+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
11038+
11039+ac_rmfiles=
11040+for ac_file in $ac_files
11041+do
11042+ case $ac_file in
11043+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
11044+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
11045+ esac
11046+done
11047+rm -f $ac_rmfiles
11048+
11049+if { { ac_try="$ac_link_default"
11050+case "(($ac_try" in
11051+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11052+ *) ac_try_echo=$ac_try;;
11053+esac
11054+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
11055+$as_echo "$ac_try_echo"; } >&5
11056+ (eval "$ac_link_default") 2>&5
11057+ ac_status=$?
11058+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11059+ test $ac_status = 0; }; then :
11060+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
11061+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
11062+# in a Makefile. We should not override ac_cv_exeext if it was cached,
11063+# so that the user can short-circuit this test for compilers unknown to
11064+# Autoconf.
11065+for ac_file in $ac_files ''
11066+do
11067+ test -f "$ac_file" || continue
11068+ case $ac_file in
11069+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
11070+ ;;
11071+ [ab].out )
11072+ # We found the default executable, but exeext='' is most
11073+ # certainly right.
11074+ break;;
11075+ *.* )
11076+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
11077+ then :; else
11078+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
11079+ fi
11080+ # We set ac_cv_exeext here because the later test for it is not
11081+ # safe: cross compilers may not add the suffix if given an `-o'
11082+ # argument, so we may need to know it at that point already.
11083+ # Even if this section looks crufty: it has the advantage of
11084+ # actually working.
11085+ break;;
11086+ * )
11087+ break;;
11088+ esac
11089+done
11090+test "$ac_cv_exeext" = no && ac_cv_exeext=
11091+
11092+else
11093+ ac_file=''
11094+fi
11095+if test -z "$ac_file"; then :
11096+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11097+$as_echo "no" >&6; }
11098+$as_echo "$as_me: failed program was:" >&5
11099+sed 's/^/| /' conftest.$ac_ext >&5
11100+
11101+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11102+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11103+as_fn_error 77 "C compiler cannot create executables
11104+See \`config.log' for more details" "$LINENO" 5; }
11105+else
11106+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11107+$as_echo "yes" >&6; }
11108+fi
11109+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
11110+$as_echo_n "checking for C compiler default output file name... " >&6; }
11111+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
11112+$as_echo "$ac_file" >&6; }
11113+ac_exeext=$ac_cv_exeext
11114+
11115+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
11116+ac_clean_files=$ac_clean_files_save
11117+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
11118+$as_echo_n "checking for suffix of executables... " >&6; }
11119+if { { ac_try="$ac_link"
11120+case "(($ac_try" in
11121+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11122+ *) ac_try_echo=$ac_try;;
11123+esac
11124+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
11125+$as_echo "$ac_try_echo"; } >&5
11126+ (eval "$ac_link") 2>&5
11127+ ac_status=$?
11128+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11129+ test $ac_status = 0; }; then :
11130+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
11131+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
11132+# work properly (i.e., refer to `conftest.exe'), while it won't with
11133+# `rm'.
11134+for ac_file in conftest.exe conftest conftest.*; do
11135+ test -f "$ac_file" || continue
11136+ case $ac_file in
11137+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
11138+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
11139+ break;;
11140+ * ) break;;
11141+ esac
11142+done
11143+else
11144+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11145+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11146+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
11147+See \`config.log' for more details" "$LINENO" 5; }
11148+fi
11149+rm -f conftest conftest$ac_cv_exeext
11150+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
11151+$as_echo "$ac_cv_exeext" >&6; }
11152+
11153+rm -f conftest.$ac_ext
11154+EXEEXT=$ac_cv_exeext
11155+ac_exeext=$EXEEXT
11156+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11157+/* end confdefs.h. */
11158+#include <stdio.h>
11159+int
11160+main ()
11161+{
11162+FILE *f = fopen ("conftest.out", "w");
11163+ return ferror (f) || fclose (f) != 0;
11164+
11165+ ;
11166+ return 0;
11167+}
11168+_ACEOF
11169+ac_clean_files="$ac_clean_files conftest.out"
11170+# Check that the compiler produces executables we can run. If not, either
11171+# the compiler is broken, or we cross compile.
11172+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
11173+$as_echo_n "checking whether we are cross compiling... " >&6; }
11174+if test "$cross_compiling" != yes; then
11175+ { { ac_try="$ac_link"
11176+case "(($ac_try" in
11177+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11178+ *) ac_try_echo=$ac_try;;
11179+esac
11180+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
11181+$as_echo "$ac_try_echo"; } >&5
11182+ (eval "$ac_link") 2>&5
11183+ ac_status=$?
11184+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11185+ test $ac_status = 0; }
11186+ if { ac_try='./conftest$ac_cv_exeext'
11187+ { { case "(($ac_try" in
11188+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11189+ *) ac_try_echo=$ac_try;;
11190+esac
11191+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
11192+$as_echo "$ac_try_echo"; } >&5
11193+ (eval "$ac_try") 2>&5
11194+ ac_status=$?
11195+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11196+ test $ac_status = 0; }; }; then
11197+ cross_compiling=no
11198+ else
11199+ if test "$cross_compiling" = maybe; then
11200+ cross_compiling=yes
11201+ else
11202+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11203+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11204+as_fn_error $? "cannot run C compiled programs.
11205+If you meant to cross compile, use \`--host'.
11206+See \`config.log' for more details" "$LINENO" 5; }
11207+ fi
11208+ fi
11209+fi
11210+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
11211+$as_echo "$cross_compiling" >&6; }
11212+
11213+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
11214+ac_clean_files=$ac_clean_files_save
11215+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
11216+$as_echo_n "checking for suffix of object files... " >&6; }
11217+if ${ac_cv_objext+:} false; then :
11218+ $as_echo_n "(cached) " >&6
11219+else
11220+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11221+/* end confdefs.h. */
11222+
11223+int
11224+main ()
11225+{
11226+
11227+ ;
11228+ return 0;
11229+}
11230+_ACEOF
11231+rm -f conftest.o conftest.obj
11232+if { { ac_try="$ac_compile"
11233+case "(($ac_try" in
11234+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11235+ *) ac_try_echo=$ac_try;;
11236+esac
11237+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
11238+$as_echo "$ac_try_echo"; } >&5
11239+ (eval "$ac_compile") 2>&5
11240+ ac_status=$?
11241+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11242+ test $ac_status = 0; }; then :
11243+ for ac_file in conftest.o conftest.obj conftest.*; do
11244+ test -f "$ac_file" || continue;
11245+ case $ac_file in
11246+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
11247+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
11248+ break;;
11249+ esac
11250+done
11251+else
11252+ $as_echo "$as_me: failed program was:" >&5
11253+sed 's/^/| /' conftest.$ac_ext >&5
11254+
11255+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11256+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11257+as_fn_error $? "cannot compute suffix of object files: cannot compile
11258+See \`config.log' for more details" "$LINENO" 5; }
11259+fi
11260+rm -f conftest.$ac_cv_objext conftest.$ac_ext
11261+fi
11262+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
11263+$as_echo "$ac_cv_objext" >&6; }
11264+OBJEXT=$ac_cv_objext
11265+ac_objext=$OBJEXT
11266+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
11267+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
11268+if ${ac_cv_c_compiler_gnu+:} false; then :
11269+ $as_echo_n "(cached) " >&6
11270+else
11271+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11272+/* end confdefs.h. */
11273+
11274+int
11275+main ()
11276+{
11277+#ifndef __GNUC__
11278+ choke me
11279+#endif
11280+
11281+ ;
11282+ return 0;
11283+}
11284+_ACEOF
11285+if ac_fn_c_try_compile "$LINENO"; then :
11286+ ac_compiler_gnu=yes
11287+else
11288+ ac_compiler_gnu=no
11289+fi
11290+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11291+ac_cv_c_compiler_gnu=$ac_compiler_gnu
11292+
11293+fi
11294+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
11295+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
11296+if test $ac_compiler_gnu = yes; then
11297+ GCC=yes
11298+else
11299+ GCC=
11300+fi
11301+ac_test_CFLAGS=${CFLAGS+set}
11302+ac_save_CFLAGS=$CFLAGS
11303+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
11304+$as_echo_n "checking whether $CC accepts -g... " >&6; }
11305+if ${ac_cv_prog_cc_g+:} false; then :
11306+ $as_echo_n "(cached) " >&6
11307+else
11308+ ac_save_c_werror_flag=$ac_c_werror_flag
11309+ ac_c_werror_flag=yes
11310+ ac_cv_prog_cc_g=no
11311+ CFLAGS="-g"
11312+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11313+/* end confdefs.h. */
11314+
11315+int
11316+main ()
11317+{
11318+
11319+ ;
11320+ return 0;
11321+}
11322+_ACEOF
11323+if ac_fn_c_try_compile "$LINENO"; then :
11324+ ac_cv_prog_cc_g=yes
11325+else
11326+ CFLAGS=""
11327+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11328+/* end confdefs.h. */
11329+
11330+int
11331+main ()
11332+{
11333+
11334+ ;
11335+ return 0;
11336+}
11337+_ACEOF
11338+if ac_fn_c_try_compile "$LINENO"; then :
11339+
11340+else
11341+ ac_c_werror_flag=$ac_save_c_werror_flag
11342+ CFLAGS="-g"
11343+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11344+/* end confdefs.h. */
11345+
11346+int
11347+main ()
11348+{
11349+
11350+ ;
11351+ return 0;
11352+}
11353+_ACEOF
11354+if ac_fn_c_try_compile "$LINENO"; then :
11355+ ac_cv_prog_cc_g=yes
11356+fi
11357+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11358+fi
11359+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11360+fi
11361+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11362+ ac_c_werror_flag=$ac_save_c_werror_flag
11363+fi
11364+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
11365+$as_echo "$ac_cv_prog_cc_g" >&6; }
11366+if test "$ac_test_CFLAGS" = set; then
11367+ CFLAGS=$ac_save_CFLAGS
11368+elif test $ac_cv_prog_cc_g = yes; then
11369+ if test "$GCC" = yes; then
11370+ CFLAGS="-g -O2"
11371+ else
11372+ CFLAGS="-g"
11373+ fi
11374+else
11375+ if test "$GCC" = yes; then
11376+ CFLAGS="-O2"
11377+ else
11378+ CFLAGS=
11379+ fi
11380+fi
11381+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
11382+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
11383+if ${ac_cv_prog_cc_c89+:} false; then :
11384+ $as_echo_n "(cached) " >&6
11385+else
11386+ ac_cv_prog_cc_c89=no
11387+ac_save_CC=$CC
11388+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11389+/* end confdefs.h. */
11390+#include <stdarg.h>
11391+#include <stdio.h>
11392+#include <sys/types.h>
11393+#include <sys/stat.h>
11394+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
11395+struct buf { int x; };
11396+FILE * (*rcsopen) (struct buf *, struct stat *, int);
11397+static char *e (p, i)
11398+ char **p;
11399+ int i;
11400+{
11401+ return p[i];
11402+}
11403+static char *f (char * (*g) (char **, int), char **p, ...)
11404+{
11405+ char *s;
11406+ va_list v;
11407+ va_start (v,p);
11408+ s = g (p, va_arg (v,int));
11409+ va_end (v);
11410+ return s;
11411+}
11412+
11413+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
11414+ function prototypes and stuff, but not '\xHH' hex character constants.
11415+ These don't provoke an error unfortunately, instead are silently treated
11416+ as 'x'. The following induces an error, until -std is added to get
11417+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
11418+ array size at least. It's necessary to write '\x00'==0 to get something
11419+ that's true only with -std. */
11420+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
11421+
11422+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
11423+ inside strings and character constants. */
11424+#define FOO(x) 'x'
11425+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
11426+
11427+int test (int i, double x);
11428+struct s1 {int (*f) (int a);};
11429+struct s2 {int (*f) (double a);};
11430+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
11431+int argc;
11432+char **argv;
11433+int
11434+main ()
11435+{
11436+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
11437+ ;
11438+ return 0;
11439+}
11440+_ACEOF
11441+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
11442+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
11443+do
11444+ CC="$ac_save_CC $ac_arg"
11445+ if ac_fn_c_try_compile "$LINENO"; then :
11446+ ac_cv_prog_cc_c89=$ac_arg
11447+fi
11448+rm -f core conftest.err conftest.$ac_objext
11449+ test "x$ac_cv_prog_cc_c89" != "xno" && break
11450+done
11451+rm -f conftest.$ac_ext
11452+CC=$ac_save_CC
11453+
11454+fi
11455+# AC_CACHE_VAL
11456+case "x$ac_cv_prog_cc_c89" in
11457+ x)
11458+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
11459+$as_echo "none needed" >&6; } ;;
11460+ xno)
11461+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
11462+$as_echo "unsupported" >&6; } ;;
11463+ *)
11464+ CC="$CC $ac_cv_prog_cc_c89"
11465+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
11466+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
11467+esac
11468+if test "x$ac_cv_prog_cc_c89" != xno; then :
11469+
11470+fi
11471+
11472+ac_ext=c
11473+ac_cpp='$CPP $CPPFLAGS'
11474+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11475+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11476+ac_compiler_gnu=$ac_cv_c_compiler_gnu
11477+DEPDIR="${am__leading_dot}deps"
11478+
11479+ac_config_commands="$ac_config_commands depfiles"
11480+
11481+
11482+am_make=${MAKE-make}
11483+cat > confinc << 'END'
11484+am__doit:
11485+ @echo this is the am__doit target
11486+.PHONY: am__doit
11487+END
11488+# If we don't find an include directive, just comment out the code.
11489+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
11490+$as_echo_n "checking for style of include used by $am_make... " >&6; }
11491+am__include="#"
11492+am__quote=
11493+_am_result=none
11494+# First try GNU make style include.
11495+echo "include confinc" > confmf
11496+# Ignore all kinds of additional output from `make'.
11497+case `$am_make -s -f confmf 2> /dev/null` in #(
11498+*the\ am__doit\ target*)
11499+ am__include=include
11500+ am__quote=
11501+ _am_result=GNU
11502+ ;;
11503+esac
11504+# Now try BSD make style include.
11505+if test "$am__include" = "#"; then
11506+ echo '.include "confinc"' > confmf
11507+ case `$am_make -s -f confmf 2> /dev/null` in #(
11508+ *the\ am__doit\ target*)
11509+ am__include=.include
11510+ am__quote="\""
11511+ _am_result=BSD
11512+ ;;
11513+ esac
11514+fi
11515+
11516+
11517+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
11518+$as_echo "$_am_result" >&6; }
11519+rm -f confinc confmf
11520+
11521+# Check whether --enable-dependency-tracking was given.
11522+if test "${enable_dependency_tracking+set}" = set; then :
11523+ enableval=$enable_dependency_tracking;
11524+fi
11525+
11526+if test "x$enable_dependency_tracking" != xno; then
11527+ am_depcomp="$ac_aux_dir/depcomp"
11528+ AMDEPBACKSLASH='\'
11529+ am__nodep='_no'
11530+fi
11531+ if test "x$enable_dependency_tracking" != xno; then
11532+ AMDEP_TRUE=
11533+ AMDEP_FALSE='#'
11534+else
11535+ AMDEP_TRUE='#'
11536+ AMDEP_FALSE=
11537+fi
11538+
11539+
11540+
11541+depcc="$CC" am_compiler_list=
11542+
11543+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
11544+$as_echo_n "checking dependency style of $depcc... " >&6; }
11545+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
11546+ $as_echo_n "(cached) " >&6
11547+else
11548+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11549+ # We make a subdir and do the tests there. Otherwise we can end up
11550+ # making bogus files that we don't know about and never remove. For
11551+ # instance it was reported that on HP-UX the gcc test will end up
11552+ # making a dummy file named `D' -- because `-MD' means `put the output
11553+ # in D'.
11554+ rm -rf conftest.dir
11555+ mkdir conftest.dir
11556+ # Copy depcomp to subdir because otherwise we won't find it if we're
11557+ # using a relative directory.
11558+ cp "$am_depcomp" conftest.dir
11559+ cd conftest.dir
11560+ # We will build objects and dependencies in a subdirectory because
11561+ # it helps to detect inapplicable dependency modes. For instance
11562+ # both Tru64's cc and ICC support -MD to output dependencies as a
11563+ # side effect of compilation, but ICC will put the dependencies in
11564+ # the current directory while Tru64 will put them in the object
11565+ # directory.
11566+ mkdir sub
11567+
11568+ am_cv_CC_dependencies_compiler_type=none
11569+ if test "$am_compiler_list" = ""; then
11570+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
11571+ fi
11572+ am__universal=false
11573+ case " $depcc " in #(
11574+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
11575+ esac
11576+
11577+ for depmode in $am_compiler_list; do
11578+ # Setup a source with many dependencies, because some compilers
11579+ # like to wrap large dependency lists on column 80 (with \), and
11580+ # we should not choose a depcomp mode which is confused by this.
11581+ #
11582+ # We need to recreate these files for each test, as the compiler may
11583+ # overwrite some of them when testing with obscure command lines.
11584+ # This happens at least with the AIX C compiler.
11585+ : > sub/conftest.c
11586+ for i in 1 2 3 4 5 6; do
11587+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
11588+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
11589+ # Solaris 8's {/usr,}/bin/sh.
11590+ touch sub/conftst$i.h
11591+ done
11592+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11593+
11594+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
11595+ # mode. It turns out that the SunPro C++ compiler does not properly
11596+ # handle `-M -o', and we need to detect this. Also, some Intel
11597+ # versions had trouble with output in subdirs
11598+ am__obj=sub/conftest.${OBJEXT-o}
11599+ am__minus_obj="-o $am__obj"
11600+ case $depmode in
11601+ gcc)
11602+ # This depmode causes a compiler race in universal mode.
11603+ test "$am__universal" = false || continue
11604+ ;;
11605+ nosideeffect)
11606+ # after this tag, mechanisms are not by side-effect, so they'll
11607+ # only be used when explicitly requested
11608+ if test "x$enable_dependency_tracking" = xyes; then
11609+ continue
11610+ else
11611+ break
11612+ fi
11613+ ;;
11614+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11615+ # This compiler won't grok `-c -o', but also, the minuso test has
11616+ # not run yet. These depmodes are late enough in the game, and
11617+ # so weak that their functioning should not be impacted.
11618+ am__obj=conftest.${OBJEXT-o}
11619+ am__minus_obj=
11620+ ;;
11621+ none) break ;;
11622+ esac
11623+ if depmode=$depmode \
11624+ source=sub/conftest.c object=$am__obj \
11625+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11626+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11627+ >/dev/null 2>conftest.err &&
11628+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11629+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11630+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11631+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11632+ # icc doesn't choke on unknown options, it will just issue warnings
11633+ # or remarks (even with -Werror). So we grep stderr for any message
11634+ # that says an option was ignored or not supported.
11635+ # When given -MP, icc 7.0 and 7.1 complain thusly:
11636+ # icc: Command line warning: ignoring option '-M'; no argument required
11637+ # The diagnosis changed in icc 8.0:
11638+ # icc: Command line remark: option '-MP' not supported
11639+ if (grep 'ignoring option' conftest.err ||
11640+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11641+ am_cv_CC_dependencies_compiler_type=$depmode
11642+ break
11643+ fi
11644+ fi
11645+ done
11646+
11647+ cd ..
11648+ rm -rf conftest.dir
11649+else
11650+ am_cv_CC_dependencies_compiler_type=none
11651+fi
11652+
11653+fi
11654+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
11655+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
11656+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
11657+
11658+ if
11659+ test "x$enable_dependency_tracking" != xno \
11660+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
11661+ am__fastdepCC_TRUE=
11662+ am__fastdepCC_FALSE='#'
11663+else
11664+ am__fastdepCC_TRUE='#'
11665+ am__fastdepCC_FALSE=
11666+fi
11667+
11668+
11669+ if test x$GCC = 'xyes'; then
11670+ GCC_TRUE=
11671+ GCC_FALSE='#'
11672+else
11673+ GCC_TRUE='#'
11674+ GCC_FALSE=
11675+fi
11676+
11677+
11678+case `pwd` in
11679+ *\ * | *\ *)
11680+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
11681+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
11682+esac
11683+
11684+
11685+
11686+macro_version='2.4.2'
11687+macro_revision='1.3337'
11688+
11689+
11690+
11691+
11692+
11693+
11694+
11695+
11696+
11697+
11698+
11699+
11700+
11701+ltmain="$ac_aux_dir/ltmain.sh"
11702+
11703+# Make sure we can run config.sub.
11704+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
11705+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
11706+
11707+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
11708+$as_echo_n "checking build system type... " >&6; }
11709+if ${ac_cv_build+:} false; then :
11710+ $as_echo_n "(cached) " >&6
11711+else
11712+ ac_build_alias=$build_alias
11713+test "x$ac_build_alias" = x &&
11714+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
11715+test "x$ac_build_alias" = x &&
11716+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
11717+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
11718+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
11719+
11720+fi
11721+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
11722+$as_echo "$ac_cv_build" >&6; }
11723+case $ac_cv_build in
11724+*-*-*) ;;
11725+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
11726+esac
11727+build=$ac_cv_build
11728+ac_save_IFS=$IFS; IFS='-'
11729+set x $ac_cv_build
11730+shift
11731+build_cpu=$1
11732+build_vendor=$2
11733+shift; shift
11734+# Remember, the first character of IFS is used to create $*,
11735+# except with old shells:
11736+build_os=$*
11737+IFS=$ac_save_IFS
11738+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
11739+
11740+
11741+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
11742+$as_echo_n "checking host system type... " >&6; }
11743+if ${ac_cv_host+:} false; then :
11744+ $as_echo_n "(cached) " >&6
11745+else
11746+ if test "x$host_alias" = x; then
11747+ ac_cv_host=$ac_cv_build
11748+else
11749+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
11750+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
11751+fi
11752+
11753+fi
11754+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
11755+$as_echo "$ac_cv_host" >&6; }
11756+case $ac_cv_host in
11757+*-*-*) ;;
11758+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
11759+esac
11760+host=$ac_cv_host
11761+ac_save_IFS=$IFS; IFS='-'
11762+set x $ac_cv_host
11763+shift
11764+host_cpu=$1
11765+host_vendor=$2
11766+shift; shift
11767+# Remember, the first character of IFS is used to create $*,
11768+# except with old shells:
11769+host_os=$*
11770+IFS=$ac_save_IFS
11771+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
11772+
11773+
11774+# Backslashify metacharacters that are still active within
11775+# double-quoted strings.
11776+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
11777+
11778+# Same as above, but do not quote variable references.
11779+double_quote_subst='s/\(["`\\]\)/\\\1/g'
11780+
11781+# Sed substitution to delay expansion of an escaped shell variable in a
11782+# double_quote_subst'ed string.
11783+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
11784+
11785+# Sed substitution to delay expansion of an escaped single quote.
11786+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
11787+
11788+# Sed substitution to avoid accidental globbing in evaled expressions
11789+no_glob_subst='s/\*/\\\*/g'
11790+
11791+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
11792+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
11793+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
11794+
11795+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
11796+$as_echo_n "checking how to print strings... " >&6; }
11797+# Test print first, because it will be a builtin if present.
11798+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
11799+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
11800+ ECHO='print -r --'
11801+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
11802+ ECHO='printf %s\n'
11803+else
11804+ # Use this function as a fallback that always works.
11805+ func_fallback_echo ()
11806+ {
11807+ eval 'cat <<_LTECHO_EOF
11808+$1
11809+_LTECHO_EOF'
11810+ }
11811+ ECHO='func_fallback_echo'
11812+fi
11813+
11814+# func_echo_all arg...
11815+# Invoke $ECHO with all args, space-separated.
11816+func_echo_all ()
11817+{
11818+ $ECHO ""
11819+}
11820+
11821+case "$ECHO" in
11822+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
11823+$as_echo "printf" >&6; } ;;
11824+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
11825+$as_echo "print -r" >&6; } ;;
11826+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
11827+$as_echo "cat" >&6; } ;;
11828+esac
11829+
11830+
11831+
11832+
11833+
11834+
11835+
11836+
11837+
11838+
11839+
11840+
11841+
11842+
11843+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
11844+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
11845+if ${ac_cv_path_SED+:} false; then :
11846+ $as_echo_n "(cached) " >&6
11847+else
11848+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
11849+ for ac_i in 1 2 3 4 5 6 7; do
11850+ ac_script="$ac_script$as_nl$ac_script"
11851+ done
11852+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
11853+ { ac_script=; unset ac_script;}
11854+ if test -z "$SED"; then
11855+ ac_path_SED_found=false
11856+ # Loop through the user's path and test for each of PROGNAME-LIST
11857+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11858+for as_dir in $PATH
11859+do
11860+ IFS=$as_save_IFS
11861+ test -z "$as_dir" && as_dir=.
11862+ for ac_prog in sed gsed; do
11863+ for ac_exec_ext in '' $ac_executable_extensions; do
11864+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
11865+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
11866+# Check for GNU ac_path_SED and select it if it is found.
11867+ # Check for GNU $ac_path_SED
11868+case `"$ac_path_SED" --version 2>&1` in
11869+*GNU*)
11870+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
11871+*)
11872+ ac_count=0
11873+ $as_echo_n 0123456789 >"conftest.in"
11874+ while :
11875+ do
11876+ cat "conftest.in" "conftest.in" >"conftest.tmp"
11877+ mv "conftest.tmp" "conftest.in"
11878+ cp "conftest.in" "conftest.nl"
11879+ $as_echo '' >> "conftest.nl"
11880+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
11881+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
11882+ as_fn_arith $ac_count + 1 && ac_count=$as_val
11883+ if test $ac_count -gt ${ac_path_SED_max-0}; then
11884+ # Best one so far, save it but keep looking for a better one
11885+ ac_cv_path_SED="$ac_path_SED"
11886+ ac_path_SED_max=$ac_count
11887+ fi
11888+ # 10*(2^10) chars as input seems more than enough
11889+ test $ac_count -gt 10 && break
11890+ done
11891+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
11892+esac
11893+
11894+ $ac_path_SED_found && break 3
11895+ done
11896+ done
11897+ done
11898+IFS=$as_save_IFS
11899+ if test -z "$ac_cv_path_SED"; then
11900+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
11901+ fi
11902+else
11903+ ac_cv_path_SED=$SED
11904+fi
11905+
11906+fi
11907+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
11908+$as_echo "$ac_cv_path_SED" >&6; }
11909+ SED="$ac_cv_path_SED"
11910+ rm -f conftest.sed
11911+
11912+test -z "$SED" && SED=sed
11913+Xsed="$SED -e 1s/^X//"
11914+
11915+
11916+
11917+
11918+
11919+
11920+
11921+
11922+
11923+
11924+
11925+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
11926+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
11927+if ${ac_cv_path_GREP+:} false; then :
11928+ $as_echo_n "(cached) " >&6
11929+else
11930+ if test -z "$GREP"; then
11931+ ac_path_GREP_found=false
11932+ # Loop through the user's path and test for each of PROGNAME-LIST
11933+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11934+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
11935+do
11936+ IFS=$as_save_IFS
11937+ test -z "$as_dir" && as_dir=.
11938+ for ac_prog in grep ggrep; do
11939+ for ac_exec_ext in '' $ac_executable_extensions; do
11940+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
11941+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
11942+# Check for GNU ac_path_GREP and select it if it is found.
11943+ # Check for GNU $ac_path_GREP
11944+case `"$ac_path_GREP" --version 2>&1` in
11945+*GNU*)
11946+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
11947+*)
11948+ ac_count=0
11949+ $as_echo_n 0123456789 >"conftest.in"
11950+ while :
11951+ do
11952+ cat "conftest.in" "conftest.in" >"conftest.tmp"
11953+ mv "conftest.tmp" "conftest.in"
11954+ cp "conftest.in" "conftest.nl"
11955+ $as_echo 'GREP' >> "conftest.nl"
11956+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
11957+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
11958+ as_fn_arith $ac_count + 1 && ac_count=$as_val
11959+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
11960+ # Best one so far, save it but keep looking for a better one
11961+ ac_cv_path_GREP="$ac_path_GREP"
11962+ ac_path_GREP_max=$ac_count
11963+ fi
11964+ # 10*(2^10) chars as input seems more than enough
11965+ test $ac_count -gt 10 && break
11966+ done
11967+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
11968+esac
11969+
11970+ $ac_path_GREP_found && break 3
11971+ done
11972+ done
11973+ done
11974+IFS=$as_save_IFS
11975+ if test -z "$ac_cv_path_GREP"; then
11976+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
11977+ fi
11978+else
11979+ ac_cv_path_GREP=$GREP
11980+fi
11981+
11982+fi
11983+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
11984+$as_echo "$ac_cv_path_GREP" >&6; }
11985+ GREP="$ac_cv_path_GREP"
11986+
11987+
11988+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
11989+$as_echo_n "checking for egrep... " >&6; }
11990+if ${ac_cv_path_EGREP+:} false; then :
11991+ $as_echo_n "(cached) " >&6
11992+else
11993+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
11994+ then ac_cv_path_EGREP="$GREP -E"
11995+ else
11996+ if test -z "$EGREP"; then
11997+ ac_path_EGREP_found=false
11998+ # Loop through the user's path and test for each of PROGNAME-LIST
11999+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12000+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
12001+do
12002+ IFS=$as_save_IFS
12003+ test -z "$as_dir" && as_dir=.
12004+ for ac_prog in egrep; do
12005+ for ac_exec_ext in '' $ac_executable_extensions; do
12006+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
12007+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
12008+# Check for GNU ac_path_EGREP and select it if it is found.
12009+ # Check for GNU $ac_path_EGREP
12010+case `"$ac_path_EGREP" --version 2>&1` in
12011+*GNU*)
12012+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
12013+*)
12014+ ac_count=0
12015+ $as_echo_n 0123456789 >"conftest.in"
12016+ while :
12017+ do
12018+ cat "conftest.in" "conftest.in" >"conftest.tmp"
12019+ mv "conftest.tmp" "conftest.in"
12020+ cp "conftest.in" "conftest.nl"
12021+ $as_echo 'EGREP' >> "conftest.nl"
12022+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
12023+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
12024+ as_fn_arith $ac_count + 1 && ac_count=$as_val
12025+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
12026+ # Best one so far, save it but keep looking for a better one
12027+ ac_cv_path_EGREP="$ac_path_EGREP"
12028+ ac_path_EGREP_max=$ac_count
12029+ fi
12030+ # 10*(2^10) chars as input seems more than enough
12031+ test $ac_count -gt 10 && break
12032+ done
12033+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
12034+esac
12035+
12036+ $ac_path_EGREP_found && break 3
12037+ done
12038+ done
12039+ done
12040+IFS=$as_save_IFS
12041+ if test -z "$ac_cv_path_EGREP"; then
12042+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
12043+ fi
12044+else
12045+ ac_cv_path_EGREP=$EGREP
12046+fi
12047+
12048+ fi
12049+fi
12050+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
12051+$as_echo "$ac_cv_path_EGREP" >&6; }
12052+ EGREP="$ac_cv_path_EGREP"
12053+
12054+
12055+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
12056+$as_echo_n "checking for fgrep... " >&6; }
12057+if ${ac_cv_path_FGREP+:} false; then :
12058+ $as_echo_n "(cached) " >&6
12059+else
12060+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
12061+ then ac_cv_path_FGREP="$GREP -F"
12062+ else
12063+ if test -z "$FGREP"; then
12064+ ac_path_FGREP_found=false
12065+ # Loop through the user's path and test for each of PROGNAME-LIST
12066+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12067+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
12068+do
12069+ IFS=$as_save_IFS
12070+ test -z "$as_dir" && as_dir=.
12071+ for ac_prog in fgrep; do
12072+ for ac_exec_ext in '' $ac_executable_extensions; do
12073+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
12074+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
12075+# Check for GNU ac_path_FGREP and select it if it is found.
12076+ # Check for GNU $ac_path_FGREP
12077+case `"$ac_path_FGREP" --version 2>&1` in
12078+*GNU*)
12079+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
12080+*)
12081+ ac_count=0
12082+ $as_echo_n 0123456789 >"conftest.in"
12083+ while :
12084+ do
12085+ cat "conftest.in" "conftest.in" >"conftest.tmp"
12086+ mv "conftest.tmp" "conftest.in"
12087+ cp "conftest.in" "conftest.nl"
12088+ $as_echo 'FGREP' >> "conftest.nl"
12089+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
12090+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
12091+ as_fn_arith $ac_count + 1 && ac_count=$as_val
12092+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
12093+ # Best one so far, save it but keep looking for a better one
12094+ ac_cv_path_FGREP="$ac_path_FGREP"
12095+ ac_path_FGREP_max=$ac_count
12096+ fi
12097+ # 10*(2^10) chars as input seems more than enough
12098+ test $ac_count -gt 10 && break
12099+ done
12100+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
12101+esac
12102+
12103+ $ac_path_FGREP_found && break 3
12104+ done
12105+ done
12106+ done
12107+IFS=$as_save_IFS
12108+ if test -z "$ac_cv_path_FGREP"; then
12109+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
12110+ fi
12111+else
12112+ ac_cv_path_FGREP=$FGREP
12113+fi
12114+
12115+ fi
12116+fi
12117+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
12118+$as_echo "$ac_cv_path_FGREP" >&6; }
12119+ FGREP="$ac_cv_path_FGREP"
12120+
12121+
12122+test -z "$GREP" && GREP=grep
12123+
12124+
12125+
12126+
12127+
12128+
12129+
12130+
12131+
12132+
12133+
12134+
12135+
12136+
12137+
12138+
12139+
12140+
12141+
12142+# Check whether --with-gnu-ld was given.
12143+if test "${with_gnu_ld+set}" = set; then :
12144+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
12145+else
12146+ with_gnu_ld=no
12147+fi
12148+
12149+ac_prog=ld
12150+if test "$GCC" = yes; then
12151+ # Check if gcc -print-prog-name=ld gives a path.
12152+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
12153+$as_echo_n "checking for ld used by $CC... " >&6; }
12154+ case $host in
12155+ *-*-mingw*)
12156+ # gcc leaves a trailing carriage return which upsets mingw
12157+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
12158+ *)
12159+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
12160+ esac
12161+ case $ac_prog in
12162+ # Accept absolute paths.
12163+ [\\/]* | ?:[\\/]*)
12164+ re_direlt='/[^/][^/]*/\.\./'
12165+ # Canonicalize the pathname of ld
12166+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
12167+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
12168+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
12169+ done
12170+ test -z "$LD" && LD="$ac_prog"
12171+ ;;
12172+ "")
12173+ # If it fails, then pretend we aren't using GCC.
12174+ ac_prog=ld
12175+ ;;
12176+ *)
12177+ # If it is relative, then search for the first ld in PATH.
12178+ with_gnu_ld=unknown
12179+ ;;
12180+ esac
12181+elif test "$with_gnu_ld" = yes; then
12182+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
12183+$as_echo_n "checking for GNU ld... " >&6; }
12184+else
12185+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
12186+$as_echo_n "checking for non-GNU ld... " >&6; }
12187+fi
12188+if ${lt_cv_path_LD+:} false; then :
12189+ $as_echo_n "(cached) " >&6
12190+else
12191+ if test -z "$LD"; then
12192+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
12193+ for ac_dir in $PATH; do
12194+ IFS="$lt_save_ifs"
12195+ test -z "$ac_dir" && ac_dir=.
12196+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
12197+ lt_cv_path_LD="$ac_dir/$ac_prog"
12198+ # Check to see if the program is GNU ld. I'd rather use --version,
12199+ # but apparently some variants of GNU ld only accept -v.
12200+ # Break only if it was the GNU/non-GNU ld that we prefer.
12201+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
12202+ *GNU* | *'with BFD'*)
12203+ test "$with_gnu_ld" != no && break
12204+ ;;
12205+ *)
12206+ test "$with_gnu_ld" != yes && break
12207+ ;;
12208+ esac
12209+ fi
12210+ done
12211+ IFS="$lt_save_ifs"
12212+else
12213+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
12214+fi
12215+fi
12216+
12217+LD="$lt_cv_path_LD"
12218+if test -n "$LD"; then
12219+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
12220+$as_echo "$LD" >&6; }
12221+else
12222+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12223+$as_echo "no" >&6; }
12224+fi
12225+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
12226+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
12227+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
12228+if ${lt_cv_prog_gnu_ld+:} false; then :
12229+ $as_echo_n "(cached) " >&6
12230+else
12231+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
12232+case `$LD -v 2>&1 </dev/null` in
12233+*GNU* | *'with BFD'*)
12234+ lt_cv_prog_gnu_ld=yes
12235+ ;;
12236+*)
12237+ lt_cv_prog_gnu_ld=no
12238+ ;;
12239+esac
12240+fi
12241+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
12242+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
12243+with_gnu_ld=$lt_cv_prog_gnu_ld
12244+
12245+
12246+
12247+
12248+
12249+
12250+
12251+
12252+
12253+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
12254+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
12255+if ${lt_cv_path_NM+:} false; then :
12256+ $as_echo_n "(cached) " >&6
12257+else
12258+ if test -n "$NM"; then
12259+ # Let the user override the test.
12260+ lt_cv_path_NM="$NM"
12261+else
12262+ lt_nm_to_check="${ac_tool_prefix}nm"
12263+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
12264+ lt_nm_to_check="$lt_nm_to_check nm"
12265+ fi
12266+ for lt_tmp_nm in $lt_nm_to_check; do
12267+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
12268+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
12269+ IFS="$lt_save_ifs"
12270+ test -z "$ac_dir" && ac_dir=.
12271+ tmp_nm="$ac_dir/$lt_tmp_nm"
12272+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
12273+ # Check to see if the nm accepts a BSD-compat flag.
12274+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
12275+ # nm: unknown option "B" ignored
12276+ # Tru64's nm complains that /dev/null is an invalid object file
12277+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
12278+ */dev/null* | *'Invalid file or object type'*)
12279+ lt_cv_path_NM="$tmp_nm -B"
12280+ break
12281+ ;;
12282+ *)
12283+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
12284+ */dev/null*)
12285+ lt_cv_path_NM="$tmp_nm -p"
12286+ break
12287+ ;;
12288+ *)
12289+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
12290+ continue # so that we can try to find one that supports BSD flags
12291+ ;;
12292+ esac
12293+ ;;
12294+ esac
12295+ fi
12296+ done
12297+ IFS="$lt_save_ifs"
12298+ done
12299+ : ${lt_cv_path_NM=no}
12300+fi
12301+fi
12302+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
12303+$as_echo "$lt_cv_path_NM" >&6; }
12304+if test "$lt_cv_path_NM" != "no"; then
12305+ NM="$lt_cv_path_NM"
12306+else
12307+ # Didn't find any BSD compatible name lister, look for dumpbin.
12308+ if test -n "$DUMPBIN"; then :
12309+ # Let the user override the test.
12310+ else
12311+ if test -n "$ac_tool_prefix"; then
12312+ for ac_prog in dumpbin "link -dump"
12313+ do
12314+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12315+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12316+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12317+$as_echo_n "checking for $ac_word... " >&6; }
12318+if ${ac_cv_prog_DUMPBIN+:} false; then :
12319+ $as_echo_n "(cached) " >&6
12320+else
12321+ if test -n "$DUMPBIN"; then
12322+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
12323+else
12324+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12325+for as_dir in $PATH
12326+do
12327+ IFS=$as_save_IFS
12328+ test -z "$as_dir" && as_dir=.
12329+ for ac_exec_ext in '' $ac_executable_extensions; do
12330+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12331+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
12332+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12333+ break 2
12334+ fi
12335+done
12336+ done
12337+IFS=$as_save_IFS
12338+
12339+fi
12340+fi
12341+DUMPBIN=$ac_cv_prog_DUMPBIN
12342+if test -n "$DUMPBIN"; then
12343+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
12344+$as_echo "$DUMPBIN" >&6; }
12345+else
12346+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12347+$as_echo "no" >&6; }
12348+fi
12349+
12350+
12351+ test -n "$DUMPBIN" && break
12352+ done
12353+fi
12354+if test -z "$DUMPBIN"; then
12355+ ac_ct_DUMPBIN=$DUMPBIN
12356+ for ac_prog in dumpbin "link -dump"
12357+do
12358+ # Extract the first word of "$ac_prog", so it can be a program name with args.
12359+set dummy $ac_prog; ac_word=$2
12360+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12361+$as_echo_n "checking for $ac_word... " >&6; }
12362+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
12363+ $as_echo_n "(cached) " >&6
12364+else
12365+ if test -n "$ac_ct_DUMPBIN"; then
12366+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
12367+else
12368+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12369+for as_dir in $PATH
12370+do
12371+ IFS=$as_save_IFS
12372+ test -z "$as_dir" && as_dir=.
12373+ for ac_exec_ext in '' $ac_executable_extensions; do
12374+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12375+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
12376+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12377+ break 2
12378+ fi
12379+done
12380+ done
12381+IFS=$as_save_IFS
12382+
12383+fi
12384+fi
12385+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
12386+if test -n "$ac_ct_DUMPBIN"; then
12387+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
12388+$as_echo "$ac_ct_DUMPBIN" >&6; }
12389+else
12390+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12391+$as_echo "no" >&6; }
12392+fi
12393+
12394+
12395+ test -n "$ac_ct_DUMPBIN" && break
12396+done
12397+
12398+ if test "x$ac_ct_DUMPBIN" = x; then
12399+ DUMPBIN=":"
12400+ else
12401+ case $cross_compiling:$ac_tool_warned in
12402+yes:)
12403+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12404+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12405+ac_tool_warned=yes ;;
12406+esac
12407+ DUMPBIN=$ac_ct_DUMPBIN
12408+ fi
12409+fi
12410+
12411+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
12412+ *COFF*)
12413+ DUMPBIN="$DUMPBIN -symbols"
12414+ ;;
12415+ *)
12416+ DUMPBIN=:
12417+ ;;
12418+ esac
12419+ fi
12420+
12421+ if test "$DUMPBIN" != ":"; then
12422+ NM="$DUMPBIN"
12423+ fi
12424+fi
12425+test -z "$NM" && NM=nm
12426+
12427+
12428+
12429+
12430+
12431+
12432+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
12433+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
12434+if ${lt_cv_nm_interface+:} false; then :
12435+ $as_echo_n "(cached) " >&6
12436+else
12437+ lt_cv_nm_interface="BSD nm"
12438+ echo "int some_variable = 0;" > conftest.$ac_ext
12439+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
12440+ (eval "$ac_compile" 2>conftest.err)
12441+ cat conftest.err >&5
12442+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
12443+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
12444+ cat conftest.err >&5
12445+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
12446+ cat conftest.out >&5
12447+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
12448+ lt_cv_nm_interface="MS dumpbin"
12449+ fi
12450+ rm -f conftest*
12451+fi
12452+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
12453+$as_echo "$lt_cv_nm_interface" >&6; }
12454+
12455+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
12456+$as_echo_n "checking whether ln -s works... " >&6; }
12457+LN_S=$as_ln_s
12458+if test "$LN_S" = "ln -s"; then
12459+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12460+$as_echo "yes" >&6; }
12461+else
12462+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
12463+$as_echo "no, using $LN_S" >&6; }
12464+fi
12465+
12466+# find the maximum length of command line arguments
12467+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
12468+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
12469+if ${lt_cv_sys_max_cmd_len+:} false; then :
12470+ $as_echo_n "(cached) " >&6
12471+else
12472+ i=0
12473+ teststring="ABCD"
12474+
12475+ case $build_os in
12476+ msdosdjgpp*)
12477+ # On DJGPP, this test can blow up pretty badly due to problems in libc
12478+ # (any single argument exceeding 2000 bytes causes a buffer overrun
12479+ # during glob expansion). Even if it were fixed, the result of this
12480+ # check would be larger than it should be.
12481+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
12482+ ;;
12483+
12484+ gnu*)
12485+ # Under GNU Hurd, this test is not required because there is
12486+ # no limit to the length of command line arguments.
12487+ # Libtool will interpret -1 as no limit whatsoever
12488+ lt_cv_sys_max_cmd_len=-1;
12489+ ;;
12490+
12491+ cygwin* | mingw* | cegcc*)
12492+ # On Win9x/ME, this test blows up -- it succeeds, but takes
12493+ # about 5 minutes as the teststring grows exponentially.
12494+ # Worse, since 9x/ME are not pre-emptively multitasking,
12495+ # you end up with a "frozen" computer, even though with patience
12496+ # the test eventually succeeds (with a max line length of 256k).
12497+ # Instead, let's just punt: use the minimum linelength reported by
12498+ # all of the supported platforms: 8192 (on NT/2K/XP).
12499+ lt_cv_sys_max_cmd_len=8192;
12500+ ;;
12501+
12502+ mint*)
12503+ # On MiNT this can take a long time and run out of memory.
12504+ lt_cv_sys_max_cmd_len=8192;
12505+ ;;
12506+
12507+ amigaos*)
12508+ # On AmigaOS with pdksh, this test takes hours, literally.
12509+ # So we just punt and use a minimum line length of 8192.
12510+ lt_cv_sys_max_cmd_len=8192;
12511+ ;;
12512+
12513+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
12514+ # This has been around since 386BSD, at least. Likely further.
12515+ if test -x /sbin/sysctl; then
12516+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
12517+ elif test -x /usr/sbin/sysctl; then
12518+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
12519+ else
12520+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
12521+ fi
12522+ # And add a safety zone
12523+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
12524+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
12525+ ;;
12526+
12527+ interix*)
12528+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
12529+ lt_cv_sys_max_cmd_len=196608
12530+ ;;
12531+
12532+ os2*)
12533+ # The test takes a long time on OS/2.
12534+ lt_cv_sys_max_cmd_len=8192
12535+ ;;
12536+
12537+ osf*)
12538+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
12539+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
12540+ # nice to cause kernel panics so lets avoid the loop below.
12541+ # First set a reasonable default.
12542+ lt_cv_sys_max_cmd_len=16384
12543+ #
12544+ if test -x /sbin/sysconfig; then
12545+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
12546+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
12547+ esac
12548+ fi
12549+ ;;
12550+ sco3.2v5*)
12551+ lt_cv_sys_max_cmd_len=102400
12552+ ;;
12553+ sysv5* | sco5v6* | sysv4.2uw2*)
12554+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
12555+ if test -n "$kargmax"; then
12556+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
12557+ else
12558+ lt_cv_sys_max_cmd_len=32768
12559+ fi
12560+ ;;
12561+ *)
12562+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
12563+ if test -n "$lt_cv_sys_max_cmd_len"; then
12564+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
12565+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
12566+ else
12567+ # Make teststring a little bigger before we do anything with it.
12568+ # a 1K string should be a reasonable start.
12569+ for i in 1 2 3 4 5 6 7 8 ; do
12570+ teststring=$teststring$teststring
12571+ done
12572+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
12573+ # If test is not a shell built-in, we'll probably end up computing a
12574+ # maximum length that is only half of the actual maximum length, but
12575+ # we can't tell.
12576+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
12577+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
12578+ test $i != 17 # 1/2 MB should be enough
12579+ do
12580+ i=`expr $i + 1`
12581+ teststring=$teststring$teststring
12582+ done
12583+ # Only check the string length outside the loop.
12584+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
12585+ teststring=
12586+ # Add a significant safety factor because C++ compilers can tack on
12587+ # massive amounts of additional arguments before passing them to the
12588+ # linker. It appears as though 1/2 is a usable value.
12589+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
12590+ fi
12591+ ;;
12592+ esac
12593+
12594+fi
12595+
12596+if test -n $lt_cv_sys_max_cmd_len ; then
12597+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
12598+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
12599+else
12600+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
12601+$as_echo "none" >&6; }
12602+fi
12603+max_cmd_len=$lt_cv_sys_max_cmd_len
12604+
12605+
12606+
12607+
12608+
12609+
12610+: ${CP="cp -f"}
12611+: ${MV="mv -f"}
12612+: ${RM="rm -f"}
12613+
12614+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
12615+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
12616+# Try some XSI features
12617+xsi_shell=no
12618+( _lt_dummy="a/b/c"
12619+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
12620+ = c,a/b,b/c, \
12621+ && eval 'test $(( 1 + 1 )) -eq 2 \
12622+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
12623+ && xsi_shell=yes
12624+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
12625+$as_echo "$xsi_shell" >&6; }
12626+
12627+
12628+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
12629+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
12630+lt_shell_append=no
12631+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
12632+ >/dev/null 2>&1 \
12633+ && lt_shell_append=yes
12634+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
12635+$as_echo "$lt_shell_append" >&6; }
12636+
12637+
12638+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
12639+ lt_unset=unset
12640+else
12641+ lt_unset=false
12642+fi
12643+
12644+
12645+
12646+
12647+
12648+# test EBCDIC or ASCII
12649+case `echo X|tr X '\101'` in
12650+ A) # ASCII based system
12651+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
12652+ lt_SP2NL='tr \040 \012'
12653+ lt_NL2SP='tr \015\012 \040\040'
12654+ ;;
12655+ *) # EBCDIC based system
12656+ lt_SP2NL='tr \100 \n'
12657+ lt_NL2SP='tr \r\n \100\100'
12658+ ;;
12659+esac
12660+
12661+
12662+
12663+
12664+
12665+
12666+
12667+
12668+
12669+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
12670+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
12671+if ${lt_cv_to_host_file_cmd+:} false; then :
12672+ $as_echo_n "(cached) " >&6
12673+else
12674+ case $host in
12675+ *-*-mingw* )
12676+ case $build in
12677+ *-*-mingw* ) # actually msys
12678+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
12679+ ;;
12680+ *-*-cygwin* )
12681+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
12682+ ;;
12683+ * ) # otherwise, assume *nix
12684+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
12685+ ;;
12686+ esac
12687+ ;;
12688+ *-*-cygwin* )
12689+ case $build in
12690+ *-*-mingw* ) # actually msys
12691+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
12692+ ;;
12693+ *-*-cygwin* )
12694+ lt_cv_to_host_file_cmd=func_convert_file_noop
12695+ ;;
12696+ * ) # otherwise, assume *nix
12697+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
12698+ ;;
12699+ esac
12700+ ;;
12701+ * ) # unhandled hosts (and "normal" native builds)
12702+ lt_cv_to_host_file_cmd=func_convert_file_noop
12703+ ;;
12704+esac
12705+
12706+fi
12707+
12708+to_host_file_cmd=$lt_cv_to_host_file_cmd
12709+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
12710+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
12711+
12712+
12713+
12714+
12715+
12716+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
12717+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
12718+if ${lt_cv_to_tool_file_cmd+:} false; then :
12719+ $as_echo_n "(cached) " >&6
12720+else
12721+ #assume ordinary cross tools, or native build.
12722+lt_cv_to_tool_file_cmd=func_convert_file_noop
12723+case $host in
12724+ *-*-mingw* )
12725+ case $build in
12726+ *-*-mingw* ) # actually msys
12727+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
12728+ ;;
12729+ esac
12730+ ;;
12731+esac
12732+
12733+fi
12734+
12735+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
12736+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
12737+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
12738+
12739+
12740+
12741+
12742+
12743+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
12744+$as_echo_n "checking for $LD option to reload object files... " >&6; }
12745+if ${lt_cv_ld_reload_flag+:} false; then :
12746+ $as_echo_n "(cached) " >&6
12747+else
12748+ lt_cv_ld_reload_flag='-r'
12749+fi
12750+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
12751+$as_echo "$lt_cv_ld_reload_flag" >&6; }
12752+reload_flag=$lt_cv_ld_reload_flag
12753+case $reload_flag in
12754+"" | " "*) ;;
12755+*) reload_flag=" $reload_flag" ;;
12756+esac
12757+reload_cmds='$LD$reload_flag -o $output$reload_objs'
12758+case $host_os in
12759+ cygwin* | mingw* | pw32* | cegcc*)
12760+ if test "$GCC" != yes; then
12761+ reload_cmds=false
12762+ fi
12763+ ;;
12764+ darwin*)
12765+ if test "$GCC" = yes; then
12766+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
12767+ else
12768+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
12769+ fi
12770+ ;;
12771+esac
12772+
12773+
12774+
12775+
12776+
12777+
12778+
12779+
12780+
12781+if test -n "$ac_tool_prefix"; then
12782+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
12783+set dummy ${ac_tool_prefix}objdump; ac_word=$2
12784+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12785+$as_echo_n "checking for $ac_word... " >&6; }
12786+if ${ac_cv_prog_OBJDUMP+:} false; then :
12787+ $as_echo_n "(cached) " >&6
12788+else
12789+ if test -n "$OBJDUMP"; then
12790+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
12791+else
12792+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12793+for as_dir in $PATH
12794+do
12795+ IFS=$as_save_IFS
12796+ test -z "$as_dir" && as_dir=.
12797+ for ac_exec_ext in '' $ac_executable_extensions; do
12798+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12799+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
12800+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12801+ break 2
12802+ fi
12803+done
12804+ done
12805+IFS=$as_save_IFS
12806+
12807+fi
12808+fi
12809+OBJDUMP=$ac_cv_prog_OBJDUMP
12810+if test -n "$OBJDUMP"; then
12811+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
12812+$as_echo "$OBJDUMP" >&6; }
12813+else
12814+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12815+$as_echo "no" >&6; }
12816+fi
12817+
12818+
12819+fi
12820+if test -z "$ac_cv_prog_OBJDUMP"; then
12821+ ac_ct_OBJDUMP=$OBJDUMP
12822+ # Extract the first word of "objdump", so it can be a program name with args.
12823+set dummy objdump; ac_word=$2
12824+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12825+$as_echo_n "checking for $ac_word... " >&6; }
12826+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
12827+ $as_echo_n "(cached) " >&6
12828+else
12829+ if test -n "$ac_ct_OBJDUMP"; then
12830+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
12831+else
12832+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12833+for as_dir in $PATH
12834+do
12835+ IFS=$as_save_IFS
12836+ test -z "$as_dir" && as_dir=.
12837+ for ac_exec_ext in '' $ac_executable_extensions; do
12838+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12839+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
12840+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12841+ break 2
12842+ fi
12843+done
12844+ done
12845+IFS=$as_save_IFS
12846+
12847+fi
12848+fi
12849+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
12850+if test -n "$ac_ct_OBJDUMP"; then
12851+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
12852+$as_echo "$ac_ct_OBJDUMP" >&6; }
12853+else
12854+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12855+$as_echo "no" >&6; }
12856+fi
12857+
12858+ if test "x$ac_ct_OBJDUMP" = x; then
12859+ OBJDUMP="false"
12860+ else
12861+ case $cross_compiling:$ac_tool_warned in
12862+yes:)
12863+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12864+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12865+ac_tool_warned=yes ;;
12866+esac
12867+ OBJDUMP=$ac_ct_OBJDUMP
12868+ fi
12869+else
12870+ OBJDUMP="$ac_cv_prog_OBJDUMP"
12871+fi
12872+
12873+test -z "$OBJDUMP" && OBJDUMP=objdump
12874+
12875+
12876+
12877+
12878+
12879+
12880+
12881+
12882+
12883+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
12884+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
12885+if ${lt_cv_deplibs_check_method+:} false; then :
12886+ $as_echo_n "(cached) " >&6
12887+else
12888+ lt_cv_file_magic_cmd='$MAGIC_CMD'
12889+lt_cv_file_magic_test_file=
12890+lt_cv_deplibs_check_method='unknown'
12891+# Need to set the preceding variable on all platforms that support
12892+# interlibrary dependencies.
12893+# 'none' -- dependencies not supported.
12894+# `unknown' -- same as none, but documents that we really don't know.
12895+# 'pass_all' -- all dependencies passed with no checks.
12896+# 'test_compile' -- check by making test program.
12897+# 'file_magic [[regex]]' -- check by looking for files in library path
12898+# which responds to the $file_magic_cmd with a given extended regex.
12899+# If you have `file' or equivalent on your system and you're not sure
12900+# whether `pass_all' will *always* work, you probably want this one.
12901+
12902+case $host_os in
12903+aix[4-9]*)
12904+ lt_cv_deplibs_check_method=pass_all
12905+ ;;
12906+
12907+beos*)
12908+ lt_cv_deplibs_check_method=pass_all
12909+ ;;
12910+
12911+bsdi[45]*)
12912+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
12913+ lt_cv_file_magic_cmd='/usr/bin/file -L'
12914+ lt_cv_file_magic_test_file=/shlib/libc.so
12915+ ;;
12916+
12917+cygwin*)
12918+ # func_win32_libid is a shell function defined in ltmain.sh
12919+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
12920+ lt_cv_file_magic_cmd='func_win32_libid'
12921+ ;;
12922+
12923+mingw* | pw32*)
12924+ # Base MSYS/MinGW do not provide the 'file' command needed by
12925+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
12926+ # unless we find 'file', for example because we are cross-compiling.
12927+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
12928+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
12929+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
12930+ lt_cv_file_magic_cmd='func_win32_libid'
12931+ else
12932+ # Keep this pattern in sync with the one in func_win32_libid.
12933+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
12934+ lt_cv_file_magic_cmd='$OBJDUMP -f'
12935+ fi
12936+ ;;
12937+
12938+cegcc*)
12939+ # use the weaker test based on 'objdump'. See mingw*.
12940+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
12941+ lt_cv_file_magic_cmd='$OBJDUMP -f'
12942+ ;;
12943+
12944+darwin* | rhapsody*)
12945+ lt_cv_deplibs_check_method=pass_all
12946+ ;;
12947+
12948+freebsd* | dragonfly*)
12949+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
12950+ case $host_cpu in
12951+ i*86 )
12952+ # Not sure whether the presence of OpenBSD here was a mistake.
12953+ # Let's accept both of them until this is cleared up.
12954+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
12955+ lt_cv_file_magic_cmd=/usr/bin/file
12956+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
12957+ ;;
12958+ esac
12959+ else
12960+ lt_cv_deplibs_check_method=pass_all
12961+ fi
12962+ ;;
12963+
12964+gnu*)
12965+ lt_cv_deplibs_check_method=pass_all
12966+ ;;
12967+
12968+haiku*)
12969+ lt_cv_deplibs_check_method=pass_all
12970+ ;;
12971+
12972+hpux10.20* | hpux11*)
12973+ lt_cv_file_magic_cmd=/usr/bin/file
12974+ case $host_cpu in
12975+ ia64*)
12976+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
12977+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
12978+ ;;
12979+ hppa*64*)
12980+ 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]'
12981+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
12982+ ;;
12983+ *)
12984+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
12985+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
12986+ ;;
12987+ esac
12988+ ;;
12989+
12990+interix[3-9]*)
12991+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
12992+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
12993+ ;;
12994+
12995+irix5* | irix6* | nonstopux*)
12996+ case $LD in
12997+ *-32|*"-32 ") libmagic=32-bit;;
12998+ *-n32|*"-n32 ") libmagic=N32;;
12999+ *-64|*"-64 ") libmagic=64-bit;;
13000+ *) libmagic=never-match;;
13001+ esac
13002+ lt_cv_deplibs_check_method=pass_all
13003+ ;;
13004+
13005+# This must be glibc/ELF.
13006+linux* | k*bsd*-gnu | kopensolaris*-gnu)
13007+ lt_cv_deplibs_check_method=pass_all
13008+ ;;
13009+
13010+netbsd* | netbsdelf*-gnu)
13011+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
13012+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
13013+ else
13014+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
13015+ fi
13016+ ;;
13017+
13018+newos6*)
13019+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
13020+ lt_cv_file_magic_cmd=/usr/bin/file
13021+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
13022+ ;;
13023+
13024+*nto* | *qnx*)
13025+ lt_cv_deplibs_check_method=pass_all
13026+ ;;
13027+
13028+openbsd*)
13029+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
13030+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
13031+ else
13032+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
13033+ fi
13034+ ;;
13035+
13036+osf3* | osf4* | osf5*)
13037+ lt_cv_deplibs_check_method=pass_all
13038+ ;;
13039+
13040+rdos*)
13041+ lt_cv_deplibs_check_method=pass_all
13042+ ;;
13043+
13044+solaris*)
13045+ lt_cv_deplibs_check_method=pass_all
13046+ ;;
13047+
13048+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
13049+ lt_cv_deplibs_check_method=pass_all
13050+ ;;
13051+
13052+sysv4 | sysv4.3*)
13053+ case $host_vendor in
13054+ motorola)
13055+ 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]'
13056+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
13057+ ;;
13058+ ncr)
13059+ lt_cv_deplibs_check_method=pass_all
13060+ ;;
13061+ sequent)
13062+ lt_cv_file_magic_cmd='/bin/file'
13063+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
13064+ ;;
13065+ sni)
13066+ lt_cv_file_magic_cmd='/bin/file'
13067+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
13068+ lt_cv_file_magic_test_file=/lib/libc.so
13069+ ;;
13070+ siemens)
13071+ lt_cv_deplibs_check_method=pass_all
13072+ ;;
13073+ pc)
13074+ lt_cv_deplibs_check_method=pass_all
13075+ ;;
13076+ esac
13077+ ;;
13078+
13079+tpf*)
13080+ lt_cv_deplibs_check_method=pass_all
13081+ ;;
13082+esac
13083+
13084+fi
13085+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
13086+$as_echo "$lt_cv_deplibs_check_method" >&6; }
13087+
13088+file_magic_glob=
13089+want_nocaseglob=no
13090+if test "$build" = "$host"; then
13091+ case $host_os in
13092+ mingw* | pw32*)
13093+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
13094+ want_nocaseglob=yes
13095+ else
13096+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
13097+ fi
13098+ ;;
13099+ esac
13100+fi
13101+
13102+file_magic_cmd=$lt_cv_file_magic_cmd
13103+deplibs_check_method=$lt_cv_deplibs_check_method
13104+test -z "$deplibs_check_method" && deplibs_check_method=unknown
13105+
13106+
13107+
13108+
13109+
13110+
13111+
13112+
13113+
13114+
13115+
13116+
13117+
13118+
13119+
13120+
13121+
13122+
13123+
13124+
13125+
13126+
13127+if test -n "$ac_tool_prefix"; then
13128+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
13129+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
13130+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13131+$as_echo_n "checking for $ac_word... " >&6; }
13132+if ${ac_cv_prog_DLLTOOL+:} false; then :
13133+ $as_echo_n "(cached) " >&6
13134+else
13135+ if test -n "$DLLTOOL"; then
13136+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
13137+else
13138+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13139+for as_dir in $PATH
13140+do
13141+ IFS=$as_save_IFS
13142+ test -z "$as_dir" && as_dir=.
13143+ for ac_exec_ext in '' $ac_executable_extensions; do
13144+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13145+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
13146+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13147+ break 2
13148+ fi
13149+done
13150+ done
13151+IFS=$as_save_IFS
13152+
13153+fi
13154+fi
13155+DLLTOOL=$ac_cv_prog_DLLTOOL
13156+if test -n "$DLLTOOL"; then
13157+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
13158+$as_echo "$DLLTOOL" >&6; }
13159+else
13160+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13161+$as_echo "no" >&6; }
13162+fi
13163+
13164+
13165+fi
13166+if test -z "$ac_cv_prog_DLLTOOL"; then
13167+ ac_ct_DLLTOOL=$DLLTOOL
13168+ # Extract the first word of "dlltool", so it can be a program name with args.
13169+set dummy dlltool; ac_word=$2
13170+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13171+$as_echo_n "checking for $ac_word... " >&6; }
13172+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
13173+ $as_echo_n "(cached) " >&6
13174+else
13175+ if test -n "$ac_ct_DLLTOOL"; then
13176+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
13177+else
13178+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13179+for as_dir in $PATH
13180+do
13181+ IFS=$as_save_IFS
13182+ test -z "$as_dir" && as_dir=.
13183+ for ac_exec_ext in '' $ac_executable_extensions; do
13184+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13185+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
13186+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13187+ break 2
13188+ fi
13189+done
13190+ done
13191+IFS=$as_save_IFS
13192+
13193+fi
13194+fi
13195+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
13196+if test -n "$ac_ct_DLLTOOL"; then
13197+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
13198+$as_echo "$ac_ct_DLLTOOL" >&6; }
13199+else
13200+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13201+$as_echo "no" >&6; }
13202+fi
13203+
13204+ if test "x$ac_ct_DLLTOOL" = x; then
13205+ DLLTOOL="false"
13206+ else
13207+ case $cross_compiling:$ac_tool_warned in
13208+yes:)
13209+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
13210+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
13211+ac_tool_warned=yes ;;
13212+esac
13213+ DLLTOOL=$ac_ct_DLLTOOL
13214+ fi
13215+else
13216+ DLLTOOL="$ac_cv_prog_DLLTOOL"
13217+fi
13218+
13219+test -z "$DLLTOOL" && DLLTOOL=dlltool
13220+
13221+
13222+
13223+
13224+
13225+
13226+
13227+
13228+
13229+
13230+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
13231+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
13232+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
13233+ $as_echo_n "(cached) " >&6
13234+else
13235+ lt_cv_sharedlib_from_linklib_cmd='unknown'
13236+
13237+case $host_os in
13238+cygwin* | mingw* | pw32* | cegcc*)
13239+ # two different shell functions defined in ltmain.sh
13240+ # decide which to use based on capabilities of $DLLTOOL
13241+ case `$DLLTOOL --help 2>&1` in
13242+ *--identify-strict*)
13243+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
13244+ ;;
13245+ *)
13246+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
13247+ ;;
13248+ esac
13249+ ;;
13250+*)
13251+ # fallback: assume linklib IS sharedlib
13252+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
13253+ ;;
13254+esac
13255+
13256+fi
13257+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
13258+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
13259+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
13260+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
13261+
13262+
13263+
13264+
13265+
13266+
13267+
13268+
13269+if test -n "$ac_tool_prefix"; then
13270+ for ac_prog in ar
13271+ do
13272+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13273+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13274+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13275+$as_echo_n "checking for $ac_word... " >&6; }
13276+if ${ac_cv_prog_AR+:} false; then :
13277+ $as_echo_n "(cached) " >&6
13278+else
13279+ if test -n "$AR"; then
13280+ ac_cv_prog_AR="$AR" # Let the user override the test.
13281+else
13282+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13283+for as_dir in $PATH
13284+do
13285+ IFS=$as_save_IFS
13286+ test -z "$as_dir" && as_dir=.
13287+ for ac_exec_ext in '' $ac_executable_extensions; do
13288+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13289+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
13290+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13291+ break 2
13292+ fi
13293+done
13294+ done
13295+IFS=$as_save_IFS
13296+
13297+fi
13298+fi
13299+AR=$ac_cv_prog_AR
13300+if test -n "$AR"; then
13301+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
13302+$as_echo "$AR" >&6; }
13303+else
13304+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13305+$as_echo "no" >&6; }
13306+fi
13307+
13308+
13309+ test -n "$AR" && break
13310+ done
13311+fi
13312+if test -z "$AR"; then
13313+ ac_ct_AR=$AR
13314+ for ac_prog in ar
13315+do
13316+ # Extract the first word of "$ac_prog", so it can be a program name with args.
13317+set dummy $ac_prog; ac_word=$2
13318+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13319+$as_echo_n "checking for $ac_word... " >&6; }
13320+if ${ac_cv_prog_ac_ct_AR+:} false; then :
13321+ $as_echo_n "(cached) " >&6
13322+else
13323+ if test -n "$ac_ct_AR"; then
13324+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
13325+else
13326+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13327+for as_dir in $PATH
13328+do
13329+ IFS=$as_save_IFS
13330+ test -z "$as_dir" && as_dir=.
13331+ for ac_exec_ext in '' $ac_executable_extensions; do
13332+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13333+ ac_cv_prog_ac_ct_AR="$ac_prog"
13334+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13335+ break 2
13336+ fi
13337+done
13338+ done
13339+IFS=$as_save_IFS
13340+
13341+fi
13342+fi
13343+ac_ct_AR=$ac_cv_prog_ac_ct_AR
13344+if test -n "$ac_ct_AR"; then
13345+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
13346+$as_echo "$ac_ct_AR" >&6; }
13347+else
13348+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13349+$as_echo "no" >&6; }
13350+fi
13351+
13352+
13353+ test -n "$ac_ct_AR" && break
13354+done
13355+
13356+ if test "x$ac_ct_AR" = x; then
13357+ AR="false"
13358+ else
13359+ case $cross_compiling:$ac_tool_warned in
13360+yes:)
13361+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
13362+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
13363+ac_tool_warned=yes ;;
13364+esac
13365+ AR=$ac_ct_AR
13366+ fi
13367+fi
13368+
13369+: ${AR=ar}
13370+: ${AR_FLAGS=cru}
13371+
13372+
13373+
13374+
13375+
13376+
13377+
13378+
13379+
13380+
13381+
13382+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
13383+$as_echo_n "checking for archiver @FILE support... " >&6; }
13384+if ${lt_cv_ar_at_file+:} false; then :
13385+ $as_echo_n "(cached) " >&6
13386+else
13387+ lt_cv_ar_at_file=no
13388+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13389+/* end confdefs.h. */
13390+
13391+int
13392+main ()
13393+{
13394+
13395+ ;
13396+ return 0;
13397+}
13398+_ACEOF
13399+if ac_fn_c_try_compile "$LINENO"; then :
13400+ echo conftest.$ac_objext > conftest.lst
13401+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
13402+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
13403+ (eval $lt_ar_try) 2>&5
13404+ ac_status=$?
13405+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13406+ test $ac_status = 0; }
13407+ if test "$ac_status" -eq 0; then
13408+ # Ensure the archiver fails upon bogus file names.
13409+ rm -f conftest.$ac_objext libconftest.a
13410+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
13411+ (eval $lt_ar_try) 2>&5
13412+ ac_status=$?
13413+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13414+ test $ac_status = 0; }
13415+ if test "$ac_status" -ne 0; then
13416+ lt_cv_ar_at_file=@
13417+ fi
13418+ fi
13419+ rm -f conftest.* libconftest.a
13420+
13421+fi
13422+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13423+
13424+fi
13425+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
13426+$as_echo "$lt_cv_ar_at_file" >&6; }
13427+
13428+if test "x$lt_cv_ar_at_file" = xno; then
13429+ archiver_list_spec=
13430+else
13431+ archiver_list_spec=$lt_cv_ar_at_file
13432+fi
13433+
13434+
13435+
13436+
13437+
13438+
13439+
13440+if test -n "$ac_tool_prefix"; then
13441+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
13442+set dummy ${ac_tool_prefix}strip; ac_word=$2
13443+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13444+$as_echo_n "checking for $ac_word... " >&6; }
13445+if ${ac_cv_prog_STRIP+:} false; then :
13446+ $as_echo_n "(cached) " >&6
13447+else
13448+ if test -n "$STRIP"; then
13449+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
13450+else
13451+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13452+for as_dir in $PATH
13453+do
13454+ IFS=$as_save_IFS
13455+ test -z "$as_dir" && as_dir=.
13456+ for ac_exec_ext in '' $ac_executable_extensions; do
13457+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13458+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
13459+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13460+ break 2
13461+ fi
13462+done
13463+ done
13464+IFS=$as_save_IFS
13465+
13466+fi
13467+fi
13468+STRIP=$ac_cv_prog_STRIP
13469+if test -n "$STRIP"; then
13470+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
13471+$as_echo "$STRIP" >&6; }
13472+else
13473+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13474+$as_echo "no" >&6; }
13475+fi
13476+
13477+
13478+fi
13479+if test -z "$ac_cv_prog_STRIP"; then
13480+ ac_ct_STRIP=$STRIP
13481+ # Extract the first word of "strip", so it can be a program name with args.
13482+set dummy strip; ac_word=$2
13483+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13484+$as_echo_n "checking for $ac_word... " >&6; }
13485+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
13486+ $as_echo_n "(cached) " >&6
13487+else
13488+ if test -n "$ac_ct_STRIP"; then
13489+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
13490+else
13491+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13492+for as_dir in $PATH
13493+do
13494+ IFS=$as_save_IFS
13495+ test -z "$as_dir" && as_dir=.
13496+ for ac_exec_ext in '' $ac_executable_extensions; do
13497+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13498+ ac_cv_prog_ac_ct_STRIP="strip"
13499+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13500+ break 2
13501+ fi
13502+done
13503+ done
13504+IFS=$as_save_IFS
13505+
13506+fi
13507+fi
13508+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
13509+if test -n "$ac_ct_STRIP"; then
13510+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
13511+$as_echo "$ac_ct_STRIP" >&6; }
13512+else
13513+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13514+$as_echo "no" >&6; }
13515+fi
13516+
13517+ if test "x$ac_ct_STRIP" = x; then
13518+ STRIP=":"
13519+ else
13520+ case $cross_compiling:$ac_tool_warned in
13521+yes:)
13522+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
13523+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
13524+ac_tool_warned=yes ;;
13525+esac
13526+ STRIP=$ac_ct_STRIP
13527+ fi
13528+else
13529+ STRIP="$ac_cv_prog_STRIP"
13530+fi
13531+
13532+test -z "$STRIP" && STRIP=:
13533+
13534+
13535+
13536+
13537+
13538+
13539+if test -n "$ac_tool_prefix"; then
13540+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
13541+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
13542+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13543+$as_echo_n "checking for $ac_word... " >&6; }
13544+if ${ac_cv_prog_RANLIB+:} false; then :
13545+ $as_echo_n "(cached) " >&6
13546+else
13547+ if test -n "$RANLIB"; then
13548+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
13549+else
13550+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13551+for as_dir in $PATH
13552+do
13553+ IFS=$as_save_IFS
13554+ test -z "$as_dir" && as_dir=.
13555+ for ac_exec_ext in '' $ac_executable_extensions; do
13556+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13557+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
13558+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13559+ break 2
13560+ fi
13561+done
13562+ done
13563+IFS=$as_save_IFS
13564+
13565+fi
13566+fi
13567+RANLIB=$ac_cv_prog_RANLIB
13568+if test -n "$RANLIB"; then
13569+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
13570+$as_echo "$RANLIB" >&6; }
13571+else
13572+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13573+$as_echo "no" >&6; }
13574+fi
13575+
13576+
13577+fi
13578+if test -z "$ac_cv_prog_RANLIB"; then
13579+ ac_ct_RANLIB=$RANLIB
13580+ # Extract the first word of "ranlib", so it can be a program name with args.
13581+set dummy ranlib; ac_word=$2
13582+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13583+$as_echo_n "checking for $ac_word... " >&6; }
13584+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
13585+ $as_echo_n "(cached) " >&6
13586+else
13587+ if test -n "$ac_ct_RANLIB"; then
13588+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
13589+else
13590+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13591+for as_dir in $PATH
13592+do
13593+ IFS=$as_save_IFS
13594+ test -z "$as_dir" && as_dir=.
13595+ for ac_exec_ext in '' $ac_executable_extensions; do
13596+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13597+ ac_cv_prog_ac_ct_RANLIB="ranlib"
13598+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13599+ break 2
13600+ fi
13601+done
13602+ done
13603+IFS=$as_save_IFS
13604+
13605+fi
13606+fi
13607+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
13608+if test -n "$ac_ct_RANLIB"; then
13609+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
13610+$as_echo "$ac_ct_RANLIB" >&6; }
13611+else
13612+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13613+$as_echo "no" >&6; }
13614+fi
13615+
13616+ if test "x$ac_ct_RANLIB" = x; then
13617+ RANLIB=":"
13618+ else
13619+ case $cross_compiling:$ac_tool_warned in
13620+yes:)
13621+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
13622+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
13623+ac_tool_warned=yes ;;
13624+esac
13625+ RANLIB=$ac_ct_RANLIB
13626+ fi
13627+else
13628+ RANLIB="$ac_cv_prog_RANLIB"
13629+fi
13630+
13631+test -z "$RANLIB" && RANLIB=:
13632+
13633+
13634+
13635+
13636+
13637+
13638+# Determine commands to create old-style static archives.
13639+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
13640+old_postinstall_cmds='chmod 644 $oldlib'
13641+old_postuninstall_cmds=
13642+
13643+if test -n "$RANLIB"; then
13644+ case $host_os in
13645+ openbsd*)
13646+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
13647+ ;;
13648+ *)
13649+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
13650+ ;;
13651+ esac
13652+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
13653+fi
13654+
13655+case $host_os in
13656+ darwin*)
13657+ lock_old_archive_extraction=yes ;;
13658+ *)
13659+ lock_old_archive_extraction=no ;;
13660+esac
13661+
13662+
13663+
13664+
13665+
13666+
13667+
13668+
13669+
13670+
13671+
13672+
13673+
13674+
13675+
13676+
13677+
13678+
13679+
13680+
13681+
13682+
13683+
13684+
13685+
13686+
13687+
13688+
13689+
13690+
13691+
13692+
13693+
13694+
13695+
13696+
13697+
13698+
13699+
13700+# If no C compiler was specified, use CC.
13701+LTCC=${LTCC-"$CC"}
13702+
13703+# If no C compiler flags were specified, use CFLAGS.
13704+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
13705+
13706+# Allow CC to be a program name with arguments.
13707+compiler=$CC
13708+
13709+
13710+# Check for command to grab the raw symbol name followed by C symbol from nm.
13711+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
13712+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
13713+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
13714+ $as_echo_n "(cached) " >&6
13715+else
13716+
13717+# These are sane defaults that work on at least a few old systems.
13718+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
13719+
13720+# Character class describing NM global symbol codes.
13721+symcode='[BCDEGRST]'
13722+
13723+# Regexp to match symbols that can be accessed directly from C.
13724+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
13725+
13726+# Define system-specific variables.
13727+case $host_os in
13728+aix*)
13729+ symcode='[BCDT]'
13730+ ;;
13731+cygwin* | mingw* | pw32* | cegcc*)
13732+ symcode='[ABCDGISTW]'
13733+ ;;
13734+hpux*)
13735+ if test "$host_cpu" = ia64; then
13736+ symcode='[ABCDEGRST]'
13737+ fi
13738+ ;;
13739+irix* | nonstopux*)
13740+ symcode='[BCDEGRST]'
13741+ ;;
13742+osf*)
13743+ symcode='[BCDEGQRST]'
13744+ ;;
13745+solaris*)
13746+ symcode='[BDRT]'
13747+ ;;
13748+sco3.2v5*)
13749+ symcode='[DT]'
13750+ ;;
13751+sysv4.2uw2*)
13752+ symcode='[DT]'
13753+ ;;
13754+sysv5* | sco5v6* | unixware* | OpenUNIX*)
13755+ symcode='[ABDT]'
13756+ ;;
13757+sysv4)
13758+ symcode='[DFNSTU]'
13759+ ;;
13760+esac
13761+
13762+# If we're using GNU nm, then use its standard symbol codes.
13763+case `$NM -V 2>&1` in
13764+*GNU* | *'with BFD'*)
13765+ symcode='[ABCDGIRSTW]' ;;
13766+esac
13767+
13768+# Transform an extracted symbol line into a proper C declaration.
13769+# Some systems (esp. on ia64) link data and code symbols differently,
13770+# so use this general approach.
13771+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
13772+
13773+# Transform an extracted symbol line into symbol name and symbol address
13774+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
13775+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'"
13776+
13777+# Handle CRLF in mingw tool chain
13778+opt_cr=
13779+case $build_os in
13780+mingw*)
13781+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
13782+ ;;
13783+esac
13784+
13785+# Try without a prefix underscore, then with it.
13786+for ac_symprfx in "" "_"; do
13787+
13788+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
13789+ symxfrm="\\1 $ac_symprfx\\2 \\2"
13790+
13791+ # Write the raw and C identifiers.
13792+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
13793+ # Fake it for dumpbin and say T for any non-static function
13794+ # and D for any global variable.
13795+ # Also find C++ and __fastcall symbols from MSVC++,
13796+ # which start with @ or ?.
13797+ lt_cv_sys_global_symbol_pipe="$AWK '"\
13798+" {last_section=section; section=\$ 3};"\
13799+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
13800+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
13801+" \$ 0!~/External *\|/{next};"\
13802+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
13803+" {if(hide[section]) next};"\
13804+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
13805+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
13806+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
13807+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
13808+" ' prfx=^$ac_symprfx"
13809+ else
13810+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
13811+ fi
13812+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
13813+
13814+ # Check to see that the pipe works correctly.
13815+ pipe_works=no
13816+
13817+ rm -f conftest*
13818+ cat > conftest.$ac_ext <<_LT_EOF
13819+#ifdef __cplusplus
13820+extern "C" {
13821+#endif
13822+char nm_test_var;
13823+void nm_test_func(void);
13824+void nm_test_func(void){}
13825+#ifdef __cplusplus
13826+}
13827+#endif
13828+int main(){nm_test_var='a';nm_test_func();return(0);}
13829+_LT_EOF
13830+
13831+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
13832+ (eval $ac_compile) 2>&5
13833+ ac_status=$?
13834+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13835+ test $ac_status = 0; }; then
13836+ # Now try to grab the symbols.
13837+ nlist=conftest.nm
13838+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
13839+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
13840+ ac_status=$?
13841+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13842+ test $ac_status = 0; } && test -s "$nlist"; then
13843+ # Try sorting and uniquifying the output.
13844+ if sort "$nlist" | uniq > "$nlist"T; then
13845+ mv -f "$nlist"T "$nlist"
13846+ else
13847+ rm -f "$nlist"T
13848+ fi
13849+
13850+ # Make sure that we snagged all the symbols we need.
13851+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
13852+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
13853+ cat <<_LT_EOF > conftest.$ac_ext
13854+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
13855+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
13856+/* DATA imports from DLLs on WIN32 con't be const, because runtime
13857+ relocations are performed -- see ld's documentation on pseudo-relocs. */
13858+# define LT_DLSYM_CONST
13859+#elif defined(__osf__)
13860+/* This system does not cope well with relocations in const data. */
13861+# define LT_DLSYM_CONST
13862+#else
13863+# define LT_DLSYM_CONST const
13864+#endif
13865+
13866+#ifdef __cplusplus
13867+extern "C" {
13868+#endif
13869+
13870+_LT_EOF
13871+ # Now generate the symbol file.
13872+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
13873+
13874+ cat <<_LT_EOF >> conftest.$ac_ext
13875+
13876+/* The mapping between symbol names and symbols. */
13877+LT_DLSYM_CONST struct {
13878+ const char *name;
13879+ void *address;
13880+}
13881+lt__PROGRAM__LTX_preloaded_symbols[] =
13882+{
13883+ { "@PROGRAM@", (void *) 0 },
13884+_LT_EOF
13885+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
13886+ cat <<\_LT_EOF >> conftest.$ac_ext
13887+ {0, (void *) 0}
13888+};
13889+
13890+/* This works around a problem in FreeBSD linker */
13891+#ifdef FREEBSD_WORKAROUND
13892+static const void *lt_preloaded_setup() {
13893+ return lt__PROGRAM__LTX_preloaded_symbols;
13894+}
13895+#endif
13896+
13897+#ifdef __cplusplus
13898+}
13899+#endif
13900+_LT_EOF
13901+ # Now try linking the two files.
13902+ mv conftest.$ac_objext conftstm.$ac_objext
13903+ lt_globsym_save_LIBS=$LIBS
13904+ lt_globsym_save_CFLAGS=$CFLAGS
13905+ LIBS="conftstm.$ac_objext"
13906+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
13907+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13908+ (eval $ac_link) 2>&5
13909+ ac_status=$?
13910+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13911+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
13912+ pipe_works=yes
13913+ fi
13914+ LIBS=$lt_globsym_save_LIBS
13915+ CFLAGS=$lt_globsym_save_CFLAGS
13916+ else
13917+ echo "cannot find nm_test_func in $nlist" >&5
13918+ fi
13919+ else
13920+ echo "cannot find nm_test_var in $nlist" >&5
13921+ fi
13922+ else
13923+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
13924+ fi
13925+ else
13926+ echo "$progname: failed program was:" >&5
13927+ cat conftest.$ac_ext >&5
13928+ fi
13929+ rm -rf conftest* conftst*
13930+
13931+ # Do not use the global_symbol_pipe unless it works.
13932+ if test "$pipe_works" = yes; then
13933+ break
13934+ else
13935+ lt_cv_sys_global_symbol_pipe=
13936+ fi
13937+done
13938+
13939+fi
13940+
13941+if test -z "$lt_cv_sys_global_symbol_pipe"; then
13942+ lt_cv_sys_global_symbol_to_cdecl=
13943+fi
13944+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
13945+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
13946+$as_echo "failed" >&6; }
13947+else
13948+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
13949+$as_echo "ok" >&6; }
13950+fi
13951+
13952+# Response file support.
13953+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
13954+ nm_file_list_spec='@'
13955+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
13956+ nm_file_list_spec='@'
13957+fi
13958+
13959+
13960+
13961+
13962+
13963+
13964+
13965+
13966+
13967+
13968+
13969+
13970+
13971+
13972+
13973+
13974+
13975+
13976+
13977+
13978+
13979+
13980+
13981+
13982+
13983+
13984+
13985+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
13986+$as_echo_n "checking for sysroot... " >&6; }
13987+
13988+# Check whether --with-sysroot was given.
13989+if test "${with_sysroot+set}" = set; then :
13990+ withval=$with_sysroot;
13991+else
13992+ with_sysroot=no
13993+fi
13994+
13995+
13996+lt_sysroot=
13997+case ${with_sysroot} in #(
13998+ yes)
13999+ if test "$GCC" = yes; then
14000+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
14001+ fi
14002+ ;; #(
14003+ /*)
14004+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
14005+ ;; #(
14006+ no|'')
14007+ ;; #(
14008+ *)
14009+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
14010+$as_echo "${with_sysroot}" >&6; }
14011+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
14012+ ;;
14013+esac
14014+
14015+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
14016+$as_echo "${lt_sysroot:-no}" >&6; }
14017+
14018+
14019+
14020+
14021+
14022+# Check whether --enable-libtool-lock was given.
14023+if test "${enable_libtool_lock+set}" = set; then :
14024+ enableval=$enable_libtool_lock;
14025+fi
14026+
14027+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
14028+
14029+# Some flags need to be propagated to the compiler or linker for good
14030+# libtool support.
14031+case $host in
14032+ia64-*-hpux*)
14033+ # Find out which ABI we are using.
14034+ echo 'int i;' > conftest.$ac_ext
14035+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
14036+ (eval $ac_compile) 2>&5
14037+ ac_status=$?
14038+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14039+ test $ac_status = 0; }; then
14040+ case `/usr/bin/file conftest.$ac_objext` in
14041+ *ELF-32*)
14042+ HPUX_IA64_MODE="32"
14043+ ;;
14044+ *ELF-64*)
14045+ HPUX_IA64_MODE="64"
14046+ ;;
14047+ esac
14048+ fi
14049+ rm -rf conftest*
14050+ ;;
14051+*-*-irix6*)
14052+ # Find out which ABI we are using.
14053+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
14054+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
14055+ (eval $ac_compile) 2>&5
14056+ ac_status=$?
14057+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14058+ test $ac_status = 0; }; then
14059+ if test "$lt_cv_prog_gnu_ld" = yes; then
14060+ case `/usr/bin/file conftest.$ac_objext` in
14061+ *32-bit*)
14062+ LD="${LD-ld} -melf32bsmip"
14063+ ;;
14064+ *N32*)
14065+ LD="${LD-ld} -melf32bmipn32"
14066+ ;;
14067+ *64-bit*)
14068+ LD="${LD-ld} -melf64bmip"
14069+ ;;
14070+ esac
14071+ else
14072+ case `/usr/bin/file conftest.$ac_objext` in
14073+ *32-bit*)
14074+ LD="${LD-ld} -32"
14075+ ;;
14076+ *N32*)
14077+ LD="${LD-ld} -n32"
14078+ ;;
14079+ *64-bit*)
14080+ LD="${LD-ld} -64"
14081+ ;;
14082+ esac
14083+ fi
14084+ fi
14085+ rm -rf conftest*
14086+ ;;
14087+
14088+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
14089+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
14090+ # Find out which ABI we are using.
14091+ echo 'int i;' > conftest.$ac_ext
14092+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
14093+ (eval $ac_compile) 2>&5
14094+ ac_status=$?
14095+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14096+ test $ac_status = 0; }; then
14097+ case `/usr/bin/file conftest.o` in
14098+ *32-bit*)
14099+ case $host in
14100+ x86_64-*kfreebsd*-gnu)
14101+ LD="${LD-ld} -m elf_i386_fbsd"
14102+ ;;
14103+ x86_64-*linux*)
14104+ LD="${LD-ld} -m elf_i386"
14105+ ;;
14106+ ppc64-*linux*|powerpc64-*linux*)
14107+ LD="${LD-ld} -m elf32ppclinux"
14108+ ;;
14109+ s390x-*linux*)
14110+ LD="${LD-ld} -m elf_s390"
14111+ ;;
14112+ sparc64-*linux*)
14113+ LD="${LD-ld} -m elf32_sparc"
14114+ ;;
14115+ esac
14116+ ;;
14117+ *64-bit*)
14118+ case $host in
14119+ x86_64-*kfreebsd*-gnu)
14120+ LD="${LD-ld} -m elf_x86_64_fbsd"
14121+ ;;
14122+ x86_64-*linux*)
14123+ LD="${LD-ld} -m elf_x86_64"
14124+ ;;
14125+ ppc*-*linux*|powerpc*-*linux*)
14126+ LD="${LD-ld} -m elf64ppc"
14127+ ;;
14128+ s390*-*linux*|s390*-*tpf*)
14129+ LD="${LD-ld} -m elf64_s390"
14130+ ;;
14131+ sparc*-*linux*)
14132+ LD="${LD-ld} -m elf64_sparc"
14133+ ;;
14134+ esac
14135+ ;;
14136+ esac
14137+ fi
14138+ rm -rf conftest*
14139+ ;;
14140+
14141+*-*-sco3.2v5*)
14142+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
14143+ SAVE_CFLAGS="$CFLAGS"
14144+ CFLAGS="$CFLAGS -belf"
14145+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
14146+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
14147+if ${lt_cv_cc_needs_belf+:} false; then :
14148+ $as_echo_n "(cached) " >&6
14149+else
14150+ ac_ext=c
14151+ac_cpp='$CPP $CPPFLAGS'
14152+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14153+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14154+ac_compiler_gnu=$ac_cv_c_compiler_gnu
14155+
14156+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14157+/* end confdefs.h. */
14158+
14159+int
14160+main ()
14161+{
14162+
14163+ ;
14164+ return 0;
14165+}
14166+_ACEOF
14167+if ac_fn_c_try_link "$LINENO"; then :
14168+ lt_cv_cc_needs_belf=yes
14169+else
14170+ lt_cv_cc_needs_belf=no
14171+fi
14172+rm -f core conftest.err conftest.$ac_objext \
14173+ conftest$ac_exeext conftest.$ac_ext
14174+ ac_ext=c
14175+ac_cpp='$CPP $CPPFLAGS'
14176+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14177+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14178+ac_compiler_gnu=$ac_cv_c_compiler_gnu
14179+
14180+fi
14181+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
14182+$as_echo "$lt_cv_cc_needs_belf" >&6; }
14183+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
14184+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
14185+ CFLAGS="$SAVE_CFLAGS"
14186+ fi
14187+ ;;
14188+*-*solaris*)
14189+ # Find out which ABI we are using.
14190+ echo 'int i;' > conftest.$ac_ext
14191+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
14192+ (eval $ac_compile) 2>&5
14193+ ac_status=$?
14194+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14195+ test $ac_status = 0; }; then
14196+ case `/usr/bin/file conftest.o` in
14197+ *64-bit*)
14198+ case $lt_cv_prog_gnu_ld in
14199+ yes*)
14200+ case $host in
14201+ i?86-*-solaris*)
14202+ LD="${LD-ld} -m elf_x86_64"
14203+ ;;
14204+ sparc*-*-solaris*)
14205+ LD="${LD-ld} -m elf64_sparc"
14206+ ;;
14207+ esac
14208+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
14209+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14210+ LD="${LD-ld}_sol2"
14211+ fi
14212+ ;;
14213+ *)
14214+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14215+ LD="${LD-ld} -64"
14216+ fi
14217+ ;;
14218+ esac
14219+ ;;
14220+ esac
14221+ fi
14222+ rm -rf conftest*
14223+ ;;
14224+esac
14225+
14226+need_locks="$enable_libtool_lock"
14227+
14228+if test -n "$ac_tool_prefix"; then
14229+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
14230+set dummy ${ac_tool_prefix}mt; ac_word=$2
14231+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14232+$as_echo_n "checking for $ac_word... " >&6; }
14233+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
14234+ $as_echo_n "(cached) " >&6
14235+else
14236+ if test -n "$MANIFEST_TOOL"; then
14237+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
14238+else
14239+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14240+for as_dir in $PATH
14241+do
14242+ IFS=$as_save_IFS
14243+ test -z "$as_dir" && as_dir=.
14244+ for ac_exec_ext in '' $ac_executable_extensions; do
14245+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14246+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
14247+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14248+ break 2
14249+ fi
14250+done
14251+ done
14252+IFS=$as_save_IFS
14253+
14254+fi
14255+fi
14256+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
14257+if test -n "$MANIFEST_TOOL"; then
14258+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
14259+$as_echo "$MANIFEST_TOOL" >&6; }
14260+else
14261+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14262+$as_echo "no" >&6; }
14263+fi
14264+
14265+
14266+fi
14267+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
14268+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
14269+ # Extract the first word of "mt", so it can be a program name with args.
14270+set dummy mt; ac_word=$2
14271+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14272+$as_echo_n "checking for $ac_word... " >&6; }
14273+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
14274+ $as_echo_n "(cached) " >&6
14275+else
14276+ if test -n "$ac_ct_MANIFEST_TOOL"; then
14277+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
14278+else
14279+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14280+for as_dir in $PATH
14281+do
14282+ IFS=$as_save_IFS
14283+ test -z "$as_dir" && as_dir=.
14284+ for ac_exec_ext in '' $ac_executable_extensions; do
14285+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14286+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
14287+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14288+ break 2
14289+ fi
14290+done
14291+ done
14292+IFS=$as_save_IFS
14293+
14294+fi
14295+fi
14296+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
14297+if test -n "$ac_ct_MANIFEST_TOOL"; then
14298+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
14299+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
14300+else
14301+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14302+$as_echo "no" >&6; }
14303+fi
14304+
14305+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
14306+ MANIFEST_TOOL=":"
14307+ else
14308+ case $cross_compiling:$ac_tool_warned in
14309+yes:)
14310+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
14311+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
14312+ac_tool_warned=yes ;;
14313+esac
14314+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
14315+ fi
14316+else
14317+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
14318+fi
14319+
14320+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
14321+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
14322+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
14323+if ${lt_cv_path_mainfest_tool+:} false; then :
14324+ $as_echo_n "(cached) " >&6
14325+else
14326+ lt_cv_path_mainfest_tool=no
14327+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
14328+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
14329+ cat conftest.err >&5
14330+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
14331+ lt_cv_path_mainfest_tool=yes
14332+ fi
14333+ rm -f conftest*
14334+fi
14335+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
14336+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
14337+if test "x$lt_cv_path_mainfest_tool" != xyes; then
14338+ MANIFEST_TOOL=:
14339+fi
14340+
14341+
14342+
14343+
14344+
14345+
14346+ case $host_os in
14347+ rhapsody* | darwin*)
14348+ if test -n "$ac_tool_prefix"; then
14349+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
14350+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
14351+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14352+$as_echo_n "checking for $ac_word... " >&6; }
14353+if ${ac_cv_prog_DSYMUTIL+:} false; then :
14354+ $as_echo_n "(cached) " >&6
14355+else
14356+ if test -n "$DSYMUTIL"; then
14357+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
14358+else
14359+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14360+for as_dir in $PATH
14361+do
14362+ IFS=$as_save_IFS
14363+ test -z "$as_dir" && as_dir=.
14364+ for ac_exec_ext in '' $ac_executable_extensions; do
14365+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14366+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
14367+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14368+ break 2
14369+ fi
14370+done
14371+ done
14372+IFS=$as_save_IFS
14373+
14374+fi
14375+fi
14376+DSYMUTIL=$ac_cv_prog_DSYMUTIL
14377+if test -n "$DSYMUTIL"; then
14378+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
14379+$as_echo "$DSYMUTIL" >&6; }
14380+else
14381+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14382+$as_echo "no" >&6; }
14383+fi
14384+
14385+
14386+fi
14387+if test -z "$ac_cv_prog_DSYMUTIL"; then
14388+ ac_ct_DSYMUTIL=$DSYMUTIL
14389+ # Extract the first word of "dsymutil", so it can be a program name with args.
14390+set dummy dsymutil; ac_word=$2
14391+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14392+$as_echo_n "checking for $ac_word... " >&6; }
14393+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
14394+ $as_echo_n "(cached) " >&6
14395+else
14396+ if test -n "$ac_ct_DSYMUTIL"; then
14397+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
14398+else
14399+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14400+for as_dir in $PATH
14401+do
14402+ IFS=$as_save_IFS
14403+ test -z "$as_dir" && as_dir=.
14404+ for ac_exec_ext in '' $ac_executable_extensions; do
14405+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14406+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
14407+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14408+ break 2
14409+ fi
14410+done
14411+ done
14412+IFS=$as_save_IFS
14413+
14414+fi
14415+fi
14416+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
14417+if test -n "$ac_ct_DSYMUTIL"; then
14418+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
14419+$as_echo "$ac_ct_DSYMUTIL" >&6; }
14420+else
14421+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14422+$as_echo "no" >&6; }
14423+fi
14424+
14425+ if test "x$ac_ct_DSYMUTIL" = x; then
14426+ DSYMUTIL=":"
14427+ else
14428+ case $cross_compiling:$ac_tool_warned in
14429+yes:)
14430+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
14431+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
14432+ac_tool_warned=yes ;;
14433+esac
14434+ DSYMUTIL=$ac_ct_DSYMUTIL
14435+ fi
14436+else
14437+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
14438+fi
14439+
14440+ if test -n "$ac_tool_prefix"; then
14441+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
14442+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
14443+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14444+$as_echo_n "checking for $ac_word... " >&6; }
14445+if ${ac_cv_prog_NMEDIT+:} false; then :
14446+ $as_echo_n "(cached) " >&6
14447+else
14448+ if test -n "$NMEDIT"; then
14449+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
14450+else
14451+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14452+for as_dir in $PATH
14453+do
14454+ IFS=$as_save_IFS
14455+ test -z "$as_dir" && as_dir=.
14456+ for ac_exec_ext in '' $ac_executable_extensions; do
14457+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14458+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
14459+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14460+ break 2
14461+ fi
14462+done
14463+ done
14464+IFS=$as_save_IFS
14465+
14466+fi
14467+fi
14468+NMEDIT=$ac_cv_prog_NMEDIT
14469+if test -n "$NMEDIT"; then
14470+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
14471+$as_echo "$NMEDIT" >&6; }
14472+else
14473+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14474+$as_echo "no" >&6; }
14475+fi
14476+
14477+
14478+fi
14479+if test -z "$ac_cv_prog_NMEDIT"; then
14480+ ac_ct_NMEDIT=$NMEDIT
14481+ # Extract the first word of "nmedit", so it can be a program name with args.
14482+set dummy nmedit; ac_word=$2
14483+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14484+$as_echo_n "checking for $ac_word... " >&6; }
14485+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
14486+ $as_echo_n "(cached) " >&6
14487+else
14488+ if test -n "$ac_ct_NMEDIT"; then
14489+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
14490+else
14491+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14492+for as_dir in $PATH
14493+do
14494+ IFS=$as_save_IFS
14495+ test -z "$as_dir" && as_dir=.
14496+ for ac_exec_ext in '' $ac_executable_extensions; do
14497+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14498+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
14499+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14500+ break 2
14501+ fi
14502+done
14503+ done
14504+IFS=$as_save_IFS
14505+
14506+fi
14507+fi
14508+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
14509+if test -n "$ac_ct_NMEDIT"; then
14510+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
14511+$as_echo "$ac_ct_NMEDIT" >&6; }
14512+else
14513+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14514+$as_echo "no" >&6; }
14515+fi
14516+
14517+ if test "x$ac_ct_NMEDIT" = x; then
14518+ NMEDIT=":"
14519+ else
14520+ case $cross_compiling:$ac_tool_warned in
14521+yes:)
14522+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
14523+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
14524+ac_tool_warned=yes ;;
14525+esac
14526+ NMEDIT=$ac_ct_NMEDIT
14527+ fi
14528+else
14529+ NMEDIT="$ac_cv_prog_NMEDIT"
14530+fi
14531+
14532+ if test -n "$ac_tool_prefix"; then
14533+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
14534+set dummy ${ac_tool_prefix}lipo; ac_word=$2
14535+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14536+$as_echo_n "checking for $ac_word... " >&6; }
14537+if ${ac_cv_prog_LIPO+:} false; then :
14538+ $as_echo_n "(cached) " >&6
14539+else
14540+ if test -n "$LIPO"; then
14541+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
14542+else
14543+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14544+for as_dir in $PATH
14545+do
14546+ IFS=$as_save_IFS
14547+ test -z "$as_dir" && as_dir=.
14548+ for ac_exec_ext in '' $ac_executable_extensions; do
14549+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14550+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
14551+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14552+ break 2
14553+ fi
14554+done
14555+ done
14556+IFS=$as_save_IFS
14557+
14558+fi
14559+fi
14560+LIPO=$ac_cv_prog_LIPO
14561+if test -n "$LIPO"; then
14562+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
14563+$as_echo "$LIPO" >&6; }
14564+else
14565+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14566+$as_echo "no" >&6; }
14567+fi
14568+
14569+
14570+fi
14571+if test -z "$ac_cv_prog_LIPO"; then
14572+ ac_ct_LIPO=$LIPO
14573+ # Extract the first word of "lipo", so it can be a program name with args.
14574+set dummy lipo; ac_word=$2
14575+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14576+$as_echo_n "checking for $ac_word... " >&6; }
14577+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
14578+ $as_echo_n "(cached) " >&6
14579+else
14580+ if test -n "$ac_ct_LIPO"; then
14581+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
14582+else
14583+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14584+for as_dir in $PATH
14585+do
14586+ IFS=$as_save_IFS
14587+ test -z "$as_dir" && as_dir=.
14588+ for ac_exec_ext in '' $ac_executable_extensions; do
14589+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14590+ ac_cv_prog_ac_ct_LIPO="lipo"
14591+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14592+ break 2
14593+ fi
14594+done
14595+ done
14596+IFS=$as_save_IFS
14597+
14598+fi
14599+fi
14600+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
14601+if test -n "$ac_ct_LIPO"; then
14602+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
14603+$as_echo "$ac_ct_LIPO" >&6; }
14604+else
14605+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14606+$as_echo "no" >&6; }
14607+fi
14608+
14609+ if test "x$ac_ct_LIPO" = x; then
14610+ LIPO=":"
14611+ else
14612+ case $cross_compiling:$ac_tool_warned in
14613+yes:)
14614+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
14615+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
14616+ac_tool_warned=yes ;;
14617+esac
14618+ LIPO=$ac_ct_LIPO
14619+ fi
14620+else
14621+ LIPO="$ac_cv_prog_LIPO"
14622+fi
14623+
14624+ if test -n "$ac_tool_prefix"; then
14625+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
14626+set dummy ${ac_tool_prefix}otool; ac_word=$2
14627+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14628+$as_echo_n "checking for $ac_word... " >&6; }
14629+if ${ac_cv_prog_OTOOL+:} false; then :
14630+ $as_echo_n "(cached) " >&6
14631+else
14632+ if test -n "$OTOOL"; then
14633+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
14634+else
14635+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14636+for as_dir in $PATH
14637+do
14638+ IFS=$as_save_IFS
14639+ test -z "$as_dir" && as_dir=.
14640+ for ac_exec_ext in '' $ac_executable_extensions; do
14641+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14642+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
14643+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14644+ break 2
14645+ fi
14646+done
14647+ done
14648+IFS=$as_save_IFS
14649+
14650+fi
14651+fi
14652+OTOOL=$ac_cv_prog_OTOOL
14653+if test -n "$OTOOL"; then
14654+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
14655+$as_echo "$OTOOL" >&6; }
14656+else
14657+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14658+$as_echo "no" >&6; }
14659+fi
14660+
14661+
14662+fi
14663+if test -z "$ac_cv_prog_OTOOL"; then
14664+ ac_ct_OTOOL=$OTOOL
14665+ # Extract the first word of "otool", so it can be a program name with args.
14666+set dummy otool; ac_word=$2
14667+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14668+$as_echo_n "checking for $ac_word... " >&6; }
14669+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
14670+ $as_echo_n "(cached) " >&6
14671+else
14672+ if test -n "$ac_ct_OTOOL"; then
14673+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
14674+else
14675+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14676+for as_dir in $PATH
14677+do
14678+ IFS=$as_save_IFS
14679+ test -z "$as_dir" && as_dir=.
14680+ for ac_exec_ext in '' $ac_executable_extensions; do
14681+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14682+ ac_cv_prog_ac_ct_OTOOL="otool"
14683+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14684+ break 2
14685+ fi
14686+done
14687+ done
14688+IFS=$as_save_IFS
14689+
14690+fi
14691+fi
14692+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
14693+if test -n "$ac_ct_OTOOL"; then
14694+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
14695+$as_echo "$ac_ct_OTOOL" >&6; }
14696+else
14697+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14698+$as_echo "no" >&6; }
14699+fi
14700+
14701+ if test "x$ac_ct_OTOOL" = x; then
14702+ OTOOL=":"
14703+ else
14704+ case $cross_compiling:$ac_tool_warned in
14705+yes:)
14706+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
14707+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
14708+ac_tool_warned=yes ;;
14709+esac
14710+ OTOOL=$ac_ct_OTOOL
14711+ fi
14712+else
14713+ OTOOL="$ac_cv_prog_OTOOL"
14714+fi
14715+
14716+ if test -n "$ac_tool_prefix"; then
14717+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
14718+set dummy ${ac_tool_prefix}otool64; ac_word=$2
14719+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14720+$as_echo_n "checking for $ac_word... " >&6; }
14721+if ${ac_cv_prog_OTOOL64+:} false; then :
14722+ $as_echo_n "(cached) " >&6
14723+else
14724+ if test -n "$OTOOL64"; then
14725+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
14726+else
14727+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14728+for as_dir in $PATH
14729+do
14730+ IFS=$as_save_IFS
14731+ test -z "$as_dir" && as_dir=.
14732+ for ac_exec_ext in '' $ac_executable_extensions; do
14733+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14734+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
14735+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14736+ break 2
14737+ fi
14738+done
14739+ done
14740+IFS=$as_save_IFS
14741+
14742+fi
14743+fi
14744+OTOOL64=$ac_cv_prog_OTOOL64
14745+if test -n "$OTOOL64"; then
14746+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
14747+$as_echo "$OTOOL64" >&6; }
14748+else
14749+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14750+$as_echo "no" >&6; }
14751+fi
14752+
14753+
14754+fi
14755+if test -z "$ac_cv_prog_OTOOL64"; then
14756+ ac_ct_OTOOL64=$OTOOL64
14757+ # Extract the first word of "otool64", so it can be a program name with args.
14758+set dummy otool64; ac_word=$2
14759+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14760+$as_echo_n "checking for $ac_word... " >&6; }
14761+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
14762+ $as_echo_n "(cached) " >&6
14763+else
14764+ if test -n "$ac_ct_OTOOL64"; then
14765+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
14766+else
14767+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14768+for as_dir in $PATH
14769+do
14770+ IFS=$as_save_IFS
14771+ test -z "$as_dir" && as_dir=.
14772+ for ac_exec_ext in '' $ac_executable_extensions; do
14773+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
14774+ ac_cv_prog_ac_ct_OTOOL64="otool64"
14775+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14776+ break 2
14777+ fi
14778+done
14779+ done
14780+IFS=$as_save_IFS
14781+
14782+fi
14783+fi
14784+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
14785+if test -n "$ac_ct_OTOOL64"; then
14786+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
14787+$as_echo "$ac_ct_OTOOL64" >&6; }
14788+else
14789+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14790+$as_echo "no" >&6; }
14791+fi
14792+
14793+ if test "x$ac_ct_OTOOL64" = x; then
14794+ OTOOL64=":"
14795+ else
14796+ case $cross_compiling:$ac_tool_warned in
14797+yes:)
14798+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
14799+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
14800+ac_tool_warned=yes ;;
14801+esac
14802+ OTOOL64=$ac_ct_OTOOL64
14803+ fi
14804+else
14805+ OTOOL64="$ac_cv_prog_OTOOL64"
14806+fi
14807+
14808+
14809+
14810+
14811+
14812+
14813+
14814+
14815+
14816+
14817+
14818+
14819+
14820+
14821+
14822+
14823+
14824+
14825+
14826+
14827+
14828+
14829+
14830+
14831+
14832+
14833+
14834+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
14835+$as_echo_n "checking for -single_module linker flag... " >&6; }
14836+if ${lt_cv_apple_cc_single_mod+:} false; then :
14837+ $as_echo_n "(cached) " >&6
14838+else
14839+ lt_cv_apple_cc_single_mod=no
14840+ if test -z "${LT_MULTI_MODULE}"; then
14841+ # By default we will add the -single_module flag. You can override
14842+ # by either setting the environment variable LT_MULTI_MODULE
14843+ # non-empty at configure time, or by adding -multi_module to the
14844+ # link flags.
14845+ rm -rf libconftest.dylib*
14846+ echo "int foo(void){return 1;}" > conftest.c
14847+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
14848+-dynamiclib -Wl,-single_module conftest.c" >&5
14849+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
14850+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
14851+ _lt_result=$?
14852+ # If there is a non-empty error log, and "single_module"
14853+ # appears in it, assume the flag caused a linker warning
14854+ if test -s conftest.err && $GREP single_module conftest.err; then
14855+ cat conftest.err >&5
14856+ # Otherwise, if the output was created with a 0 exit code from
14857+ # the compiler, it worked.
14858+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
14859+ lt_cv_apple_cc_single_mod=yes
14860+ else
14861+ cat conftest.err >&5
14862+ fi
14863+ rm -rf libconftest.dylib*
14864+ rm -f conftest.*
14865+ fi
14866+fi
14867+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
14868+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
14869+
14870+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
14871+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
14872+if ${lt_cv_ld_exported_symbols_list+:} false; then :
14873+ $as_echo_n "(cached) " >&6
14874+else
14875+ lt_cv_ld_exported_symbols_list=no
14876+ save_LDFLAGS=$LDFLAGS
14877+ echo "_main" > conftest.sym
14878+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
14879+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14880+/* end confdefs.h. */
14881+
14882+int
14883+main ()
14884+{
14885+
14886+ ;
14887+ return 0;
14888+}
14889+_ACEOF
14890+if ac_fn_c_try_link "$LINENO"; then :
14891+ lt_cv_ld_exported_symbols_list=yes
14892+else
14893+ lt_cv_ld_exported_symbols_list=no
14894+fi
14895+rm -f core conftest.err conftest.$ac_objext \
14896+ conftest$ac_exeext conftest.$ac_ext
14897+ LDFLAGS="$save_LDFLAGS"
14898+
14899+fi
14900+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
14901+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
14902+
14903+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
14904+$as_echo_n "checking for -force_load linker flag... " >&6; }
14905+if ${lt_cv_ld_force_load+:} false; then :
14906+ $as_echo_n "(cached) " >&6
14907+else
14908+ lt_cv_ld_force_load=no
14909+ cat > conftest.c << _LT_EOF
14910+int forced_loaded() { return 2;}
14911+_LT_EOF
14912+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
14913+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
14914+ echo "$AR cru libconftest.a conftest.o" >&5
14915+ $AR cru libconftest.a conftest.o 2>&5
14916+ echo "$RANLIB libconftest.a" >&5
14917+ $RANLIB libconftest.a 2>&5
14918+ cat > conftest.c << _LT_EOF
14919+int main() { return 0;}
14920+_LT_EOF
14921+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
14922+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
14923+ _lt_result=$?
14924+ if test -s conftest.err && $GREP force_load conftest.err; then
14925+ cat conftest.err >&5
14926+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
14927+ lt_cv_ld_force_load=yes
14928+ else
14929+ cat conftest.err >&5
14930+ fi
14931+ rm -f conftest.err libconftest.a conftest conftest.c
14932+ rm -rf conftest.dSYM
14933+
14934+fi
14935+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
14936+$as_echo "$lt_cv_ld_force_load" >&6; }
14937+ case $host_os in
14938+ rhapsody* | darwin1.[012])
14939+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
14940+ darwin1.*)
14941+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
14942+ darwin*) # darwin 5.x on
14943+ # if running on 10.5 or later, the deployment target defaults
14944+ # to the OS version, if on x86, and 10.4, the deployment
14945+ # target defaults to 10.4. Don't you love it?
14946+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
14947+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
14948+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
14949+ 10.[012]*)
14950+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
14951+ 10.*)
14952+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
14953+ esac
14954+ ;;
14955+ esac
14956+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
14957+ _lt_dar_single_mod='$single_module'
14958+ fi
14959+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
14960+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
14961+ else
14962+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
14963+ fi
14964+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
14965+ _lt_dsymutil='~$DSYMUTIL $lib || :'
14966+ else
14967+ _lt_dsymutil=
14968+ fi
14969+ ;;
14970+ esac
14971+
14972+ac_ext=c
14973+ac_cpp='$CPP $CPPFLAGS'
14974+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14975+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14976+ac_compiler_gnu=$ac_cv_c_compiler_gnu
14977+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
14978+$as_echo_n "checking how to run the C preprocessor... " >&6; }
14979+# On Suns, sometimes $CPP names a directory.
14980+if test -n "$CPP" && test -d "$CPP"; then
14981+ CPP=
14982+fi
14983+if test -z "$CPP"; then
14984+ if ${ac_cv_prog_CPP+:} false; then :
14985+ $as_echo_n "(cached) " >&6
14986+else
14987+ # Double quotes because CPP needs to be expanded
14988+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
14989+ do
14990+ ac_preproc_ok=false
14991+for ac_c_preproc_warn_flag in '' yes
14992+do
14993+ # Use a header file that comes with gcc, so configuring glibc
14994+ # with a fresh cross-compiler works.
14995+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
14996+ # <limits.h> exists even on freestanding compilers.
14997+ # On the NeXT, cc -E runs the code through the compiler's parser,
14998+ # not just through cpp. "Syntax error" is here to catch this case.
14999+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15000+/* end confdefs.h. */
15001+#ifdef __STDC__
15002+# include <limits.h>
15003+#else
15004+# include <assert.h>
15005+#endif
15006+ Syntax error
15007+_ACEOF
15008+if ac_fn_c_try_cpp "$LINENO"; then :
15009+
15010+else
15011+ # Broken: fails on valid input.
15012+continue
15013+fi
15014+rm -f conftest.err conftest.i conftest.$ac_ext
15015+
15016+ # OK, works on sane cases. Now check whether nonexistent headers
15017+ # can be detected and how.
15018+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15019+/* end confdefs.h. */
15020+#include <ac_nonexistent.h>
15021+_ACEOF
15022+if ac_fn_c_try_cpp "$LINENO"; then :
15023+ # Broken: success on invalid input.
15024+continue
15025+else
15026+ # Passes both tests.
15027+ac_preproc_ok=:
15028+break
15029+fi
15030+rm -f conftest.err conftest.i conftest.$ac_ext
15031+
15032+done
15033+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
15034+rm -f conftest.i conftest.err conftest.$ac_ext
15035+if $ac_preproc_ok; then :
15036+ break
15037+fi
15038+
15039+ done
15040+ ac_cv_prog_CPP=$CPP
15041+
15042+fi
15043+ CPP=$ac_cv_prog_CPP
15044+else
15045+ ac_cv_prog_CPP=$CPP
15046+fi
15047+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
15048+$as_echo "$CPP" >&6; }
15049+ac_preproc_ok=false
15050+for ac_c_preproc_warn_flag in '' yes
15051+do
15052+ # Use a header file that comes with gcc, so configuring glibc
15053+ # with a fresh cross-compiler works.
15054+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
15055+ # <limits.h> exists even on freestanding compilers.
15056+ # On the NeXT, cc -E runs the code through the compiler's parser,
15057+ # not just through cpp. "Syntax error" is here to catch this case.
15058+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15059+/* end confdefs.h. */
15060+#ifdef __STDC__
15061+# include <limits.h>
15062+#else
15063+# include <assert.h>
15064+#endif
15065+ Syntax error
15066+_ACEOF
15067+if ac_fn_c_try_cpp "$LINENO"; then :
15068+
15069+else
15070+ # Broken: fails on valid input.
15071+continue
15072+fi
15073+rm -f conftest.err conftest.i conftest.$ac_ext
15074+
15075+ # OK, works on sane cases. Now check whether nonexistent headers
15076+ # can be detected and how.
15077+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15078+/* end confdefs.h. */
15079+#include <ac_nonexistent.h>
15080+_ACEOF
15081+if ac_fn_c_try_cpp "$LINENO"; then :
15082+ # Broken: success on invalid input.
15083+continue
15084+else
15085+ # Passes both tests.
15086+ac_preproc_ok=:
15087+break
15088+fi
15089+rm -f conftest.err conftest.i conftest.$ac_ext
15090+
15091+done
15092+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
15093+rm -f conftest.i conftest.err conftest.$ac_ext
15094+if $ac_preproc_ok; then :
15095+
15096+else
15097+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
15098+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
15099+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
15100+See \`config.log' for more details" "$LINENO" 5; }
15101+fi
15102+
15103+ac_ext=c
15104+ac_cpp='$CPP $CPPFLAGS'
15105+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15106+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15107+ac_compiler_gnu=$ac_cv_c_compiler_gnu
15108+
15109+
15110+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
15111+$as_echo_n "checking for ANSI C header files... " >&6; }
15112+if ${ac_cv_header_stdc+:} false; then :
15113+ $as_echo_n "(cached) " >&6
15114+else
15115+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15116+/* end confdefs.h. */
15117+#include <stdlib.h>
15118+#include <stdarg.h>
15119+#include <string.h>
15120+#include <float.h>
15121+
15122+int
15123+main ()
15124+{
15125+
15126+ ;
15127+ return 0;
15128+}
15129+_ACEOF
15130+if ac_fn_c_try_compile "$LINENO"; then :
15131+ ac_cv_header_stdc=yes
15132+else
15133+ ac_cv_header_stdc=no
15134+fi
15135+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15136+
15137+if test $ac_cv_header_stdc = yes; then
15138+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15139+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15140+/* end confdefs.h. */
15141+#include <string.h>
15142+
15143+_ACEOF
15144+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15145+ $EGREP "memchr" >/dev/null 2>&1; then :
15146+
15147+else
15148+ ac_cv_header_stdc=no
15149+fi
15150+rm -f conftest*
15151+
15152+fi
15153+
15154+if test $ac_cv_header_stdc = yes; then
15155+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15156+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15157+/* end confdefs.h. */
15158+#include <stdlib.h>
15159+
15160+_ACEOF
15161+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15162+ $EGREP "free" >/dev/null 2>&1; then :
15163+
15164+else
15165+ ac_cv_header_stdc=no
15166+fi
15167+rm -f conftest*
15168+
15169+fi
15170+
15171+if test $ac_cv_header_stdc = yes; then
15172+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15173+ if test "$cross_compiling" = yes; then :
15174+ :
15175+else
15176+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15177+/* end confdefs.h. */
15178+#include <ctype.h>
15179+#include <stdlib.h>
15180+#if ((' ' & 0x0FF) == 0x020)
15181+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15182+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15183+#else
15184+# define ISLOWER(c) \
15185+ (('a' <= (c) && (c) <= 'i') \
15186+ || ('j' <= (c) && (c) <= 'r') \
15187+ || ('s' <= (c) && (c) <= 'z'))
15188+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15189+#endif
15190+
15191+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15192+int
15193+main ()
15194+{
15195+ int i;
15196+ for (i = 0; i < 256; i++)
15197+ if (XOR (islower (i), ISLOWER (i))
15198+ || toupper (i) != TOUPPER (i))
15199+ return 2;
15200+ return 0;
15201+}
15202+_ACEOF
15203+if ac_fn_c_try_run "$LINENO"; then :
15204+
15205+else
15206+ ac_cv_header_stdc=no
15207+fi
15208+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15209+ conftest.$ac_objext conftest.beam conftest.$ac_ext
15210+fi
15211+
15212+fi
15213+fi
15214+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
15215+$as_echo "$ac_cv_header_stdc" >&6; }
15216+if test $ac_cv_header_stdc = yes; then
15217+
15218+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
15219+
15220+fi
15221+
15222+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
15223+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15224+ inttypes.h stdint.h unistd.h
15225+do :
15226+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
15227+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
15228+"
15229+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
15230+ cat >>confdefs.h <<_ACEOF
15231+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
15232+_ACEOF
15233+
15234+fi
15235+
15236+done
15237+
15238+
15239+for ac_header in dlfcn.h
15240+do :
15241+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
15242+"
15243+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
15244+ cat >>confdefs.h <<_ACEOF
15245+#define HAVE_DLFCN_H 1
15246+_ACEOF
15247+
15248+fi
15249+
15250+done
15251+
15252+
15253+
15254+
15255+
15256+# Set options
15257+
15258+
15259+
15260+ enable_dlopen=no
15261+
15262+
15263+ enable_win32_dll=no
15264+
15265+
15266+ # Check whether --enable-shared was given.
15267+if test "${enable_shared+set}" = set; then :
15268+ enableval=$enable_shared; p=${PACKAGE-default}
15269+ case $enableval in
15270+ yes) enable_shared=yes ;;
15271+ no) enable_shared=no ;;
15272+ *)
15273+ enable_shared=no
15274+ # Look at the argument we got. We use all the common list separators.
15275+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
15276+ for pkg in $enableval; do
15277+ IFS="$lt_save_ifs"
15278+ if test "X$pkg" = "X$p"; then
15279+ enable_shared=yes
15280+ fi
15281+ done
15282+ IFS="$lt_save_ifs"
15283+ ;;
15284+ esac
15285+else
15286+ enable_shared=yes
15287+fi
15288+
15289+
15290+
15291+
15292+
15293+
15294+
15295+
15296+
15297+ # Check whether --enable-static was given.
15298+if test "${enable_static+set}" = set; then :
15299+ enableval=$enable_static; p=${PACKAGE-default}
15300+ case $enableval in
15301+ yes) enable_static=yes ;;
15302+ no) enable_static=no ;;
15303+ *)
15304+ enable_static=no
15305+ # Look at the argument we got. We use all the common list separators.
15306+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
15307+ for pkg in $enableval; do
15308+ IFS="$lt_save_ifs"
15309+ if test "X$pkg" = "X$p"; then
15310+ enable_static=yes
15311+ fi
15312+ done
15313+ IFS="$lt_save_ifs"
15314+ ;;
15315+ esac
15316+else
15317+ enable_static=yes
15318+fi
15319+
15320+
15321+
15322+
15323+
15324+
15325+
15326+
15327+
15328+
15329+# Check whether --with-pic was given.
15330+if test "${with_pic+set}" = set; then :
15331+ withval=$with_pic; lt_p=${PACKAGE-default}
15332+ case $withval in
15333+ yes|no) pic_mode=$withval ;;
15334+ *)
15335+ pic_mode=default
15336+ # Look at the argument we got. We use all the common list separators.
15337+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
15338+ for lt_pkg in $withval; do
15339+ IFS="$lt_save_ifs"
15340+ if test "X$lt_pkg" = "X$lt_p"; then
15341+ pic_mode=yes
15342+ fi
15343+ done
15344+ IFS="$lt_save_ifs"
15345+ ;;
15346+ esac
15347+else
15348+ pic_mode=default
15349+fi
15350+
15351+
15352+test -z "$pic_mode" && pic_mode=default
15353+
15354+
15355+
15356+
15357+
15358+
15359+
15360+ # Check whether --enable-fast-install was given.
15361+if test "${enable_fast_install+set}" = set; then :
15362+ enableval=$enable_fast_install; p=${PACKAGE-default}
15363+ case $enableval in
15364+ yes) enable_fast_install=yes ;;
15365+ no) enable_fast_install=no ;;
15366+ *)
15367+ enable_fast_install=no
15368+ # Look at the argument we got. We use all the common list separators.
15369+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
15370+ for pkg in $enableval; do
15371+ IFS="$lt_save_ifs"
15372+ if test "X$pkg" = "X$p"; then
15373+ enable_fast_install=yes
15374+ fi
15375+ done
15376+ IFS="$lt_save_ifs"
15377+ ;;
15378+ esac
15379+else
15380+ enable_fast_install=yes
15381+fi
15382+
15383+
15384+
15385+
15386+
15387+
15388+
15389+
15390+
15391+
15392+
15393+# This can be used to rebuild libtool when needed
15394+LIBTOOL_DEPS="$ltmain"
15395+
15396+# Always use our own libtool.
15397+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
15398+
15399+
15400+
15401+
15402+
15403+
15404+
15405+
15406+
15407+
15408+
15409+
15410+
15411+
15412+
15413+
15414+
15415+
15416+
15417+
15418+
15419+
15420+
15421+
15422+
15423+
15424+
15425+
15426+
15427+
15428+test -z "$LN_S" && LN_S="ln -s"
15429+
15430+
15431+
15432+
15433+
15434+
15435+
15436+
15437+
15438+
15439+
15440+
15441+
15442+
15443+if test -n "${ZSH_VERSION+set}" ; then
15444+ setopt NO_GLOB_SUBST
15445+fi
15446+
15447+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
15448+$as_echo_n "checking for objdir... " >&6; }
15449+if ${lt_cv_objdir+:} false; then :
15450+ $as_echo_n "(cached) " >&6
15451+else
15452+ rm -f .libs 2>/dev/null
15453+mkdir .libs 2>/dev/null
15454+if test -d .libs; then
15455+ lt_cv_objdir=.libs
15456+else
15457+ # MS-DOS does not allow filenames that begin with a dot.
15458+ lt_cv_objdir=_libs
15459+fi
15460+rmdir .libs 2>/dev/null
15461+fi
15462+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
15463+$as_echo "$lt_cv_objdir" >&6; }
15464+objdir=$lt_cv_objdir
15465+
15466+
15467+
15468+
15469+
15470+cat >>confdefs.h <<_ACEOF
15471+#define LT_OBJDIR "$lt_cv_objdir/"
15472+_ACEOF
15473+
15474+
15475+
15476+
15477+case $host_os in
15478+aix3*)
15479+ # AIX sometimes has problems with the GCC collect2 program. For some
15480+ # reason, if we set the COLLECT_NAMES environment variable, the problems
15481+ # vanish in a puff of smoke.
15482+ if test "X${COLLECT_NAMES+set}" != Xset; then
15483+ COLLECT_NAMES=
15484+ export COLLECT_NAMES
15485+ fi
15486+ ;;
15487+esac
15488+
15489+# Global variables:
15490+ofile=libtool
15491+can_build_shared=yes
15492+
15493+# All known linkers require a `.a' archive for static linking (except MSVC,
15494+# which needs '.lib').
15495+libext=a
15496+
15497+with_gnu_ld="$lt_cv_prog_gnu_ld"
15498+
15499+old_CC="$CC"
15500+old_CFLAGS="$CFLAGS"
15501+
15502+# Set sane defaults for various variables
15503+test -z "$CC" && CC=cc
15504+test -z "$LTCC" && LTCC=$CC
15505+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
15506+test -z "$LD" && LD=ld
15507+test -z "$ac_objext" && ac_objext=o
15508+
15509+for cc_temp in $compiler""; do
15510+ case $cc_temp in
15511+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
15512+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
15513+ \-*) ;;
15514+ *) break;;
15515+ esac
15516+done
15517+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
15518+
15519+
15520+# Only perform the check for file, if the check method requires it
15521+test -z "$MAGIC_CMD" && MAGIC_CMD=file
15522+case $deplibs_check_method in
15523+file_magic*)
15524+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
15525+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
15526+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
15527+if ${lt_cv_path_MAGIC_CMD+:} false; then :
15528+ $as_echo_n "(cached) " >&6
15529+else
15530+ case $MAGIC_CMD in
15531+[\\/*] | ?:[\\/]*)
15532+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
15533+ ;;
15534+*)
15535+ lt_save_MAGIC_CMD="$MAGIC_CMD"
15536+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
15537+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
15538+ for ac_dir in $ac_dummy; do
15539+ IFS="$lt_save_ifs"
15540+ test -z "$ac_dir" && ac_dir=.
15541+ if test -f $ac_dir/${ac_tool_prefix}file; then
15542+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
15543+ if test -n "$file_magic_test_file"; then
15544+ case $deplibs_check_method in
15545+ "file_magic "*)
15546+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
15547+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
15548+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
15549+ $EGREP "$file_magic_regex" > /dev/null; then
15550+ :
15551+ else
15552+ cat <<_LT_EOF 1>&2
15553+
15554+*** Warning: the command libtool uses to detect shared libraries,
15555+*** $file_magic_cmd, produces output that libtool cannot recognize.
15556+*** The result is that libtool may fail to recognize shared libraries
15557+*** as such. This will affect the creation of libtool libraries that
15558+*** depend on shared libraries, but programs linked with such libtool
15559+*** libraries will work regardless of this problem. Nevertheless, you
15560+*** may want to report the problem to your system manager and/or to
15561+*** bug-libtool@gnu.org
15562+
15563+_LT_EOF
15564+ fi ;;
15565+ esac
15566+ fi
15567+ break
15568+ fi
15569+ done
15570+ IFS="$lt_save_ifs"
15571+ MAGIC_CMD="$lt_save_MAGIC_CMD"
15572+ ;;
15573+esac
15574+fi
15575+
15576+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
15577+if test -n "$MAGIC_CMD"; then
15578+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
15579+$as_echo "$MAGIC_CMD" >&6; }
15580+else
15581+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15582+$as_echo "no" >&6; }
15583+fi
15584+
15585+
15586+
15587+
15588+
15589+if test -z "$lt_cv_path_MAGIC_CMD"; then
15590+ if test -n "$ac_tool_prefix"; then
15591+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
15592+$as_echo_n "checking for file... " >&6; }
15593+if ${lt_cv_path_MAGIC_CMD+:} false; then :
15594+ $as_echo_n "(cached) " >&6
15595+else
15596+ case $MAGIC_CMD in
15597+[\\/*] | ?:[\\/]*)
15598+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
15599+ ;;
15600+*)
15601+ lt_save_MAGIC_CMD="$MAGIC_CMD"
15602+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
15603+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
15604+ for ac_dir in $ac_dummy; do
15605+ IFS="$lt_save_ifs"
15606+ test -z "$ac_dir" && ac_dir=.
15607+ if test -f $ac_dir/file; then
15608+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
15609+ if test -n "$file_magic_test_file"; then
15610+ case $deplibs_check_method in
15611+ "file_magic "*)
15612+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
15613+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
15614+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
15615+ $EGREP "$file_magic_regex" > /dev/null; then
15616+ :
15617+ else
15618+ cat <<_LT_EOF 1>&2
15619+
15620+*** Warning: the command libtool uses to detect shared libraries,
15621+*** $file_magic_cmd, produces output that libtool cannot recognize.
15622+*** The result is that libtool may fail to recognize shared libraries
15623+*** as such. This will affect the creation of libtool libraries that
15624+*** depend on shared libraries, but programs linked with such libtool
15625+*** libraries will work regardless of this problem. Nevertheless, you
15626+*** may want to report the problem to your system manager and/or to
15627+*** bug-libtool@gnu.org
15628+
15629+_LT_EOF
15630+ fi ;;
15631+ esac
15632+ fi
15633+ break
15634+ fi
15635+ done
15636+ IFS="$lt_save_ifs"
15637+ MAGIC_CMD="$lt_save_MAGIC_CMD"
15638+ ;;
15639+esac
15640+fi
15641+
15642+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
15643+if test -n "$MAGIC_CMD"; then
15644+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
15645+$as_echo "$MAGIC_CMD" >&6; }
15646+else
15647+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15648+$as_echo "no" >&6; }
15649+fi
15650+
15651+
15652+ else
15653+ MAGIC_CMD=:
15654+ fi
15655+fi
15656+
15657+ fi
15658+ ;;
15659+esac
15660+
15661+# Use C for the default configuration in the libtool script
15662+
15663+lt_save_CC="$CC"
15664+ac_ext=c
15665+ac_cpp='$CPP $CPPFLAGS'
15666+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15667+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15668+ac_compiler_gnu=$ac_cv_c_compiler_gnu
15669+
15670+
15671+# Source file extension for C test sources.
15672+ac_ext=c
15673+
15674+# Object file extension for compiled C test sources.
15675+objext=o
15676+objext=$objext
15677+
15678+# Code to be used in simple compile tests
15679+lt_simple_compile_test_code="int some_variable = 0;"
15680+
15681+# Code to be used in simple link tests
15682+lt_simple_link_test_code='int main(){return(0);}'
15683+
15684+
15685+
15686+
15687+
15688+
15689+
15690+# If no C compiler was specified, use CC.
15691+LTCC=${LTCC-"$CC"}
15692+
15693+# If no C compiler flags were specified, use CFLAGS.
15694+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
15695+
15696+# Allow CC to be a program name with arguments.
15697+compiler=$CC
15698+
15699+# Save the default compiler, since it gets overwritten when the other
15700+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
15701+compiler_DEFAULT=$CC
15702+
15703+# save warnings/boilerplate of simple test code
15704+ac_outfile=conftest.$ac_objext
15705+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
15706+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
15707+_lt_compiler_boilerplate=`cat conftest.err`
15708+$RM conftest*
15709+
15710+ac_outfile=conftest.$ac_objext
15711+echo "$lt_simple_link_test_code" >conftest.$ac_ext
15712+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
15713+_lt_linker_boilerplate=`cat conftest.err`
15714+$RM -r conftest*
15715+
15716+
15717+## CAVEAT EMPTOR:
15718+## There is no encapsulation within the following macros, do not change
15719+## the running order or otherwise move them around unless you know exactly
15720+## what you are doing...
15721+if test -n "$compiler"; then
15722+
15723+lt_prog_compiler_no_builtin_flag=
15724+
15725+if test "$GCC" = yes; then
15726+ case $cc_basename in
15727+ nvcc*)
15728+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
15729+ *)
15730+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
15731+ esac
15732+
15733+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
15734+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
15735+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
15736+ $as_echo_n "(cached) " >&6
15737+else
15738+ lt_cv_prog_compiler_rtti_exceptions=no
15739+ ac_outfile=conftest.$ac_objext
15740+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15741+ lt_compiler_flag="-fno-rtti -fno-exceptions"
15742+ # Insert the option either (1) after the last *FLAGS variable, or
15743+ # (2) before a word containing "conftest.", or (3) at the end.
15744+ # Note that $ac_compile itself does not contain backslashes and begins
15745+ # with a dollar sign (not a hyphen), so the echo should work correctly.
15746+ # The option is referenced via a variable to avoid confusing sed.
15747+ lt_compile=`echo "$ac_compile" | $SED \
15748+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
15749+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
15750+ -e 's:$: $lt_compiler_flag:'`
15751+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
15752+ (eval "$lt_compile" 2>conftest.err)
15753+ ac_status=$?
15754+ cat conftest.err >&5
15755+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
15756+ if (exit $ac_status) && test -s "$ac_outfile"; then
15757+ # The compiler can only warn and ignore the option if not recognized
15758+ # So say no if there are warnings other than the usual output.
15759+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
15760+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15761+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
15762+ lt_cv_prog_compiler_rtti_exceptions=yes
15763+ fi
15764+ fi
15765+ $RM conftest*
15766+
15767+fi
15768+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
15769+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
15770+
15771+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
15772+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
15773+else
15774+ :
15775+fi
15776+
15777+fi
15778+
15779+
15780+
15781+
15782+
15783+
15784+ lt_prog_compiler_wl=
15785+lt_prog_compiler_pic=
15786+lt_prog_compiler_static=
15787+
15788+
15789+ if test "$GCC" = yes; then
15790+ lt_prog_compiler_wl='-Wl,'
15791+ lt_prog_compiler_static='-static'
15792+
15793+ case $host_os in
15794+ aix*)
15795+ # All AIX code is PIC.
15796+ if test "$host_cpu" = ia64; then
15797+ # AIX 5 now supports IA64 processor
15798+ lt_prog_compiler_static='-Bstatic'
15799+ fi
15800+ ;;
15801+
15802+ amigaos*)
15803+ case $host_cpu in
15804+ powerpc)
15805+ # see comment about AmigaOS4 .so support
15806+ lt_prog_compiler_pic='-fPIC'
15807+ ;;
15808+ m68k)
15809+ # FIXME: we need at least 68020 code to build shared libraries, but
15810+ # adding the `-m68020' flag to GCC prevents building anything better,
15811+ # like `-m68040'.
15812+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
15813+ ;;
15814+ esac
15815+ ;;
15816+
15817+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
15818+ # PIC is the default for these OSes.
15819+ ;;
15820+
15821+ mingw* | cygwin* | pw32* | os2* | cegcc*)
15822+ # This hack is so that the source file can tell whether it is being
15823+ # built for inclusion in a dll (and should export symbols for example).
15824+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
15825+ # (--disable-auto-import) libraries
15826+ lt_prog_compiler_pic='-DDLL_EXPORT'
15827+ ;;
15828+
15829+ darwin* | rhapsody*)
15830+ # PIC is the default on this platform
15831+ # Common symbols not allowed in MH_DYLIB files
15832+ lt_prog_compiler_pic='-fno-common'
15833+ ;;
15834+
15835+ haiku*)
15836+ # PIC is the default for Haiku.
15837+ # The "-static" flag exists, but is broken.
15838+ lt_prog_compiler_static=
15839+ ;;
15840+
15841+ hpux*)
15842+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
15843+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
15844+ # sets the default TLS model and affects inlining.
15845+ case $host_cpu in
15846+ hppa*64*)
15847+ # +Z the default
15848+ ;;
15849+ *)
15850+ lt_prog_compiler_pic='-fPIC'
15851+ ;;
15852+ esac
15853+ ;;
15854+
15855+ interix[3-9]*)
15856+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
15857+ # Instead, we relocate shared libraries at runtime.
15858+ ;;
15859+
15860+ msdosdjgpp*)
15861+ # Just because we use GCC doesn't mean we suddenly get shared libraries
15862+ # on systems that don't support them.
15863+ lt_prog_compiler_can_build_shared=no
15864+ enable_shared=no
15865+ ;;
15866+
15867+ *nto* | *qnx*)
15868+ # QNX uses GNU C++, but need to define -shared option too, otherwise
15869+ # it will coredump.
15870+ lt_prog_compiler_pic='-fPIC -shared'
15871+ ;;
15872+
15873+ sysv4*MP*)
15874+ if test -d /usr/nec; then
15875+ lt_prog_compiler_pic=-Kconform_pic
15876+ fi
15877+ ;;
15878+
15879+ *)
15880+ lt_prog_compiler_pic='-fPIC'
15881+ ;;
15882+ esac
15883+
15884+ case $cc_basename in
15885+ nvcc*) # Cuda Compiler Driver 2.2
15886+ lt_prog_compiler_wl='-Xlinker '
15887+ if test -n "$lt_prog_compiler_pic"; then
15888+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
15889+ fi
15890+ ;;
15891+ esac
15892+ else
15893+ # PORTME Check for flag to pass linker flags through the system compiler.
15894+ case $host_os in
15895+ aix*)
15896+ lt_prog_compiler_wl='-Wl,'
15897+ if test "$host_cpu" = ia64; then
15898+ # AIX 5 now supports IA64 processor
15899+ lt_prog_compiler_static='-Bstatic'
15900+ else
15901+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
15902+ fi
15903+ ;;
15904+
15905+ mingw* | cygwin* | pw32* | os2* | cegcc*)
15906+ # This hack is so that the source file can tell whether it is being
15907+ # built for inclusion in a dll (and should export symbols for example).
15908+ lt_prog_compiler_pic='-DDLL_EXPORT'
15909+ ;;
15910+
15911+ hpux9* | hpux10* | hpux11*)
15912+ lt_prog_compiler_wl='-Wl,'
15913+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
15914+ # not for PA HP-UX.
15915+ case $host_cpu in
15916+ hppa*64*|ia64*)
15917+ # +Z the default
15918+ ;;
15919+ *)
15920+ lt_prog_compiler_pic='+Z'
15921+ ;;
15922+ esac
15923+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
15924+ lt_prog_compiler_static='${wl}-a ${wl}archive'
15925+ ;;
15926+
15927+ irix5* | irix6* | nonstopux*)
15928+ lt_prog_compiler_wl='-Wl,'
15929+ # PIC (with -KPIC) is the default.
15930+ lt_prog_compiler_static='-non_shared'
15931+ ;;
15932+
15933+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
15934+ case $cc_basename in
15935+ # old Intel for x86_64 which still supported -KPIC.
15936+ ecc*)
15937+ lt_prog_compiler_wl='-Wl,'
15938+ lt_prog_compiler_pic='-KPIC'
15939+ lt_prog_compiler_static='-static'
15940+ ;;
15941+ # icc used to be incompatible with GCC.
15942+ # ICC 10 doesn't accept -KPIC any more.
15943+ icc* | ifort*)
15944+ lt_prog_compiler_wl='-Wl,'
15945+ lt_prog_compiler_pic='-fPIC'
15946+ lt_prog_compiler_static='-static'
15947+ ;;
15948+ # Lahey Fortran 8.1.
15949+ lf95*)
15950+ lt_prog_compiler_wl='-Wl,'
15951+ lt_prog_compiler_pic='--shared'
15952+ lt_prog_compiler_static='--static'
15953+ ;;
15954+ nagfor*)
15955+ # NAG Fortran compiler
15956+ lt_prog_compiler_wl='-Wl,-Wl,,'
15957+ lt_prog_compiler_pic='-PIC'
15958+ lt_prog_compiler_static='-Bstatic'
15959+ ;;
15960+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
15961+ # Portland Group compilers (*not* the Pentium gcc compiler,
15962+ # which looks to be a dead project)
15963+ lt_prog_compiler_wl='-Wl,'
15964+ lt_prog_compiler_pic='-fpic'
15965+ lt_prog_compiler_static='-Bstatic'
15966+ ;;
15967+ ccc*)
15968+ lt_prog_compiler_wl='-Wl,'
15969+ # All Alpha code is PIC.
15970+ lt_prog_compiler_static='-non_shared'
15971+ ;;
15972+ xl* | bgxl* | bgf* | mpixl*)
15973+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
15974+ lt_prog_compiler_wl='-Wl,'
15975+ lt_prog_compiler_pic='-qpic'
15976+ lt_prog_compiler_static='-qstaticlink'
15977+ ;;
15978+ *)
15979+ case `$CC -V 2>&1 | sed 5q` in
15980+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
15981+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
15982+ lt_prog_compiler_pic='-KPIC'
15983+ lt_prog_compiler_static='-Bstatic'
15984+ lt_prog_compiler_wl=''
15985+ ;;
15986+ *Sun\ F* | *Sun*Fortran*)
15987+ lt_prog_compiler_pic='-KPIC'
15988+ lt_prog_compiler_static='-Bstatic'
15989+ lt_prog_compiler_wl='-Qoption ld '
15990+ ;;
15991+ *Sun\ C*)
15992+ # Sun C 5.9
15993+ lt_prog_compiler_pic='-KPIC'
15994+ lt_prog_compiler_static='-Bstatic'
15995+ lt_prog_compiler_wl='-Wl,'
15996+ ;;
15997+ *Intel*\ [CF]*Compiler*)
15998+ lt_prog_compiler_wl='-Wl,'
15999+ lt_prog_compiler_pic='-fPIC'
16000+ lt_prog_compiler_static='-static'
16001+ ;;
16002+ *Portland\ Group*)
16003+ lt_prog_compiler_wl='-Wl,'
16004+ lt_prog_compiler_pic='-fpic'
16005+ lt_prog_compiler_static='-Bstatic'
16006+ ;;
16007+ esac
16008+ ;;
16009+ esac
16010+ ;;
16011+
16012+ newsos6)
16013+ lt_prog_compiler_pic='-KPIC'
16014+ lt_prog_compiler_static='-Bstatic'
16015+ ;;
16016+
16017+ *nto* | *qnx*)
16018+ # QNX uses GNU C++, but need to define -shared option too, otherwise
16019+ # it will coredump.
16020+ lt_prog_compiler_pic='-fPIC -shared'
16021+ ;;
16022+
16023+ osf3* | osf4* | osf5*)
16024+ lt_prog_compiler_wl='-Wl,'
16025+ # All OSF/1 code is PIC.
16026+ lt_prog_compiler_static='-non_shared'
16027+ ;;
16028+
16029+ rdos*)
16030+ lt_prog_compiler_static='-non_shared'
16031+ ;;
16032+
16033+ solaris*)
16034+ lt_prog_compiler_pic='-KPIC'
16035+ lt_prog_compiler_static='-Bstatic'
16036+ case $cc_basename in
16037+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
16038+ lt_prog_compiler_wl='-Qoption ld ';;
16039+ *)
16040+ lt_prog_compiler_wl='-Wl,';;
16041+ esac
16042+ ;;
16043+
16044+ sunos4*)
16045+ lt_prog_compiler_wl='-Qoption ld '
16046+ lt_prog_compiler_pic='-PIC'
16047+ lt_prog_compiler_static='-Bstatic'
16048+ ;;
16049+
16050+ sysv4 | sysv4.2uw2* | sysv4.3*)
16051+ lt_prog_compiler_wl='-Wl,'
16052+ lt_prog_compiler_pic='-KPIC'
16053+ lt_prog_compiler_static='-Bstatic'
16054+ ;;
16055+
16056+ sysv4*MP*)
16057+ if test -d /usr/nec ;then
16058+ lt_prog_compiler_pic='-Kconform_pic'
16059+ lt_prog_compiler_static='-Bstatic'
16060+ fi
16061+ ;;
16062+
16063+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
16064+ lt_prog_compiler_wl='-Wl,'
16065+ lt_prog_compiler_pic='-KPIC'
16066+ lt_prog_compiler_static='-Bstatic'
16067+ ;;
16068+
16069+ unicos*)
16070+ lt_prog_compiler_wl='-Wl,'
16071+ lt_prog_compiler_can_build_shared=no
16072+ ;;
16073+
16074+ uts4*)
16075+ lt_prog_compiler_pic='-pic'
16076+ lt_prog_compiler_static='-Bstatic'
16077+ ;;
16078+
16079+ *)
16080+ lt_prog_compiler_can_build_shared=no
16081+ ;;
16082+ esac
16083+ fi
16084+
16085+case $host_os in
16086+ # For platforms which do not support PIC, -DPIC is meaningless:
16087+ *djgpp*)
16088+ lt_prog_compiler_pic=
16089+ ;;
16090+ *)
16091+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
16092+ ;;
16093+esac
16094+
16095+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
16096+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
16097+if ${lt_cv_prog_compiler_pic+:} false; then :
16098+ $as_echo_n "(cached) " >&6
16099+else
16100+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
16101+fi
16102+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
16103+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
16104+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
16105+
16106+#
16107+# Check to make sure the PIC flag actually works.
16108+#
16109+if test -n "$lt_prog_compiler_pic"; then
16110+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
16111+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
16112+if ${lt_cv_prog_compiler_pic_works+:} false; then :
16113+ $as_echo_n "(cached) " >&6
16114+else
16115+ lt_cv_prog_compiler_pic_works=no
16116+ ac_outfile=conftest.$ac_objext
16117+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
16118+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
16119+ # Insert the option either (1) after the last *FLAGS variable, or
16120+ # (2) before a word containing "conftest.", or (3) at the end.
16121+ # Note that $ac_compile itself does not contain backslashes and begins
16122+ # with a dollar sign (not a hyphen), so the echo should work correctly.
16123+ # The option is referenced via a variable to avoid confusing sed.
16124+ lt_compile=`echo "$ac_compile" | $SED \
16125+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16126+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16127+ -e 's:$: $lt_compiler_flag:'`
16128+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
16129+ (eval "$lt_compile" 2>conftest.err)
16130+ ac_status=$?
16131+ cat conftest.err >&5
16132+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
16133+ if (exit $ac_status) && test -s "$ac_outfile"; then
16134+ # The compiler can only warn and ignore the option if not recognized
16135+ # So say no if there are warnings other than the usual output.
16136+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
16137+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16138+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
16139+ lt_cv_prog_compiler_pic_works=yes
16140+ fi
16141+ fi
16142+ $RM conftest*
16143+
16144+fi
16145+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
16146+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
16147+
16148+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
16149+ case $lt_prog_compiler_pic in
16150+ "" | " "*) ;;
16151+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
16152+ esac
16153+else
16154+ lt_prog_compiler_pic=
16155+ lt_prog_compiler_can_build_shared=no
16156+fi
16157+
16158+fi
16159+
16160+
16161+
16162+
16163+
16164+
16165+
16166+
16167+
16168+
16169+
16170+#
16171+# Check to make sure the static flag actually works.
16172+#
16173+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
16174+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
16175+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
16176+if ${lt_cv_prog_compiler_static_works+:} false; then :
16177+ $as_echo_n "(cached) " >&6
16178+else
16179+ lt_cv_prog_compiler_static_works=no
16180+ save_LDFLAGS="$LDFLAGS"
16181+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
16182+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
16183+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
16184+ # The linker can only warn and ignore the option if not recognized
16185+ # So say no if there are warnings
16186+ if test -s conftest.err; then
16187+ # Append any errors to the config.log.
16188+ cat conftest.err 1>&5
16189+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
16190+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16191+ if diff conftest.exp conftest.er2 >/dev/null; then
16192+ lt_cv_prog_compiler_static_works=yes
16193+ fi
16194+ else
16195+ lt_cv_prog_compiler_static_works=yes
16196+ fi
16197+ fi
16198+ $RM -r conftest*
16199+ LDFLAGS="$save_LDFLAGS"
16200+
16201+fi
16202+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
16203+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
16204+
16205+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
16206+ :
16207+else
16208+ lt_prog_compiler_static=
16209+fi
16210+
16211+
16212+
16213+
16214+
16215+
16216+
16217+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
16218+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
16219+if ${lt_cv_prog_compiler_c_o+:} false; then :
16220+ $as_echo_n "(cached) " >&6
16221+else
16222+ lt_cv_prog_compiler_c_o=no
16223+ $RM -r conftest 2>/dev/null
16224+ mkdir conftest
16225+ cd conftest
16226+ mkdir out
16227+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
16228+
16229+ lt_compiler_flag="-o out/conftest2.$ac_objext"
16230+ # Insert the option either (1) after the last *FLAGS variable, or
16231+ # (2) before a word containing "conftest.", or (3) at the end.
16232+ # Note that $ac_compile itself does not contain backslashes and begins
16233+ # with a dollar sign (not a hyphen), so the echo should work correctly.
16234+ lt_compile=`echo "$ac_compile" | $SED \
16235+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16236+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16237+ -e 's:$: $lt_compiler_flag:'`
16238+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
16239+ (eval "$lt_compile" 2>out/conftest.err)
16240+ ac_status=$?
16241+ cat out/conftest.err >&5
16242+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
16243+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
16244+ then
16245+ # The compiler can only warn and ignore the option if not recognized
16246+ # So say no if there are warnings
16247+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
16248+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
16249+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
16250+ lt_cv_prog_compiler_c_o=yes
16251+ fi
16252+ fi
16253+ chmod u+w . 2>&5
16254+ $RM conftest*
16255+ # SGI C++ compiler will create directory out/ii_files/ for
16256+ # template instantiation
16257+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
16258+ $RM out/* && rmdir out
16259+ cd ..
16260+ $RM -r conftest
16261+ $RM conftest*
16262+
16263+fi
16264+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
16265+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
16266+
16267+
16268+
16269+
16270+
16271+
16272+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
16273+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
16274+if ${lt_cv_prog_compiler_c_o+:} false; then :
16275+ $as_echo_n "(cached) " >&6
16276+else
16277+ lt_cv_prog_compiler_c_o=no
16278+ $RM -r conftest 2>/dev/null
16279+ mkdir conftest
16280+ cd conftest
16281+ mkdir out
16282+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
16283+
16284+ lt_compiler_flag="-o out/conftest2.$ac_objext"
16285+ # Insert the option either (1) after the last *FLAGS variable, or
16286+ # (2) before a word containing "conftest.", or (3) at the end.
16287+ # Note that $ac_compile itself does not contain backslashes and begins
16288+ # with a dollar sign (not a hyphen), so the echo should work correctly.
16289+ lt_compile=`echo "$ac_compile" | $SED \
16290+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16291+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16292+ -e 's:$: $lt_compiler_flag:'`
16293+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
16294+ (eval "$lt_compile" 2>out/conftest.err)
16295+ ac_status=$?
16296+ cat out/conftest.err >&5
16297+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
16298+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
16299+ then
16300+ # The compiler can only warn and ignore the option if not recognized
16301+ # So say no if there are warnings
16302+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
16303+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
16304+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
16305+ lt_cv_prog_compiler_c_o=yes
16306+ fi
16307+ fi
16308+ chmod u+w . 2>&5
16309+ $RM conftest*
16310+ # SGI C++ compiler will create directory out/ii_files/ for
16311+ # template instantiation
16312+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
16313+ $RM out/* && rmdir out
16314+ cd ..
16315+ $RM -r conftest
16316+ $RM conftest*
16317+
16318+fi
16319+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
16320+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
16321+
16322+
16323+
16324+
16325+hard_links="nottested"
16326+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
16327+ # do not overwrite the value of need_locks provided by the user
16328+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
16329+$as_echo_n "checking if we can lock with hard links... " >&6; }
16330+ hard_links=yes
16331+ $RM conftest*
16332+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
16333+ touch conftest.a
16334+ ln conftest.a conftest.b 2>&5 || hard_links=no
16335+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
16336+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
16337+$as_echo "$hard_links" >&6; }
16338+ if test "$hard_links" = no; then
16339+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
16340+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
16341+ need_locks=warn
16342+ fi
16343+else
16344+ need_locks=no
16345+fi
16346+
16347+
16348+
16349+
16350+
16351+
16352+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
16353+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
16354+
16355+ runpath_var=
16356+ allow_undefined_flag=
16357+ always_export_symbols=no
16358+ archive_cmds=
16359+ archive_expsym_cmds=
16360+ compiler_needs_object=no
16361+ enable_shared_with_static_runtimes=no
16362+ export_dynamic_flag_spec=
16363+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
16364+ hardcode_automatic=no
16365+ hardcode_direct=no
16366+ hardcode_direct_absolute=no
16367+ hardcode_libdir_flag_spec=
16368+ hardcode_libdir_separator=
16369+ hardcode_minus_L=no
16370+ hardcode_shlibpath_var=unsupported
16371+ inherit_rpath=no
16372+ link_all_deplibs=unknown
16373+ module_cmds=
16374+ module_expsym_cmds=
16375+ old_archive_from_new_cmds=
16376+ old_archive_from_expsyms_cmds=
16377+ thread_safe_flag_spec=
16378+ whole_archive_flag_spec=
16379+ # include_expsyms should be a list of space-separated symbols to be *always*
16380+ # included in the symbol list
16381+ include_expsyms=
16382+ # exclude_expsyms can be an extended regexp of symbols to exclude
16383+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
16384+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
16385+ # as well as any symbol that contains `d'.
16386+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
16387+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
16388+ # platforms (ab)use it in PIC code, but their linkers get confused if
16389+ # the symbol is explicitly referenced. Since portable code cannot
16390+ # rely on this symbol name, it's probably fine to never include it in
16391+ # preloaded symbol tables.
16392+ # Exclude shared library initialization/finalization symbols.
16393+ extract_expsyms_cmds=
16394+
16395+ case $host_os in
16396+ cygwin* | mingw* | pw32* | cegcc*)
16397+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
16398+ # When not using gcc, we currently assume that we are using
16399+ # Microsoft Visual C++.
16400+ if test "$GCC" != yes; then
16401+ with_gnu_ld=no
16402+ fi
16403+ ;;
16404+ interix*)
16405+ # we just hope/assume this is gcc and not c89 (= MSVC++)
16406+ with_gnu_ld=yes
16407+ ;;
16408+ openbsd*)
16409+ with_gnu_ld=no
16410+ ;;
16411+ linux* | k*bsd*-gnu | gnu*)
16412+ link_all_deplibs=no
16413+ ;;
16414+ esac
16415+
16416+ ld_shlibs=yes
16417+
16418+ # On some targets, GNU ld is compatible enough with the native linker
16419+ # that we're better off using the native interface for both.
16420+ lt_use_gnu_ld_interface=no
16421+ if test "$with_gnu_ld" = yes; then
16422+ case $host_os in
16423+ aix*)
16424+ # The AIX port of GNU ld has always aspired to compatibility
16425+ # with the native linker. However, as the warning in the GNU ld
16426+ # block says, versions before 2.19.5* couldn't really create working
16427+ # shared libraries, regardless of the interface used.
16428+ case `$LD -v 2>&1` in
16429+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
16430+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
16431+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
16432+ *)
16433+ lt_use_gnu_ld_interface=yes
16434+ ;;
16435+ esac
16436+ ;;
16437+ *)
16438+ lt_use_gnu_ld_interface=yes
16439+ ;;
16440+ esac
16441+ fi
16442+
16443+ if test "$lt_use_gnu_ld_interface" = yes; then
16444+ # If archive_cmds runs LD, not CC, wlarc should be empty
16445+ wlarc='${wl}'
16446+
16447+ # Set some defaults for GNU ld with shared library support. These
16448+ # are reset later if shared libraries are not supported. Putting them
16449+ # here allows them to be overridden if necessary.
16450+ runpath_var=LD_RUN_PATH
16451+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
16452+ export_dynamic_flag_spec='${wl}--export-dynamic'
16453+ # ancient GNU ld didn't support --whole-archive et. al.
16454+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
16455+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
16456+ else
16457+ whole_archive_flag_spec=
16458+ fi
16459+ supports_anon_versioning=no
16460+ case `$LD -v 2>&1` in
16461+ *GNU\ gold*) supports_anon_versioning=yes ;;
16462+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
16463+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
16464+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
16465+ *\ 2.11.*) ;; # other 2.11 versions
16466+ *) supports_anon_versioning=yes ;;
16467+ esac
16468+
16469+ # See if GNU ld supports shared libraries.
16470+ case $host_os in
16471+ aix[3-9]*)
16472+ # On AIX/PPC, the GNU linker is very broken
16473+ if test "$host_cpu" != ia64; then
16474+ ld_shlibs=no
16475+ cat <<_LT_EOF 1>&2
16476+
16477+*** Warning: the GNU linker, at least up to release 2.19, is reported
16478+*** to be unable to reliably create shared libraries on AIX.
16479+*** Therefore, libtool is disabling shared libraries support. If you
16480+*** really care for shared libraries, you may want to install binutils
16481+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
16482+*** You will then need to restart the configuration process.
16483+
16484+_LT_EOF
16485+ fi
16486+ ;;
16487+
16488+ amigaos*)
16489+ case $host_cpu in
16490+ powerpc)
16491+ # see comment about AmigaOS4 .so support
16492+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16493+ archive_expsym_cmds=''
16494+ ;;
16495+ m68k)
16496+ archive_cmds='$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)'
16497+ hardcode_libdir_flag_spec='-L$libdir'
16498+ hardcode_minus_L=yes
16499+ ;;
16500+ esac
16501+ ;;
16502+
16503+ beos*)
16504+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
16505+ allow_undefined_flag=unsupported
16506+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
16507+ # support --undefined. This deserves some investigation. FIXME
16508+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16509+ else
16510+ ld_shlibs=no
16511+ fi
16512+ ;;
16513+
16514+ cygwin* | mingw* | pw32* | cegcc*)
16515+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
16516+ # as there is no search path for DLLs.
16517+ hardcode_libdir_flag_spec='-L$libdir'
16518+ export_dynamic_flag_spec='${wl}--export-all-symbols'
16519+ allow_undefined_flag=unsupported
16520+ always_export_symbols=no
16521+ enable_shared_with_static_runtimes=yes
16522+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
16523+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
16524+
16525+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
16526+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
16527+ # If the export-symbols file already is a .def file (1st line
16528+ # is EXPORTS), use it as is; otherwise, prepend...
16529+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
16530+ cp $export_symbols $output_objdir/$soname.def;
16531+ else
16532+ echo EXPORTS > $output_objdir/$soname.def;
16533+ cat $export_symbols >> $output_objdir/$soname.def;
16534+ fi~
16535+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
16536+ else
16537+ ld_shlibs=no
16538+ fi
16539+ ;;
16540+
16541+ haiku*)
16542+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16543+ link_all_deplibs=yes
16544+ ;;
16545+
16546+ interix[3-9]*)
16547+ hardcode_direct=no
16548+ hardcode_shlibpath_var=no
16549+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
16550+ export_dynamic_flag_spec='${wl}-E'
16551+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
16552+ # Instead, shared libraries are loaded at an image base (0x10000000 by
16553+ # default) and relocated if they conflict, which is a slow very memory
16554+ # consuming and fragmenting process. To avoid this, we pick a random,
16555+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
16556+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
16557+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
16558+ archive_expsym_cmds='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'
16559+ ;;
16560+
16561+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
16562+ tmp_diet=no
16563+ if test "$host_os" = linux-dietlibc; then
16564+ case $cc_basename in
16565+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
16566+ esac
16567+ fi
16568+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
16569+ && test "$tmp_diet" = no
16570+ then
16571+ tmp_addflag=' $pic_flag'
16572+ tmp_sharedflag='-shared'
16573+ case $cc_basename,$host_cpu in
16574+ pgcc*) # Portland Group C compiler
16575+ whole_archive_flag_spec='${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'
16576+ tmp_addflag=' $pic_flag'
16577+ ;;
16578+ pgf77* | pgf90* | pgf95* | pgfortran*)
16579+ # Portland Group f77 and f90 compilers
16580+ whole_archive_flag_spec='${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'
16581+ tmp_addflag=' $pic_flag -Mnomain' ;;
16582+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
16583+ tmp_addflag=' -i_dynamic' ;;
16584+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
16585+ tmp_addflag=' -i_dynamic -nofor_main' ;;
16586+ ifc* | ifort*) # Intel Fortran compiler
16587+ tmp_addflag=' -nofor_main' ;;
16588+ lf95*) # Lahey Fortran 8.1
16589+ whole_archive_flag_spec=
16590+ tmp_sharedflag='--shared' ;;
16591+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
16592+ tmp_sharedflag='-qmkshrobj'
16593+ tmp_addflag= ;;
16594+ nvcc*) # Cuda Compiler Driver 2.2
16595+ whole_archive_flag_spec='${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'
16596+ compiler_needs_object=yes
16597+ ;;
16598+ esac
16599+ case `$CC -V 2>&1 | sed 5q` in
16600+ *Sun\ C*) # Sun C 5.9
16601+ whole_archive_flag_spec='${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'
16602+ compiler_needs_object=yes
16603+ tmp_sharedflag='-G' ;;
16604+ *Sun\ F*) # Sun Fortran 8.3
16605+ tmp_sharedflag='-G' ;;
16606+ esac
16607+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16608+
16609+ if test "x$supports_anon_versioning" = xyes; then
16610+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
16611+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
16612+ echo "local: *; };" >> $output_objdir/$libname.ver~
16613+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
16614+ fi
16615+
16616+ case $cc_basename in
16617+ xlf* | bgf* | bgxlf* | mpixlf*)
16618+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
16619+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
16620+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
16621+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
16622+ if test "x$supports_anon_versioning" = xyes; then
16623+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
16624+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
16625+ echo "local: *; };" >> $output_objdir/$libname.ver~
16626+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
16627+ fi
16628+ ;;
16629+ esac
16630+ else
16631+ ld_shlibs=no
16632+ fi
16633+ ;;
16634+
16635+ netbsd* | netbsdelf*-gnu)
16636+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
16637+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
16638+ wlarc=
16639+ else
16640+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16641+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
16642+ fi
16643+ ;;
16644+
16645+ solaris*)
16646+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
16647+ ld_shlibs=no
16648+ cat <<_LT_EOF 1>&2
16649+
16650+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
16651+*** create shared libraries on Solaris systems. Therefore, libtool
16652+*** is disabling shared libraries support. We urge you to upgrade GNU
16653+*** binutils to release 2.9.1 or newer. Another option is to modify
16654+*** your PATH or compiler configuration so that the native linker is
16655+*** used, and then restart.
16656+
16657+_LT_EOF
16658+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
16659+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16660+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
16661+ else
16662+ ld_shlibs=no
16663+ fi
16664+ ;;
16665+
16666+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
16667+ case `$LD -v 2>&1` in
16668+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
16669+ ld_shlibs=no
16670+ cat <<_LT_EOF 1>&2
16671+
16672+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
16673+*** reliably create shared libraries on SCO systems. Therefore, libtool
16674+*** is disabling shared libraries support. We urge you to upgrade GNU
16675+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
16676+*** your PATH or compiler configuration so that the native linker is
16677+*** used, and then restart.
16678+
16679+_LT_EOF
16680+ ;;
16681+ *)
16682+ # For security reasons, it is highly recommended that you always
16683+ # use absolute paths for naming shared libraries, and exclude the
16684+ # DT_RUNPATH tag from executables and libraries. But doing so
16685+ # requires that you compile everything twice, which is a pain.
16686+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
16687+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
16688+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16689+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
16690+ else
16691+ ld_shlibs=no
16692+ fi
16693+ ;;
16694+ esac
16695+ ;;
16696+
16697+ sunos4*)
16698+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
16699+ wlarc=
16700+ hardcode_direct=yes
16701+ hardcode_shlibpath_var=no
16702+ ;;
16703+
16704+ *)
16705+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
16706+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16707+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
16708+ else
16709+ ld_shlibs=no
16710+ fi
16711+ ;;
16712+ esac
16713+
16714+ if test "$ld_shlibs" = no; then
16715+ runpath_var=
16716+ hardcode_libdir_flag_spec=
16717+ export_dynamic_flag_spec=
16718+ whole_archive_flag_spec=
16719+ fi
16720+ else
16721+ # PORTME fill in a description of your system's linker (not GNU ld)
16722+ case $host_os in
16723+ aix3*)
16724+ allow_undefined_flag=unsupported
16725+ always_export_symbols=yes
16726+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
16727+ # Note: this linker hardcodes the directories in LIBPATH if there
16728+ # are no directories specified by -L.
16729+ hardcode_minus_L=yes
16730+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
16731+ # Neither direct hardcoding nor static linking is supported with a
16732+ # broken collect2.
16733+ hardcode_direct=unsupported
16734+ fi
16735+ ;;
16736+
16737+ aix[4-9]*)
16738+ if test "$host_cpu" = ia64; then
16739+ # On IA64, the linker does run time linking by default, so we don't
16740+ # have to do anything special.
16741+ aix_use_runtimelinking=no
16742+ exp_sym_flag='-Bexport'
16743+ no_entry_flag=""
16744+ else
16745+ # If we're using GNU nm, then we don't want the "-C" option.
16746+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
16747+ # Also, AIX nm treats weak defined symbols like other global
16748+ # defined symbols, whereas GNU nm marks them as "W".
16749+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
16750+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
16751+ else
16752+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
16753+ fi
16754+ aix_use_runtimelinking=no
16755+
16756+ # Test if we are trying to use run time linking or normal
16757+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
16758+ # need to do runtime linking.
16759+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
16760+ for ld_flag in $LDFLAGS; do
16761+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
16762+ aix_use_runtimelinking=yes
16763+ break
16764+ fi
16765+ done
16766+ ;;
16767+ esac
16768+
16769+ exp_sym_flag='-bexport'
16770+ no_entry_flag='-bnoentry'
16771+ fi
16772+
16773+ # When large executables or shared objects are built, AIX ld can
16774+ # have problems creating the table of contents. If linking a library
16775+ # or program results in "error TOC overflow" add -mminimal-toc to
16776+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
16777+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
16778+
16779+ archive_cmds=''
16780+ hardcode_direct=yes
16781+ hardcode_direct_absolute=yes
16782+ hardcode_libdir_separator=':'
16783+ link_all_deplibs=yes
16784+ file_list_spec='${wl}-f,'
16785+
16786+ if test "$GCC" = yes; then
16787+ case $host_os in aix4.[012]|aix4.[012].*)
16788+ # We only want to do this on AIX 4.2 and lower, the check
16789+ # below for broken collect2 doesn't work under 4.3+
16790+ collect2name=`${CC} -print-prog-name=collect2`
16791+ if test -f "$collect2name" &&
16792+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
16793+ then
16794+ # We have reworked collect2
16795+ :
16796+ else
16797+ # We have old collect2
16798+ hardcode_direct=unsupported
16799+ # It fails to find uninstalled libraries when the uninstalled
16800+ # path is not listed in the libpath. Setting hardcode_minus_L
16801+ # to unsupported forces relinking
16802+ hardcode_minus_L=yes
16803+ hardcode_libdir_flag_spec='-L$libdir'
16804+ hardcode_libdir_separator=
16805+ fi
16806+ ;;
16807+ esac
16808+ shared_flag='-shared'
16809+ if test "$aix_use_runtimelinking" = yes; then
16810+ shared_flag="$shared_flag "'${wl}-G'
16811+ fi
16812+ link_all_deplibs=no
16813+ else
16814+ # not using gcc
16815+ if test "$host_cpu" = ia64; then
16816+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
16817+ # chokes on -Wl,-G. The following line is correct:
16818+ shared_flag='-G'
16819+ else
16820+ if test "$aix_use_runtimelinking" = yes; then
16821+ shared_flag='${wl}-G'
16822+ else
16823+ shared_flag='${wl}-bM:SRE'
16824+ fi
16825+ fi
16826+ fi
16827+
16828+ export_dynamic_flag_spec='${wl}-bexpall'
16829+ # It seems that -bexpall does not export symbols beginning with
16830+ # underscore (_), so it is better to generate a list of symbols to export.
16831+ always_export_symbols=yes
16832+ if test "$aix_use_runtimelinking" = yes; then
16833+ # Warning - without using the other runtime loading flags (-brtl),
16834+ # -berok will link without error, but may produce a broken library.
16835+ allow_undefined_flag='-berok'
16836+ # Determine the default libpath from the value encoded in an
16837+ # empty executable.
16838+ if test "${lt_cv_aix_libpath+set}" = set; then
16839+ aix_libpath=$lt_cv_aix_libpath
16840+else
16841+ if ${lt_cv_aix_libpath_+:} false; then :
16842+ $as_echo_n "(cached) " >&6
16843+else
16844+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16845+/* end confdefs.h. */
16846+
16847+int
16848+main ()
16849+{
16850+
16851+ ;
16852+ return 0;
16853+}
16854+_ACEOF
16855+if ac_fn_c_try_link "$LINENO"; then :
16856+
16857+ lt_aix_libpath_sed='
16858+ /Import File Strings/,/^$/ {
16859+ /^0/ {
16860+ s/^0 *\([^ ]*\) *$/\1/
16861+ p
16862+ }
16863+ }'
16864+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
16865+ # Check for a 64-bit object if we didn't find anything.
16866+ if test -z "$lt_cv_aix_libpath_"; then
16867+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
16868+ fi
16869+fi
16870+rm -f core conftest.err conftest.$ac_objext \
16871+ conftest$ac_exeext conftest.$ac_ext
16872+ if test -z "$lt_cv_aix_libpath_"; then
16873+ lt_cv_aix_libpath_="/usr/lib:/lib"
16874+ fi
16875+
16876+fi
16877+
16878+ aix_libpath=$lt_cv_aix_libpath_
16879+fi
16880+
16881+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
16882+ archive_expsym_cmds='$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"
16883+ else
16884+ if test "$host_cpu" = ia64; then
16885+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
16886+ allow_undefined_flag="-z nodefs"
16887+ archive_expsym_cmds="\$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"
16888+ else
16889+ # Determine the default libpath from the value encoded in an
16890+ # empty executable.
16891+ if test "${lt_cv_aix_libpath+set}" = set; then
16892+ aix_libpath=$lt_cv_aix_libpath
16893+else
16894+ if ${lt_cv_aix_libpath_+:} false; then :
16895+ $as_echo_n "(cached) " >&6
16896+else
16897+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16898+/* end confdefs.h. */
16899+
16900+int
16901+main ()
16902+{
16903+
16904+ ;
16905+ return 0;
16906+}
16907+_ACEOF
16908+if ac_fn_c_try_link "$LINENO"; then :
16909+
16910+ lt_aix_libpath_sed='
16911+ /Import File Strings/,/^$/ {
16912+ /^0/ {
16913+ s/^0 *\([^ ]*\) *$/\1/
16914+ p
16915+ }
16916+ }'
16917+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
16918+ # Check for a 64-bit object if we didn't find anything.
16919+ if test -z "$lt_cv_aix_libpath_"; then
16920+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
16921+ fi
16922+fi
16923+rm -f core conftest.err conftest.$ac_objext \
16924+ conftest$ac_exeext conftest.$ac_ext
16925+ if test -z "$lt_cv_aix_libpath_"; then
16926+ lt_cv_aix_libpath_="/usr/lib:/lib"
16927+ fi
16928+
16929+fi
16930+
16931+ aix_libpath=$lt_cv_aix_libpath_
16932+fi
16933+
16934+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
16935+ # Warning - without using the other run time loading flags,
16936+ # -berok will link without error, but may produce a broken library.
16937+ no_undefined_flag=' ${wl}-bernotok'
16938+ allow_undefined_flag=' ${wl}-berok'
16939+ if test "$with_gnu_ld" = yes; then
16940+ # We only use this code for GNU lds that support --whole-archive.
16941+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
16942+ else
16943+ # Exported symbols can be pulled into shared objects from archives
16944+ whole_archive_flag_spec='$convenience'
16945+ fi
16946+ archive_cmds_need_lc=yes
16947+ # This is similar to how AIX traditionally builds its shared libraries.
16948+ archive_expsym_cmds="\$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'
16949+ fi
16950+ fi
16951+ ;;
16952+
16953+ amigaos*)
16954+ case $host_cpu in
16955+ powerpc)
16956+ # see comment about AmigaOS4 .so support
16957+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
16958+ archive_expsym_cmds=''
16959+ ;;
16960+ m68k)
16961+ archive_cmds='$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)'
16962+ hardcode_libdir_flag_spec='-L$libdir'
16963+ hardcode_minus_L=yes
16964+ ;;
16965+ esac
16966+ ;;
16967+
16968+ bsdi[45]*)
16969+ export_dynamic_flag_spec=-rdynamic
16970+ ;;
16971+
16972+ cygwin* | mingw* | pw32* | cegcc*)
16973+ # When not using gcc, we currently assume that we are using
16974+ # Microsoft Visual C++.
16975+ # hardcode_libdir_flag_spec is actually meaningless, as there is
16976+ # no search path for DLLs.
16977+ case $cc_basename in
16978+ cl*)
16979+ # Native MSVC
16980+ hardcode_libdir_flag_spec=' '
16981+ allow_undefined_flag=unsupported
16982+ always_export_symbols=yes
16983+ file_list_spec='@'
16984+ # Tell ltmain to make .lib files, not .a files.
16985+ libext=lib
16986+ # Tell ltmain to make .dll files, not .so files.
16987+ shrext_cmds=".dll"
16988+ # FIXME: Setting linknames here is a bad hack.
16989+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
16990+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
16991+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
16992+ else
16993+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
16994+ fi~
16995+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
16996+ linknames='
16997+ # The linker will not automatically build a static lib if we build a DLL.
16998+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
16999+ enable_shared_with_static_runtimes=yes
17000+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
17001+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
17002+ # Don't use ranlib
17003+ old_postinstall_cmds='chmod 644 $oldlib'
17004+ postlink_cmds='lt_outputfile="@OUTPUT@"~
17005+ lt_tool_outputfile="@TOOL_OUTPUT@"~
17006+ case $lt_outputfile in
17007+ *.exe|*.EXE) ;;
17008+ *)
17009+ lt_outputfile="$lt_outputfile.exe"
17010+ lt_tool_outputfile="$lt_tool_outputfile.exe"
17011+ ;;
17012+ esac~
17013+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
17014+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
17015+ $RM "$lt_outputfile.manifest";
17016+ fi'
17017+ ;;
17018+ *)
17019+ # Assume MSVC wrapper
17020+ hardcode_libdir_flag_spec=' '
17021+ allow_undefined_flag=unsupported
17022+ # Tell ltmain to make .lib files, not .a files.
17023+ libext=lib
17024+ # Tell ltmain to make .dll files, not .so files.
17025+ shrext_cmds=".dll"
17026+ # FIXME: Setting linknames here is a bad hack.
17027+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
17028+ # The linker will automatically build a .lib file if we build a DLL.
17029+ old_archive_from_new_cmds='true'
17030+ # FIXME: Should let the user specify the lib program.
17031+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
17032+ enable_shared_with_static_runtimes=yes
17033+ ;;
17034+ esac
17035+ ;;
17036+
17037+ darwin* | rhapsody*)
17038+
17039+
17040+ archive_cmds_need_lc=no
17041+ hardcode_direct=no
17042+ hardcode_automatic=yes
17043+ hardcode_shlibpath_var=unsupported
17044+ if test "$lt_cv_ld_force_load" = "yes"; then
17045+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
17046+
17047+ else
17048+ whole_archive_flag_spec=''
17049+ fi
17050+ link_all_deplibs=yes
17051+ allow_undefined_flag="$_lt_dar_allow_undefined"
17052+ case $cc_basename in
17053+ ifort*) _lt_dar_can_shared=yes ;;
17054+ *) _lt_dar_can_shared=$GCC ;;
17055+ esac
17056+ if test "$_lt_dar_can_shared" = "yes"; then
17057+ output_verbose_link_cmd=func_echo_all
17058+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
17059+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
17060+ archive_expsym_cmds="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}"
17061+ module_expsym_cmds="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}"
17062+
17063+ else
17064+ ld_shlibs=no
17065+ fi
17066+
17067+ ;;
17068+
17069+ dgux*)
17070+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
17071+ hardcode_libdir_flag_spec='-L$libdir'
17072+ hardcode_shlibpath_var=no
17073+ ;;
17074+
17075+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
17076+ # support. Future versions do this automatically, but an explicit c++rt0.o
17077+ # does not break anything, and helps significantly (at the cost of a little
17078+ # extra space).
17079+ freebsd2.2*)
17080+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
17081+ hardcode_libdir_flag_spec='-R$libdir'
17082+ hardcode_direct=yes
17083+ hardcode_shlibpath_var=no
17084+ ;;
17085+
17086+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
17087+ freebsd2.*)
17088+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
17089+ hardcode_direct=yes
17090+ hardcode_minus_L=yes
17091+ hardcode_shlibpath_var=no
17092+ ;;
17093+
17094+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
17095+ freebsd* | dragonfly*)
17096+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
17097+ hardcode_libdir_flag_spec='-R$libdir'
17098+ hardcode_direct=yes
17099+ hardcode_shlibpath_var=no
17100+ ;;
17101+
17102+ hpux9*)
17103+ if test "$GCC" = yes; then
17104+ archive_cmds='$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'
17105+ else
17106+ archive_cmds='$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'
17107+ fi
17108+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
17109+ hardcode_libdir_separator=:
17110+ hardcode_direct=yes
17111+
17112+ # hardcode_minus_L: Not really in the search PATH,
17113+ # but as the default location of the library.
17114+ hardcode_minus_L=yes
17115+ export_dynamic_flag_spec='${wl}-E'
17116+ ;;
17117+
17118+ hpux10*)
17119+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
17120+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
17121+ else
17122+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
17123+ fi
17124+ if test "$with_gnu_ld" = no; then
17125+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
17126+ hardcode_libdir_separator=:
17127+ hardcode_direct=yes
17128+ hardcode_direct_absolute=yes
17129+ export_dynamic_flag_spec='${wl}-E'
17130+ # hardcode_minus_L: Not really in the search PATH,
17131+ # but as the default location of the library.
17132+ hardcode_minus_L=yes
17133+ fi
17134+ ;;
17135+
17136+ hpux11*)
17137+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
17138+ case $host_cpu in
17139+ hppa*64*)
17140+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
17141+ ;;
17142+ ia64*)
17143+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
17144+ ;;
17145+ *)
17146+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
17147+ ;;
17148+ esac
17149+ else
17150+ case $host_cpu in
17151+ hppa*64*)
17152+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
17153+ ;;
17154+ ia64*)
17155+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
17156+ ;;
17157+ *)
17158+
17159+ # Older versions of the 11.00 compiler do not understand -b yet
17160+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
17161+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
17162+$as_echo_n "checking if $CC understands -b... " >&6; }
17163+if ${lt_cv_prog_compiler__b+:} false; then :
17164+ $as_echo_n "(cached) " >&6
17165+else
17166+ lt_cv_prog_compiler__b=no
17167+ save_LDFLAGS="$LDFLAGS"
17168+ LDFLAGS="$LDFLAGS -b"
17169+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
17170+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
17171+ # The linker can only warn and ignore the option if not recognized
17172+ # So say no if there are warnings
17173+ if test -s conftest.err; then
17174+ # Append any errors to the config.log.
17175+ cat conftest.err 1>&5
17176+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
17177+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
17178+ if diff conftest.exp conftest.er2 >/dev/null; then
17179+ lt_cv_prog_compiler__b=yes
17180+ fi
17181+ else
17182+ lt_cv_prog_compiler__b=yes
17183+ fi
17184+ fi
17185+ $RM -r conftest*
17186+ LDFLAGS="$save_LDFLAGS"
17187+
17188+fi
17189+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
17190+$as_echo "$lt_cv_prog_compiler__b" >&6; }
17191+
17192+if test x"$lt_cv_prog_compiler__b" = xyes; then
17193+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
17194+else
17195+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
17196+fi
17197+
17198+ ;;
17199+ esac
17200+ fi
17201+ if test "$with_gnu_ld" = no; then
17202+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
17203+ hardcode_libdir_separator=:
17204+
17205+ case $host_cpu in
17206+ hppa*64*|ia64*)
17207+ hardcode_direct=no
17208+ hardcode_shlibpath_var=no
17209+ ;;
17210+ *)
17211+ hardcode_direct=yes
17212+ hardcode_direct_absolute=yes
17213+ export_dynamic_flag_spec='${wl}-E'
17214+
17215+ # hardcode_minus_L: Not really in the search PATH,
17216+ # but as the default location of the library.
17217+ hardcode_minus_L=yes
17218+ ;;
17219+ esac
17220+ fi
17221+ ;;
17222+
17223+ irix5* | irix6* | nonstopux*)
17224+ if test "$GCC" = yes; then
17225+ archive_cmds='$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'
17226+ # Try to use the -exported_symbol ld option, if it does not
17227+ # work, assume that -exports_file does not work either and
17228+ # implicitly export all symbols.
17229+ # This should be the same for all languages, so no per-tag cache variable.
17230+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
17231+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
17232+if ${lt_cv_irix_exported_symbol+:} false; then :
17233+ $as_echo_n "(cached) " >&6
17234+else
17235+ save_LDFLAGS="$LDFLAGS"
17236+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
17237+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17238+/* end confdefs.h. */
17239+int foo (void) { return 0; }
17240+_ACEOF
17241+if ac_fn_c_try_link "$LINENO"; then :
17242+ lt_cv_irix_exported_symbol=yes
17243+else
17244+ lt_cv_irix_exported_symbol=no
17245+fi
17246+rm -f core conftest.err conftest.$ac_objext \
17247+ conftest$ac_exeext conftest.$ac_ext
17248+ LDFLAGS="$save_LDFLAGS"
17249+fi
17250+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
17251+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
17252+ if test "$lt_cv_irix_exported_symbol" = yes; then
17253+ archive_expsym_cmds='$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'
17254+ fi
17255+ else
17256+ archive_cmds='$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'
17257+ archive_expsym_cmds='$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'
17258+ fi
17259+ archive_cmds_need_lc='no'
17260+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
17261+ hardcode_libdir_separator=:
17262+ inherit_rpath=yes
17263+ link_all_deplibs=yes
17264+ ;;
17265+
17266+ netbsd* | netbsdelf*-gnu)
17267+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
17268+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
17269+ else
17270+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
17271+ fi
17272+ hardcode_libdir_flag_spec='-R$libdir'
17273+ hardcode_direct=yes
17274+ hardcode_shlibpath_var=no
17275+ ;;
17276+
17277+ newsos6)
17278+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
17279+ hardcode_direct=yes
17280+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
17281+ hardcode_libdir_separator=:
17282+ hardcode_shlibpath_var=no
17283+ ;;
17284+
17285+ *nto* | *qnx*)
17286+ ;;
17287+
17288+ openbsd*)
17289+ if test -f /usr/libexec/ld.so; then
17290+ hardcode_direct=yes
17291+ hardcode_shlibpath_var=no
17292+ hardcode_direct_absolute=yes
17293+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
17294+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
17295+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
17296+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
17297+ export_dynamic_flag_spec='${wl}-E'
17298+ else
17299+ case $host_os in
17300+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
17301+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
17302+ hardcode_libdir_flag_spec='-R$libdir'
17303+ ;;
17304+ *)
17305+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
17306+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
17307+ ;;
17308+ esac
17309+ fi
17310+ else
17311+ ld_shlibs=no
17312+ fi
17313+ ;;
17314+
17315+ os2*)
17316+ hardcode_libdir_flag_spec='-L$libdir'
17317+ hardcode_minus_L=yes
17318+ allow_undefined_flag=unsupported
17319+ archive_cmds='$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'
17320+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
17321+ ;;
17322+
17323+ osf3*)
17324+ if test "$GCC" = yes; then
17325+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
17326+ archive_cmds='$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'
17327+ else
17328+ allow_undefined_flag=' -expect_unresolved \*'
17329+ archive_cmds='$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'
17330+ fi
17331+ archive_cmds_need_lc='no'
17332+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
17333+ hardcode_libdir_separator=:
17334+ ;;
17335+
17336+ osf4* | osf5*) # as osf3* with the addition of -msym flag
17337+ if test "$GCC" = yes; then
17338+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
17339+ archive_cmds='$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'
17340+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
17341+ else
17342+ allow_undefined_flag=' -expect_unresolved \*'
17343+ archive_cmds='$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'
17344+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
17345+ $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'
17346+
17347+ # Both c and cxx compiler support -rpath directly
17348+ hardcode_libdir_flag_spec='-rpath $libdir'
17349+ fi
17350+ archive_cmds_need_lc='no'
17351+ hardcode_libdir_separator=:
17352+ ;;
17353+
17354+ solaris*)
17355+ no_undefined_flag=' -z defs'
17356+ if test "$GCC" = yes; then
17357+ wlarc='${wl}'
17358+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
17359+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
17360+ $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'
17361+ else
17362+ case `$CC -V 2>&1` in
17363+ *"Compilers 5.0"*)
17364+ wlarc=''
17365+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
17366+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
17367+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
17368+ ;;
17369+ *)
17370+ wlarc='${wl}'
17371+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
17372+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
17373+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
17374+ ;;
17375+ esac
17376+ fi
17377+ hardcode_libdir_flag_spec='-R$libdir'
17378+ hardcode_shlibpath_var=no
17379+ case $host_os in
17380+ solaris2.[0-5] | solaris2.[0-5].*) ;;
17381+ *)
17382+ # The compiler driver will combine and reorder linker options,
17383+ # but understands `-z linker_flag'. GCC discards it without `$wl',
17384+ # but is careful enough not to reorder.
17385+ # Supported since Solaris 2.6 (maybe 2.5.1?)
17386+ if test "$GCC" = yes; then
17387+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
17388+ else
17389+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
17390+ fi
17391+ ;;
17392+ esac
17393+ link_all_deplibs=yes
17394+ ;;
17395+
17396+ sunos4*)
17397+ if test "x$host_vendor" = xsequent; then
17398+ # Use $CC to link under sequent, because it throws in some extra .o
17399+ # files that make .init and .fini sections work.
17400+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
17401+ else
17402+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
17403+ fi
17404+ hardcode_libdir_flag_spec='-L$libdir'
17405+ hardcode_direct=yes
17406+ hardcode_minus_L=yes
17407+ hardcode_shlibpath_var=no
17408+ ;;
17409+
17410+ sysv4)
17411+ case $host_vendor in
17412+ sni)
17413+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
17414+ hardcode_direct=yes # is this really true???
17415+ ;;
17416+ siemens)
17417+ ## LD is ld it makes a PLAMLIB
17418+ ## CC just makes a GrossModule.
17419+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
17420+ reload_cmds='$CC -r -o $output$reload_objs'
17421+ hardcode_direct=no
17422+ ;;
17423+ motorola)
17424+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
17425+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
17426+ ;;
17427+ esac
17428+ runpath_var='LD_RUN_PATH'
17429+ hardcode_shlibpath_var=no
17430+ ;;
17431+
17432+ sysv4.3*)
17433+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
17434+ hardcode_shlibpath_var=no
17435+ export_dynamic_flag_spec='-Bexport'
17436+ ;;
17437+
17438+ sysv4*MP*)
17439+ if test -d /usr/nec; then
17440+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
17441+ hardcode_shlibpath_var=no
17442+ runpath_var=LD_RUN_PATH
17443+ hardcode_runpath_var=yes
17444+ ld_shlibs=yes
17445+ fi
17446+ ;;
17447+
17448+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
17449+ no_undefined_flag='${wl}-z,text'
17450+ archive_cmds_need_lc=no
17451+ hardcode_shlibpath_var=no
17452+ runpath_var='LD_RUN_PATH'
17453+
17454+ if test "$GCC" = yes; then
17455+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17456+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17457+ else
17458+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17459+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17460+ fi
17461+ ;;
17462+
17463+ sysv5* | sco3.2v5* | sco5v6*)
17464+ # Note: We can NOT use -z defs as we might desire, because we do not
17465+ # link with -lc, and that would cause any symbols used from libc to
17466+ # always be unresolved, which means just about no library would
17467+ # ever link correctly. If we're not using GNU ld we use -z text
17468+ # though, which does catch some bad symbols but isn't as heavy-handed
17469+ # as -z defs.
17470+ no_undefined_flag='${wl}-z,text'
17471+ allow_undefined_flag='${wl}-z,nodefs'
17472+ archive_cmds_need_lc=no
17473+ hardcode_shlibpath_var=no
17474+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
17475+ hardcode_libdir_separator=':'
17476+ link_all_deplibs=yes
17477+ export_dynamic_flag_spec='${wl}-Bexport'
17478+ runpath_var='LD_RUN_PATH'
17479+
17480+ if test "$GCC" = yes; then
17481+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17482+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17483+ else
17484+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17485+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
17486+ fi
17487+ ;;
17488+
17489+ uts4*)
17490+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
17491+ hardcode_libdir_flag_spec='-L$libdir'
17492+ hardcode_shlibpath_var=no
17493+ ;;
17494+
17495+ *)
17496+ ld_shlibs=no
17497+ ;;
17498+ esac
17499+
17500+ if test x$host_vendor = xsni; then
17501+ case $host in
17502+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
17503+ export_dynamic_flag_spec='${wl}-Blargedynsym'
17504+ ;;
17505+ esac
17506+ fi
17507+ fi
17508+
17509+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
17510+$as_echo "$ld_shlibs" >&6; }
17511+test "$ld_shlibs" = no && can_build_shared=no
17512+
17513+with_gnu_ld=$with_gnu_ld
17514+
17515+
17516+
17517+
17518+
17519+
17520+
17521+
17522+
17523+
17524+
17525+
17526+
17527+
17528+
17529+#
17530+# Do we need to explicitly link libc?
17531+#
17532+case "x$archive_cmds_need_lc" in
17533+x|xyes)
17534+ # Assume -lc should be added
17535+ archive_cmds_need_lc=yes
17536+
17537+ if test "$enable_shared" = yes && test "$GCC" = yes; then
17538+ case $archive_cmds in
17539+ *'~'*)
17540+ # FIXME: we may have to deal with multi-command sequences.
17541+ ;;
17542+ '$CC '*)
17543+ # Test whether the compiler implicitly links with -lc since on some
17544+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
17545+ # to ld, don't add -lc before -lgcc.
17546+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
17547+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
17548+if ${lt_cv_archive_cmds_need_lc+:} false; then :
17549+ $as_echo_n "(cached) " >&6
17550+else
17551+ $RM conftest*
17552+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
17553+
17554+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
17555+ (eval $ac_compile) 2>&5
17556+ ac_status=$?
17557+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
17558+ test $ac_status = 0; } 2>conftest.err; then
17559+ soname=conftest
17560+ lib=conftest
17561+ libobjs=conftest.$ac_objext
17562+ deplibs=
17563+ wl=$lt_prog_compiler_wl
17564+ pic_flag=$lt_prog_compiler_pic
17565+ compiler_flags=-v
17566+ linker_flags=-v
17567+ verstring=
17568+ output_objdir=.
17569+ libname=conftest
17570+ lt_save_allow_undefined_flag=$allow_undefined_flag
17571+ allow_undefined_flag=
17572+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
17573+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
17574+ ac_status=$?
17575+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
17576+ test $ac_status = 0; }
17577+ then
17578+ lt_cv_archive_cmds_need_lc=no
17579+ else
17580+ lt_cv_archive_cmds_need_lc=yes
17581+ fi
17582+ allow_undefined_flag=$lt_save_allow_undefined_flag
17583+ else
17584+ cat conftest.err 1>&5
17585+ fi
17586+ $RM conftest*
17587+
17588+fi
17589+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
17590+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
17591+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
17592+ ;;
17593+ esac
17594+ fi
17595+ ;;
17596+esac
17597+
17598+
17599+
17600+
17601+
17602+
17603+
17604+
17605+
17606+
17607+
17608+
17609+
17610+
17611+
17612+
17613+
17614+
17615+
17616+
17617+
17618+
17619+
17620+
17621+
17622+
17623+
17624+
17625+
17626+
17627+
17628+
17629+
17630+
17631+
17632+
17633+
17634+
17635+
17636+
17637+
17638+
17639+
17640+
17641+
17642+
17643+
17644+
17645+
17646+
17647+
17648+
17649+
17650+
17651+
17652+
17653+
17654+
17655+
17656+
17657+
17658+
17659+
17660+
17661+
17662+
17663+
17664+
17665+
17666+
17667+
17668+
17669+
17670+
17671+
17672+
17673+
17674+
17675+
17676+
17677+
17678+
17679+
17680+
17681+
17682+
17683+
17684+
17685+
17686+
17687+
17688+
17689+
17690+
17691+
17692+
17693+
17694+
17695+
17696+
17697+
17698+
17699+
17700+
17701+
17702+
17703+
17704+
17705+
17706+
17707+
17708+
17709+
17710+
17711+
17712+
17713+
17714+
17715+
17716+
17717+
17718+
17719+
17720+
17721+
17722+
17723+
17724+
17725+
17726+
17727+
17728+
17729+
17730+
17731+
17732+
17733+
17734+
17735+
17736+
17737+
17738+
17739+
17740+
17741+
17742+
17743+
17744+
17745+
17746+
17747+
17748+
17749+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
17750+$as_echo_n "checking dynamic linker characteristics... " >&6; }
17751+
17752+if test "$GCC" = yes; then
17753+ case $host_os in
17754+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
17755+ *) lt_awk_arg="/^libraries:/" ;;
17756+ esac
17757+ case $host_os in
17758+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
17759+ *) lt_sed_strip_eq="s,=/,/,g" ;;
17760+ esac
17761+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
17762+ case $lt_search_path_spec in
17763+ *\;*)
17764+ # if the path contains ";" then we assume it to be the separator
17765+ # otherwise default to the standard path separator (i.e. ":") - it is
17766+ # assumed that no part of a normal pathname contains ";" but that should
17767+ # okay in the real world where ";" in dirpaths is itself problematic.
17768+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
17769+ ;;
17770+ *)
17771+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
17772+ ;;
17773+ esac
17774+ # Ok, now we have the path, separated by spaces, we can step through it
17775+ # and add multilib dir if necessary.
17776+ lt_tmp_lt_search_path_spec=
17777+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
17778+ for lt_sys_path in $lt_search_path_spec; do
17779+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
17780+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
17781+ else
17782+ test -d "$lt_sys_path" && \
17783+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
17784+ fi
17785+ done
17786+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
17787+BEGIN {RS=" "; FS="/|\n";} {
17788+ lt_foo="";
17789+ lt_count=0;
17790+ for (lt_i = NF; lt_i > 0; lt_i--) {
17791+ if ($lt_i != "" && $lt_i != ".") {
17792+ if ($lt_i == "..") {
17793+ lt_count++;
17794+ } else {
17795+ if (lt_count == 0) {
17796+ lt_foo="/" $lt_i lt_foo;
17797+ } else {
17798+ lt_count--;
17799+ }
17800+ }
17801+ }
17802+ }
17803+ if (lt_foo != "") { lt_freq[lt_foo]++; }
17804+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
17805+}'`
17806+ # AWK program above erroneously prepends '/' to C:/dos/paths
17807+ # for these hosts.
17808+ case $host_os in
17809+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
17810+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
17811+ esac
17812+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
17813+else
17814+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
17815+fi
17816+library_names_spec=
17817+libname_spec='lib$name'
17818+soname_spec=
17819+shrext_cmds=".so"
17820+postinstall_cmds=
17821+postuninstall_cmds=
17822+finish_cmds=
17823+finish_eval=
17824+shlibpath_var=
17825+shlibpath_overrides_runpath=unknown
17826+version_type=none
17827+dynamic_linker="$host_os ld.so"
17828+sys_lib_dlsearch_path_spec="/lib /usr/lib"
17829+need_lib_prefix=unknown
17830+hardcode_into_libs=no
17831+
17832+# when you set need_version to no, make sure it does not cause -set_version
17833+# flags to be left without arguments
17834+need_version=unknown
17835+
17836+case $host_os in
17837+aix3*)
17838+ version_type=linux # correct to gnu/linux during the next big refactor
17839+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
17840+ shlibpath_var=LIBPATH
17841+
17842+ # AIX 3 has no versioning support, so we append a major version to the name.
17843+ soname_spec='${libname}${release}${shared_ext}$major'
17844+ ;;
17845+
17846+aix[4-9]*)
17847+ version_type=linux # correct to gnu/linux during the next big refactor
17848+ need_lib_prefix=no
17849+ need_version=no
17850+ hardcode_into_libs=yes
17851+ if test "$host_cpu" = ia64; then
17852+ # AIX 5 supports IA64
17853+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
17854+ shlibpath_var=LD_LIBRARY_PATH
17855+ else
17856+ # With GCC up to 2.95.x, collect2 would create an import file
17857+ # for dependence libraries. The import file would start with
17858+ # the line `#! .'. This would cause the generated library to
17859+ # depend on `.', always an invalid library. This was fixed in
17860+ # development snapshots of GCC prior to 3.0.
17861+ case $host_os in
17862+ aix4 | aix4.[01] | aix4.[01].*)
17863+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
17864+ echo ' yes '
17865+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
17866+ :
17867+ else
17868+ can_build_shared=no
17869+ fi
17870+ ;;
17871+ esac
17872+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
17873+ # soname into executable. Probably we can add versioning support to
17874+ # collect2, so additional links can be useful in future.
17875+ if test "$aix_use_runtimelinking" = yes; then
17876+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
17877+ # instead of lib<name>.a to let people know that these are not
17878+ # typical AIX shared libraries.
17879+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
17880+ else
17881+ # We preserve .a as extension for shared libraries through AIX4.2
17882+ # and later when we are not doing run time linking.
17883+ library_names_spec='${libname}${release}.a $libname.a'
17884+ soname_spec='${libname}${release}${shared_ext}$major'
17885+ fi
17886+ shlibpath_var=LIBPATH
17887+ fi
17888+ ;;
17889+
17890+amigaos*)
17891+ case $host_cpu in
17892+ powerpc)
17893+ # Since July 2007 AmigaOS4 officially supports .so libraries.
17894+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
17895+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
17896+ ;;
17897+ m68k)
17898+ library_names_spec='$libname.ixlibrary $libname.a'
17899+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
17900+ 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'
17901+ ;;
17902+ esac
17903+ ;;
17904+
17905+beos*)
17906+ library_names_spec='${libname}${shared_ext}'
17907+ dynamic_linker="$host_os ld.so"
17908+ shlibpath_var=LIBRARY_PATH
17909+ ;;
17910+
17911+bsdi[45]*)
17912+ version_type=linux # correct to gnu/linux during the next big refactor
17913+ need_version=no
17914+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
17915+ soname_spec='${libname}${release}${shared_ext}$major'
17916+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
17917+ shlibpath_var=LD_LIBRARY_PATH
17918+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
17919+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
17920+ # the default ld.so.conf also contains /usr/contrib/lib and
17921+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
17922+ # libtool to hard-code these into programs
17923+ ;;
17924+
17925+cygwin* | mingw* | pw32* | cegcc*)
17926+ version_type=windows
17927+ shrext_cmds=".dll"
17928+ need_version=no
17929+ need_lib_prefix=no
17930+
17931+ case $GCC,$cc_basename in
17932+ yes,*)
17933+ # gcc
17934+ library_names_spec='$libname.dll.a'
17935+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
17936+ postinstall_cmds='base_file=`basename \${file}`~
17937+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
17938+ dldir=$destdir/`dirname \$dlpath`~
17939+ test -d \$dldir || mkdir -p \$dldir~
17940+ $install_prog $dir/$dlname \$dldir/$dlname~
17941+ chmod a+x \$dldir/$dlname~
17942+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
17943+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
17944+ fi'
17945+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
17946+ dlpath=$dir/\$dldll~
17947+ $RM \$dlpath'
17948+ shlibpath_overrides_runpath=yes
17949+
17950+ case $host_os in
17951+ cygwin*)
17952+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
17953+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
17954+
17955+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
17956+ ;;
17957+ mingw* | cegcc*)
17958+ # MinGW DLLs use traditional 'lib' prefix
17959+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
17960+ ;;
17961+ pw32*)
17962+ # pw32 DLLs use 'pw' prefix rather than 'lib'
17963+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
17964+ ;;
17965+ esac
17966+ dynamic_linker='Win32 ld.exe'
17967+ ;;
17968+
17969+ *,cl*)
17970+ # Native MSVC
17971+ libname_spec='$name'
17972+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
17973+ library_names_spec='${libname}.dll.lib'
17974+
17975+ case $build_os in
17976+ mingw*)
17977+ sys_lib_search_path_spec=
17978+ lt_save_ifs=$IFS
17979+ IFS=';'
17980+ for lt_path in $LIB
17981+ do
17982+ IFS=$lt_save_ifs
17983+ # Let DOS variable expansion print the short 8.3 style file name.
17984+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
17985+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
17986+ done
17987+ IFS=$lt_save_ifs
17988+ # Convert to MSYS style.
17989+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
17990+ ;;
17991+ cygwin*)
17992+ # Convert to unix form, then to dos form, then back to unix form
17993+ # but this time dos style (no spaces!) so that the unix form looks
17994+ # like /cygdrive/c/PROGRA~1:/cygdr...
17995+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
17996+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
17997+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
17998+ ;;
17999+ *)
18000+ sys_lib_search_path_spec="$LIB"
18001+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
18002+ # It is most probably a Windows format PATH.
18003+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
18004+ else
18005+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
18006+ fi
18007+ # FIXME: find the short name or the path components, as spaces are
18008+ # common. (e.g. "Program Files" -> "PROGRA~1")
18009+ ;;
18010+ esac
18011+
18012+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
18013+ postinstall_cmds='base_file=`basename \${file}`~
18014+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
18015+ dldir=$destdir/`dirname \$dlpath`~
18016+ test -d \$dldir || mkdir -p \$dldir~
18017+ $install_prog $dir/$dlname \$dldir/$dlname'
18018+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
18019+ dlpath=$dir/\$dldll~
18020+ $RM \$dlpath'
18021+ shlibpath_overrides_runpath=yes
18022+ dynamic_linker='Win32 link.exe'
18023+ ;;
18024+
18025+ *)
18026+ # Assume MSVC wrapper
18027+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
18028+ dynamic_linker='Win32 ld.exe'
18029+ ;;
18030+ esac
18031+ # FIXME: first we should search . and the directory the executable is in
18032+ shlibpath_var=PATH
18033+ ;;
18034+
18035+darwin* | rhapsody*)
18036+ dynamic_linker="$host_os dyld"
18037+ version_type=darwin
18038+ need_lib_prefix=no
18039+ need_version=no
18040+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
18041+ soname_spec='${libname}${release}${major}$shared_ext'
18042+ shlibpath_overrides_runpath=yes
18043+ shlibpath_var=DYLD_LIBRARY_PATH
18044+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
18045+
18046+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
18047+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
18048+ ;;
18049+
18050+dgux*)
18051+ version_type=linux # correct to gnu/linux during the next big refactor
18052+ need_lib_prefix=no
18053+ need_version=no
18054+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
18055+ soname_spec='${libname}${release}${shared_ext}$major'
18056+ shlibpath_var=LD_LIBRARY_PATH
18057+ ;;
18058+
18059+freebsd* | dragonfly*)
18060+ # DragonFly does not have aout. When/if they implement a new
18061+ # versioning mechanism, adjust this.
18062+ if test -x /usr/bin/objformat; then
18063+ objformat=`/usr/bin/objformat`
18064+ else
18065+ case $host_os in
18066+ freebsd[23].*) objformat=aout ;;
18067+ *) objformat=elf ;;
18068+ esac
18069+ fi
18070+ version_type=freebsd-$objformat
18071+ case $version_type in
18072+ freebsd-elf*)
18073+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
18074+ need_version=no
18075+ need_lib_prefix=no
18076+ ;;
18077+ freebsd-*)
18078+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
18079+ need_version=yes
18080+ ;;
18081+ esac
18082+ shlibpath_var=LD_LIBRARY_PATH
18083+ case $host_os in
18084+ freebsd2.*)
18085+ shlibpath_overrides_runpath=yes
18086+ ;;
18087+ freebsd3.[01]* | freebsdelf3.[01]*)
18088+ shlibpath_overrides_runpath=yes
18089+ hardcode_into_libs=yes
18090+ ;;
18091+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
18092+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
18093+ shlibpath_overrides_runpath=no
18094+ hardcode_into_libs=yes
18095+ ;;
18096+ *) # from 4.6 on, and DragonFly
18097+ shlibpath_overrides_runpath=yes
18098+ hardcode_into_libs=yes
18099+ ;;
18100+ esac
18101+ ;;
18102+
18103+gnu*)
18104+ version_type=linux # correct to gnu/linux during the next big refactor
18105+ need_lib_prefix=no
18106+ need_version=no
18107+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
18108+ soname_spec='${libname}${release}${shared_ext}$major'
18109+ shlibpath_var=LD_LIBRARY_PATH
18110+ shlibpath_overrides_runpath=no
18111+ hardcode_into_libs=yes
18112+ ;;
18113+
18114+haiku*)
18115+ version_type=linux # correct to gnu/linux during the next big refactor
18116+ need_lib_prefix=no
18117+ need_version=no
18118+ dynamic_linker="$host_os runtime_loader"
18119+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
18120+ soname_spec='${libname}${release}${shared_ext}$major'
18121+ shlibpath_var=LIBRARY_PATH
18122+ shlibpath_overrides_runpath=yes
18123+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
18124+ hardcode_into_libs=yes
18125+ ;;
18126+
18127+hpux9* | hpux10* | hpux11*)
18128+ # Give a soname corresponding to the major version so that dld.sl refuses to
18129+ # link against other versions.
18130+ version_type=sunos
18131+ need_lib_prefix=no
18132+ need_version=no
18133+ case $host_cpu in
18134+ ia64*)
18135+ shrext_cmds='.so'
18136+ hardcode_into_libs=yes
18137+ dynamic_linker="$host_os dld.so"
18138+ shlibpath_var=LD_LIBRARY_PATH
18139+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
18140+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18141+ soname_spec='${libname}${release}${shared_ext}$major'
18142+ if test "X$HPUX_IA64_MODE" = X32; then
18143+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
18144+ else
18145+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
18146+ fi
18147+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
18148+ ;;
18149+ hppa*64*)
18150+ shrext_cmds='.sl'
18151+ hardcode_into_libs=yes
18152+ dynamic_linker="$host_os dld.sl"
18153+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
18154+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
18155+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18156+ soname_spec='${libname}${release}${shared_ext}$major'
18157+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
18158+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
18159+ ;;
18160+ *)
18161+ shrext_cmds='.sl'
18162+ dynamic_linker="$host_os dld.sl"
18163+ shlibpath_var=SHLIB_PATH
18164+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
18165+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18166+ soname_spec='${libname}${release}${shared_ext}$major'
18167+ ;;
18168+ esac
18169+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
18170+ postinstall_cmds='chmod 555 $lib'
18171+ # or fails outright, so override atomically:
18172+ install_override_mode=555
18173+ ;;
18174+
18175+interix[3-9]*)
18176+ version_type=linux # correct to gnu/linux during the next big refactor
18177+ need_lib_prefix=no
18178+ need_version=no
18179+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
18180+ soname_spec='${libname}${release}${shared_ext}$major'
18181+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
18182+ shlibpath_var=LD_LIBRARY_PATH
18183+ shlibpath_overrides_runpath=no
18184+ hardcode_into_libs=yes
18185+ ;;
18186+
18187+irix5* | irix6* | nonstopux*)
18188+ case $host_os in
18189+ nonstopux*) version_type=nonstopux ;;
18190+ *)
18191+ if test "$lt_cv_prog_gnu_ld" = yes; then
18192+ version_type=linux # correct to gnu/linux during the next big refactor
18193+ else
18194+ version_type=irix
18195+ fi ;;
18196+ esac
18197+ need_lib_prefix=no
18198+ need_version=no
18199+ soname_spec='${libname}${release}${shared_ext}$major'
18200+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
18201+ case $host_os in
18202+ irix5* | nonstopux*)
18203+ libsuff= shlibsuff=
18204+ ;;
18205+ *)
18206+ case $LD in # libtool.m4 will add one of these switches to LD
18207+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
18208+ libsuff= shlibsuff= libmagic=32-bit;;
18209+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
18210+ libsuff=32 shlibsuff=N32 libmagic=N32;;
18211+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
18212+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
18213+ *) libsuff= shlibsuff= libmagic=never-match;;
18214+ esac
18215+ ;;
18216+ esac
18217+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
18218+ shlibpath_overrides_runpath=no
18219+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
18220+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
18221+ hardcode_into_libs=yes
18222+ ;;
18223+
18224+# No shared lib support for Linux oldld, aout, or coff.
18225+linux*oldld* | linux*aout* | linux*coff*)
18226+ dynamic_linker=no
18227+ ;;
18228+
18229+# This must be glibc/ELF.
18230+linux* | k*bsd*-gnu | kopensolaris*-gnu)
18231+ version_type=linux # correct to gnu/linux during the next big refactor
18232+ need_lib_prefix=no
18233+ need_version=no
18234+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18235+ soname_spec='${libname}${release}${shared_ext}$major'
18236+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
18237+ shlibpath_var=LD_LIBRARY_PATH
18238+ shlibpath_overrides_runpath=no
18239+
18240+ # Some binutils ld are patched to set DT_RUNPATH
18241+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
18242+ $as_echo_n "(cached) " >&6
18243+else
18244+ lt_cv_shlibpath_overrides_runpath=no
18245+ save_LDFLAGS=$LDFLAGS
18246+ save_libdir=$libdir
18247+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
18248+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
18249+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18250+/* end confdefs.h. */
18251+
18252+int
18253+main ()
18254+{
18255+
18256+ ;
18257+ return 0;
18258+}
18259+_ACEOF
18260+if ac_fn_c_try_link "$LINENO"; then :
18261+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
18262+ lt_cv_shlibpath_overrides_runpath=yes
18263+fi
18264+fi
18265+rm -f core conftest.err conftest.$ac_objext \
18266+ conftest$ac_exeext conftest.$ac_ext
18267+ LDFLAGS=$save_LDFLAGS
18268+ libdir=$save_libdir
18269+
18270+fi
18271+
18272+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
18273+
18274+ # This implies no fast_install, which is unacceptable.
18275+ # Some rework will be needed to allow for fast_install
18276+ # before this can be enabled.
18277+ hardcode_into_libs=yes
18278+
18279+ # Append ld.so.conf contents to the search path
18280+ if test -f /etc/ld.so.conf; then
18281+ 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' ' '`
18282+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
18283+ fi
18284+
18285+ # We used to test for /lib/ld.so.1 and disable shared libraries on
18286+ # powerpc, because MkLinux only supported shared libraries with the
18287+ # GNU dynamic linker. Since this was broken with cross compilers,
18288+ # most powerpc-linux boxes support dynamic linking these days and
18289+ # people can always --disable-shared, the test was removed, and we
18290+ # assume the GNU/Linux dynamic linker is in use.
18291+ dynamic_linker='GNU/Linux ld.so'
18292+ ;;
18293+
18294+netbsdelf*-gnu)
18295+ version_type=linux
18296+ need_lib_prefix=no
18297+ need_version=no
18298+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
18299+ soname_spec='${libname}${release}${shared_ext}$major'
18300+ shlibpath_var=LD_LIBRARY_PATH
18301+ shlibpath_overrides_runpath=no
18302+ hardcode_into_libs=yes
18303+ dynamic_linker='NetBSD ld.elf_so'
18304+ ;;
18305+
18306+netbsd*)
18307+ version_type=sunos
18308+ need_lib_prefix=no
18309+ need_version=no
18310+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
18311+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
18312+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
18313+ dynamic_linker='NetBSD (a.out) ld.so'
18314+ else
18315+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
18316+ soname_spec='${libname}${release}${shared_ext}$major'
18317+ dynamic_linker='NetBSD ld.elf_so'
18318+ fi
18319+ shlibpath_var=LD_LIBRARY_PATH
18320+ shlibpath_overrides_runpath=yes
18321+ hardcode_into_libs=yes
18322+ ;;
18323+
18324+newsos6)
18325+ version_type=linux # correct to gnu/linux during the next big refactor
18326+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18327+ shlibpath_var=LD_LIBRARY_PATH
18328+ shlibpath_overrides_runpath=yes
18329+ ;;
18330+
18331+*nto* | *qnx*)
18332+ version_type=qnx
18333+ need_lib_prefix=no
18334+ need_version=no
18335+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18336+ soname_spec='${libname}${release}${shared_ext}$major'
18337+ shlibpath_var=LD_LIBRARY_PATH
18338+ shlibpath_overrides_runpath=no
18339+ hardcode_into_libs=yes
18340+ dynamic_linker='ldqnx.so'
18341+ ;;
18342+
18343+openbsd*)
18344+ version_type=sunos
18345+ sys_lib_dlsearch_path_spec="/usr/lib"
18346+ need_lib_prefix=no
18347+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
18348+ case $host_os in
18349+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
18350+ *) need_version=no ;;
18351+ esac
18352+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
18353+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
18354+ shlibpath_var=LD_LIBRARY_PATH
18355+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
18356+ case $host_os in
18357+ openbsd2.[89] | openbsd2.[89].*)
18358+ shlibpath_overrides_runpath=no
18359+ ;;
18360+ *)
18361+ shlibpath_overrides_runpath=yes
18362+ ;;
18363+ esac
18364+ else
18365+ shlibpath_overrides_runpath=yes
18366+ fi
18367+ ;;
18368+
18369+os2*)
18370+ libname_spec='$name'
18371+ shrext_cmds=".dll"
18372+ need_lib_prefix=no
18373+ library_names_spec='$libname${shared_ext} $libname.a'
18374+ dynamic_linker='OS/2 ld.exe'
18375+ shlibpath_var=LIBPATH
18376+ ;;
18377+
18378+osf3* | osf4* | osf5*)
18379+ version_type=osf
18380+ need_lib_prefix=no
18381+ need_version=no
18382+ soname_spec='${libname}${release}${shared_ext}$major'
18383+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18384+ shlibpath_var=LD_LIBRARY_PATH
18385+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
18386+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
18387+ ;;
18388+
18389+rdos*)
18390+ dynamic_linker=no
18391+ ;;
18392+
18393+solaris*)
18394+ version_type=linux # correct to gnu/linux during the next big refactor
18395+ need_lib_prefix=no
18396+ need_version=no
18397+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18398+ soname_spec='${libname}${release}${shared_ext}$major'
18399+ shlibpath_var=LD_LIBRARY_PATH
18400+ shlibpath_overrides_runpath=yes
18401+ hardcode_into_libs=yes
18402+ # ldd complains unless libraries are executable
18403+ postinstall_cmds='chmod +x $lib'
18404+ ;;
18405+
18406+sunos4*)
18407+ version_type=sunos
18408+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
18409+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
18410+ shlibpath_var=LD_LIBRARY_PATH
18411+ shlibpath_overrides_runpath=yes
18412+ if test "$with_gnu_ld" = yes; then
18413+ need_lib_prefix=no
18414+ fi
18415+ need_version=yes
18416+ ;;
18417+
18418+sysv4 | sysv4.3*)
18419+ version_type=linux # correct to gnu/linux during the next big refactor
18420+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18421+ soname_spec='${libname}${release}${shared_ext}$major'
18422+ shlibpath_var=LD_LIBRARY_PATH
18423+ case $host_vendor in
18424+ sni)
18425+ shlibpath_overrides_runpath=no
18426+ need_lib_prefix=no
18427+ runpath_var=LD_RUN_PATH
18428+ ;;
18429+ siemens)
18430+ need_lib_prefix=no
18431+ ;;
18432+ motorola)
18433+ need_lib_prefix=no
18434+ need_version=no
18435+ shlibpath_overrides_runpath=no
18436+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
18437+ ;;
18438+ esac
18439+ ;;
18440+
18441+sysv4*MP*)
18442+ if test -d /usr/nec ;then
18443+ version_type=linux # correct to gnu/linux during the next big refactor
18444+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
18445+ soname_spec='$libname${shared_ext}.$major'
18446+ shlibpath_var=LD_LIBRARY_PATH
18447+ fi
18448+ ;;
18449+
18450+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
18451+ version_type=freebsd-elf
18452+ need_lib_prefix=no
18453+ need_version=no
18454+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
18455+ soname_spec='${libname}${release}${shared_ext}$major'
18456+ shlibpath_var=LD_LIBRARY_PATH
18457+ shlibpath_overrides_runpath=yes
18458+ hardcode_into_libs=yes
18459+ if test "$with_gnu_ld" = yes; then
18460+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
18461+ else
18462+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
18463+ case $host_os in
18464+ sco3.2v5*)
18465+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
18466+ ;;
18467+ esac
18468+ fi
18469+ sys_lib_dlsearch_path_spec='/usr/lib'
18470+ ;;
18471+
18472+tpf*)
18473+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
18474+ version_type=linux # correct to gnu/linux during the next big refactor
18475+ need_lib_prefix=no
18476+ need_version=no
18477+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18478+ shlibpath_var=LD_LIBRARY_PATH
18479+ shlibpath_overrides_runpath=no
18480+ hardcode_into_libs=yes
18481+ ;;
18482+
18483+uts4*)
18484+ version_type=linux # correct to gnu/linux during the next big refactor
18485+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
18486+ soname_spec='${libname}${release}${shared_ext}$major'
18487+ shlibpath_var=LD_LIBRARY_PATH
18488+ ;;
18489+
18490+*)
18491+ dynamic_linker=no
18492+ ;;
18493+esac
18494+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
18495+$as_echo "$dynamic_linker" >&6; }
18496+test "$dynamic_linker" = no && can_build_shared=no
18497+
18498+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
18499+if test "$GCC" = yes; then
18500+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
18501+fi
18502+
18503+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
18504+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
18505+fi
18506+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
18507+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
18508+fi
18509+
18510+
18511+
18512+
18513+
18514+
18515+
18516+
18517+
18518+
18519+
18520+
18521+
18522+
18523+
18524+
18525+
18526+
18527+
18528+
18529+
18530+
18531+
18532+
18533+
18534+
18535+
18536+
18537+
18538+
18539+
18540+
18541+
18542+
18543+
18544+
18545+
18546+
18547+
18548+
18549+
18550+
18551+
18552+
18553+
18554+
18555+
18556+
18557+
18558+
18559+
18560+
18561+
18562+
18563+
18564+
18565+
18566+
18567+
18568+
18569+
18570+
18571+
18572+
18573+
18574+
18575+
18576+
18577+
18578+
18579+
18580+
18581+
18582+
18583+
18584+
18585+
18586+
18587+
18588+
18589+
18590+
18591+
18592+
18593+
18594+
18595+
18596+
18597+
18598+
18599+
18600+
18601+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
18602+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
18603+hardcode_action=
18604+if test -n "$hardcode_libdir_flag_spec" ||
18605+ test -n "$runpath_var" ||
18606+ test "X$hardcode_automatic" = "Xyes" ; then
18607+
18608+ # We can hardcode non-existent directories.
18609+ if test "$hardcode_direct" != no &&
18610+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
18611+ # have to relink, otherwise we might link with an installed library
18612+ # when we should be linking with a yet-to-be-installed one
18613+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
18614+ test "$hardcode_minus_L" != no; then
18615+ # Linking always hardcodes the temporary library directory.
18616+ hardcode_action=relink
18617+ else
18618+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
18619+ hardcode_action=immediate
18620+ fi
18621+else
18622+ # We cannot hardcode anything, or else we can only hardcode existing
18623+ # directories.
18624+ hardcode_action=unsupported
18625+fi
18626+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
18627+$as_echo "$hardcode_action" >&6; }
18628+
18629+if test "$hardcode_action" = relink ||
18630+ test "$inherit_rpath" = yes; then
18631+ # Fast installation is not supported
18632+ enable_fast_install=no
18633+elif test "$shlibpath_overrides_runpath" = yes ||
18634+ test "$enable_shared" = no; then
18635+ # Fast installation is not necessary
18636+ enable_fast_install=needless
18637+fi
18638+
18639+
18640+
18641+
18642+
18643+
18644+ if test "x$enable_dlopen" != xyes; then
18645+ enable_dlopen=unknown
18646+ enable_dlopen_self=unknown
18647+ enable_dlopen_self_static=unknown
18648+else
18649+ lt_cv_dlopen=no
18650+ lt_cv_dlopen_libs=
18651+
18652+ case $host_os in
18653+ beos*)
18654+ lt_cv_dlopen="load_add_on"
18655+ lt_cv_dlopen_libs=
18656+ lt_cv_dlopen_self=yes
18657+ ;;
18658+
18659+ mingw* | pw32* | cegcc*)
18660+ lt_cv_dlopen="LoadLibrary"
18661+ lt_cv_dlopen_libs=
18662+ ;;
18663+
18664+ cygwin*)
18665+ lt_cv_dlopen="dlopen"
18666+ lt_cv_dlopen_libs=
18667+ ;;
18668+
18669+ darwin*)
18670+ # if libdl is installed we need to link against it
18671+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
18672+$as_echo_n "checking for dlopen in -ldl... " >&6; }
18673+if ${ac_cv_lib_dl_dlopen+:} false; then :
18674+ $as_echo_n "(cached) " >&6
18675+else
18676+ ac_check_lib_save_LIBS=$LIBS
18677+LIBS="-ldl $LIBS"
18678+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18679+/* end confdefs.h. */
18680+
18681+/* Override any GCC internal prototype to avoid an error.
18682+ Use char because int might match the return type of a GCC
18683+ builtin and then its argument prototype would still apply. */
18684+#ifdef __cplusplus
18685+extern "C"
18686+#endif
18687+char dlopen ();
18688+int
18689+main ()
18690+{
18691+return dlopen ();
18692+ ;
18693+ return 0;
18694+}
18695+_ACEOF
18696+if ac_fn_c_try_link "$LINENO"; then :
18697+ ac_cv_lib_dl_dlopen=yes
18698+else
18699+ ac_cv_lib_dl_dlopen=no
18700+fi
18701+rm -f core conftest.err conftest.$ac_objext \
18702+ conftest$ac_exeext conftest.$ac_ext
18703+LIBS=$ac_check_lib_save_LIBS
18704+fi
18705+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
18706+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
18707+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
18708+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
18709+else
18710+
18711+ lt_cv_dlopen="dyld"
18712+ lt_cv_dlopen_libs=
18713+ lt_cv_dlopen_self=yes
18714+
18715+fi
18716+
18717+ ;;
18718+
18719+ *)
18720+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
18721+if test "x$ac_cv_func_shl_load" = xyes; then :
18722+ lt_cv_dlopen="shl_load"
18723+else
18724+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
18725+$as_echo_n "checking for shl_load in -ldld... " >&6; }
18726+if ${ac_cv_lib_dld_shl_load+:} false; then :
18727+ $as_echo_n "(cached) " >&6
18728+else
18729+ ac_check_lib_save_LIBS=$LIBS
18730+LIBS="-ldld $LIBS"
18731+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18732+/* end confdefs.h. */
18733+
18734+/* Override any GCC internal prototype to avoid an error.
18735+ Use char because int might match the return type of a GCC
18736+ builtin and then its argument prototype would still apply. */
18737+#ifdef __cplusplus
18738+extern "C"
18739+#endif
18740+char shl_load ();
18741+int
18742+main ()
18743+{
18744+return shl_load ();
18745+ ;
18746+ return 0;
18747+}
18748+_ACEOF
18749+if ac_fn_c_try_link "$LINENO"; then :
18750+ ac_cv_lib_dld_shl_load=yes
18751+else
18752+ ac_cv_lib_dld_shl_load=no
18753+fi
18754+rm -f core conftest.err conftest.$ac_objext \
18755+ conftest$ac_exeext conftest.$ac_ext
18756+LIBS=$ac_check_lib_save_LIBS
18757+fi
18758+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
18759+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
18760+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
18761+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
18762+else
18763+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
18764+if test "x$ac_cv_func_dlopen" = xyes; then :
18765+ lt_cv_dlopen="dlopen"
18766+else
18767+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
18768+$as_echo_n "checking for dlopen in -ldl... " >&6; }
18769+if ${ac_cv_lib_dl_dlopen+:} false; then :
18770+ $as_echo_n "(cached) " >&6
18771+else
18772+ ac_check_lib_save_LIBS=$LIBS
18773+LIBS="-ldl $LIBS"
18774+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18775+/* end confdefs.h. */
18776+
18777+/* Override any GCC internal prototype to avoid an error.
18778+ Use char because int might match the return type of a GCC
18779+ builtin and then its argument prototype would still apply. */
18780+#ifdef __cplusplus
18781+extern "C"
18782+#endif
18783+char dlopen ();
18784+int
18785+main ()
18786+{
18787+return dlopen ();
18788+ ;
18789+ return 0;
18790+}
18791+_ACEOF
18792+if ac_fn_c_try_link "$LINENO"; then :
18793+ ac_cv_lib_dl_dlopen=yes
18794+else
18795+ ac_cv_lib_dl_dlopen=no
18796+fi
18797+rm -f core conftest.err conftest.$ac_objext \
18798+ conftest$ac_exeext conftest.$ac_ext
18799+LIBS=$ac_check_lib_save_LIBS
18800+fi
18801+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
18802+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
18803+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
18804+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
18805+else
18806+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
18807+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
18808+if ${ac_cv_lib_svld_dlopen+:} false; then :
18809+ $as_echo_n "(cached) " >&6
18810+else
18811+ ac_check_lib_save_LIBS=$LIBS
18812+LIBS="-lsvld $LIBS"
18813+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18814+/* end confdefs.h. */
18815+
18816+/* Override any GCC internal prototype to avoid an error.
18817+ Use char because int might match the return type of a GCC
18818+ builtin and then its argument prototype would still apply. */
18819+#ifdef __cplusplus
18820+extern "C"
18821+#endif
18822+char dlopen ();
18823+int
18824+main ()
18825+{
18826+return dlopen ();
18827+ ;
18828+ return 0;
18829+}
18830+_ACEOF
18831+if ac_fn_c_try_link "$LINENO"; then :
18832+ ac_cv_lib_svld_dlopen=yes
18833+else
18834+ ac_cv_lib_svld_dlopen=no
18835+fi
18836+rm -f core conftest.err conftest.$ac_objext \
18837+ conftest$ac_exeext conftest.$ac_ext
18838+LIBS=$ac_check_lib_save_LIBS
18839+fi
18840+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
18841+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
18842+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
18843+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
18844+else
18845+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
18846+$as_echo_n "checking for dld_link in -ldld... " >&6; }
18847+if ${ac_cv_lib_dld_dld_link+:} false; then :
18848+ $as_echo_n "(cached) " >&6
18849+else
18850+ ac_check_lib_save_LIBS=$LIBS
18851+LIBS="-ldld $LIBS"
18852+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18853+/* end confdefs.h. */
18854+
18855+/* Override any GCC internal prototype to avoid an error.
18856+ Use char because int might match the return type of a GCC
18857+ builtin and then its argument prototype would still apply. */
18858+#ifdef __cplusplus
18859+extern "C"
18860+#endif
18861+char dld_link ();
18862+int
18863+main ()
18864+{
18865+return dld_link ();
18866+ ;
18867+ return 0;
18868+}
18869+_ACEOF
18870+if ac_fn_c_try_link "$LINENO"; then :
18871+ ac_cv_lib_dld_dld_link=yes
18872+else
18873+ ac_cv_lib_dld_dld_link=no
18874+fi
18875+rm -f core conftest.err conftest.$ac_objext \
18876+ conftest$ac_exeext conftest.$ac_ext
18877+LIBS=$ac_check_lib_save_LIBS
18878+fi
18879+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
18880+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
18881+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
18882+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
18883+fi
18884+
18885+
18886+fi
18887+
18888+
18889+fi
18890+
18891+
18892+fi
18893+
18894+
18895+fi
18896+
18897+
18898+fi
18899+
18900+ ;;
18901+ esac
18902+
18903+ if test "x$lt_cv_dlopen" != xno; then
18904+ enable_dlopen=yes
18905+ else
18906+ enable_dlopen=no
18907+ fi
18908+
18909+ case $lt_cv_dlopen in
18910+ dlopen)
18911+ save_CPPFLAGS="$CPPFLAGS"
18912+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
18913+
18914+ save_LDFLAGS="$LDFLAGS"
18915+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
18916+
18917+ save_LIBS="$LIBS"
18918+ LIBS="$lt_cv_dlopen_libs $LIBS"
18919+
18920+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
18921+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
18922+if ${lt_cv_dlopen_self+:} false; then :
18923+ $as_echo_n "(cached) " >&6
18924+else
18925+ if test "$cross_compiling" = yes; then :
18926+ lt_cv_dlopen_self=cross
18927+else
18928+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
18929+ lt_status=$lt_dlunknown
18930+ cat > conftest.$ac_ext <<_LT_EOF
18931+#line $LINENO "configure"
18932+#include "confdefs.h"
18933+
18934+#if HAVE_DLFCN_H
18935+#include <dlfcn.h>
18936+#endif
18937+
18938+#include <stdio.h>
18939+
18940+#ifdef RTLD_GLOBAL
18941+# define LT_DLGLOBAL RTLD_GLOBAL
18942+#else
18943+# ifdef DL_GLOBAL
18944+# define LT_DLGLOBAL DL_GLOBAL
18945+# else
18946+# define LT_DLGLOBAL 0
18947+# endif
18948+#endif
18949+
18950+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
18951+ find out it does not work in some platform. */
18952+#ifndef LT_DLLAZY_OR_NOW
18953+# ifdef RTLD_LAZY
18954+# define LT_DLLAZY_OR_NOW RTLD_LAZY
18955+# else
18956+# ifdef DL_LAZY
18957+# define LT_DLLAZY_OR_NOW DL_LAZY
18958+# else
18959+# ifdef RTLD_NOW
18960+# define LT_DLLAZY_OR_NOW RTLD_NOW
18961+# else
18962+# ifdef DL_NOW
18963+# define LT_DLLAZY_OR_NOW DL_NOW
18964+# else
18965+# define LT_DLLAZY_OR_NOW 0
18966+# endif
18967+# endif
18968+# endif
18969+# endif
18970+#endif
18971+
18972+/* When -fvisbility=hidden is used, assume the code has been annotated
18973+ correspondingly for the symbols needed. */
18974+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18975+int fnord () __attribute__((visibility("default")));
18976+#endif
18977+
18978+int fnord () { return 42; }
18979+int main ()
18980+{
18981+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18982+ int status = $lt_dlunknown;
18983+
18984+ if (self)
18985+ {
18986+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
18987+ else
18988+ {
18989+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
18990+ else puts (dlerror ());
18991+ }
18992+ /* dlclose (self); */
18993+ }
18994+ else
18995+ puts (dlerror ());
18996+
18997+ return status;
18998+}
18999+_LT_EOF
19000+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
19001+ (eval $ac_link) 2>&5
19002+ ac_status=$?
19003+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
19004+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
19005+ (./conftest; exit; ) >&5 2>/dev/null
19006+ lt_status=$?
19007+ case x$lt_status in
19008+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
19009+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
19010+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
19011+ esac
19012+ else :
19013+ # compilation failed
19014+ lt_cv_dlopen_self=no
19015+ fi
19016+fi
19017+rm -fr conftest*
19018+
19019+
19020+fi
19021+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
19022+$as_echo "$lt_cv_dlopen_self" >&6; }
19023+
19024+ if test "x$lt_cv_dlopen_self" = xyes; then
19025+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
19026+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
19027+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
19028+if ${lt_cv_dlopen_self_static+:} false; then :
19029+ $as_echo_n "(cached) " >&6
19030+else
19031+ if test "$cross_compiling" = yes; then :
19032+ lt_cv_dlopen_self_static=cross
19033+else
19034+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
19035+ lt_status=$lt_dlunknown
19036+ cat > conftest.$ac_ext <<_LT_EOF
19037+#line $LINENO "configure"
19038+#include "confdefs.h"
19039+
19040+#if HAVE_DLFCN_H
19041+#include <dlfcn.h>
19042+#endif
19043+
19044+#include <stdio.h>
19045+
19046+#ifdef RTLD_GLOBAL
19047+# define LT_DLGLOBAL RTLD_GLOBAL
19048+#else
19049+# ifdef DL_GLOBAL
19050+# define LT_DLGLOBAL DL_GLOBAL
19051+# else
19052+# define LT_DLGLOBAL 0
19053+# endif
19054+#endif
19055+
19056+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
19057+ find out it does not work in some platform. */
19058+#ifndef LT_DLLAZY_OR_NOW
19059+# ifdef RTLD_LAZY
19060+# define LT_DLLAZY_OR_NOW RTLD_LAZY
19061+# else
19062+# ifdef DL_LAZY
19063+# define LT_DLLAZY_OR_NOW DL_LAZY
19064+# else
19065+# ifdef RTLD_NOW
19066+# define LT_DLLAZY_OR_NOW RTLD_NOW
19067+# else
19068+# ifdef DL_NOW
19069+# define LT_DLLAZY_OR_NOW DL_NOW
19070+# else
19071+# define LT_DLLAZY_OR_NOW 0
19072+# endif
19073+# endif
19074+# endif
19075+# endif
19076+#endif
19077+
19078+/* When -fvisbility=hidden is used, assume the code has been annotated
19079+ correspondingly for the symbols needed. */
19080+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
19081+int fnord () __attribute__((visibility("default")));
19082+#endif
19083+
19084+int fnord () { return 42; }
19085+int main ()
19086+{
19087+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
19088+ int status = $lt_dlunknown;
19089+
19090+ if (self)
19091+ {
19092+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
19093+ else
19094+ {
19095+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
19096+ else puts (dlerror ());
19097+ }
19098+ /* dlclose (self); */
19099+ }
19100+ else
19101+ puts (dlerror ());
19102+
19103+ return status;
19104+}
19105+_LT_EOF
19106+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
19107+ (eval $ac_link) 2>&5
19108+ ac_status=$?
19109+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
19110+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
19111+ (./conftest; exit; ) >&5 2>/dev/null
19112+ lt_status=$?
19113+ case x$lt_status in
19114+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
19115+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
19116+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
19117+ esac
19118+ else :
19119+ # compilation failed
19120+ lt_cv_dlopen_self_static=no
19121+ fi
19122+fi
19123+rm -fr conftest*
19124+
19125+
19126+fi
19127+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
19128+$as_echo "$lt_cv_dlopen_self_static" >&6; }
19129+ fi
19130+
19131+ CPPFLAGS="$save_CPPFLAGS"
19132+ LDFLAGS="$save_LDFLAGS"
19133+ LIBS="$save_LIBS"
19134+ ;;
19135+ esac
19136+
19137+ case $lt_cv_dlopen_self in
19138+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
19139+ *) enable_dlopen_self=unknown ;;
19140+ esac
19141+
19142+ case $lt_cv_dlopen_self_static in
19143+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
19144+ *) enable_dlopen_self_static=unknown ;;
19145+ esac
19146+fi
19147+
19148+
19149+
19150+
19151+
19152+
19153+
19154+
19155+
19156+
19157+
19158+
19159+
19160+
19161+
19162+
19163+
19164+striplib=
19165+old_striplib=
19166+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
19167+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
19168+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
19169+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
19170+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
19171+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
19172+$as_echo "yes" >&6; }
19173+else
19174+# FIXME - insert some real tests, host_os isn't really good enough
19175+ case $host_os in
19176+ darwin*)
19177+ if test -n "$STRIP" ; then
19178+ striplib="$STRIP -x"
19179+ old_striplib="$STRIP -S"
19180+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
19181+$as_echo "yes" >&6; }
19182+ else
19183+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19184+$as_echo "no" >&6; }
19185+ fi
19186+ ;;
19187+ *)
19188+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19189+$as_echo "no" >&6; }
19190+ ;;
19191+ esac
19192+fi
19193+
19194+
19195+
19196+
19197+
19198+
19199+
19200+
19201+
19202+
19203+
19204+
19205+ # Report which library types will actually be built
19206+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
19207+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
19208+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
19209+$as_echo "$can_build_shared" >&6; }
19210+
19211+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
19212+$as_echo_n "checking whether to build shared libraries... " >&6; }
19213+ test "$can_build_shared" = "no" && enable_shared=no
19214+
19215+ # On AIX, shared libraries and static libraries use the same namespace, and
19216+ # are all built from PIC.
19217+ case $host_os in
19218+ aix3*)
19219+ test "$enable_shared" = yes && enable_static=no
19220+ if test -n "$RANLIB"; then
19221+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
19222+ postinstall_cmds='$RANLIB $lib'
19223+ fi
19224+ ;;
19225+
19226+ aix[4-9]*)
19227+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
19228+ test "$enable_shared" = yes && enable_static=no
19229+ fi
19230+ ;;
19231+ esac
19232+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
19233+$as_echo "$enable_shared" >&6; }
19234+
19235+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
19236+$as_echo_n "checking whether to build static libraries... " >&6; }
19237+ # Make sure either enable_shared or enable_static is yes.
19238+ test "$enable_shared" = yes || enable_static=yes
19239+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
19240+$as_echo "$enable_static" >&6; }
19241+
19242+
19243+
19244+
19245+fi
19246+ac_ext=c
19247+ac_cpp='$CPP $CPPFLAGS'
19248+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
19249+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
19250+ac_compiler_gnu=$ac_cv_c_compiler_gnu
19251+
19252+CC="$lt_save_CC"
19253+
19254+
19255+
19256+
19257+
19258+
19259+
19260+
19261+
19262+
19263+
19264+
19265+
19266+
19267+
19268+ ac_config_commands="$ac_config_commands libtool"
19269+
19270+
19271+
19272+
19273+# Only expand once:
19274+
19275+
19276+
19277+
19278+# Checks for header files.
19279+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
19280+$as_echo_n "checking for ANSI C header files... " >&6; }
19281+if ${ac_cv_header_stdc+:} false; then :
19282+ $as_echo_n "(cached) " >&6
19283+else
19284+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19285+/* end confdefs.h. */
19286+#include <stdlib.h>
19287+#include <stdarg.h>
19288+#include <string.h>
19289+#include <float.h>
19290+
19291+int
19292+main ()
19293+{
19294+
19295+ ;
19296+ return 0;
19297+}
19298+_ACEOF
19299+if ac_fn_c_try_compile "$LINENO"; then :
19300+ ac_cv_header_stdc=yes
19301+else
19302+ ac_cv_header_stdc=no
19303+fi
19304+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19305+
19306+if test $ac_cv_header_stdc = yes; then
19307+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
19308+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19309+/* end confdefs.h. */
19310+#include <string.h>
19311+
19312+_ACEOF
19313+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19314+ $EGREP "memchr" >/dev/null 2>&1; then :
19315+
19316+else
19317+ ac_cv_header_stdc=no
19318+fi
19319+rm -f conftest*
19320+
19321+fi
19322+
19323+if test $ac_cv_header_stdc = yes; then
19324+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
19325+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19326+/* end confdefs.h. */
19327+#include <stdlib.h>
19328+
19329+_ACEOF
19330+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19331+ $EGREP "free" >/dev/null 2>&1; then :
19332+
19333+else
19334+ ac_cv_header_stdc=no
19335+fi
19336+rm -f conftest*
19337+
19338+fi
19339+
19340+if test $ac_cv_header_stdc = yes; then
19341+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
19342+ if test "$cross_compiling" = yes; then :
19343+ :
19344+else
19345+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19346+/* end confdefs.h. */
19347+#include <ctype.h>
19348+#include <stdlib.h>
19349+#if ((' ' & 0x0FF) == 0x020)
19350+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
19351+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
19352+#else
19353+# define ISLOWER(c) \
19354+ (('a' <= (c) && (c) <= 'i') \
19355+ || ('j' <= (c) && (c) <= 'r') \
19356+ || ('s' <= (c) && (c) <= 'z'))
19357+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
19358+#endif
19359+
19360+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
19361+int
19362+main ()
19363+{
19364+ int i;
19365+ for (i = 0; i < 256; i++)
19366+ if (XOR (islower (i), ISLOWER (i))
19367+ || toupper (i) != TOUPPER (i))
19368+ return 2;
19369+ return 0;
19370+}
19371+_ACEOF
19372+if ac_fn_c_try_run "$LINENO"; then :
19373+
19374+else
19375+ ac_cv_header_stdc=no
19376+fi
19377+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19378+ conftest.$ac_objext conftest.beam conftest.$ac_ext
19379+fi
19380+
19381+fi
19382+fi
19383+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
19384+$as_echo "$ac_cv_header_stdc" >&6; }
19385+if test $ac_cv_header_stdc = yes; then
19386+
19387+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
19388+
19389+fi
19390+
19391+for ac_header in ctype.h limits.h stdlib.h wctype.h
19392+do :
19393+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
19394+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
19395+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
19396+ cat >>confdefs.h <<_ACEOF
19397+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
19398+_ACEOF
19399+
19400+fi
19401+
19402+done
19403+
19404+
19405+# Checks for typedefs, structures, and compiler characteristics.
19406+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
19407+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
19408+if ${ac_cv_c_const+:} false; then :
19409+ $as_echo_n "(cached) " >&6
19410+else
19411+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19412+/* end confdefs.h. */
19413+
19414+int
19415+main ()
19416+{
19417+/* FIXME: Include the comments suggested by Paul. */
19418+#ifndef __cplusplus
19419+ /* Ultrix mips cc rejects this. */
19420+ typedef int charset[2];
19421+ const charset cs;
19422+ /* SunOS 4.1.1 cc rejects this. */
19423+ char const *const *pcpcc;
19424+ char **ppc;
19425+ /* NEC SVR4.0.2 mips cc rejects this. */
19426+ struct point {int x, y;};
19427+ static struct point const zero = {0,0};
19428+ /* AIX XL C 1.02.0.0 rejects this.
19429+ It does not let you subtract one const X* pointer from another in
19430+ an arm of an if-expression whose if-part is not a constant
19431+ expression */
19432+ const char *g = "string";
19433+ pcpcc = &g + (g ? g-g : 0);
19434+ /* HPUX 7.0 cc rejects these. */
19435+ ++pcpcc;
19436+ ppc = (char**) pcpcc;
19437+ pcpcc = (char const *const *) ppc;
19438+ { /* SCO 3.2v4 cc rejects this. */
19439+ char *t;
19440+ char const *s = 0 ? (char *) 0 : (char const *) 0;
19441+
19442+ *t++ = 0;
19443+ if (s) return 0;
19444+ }
19445+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
19446+ int x[] = {25, 17};
19447+ const int *foo = &x[0];
19448+ ++foo;
19449+ }
19450+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
19451+ typedef const int *iptr;
19452+ iptr p = 0;
19453+ ++p;
19454+ }
19455+ { /* AIX XL C 1.02.0.0 rejects this saying
19456+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
19457+ struct s { int j; const int *ap[3]; };
19458+ struct s *b; b->j = 5;
19459+ }
19460+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
19461+ const int foo = 10;
19462+ if (!foo) return 0;
19463+ }
19464+ return !cs[0] && !zero.x;
19465+#endif
19466+
19467+ ;
19468+ return 0;
19469+}
19470+_ACEOF
19471+if ac_fn_c_try_compile "$LINENO"; then :
19472+ ac_cv_c_const=yes
19473+else
19474+ ac_cv_c_const=no
19475+fi
19476+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19477+fi
19478+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
19479+$as_echo "$ac_cv_c_const" >&6; }
19480+if test $ac_cv_c_const = no; then
19481+
19482+$as_echo "#define const /**/" >>confdefs.h
19483+
19484+fi
19485+
19486+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
19487+$as_echo_n "checking for inline... " >&6; }
19488+if ${ac_cv_c_inline+:} false; then :
19489+ $as_echo_n "(cached) " >&6
19490+else
19491+ ac_cv_c_inline=no
19492+for ac_kw in inline __inline__ __inline; do
19493+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19494+/* end confdefs.h. */
19495+#ifndef __cplusplus
19496+typedef int foo_t;
19497+static $ac_kw foo_t static_foo () {return 0; }
19498+$ac_kw foo_t foo () {return 0; }
19499+#endif
19500+
19501+_ACEOF
19502+if ac_fn_c_try_compile "$LINENO"; then :
19503+ ac_cv_c_inline=$ac_kw
19504+fi
19505+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19506+ test "$ac_cv_c_inline" != no && break
19507+done
19508+
19509+fi
19510+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
19511+$as_echo "$ac_cv_c_inline" >&6; }
19512+
19513+case $ac_cv_c_inline in
19514+ inline | yes) ;;
19515+ *)
19516+ case $ac_cv_c_inline in
19517+ no) ac_val=;;
19518+ *) ac_val=$ac_cv_c_inline;;
19519+ esac
19520+ cat >>confdefs.h <<_ACEOF
19521+#ifndef __cplusplus
19522+#define inline $ac_val
19523+#endif
19524+_ACEOF
19525+ ;;
19526+esac
19527+
19528+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
19529+if test "x$ac_cv_type_mode_t" = xyes; then :
19530+
19531+else
19532+
19533+cat >>confdefs.h <<_ACEOF
19534+#define mode_t int
19535+_ACEOF
19536+
19537+fi
19538+
19539+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
19540+if test "x$ac_cv_type_off_t" = xyes; then :
19541+
19542+else
19543+
19544+cat >>confdefs.h <<_ACEOF
19545+#define off_t long int
19546+_ACEOF
19547+
19548+fi
19549+
19550+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
19551+if test "x$ac_cv_type_size_t" = xyes; then :
19552+
19553+else
19554+
19555+cat >>confdefs.h <<_ACEOF
19556+#define size_t unsigned int
19557+_ACEOF
19558+
19559+fi
19560+
19561+# The cast to long int works around a bug in the HP C Compiler
19562+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
19563+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
19564+# This bug is HP SR number 8606223364.
19565+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
19566+$as_echo_n "checking size of off_t... " >&6; }
19567+if ${ac_cv_sizeof_off_t+:} false; then :
19568+ $as_echo_n "(cached) " >&6
19569+else
19570+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
19571+
19572+else
19573+ if test "$ac_cv_type_off_t" = yes; then
19574+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
19575+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
19576+as_fn_error 77 "cannot compute sizeof (off_t)
19577+See \`config.log' for more details" "$LINENO" 5; }
19578+ else
19579+ ac_cv_sizeof_off_t=0
19580+ fi
19581+fi
19582+
19583+fi
19584+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
19585+$as_echo "$ac_cv_sizeof_off_t" >&6; }
19586+
19587+
19588+
19589+cat >>confdefs.h <<_ACEOF
19590+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
19591+_ACEOF
19592+
19593+
19594+for ac_func in tolower towlower
19595+do :
19596+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
19597+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
19598+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
19599+ cat >>confdefs.h <<_ACEOF
19600+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
19601+_ACEOF
19602+
19603+fi
19604+done
19605+
19606+
19607+# largefile support
19608+# Check whether --enable-largefile was given.
19609+if test "${enable_largefile+set}" = set; then :
19610+ enableval=$enable_largefile;
19611+fi
19612+
19613+if test "$enable_largefile" != no; then
19614+
19615+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
19616+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
19617+if ${ac_cv_sys_largefile_CC+:} false; then :
19618+ $as_echo_n "(cached) " >&6
19619+else
19620+ ac_cv_sys_largefile_CC=no
19621+ if test "$GCC" != yes; then
19622+ ac_save_CC=$CC
19623+ while :; do
19624+ # IRIX 6.2 and later do not support large files by default,
19625+ # so use the C compiler's -n32 option if that helps.
19626+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19627+/* end confdefs.h. */
19628+#include <sys/types.h>
19629+ /* Check that off_t can represent 2**63 - 1 correctly.
19630+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
19631+ since some C++ compilers masquerading as C compilers
19632+ incorrectly reject 9223372036854775807. */
19633+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
19634+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
19635+ && LARGE_OFF_T % 2147483647 == 1)
19636+ ? 1 : -1];
19637+int
19638+main ()
19639+{
19640+
19641+ ;
19642+ return 0;
19643+}
19644+_ACEOF
19645+ if ac_fn_c_try_compile "$LINENO"; then :
19646+ break
19647+fi
19648+rm -f core conftest.err conftest.$ac_objext
19649+ CC="$CC -n32"
19650+ if ac_fn_c_try_compile "$LINENO"; then :
19651+ ac_cv_sys_largefile_CC=' -n32'; break
19652+fi
19653+rm -f core conftest.err conftest.$ac_objext
19654+ break
19655+ done
19656+ CC=$ac_save_CC
19657+ rm -f conftest.$ac_ext
19658+ fi
19659+fi
19660+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
19661+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
19662+ if test "$ac_cv_sys_largefile_CC" != no; then
19663+ CC=$CC$ac_cv_sys_largefile_CC
19664+ fi
19665+
19666+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
19667+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
19668+if ${ac_cv_sys_file_offset_bits+:} false; then :
19669+ $as_echo_n "(cached) " >&6
19670+else
19671+ while :; do
19672+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19673+/* end confdefs.h. */
19674+#include <sys/types.h>
19675+ /* Check that off_t can represent 2**63 - 1 correctly.
19676+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
19677+ since some C++ compilers masquerading as C compilers
19678+ incorrectly reject 9223372036854775807. */
19679+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
19680+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
19681+ && LARGE_OFF_T % 2147483647 == 1)
19682+ ? 1 : -1];
19683+int
19684+main ()
19685+{
19686+
19687+ ;
19688+ return 0;
19689+}
19690+_ACEOF
19691+if ac_fn_c_try_compile "$LINENO"; then :
19692+ ac_cv_sys_file_offset_bits=no; break
19693+fi
19694+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19695+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19696+/* end confdefs.h. */
19697+#define _FILE_OFFSET_BITS 64
19698+#include <sys/types.h>
19699+ /* Check that off_t can represent 2**63 - 1 correctly.
19700+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
19701+ since some C++ compilers masquerading as C compilers
19702+ incorrectly reject 9223372036854775807. */
19703+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
19704+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
19705+ && LARGE_OFF_T % 2147483647 == 1)
19706+ ? 1 : -1];
19707+int
19708+main ()
19709+{
19710+
19711+ ;
19712+ return 0;
19713+}
19714+_ACEOF
19715+if ac_fn_c_try_compile "$LINENO"; then :
19716+ ac_cv_sys_file_offset_bits=64; break
19717+fi
19718+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19719+ ac_cv_sys_file_offset_bits=unknown
19720+ break
19721+done
19722+fi
19723+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
19724+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
19725+case $ac_cv_sys_file_offset_bits in #(
19726+ no | unknown) ;;
19727+ *)
19728+cat >>confdefs.h <<_ACEOF
19729+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
19730+_ACEOF
19731+;;
19732+esac
19733+rm -rf conftest*
19734+ if test $ac_cv_sys_file_offset_bits = unknown; then
19735+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
19736+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
19737+if ${ac_cv_sys_large_files+:} false; then :
19738+ $as_echo_n "(cached) " >&6
19739+else
19740+ while :; do
19741+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19742+/* end confdefs.h. */
19743+#include <sys/types.h>
19744+ /* Check that off_t can represent 2**63 - 1 correctly.
19745+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
19746+ since some C++ compilers masquerading as C compilers
19747+ incorrectly reject 9223372036854775807. */
19748+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
19749+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
19750+ && LARGE_OFF_T % 2147483647 == 1)
19751+ ? 1 : -1];
19752+int
19753+main ()
19754+{
19755+
19756+ ;
19757+ return 0;
19758+}
19759+_ACEOF
19760+if ac_fn_c_try_compile "$LINENO"; then :
19761+ ac_cv_sys_large_files=no; break
19762+fi
19763+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19764+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19765+/* end confdefs.h. */
19766+#define _LARGE_FILES 1
19767+#include <sys/types.h>
19768+ /* Check that off_t can represent 2**63 - 1 correctly.
19769+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
19770+ since some C++ compilers masquerading as C compilers
19771+ incorrectly reject 9223372036854775807. */
19772+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
19773+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
19774+ && LARGE_OFF_T % 2147483647 == 1)
19775+ ? 1 : -1];
19776+int
19777+main ()
19778+{
19779+
19780+ ;
19781+ return 0;
19782+}
19783+_ACEOF
19784+if ac_fn_c_try_compile "$LINENO"; then :
19785+ ac_cv_sys_large_files=1; break
19786+fi
19787+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19788+ ac_cv_sys_large_files=unknown
19789+ break
19790+done
19791+fi
19792+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
19793+$as_echo "$ac_cv_sys_large_files" >&6; }
19794+case $ac_cv_sys_large_files in #(
19795+ no | unknown) ;;
19796+ *)
19797+cat >>confdefs.h <<_ACEOF
19798+#define _LARGE_FILES $ac_cv_sys_large_files
19799+_ACEOF
19800+;;
19801+esac
19802+rm -rf conftest*
19803+ fi
19804+fi
19805+
19806+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
19807+$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
19808+if ${ac_cv_sys_largefile_source+:} false; then :
19809+ $as_echo_n "(cached) " >&6
19810+else
19811+ while :; do
19812+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19813+/* end confdefs.h. */
19814+#include <sys/types.h> /* for off_t */
19815+ #include <stdio.h>
19816+int
19817+main ()
19818+{
19819+int (*fp) (FILE *, off_t, int) = fseeko;
19820+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
19821+ ;
19822+ return 0;
19823+}
19824+_ACEOF
19825+if ac_fn_c_try_link "$LINENO"; then :
19826+ ac_cv_sys_largefile_source=no; break
19827+fi
19828+rm -f core conftest.err conftest.$ac_objext \
19829+ conftest$ac_exeext conftest.$ac_ext
19830+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19831+/* end confdefs.h. */
19832+#define _LARGEFILE_SOURCE 1
19833+#include <sys/types.h> /* for off_t */
19834+ #include <stdio.h>
19835+int
19836+main ()
19837+{
19838+int (*fp) (FILE *, off_t, int) = fseeko;
19839+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
19840+ ;
19841+ return 0;
19842+}
19843+_ACEOF
19844+if ac_fn_c_try_link "$LINENO"; then :
19845+ ac_cv_sys_largefile_source=1; break
19846+fi
19847+rm -f core conftest.err conftest.$ac_objext \
19848+ conftest$ac_exeext conftest.$ac_ext
19849+ ac_cv_sys_largefile_source=unknown
19850+ break
19851+done
19852+fi
19853+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
19854+$as_echo "$ac_cv_sys_largefile_source" >&6; }
19855+case $ac_cv_sys_largefile_source in #(
19856+ no | unknown) ;;
19857+ *)
19858+cat >>confdefs.h <<_ACEOF
19859+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
19860+_ACEOF
19861+;;
19862+esac
19863+rm -rf conftest*
19864+
19865+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
19866+# in glibc 2.1.3, but that breaks too many other things.
19867+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
19868+if test $ac_cv_sys_largefile_source != unknown; then
19869+
19870+$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
19871+
19872+fi
19873+
19874+
19875+# Checks for library functions.
19876+ac_config_files="$ac_config_files Makefile doc/Makefile doc/Doxyfile libmspack.pc"
19877+
19878+cat >confcache <<\_ACEOF
19879+# This file is a shell script that caches the results of configure
19880+# tests run on this system so they can be shared between configure
19881+# scripts and configure runs, see configure's option --config-cache.
19882+# It is not useful on other systems. If it contains results you don't
19883+# want to keep, you may remove or edit it.
19884+#
19885+# config.status only pays attention to the cache file if you give it
19886+# the --recheck option to rerun configure.
19887+#
19888+# `ac_cv_env_foo' variables (set or unset) will be overridden when
19889+# loading this file, other *unset* `ac_cv_foo' will be assigned the
19890+# following values.
19891+
19892+_ACEOF
19893+
19894+# The following way of writing the cache mishandles newlines in values,
19895+# but we know of no workaround that is simple, portable, and efficient.
19896+# So, we kill variables containing newlines.
19897+# Ultrix sh set writes to stderr and can't be redirected directly,
19898+# and sets the high bit in the cache file unless we assign to the vars.
19899+(
19900+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
19901+ eval ac_val=\$$ac_var
19902+ case $ac_val in #(
19903+ *${as_nl}*)
19904+ case $ac_var in #(
19905+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
19906+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
19907+ esac
19908+ case $ac_var in #(
19909+ _ | IFS | as_nl) ;; #(
19910+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
19911+ *) { eval $ac_var=; unset $ac_var;} ;;
19912+ esac ;;
19913+ esac
19914+ done
19915+
19916+ (set) 2>&1 |
19917+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
19918+ *${as_nl}ac_space=\ *)
19919+ # `set' does not quote correctly, so add quotes: double-quote
19920+ # substitution turns \\\\ into \\, and sed turns \\ into \.
19921+ sed -n \
19922+ "s/'/'\\\\''/g;
19923+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19924+ ;; #(
19925+ *)
19926+ # `set' quotes correctly as required by POSIX, so do not add quotes.
19927+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
19928+ ;;
19929+ esac |
19930+ sort
19931+) |
19932+ sed '
19933+ /^ac_cv_env_/b end
19934+ t clear
19935+ :clear
19936+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
19937+ t end
19938+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19939+ :end' >>confcache
19940+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
19941+ if test -w "$cache_file"; then
19942+ if test "x$cache_file" != "x/dev/null"; then
19943+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
19944+$as_echo "$as_me: updating cache $cache_file" >&6;}
19945+ if test ! -f "$cache_file" || test -h "$cache_file"; then
19946+ cat confcache >"$cache_file"
19947+ else
19948+ case $cache_file in #(
19949+ */* | ?:*)
19950+ mv -f confcache "$cache_file"$$ &&
19951+ mv -f "$cache_file"$$ "$cache_file" ;; #(
19952+ *)
19953+ mv -f confcache "$cache_file" ;;
19954+ esac
19955+ fi
19956+ fi
19957+ else
19958+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
19959+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
19960+ fi
19961+fi
19962+rm -f confcache
19963+
19964+test "x$prefix" = xNONE && prefix=$ac_default_prefix
19965+# Let make expand exec_prefix.
19966+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19967+
19968+DEFS=-DHAVE_CONFIG_H
19969+
19970+ac_libobjs=
19971+ac_ltlibobjs=
19972+U=
19973+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
19974+ # 1. Remove the extension, and $U if already installed.
19975+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
19976+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
19977+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
19978+ # will be set to the directory where LIBOBJS objects are built.
19979+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
19980+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
19981+done
19982+LIBOBJS=$ac_libobjs
19983+
19984+LTLIBOBJS=$ac_ltlibobjs
19985+
19986+
19987+ if test -n "$EXEEXT"; then
19988+ am__EXEEXT_TRUE=
19989+ am__EXEEXT_FALSE='#'
19990+else
19991+ am__EXEEXT_TRUE='#'
19992+ am__EXEEXT_FALSE=
19993+fi
19994+
19995+if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then
19996+ as_fn_error $? "conditional \"DEBUG\" was never defined.
19997+Usually this means the macro was only invoked conditionally." "$LINENO" 5
19998+fi
19999+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
20000+ as_fn_error $? "conditional \"AMDEP\" was never defined.
20001+Usually this means the macro was only invoked conditionally." "$LINENO" 5
20002+fi
20003+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
20004+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
20005+Usually this means the macro was only invoked conditionally." "$LINENO" 5
20006+fi
20007+if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then
20008+ as_fn_error $? "conditional \"GCC\" was never defined.
20009+Usually this means the macro was only invoked conditionally." "$LINENO" 5
20010+fi
20011+
20012+: "${CONFIG_STATUS=./config.status}"
20013+ac_write_fail=0
20014+ac_clean_files_save=$ac_clean_files
20015+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20016+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
20017+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
20018+as_write_fail=0
20019+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
20020+#! $SHELL
20021+# Generated by $as_me.
20022+# Run this file to recreate the current configuration.
20023+# Compiler output produced by configure, useful for debugging
20024+# configure, is in config.log if it exists.
20025+
20026+debug=false
20027+ac_cs_recheck=false
20028+ac_cs_silent=false
20029+
20030+SHELL=\${CONFIG_SHELL-$SHELL}
20031+export SHELL
20032+_ASEOF
20033+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
20034+## -------------------- ##
20035+## M4sh Initialization. ##
20036+## -------------------- ##
20037+
20038+# Be more Bourne compatible
20039+DUALCASE=1; export DUALCASE # for MKS sh
20040+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
20041+ emulate sh
20042+ NULLCMD=:
20043+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
20044+ # is contrary to our usage. Disable this feature.
20045+ alias -g '${1+"$@"}'='"$@"'
20046+ setopt NO_GLOB_SUBST
20047+else
20048+ case `(set -o) 2>/dev/null` in #(
20049+ *posix*) :
20050+ set -o posix ;; #(
20051+ *) :
20052+ ;;
20053+esac
20054+fi
20055+
20056+
20057+as_nl='
20058+'
20059+export as_nl
20060+# Printing a long string crashes Solaris 7 /usr/bin/printf.
20061+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
20062+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
20063+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
20064+# Prefer a ksh shell builtin over an external printf program on Solaris,
20065+# but without wasting forks for bash or zsh.
20066+if test -z "$BASH_VERSION$ZSH_VERSION" \
20067+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
20068+ as_echo='print -r --'
20069+ as_echo_n='print -rn --'
20070+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
20071+ as_echo='printf %s\n'
20072+ as_echo_n='printf %s'
20073+else
20074+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
20075+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
20076+ as_echo_n='/usr/ucb/echo -n'
20077+ else
20078+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
20079+ as_echo_n_body='eval
20080+ arg=$1;
20081+ case $arg in #(
20082+ *"$as_nl"*)
20083+ expr "X$arg" : "X\\(.*\\)$as_nl";
20084+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
20085+ esac;
20086+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
20087+ '
20088+ export as_echo_n_body
20089+ as_echo_n='sh -c $as_echo_n_body as_echo'
20090+ fi
20091+ export as_echo_body
20092+ as_echo='sh -c $as_echo_body as_echo'
20093+fi
20094+
20095+# The user is always right.
20096+if test "${PATH_SEPARATOR+set}" != set; then
20097+ PATH_SEPARATOR=:
20098+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
20099+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
20100+ PATH_SEPARATOR=';'
20101+ }
20102+fi
20103+
20104+
20105+# IFS
20106+# We need space, tab and new line, in precisely that order. Quoting is
20107+# there to prevent editors from complaining about space-tab.
20108+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
20109+# splitting by setting IFS to empty value.)
20110+IFS=" "" $as_nl"
20111+
20112+# Find who we are. Look in the path if we contain no directory separator.
20113+as_myself=
20114+case $0 in #((
20115+ *[\\/]* ) as_myself=$0 ;;
20116+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
20117+for as_dir in $PATH
20118+do
20119+ IFS=$as_save_IFS
20120+ test -z "$as_dir" && as_dir=.
20121+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
20122+ done
20123+IFS=$as_save_IFS
20124+
20125+ ;;
20126+esac
20127+# We did not find ourselves, most probably we were run as `sh COMMAND'
20128+# in which case we are not to be found in the path.
20129+if test "x$as_myself" = x; then
20130+ as_myself=$0
20131+fi
20132+if test ! -f "$as_myself"; then
20133+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
20134+ exit 1
20135+fi
20136+
20137+# Unset variables that we do not need and which cause bugs (e.g. in
20138+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
20139+# suppresses any "Segmentation fault" message there. '((' could
20140+# trigger a bug in pdksh 5.2.14.
20141+for as_var in BASH_ENV ENV MAIL MAILPATH
20142+do eval test x\${$as_var+set} = xset \
20143+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
20144+done
20145+PS1='$ '
20146+PS2='> '
20147+PS4='+ '
20148+
20149+# NLS nuisances.
20150+LC_ALL=C
20151+export LC_ALL
20152+LANGUAGE=C
20153+export LANGUAGE
20154+
20155+# CDPATH.
20156+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
20157+
20158+
20159+# as_fn_error STATUS ERROR [LINENO LOG_FD]
20160+# ----------------------------------------
20161+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
20162+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
20163+# script with STATUS, using 1 if that was 0.
20164+as_fn_error ()
20165+{
20166+ as_status=$1; test $as_status -eq 0 && as_status=1
20167+ if test "$4"; then
20168+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
20169+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
20170+ fi
20171+ $as_echo "$as_me: error: $2" >&2
20172+ as_fn_exit $as_status
20173+} # as_fn_error
20174+
20175+
20176+# as_fn_set_status STATUS
20177+# -----------------------
20178+# Set $? to STATUS, without forking.
20179+as_fn_set_status ()
20180+{
20181+ return $1
20182+} # as_fn_set_status
20183+
20184+# as_fn_exit STATUS
20185+# -----------------
20186+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
20187+as_fn_exit ()
20188+{
20189+ set +e
20190+ as_fn_set_status $1
20191+ exit $1
20192+} # as_fn_exit
20193+
20194+# as_fn_unset VAR
20195+# ---------------
20196+# Portably unset VAR.
20197+as_fn_unset ()
20198+{
20199+ { eval $1=; unset $1;}
20200+}
20201+as_unset=as_fn_unset
20202+# as_fn_append VAR VALUE
20203+# ----------------------
20204+# Append the text in VALUE to the end of the definition contained in VAR. Take
20205+# advantage of any shell optimizations that allow amortized linear growth over
20206+# repeated appends, instead of the typical quadratic growth present in naive
20207+# implementations.
20208+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
20209+ eval 'as_fn_append ()
20210+ {
20211+ eval $1+=\$2
20212+ }'
20213+else
20214+ as_fn_append ()
20215+ {
20216+ eval $1=\$$1\$2
20217+ }
20218+fi # as_fn_append
20219+
20220+# as_fn_arith ARG...
20221+# ------------------
20222+# Perform arithmetic evaluation on the ARGs, and store the result in the
20223+# global $as_val. Take advantage of shells that can avoid forks. The arguments
20224+# must be portable across $(()) and expr.
20225+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
20226+ eval 'as_fn_arith ()
20227+ {
20228+ as_val=$(( $* ))
20229+ }'
20230+else
20231+ as_fn_arith ()
20232+ {
20233+ as_val=`expr "$@" || test $? -eq 1`
20234+ }
20235+fi # as_fn_arith
20236+
20237+
20238+if expr a : '\(a\)' >/dev/null 2>&1 &&
20239+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
20240+ as_expr=expr
20241+else
20242+ as_expr=false
20243+fi
20244+
20245+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
20246+ as_basename=basename
20247+else
20248+ as_basename=false
20249+fi
20250+
20251+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
20252+ as_dirname=dirname
20253+else
20254+ as_dirname=false
20255+fi
20256+
20257+as_me=`$as_basename -- "$0" ||
20258+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
20259+ X"$0" : 'X\(//\)$' \| \
20260+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
20261+$as_echo X/"$0" |
20262+ sed '/^.*\/\([^/][^/]*\)\/*$/{
20263+ s//\1/
20264+ q
20265+ }
20266+ /^X\/\(\/\/\)$/{
20267+ s//\1/
20268+ q
20269+ }
20270+ /^X\/\(\/\).*/{
20271+ s//\1/
20272+ q
20273+ }
20274+ s/.*/./; q'`
20275+
20276+# Avoid depending upon Character Ranges.
20277+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
20278+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
20279+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
20280+as_cr_digits='0123456789'
20281+as_cr_alnum=$as_cr_Letters$as_cr_digits
20282+
20283+ECHO_C= ECHO_N= ECHO_T=
20284+case `echo -n x` in #(((((
20285+-n*)
20286+ case `echo 'xy\c'` in
20287+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
20288+ xy) ECHO_C='\c';;
20289+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
20290+ ECHO_T=' ';;
20291+ esac;;
20292+*)
20293+ ECHO_N='-n';;
20294+esac
20295+
20296+rm -f conf$$ conf$$.exe conf$$.file
20297+if test -d conf$$.dir; then
20298+ rm -f conf$$.dir/conf$$.file
20299+else
20300+ rm -f conf$$.dir
20301+ mkdir conf$$.dir 2>/dev/null
20302+fi
20303+if (echo >conf$$.file) 2>/dev/null; then
20304+ if ln -s conf$$.file conf$$ 2>/dev/null; then
20305+ as_ln_s='ln -s'
20306+ # ... but there are two gotchas:
20307+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
20308+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
20309+ # In both cases, we have to default to `cp -p'.
20310+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
20311+ as_ln_s='cp -p'
20312+ elif ln conf$$.file conf$$ 2>/dev/null; then
20313+ as_ln_s=ln
20314+ else
20315+ as_ln_s='cp -p'
20316+ fi
20317+else
20318+ as_ln_s='cp -p'
20319+fi
20320+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
20321+rmdir conf$$.dir 2>/dev/null
20322+
20323+
20324+# as_fn_mkdir_p
20325+# -------------
20326+# Create "$as_dir" as a directory, including parents if necessary.
20327+as_fn_mkdir_p ()
20328+{
20329+
20330+ case $as_dir in #(
20331+ -*) as_dir=./$as_dir;;
20332+ esac
20333+ test -d "$as_dir" || eval $as_mkdir_p || {
20334+ as_dirs=
20335+ while :; do
20336+ case $as_dir in #(
20337+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
20338+ *) as_qdir=$as_dir;;
20339+ esac
20340+ as_dirs="'$as_qdir' $as_dirs"
20341+ as_dir=`$as_dirname -- "$as_dir" ||
20342+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20343+ X"$as_dir" : 'X\(//\)[^/]' \| \
20344+ X"$as_dir" : 'X\(//\)$' \| \
20345+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
20346+$as_echo X"$as_dir" |
20347+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
20348+ s//\1/
20349+ q
20350+ }
20351+ /^X\(\/\/\)[^/].*/{
20352+ s//\1/
20353+ q
20354+ }
20355+ /^X\(\/\/\)$/{
20356+ s//\1/
20357+ q
20358+ }
20359+ /^X\(\/\).*/{
20360+ s//\1/
20361+ q
20362+ }
20363+ s/.*/./; q'`
20364+ test -d "$as_dir" && break
20365+ done
20366+ test -z "$as_dirs" || eval "mkdir $as_dirs"
20367+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
20368+
20369+
20370+} # as_fn_mkdir_p
20371+if mkdir -p . 2>/dev/null; then
20372+ as_mkdir_p='mkdir -p "$as_dir"'
20373+else
20374+ test -d ./-p && rmdir ./-p
20375+ as_mkdir_p=false
20376+fi
20377+
20378+if test -x / >/dev/null 2>&1; then
20379+ as_test_x='test -x'
20380+else
20381+ if ls -dL / >/dev/null 2>&1; then
20382+ as_ls_L_option=L
20383+ else
20384+ as_ls_L_option=
20385+ fi
20386+ as_test_x='
20387+ eval sh -c '\''
20388+ if test -d "$1"; then
20389+ test -d "$1/.";
20390+ else
20391+ case $1 in #(
20392+ -*)set "./$1";;
20393+ esac;
20394+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
20395+ ???[sx]*):;;*)false;;esac;fi
20396+ '\'' sh
20397+ '
20398+fi
20399+as_executable_p=$as_test_x
20400+
20401+# Sed expression to map a string onto a valid CPP name.
20402+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
20403+
20404+# Sed expression to map a string onto a valid variable name.
20405+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
20406+
20407+
20408+exec 6>&1
20409+## ----------------------------------- ##
20410+## Main body of $CONFIG_STATUS script. ##
20411+## ----------------------------------- ##
20412+_ASEOF
20413+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
20414+
20415+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20416+# Save the log message, to keep $0 and so on meaningful, and to
20417+# report actual input values of CONFIG_FILES etc. instead of their
20418+# values after options handling.
20419+ac_log="
20420+This file was extended by libmspack $as_me 0.4alpha, which was
20421+generated by GNU Autoconf 2.68. Invocation command line was
20422+
20423+ CONFIG_FILES = $CONFIG_FILES
20424+ CONFIG_HEADERS = $CONFIG_HEADERS
20425+ CONFIG_LINKS = $CONFIG_LINKS
20426+ CONFIG_COMMANDS = $CONFIG_COMMANDS
20427+ $ $0 $@
20428+
20429+on `(hostname || uname -n) 2>/dev/null | sed 1q`
20430+"
20431+
20432+_ACEOF
20433+
20434+case $ac_config_files in *"
20435+"*) set x $ac_config_files; shift; ac_config_files=$*;;
20436+esac
20437+
20438+case $ac_config_headers in *"
20439+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
20440+esac
20441+
20442+
20443+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20444+# Files that config.status was made for.
20445+config_files="$ac_config_files"
20446+config_headers="$ac_config_headers"
20447+config_commands="$ac_config_commands"
20448+
20449+_ACEOF
20450+
20451+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20452+ac_cs_usage="\
20453+\`$as_me' instantiates files and other configuration actions
20454+from templates according to the current configuration. Unless the files
20455+and actions are specified as TAGs, all are instantiated by default.
20456+
20457+Usage: $0 [OPTION]... [TAG]...
20458+
20459+ -h, --help print this help, then exit
20460+ -V, --version print version number and configuration settings, then exit
20461+ --config print configuration, then exit
20462+ -q, --quiet, --silent
20463+ do not print progress messages
20464+ -d, --debug don't remove temporary files
20465+ --recheck update $as_me by reconfiguring in the same conditions
20466+ --file=FILE[:TEMPLATE]
20467+ instantiate the configuration file FILE
20468+ --header=FILE[:TEMPLATE]
20469+ instantiate the configuration header FILE
20470+
20471+Configuration files:
20472+$config_files
20473+
20474+Configuration headers:
20475+$config_headers
20476+
20477+Configuration commands:
20478+$config_commands
20479+
20480+Report bugs to <kyzer@4u.net>."
20481+
20482+_ACEOF
20483+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20484+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
20485+ac_cs_version="\\
20486+libmspack config.status 0.4alpha
20487+configured by $0, generated by GNU Autoconf 2.68,
20488+ with options \\"\$ac_cs_config\\"
20489+
20490+Copyright (C) 2010 Free Software Foundation, Inc.
20491+This config.status script is free software; the Free Software Foundation
20492+gives unlimited permission to copy, distribute and modify it."
20493+
20494+ac_pwd='$ac_pwd'
20495+srcdir='$srcdir'
20496+INSTALL='$INSTALL'
20497+MKDIR_P='$MKDIR_P'
20498+AWK='$AWK'
20499+test -n "\$AWK" || AWK=awk
20500+_ACEOF
20501+
20502+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20503+# The default lists apply if the user does not specify any file.
20504+ac_need_defaults=:
20505+while test $# != 0
20506+do
20507+ case $1 in
20508+ --*=?*)
20509+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
20510+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
20511+ ac_shift=:
20512+ ;;
20513+ --*=)
20514+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
20515+ ac_optarg=
20516+ ac_shift=:
20517+ ;;
20518+ *)
20519+ ac_option=$1
20520+ ac_optarg=$2
20521+ ac_shift=shift
20522+ ;;
20523+ esac
20524+
20525+ case $ac_option in
20526+ # Handling of the options.
20527+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
20528+ ac_cs_recheck=: ;;
20529+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
20530+ $as_echo "$ac_cs_version"; exit ;;
20531+ --config | --confi | --conf | --con | --co | --c )
20532+ $as_echo "$ac_cs_config"; exit ;;
20533+ --debug | --debu | --deb | --de | --d | -d )
20534+ debug=: ;;
20535+ --file | --fil | --fi | --f )
20536+ $ac_shift
20537+ case $ac_optarg in
20538+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
20539+ '') as_fn_error $? "missing file argument" ;;
20540+ esac
20541+ as_fn_append CONFIG_FILES " '$ac_optarg'"
20542+ ac_need_defaults=false;;
20543+ --header | --heade | --head | --hea )
20544+ $ac_shift
20545+ case $ac_optarg in
20546+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
20547+ esac
20548+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
20549+ ac_need_defaults=false;;
20550+ --he | --h)
20551+ # Conflict between --help and --header
20552+ as_fn_error $? "ambiguous option: \`$1'
20553+Try \`$0 --help' for more information.";;
20554+ --help | --hel | -h )
20555+ $as_echo "$ac_cs_usage"; exit ;;
20556+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
20557+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
20558+ ac_cs_silent=: ;;
20559+
20560+ # This is an error.
20561+ -*) as_fn_error $? "unrecognized option: \`$1'
20562+Try \`$0 --help' for more information." ;;
20563+
20564+ *) as_fn_append ac_config_targets " $1"
20565+ ac_need_defaults=false ;;
20566+
20567+ esac
20568+ shift
20569+done
20570+
20571+ac_configure_extra_args=
20572+
20573+if $ac_cs_silent; then
20574+ exec 6>/dev/null
20575+ ac_configure_extra_args="$ac_configure_extra_args --silent"
20576+fi
20577+
20578+_ACEOF
20579+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20580+if \$ac_cs_recheck; then
20581+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
20582+ shift
20583+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
20584+ CONFIG_SHELL='$SHELL'
20585+ export CONFIG_SHELL
20586+ exec "\$@"
20587+fi
20588+
20589+_ACEOF
20590+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20591+exec 5>>config.log
20592+{
20593+ echo
20594+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
20595+## Running $as_me. ##
20596+_ASBOX
20597+ $as_echo "$ac_log"
20598+} >&5
20599+
20600+_ACEOF
20601+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20602+#
20603+# INIT-COMMANDS
20604+#
20605+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
20606+
20607+
20608+# The HP-UX ksh and POSIX shell print the target directory to stdout
20609+# if CDPATH is set.
20610+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
20611+
20612+sed_quote_subst='$sed_quote_subst'
20613+double_quote_subst='$double_quote_subst'
20614+delay_variable_subst='$delay_variable_subst'
20615+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
20616+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
20617+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
20618+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
20619+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
20620+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
20621+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
20622+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
20623+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
20624+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
20625+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
20626+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
20627+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
20628+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
20629+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
20630+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
20631+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
20632+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
20633+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
20634+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
20635+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
20636+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
20637+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
20638+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
20639+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
20640+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
20641+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
20642+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
20643+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
20644+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
20645+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
20646+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
20647+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
20648+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
20649+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
20650+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
20651+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
20652+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
20653+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
20654+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
20655+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
20656+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
20657+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
20658+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
20659+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
20660+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
20661+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
20662+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
20663+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
20664+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
20665+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
20666+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
20667+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
20668+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
20669+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
20670+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
20671+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
20672+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
20673+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
20674+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
20675+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
20676+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
20677+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
20678+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
20679+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
20680+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
20681+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
20682+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
20683+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
20684+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
20685+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
20686+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
20687+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
20688+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
20689+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
20690+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
20691+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
20692+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
20693+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
20694+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
20695+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
20696+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
20697+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
20698+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
20699+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
20700+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
20701+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
20702+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
20703+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
20704+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
20705+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
20706+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
20707+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
20708+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
20709+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
20710+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
20711+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
20712+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
20713+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
20714+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
20715+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
20716+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
20717+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
20718+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
20719+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
20720+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
20721+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
20722+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
20723+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
20724+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
20725+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
20726+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
20727+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
20728+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
20729+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
20730+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
20731+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
20732+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
20733+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
20734+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
20735+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
20736+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
20737+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
20738+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
20739+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
20740+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
20741+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
20742+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
20743+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
20744+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
20745+
20746+LTCC='$LTCC'
20747+LTCFLAGS='$LTCFLAGS'
20748+compiler='$compiler_DEFAULT'
20749+
20750+# A function that is used when there is no print builtin or printf.
20751+func_fallback_echo ()
20752+{
20753+ eval 'cat <<_LTECHO_EOF
20754+\$1
20755+_LTECHO_EOF'
20756+}
20757+
20758+# Quote evaled strings.
20759+for var in SHELL \
20760+ECHO \
20761+PATH_SEPARATOR \
20762+SED \
20763+GREP \
20764+EGREP \
20765+FGREP \
20766+LD \
20767+NM \
20768+LN_S \
20769+lt_SP2NL \
20770+lt_NL2SP \
20771+reload_flag \
20772+OBJDUMP \
20773+deplibs_check_method \
20774+file_magic_cmd \
20775+file_magic_glob \
20776+want_nocaseglob \
20777+DLLTOOL \
20778+sharedlib_from_linklib_cmd \
20779+AR \
20780+AR_FLAGS \
20781+archiver_list_spec \
20782+STRIP \
20783+RANLIB \
20784+CC \
20785+CFLAGS \
20786+compiler \
20787+lt_cv_sys_global_symbol_pipe \
20788+lt_cv_sys_global_symbol_to_cdecl \
20789+lt_cv_sys_global_symbol_to_c_name_address \
20790+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
20791+nm_file_list_spec \
20792+lt_prog_compiler_no_builtin_flag \
20793+lt_prog_compiler_pic \
20794+lt_prog_compiler_wl \
20795+lt_prog_compiler_static \
20796+lt_cv_prog_compiler_c_o \
20797+need_locks \
20798+MANIFEST_TOOL \
20799+DSYMUTIL \
20800+NMEDIT \
20801+LIPO \
20802+OTOOL \
20803+OTOOL64 \
20804+shrext_cmds \
20805+export_dynamic_flag_spec \
20806+whole_archive_flag_spec \
20807+compiler_needs_object \
20808+with_gnu_ld \
20809+allow_undefined_flag \
20810+no_undefined_flag \
20811+hardcode_libdir_flag_spec \
20812+hardcode_libdir_separator \
20813+exclude_expsyms \
20814+include_expsyms \
20815+file_list_spec \
20816+variables_saved_for_relink \
20817+libname_spec \
20818+library_names_spec \
20819+soname_spec \
20820+install_override_mode \
20821+finish_eval \
20822+old_striplib \
20823+striplib; do
20824+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
20825+ *[\\\\\\\`\\"\\\$]*)
20826+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
20827+ ;;
20828+ *)
20829+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
20830+ ;;
20831+ esac
20832+done
20833+
20834+# Double-quote double-evaled strings.
20835+for var in reload_cmds \
20836+old_postinstall_cmds \
20837+old_postuninstall_cmds \
20838+old_archive_cmds \
20839+extract_expsyms_cmds \
20840+old_archive_from_new_cmds \
20841+old_archive_from_expsyms_cmds \
20842+archive_cmds \
20843+archive_expsym_cmds \
20844+module_cmds \
20845+module_expsym_cmds \
20846+export_symbols_cmds \
20847+prelink_cmds \
20848+postlink_cmds \
20849+postinstall_cmds \
20850+postuninstall_cmds \
20851+finish_cmds \
20852+sys_lib_search_path_spec \
20853+sys_lib_dlsearch_path_spec; do
20854+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
20855+ *[\\\\\\\`\\"\\\$]*)
20856+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
20857+ ;;
20858+ *)
20859+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
20860+ ;;
20861+ esac
20862+done
20863+
20864+ac_aux_dir='$ac_aux_dir'
20865+xsi_shell='$xsi_shell'
20866+lt_shell_append='$lt_shell_append'
20867+
20868+# See if we are running on zsh, and set the options which allow our
20869+# commands through without removal of \ escapes INIT.
20870+if test -n "\${ZSH_VERSION+set}" ; then
20871+ setopt NO_GLOB_SUBST
20872+fi
20873+
20874+
20875+ PACKAGE='$PACKAGE'
20876+ VERSION='$VERSION'
20877+ TIMESTAMP='$TIMESTAMP'
20878+ RM='$RM'
20879+ ofile='$ofile'
20880+
20881+
20882+
20883+
20884+_ACEOF
20885+
20886+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20887+
20888+# Handling of arguments.
20889+for ac_config_target in $ac_config_targets
20890+do
20891+ case $ac_config_target in
20892+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
20893+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
20894+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
20895+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
20896+ "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
20897+ "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;;
20898+ "libmspack.pc") CONFIG_FILES="$CONFIG_FILES libmspack.pc" ;;
20899+
20900+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
20901+ esac
20902+done
20903+
20904+
20905+# If the user did not use the arguments to specify the items to instantiate,
20906+# then the envvar interface is used. Set only those that are not.
20907+# We use the long form for the default assignment because of an extremely
20908+# bizarre bug on SunOS 4.1.3.
20909+if $ac_need_defaults; then
20910+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
20911+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
20912+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
20913+fi
20914+
20915+# Have a temporary directory for convenience. Make it in the build tree
20916+# simply because there is no reason against having it here, and in addition,
20917+# creating and moving files from /tmp can sometimes cause problems.
20918+# Hook for its removal unless debugging.
20919+# Note that there is a small window in which the directory will not be cleaned:
20920+# after its creation but before its name has been assigned to `$tmp'.
20921+$debug ||
20922+{
20923+ tmp= ac_tmp=
20924+ trap 'exit_status=$?
20925+ : "${ac_tmp:=$tmp}"
20926+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
20927+' 0
20928+ trap 'as_fn_exit 1' 1 2 13 15
20929+}
20930+# Create a (secure) tmp directory for tmp files.
20931+
20932+{
20933+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
20934+ test -d "$tmp"
20935+} ||
20936+{
20937+ tmp=./conf$$-$RANDOM
20938+ (umask 077 && mkdir "$tmp")
20939+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
20940+ac_tmp=$tmp
20941+
20942+# Set up the scripts for CONFIG_FILES section.
20943+# No need to generate them if there are no CONFIG_FILES.
20944+# This happens for instance with `./config.status config.h'.
20945+if test -n "$CONFIG_FILES"; then
20946+
20947+
20948+ac_cr=`echo X | tr X '\015'`
20949+# On cygwin, bash can eat \r inside `` if the user requested igncr.
20950+# But we know of no other shell where ac_cr would be empty at this
20951+# point, so we can use a bashism as a fallback.
20952+if test "x$ac_cr" = x; then
20953+ eval ac_cr=\$\'\\r\'
20954+fi
20955+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
20956+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
20957+ ac_cs_awk_cr='\\r'
20958+else
20959+ ac_cs_awk_cr=$ac_cr
20960+fi
20961+
20962+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
20963+_ACEOF
20964+
20965+
20966+{
20967+ echo "cat >conf$$subs.awk <<_ACEOF" &&
20968+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
20969+ echo "_ACEOF"
20970+} >conf$$subs.sh ||
20971+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
20972+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
20973+ac_delim='%!_!# '
20974+for ac_last_try in false false false false false :; do
20975+ . ./conf$$subs.sh ||
20976+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
20977+
20978+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
20979+ if test $ac_delim_n = $ac_delim_num; then
20980+ break
20981+ elif $ac_last_try; then
20982+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
20983+ else
20984+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
20985+ fi
20986+done
20987+rm -f conf$$subs.sh
20988+
20989+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20990+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
20991+_ACEOF
20992+sed -n '
20993+h
20994+s/^/S["/; s/!.*/"]=/
20995+p
20996+g
20997+s/^[^!]*!//
20998+:repl
20999+t repl
21000+s/'"$ac_delim"'$//
21001+t delim
21002+:nl
21003+h
21004+s/\(.\{148\}\)..*/\1/
21005+t more1
21006+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
21007+p
21008+n
21009+b repl
21010+:more1
21011+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
21012+p
21013+g
21014+s/.\{148\}//
21015+t nl
21016+:delim
21017+h
21018+s/\(.\{148\}\)..*/\1/
21019+t more2
21020+s/["\\]/\\&/g; s/^/"/; s/$/"/
21021+p
21022+b
21023+:more2
21024+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
21025+p
21026+g
21027+s/.\{148\}//
21028+t delim
21029+' <conf$$subs.awk | sed '
21030+/^[^""]/{
21031+ N
21032+ s/\n//
21033+}
21034+' >>$CONFIG_STATUS || ac_write_fail=1
21035+rm -f conf$$subs.awk
21036+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
21037+_ACAWK
21038+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
21039+ for (key in S) S_is_set[key] = 1
21040+ FS = ""
21041+
21042+}
21043+{
21044+ line = $ 0
21045+ nfields = split(line, field, "@")
21046+ substed = 0
21047+ len = length(field[1])
21048+ for (i = 2; i < nfields; i++) {
21049+ key = field[i]
21050+ keylen = length(key)
21051+ if (S_is_set[key]) {
21052+ value = S[key]
21053+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
21054+ len += length(value) + length(field[++i])
21055+ substed = 1
21056+ } else
21057+ len += 1 + keylen
21058+ }
21059+
21060+ print line
21061+}
21062+
21063+_ACAWK
21064+_ACEOF
21065+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
21066+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
21067+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
21068+else
21069+ cat
21070+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
21071+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
21072+_ACEOF
21073+
21074+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
21075+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
21076+# trailing colons and then remove the whole line if VPATH becomes empty
21077+# (actually we leave an empty line to preserve line numbers).
21078+if test "x$srcdir" = x.; then
21079+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
21080+h
21081+s///
21082+s/^/:/
21083+s/[ ]*$/:/
21084+s/:\$(srcdir):/:/g
21085+s/:\${srcdir}:/:/g
21086+s/:@srcdir@:/:/g
21087+s/^:*//
21088+s/:*$//
21089+x
21090+s/\(=[ ]*\).*/\1/
21091+G
21092+s/\n//
21093+s/^[^=]*=[ ]*$//
21094+}'
21095+fi
21096+
21097+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
21098+fi # test -n "$CONFIG_FILES"
21099+
21100+# Set up the scripts for CONFIG_HEADERS section.
21101+# No need to generate them if there are no CONFIG_HEADERS.
21102+# This happens for instance with `./config.status Makefile'.
21103+if test -n "$CONFIG_HEADERS"; then
21104+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
21105+BEGIN {
21106+_ACEOF
21107+
21108+# Transform confdefs.h into an awk script `defines.awk', embedded as
21109+# here-document in config.status, that substitutes the proper values into
21110+# config.h.in to produce config.h.
21111+
21112+# Create a delimiter string that does not exist in confdefs.h, to ease
21113+# handling of long lines.
21114+ac_delim='%!_!# '
21115+for ac_last_try in false false :; do
21116+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
21117+ if test -z "$ac_tt"; then
21118+ break
21119+ elif $ac_last_try; then
21120+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
21121+ else
21122+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
21123+ fi
21124+done
21125+
21126+# For the awk script, D is an array of macro values keyed by name,
21127+# likewise P contains macro parameters if any. Preserve backslash
21128+# newline sequences.
21129+
21130+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
21131+sed -n '
21132+s/.\{148\}/&'"$ac_delim"'/g
21133+t rset
21134+:rset
21135+s/^[ ]*#[ ]*define[ ][ ]*/ /
21136+t def
21137+d
21138+:def
21139+s/\\$//
21140+t bsnl
21141+s/["\\]/\\&/g
21142+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
21143+D["\1"]=" \3"/p
21144+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
21145+d
21146+:bsnl
21147+s/["\\]/\\&/g
21148+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
21149+D["\1"]=" \3\\\\\\n"\\/p
21150+t cont
21151+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
21152+t cont
21153+d
21154+:cont
21155+n
21156+s/.\{148\}/&'"$ac_delim"'/g
21157+t clear
21158+:clear
21159+s/\\$//
21160+t bsnlc
21161+s/["\\]/\\&/g; s/^/"/; s/$/"/p
21162+d
21163+:bsnlc
21164+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
21165+b cont
21166+' <confdefs.h | sed '
21167+s/'"$ac_delim"'/"\\\
21168+"/g' >>$CONFIG_STATUS || ac_write_fail=1
21169+
21170+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
21171+ for (key in D) D_is_set[key] = 1
21172+ FS = ""
21173+}
21174+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
21175+ line = \$ 0
21176+ split(line, arg, " ")
21177+ if (arg[1] == "#") {
21178+ defundef = arg[2]
21179+ mac1 = arg[3]
21180+ } else {
21181+ defundef = substr(arg[1], 2)
21182+ mac1 = arg[2]
21183+ }
21184+ split(mac1, mac2, "(") #)
21185+ macro = mac2[1]
21186+ prefix = substr(line, 1, index(line, defundef) - 1)
21187+ if (D_is_set[macro]) {
21188+ # Preserve the white space surrounding the "#".
21189+ print prefix "define", macro P[macro] D[macro]
21190+ next
21191+ } else {
21192+ # Replace #undef with comments. This is necessary, for example,
21193+ # in the case of _POSIX_SOURCE, which is predefined and required
21194+ # on some systems where configure will not decide to define it.
21195+ if (defundef == "undef") {
21196+ print "/*", prefix defundef, macro, "*/"
21197+ next
21198+ }
21199+ }
21200+}
21201+{ print }
21202+_ACAWK
21203+_ACEOF
21204+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
21205+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
21206+fi # test -n "$CONFIG_HEADERS"
21207+
21208+
21209+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
21210+shift
21211+for ac_tag
21212+do
21213+ case $ac_tag in
21214+ :[FHLC]) ac_mode=$ac_tag; continue;;
21215+ esac
21216+ case $ac_mode$ac_tag in
21217+ :[FHL]*:*);;
21218+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
21219+ :[FH]-) ac_tag=-:-;;
21220+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
21221+ esac
21222+ ac_save_IFS=$IFS
21223+ IFS=:
21224+ set x $ac_tag
21225+ IFS=$ac_save_IFS
21226+ shift
21227+ ac_file=$1
21228+ shift
21229+
21230+ case $ac_mode in
21231+ :L) ac_source=$1;;
21232+ :[FH])
21233+ ac_file_inputs=
21234+ for ac_f
21235+ do
21236+ case $ac_f in
21237+ -) ac_f="$ac_tmp/stdin";;
21238+ *) # Look for the file first in the build tree, then in the source tree
21239+ # (if the path is not absolute). The absolute path cannot be DOS-style,
21240+ # because $ac_f cannot contain `:'.
21241+ test -f "$ac_f" ||
21242+ case $ac_f in
21243+ [\\/$]*) false;;
21244+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
21245+ esac ||
21246+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
21247+ esac
21248+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
21249+ as_fn_append ac_file_inputs " '$ac_f'"
21250+ done
21251+
21252+ # Let's still pretend it is `configure' which instantiates (i.e., don't
21253+ # use $as_me), people would be surprised to read:
21254+ # /* config.h. Generated by config.status. */
21255+ configure_input='Generated from '`
21256+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
21257+ `' by configure.'
21258+ if test x"$ac_file" != x-; then
21259+ configure_input="$ac_file. $configure_input"
21260+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
21261+$as_echo "$as_me: creating $ac_file" >&6;}
21262+ fi
21263+ # Neutralize special characters interpreted by sed in replacement strings.
21264+ case $configure_input in #(
21265+ *\&* | *\|* | *\\* )
21266+ ac_sed_conf_input=`$as_echo "$configure_input" |
21267+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
21268+ *) ac_sed_conf_input=$configure_input;;
21269+ esac
21270+
21271+ case $ac_tag in
21272+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
21273+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
21274+ esac
21275+ ;;
21276+ esac
21277+
21278+ ac_dir=`$as_dirname -- "$ac_file" ||
21279+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21280+ X"$ac_file" : 'X\(//\)[^/]' \| \
21281+ X"$ac_file" : 'X\(//\)$' \| \
21282+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
21283+$as_echo X"$ac_file" |
21284+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
21285+ s//\1/
21286+ q
21287+ }
21288+ /^X\(\/\/\)[^/].*/{
21289+ s//\1/
21290+ q
21291+ }
21292+ /^X\(\/\/\)$/{
21293+ s//\1/
21294+ q
21295+ }
21296+ /^X\(\/\).*/{
21297+ s//\1/
21298+ q
21299+ }
21300+ s/.*/./; q'`
21301+ as_dir="$ac_dir"; as_fn_mkdir_p
21302+ ac_builddir=.
21303+
21304+case "$ac_dir" in
21305+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
21306+*)
21307+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
21308+ # A ".." for each directory in $ac_dir_suffix.
21309+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
21310+ case $ac_top_builddir_sub in
21311+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
21312+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
21313+ esac ;;
21314+esac
21315+ac_abs_top_builddir=$ac_pwd
21316+ac_abs_builddir=$ac_pwd$ac_dir_suffix
21317+# for backward compatibility:
21318+ac_top_builddir=$ac_top_build_prefix
21319+
21320+case $srcdir in
21321+ .) # We are building in place.
21322+ ac_srcdir=.
21323+ ac_top_srcdir=$ac_top_builddir_sub
21324+ ac_abs_top_srcdir=$ac_pwd ;;
21325+ [\\/]* | ?:[\\/]* ) # Absolute name.
21326+ ac_srcdir=$srcdir$ac_dir_suffix;
21327+ ac_top_srcdir=$srcdir
21328+ ac_abs_top_srcdir=$srcdir ;;
21329+ *) # Relative name.
21330+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
21331+ ac_top_srcdir=$ac_top_build_prefix$srcdir
21332+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
21333+esac
21334+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
21335+
21336+
21337+ case $ac_mode in
21338+ :F)
21339+ #
21340+ # CONFIG_FILE
21341+ #
21342+
21343+ case $INSTALL in
21344+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21345+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
21346+ esac
21347+ ac_MKDIR_P=$MKDIR_P
21348+ case $MKDIR_P in
21349+ [\\/$]* | ?:[\\/]* ) ;;
21350+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
21351+ esac
21352+_ACEOF
21353+
21354+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
21355+# If the template does not know about datarootdir, expand it.
21356+# FIXME: This hack should be removed a few years after 2.60.
21357+ac_datarootdir_hack=; ac_datarootdir_seen=
21358+ac_sed_dataroot='
21359+/datarootdir/ {
21360+ p
21361+ q
21362+}
21363+/@datadir@/p
21364+/@docdir@/p
21365+/@infodir@/p
21366+/@localedir@/p
21367+/@mandir@/p'
21368+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
21369+*datarootdir*) ac_datarootdir_seen=yes;;
21370+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
21371+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
21372+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
21373+_ACEOF
21374+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
21375+ ac_datarootdir_hack='
21376+ s&@datadir@&$datadir&g
21377+ s&@docdir@&$docdir&g
21378+ s&@infodir@&$infodir&g
21379+ s&@localedir@&$localedir&g
21380+ s&@mandir@&$mandir&g
21381+ s&\\\${datarootdir}&$datarootdir&g' ;;
21382+esac
21383+_ACEOF
21384+
21385+# Neutralize VPATH when `$srcdir' = `.'.
21386+# Shell code in configure.ac might set extrasub.
21387+# FIXME: do we really want to maintain this feature?
21388+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
21389+ac_sed_extra="$ac_vpsub
21390+$extrasub
21391+_ACEOF
21392+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
21393+:t
21394+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21395+s|@configure_input@|$ac_sed_conf_input|;t t
21396+s&@top_builddir@&$ac_top_builddir_sub&;t t
21397+s&@top_build_prefix@&$ac_top_build_prefix&;t t
21398+s&@srcdir@&$ac_srcdir&;t t
21399+s&@abs_srcdir@&$ac_abs_srcdir&;t t
21400+s&@top_srcdir@&$ac_top_srcdir&;t t
21401+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
21402+s&@builddir@&$ac_builddir&;t t
21403+s&@abs_builddir@&$ac_abs_builddir&;t t
21404+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
21405+s&@INSTALL@&$ac_INSTALL&;t t
21406+s&@MKDIR_P@&$ac_MKDIR_P&;t t
21407+$ac_datarootdir_hack
21408+"
21409+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
21410+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
21411+
21412+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
21413+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
21414+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
21415+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
21416+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
21417+which seems to be undefined. Please make sure it is defined" >&5
21418+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
21419+which seems to be undefined. Please make sure it is defined" >&2;}
21420+
21421+ rm -f "$ac_tmp/stdin"
21422+ case $ac_file in
21423+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
21424+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
21425+ esac \
21426+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
21427+ ;;
21428+ :H)
21429+ #
21430+ # CONFIG_HEADER
21431+ #
21432+ if test x"$ac_file" != x-; then
21433+ {
21434+ $as_echo "/* $configure_input */" \
21435+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
21436+ } >"$ac_tmp/config.h" \
21437+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
21438+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
21439+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
21440+$as_echo "$as_me: $ac_file is unchanged" >&6;}
21441+ else
21442+ rm -f "$ac_file"
21443+ mv "$ac_tmp/config.h" "$ac_file" \
21444+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
21445+ fi
21446+ else
21447+ $as_echo "/* $configure_input */" \
21448+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
21449+ || as_fn_error $? "could not create -" "$LINENO" 5
21450+ fi
21451+# Compute "$ac_file"'s index in $config_headers.
21452+_am_arg="$ac_file"
21453+_am_stamp_count=1
21454+for _am_header in $config_headers :; do
21455+ case $_am_header in
21456+ $_am_arg | $_am_arg:* )
21457+ break ;;
21458+ * )
21459+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
21460+ esac
21461+done
21462+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
21463+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21464+ X"$_am_arg" : 'X\(//\)[^/]' \| \
21465+ X"$_am_arg" : 'X\(//\)$' \| \
21466+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
21467+$as_echo X"$_am_arg" |
21468+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
21469+ s//\1/
21470+ q
21471+ }
21472+ /^X\(\/\/\)[^/].*/{
21473+ s//\1/
21474+ q
21475+ }
21476+ /^X\(\/\/\)$/{
21477+ s//\1/
21478+ q
21479+ }
21480+ /^X\(\/\).*/{
21481+ s//\1/
21482+ q
21483+ }
21484+ s/.*/./; q'`/stamp-h$_am_stamp_count
21485+ ;;
21486+
21487+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
21488+$as_echo "$as_me: executing $ac_file commands" >&6;}
21489+ ;;
21490+ esac
21491+
21492+
21493+ case $ac_file$ac_mode in
21494+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
21495+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
21496+ # are listed without --file. Let's play safe and only enable the eval
21497+ # if we detect the quoting.
21498+ case $CONFIG_FILES in
21499+ *\'*) eval set x "$CONFIG_FILES" ;;
21500+ *) set x $CONFIG_FILES ;;
21501+ esac
21502+ shift
21503+ for mf
21504+ do
21505+ # Strip MF so we end up with the name of the file.
21506+ mf=`echo "$mf" | sed -e 's/:.*$//'`
21507+ # Check whether this is an Automake generated Makefile or not.
21508+ # We used to match only the files named `Makefile.in', but
21509+ # some people rename them; so instead we look at the file content.
21510+ # Grep'ing the first line is not enough: some people post-process
21511+ # each Makefile.in and add a new line on top of each file to say so.
21512+ # Grep'ing the whole file is not good either: AIX grep has a line
21513+ # limit of 2048, but all sed's we know have understand at least 4000.
21514+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
21515+ dirpart=`$as_dirname -- "$mf" ||
21516+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21517+ X"$mf" : 'X\(//\)[^/]' \| \
21518+ X"$mf" : 'X\(//\)$' \| \
21519+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
21520+$as_echo X"$mf" |
21521+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
21522+ s//\1/
21523+ q
21524+ }
21525+ /^X\(\/\/\)[^/].*/{
21526+ s//\1/
21527+ q
21528+ }
21529+ /^X\(\/\/\)$/{
21530+ s//\1/
21531+ q
21532+ }
21533+ /^X\(\/\).*/{
21534+ s//\1/
21535+ q
21536+ }
21537+ s/.*/./; q'`
21538+ else
21539+ continue
21540+ fi
21541+ # Extract the definition of DEPDIR, am__include, and am__quote
21542+ # from the Makefile without running `make'.
21543+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
21544+ test -z "$DEPDIR" && continue
21545+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
21546+ test -z "am__include" && continue
21547+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
21548+ # When using ansi2knr, U may be empty or an underscore; expand it
21549+ U=`sed -n 's/^U = //p' < "$mf"`
21550+ # Find all dependency output files, they are included files with
21551+ # $(DEPDIR) in their names. We invoke sed twice because it is the
21552+ # simplest approach to changing $(DEPDIR) to its actual value in the
21553+ # expansion.
21554+ for file in `sed -n "
21555+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
21556+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
21557+ # Make sure the directory exists.
21558+ test -f "$dirpart/$file" && continue
21559+ fdir=`$as_dirname -- "$file" ||
21560+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21561+ X"$file" : 'X\(//\)[^/]' \| \
21562+ X"$file" : 'X\(//\)$' \| \
21563+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
21564+$as_echo X"$file" |
21565+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
21566+ s//\1/
21567+ q
21568+ }
21569+ /^X\(\/\/\)[^/].*/{
21570+ s//\1/
21571+ q
21572+ }
21573+ /^X\(\/\/\)$/{
21574+ s//\1/
21575+ q
21576+ }
21577+ /^X\(\/\).*/{
21578+ s//\1/
21579+ q
21580+ }
21581+ s/.*/./; q'`
21582+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
21583+ # echo "creating $dirpart/$file"
21584+ echo '# dummy' > "$dirpart/$file"
21585+ done
21586+ done
21587+}
21588+ ;;
21589+ "libtool":C)
21590+
21591+ # See if we are running on zsh, and set the options which allow our
21592+ # commands through without removal of \ escapes.
21593+ if test -n "${ZSH_VERSION+set}" ; then
21594+ setopt NO_GLOB_SUBST
21595+ fi
21596+
21597+ cfgfile="${ofile}T"
21598+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
21599+ $RM "$cfgfile"
21600+
21601+ cat <<_LT_EOF >> "$cfgfile"
21602+#! $SHELL
21603+
21604+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
21605+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
21606+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
21607+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
21608+#
21609+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
21610+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
21611+# Foundation, Inc.
21612+# Written by Gordon Matzigkeit, 1996
21613+#
21614+# This file is part of GNU Libtool.
21615+#
21616+# GNU Libtool is free software; you can redistribute it and/or
21617+# modify it under the terms of the GNU General Public License as
21618+# published by the Free Software Foundation; either version 2 of
21619+# the License, or (at your option) any later version.
21620+#
21621+# As a special exception to the GNU General Public License,
21622+# if you distribute this file as part of a program or library that
21623+# is built using GNU Libtool, you may include this file under the
21624+# same distribution terms that you use for the rest of that program.
21625+#
21626+# GNU Libtool is distributed in the hope that it will be useful,
21627+# but WITHOUT ANY WARRANTY; without even the implied warranty of
21628+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21629+# GNU General Public License for more details.
21630+#
21631+# You should have received a copy of the GNU General Public License
21632+# along with GNU Libtool; see the file COPYING. If not, a copy
21633+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
21634+# obtained by writing to the Free Software Foundation, Inc.,
21635+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21636+
21637+
21638+# The names of the tagged configurations supported by this script.
21639+available_tags=""
21640+
21641+# ### BEGIN LIBTOOL CONFIG
21642+
21643+# Which release of libtool.m4 was used?
21644+macro_version=$macro_version
21645+macro_revision=$macro_revision
21646+
21647+# Whether or not to build shared libraries.
21648+build_libtool_libs=$enable_shared
21649+
21650+# Whether or not to build static libraries.
21651+build_old_libs=$enable_static
21652+
21653+# What type of objects to build.
21654+pic_mode=$pic_mode
21655+
21656+# Whether or not to optimize for fast installation.
21657+fast_install=$enable_fast_install
21658+
21659+# Shell to use when invoking shell scripts.
21660+SHELL=$lt_SHELL
21661+
21662+# An echo program that protects backslashes.
21663+ECHO=$lt_ECHO
21664+
21665+# The PATH separator for the build system.
21666+PATH_SEPARATOR=$lt_PATH_SEPARATOR
21667+
21668+# The host system.
21669+host_alias=$host_alias
21670+host=$host
21671+host_os=$host_os
21672+
21673+# The build system.
21674+build_alias=$build_alias
21675+build=$build
21676+build_os=$build_os
21677+
21678+# A sed program that does not truncate output.
21679+SED=$lt_SED
21680+
21681+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
21682+Xsed="\$SED -e 1s/^X//"
21683+
21684+# A grep program that handles long lines.
21685+GREP=$lt_GREP
21686+
21687+# An ERE matcher.
21688+EGREP=$lt_EGREP
21689+
21690+# A literal string matcher.
21691+FGREP=$lt_FGREP
21692+
21693+# A BSD- or MS-compatible name lister.
21694+NM=$lt_NM
21695+
21696+# Whether we need soft or hard links.
21697+LN_S=$lt_LN_S
21698+
21699+# What is the maximum length of a command?
21700+max_cmd_len=$max_cmd_len
21701+
21702+# Object file suffix (normally "o").
21703+objext=$ac_objext
21704+
21705+# Executable file suffix (normally "").
21706+exeext=$exeext
21707+
21708+# whether the shell understands "unset".
21709+lt_unset=$lt_unset
21710+
21711+# turn spaces into newlines.
21712+SP2NL=$lt_lt_SP2NL
21713+
21714+# turn newlines into spaces.
21715+NL2SP=$lt_lt_NL2SP
21716+
21717+# convert \$build file names to \$host format.
21718+to_host_file_cmd=$lt_cv_to_host_file_cmd
21719+
21720+# convert \$build files to toolchain format.
21721+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
21722+
21723+# An object symbol dumper.
21724+OBJDUMP=$lt_OBJDUMP
21725+
21726+# Method to check whether dependent libraries are shared objects.
21727+deplibs_check_method=$lt_deplibs_check_method
21728+
21729+# Command to use when deplibs_check_method = "file_magic".
21730+file_magic_cmd=$lt_file_magic_cmd
21731+
21732+# How to find potential files when deplibs_check_method = "file_magic".
21733+file_magic_glob=$lt_file_magic_glob
21734+
21735+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
21736+want_nocaseglob=$lt_want_nocaseglob
21737+
21738+# DLL creation program.
21739+DLLTOOL=$lt_DLLTOOL
21740+
21741+# Command to associate shared and link libraries.
21742+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
21743+
21744+# The archiver.
21745+AR=$lt_AR
21746+
21747+# Flags to create an archive.
21748+AR_FLAGS=$lt_AR_FLAGS
21749+
21750+# How to feed a file listing to the archiver.
21751+archiver_list_spec=$lt_archiver_list_spec
21752+
21753+# A symbol stripping program.
21754+STRIP=$lt_STRIP
21755+
21756+# Commands used to install an old-style archive.
21757+RANLIB=$lt_RANLIB
21758+old_postinstall_cmds=$lt_old_postinstall_cmds
21759+old_postuninstall_cmds=$lt_old_postuninstall_cmds
21760+
21761+# Whether to use a lock for old archive extraction.
21762+lock_old_archive_extraction=$lock_old_archive_extraction
21763+
21764+# A C compiler.
21765+LTCC=$lt_CC
21766+
21767+# LTCC compiler flags.
21768+LTCFLAGS=$lt_CFLAGS
21769+
21770+# Take the output of nm and produce a listing of raw symbols and C names.
21771+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
21772+
21773+# Transform the output of nm in a proper C declaration.
21774+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
21775+
21776+# Transform the output of nm in a C name address pair.
21777+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
21778+
21779+# Transform the output of nm in a C name address pair when lib prefix is needed.
21780+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
21781+
21782+# Specify filename containing input files for \$NM.
21783+nm_file_list_spec=$lt_nm_file_list_spec
21784+
21785+# The root where to search for dependent libraries,and in which our libraries should be installed.
21786+lt_sysroot=$lt_sysroot
21787+
21788+# The name of the directory that contains temporary libtool files.
21789+objdir=$objdir
21790+
21791+# Used to examine libraries when file_magic_cmd begins with "file".
21792+MAGIC_CMD=$MAGIC_CMD
21793+
21794+# Must we lock files when doing compilation?
21795+need_locks=$lt_need_locks
21796+
21797+# Manifest tool.
21798+MANIFEST_TOOL=$lt_MANIFEST_TOOL
21799+
21800+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
21801+DSYMUTIL=$lt_DSYMUTIL
21802+
21803+# Tool to change global to local symbols on Mac OS X.
21804+NMEDIT=$lt_NMEDIT
21805+
21806+# Tool to manipulate fat objects and archives on Mac OS X.
21807+LIPO=$lt_LIPO
21808+
21809+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
21810+OTOOL=$lt_OTOOL
21811+
21812+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
21813+OTOOL64=$lt_OTOOL64
21814+
21815+# Old archive suffix (normally "a").
21816+libext=$libext
21817+
21818+# Shared library suffix (normally ".so").
21819+shrext_cmds=$lt_shrext_cmds
21820+
21821+# The commands to extract the exported symbol list from a shared archive.
21822+extract_expsyms_cmds=$lt_extract_expsyms_cmds
21823+
21824+# Variables whose values should be saved in libtool wrapper scripts and
21825+# restored at link time.
21826+variables_saved_for_relink=$lt_variables_saved_for_relink
21827+
21828+# Do we need the "lib" prefix for modules?
21829+need_lib_prefix=$need_lib_prefix
21830+
21831+# Do we need a version for libraries?
21832+need_version=$need_version
21833+
21834+# Library versioning type.
21835+version_type=$version_type
21836+
21837+# Shared library runtime path variable.
21838+runpath_var=$runpath_var
21839+
21840+# Shared library path variable.
21841+shlibpath_var=$shlibpath_var
21842+
21843+# Is shlibpath searched before the hard-coded library search path?
21844+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
21845+
21846+# Format of library name prefix.
21847+libname_spec=$lt_libname_spec
21848+
21849+# List of archive names. First name is the real one, the rest are links.
21850+# The last name is the one that the linker finds with -lNAME
21851+library_names_spec=$lt_library_names_spec
21852+
21853+# The coded name of the library, if different from the real name.
21854+soname_spec=$lt_soname_spec
21855+
21856+# Permission mode override for installation of shared libraries.
21857+install_override_mode=$lt_install_override_mode
21858+
21859+# Command to use after installation of a shared archive.
21860+postinstall_cmds=$lt_postinstall_cmds
21861+
21862+# Command to use after uninstallation of a shared archive.
21863+postuninstall_cmds=$lt_postuninstall_cmds
21864+
21865+# Commands used to finish a libtool library installation in a directory.
21866+finish_cmds=$lt_finish_cmds
21867+
21868+# As "finish_cmds", except a single script fragment to be evaled but
21869+# not shown.
21870+finish_eval=$lt_finish_eval
21871+
21872+# Whether we should hardcode library paths into libraries.
21873+hardcode_into_libs=$hardcode_into_libs
21874+
21875+# Compile-time system search path for libraries.
21876+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
21877+
21878+# Run-time system search path for libraries.
21879+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
21880+
21881+# Whether dlopen is supported.
21882+dlopen_support=$enable_dlopen
21883+
21884+# Whether dlopen of programs is supported.
21885+dlopen_self=$enable_dlopen_self
21886+
21887+# Whether dlopen of statically linked programs is supported.
21888+dlopen_self_static=$enable_dlopen_self_static
21889+
21890+# Commands to strip libraries.
21891+old_striplib=$lt_old_striplib
21892+striplib=$lt_striplib
21893+
21894+
21895+# The linker used to build libraries.
21896+LD=$lt_LD
21897+
21898+# How to create reloadable object files.
21899+reload_flag=$lt_reload_flag
21900+reload_cmds=$lt_reload_cmds
21901+
21902+# Commands used to build an old-style archive.
21903+old_archive_cmds=$lt_old_archive_cmds
21904+
21905+# A language specific compiler.
21906+CC=$lt_compiler
21907+
21908+# Is the compiler the GNU compiler?
21909+with_gcc=$GCC
21910+
21911+# Compiler flag to turn off builtin functions.
21912+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
21913+
21914+# Additional compiler flags for building library objects.
21915+pic_flag=$lt_lt_prog_compiler_pic
21916+
21917+# How to pass a linker flag through the compiler.
21918+wl=$lt_lt_prog_compiler_wl
21919+
21920+# Compiler flag to prevent dynamic linking.
21921+link_static_flag=$lt_lt_prog_compiler_static
21922+
21923+# Does compiler simultaneously support -c and -o options?
21924+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
21925+
21926+# Whether or not to add -lc for building shared libraries.
21927+build_libtool_need_lc=$archive_cmds_need_lc
21928+
21929+# Whether or not to disallow shared libs when runtime libs are static.
21930+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
21931+
21932+# Compiler flag to allow reflexive dlopens.
21933+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
21934+
21935+# Compiler flag to generate shared objects directly from archives.
21936+whole_archive_flag_spec=$lt_whole_archive_flag_spec
21937+
21938+# Whether the compiler copes with passing no objects directly.
21939+compiler_needs_object=$lt_compiler_needs_object
21940+
21941+# Create an old-style archive from a shared archive.
21942+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
21943+
21944+# Create a temporary old-style archive to link instead of a shared archive.
21945+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
21946+
21947+# Commands used to build a shared archive.
21948+archive_cmds=$lt_archive_cmds
21949+archive_expsym_cmds=$lt_archive_expsym_cmds
21950+
21951+# Commands used to build a loadable module if different from building
21952+# a shared archive.
21953+module_cmds=$lt_module_cmds
21954+module_expsym_cmds=$lt_module_expsym_cmds
21955+
21956+# Whether we are building with GNU ld or not.
21957+with_gnu_ld=$lt_with_gnu_ld
21958+
21959+# Flag that allows shared libraries with undefined symbols to be built.
21960+allow_undefined_flag=$lt_allow_undefined_flag
21961+
21962+# Flag that enforces no undefined symbols.
21963+no_undefined_flag=$lt_no_undefined_flag
21964+
21965+# Flag to hardcode \$libdir into a binary during linking.
21966+# This must work even if \$libdir does not exist
21967+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
21968+
21969+# Whether we need a single "-rpath" flag with a separated argument.
21970+hardcode_libdir_separator=$lt_hardcode_libdir_separator
21971+
21972+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
21973+# DIR into the resulting binary.
21974+hardcode_direct=$hardcode_direct
21975+
21976+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
21977+# DIR into the resulting binary and the resulting library dependency is
21978+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
21979+# library is relocated.
21980+hardcode_direct_absolute=$hardcode_direct_absolute
21981+
21982+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
21983+# into the resulting binary.
21984+hardcode_minus_L=$hardcode_minus_L
21985+
21986+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
21987+# into the resulting binary.
21988+hardcode_shlibpath_var=$hardcode_shlibpath_var
21989+
21990+# Set to "yes" if building a shared library automatically hardcodes DIR
21991+# into the library and all subsequent libraries and executables linked
21992+# against it.
21993+hardcode_automatic=$hardcode_automatic
21994+
21995+# Set to yes if linker adds runtime paths of dependent libraries
21996+# to runtime path list.
21997+inherit_rpath=$inherit_rpath
21998+
21999+# Whether libtool must link a program against all its dependency libraries.
22000+link_all_deplibs=$link_all_deplibs
22001+
22002+# Set to "yes" if exported symbols are required.
22003+always_export_symbols=$always_export_symbols
22004+
22005+# The commands to list exported symbols.
22006+export_symbols_cmds=$lt_export_symbols_cmds
22007+
22008+# Symbols that should not be listed in the preloaded symbols.
22009+exclude_expsyms=$lt_exclude_expsyms
22010+
22011+# Symbols that must always be exported.
22012+include_expsyms=$lt_include_expsyms
22013+
22014+# Commands necessary for linking programs (against libraries) with templates.
22015+prelink_cmds=$lt_prelink_cmds
22016+
22017+# Commands necessary for finishing linking programs.
22018+postlink_cmds=$lt_postlink_cmds
22019+
22020+# Specify filename containing input files.
22021+file_list_spec=$lt_file_list_spec
22022+
22023+# How to hardcode a shared library path into an executable.
22024+hardcode_action=$hardcode_action
22025+
22026+# ### END LIBTOOL CONFIG
22027+
22028+_LT_EOF
22029+
22030+ case $host_os in
22031+ aix3*)
22032+ cat <<\_LT_EOF >> "$cfgfile"
22033+# AIX sometimes has problems with the GCC collect2 program. For some
22034+# reason, if we set the COLLECT_NAMES environment variable, the problems
22035+# vanish in a puff of smoke.
22036+if test "X${COLLECT_NAMES+set}" != Xset; then
22037+ COLLECT_NAMES=
22038+ export COLLECT_NAMES
22039+fi
22040+_LT_EOF
22041+ ;;
22042+ esac
22043+
22044+
22045+ltmain="$ac_aux_dir/ltmain.sh"
22046+
22047+
22048+ # We use sed instead of cat because bash on DJGPP gets confused if
22049+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
22050+ # text mode, it properly converts lines to CR/LF. This bash problem
22051+ # is reportedly fixed, but why not run on old versions too?
22052+ sed '$q' "$ltmain" >> "$cfgfile" \
22053+ || (rm -f "$cfgfile"; exit 1)
22054+
22055+ if test x"$xsi_shell" = xyes; then
22056+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
22057+func_dirname ()\
22058+{\
22059+\ case ${1} in\
22060+\ */*) func_dirname_result="${1%/*}${2}" ;;\
22061+\ * ) func_dirname_result="${3}" ;;\
22062+\ esac\
22063+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
22064+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22065+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22066+test 0 -eq $? || _lt_function_replace_fail=:
22067+
22068+
22069+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
22070+func_basename ()\
22071+{\
22072+\ func_basename_result="${1##*/}"\
22073+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
22074+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22075+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22076+test 0 -eq $? || _lt_function_replace_fail=:
22077+
22078+
22079+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
22080+func_dirname_and_basename ()\
22081+{\
22082+\ case ${1} in\
22083+\ */*) func_dirname_result="${1%/*}${2}" ;;\
22084+\ * ) func_dirname_result="${3}" ;;\
22085+\ esac\
22086+\ func_basename_result="${1##*/}"\
22087+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
22088+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22089+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22090+test 0 -eq $? || _lt_function_replace_fail=:
22091+
22092+
22093+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
22094+func_stripname ()\
22095+{\
22096+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
22097+\ # positional parameters, so assign one to ordinary parameter first.\
22098+\ func_stripname_result=${3}\
22099+\ func_stripname_result=${func_stripname_result#"${1}"}\
22100+\ func_stripname_result=${func_stripname_result%"${2}"}\
22101+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
22102+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22103+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22104+test 0 -eq $? || _lt_function_replace_fail=:
22105+
22106+
22107+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
22108+func_split_long_opt ()\
22109+{\
22110+\ func_split_long_opt_name=${1%%=*}\
22111+\ func_split_long_opt_arg=${1#*=}\
22112+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
22113+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22114+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22115+test 0 -eq $? || _lt_function_replace_fail=:
22116+
22117+
22118+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
22119+func_split_short_opt ()\
22120+{\
22121+\ func_split_short_opt_arg=${1#??}\
22122+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
22123+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
22124+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22125+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22126+test 0 -eq $? || _lt_function_replace_fail=:
22127+
22128+
22129+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
22130+func_lo2o ()\
22131+{\
22132+\ case ${1} in\
22133+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
22134+\ *) func_lo2o_result=${1} ;;\
22135+\ esac\
22136+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
22137+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22138+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22139+test 0 -eq $? || _lt_function_replace_fail=:
22140+
22141+
22142+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
22143+func_xform ()\
22144+{\
22145+ func_xform_result=${1%.*}.lo\
22146+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
22147+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22148+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22149+test 0 -eq $? || _lt_function_replace_fail=:
22150+
22151+
22152+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
22153+func_arith ()\
22154+{\
22155+ func_arith_result=$(( $* ))\
22156+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
22157+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22158+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22159+test 0 -eq $? || _lt_function_replace_fail=:
22160+
22161+
22162+ sed -e '/^func_len ()$/,/^} # func_len /c\
22163+func_len ()\
22164+{\
22165+ func_len_result=${#1}\
22166+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
22167+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22168+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22169+test 0 -eq $? || _lt_function_replace_fail=:
22170+
22171+fi
22172+
22173+if test x"$lt_shell_append" = xyes; then
22174+ sed -e '/^func_append ()$/,/^} # func_append /c\
22175+func_append ()\
22176+{\
22177+ eval "${1}+=\\${2}"\
22178+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
22179+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22180+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22181+test 0 -eq $? || _lt_function_replace_fail=:
22182+
22183+
22184+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
22185+func_append_quoted ()\
22186+{\
22187+\ func_quote_for_eval "${2}"\
22188+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
22189+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
22190+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22191+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22192+test 0 -eq $? || _lt_function_replace_fail=:
22193+
22194+
22195+ # Save a `func_append' function call where possible by direct use of '+='
22196+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
22197+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22198+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22199+ test 0 -eq $? || _lt_function_replace_fail=:
22200+else
22201+ # Save a `func_append' function call even when '+=' is not available
22202+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
22203+ && mv -f "$cfgfile.tmp" "$cfgfile" \
22204+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
22205+ test 0 -eq $? || _lt_function_replace_fail=:
22206+fi
22207+
22208+if test x"$_lt_function_replace_fail" = x":"; then
22209+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
22210+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
22211+fi
22212+
22213+
22214+ mv -f "$cfgfile" "$ofile" ||
22215+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
22216+ chmod +x "$ofile"
22217+
22218+ ;;
22219+
22220+ esac
22221+done # for ac_tag
22222+
22223+
22224+as_fn_exit 0
22225+_ACEOF
22226+ac_clean_files=$ac_clean_files_save
22227+
22228+test $ac_write_fail = 0 ||
22229+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
22230+
22231+
22232+# configure is writing to config.log, and then calls config.status.
22233+# config.status does its own redirection, appending to config.log.
22234+# Unfortunately, on DOS this fails, as config.log is still kept open
22235+# by configure, so config.status won't be able to write to it; its
22236+# output is simply discarded. So we exec the FD to /dev/null,
22237+# effectively closing config.log, so it can be properly (re)opened and
22238+# appended to by config.status. When coming back to configure, we
22239+# need to make the FD available again.
22240+if test "$no_create" != yes; then
22241+ ac_cs_success=:
22242+ ac_config_status_args=
22243+ test "$silent" = yes &&
22244+ ac_config_status_args="$ac_config_status_args --quiet"
22245+ exec 5>/dev/null
22246+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
22247+ exec 5>>config.log
22248+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
22249+ # would make configure fail if this is the last instruction.
22250+ $ac_cs_success || as_fn_exit 1
22251+fi
22252+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
22253+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
22254+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
22255+fi
22256+
22257diff --git a/libclamav/libmspack-0.4alpha/configure.ac b/libclamav/libmspack-0.4alpha/configure.ac
22258new file mode 100644
22259index 000000000000..55fb6ce5ee9d
22260--- /dev/null
22261+++ b/libclamav/libmspack-0.4alpha/configure.ac
22262@@ -0,0 +1,50 @@
22263+# -*- Autoconf -*-
22264+# Process this file with autoconf to produce a configure script.
22265+AC_PREREQ(2.59)
22266+AC_INIT([libmspack],[0.4alpha],[kyzer@4u.net])
22267+AC_CONFIG_MACRO_DIR([m4])
22268+AM_INIT_AUTOMAKE
22269+AC_CONFIG_SRCDIR([mspack/mspack.h])
22270+AC_CONFIG_HEADER([config.h])
22271+
22272+dnl Enable silent rules by default (if yet support in automake)
22273+dnl use 'make V=1' to look at verbose commandline
22274+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
22275+
22276+# --enable-debug option
22277+AC_ARG_ENABLE(debug,
22278+ AS_HELP_STRING(--enable-debug,enable debugging),
22279+ enable_debug=$enableval,
22280+ enable_debug=no)
22281+if test x$enable_debug = xyes; then
22282+ AC_DEFINE(DEBUG, 1, [Turn debugging mode on?])
22283+fi
22284+AM_CONDITIONAL(DEBUG, test x$enable_debug = 'xyes')
22285+
22286+# Checks for programs.
22287+AC_PROG_CC
22288+AM_CONDITIONAL(GCC, test x$GCC = 'xyes')
22289+AC_PROG_INSTALL
22290+LT_INIT
22291+AC_EXEEXT
22292+
22293+# Checks for header files.
22294+AC_HEADER_STDC
22295+AC_CHECK_HEADERS([ctype.h limits.h stdlib.h wctype.h])
22296+
22297+# Checks for typedefs, structures, and compiler characteristics.
22298+AC_C_CONST
22299+AC_C_INLINE
22300+AC_TYPE_MODE_T
22301+AC_TYPE_OFF_T
22302+AC_TYPE_SIZE_T
22303+AC_CHECK_SIZEOF([off_t])
22304+AC_CHECK_FUNCS([tolower towlower])
22305+
22306+# largefile support
22307+AC_SYS_LARGEFILE
22308+AC_FUNC_FSEEKO
22309+
22310+# Checks for library functions.
22311+AC_CONFIG_FILES([Makefile doc/Makefile doc/Doxyfile libmspack.pc])
22312+AC_OUTPUT
22313diff --git a/libclamav/libmspack-0.4alpha/depcomp b/libclamav/libmspack-0.4alpha/depcomp
22314new file mode 100755
22315index 000000000000..bd0ac089584a
22316--- /dev/null
22317+++ b/libclamav/libmspack-0.4alpha/depcomp
22318@@ -0,0 +1,688 @@
22319+#! /bin/sh
22320+# depcomp - compile a program generating dependencies as side-effects
22321+
22322+scriptversion=2011-12-04.11; # UTC
22323+
22324+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
22325+# 2011 Free Software Foundation, Inc.
22326+
22327+# This program is free software; you can redistribute it and/or modify
22328+# it under the terms of the GNU General Public License as published by
22329+# the Free Software Foundation; either version 2, or (at your option)
22330+# any later version.
22331+
22332+# This program is distributed in the hope that it will be useful,
22333+# but WITHOUT ANY WARRANTY; without even the implied warranty of
22334+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22335+# GNU General Public License for more details.
22336+
22337+# You should have received a copy of the GNU General Public License
22338+# along with this program. If not, see <http://www.gnu.org/licenses/>.
22339+
22340+# As a special exception to the GNU General Public License, if you
22341+# distribute this file as part of a program that contains a
22342+# configuration script generated by Autoconf, you may include it under
22343+# the same distribution terms that you use for the rest of that program.
22344+
22345+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
22346+
22347+case $1 in
22348+ '')
22349+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
22350+ exit 1;
22351+ ;;
22352+ -h | --h*)
22353+ cat <<\EOF
22354+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
22355+
22356+Run PROGRAMS ARGS to compile a file, generating dependencies
22357+as side-effects.
22358+
22359+Environment variables:
22360+ depmode Dependency tracking mode.
22361+ source Source file read by `PROGRAMS ARGS'.
22362+ object Object file output by `PROGRAMS ARGS'.
22363+ DEPDIR directory where to store dependencies.
22364+ depfile Dependency file to output.
22365+ tmpdepfile Temporary file to use when outputting dependencies.
22366+ libtool Whether libtool is used (yes/no).
22367+
22368+Report bugs to <bug-automake@gnu.org>.
22369+EOF
22370+ exit $?
22371+ ;;
22372+ -v | --v*)
22373+ echo "depcomp $scriptversion"
22374+ exit $?
22375+ ;;
22376+esac
22377+
22378+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
22379+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
22380+ exit 1
22381+fi
22382+
22383+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
22384+depfile=${depfile-`echo "$object" |
22385+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
22386+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
22387+
22388+rm -f "$tmpdepfile"
22389+
22390+# Some modes work just like other modes, but use different flags. We
22391+# parameterize here, but still list the modes in the big case below,
22392+# to make depend.m4 easier to write. Note that we *cannot* use a case
22393+# here, because this file can only contain one case statement.
22394+if test "$depmode" = hp; then
22395+ # HP compiler uses -M and no extra arg.
22396+ gccflag=-M
22397+ depmode=gcc
22398+fi
22399+
22400+if test "$depmode" = dashXmstdout; then
22401+ # This is just like dashmstdout with a different argument.
22402+ dashmflag=-xM
22403+ depmode=dashmstdout
22404+fi
22405+
22406+cygpath_u="cygpath -u -f -"
22407+if test "$depmode" = msvcmsys; then
22408+ # This is just like msvisualcpp but w/o cygpath translation.
22409+ # Just convert the backslash-escaped backslashes to single forward
22410+ # slashes to satisfy depend.m4
22411+ cygpath_u='sed s,\\\\,/,g'
22412+ depmode=msvisualcpp
22413+fi
22414+
22415+if test "$depmode" = msvc7msys; then
22416+ # This is just like msvc7 but w/o cygpath translation.
22417+ # Just convert the backslash-escaped backslashes to single forward
22418+ # slashes to satisfy depend.m4
22419+ cygpath_u='sed s,\\\\,/,g'
22420+ depmode=msvc7
22421+fi
22422+
22423+case "$depmode" in
22424+gcc3)
22425+## gcc 3 implements dependency tracking that does exactly what
22426+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
22427+## it if -MD -MP comes after the -MF stuff. Hmm.
22428+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
22429+## the command line argument order; so add the flags where they
22430+## appear in depend2.am. Note that the slowdown incurred here
22431+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
22432+ for arg
22433+ do
22434+ case $arg in
22435+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
22436+ *) set fnord "$@" "$arg" ;;
22437+ esac
22438+ shift # fnord
22439+ shift # $arg
22440+ done
22441+ "$@"
22442+ stat=$?
22443+ if test $stat -eq 0; then :
22444+ else
22445+ rm -f "$tmpdepfile"
22446+ exit $stat
22447+ fi
22448+ mv "$tmpdepfile" "$depfile"
22449+ ;;
22450+
22451+gcc)
22452+## There are various ways to get dependency output from gcc. Here's
22453+## why we pick this rather obscure method:
22454+## - Don't want to use -MD because we'd like the dependencies to end
22455+## up in a subdir. Having to rename by hand is ugly.
22456+## (We might end up doing this anyway to support other compilers.)
22457+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
22458+## -MM, not -M (despite what the docs say).
22459+## - Using -M directly means running the compiler twice (even worse
22460+## than renaming).
22461+ if test -z "$gccflag"; then
22462+ gccflag=-MD,
22463+ fi
22464+ "$@" -Wp,"$gccflag$tmpdepfile"
22465+ stat=$?
22466+ if test $stat -eq 0; then :
22467+ else
22468+ rm -f "$tmpdepfile"
22469+ exit $stat
22470+ fi
22471+ rm -f "$depfile"
22472+ echo "$object : \\" > "$depfile"
22473+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
22474+## The second -e expression handles DOS-style file names with drive letters.
22475+ sed -e 's/^[^:]*: / /' \
22476+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
22477+## This next piece of magic avoids the `deleted header file' problem.
22478+## The problem is that when a header file which appears in a .P file
22479+## is deleted, the dependency causes make to die (because there is
22480+## typically no way to rebuild the header). We avoid this by adding
22481+## dummy dependencies for each header file. Too bad gcc doesn't do
22482+## this for us directly.
22483+ tr ' ' '
22484+' < "$tmpdepfile" |
22485+## Some versions of gcc put a space before the `:'. On the theory
22486+## that the space means something, we add a space to the output as
22487+## well. hp depmode also adds that space, but also prefixes the VPATH
22488+## to the object. Take care to not repeat it in the output.
22489+## Some versions of the HPUX 10.20 sed can't process this invocation
22490+## correctly. Breaking it into two sed invocations is a workaround.
22491+ sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
22492+ | sed -e 's/$/ :/' >> "$depfile"
22493+ rm -f "$tmpdepfile"
22494+ ;;
22495+
22496+hp)
22497+ # This case exists only to let depend.m4 do its work. It works by
22498+ # looking at the text of this script. This case will never be run,
22499+ # since it is checked for above.
22500+ exit 1
22501+ ;;
22502+
22503+sgi)
22504+ if test "$libtool" = yes; then
22505+ "$@" "-Wp,-MDupdate,$tmpdepfile"
22506+ else
22507+ "$@" -MDupdate "$tmpdepfile"
22508+ fi
22509+ stat=$?
22510+ if test $stat -eq 0; then :
22511+ else
22512+ rm -f "$tmpdepfile"
22513+ exit $stat
22514+ fi
22515+ rm -f "$depfile"
22516+
22517+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
22518+ echo "$object : \\" > "$depfile"
22519+
22520+ # Clip off the initial element (the dependent). Don't try to be
22521+ # clever and replace this with sed code, as IRIX sed won't handle
22522+ # lines with more than a fixed number of characters (4096 in
22523+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
22524+ # the IRIX cc adds comments like `#:fec' to the end of the
22525+ # dependency line.
22526+ tr ' ' '
22527+' < "$tmpdepfile" \
22528+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
22529+ tr '
22530+' ' ' >> "$depfile"
22531+ echo >> "$depfile"
22532+
22533+ # The second pass generates a dummy entry for each header file.
22534+ tr ' ' '
22535+' < "$tmpdepfile" \
22536+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
22537+ >> "$depfile"
22538+ else
22539+ # The sourcefile does not contain any dependencies, so just
22540+ # store a dummy comment line, to avoid errors with the Makefile
22541+ # "include basename.Plo" scheme.
22542+ echo "#dummy" > "$depfile"
22543+ fi
22544+ rm -f "$tmpdepfile"
22545+ ;;
22546+
22547+aix)
22548+ # The C for AIX Compiler uses -M and outputs the dependencies
22549+ # in a .u file. In older versions, this file always lives in the
22550+ # current directory. Also, the AIX compiler puts `$object:' at the
22551+ # start of each line; $object doesn't have directory information.
22552+ # Version 6 uses the directory in both cases.
22553+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
22554+ test "x$dir" = "x$object" && dir=
22555+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
22556+ if test "$libtool" = yes; then
22557+ tmpdepfile1=$dir$base.u
22558+ tmpdepfile2=$base.u
22559+ tmpdepfile3=$dir.libs/$base.u
22560+ "$@" -Wc,-M
22561+ else
22562+ tmpdepfile1=$dir$base.u
22563+ tmpdepfile2=$dir$base.u
22564+ tmpdepfile3=$dir$base.u
22565+ "$@" -M
22566+ fi
22567+ stat=$?
22568+
22569+ if test $stat -eq 0; then :
22570+ else
22571+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
22572+ exit $stat
22573+ fi
22574+
22575+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
22576+ do
22577+ test -f "$tmpdepfile" && break
22578+ done
22579+ if test -f "$tmpdepfile"; then
22580+ # Each line is of the form `foo.o: dependent.h'.
22581+ # Do two passes, one to just change these to
22582+ # `$object: dependent.h' and one to simply `dependent.h:'.
22583+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
22584+ # That's a tab and a space in the [].
22585+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
22586+ else
22587+ # The sourcefile does not contain any dependencies, so just
22588+ # store a dummy comment line, to avoid errors with the Makefile
22589+ # "include basename.Plo" scheme.
22590+ echo "#dummy" > "$depfile"
22591+ fi
22592+ rm -f "$tmpdepfile"
22593+ ;;
22594+
22595+icc)
22596+ # Intel's C compiler understands `-MD -MF file'. However on
22597+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
22598+ # ICC 7.0 will fill foo.d with something like
22599+ # foo.o: sub/foo.c
22600+ # foo.o: sub/foo.h
22601+ # which is wrong. We want:
22602+ # sub/foo.o: sub/foo.c
22603+ # sub/foo.o: sub/foo.h
22604+ # sub/foo.c:
22605+ # sub/foo.h:
22606+ # ICC 7.1 will output
22607+ # foo.o: sub/foo.c sub/foo.h
22608+ # and will wrap long lines using \ :
22609+ # foo.o: sub/foo.c ... \
22610+ # sub/foo.h ... \
22611+ # ...
22612+
22613+ "$@" -MD -MF "$tmpdepfile"
22614+ stat=$?
22615+ if test $stat -eq 0; then :
22616+ else
22617+ rm -f "$tmpdepfile"
22618+ exit $stat
22619+ fi
22620+ rm -f "$depfile"
22621+ # Each line is of the form `foo.o: dependent.h',
22622+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
22623+ # Do two passes, one to just change these to
22624+ # `$object: dependent.h' and one to simply `dependent.h:'.
22625+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
22626+ # Some versions of the HPUX 10.20 sed can't process this invocation
22627+ # correctly. Breaking it into two sed invocations is a workaround.
22628+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
22629+ sed -e 's/$/ :/' >> "$depfile"
22630+ rm -f "$tmpdepfile"
22631+ ;;
22632+
22633+hp2)
22634+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
22635+ # compilers, which have integrated preprocessors. The correct option
22636+ # to use with these is +Maked; it writes dependencies to a file named
22637+ # 'foo.d', which lands next to the object file, wherever that
22638+ # happens to be.
22639+ # Much of this is similar to the tru64 case; see comments there.
22640+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
22641+ test "x$dir" = "x$object" && dir=
22642+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
22643+ if test "$libtool" = yes; then
22644+ tmpdepfile1=$dir$base.d
22645+ tmpdepfile2=$dir.libs/$base.d
22646+ "$@" -Wc,+Maked
22647+ else
22648+ tmpdepfile1=$dir$base.d
22649+ tmpdepfile2=$dir$base.d
22650+ "$@" +Maked
22651+ fi
22652+ stat=$?
22653+ if test $stat -eq 0; then :
22654+ else
22655+ rm -f "$tmpdepfile1" "$tmpdepfile2"
22656+ exit $stat
22657+ fi
22658+
22659+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
22660+ do
22661+ test -f "$tmpdepfile" && break
22662+ done
22663+ if test -f "$tmpdepfile"; then
22664+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
22665+ # Add `dependent.h:' lines.
22666+ sed -ne '2,${
22667+ s/^ *//
22668+ s/ \\*$//
22669+ s/$/:/
22670+ p
22671+ }' "$tmpdepfile" >> "$depfile"
22672+ else
22673+ echo "#dummy" > "$depfile"
22674+ fi
22675+ rm -f "$tmpdepfile" "$tmpdepfile2"
22676+ ;;
22677+
22678+tru64)
22679+ # The Tru64 compiler uses -MD to generate dependencies as a side
22680+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
22681+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
22682+ # dependencies in `foo.d' instead, so we check for that too.
22683+ # Subdirectories are respected.
22684+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
22685+ test "x$dir" = "x$object" && dir=
22686+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
22687+
22688+ if test "$libtool" = yes; then
22689+ # With Tru64 cc, shared objects can also be used to make a
22690+ # static library. This mechanism is used in libtool 1.4 series to
22691+ # handle both shared and static libraries in a single compilation.
22692+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
22693+ #
22694+ # With libtool 1.5 this exception was removed, and libtool now
22695+ # generates 2 separate objects for the 2 libraries. These two
22696+ # compilations output dependencies in $dir.libs/$base.o.d and
22697+ # in $dir$base.o.d. We have to check for both files, because
22698+ # one of the two compilations can be disabled. We should prefer
22699+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
22700+ # automatically cleaned when .libs/ is deleted, while ignoring
22701+ # the former would cause a distcleancheck panic.
22702+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
22703+ tmpdepfile2=$dir$base.o.d # libtool 1.5
22704+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
22705+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
22706+ "$@" -Wc,-MD
22707+ else
22708+ tmpdepfile1=$dir$base.o.d
22709+ tmpdepfile2=$dir$base.d
22710+ tmpdepfile3=$dir$base.d
22711+ tmpdepfile4=$dir$base.d
22712+ "$@" -MD
22713+ fi
22714+
22715+ stat=$?
22716+ if test $stat -eq 0; then :
22717+ else
22718+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
22719+ exit $stat
22720+ fi
22721+
22722+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
22723+ do
22724+ test -f "$tmpdepfile" && break
22725+ done
22726+ if test -f "$tmpdepfile"; then
22727+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
22728+ # That's a tab and a space in the [].
22729+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
22730+ else
22731+ echo "#dummy" > "$depfile"
22732+ fi
22733+ rm -f "$tmpdepfile"
22734+ ;;
22735+
22736+msvc7)
22737+ if test "$libtool" = yes; then
22738+ showIncludes=-Wc,-showIncludes
22739+ else
22740+ showIncludes=-showIncludes
22741+ fi
22742+ "$@" $showIncludes > "$tmpdepfile"
22743+ stat=$?
22744+ grep -v '^Note: including file: ' "$tmpdepfile"
22745+ if test "$stat" = 0; then :
22746+ else
22747+ rm -f "$tmpdepfile"
22748+ exit $stat
22749+ fi
22750+ rm -f "$depfile"
22751+ echo "$object : \\" > "$depfile"
22752+ # The first sed program below extracts the file names and escapes
22753+ # backslashes for cygpath. The second sed program outputs the file
22754+ # name when reading, but also accumulates all include files in the
22755+ # hold buffer in order to output them again at the end. This only
22756+ # works with sed implementations that can handle large buffers.
22757+ sed < "$tmpdepfile" -n '
22758+/^Note: including file: *\(.*\)/ {
22759+ s//\1/
22760+ s/\\/\\\\/g
22761+ p
22762+}' | $cygpath_u | sort -u | sed -n '
22763+s/ /\\ /g
22764+s/\(.*\)/ \1 \\/p
22765+s/.\(.*\) \\/\1:/
22766+H
22767+$ {
22768+ s/.*/ /
22769+ G
22770+ p
22771+}' >> "$depfile"
22772+ rm -f "$tmpdepfile"
22773+ ;;
22774+
22775+msvc7msys)
22776+ # This case exists only to let depend.m4 do its work. It works by
22777+ # looking at the text of this script. This case will never be run,
22778+ # since it is checked for above.
22779+ exit 1
22780+ ;;
22781+
22782+#nosideeffect)
22783+ # This comment above is used by automake to tell side-effect
22784+ # dependency tracking mechanisms from slower ones.
22785+
22786+dashmstdout)
22787+ # Important note: in order to support this mode, a compiler *must*
22788+ # always write the preprocessed file to stdout, regardless of -o.
22789+ "$@" || exit $?
22790+
22791+ # Remove the call to Libtool.
22792+ if test "$libtool" = yes; then
22793+ while test "X$1" != 'X--mode=compile'; do
22794+ shift
22795+ done
22796+ shift
22797+ fi
22798+
22799+ # Remove `-o $object'.
22800+ IFS=" "
22801+ for arg
22802+ do
22803+ case $arg in
22804+ -o)
22805+ shift
22806+ ;;
22807+ $object)
22808+ shift
22809+ ;;
22810+ *)
22811+ set fnord "$@" "$arg"
22812+ shift # fnord
22813+ shift # $arg
22814+ ;;
22815+ esac
22816+ done
22817+
22818+ test -z "$dashmflag" && dashmflag=-M
22819+ # Require at least two characters before searching for `:'
22820+ # in the target name. This is to cope with DOS-style filenames:
22821+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
22822+ "$@" $dashmflag |
22823+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
22824+ rm -f "$depfile"
22825+ cat < "$tmpdepfile" > "$depfile"
22826+ tr ' ' '
22827+' < "$tmpdepfile" | \
22828+## Some versions of the HPUX 10.20 sed can't process this invocation
22829+## correctly. Breaking it into two sed invocations is a workaround.
22830+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
22831+ rm -f "$tmpdepfile"
22832+ ;;
22833+
22834+dashXmstdout)
22835+ # This case only exists to satisfy depend.m4. It is never actually
22836+ # run, as this mode is specially recognized in the preamble.
22837+ exit 1
22838+ ;;
22839+
22840+makedepend)
22841+ "$@" || exit $?
22842+ # Remove any Libtool call
22843+ if test "$libtool" = yes; then
22844+ while test "X$1" != 'X--mode=compile'; do
22845+ shift
22846+ done
22847+ shift
22848+ fi
22849+ # X makedepend
22850+ shift
22851+ cleared=no eat=no
22852+ for arg
22853+ do
22854+ case $cleared in
22855+ no)
22856+ set ""; shift
22857+ cleared=yes ;;
22858+ esac
22859+ if test $eat = yes; then
22860+ eat=no
22861+ continue
22862+ fi
22863+ case "$arg" in
22864+ -D*|-I*)
22865+ set fnord "$@" "$arg"; shift ;;
22866+ # Strip any option that makedepend may not understand. Remove
22867+ # the object too, otherwise makedepend will parse it as a source file.
22868+ -arch)
22869+ eat=yes ;;
22870+ -*|$object)
22871+ ;;
22872+ *)
22873+ set fnord "$@" "$arg"; shift ;;
22874+ esac
22875+ done
22876+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
22877+ touch "$tmpdepfile"
22878+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
22879+ rm -f "$depfile"
22880+ # makedepend may prepend the VPATH from the source file name to the object.
22881+ # No need to regex-escape $object, excess matching of '.' is harmless.
22882+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
22883+ sed '1,2d' "$tmpdepfile" | tr ' ' '
22884+' | \
22885+## Some versions of the HPUX 10.20 sed can't process this invocation
22886+## correctly. Breaking it into two sed invocations is a workaround.
22887+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
22888+ rm -f "$tmpdepfile" "$tmpdepfile".bak
22889+ ;;
22890+
22891+cpp)
22892+ # Important note: in order to support this mode, a compiler *must*
22893+ # always write the preprocessed file to stdout.
22894+ "$@" || exit $?
22895+
22896+ # Remove the call to Libtool.
22897+ if test "$libtool" = yes; then
22898+ while test "X$1" != 'X--mode=compile'; do
22899+ shift
22900+ done
22901+ shift
22902+ fi
22903+
22904+ # Remove `-o $object'.
22905+ IFS=" "
22906+ for arg
22907+ do
22908+ case $arg in
22909+ -o)
22910+ shift
22911+ ;;
22912+ $object)
22913+ shift
22914+ ;;
22915+ *)
22916+ set fnord "$@" "$arg"
22917+ shift # fnord
22918+ shift # $arg
22919+ ;;
22920+ esac
22921+ done
22922+
22923+ "$@" -E |
22924+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
22925+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
22926+ sed '$ s: \\$::' > "$tmpdepfile"
22927+ rm -f "$depfile"
22928+ echo "$object : \\" > "$depfile"
22929+ cat < "$tmpdepfile" >> "$depfile"
22930+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
22931+ rm -f "$tmpdepfile"
22932+ ;;
22933+
22934+msvisualcpp)
22935+ # Important note: in order to support this mode, a compiler *must*
22936+ # always write the preprocessed file to stdout.
22937+ "$@" || exit $?
22938+
22939+ # Remove the call to Libtool.
22940+ if test "$libtool" = yes; then
22941+ while test "X$1" != 'X--mode=compile'; do
22942+ shift
22943+ done
22944+ shift
22945+ fi
22946+
22947+ IFS=" "
22948+ for arg
22949+ do
22950+ case "$arg" in
22951+ -o)
22952+ shift
22953+ ;;
22954+ $object)
22955+ shift
22956+ ;;
22957+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
22958+ set fnord "$@"
22959+ shift
22960+ shift
22961+ ;;
22962+ *)
22963+ set fnord "$@" "$arg"
22964+ shift
22965+ shift
22966+ ;;
22967+ esac
22968+ done
22969+ "$@" -E 2>/dev/null |
22970+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
22971+ rm -f "$depfile"
22972+ echo "$object : \\" > "$depfile"
22973+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
22974+ echo " " >> "$depfile"
22975+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
22976+ rm -f "$tmpdepfile"
22977+ ;;
22978+
22979+msvcmsys)
22980+ # This case exists only to let depend.m4 do its work. It works by
22981+ # looking at the text of this script. This case will never be run,
22982+ # since it is checked for above.
22983+ exit 1
22984+ ;;
22985+
22986+none)
22987+ exec "$@"
22988+ ;;
22989+
22990+*)
22991+ echo "Unknown depmode $depmode" 1>&2
22992+ exit 1
22993+ ;;
22994+esac
22995+
22996+exit 0
22997+
22998+# Local Variables:
22999+# mode: shell-script
23000+# sh-indentation: 2
23001+# eval: (add-hook 'write-file-hooks 'time-stamp)
23002+# time-stamp-start: "scriptversion="
23003+# time-stamp-format: "%:y-%02m-%02d.%02H"
23004+# time-stamp-time-zone: "UTC"
23005+# time-stamp-end: "; # UTC"
23006+# End:
23007diff --git a/libclamav/libmspack-0.4alpha/install-sh b/libclamav/libmspack-0.4alpha/install-sh
23008new file mode 100755
23009index 000000000000..6781b987bdbc
23010--- /dev/null
23011+++ b/libclamav/libmspack-0.4alpha/install-sh
23012@@ -0,0 +1,520 @@
23013+#!/bin/sh
23014+# install - install a program, script, or datafile
23015+
23016+scriptversion=2009-04-28.21; # UTC
23017+
23018+# This originates from X11R5 (mit/util/scripts/install.sh), which was
23019+# later released in X11R6 (xc/config/util/install.sh) with the
23020+# following copyright and license.
23021+#
23022+# Copyright (C) 1994 X Consortium
23023+#
23024+# Permission is hereby granted, free of charge, to any person obtaining a copy
23025+# of this software and associated documentation files (the "Software"), to
23026+# deal in the Software without restriction, including without limitation the
23027+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
23028+# sell copies of the Software, and to permit persons to whom the Software is
23029+# furnished to do so, subject to the following conditions:
23030+#
23031+# The above copyright notice and this permission notice shall be included in
23032+# all copies or substantial portions of the Software.
23033+#
23034+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23035+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23036+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23037+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23038+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
23039+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23040+#
23041+# Except as contained in this notice, the name of the X Consortium shall not
23042+# be used in advertising or otherwise to promote the sale, use or other deal-
23043+# ings in this Software without prior written authorization from the X Consor-
23044+# tium.
23045+#
23046+#
23047+# FSF changes to this file are in the public domain.
23048+#
23049+# Calling this script install-sh is preferred over install.sh, to prevent
23050+# `make' implicit rules from creating a file called install from it
23051+# when there is no Makefile.
23052+#
23053+# This script is compatible with the BSD install script, but was written
23054+# from scratch.
23055+
23056+nl='
23057+'
23058+IFS=" "" $nl"
23059+
23060+# set DOITPROG to echo to test this script
23061+
23062+# Don't use :- since 4.3BSD and earlier shells don't like it.
23063+doit=${DOITPROG-}
23064+if test -z "$doit"; then
23065+ doit_exec=exec
23066+else
23067+ doit_exec=$doit
23068+fi
23069+
23070+# Put in absolute file names if you don't have them in your path;
23071+# or use environment vars.
23072+
23073+chgrpprog=${CHGRPPROG-chgrp}
23074+chmodprog=${CHMODPROG-chmod}
23075+chownprog=${CHOWNPROG-chown}
23076+cmpprog=${CMPPROG-cmp}
23077+cpprog=${CPPROG-cp}
23078+mkdirprog=${MKDIRPROG-mkdir}
23079+mvprog=${MVPROG-mv}
23080+rmprog=${RMPROG-rm}
23081+stripprog=${STRIPPROG-strip}
23082+
23083+posix_glob='?'
23084+initialize_posix_glob='
23085+ test "$posix_glob" != "?" || {
23086+ if (set -f) 2>/dev/null; then
23087+ posix_glob=
23088+ else
23089+ posix_glob=:
23090+ fi
23091+ }
23092+'
23093+
23094+posix_mkdir=
23095+
23096+# Desired mode of installed file.
23097+mode=0755
23098+
23099+chgrpcmd=
23100+chmodcmd=$chmodprog
23101+chowncmd=
23102+mvcmd=$mvprog
23103+rmcmd="$rmprog -f"
23104+stripcmd=
23105+
23106+src=
23107+dst=
23108+dir_arg=
23109+dst_arg=
23110+
23111+copy_on_change=false
23112+no_target_directory=
23113+
23114+usage="\
23115+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
23116+ or: $0 [OPTION]... SRCFILES... DIRECTORY
23117+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
23118+ or: $0 [OPTION]... -d DIRECTORIES...
23119+
23120+In the 1st form, copy SRCFILE to DSTFILE.
23121+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
23122+In the 4th, create DIRECTORIES.
23123+
23124+Options:
23125+ --help display this help and exit.
23126+ --version display version info and exit.
23127+
23128+ -c (ignored)
23129+ -C install only if different (preserve the last data modification time)
23130+ -d create directories instead of installing files.
23131+ -g GROUP $chgrpprog installed files to GROUP.
23132+ -m MODE $chmodprog installed files to MODE.
23133+ -o USER $chownprog installed files to USER.
23134+ -s $stripprog installed files.
23135+ -t DIRECTORY install into DIRECTORY.
23136+ -T report an error if DSTFILE is a directory.
23137+
23138+Environment variables override the default commands:
23139+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
23140+ RMPROG STRIPPROG
23141+"
23142+
23143+while test $# -ne 0; do
23144+ case $1 in
23145+ -c) ;;
23146+
23147+ -C) copy_on_change=true;;
23148+
23149+ -d) dir_arg=true;;
23150+
23151+ -g) chgrpcmd="$chgrpprog $2"
23152+ shift;;
23153+
23154+ --help) echo "$usage"; exit $?;;
23155+
23156+ -m) mode=$2
23157+ case $mode in
23158+ *' '* | *' '* | *'
23159+'* | *'*'* | *'?'* | *'['*)
23160+ echo "$0: invalid mode: $mode" >&2
23161+ exit 1;;
23162+ esac
23163+ shift;;
23164+
23165+ -o) chowncmd="$chownprog $2"
23166+ shift;;
23167+
23168+ -s) stripcmd=$stripprog;;
23169+
23170+ -t) dst_arg=$2
23171+ shift;;
23172+
23173+ -T) no_target_directory=true;;
23174+
23175+ --version) echo "$0 $scriptversion"; exit $?;;
23176+
23177+ --) shift
23178+ break;;
23179+
23180+ -*) echo "$0: invalid option: $1" >&2
23181+ exit 1;;
23182+
23183+ *) break;;
23184+ esac
23185+ shift
23186+done
23187+
23188+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
23189+ # When -d is used, all remaining arguments are directories to create.
23190+ # When -t is used, the destination is already specified.
23191+ # Otherwise, the last argument is the destination. Remove it from $@.
23192+ for arg
23193+ do
23194+ if test -n "$dst_arg"; then
23195+ # $@ is not empty: it contains at least $arg.
23196+ set fnord "$@" "$dst_arg"
23197+ shift # fnord
23198+ fi
23199+ shift # arg
23200+ dst_arg=$arg
23201+ done
23202+fi
23203+
23204+if test $# -eq 0; then
23205+ if test -z "$dir_arg"; then
23206+ echo "$0: no input file specified." >&2
23207+ exit 1
23208+ fi
23209+ # It's OK to call `install-sh -d' without argument.
23210+ # This can happen when creating conditional directories.
23211+ exit 0
23212+fi
23213+
23214+if test -z "$dir_arg"; then
23215+ trap '(exit $?); exit' 1 2 13 15
23216+
23217+ # Set umask so as not to create temps with too-generous modes.
23218+ # However, 'strip' requires both read and write access to temps.
23219+ case $mode in
23220+ # Optimize common cases.
23221+ *644) cp_umask=133;;
23222+ *755) cp_umask=22;;
23223+
23224+ *[0-7])
23225+ if test -z "$stripcmd"; then
23226+ u_plus_rw=
23227+ else
23228+ u_plus_rw='% 200'
23229+ fi
23230+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
23231+ *)
23232+ if test -z "$stripcmd"; then
23233+ u_plus_rw=
23234+ else
23235+ u_plus_rw=,u+rw
23236+ fi
23237+ cp_umask=$mode$u_plus_rw;;
23238+ esac
23239+fi
23240+
23241+for src
23242+do
23243+ # Protect names starting with `-'.
23244+ case $src in
23245+ -*) src=./$src;;
23246+ esac
23247+
23248+ if test -n "$dir_arg"; then
23249+ dst=$src
23250+ dstdir=$dst
23251+ test -d "$dstdir"
23252+ dstdir_status=$?
23253+ else
23254+
23255+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
23256+ # might cause directories to be created, which would be especially bad
23257+ # if $src (and thus $dsttmp) contains '*'.
23258+ if test ! -f "$src" && test ! -d "$src"; then
23259+ echo "$0: $src does not exist." >&2
23260+ exit 1
23261+ fi
23262+
23263+ if test -z "$dst_arg"; then
23264+ echo "$0: no destination specified." >&2
23265+ exit 1
23266+ fi
23267+
23268+ dst=$dst_arg
23269+ # Protect names starting with `-'.
23270+ case $dst in
23271+ -*) dst=./$dst;;
23272+ esac
23273+
23274+ # If destination is a directory, append the input filename; won't work
23275+ # if double slashes aren't ignored.
23276+ if test -d "$dst"; then
23277+ if test -n "$no_target_directory"; then
23278+ echo "$0: $dst_arg: Is a directory" >&2
23279+ exit 1
23280+ fi
23281+ dstdir=$dst
23282+ dst=$dstdir/`basename "$src"`
23283+ dstdir_status=0
23284+ else
23285+ # Prefer dirname, but fall back on a substitute if dirname fails.
23286+ dstdir=`
23287+ (dirname "$dst") 2>/dev/null ||
23288+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23289+ X"$dst" : 'X\(//\)[^/]' \| \
23290+ X"$dst" : 'X\(//\)$' \| \
23291+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
23292+ echo X"$dst" |
23293+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
23294+ s//\1/
23295+ q
23296+ }
23297+ /^X\(\/\/\)[^/].*/{
23298+ s//\1/
23299+ q
23300+ }
23301+ /^X\(\/\/\)$/{
23302+ s//\1/
23303+ q
23304+ }
23305+ /^X\(\/\).*/{
23306+ s//\1/
23307+ q
23308+ }
23309+ s/.*/./; q'
23310+ `
23311+
23312+ test -d "$dstdir"
23313+ dstdir_status=$?
23314+ fi
23315+ fi
23316+
23317+ obsolete_mkdir_used=false
23318+
23319+ if test $dstdir_status != 0; then
23320+ case $posix_mkdir in
23321+ '')
23322+ # Create intermediate dirs using mode 755 as modified by the umask.
23323+ # This is like FreeBSD 'install' as of 1997-10-28.
23324+ umask=`umask`
23325+ case $stripcmd.$umask in
23326+ # Optimize common cases.
23327+ *[2367][2367]) mkdir_umask=$umask;;
23328+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
23329+
23330+ *[0-7])
23331+ mkdir_umask=`expr $umask + 22 \
23332+ - $umask % 100 % 40 + $umask % 20 \
23333+ - $umask % 10 % 4 + $umask % 2
23334+ `;;
23335+ *) mkdir_umask=$umask,go-w;;
23336+ esac
23337+
23338+ # With -d, create the new directory with the user-specified mode.
23339+ # Otherwise, rely on $mkdir_umask.
23340+ if test -n "$dir_arg"; then
23341+ mkdir_mode=-m$mode
23342+ else
23343+ mkdir_mode=
23344+ fi
23345+
23346+ posix_mkdir=false
23347+ case $umask in
23348+ *[123567][0-7][0-7])
23349+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
23350+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
23351+ ;;
23352+ *)
23353+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
23354+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
23355+
23356+ if (umask $mkdir_umask &&
23357+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
23358+ then
23359+ if test -z "$dir_arg" || {
23360+ # Check for POSIX incompatibilities with -m.
23361+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
23362+ # other-writeable bit of parent directory when it shouldn't.
23363+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
23364+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
23365+ case $ls_ld_tmpdir in
23366+ d????-?r-*) different_mode=700;;
23367+ d????-?--*) different_mode=755;;
23368+ *) false;;
23369+ esac &&
23370+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
23371+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
23372+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
23373+ }
23374+ }
23375+ then posix_mkdir=:
23376+ fi
23377+ rmdir "$tmpdir/d" "$tmpdir"
23378+ else
23379+ # Remove any dirs left behind by ancient mkdir implementations.
23380+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
23381+ fi
23382+ trap '' 0;;
23383+ esac;;
23384+ esac
23385+
23386+ if
23387+ $posix_mkdir && (
23388+ umask $mkdir_umask &&
23389+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
23390+ )
23391+ then :
23392+ else
23393+
23394+ # The umask is ridiculous, or mkdir does not conform to POSIX,
23395+ # or it failed possibly due to a race condition. Create the
23396+ # directory the slow way, step by step, checking for races as we go.
23397+
23398+ case $dstdir in
23399+ /*) prefix='/';;
23400+ -*) prefix='./';;
23401+ *) prefix='';;
23402+ esac
23403+
23404+ eval "$initialize_posix_glob"
23405+
23406+ oIFS=$IFS
23407+ IFS=/
23408+ $posix_glob set -f
23409+ set fnord $dstdir
23410+ shift
23411+ $posix_glob set +f
23412+ IFS=$oIFS
23413+
23414+ prefixes=
23415+
23416+ for d
23417+ do
23418+ test -z "$d" && continue
23419+
23420+ prefix=$prefix$d
23421+ if test -d "$prefix"; then
23422+ prefixes=
23423+ else
23424+ if $posix_mkdir; then
23425+ (umask=$mkdir_umask &&
23426+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
23427+ # Don't fail if two instances are running concurrently.
23428+ test -d "$prefix" || exit 1
23429+ else
23430+ case $prefix in
23431+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
23432+ *) qprefix=$prefix;;
23433+ esac
23434+ prefixes="$prefixes '$qprefix'"
23435+ fi
23436+ fi
23437+ prefix=$prefix/
23438+ done
23439+
23440+ if test -n "$prefixes"; then
23441+ # Don't fail if two instances are running concurrently.
23442+ (umask $mkdir_umask &&
23443+ eval "\$doit_exec \$mkdirprog $prefixes") ||
23444+ test -d "$dstdir" || exit 1
23445+ obsolete_mkdir_used=true
23446+ fi
23447+ fi
23448+ fi
23449+
23450+ if test -n "$dir_arg"; then
23451+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
23452+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
23453+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
23454+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
23455+ else
23456+
23457+ # Make a couple of temp file names in the proper directory.
23458+ dsttmp=$dstdir/_inst.$$_
23459+ rmtmp=$dstdir/_rm.$$_
23460+
23461+ # Trap to clean up those temp files at exit.
23462+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
23463+
23464+ # Copy the file name to the temp name.
23465+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
23466+
23467+ # and set any options; do chmod last to preserve setuid bits.
23468+ #
23469+ # If any of these fail, we abort the whole thing. If we want to
23470+ # ignore errors from any of these, just make sure not to ignore
23471+ # errors from the above "$doit $cpprog $src $dsttmp" command.
23472+ #
23473+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
23474+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
23475+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
23476+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
23477+
23478+ # If -C, don't bother to copy if it wouldn't change the file.
23479+ if $copy_on_change &&
23480+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
23481+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
23482+
23483+ eval "$initialize_posix_glob" &&
23484+ $posix_glob set -f &&
23485+ set X $old && old=:$2:$4:$5:$6 &&
23486+ set X $new && new=:$2:$4:$5:$6 &&
23487+ $posix_glob set +f &&
23488+
23489+ test "$old" = "$new" &&
23490+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
23491+ then
23492+ rm -f "$dsttmp"
23493+ else
23494+ # Rename the file to the real destination.
23495+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
23496+
23497+ # The rename failed, perhaps because mv can't rename something else
23498+ # to itself, or perhaps because mv is so ancient that it does not
23499+ # support -f.
23500+ {
23501+ # Now remove or move aside any old file at destination location.
23502+ # We try this two ways since rm can't unlink itself on some
23503+ # systems and the destination file might be busy for other
23504+ # reasons. In this case, the final cleanup might fail but the new
23505+ # file should still install successfully.
23506+ {
23507+ test ! -f "$dst" ||
23508+ $doit $rmcmd -f "$dst" 2>/dev/null ||
23509+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
23510+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
23511+ } ||
23512+ { echo "$0: cannot unlink or rename $dst" >&2
23513+ (exit 1); exit 1
23514+ }
23515+ } &&
23516+
23517+ # Now rename the file to the real destination.
23518+ $doit $mvcmd "$dsttmp" "$dst"
23519+ }
23520+ fi || exit 1
23521+
23522+ trap '' 0
23523+ fi
23524+done
23525+
23526+# Local variables:
23527+# eval: (add-hook 'write-file-hooks 'time-stamp)
23528+# time-stamp-start: "scriptversion="
23529+# time-stamp-format: "%:y-%02m-%02d.%02H"
23530+# time-stamp-time-zone: "UTC"
23531+# time-stamp-end: "; # UTC"
23532+# End:
23533diff --git a/libclamav/libmspack-0.4alpha/libmspack.pc.in b/libclamav/libmspack-0.4alpha/libmspack.pc.in
23534new file mode 100644
23535index 000000000000..44b09f350580
23536--- /dev/null
23537+++ b/libclamav/libmspack-0.4alpha/libmspack.pc.in
23538@@ -0,0 +1,10 @@
23539+prefix=@prefix@
23540+exec_prefix=@exec_prefix@
23541+libdir=@libdir@
23542+includedir=@includedir@
23543+
23544+Name: @PACKAGE@
23545+Description: Compressors and decompressors for Microsoft formats
23546+Version: @VERSION@
23547+Libs: -L${libdir} -lmspack
23548+Cflags: -I${includedir}
23549diff --git a/libclamav/libmspack-0.4alpha/ltmain.sh b/libclamav/libmspack-0.4alpha/ltmain.sh
23550new file mode 100644
23551index 000000000000..c2852d856135
23552--- /dev/null
23553+++ b/libclamav/libmspack-0.4alpha/ltmain.sh
23554@@ -0,0 +1,9661 @@
23555+
23556+# libtool (GNU libtool) 2.4.2
23557+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
23558+
23559+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
23560+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
23561+# This is free software; see the source for copying conditions. There is NO
23562+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23563+
23564+# GNU Libtool is free software; you can redistribute it and/or modify
23565+# it under the terms of the GNU General Public License as published by
23566+# the Free Software Foundation; either version 2 of the License, or
23567+# (at your option) any later version.
23568+#
23569+# As a special exception to the GNU General Public License,
23570+# if you distribute this file as part of a program or library that
23571+# is built using GNU Libtool, you may include this file under the
23572+# same distribution terms that you use for the rest of that program.
23573+#
23574+# GNU Libtool is distributed in the hope that it will be useful, but
23575+# WITHOUT ANY WARRANTY; without even the implied warranty of
23576+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23577+# General Public License for more details.
23578+#
23579+# You should have received a copy of the GNU General Public License
23580+# along with GNU Libtool; see the file COPYING. If not, a copy
23581+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
23582+# or obtained by writing to the Free Software Foundation, Inc.,
23583+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23584+
23585+# Usage: $progname [OPTION]... [MODE-ARG]...
23586+#
23587+# Provide generalized library-building support services.
23588+#
23589+# --config show all configuration variables
23590+# --debug enable verbose shell tracing
23591+# -n, --dry-run display commands without modifying any files
23592+# --features display basic configuration information and exit
23593+# --mode=MODE use operation mode MODE
23594+# --preserve-dup-deps don't remove duplicate dependency libraries
23595+# --quiet, --silent don't print informational messages
23596+# --no-quiet, --no-silent
23597+# print informational messages (default)
23598+# --no-warn don't display warning messages
23599+# --tag=TAG use configuration variables from tag TAG
23600+# -v, --verbose print more informational messages than default
23601+# --no-verbose don't print the extra informational messages
23602+# --version print version information
23603+# -h, --help, --help-all print short, long, or detailed help message
23604+#
23605+# MODE must be one of the following:
23606+#
23607+# clean remove files from the build directory
23608+# compile compile a source file into a libtool object
23609+# execute automatically set library path, then run a program
23610+# finish complete the installation of libtool libraries
23611+# install install libraries or executables
23612+# link create a library or an executable
23613+# uninstall remove libraries from an installed directory
23614+#
23615+# MODE-ARGS vary depending on the MODE. When passed as first option,
23616+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
23617+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
23618+#
23619+# When reporting a bug, please describe a test case to reproduce it and
23620+# include the following information:
23621+#
23622+# host-triplet: $host
23623+# shell: $SHELL
23624+# compiler: $LTCC
23625+# compiler flags: $LTCFLAGS
23626+# linker: $LD (gnu? $with_gnu_ld)
23627+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
23628+# automake: $automake_version
23629+# autoconf: $autoconf_version
23630+#
23631+# Report bugs to <bug-libtool@gnu.org>.
23632+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
23633+# General help using GNU software: <http://www.gnu.org/gethelp/>.
23634+
23635+PROGRAM=libtool
23636+PACKAGE=libtool
23637+VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
23638+TIMESTAMP=""
23639+package_revision=1.3337
23640+
23641+# Be Bourne compatible
23642+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23643+ emulate sh
23644+ NULLCMD=:
23645+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
23646+ # is contrary to our usage. Disable this feature.
23647+ alias -g '${1+"$@"}'='"$@"'
23648+ setopt NO_GLOB_SUBST
23649+else
23650+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
23651+fi
23652+BIN_SH=xpg4; export BIN_SH # for Tru64
23653+DUALCASE=1; export DUALCASE # for MKS sh
23654+
23655+# A function that is used when there is no print builtin or printf.
23656+func_fallback_echo ()
23657+{
23658+ eval 'cat <<_LTECHO_EOF
23659+$1
23660+_LTECHO_EOF'
23661+}
23662+
23663+# NLS nuisances: We save the old values to restore during execute mode.
23664+lt_user_locale=
23665+lt_safe_locale=
23666+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
23667+do
23668+ eval "if test \"\${$lt_var+set}\" = set; then
23669+ save_$lt_var=\$$lt_var
23670+ $lt_var=C
23671+ export $lt_var
23672+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
23673+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
23674+ fi"
23675+done
23676+LC_ALL=C
23677+LANGUAGE=C
23678+export LANGUAGE LC_ALL
23679+
23680+$lt_unset CDPATH
23681+
23682+
23683+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
23684+# is ksh but when the shell is invoked as "sh" and the current value of
23685+# the _XPG environment variable is not equal to 1 (one), the special
23686+# positional parameter $0, within a function call, is the name of the
23687+# function.
23688+progpath="$0"
23689+
23690+
23691+
23692+: ${CP="cp -f"}
23693+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
23694+: ${MAKE="make"}
23695+: ${MKDIR="mkdir"}
23696+: ${MV="mv -f"}
23697+: ${RM="rm -f"}
23698+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
23699+: ${Xsed="$SED -e 1s/^X//"}
23700+
23701+# Global variables:
23702+EXIT_SUCCESS=0
23703+EXIT_FAILURE=1
23704+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
23705+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
23706+
23707+exit_status=$EXIT_SUCCESS
23708+
23709+# Make sure IFS has a sensible default
23710+lt_nl='
23711+'
23712+IFS=" $lt_nl"
23713+
23714+dirname="s,/[^/]*$,,"
23715+basename="s,^.*/,,"
23716+
23717+# func_dirname file append nondir_replacement
23718+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
23719+# otherwise set result to NONDIR_REPLACEMENT.
23720+func_dirname ()
23721+{
23722+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
23723+ if test "X$func_dirname_result" = "X${1}"; then
23724+ func_dirname_result="${3}"
23725+ else
23726+ func_dirname_result="$func_dirname_result${2}"
23727+ fi
23728+} # func_dirname may be replaced by extended shell implementation
23729+
23730+
23731+# func_basename file
23732+func_basename ()
23733+{
23734+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
23735+} # func_basename may be replaced by extended shell implementation
23736+
23737+
23738+# func_dirname_and_basename file append nondir_replacement
23739+# perform func_basename and func_dirname in a single function
23740+# call:
23741+# dirname: Compute the dirname of FILE. If nonempty,
23742+# add APPEND to the result, otherwise set result
23743+# to NONDIR_REPLACEMENT.
23744+# value returned in "$func_dirname_result"
23745+# basename: Compute filename of FILE.
23746+# value retuned in "$func_basename_result"
23747+# Implementation must be kept synchronized with func_dirname
23748+# and func_basename. For efficiency, we do not delegate to
23749+# those functions but instead duplicate the functionality here.
23750+func_dirname_and_basename ()
23751+{
23752+ # Extract subdirectory from the argument.
23753+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
23754+ if test "X$func_dirname_result" = "X${1}"; then
23755+ func_dirname_result="${3}"
23756+ else
23757+ func_dirname_result="$func_dirname_result${2}"
23758+ fi
23759+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
23760+} # func_dirname_and_basename may be replaced by extended shell implementation
23761+
23762+
23763+# func_stripname prefix suffix name
23764+# strip PREFIX and SUFFIX off of NAME.
23765+# PREFIX and SUFFIX must not contain globbing or regex special
23766+# characters, hashes, percent signs, but SUFFIX may contain a leading
23767+# dot (in which case that matches only a dot).
23768+# func_strip_suffix prefix name
23769+func_stripname ()
23770+{
23771+ case ${2} in
23772+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
23773+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
23774+ esac
23775+} # func_stripname may be replaced by extended shell implementation
23776+
23777+
23778+# These SED scripts presuppose an absolute path with a trailing slash.
23779+pathcar='s,^/\([^/]*\).*$,\1,'
23780+pathcdr='s,^/[^/]*,,'
23781+removedotparts=':dotsl
23782+ s@/\./@/@g
23783+ t dotsl
23784+ s,/\.$,/,'
23785+collapseslashes='s@/\{1,\}@/@g'
23786+finalslash='s,/*$,/,'
23787+
23788+# func_normal_abspath PATH
23789+# Remove doubled-up and trailing slashes, "." path components,
23790+# and cancel out any ".." path components in PATH after making
23791+# it an absolute path.
23792+# value returned in "$func_normal_abspath_result"
23793+func_normal_abspath ()
23794+{
23795+ # Start from root dir and reassemble the path.
23796+ func_normal_abspath_result=
23797+ func_normal_abspath_tpath=$1
23798+ func_normal_abspath_altnamespace=
23799+ case $func_normal_abspath_tpath in
23800+ "")
23801+ # Empty path, that just means $cwd.
23802+ func_stripname '' '/' "`pwd`"
23803+ func_normal_abspath_result=$func_stripname_result
23804+ return
23805+ ;;
23806+ # The next three entries are used to spot a run of precisely
23807+ # two leading slashes without using negated character classes;
23808+ # we take advantage of case's first-match behaviour.
23809+ ///*)
23810+ # Unusual form of absolute path, do nothing.
23811+ ;;
23812+ //*)
23813+ # Not necessarily an ordinary path; POSIX reserves leading '//'
23814+ # and for example Cygwin uses it to access remote file shares
23815+ # over CIFS/SMB, so we conserve a leading double slash if found.
23816+ func_normal_abspath_altnamespace=/
23817+ ;;
23818+ /*)
23819+ # Absolute path, do nothing.
23820+ ;;
23821+ *)
23822+ # Relative path, prepend $cwd.
23823+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
23824+ ;;
23825+ esac
23826+ # Cancel out all the simple stuff to save iterations. We also want
23827+ # the path to end with a slash for ease of parsing, so make sure
23828+ # there is one (and only one) here.
23829+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
23830+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
23831+ while :; do
23832+ # Processed it all yet?
23833+ if test "$func_normal_abspath_tpath" = / ; then
23834+ # If we ascended to the root using ".." the result may be empty now.
23835+ if test -z "$func_normal_abspath_result" ; then
23836+ func_normal_abspath_result=/
23837+ fi
23838+ break
23839+ fi
23840+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
23841+ -e "$pathcar"`
23842+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
23843+ -e "$pathcdr"`
23844+ # Figure out what to do with it
23845+ case $func_normal_abspath_tcomponent in
23846+ "")
23847+ # Trailing empty path component, ignore it.
23848+ ;;
23849+ ..)
23850+ # Parent dir; strip last assembled component from result.
23851+ func_dirname "$func_normal_abspath_result"
23852+ func_normal_abspath_result=$func_dirname_result
23853+ ;;
23854+ *)
23855+ # Actual path component, append it.
23856+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
23857+ ;;
23858+ esac
23859+ done
23860+ # Restore leading double-slash if one was found on entry.
23861+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
23862+}
23863+
23864+# func_relative_path SRCDIR DSTDIR
23865+# generates a relative path from SRCDIR to DSTDIR, with a trailing
23866+# slash if non-empty, suitable for immediately appending a filename
23867+# without needing to append a separator.
23868+# value returned in "$func_relative_path_result"
23869+func_relative_path ()
23870+{
23871+ func_relative_path_result=
23872+ func_normal_abspath "$1"
23873+ func_relative_path_tlibdir=$func_normal_abspath_result
23874+ func_normal_abspath "$2"
23875+ func_relative_path_tbindir=$func_normal_abspath_result
23876+
23877+ # Ascend the tree starting from libdir
23878+ while :; do
23879+ # check if we have found a prefix of bindir
23880+ case $func_relative_path_tbindir in
23881+ $func_relative_path_tlibdir)
23882+ # found an exact match
23883+ func_relative_path_tcancelled=
23884+ break
23885+ ;;
23886+ $func_relative_path_tlibdir*)
23887+ # found a matching prefix
23888+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
23889+ func_relative_path_tcancelled=$func_stripname_result
23890+ if test -z "$func_relative_path_result"; then
23891+ func_relative_path_result=.
23892+ fi
23893+ break
23894+ ;;
23895+ *)
23896+ func_dirname $func_relative_path_tlibdir
23897+ func_relative_path_tlibdir=${func_dirname_result}
23898+ if test "x$func_relative_path_tlibdir" = x ; then
23899+ # Have to descend all the way to the root!
23900+ func_relative_path_result=../$func_relative_path_result
23901+ func_relative_path_tcancelled=$func_relative_path_tbindir
23902+ break
23903+ fi
23904+ func_relative_path_result=../$func_relative_path_result
23905+ ;;
23906+ esac
23907+ done
23908+
23909+ # Now calculate path; take care to avoid doubling-up slashes.
23910+ func_stripname '' '/' "$func_relative_path_result"
23911+ func_relative_path_result=$func_stripname_result
23912+ func_stripname '/' '/' "$func_relative_path_tcancelled"
23913+ if test "x$func_stripname_result" != x ; then
23914+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
23915+ fi
23916+
23917+ # Normalisation. If bindir is libdir, return empty string,
23918+ # else relative path ending with a slash; either way, target
23919+ # file name can be directly appended.
23920+ if test ! -z "$func_relative_path_result"; then
23921+ func_stripname './' '' "$func_relative_path_result/"
23922+ func_relative_path_result=$func_stripname_result
23923+ fi
23924+}
23925+
23926+# The name of this program:
23927+func_dirname_and_basename "$progpath"
23928+progname=$func_basename_result
23929+
23930+# Make sure we have an absolute path for reexecution:
23931+case $progpath in
23932+ [\\/]*|[A-Za-z]:\\*) ;;
23933+ *[\\/]*)
23934+ progdir=$func_dirname_result
23935+ progdir=`cd "$progdir" && pwd`
23936+ progpath="$progdir/$progname"
23937+ ;;
23938+ *)
23939+ save_IFS="$IFS"
23940+ IFS=${PATH_SEPARATOR-:}
23941+ for progdir in $PATH; do
23942+ IFS="$save_IFS"
23943+ test -x "$progdir/$progname" && break
23944+ done
23945+ IFS="$save_IFS"
23946+ test -n "$progdir" || progdir=`pwd`
23947+ progpath="$progdir/$progname"
23948+ ;;
23949+esac
23950+
23951+# Sed substitution that helps us do robust quoting. It backslashifies
23952+# metacharacters that are still active within double-quoted strings.
23953+Xsed="${SED}"' -e 1s/^X//'
23954+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
23955+
23956+# Same as above, but do not quote variable references.
23957+double_quote_subst='s/\(["`\\]\)/\\\1/g'
23958+
23959+# Sed substitution that turns a string into a regex matching for the
23960+# string literally.
23961+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
23962+
23963+# Sed substitution that converts a w32 file name or path
23964+# which contains forward slashes, into one that contains
23965+# (escaped) backslashes. A very naive implementation.
23966+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
23967+
23968+# Re-`\' parameter expansions in output of double_quote_subst that were
23969+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
23970+# in input to double_quote_subst, that '$' was protected from expansion.
23971+# Since each input `\' is now two `\'s, look for any number of runs of
23972+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
23973+bs='\\'
23974+bs2='\\\\'
23975+bs4='\\\\\\\\'
23976+dollar='\$'
23977+sed_double_backslash="\
23978+ s/$bs4/&\\
23979+/g
23980+ s/^$bs2$dollar/$bs&/
23981+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
23982+ s/\n//g"
23983+
23984+# Standard options:
23985+opt_dry_run=false
23986+opt_help=false
23987+opt_quiet=false
23988+opt_verbose=false
23989+opt_warning=:
23990+
23991+# func_echo arg...
23992+# Echo program name prefixed message, along with the current mode
23993+# name if it has been set yet.
23994+func_echo ()
23995+{
23996+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
23997+}
23998+
23999+# func_verbose arg...
24000+# Echo program name prefixed message in verbose mode only.
24001+func_verbose ()
24002+{
24003+ $opt_verbose && func_echo ${1+"$@"}
24004+
24005+ # A bug in bash halts the script if the last line of a function
24006+ # fails when set -e is in force, so we need another command to
24007+ # work around that:
24008+ :
24009+}
24010+
24011+# func_echo_all arg...
24012+# Invoke $ECHO with all args, space-separated.
24013+func_echo_all ()
24014+{
24015+ $ECHO "$*"
24016+}
24017+
24018+# func_error arg...
24019+# Echo program name prefixed message to standard error.
24020+func_error ()
24021+{
24022+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
24023+}
24024+
24025+# func_warning arg...
24026+# Echo program name prefixed warning message to standard error.
24027+func_warning ()
24028+{
24029+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
24030+
24031+ # bash bug again:
24032+ :
24033+}
24034+
24035+# func_fatal_error arg...
24036+# Echo program name prefixed message to standard error, and exit.
24037+func_fatal_error ()
24038+{
24039+ func_error ${1+"$@"}
24040+ exit $EXIT_FAILURE
24041+}
24042+
24043+# func_fatal_help arg...
24044+# Echo program name prefixed message to standard error, followed by
24045+# a help hint, and exit.
24046+func_fatal_help ()
24047+{
24048+ func_error ${1+"$@"}
24049+ func_fatal_error "$help"
24050+}
24051+help="Try \`$progname --help' for more information." ## default
24052+
24053+
24054+# func_grep expression filename
24055+# Check whether EXPRESSION matches any line of FILENAME, without output.
24056+func_grep ()
24057+{
24058+ $GREP "$1" "$2" >/dev/null 2>&1
24059+}
24060+
24061+
24062+# func_mkdir_p directory-path
24063+# Make sure the entire path to DIRECTORY-PATH is available.
24064+func_mkdir_p ()
24065+{
24066+ my_directory_path="$1"
24067+ my_dir_list=
24068+
24069+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
24070+
24071+ # Protect directory names starting with `-'
24072+ case $my_directory_path in
24073+ -*) my_directory_path="./$my_directory_path" ;;
24074+ esac
24075+
24076+ # While some portion of DIR does not yet exist...
24077+ while test ! -d "$my_directory_path"; do
24078+ # ...make a list in topmost first order. Use a colon delimited
24079+ # list incase some portion of path contains whitespace.
24080+ my_dir_list="$my_directory_path:$my_dir_list"
24081+
24082+ # If the last portion added has no slash in it, the list is done
24083+ case $my_directory_path in */*) ;; *) break ;; esac
24084+
24085+ # ...otherwise throw away the child directory and loop
24086+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
24087+ done
24088+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
24089+
24090+ save_mkdir_p_IFS="$IFS"; IFS=':'
24091+ for my_dir in $my_dir_list; do
24092+ IFS="$save_mkdir_p_IFS"
24093+ # mkdir can fail with a `File exist' error if two processes
24094+ # try to create one of the directories concurrently. Don't
24095+ # stop in that case!
24096+ $MKDIR "$my_dir" 2>/dev/null || :
24097+ done
24098+ IFS="$save_mkdir_p_IFS"
24099+
24100+ # Bail out if we (or some other process) failed to create a directory.
24101+ test -d "$my_directory_path" || \
24102+ func_fatal_error "Failed to create \`$1'"
24103+ fi
24104+}
24105+
24106+
24107+# func_mktempdir [string]
24108+# Make a temporary directory that won't clash with other running
24109+# libtool processes, and avoids race conditions if possible. If
24110+# given, STRING is the basename for that directory.
24111+func_mktempdir ()
24112+{
24113+ my_template="${TMPDIR-/tmp}/${1-$progname}"
24114+
24115+ if test "$opt_dry_run" = ":"; then
24116+ # Return a directory name, but don't create it in dry-run mode
24117+ my_tmpdir="${my_template}-$$"
24118+ else
24119+
24120+ # If mktemp works, use that first and foremost
24121+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
24122+
24123+ if test ! -d "$my_tmpdir"; then
24124+ # Failing that, at least try and use $RANDOM to avoid a race
24125+ my_tmpdir="${my_template}-${RANDOM-0}$$"
24126+
24127+ save_mktempdir_umask=`umask`
24128+ umask 0077
24129+ $MKDIR "$my_tmpdir"
24130+ umask $save_mktempdir_umask
24131+ fi
24132+
24133+ # If we're not in dry-run mode, bomb out on failure
24134+ test -d "$my_tmpdir" || \
24135+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
24136+ fi
24137+
24138+ $ECHO "$my_tmpdir"
24139+}
24140+
24141+
24142+# func_quote_for_eval arg
24143+# Aesthetically quote ARG to be evaled later.
24144+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
24145+# is double-quoted, suitable for a subsequent eval, whereas
24146+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
24147+# which are still active within double quotes backslashified.
24148+func_quote_for_eval ()
24149+{
24150+ case $1 in
24151+ *[\\\`\"\$]*)
24152+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
24153+ *)
24154+ func_quote_for_eval_unquoted_result="$1" ;;
24155+ esac
24156+
24157+ case $func_quote_for_eval_unquoted_result in
24158+ # Double-quote args containing shell metacharacters to delay
24159+ # word splitting, command substitution and and variable
24160+ # expansion for a subsequent eval.
24161+ # Many Bourne shells cannot handle close brackets correctly
24162+ # in scan sets, so we specify it separately.
24163+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
24164+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
24165+ ;;
24166+ *)
24167+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
24168+ esac
24169+}
24170+
24171+
24172+# func_quote_for_expand arg
24173+# Aesthetically quote ARG to be evaled later; same as above,
24174+# but do not quote variable references.
24175+func_quote_for_expand ()
24176+{
24177+ case $1 in
24178+ *[\\\`\"]*)
24179+ my_arg=`$ECHO "$1" | $SED \
24180+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
24181+ *)
24182+ my_arg="$1" ;;
24183+ esac
24184+
24185+ case $my_arg in
24186+ # Double-quote args containing shell metacharacters to delay
24187+ # word splitting and command substitution for a subsequent eval.
24188+ # Many Bourne shells cannot handle close brackets correctly
24189+ # in scan sets, so we specify it separately.
24190+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
24191+ my_arg="\"$my_arg\""
24192+ ;;
24193+ esac
24194+
24195+ func_quote_for_expand_result="$my_arg"
24196+}
24197+
24198+
24199+# func_show_eval cmd [fail_exp]
24200+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
24201+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
24202+# is given, then evaluate it.
24203+func_show_eval ()
24204+{
24205+ my_cmd="$1"
24206+ my_fail_exp="${2-:}"
24207+
24208+ ${opt_silent-false} || {
24209+ func_quote_for_expand "$my_cmd"
24210+ eval "func_echo $func_quote_for_expand_result"
24211+ }
24212+
24213+ if ${opt_dry_run-false}; then :; else
24214+ eval "$my_cmd"
24215+ my_status=$?
24216+ if test "$my_status" -eq 0; then :; else
24217+ eval "(exit $my_status); $my_fail_exp"
24218+ fi
24219+ fi
24220+}
24221+
24222+
24223+# func_show_eval_locale cmd [fail_exp]
24224+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
24225+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
24226+# is given, then evaluate it. Use the saved locale for evaluation.
24227+func_show_eval_locale ()
24228+{
24229+ my_cmd="$1"
24230+ my_fail_exp="${2-:}"
24231+
24232+ ${opt_silent-false} || {
24233+ func_quote_for_expand "$my_cmd"
24234+ eval "func_echo $func_quote_for_expand_result"
24235+ }
24236+
24237+ if ${opt_dry_run-false}; then :; else
24238+ eval "$lt_user_locale
24239+ $my_cmd"
24240+ my_status=$?
24241+ eval "$lt_safe_locale"
24242+ if test "$my_status" -eq 0; then :; else
24243+ eval "(exit $my_status); $my_fail_exp"
24244+ fi
24245+ fi
24246+}
24247+
24248+# func_tr_sh
24249+# Turn $1 into a string suitable for a shell variable name.
24250+# Result is stored in $func_tr_sh_result. All characters
24251+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
24252+# if $1 begins with a digit, a '_' is prepended as well.
24253+func_tr_sh ()
24254+{
24255+ case $1 in
24256+ [0-9]* | *[!a-zA-Z0-9_]*)
24257+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
24258+ ;;
24259+ * )
24260+ func_tr_sh_result=$1
24261+ ;;
24262+ esac
24263+}
24264+
24265+
24266+# func_version
24267+# Echo version message to standard output and exit.
24268+func_version ()
24269+{
24270+ $opt_debug
24271+
24272+ $SED -n '/(C)/!b go
24273+ :more
24274+ /\./!{
24275+ N
24276+ s/\n# / /
24277+ b more
24278+ }
24279+ :go
24280+ /^# '$PROGRAM' (GNU /,/# warranty; / {
24281+ s/^# //
24282+ s/^# *$//
24283+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
24284+ p
24285+ }' < "$progpath"
24286+ exit $?
24287+}
24288+
24289+# func_usage
24290+# Echo short help message to standard output and exit.
24291+func_usage ()
24292+{
24293+ $opt_debug
24294+
24295+ $SED -n '/^# Usage:/,/^# *.*--help/ {
24296+ s/^# //
24297+ s/^# *$//
24298+ s/\$progname/'$progname'/
24299+ p
24300+ }' < "$progpath"
24301+ echo
24302+ $ECHO "run \`$progname --help | more' for full usage"
24303+ exit $?
24304+}
24305+
24306+# func_help [NOEXIT]
24307+# Echo long help message to standard output and exit,
24308+# unless 'noexit' is passed as argument.
24309+func_help ()
24310+{
24311+ $opt_debug
24312+
24313+ $SED -n '/^# Usage:/,/# Report bugs to/ {
24314+ :print
24315+ s/^# //
24316+ s/^# *$//
24317+ s*\$progname*'$progname'*
24318+ s*\$host*'"$host"'*
24319+ s*\$SHELL*'"$SHELL"'*
24320+ s*\$LTCC*'"$LTCC"'*
24321+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
24322+ s*\$LD*'"$LD"'*
24323+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
24324+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
24325+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
24326+ p
24327+ d
24328+ }
24329+ /^# .* home page:/b print
24330+ /^# General help using/b print
24331+ ' < "$progpath"
24332+ ret=$?
24333+ if test -z "$1"; then
24334+ exit $ret
24335+ fi
24336+}
24337+
24338+# func_missing_arg argname
24339+# Echo program name prefixed message to standard error and set global
24340+# exit_cmd.
24341+func_missing_arg ()
24342+{
24343+ $opt_debug
24344+
24345+ func_error "missing argument for $1."
24346+ exit_cmd=exit
24347+}
24348+
24349+
24350+# func_split_short_opt shortopt
24351+# Set func_split_short_opt_name and func_split_short_opt_arg shell
24352+# variables after splitting SHORTOPT after the 2nd character.
24353+func_split_short_opt ()
24354+{
24355+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
24356+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
24357+
24358+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
24359+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
24360+} # func_split_short_opt may be replaced by extended shell implementation
24361+
24362+
24363+# func_split_long_opt longopt
24364+# Set func_split_long_opt_name and func_split_long_opt_arg shell
24365+# variables after splitting LONGOPT at the `=' sign.
24366+func_split_long_opt ()
24367+{
24368+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
24369+ my_sed_long_arg='1s/^--[^=]*=//'
24370+
24371+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
24372+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
24373+} # func_split_long_opt may be replaced by extended shell implementation
24374+
24375+exit_cmd=:
24376+
24377+
24378+
24379+
24380+
24381+magic="%%%MAGIC variable%%%"
24382+magic_exe="%%%MAGIC EXE variable%%%"
24383+
24384+# Global variables.
24385+nonopt=
24386+preserve_args=
24387+lo2o="s/\\.lo\$/.${objext}/"
24388+o2lo="s/\\.${objext}\$/.lo/"
24389+extracted_archives=
24390+extracted_serial=0
24391+
24392+# If this variable is set in any of the actions, the command in it
24393+# will be execed at the end. This prevents here-documents from being
24394+# left over by shells.
24395+exec_cmd=
24396+
24397+# func_append var value
24398+# Append VALUE to the end of shell variable VAR.
24399+func_append ()
24400+{
24401+ eval "${1}=\$${1}\${2}"
24402+} # func_append may be replaced by extended shell implementation
24403+
24404+# func_append_quoted var value
24405+# Quote VALUE and append to the end of shell variable VAR, separated
24406+# by a space.
24407+func_append_quoted ()
24408+{
24409+ func_quote_for_eval "${2}"
24410+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
24411+} # func_append_quoted may be replaced by extended shell implementation
24412+
24413+
24414+# func_arith arithmetic-term...
24415+func_arith ()
24416+{
24417+ func_arith_result=`expr "${@}"`
24418+} # func_arith may be replaced by extended shell implementation
24419+
24420+
24421+# func_len string
24422+# STRING may not start with a hyphen.
24423+func_len ()
24424+{
24425+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
24426+} # func_len may be replaced by extended shell implementation
24427+
24428+
24429+# func_lo2o object
24430+func_lo2o ()
24431+{
24432+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
24433+} # func_lo2o may be replaced by extended shell implementation
24434+
24435+
24436+# func_xform libobj-or-source
24437+func_xform ()
24438+{
24439+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
24440+} # func_xform may be replaced by extended shell implementation
24441+
24442+
24443+# func_fatal_configuration arg...
24444+# Echo program name prefixed message to standard error, followed by
24445+# a configuration failure hint, and exit.
24446+func_fatal_configuration ()
24447+{
24448+ func_error ${1+"$@"}
24449+ func_error "See the $PACKAGE documentation for more information."
24450+ func_fatal_error "Fatal configuration error."
24451+}
24452+
24453+
24454+# func_config
24455+# Display the configuration for all the tags in this script.
24456+func_config ()
24457+{
24458+ re_begincf='^# ### BEGIN LIBTOOL'
24459+ re_endcf='^# ### END LIBTOOL'
24460+
24461+ # Default configuration.
24462+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
24463+
24464+ # Now print the configurations for the tags.
24465+ for tagname in $taglist; do
24466+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
24467+ done
24468+
24469+ exit $?
24470+}
24471+
24472+# func_features
24473+# Display the features supported by this script.
24474+func_features ()
24475+{
24476+ echo "host: $host"
24477+ if test "$build_libtool_libs" = yes; then
24478+ echo "enable shared libraries"
24479+ else
24480+ echo "disable shared libraries"
24481+ fi
24482+ if test "$build_old_libs" = yes; then
24483+ echo "enable static libraries"
24484+ else
24485+ echo "disable static libraries"
24486+ fi
24487+
24488+ exit $?
24489+}
24490+
24491+# func_enable_tag tagname
24492+# Verify that TAGNAME is valid, and either flag an error and exit, or
24493+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
24494+# variable here.
24495+func_enable_tag ()
24496+{
24497+ # Global variable:
24498+ tagname="$1"
24499+
24500+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
24501+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
24502+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
24503+
24504+ # Validate tagname.
24505+ case $tagname in
24506+ *[!-_A-Za-z0-9,/]*)
24507+ func_fatal_error "invalid tag name: $tagname"
24508+ ;;
24509+ esac
24510+
24511+ # Don't test for the "default" C tag, as we know it's
24512+ # there but not specially marked.
24513+ case $tagname in
24514+ CC) ;;
24515+ *)
24516+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
24517+ taglist="$taglist $tagname"
24518+
24519+ # Evaluate the configuration. Be careful to quote the path
24520+ # and the sed script, to avoid splitting on whitespace, but
24521+ # also don't use non-portable quotes within backquotes within
24522+ # quotes we have to do it in 2 steps:
24523+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
24524+ eval "$extractedcf"
24525+ else
24526+ func_error "ignoring unknown tag $tagname"
24527+ fi
24528+ ;;
24529+ esac
24530+}
24531+
24532+# func_check_version_match
24533+# Ensure that we are using m4 macros, and libtool script from the same
24534+# release of libtool.
24535+func_check_version_match ()
24536+{
24537+ if test "$package_revision" != "$macro_revision"; then
24538+ if test "$VERSION" != "$macro_version"; then
24539+ if test -z "$macro_version"; then
24540+ cat >&2 <<_LT_EOF
24541+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
24542+$progname: definition of this LT_INIT comes from an older release.
24543+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
24544+$progname: and run autoconf again.
24545+_LT_EOF
24546+ else
24547+ cat >&2 <<_LT_EOF
24548+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
24549+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
24550+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
24551+$progname: and run autoconf again.
24552+_LT_EOF
24553+ fi
24554+ else
24555+ cat >&2 <<_LT_EOF
24556+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
24557+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
24558+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
24559+$progname: of $PACKAGE $VERSION and run autoconf again.
24560+_LT_EOF
24561+ fi
24562+
24563+ exit $EXIT_MISMATCH
24564+ fi
24565+}
24566+
24567+
24568+# Shorthand for --mode=foo, only valid as the first argument
24569+case $1 in
24570+clean|clea|cle|cl)
24571+ shift; set dummy --mode clean ${1+"$@"}; shift
24572+ ;;
24573+compile|compil|compi|comp|com|co|c)
24574+ shift; set dummy --mode compile ${1+"$@"}; shift
24575+ ;;
24576+execute|execut|execu|exec|exe|ex|e)
24577+ shift; set dummy --mode execute ${1+"$@"}; shift
24578+ ;;
24579+finish|finis|fini|fin|fi|f)
24580+ shift; set dummy --mode finish ${1+"$@"}; shift
24581+ ;;
24582+install|instal|insta|inst|ins|in|i)
24583+ shift; set dummy --mode install ${1+"$@"}; shift
24584+ ;;
24585+link|lin|li|l)
24586+ shift; set dummy --mode link ${1+"$@"}; shift
24587+ ;;
24588+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
24589+ shift; set dummy --mode uninstall ${1+"$@"}; shift
24590+ ;;
24591+esac
24592+
24593+
24594+
24595+# Option defaults:
24596+opt_debug=:
24597+opt_dry_run=false
24598+opt_config=false
24599+opt_preserve_dup_deps=false
24600+opt_features=false
24601+opt_finish=false
24602+opt_help=false
24603+opt_help_all=false
24604+opt_silent=:
24605+opt_warning=:
24606+opt_verbose=:
24607+opt_silent=false
24608+opt_verbose=false
24609+
24610+
24611+# Parse options once, thoroughly. This comes as soon as possible in the
24612+# script to make things like `--version' happen as quickly as we can.
24613+{
24614+ # this just eases exit handling
24615+ while test $# -gt 0; do
24616+ opt="$1"
24617+ shift
24618+ case $opt in
24619+ --debug|-x) opt_debug='set -x'
24620+ func_echo "enabling shell trace mode"
24621+ $opt_debug
24622+ ;;
24623+ --dry-run|--dryrun|-n)
24624+ opt_dry_run=:
24625+ ;;
24626+ --config)
24627+ opt_config=:
24628+func_config
24629+ ;;
24630+ --dlopen|-dlopen)
24631+ optarg="$1"
24632+ opt_dlopen="${opt_dlopen+$opt_dlopen
24633+}$optarg"
24634+ shift
24635+ ;;
24636+ --preserve-dup-deps)
24637+ opt_preserve_dup_deps=:
24638+ ;;
24639+ --features)
24640+ opt_features=:
24641+func_features
24642+ ;;
24643+ --finish)
24644+ opt_finish=:
24645+set dummy --mode finish ${1+"$@"}; shift
24646+ ;;
24647+ --help)
24648+ opt_help=:
24649+ ;;
24650+ --help-all)
24651+ opt_help_all=:
24652+opt_help=': help-all'
24653+ ;;
24654+ --mode)
24655+ test $# = 0 && func_missing_arg $opt && break
24656+ optarg="$1"
24657+ opt_mode="$optarg"
24658+case $optarg in
24659+ # Valid mode arguments:
24660+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
24661+
24662+ # Catch anything else as an error
24663+ *) func_error "invalid argument for $opt"
24664+ exit_cmd=exit
24665+ break
24666+ ;;
24667+esac
24668+ shift
24669+ ;;
24670+ --no-silent|--no-quiet)
24671+ opt_silent=false
24672+func_append preserve_args " $opt"
24673+ ;;
24674+ --no-warning|--no-warn)
24675+ opt_warning=false
24676+func_append preserve_args " $opt"
24677+ ;;
24678+ --no-verbose)
24679+ opt_verbose=false
24680+func_append preserve_args " $opt"
24681+ ;;
24682+ --silent|--quiet)
24683+ opt_silent=:
24684+func_append preserve_args " $opt"
24685+ opt_verbose=false
24686+ ;;
24687+ --verbose|-v)
24688+ opt_verbose=:
24689+func_append preserve_args " $opt"
24690+opt_silent=false
24691+ ;;
24692+ --tag)
24693+ test $# = 0 && func_missing_arg $opt && break
24694+ optarg="$1"
24695+ opt_tag="$optarg"
24696+func_append preserve_args " $opt $optarg"
24697+func_enable_tag "$optarg"
24698+ shift
24699+ ;;
24700+
24701+ -\?|-h) func_usage ;;
24702+ --help) func_help ;;
24703+ --version) func_version ;;
24704+
24705+ # Separate optargs to long options:
24706+ --*=*)
24707+ func_split_long_opt "$opt"
24708+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
24709+ shift
24710+ ;;
24711+
24712+ # Separate non-argument short options:
24713+ -\?*|-h*|-n*|-v*)
24714+ func_split_short_opt "$opt"
24715+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
24716+ shift
24717+ ;;
24718+
24719+ --) break ;;
24720+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
24721+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
24722+ esac
24723+ done
24724+
24725+ # Validate options:
24726+
24727+ # save first non-option argument
24728+ if test "$#" -gt 0; then
24729+ nonopt="$opt"
24730+ shift
24731+ fi
24732+
24733+ # preserve --debug
24734+ test "$opt_debug" = : || func_append preserve_args " --debug"
24735+
24736+ case $host in
24737+ *cygwin* | *mingw* | *pw32* | *cegcc*)
24738+ # don't eliminate duplications in $postdeps and $predeps
24739+ opt_duplicate_compiler_generated_deps=:
24740+ ;;
24741+ *)
24742+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
24743+ ;;
24744+ esac
24745+
24746+ $opt_help || {
24747+ # Sanity checks first:
24748+ func_check_version_match
24749+
24750+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
24751+ func_fatal_configuration "not configured to build any kind of library"
24752+ fi
24753+
24754+ # Darwin sucks
24755+ eval std_shrext=\"$shrext_cmds\"
24756+
24757+ # Only execute mode is allowed to have -dlopen flags.
24758+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
24759+ func_error "unrecognized option \`-dlopen'"
24760+ $ECHO "$help" 1>&2
24761+ exit $EXIT_FAILURE
24762+ fi
24763+
24764+ # Change the help message to a mode-specific one.
24765+ generic_help="$help"
24766+ help="Try \`$progname --help --mode=$opt_mode' for more information."
24767+ }
24768+
24769+
24770+ # Bail if the options were screwed
24771+ $exit_cmd $EXIT_FAILURE
24772+}
24773+
24774+
24775+
24776+
24777+## ----------- ##
24778+## Main. ##
24779+## ----------- ##
24780+
24781+# func_lalib_p file
24782+# True iff FILE is a libtool `.la' library or `.lo' object file.
24783+# This function is only a basic sanity check; it will hardly flush out
24784+# determined imposters.
24785+func_lalib_p ()
24786+{
24787+ test -f "$1" &&
24788+ $SED -e 4q "$1" 2>/dev/null \
24789+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
24790+}
24791+
24792+# func_lalib_unsafe_p file
24793+# True iff FILE is a libtool `.la' library or `.lo' object file.
24794+# This function implements the same check as func_lalib_p without
24795+# resorting to external programs. To this end, it redirects stdin and
24796+# closes it afterwards, without saving the original file descriptor.
24797+# As a safety measure, use it only where a negative result would be
24798+# fatal anyway. Works if `file' does not exist.
24799+func_lalib_unsafe_p ()
24800+{
24801+ lalib_p=no
24802+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
24803+ for lalib_p_l in 1 2 3 4
24804+ do
24805+ read lalib_p_line
24806+ case "$lalib_p_line" in
24807+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
24808+ esac
24809+ done
24810+ exec 0<&5 5<&-
24811+ fi
24812+ test "$lalib_p" = yes
24813+}
24814+
24815+# func_ltwrapper_script_p file
24816+# True iff FILE is a libtool wrapper script
24817+# This function is only a basic sanity check; it will hardly flush out
24818+# determined imposters.
24819+func_ltwrapper_script_p ()
24820+{
24821+ func_lalib_p "$1"
24822+}
24823+
24824+# func_ltwrapper_executable_p file
24825+# True iff FILE is a libtool wrapper executable
24826+# This function is only a basic sanity check; it will hardly flush out
24827+# determined imposters.
24828+func_ltwrapper_executable_p ()
24829+{
24830+ func_ltwrapper_exec_suffix=
24831+ case $1 in
24832+ *.exe) ;;
24833+ *) func_ltwrapper_exec_suffix=.exe ;;
24834+ esac
24835+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
24836+}
24837+
24838+# func_ltwrapper_scriptname file
24839+# Assumes file is an ltwrapper_executable
24840+# uses $file to determine the appropriate filename for a
24841+# temporary ltwrapper_script.
24842+func_ltwrapper_scriptname ()
24843+{
24844+ func_dirname_and_basename "$1" "" "."
24845+ func_stripname '' '.exe' "$func_basename_result"
24846+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
24847+}
24848+
24849+# func_ltwrapper_p file
24850+# True iff FILE is a libtool wrapper script or wrapper executable
24851+# This function is only a basic sanity check; it will hardly flush out
24852+# determined imposters.
24853+func_ltwrapper_p ()
24854+{
24855+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
24856+}
24857+
24858+
24859+# func_execute_cmds commands fail_cmd
24860+# Execute tilde-delimited COMMANDS.
24861+# If FAIL_CMD is given, eval that upon failure.
24862+# FAIL_CMD may read-access the current command in variable CMD!
24863+func_execute_cmds ()
24864+{
24865+ $opt_debug
24866+ save_ifs=$IFS; IFS='~'
24867+ for cmd in $1; do
24868+ IFS=$save_ifs
24869+ eval cmd=\"$cmd\"
24870+ func_show_eval "$cmd" "${2-:}"
24871+ done
24872+ IFS=$save_ifs
24873+}
24874+
24875+
24876+# func_source file
24877+# Source FILE, adding directory component if necessary.
24878+# Note that it is not necessary on cygwin/mingw to append a dot to
24879+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
24880+# behavior happens only for exec(3), not for open(2)! Also, sourcing
24881+# `FILE.' does not work on cygwin managed mounts.
24882+func_source ()
24883+{
24884+ $opt_debug
24885+ case $1 in
24886+ */* | *\\*) . "$1" ;;
24887+ *) . "./$1" ;;
24888+ esac
24889+}
24890+
24891+
24892+# func_resolve_sysroot PATH
24893+# Replace a leading = in PATH with a sysroot. Store the result into
24894+# func_resolve_sysroot_result
24895+func_resolve_sysroot ()
24896+{
24897+ func_resolve_sysroot_result=$1
24898+ case $func_resolve_sysroot_result in
24899+ =*)
24900+ func_stripname '=' '' "$func_resolve_sysroot_result"
24901+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
24902+ ;;
24903+ esac
24904+}
24905+
24906+# func_replace_sysroot PATH
24907+# If PATH begins with the sysroot, replace it with = and
24908+# store the result into func_replace_sysroot_result.
24909+func_replace_sysroot ()
24910+{
24911+ case "$lt_sysroot:$1" in
24912+ ?*:"$lt_sysroot"*)
24913+ func_stripname "$lt_sysroot" '' "$1"
24914+ func_replace_sysroot_result="=$func_stripname_result"
24915+ ;;
24916+ *)
24917+ # Including no sysroot.
24918+ func_replace_sysroot_result=$1
24919+ ;;
24920+ esac
24921+}
24922+
24923+# func_infer_tag arg
24924+# Infer tagged configuration to use if any are available and
24925+# if one wasn't chosen via the "--tag" command line option.
24926+# Only attempt this if the compiler in the base compile
24927+# command doesn't match the default compiler.
24928+# arg is usually of the form 'gcc ...'
24929+func_infer_tag ()
24930+{
24931+ $opt_debug
24932+ if test -n "$available_tags" && test -z "$tagname"; then
24933+ CC_quoted=
24934+ for arg in $CC; do
24935+ func_append_quoted CC_quoted "$arg"
24936+ done
24937+ CC_expanded=`func_echo_all $CC`
24938+ CC_quoted_expanded=`func_echo_all $CC_quoted`
24939+ case $@ in
24940+ # Blanks in the command may have been stripped by the calling shell,
24941+ # but not from the CC environment variable when configure was run.
24942+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
24943+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
24944+ # Blanks at the start of $base_compile will cause this to fail
24945+ # if we don't check for them as well.
24946+ *)
24947+ for z in $available_tags; do
24948+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
24949+ # Evaluate the configuration.
24950+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
24951+ CC_quoted=
24952+ for arg in $CC; do
24953+ # Double-quote args containing other shell metacharacters.
24954+ func_append_quoted CC_quoted "$arg"
24955+ done
24956+ CC_expanded=`func_echo_all $CC`
24957+ CC_quoted_expanded=`func_echo_all $CC_quoted`
24958+ case "$@ " in
24959+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
24960+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
24961+ # The compiler in the base compile command matches
24962+ # the one in the tagged configuration.
24963+ # Assume this is the tagged configuration we want.
24964+ tagname=$z
24965+ break
24966+ ;;
24967+ esac
24968+ fi
24969+ done
24970+ # If $tagname still isn't set, then no tagged configuration
24971+ # was found and let the user know that the "--tag" command
24972+ # line option must be used.
24973+ if test -z "$tagname"; then
24974+ func_echo "unable to infer tagged configuration"
24975+ func_fatal_error "specify a tag with \`--tag'"
24976+# else
24977+# func_verbose "using $tagname tagged configuration"
24978+ fi
24979+ ;;
24980+ esac
24981+ fi
24982+}
24983+
24984+
24985+
24986+# func_write_libtool_object output_name pic_name nonpic_name
24987+# Create a libtool object file (analogous to a ".la" file),
24988+# but don't create it if we're doing a dry run.
24989+func_write_libtool_object ()
24990+{
24991+ write_libobj=${1}
24992+ if test "$build_libtool_libs" = yes; then
24993+ write_lobj=\'${2}\'
24994+ else
24995+ write_lobj=none
24996+ fi
24997+
24998+ if test "$build_old_libs" = yes; then
24999+ write_oldobj=\'${3}\'
25000+ else
25001+ write_oldobj=none
25002+ fi
25003+
25004+ $opt_dry_run || {
25005+ cat >${write_libobj}T <<EOF
25006+# $write_libobj - a libtool object file
25007+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
25008+#
25009+# Please DO NOT delete this file!
25010+# It is necessary for linking the library.
25011+
25012+# Name of the PIC object.
25013+pic_object=$write_lobj
25014+
25015+# Name of the non-PIC object
25016+non_pic_object=$write_oldobj
25017+
25018+EOF
25019+ $MV "${write_libobj}T" "${write_libobj}"
25020+ }
25021+}
25022+
25023+
25024+##################################################
25025+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
25026+##################################################
25027+
25028+# func_convert_core_file_wine_to_w32 ARG
25029+# Helper function used by file name conversion functions when $build is *nix,
25030+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
25031+# correctly configured wine environment available, with the winepath program
25032+# in $build's $PATH.
25033+#
25034+# ARG is the $build file name to be converted to w32 format.
25035+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
25036+# be empty on error (or when ARG is empty)
25037+func_convert_core_file_wine_to_w32 ()
25038+{
25039+ $opt_debug
25040+ func_convert_core_file_wine_to_w32_result="$1"
25041+ if test -n "$1"; then
25042+ # Unfortunately, winepath does not exit with a non-zero error code, so we
25043+ # are forced to check the contents of stdout. On the other hand, if the
25044+ # command is not found, the shell will set an exit code of 127 and print
25045+ # *an error message* to stdout. So we must check for both error code of
25046+ # zero AND non-empty stdout, which explains the odd construction:
25047+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
25048+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
25049+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
25050+ $SED -e "$lt_sed_naive_backslashify"`
25051+ else
25052+ func_convert_core_file_wine_to_w32_result=
25053+ fi
25054+ fi
25055+}
25056+# end: func_convert_core_file_wine_to_w32
25057+
25058+
25059+# func_convert_core_path_wine_to_w32 ARG
25060+# Helper function used by path conversion functions when $build is *nix, and
25061+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
25062+# configured wine environment available, with the winepath program in $build's
25063+# $PATH. Assumes ARG has no leading or trailing path separator characters.
25064+#
25065+# ARG is path to be converted from $build format to win32.
25066+# Result is available in $func_convert_core_path_wine_to_w32_result.
25067+# Unconvertible file (directory) names in ARG are skipped; if no directory names
25068+# are convertible, then the result may be empty.
25069+func_convert_core_path_wine_to_w32 ()
25070+{
25071+ $opt_debug
25072+ # unfortunately, winepath doesn't convert paths, only file names
25073+ func_convert_core_path_wine_to_w32_result=""
25074+ if test -n "$1"; then
25075+ oldIFS=$IFS
25076+ IFS=:
25077+ for func_convert_core_path_wine_to_w32_f in $1; do
25078+ IFS=$oldIFS
25079+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
25080+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
25081+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
25082+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
25083+ else
25084+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
25085+ fi
25086+ fi
25087+ done
25088+ IFS=$oldIFS
25089+ fi
25090+}
25091+# end: func_convert_core_path_wine_to_w32
25092+
25093+
25094+# func_cygpath ARGS...
25095+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
25096+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
25097+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
25098+# (2), returns the Cygwin file name or path in func_cygpath_result (input
25099+# file name or path is assumed to be in w32 format, as previously converted
25100+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
25101+# or path in func_cygpath_result (input file name or path is assumed to be in
25102+# Cygwin format). Returns an empty string on error.
25103+#
25104+# ARGS are passed to cygpath, with the last one being the file name or path to
25105+# be converted.
25106+#
25107+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
25108+# environment variable; do not put it in $PATH.
25109+func_cygpath ()
25110+{
25111+ $opt_debug
25112+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
25113+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
25114+ if test "$?" -ne 0; then
25115+ # on failure, ensure result is empty
25116+ func_cygpath_result=
25117+ fi
25118+ else
25119+ func_cygpath_result=
25120+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
25121+ fi
25122+}
25123+#end: func_cygpath
25124+
25125+
25126+# func_convert_core_msys_to_w32 ARG
25127+# Convert file name or path ARG from MSYS format to w32 format. Return
25128+# result in func_convert_core_msys_to_w32_result.
25129+func_convert_core_msys_to_w32 ()
25130+{
25131+ $opt_debug
25132+ # awkward: cmd appends spaces to result
25133+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
25134+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
25135+}
25136+#end: func_convert_core_msys_to_w32
25137+
25138+
25139+# func_convert_file_check ARG1 ARG2
25140+# Verify that ARG1 (a file name in $build format) was converted to $host
25141+# format in ARG2. Otherwise, emit an error message, but continue (resetting
25142+# func_to_host_file_result to ARG1).
25143+func_convert_file_check ()
25144+{
25145+ $opt_debug
25146+ if test -z "$2" && test -n "$1" ; then
25147+ func_error "Could not determine host file name corresponding to"
25148+ func_error " \`$1'"
25149+ func_error "Continuing, but uninstalled executables may not work."
25150+ # Fallback:
25151+ func_to_host_file_result="$1"
25152+ fi
25153+}
25154+# end func_convert_file_check
25155+
25156+
25157+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
25158+# Verify that FROM_PATH (a path in $build format) was converted to $host
25159+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
25160+# func_to_host_file_result to a simplistic fallback value (see below).
25161+func_convert_path_check ()
25162+{
25163+ $opt_debug
25164+ if test -z "$4" && test -n "$3"; then
25165+ func_error "Could not determine the host path corresponding to"
25166+ func_error " \`$3'"
25167+ func_error "Continuing, but uninstalled executables may not work."
25168+ # Fallback. This is a deliberately simplistic "conversion" and
25169+ # should not be "improved". See libtool.info.
25170+ if test "x$1" != "x$2"; then
25171+ lt_replace_pathsep_chars="s|$1|$2|g"
25172+ func_to_host_path_result=`echo "$3" |
25173+ $SED -e "$lt_replace_pathsep_chars"`
25174+ else
25175+ func_to_host_path_result="$3"
25176+ fi
25177+ fi
25178+}
25179+# end func_convert_path_check
25180+
25181+
25182+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
25183+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
25184+# and appending REPL if ORIG matches BACKPAT.
25185+func_convert_path_front_back_pathsep ()
25186+{
25187+ $opt_debug
25188+ case $4 in
25189+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
25190+ ;;
25191+ esac
25192+ case $4 in
25193+ $2 ) func_append func_to_host_path_result "$3"
25194+ ;;
25195+ esac
25196+}
25197+# end func_convert_path_front_back_pathsep
25198+
25199+
25200+##################################################
25201+# $build to $host FILE NAME CONVERSION FUNCTIONS #
25202+##################################################
25203+# invoked via `$to_host_file_cmd ARG'
25204+#
25205+# In each case, ARG is the path to be converted from $build to $host format.
25206+# Result will be available in $func_to_host_file_result.
25207+
25208+
25209+# func_to_host_file ARG
25210+# Converts the file name ARG from $build format to $host format. Return result
25211+# in func_to_host_file_result.
25212+func_to_host_file ()
25213+{
25214+ $opt_debug
25215+ $to_host_file_cmd "$1"
25216+}
25217+# end func_to_host_file
25218+
25219+
25220+# func_to_tool_file ARG LAZY
25221+# converts the file name ARG from $build format to toolchain format. Return
25222+# result in func_to_tool_file_result. If the conversion in use is listed
25223+# in (the comma separated) LAZY, no conversion takes place.
25224+func_to_tool_file ()
25225+{
25226+ $opt_debug
25227+ case ,$2, in
25228+ *,"$to_tool_file_cmd",*)
25229+ func_to_tool_file_result=$1
25230+ ;;
25231+ *)
25232+ $to_tool_file_cmd "$1"
25233+ func_to_tool_file_result=$func_to_host_file_result
25234+ ;;
25235+ esac
25236+}
25237+# end func_to_tool_file
25238+
25239+
25240+# func_convert_file_noop ARG
25241+# Copy ARG to func_to_host_file_result.
25242+func_convert_file_noop ()
25243+{
25244+ func_to_host_file_result="$1"
25245+}
25246+# end func_convert_file_noop
25247+
25248+
25249+# func_convert_file_msys_to_w32 ARG
25250+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
25251+# conversion to w32 is not available inside the cwrapper. Returns result in
25252+# func_to_host_file_result.
25253+func_convert_file_msys_to_w32 ()
25254+{
25255+ $opt_debug
25256+ func_to_host_file_result="$1"
25257+ if test -n "$1"; then
25258+ func_convert_core_msys_to_w32 "$1"
25259+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
25260+ fi
25261+ func_convert_file_check "$1" "$func_to_host_file_result"
25262+}
25263+# end func_convert_file_msys_to_w32
25264+
25265+
25266+# func_convert_file_cygwin_to_w32 ARG
25267+# Convert file name ARG from Cygwin to w32 format. Returns result in
25268+# func_to_host_file_result.
25269+func_convert_file_cygwin_to_w32 ()
25270+{
25271+ $opt_debug
25272+ func_to_host_file_result="$1"
25273+ if test -n "$1"; then
25274+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
25275+ # LT_CYGPATH in this case.
25276+ func_to_host_file_result=`cygpath -m "$1"`
25277+ fi
25278+ func_convert_file_check "$1" "$func_to_host_file_result"
25279+}
25280+# end func_convert_file_cygwin_to_w32
25281+
25282+
25283+# func_convert_file_nix_to_w32 ARG
25284+# Convert file name ARG from *nix to w32 format. Requires a wine environment
25285+# and a working winepath. Returns result in func_to_host_file_result.
25286+func_convert_file_nix_to_w32 ()
25287+{
25288+ $opt_debug
25289+ func_to_host_file_result="$1"
25290+ if test -n "$1"; then
25291+ func_convert_core_file_wine_to_w32 "$1"
25292+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
25293+ fi
25294+ func_convert_file_check "$1" "$func_to_host_file_result"
25295+}
25296+# end func_convert_file_nix_to_w32
25297+
25298+
25299+# func_convert_file_msys_to_cygwin ARG
25300+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
25301+# Returns result in func_to_host_file_result.
25302+func_convert_file_msys_to_cygwin ()
25303+{
25304+ $opt_debug
25305+ func_to_host_file_result="$1"
25306+ if test -n "$1"; then
25307+ func_convert_core_msys_to_w32 "$1"
25308+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
25309+ func_to_host_file_result="$func_cygpath_result"
25310+ fi
25311+ func_convert_file_check "$1" "$func_to_host_file_result"
25312+}
25313+# end func_convert_file_msys_to_cygwin
25314+
25315+
25316+# func_convert_file_nix_to_cygwin ARG
25317+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
25318+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
25319+# in func_to_host_file_result.
25320+func_convert_file_nix_to_cygwin ()
25321+{
25322+ $opt_debug
25323+ func_to_host_file_result="$1"
25324+ if test -n "$1"; then
25325+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
25326+ func_convert_core_file_wine_to_w32 "$1"
25327+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
25328+ func_to_host_file_result="$func_cygpath_result"
25329+ fi
25330+ func_convert_file_check "$1" "$func_to_host_file_result"
25331+}
25332+# end func_convert_file_nix_to_cygwin
25333+
25334+
25335+#############################################
25336+# $build to $host PATH CONVERSION FUNCTIONS #
25337+#############################################
25338+# invoked via `$to_host_path_cmd ARG'
25339+#
25340+# In each case, ARG is the path to be converted from $build to $host format.
25341+# The result will be available in $func_to_host_path_result.
25342+#
25343+# Path separators are also converted from $build format to $host format. If
25344+# ARG begins or ends with a path separator character, it is preserved (but
25345+# converted to $host format) on output.
25346+#
25347+# All path conversion functions are named using the following convention:
25348+# file name conversion function : func_convert_file_X_to_Y ()
25349+# path conversion function : func_convert_path_X_to_Y ()
25350+# where, for any given $build/$host combination the 'X_to_Y' value is the
25351+# same. If conversion functions are added for new $build/$host combinations,
25352+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
25353+# will break.
25354+
25355+
25356+# func_init_to_host_path_cmd
25357+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
25358+# appropriate value, based on the value of $to_host_file_cmd.
25359+to_host_path_cmd=
25360+func_init_to_host_path_cmd ()
25361+{
25362+ $opt_debug
25363+ if test -z "$to_host_path_cmd"; then
25364+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
25365+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
25366+ fi
25367+}
25368+
25369+
25370+# func_to_host_path ARG
25371+# Converts the path ARG from $build format to $host format. Return result
25372+# in func_to_host_path_result.
25373+func_to_host_path ()
25374+{
25375+ $opt_debug
25376+ func_init_to_host_path_cmd
25377+ $to_host_path_cmd "$1"
25378+}
25379+# end func_to_host_path
25380+
25381+
25382+# func_convert_path_noop ARG
25383+# Copy ARG to func_to_host_path_result.
25384+func_convert_path_noop ()
25385+{
25386+ func_to_host_path_result="$1"
25387+}
25388+# end func_convert_path_noop
25389+
25390+
25391+# func_convert_path_msys_to_w32 ARG
25392+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
25393+# conversion to w32 is not available inside the cwrapper. Returns result in
25394+# func_to_host_path_result.
25395+func_convert_path_msys_to_w32 ()
25396+{
25397+ $opt_debug
25398+ func_to_host_path_result="$1"
25399+ if test -n "$1"; then
25400+ # Remove leading and trailing path separator characters from ARG. MSYS
25401+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
25402+ # and winepath ignores them completely.
25403+ func_stripname : : "$1"
25404+ func_to_host_path_tmp1=$func_stripname_result
25405+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
25406+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
25407+ func_convert_path_check : ";" \
25408+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
25409+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
25410+ fi
25411+}
25412+# end func_convert_path_msys_to_w32
25413+
25414+
25415+# func_convert_path_cygwin_to_w32 ARG
25416+# Convert path ARG from Cygwin to w32 format. Returns result in
25417+# func_to_host_file_result.
25418+func_convert_path_cygwin_to_w32 ()
25419+{
25420+ $opt_debug
25421+ func_to_host_path_result="$1"
25422+ if test -n "$1"; then
25423+ # See func_convert_path_msys_to_w32:
25424+ func_stripname : : "$1"
25425+ func_to_host_path_tmp1=$func_stripname_result
25426+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
25427+ func_convert_path_check : ";" \
25428+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
25429+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
25430+ fi
25431+}
25432+# end func_convert_path_cygwin_to_w32
25433+
25434+
25435+# func_convert_path_nix_to_w32 ARG
25436+# Convert path ARG from *nix to w32 format. Requires a wine environment and
25437+# a working winepath. Returns result in func_to_host_file_result.
25438+func_convert_path_nix_to_w32 ()
25439+{
25440+ $opt_debug
25441+ func_to_host_path_result="$1"
25442+ if test -n "$1"; then
25443+ # See func_convert_path_msys_to_w32:
25444+ func_stripname : : "$1"
25445+ func_to_host_path_tmp1=$func_stripname_result
25446+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
25447+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
25448+ func_convert_path_check : ";" \
25449+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
25450+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
25451+ fi
25452+}
25453+# end func_convert_path_nix_to_w32
25454+
25455+
25456+# func_convert_path_msys_to_cygwin ARG
25457+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
25458+# Returns result in func_to_host_file_result.
25459+func_convert_path_msys_to_cygwin ()
25460+{
25461+ $opt_debug
25462+ func_to_host_path_result="$1"
25463+ if test -n "$1"; then
25464+ # See func_convert_path_msys_to_w32:
25465+ func_stripname : : "$1"
25466+ func_to_host_path_tmp1=$func_stripname_result
25467+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
25468+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
25469+ func_to_host_path_result="$func_cygpath_result"
25470+ func_convert_path_check : : \
25471+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
25472+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
25473+ fi
25474+}
25475+# end func_convert_path_msys_to_cygwin
25476+
25477+
25478+# func_convert_path_nix_to_cygwin ARG
25479+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
25480+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
25481+# func_to_host_file_result.
25482+func_convert_path_nix_to_cygwin ()
25483+{
25484+ $opt_debug
25485+ func_to_host_path_result="$1"
25486+ if test -n "$1"; then
25487+ # Remove leading and trailing path separator characters from
25488+ # ARG. msys behavior is inconsistent here, cygpath turns them
25489+ # into '.;' and ';.', and winepath ignores them completely.
25490+ func_stripname : : "$1"
25491+ func_to_host_path_tmp1=$func_stripname_result
25492+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
25493+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
25494+ func_to_host_path_result="$func_cygpath_result"
25495+ func_convert_path_check : : \
25496+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
25497+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
25498+ fi
25499+}
25500+# end func_convert_path_nix_to_cygwin
25501+
25502+
25503+# func_mode_compile arg...
25504+func_mode_compile ()
25505+{
25506+ $opt_debug
25507+ # Get the compilation command and the source file.
25508+ base_compile=
25509+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
25510+ suppress_opt=yes
25511+ suppress_output=
25512+ arg_mode=normal
25513+ libobj=
25514+ later=
25515+ pie_flag=
25516+
25517+ for arg
25518+ do
25519+ case $arg_mode in
25520+ arg )
25521+ # do not "continue". Instead, add this to base_compile
25522+ lastarg="$arg"
25523+ arg_mode=normal
25524+ ;;
25525+
25526+ target )
25527+ libobj="$arg"
25528+ arg_mode=normal
25529+ continue
25530+ ;;
25531+
25532+ normal )
25533+ # Accept any command-line options.
25534+ case $arg in
25535+ -o)
25536+ test -n "$libobj" && \
25537+ func_fatal_error "you cannot specify \`-o' more than once"
25538+ arg_mode=target
25539+ continue
25540+ ;;
25541+
25542+ -pie | -fpie | -fPIE)
25543+ func_append pie_flag " $arg"
25544+ continue
25545+ ;;
25546+
25547+ -shared | -static | -prefer-pic | -prefer-non-pic)
25548+ func_append later " $arg"
25549+ continue
25550+ ;;
25551+
25552+ -no-suppress)
25553+ suppress_opt=no
25554+ continue
25555+ ;;
25556+
25557+ -Xcompiler)
25558+ arg_mode=arg # the next one goes into the "base_compile" arg list
25559+ continue # The current "srcfile" will either be retained or
25560+ ;; # replaced later. I would guess that would be a bug.
25561+
25562+ -Wc,*)
25563+ func_stripname '-Wc,' '' "$arg"
25564+ args=$func_stripname_result
25565+ lastarg=
25566+ save_ifs="$IFS"; IFS=','
25567+ for arg in $args; do
25568+ IFS="$save_ifs"
25569+ func_append_quoted lastarg "$arg"
25570+ done
25571+ IFS="$save_ifs"
25572+ func_stripname ' ' '' "$lastarg"
25573+ lastarg=$func_stripname_result
25574+
25575+ # Add the arguments to base_compile.
25576+ func_append base_compile " $lastarg"
25577+ continue
25578+ ;;
25579+
25580+ *)
25581+ # Accept the current argument as the source file.
25582+ # The previous "srcfile" becomes the current argument.
25583+ #
25584+ lastarg="$srcfile"
25585+ srcfile="$arg"
25586+ ;;
25587+ esac # case $arg
25588+ ;;
25589+ esac # case $arg_mode
25590+
25591+ # Aesthetically quote the previous argument.
25592+ func_append_quoted base_compile "$lastarg"
25593+ done # for arg
25594+
25595+ case $arg_mode in
25596+ arg)
25597+ func_fatal_error "you must specify an argument for -Xcompile"
25598+ ;;
25599+ target)
25600+ func_fatal_error "you must specify a target with \`-o'"
25601+ ;;
25602+ *)
25603+ # Get the name of the library object.
25604+ test -z "$libobj" && {
25605+ func_basename "$srcfile"
25606+ libobj="$func_basename_result"
25607+ }
25608+ ;;
25609+ esac
25610+
25611+ # Recognize several different file suffixes.
25612+ # If the user specifies -o file.o, it is replaced with file.lo
25613+ case $libobj in
25614+ *.[cCFSifmso] | \
25615+ *.ada | *.adb | *.ads | *.asm | \
25616+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
25617+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
25618+ func_xform "$libobj"
25619+ libobj=$func_xform_result
25620+ ;;
25621+ esac
25622+
25623+ case $libobj in
25624+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
25625+ *)
25626+ func_fatal_error "cannot determine name of library object from \`$libobj'"
25627+ ;;
25628+ esac
25629+
25630+ func_infer_tag $base_compile
25631+
25632+ for arg in $later; do
25633+ case $arg in
25634+ -shared)
25635+ test "$build_libtool_libs" != yes && \
25636+ func_fatal_configuration "can not build a shared library"
25637+ build_old_libs=no
25638+ continue
25639+ ;;
25640+
25641+ -static)
25642+ build_libtool_libs=no
25643+ build_old_libs=yes
25644+ continue
25645+ ;;
25646+
25647+ -prefer-pic)
25648+ pic_mode=yes
25649+ continue
25650+ ;;
25651+
25652+ -prefer-non-pic)
25653+ pic_mode=no
25654+ continue
25655+ ;;
25656+ esac
25657+ done
25658+
25659+ func_quote_for_eval "$libobj"
25660+ test "X$libobj" != "X$func_quote_for_eval_result" \
25661+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
25662+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
25663+ func_dirname_and_basename "$obj" "/" ""
25664+ objname="$func_basename_result"
25665+ xdir="$func_dirname_result"
25666+ lobj=${xdir}$objdir/$objname
25667+
25668+ test -z "$base_compile" && \
25669+ func_fatal_help "you must specify a compilation command"
25670+
25671+ # Delete any leftover library objects.
25672+ if test "$build_old_libs" = yes; then
25673+ removelist="$obj $lobj $libobj ${libobj}T"
25674+ else
25675+ removelist="$lobj $libobj ${libobj}T"
25676+ fi
25677+
25678+ # On Cygwin there's no "real" PIC flag so we must build both object types
25679+ case $host_os in
25680+ cygwin* | mingw* | pw32* | os2* | cegcc*)
25681+ pic_mode=default
25682+ ;;
25683+ esac
25684+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
25685+ # non-PIC code in shared libraries is not supported
25686+ pic_mode=default
25687+ fi
25688+
25689+ # Calculate the filename of the output object if compiler does
25690+ # not support -o with -c
25691+ if test "$compiler_c_o" = no; then
25692+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
25693+ lockfile="$output_obj.lock"
25694+ else
25695+ output_obj=
25696+ need_locks=no
25697+ lockfile=
25698+ fi
25699+
25700+ # Lock this critical section if it is needed
25701+ # We use this script file to make the link, it avoids creating a new file
25702+ if test "$need_locks" = yes; then
25703+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
25704+ func_echo "Waiting for $lockfile to be removed"
25705+ sleep 2
25706+ done
25707+ elif test "$need_locks" = warn; then
25708+ if test -f "$lockfile"; then
25709+ $ECHO "\
25710+*** ERROR, $lockfile exists and contains:
25711+`cat $lockfile 2>/dev/null`
25712+
25713+This indicates that another process is trying to use the same
25714+temporary object file, and libtool could not work around it because
25715+your compiler does not support \`-c' and \`-o' together. If you
25716+repeat this compilation, it may succeed, by chance, but you had better
25717+avoid parallel builds (make -j) in this platform, or get a better
25718+compiler."
25719+
25720+ $opt_dry_run || $RM $removelist
25721+ exit $EXIT_FAILURE
25722+ fi
25723+ func_append removelist " $output_obj"
25724+ $ECHO "$srcfile" > "$lockfile"
25725+ fi
25726+
25727+ $opt_dry_run || $RM $removelist
25728+ func_append removelist " $lockfile"
25729+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
25730+
25731+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
25732+ srcfile=$func_to_tool_file_result
25733+ func_quote_for_eval "$srcfile"
25734+ qsrcfile=$func_quote_for_eval_result
25735+
25736+ # Only build a PIC object if we are building libtool libraries.
25737+ if test "$build_libtool_libs" = yes; then
25738+ # Without this assignment, base_compile gets emptied.
25739+ fbsd_hideous_sh_bug=$base_compile
25740+
25741+ if test "$pic_mode" != no; then
25742+ command="$base_compile $qsrcfile $pic_flag"
25743+ else
25744+ # Don't build PIC code
25745+ command="$base_compile $qsrcfile"
25746+ fi
25747+
25748+ func_mkdir_p "$xdir$objdir"
25749+
25750+ if test -z "$output_obj"; then
25751+ # Place PIC objects in $objdir
25752+ func_append command " -o $lobj"
25753+ fi
25754+
25755+ func_show_eval_locale "$command" \
25756+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
25757+
25758+ if test "$need_locks" = warn &&
25759+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
25760+ $ECHO "\
25761+*** ERROR, $lockfile contains:
25762+`cat $lockfile 2>/dev/null`
25763+
25764+but it should contain:
25765+$srcfile
25766+
25767+This indicates that another process is trying to use the same
25768+temporary object file, and libtool could not work around it because
25769+your compiler does not support \`-c' and \`-o' together. If you
25770+repeat this compilation, it may succeed, by chance, but you had better
25771+avoid parallel builds (make -j) in this platform, or get a better
25772+compiler."
25773+
25774+ $opt_dry_run || $RM $removelist
25775+ exit $EXIT_FAILURE
25776+ fi
25777+
25778+ # Just move the object if needed, then go on to compile the next one
25779+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
25780+ func_show_eval '$MV "$output_obj" "$lobj"' \
25781+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
25782+ fi
25783+
25784+ # Allow error messages only from the first compilation.
25785+ if test "$suppress_opt" = yes; then
25786+ suppress_output=' >/dev/null 2>&1'
25787+ fi
25788+ fi
25789+
25790+ # Only build a position-dependent object if we build old libraries.
25791+ if test "$build_old_libs" = yes; then
25792+ if test "$pic_mode" != yes; then
25793+ # Don't build PIC code
25794+ command="$base_compile $qsrcfile$pie_flag"
25795+ else
25796+ command="$base_compile $qsrcfile $pic_flag"
25797+ fi
25798+ if test "$compiler_c_o" = yes; then
25799+ func_append command " -o $obj"
25800+ fi
25801+
25802+ # Suppress compiler output if we already did a PIC compilation.
25803+ func_append command "$suppress_output"
25804+ func_show_eval_locale "$command" \
25805+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
25806+
25807+ if test "$need_locks" = warn &&
25808+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
25809+ $ECHO "\
25810+*** ERROR, $lockfile contains:
25811+`cat $lockfile 2>/dev/null`
25812+
25813+but it should contain:
25814+$srcfile
25815+
25816+This indicates that another process is trying to use the same
25817+temporary object file, and libtool could not work around it because
25818+your compiler does not support \`-c' and \`-o' together. If you
25819+repeat this compilation, it may succeed, by chance, but you had better
25820+avoid parallel builds (make -j) in this platform, or get a better
25821+compiler."
25822+
25823+ $opt_dry_run || $RM $removelist
25824+ exit $EXIT_FAILURE
25825+ fi
25826+
25827+ # Just move the object if needed
25828+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
25829+ func_show_eval '$MV "$output_obj" "$obj"' \
25830+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
25831+ fi
25832+ fi
25833+
25834+ $opt_dry_run || {
25835+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
25836+
25837+ # Unlock the critical section if it was locked
25838+ if test "$need_locks" != no; then
25839+ removelist=$lockfile
25840+ $RM "$lockfile"
25841+ fi
25842+ }
25843+
25844+ exit $EXIT_SUCCESS
25845+}
25846+
25847+$opt_help || {
25848+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
25849+}
25850+
25851+func_mode_help ()
25852+{
25853+ # We need to display help for each of the modes.
25854+ case $opt_mode in
25855+ "")
25856+ # Generic help is extracted from the usage comments
25857+ # at the start of this file.
25858+ func_help
25859+ ;;
25860+
25861+ clean)
25862+ $ECHO \
25863+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
25864+
25865+Remove files from the build directory.
25866+
25867+RM is the name of the program to use to delete files associated with each FILE
25868+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
25869+to RM.
25870+
25871+If FILE is a libtool library, object or program, all the files associated
25872+with it are deleted. Otherwise, only FILE itself is deleted using RM."
25873+ ;;
25874+
25875+ compile)
25876+ $ECHO \
25877+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
25878+
25879+Compile a source file into a libtool library object.
25880+
25881+This mode accepts the following additional options:
25882+
25883+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
25884+ -no-suppress do not suppress compiler output for multiple passes
25885+ -prefer-pic try to build PIC objects only
25886+ -prefer-non-pic try to build non-PIC objects only
25887+ -shared do not build a \`.o' file suitable for static linking
25888+ -static only build a \`.o' file suitable for static linking
25889+ -Wc,FLAG pass FLAG directly to the compiler
25890+
25891+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
25892+from the given SOURCEFILE.
25893+
25894+The output file name is determined by removing the directory component from
25895+SOURCEFILE, then substituting the C source code suffix \`.c' with the
25896+library object suffix, \`.lo'."
25897+ ;;
25898+
25899+ execute)
25900+ $ECHO \
25901+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
25902+
25903+Automatically set library path, then run a program.
25904+
25905+This mode accepts the following additional options:
25906+
25907+ -dlopen FILE add the directory containing FILE to the library path
25908+
25909+This mode sets the library path environment variable according to \`-dlopen'
25910+flags.
25911+
25912+If any of the ARGS are libtool executable wrappers, then they are translated
25913+into their corresponding uninstalled binary, and any of their required library
25914+directories are added to the library path.
25915+
25916+Then, COMMAND is executed, with ARGS as arguments."
25917+ ;;
25918+
25919+ finish)
25920+ $ECHO \
25921+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
25922+
25923+Complete the installation of libtool libraries.
25924+
25925+Each LIBDIR is a directory that contains libtool libraries.
25926+
25927+The commands that this mode executes may require superuser privileges. Use
25928+the \`--dry-run' option if you just want to see what would be executed."
25929+ ;;
25930+
25931+ install)
25932+ $ECHO \
25933+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
25934+
25935+Install executables or libraries.
25936+
25937+INSTALL-COMMAND is the installation command. The first component should be
25938+either the \`install' or \`cp' program.
25939+
25940+The following components of INSTALL-COMMAND are treated specially:
25941+
25942+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
25943+
25944+The rest of the components are interpreted as arguments to that command (only
25945+BSD-compatible install options are recognized)."
25946+ ;;
25947+
25948+ link)
25949+ $ECHO \
25950+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
25951+
25952+Link object files or libraries together to form another library, or to
25953+create an executable program.
25954+
25955+LINK-COMMAND is a command using the C compiler that you would use to create
25956+a program from several object files.
25957+
25958+The following components of LINK-COMMAND are treated specially:
25959+
25960+ -all-static do not do any dynamic linking at all
25961+ -avoid-version do not add a version suffix if possible
25962+ -bindir BINDIR specify path to binaries directory (for systems where
25963+ libraries must be found in the PATH setting at runtime)
25964+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
25965+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
25966+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
25967+ -export-symbols SYMFILE
25968+ try to export only the symbols listed in SYMFILE
25969+ -export-symbols-regex REGEX
25970+ try to export only the symbols matching REGEX
25971+ -LLIBDIR search LIBDIR for required installed libraries
25972+ -lNAME OUTPUT-FILE requires the installed library libNAME
25973+ -module build a library that can dlopened
25974+ -no-fast-install disable the fast-install mode
25975+ -no-install link a not-installable executable
25976+ -no-undefined declare that a library does not refer to external symbols
25977+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
25978+ -objectlist FILE Use a list of object files found in FILE to specify objects
25979+ -precious-files-regex REGEX
25980+ don't remove output files matching REGEX
25981+ -release RELEASE specify package release information
25982+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
25983+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
25984+ -shared only do dynamic linking of libtool libraries
25985+ -shrext SUFFIX override the standard shared library file extension
25986+ -static do not do any dynamic linking of uninstalled libtool libraries
25987+ -static-libtool-libs
25988+ do not do any dynamic linking of libtool libraries
25989+ -version-info CURRENT[:REVISION[:AGE]]
25990+ specify library version info [each variable defaults to 0]
25991+ -weak LIBNAME declare that the target provides the LIBNAME interface
25992+ -Wc,FLAG
25993+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
25994+ -Wl,FLAG
25995+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
25996+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
25997+
25998+All other options (arguments beginning with \`-') are ignored.
25999+
26000+Every other argument is treated as a filename. Files ending in \`.la' are
26001+treated as uninstalled libtool libraries, other files are standard or library
26002+object files.
26003+
26004+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
26005+only library objects (\`.lo' files) may be specified, and \`-rpath' is
26006+required, except when creating a convenience library.
26007+
26008+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
26009+using \`ar' and \`ranlib', or on Windows using \`lib'.
26010+
26011+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
26012+is created, otherwise an executable program is created."
26013+ ;;
26014+
26015+ uninstall)
26016+ $ECHO \
26017+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
26018+
26019+Remove libraries from an installation directory.
26020+
26021+RM is the name of the program to use to delete files associated with each FILE
26022+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
26023+to RM.
26024+
26025+If FILE is a libtool library, all the files associated with it are deleted.
26026+Otherwise, only FILE itself is deleted using RM."
26027+ ;;
26028+
26029+ *)
26030+ func_fatal_help "invalid operation mode \`$opt_mode'"
26031+ ;;
26032+ esac
26033+
26034+ echo
26035+ $ECHO "Try \`$progname --help' for more information about other modes."
26036+}
26037+
26038+# Now that we've collected a possible --mode arg, show help if necessary
26039+if $opt_help; then
26040+ if test "$opt_help" = :; then
26041+ func_mode_help
26042+ else
26043+ {
26044+ func_help noexit
26045+ for opt_mode in compile link execute install finish uninstall clean; do
26046+ func_mode_help
26047+ done
26048+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
26049+ {
26050+ func_help noexit
26051+ for opt_mode in compile link execute install finish uninstall clean; do
26052+ echo
26053+ func_mode_help
26054+ done
26055+ } |
26056+ sed '1d
26057+ /^When reporting/,/^Report/{
26058+ H
26059+ d
26060+ }
26061+ $x
26062+ /information about other modes/d
26063+ /more detailed .*MODE/d
26064+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
26065+ fi
26066+ exit $?
26067+fi
26068+
26069+
26070+# func_mode_execute arg...
26071+func_mode_execute ()
26072+{
26073+ $opt_debug
26074+ # The first argument is the command name.
26075+ cmd="$nonopt"
26076+ test -z "$cmd" && \
26077+ func_fatal_help "you must specify a COMMAND"
26078+
26079+ # Handle -dlopen flags immediately.
26080+ for file in $opt_dlopen; do
26081+ test -f "$file" \
26082+ || func_fatal_help "\`$file' is not a file"
26083+
26084+ dir=
26085+ case $file in
26086+ *.la)
26087+ func_resolve_sysroot "$file"
26088+ file=$func_resolve_sysroot_result
26089+
26090+ # Check to see that this really is a libtool archive.
26091+ func_lalib_unsafe_p "$file" \
26092+ || func_fatal_help "\`$lib' is not a valid libtool archive"
26093+
26094+ # Read the libtool library.
26095+ dlname=
26096+ library_names=
26097+ func_source "$file"
26098+
26099+ # Skip this library if it cannot be dlopened.
26100+ if test -z "$dlname"; then
26101+ # Warn if it was a shared library.
26102+ test -n "$library_names" && \
26103+ func_warning "\`$file' was not linked with \`-export-dynamic'"
26104+ continue
26105+ fi
26106+
26107+ func_dirname "$file" "" "."
26108+ dir="$func_dirname_result"
26109+
26110+ if test -f "$dir/$objdir/$dlname"; then
26111+ func_append dir "/$objdir"
26112+ else
26113+ if test ! -f "$dir/$dlname"; then
26114+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
26115+ fi
26116+ fi
26117+ ;;
26118+
26119+ *.lo)
26120+ # Just add the directory containing the .lo file.
26121+ func_dirname "$file" "" "."
26122+ dir="$func_dirname_result"
26123+ ;;
26124+
26125+ *)
26126+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
26127+ continue
26128+ ;;
26129+ esac
26130+
26131+ # Get the absolute pathname.
26132+ absdir=`cd "$dir" && pwd`
26133+ test -n "$absdir" && dir="$absdir"
26134+
26135+ # Now add the directory to shlibpath_var.
26136+ if eval "test -z \"\$$shlibpath_var\""; then
26137+ eval "$shlibpath_var=\"\$dir\""
26138+ else
26139+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
26140+ fi
26141+ done
26142+
26143+ # This variable tells wrapper scripts just to set shlibpath_var
26144+ # rather than running their programs.
26145+ libtool_execute_magic="$magic"
26146+
26147+ # Check if any of the arguments is a wrapper script.
26148+ args=
26149+ for file
26150+ do
26151+ case $file in
26152+ -* | *.la | *.lo ) ;;
26153+ *)
26154+ # Do a test to see if this is really a libtool program.
26155+ if func_ltwrapper_script_p "$file"; then
26156+ func_source "$file"
26157+ # Transform arg to wrapped name.
26158+ file="$progdir/$program"
26159+ elif func_ltwrapper_executable_p "$file"; then
26160+ func_ltwrapper_scriptname "$file"
26161+ func_source "$func_ltwrapper_scriptname_result"
26162+ # Transform arg to wrapped name.
26163+ file="$progdir/$program"
26164+ fi
26165+ ;;
26166+ esac
26167+ # Quote arguments (to preserve shell metacharacters).
26168+ func_append_quoted args "$file"
26169+ done
26170+
26171+ if test "X$opt_dry_run" = Xfalse; then
26172+ if test -n "$shlibpath_var"; then
26173+ # Export the shlibpath_var.
26174+ eval "export $shlibpath_var"
26175+ fi
26176+
26177+ # Restore saved environment variables
26178+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
26179+ do
26180+ eval "if test \"\${save_$lt_var+set}\" = set; then
26181+ $lt_var=\$save_$lt_var; export $lt_var
26182+ else
26183+ $lt_unset $lt_var
26184+ fi"
26185+ done
26186+
26187+ # Now prepare to actually exec the command.
26188+ exec_cmd="\$cmd$args"
26189+ else
26190+ # Display what would be done.
26191+ if test -n "$shlibpath_var"; then
26192+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
26193+ echo "export $shlibpath_var"
26194+ fi
26195+ $ECHO "$cmd$args"
26196+ exit $EXIT_SUCCESS
26197+ fi
26198+}
26199+
26200+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
26201+
26202+
26203+# func_mode_finish arg...
26204+func_mode_finish ()
26205+{
26206+ $opt_debug
26207+ libs=
26208+ libdirs=
26209+ admincmds=
26210+
26211+ for opt in "$nonopt" ${1+"$@"}
26212+ do
26213+ if test -d "$opt"; then
26214+ func_append libdirs " $opt"
26215+
26216+ elif test -f "$opt"; then
26217+ if func_lalib_unsafe_p "$opt"; then
26218+ func_append libs " $opt"
26219+ else
26220+ func_warning "\`$opt' is not a valid libtool archive"
26221+ fi
26222+
26223+ else
26224+ func_fatal_error "invalid argument \`$opt'"
26225+ fi
26226+ done
26227+
26228+ if test -n "$libs"; then
26229+ if test -n "$lt_sysroot"; then
26230+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
26231+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
26232+ else
26233+ sysroot_cmd=
26234+ fi
26235+
26236+ # Remove sysroot references
26237+ if $opt_dry_run; then
26238+ for lib in $libs; do
26239+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
26240+ done
26241+ else
26242+ tmpdir=`func_mktempdir`
26243+ for lib in $libs; do
26244+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
26245+ > $tmpdir/tmp-la
26246+ mv -f $tmpdir/tmp-la $lib
26247+ done
26248+ ${RM}r "$tmpdir"
26249+ fi
26250+ fi
26251+
26252+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
26253+ for libdir in $libdirs; do
26254+ if test -n "$finish_cmds"; then
26255+ # Do each command in the finish commands.
26256+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
26257+'"$cmd"'"'
26258+ fi
26259+ if test -n "$finish_eval"; then
26260+ # Do the single finish_eval.
26261+ eval cmds=\"$finish_eval\"
26262+ $opt_dry_run || eval "$cmds" || func_append admincmds "
26263+ $cmds"
26264+ fi
26265+ done
26266+ fi
26267+
26268+ # Exit here if they wanted silent mode.
26269+ $opt_silent && exit $EXIT_SUCCESS
26270+
26271+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
26272+ echo "----------------------------------------------------------------------"
26273+ echo "Libraries have been installed in:"
26274+ for libdir in $libdirs; do
26275+ $ECHO " $libdir"
26276+ done
26277+ echo
26278+ echo "If you ever happen to want to link against installed libraries"
26279+ echo "in a given directory, LIBDIR, you must either use libtool, and"
26280+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
26281+ echo "flag during linking and do at least one of the following:"
26282+ if test -n "$shlibpath_var"; then
26283+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
26284+ echo " during execution"
26285+ fi
26286+ if test -n "$runpath_var"; then
26287+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
26288+ echo " during linking"
26289+ fi
26290+ if test -n "$hardcode_libdir_flag_spec"; then
26291+ libdir=LIBDIR
26292+ eval flag=\"$hardcode_libdir_flag_spec\"
26293+
26294+ $ECHO " - use the \`$flag' linker flag"
26295+ fi
26296+ if test -n "$admincmds"; then
26297+ $ECHO " - have your system administrator run these commands:$admincmds"
26298+ fi
26299+ if test -f /etc/ld.so.conf; then
26300+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
26301+ fi
26302+ echo
26303+
26304+ echo "See any operating system documentation about shared libraries for"
26305+ case $host in
26306+ solaris2.[6789]|solaris2.1[0-9])
26307+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
26308+ echo "pages."
26309+ ;;
26310+ *)
26311+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
26312+ ;;
26313+ esac
26314+ echo "----------------------------------------------------------------------"
26315+ fi
26316+ exit $EXIT_SUCCESS
26317+}
26318+
26319+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
26320+
26321+
26322+# func_mode_install arg...
26323+func_mode_install ()
26324+{
26325+ $opt_debug
26326+ # There may be an optional sh(1) argument at the beginning of
26327+ # install_prog (especially on Windows NT).
26328+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
26329+ # Allow the use of GNU shtool's install command.
26330+ case $nonopt in *shtool*) :;; *) false;; esac; then
26331+ # Aesthetically quote it.
26332+ func_quote_for_eval "$nonopt"
26333+ install_prog="$func_quote_for_eval_result "
26334+ arg=$1
26335+ shift
26336+ else
26337+ install_prog=
26338+ arg=$nonopt
26339+ fi
26340+
26341+ # The real first argument should be the name of the installation program.
26342+ # Aesthetically quote it.
26343+ func_quote_for_eval "$arg"
26344+ func_append install_prog "$func_quote_for_eval_result"
26345+ install_shared_prog=$install_prog
26346+ case " $install_prog " in
26347+ *[\\\ /]cp\ *) install_cp=: ;;
26348+ *) install_cp=false ;;
26349+ esac
26350+
26351+ # We need to accept at least all the BSD install flags.
26352+ dest=
26353+ files=
26354+ opts=
26355+ prev=
26356+ install_type=
26357+ isdir=no
26358+ stripme=
26359+ no_mode=:
26360+ for arg
26361+ do
26362+ arg2=
26363+ if test -n "$dest"; then
26364+ func_append files " $dest"
26365+ dest=$arg
26366+ continue
26367+ fi
26368+
26369+ case $arg in
26370+ -d) isdir=yes ;;
26371+ -f)
26372+ if $install_cp; then :; else
26373+ prev=$arg
26374+ fi
26375+ ;;
26376+ -g | -m | -o)
26377+ prev=$arg
26378+ ;;
26379+ -s)
26380+ stripme=" -s"
26381+ continue
26382+ ;;
26383+ -*)
26384+ ;;
26385+ *)
26386+ # If the previous option needed an argument, then skip it.
26387+ if test -n "$prev"; then
26388+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
26389+ arg2=$install_override_mode
26390+ no_mode=false
26391+ fi
26392+ prev=
26393+ else
26394+ dest=$arg
26395+ continue
26396+ fi
26397+ ;;
26398+ esac
26399+
26400+ # Aesthetically quote the argument.
26401+ func_quote_for_eval "$arg"
26402+ func_append install_prog " $func_quote_for_eval_result"
26403+ if test -n "$arg2"; then
26404+ func_quote_for_eval "$arg2"
26405+ fi
26406+ func_append install_shared_prog " $func_quote_for_eval_result"
26407+ done
26408+
26409+ test -z "$install_prog" && \
26410+ func_fatal_help "you must specify an install program"
26411+
26412+ test -n "$prev" && \
26413+ func_fatal_help "the \`$prev' option requires an argument"
26414+
26415+ if test -n "$install_override_mode" && $no_mode; then
26416+ if $install_cp; then :; else
26417+ func_quote_for_eval "$install_override_mode"
26418+ func_append install_shared_prog " -m $func_quote_for_eval_result"
26419+ fi
26420+ fi
26421+
26422+ if test -z "$files"; then
26423+ if test -z "$dest"; then
26424+ func_fatal_help "no file or destination specified"
26425+ else
26426+ func_fatal_help "you must specify a destination"
26427+ fi
26428+ fi
26429+
26430+ # Strip any trailing slash from the destination.
26431+ func_stripname '' '/' "$dest"
26432+ dest=$func_stripname_result
26433+
26434+ # Check to see that the destination is a directory.
26435+ test -d "$dest" && isdir=yes
26436+ if test "$isdir" = yes; then
26437+ destdir="$dest"
26438+ destname=
26439+ else
26440+ func_dirname_and_basename "$dest" "" "."
26441+ destdir="$func_dirname_result"
26442+ destname="$func_basename_result"
26443+
26444+ # Not a directory, so check to see that there is only one file specified.
26445+ set dummy $files; shift
26446+ test "$#" -gt 1 && \
26447+ func_fatal_help "\`$dest' is not a directory"
26448+ fi
26449+ case $destdir in
26450+ [\\/]* | [A-Za-z]:[\\/]*) ;;
26451+ *)
26452+ for file in $files; do
26453+ case $file in
26454+ *.lo) ;;
26455+ *)
26456+ func_fatal_help "\`$destdir' must be an absolute directory name"
26457+ ;;
26458+ esac
26459+ done
26460+ ;;
26461+ esac
26462+
26463+ # This variable tells wrapper scripts just to set variables rather
26464+ # than running their programs.
26465+ libtool_install_magic="$magic"
26466+
26467+ staticlibs=
26468+ future_libdirs=
26469+ current_libdirs=
26470+ for file in $files; do
26471+
26472+ # Do each installation.
26473+ case $file in
26474+ *.$libext)
26475+ # Do the static libraries later.
26476+ func_append staticlibs " $file"
26477+ ;;
26478+
26479+ *.la)
26480+ func_resolve_sysroot "$file"
26481+ file=$func_resolve_sysroot_result
26482+
26483+ # Check to see that this really is a libtool archive.
26484+ func_lalib_unsafe_p "$file" \
26485+ || func_fatal_help "\`$file' is not a valid libtool archive"
26486+
26487+ library_names=
26488+ old_library=
26489+ relink_command=
26490+ func_source "$file"
26491+
26492+ # Add the libdir to current_libdirs if it is the destination.
26493+ if test "X$destdir" = "X$libdir"; then
26494+ case "$current_libdirs " in
26495+ *" $libdir "*) ;;
26496+ *) func_append current_libdirs " $libdir" ;;
26497+ esac
26498+ else
26499+ # Note the libdir as a future libdir.
26500+ case "$future_libdirs " in
26501+ *" $libdir "*) ;;
26502+ *) func_append future_libdirs " $libdir" ;;
26503+ esac
26504+ fi
26505+
26506+ func_dirname "$file" "/" ""
26507+ dir="$func_dirname_result"
26508+ func_append dir "$objdir"
26509+
26510+ if test -n "$relink_command"; then
26511+ # Determine the prefix the user has applied to our future dir.
26512+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
26513+
26514+ # Don't allow the user to place us outside of our expected
26515+ # location b/c this prevents finding dependent libraries that
26516+ # are installed to the same prefix.
26517+ # At present, this check doesn't affect windows .dll's that
26518+ # are installed into $libdir/../bin (currently, that works fine)
26519+ # but it's something to keep an eye on.
26520+ test "$inst_prefix_dir" = "$destdir" && \
26521+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
26522+
26523+ if test -n "$inst_prefix_dir"; then
26524+ # Stick the inst_prefix_dir data into the link command.
26525+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
26526+ else
26527+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
26528+ fi
26529+
26530+ func_warning "relinking \`$file'"
26531+ func_show_eval "$relink_command" \
26532+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
26533+ fi
26534+
26535+ # See the names of the shared library.
26536+ set dummy $library_names; shift
26537+ if test -n "$1"; then
26538+ realname="$1"
26539+ shift
26540+
26541+ srcname="$realname"
26542+ test -n "$relink_command" && srcname="$realname"T
26543+
26544+ # Install the shared library and build the symlinks.
26545+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
26546+ 'exit $?'
26547+ tstripme="$stripme"
26548+ case $host_os in
26549+ cygwin* | mingw* | pw32* | cegcc*)
26550+ case $realname in
26551+ *.dll.a)
26552+ tstripme=""
26553+ ;;
26554+ esac
26555+ ;;
26556+ esac
26557+ if test -n "$tstripme" && test -n "$striplib"; then
26558+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
26559+ fi
26560+
26561+ if test "$#" -gt 0; then
26562+ # Delete the old symlinks, and create new ones.
26563+ # Try `ln -sf' first, because the `ln' binary might depend on
26564+ # the symlink we replace! Solaris /bin/ln does not understand -f,
26565+ # so we also need to try rm && ln -s.
26566+ for linkname
26567+ do
26568+ test "$linkname" != "$realname" \
26569+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
26570+ done
26571+ fi
26572+
26573+ # Do each command in the postinstall commands.
26574+ lib="$destdir/$realname"
26575+ func_execute_cmds "$postinstall_cmds" 'exit $?'
26576+ fi
26577+
26578+ # Install the pseudo-library for information purposes.
26579+ func_basename "$file"
26580+ name="$func_basename_result"
26581+ instname="$dir/$name"i
26582+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
26583+
26584+ # Maybe install the static library, too.
26585+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
26586+ ;;
26587+
26588+ *.lo)
26589+ # Install (i.e. copy) a libtool object.
26590+
26591+ # Figure out destination file name, if it wasn't already specified.
26592+ if test -n "$destname"; then
26593+ destfile="$destdir/$destname"
26594+ else
26595+ func_basename "$file"
26596+ destfile="$func_basename_result"
26597+ destfile="$destdir/$destfile"
26598+ fi
26599+
26600+ # Deduce the name of the destination old-style object file.
26601+ case $destfile in
26602+ *.lo)
26603+ func_lo2o "$destfile"
26604+ staticdest=$func_lo2o_result
26605+ ;;
26606+ *.$objext)
26607+ staticdest="$destfile"
26608+ destfile=
26609+ ;;
26610+ *)
26611+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
26612+ ;;
26613+ esac
26614+
26615+ # Install the libtool object if requested.
26616+ test -n "$destfile" && \
26617+ func_show_eval "$install_prog $file $destfile" 'exit $?'
26618+
26619+ # Install the old object if enabled.
26620+ if test "$build_old_libs" = yes; then
26621+ # Deduce the name of the old-style object file.
26622+ func_lo2o "$file"
26623+ staticobj=$func_lo2o_result
26624+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
26625+ fi
26626+ exit $EXIT_SUCCESS
26627+ ;;
26628+
26629+ *)
26630+ # Figure out destination file name, if it wasn't already specified.
26631+ if test -n "$destname"; then
26632+ destfile="$destdir/$destname"
26633+ else
26634+ func_basename "$file"
26635+ destfile="$func_basename_result"
26636+ destfile="$destdir/$destfile"
26637+ fi
26638+
26639+ # If the file is missing, and there is a .exe on the end, strip it
26640+ # because it is most likely a libtool script we actually want to
26641+ # install
26642+ stripped_ext=""
26643+ case $file in
26644+ *.exe)
26645+ if test ! -f "$file"; then
26646+ func_stripname '' '.exe' "$file"
26647+ file=$func_stripname_result
26648+ stripped_ext=".exe"
26649+ fi
26650+ ;;
26651+ esac
26652+
26653+ # Do a test to see if this is really a libtool program.
26654+ case $host in
26655+ *cygwin* | *mingw*)
26656+ if func_ltwrapper_executable_p "$file"; then
26657+ func_ltwrapper_scriptname "$file"
26658+ wrapper=$func_ltwrapper_scriptname_result
26659+ else
26660+ func_stripname '' '.exe' "$file"
26661+ wrapper=$func_stripname_result
26662+ fi
26663+ ;;
26664+ *)
26665+ wrapper=$file
26666+ ;;
26667+ esac
26668+ if func_ltwrapper_script_p "$wrapper"; then
26669+ notinst_deplibs=
26670+ relink_command=
26671+
26672+ func_source "$wrapper"
26673+
26674+ # Check the variables that should have been set.
26675+ test -z "$generated_by_libtool_version" && \
26676+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
26677+
26678+ finalize=yes
26679+ for lib in $notinst_deplibs; do
26680+ # Check to see that each library is installed.
26681+ libdir=
26682+ if test -f "$lib"; then
26683+ func_source "$lib"
26684+ fi
26685+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
26686+ if test -n "$libdir" && test ! -f "$libfile"; then
26687+ func_warning "\`$lib' has not been installed in \`$libdir'"
26688+ finalize=no
26689+ fi
26690+ done
26691+
26692+ relink_command=
26693+ func_source "$wrapper"
26694+
26695+ outputname=
26696+ if test "$fast_install" = no && test -n "$relink_command"; then
26697+ $opt_dry_run || {
26698+ if test "$finalize" = yes; then
26699+ tmpdir=`func_mktempdir`
26700+ func_basename "$file$stripped_ext"
26701+ file="$func_basename_result"
26702+ outputname="$tmpdir/$file"
26703+ # Replace the output file specification.
26704+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
26705+
26706+ $opt_silent || {
26707+ func_quote_for_expand "$relink_command"
26708+ eval "func_echo $func_quote_for_expand_result"
26709+ }
26710+ if eval "$relink_command"; then :
26711+ else
26712+ func_error "error: relink \`$file' with the above command before installing it"
26713+ $opt_dry_run || ${RM}r "$tmpdir"
26714+ continue
26715+ fi
26716+ file="$outputname"
26717+ else
26718+ func_warning "cannot relink \`$file'"
26719+ fi
26720+ }
26721+ else
26722+ # Install the binary that we compiled earlier.
26723+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
26724+ fi
26725+ fi
26726+
26727+ # remove .exe since cygwin /usr/bin/install will append another
26728+ # one anyway
26729+ case $install_prog,$host in
26730+ */usr/bin/install*,*cygwin*)
26731+ case $file:$destfile in
26732+ *.exe:*.exe)
26733+ # this is ok
26734+ ;;
26735+ *.exe:*)
26736+ destfile=$destfile.exe
26737+ ;;
26738+ *:*.exe)
26739+ func_stripname '' '.exe' "$destfile"
26740+ destfile=$func_stripname_result
26741+ ;;
26742+ esac
26743+ ;;
26744+ esac
26745+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
26746+ $opt_dry_run || if test -n "$outputname"; then
26747+ ${RM}r "$tmpdir"
26748+ fi
26749+ ;;
26750+ esac
26751+ done
26752+
26753+ for file in $staticlibs; do
26754+ func_basename "$file"
26755+ name="$func_basename_result"
26756+
26757+ # Set up the ranlib parameters.
26758+ oldlib="$destdir/$name"
26759+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
26760+ tool_oldlib=$func_to_tool_file_result
26761+
26762+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
26763+
26764+ if test -n "$stripme" && test -n "$old_striplib"; then
26765+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
26766+ fi
26767+
26768+ # Do each command in the postinstall commands.
26769+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
26770+ done
26771+
26772+ test -n "$future_libdirs" && \
26773+ func_warning "remember to run \`$progname --finish$future_libdirs'"
26774+
26775+ if test -n "$current_libdirs"; then
26776+ # Maybe just do a dry run.
26777+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
26778+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
26779+ else
26780+ exit $EXIT_SUCCESS
26781+ fi
26782+}
26783+
26784+test "$opt_mode" = install && func_mode_install ${1+"$@"}
26785+
26786+
26787+# func_generate_dlsyms outputname originator pic_p
26788+# Extract symbols from dlprefiles and create ${outputname}S.o with
26789+# a dlpreopen symbol table.
26790+func_generate_dlsyms ()
26791+{
26792+ $opt_debug
26793+ my_outputname="$1"
26794+ my_originator="$2"
26795+ my_pic_p="${3-no}"
26796+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
26797+ my_dlsyms=
26798+
26799+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
26800+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
26801+ my_dlsyms="${my_outputname}S.c"
26802+ else
26803+ func_error "not configured to extract global symbols from dlpreopened files"
26804+ fi
26805+ fi
26806+
26807+ if test -n "$my_dlsyms"; then
26808+ case $my_dlsyms in
26809+ "") ;;
26810+ *.c)
26811+ # Discover the nlist of each of the dlfiles.
26812+ nlist="$output_objdir/${my_outputname}.nm"
26813+
26814+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
26815+
26816+ # Parse the name list into a source file.
26817+ func_verbose "creating $output_objdir/$my_dlsyms"
26818+
26819+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
26820+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
26821+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
26822+
26823+#ifdef __cplusplus
26824+extern \"C\" {
26825+#endif
26826+
26827+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
26828+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
26829+#endif
26830+
26831+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
26832+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
26833+/* DATA imports from DLLs on WIN32 con't be const, because runtime
26834+ relocations are performed -- see ld's documentation on pseudo-relocs. */
26835+# define LT_DLSYM_CONST
26836+#elif defined(__osf__)
26837+/* This system does not cope well with relocations in const data. */
26838+# define LT_DLSYM_CONST
26839+#else
26840+# define LT_DLSYM_CONST const
26841+#endif
26842+
26843+/* External symbol declarations for the compiler. */\
26844+"
26845+
26846+ if test "$dlself" = yes; then
26847+ func_verbose "generating symbol list for \`$output'"
26848+
26849+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
26850+
26851+ # Add our own program objects to the symbol list.
26852+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
26853+ for progfile in $progfiles; do
26854+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
26855+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
26856+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
26857+ done
26858+
26859+ if test -n "$exclude_expsyms"; then
26860+ $opt_dry_run || {
26861+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
26862+ eval '$MV "$nlist"T "$nlist"'
26863+ }
26864+ fi
26865+
26866+ if test -n "$export_symbols_regex"; then
26867+ $opt_dry_run || {
26868+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
26869+ eval '$MV "$nlist"T "$nlist"'
26870+ }
26871+ fi
26872+
26873+ # Prepare the list of exported symbols
26874+ if test -z "$export_symbols"; then
26875+ export_symbols="$output_objdir/$outputname.exp"
26876+ $opt_dry_run || {
26877+ $RM $export_symbols
26878+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
26879+ case $host in
26880+ *cygwin* | *mingw* | *cegcc* )
26881+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
26882+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
26883+ ;;
26884+ esac
26885+ }
26886+ else
26887+ $opt_dry_run || {
26888+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
26889+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
26890+ eval '$MV "$nlist"T "$nlist"'
26891+ case $host in
26892+ *cygwin* | *mingw* | *cegcc* )
26893+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
26894+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
26895+ ;;
26896+ esac
26897+ }
26898+ fi
26899+ fi
26900+
26901+ for dlprefile in $dlprefiles; do
26902+ func_verbose "extracting global C symbols from \`$dlprefile'"
26903+ func_basename "$dlprefile"
26904+ name="$func_basename_result"
26905+ case $host in
26906+ *cygwin* | *mingw* | *cegcc* )
26907+ # if an import library, we need to obtain dlname
26908+ if func_win32_import_lib_p "$dlprefile"; then
26909+ func_tr_sh "$dlprefile"
26910+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
26911+ dlprefile_dlbasename=""
26912+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
26913+ # Use subshell, to avoid clobbering current variable values
26914+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
26915+ if test -n "$dlprefile_dlname" ; then
26916+ func_basename "$dlprefile_dlname"
26917+ dlprefile_dlbasename="$func_basename_result"
26918+ else
26919+ # no lafile. user explicitly requested -dlpreopen <import library>.
26920+ $sharedlib_from_linklib_cmd "$dlprefile"
26921+ dlprefile_dlbasename=$sharedlib_from_linklib_result
26922+ fi
26923+ fi
26924+ $opt_dry_run || {
26925+ if test -n "$dlprefile_dlbasename" ; then
26926+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
26927+ else
26928+ func_warning "Could not compute DLL name from $name"
26929+ eval '$ECHO ": $name " >> "$nlist"'
26930+ fi
26931+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
26932+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
26933+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
26934+ }
26935+ else # not an import lib
26936+ $opt_dry_run || {
26937+ eval '$ECHO ": $name " >> "$nlist"'
26938+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
26939+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
26940+ }
26941+ fi
26942+ ;;
26943+ *)
26944+ $opt_dry_run || {
26945+ eval '$ECHO ": $name " >> "$nlist"'
26946+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
26947+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
26948+ }
26949+ ;;
26950+ esac
26951+ done
26952+
26953+ $opt_dry_run || {
26954+ # Make sure we have at least an empty file.
26955+ test -f "$nlist" || : > "$nlist"
26956+
26957+ if test -n "$exclude_expsyms"; then
26958+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
26959+ $MV "$nlist"T "$nlist"
26960+ fi
26961+
26962+ # Try sorting and uniquifying the output.
26963+ if $GREP -v "^: " < "$nlist" |
26964+ if sort -k 3 </dev/null >/dev/null 2>&1; then
26965+ sort -k 3
26966+ else
26967+ sort +2
26968+ fi |
26969+ uniq > "$nlist"S; then
26970+ :
26971+ else
26972+ $GREP -v "^: " < "$nlist" > "$nlist"S
26973+ fi
26974+
26975+ if test -f "$nlist"S; then
26976+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
26977+ else
26978+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
26979+ fi
26980+
26981+ echo >> "$output_objdir/$my_dlsyms" "\
26982+
26983+/* The mapping between symbol names and symbols. */
26984+typedef struct {
26985+ const char *name;
26986+ void *address;
26987+} lt_dlsymlist;
26988+extern LT_DLSYM_CONST lt_dlsymlist
26989+lt_${my_prefix}_LTX_preloaded_symbols[];
26990+LT_DLSYM_CONST lt_dlsymlist
26991+lt_${my_prefix}_LTX_preloaded_symbols[] =
26992+{\
26993+ { \"$my_originator\", (void *) 0 },"
26994+
26995+ case $need_lib_prefix in
26996+ no)
26997+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
26998+ ;;
26999+ *)
27000+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
27001+ ;;
27002+ esac
27003+ echo >> "$output_objdir/$my_dlsyms" "\
27004+ {0, (void *) 0}
27005+};
27006+
27007+/* This works around a problem in FreeBSD linker */
27008+#ifdef FREEBSD_WORKAROUND
27009+static const void *lt_preloaded_setup() {
27010+ return lt_${my_prefix}_LTX_preloaded_symbols;
27011+}
27012+#endif
27013+
27014+#ifdef __cplusplus
27015+}
27016+#endif\
27017+"
27018+ } # !$opt_dry_run
27019+
27020+ pic_flag_for_symtable=
27021+ case "$compile_command " in
27022+ *" -static "*) ;;
27023+ *)
27024+ case $host in
27025+ # compiling the symbol table file with pic_flag works around
27026+ # a FreeBSD bug that causes programs to crash when -lm is
27027+ # linked before any other PIC object. But we must not use
27028+ # pic_flag when linking with -static. The problem exists in
27029+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
27030+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
27031+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
27032+ *-*-hpux*)
27033+ pic_flag_for_symtable=" $pic_flag" ;;
27034+ *)
27035+ if test "X$my_pic_p" != Xno; then
27036+ pic_flag_for_symtable=" $pic_flag"
27037+ fi
27038+ ;;
27039+ esac
27040+ ;;
27041+ esac
27042+ symtab_cflags=
27043+ for arg in $LTCFLAGS; do
27044+ case $arg in
27045+ -pie | -fpie | -fPIE) ;;
27046+ *) func_append symtab_cflags " $arg" ;;
27047+ esac
27048+ done
27049+
27050+ # Now compile the dynamic symbol file.
27051+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
27052+
27053+ # Clean up the generated files.
27054+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
27055+
27056+ # Transform the symbol file into the correct name.
27057+ symfileobj="$output_objdir/${my_outputname}S.$objext"
27058+ case $host in
27059+ *cygwin* | *mingw* | *cegcc* )
27060+ if test -f "$output_objdir/$my_outputname.def"; then
27061+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
27062+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
27063+ else
27064+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
27065+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
27066+ fi
27067+ ;;
27068+ *)
27069+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
27070+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
27071+ ;;
27072+ esac
27073+ ;;
27074+ *)
27075+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
27076+ ;;
27077+ esac
27078+ else
27079+ # We keep going just in case the user didn't refer to
27080+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
27081+ # really was required.
27082+
27083+ # Nullify the symbol file.
27084+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
27085+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
27086+ fi
27087+}
27088+
27089+# func_win32_libid arg
27090+# return the library type of file 'arg'
27091+#
27092+# Need a lot of goo to handle *both* DLLs and import libs
27093+# Has to be a shell function in order to 'eat' the argument
27094+# that is supplied when $file_magic_command is called.
27095+# Despite the name, also deal with 64 bit binaries.
27096+func_win32_libid ()
27097+{
27098+ $opt_debug
27099+ win32_libid_type="unknown"
27100+ win32_fileres=`file -L $1 2>/dev/null`
27101+ case $win32_fileres in
27102+ *ar\ archive\ import\ library*) # definitely import
27103+ win32_libid_type="x86 archive import"
27104+ ;;
27105+ *ar\ archive*) # could be an import, or static
27106+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
27107+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
27108+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
27109+ func_to_tool_file "$1" func_convert_file_msys_to_w32
27110+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
27111+ $SED -n -e '
27112+ 1,100{
27113+ / I /{
27114+ s,.*,import,
27115+ p
27116+ q
27117+ }
27118+ }'`
27119+ case $win32_nmres in
27120+ import*) win32_libid_type="x86 archive import";;
27121+ *) win32_libid_type="x86 archive static";;
27122+ esac
27123+ fi
27124+ ;;
27125+ *DLL*)
27126+ win32_libid_type="x86 DLL"
27127+ ;;
27128+ *executable*) # but shell scripts are "executable" too...
27129+ case $win32_fileres in
27130+ *MS\ Windows\ PE\ Intel*)
27131+ win32_libid_type="x86 DLL"
27132+ ;;
27133+ esac
27134+ ;;
27135+ esac
27136+ $ECHO "$win32_libid_type"
27137+}
27138+
27139+# func_cygming_dll_for_implib ARG
27140+#
27141+# Platform-specific function to extract the
27142+# name of the DLL associated with the specified
27143+# import library ARG.
27144+# Invoked by eval'ing the libtool variable
27145+# $sharedlib_from_linklib_cmd
27146+# Result is available in the variable
27147+# $sharedlib_from_linklib_result
27148+func_cygming_dll_for_implib ()
27149+{
27150+ $opt_debug
27151+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
27152+}
27153+
27154+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
27155+#
27156+# The is the core of a fallback implementation of a
27157+# platform-specific function to extract the name of the
27158+# DLL associated with the specified import library LIBNAME.
27159+#
27160+# SECTION_NAME is either .idata$6 or .idata$7, depending
27161+# on the platform and compiler that created the implib.
27162+#
27163+# Echos the name of the DLL associated with the
27164+# specified import library.
27165+func_cygming_dll_for_implib_fallback_core ()
27166+{
27167+ $opt_debug
27168+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
27169+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
27170+ $SED '/^Contents of section '"$match_literal"':/{
27171+ # Place marker at beginning of archive member dllname section
27172+ s/.*/====MARK====/
27173+ p
27174+ d
27175+ }
27176+ # These lines can sometimes be longer than 43 characters, but
27177+ # are always uninteresting
27178+ /:[ ]*file format pe[i]\{,1\}-/d
27179+ /^In archive [^:]*:/d
27180+ # Ensure marker is printed
27181+ /^====MARK====/p
27182+ # Remove all lines with less than 43 characters
27183+ /^.\{43\}/!d
27184+ # From remaining lines, remove first 43 characters
27185+ s/^.\{43\}//' |
27186+ $SED -n '
27187+ # Join marker and all lines until next marker into a single line
27188+ /^====MARK====/ b para
27189+ H
27190+ $ b para
27191+ b
27192+ :para
27193+ x
27194+ s/\n//g
27195+ # Remove the marker
27196+ s/^====MARK====//
27197+ # Remove trailing dots and whitespace
27198+ s/[\. \t]*$//
27199+ # Print
27200+ /./p' |
27201+ # we now have a list, one entry per line, of the stringified
27202+ # contents of the appropriate section of all members of the
27203+ # archive which possess that section. Heuristic: eliminate
27204+ # all those which have a first or second character that is
27205+ # a '.' (that is, objdump's representation of an unprintable
27206+ # character.) This should work for all archives with less than
27207+ # 0x302f exports -- but will fail for DLLs whose name actually
27208+ # begins with a literal '.' or a single character followed by
27209+ # a '.'.
27210+ #
27211+ # Of those that remain, print the first one.
27212+ $SED -e '/^\./d;/^.\./d;q'
27213+}
27214+
27215+# func_cygming_gnu_implib_p ARG
27216+# This predicate returns with zero status (TRUE) if
27217+# ARG is a GNU/binutils-style import library. Returns
27218+# with nonzero status (FALSE) otherwise.
27219+func_cygming_gnu_implib_p ()
27220+{
27221+ $opt_debug
27222+ func_to_tool_file "$1" func_convert_file_msys_to_w32
27223+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
27224+ test -n "$func_cygming_gnu_implib_tmp"
27225+}
27226+
27227+# func_cygming_ms_implib_p ARG
27228+# This predicate returns with zero status (TRUE) if
27229+# ARG is an MS-style import library. Returns
27230+# with nonzero status (FALSE) otherwise.
27231+func_cygming_ms_implib_p ()
27232+{
27233+ $opt_debug
27234+ func_to_tool_file "$1" func_convert_file_msys_to_w32
27235+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
27236+ test -n "$func_cygming_ms_implib_tmp"
27237+}
27238+
27239+# func_cygming_dll_for_implib_fallback ARG
27240+# Platform-specific function to extract the
27241+# name of the DLL associated with the specified
27242+# import library ARG.
27243+#
27244+# This fallback implementation is for use when $DLLTOOL
27245+# does not support the --identify-strict option.
27246+# Invoked by eval'ing the libtool variable
27247+# $sharedlib_from_linklib_cmd
27248+# Result is available in the variable
27249+# $sharedlib_from_linklib_result
27250+func_cygming_dll_for_implib_fallback ()
27251+{
27252+ $opt_debug
27253+ if func_cygming_gnu_implib_p "$1" ; then
27254+ # binutils import library
27255+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
27256+ elif func_cygming_ms_implib_p "$1" ; then
27257+ # ms-generated import library
27258+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
27259+ else
27260+ # unknown
27261+ sharedlib_from_linklib_result=""
27262+ fi
27263+}
27264+
27265+
27266+# func_extract_an_archive dir oldlib
27267+func_extract_an_archive ()
27268+{
27269+ $opt_debug
27270+ f_ex_an_ar_dir="$1"; shift
27271+ f_ex_an_ar_oldlib="$1"
27272+ if test "$lock_old_archive_extraction" = yes; then
27273+ lockfile=$f_ex_an_ar_oldlib.lock
27274+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
27275+ func_echo "Waiting for $lockfile to be removed"
27276+ sleep 2
27277+ done
27278+ fi
27279+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
27280+ 'stat=$?; rm -f "$lockfile"; exit $stat'
27281+ if test "$lock_old_archive_extraction" = yes; then
27282+ $opt_dry_run || rm -f "$lockfile"
27283+ fi
27284+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
27285+ :
27286+ else
27287+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
27288+ fi
27289+}
27290+
27291+
27292+# func_extract_archives gentop oldlib ...
27293+func_extract_archives ()
27294+{
27295+ $opt_debug
27296+ my_gentop="$1"; shift
27297+ my_oldlibs=${1+"$@"}
27298+ my_oldobjs=""
27299+ my_xlib=""
27300+ my_xabs=""
27301+ my_xdir=""
27302+
27303+ for my_xlib in $my_oldlibs; do
27304+ # Extract the objects.
27305+ case $my_xlib in
27306+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
27307+ *) my_xabs=`pwd`"/$my_xlib" ;;
27308+ esac
27309+ func_basename "$my_xlib"
27310+ my_xlib="$func_basename_result"
27311+ my_xlib_u=$my_xlib
27312+ while :; do
27313+ case " $extracted_archives " in
27314+ *" $my_xlib_u "*)
27315+ func_arith $extracted_serial + 1
27316+ extracted_serial=$func_arith_result
27317+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
27318+ *) break ;;
27319+ esac
27320+ done
27321+ extracted_archives="$extracted_archives $my_xlib_u"
27322+ my_xdir="$my_gentop/$my_xlib_u"
27323+
27324+ func_mkdir_p "$my_xdir"
27325+
27326+ case $host in
27327+ *-darwin*)
27328+ func_verbose "Extracting $my_xabs"
27329+ # Do not bother doing anything if just a dry run
27330+ $opt_dry_run || {
27331+ darwin_orig_dir=`pwd`
27332+ cd $my_xdir || exit $?
27333+ darwin_archive=$my_xabs
27334+ darwin_curdir=`pwd`
27335+ darwin_base_archive=`basename "$darwin_archive"`
27336+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
27337+ if test -n "$darwin_arches"; then
27338+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
27339+ darwin_arch=
27340+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
27341+ for darwin_arch in $darwin_arches ; do
27342+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
27343+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
27344+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
27345+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
27346+ cd "$darwin_curdir"
27347+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
27348+ done # $darwin_arches
27349+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
27350+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
27351+ darwin_file=
27352+ darwin_files=
27353+ for darwin_file in $darwin_filelist; do
27354+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
27355+ $LIPO -create -output "$darwin_file" $darwin_files
27356+ done # $darwin_filelist
27357+ $RM -rf unfat-$$
27358+ cd "$darwin_orig_dir"
27359+ else
27360+ cd $darwin_orig_dir
27361+ func_extract_an_archive "$my_xdir" "$my_xabs"
27362+ fi # $darwin_arches
27363+ } # !$opt_dry_run
27364+ ;;
27365+ *)
27366+ func_extract_an_archive "$my_xdir" "$my_xabs"
27367+ ;;
27368+ esac
27369+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
27370+ done
27371+
27372+ func_extract_archives_result="$my_oldobjs"
27373+}
27374+
27375+
27376+# func_emit_wrapper [arg=no]
27377+#
27378+# Emit a libtool wrapper script on stdout.
27379+# Don't directly open a file because we may want to
27380+# incorporate the script contents within a cygwin/mingw
27381+# wrapper executable. Must ONLY be called from within
27382+# func_mode_link because it depends on a number of variables
27383+# set therein.
27384+#
27385+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
27386+# variable will take. If 'yes', then the emitted script
27387+# will assume that the directory in which it is stored is
27388+# the $objdir directory. This is a cygwin/mingw-specific
27389+# behavior.
27390+func_emit_wrapper ()
27391+{
27392+ func_emit_wrapper_arg1=${1-no}
27393+
27394+ $ECHO "\
27395+#! $SHELL
27396+
27397+# $output - temporary wrapper script for $objdir/$outputname
27398+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
27399+#
27400+# The $output program cannot be directly executed until all the libtool
27401+# libraries that it depends on are installed.
27402+#
27403+# This wrapper script should never be moved out of the build directory.
27404+# If it is, it will not operate correctly.
27405+
27406+# Sed substitution that helps us do robust quoting. It backslashifies
27407+# metacharacters that are still active within double-quoted strings.
27408+sed_quote_subst='$sed_quote_subst'
27409+
27410+# Be Bourne compatible
27411+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
27412+ emulate sh
27413+ NULLCMD=:
27414+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
27415+ # is contrary to our usage. Disable this feature.
27416+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
27417+ setopt NO_GLOB_SUBST
27418+else
27419+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
27420+fi
27421+BIN_SH=xpg4; export BIN_SH # for Tru64
27422+DUALCASE=1; export DUALCASE # for MKS sh
27423+
27424+# The HP-UX ksh and POSIX shell print the target directory to stdout
27425+# if CDPATH is set.
27426+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
27427+
27428+relink_command=\"$relink_command\"
27429+
27430+# This environment variable determines our operation mode.
27431+if test \"\$libtool_install_magic\" = \"$magic\"; then
27432+ # install mode needs the following variables:
27433+ generated_by_libtool_version='$macro_version'
27434+ notinst_deplibs='$notinst_deplibs'
27435+else
27436+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
27437+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
27438+ file=\"\$0\""
27439+
27440+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
27441+ $ECHO "\
27442+
27443+# A function that is used when there is no print builtin or printf.
27444+func_fallback_echo ()
27445+{
27446+ eval 'cat <<_LTECHO_EOF
27447+\$1
27448+_LTECHO_EOF'
27449+}
27450+ ECHO=\"$qECHO\"
27451+ fi
27452+
27453+# Very basic option parsing. These options are (a) specific to
27454+# the libtool wrapper, (b) are identical between the wrapper
27455+# /script/ and the wrapper /executable/ which is used only on
27456+# windows platforms, and (c) all begin with the string "--lt-"
27457+# (application programs are unlikely to have options which match
27458+# this pattern).
27459+#
27460+# There are only two supported options: --lt-debug and
27461+# --lt-dump-script. There is, deliberately, no --lt-help.
27462+#
27463+# The first argument to this parsing function should be the
27464+# script's $0 value, followed by "$@".
27465+lt_option_debug=
27466+func_parse_lt_options ()
27467+{
27468+ lt_script_arg0=\$0
27469+ shift
27470+ for lt_opt
27471+ do
27472+ case \"\$lt_opt\" in
27473+ --lt-debug) lt_option_debug=1 ;;
27474+ --lt-dump-script)
27475+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
27476+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
27477+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
27478+ cat \"\$lt_dump_D/\$lt_dump_F\"
27479+ exit 0
27480+ ;;
27481+ --lt-*)
27482+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
27483+ exit 1
27484+ ;;
27485+ esac
27486+ done
27487+
27488+ # Print the debug banner immediately:
27489+ if test -n \"\$lt_option_debug\"; then
27490+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
27491+ fi
27492+}
27493+
27494+# Used when --lt-debug. Prints its arguments to stdout
27495+# (redirection is the responsibility of the caller)
27496+func_lt_dump_args ()
27497+{
27498+ lt_dump_args_N=1;
27499+ for lt_arg
27500+ do
27501+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
27502+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
27503+ done
27504+}
27505+
27506+# Core function for launching the target application
27507+func_exec_program_core ()
27508+{
27509+"
27510+ case $host in
27511+ # Backslashes separate directories on plain windows
27512+ *-*-mingw | *-*-os2* | *-cegcc*)
27513+ $ECHO "\
27514+ if test -n \"\$lt_option_debug\"; then
27515+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
27516+ func_lt_dump_args \${1+\"\$@\"} 1>&2
27517+ fi
27518+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
27519+"
27520+ ;;
27521+
27522+ *)
27523+ $ECHO "\
27524+ if test -n \"\$lt_option_debug\"; then
27525+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
27526+ func_lt_dump_args \${1+\"\$@\"} 1>&2
27527+ fi
27528+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
27529+"
27530+ ;;
27531+ esac
27532+ $ECHO "\
27533+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
27534+ exit 1
27535+}
27536+
27537+# A function to encapsulate launching the target application
27538+# Strips options in the --lt-* namespace from \$@ and
27539+# launches target application with the remaining arguments.
27540+func_exec_program ()
27541+{
27542+ case \" \$* \" in
27543+ *\\ --lt-*)
27544+ for lt_wr_arg
27545+ do
27546+ case \$lt_wr_arg in
27547+ --lt-*) ;;
27548+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
27549+ esac
27550+ shift
27551+ done ;;
27552+ esac
27553+ func_exec_program_core \${1+\"\$@\"}
27554+}
27555+
27556+ # Parse options
27557+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
27558+
27559+ # Find the directory that this script lives in.
27560+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
27561+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
27562+
27563+ # Follow symbolic links until we get to the real thisdir.
27564+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
27565+ while test -n \"\$file\"; do
27566+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
27567+
27568+ # If there was a directory component, then change thisdir.
27569+ if test \"x\$destdir\" != \"x\$file\"; then
27570+ case \"\$destdir\" in
27571+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
27572+ *) thisdir=\"\$thisdir/\$destdir\" ;;
27573+ esac
27574+ fi
27575+
27576+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
27577+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
27578+ done
27579+
27580+ # Usually 'no', except on cygwin/mingw when embedded into
27581+ # the cwrapper.
27582+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
27583+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
27584+ # special case for '.'
27585+ if test \"\$thisdir\" = \".\"; then
27586+ thisdir=\`pwd\`
27587+ fi
27588+ # remove .libs from thisdir
27589+ case \"\$thisdir\" in
27590+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
27591+ $objdir ) thisdir=. ;;
27592+ esac
27593+ fi
27594+
27595+ # Try to get the absolute directory name.
27596+ absdir=\`cd \"\$thisdir\" && pwd\`
27597+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
27598+"
27599+
27600+ if test "$fast_install" = yes; then
27601+ $ECHO "\
27602+ program=lt-'$outputname'$exeext
27603+ progdir=\"\$thisdir/$objdir\"
27604+
27605+ if test ! -f \"\$progdir/\$program\" ||
27606+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
27607+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
27608+
27609+ file=\"\$\$-\$program\"
27610+
27611+ if test ! -d \"\$progdir\"; then
27612+ $MKDIR \"\$progdir\"
27613+ else
27614+ $RM \"\$progdir/\$file\"
27615+ fi"
27616+
27617+ $ECHO "\
27618+
27619+ # relink executable if necessary
27620+ if test -n \"\$relink_command\"; then
27621+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
27622+ else
27623+ $ECHO \"\$relink_command_output\" >&2
27624+ $RM \"\$progdir/\$file\"
27625+ exit 1
27626+ fi
27627+ fi
27628+
27629+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
27630+ { $RM \"\$progdir/\$program\";
27631+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
27632+ $RM \"\$progdir/\$file\"
27633+ fi"
27634+ else
27635+ $ECHO "\
27636+ program='$outputname'
27637+ progdir=\"\$thisdir/$objdir\"
27638+"
27639+ fi
27640+
27641+ $ECHO "\
27642+
27643+ if test -f \"\$progdir/\$program\"; then"
27644+
27645+ # fixup the dll searchpath if we need to.
27646+ #
27647+ # Fix the DLL searchpath if we need to. Do this before prepending
27648+ # to shlibpath, because on Windows, both are PATH and uninstalled
27649+ # libraries must come first.
27650+ if test -n "$dllsearchpath"; then
27651+ $ECHO "\
27652+ # Add the dll search path components to the executable PATH
27653+ PATH=$dllsearchpath:\$PATH
27654+"
27655+ fi
27656+
27657+ # Export our shlibpath_var if we have one.
27658+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
27659+ $ECHO "\
27660+ # Add our own library path to $shlibpath_var
27661+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
27662+
27663+ # Some systems cannot cope with colon-terminated $shlibpath_var
27664+ # The second colon is a workaround for a bug in BeOS R4 sed
27665+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
27666+
27667+ export $shlibpath_var
27668+"
27669+ fi
27670+
27671+ $ECHO "\
27672+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
27673+ # Run the actual program with our arguments.
27674+ func_exec_program \${1+\"\$@\"}
27675+ fi
27676+ else
27677+ # The program doesn't exist.
27678+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
27679+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
27680+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
27681+ exit 1
27682+ fi
27683+fi\
27684+"
27685+}
27686+
27687+
27688+# func_emit_cwrapperexe_src
27689+# emit the source code for a wrapper executable on stdout
27690+# Must ONLY be called from within func_mode_link because
27691+# it depends on a number of variable set therein.
27692+func_emit_cwrapperexe_src ()
27693+{
27694+ cat <<EOF
27695+
27696+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
27697+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
27698+
27699+ The $output program cannot be directly executed until all the libtool
27700+ libraries that it depends on are installed.
27701+
27702+ This wrapper executable should never be moved out of the build directory.
27703+ If it is, it will not operate correctly.
27704+*/
27705+EOF
27706+ cat <<"EOF"
27707+#ifdef _MSC_VER
27708+# define _CRT_SECURE_NO_DEPRECATE 1
27709+#endif
27710+#include <stdio.h>
27711+#include <stdlib.h>
27712+#ifdef _MSC_VER
27713+# include <direct.h>
27714+# include <process.h>
27715+# include <io.h>
27716+#else
27717+# include <unistd.h>
27718+# include <stdint.h>
27719+# ifdef __CYGWIN__
27720+# include <io.h>
27721+# endif
27722+#endif
27723+#include <malloc.h>
27724+#include <stdarg.h>
27725+#include <assert.h>
27726+#include <string.h>
27727+#include <ctype.h>
27728+#include <errno.h>
27729+#include <fcntl.h>
27730+#include <sys/stat.h>
27731+
27732+/* declarations of non-ANSI functions */
27733+#if defined(__MINGW32__)
27734+# ifdef __STRICT_ANSI__
27735+int _putenv (const char *);
27736+# endif
27737+#elif defined(__CYGWIN__)
27738+# ifdef __STRICT_ANSI__
27739+char *realpath (const char *, char *);
27740+int putenv (char *);
27741+int setenv (const char *, const char *, int);
27742+# endif
27743+/* #elif defined (other platforms) ... */
27744+#endif
27745+
27746+/* portability defines, excluding path handling macros */
27747+#if defined(_MSC_VER)
27748+# define setmode _setmode
27749+# define stat _stat
27750+# define chmod _chmod
27751+# define getcwd _getcwd
27752+# define putenv _putenv
27753+# define S_IXUSR _S_IEXEC
27754+# ifndef _INTPTR_T_DEFINED
27755+# define _INTPTR_T_DEFINED
27756+# define intptr_t int
27757+# endif
27758+#elif defined(__MINGW32__)
27759+# define setmode _setmode
27760+# define stat _stat
27761+# define chmod _chmod
27762+# define getcwd _getcwd
27763+# define putenv _putenv
27764+#elif defined(__CYGWIN__)
27765+# define HAVE_SETENV
27766+# define FOPEN_WB "wb"
27767+/* #elif defined (other platforms) ... */
27768+#endif
27769+
27770+#if defined(PATH_MAX)
27771+# define LT_PATHMAX PATH_MAX
27772+#elif defined(MAXPATHLEN)
27773+# define LT_PATHMAX MAXPATHLEN
27774+#else
27775+# define LT_PATHMAX 1024
27776+#endif
27777+
27778+#ifndef S_IXOTH
27779+# define S_IXOTH 0
27780+#endif
27781+#ifndef S_IXGRP
27782+# define S_IXGRP 0
27783+#endif
27784+
27785+/* path handling portability macros */
27786+#ifndef DIR_SEPARATOR
27787+# define DIR_SEPARATOR '/'
27788+# define PATH_SEPARATOR ':'
27789+#endif
27790+
27791+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
27792+ defined (__OS2__)
27793+# define HAVE_DOS_BASED_FILE_SYSTEM
27794+# define FOPEN_WB "wb"
27795+# ifndef DIR_SEPARATOR_2
27796+# define DIR_SEPARATOR_2 '\\'
27797+# endif
27798+# ifndef PATH_SEPARATOR_2
27799+# define PATH_SEPARATOR_2 ';'
27800+# endif
27801+#endif
27802+
27803+#ifndef DIR_SEPARATOR_2
27804+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
27805+#else /* DIR_SEPARATOR_2 */
27806+# define IS_DIR_SEPARATOR(ch) \
27807+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
27808+#endif /* DIR_SEPARATOR_2 */
27809+
27810+#ifndef PATH_SEPARATOR_2
27811+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
27812+#else /* PATH_SEPARATOR_2 */
27813+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
27814+#endif /* PATH_SEPARATOR_2 */
27815+
27816+#ifndef FOPEN_WB
27817+# define FOPEN_WB "w"
27818+#endif
27819+#ifndef _O_BINARY
27820+# define _O_BINARY 0
27821+#endif
27822+
27823+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
27824+#define XFREE(stale) do { \
27825+ if (stale) { free ((void *) stale); stale = 0; } \
27826+} while (0)
27827+
27828+#if defined(LT_DEBUGWRAPPER)
27829+static int lt_debug = 1;
27830+#else
27831+static int lt_debug = 0;
27832+#endif
27833+
27834+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
27835+
27836+void *xmalloc (size_t num);
27837+char *xstrdup (const char *string);
27838+const char *base_name (const char *name);
27839+char *find_executable (const char *wrapper);
27840+char *chase_symlinks (const char *pathspec);
27841+int make_executable (const char *path);
27842+int check_executable (const char *path);
27843+char *strendzap (char *str, const char *pat);
27844+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
27845+void lt_fatal (const char *file, int line, const char *message, ...);
27846+static const char *nonnull (const char *s);
27847+static const char *nonempty (const char *s);
27848+void lt_setenv (const char *name, const char *value);
27849+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
27850+void lt_update_exe_path (const char *name, const char *value);
27851+void lt_update_lib_path (const char *name, const char *value);
27852+char **prepare_spawn (char **argv);
27853+void lt_dump_script (FILE *f);
27854+EOF
27855+
27856+ cat <<EOF
27857+volatile const char * MAGIC_EXE = "$magic_exe";
27858+const char * LIB_PATH_VARNAME = "$shlibpath_var";
27859+EOF
27860+
27861+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
27862+ func_to_host_path "$temp_rpath"
27863+ cat <<EOF
27864+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
27865+EOF
27866+ else
27867+ cat <<"EOF"
27868+const char * LIB_PATH_VALUE = "";
27869+EOF
27870+ fi
27871+
27872+ if test -n "$dllsearchpath"; then
27873+ func_to_host_path "$dllsearchpath:"
27874+ cat <<EOF
27875+const char * EXE_PATH_VARNAME = "PATH";
27876+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
27877+EOF
27878+ else
27879+ cat <<"EOF"
27880+const char * EXE_PATH_VARNAME = "";
27881+const char * EXE_PATH_VALUE = "";
27882+EOF
27883+ fi
27884+
27885+ if test "$fast_install" = yes; then
27886+ cat <<EOF
27887+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
27888+EOF
27889+ else
27890+ cat <<EOF
27891+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
27892+EOF
27893+ fi
27894+
27895+
27896+ cat <<"EOF"
27897+
27898+#define LTWRAPPER_OPTION_PREFIX "--lt-"
27899+
27900+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
27901+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
27902+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
27903+
27904+int
27905+main (int argc, char *argv[])
27906+{
27907+ char **newargz;
27908+ int newargc;
27909+ char *tmp_pathspec;
27910+ char *actual_cwrapper_path;
27911+ char *actual_cwrapper_name;
27912+ char *target_name;
27913+ char *lt_argv_zero;
27914+ intptr_t rval = 127;
27915+
27916+ int i;
27917+
27918+ program_name = (char *) xstrdup (base_name (argv[0]));
27919+ newargz = XMALLOC (char *, argc + 1);
27920+
27921+ /* very simple arg parsing; don't want to rely on getopt
27922+ * also, copy all non cwrapper options to newargz, except
27923+ * argz[0], which is handled differently
27924+ */
27925+ newargc=0;
27926+ for (i = 1; i < argc; i++)
27927+ {
27928+ if (strcmp (argv[i], dumpscript_opt) == 0)
27929+ {
27930+EOF
27931+ case "$host" in
27932+ *mingw* | *cygwin* )
27933+ # make stdout use "unix" line endings
27934+ echo " setmode(1,_O_BINARY);"
27935+ ;;
27936+ esac
27937+
27938+ cat <<"EOF"
27939+ lt_dump_script (stdout);
27940+ return 0;
27941+ }
27942+ if (strcmp (argv[i], debug_opt) == 0)
27943+ {
27944+ lt_debug = 1;
27945+ continue;
27946+ }
27947+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
27948+ {
27949+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
27950+ namespace, but it is not one of the ones we know about and
27951+ have already dealt with, above (inluding dump-script), then
27952+ report an error. Otherwise, targets might begin to believe
27953+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
27954+ namespace. The first time any user complains about this, we'll
27955+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
27956+ or a configure.ac-settable value.
27957+ */
27958+ lt_fatal (__FILE__, __LINE__,
27959+ "unrecognized %s option: '%s'",
27960+ ltwrapper_option_prefix, argv[i]);
27961+ }
27962+ /* otherwise ... */
27963+ newargz[++newargc] = xstrdup (argv[i]);
27964+ }
27965+ newargz[++newargc] = NULL;
27966+
27967+EOF
27968+ cat <<EOF
27969+ /* The GNU banner must be the first non-error debug message */
27970+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
27971+EOF
27972+ cat <<"EOF"
27973+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
27974+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
27975+
27976+ tmp_pathspec = find_executable (argv[0]);
27977+ if (tmp_pathspec == NULL)
27978+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
27979+ lt_debugprintf (__FILE__, __LINE__,
27980+ "(main) found exe (before symlink chase) at: %s\n",
27981+ tmp_pathspec);
27982+
27983+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
27984+ lt_debugprintf (__FILE__, __LINE__,
27985+ "(main) found exe (after symlink chase) at: %s\n",
27986+ actual_cwrapper_path);
27987+ XFREE (tmp_pathspec);
27988+
27989+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
27990+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
27991+
27992+ /* wrapper name transforms */
27993+ strendzap (actual_cwrapper_name, ".exe");
27994+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
27995+ XFREE (actual_cwrapper_name);
27996+ actual_cwrapper_name = tmp_pathspec;
27997+ tmp_pathspec = 0;
27998+
27999+ /* target_name transforms -- use actual target program name; might have lt- prefix */
28000+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
28001+ strendzap (target_name, ".exe");
28002+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
28003+ XFREE (target_name);
28004+ target_name = tmp_pathspec;
28005+ tmp_pathspec = 0;
28006+
28007+ lt_debugprintf (__FILE__, __LINE__,
28008+ "(main) libtool target name: %s\n",
28009+ target_name);
28010+EOF
28011+
28012+ cat <<EOF
28013+ newargz[0] =
28014+ XMALLOC (char, (strlen (actual_cwrapper_path) +
28015+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
28016+ strcpy (newargz[0], actual_cwrapper_path);
28017+ strcat (newargz[0], "$objdir");
28018+ strcat (newargz[0], "/");
28019+EOF
28020+
28021+ cat <<"EOF"
28022+ /* stop here, and copy so we don't have to do this twice */
28023+ tmp_pathspec = xstrdup (newargz[0]);
28024+
28025+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
28026+ strcat (newargz[0], actual_cwrapper_name);
28027+
28028+ /* DO want the lt- prefix here if it exists, so use target_name */
28029+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
28030+ XFREE (tmp_pathspec);
28031+ tmp_pathspec = NULL;
28032+EOF
28033+
28034+ case $host_os in
28035+ mingw*)
28036+ cat <<"EOF"
28037+ {
28038+ char* p;
28039+ while ((p = strchr (newargz[0], '\\')) != NULL)
28040+ {
28041+ *p = '/';
28042+ }
28043+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
28044+ {
28045+ *p = '/';
28046+ }
28047+ }
28048+EOF
28049+ ;;
28050+ esac
28051+
28052+ cat <<"EOF"
28053+ XFREE (target_name);
28054+ XFREE (actual_cwrapper_path);
28055+ XFREE (actual_cwrapper_name);
28056+
28057+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
28058+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
28059+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
28060+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
28061+ because on Windows, both *_VARNAMEs are PATH but uninstalled
28062+ libraries must come first. */
28063+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
28064+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
28065+
28066+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
28067+ nonnull (lt_argv_zero));
28068+ for (i = 0; i < newargc; i++)
28069+ {
28070+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
28071+ i, nonnull (newargz[i]));
28072+ }
28073+
28074+EOF
28075+
28076+ case $host_os in
28077+ mingw*)
28078+ cat <<"EOF"
28079+ /* execv doesn't actually work on mingw as expected on unix */
28080+ newargz = prepare_spawn (newargz);
28081+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
28082+ if (rval == -1)
28083+ {
28084+ /* failed to start process */
28085+ lt_debugprintf (__FILE__, __LINE__,
28086+ "(main) failed to launch target \"%s\": %s\n",
28087+ lt_argv_zero, nonnull (strerror (errno)));
28088+ return 127;
28089+ }
28090+ return rval;
28091+EOF
28092+ ;;
28093+ *)
28094+ cat <<"EOF"
28095+ execv (lt_argv_zero, newargz);
28096+ return rval; /* =127, but avoids unused variable warning */
28097+EOF
28098+ ;;
28099+ esac
28100+
28101+ cat <<"EOF"
28102+}
28103+
28104+void *
28105+xmalloc (size_t num)
28106+{
28107+ void *p = (void *) malloc (num);
28108+ if (!p)
28109+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
28110+
28111+ return p;
28112+}
28113+
28114+char *
28115+xstrdup (const char *string)
28116+{
28117+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
28118+ string) : NULL;
28119+}
28120+
28121+const char *
28122+base_name (const char *name)
28123+{
28124+ const char *base;
28125+
28126+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
28127+ /* Skip over the disk name in MSDOS pathnames. */
28128+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
28129+ name += 2;
28130+#endif
28131+
28132+ for (base = name; *name; name++)
28133+ if (IS_DIR_SEPARATOR (*name))
28134+ base = name + 1;
28135+ return base;
28136+}
28137+
28138+int
28139+check_executable (const char *path)
28140+{
28141+ struct stat st;
28142+
28143+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
28144+ nonempty (path));
28145+ if ((!path) || (!*path))
28146+ return 0;
28147+
28148+ if ((stat (path, &st) >= 0)
28149+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
28150+ return 1;
28151+ else
28152+ return 0;
28153+}
28154+
28155+int
28156+make_executable (const char *path)
28157+{
28158+ int rval = 0;
28159+ struct stat st;
28160+
28161+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
28162+ nonempty (path));
28163+ if ((!path) || (!*path))
28164+ return 0;
28165+
28166+ if (stat (path, &st) >= 0)
28167+ {
28168+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
28169+ }
28170+ return rval;
28171+}
28172+
28173+/* Searches for the full path of the wrapper. Returns
28174+ newly allocated full path name if found, NULL otherwise
28175+ Does not chase symlinks, even on platforms that support them.
28176+*/
28177+char *
28178+find_executable (const char *wrapper)
28179+{
28180+ int has_slash = 0;
28181+ const char *p;
28182+ const char *p_next;
28183+ /* static buffer for getcwd */
28184+ char tmp[LT_PATHMAX + 1];
28185+ int tmp_len;
28186+ char *concat_name;
28187+
28188+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
28189+ nonempty (wrapper));
28190+
28191+ if ((wrapper == NULL) || (*wrapper == '\0'))
28192+ return NULL;
28193+
28194+ /* Absolute path? */
28195+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
28196+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
28197+ {
28198+ concat_name = xstrdup (wrapper);
28199+ if (check_executable (concat_name))
28200+ return concat_name;
28201+ XFREE (concat_name);
28202+ }
28203+ else
28204+ {
28205+#endif
28206+ if (IS_DIR_SEPARATOR (wrapper[0]))
28207+ {
28208+ concat_name = xstrdup (wrapper);
28209+ if (check_executable (concat_name))
28210+ return concat_name;
28211+ XFREE (concat_name);
28212+ }
28213+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
28214+ }
28215+#endif
28216+
28217+ for (p = wrapper; *p; p++)
28218+ if (*p == '/')
28219+ {
28220+ has_slash = 1;
28221+ break;
28222+ }
28223+ if (!has_slash)
28224+ {
28225+ /* no slashes; search PATH */
28226+ const char *path = getenv ("PATH");
28227+ if (path != NULL)
28228+ {
28229+ for (p = path; *p; p = p_next)
28230+ {
28231+ const char *q;
28232+ size_t p_len;
28233+ for (q = p; *q; q++)
28234+ if (IS_PATH_SEPARATOR (*q))
28235+ break;
28236+ p_len = q - p;
28237+ p_next = (*q == '\0' ? q : q + 1);
28238+ if (p_len == 0)
28239+ {
28240+ /* empty path: current directory */
28241+ if (getcwd (tmp, LT_PATHMAX) == NULL)
28242+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
28243+ nonnull (strerror (errno)));
28244+ tmp_len = strlen (tmp);
28245+ concat_name =
28246+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
28247+ memcpy (concat_name, tmp, tmp_len);
28248+ concat_name[tmp_len] = '/';
28249+ strcpy (concat_name + tmp_len + 1, wrapper);
28250+ }
28251+ else
28252+ {
28253+ concat_name =
28254+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
28255+ memcpy (concat_name, p, p_len);
28256+ concat_name[p_len] = '/';
28257+ strcpy (concat_name + p_len + 1, wrapper);
28258+ }
28259+ if (check_executable (concat_name))
28260+ return concat_name;
28261+ XFREE (concat_name);
28262+ }
28263+ }
28264+ /* not found in PATH; assume curdir */
28265+ }
28266+ /* Relative path | not found in path: prepend cwd */
28267+ if (getcwd (tmp, LT_PATHMAX) == NULL)
28268+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
28269+ nonnull (strerror (errno)));
28270+ tmp_len = strlen (tmp);
28271+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
28272+ memcpy (concat_name, tmp, tmp_len);
28273+ concat_name[tmp_len] = '/';
28274+ strcpy (concat_name + tmp_len + 1, wrapper);
28275+
28276+ if (check_executable (concat_name))
28277+ return concat_name;
28278+ XFREE (concat_name);
28279+ return NULL;
28280+}
28281+
28282+char *
28283+chase_symlinks (const char *pathspec)
28284+{
28285+#ifndef S_ISLNK
28286+ return xstrdup (pathspec);
28287+#else
28288+ char buf[LT_PATHMAX];
28289+ struct stat s;
28290+ char *tmp_pathspec = xstrdup (pathspec);
28291+ char *p;
28292+ int has_symlinks = 0;
28293+ while (strlen (tmp_pathspec) && !has_symlinks)
28294+ {
28295+ lt_debugprintf (__FILE__, __LINE__,
28296+ "checking path component for symlinks: %s\n",
28297+ tmp_pathspec);
28298+ if (lstat (tmp_pathspec, &s) == 0)
28299+ {
28300+ if (S_ISLNK (s.st_mode) != 0)
28301+ {
28302+ has_symlinks = 1;
28303+ break;
28304+ }
28305+
28306+ /* search backwards for last DIR_SEPARATOR */
28307+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
28308+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
28309+ p--;
28310+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
28311+ {
28312+ /* no more DIR_SEPARATORS left */
28313+ break;
28314+ }
28315+ *p = '\0';
28316+ }
28317+ else
28318+ {
28319+ lt_fatal (__FILE__, __LINE__,
28320+ "error accessing file \"%s\": %s",
28321+ tmp_pathspec, nonnull (strerror (errno)));
28322+ }
28323+ }
28324+ XFREE (tmp_pathspec);
28325+
28326+ if (!has_symlinks)
28327+ {
28328+ return xstrdup (pathspec);
28329+ }
28330+
28331+ tmp_pathspec = realpath (pathspec, buf);
28332+ if (tmp_pathspec == 0)
28333+ {
28334+ lt_fatal (__FILE__, __LINE__,
28335+ "could not follow symlinks for %s", pathspec);
28336+ }
28337+ return xstrdup (tmp_pathspec);
28338+#endif
28339+}
28340+
28341+char *
28342+strendzap (char *str, const char *pat)
28343+{
28344+ size_t len, patlen;
28345+
28346+ assert (str != NULL);
28347+ assert (pat != NULL);
28348+
28349+ len = strlen (str);
28350+ patlen = strlen (pat);
28351+
28352+ if (patlen <= len)
28353+ {
28354+ str += len - patlen;
28355+ if (strcmp (str, pat) == 0)
28356+ *str = '\0';
28357+ }
28358+ return str;
28359+}
28360+
28361+void
28362+lt_debugprintf (const char *file, int line, const char *fmt, ...)
28363+{
28364+ va_list args;
28365+ if (lt_debug)
28366+ {
28367+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
28368+ va_start (args, fmt);
28369+ (void) vfprintf (stderr, fmt, args);
28370+ va_end (args);
28371+ }
28372+}
28373+
28374+static void
28375+lt_error_core (int exit_status, const char *file,
28376+ int line, const char *mode,
28377+ const char *message, va_list ap)
28378+{
28379+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
28380+ vfprintf (stderr, message, ap);
28381+ fprintf (stderr, ".\n");
28382+
28383+ if (exit_status >= 0)
28384+ exit (exit_status);
28385+}
28386+
28387+void
28388+lt_fatal (const char *file, int line, const char *message, ...)
28389+{
28390+ va_list ap;
28391+ va_start (ap, message);
28392+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
28393+ va_end (ap);
28394+}
28395+
28396+static const char *
28397+nonnull (const char *s)
28398+{
28399+ return s ? s : "(null)";
28400+}
28401+
28402+static const char *
28403+nonempty (const char *s)
28404+{
28405+ return (s && !*s) ? "(empty)" : nonnull (s);
28406+}
28407+
28408+void
28409+lt_setenv (const char *name, const char *value)
28410+{
28411+ lt_debugprintf (__FILE__, __LINE__,
28412+ "(lt_setenv) setting '%s' to '%s'\n",
28413+ nonnull (name), nonnull (value));
28414+ {
28415+#ifdef HAVE_SETENV
28416+ /* always make a copy, for consistency with !HAVE_SETENV */
28417+ char *str = xstrdup (value);
28418+ setenv (name, str, 1);
28419+#else
28420+ int len = strlen (name) + 1 + strlen (value) + 1;
28421+ char *str = XMALLOC (char, len);
28422+ sprintf (str, "%s=%s", name, value);
28423+ if (putenv (str) != EXIT_SUCCESS)
28424+ {
28425+ XFREE (str);
28426+ }
28427+#endif
28428+ }
28429+}
28430+
28431+char *
28432+lt_extend_str (const char *orig_value, const char *add, int to_end)
28433+{
28434+ char *new_value;
28435+ if (orig_value && *orig_value)
28436+ {
28437+ int orig_value_len = strlen (orig_value);
28438+ int add_len = strlen (add);
28439+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
28440+ if (to_end)
28441+ {
28442+ strcpy (new_value, orig_value);
28443+ strcpy (new_value + orig_value_len, add);
28444+ }
28445+ else
28446+ {
28447+ strcpy (new_value, add);
28448+ strcpy (new_value + add_len, orig_value);
28449+ }
28450+ }
28451+ else
28452+ {
28453+ new_value = xstrdup (add);
28454+ }
28455+ return new_value;
28456+}
28457+
28458+void
28459+lt_update_exe_path (const char *name, const char *value)
28460+{
28461+ lt_debugprintf (__FILE__, __LINE__,
28462+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
28463+ nonnull (name), nonnull (value));
28464+
28465+ if (name && *name && value && *value)
28466+ {
28467+ char *new_value = lt_extend_str (getenv (name), value, 0);
28468+ /* some systems can't cope with a ':'-terminated path #' */
28469+ int len = strlen (new_value);
28470+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
28471+ {
28472+ new_value[len-1] = '\0';
28473+ }
28474+ lt_setenv (name, new_value);
28475+ XFREE (new_value);
28476+ }
28477+}
28478+
28479+void
28480+lt_update_lib_path (const char *name, const char *value)
28481+{
28482+ lt_debugprintf (__FILE__, __LINE__,
28483+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
28484+ nonnull (name), nonnull (value));
28485+
28486+ if (name && *name && value && *value)
28487+ {
28488+ char *new_value = lt_extend_str (getenv (name), value, 0);
28489+ lt_setenv (name, new_value);
28490+ XFREE (new_value);
28491+ }
28492+}
28493+
28494+EOF
28495+ case $host_os in
28496+ mingw*)
28497+ cat <<"EOF"
28498+
28499+/* Prepares an argument vector before calling spawn().
28500+ Note that spawn() does not by itself call the command interpreter
28501+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
28502+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
28503+ GetVersionEx(&v);
28504+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
28505+ }) ? "cmd.exe" : "command.com").
28506+ Instead it simply concatenates the arguments, separated by ' ', and calls
28507+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
28508+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
28509+ special way:
28510+ - Space and tab are interpreted as delimiters. They are not treated as
28511+ delimiters if they are surrounded by double quotes: "...".
28512+ - Unescaped double quotes are removed from the input. Their only effect is
28513+ that within double quotes, space and tab are treated like normal
28514+ characters.
28515+ - Backslashes not followed by double quotes are not special.
28516+ - But 2*n+1 backslashes followed by a double quote become
28517+ n backslashes followed by a double quote (n >= 0):
28518+ \" -> "
28519+ \\\" -> \"
28520+ \\\\\" -> \\"
28521+ */
28522+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
28523+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
28524+char **
28525+prepare_spawn (char **argv)
28526+{
28527+ size_t argc;
28528+ char **new_argv;
28529+ size_t i;
28530+
28531+ /* Count number of arguments. */
28532+ for (argc = 0; argv[argc] != NULL; argc++)
28533+ ;
28534+
28535+ /* Allocate new argument vector. */
28536+ new_argv = XMALLOC (char *, argc + 1);
28537+
28538+ /* Put quoted arguments into the new argument vector. */
28539+ for (i = 0; i < argc; i++)
28540+ {
28541+ const char *string = argv[i];
28542+
28543+ if (string[0] == '\0')
28544+ new_argv[i] = xstrdup ("\"\"");
28545+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
28546+ {
28547+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
28548+ size_t length;
28549+ unsigned int backslashes;
28550+ const char *s;
28551+ char *quoted_string;
28552+ char *p;
28553+
28554+ length = 0;
28555+ backslashes = 0;
28556+ if (quote_around)
28557+ length++;
28558+ for (s = string; *s != '\0'; s++)
28559+ {
28560+ char c = *s;
28561+ if (c == '"')
28562+ length += backslashes + 1;
28563+ length++;
28564+ if (c == '\\')
28565+ backslashes++;
28566+ else
28567+ backslashes = 0;
28568+ }
28569+ if (quote_around)
28570+ length += backslashes + 1;
28571+
28572+ quoted_string = XMALLOC (char, length + 1);
28573+
28574+ p = quoted_string;
28575+ backslashes = 0;
28576+ if (quote_around)
28577+ *p++ = '"';
28578+ for (s = string; *s != '\0'; s++)
28579+ {
28580+ char c = *s;
28581+ if (c == '"')
28582+ {
28583+ unsigned int j;
28584+ for (j = backslashes + 1; j > 0; j--)
28585+ *p++ = '\\';
28586+ }
28587+ *p++ = c;
28588+ if (c == '\\')
28589+ backslashes++;
28590+ else
28591+ backslashes = 0;
28592+ }
28593+ if (quote_around)
28594+ {
28595+ unsigned int j;
28596+ for (j = backslashes; j > 0; j--)
28597+ *p++ = '\\';
28598+ *p++ = '"';
28599+ }
28600+ *p = '\0';
28601+
28602+ new_argv[i] = quoted_string;
28603+ }
28604+ else
28605+ new_argv[i] = (char *) string;
28606+ }
28607+ new_argv[argc] = NULL;
28608+
28609+ return new_argv;
28610+}
28611+EOF
28612+ ;;
28613+ esac
28614+
28615+ cat <<"EOF"
28616+void lt_dump_script (FILE* f)
28617+{
28618+EOF
28619+ func_emit_wrapper yes |
28620+ $SED -n -e '
28621+s/^\(.\{79\}\)\(..*\)/\1\
28622+\2/
28623+h
28624+s/\([\\"]\)/\\\1/g
28625+s/$/\\n/
28626+s/\([^\n]*\).*/ fputs ("\1", f);/p
28627+g
28628+D'
28629+ cat <<"EOF"
28630+}
28631+EOF
28632+}
28633+# end: func_emit_cwrapperexe_src
28634+
28635+# func_win32_import_lib_p ARG
28636+# True if ARG is an import lib, as indicated by $file_magic_cmd
28637+func_win32_import_lib_p ()
28638+{
28639+ $opt_debug
28640+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
28641+ *import*) : ;;
28642+ *) false ;;
28643+ esac
28644+}
28645+
28646+# func_mode_link arg...
28647+func_mode_link ()
28648+{
28649+ $opt_debug
28650+ case $host in
28651+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
28652+ # It is impossible to link a dll without this setting, and
28653+ # we shouldn't force the makefile maintainer to figure out
28654+ # which system we are compiling for in order to pass an extra
28655+ # flag for every libtool invocation.
28656+ # allow_undefined=no
28657+
28658+ # FIXME: Unfortunately, there are problems with the above when trying
28659+ # to make a dll which has undefined symbols, in which case not
28660+ # even a static library is built. For now, we need to specify
28661+ # -no-undefined on the libtool link line when we can be certain
28662+ # that all symbols are satisfied, otherwise we get a static library.
28663+ allow_undefined=yes
28664+ ;;
28665+ *)
28666+ allow_undefined=yes
28667+ ;;
28668+ esac
28669+ libtool_args=$nonopt
28670+ base_compile="$nonopt $@"
28671+ compile_command=$nonopt
28672+ finalize_command=$nonopt
28673+
28674+ compile_rpath=
28675+ finalize_rpath=
28676+ compile_shlibpath=
28677+ finalize_shlibpath=
28678+ convenience=
28679+ old_convenience=
28680+ deplibs=
28681+ old_deplibs=
28682+ compiler_flags=
28683+ linker_flags=
28684+ dllsearchpath=
28685+ lib_search_path=`pwd`
28686+ inst_prefix_dir=
28687+ new_inherited_linker_flags=
28688+
28689+ avoid_version=no
28690+ bindir=
28691+ dlfiles=
28692+ dlprefiles=
28693+ dlself=no
28694+ export_dynamic=no
28695+ export_symbols=
28696+ export_symbols_regex=
28697+ generated=
28698+ libobjs=
28699+ ltlibs=
28700+ module=no
28701+ no_install=no
28702+ objs=
28703+ non_pic_objects=
28704+ precious_files_regex=
28705+ prefer_static_libs=no
28706+ preload=no
28707+ prev=
28708+ prevarg=
28709+ release=
28710+ rpath=
28711+ xrpath=
28712+ perm_rpath=
28713+ temp_rpath=
28714+ thread_safe=no
28715+ vinfo=
28716+ vinfo_number=no
28717+ weak_libs=
28718+ single_module="${wl}-single_module"
28719+ func_infer_tag $base_compile
28720+
28721+ # We need to know -static, to get the right output filenames.
28722+ for arg
28723+ do
28724+ case $arg in
28725+ -shared)
28726+ test "$build_libtool_libs" != yes && \
28727+ func_fatal_configuration "can not build a shared library"
28728+ build_old_libs=no
28729+ break
28730+ ;;
28731+ -all-static | -static | -static-libtool-libs)
28732+ case $arg in
28733+ -all-static)
28734+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
28735+ func_warning "complete static linking is impossible in this configuration"
28736+ fi
28737+ if test -n "$link_static_flag"; then
28738+ dlopen_self=$dlopen_self_static
28739+ fi
28740+ prefer_static_libs=yes
28741+ ;;
28742+ -static)
28743+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
28744+ dlopen_self=$dlopen_self_static
28745+ fi
28746+ prefer_static_libs=built
28747+ ;;
28748+ -static-libtool-libs)
28749+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
28750+ dlopen_self=$dlopen_self_static
28751+ fi
28752+ prefer_static_libs=yes
28753+ ;;
28754+ esac
28755+ build_libtool_libs=no
28756+ build_old_libs=yes
28757+ break
28758+ ;;
28759+ esac
28760+ done
28761+
28762+ # See if our shared archives depend on static archives.
28763+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
28764+
28765+ # Go through the arguments, transforming them on the way.
28766+ while test "$#" -gt 0; do
28767+ arg="$1"
28768+ shift
28769+ func_quote_for_eval "$arg"
28770+ qarg=$func_quote_for_eval_unquoted_result
28771+ func_append libtool_args " $func_quote_for_eval_result"
28772+
28773+ # If the previous option needs an argument, assign it.
28774+ if test -n "$prev"; then
28775+ case $prev in
28776+ output)
28777+ func_append compile_command " @OUTPUT@"
28778+ func_append finalize_command " @OUTPUT@"
28779+ ;;
28780+ esac
28781+
28782+ case $prev in
28783+ bindir)
28784+ bindir="$arg"
28785+ prev=
28786+ continue
28787+ ;;
28788+ dlfiles|dlprefiles)
28789+ if test "$preload" = no; then
28790+ # Add the symbol object into the linking commands.
28791+ func_append compile_command " @SYMFILE@"
28792+ func_append finalize_command " @SYMFILE@"
28793+ preload=yes
28794+ fi
28795+ case $arg in
28796+ *.la | *.lo) ;; # We handle these cases below.
28797+ force)
28798+ if test "$dlself" = no; then
28799+ dlself=needless
28800+ export_dynamic=yes
28801+ fi
28802+ prev=
28803+ continue
28804+ ;;
28805+ self)
28806+ if test "$prev" = dlprefiles; then
28807+ dlself=yes
28808+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
28809+ dlself=yes
28810+ else
28811+ dlself=needless
28812+ export_dynamic=yes
28813+ fi
28814+ prev=
28815+ continue
28816+ ;;
28817+ *)
28818+ if test "$prev" = dlfiles; then
28819+ func_append dlfiles " $arg"
28820+ else
28821+ func_append dlprefiles " $arg"
28822+ fi
28823+ prev=
28824+ continue
28825+ ;;
28826+ esac
28827+ ;;
28828+ expsyms)
28829+ export_symbols="$arg"
28830+ test -f "$arg" \
28831+ || func_fatal_error "symbol file \`$arg' does not exist"
28832+ prev=
28833+ continue
28834+ ;;
28835+ expsyms_regex)
28836+ export_symbols_regex="$arg"
28837+ prev=
28838+ continue
28839+ ;;
28840+ framework)
28841+ case $host in
28842+ *-*-darwin*)
28843+ case "$deplibs " in
28844+ *" $qarg.ltframework "*) ;;
28845+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
28846+ ;;
28847+ esac
28848+ ;;
28849+ esac
28850+ prev=
28851+ continue
28852+ ;;
28853+ inst_prefix)
28854+ inst_prefix_dir="$arg"
28855+ prev=
28856+ continue
28857+ ;;
28858+ objectlist)
28859+ if test -f "$arg"; then
28860+ save_arg=$arg
28861+ moreargs=
28862+ for fil in `cat "$save_arg"`
28863+ do
28864+# func_append moreargs " $fil"
28865+ arg=$fil
28866+ # A libtool-controlled object.
28867+
28868+ # Check to see that this really is a libtool object.
28869+ if func_lalib_unsafe_p "$arg"; then
28870+ pic_object=
28871+ non_pic_object=
28872+
28873+ # Read the .lo file
28874+ func_source "$arg"
28875+
28876+ if test -z "$pic_object" ||
28877+ test -z "$non_pic_object" ||
28878+ test "$pic_object" = none &&
28879+ test "$non_pic_object" = none; then
28880+ func_fatal_error "cannot find name of object for \`$arg'"
28881+ fi
28882+
28883+ # Extract subdirectory from the argument.
28884+ func_dirname "$arg" "/" ""
28885+ xdir="$func_dirname_result"
28886+
28887+ if test "$pic_object" != none; then
28888+ # Prepend the subdirectory the object is found in.
28889+ pic_object="$xdir$pic_object"
28890+
28891+ if test "$prev" = dlfiles; then
28892+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
28893+ func_append dlfiles " $pic_object"
28894+ prev=
28895+ continue
28896+ else
28897+ # If libtool objects are unsupported, then we need to preload.
28898+ prev=dlprefiles
28899+ fi
28900+ fi
28901+
28902+ # CHECK ME: I think I busted this. -Ossama
28903+ if test "$prev" = dlprefiles; then
28904+ # Preload the old-style object.
28905+ func_append dlprefiles " $pic_object"
28906+ prev=
28907+ fi
28908+
28909+ # A PIC object.
28910+ func_append libobjs " $pic_object"
28911+ arg="$pic_object"
28912+ fi
28913+
28914+ # Non-PIC object.
28915+ if test "$non_pic_object" != none; then
28916+ # Prepend the subdirectory the object is found in.
28917+ non_pic_object="$xdir$non_pic_object"
28918+
28919+ # A standard non-PIC object
28920+ func_append non_pic_objects " $non_pic_object"
28921+ if test -z "$pic_object" || test "$pic_object" = none ; then
28922+ arg="$non_pic_object"
28923+ fi
28924+ else
28925+ # If the PIC object exists, use it instead.
28926+ # $xdir was prepended to $pic_object above.
28927+ non_pic_object="$pic_object"
28928+ func_append non_pic_objects " $non_pic_object"
28929+ fi
28930+ else
28931+ # Only an error if not doing a dry-run.
28932+ if $opt_dry_run; then
28933+ # Extract subdirectory from the argument.
28934+ func_dirname "$arg" "/" ""
28935+ xdir="$func_dirname_result"
28936+
28937+ func_lo2o "$arg"
28938+ pic_object=$xdir$objdir/$func_lo2o_result
28939+ non_pic_object=$xdir$func_lo2o_result
28940+ func_append libobjs " $pic_object"
28941+ func_append non_pic_objects " $non_pic_object"
28942+ else
28943+ func_fatal_error "\`$arg' is not a valid libtool object"
28944+ fi
28945+ fi
28946+ done
28947+ else
28948+ func_fatal_error "link input file \`$arg' does not exist"
28949+ fi
28950+ arg=$save_arg
28951+ prev=
28952+ continue
28953+ ;;
28954+ precious_regex)
28955+ precious_files_regex="$arg"
28956+ prev=
28957+ continue
28958+ ;;
28959+ release)
28960+ release="-$arg"
28961+ prev=
28962+ continue
28963+ ;;
28964+ rpath | xrpath)
28965+ # We need an absolute path.
28966+ case $arg in
28967+ [\\/]* | [A-Za-z]:[\\/]*) ;;
28968+ *)
28969+ func_fatal_error "only absolute run-paths are allowed"
28970+ ;;
28971+ esac
28972+ if test "$prev" = rpath; then
28973+ case "$rpath " in
28974+ *" $arg "*) ;;
28975+ *) func_append rpath " $arg" ;;
28976+ esac
28977+ else
28978+ case "$xrpath " in
28979+ *" $arg "*) ;;
28980+ *) func_append xrpath " $arg" ;;
28981+ esac
28982+ fi
28983+ prev=
28984+ continue
28985+ ;;
28986+ shrext)
28987+ shrext_cmds="$arg"
28988+ prev=
28989+ continue
28990+ ;;
28991+ weak)
28992+ func_append weak_libs " $arg"
28993+ prev=
28994+ continue
28995+ ;;
28996+ xcclinker)
28997+ func_append linker_flags " $qarg"
28998+ func_append compiler_flags " $qarg"
28999+ prev=
29000+ func_append compile_command " $qarg"
29001+ func_append finalize_command " $qarg"
29002+ continue
29003+ ;;
29004+ xcompiler)
29005+ func_append compiler_flags " $qarg"
29006+ prev=
29007+ func_append compile_command " $qarg"
29008+ func_append finalize_command " $qarg"
29009+ continue
29010+ ;;
29011+ xlinker)
29012+ func_append linker_flags " $qarg"
29013+ func_append compiler_flags " $wl$qarg"
29014+ prev=
29015+ func_append compile_command " $wl$qarg"
29016+ func_append finalize_command " $wl$qarg"
29017+ continue
29018+ ;;
29019+ *)
29020+ eval "$prev=\"\$arg\""
29021+ prev=
29022+ continue
29023+ ;;
29024+ esac
29025+ fi # test -n "$prev"
29026+
29027+ prevarg="$arg"
29028+
29029+ case $arg in
29030+ -all-static)
29031+ if test -n "$link_static_flag"; then
29032+ # See comment for -static flag below, for more details.
29033+ func_append compile_command " $link_static_flag"
29034+ func_append finalize_command " $link_static_flag"
29035+ fi
29036+ continue
29037+ ;;
29038+
29039+ -allow-undefined)
29040+ # FIXME: remove this flag sometime in the future.
29041+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
29042+ ;;
29043+
29044+ -avoid-version)
29045+ avoid_version=yes
29046+ continue
29047+ ;;
29048+
29049+ -bindir)
29050+ prev=bindir
29051+ continue
29052+ ;;
29053+
29054+ -dlopen)
29055+ prev=dlfiles
29056+ continue
29057+ ;;
29058+
29059+ -dlpreopen)
29060+ prev=dlprefiles
29061+ continue
29062+ ;;
29063+
29064+ -export-dynamic)
29065+ export_dynamic=yes
29066+ continue
29067+ ;;
29068+
29069+ -export-symbols | -export-symbols-regex)
29070+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
29071+ func_fatal_error "more than one -exported-symbols argument is not allowed"
29072+ fi
29073+ if test "X$arg" = "X-export-symbols"; then
29074+ prev=expsyms
29075+ else
29076+ prev=expsyms_regex
29077+ fi
29078+ continue
29079+ ;;
29080+
29081+ -framework)
29082+ prev=framework
29083+ continue
29084+ ;;
29085+
29086+ -inst-prefix-dir)
29087+ prev=inst_prefix
29088+ continue
29089+ ;;
29090+
29091+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
29092+ # so, if we see these flags be careful not to treat them like -L
29093+ -L[A-Z][A-Z]*:*)
29094+ case $with_gcc/$host in
29095+ no/*-*-irix* | /*-*-irix*)
29096+ func_append compile_command " $arg"
29097+ func_append finalize_command " $arg"
29098+ ;;
29099+ esac
29100+ continue
29101+ ;;
29102+
29103+ -L*)
29104+ func_stripname "-L" '' "$arg"
29105+ if test -z "$func_stripname_result"; then
29106+ if test "$#" -gt 0; then
29107+ func_fatal_error "require no space between \`-L' and \`$1'"
29108+ else
29109+ func_fatal_error "need path for \`-L' option"
29110+ fi
29111+ fi
29112+ func_resolve_sysroot "$func_stripname_result"
29113+ dir=$func_resolve_sysroot_result
29114+ # We need an absolute path.
29115+ case $dir in
29116+ [\\/]* | [A-Za-z]:[\\/]*) ;;
29117+ *)
29118+ absdir=`cd "$dir" && pwd`
29119+ test -z "$absdir" && \
29120+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
29121+ dir="$absdir"
29122+ ;;
29123+ esac
29124+ case "$deplibs " in
29125+ *" -L$dir "* | *" $arg "*)
29126+ # Will only happen for absolute or sysroot arguments
29127+ ;;
29128+ *)
29129+ # Preserve sysroot, but never include relative directories
29130+ case $dir in
29131+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
29132+ *) func_append deplibs " -L$dir" ;;
29133+ esac
29134+ func_append lib_search_path " $dir"
29135+ ;;
29136+ esac
29137+ case $host in
29138+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
29139+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
29140+ case :$dllsearchpath: in
29141+ *":$dir:"*) ;;
29142+ ::) dllsearchpath=$dir;;
29143+ *) func_append dllsearchpath ":$dir";;
29144+ esac
29145+ case :$dllsearchpath: in
29146+ *":$testbindir:"*) ;;
29147+ ::) dllsearchpath=$testbindir;;
29148+ *) func_append dllsearchpath ":$testbindir";;
29149+ esac
29150+ ;;
29151+ esac
29152+ continue
29153+ ;;
29154+
29155+ -l*)
29156+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
29157+ case $host in
29158+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
29159+ # These systems don't actually have a C or math library (as such)
29160+ continue
29161+ ;;
29162+ *-*-os2*)
29163+ # These systems don't actually have a C library (as such)
29164+ test "X$arg" = "X-lc" && continue
29165+ ;;
29166+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
29167+ # Do not include libc due to us having libc/libc_r.
29168+ test "X$arg" = "X-lc" && continue
29169+ ;;
29170+ *-*-rhapsody* | *-*-darwin1.[012])
29171+ # Rhapsody C and math libraries are in the System framework
29172+ func_append deplibs " System.ltframework"
29173+ continue
29174+ ;;
29175+ *-*-sco3.2v5* | *-*-sco5v6*)
29176+ # Causes problems with __ctype
29177+ test "X$arg" = "X-lc" && continue
29178+ ;;
29179+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
29180+ # Compiler inserts libc in the correct place for threads to work
29181+ test "X$arg" = "X-lc" && continue
29182+ ;;
29183+ esac
29184+ elif test "X$arg" = "X-lc_r"; then
29185+ case $host in
29186+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
29187+ # Do not include libc_r directly, use -pthread flag.
29188+ continue
29189+ ;;
29190+ esac
29191+ fi
29192+ func_append deplibs " $arg"
29193+ continue
29194+ ;;
29195+
29196+ -module)
29197+ module=yes
29198+ continue
29199+ ;;
29200+
29201+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
29202+ # classes, name mangling, and exception handling.
29203+ # Darwin uses the -arch flag to determine output architecture.
29204+ -model|-arch|-isysroot|--sysroot)
29205+ func_append compiler_flags " $arg"
29206+ func_append compile_command " $arg"
29207+ func_append finalize_command " $arg"
29208+ prev=xcompiler
29209+ continue
29210+ ;;
29211+
29212+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
29213+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
29214+ func_append compiler_flags " $arg"
29215+ func_append compile_command " $arg"
29216+ func_append finalize_command " $arg"
29217+ case "$new_inherited_linker_flags " in
29218+ *" $arg "*) ;;
29219+ * ) func_append new_inherited_linker_flags " $arg" ;;
29220+ esac
29221+ continue
29222+ ;;
29223+
29224+ -multi_module)
29225+ single_module="${wl}-multi_module"
29226+ continue
29227+ ;;
29228+
29229+ -no-fast-install)
29230+ fast_install=no
29231+ continue
29232+ ;;
29233+
29234+ -no-install)
29235+ case $host in
29236+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
29237+ # The PATH hackery in wrapper scripts is required on Windows
29238+ # and Darwin in order for the loader to find any dlls it needs.
29239+ func_warning "\`-no-install' is ignored for $host"
29240+ func_warning "assuming \`-no-fast-install' instead"
29241+ fast_install=no
29242+ ;;
29243+ *) no_install=yes ;;
29244+ esac
29245+ continue
29246+ ;;
29247+
29248+ -no-undefined)
29249+ allow_undefined=no
29250+ continue
29251+ ;;
29252+
29253+ -objectlist)
29254+ prev=objectlist
29255+ continue
29256+ ;;
29257+
29258+ -o) prev=output ;;
29259+
29260+ -precious-files-regex)
29261+ prev=precious_regex
29262+ continue
29263+ ;;
29264+
29265+ -release)
29266+ prev=release
29267+ continue
29268+ ;;
29269+
29270+ -rpath)
29271+ prev=rpath
29272+ continue
29273+ ;;
29274+
29275+ -R)
29276+ prev=xrpath
29277+ continue
29278+ ;;
29279+
29280+ -R*)
29281+ func_stripname '-R' '' "$arg"
29282+ dir=$func_stripname_result
29283+ # We need an absolute path.
29284+ case $dir in
29285+ [\\/]* | [A-Za-z]:[\\/]*) ;;
29286+ =*)
29287+ func_stripname '=' '' "$dir"
29288+ dir=$lt_sysroot$func_stripname_result
29289+ ;;
29290+ *)
29291+ func_fatal_error "only absolute run-paths are allowed"
29292+ ;;
29293+ esac
29294+ case "$xrpath " in
29295+ *" $dir "*) ;;
29296+ *) func_append xrpath " $dir" ;;
29297+ esac
29298+ continue
29299+ ;;
29300+
29301+ -shared)
29302+ # The effects of -shared are defined in a previous loop.
29303+ continue
29304+ ;;
29305+
29306+ -shrext)
29307+ prev=shrext
29308+ continue
29309+ ;;
29310+
29311+ -static | -static-libtool-libs)
29312+ # The effects of -static are defined in a previous loop.
29313+ # We used to do the same as -all-static on platforms that
29314+ # didn't have a PIC flag, but the assumption that the effects
29315+ # would be equivalent was wrong. It would break on at least
29316+ # Digital Unix and AIX.
29317+ continue
29318+ ;;
29319+
29320+ -thread-safe)
29321+ thread_safe=yes
29322+ continue
29323+ ;;
29324+
29325+ -version-info)
29326+ prev=vinfo
29327+ continue
29328+ ;;
29329+
29330+ -version-number)
29331+ prev=vinfo
29332+ vinfo_number=yes
29333+ continue
29334+ ;;
29335+
29336+ -weak)
29337+ prev=weak
29338+ continue
29339+ ;;
29340+
29341+ -Wc,*)
29342+ func_stripname '-Wc,' '' "$arg"
29343+ args=$func_stripname_result
29344+ arg=
29345+ save_ifs="$IFS"; IFS=','
29346+ for flag in $args; do
29347+ IFS="$save_ifs"
29348+ func_quote_for_eval "$flag"
29349+ func_append arg " $func_quote_for_eval_result"
29350+ func_append compiler_flags " $func_quote_for_eval_result"
29351+ done
29352+ IFS="$save_ifs"
29353+ func_stripname ' ' '' "$arg"
29354+ arg=$func_stripname_result
29355+ ;;
29356+
29357+ -Wl,*)
29358+ func_stripname '-Wl,' '' "$arg"
29359+ args=$func_stripname_result
29360+ arg=
29361+ save_ifs="$IFS"; IFS=','
29362+ for flag in $args; do
29363+ IFS="$save_ifs"
29364+ func_quote_for_eval "$flag"
29365+ func_append arg " $wl$func_quote_for_eval_result"
29366+ func_append compiler_flags " $wl$func_quote_for_eval_result"
29367+ func_append linker_flags " $func_quote_for_eval_result"
29368+ done
29369+ IFS="$save_ifs"
29370+ func_stripname ' ' '' "$arg"
29371+ arg=$func_stripname_result
29372+ ;;
29373+
29374+ -Xcompiler)
29375+ prev=xcompiler
29376+ continue
29377+ ;;
29378+
29379+ -Xlinker)
29380+ prev=xlinker
29381+ continue
29382+ ;;
29383+
29384+ -XCClinker)
29385+ prev=xcclinker
29386+ continue
29387+ ;;
29388+
29389+ # -msg_* for osf cc
29390+ -msg_*)
29391+ func_quote_for_eval "$arg"
29392+ arg="$func_quote_for_eval_result"
29393+ ;;
29394+
29395+ # Flags to be passed through unchanged, with rationale:
29396+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
29397+ # -r[0-9][0-9]* specify processor for the SGI compiler
29398+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
29399+ # +DA*, +DD* enable 64-bit mode for the HP compiler
29400+ # -q* compiler args for the IBM compiler
29401+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
29402+ # -F/path path to uninstalled frameworks, gcc on darwin
29403+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
29404+ # @file GCC response files
29405+ # -tp=* Portland pgcc target processor selection
29406+ # --sysroot=* for sysroot support
29407+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
29408+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
29409+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
29410+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
29411+ func_quote_for_eval "$arg"
29412+ arg="$func_quote_for_eval_result"
29413+ func_append compile_command " $arg"
29414+ func_append finalize_command " $arg"
29415+ func_append compiler_flags " $arg"
29416+ continue
29417+ ;;
29418+
29419+ # Some other compiler flag.
29420+ -* | +*)
29421+ func_quote_for_eval "$arg"
29422+ arg="$func_quote_for_eval_result"
29423+ ;;
29424+
29425+ *.$objext)
29426+ # A standard object.
29427+ func_append objs " $arg"
29428+ ;;
29429+
29430+ *.lo)
29431+ # A libtool-controlled object.
29432+
29433+ # Check to see that this really is a libtool object.
29434+ if func_lalib_unsafe_p "$arg"; then
29435+ pic_object=
29436+ non_pic_object=
29437+
29438+ # Read the .lo file
29439+ func_source "$arg"
29440+
29441+ if test -z "$pic_object" ||
29442+ test -z "$non_pic_object" ||
29443+ test "$pic_object" = none &&
29444+ test "$non_pic_object" = none; then
29445+ func_fatal_error "cannot find name of object for \`$arg'"
29446+ fi
29447+
29448+ # Extract subdirectory from the argument.
29449+ func_dirname "$arg" "/" ""
29450+ xdir="$func_dirname_result"
29451+
29452+ if test "$pic_object" != none; then
29453+ # Prepend the subdirectory the object is found in.
29454+ pic_object="$xdir$pic_object"
29455+
29456+ if test "$prev" = dlfiles; then
29457+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
29458+ func_append dlfiles " $pic_object"
29459+ prev=
29460+ continue
29461+ else
29462+ # If libtool objects are unsupported, then we need to preload.
29463+ prev=dlprefiles
29464+ fi
29465+ fi
29466+
29467+ # CHECK ME: I think I busted this. -Ossama
29468+ if test "$prev" = dlprefiles; then
29469+ # Preload the old-style object.
29470+ func_append dlprefiles " $pic_object"
29471+ prev=
29472+ fi
29473+
29474+ # A PIC object.
29475+ func_append libobjs " $pic_object"
29476+ arg="$pic_object"
29477+ fi
29478+
29479+ # Non-PIC object.
29480+ if test "$non_pic_object" != none; then
29481+ # Prepend the subdirectory the object is found in.
29482+ non_pic_object="$xdir$non_pic_object"
29483+
29484+ # A standard non-PIC object
29485+ func_append non_pic_objects " $non_pic_object"
29486+ if test -z "$pic_object" || test "$pic_object" = none ; then
29487+ arg="$non_pic_object"
29488+ fi
29489+ else
29490+ # If the PIC object exists, use it instead.
29491+ # $xdir was prepended to $pic_object above.
29492+ non_pic_object="$pic_object"
29493+ func_append non_pic_objects " $non_pic_object"
29494+ fi
29495+ else
29496+ # Only an error if not doing a dry-run.
29497+ if $opt_dry_run; then
29498+ # Extract subdirectory from the argument.
29499+ func_dirname "$arg" "/" ""
29500+ xdir="$func_dirname_result"
29501+
29502+ func_lo2o "$arg"
29503+ pic_object=$xdir$objdir/$func_lo2o_result
29504+ non_pic_object=$xdir$func_lo2o_result
29505+ func_append libobjs " $pic_object"
29506+ func_append non_pic_objects " $non_pic_object"
29507+ else
29508+ func_fatal_error "\`$arg' is not a valid libtool object"
29509+ fi
29510+ fi
29511+ ;;
29512+
29513+ *.$libext)
29514+ # An archive.
29515+ func_append deplibs " $arg"
29516+ func_append old_deplibs " $arg"
29517+ continue
29518+ ;;
29519+
29520+ *.la)
29521+ # A libtool-controlled library.
29522+
29523+ func_resolve_sysroot "$arg"
29524+ if test "$prev" = dlfiles; then
29525+ # This library was specified with -dlopen.
29526+ func_append dlfiles " $func_resolve_sysroot_result"
29527+ prev=
29528+ elif test "$prev" = dlprefiles; then
29529+ # The library was specified with -dlpreopen.
29530+ func_append dlprefiles " $func_resolve_sysroot_result"
29531+ prev=
29532+ else
29533+ func_append deplibs " $func_resolve_sysroot_result"
29534+ fi
29535+ continue
29536+ ;;
29537+
29538+ # Some other compiler argument.
29539+ *)
29540+ # Unknown arguments in both finalize_command and compile_command need
29541+ # to be aesthetically quoted because they are evaled later.
29542+ func_quote_for_eval "$arg"
29543+ arg="$func_quote_for_eval_result"
29544+ ;;
29545+ esac # arg
29546+
29547+ # Now actually substitute the argument into the commands.
29548+ if test -n "$arg"; then
29549+ func_append compile_command " $arg"
29550+ func_append finalize_command " $arg"
29551+ fi
29552+ done # argument parsing loop
29553+
29554+ test -n "$prev" && \
29555+ func_fatal_help "the \`$prevarg' option requires an argument"
29556+
29557+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
29558+ eval arg=\"$export_dynamic_flag_spec\"
29559+ func_append compile_command " $arg"
29560+ func_append finalize_command " $arg"
29561+ fi
29562+
29563+ oldlibs=
29564+ # calculate the name of the file, without its directory
29565+ func_basename "$output"
29566+ outputname="$func_basename_result"
29567+ libobjs_save="$libobjs"
29568+
29569+ if test -n "$shlibpath_var"; then
29570+ # get the directories listed in $shlibpath_var
29571+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
29572+ else
29573+ shlib_search_path=
29574+ fi
29575+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
29576+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
29577+
29578+ func_dirname "$output" "/" ""
29579+ output_objdir="$func_dirname_result$objdir"
29580+ func_to_tool_file "$output_objdir/"
29581+ tool_output_objdir=$func_to_tool_file_result
29582+ # Create the object directory.
29583+ func_mkdir_p "$output_objdir"
29584+
29585+ # Determine the type of output
29586+ case $output in
29587+ "")
29588+ func_fatal_help "you must specify an output file"
29589+ ;;
29590+ *.$libext) linkmode=oldlib ;;
29591+ *.lo | *.$objext) linkmode=obj ;;
29592+ *.la) linkmode=lib ;;
29593+ *) linkmode=prog ;; # Anything else should be a program.
29594+ esac
29595+
29596+ specialdeplibs=
29597+
29598+ libs=
29599+ # Find all interdependent deplibs by searching for libraries
29600+ # that are linked more than once (e.g. -la -lb -la)
29601+ for deplib in $deplibs; do
29602+ if $opt_preserve_dup_deps ; then
29603+ case "$libs " in
29604+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
29605+ esac
29606+ fi
29607+ func_append libs " $deplib"
29608+ done
29609+
29610+ if test "$linkmode" = lib; then
29611+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
29612+
29613+ # Compute libraries that are listed more than once in $predeps
29614+ # $postdeps and mark them as special (i.e., whose duplicates are
29615+ # not to be eliminated).
29616+ pre_post_deps=
29617+ if $opt_duplicate_compiler_generated_deps; then
29618+ for pre_post_dep in $predeps $postdeps; do
29619+ case "$pre_post_deps " in
29620+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
29621+ esac
29622+ func_append pre_post_deps " $pre_post_dep"
29623+ done
29624+ fi
29625+ pre_post_deps=
29626+ fi
29627+
29628+ deplibs=
29629+ newdependency_libs=
29630+ newlib_search_path=
29631+ need_relink=no # whether we're linking any uninstalled libtool libraries
29632+ notinst_deplibs= # not-installed libtool libraries
29633+ notinst_path= # paths that contain not-installed libtool libraries
29634+
29635+ case $linkmode in
29636+ lib)
29637+ passes="conv dlpreopen link"
29638+ for file in $dlfiles $dlprefiles; do
29639+ case $file in
29640+ *.la) ;;
29641+ *)
29642+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
29643+ ;;
29644+ esac
29645+ done
29646+ ;;
29647+ prog)
29648+ compile_deplibs=
29649+ finalize_deplibs=
29650+ alldeplibs=no
29651+ newdlfiles=
29652+ newdlprefiles=
29653+ passes="conv scan dlopen dlpreopen link"
29654+ ;;
29655+ *) passes="conv"
29656+ ;;
29657+ esac
29658+
29659+ for pass in $passes; do
29660+ # The preopen pass in lib mode reverses $deplibs; put it back here
29661+ # so that -L comes before libs that need it for instance...
29662+ if test "$linkmode,$pass" = "lib,link"; then
29663+ ## FIXME: Find the place where the list is rebuilt in the wrong
29664+ ## order, and fix it there properly
29665+ tmp_deplibs=
29666+ for deplib in $deplibs; do
29667+ tmp_deplibs="$deplib $tmp_deplibs"
29668+ done
29669+ deplibs="$tmp_deplibs"
29670+ fi
29671+
29672+ if test "$linkmode,$pass" = "lib,link" ||
29673+ test "$linkmode,$pass" = "prog,scan"; then
29674+ libs="$deplibs"
29675+ deplibs=
29676+ fi
29677+ if test "$linkmode" = prog; then
29678+ case $pass in
29679+ dlopen) libs="$dlfiles" ;;
29680+ dlpreopen) libs="$dlprefiles" ;;
29681+ link)
29682+ libs="$deplibs %DEPLIBS%"
29683+ test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
29684+ ;;
29685+ esac
29686+ fi
29687+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
29688+ # Collect and forward deplibs of preopened libtool libs
29689+ for lib in $dlprefiles; do
29690+ # Ignore non-libtool-libs
29691+ dependency_libs=
29692+ func_resolve_sysroot "$lib"
29693+ case $lib in
29694+ *.la) func_source "$func_resolve_sysroot_result" ;;
29695+ esac
29696+
29697+ # Collect preopened libtool deplibs, except any this library
29698+ # has declared as weak libs
29699+ for deplib in $dependency_libs; do
29700+ func_basename "$deplib"
29701+ deplib_base=$func_basename_result
29702+ case " $weak_libs " in
29703+ *" $deplib_base "*) ;;
29704+ *) func_append deplibs " $deplib" ;;
29705+ esac
29706+ done
29707+ done
29708+ libs="$dlprefiles"
29709+ fi
29710+ if test "$pass" = dlopen; then
29711+ # Collect dlpreopened libraries
29712+ save_deplibs="$deplibs"
29713+ deplibs=
29714+ fi
29715+
29716+ for deplib in $libs; do
29717+ lib=
29718+ found=no
29719+ case $deplib in
29720+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
29721+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
29722+ if test "$linkmode,$pass" = "prog,link"; then
29723+ compile_deplibs="$deplib $compile_deplibs"
29724+ finalize_deplibs="$deplib $finalize_deplibs"
29725+ else
29726+ func_append compiler_flags " $deplib"
29727+ if test "$linkmode" = lib ; then
29728+ case "$new_inherited_linker_flags " in
29729+ *" $deplib "*) ;;
29730+ * ) func_append new_inherited_linker_flags " $deplib" ;;
29731+ esac
29732+ fi
29733+ fi
29734+ continue
29735+ ;;
29736+ -l*)
29737+ if test "$linkmode" != lib && test "$linkmode" != prog; then
29738+ func_warning "\`-l' is ignored for archives/objects"
29739+ continue
29740+ fi
29741+ func_stripname '-l' '' "$deplib"
29742+ name=$func_stripname_result
29743+ if test "$linkmode" = lib; then
29744+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
29745+ else
29746+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
29747+ fi
29748+ for searchdir in $searchdirs; do
29749+ for search_ext in .la $std_shrext .so .a; do
29750+ # Search the libtool library
29751+ lib="$searchdir/lib${name}${search_ext}"
29752+ if test -f "$lib"; then
29753+ if test "$search_ext" = ".la"; then
29754+ found=yes
29755+ else
29756+ found=no
29757+ fi
29758+ break 2
29759+ fi
29760+ done
29761+ done
29762+ if test "$found" != yes; then
29763+ # deplib doesn't seem to be a libtool library
29764+ if test "$linkmode,$pass" = "prog,link"; then
29765+ compile_deplibs="$deplib $compile_deplibs"
29766+ finalize_deplibs="$deplib $finalize_deplibs"
29767+ else
29768+ deplibs="$deplib $deplibs"
29769+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
29770+ fi
29771+ continue
29772+ else # deplib is a libtool library
29773+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
29774+ # We need to do some special things here, and not later.
29775+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
29776+ case " $predeps $postdeps " in
29777+ *" $deplib "*)
29778+ if func_lalib_p "$lib"; then
29779+ library_names=
29780+ old_library=
29781+ func_source "$lib"
29782+ for l in $old_library $library_names; do
29783+ ll="$l"
29784+ done
29785+ if test "X$ll" = "X$old_library" ; then # only static version available
29786+ found=no
29787+ func_dirname "$lib" "" "."
29788+ ladir="$func_dirname_result"
29789+ lib=$ladir/$old_library
29790+ if test "$linkmode,$pass" = "prog,link"; then
29791+ compile_deplibs="$deplib $compile_deplibs"
29792+ finalize_deplibs="$deplib $finalize_deplibs"
29793+ else
29794+ deplibs="$deplib $deplibs"
29795+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
29796+ fi
29797+ continue
29798+ fi
29799+ fi
29800+ ;;
29801+ *) ;;
29802+ esac
29803+ fi
29804+ fi
29805+ ;; # -l
29806+ *.ltframework)
29807+ if test "$linkmode,$pass" = "prog,link"; then
29808+ compile_deplibs="$deplib $compile_deplibs"
29809+ finalize_deplibs="$deplib $finalize_deplibs"
29810+ else
29811+ deplibs="$deplib $deplibs"
29812+ if test "$linkmode" = lib ; then
29813+ case "$new_inherited_linker_flags " in
29814+ *" $deplib "*) ;;
29815+ * ) func_append new_inherited_linker_flags " $deplib" ;;
29816+ esac
29817+ fi
29818+ fi
29819+ continue
29820+ ;;
29821+ -L*)
29822+ case $linkmode in
29823+ lib)
29824+ deplibs="$deplib $deplibs"
29825+ test "$pass" = conv && continue
29826+ newdependency_libs="$deplib $newdependency_libs"
29827+ func_stripname '-L' '' "$deplib"
29828+ func_resolve_sysroot "$func_stripname_result"
29829+ func_append newlib_search_path " $func_resolve_sysroot_result"
29830+ ;;
29831+ prog)
29832+ if test "$pass" = conv; then
29833+ deplibs="$deplib $deplibs"
29834+ continue
29835+ fi
29836+ if test "$pass" = scan; then
29837+ deplibs="$deplib $deplibs"
29838+ else
29839+ compile_deplibs="$deplib $compile_deplibs"
29840+ finalize_deplibs="$deplib $finalize_deplibs"
29841+ fi
29842+ func_stripname '-L' '' "$deplib"
29843+ func_resolve_sysroot "$func_stripname_result"
29844+ func_append newlib_search_path " $func_resolve_sysroot_result"
29845+ ;;
29846+ *)
29847+ func_warning "\`-L' is ignored for archives/objects"
29848+ ;;
29849+ esac # linkmode
29850+ continue
29851+ ;; # -L
29852+ -R*)
29853+ if test "$pass" = link; then
29854+ func_stripname '-R' '' "$deplib"
29855+ func_resolve_sysroot "$func_stripname_result"
29856+ dir=$func_resolve_sysroot_result
29857+ # Make sure the xrpath contains only unique directories.
29858+ case "$xrpath " in
29859+ *" $dir "*) ;;
29860+ *) func_append xrpath " $dir" ;;
29861+ esac
29862+ fi
29863+ deplibs="$deplib $deplibs"
29864+ continue
29865+ ;;
29866+ *.la)
29867+ func_resolve_sysroot "$deplib"
29868+ lib=$func_resolve_sysroot_result
29869+ ;;
29870+ *.$libext)
29871+ if test "$pass" = conv; then
29872+ deplibs="$deplib $deplibs"
29873+ continue
29874+ fi
29875+ case $linkmode in
29876+ lib)
29877+ # Linking convenience modules into shared libraries is allowed,
29878+ # but linking other static libraries is non-portable.
29879+ case " $dlpreconveniencelibs " in
29880+ *" $deplib "*) ;;
29881+ *)
29882+ valid_a_lib=no
29883+ case $deplibs_check_method in
29884+ match_pattern*)
29885+ set dummy $deplibs_check_method; shift
29886+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
29887+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
29888+ | $EGREP "$match_pattern_regex" > /dev/null; then
29889+ valid_a_lib=yes
29890+ fi
29891+ ;;
29892+ pass_all)
29893+ valid_a_lib=yes
29894+ ;;
29895+ esac
29896+ if test "$valid_a_lib" != yes; then
29897+ echo
29898+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
29899+ echo "*** I have the capability to make that library automatically link in when"
29900+ echo "*** you link to this library. But I can only do this if you have a"
29901+ echo "*** shared version of the library, which you do not appear to have"
29902+ echo "*** because the file extensions .$libext of this argument makes me believe"
29903+ echo "*** that it is just a static archive that I should not use here."
29904+ else
29905+ echo
29906+ $ECHO "*** Warning: Linking the shared library $output against the"
29907+ $ECHO "*** static library $deplib is not portable!"
29908+ deplibs="$deplib $deplibs"
29909+ fi
29910+ ;;
29911+ esac
29912+ continue
29913+ ;;
29914+ prog)
29915+ if test "$pass" != link; then
29916+ deplibs="$deplib $deplibs"
29917+ else
29918+ compile_deplibs="$deplib $compile_deplibs"
29919+ finalize_deplibs="$deplib $finalize_deplibs"
29920+ fi
29921+ continue
29922+ ;;
29923+ esac # linkmode
29924+ ;; # *.$libext
29925+ *.lo | *.$objext)
29926+ if test "$pass" = conv; then
29927+ deplibs="$deplib $deplibs"
29928+ elif test "$linkmode" = prog; then
29929+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
29930+ # If there is no dlopen support or we're linking statically,
29931+ # we need to preload.
29932+ func_append newdlprefiles " $deplib"
29933+ compile_deplibs="$deplib $compile_deplibs"
29934+ finalize_deplibs="$deplib $finalize_deplibs"
29935+ else
29936+ func_append newdlfiles " $deplib"
29937+ fi
29938+ fi
29939+ continue
29940+ ;;
29941+ %DEPLIBS%)
29942+ alldeplibs=yes
29943+ continue
29944+ ;;
29945+ esac # case $deplib
29946+
29947+ if test "$found" = yes || test -f "$lib"; then :
29948+ else
29949+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
29950+ fi
29951+
29952+ # Check to see that this really is a libtool archive.
29953+ func_lalib_unsafe_p "$lib" \
29954+ || func_fatal_error "\`$lib' is not a valid libtool archive"
29955+
29956+ func_dirname "$lib" "" "."
29957+ ladir="$func_dirname_result"
29958+
29959+ dlname=
29960+ dlopen=
29961+ dlpreopen=
29962+ libdir=
29963+ library_names=
29964+ old_library=
29965+ inherited_linker_flags=
29966+ # If the library was installed with an old release of libtool,
29967+ # it will not redefine variables installed, or shouldnotlink
29968+ installed=yes
29969+ shouldnotlink=no
29970+ avoidtemprpath=
29971+
29972+
29973+ # Read the .la file
29974+ func_source "$lib"
29975+
29976+ # Convert "-framework foo" to "foo.ltframework"
29977+ if test -n "$inherited_linker_flags"; then
29978+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
29979+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
29980+ case " $new_inherited_linker_flags " in
29981+ *" $tmp_inherited_linker_flag "*) ;;
29982+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
29983+ esac
29984+ done
29985+ fi
29986+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
29987+ if test "$linkmode,$pass" = "lib,link" ||
29988+ test "$linkmode,$pass" = "prog,scan" ||
29989+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
29990+ test -n "$dlopen" && func_append dlfiles " $dlopen"
29991+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
29992+ fi
29993+
29994+ if test "$pass" = conv; then
29995+ # Only check for convenience libraries
29996+ deplibs="$lib $deplibs"
29997+ if test -z "$libdir"; then
29998+ if test -z "$old_library"; then
29999+ func_fatal_error "cannot find name of link library for \`$lib'"
30000+ fi
30001+ # It is a libtool convenience library, so add in its objects.
30002+ func_append convenience " $ladir/$objdir/$old_library"
30003+ func_append old_convenience " $ladir/$objdir/$old_library"
30004+ tmp_libs=
30005+ for deplib in $dependency_libs; do
30006+ deplibs="$deplib $deplibs"
30007+ if $opt_preserve_dup_deps ; then
30008+ case "$tmp_libs " in
30009+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
30010+ esac
30011+ fi
30012+ func_append tmp_libs " $deplib"
30013+ done
30014+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
30015+ func_fatal_error "\`$lib' is not a convenience library"
30016+ fi
30017+ continue
30018+ fi # $pass = conv
30019+
30020+
30021+ # Get the name of the library we link against.
30022+ linklib=
30023+ if test -n "$old_library" &&
30024+ { test "$prefer_static_libs" = yes ||
30025+ test "$prefer_static_libs,$installed" = "built,no"; }; then
30026+ linklib=$old_library
30027+ else
30028+ for l in $old_library $library_names; do
30029+ linklib="$l"
30030+ done
30031+ fi
30032+ if test -z "$linklib"; then
30033+ func_fatal_error "cannot find name of link library for \`$lib'"
30034+ fi
30035+
30036+ # This library was specified with -dlopen.
30037+ if test "$pass" = dlopen; then
30038+ if test -z "$libdir"; then
30039+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
30040+ fi
30041+ if test -z "$dlname" ||
30042+ test "$dlopen_support" != yes ||
30043+ test "$build_libtool_libs" = no; then
30044+ # If there is no dlname, no dlopen support or we're linking
30045+ # statically, we need to preload. We also need to preload any
30046+ # dependent libraries so libltdl's deplib preloader doesn't
30047+ # bomb out in the load deplibs phase.
30048+ func_append dlprefiles " $lib $dependency_libs"
30049+ else
30050+ func_append newdlfiles " $lib"
30051+ fi
30052+ continue
30053+ fi # $pass = dlopen
30054+
30055+ # We need an absolute path.
30056+ case $ladir in
30057+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
30058+ *)
30059+ abs_ladir=`cd "$ladir" && pwd`
30060+ if test -z "$abs_ladir"; then
30061+ func_warning "cannot determine absolute directory name of \`$ladir'"
30062+ func_warning "passing it literally to the linker, although it might fail"
30063+ abs_ladir="$ladir"
30064+ fi
30065+ ;;
30066+ esac
30067+ func_basename "$lib"
30068+ laname="$func_basename_result"
30069+
30070+ # Find the relevant object directory and library name.
30071+ if test "X$installed" = Xyes; then
30072+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
30073+ func_warning "library \`$lib' was moved."
30074+ dir="$ladir"
30075+ absdir="$abs_ladir"
30076+ libdir="$abs_ladir"
30077+ else
30078+ dir="$lt_sysroot$libdir"
30079+ absdir="$lt_sysroot$libdir"
30080+ fi
30081+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
30082+ else
30083+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
30084+ dir="$ladir"
30085+ absdir="$abs_ladir"
30086+ # Remove this search path later
30087+ func_append notinst_path " $abs_ladir"
30088+ else
30089+ dir="$ladir/$objdir"
30090+ absdir="$abs_ladir/$objdir"
30091+ # Remove this search path later
30092+ func_append notinst_path " $abs_ladir"
30093+ fi
30094+ fi # $installed = yes
30095+ func_stripname 'lib' '.la' "$laname"
30096+ name=$func_stripname_result
30097+
30098+ # This library was specified with -dlpreopen.
30099+ if test "$pass" = dlpreopen; then
30100+ if test -z "$libdir" && test "$linkmode" = prog; then
30101+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
30102+ fi
30103+ case "$host" in
30104+ # special handling for platforms with PE-DLLs.
30105+ *cygwin* | *mingw* | *cegcc* )
30106+ # Linker will automatically link against shared library if both
30107+ # static and shared are present. Therefore, ensure we extract
30108+ # symbols from the import library if a shared library is present
30109+ # (otherwise, the dlopen module name will be incorrect). We do
30110+ # this by putting the import library name into $newdlprefiles.
30111+ # We recover the dlopen module name by 'saving' the la file
30112+ # name in a special purpose variable, and (later) extracting the
30113+ # dlname from the la file.
30114+ if test -n "$dlname"; then
30115+ func_tr_sh "$dir/$linklib"
30116+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
30117+ func_append newdlprefiles " $dir/$linklib"
30118+ else
30119+ func_append newdlprefiles " $dir/$old_library"
30120+ # Keep a list of preopened convenience libraries to check
30121+ # that they are being used correctly in the link pass.
30122+ test -z "$libdir" && \
30123+ func_append dlpreconveniencelibs " $dir/$old_library"
30124+ fi
30125+ ;;
30126+ * )
30127+ # Prefer using a static library (so that no silly _DYNAMIC symbols
30128+ # are required to link).
30129+ if test -n "$old_library"; then
30130+ func_append newdlprefiles " $dir/$old_library"
30131+ # Keep a list of preopened convenience libraries to check
30132+ # that they are being used correctly in the link pass.
30133+ test -z "$libdir" && \
30134+ func_append dlpreconveniencelibs " $dir/$old_library"
30135+ # Otherwise, use the dlname, so that lt_dlopen finds it.
30136+ elif test -n "$dlname"; then
30137+ func_append newdlprefiles " $dir/$dlname"
30138+ else
30139+ func_append newdlprefiles " $dir/$linklib"
30140+ fi
30141+ ;;
30142+ esac
30143+ fi # $pass = dlpreopen
30144+
30145+ if test -z "$libdir"; then
30146+ # Link the convenience library
30147+ if test "$linkmode" = lib; then
30148+ deplibs="$dir/$old_library $deplibs"
30149+ elif test "$linkmode,$pass" = "prog,link"; then
30150+ compile_deplibs="$dir/$old_library $compile_deplibs"
30151+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
30152+ else
30153+ deplibs="$lib $deplibs" # used for prog,scan pass
30154+ fi
30155+ continue
30156+ fi
30157+
30158+
30159+ if test "$linkmode" = prog && test "$pass" != link; then
30160+ func_append newlib_search_path " $ladir"
30161+ deplibs="$lib $deplibs"
30162+
30163+ linkalldeplibs=no
30164+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
30165+ test "$build_libtool_libs" = no; then
30166+ linkalldeplibs=yes
30167+ fi
30168+
30169+ tmp_libs=
30170+ for deplib in $dependency_libs; do
30171+ case $deplib in
30172+ -L*) func_stripname '-L' '' "$deplib"
30173+ func_resolve_sysroot "$func_stripname_result"
30174+ func_append newlib_search_path " $func_resolve_sysroot_result"
30175+ ;;
30176+ esac
30177+ # Need to link against all dependency_libs?
30178+ if test "$linkalldeplibs" = yes; then
30179+ deplibs="$deplib $deplibs"
30180+ else
30181+ # Need to hardcode shared library paths
30182+ # or/and link against static libraries
30183+ newdependency_libs="$deplib $newdependency_libs"
30184+ fi
30185+ if $opt_preserve_dup_deps ; then
30186+ case "$tmp_libs " in
30187+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
30188+ esac
30189+ fi
30190+ func_append tmp_libs " $deplib"
30191+ done # for deplib
30192+ continue
30193+ fi # $linkmode = prog...
30194+
30195+ if test "$linkmode,$pass" = "prog,link"; then
30196+ if test -n "$library_names" &&
30197+ { { test "$prefer_static_libs" = no ||
30198+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
30199+ test -z "$old_library"; }; then
30200+ # We need to hardcode the library path
30201+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
30202+ # Make sure the rpath contains only unique directories.
30203+ case "$temp_rpath:" in
30204+ *"$absdir:"*) ;;
30205+ *) func_append temp_rpath "$absdir:" ;;
30206+ esac
30207+ fi
30208+
30209+ # Hardcode the library path.
30210+ # Skip directories that are in the system default run-time
30211+ # search path.
30212+ case " $sys_lib_dlsearch_path " in
30213+ *" $absdir "*) ;;
30214+ *)
30215+ case "$compile_rpath " in
30216+ *" $absdir "*) ;;
30217+ *) func_append compile_rpath " $absdir" ;;
30218+ esac
30219+ ;;
30220+ esac
30221+ case " $sys_lib_dlsearch_path " in
30222+ *" $libdir "*) ;;
30223+ *)
30224+ case "$finalize_rpath " in
30225+ *" $libdir "*) ;;
30226+ *) func_append finalize_rpath " $libdir" ;;
30227+ esac
30228+ ;;
30229+ esac
30230+ fi # $linkmode,$pass = prog,link...
30231+
30232+ if test "$alldeplibs" = yes &&
30233+ { test "$deplibs_check_method" = pass_all ||
30234+ { test "$build_libtool_libs" = yes &&
30235+ test -n "$library_names"; }; }; then
30236+ # We only need to search for static libraries
30237+ continue
30238+ fi
30239+ fi
30240+
30241+ link_static=no # Whether the deplib will be linked statically
30242+ use_static_libs=$prefer_static_libs
30243+ if test "$use_static_libs" = built && test "$installed" = yes; then
30244+ use_static_libs=no
30245+ fi
30246+ if test -n "$library_names" &&
30247+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
30248+ case $host in
30249+ *cygwin* | *mingw* | *cegcc*)
30250+ # No point in relinking DLLs because paths are not encoded
30251+ func_append notinst_deplibs " $lib"
30252+ need_relink=no
30253+ ;;
30254+ *)
30255+ if test "$installed" = no; then
30256+ func_append notinst_deplibs " $lib"
30257+ need_relink=yes
30258+ fi
30259+ ;;
30260+ esac
30261+ # This is a shared library
30262+
30263+ # Warn about portability, can't link against -module's on some
30264+ # systems (darwin). Don't bleat about dlopened modules though!
30265+ dlopenmodule=""
30266+ for dlpremoduletest in $dlprefiles; do
30267+ if test "X$dlpremoduletest" = "X$lib"; then
30268+ dlopenmodule="$dlpremoduletest"
30269+ break
30270+ fi
30271+ done
30272+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
30273+ echo
30274+ if test "$linkmode" = prog; then
30275+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
30276+ else
30277+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
30278+ fi
30279+ $ECHO "*** $linklib is not portable!"
30280+ fi
30281+ if test "$linkmode" = lib &&
30282+ test "$hardcode_into_libs" = yes; then
30283+ # Hardcode the library path.
30284+ # Skip directories that are in the system default run-time
30285+ # search path.
30286+ case " $sys_lib_dlsearch_path " in
30287+ *" $absdir "*) ;;
30288+ *)
30289+ case "$compile_rpath " in
30290+ *" $absdir "*) ;;
30291+ *) func_append compile_rpath " $absdir" ;;
30292+ esac
30293+ ;;
30294+ esac
30295+ case " $sys_lib_dlsearch_path " in
30296+ *" $libdir "*) ;;
30297+ *)
30298+ case "$finalize_rpath " in
30299+ *" $libdir "*) ;;
30300+ *) func_append finalize_rpath " $libdir" ;;
30301+ esac
30302+ ;;
30303+ esac
30304+ fi
30305+
30306+ if test -n "$old_archive_from_expsyms_cmds"; then
30307+ # figure out the soname
30308+ set dummy $library_names
30309+ shift
30310+ realname="$1"
30311+ shift
30312+ libname=`eval "\\$ECHO \"$libname_spec\""`
30313+ # use dlname if we got it. it's perfectly good, no?
30314+ if test -n "$dlname"; then
30315+ soname="$dlname"
30316+ elif test -n "$soname_spec"; then
30317+ # bleh windows
30318+ case $host in
30319+ *cygwin* | mingw* | *cegcc*)
30320+ func_arith $current - $age
30321+ major=$func_arith_result
30322+ versuffix="-$major"
30323+ ;;
30324+ esac
30325+ eval soname=\"$soname_spec\"
30326+ else
30327+ soname="$realname"
30328+ fi
30329+
30330+ # Make a new name for the extract_expsyms_cmds to use
30331+ soroot="$soname"
30332+ func_basename "$soroot"
30333+ soname="$func_basename_result"
30334+ func_stripname 'lib' '.dll' "$soname"
30335+ newlib=libimp-$func_stripname_result.a
30336+
30337+ # If the library has no export list, then create one now
30338+ if test -f "$output_objdir/$soname-def"; then :
30339+ else
30340+ func_verbose "extracting exported symbol list from \`$soname'"
30341+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
30342+ fi
30343+
30344+ # Create $newlib
30345+ if test -f "$output_objdir/$newlib"; then :; else
30346+ func_verbose "generating import library for \`$soname'"
30347+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
30348+ fi
30349+ # make sure the library variables are pointing to the new library
30350+ dir=$output_objdir
30351+ linklib=$newlib
30352+ fi # test -n "$old_archive_from_expsyms_cmds"
30353+
30354+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
30355+ add_shlibpath=
30356+ add_dir=
30357+ add=
30358+ lib_linked=yes
30359+ case $hardcode_action in
30360+ immediate | unsupported)
30361+ if test "$hardcode_direct" = no; then
30362+ add="$dir/$linklib"
30363+ case $host in
30364+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
30365+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
30366+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
30367+ *-*-unixware7*) add_dir="-L$dir" ;;
30368+ *-*-darwin* )
30369+ # if the lib is a (non-dlopened) module then we can not
30370+ # link against it, someone is ignoring the earlier warnings
30371+ if /usr/bin/file -L $add 2> /dev/null |
30372+ $GREP ": [^:]* bundle" >/dev/null ; then
30373+ if test "X$dlopenmodule" != "X$lib"; then
30374+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
30375+ if test -z "$old_library" ; then
30376+ echo
30377+ echo "*** And there doesn't seem to be a static archive available"
30378+ echo "*** The link will probably fail, sorry"
30379+ else
30380+ add="$dir/$old_library"
30381+ fi
30382+ elif test -n "$old_library"; then
30383+ add="$dir/$old_library"
30384+ fi
30385+ fi
30386+ esac
30387+ elif test "$hardcode_minus_L" = no; then
30388+ case $host in
30389+ *-*-sunos*) add_shlibpath="$dir" ;;
30390+ esac
30391+ add_dir="-L$dir"
30392+ add="-l$name"
30393+ elif test "$hardcode_shlibpath_var" = no; then
30394+ add_shlibpath="$dir"
30395+ add="-l$name"
30396+ else
30397+ lib_linked=no
30398+ fi
30399+ ;;
30400+ relink)
30401+ if test "$hardcode_direct" = yes &&
30402+ test "$hardcode_direct_absolute" = no; then
30403+ add="$dir/$linklib"
30404+ elif test "$hardcode_minus_L" = yes; then
30405+ add_dir="-L$absdir"
30406+ # Try looking first in the location we're being installed to.
30407+ if test -n "$inst_prefix_dir"; then
30408+ case $libdir in
30409+ [\\/]*)
30410+ func_append add_dir " -L$inst_prefix_dir$libdir"
30411+ ;;
30412+ esac
30413+ fi
30414+ add="-l$name"
30415+ elif test "$hardcode_shlibpath_var" = yes; then
30416+ add_shlibpath="$dir"
30417+ add="-l$name"
30418+ else
30419+ lib_linked=no
30420+ fi
30421+ ;;
30422+ *) lib_linked=no ;;
30423+ esac
30424+
30425+ if test "$lib_linked" != yes; then
30426+ func_fatal_configuration "unsupported hardcode properties"
30427+ fi
30428+
30429+ if test -n "$add_shlibpath"; then
30430+ case :$compile_shlibpath: in
30431+ *":$add_shlibpath:"*) ;;
30432+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
30433+ esac
30434+ fi
30435+ if test "$linkmode" = prog; then
30436+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
30437+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
30438+ else
30439+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
30440+ test -n "$add" && deplibs="$add $deplibs"
30441+ if test "$hardcode_direct" != yes &&
30442+ test "$hardcode_minus_L" != yes &&
30443+ test "$hardcode_shlibpath_var" = yes; then
30444+ case :$finalize_shlibpath: in
30445+ *":$libdir:"*) ;;
30446+ *) func_append finalize_shlibpath "$libdir:" ;;
30447+ esac
30448+ fi
30449+ fi
30450+ fi
30451+
30452+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
30453+ add_shlibpath=
30454+ add_dir=
30455+ add=
30456+ # Finalize command for both is simple: just hardcode it.
30457+ if test "$hardcode_direct" = yes &&
30458+ test "$hardcode_direct_absolute" = no; then
30459+ add="$libdir/$linklib"
30460+ elif test "$hardcode_minus_L" = yes; then
30461+ add_dir="-L$libdir"
30462+ add="-l$name"
30463+ elif test "$hardcode_shlibpath_var" = yes; then
30464+ case :$finalize_shlibpath: in
30465+ *":$libdir:"*) ;;
30466+ *) func_append finalize_shlibpath "$libdir:" ;;
30467+ esac
30468+ add="-l$name"
30469+ elif test "$hardcode_automatic" = yes; then
30470+ if test -n "$inst_prefix_dir" &&
30471+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
30472+ add="$inst_prefix_dir$libdir/$linklib"
30473+ else
30474+ add="$libdir/$linklib"
30475+ fi
30476+ else
30477+ # We cannot seem to hardcode it, guess we'll fake it.
30478+ add_dir="-L$libdir"
30479+ # Try looking first in the location we're being installed to.
30480+ if test -n "$inst_prefix_dir"; then
30481+ case $libdir in
30482+ [\\/]*)
30483+ func_append add_dir " -L$inst_prefix_dir$libdir"
30484+ ;;
30485+ esac
30486+ fi
30487+ add="-l$name"
30488+ fi
30489+
30490+ if test "$linkmode" = prog; then
30491+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
30492+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
30493+ else
30494+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
30495+ test -n "$add" && deplibs="$add $deplibs"
30496+ fi
30497+ fi
30498+ elif test "$linkmode" = prog; then
30499+ # Here we assume that one of hardcode_direct or hardcode_minus_L
30500+ # is not unsupported. This is valid on all known static and
30501+ # shared platforms.
30502+ if test "$hardcode_direct" != unsupported; then
30503+ test -n "$old_library" && linklib="$old_library"
30504+ compile_deplibs="$dir/$linklib $compile_deplibs"
30505+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
30506+ else
30507+ compile_deplibs="-l$name -L$dir $compile_deplibs"
30508+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
30509+ fi
30510+ elif test "$build_libtool_libs" = yes; then
30511+ # Not a shared library
30512+ if test "$deplibs_check_method" != pass_all; then
30513+ # We're trying link a shared library against a static one
30514+ # but the system doesn't support it.
30515+
30516+ # Just print a warning and add the library to dependency_libs so
30517+ # that the program can be linked against the static library.
30518+ echo
30519+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
30520+ echo "*** I have the capability to make that library automatically link in when"
30521+ echo "*** you link to this library. But I can only do this if you have a"
30522+ echo "*** shared version of the library, which you do not appear to have."
30523+ if test "$module" = yes; then
30524+ echo "*** But as you try to build a module library, libtool will still create "
30525+ echo "*** a static module, that should work as long as the dlopening application"
30526+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
30527+ if test -z "$global_symbol_pipe"; then
30528+ echo
30529+ echo "*** However, this would only work if libtool was able to extract symbol"
30530+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
30531+ echo "*** not find such a program. So, this module is probably useless."
30532+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
30533+ fi
30534+ if test "$build_old_libs" = no; then
30535+ build_libtool_libs=module
30536+ build_old_libs=yes
30537+ else
30538+ build_libtool_libs=no
30539+ fi
30540+ fi
30541+ else
30542+ deplibs="$dir/$old_library $deplibs"
30543+ link_static=yes
30544+ fi
30545+ fi # link shared/static library?
30546+
30547+ if test "$linkmode" = lib; then
30548+ if test -n "$dependency_libs" &&
30549+ { test "$hardcode_into_libs" != yes ||
30550+ test "$build_old_libs" = yes ||
30551+ test "$link_static" = yes; }; then
30552+ # Extract -R from dependency_libs
30553+ temp_deplibs=
30554+ for libdir in $dependency_libs; do
30555+ case $libdir in
30556+ -R*) func_stripname '-R' '' "$libdir"
30557+ temp_xrpath=$func_stripname_result
30558+ case " $xrpath " in
30559+ *" $temp_xrpath "*) ;;
30560+ *) func_append xrpath " $temp_xrpath";;
30561+ esac;;
30562+ *) func_append temp_deplibs " $libdir";;
30563+ esac
30564+ done
30565+ dependency_libs="$temp_deplibs"
30566+ fi
30567+
30568+ func_append newlib_search_path " $absdir"
30569+ # Link against this library
30570+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
30571+ # ... and its dependency_libs
30572+ tmp_libs=
30573+ for deplib in $dependency_libs; do
30574+ newdependency_libs="$deplib $newdependency_libs"
30575+ case $deplib in
30576+ -L*) func_stripname '-L' '' "$deplib"
30577+ func_resolve_sysroot "$func_stripname_result";;
30578+ *) func_resolve_sysroot "$deplib" ;;
30579+ esac
30580+ if $opt_preserve_dup_deps ; then
30581+ case "$tmp_libs " in
30582+ *" $func_resolve_sysroot_result "*)
30583+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
30584+ esac
30585+ fi
30586+ func_append tmp_libs " $func_resolve_sysroot_result"
30587+ done
30588+
30589+ if test "$link_all_deplibs" != no; then
30590+ # Add the search paths of all dependency libraries
30591+ for deplib in $dependency_libs; do
30592+ path=
30593+ case $deplib in
30594+ -L*) path="$deplib" ;;
30595+ *.la)
30596+ func_resolve_sysroot "$deplib"
30597+ deplib=$func_resolve_sysroot_result
30598+ func_dirname "$deplib" "" "."
30599+ dir=$func_dirname_result
30600+ # We need an absolute path.
30601+ case $dir in
30602+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
30603+ *)
30604+ absdir=`cd "$dir" && pwd`
30605+ if test -z "$absdir"; then
30606+ func_warning "cannot determine absolute directory name of \`$dir'"
30607+ absdir="$dir"
30608+ fi
30609+ ;;
30610+ esac
30611+ if $GREP "^installed=no" $deplib > /dev/null; then
30612+ case $host in
30613+ *-*-darwin*)
30614+ depdepl=
30615+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
30616+ if test -n "$deplibrary_names" ; then
30617+ for tmp in $deplibrary_names ; do
30618+ depdepl=$tmp
30619+ done
30620+ if test -f "$absdir/$objdir/$depdepl" ; then
30621+ depdepl="$absdir/$objdir/$depdepl"
30622+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
30623+ if test -z "$darwin_install_name"; then
30624+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
30625+ fi
30626+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
30627+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
30628+ path=
30629+ fi
30630+ fi
30631+ ;;
30632+ *)
30633+ path="-L$absdir/$objdir"
30634+ ;;
30635+ esac
30636+ else
30637+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
30638+ test -z "$libdir" && \
30639+ func_fatal_error "\`$deplib' is not a valid libtool archive"
30640+ test "$absdir" != "$libdir" && \
30641+ func_warning "\`$deplib' seems to be moved"
30642+
30643+ path="-L$absdir"
30644+ fi
30645+ ;;
30646+ esac
30647+ case " $deplibs " in
30648+ *" $path "*) ;;
30649+ *) deplibs="$path $deplibs" ;;
30650+ esac
30651+ done
30652+ fi # link_all_deplibs != no
30653+ fi # linkmode = lib
30654+ done # for deplib in $libs
30655+ if test "$pass" = link; then
30656+ if test "$linkmode" = "prog"; then
30657+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
30658+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
30659+ else
30660+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
30661+ fi
30662+ fi
30663+ dependency_libs="$newdependency_libs"
30664+ if test "$pass" = dlpreopen; then
30665+ # Link the dlpreopened libraries before other libraries
30666+ for deplib in $save_deplibs; do
30667+ deplibs="$deplib $deplibs"
30668+ done
30669+ fi
30670+ if test "$pass" != dlopen; then
30671+ if test "$pass" != conv; then
30672+ # Make sure lib_search_path contains only unique directories.
30673+ lib_search_path=
30674+ for dir in $newlib_search_path; do
30675+ case "$lib_search_path " in
30676+ *" $dir "*) ;;
30677+ *) func_append lib_search_path " $dir" ;;
30678+ esac
30679+ done
30680+ newlib_search_path=
30681+ fi
30682+
30683+ if test "$linkmode,$pass" != "prog,link"; then
30684+ vars="deplibs"
30685+ else
30686+ vars="compile_deplibs finalize_deplibs"
30687+ fi
30688+ for var in $vars dependency_libs; do
30689+ # Add libraries to $var in reverse order
30690+ eval tmp_libs=\"\$$var\"
30691+ new_libs=
30692+ for deplib in $tmp_libs; do
30693+ # FIXME: Pedantically, this is the right thing to do, so
30694+ # that some nasty dependency loop isn't accidentally
30695+ # broken:
30696+ #new_libs="$deplib $new_libs"
30697+ # Pragmatically, this seems to cause very few problems in
30698+ # practice:
30699+ case $deplib in
30700+ -L*) new_libs="$deplib $new_libs" ;;
30701+ -R*) ;;
30702+ *)
30703+ # And here is the reason: when a library appears more
30704+ # than once as an explicit dependence of a library, or
30705+ # is implicitly linked in more than once by the
30706+ # compiler, it is considered special, and multiple
30707+ # occurrences thereof are not removed. Compare this
30708+ # with having the same library being listed as a
30709+ # dependency of multiple other libraries: in this case,
30710+ # we know (pedantically, we assume) the library does not
30711+ # need to be listed more than once, so we keep only the
30712+ # last copy. This is not always right, but it is rare
30713+ # enough that we require users that really mean to play
30714+ # such unportable linking tricks to link the library
30715+ # using -Wl,-lname, so that libtool does not consider it
30716+ # for duplicate removal.
30717+ case " $specialdeplibs " in
30718+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
30719+ *)
30720+ case " $new_libs " in
30721+ *" $deplib "*) ;;
30722+ *) new_libs="$deplib $new_libs" ;;
30723+ esac
30724+ ;;
30725+ esac
30726+ ;;
30727+ esac
30728+ done
30729+ tmp_libs=
30730+ for deplib in $new_libs; do
30731+ case $deplib in
30732+ -L*)
30733+ case " $tmp_libs " in
30734+ *" $deplib "*) ;;
30735+ *) func_append tmp_libs " $deplib" ;;
30736+ esac
30737+ ;;
30738+ *) func_append tmp_libs " $deplib" ;;
30739+ esac
30740+ done
30741+ eval $var=\"$tmp_libs\"
30742+ done # for var
30743+ fi
30744+ # Last step: remove runtime libs from dependency_libs
30745+ # (they stay in deplibs)
30746+ tmp_libs=
30747+ for i in $dependency_libs ; do
30748+ case " $predeps $postdeps $compiler_lib_search_path " in
30749+ *" $i "*)
30750+ i=""
30751+ ;;
30752+ esac
30753+ if test -n "$i" ; then
30754+ func_append tmp_libs " $i"
30755+ fi
30756+ done
30757+ dependency_libs=$tmp_libs
30758+ done # for pass
30759+ if test "$linkmode" = prog; then
30760+ dlfiles="$newdlfiles"
30761+ fi
30762+ if test "$linkmode" = prog || test "$linkmode" = lib; then
30763+ dlprefiles="$newdlprefiles"
30764+ fi
30765+
30766+ case $linkmode in
30767+ oldlib)
30768+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
30769+ func_warning "\`-dlopen' is ignored for archives"
30770+ fi
30771+
30772+ case " $deplibs" in
30773+ *\ -l* | *\ -L*)
30774+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
30775+ esac
30776+
30777+ test -n "$rpath" && \
30778+ func_warning "\`-rpath' is ignored for archives"
30779+
30780+ test -n "$xrpath" && \
30781+ func_warning "\`-R' is ignored for archives"
30782+
30783+ test -n "$vinfo" && \
30784+ func_warning "\`-version-info/-version-number' is ignored for archives"
30785+
30786+ test -n "$release" && \
30787+ func_warning "\`-release' is ignored for archives"
30788+
30789+ test -n "$export_symbols$export_symbols_regex" && \
30790+ func_warning "\`-export-symbols' is ignored for archives"
30791+
30792+ # Now set the variables for building old libraries.
30793+ build_libtool_libs=no
30794+ oldlibs="$output"
30795+ func_append objs "$old_deplibs"
30796+ ;;
30797+
30798+ lib)
30799+ # Make sure we only generate libraries of the form `libNAME.la'.
30800+ case $outputname in
30801+ lib*)
30802+ func_stripname 'lib' '.la' "$outputname"
30803+ name=$func_stripname_result
30804+ eval shared_ext=\"$shrext_cmds\"
30805+ eval libname=\"$libname_spec\"
30806+ ;;
30807+ *)
30808+ test "$module" = no && \
30809+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
30810+
30811+ if test "$need_lib_prefix" != no; then
30812+ # Add the "lib" prefix for modules if required
30813+ func_stripname '' '.la' "$outputname"
30814+ name=$func_stripname_result
30815+ eval shared_ext=\"$shrext_cmds\"
30816+ eval libname=\"$libname_spec\"
30817+ else
30818+ func_stripname '' '.la' "$outputname"
30819+ libname=$func_stripname_result
30820+ fi
30821+ ;;
30822+ esac
30823+
30824+ if test -n "$objs"; then
30825+ if test "$deplibs_check_method" != pass_all; then
30826+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
30827+ else
30828+ echo
30829+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
30830+ $ECHO "*** objects $objs is not portable!"
30831+ func_append libobjs " $objs"
30832+ fi
30833+ fi
30834+
30835+ test "$dlself" != no && \
30836+ func_warning "\`-dlopen self' is ignored for libtool libraries"
30837+
30838+ set dummy $rpath
30839+ shift
30840+ test "$#" -gt 1 && \
30841+ func_warning "ignoring multiple \`-rpath's for a libtool library"
30842+
30843+ install_libdir="$1"
30844+
30845+ oldlibs=
30846+ if test -z "$rpath"; then
30847+ if test "$build_libtool_libs" = yes; then
30848+ # Building a libtool convenience library.
30849+ # Some compilers have problems with a `.al' extension so
30850+ # convenience libraries should have the same extension an
30851+ # archive normally would.
30852+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
30853+ build_libtool_libs=convenience
30854+ build_old_libs=yes
30855+ fi
30856+
30857+ test -n "$vinfo" && \
30858+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
30859+
30860+ test -n "$release" && \
30861+ func_warning "\`-release' is ignored for convenience libraries"
30862+ else
30863+
30864+ # Parse the version information argument.
30865+ save_ifs="$IFS"; IFS=':'
30866+ set dummy $vinfo 0 0 0
30867+ shift
30868+ IFS="$save_ifs"
30869+
30870+ test -n "$7" && \
30871+ func_fatal_help "too many parameters to \`-version-info'"
30872+
30873+ # convert absolute version numbers to libtool ages
30874+ # this retains compatibility with .la files and attempts
30875+ # to make the code below a bit more comprehensible
30876+
30877+ case $vinfo_number in
30878+ yes)
30879+ number_major="$1"
30880+ number_minor="$2"
30881+ number_revision="$3"
30882+ #
30883+ # There are really only two kinds -- those that
30884+ # use the current revision as the major version
30885+ # and those that subtract age and use age as
30886+ # a minor version. But, then there is irix
30887+ # which has an extra 1 added just for fun
30888+ #
30889+ case $version_type in
30890+ # correct linux to gnu/linux during the next big refactor
30891+ darwin|linux|osf|windows|none)
30892+ func_arith $number_major + $number_minor
30893+ current=$func_arith_result
30894+ age="$number_minor"
30895+ revision="$number_revision"
30896+ ;;
30897+ freebsd-aout|freebsd-elf|qnx|sunos)
30898+ current="$number_major"
30899+ revision="$number_minor"
30900+ age="0"
30901+ ;;
30902+ irix|nonstopux)
30903+ func_arith $number_major + $number_minor
30904+ current=$func_arith_result
30905+ age="$number_minor"
30906+ revision="$number_minor"
30907+ lt_irix_increment=no
30908+ ;;
30909+ *)
30910+ func_fatal_configuration "$modename: unknown library version type \`$version_type'"
30911+ ;;
30912+ esac
30913+ ;;
30914+ no)
30915+ current="$1"
30916+ revision="$2"
30917+ age="$3"
30918+ ;;
30919+ esac
30920+
30921+ # Check that each of the things are valid numbers.
30922+ case $current in
30923+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
30924+ *)
30925+ func_error "CURRENT \`$current' must be a nonnegative integer"
30926+ func_fatal_error "\`$vinfo' is not valid version information"
30927+ ;;
30928+ esac
30929+
30930+ case $revision in
30931+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
30932+ *)
30933+ func_error "REVISION \`$revision' must be a nonnegative integer"
30934+ func_fatal_error "\`$vinfo' is not valid version information"
30935+ ;;
30936+ esac
30937+
30938+ case $age in
30939+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
30940+ *)
30941+ func_error "AGE \`$age' must be a nonnegative integer"
30942+ func_fatal_error "\`$vinfo' is not valid version information"
30943+ ;;
30944+ esac
30945+
30946+ if test "$age" -gt "$current"; then
30947+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
30948+ func_fatal_error "\`$vinfo' is not valid version information"
30949+ fi
30950+
30951+ # Calculate the version variables.
30952+ major=
30953+ versuffix=
30954+ verstring=
30955+ case $version_type in
30956+ none) ;;
30957+
30958+ darwin)
30959+ # Like Linux, but with the current version available in
30960+ # verstring for coding it into the library header
30961+ func_arith $current - $age
30962+ major=.$func_arith_result
30963+ versuffix="$major.$age.$revision"
30964+ # Darwin ld doesn't like 0 for these options...
30965+ func_arith $current + 1
30966+ minor_current=$func_arith_result
30967+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
30968+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
30969+ ;;
30970+
30971+ freebsd-aout)
30972+ major=".$current"
30973+ versuffix=".$current.$revision";
30974+ ;;
30975+
30976+ freebsd-elf)
30977+ major=".$current"
30978+ versuffix=".$current"
30979+ ;;
30980+
30981+ irix | nonstopux)
30982+ if test "X$lt_irix_increment" = "Xno"; then
30983+ func_arith $current - $age
30984+ else
30985+ func_arith $current - $age + 1
30986+ fi
30987+ major=$func_arith_result
30988+
30989+ case $version_type in
30990+ nonstopux) verstring_prefix=nonstopux ;;
30991+ *) verstring_prefix=sgi ;;
30992+ esac
30993+ verstring="$verstring_prefix$major.$revision"
30994+
30995+ # Add in all the interfaces that we are compatible with.
30996+ loop=$revision
30997+ while test "$loop" -ne 0; do
30998+ func_arith $revision - $loop
30999+ iface=$func_arith_result
31000+ func_arith $loop - 1
31001+ loop=$func_arith_result
31002+ verstring="$verstring_prefix$major.$iface:$verstring"
31003+ done
31004+
31005+ # Before this point, $major must not contain `.'.
31006+ major=.$major
31007+ versuffix="$major.$revision"
31008+ ;;
31009+
31010+ linux) # correct to gnu/linux during the next big refactor
31011+ func_arith $current - $age
31012+ major=.$func_arith_result
31013+ versuffix="$major.$age.$revision"
31014+ ;;
31015+
31016+ osf)
31017+ func_arith $current - $age
31018+ major=.$func_arith_result
31019+ versuffix=".$current.$age.$revision"
31020+ verstring="$current.$age.$revision"
31021+
31022+ # Add in all the interfaces that we are compatible with.
31023+ loop=$age
31024+ while test "$loop" -ne 0; do
31025+ func_arith $current - $loop
31026+ iface=$func_arith_result
31027+ func_arith $loop - 1
31028+ loop=$func_arith_result
31029+ verstring="$verstring:${iface}.0"
31030+ done
31031+
31032+ # Make executables depend on our current version.
31033+ func_append verstring ":${current}.0"
31034+ ;;
31035+
31036+ qnx)
31037+ major=".$current"
31038+ versuffix=".$current"
31039+ ;;
31040+
31041+ sunos)
31042+ major=".$current"
31043+ versuffix=".$current.$revision"
31044+ ;;
31045+
31046+ windows)
31047+ # Use '-' rather than '.', since we only want one
31048+ # extension on DOS 8.3 filesystems.
31049+ func_arith $current - $age
31050+ major=$func_arith_result
31051+ versuffix="-$major"
31052+ ;;
31053+
31054+ *)
31055+ func_fatal_configuration "unknown library version type \`$version_type'"
31056+ ;;
31057+ esac
31058+
31059+ # Clear the version info if we defaulted, and they specified a release.
31060+ if test -z "$vinfo" && test -n "$release"; then
31061+ major=
31062+ case $version_type in
31063+ darwin)
31064+ # we can't check for "0.0" in archive_cmds due to quoting
31065+ # problems, so we reset it completely
31066+ verstring=
31067+ ;;
31068+ *)
31069+ verstring="0.0"
31070+ ;;
31071+ esac
31072+ if test "$need_version" = no; then
31073+ versuffix=
31074+ else
31075+ versuffix=".0.0"
31076+ fi
31077+ fi
31078+
31079+ # Remove version info from name if versioning should be avoided
31080+ if test "$avoid_version" = yes && test "$need_version" = no; then
31081+ major=
31082+ versuffix=
31083+ verstring=""
31084+ fi
31085+
31086+ # Check to see if the archive will have undefined symbols.
31087+ if test "$allow_undefined" = yes; then
31088+ if test "$allow_undefined_flag" = unsupported; then
31089+ func_warning "undefined symbols not allowed in $host shared libraries"
31090+ build_libtool_libs=no
31091+ build_old_libs=yes
31092+ fi
31093+ else
31094+ # Don't allow undefined symbols.
31095+ allow_undefined_flag="$no_undefined_flag"
31096+ fi
31097+
31098+ fi
31099+
31100+ func_generate_dlsyms "$libname" "$libname" "yes"
31101+ func_append libobjs " $symfileobj"
31102+ test "X$libobjs" = "X " && libobjs=
31103+
31104+ if test "$opt_mode" != relink; then
31105+ # Remove our outputs, but don't remove object files since they
31106+ # may have been created when compiling PIC objects.
31107+ removelist=
31108+ tempremovelist=`$ECHO "$output_objdir/*"`
31109+ for p in $tempremovelist; do
31110+ case $p in
31111+ *.$objext | *.gcno)
31112+ ;;
31113+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
31114+ if test "X$precious_files_regex" != "X"; then
31115+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
31116+ then
31117+ continue
31118+ fi
31119+ fi
31120+ func_append removelist " $p"
31121+ ;;
31122+ *) ;;
31123+ esac
31124+ done
31125+ test -n "$removelist" && \
31126+ func_show_eval "${RM}r \$removelist"
31127+ fi
31128+
31129+ # Now set the variables for building old libraries.
31130+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
31131+ func_append oldlibs " $output_objdir/$libname.$libext"
31132+
31133+ # Transform .lo files to .o files.
31134+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
31135+ fi
31136+
31137+ # Eliminate all temporary directories.
31138+ #for path in $notinst_path; do
31139+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
31140+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
31141+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
31142+ #done
31143+
31144+ if test -n "$xrpath"; then
31145+ # If the user specified any rpath flags, then add them.
31146+ temp_xrpath=
31147+ for libdir in $xrpath; do
31148+ func_replace_sysroot "$libdir"
31149+ func_append temp_xrpath " -R$func_replace_sysroot_result"
31150+ case "$finalize_rpath " in
31151+ *" $libdir "*) ;;
31152+ *) func_append finalize_rpath " $libdir" ;;
31153+ esac
31154+ done
31155+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
31156+ dependency_libs="$temp_xrpath $dependency_libs"
31157+ fi
31158+ fi
31159+
31160+ # Make sure dlfiles contains only unique files that won't be dlpreopened
31161+ old_dlfiles="$dlfiles"
31162+ dlfiles=
31163+ for lib in $old_dlfiles; do
31164+ case " $dlprefiles $dlfiles " in
31165+ *" $lib "*) ;;
31166+ *) func_append dlfiles " $lib" ;;
31167+ esac
31168+ done
31169+
31170+ # Make sure dlprefiles contains only unique files
31171+ old_dlprefiles="$dlprefiles"
31172+ dlprefiles=
31173+ for lib in $old_dlprefiles; do
31174+ case "$dlprefiles " in
31175+ *" $lib "*) ;;
31176+ *) func_append dlprefiles " $lib" ;;
31177+ esac
31178+ done
31179+
31180+ if test "$build_libtool_libs" = yes; then
31181+ if test -n "$rpath"; then
31182+ case $host in
31183+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
31184+ # these systems don't actually have a c library (as such)!
31185+ ;;
31186+ *-*-rhapsody* | *-*-darwin1.[012])
31187+ # Rhapsody C library is in the System framework
31188+ func_append deplibs " System.ltframework"
31189+ ;;
31190+ *-*-netbsd*)
31191+ # Don't link with libc until the a.out ld.so is fixed.
31192+ ;;
31193+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
31194+ # Do not include libc due to us having libc/libc_r.
31195+ ;;
31196+ *-*-sco3.2v5* | *-*-sco5v6*)
31197+ # Causes problems with __ctype
31198+ ;;
31199+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
31200+ # Compiler inserts libc in the correct place for threads to work
31201+ ;;
31202+ *)
31203+ # Add libc to deplibs on all other systems if necessary.
31204+ if test "$build_libtool_need_lc" = "yes"; then
31205+ func_append deplibs " -lc"
31206+ fi
31207+ ;;
31208+ esac
31209+ fi
31210+
31211+ # Transform deplibs into only deplibs that can be linked in shared.
31212+ name_save=$name
31213+ libname_save=$libname
31214+ release_save=$release
31215+ versuffix_save=$versuffix
31216+ major_save=$major
31217+ # I'm not sure if I'm treating the release correctly. I think
31218+ # release should show up in the -l (ie -lgmp5) so we don't want to
31219+ # add it in twice. Is that correct?
31220+ release=""
31221+ versuffix=""
31222+ major=""
31223+ newdeplibs=
31224+ droppeddeps=no
31225+ case $deplibs_check_method in
31226+ pass_all)
31227+ # Don't check for shared/static. Everything works.
31228+ # This might be a little naive. We might want to check
31229+ # whether the library exists or not. But this is on
31230+ # osf3 & osf4 and I'm not really sure... Just
31231+ # implementing what was already the behavior.
31232+ newdeplibs=$deplibs
31233+ ;;
31234+ test_compile)
31235+ # This code stresses the "libraries are programs" paradigm to its
31236+ # limits. Maybe even breaks it. We compile a program, linking it
31237+ # against the deplibs as a proxy for the library. Then we can check
31238+ # whether they linked in statically or dynamically with ldd.
31239+ $opt_dry_run || $RM conftest.c
31240+ cat > conftest.c <<EOF
31241+ int main() { return 0; }
31242+EOF
31243+ $opt_dry_run || $RM conftest
31244+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
31245+ ldd_output=`ldd conftest`
31246+ for i in $deplibs; do
31247+ case $i in
31248+ -l*)
31249+ func_stripname -l '' "$i"
31250+ name=$func_stripname_result
31251+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
31252+ case " $predeps $postdeps " in
31253+ *" $i "*)
31254+ func_append newdeplibs " $i"
31255+ i=""
31256+ ;;
31257+ esac
31258+ fi
31259+ if test -n "$i" ; then
31260+ libname=`eval "\\$ECHO \"$libname_spec\""`
31261+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
31262+ set dummy $deplib_matches; shift
31263+ deplib_match=$1
31264+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
31265+ func_append newdeplibs " $i"
31266+ else
31267+ droppeddeps=yes
31268+ echo
31269+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
31270+ echo "*** I have the capability to make that library automatically link in when"
31271+ echo "*** you link to this library. But I can only do this if you have a"
31272+ echo "*** shared version of the library, which I believe you do not have"
31273+ echo "*** because a test_compile did reveal that the linker did not use it for"
31274+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
31275+ fi
31276+ fi
31277+ ;;
31278+ *)
31279+ func_append newdeplibs " $i"
31280+ ;;
31281+ esac
31282+ done
31283+ else
31284+ # Error occurred in the first compile. Let's try to salvage
31285+ # the situation: Compile a separate program for each library.
31286+ for i in $deplibs; do
31287+ case $i in
31288+ -l*)
31289+ func_stripname -l '' "$i"
31290+ name=$func_stripname_result
31291+ $opt_dry_run || $RM conftest
31292+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
31293+ ldd_output=`ldd conftest`
31294+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
31295+ case " $predeps $postdeps " in
31296+ *" $i "*)
31297+ func_append newdeplibs " $i"
31298+ i=""
31299+ ;;
31300+ esac
31301+ fi
31302+ if test -n "$i" ; then
31303+ libname=`eval "\\$ECHO \"$libname_spec\""`
31304+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
31305+ set dummy $deplib_matches; shift
31306+ deplib_match=$1
31307+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
31308+ func_append newdeplibs " $i"
31309+ else
31310+ droppeddeps=yes
31311+ echo
31312+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
31313+ echo "*** I have the capability to make that library automatically link in when"
31314+ echo "*** you link to this library. But I can only do this if you have a"
31315+ echo "*** shared version of the library, which you do not appear to have"
31316+ echo "*** because a test_compile did reveal that the linker did not use this one"
31317+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
31318+ fi
31319+ fi
31320+ else
31321+ droppeddeps=yes
31322+ echo
31323+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
31324+ echo "*** make it link in! You will probably need to install it or some"
31325+ echo "*** library that it depends on before this library will be fully"
31326+ echo "*** functional. Installing it before continuing would be even better."
31327+ fi
31328+ ;;
31329+ *)
31330+ func_append newdeplibs " $i"
31331+ ;;
31332+ esac
31333+ done
31334+ fi
31335+ ;;
31336+ file_magic*)
31337+ set dummy $deplibs_check_method; shift
31338+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
31339+ for a_deplib in $deplibs; do
31340+ case $a_deplib in
31341+ -l*)
31342+ func_stripname -l '' "$a_deplib"
31343+ name=$func_stripname_result
31344+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
31345+ case " $predeps $postdeps " in
31346+ *" $a_deplib "*)
31347+ func_append newdeplibs " $a_deplib"
31348+ a_deplib=""
31349+ ;;
31350+ esac
31351+ fi
31352+ if test -n "$a_deplib" ; then
31353+ libname=`eval "\\$ECHO \"$libname_spec\""`
31354+ if test -n "$file_magic_glob"; then
31355+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
31356+ else
31357+ libnameglob=$libname
31358+ fi
31359+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
31360+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
31361+ if test "$want_nocaseglob" = yes; then
31362+ shopt -s nocaseglob
31363+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
31364+ $nocaseglob
31365+ else
31366+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
31367+ fi
31368+ for potent_lib in $potential_libs; do
31369+ # Follow soft links.
31370+ if ls -lLd "$potent_lib" 2>/dev/null |
31371+ $GREP " -> " >/dev/null; then
31372+ continue
31373+ fi
31374+ # The statement above tries to avoid entering an
31375+ # endless loop below, in case of cyclic links.
31376+ # We might still enter an endless loop, since a link
31377+ # loop can be closed while we follow links,
31378+ # but so what?
31379+ potlib="$potent_lib"
31380+ while test -h "$potlib" 2>/dev/null; do
31381+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
31382+ case $potliblink in
31383+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
31384+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
31385+ esac
31386+ done
31387+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
31388+ $SED -e 10q |
31389+ $EGREP "$file_magic_regex" > /dev/null; then
31390+ func_append newdeplibs " $a_deplib"
31391+ a_deplib=""
31392+ break 2
31393+ fi
31394+ done
31395+ done
31396+ fi
31397+ if test -n "$a_deplib" ; then
31398+ droppeddeps=yes
31399+ echo
31400+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
31401+ echo "*** I have the capability to make that library automatically link in when"
31402+ echo "*** you link to this library. But I can only do this if you have a"
31403+ echo "*** shared version of the library, which you do not appear to have"
31404+ echo "*** because I did check the linker path looking for a file starting"
31405+ if test -z "$potlib" ; then
31406+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
31407+ else
31408+ $ECHO "*** with $libname and none of the candidates passed a file format test"
31409+ $ECHO "*** using a file magic. Last file checked: $potlib"
31410+ fi
31411+ fi
31412+ ;;
31413+ *)
31414+ # Add a -L argument.
31415+ func_append newdeplibs " $a_deplib"
31416+ ;;
31417+ esac
31418+ done # Gone through all deplibs.
31419+ ;;
31420+ match_pattern*)
31421+ set dummy $deplibs_check_method; shift
31422+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
31423+ for a_deplib in $deplibs; do
31424+ case $a_deplib in
31425+ -l*)
31426+ func_stripname -l '' "$a_deplib"
31427+ name=$func_stripname_result
31428+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
31429+ case " $predeps $postdeps " in
31430+ *" $a_deplib "*)
31431+ func_append newdeplibs " $a_deplib"
31432+ a_deplib=""
31433+ ;;
31434+ esac
31435+ fi
31436+ if test -n "$a_deplib" ; then
31437+ libname=`eval "\\$ECHO \"$libname_spec\""`
31438+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
31439+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
31440+ for potent_lib in $potential_libs; do
31441+ potlib="$potent_lib" # see symlink-check above in file_magic test
31442+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
31443+ $EGREP "$match_pattern_regex" > /dev/null; then
31444+ func_append newdeplibs " $a_deplib"
31445+ a_deplib=""
31446+ break 2
31447+ fi
31448+ done
31449+ done
31450+ fi
31451+ if test -n "$a_deplib" ; then
31452+ droppeddeps=yes
31453+ echo
31454+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
31455+ echo "*** I have the capability to make that library automatically link in when"
31456+ echo "*** you link to this library. But I can only do this if you have a"
31457+ echo "*** shared version of the library, which you do not appear to have"
31458+ echo "*** because I did check the linker path looking for a file starting"
31459+ if test -z "$potlib" ; then
31460+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
31461+ else
31462+ $ECHO "*** with $libname and none of the candidates passed a file format test"
31463+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
31464+ fi
31465+ fi
31466+ ;;
31467+ *)
31468+ # Add a -L argument.
31469+ func_append newdeplibs " $a_deplib"
31470+ ;;
31471+ esac
31472+ done # Gone through all deplibs.
31473+ ;;
31474+ none | unknown | *)
31475+ newdeplibs=""
31476+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
31477+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
31478+ for i in $predeps $postdeps ; do
31479+ # can't use Xsed below, because $i might contain '/'
31480+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
31481+ done
31482+ fi
31483+ case $tmp_deplibs in
31484+ *[!\ \ ]*)
31485+ echo
31486+ if test "X$deplibs_check_method" = "Xnone"; then
31487+ echo "*** Warning: inter-library dependencies are not supported in this platform."
31488+ else
31489+ echo "*** Warning: inter-library dependencies are not known to be supported."
31490+ fi
31491+ echo "*** All declared inter-library dependencies are being dropped."
31492+ droppeddeps=yes
31493+ ;;
31494+ esac
31495+ ;;
31496+ esac
31497+ versuffix=$versuffix_save
31498+ major=$major_save
31499+ release=$release_save
31500+ libname=$libname_save
31501+ name=$name_save
31502+
31503+ case $host in
31504+ *-*-rhapsody* | *-*-darwin1.[012])
31505+ # On Rhapsody replace the C library with the System framework
31506+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
31507+ ;;
31508+ esac
31509+
31510+ if test "$droppeddeps" = yes; then
31511+ if test "$module" = yes; then
31512+ echo
31513+ echo "*** Warning: libtool could not satisfy all declared inter-library"
31514+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
31515+ echo "*** a static module, that should work as long as the dlopening"
31516+ echo "*** application is linked with the -dlopen flag."
31517+ if test -z "$global_symbol_pipe"; then
31518+ echo
31519+ echo "*** However, this would only work if libtool was able to extract symbol"
31520+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
31521+ echo "*** not find such a program. So, this module is probably useless."
31522+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
31523+ fi
31524+ if test "$build_old_libs" = no; then
31525+ oldlibs="$output_objdir/$libname.$libext"
31526+ build_libtool_libs=module
31527+ build_old_libs=yes
31528+ else
31529+ build_libtool_libs=no
31530+ fi
31531+ else
31532+ echo "*** The inter-library dependencies that have been dropped here will be"
31533+ echo "*** automatically added whenever a program is linked with this library"
31534+ echo "*** or is declared to -dlopen it."
31535+
31536+ if test "$allow_undefined" = no; then
31537+ echo
31538+ echo "*** Since this library must not contain undefined symbols,"
31539+ echo "*** because either the platform does not support them or"
31540+ echo "*** it was explicitly requested with -no-undefined,"
31541+ echo "*** libtool will only create a static version of it."
31542+ if test "$build_old_libs" = no; then
31543+ oldlibs="$output_objdir/$libname.$libext"
31544+ build_libtool_libs=module
31545+ build_old_libs=yes
31546+ else
31547+ build_libtool_libs=no
31548+ fi
31549+ fi
31550+ fi
31551+ fi
31552+ # Done checking deplibs!
31553+ deplibs=$newdeplibs
31554+ fi
31555+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
31556+ case $host in
31557+ *-*-darwin*)
31558+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
31559+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
31560+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
31561+ ;;
31562+ esac
31563+
31564+ # move library search paths that coincide with paths to not yet
31565+ # installed libraries to the beginning of the library search list
31566+ new_libs=
31567+ for path in $notinst_path; do
31568+ case " $new_libs " in
31569+ *" -L$path/$objdir "*) ;;
31570+ *)
31571+ case " $deplibs " in
31572+ *" -L$path/$objdir "*)
31573+ func_append new_libs " -L$path/$objdir" ;;
31574+ esac
31575+ ;;
31576+ esac
31577+ done
31578+ for deplib in $deplibs; do
31579+ case $deplib in
31580+ -L*)
31581+ case " $new_libs " in
31582+ *" $deplib "*) ;;
31583+ *) func_append new_libs " $deplib" ;;
31584+ esac
31585+ ;;
31586+ *) func_append new_libs " $deplib" ;;
31587+ esac
31588+ done
31589+ deplibs="$new_libs"
31590+
31591+ # All the library-specific variables (install_libdir is set above).
31592+ library_names=
31593+ old_library=
31594+ dlname=
31595+
31596+ # Test again, we may have decided not to build it any more
31597+ if test "$build_libtool_libs" = yes; then
31598+ # Remove ${wl} instances when linking with ld.
31599+ # FIXME: should test the right _cmds variable.
31600+ case $archive_cmds in
31601+ *\$LD\ *) wl= ;;
31602+ esac
31603+ if test "$hardcode_into_libs" = yes; then
31604+ # Hardcode the library paths
31605+ hardcode_libdirs=
31606+ dep_rpath=
31607+ rpath="$finalize_rpath"
31608+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
31609+ for libdir in $rpath; do
31610+ if test -n "$hardcode_libdir_flag_spec"; then
31611+ if test -n "$hardcode_libdir_separator"; then
31612+ func_replace_sysroot "$libdir"
31613+ libdir=$func_replace_sysroot_result
31614+ if test -z "$hardcode_libdirs"; then
31615+ hardcode_libdirs="$libdir"
31616+ else
31617+ # Just accumulate the unique libdirs.
31618+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
31619+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
31620+ ;;
31621+ *)
31622+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
31623+ ;;
31624+ esac
31625+ fi
31626+ else
31627+ eval flag=\"$hardcode_libdir_flag_spec\"
31628+ func_append dep_rpath " $flag"
31629+ fi
31630+ elif test -n "$runpath_var"; then
31631+ case "$perm_rpath " in
31632+ *" $libdir "*) ;;
31633+ *) func_append perm_rpath " $libdir" ;;
31634+ esac
31635+ fi
31636+ done
31637+ # Substitute the hardcoded libdirs into the rpath.
31638+ if test -n "$hardcode_libdir_separator" &&
31639+ test -n "$hardcode_libdirs"; then
31640+ libdir="$hardcode_libdirs"
31641+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
31642+ fi
31643+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
31644+ # We should set the runpath_var.
31645+ rpath=
31646+ for dir in $perm_rpath; do
31647+ func_append rpath "$dir:"
31648+ done
31649+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
31650+ fi
31651+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
31652+ fi
31653+
31654+ shlibpath="$finalize_shlibpath"
31655+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
31656+ if test -n "$shlibpath"; then
31657+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
31658+ fi
31659+
31660+ # Get the real and link names of the library.
31661+ eval shared_ext=\"$shrext_cmds\"
31662+ eval library_names=\"$library_names_spec\"
31663+ set dummy $library_names
31664+ shift
31665+ realname="$1"
31666+ shift
31667+
31668+ if test -n "$soname_spec"; then
31669+ eval soname=\"$soname_spec\"
31670+ else
31671+ soname="$realname"
31672+ fi
31673+ if test -z "$dlname"; then
31674+ dlname=$soname
31675+ fi
31676+
31677+ lib="$output_objdir/$realname"
31678+ linknames=
31679+ for link
31680+ do
31681+ func_append linknames " $link"
31682+ done
31683+
31684+ # Use standard objects if they are pic
31685+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
31686+ test "X$libobjs" = "X " && libobjs=
31687+
31688+ delfiles=
31689+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
31690+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
31691+ export_symbols="$output_objdir/$libname.uexp"
31692+ func_append delfiles " $export_symbols"
31693+ fi
31694+
31695+ orig_export_symbols=
31696+ case $host_os in
31697+ cygwin* | mingw* | cegcc*)
31698+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
31699+ # exporting using user supplied symfile
31700+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
31701+ # and it's NOT already a .def file. Must figure out
31702+ # which of the given symbols are data symbols and tag
31703+ # them as such. So, trigger use of export_symbols_cmds.
31704+ # export_symbols gets reassigned inside the "prepare
31705+ # the list of exported symbols" if statement, so the
31706+ # include_expsyms logic still works.
31707+ orig_export_symbols="$export_symbols"
31708+ export_symbols=
31709+ always_export_symbols=yes
31710+ fi
31711+ fi
31712+ ;;
31713+ esac
31714+
31715+ # Prepare the list of exported symbols
31716+ if test -z "$export_symbols"; then
31717+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
31718+ func_verbose "generating symbol list for \`$libname.la'"
31719+ export_symbols="$output_objdir/$libname.exp"
31720+ $opt_dry_run || $RM $export_symbols
31721+ cmds=$export_symbols_cmds
31722+ save_ifs="$IFS"; IFS='~'
31723+ for cmd1 in $cmds; do
31724+ IFS="$save_ifs"
31725+ # Take the normal branch if the nm_file_list_spec branch
31726+ # doesn't work or if tool conversion is not needed.
31727+ case $nm_file_list_spec~$to_tool_file_cmd in
31728+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
31729+ try_normal_branch=yes
31730+ eval cmd=\"$cmd1\"
31731+ func_len " $cmd"
31732+ len=$func_len_result
31733+ ;;
31734+ *)
31735+ try_normal_branch=no
31736+ ;;
31737+ esac
31738+ if test "$try_normal_branch" = yes \
31739+ && { test "$len" -lt "$max_cmd_len" \
31740+ || test "$max_cmd_len" -le -1; }
31741+ then
31742+ func_show_eval "$cmd" 'exit $?'
31743+ skipped_export=false
31744+ elif test -n "$nm_file_list_spec"; then
31745+ func_basename "$output"
31746+ output_la=$func_basename_result
31747+ save_libobjs=$libobjs
31748+ save_output=$output
31749+ output=${output_objdir}/${output_la}.nm
31750+ func_to_tool_file "$output"
31751+ libobjs=$nm_file_list_spec$func_to_tool_file_result
31752+ func_append delfiles " $output"
31753+ func_verbose "creating $NM input file list: $output"
31754+ for obj in $save_libobjs; do
31755+ func_to_tool_file "$obj"
31756+ $ECHO "$func_to_tool_file_result"
31757+ done > "$output"
31758+ eval cmd=\"$cmd1\"
31759+ func_show_eval "$cmd" 'exit $?'
31760+ output=$save_output
31761+ libobjs=$save_libobjs
31762+ skipped_export=false
31763+ else
31764+ # The command line is too long to execute in one step.
31765+ func_verbose "using reloadable object file for export list..."
31766+ skipped_export=:
31767+ # Break out early, otherwise skipped_export may be
31768+ # set to false by a later but shorter cmd.
31769+ break
31770+ fi
31771+ done
31772+ IFS="$save_ifs"
31773+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
31774+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
31775+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
31776+ fi
31777+ fi
31778+ fi
31779+
31780+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
31781+ tmp_export_symbols="$export_symbols"
31782+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
31783+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
31784+ fi
31785+
31786+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
31787+ # The given exports_symbols file has to be filtered, so filter it.
31788+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
31789+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
31790+ # 's' commands which not all seds can handle. GNU sed should be fine
31791+ # though. Also, the filter scales superlinearly with the number of
31792+ # global variables. join(1) would be nice here, but unfortunately
31793+ # isn't a blessed tool.
31794+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
31795+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
31796+ export_symbols=$output_objdir/$libname.def
31797+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
31798+ fi
31799+
31800+ tmp_deplibs=
31801+ for test_deplib in $deplibs; do
31802+ case " $convenience " in
31803+ *" $test_deplib "*) ;;
31804+ *)
31805+ func_append tmp_deplibs " $test_deplib"
31806+ ;;
31807+ esac
31808+ done
31809+ deplibs="$tmp_deplibs"
31810+
31811+ if test -n "$convenience"; then
31812+ if test -n "$whole_archive_flag_spec" &&
31813+ test "$compiler_needs_object" = yes &&
31814+ test -z "$libobjs"; then
31815+ # extract the archives, so we have objects to list.
31816+ # TODO: could optimize this to just extract one archive.
31817+ whole_archive_flag_spec=
31818+ fi
31819+ if test -n "$whole_archive_flag_spec"; then
31820+ save_libobjs=$libobjs
31821+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
31822+ test "X$libobjs" = "X " && libobjs=
31823+ else
31824+ gentop="$output_objdir/${outputname}x"
31825+ func_append generated " $gentop"
31826+
31827+ func_extract_archives $gentop $convenience
31828+ func_append libobjs " $func_extract_archives_result"
31829+ test "X$libobjs" = "X " && libobjs=
31830+ fi
31831+ fi
31832+
31833+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
31834+ eval flag=\"$thread_safe_flag_spec\"
31835+ func_append linker_flags " $flag"
31836+ fi
31837+
31838+ # Make a backup of the uninstalled library when relinking
31839+ if test "$opt_mode" = relink; then
31840+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
31841+ fi
31842+
31843+ # Do each of the archive commands.
31844+ if test "$module" = yes && test -n "$module_cmds" ; then
31845+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
31846+ eval test_cmds=\"$module_expsym_cmds\"
31847+ cmds=$module_expsym_cmds
31848+ else
31849+ eval test_cmds=\"$module_cmds\"
31850+ cmds=$module_cmds
31851+ fi
31852+ else
31853+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
31854+ eval test_cmds=\"$archive_expsym_cmds\"
31855+ cmds=$archive_expsym_cmds
31856+ else
31857+ eval test_cmds=\"$archive_cmds\"
31858+ cmds=$archive_cmds
31859+ fi
31860+ fi
31861+
31862+ if test "X$skipped_export" != "X:" &&
31863+ func_len " $test_cmds" &&
31864+ len=$func_len_result &&
31865+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
31866+ :
31867+ else
31868+ # The command line is too long to link in one step, link piecewise
31869+ # or, if using GNU ld and skipped_export is not :, use a linker
31870+ # script.
31871+
31872+ # Save the value of $output and $libobjs because we want to
31873+ # use them later. If we have whole_archive_flag_spec, we
31874+ # want to use save_libobjs as it was before
31875+ # whole_archive_flag_spec was expanded, because we can't
31876+ # assume the linker understands whole_archive_flag_spec.
31877+ # This may have to be revisited, in case too many
31878+ # convenience libraries get linked in and end up exceeding
31879+ # the spec.
31880+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
31881+ save_libobjs=$libobjs
31882+ fi
31883+ save_output=$output
31884+ func_basename "$output"
31885+ output_la=$func_basename_result
31886+
31887+ # Clear the reloadable object creation command queue and
31888+ # initialize k to one.
31889+ test_cmds=
31890+ concat_cmds=
31891+ objlist=
31892+ last_robj=
31893+ k=1
31894+
31895+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
31896+ output=${output_objdir}/${output_la}.lnkscript
31897+ func_verbose "creating GNU ld script: $output"
31898+ echo 'INPUT (' > $output
31899+ for obj in $save_libobjs
31900+ do
31901+ func_to_tool_file "$obj"
31902+ $ECHO "$func_to_tool_file_result" >> $output
31903+ done
31904+ echo ')' >> $output
31905+ func_append delfiles " $output"
31906+ func_to_tool_file "$output"
31907+ output=$func_to_tool_file_result
31908+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
31909+ output=${output_objdir}/${output_la}.lnk
31910+ func_verbose "creating linker input file list: $output"
31911+ : > $output
31912+ set x $save_libobjs
31913+ shift
31914+ firstobj=
31915+ if test "$compiler_needs_object" = yes; then
31916+ firstobj="$1 "
31917+ shift
31918+ fi
31919+ for obj
31920+ do
31921+ func_to_tool_file "$obj"
31922+ $ECHO "$func_to_tool_file_result" >> $output
31923+ done
31924+ func_append delfiles " $output"
31925+ func_to_tool_file "$output"
31926+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
31927+ else
31928+ if test -n "$save_libobjs"; then
31929+ func_verbose "creating reloadable object files..."
31930+ output=$output_objdir/$output_la-${k}.$objext
31931+ eval test_cmds=\"$reload_cmds\"
31932+ func_len " $test_cmds"
31933+ len0=$func_len_result
31934+ len=$len0
31935+
31936+ # Loop over the list of objects to be linked.
31937+ for obj in $save_libobjs
31938+ do
31939+ func_len " $obj"
31940+ func_arith $len + $func_len_result
31941+ len=$func_arith_result
31942+ if test "X$objlist" = X ||
31943+ test "$len" -lt "$max_cmd_len"; then
31944+ func_append objlist " $obj"
31945+ else
31946+ # The command $test_cmds is almost too long, add a
31947+ # command to the queue.
31948+ if test "$k" -eq 1 ; then
31949+ # The first file doesn't have a previous command to add.
31950+ reload_objs=$objlist
31951+ eval concat_cmds=\"$reload_cmds\"
31952+ else
31953+ # All subsequent reloadable object files will link in
31954+ # the last one created.
31955+ reload_objs="$objlist $last_robj"
31956+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
31957+ fi
31958+ last_robj=$output_objdir/$output_la-${k}.$objext
31959+ func_arith $k + 1
31960+ k=$func_arith_result
31961+ output=$output_objdir/$output_la-${k}.$objext
31962+ objlist=" $obj"
31963+ func_len " $last_robj"
31964+ func_arith $len0 + $func_len_result
31965+ len=$func_arith_result
31966+ fi
31967+ done
31968+ # Handle the remaining objects by creating one last
31969+ # reloadable object file. All subsequent reloadable object
31970+ # files will link in the last one created.
31971+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
31972+ reload_objs="$objlist $last_robj"
31973+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
31974+ if test -n "$last_robj"; then
31975+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
31976+ fi
31977+ func_append delfiles " $output"
31978+
31979+ else
31980+ output=
31981+ fi
31982+
31983+ if ${skipped_export-false}; then
31984+ func_verbose "generating symbol list for \`$libname.la'"
31985+ export_symbols="$output_objdir/$libname.exp"
31986+ $opt_dry_run || $RM $export_symbols
31987+ libobjs=$output
31988+ # Append the command to create the export file.
31989+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
31990+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
31991+ if test -n "$last_robj"; then
31992+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
31993+ fi
31994+ fi
31995+
31996+ test -n "$save_libobjs" &&
31997+ func_verbose "creating a temporary reloadable object file: $output"
31998+
31999+ # Loop through the commands generated above and execute them.
32000+ save_ifs="$IFS"; IFS='~'
32001+ for cmd in $concat_cmds; do
32002+ IFS="$save_ifs"
32003+ $opt_silent || {
32004+ func_quote_for_expand "$cmd"
32005+ eval "func_echo $func_quote_for_expand_result"
32006+ }
32007+ $opt_dry_run || eval "$cmd" || {
32008+ lt_exit=$?
32009+
32010+ # Restore the uninstalled library and exit
32011+ if test "$opt_mode" = relink; then
32012+ ( cd "$output_objdir" && \
32013+ $RM "${realname}T" && \
32014+ $MV "${realname}U" "$realname" )
32015+ fi
32016+
32017+ exit $lt_exit
32018+ }
32019+ done
32020+ IFS="$save_ifs"
32021+
32022+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
32023+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
32024+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
32025+ fi
32026+ fi
32027+
32028+ if ${skipped_export-false}; then
32029+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
32030+ tmp_export_symbols="$export_symbols"
32031+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
32032+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
32033+ fi
32034+
32035+ if test -n "$orig_export_symbols"; then
32036+ # The given exports_symbols file has to be filtered, so filter it.
32037+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
32038+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
32039+ # 's' commands which not all seds can handle. GNU sed should be fine
32040+ # though. Also, the filter scales superlinearly with the number of
32041+ # global variables. join(1) would be nice here, but unfortunately
32042+ # isn't a blessed tool.
32043+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
32044+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
32045+ export_symbols=$output_objdir/$libname.def
32046+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
32047+ fi
32048+ fi
32049+
32050+ libobjs=$output
32051+ # Restore the value of output.
32052+ output=$save_output
32053+
32054+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
32055+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
32056+ test "X$libobjs" = "X " && libobjs=
32057+ fi
32058+ # Expand the library linking commands again to reset the
32059+ # value of $libobjs for piecewise linking.
32060+
32061+ # Do each of the archive commands.
32062+ if test "$module" = yes && test -n "$module_cmds" ; then
32063+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
32064+ cmds=$module_expsym_cmds
32065+ else
32066+ cmds=$module_cmds
32067+ fi
32068+ else
32069+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
32070+ cmds=$archive_expsym_cmds
32071+ else
32072+ cmds=$archive_cmds
32073+ fi
32074+ fi
32075+ fi
32076+
32077+ if test -n "$delfiles"; then
32078+ # Append the command to remove temporary files to $cmds.
32079+ eval cmds=\"\$cmds~\$RM $delfiles\"
32080+ fi
32081+
32082+ # Add any objects from preloaded convenience libraries
32083+ if test -n "$dlprefiles"; then
32084+ gentop="$output_objdir/${outputname}x"
32085+ func_append generated " $gentop"
32086+
32087+ func_extract_archives $gentop $dlprefiles
32088+ func_append libobjs " $func_extract_archives_result"
32089+ test "X$libobjs" = "X " && libobjs=
32090+ fi
32091+
32092+ save_ifs="$IFS"; IFS='~'
32093+ for cmd in $cmds; do
32094+ IFS="$save_ifs"
32095+ eval cmd=\"$cmd\"
32096+ $opt_silent || {
32097+ func_quote_for_expand "$cmd"
32098+ eval "func_echo $func_quote_for_expand_result"
32099+ }
32100+ $opt_dry_run || eval "$cmd" || {
32101+ lt_exit=$?
32102+
32103+ # Restore the uninstalled library and exit
32104+ if test "$opt_mode" = relink; then
32105+ ( cd "$output_objdir" && \
32106+ $RM "${realname}T" && \
32107+ $MV "${realname}U" "$realname" )
32108+ fi
32109+
32110+ exit $lt_exit
32111+ }
32112+ done
32113+ IFS="$save_ifs"
32114+
32115+ # Restore the uninstalled library and exit
32116+ if test "$opt_mode" = relink; then
32117+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
32118+
32119+ if test -n "$convenience"; then
32120+ if test -z "$whole_archive_flag_spec"; then
32121+ func_show_eval '${RM}r "$gentop"'
32122+ fi
32123+ fi
32124+
32125+ exit $EXIT_SUCCESS
32126+ fi
32127+
32128+ # Create links to the real library.
32129+ for linkname in $linknames; do
32130+ if test "$realname" != "$linkname"; then
32131+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
32132+ fi
32133+ done
32134+
32135+ # If -module or -export-dynamic was specified, set the dlname.
32136+ if test "$module" = yes || test "$export_dynamic" = yes; then
32137+ # On all known operating systems, these are identical.
32138+ dlname="$soname"
32139+ fi
32140+ fi
32141+ ;;
32142+
32143+ obj)
32144+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
32145+ func_warning "\`-dlopen' is ignored for objects"
32146+ fi
32147+
32148+ case " $deplibs" in
32149+ *\ -l* | *\ -L*)
32150+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
32151+ esac
32152+
32153+ test -n "$rpath" && \
32154+ func_warning "\`-rpath' is ignored for objects"
32155+
32156+ test -n "$xrpath" && \
32157+ func_warning "\`-R' is ignored for objects"
32158+
32159+ test -n "$vinfo" && \
32160+ func_warning "\`-version-info' is ignored for objects"
32161+
32162+ test -n "$release" && \
32163+ func_warning "\`-release' is ignored for objects"
32164+
32165+ case $output in
32166+ *.lo)
32167+ test -n "$objs$old_deplibs" && \
32168+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
32169+
32170+ libobj=$output
32171+ func_lo2o "$libobj"
32172+ obj=$func_lo2o_result
32173+ ;;
32174+ *)
32175+ libobj=
32176+ obj="$output"
32177+ ;;
32178+ esac
32179+
32180+ # Delete the old objects.
32181+ $opt_dry_run || $RM $obj $libobj
32182+
32183+ # Objects from convenience libraries. This assumes
32184+ # single-version convenience libraries. Whenever we create
32185+ # different ones for PIC/non-PIC, this we'll have to duplicate
32186+ # the extraction.
32187+ reload_conv_objs=
32188+ gentop=
32189+ # reload_cmds runs $LD directly, so let us get rid of
32190+ # -Wl from whole_archive_flag_spec and hope we can get by with
32191+ # turning comma into space..
32192+ wl=
32193+
32194+ if test -n "$convenience"; then
32195+ if test -n "$whole_archive_flag_spec"; then
32196+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
32197+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
32198+ else
32199+ gentop="$output_objdir/${obj}x"
32200+ func_append generated " $gentop"
32201+
32202+ func_extract_archives $gentop $convenience
32203+ reload_conv_objs="$reload_objs $func_extract_archives_result"
32204+ fi
32205+ fi
32206+
32207+ # If we're not building shared, we need to use non_pic_objs
32208+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
32209+
32210+ # Create the old-style object.
32211+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
32212+
32213+ output="$obj"
32214+ func_execute_cmds "$reload_cmds" 'exit $?'
32215+
32216+ # Exit if we aren't doing a library object file.
32217+ if test -z "$libobj"; then
32218+ if test -n "$gentop"; then
32219+ func_show_eval '${RM}r "$gentop"'
32220+ fi
32221+
32222+ exit $EXIT_SUCCESS
32223+ fi
32224+
32225+ if test "$build_libtool_libs" != yes; then
32226+ if test -n "$gentop"; then
32227+ func_show_eval '${RM}r "$gentop"'
32228+ fi
32229+
32230+ # Create an invalid libtool object if no PIC, so that we don't
32231+ # accidentally link it into a program.
32232+ # $show "echo timestamp > $libobj"
32233+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
32234+ exit $EXIT_SUCCESS
32235+ fi
32236+
32237+ if test -n "$pic_flag" || test "$pic_mode" != default; then
32238+ # Only do commands if we really have different PIC objects.
32239+ reload_objs="$libobjs $reload_conv_objs"
32240+ output="$libobj"
32241+ func_execute_cmds "$reload_cmds" 'exit $?'
32242+ fi
32243+
32244+ if test -n "$gentop"; then
32245+ func_show_eval '${RM}r "$gentop"'
32246+ fi
32247+
32248+ exit $EXIT_SUCCESS
32249+ ;;
32250+
32251+ prog)
32252+ case $host in
32253+ *cygwin*) func_stripname '' '.exe' "$output"
32254+ output=$func_stripname_result.exe;;
32255+ esac
32256+ test -n "$vinfo" && \
32257+ func_warning "\`-version-info' is ignored for programs"
32258+
32259+ test -n "$release" && \
32260+ func_warning "\`-release' is ignored for programs"
32261+
32262+ test "$preload" = yes \
32263+ && test "$dlopen_support" = unknown \
32264+ && test "$dlopen_self" = unknown \
32265+ && test "$dlopen_self_static" = unknown && \
32266+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
32267+
32268+ case $host in
32269+ *-*-rhapsody* | *-*-darwin1.[012])
32270+ # On Rhapsody replace the C library is the System framework
32271+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
32272+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
32273+ ;;
32274+ esac
32275+
32276+ case $host in
32277+ *-*-darwin*)
32278+ # Don't allow lazy linking, it breaks C++ global constructors
32279+ # But is supposedly fixed on 10.4 or later (yay!).
32280+ if test "$tagname" = CXX ; then
32281+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
32282+ 10.[0123])
32283+ func_append compile_command " ${wl}-bind_at_load"
32284+ func_append finalize_command " ${wl}-bind_at_load"
32285+ ;;
32286+ esac
32287+ fi
32288+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
32289+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
32290+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
32291+ ;;
32292+ esac
32293+
32294+
32295+ # move library search paths that coincide with paths to not yet
32296+ # installed libraries to the beginning of the library search list
32297+ new_libs=
32298+ for path in $notinst_path; do
32299+ case " $new_libs " in
32300+ *" -L$path/$objdir "*) ;;
32301+ *)
32302+ case " $compile_deplibs " in
32303+ *" -L$path/$objdir "*)
32304+ func_append new_libs " -L$path/$objdir" ;;
32305+ esac
32306+ ;;
32307+ esac
32308+ done
32309+ for deplib in $compile_deplibs; do
32310+ case $deplib in
32311+ -L*)
32312+ case " $new_libs " in
32313+ *" $deplib "*) ;;
32314+ *) func_append new_libs " $deplib" ;;
32315+ esac
32316+ ;;
32317+ *) func_append new_libs " $deplib" ;;
32318+ esac
32319+ done
32320+ compile_deplibs="$new_libs"
32321+
32322+
32323+ func_append compile_command " $compile_deplibs"
32324+ func_append finalize_command " $finalize_deplibs"
32325+
32326+ if test -n "$rpath$xrpath"; then
32327+ # If the user specified any rpath flags, then add them.
32328+ for libdir in $rpath $xrpath; do
32329+ # This is the magic to use -rpath.
32330+ case "$finalize_rpath " in
32331+ *" $libdir "*) ;;
32332+ *) func_append finalize_rpath " $libdir" ;;
32333+ esac
32334+ done
32335+ fi
32336+
32337+ # Now hardcode the library paths
32338+ rpath=
32339+ hardcode_libdirs=
32340+ for libdir in $compile_rpath $finalize_rpath; do
32341+ if test -n "$hardcode_libdir_flag_spec"; then
32342+ if test -n "$hardcode_libdir_separator"; then
32343+ if test -z "$hardcode_libdirs"; then
32344+ hardcode_libdirs="$libdir"
32345+ else
32346+ # Just accumulate the unique libdirs.
32347+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
32348+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
32349+ ;;
32350+ *)
32351+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
32352+ ;;
32353+ esac
32354+ fi
32355+ else
32356+ eval flag=\"$hardcode_libdir_flag_spec\"
32357+ func_append rpath " $flag"
32358+ fi
32359+ elif test -n "$runpath_var"; then
32360+ case "$perm_rpath " in
32361+ *" $libdir "*) ;;
32362+ *) func_append perm_rpath " $libdir" ;;
32363+ esac
32364+ fi
32365+ case $host in
32366+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
32367+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
32368+ case :$dllsearchpath: in
32369+ *":$libdir:"*) ;;
32370+ ::) dllsearchpath=$libdir;;
32371+ *) func_append dllsearchpath ":$libdir";;
32372+ esac
32373+ case :$dllsearchpath: in
32374+ *":$testbindir:"*) ;;
32375+ ::) dllsearchpath=$testbindir;;
32376+ *) func_append dllsearchpath ":$testbindir";;
32377+ esac
32378+ ;;
32379+ esac
32380+ done
32381+ # Substitute the hardcoded libdirs into the rpath.
32382+ if test -n "$hardcode_libdir_separator" &&
32383+ test -n "$hardcode_libdirs"; then
32384+ libdir="$hardcode_libdirs"
32385+ eval rpath=\" $hardcode_libdir_flag_spec\"
32386+ fi
32387+ compile_rpath="$rpath"
32388+
32389+ rpath=
32390+ hardcode_libdirs=
32391+ for libdir in $finalize_rpath; do
32392+ if test -n "$hardcode_libdir_flag_spec"; then
32393+ if test -n "$hardcode_libdir_separator"; then
32394+ if test -z "$hardcode_libdirs"; then
32395+ hardcode_libdirs="$libdir"
32396+ else
32397+ # Just accumulate the unique libdirs.
32398+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
32399+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
32400+ ;;
32401+ *)
32402+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
32403+ ;;
32404+ esac
32405+ fi
32406+ else
32407+ eval flag=\"$hardcode_libdir_flag_spec\"
32408+ func_append rpath " $flag"
32409+ fi
32410+ elif test -n "$runpath_var"; then
32411+ case "$finalize_perm_rpath " in
32412+ *" $libdir "*) ;;
32413+ *) func_append finalize_perm_rpath " $libdir" ;;
32414+ esac
32415+ fi
32416+ done
32417+ # Substitute the hardcoded libdirs into the rpath.
32418+ if test -n "$hardcode_libdir_separator" &&
32419+ test -n "$hardcode_libdirs"; then
32420+ libdir="$hardcode_libdirs"
32421+ eval rpath=\" $hardcode_libdir_flag_spec\"
32422+ fi
32423+ finalize_rpath="$rpath"
32424+
32425+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
32426+ # Transform all the library objects into standard objects.
32427+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
32428+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
32429+ fi
32430+
32431+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
32432+
32433+ # template prelinking step
32434+ if test -n "$prelink_cmds"; then
32435+ func_execute_cmds "$prelink_cmds" 'exit $?'
32436+ fi
32437+
32438+ wrappers_required=yes
32439+ case $host in
32440+ *cegcc* | *mingw32ce*)
32441+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
32442+ wrappers_required=no
32443+ ;;
32444+ *cygwin* | *mingw* )
32445+ if test "$build_libtool_libs" != yes; then
32446+ wrappers_required=no
32447+ fi
32448+ ;;
32449+ *)
32450+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
32451+ wrappers_required=no
32452+ fi
32453+ ;;
32454+ esac
32455+ if test "$wrappers_required" = no; then
32456+ # Replace the output file specification.
32457+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
32458+ link_command="$compile_command$compile_rpath"
32459+
32460+ # We have no uninstalled library dependencies, so finalize right now.
32461+ exit_status=0
32462+ func_show_eval "$link_command" 'exit_status=$?'
32463+
32464+ if test -n "$postlink_cmds"; then
32465+ func_to_tool_file "$output"
32466+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
32467+ func_execute_cmds "$postlink_cmds" 'exit $?'
32468+ fi
32469+
32470+ # Delete the generated files.
32471+ if test -f "$output_objdir/${outputname}S.${objext}"; then
32472+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
32473+ fi
32474+
32475+ exit $exit_status
32476+ fi
32477+
32478+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
32479+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
32480+ fi
32481+ if test -n "$finalize_shlibpath"; then
32482+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
32483+ fi
32484+
32485+ compile_var=
32486+ finalize_var=
32487+ if test -n "$runpath_var"; then
32488+ if test -n "$perm_rpath"; then
32489+ # We should set the runpath_var.
32490+ rpath=
32491+ for dir in $perm_rpath; do
32492+ func_append rpath "$dir:"
32493+ done
32494+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
32495+ fi
32496+ if test -n "$finalize_perm_rpath"; then
32497+ # We should set the runpath_var.
32498+ rpath=
32499+ for dir in $finalize_perm_rpath; do
32500+ func_append rpath "$dir:"
32501+ done
32502+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
32503+ fi
32504+ fi
32505+
32506+ if test "$no_install" = yes; then
32507+ # We don't need to create a wrapper script.
32508+ link_command="$compile_var$compile_command$compile_rpath"
32509+ # Replace the output file specification.
32510+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
32511+ # Delete the old output file.
32512+ $opt_dry_run || $RM $output
32513+ # Link the executable and exit
32514+ func_show_eval "$link_command" 'exit $?'
32515+
32516+ if test -n "$postlink_cmds"; then
32517+ func_to_tool_file "$output"
32518+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
32519+ func_execute_cmds "$postlink_cmds" 'exit $?'
32520+ fi
32521+
32522+ exit $EXIT_SUCCESS
32523+ fi
32524+
32525+ if test "$hardcode_action" = relink; then
32526+ # Fast installation is not supported
32527+ link_command="$compile_var$compile_command$compile_rpath"
32528+ relink_command="$finalize_var$finalize_command$finalize_rpath"
32529+
32530+ func_warning "this platform does not like uninstalled shared libraries"
32531+ func_warning "\`$output' will be relinked during installation"
32532+ else
32533+ if test "$fast_install" != no; then
32534+ link_command="$finalize_var$compile_command$finalize_rpath"
32535+ if test "$fast_install" = yes; then
32536+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
32537+ else
32538+ # fast_install is set to needless
32539+ relink_command=
32540+ fi
32541+ else
32542+ link_command="$compile_var$compile_command$compile_rpath"
32543+ relink_command="$finalize_var$finalize_command$finalize_rpath"
32544+ fi
32545+ fi
32546+
32547+ # Replace the output file specification.
32548+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
32549+
32550+ # Delete the old output files.
32551+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
32552+
32553+ func_show_eval "$link_command" 'exit $?'
32554+
32555+ if test -n "$postlink_cmds"; then
32556+ func_to_tool_file "$output_objdir/$outputname"
32557+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
32558+ func_execute_cmds "$postlink_cmds" 'exit $?'
32559+ fi
32560+
32561+ # Now create the wrapper script.
32562+ func_verbose "creating $output"
32563+
32564+ # Quote the relink command for shipping.
32565+ if test -n "$relink_command"; then
32566+ # Preserve any variables that may affect compiler behavior
32567+ for var in $variables_saved_for_relink; do
32568+ if eval test -z \"\${$var+set}\"; then
32569+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
32570+ elif eval var_value=\$$var; test -z "$var_value"; then
32571+ relink_command="$var=; export $var; $relink_command"
32572+ else
32573+ func_quote_for_eval "$var_value"
32574+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
32575+ fi
32576+ done
32577+ relink_command="(cd `pwd`; $relink_command)"
32578+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
32579+ fi
32580+
32581+ # Only actually do things if not in dry run mode.
32582+ $opt_dry_run || {
32583+ # win32 will think the script is a binary if it has
32584+ # a .exe suffix, so we strip it off here.
32585+ case $output in
32586+ *.exe) func_stripname '' '.exe' "$output"
32587+ output=$func_stripname_result ;;
32588+ esac
32589+ # test for cygwin because mv fails w/o .exe extensions
32590+ case $host in
32591+ *cygwin*)
32592+ exeext=.exe
32593+ func_stripname '' '.exe' "$outputname"
32594+ outputname=$func_stripname_result ;;
32595+ *) exeext= ;;
32596+ esac
32597+ case $host in
32598+ *cygwin* | *mingw* )
32599+ func_dirname_and_basename "$output" "" "."
32600+ output_name=$func_basename_result
32601+ output_path=$func_dirname_result
32602+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
32603+ cwrapper="$output_path/$output_name.exe"
32604+ $RM $cwrappersource $cwrapper
32605+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
32606+
32607+ func_emit_cwrapperexe_src > $cwrappersource
32608+
32609+ # The wrapper executable is built using the $host compiler,
32610+ # because it contains $host paths and files. If cross-
32611+ # compiling, it, like the target executable, must be
32612+ # executed on the $host or under an emulation environment.
32613+ $opt_dry_run || {
32614+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
32615+ $STRIP $cwrapper
32616+ }
32617+
32618+ # Now, create the wrapper script for func_source use:
32619+ func_ltwrapper_scriptname $cwrapper
32620+ $RM $func_ltwrapper_scriptname_result
32621+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
32622+ $opt_dry_run || {
32623+ # note: this script will not be executed, so do not chmod.
32624+ if test "x$build" = "x$host" ; then
32625+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
32626+ else
32627+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
32628+ fi
32629+ }
32630+ ;;
32631+ * )
32632+ $RM $output
32633+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
32634+
32635+ func_emit_wrapper no > $output
32636+ chmod +x $output
32637+ ;;
32638+ esac
32639+ }
32640+ exit $EXIT_SUCCESS
32641+ ;;
32642+ esac
32643+
32644+ # See if we need to build an old-fashioned archive.
32645+ for oldlib in $oldlibs; do
32646+
32647+ if test "$build_libtool_libs" = convenience; then
32648+ oldobjs="$libobjs_save $symfileobj"
32649+ addlibs="$convenience"
32650+ build_libtool_libs=no
32651+ else
32652+ if test "$build_libtool_libs" = module; then
32653+ oldobjs="$libobjs_save"
32654+ build_libtool_libs=no
32655+ else
32656+ oldobjs="$old_deplibs $non_pic_objects"
32657+ if test "$preload" = yes && test -f "$symfileobj"; then
32658+ func_append oldobjs " $symfileobj"
32659+ fi
32660+ fi
32661+ addlibs="$old_convenience"
32662+ fi
32663+
32664+ if test -n "$addlibs"; then
32665+ gentop="$output_objdir/${outputname}x"
32666+ func_append generated " $gentop"
32667+
32668+ func_extract_archives $gentop $addlibs
32669+ func_append oldobjs " $func_extract_archives_result"
32670+ fi
32671+
32672+ # Do each command in the archive commands.
32673+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
32674+ cmds=$old_archive_from_new_cmds
32675+ else
32676+
32677+ # Add any objects from preloaded convenience libraries
32678+ if test -n "$dlprefiles"; then
32679+ gentop="$output_objdir/${outputname}x"
32680+ func_append generated " $gentop"
32681+
32682+ func_extract_archives $gentop $dlprefiles
32683+ func_append oldobjs " $func_extract_archives_result"
32684+ fi
32685+
32686+ # POSIX demands no paths to be encoded in archives. We have
32687+ # to avoid creating archives with duplicate basenames if we
32688+ # might have to extract them afterwards, e.g., when creating a
32689+ # static archive out of a convenience library, or when linking
32690+ # the entirety of a libtool archive into another (currently
32691+ # not supported by libtool).
32692+ if (for obj in $oldobjs
32693+ do
32694+ func_basename "$obj"
32695+ $ECHO "$func_basename_result"
32696+ done | sort | sort -uc >/dev/null 2>&1); then
32697+ :
32698+ else
32699+ echo "copying selected object files to avoid basename conflicts..."
32700+ gentop="$output_objdir/${outputname}x"
32701+ func_append generated " $gentop"
32702+ func_mkdir_p "$gentop"
32703+ save_oldobjs=$oldobjs
32704+ oldobjs=
32705+ counter=1
32706+ for obj in $save_oldobjs
32707+ do
32708+ func_basename "$obj"
32709+ objbase="$func_basename_result"
32710+ case " $oldobjs " in
32711+ " ") oldobjs=$obj ;;
32712+ *[\ /]"$objbase "*)
32713+ while :; do
32714+ # Make sure we don't pick an alternate name that also
32715+ # overlaps.
32716+ newobj=lt$counter-$objbase
32717+ func_arith $counter + 1
32718+ counter=$func_arith_result
32719+ case " $oldobjs " in
32720+ *[\ /]"$newobj "*) ;;
32721+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
32722+ esac
32723+ done
32724+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
32725+ func_append oldobjs " $gentop/$newobj"
32726+ ;;
32727+ *) func_append oldobjs " $obj" ;;
32728+ esac
32729+ done
32730+ fi
32731+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
32732+ tool_oldlib=$func_to_tool_file_result
32733+ eval cmds=\"$old_archive_cmds\"
32734+
32735+ func_len " $cmds"
32736+ len=$func_len_result
32737+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
32738+ cmds=$old_archive_cmds
32739+ elif test -n "$archiver_list_spec"; then
32740+ func_verbose "using command file archive linking..."
32741+ for obj in $oldobjs
32742+ do
32743+ func_to_tool_file "$obj"
32744+ $ECHO "$func_to_tool_file_result"
32745+ done > $output_objdir/$libname.libcmd
32746+ func_to_tool_file "$output_objdir/$libname.libcmd"
32747+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
32748+ cmds=$old_archive_cmds
32749+ else
32750+ # the command line is too long to link in one step, link in parts
32751+ func_verbose "using piecewise archive linking..."
32752+ save_RANLIB=$RANLIB
32753+ RANLIB=:
32754+ objlist=
32755+ concat_cmds=
32756+ save_oldobjs=$oldobjs
32757+ oldobjs=
32758+ # Is there a better way of finding the last object in the list?
32759+ for obj in $save_oldobjs
32760+ do
32761+ last_oldobj=$obj
32762+ done
32763+ eval test_cmds=\"$old_archive_cmds\"
32764+ func_len " $test_cmds"
32765+ len0=$func_len_result
32766+ len=$len0
32767+ for obj in $save_oldobjs
32768+ do
32769+ func_len " $obj"
32770+ func_arith $len + $func_len_result
32771+ len=$func_arith_result
32772+ func_append objlist " $obj"
32773+ if test "$len" -lt "$max_cmd_len"; then
32774+ :
32775+ else
32776+ # the above command should be used before it gets too long
32777+ oldobjs=$objlist
32778+ if test "$obj" = "$last_oldobj" ; then
32779+ RANLIB=$save_RANLIB
32780+ fi
32781+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
32782+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
32783+ objlist=
32784+ len=$len0
32785+ fi
32786+ done
32787+ RANLIB=$save_RANLIB
32788+ oldobjs=$objlist
32789+ if test "X$oldobjs" = "X" ; then
32790+ eval cmds=\"\$concat_cmds\"
32791+ else
32792+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
32793+ fi
32794+ fi
32795+ fi
32796+ func_execute_cmds "$cmds" 'exit $?'
32797+ done
32798+
32799+ test -n "$generated" && \
32800+ func_show_eval "${RM}r$generated"
32801+
32802+ # Now create the libtool archive.
32803+ case $output in
32804+ *.la)
32805+ old_library=
32806+ test "$build_old_libs" = yes && old_library="$libname.$libext"
32807+ func_verbose "creating $output"
32808+
32809+ # Preserve any variables that may affect compiler behavior
32810+ for var in $variables_saved_for_relink; do
32811+ if eval test -z \"\${$var+set}\"; then
32812+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
32813+ elif eval var_value=\$$var; test -z "$var_value"; then
32814+ relink_command="$var=; export $var; $relink_command"
32815+ else
32816+ func_quote_for_eval "$var_value"
32817+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
32818+ fi
32819+ done
32820+ # Quote the link command for shipping.
32821+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
32822+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
32823+ if test "$hardcode_automatic" = yes ; then
32824+ relink_command=
32825+ fi
32826+
32827+ # Only create the output if not a dry run.
32828+ $opt_dry_run || {
32829+ for installed in no yes; do
32830+ if test "$installed" = yes; then
32831+ if test -z "$install_libdir"; then
32832+ break
32833+ fi
32834+ output="$output_objdir/$outputname"i
32835+ # Replace all uninstalled libtool libraries with the installed ones
32836+ newdependency_libs=
32837+ for deplib in $dependency_libs; do
32838+ case $deplib in
32839+ *.la)
32840+ func_basename "$deplib"
32841+ name="$func_basename_result"
32842+ func_resolve_sysroot "$deplib"
32843+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
32844+ test -z "$libdir" && \
32845+ func_fatal_error "\`$deplib' is not a valid libtool archive"
32846+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
32847+ ;;
32848+ -L*)
32849+ func_stripname -L '' "$deplib"
32850+ func_replace_sysroot "$func_stripname_result"
32851+ func_append newdependency_libs " -L$func_replace_sysroot_result"
32852+ ;;
32853+ -R*)
32854+ func_stripname -R '' "$deplib"
32855+ func_replace_sysroot "$func_stripname_result"
32856+ func_append newdependency_libs " -R$func_replace_sysroot_result"
32857+ ;;
32858+ *) func_append newdependency_libs " $deplib" ;;
32859+ esac
32860+ done
32861+ dependency_libs="$newdependency_libs"
32862+ newdlfiles=
32863+
32864+ for lib in $dlfiles; do
32865+ case $lib in
32866+ *.la)
32867+ func_basename "$lib"
32868+ name="$func_basename_result"
32869+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
32870+ test -z "$libdir" && \
32871+ func_fatal_error "\`$lib' is not a valid libtool archive"
32872+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
32873+ ;;
32874+ *) func_append newdlfiles " $lib" ;;
32875+ esac
32876+ done
32877+ dlfiles="$newdlfiles"
32878+ newdlprefiles=
32879+ for lib in $dlprefiles; do
32880+ case $lib in
32881+ *.la)
32882+ # Only pass preopened files to the pseudo-archive (for
32883+ # eventual linking with the app. that links it) if we
32884+ # didn't already link the preopened objects directly into
32885+ # the library:
32886+ func_basename "$lib"
32887+ name="$func_basename_result"
32888+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
32889+ test -z "$libdir" && \
32890+ func_fatal_error "\`$lib' is not a valid libtool archive"
32891+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
32892+ ;;
32893+ esac
32894+ done
32895+ dlprefiles="$newdlprefiles"
32896+ else
32897+ newdlfiles=
32898+ for lib in $dlfiles; do
32899+ case $lib in
32900+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
32901+ *) abs=`pwd`"/$lib" ;;
32902+ esac
32903+ func_append newdlfiles " $abs"
32904+ done
32905+ dlfiles="$newdlfiles"
32906+ newdlprefiles=
32907+ for lib in $dlprefiles; do
32908+ case $lib in
32909+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
32910+ *) abs=`pwd`"/$lib" ;;
32911+ esac
32912+ func_append newdlprefiles " $abs"
32913+ done
32914+ dlprefiles="$newdlprefiles"
32915+ fi
32916+ $RM $output
32917+ # place dlname in correct position for cygwin
32918+ # In fact, it would be nice if we could use this code for all target
32919+ # systems that can't hard-code library paths into their executables
32920+ # and that have no shared library path variable independent of PATH,
32921+ # but it turns out we can't easily determine that from inspecting
32922+ # libtool variables, so we have to hard-code the OSs to which it
32923+ # applies here; at the moment, that means platforms that use the PE
32924+ # object format with DLL files. See the long comment at the top of
32925+ # tests/bindir.at for full details.
32926+ tdlname=$dlname
32927+ case $host,$output,$installed,$module,$dlname in
32928+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
32929+ # If a -bindir argument was supplied, place the dll there.
32930+ if test "x$bindir" != x ;
32931+ then
32932+ func_relative_path "$install_libdir" "$bindir"
32933+ tdlname=$func_relative_path_result$dlname
32934+ else
32935+ # Otherwise fall back on heuristic.
32936+ tdlname=../bin/$dlname
32937+ fi
32938+ ;;
32939+ esac
32940+ $ECHO > $output "\
32941+# $outputname - a libtool library file
32942+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
32943+#
32944+# Please DO NOT delete this file!
32945+# It is necessary for linking the library.
32946+
32947+# The name that we can dlopen(3).
32948+dlname='$tdlname'
32949+
32950+# Names of this library.
32951+library_names='$library_names'
32952+
32953+# The name of the static archive.
32954+old_library='$old_library'
32955+
32956+# Linker flags that can not go in dependency_libs.
32957+inherited_linker_flags='$new_inherited_linker_flags'
32958+
32959+# Libraries that this one depends upon.
32960+dependency_libs='$dependency_libs'
32961+
32962+# Names of additional weak libraries provided by this library
32963+weak_library_names='$weak_libs'
32964+
32965+# Version information for $libname.
32966+current=$current
32967+age=$age
32968+revision=$revision
32969+
32970+# Is this an already installed library?
32971+installed=$installed
32972+
32973+# Should we warn about portability when linking against -modules?
32974+shouldnotlink=$module
32975+
32976+# Files to dlopen/dlpreopen
32977+dlopen='$dlfiles'
32978+dlpreopen='$dlprefiles'
32979+
32980+# Directory that this library needs to be installed in:
32981+libdir='$install_libdir'"
32982+ if test "$installed" = no && test "$need_relink" = yes; then
32983+ $ECHO >> $output "\
32984+relink_command=\"$relink_command\""
32985+ fi
32986+ done
32987+ }
32988+
32989+ # Do a symbolic link so that the libtool archive can be found in
32990+ # LD_LIBRARY_PATH before the program is installed.
32991+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
32992+ ;;
32993+ esac
32994+ exit $EXIT_SUCCESS
32995+}
32996+
32997+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
32998+ func_mode_link ${1+"$@"}
32999+
33000+
33001+# func_mode_uninstall arg...
33002+func_mode_uninstall ()
33003+{
33004+ $opt_debug
33005+ RM="$nonopt"
33006+ files=
33007+ rmforce=
33008+ exit_status=0
33009+
33010+ # This variable tells wrapper scripts just to set variables rather
33011+ # than running their programs.
33012+ libtool_install_magic="$magic"
33013+
33014+ for arg
33015+ do
33016+ case $arg in
33017+ -f) func_append RM " $arg"; rmforce=yes ;;
33018+ -*) func_append RM " $arg" ;;
33019+ *) func_append files " $arg" ;;
33020+ esac
33021+ done
33022+
33023+ test -z "$RM" && \
33024+ func_fatal_help "you must specify an RM program"
33025+
33026+ rmdirs=
33027+
33028+ for file in $files; do
33029+ func_dirname "$file" "" "."
33030+ dir="$func_dirname_result"
33031+ if test "X$dir" = X.; then
33032+ odir="$objdir"
33033+ else
33034+ odir="$dir/$objdir"
33035+ fi
33036+ func_basename "$file"
33037+ name="$func_basename_result"
33038+ test "$opt_mode" = uninstall && odir="$dir"
33039+
33040+ # Remember odir for removal later, being careful to avoid duplicates
33041+ if test "$opt_mode" = clean; then
33042+ case " $rmdirs " in
33043+ *" $odir "*) ;;
33044+ *) func_append rmdirs " $odir" ;;
33045+ esac
33046+ fi
33047+
33048+ # Don't error if the file doesn't exist and rm -f was used.
33049+ if { test -L "$file"; } >/dev/null 2>&1 ||
33050+ { test -h "$file"; } >/dev/null 2>&1 ||
33051+ test -f "$file"; then
33052+ :
33053+ elif test -d "$file"; then
33054+ exit_status=1
33055+ continue
33056+ elif test "$rmforce" = yes; then
33057+ continue
33058+ fi
33059+
33060+ rmfiles="$file"
33061+
33062+ case $name in
33063+ *.la)
33064+ # Possibly a libtool archive, so verify it.
33065+ if func_lalib_p "$file"; then
33066+ func_source $dir/$name
33067+
33068+ # Delete the libtool libraries and symlinks.
33069+ for n in $library_names; do
33070+ func_append rmfiles " $odir/$n"
33071+ done
33072+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
33073+
33074+ case "$opt_mode" in
33075+ clean)
33076+ case " $library_names " in
33077+ *" $dlname "*) ;;
33078+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
33079+ esac
33080+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
33081+ ;;
33082+ uninstall)
33083+ if test -n "$library_names"; then
33084+ # Do each command in the postuninstall commands.
33085+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
33086+ fi
33087+
33088+ if test -n "$old_library"; then
33089+ # Do each command in the old_postuninstall commands.
33090+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
33091+ fi
33092+ # FIXME: should reinstall the best remaining shared library.
33093+ ;;
33094+ esac
33095+ fi
33096+ ;;
33097+
33098+ *.lo)
33099+ # Possibly a libtool object, so verify it.
33100+ if func_lalib_p "$file"; then
33101+
33102+ # Read the .lo file
33103+ func_source $dir/$name
33104+
33105+ # Add PIC object to the list of files to remove.
33106+ if test -n "$pic_object" &&
33107+ test "$pic_object" != none; then
33108+ func_append rmfiles " $dir/$pic_object"
33109+ fi
33110+
33111+ # Add non-PIC object to the list of files to remove.
33112+ if test -n "$non_pic_object" &&
33113+ test "$non_pic_object" != none; then
33114+ func_append rmfiles " $dir/$non_pic_object"
33115+ fi
33116+ fi
33117+ ;;
33118+
33119+ *)
33120+ if test "$opt_mode" = clean ; then
33121+ noexename=$name
33122+ case $file in
33123+ *.exe)
33124+ func_stripname '' '.exe' "$file"
33125+ file=$func_stripname_result
33126+ func_stripname '' '.exe' "$name"
33127+ noexename=$func_stripname_result
33128+ # $file with .exe has already been added to rmfiles,
33129+ # add $file without .exe
33130+ func_append rmfiles " $file"
33131+ ;;
33132+ esac
33133+ # Do a test to see if this is a libtool program.
33134+ if func_ltwrapper_p "$file"; then
33135+ if func_ltwrapper_executable_p "$file"; then
33136+ func_ltwrapper_scriptname "$file"
33137+ relink_command=
33138+ func_source $func_ltwrapper_scriptname_result
33139+ func_append rmfiles " $func_ltwrapper_scriptname_result"
33140+ else
33141+ relink_command=
33142+ func_source $dir/$noexename
33143+ fi
33144+
33145+ # note $name still contains .exe if it was in $file originally
33146+ # as does the version of $file that was added into $rmfiles
33147+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
33148+ if test "$fast_install" = yes && test -n "$relink_command"; then
33149+ func_append rmfiles " $odir/lt-$name"
33150+ fi
33151+ if test "X$noexename" != "X$name" ; then
33152+ func_append rmfiles " $odir/lt-${noexename}.c"
33153+ fi
33154+ fi
33155+ fi
33156+ ;;
33157+ esac
33158+ func_show_eval "$RM $rmfiles" 'exit_status=1'
33159+ done
33160+
33161+ # Try to remove the ${objdir}s in the directories where we deleted files
33162+ for dir in $rmdirs; do
33163+ if test -d "$dir"; then
33164+ func_show_eval "rmdir $dir >/dev/null 2>&1"
33165+ fi
33166+ done
33167+
33168+ exit $exit_status
33169+}
33170+
33171+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
33172+ func_mode_uninstall ${1+"$@"}
33173+
33174+test -z "$opt_mode" && {
33175+ help="$generic_help"
33176+ func_fatal_help "you must specify a MODE"
33177+}
33178+
33179+test -z "$exec_cmd" && \
33180+ func_fatal_help "invalid operation mode \`$opt_mode'"
33181+
33182+if test -n "$exec_cmd"; then
33183+ eval exec "$exec_cmd"
33184+ exit $EXIT_FAILURE
33185+fi
33186+
33187+exit $exit_status
33188+
33189+
33190+# The TAGs below are defined such that we never get into a situation
33191+# in which we disable both kinds of libraries. Given conflicting
33192+# choices, we go for a static library, that is the most portable,
33193+# since we can't tell whether shared libraries were disabled because
33194+# the user asked for that or because the platform doesn't support
33195+# them. This is particularly important on AIX, because we don't
33196+# support having both static and shared libraries enabled at the same
33197+# time on that platform, so we default to a shared-only configuration.
33198+# If a disable-shared tag is given, we'll fallback to a static-only
33199+# configuration. But we'll never go from static-only to shared-only.
33200+
33201+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
33202+build_libtool_libs=no
33203+build_old_libs=yes
33204+# ### END LIBTOOL TAG CONFIG: disable-shared
33205+
33206+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
33207+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
33208+# ### END LIBTOOL TAG CONFIG: disable-static
33209+
33210+# Local Variables:
33211+# mode:shell-script
33212+# sh-indentation:2
33213+# End:
33214+# vi:sw=2
33215+
33216diff --git a/libclamav/libmspack-0.4alpha/m4/libtool.m4 b/libclamav/libmspack-0.4alpha/m4/libtool.m4
33217new file mode 100644
33218index 000000000000..828104cfde21
33219--- /dev/null
33220+++ b/libclamav/libmspack-0.4alpha/m4/libtool.m4
33221@@ -0,0 +1,8001 @@
33222+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
33223+#
33224+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
33225+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
33226+# Foundation, Inc.
33227+# Written by Gordon Matzigkeit, 1996
33228+#
33229+# This file is free software; the Free Software Foundation gives
33230+# unlimited permission to copy and/or distribute it, with or without
33231+# modifications, as long as this notice is preserved.
33232+
33233+m4_define([_LT_COPYING], [dnl
33234+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
33235+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
33236+# Foundation, Inc.
33237+# Written by Gordon Matzigkeit, 1996
33238+#
33239+# This file is part of GNU Libtool.
33240+#
33241+# GNU Libtool is free software; you can redistribute it and/or
33242+# modify it under the terms of the GNU General Public License as
33243+# published by the Free Software Foundation; either version 2 of
33244+# the License, or (at your option) any later version.
33245+#
33246+# As a special exception to the GNU General Public License,
33247+# if you distribute this file as part of a program or library that
33248+# is built using GNU Libtool, you may include this file under the
33249+# same distribution terms that you use for the rest of that program.
33250+#
33251+# GNU Libtool is distributed in the hope that it will be useful,
33252+# but WITHOUT ANY WARRANTY; without even the implied warranty of
33253+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33254+# GNU General Public License for more details.
33255+#
33256+# You should have received a copy of the GNU General Public License
33257+# along with GNU Libtool; see the file COPYING. If not, a copy
33258+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
33259+# obtained by writing to the Free Software Foundation, Inc.,
33260+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33261+])
33262+
33263+# serial 57 LT_INIT
33264+
33265+
33266+# LT_PREREQ(VERSION)
33267+# ------------------
33268+# Complain and exit if this libtool version is less that VERSION.
33269+m4_defun([LT_PREREQ],
33270+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
33271+ [m4_default([$3],
33272+ [m4_fatal([Libtool version $1 or higher is required],
33273+ 63)])],
33274+ [$2])])
33275+
33276+
33277+# _LT_CHECK_BUILDDIR
33278+# ------------------
33279+# Complain if the absolute build directory name contains unusual characters
33280+m4_defun([_LT_CHECK_BUILDDIR],
33281+[case `pwd` in
33282+ *\ * | *\ *)
33283+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
33284+esac
33285+])
33286+
33287+
33288+# LT_INIT([OPTIONS])
33289+# ------------------
33290+AC_DEFUN([LT_INIT],
33291+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
33292+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
33293+AC_BEFORE([$0], [LT_LANG])dnl
33294+AC_BEFORE([$0], [LT_OUTPUT])dnl
33295+AC_BEFORE([$0], [LTDL_INIT])dnl
33296+m4_require([_LT_CHECK_BUILDDIR])dnl
33297+
33298+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
33299+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
33300+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
33301+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
33302+dnl unless we require an AC_DEFUNed macro:
33303+AC_REQUIRE([LTOPTIONS_VERSION])dnl
33304+AC_REQUIRE([LTSUGAR_VERSION])dnl
33305+AC_REQUIRE([LTVERSION_VERSION])dnl
33306+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
33307+m4_require([_LT_PROG_LTMAIN])dnl
33308+
33309+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
33310+
33311+dnl Parse OPTIONS
33312+_LT_SET_OPTIONS([$0], [$1])
33313+
33314+# This can be used to rebuild libtool when needed
33315+LIBTOOL_DEPS="$ltmain"
33316+
33317+# Always use our own libtool.
33318+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
33319+AC_SUBST(LIBTOOL)dnl
33320+
33321+_LT_SETUP
33322+
33323+# Only expand once:
33324+m4_define([LT_INIT])
33325+])# LT_INIT
33326+
33327+# Old names:
33328+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
33329+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
33330+dnl aclocal-1.4 backwards compatibility:
33331+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
33332+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
33333+
33334+
33335+# _LT_CC_BASENAME(CC)
33336+# -------------------
33337+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
33338+m4_defun([_LT_CC_BASENAME],
33339+[for cc_temp in $1""; do
33340+ case $cc_temp in
33341+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
33342+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
33343+ \-*) ;;
33344+ *) break;;
33345+ esac
33346+done
33347+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
33348+])
33349+
33350+
33351+# _LT_FILEUTILS_DEFAULTS
33352+# ----------------------
33353+# It is okay to use these file commands and assume they have been set
33354+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
33355+m4_defun([_LT_FILEUTILS_DEFAULTS],
33356+[: ${CP="cp -f"}
33357+: ${MV="mv -f"}
33358+: ${RM="rm -f"}
33359+])# _LT_FILEUTILS_DEFAULTS
33360+
33361+
33362+# _LT_SETUP
33363+# ---------
33364+m4_defun([_LT_SETUP],
33365+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
33366+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
33367+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
33368+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
33369+
33370+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
33371+dnl
33372+_LT_DECL([], [host_alias], [0], [The host system])dnl
33373+_LT_DECL([], [host], [0])dnl
33374+_LT_DECL([], [host_os], [0])dnl
33375+dnl
33376+_LT_DECL([], [build_alias], [0], [The build system])dnl
33377+_LT_DECL([], [build], [0])dnl
33378+_LT_DECL([], [build_os], [0])dnl
33379+dnl
33380+AC_REQUIRE([AC_PROG_CC])dnl
33381+AC_REQUIRE([LT_PATH_LD])dnl
33382+AC_REQUIRE([LT_PATH_NM])dnl
33383+dnl
33384+AC_REQUIRE([AC_PROG_LN_S])dnl
33385+test -z "$LN_S" && LN_S="ln -s"
33386+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
33387+dnl
33388+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
33389+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
33390+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
33391+dnl
33392+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
33393+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
33394+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
33395+m4_require([_LT_CMD_RELOAD])dnl
33396+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
33397+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
33398+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
33399+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
33400+m4_require([_LT_WITH_SYSROOT])dnl
33401+
33402+_LT_CONFIG_LIBTOOL_INIT([
33403+# See if we are running on zsh, and set the options which allow our
33404+# commands through without removal of \ escapes INIT.
33405+if test -n "\${ZSH_VERSION+set}" ; then
33406+ setopt NO_GLOB_SUBST
33407+fi
33408+])
33409+if test -n "${ZSH_VERSION+set}" ; then
33410+ setopt NO_GLOB_SUBST
33411+fi
33412+
33413+_LT_CHECK_OBJDIR
33414+
33415+m4_require([_LT_TAG_COMPILER])dnl
33416+
33417+case $host_os in
33418+aix3*)
33419+ # AIX sometimes has problems with the GCC collect2 program. For some
33420+ # reason, if we set the COLLECT_NAMES environment variable, the problems
33421+ # vanish in a puff of smoke.
33422+ if test "X${COLLECT_NAMES+set}" != Xset; then
33423+ COLLECT_NAMES=
33424+ export COLLECT_NAMES
33425+ fi
33426+ ;;
33427+esac
33428+
33429+# Global variables:
33430+ofile=libtool
33431+can_build_shared=yes
33432+
33433+# All known linkers require a `.a' archive for static linking (except MSVC,
33434+# which needs '.lib').
33435+libext=a
33436+
33437+with_gnu_ld="$lt_cv_prog_gnu_ld"
33438+
33439+old_CC="$CC"
33440+old_CFLAGS="$CFLAGS"
33441+
33442+# Set sane defaults for various variables
33443+test -z "$CC" && CC=cc
33444+test -z "$LTCC" && LTCC=$CC
33445+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
33446+test -z "$LD" && LD=ld
33447+test -z "$ac_objext" && ac_objext=o
33448+
33449+_LT_CC_BASENAME([$compiler])
33450+
33451+# Only perform the check for file, if the check method requires it
33452+test -z "$MAGIC_CMD" && MAGIC_CMD=file
33453+case $deplibs_check_method in
33454+file_magic*)
33455+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
33456+ _LT_PATH_MAGIC
33457+ fi
33458+ ;;
33459+esac
33460+
33461+# Use C for the default configuration in the libtool script
33462+LT_SUPPORTED_TAG([CC])
33463+_LT_LANG_C_CONFIG
33464+_LT_LANG_DEFAULT_CONFIG
33465+_LT_CONFIG_COMMANDS
33466+])# _LT_SETUP
33467+
33468+
33469+# _LT_PREPARE_SED_QUOTE_VARS
33470+# --------------------------
33471+# Define a few sed substitution that help us do robust quoting.
33472+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
33473+[# Backslashify metacharacters that are still active within
33474+# double-quoted strings.
33475+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
33476+
33477+# Same as above, but do not quote variable references.
33478+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
33479+
33480+# Sed substitution to delay expansion of an escaped shell variable in a
33481+# double_quote_subst'ed string.
33482+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
33483+
33484+# Sed substitution to delay expansion of an escaped single quote.
33485+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
33486+
33487+# Sed substitution to avoid accidental globbing in evaled expressions
33488+no_glob_subst='s/\*/\\\*/g'
33489+])
33490+
33491+# _LT_PROG_LTMAIN
33492+# ---------------
33493+# Note that this code is called both from `configure', and `config.status'
33494+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
33495+# `config.status' has no value for ac_aux_dir unless we are using Automake,
33496+# so we pass a copy along to make sure it has a sensible value anyway.
33497+m4_defun([_LT_PROG_LTMAIN],
33498+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
33499+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
33500+ltmain="$ac_aux_dir/ltmain.sh"
33501+])# _LT_PROG_LTMAIN
33502+
33503+
33504+## ------------------------------------- ##
33505+## Accumulate code for creating libtool. ##
33506+## ------------------------------------- ##
33507+
33508+# So that we can recreate a full libtool script including additional
33509+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
33510+# in macros and then make a single call at the end using the `libtool'
33511+# label.
33512+
33513+
33514+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
33515+# ----------------------------------------
33516+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
33517+m4_define([_LT_CONFIG_LIBTOOL_INIT],
33518+[m4_ifval([$1],
33519+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
33520+ [$1
33521+])])])
33522+
33523+# Initialize.
33524+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
33525+
33526+
33527+# _LT_CONFIG_LIBTOOL([COMMANDS])
33528+# ------------------------------
33529+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
33530+m4_define([_LT_CONFIG_LIBTOOL],
33531+[m4_ifval([$1],
33532+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
33533+ [$1
33534+])])])
33535+
33536+# Initialize.
33537+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
33538+
33539+
33540+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
33541+# -----------------------------------------------------
33542+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
33543+[_LT_CONFIG_LIBTOOL([$1])
33544+_LT_CONFIG_LIBTOOL_INIT([$2])
33545+])
33546+
33547+
33548+# _LT_FORMAT_COMMENT([COMMENT])
33549+# -----------------------------
33550+# Add leading comment marks to the start of each line, and a trailing
33551+# full-stop to the whole comment if one is not present already.
33552+m4_define([_LT_FORMAT_COMMENT],
33553+[m4_ifval([$1], [
33554+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
33555+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
33556+)])
33557+
33558+
33559+
33560+## ------------------------ ##
33561+## FIXME: Eliminate VARNAME ##
33562+## ------------------------ ##
33563+
33564+
33565+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
33566+# -------------------------------------------------------------------
33567+# CONFIGNAME is the name given to the value in the libtool script.
33568+# VARNAME is the (base) name used in the configure script.
33569+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
33570+# VARNAME. Any other value will be used directly.
33571+m4_define([_LT_DECL],
33572+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
33573+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
33574+ [m4_ifval([$1], [$1], [$2])])
33575+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
33576+ m4_ifval([$4],
33577+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
33578+ lt_dict_add_subkey([lt_decl_dict], [$2],
33579+ [tagged?], [m4_ifval([$5], [yes], [no])])])
33580+])
33581+
33582+
33583+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
33584+# --------------------------------------------------------
33585+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
33586+
33587+
33588+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
33589+# ------------------------------------------------
33590+m4_define([lt_decl_tag_varnames],
33591+[_lt_decl_filter([tagged?], [yes], $@)])
33592+
33593+
33594+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
33595+# ---------------------------------------------------------
33596+m4_define([_lt_decl_filter],
33597+[m4_case([$#],
33598+ [0], [m4_fatal([$0: too few arguments: $#])],
33599+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
33600+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
33601+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
33602+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
33603+])
33604+
33605+
33606+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
33607+# --------------------------------------------------
33608+m4_define([lt_decl_quote_varnames],
33609+[_lt_decl_filter([value], [1], $@)])
33610+
33611+
33612+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
33613+# ---------------------------------------------------
33614+m4_define([lt_decl_dquote_varnames],
33615+[_lt_decl_filter([value], [2], $@)])
33616+
33617+
33618+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
33619+# ---------------------------------------------------
33620+m4_define([lt_decl_varnames_tagged],
33621+[m4_assert([$# <= 2])dnl
33622+_$0(m4_quote(m4_default([$1], [[, ]])),
33623+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
33624+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
33625+m4_define([_lt_decl_varnames_tagged],
33626+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
33627+
33628+
33629+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
33630+# ------------------------------------------------
33631+m4_define([lt_decl_all_varnames],
33632+[_$0(m4_quote(m4_default([$1], [[, ]])),
33633+ m4_if([$2], [],
33634+ m4_quote(lt_decl_varnames),
33635+ m4_quote(m4_shift($@))))[]dnl
33636+])
33637+m4_define([_lt_decl_all_varnames],
33638+[lt_join($@, lt_decl_varnames_tagged([$1],
33639+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
33640+])
33641+
33642+
33643+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
33644+# ------------------------------------
33645+# Quote a variable value, and forward it to `config.status' so that its
33646+# declaration there will have the same value as in `configure'. VARNAME
33647+# must have a single quote delimited value for this to work.
33648+m4_define([_LT_CONFIG_STATUS_DECLARE],
33649+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
33650+
33651+
33652+# _LT_CONFIG_STATUS_DECLARATIONS
33653+# ------------------------------
33654+# We delimit libtool config variables with single quotes, so when
33655+# we write them to config.status, we have to be sure to quote all
33656+# embedded single quotes properly. In configure, this macro expands
33657+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
33658+#
33659+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
33660+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
33661+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
33662+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
33663+
33664+
33665+# _LT_LIBTOOL_TAGS
33666+# ----------------
33667+# Output comment and list of tags supported by the script
33668+m4_defun([_LT_LIBTOOL_TAGS],
33669+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
33670+available_tags="_LT_TAGS"dnl
33671+])
33672+
33673+
33674+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
33675+# -----------------------------------
33676+# Extract the dictionary values for VARNAME (optionally with TAG) and
33677+# expand to a commented shell variable setting:
33678+#
33679+# # Some comment about what VAR is for.
33680+# visible_name=$lt_internal_name
33681+m4_define([_LT_LIBTOOL_DECLARE],
33682+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
33683+ [description])))[]dnl
33684+m4_pushdef([_libtool_name],
33685+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
33686+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
33687+ [0], [_libtool_name=[$]$1],
33688+ [1], [_libtool_name=$lt_[]$1],
33689+ [2], [_libtool_name=$lt_[]$1],
33690+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
33691+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
33692+])
33693+
33694+
33695+# _LT_LIBTOOL_CONFIG_VARS
33696+# -----------------------
33697+# Produce commented declarations of non-tagged libtool config variables
33698+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
33699+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
33700+# section) are produced by _LT_LIBTOOL_TAG_VARS.
33701+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
33702+[m4_foreach([_lt_var],
33703+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
33704+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
33705+
33706+
33707+# _LT_LIBTOOL_TAG_VARS(TAG)
33708+# -------------------------
33709+m4_define([_LT_LIBTOOL_TAG_VARS],
33710+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
33711+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
33712+
33713+
33714+# _LT_TAGVAR(VARNAME, [TAGNAME])
33715+# ------------------------------
33716+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
33717+
33718+
33719+# _LT_CONFIG_COMMANDS
33720+# -------------------
33721+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
33722+# variables for single and double quote escaping we saved from calls
33723+# to _LT_DECL, we can put quote escaped variables declarations
33724+# into `config.status', and then the shell code to quote escape them in
33725+# for loops in `config.status'. Finally, any additional code accumulated
33726+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
33727+m4_defun([_LT_CONFIG_COMMANDS],
33728+[AC_PROVIDE_IFELSE([LT_OUTPUT],
33729+ dnl If the libtool generation code has been placed in $CONFIG_LT,
33730+ dnl instead of duplicating it all over again into config.status,
33731+ dnl then we will have config.status run $CONFIG_LT later, so it
33732+ dnl needs to know what name is stored there:
33733+ [AC_CONFIG_COMMANDS([libtool],
33734+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
33735+ dnl If the libtool generation code is destined for config.status,
33736+ dnl expand the accumulated commands and init code now:
33737+ [AC_CONFIG_COMMANDS([libtool],
33738+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
33739+])#_LT_CONFIG_COMMANDS
33740+
33741+
33742+# Initialize.
33743+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
33744+[
33745+
33746+# The HP-UX ksh and POSIX shell print the target directory to stdout
33747+# if CDPATH is set.
33748+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
33749+
33750+sed_quote_subst='$sed_quote_subst'
33751+double_quote_subst='$double_quote_subst'
33752+delay_variable_subst='$delay_variable_subst'
33753+_LT_CONFIG_STATUS_DECLARATIONS
33754+LTCC='$LTCC'
33755+LTCFLAGS='$LTCFLAGS'
33756+compiler='$compiler_DEFAULT'
33757+
33758+# A function that is used when there is no print builtin or printf.
33759+func_fallback_echo ()
33760+{
33761+ eval 'cat <<_LTECHO_EOF
33762+\$[]1
33763+_LTECHO_EOF'
33764+}
33765+
33766+# Quote evaled strings.
33767+for var in lt_decl_all_varnames([[ \
33768+]], lt_decl_quote_varnames); do
33769+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
33770+ *[[\\\\\\\`\\"\\\$]]*)
33771+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
33772+ ;;
33773+ *)
33774+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
33775+ ;;
33776+ esac
33777+done
33778+
33779+# Double-quote double-evaled strings.
33780+for var in lt_decl_all_varnames([[ \
33781+]], lt_decl_dquote_varnames); do
33782+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
33783+ *[[\\\\\\\`\\"\\\$]]*)
33784+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
33785+ ;;
33786+ *)
33787+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
33788+ ;;
33789+ esac
33790+done
33791+
33792+_LT_OUTPUT_LIBTOOL_INIT
33793+])
33794+
33795+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
33796+# ------------------------------------
33797+# Generate a child script FILE with all initialization necessary to
33798+# reuse the environment learned by the parent script, and make the
33799+# file executable. If COMMENT is supplied, it is inserted after the
33800+# `#!' sequence but before initialization text begins. After this
33801+# macro, additional text can be appended to FILE to form the body of
33802+# the child script. The macro ends with non-zero status if the
33803+# file could not be fully written (such as if the disk is full).
33804+m4_ifdef([AS_INIT_GENERATED],
33805+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
33806+[m4_defun([_LT_GENERATED_FILE_INIT],
33807+[m4_require([AS_PREPARE])]dnl
33808+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
33809+[lt_write_fail=0
33810+cat >$1 <<_ASEOF || lt_write_fail=1
33811+#! $SHELL
33812+# Generated by $as_me.
33813+$2
33814+SHELL=\${CONFIG_SHELL-$SHELL}
33815+export SHELL
33816+_ASEOF
33817+cat >>$1 <<\_ASEOF || lt_write_fail=1
33818+AS_SHELL_SANITIZE
33819+_AS_PREPARE
33820+exec AS_MESSAGE_FD>&1
33821+_ASEOF
33822+test $lt_write_fail = 0 && chmod +x $1[]dnl
33823+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
33824+
33825+# LT_OUTPUT
33826+# ---------
33827+# This macro allows early generation of the libtool script (before
33828+# AC_OUTPUT is called), incase it is used in configure for compilation
33829+# tests.
33830+AC_DEFUN([LT_OUTPUT],
33831+[: ${CONFIG_LT=./config.lt}
33832+AC_MSG_NOTICE([creating $CONFIG_LT])
33833+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
33834+[# Run this file to recreate a libtool stub with the current configuration.])
33835+
33836+cat >>"$CONFIG_LT" <<\_LTEOF
33837+lt_cl_silent=false
33838+exec AS_MESSAGE_LOG_FD>>config.log
33839+{
33840+ echo
33841+ AS_BOX([Running $as_me.])
33842+} >&AS_MESSAGE_LOG_FD
33843+
33844+lt_cl_help="\
33845+\`$as_me' creates a local libtool stub from the current configuration,
33846+for use in further configure time tests before the real libtool is
33847+generated.
33848+
33849+Usage: $[0] [[OPTIONS]]
33850+
33851+ -h, --help print this help, then exit
33852+ -V, --version print version number, then exit
33853+ -q, --quiet do not print progress messages
33854+ -d, --debug don't remove temporary files
33855+
33856+Report bugs to <bug-libtool@gnu.org>."
33857+
33858+lt_cl_version="\
33859+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
33860+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
33861+configured by $[0], generated by m4_PACKAGE_STRING.
33862+
33863+Copyright (C) 2011 Free Software Foundation, Inc.
33864+This config.lt script is free software; the Free Software Foundation
33865+gives unlimited permision to copy, distribute and modify it."
33866+
33867+while test $[#] != 0
33868+do
33869+ case $[1] in
33870+ --version | --v* | -V )
33871+ echo "$lt_cl_version"; exit 0 ;;
33872+ --help | --h* | -h )
33873+ echo "$lt_cl_help"; exit 0 ;;
33874+ --debug | --d* | -d )
33875+ debug=: ;;
33876+ --quiet | --q* | --silent | --s* | -q )
33877+ lt_cl_silent=: ;;
33878+
33879+ -*) AC_MSG_ERROR([unrecognized option: $[1]
33880+Try \`$[0] --help' for more information.]) ;;
33881+
33882+ *) AC_MSG_ERROR([unrecognized argument: $[1]
33883+Try \`$[0] --help' for more information.]) ;;
33884+ esac
33885+ shift
33886+done
33887+
33888+if $lt_cl_silent; then
33889+ exec AS_MESSAGE_FD>/dev/null
33890+fi
33891+_LTEOF
33892+
33893+cat >>"$CONFIG_LT" <<_LTEOF
33894+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
33895+_LTEOF
33896+
33897+cat >>"$CONFIG_LT" <<\_LTEOF
33898+AC_MSG_NOTICE([creating $ofile])
33899+_LT_OUTPUT_LIBTOOL_COMMANDS
33900+AS_EXIT(0)
33901+_LTEOF
33902+chmod +x "$CONFIG_LT"
33903+
33904+# configure is writing to config.log, but config.lt does its own redirection,
33905+# appending to config.log, which fails on DOS, as config.log is still kept
33906+# open by configure. Here we exec the FD to /dev/null, effectively closing
33907+# config.log, so it can be properly (re)opened and appended to by config.lt.
33908+lt_cl_success=:
33909+test "$silent" = yes &&
33910+ lt_config_lt_args="$lt_config_lt_args --quiet"
33911+exec AS_MESSAGE_LOG_FD>/dev/null
33912+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
33913+exec AS_MESSAGE_LOG_FD>>config.log
33914+$lt_cl_success || AS_EXIT(1)
33915+])# LT_OUTPUT
33916+
33917+
33918+# _LT_CONFIG(TAG)
33919+# ---------------
33920+# If TAG is the built-in tag, create an initial libtool script with a
33921+# default configuration from the untagged config vars. Otherwise add code
33922+# to config.status for appending the configuration named by TAG from the
33923+# matching tagged config vars.
33924+m4_defun([_LT_CONFIG],
33925+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
33926+_LT_CONFIG_SAVE_COMMANDS([
33927+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
33928+ m4_if(_LT_TAG, [C], [
33929+ # See if we are running on zsh, and set the options which allow our
33930+ # commands through without removal of \ escapes.
33931+ if test -n "${ZSH_VERSION+set}" ; then
33932+ setopt NO_GLOB_SUBST
33933+ fi
33934+
33935+ cfgfile="${ofile}T"
33936+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
33937+ $RM "$cfgfile"
33938+
33939+ cat <<_LT_EOF >> "$cfgfile"
33940+#! $SHELL
33941+
33942+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
33943+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
33944+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
33945+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
33946+#
33947+_LT_COPYING
33948+_LT_LIBTOOL_TAGS
33949+
33950+# ### BEGIN LIBTOOL CONFIG
33951+_LT_LIBTOOL_CONFIG_VARS
33952+_LT_LIBTOOL_TAG_VARS
33953+# ### END LIBTOOL CONFIG
33954+
33955+_LT_EOF
33956+
33957+ case $host_os in
33958+ aix3*)
33959+ cat <<\_LT_EOF >> "$cfgfile"
33960+# AIX sometimes has problems with the GCC collect2 program. For some
33961+# reason, if we set the COLLECT_NAMES environment variable, the problems
33962+# vanish in a puff of smoke.
33963+if test "X${COLLECT_NAMES+set}" != Xset; then
33964+ COLLECT_NAMES=
33965+ export COLLECT_NAMES
33966+fi
33967+_LT_EOF
33968+ ;;
33969+ esac
33970+
33971+ _LT_PROG_LTMAIN
33972+
33973+ # We use sed instead of cat because bash on DJGPP gets confused if
33974+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
33975+ # text mode, it properly converts lines to CR/LF. This bash problem
33976+ # is reportedly fixed, but why not run on old versions too?
33977+ sed '$q' "$ltmain" >> "$cfgfile" \
33978+ || (rm -f "$cfgfile"; exit 1)
33979+
33980+ _LT_PROG_REPLACE_SHELLFNS
33981+
33982+ mv -f "$cfgfile" "$ofile" ||
33983+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
33984+ chmod +x "$ofile"
33985+],
33986+[cat <<_LT_EOF >> "$ofile"
33987+
33988+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
33989+dnl in a comment (ie after a #).
33990+# ### BEGIN LIBTOOL TAG CONFIG: $1
33991+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
33992+# ### END LIBTOOL TAG CONFIG: $1
33993+_LT_EOF
33994+])dnl /m4_if
33995+],
33996+[m4_if([$1], [], [
33997+ PACKAGE='$PACKAGE'
33998+ VERSION='$VERSION'
33999+ TIMESTAMP='$TIMESTAMP'
34000+ RM='$RM'
34001+ ofile='$ofile'], [])
34002+])dnl /_LT_CONFIG_SAVE_COMMANDS
34003+])# _LT_CONFIG
34004+
34005+
34006+# LT_SUPPORTED_TAG(TAG)
34007+# ---------------------
34008+# Trace this macro to discover what tags are supported by the libtool
34009+# --tag option, using:
34010+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
34011+AC_DEFUN([LT_SUPPORTED_TAG], [])
34012+
34013+
34014+# C support is built-in for now
34015+m4_define([_LT_LANG_C_enabled], [])
34016+m4_define([_LT_TAGS], [])
34017+
34018+
34019+# LT_LANG(LANG)
34020+# -------------
34021+# Enable libtool support for the given language if not already enabled.
34022+AC_DEFUN([LT_LANG],
34023+[AC_BEFORE([$0], [LT_OUTPUT])dnl
34024+m4_case([$1],
34025+ [C], [_LT_LANG(C)],
34026+ [C++], [_LT_LANG(CXX)],
34027+ [Go], [_LT_LANG(GO)],
34028+ [Java], [_LT_LANG(GCJ)],
34029+ [Fortran 77], [_LT_LANG(F77)],
34030+ [Fortran], [_LT_LANG(FC)],
34031+ [Windows Resource], [_LT_LANG(RC)],
34032+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
34033+ [_LT_LANG($1)],
34034+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
34035+])# LT_LANG
34036+
34037+
34038+# _LT_LANG(LANGNAME)
34039+# ------------------
34040+m4_defun([_LT_LANG],
34041+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
34042+ [LT_SUPPORTED_TAG([$1])dnl
34043+ m4_append([_LT_TAGS], [$1 ])dnl
34044+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
34045+ _LT_LANG_$1_CONFIG($1)])dnl
34046+])# _LT_LANG
34047+
34048+
34049+m4_ifndef([AC_PROG_GO], [
34050+############################################################
34051+# NOTE: This macro has been submitted for inclusion into #
34052+# GNU Autoconf as AC_PROG_GO. When it is available in #
34053+# a released version of Autoconf we should remove this #
34054+# macro and use it instead. #
34055+############################################################
34056+m4_defun([AC_PROG_GO],
34057+[AC_LANG_PUSH(Go)dnl
34058+AC_ARG_VAR([GOC], [Go compiler command])dnl
34059+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
34060+_AC_ARG_VAR_LDFLAGS()dnl
34061+AC_CHECK_TOOL(GOC, gccgo)
34062+if test -z "$GOC"; then
34063+ if test -n "$ac_tool_prefix"; then
34064+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
34065+ fi
34066+fi
34067+if test -z "$GOC"; then
34068+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
34069+fi
34070+])#m4_defun
34071+])#m4_ifndef
34072+
34073+
34074+# _LT_LANG_DEFAULT_CONFIG
34075+# -----------------------
34076+m4_defun([_LT_LANG_DEFAULT_CONFIG],
34077+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
34078+ [LT_LANG(CXX)],
34079+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
34080+
34081+AC_PROVIDE_IFELSE([AC_PROG_F77],
34082+ [LT_LANG(F77)],
34083+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
34084+
34085+AC_PROVIDE_IFELSE([AC_PROG_FC],
34086+ [LT_LANG(FC)],
34087+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
34088+
34089+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
34090+dnl pulling things in needlessly.
34091+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
34092+ [LT_LANG(GCJ)],
34093+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
34094+ [LT_LANG(GCJ)],
34095+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
34096+ [LT_LANG(GCJ)],
34097+ [m4_ifdef([AC_PROG_GCJ],
34098+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
34099+ m4_ifdef([A][M_PROG_GCJ],
34100+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
34101+ m4_ifdef([LT_PROG_GCJ],
34102+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
34103+
34104+AC_PROVIDE_IFELSE([AC_PROG_GO],
34105+ [LT_LANG(GO)],
34106+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
34107+
34108+AC_PROVIDE_IFELSE([LT_PROG_RC],
34109+ [LT_LANG(RC)],
34110+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
34111+])# _LT_LANG_DEFAULT_CONFIG
34112+
34113+# Obsolete macros:
34114+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
34115+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
34116+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
34117+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
34118+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
34119+dnl aclocal-1.4 backwards compatibility:
34120+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
34121+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
34122+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
34123+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
34124+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
34125+
34126+
34127+# _LT_TAG_COMPILER
34128+# ----------------
34129+m4_defun([_LT_TAG_COMPILER],
34130+[AC_REQUIRE([AC_PROG_CC])dnl
34131+
34132+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
34133+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
34134+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
34135+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
34136+
34137+# If no C compiler was specified, use CC.
34138+LTCC=${LTCC-"$CC"}
34139+
34140+# If no C compiler flags were specified, use CFLAGS.
34141+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
34142+
34143+# Allow CC to be a program name with arguments.
34144+compiler=$CC
34145+])# _LT_TAG_COMPILER
34146+
34147+
34148+# _LT_COMPILER_BOILERPLATE
34149+# ------------------------
34150+# Check for compiler boilerplate output or warnings with
34151+# the simple compiler test code.
34152+m4_defun([_LT_COMPILER_BOILERPLATE],
34153+[m4_require([_LT_DECL_SED])dnl
34154+ac_outfile=conftest.$ac_objext
34155+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
34156+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
34157+_lt_compiler_boilerplate=`cat conftest.err`
34158+$RM conftest*
34159+])# _LT_COMPILER_BOILERPLATE
34160+
34161+
34162+# _LT_LINKER_BOILERPLATE
34163+# ----------------------
34164+# Check for linker boilerplate output or warnings with
34165+# the simple link test code.
34166+m4_defun([_LT_LINKER_BOILERPLATE],
34167+[m4_require([_LT_DECL_SED])dnl
34168+ac_outfile=conftest.$ac_objext
34169+echo "$lt_simple_link_test_code" >conftest.$ac_ext
34170+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
34171+_lt_linker_boilerplate=`cat conftest.err`
34172+$RM -r conftest*
34173+])# _LT_LINKER_BOILERPLATE
34174+
34175+# _LT_REQUIRED_DARWIN_CHECKS
34176+# -------------------------
34177+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
34178+ case $host_os in
34179+ rhapsody* | darwin*)
34180+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
34181+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
34182+ AC_CHECK_TOOL([LIPO], [lipo], [:])
34183+ AC_CHECK_TOOL([OTOOL], [otool], [:])
34184+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
34185+ _LT_DECL([], [DSYMUTIL], [1],
34186+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
34187+ _LT_DECL([], [NMEDIT], [1],
34188+ [Tool to change global to local symbols on Mac OS X])
34189+ _LT_DECL([], [LIPO], [1],
34190+ [Tool to manipulate fat objects and archives on Mac OS X])
34191+ _LT_DECL([], [OTOOL], [1],
34192+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
34193+ _LT_DECL([], [OTOOL64], [1],
34194+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
34195+
34196+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
34197+ [lt_cv_apple_cc_single_mod=no
34198+ if test -z "${LT_MULTI_MODULE}"; then
34199+ # By default we will add the -single_module flag. You can override
34200+ # by either setting the environment variable LT_MULTI_MODULE
34201+ # non-empty at configure time, or by adding -multi_module to the
34202+ # link flags.
34203+ rm -rf libconftest.dylib*
34204+ echo "int foo(void){return 1;}" > conftest.c
34205+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
34206+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
34207+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
34208+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
34209+ _lt_result=$?
34210+ # If there is a non-empty error log, and "single_module"
34211+ # appears in it, assume the flag caused a linker warning
34212+ if test -s conftest.err && $GREP single_module conftest.err; then
34213+ cat conftest.err >&AS_MESSAGE_LOG_FD
34214+ # Otherwise, if the output was created with a 0 exit code from
34215+ # the compiler, it worked.
34216+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
34217+ lt_cv_apple_cc_single_mod=yes
34218+ else
34219+ cat conftest.err >&AS_MESSAGE_LOG_FD
34220+ fi
34221+ rm -rf libconftest.dylib*
34222+ rm -f conftest.*
34223+ fi])
34224+
34225+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
34226+ [lt_cv_ld_exported_symbols_list],
34227+ [lt_cv_ld_exported_symbols_list=no
34228+ save_LDFLAGS=$LDFLAGS
34229+ echo "_main" > conftest.sym
34230+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
34231+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
34232+ [lt_cv_ld_exported_symbols_list=yes],
34233+ [lt_cv_ld_exported_symbols_list=no])
34234+ LDFLAGS="$save_LDFLAGS"
34235+ ])
34236+
34237+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
34238+ [lt_cv_ld_force_load=no
34239+ cat > conftest.c << _LT_EOF
34240+int forced_loaded() { return 2;}
34241+_LT_EOF
34242+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
34243+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
34244+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
34245+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
34246+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
34247+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
34248+ cat > conftest.c << _LT_EOF
34249+int main() { return 0;}
34250+_LT_EOF
34251+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
34252+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
34253+ _lt_result=$?
34254+ if test -s conftest.err && $GREP force_load conftest.err; then
34255+ cat conftest.err >&AS_MESSAGE_LOG_FD
34256+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
34257+ lt_cv_ld_force_load=yes
34258+ else
34259+ cat conftest.err >&AS_MESSAGE_LOG_FD
34260+ fi
34261+ rm -f conftest.err libconftest.a conftest conftest.c
34262+ rm -rf conftest.dSYM
34263+ ])
34264+ case $host_os in
34265+ rhapsody* | darwin1.[[012]])
34266+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
34267+ darwin1.*)
34268+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
34269+ darwin*) # darwin 5.x on
34270+ # if running on 10.5 or later, the deployment target defaults
34271+ # to the OS version, if on x86, and 10.4, the deployment
34272+ # target defaults to 10.4. Don't you love it?
34273+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
34274+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
34275+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
34276+ 10.[[012]]*)
34277+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
34278+ 10.*)
34279+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
34280+ esac
34281+ ;;
34282+ esac
34283+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
34284+ _lt_dar_single_mod='$single_module'
34285+ fi
34286+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
34287+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
34288+ else
34289+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
34290+ fi
34291+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
34292+ _lt_dsymutil='~$DSYMUTIL $lib || :'
34293+ else
34294+ _lt_dsymutil=
34295+ fi
34296+ ;;
34297+ esac
34298+])
34299+
34300+
34301+# _LT_DARWIN_LINKER_FEATURES([TAG])
34302+# ---------------------------------
34303+# Checks for linker and compiler features on darwin
34304+m4_defun([_LT_DARWIN_LINKER_FEATURES],
34305+[
34306+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
34307+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
34308+ _LT_TAGVAR(hardcode_direct, $1)=no
34309+ _LT_TAGVAR(hardcode_automatic, $1)=yes
34310+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
34311+ if test "$lt_cv_ld_force_load" = "yes"; then
34312+ _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\"`'
34313+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
34314+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
34315+ else
34316+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
34317+ fi
34318+ _LT_TAGVAR(link_all_deplibs, $1)=yes
34319+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
34320+ case $cc_basename in
34321+ ifort*) _lt_dar_can_shared=yes ;;
34322+ *) _lt_dar_can_shared=$GCC ;;
34323+ esac
34324+ if test "$_lt_dar_can_shared" = "yes"; then
34325+ output_verbose_link_cmd=func_echo_all
34326+ _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}"
34327+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
34328+ _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}"
34329+ _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}"
34330+ m4_if([$1], [CXX],
34331+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
34332+ _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}"
34333+ _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}"
34334+ fi
34335+],[])
34336+ else
34337+ _LT_TAGVAR(ld_shlibs, $1)=no
34338+ fi
34339+])
34340+
34341+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
34342+# ----------------------------------
34343+# Links a minimal program and checks the executable
34344+# for the system default hardcoded library path. In most cases,
34345+# this is /usr/lib:/lib, but when the MPI compilers are used
34346+# the location of the communication and MPI libs are included too.
34347+# If we don't find anything, use the default library path according
34348+# to the aix ld manual.
34349+# Store the results from the different compilers for each TAGNAME.
34350+# Allow to override them for all tags through lt_cv_aix_libpath.
34351+m4_defun([_LT_SYS_MODULE_PATH_AIX],
34352+[m4_require([_LT_DECL_SED])dnl
34353+if test "${lt_cv_aix_libpath+set}" = set; then
34354+ aix_libpath=$lt_cv_aix_libpath
34355+else
34356+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
34357+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
34358+ lt_aix_libpath_sed='[
34359+ /Import File Strings/,/^$/ {
34360+ /^0/ {
34361+ s/^0 *\([^ ]*\) *$/\1/
34362+ p
34363+ }
34364+ }]'
34365+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
34366+ # Check for a 64-bit object if we didn't find anything.
34367+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
34368+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
34369+ fi],[])
34370+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
34371+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
34372+ fi
34373+ ])
34374+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
34375+fi
34376+])# _LT_SYS_MODULE_PATH_AIX
34377+
34378+
34379+# _LT_SHELL_INIT(ARG)
34380+# -------------------
34381+m4_define([_LT_SHELL_INIT],
34382+[m4_divert_text([M4SH-INIT], [$1
34383+])])# _LT_SHELL_INIT
34384+
34385+
34386+
34387+# _LT_PROG_ECHO_BACKSLASH
34388+# -----------------------
34389+# Find how we can fake an echo command that does not interpret backslash.
34390+# In particular, with Autoconf 2.60 or later we add some code to the start
34391+# of the generated configure script which will find a shell with a builtin
34392+# printf (which we can use as an echo command).
34393+m4_defun([_LT_PROG_ECHO_BACKSLASH],
34394+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
34395+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
34396+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
34397+
34398+AC_MSG_CHECKING([how to print strings])
34399+# Test print first, because it will be a builtin if present.
34400+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
34401+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
34402+ ECHO='print -r --'
34403+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
34404+ ECHO='printf %s\n'
34405+else
34406+ # Use this function as a fallback that always works.
34407+ func_fallback_echo ()
34408+ {
34409+ eval 'cat <<_LTECHO_EOF
34410+$[]1
34411+_LTECHO_EOF'
34412+ }
34413+ ECHO='func_fallback_echo'
34414+fi
34415+
34416+# func_echo_all arg...
34417+# Invoke $ECHO with all args, space-separated.
34418+func_echo_all ()
34419+{
34420+ $ECHO "$*"
34421+}
34422+
34423+case "$ECHO" in
34424+ printf*) AC_MSG_RESULT([printf]) ;;
34425+ print*) AC_MSG_RESULT([print -r]) ;;
34426+ *) AC_MSG_RESULT([cat]) ;;
34427+esac
34428+
34429+m4_ifdef([_AS_DETECT_SUGGESTED],
34430+[_AS_DETECT_SUGGESTED([
34431+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
34432+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
34433+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
34434+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
34435+ PATH=/empty FPATH=/empty; export PATH FPATH
34436+ test "X`printf %s $ECHO`" = "X$ECHO" \
34437+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
34438+
34439+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
34440+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
34441+])# _LT_PROG_ECHO_BACKSLASH
34442+
34443+
34444+# _LT_WITH_SYSROOT
34445+# ----------------
34446+AC_DEFUN([_LT_WITH_SYSROOT],
34447+[AC_MSG_CHECKING([for sysroot])
34448+AC_ARG_WITH([sysroot],
34449+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
34450+ (or the compiler's sysroot if not specified).],
34451+[], [with_sysroot=no])
34452+
34453+dnl lt_sysroot will always be passed unquoted. We quote it here
34454+dnl in case the user passed a directory name.
34455+lt_sysroot=
34456+case ${with_sysroot} in #(
34457+ yes)
34458+ if test "$GCC" = yes; then
34459+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
34460+ fi
34461+ ;; #(
34462+ /*)
34463+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
34464+ ;; #(
34465+ no|'')
34466+ ;; #(
34467+ *)
34468+ AC_MSG_RESULT([${with_sysroot}])
34469+ AC_MSG_ERROR([The sysroot must be an absolute path.])
34470+ ;;
34471+esac
34472+
34473+ AC_MSG_RESULT([${lt_sysroot:-no}])
34474+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
34475+[dependent libraries, and in which our libraries should be installed.])])
34476+
34477+# _LT_ENABLE_LOCK
34478+# ---------------
34479+m4_defun([_LT_ENABLE_LOCK],
34480+[AC_ARG_ENABLE([libtool-lock],
34481+ [AS_HELP_STRING([--disable-libtool-lock],
34482+ [avoid locking (might break parallel builds)])])
34483+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
34484+
34485+# Some flags need to be propagated to the compiler or linker for good
34486+# libtool support.
34487+case $host in
34488+ia64-*-hpux*)
34489+ # Find out which ABI we are using.
34490+ echo 'int i;' > conftest.$ac_ext
34491+ if AC_TRY_EVAL(ac_compile); then
34492+ case `/usr/bin/file conftest.$ac_objext` in
34493+ *ELF-32*)
34494+ HPUX_IA64_MODE="32"
34495+ ;;
34496+ *ELF-64*)
34497+ HPUX_IA64_MODE="64"
34498+ ;;
34499+ esac
34500+ fi
34501+ rm -rf conftest*
34502+ ;;
34503+*-*-irix6*)
34504+ # Find out which ABI we are using.
34505+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
34506+ if AC_TRY_EVAL(ac_compile); then
34507+ if test "$lt_cv_prog_gnu_ld" = yes; then
34508+ case `/usr/bin/file conftest.$ac_objext` in
34509+ *32-bit*)
34510+ LD="${LD-ld} -melf32bsmip"
34511+ ;;
34512+ *N32*)
34513+ LD="${LD-ld} -melf32bmipn32"
34514+ ;;
34515+ *64-bit*)
34516+ LD="${LD-ld} -melf64bmip"
34517+ ;;
34518+ esac
34519+ else
34520+ case `/usr/bin/file conftest.$ac_objext` in
34521+ *32-bit*)
34522+ LD="${LD-ld} -32"
34523+ ;;
34524+ *N32*)
34525+ LD="${LD-ld} -n32"
34526+ ;;
34527+ *64-bit*)
34528+ LD="${LD-ld} -64"
34529+ ;;
34530+ esac
34531+ fi
34532+ fi
34533+ rm -rf conftest*
34534+ ;;
34535+
34536+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
34537+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
34538+ # Find out which ABI we are using.
34539+ echo 'int i;' > conftest.$ac_ext
34540+ if AC_TRY_EVAL(ac_compile); then
34541+ case `/usr/bin/file conftest.o` in
34542+ *32-bit*)
34543+ case $host in
34544+ x86_64-*kfreebsd*-gnu)
34545+ LD="${LD-ld} -m elf_i386_fbsd"
34546+ ;;
34547+ x86_64-*linux*)
34548+ LD="${LD-ld} -m elf_i386"
34549+ ;;
34550+ ppc64-*linux*|powerpc64-*linux*)
34551+ LD="${LD-ld} -m elf32ppclinux"
34552+ ;;
34553+ s390x-*linux*)
34554+ LD="${LD-ld} -m elf_s390"
34555+ ;;
34556+ sparc64-*linux*)
34557+ LD="${LD-ld} -m elf32_sparc"
34558+ ;;
34559+ esac
34560+ ;;
34561+ *64-bit*)
34562+ case $host in
34563+ x86_64-*kfreebsd*-gnu)
34564+ LD="${LD-ld} -m elf_x86_64_fbsd"
34565+ ;;
34566+ x86_64-*linux*)
34567+ LD="${LD-ld} -m elf_x86_64"
34568+ ;;
34569+ ppc*-*linux*|powerpc*-*linux*)
34570+ LD="${LD-ld} -m elf64ppc"
34571+ ;;
34572+ s390*-*linux*|s390*-*tpf*)
34573+ LD="${LD-ld} -m elf64_s390"
34574+ ;;
34575+ sparc*-*linux*)
34576+ LD="${LD-ld} -m elf64_sparc"
34577+ ;;
34578+ esac
34579+ ;;
34580+ esac
34581+ fi
34582+ rm -rf conftest*
34583+ ;;
34584+
34585+*-*-sco3.2v5*)
34586+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
34587+ SAVE_CFLAGS="$CFLAGS"
34588+ CFLAGS="$CFLAGS -belf"
34589+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
34590+ [AC_LANG_PUSH(C)
34591+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
34592+ AC_LANG_POP])
34593+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
34594+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
34595+ CFLAGS="$SAVE_CFLAGS"
34596+ fi
34597+ ;;
34598+*-*solaris*)
34599+ # Find out which ABI we are using.
34600+ echo 'int i;' > conftest.$ac_ext
34601+ if AC_TRY_EVAL(ac_compile); then
34602+ case `/usr/bin/file conftest.o` in
34603+ *64-bit*)
34604+ case $lt_cv_prog_gnu_ld in
34605+ yes*)
34606+ case $host in
34607+ i?86-*-solaris*)
34608+ LD="${LD-ld} -m elf_x86_64"
34609+ ;;
34610+ sparc*-*-solaris*)
34611+ LD="${LD-ld} -m elf64_sparc"
34612+ ;;
34613+ esac
34614+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
34615+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
34616+ LD="${LD-ld}_sol2"
34617+ fi
34618+ ;;
34619+ *)
34620+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
34621+ LD="${LD-ld} -64"
34622+ fi
34623+ ;;
34624+ esac
34625+ ;;
34626+ esac
34627+ fi
34628+ rm -rf conftest*
34629+ ;;
34630+esac
34631+
34632+need_locks="$enable_libtool_lock"
34633+])# _LT_ENABLE_LOCK
34634+
34635+
34636+# _LT_PROG_AR
34637+# -----------
34638+m4_defun([_LT_PROG_AR],
34639+[AC_CHECK_TOOLS(AR, [ar], false)
34640+: ${AR=ar}
34641+: ${AR_FLAGS=cru}
34642+_LT_DECL([], [AR], [1], [The archiver])
34643+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
34644+
34645+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
34646+ [lt_cv_ar_at_file=no
34647+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
34648+ [echo conftest.$ac_objext > conftest.lst
34649+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
34650+ AC_TRY_EVAL([lt_ar_try])
34651+ if test "$ac_status" -eq 0; then
34652+ # Ensure the archiver fails upon bogus file names.
34653+ rm -f conftest.$ac_objext libconftest.a
34654+ AC_TRY_EVAL([lt_ar_try])
34655+ if test "$ac_status" -ne 0; then
34656+ lt_cv_ar_at_file=@
34657+ fi
34658+ fi
34659+ rm -f conftest.* libconftest.a
34660+ ])
34661+ ])
34662+
34663+if test "x$lt_cv_ar_at_file" = xno; then
34664+ archiver_list_spec=
34665+else
34666+ archiver_list_spec=$lt_cv_ar_at_file
34667+fi
34668+_LT_DECL([], [archiver_list_spec], [1],
34669+ [How to feed a file listing to the archiver])
34670+])# _LT_PROG_AR
34671+
34672+
34673+# _LT_CMD_OLD_ARCHIVE
34674+# -------------------
34675+m4_defun([_LT_CMD_OLD_ARCHIVE],
34676+[_LT_PROG_AR
34677+
34678+AC_CHECK_TOOL(STRIP, strip, :)
34679+test -z "$STRIP" && STRIP=:
34680+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
34681+
34682+AC_CHECK_TOOL(RANLIB, ranlib, :)
34683+test -z "$RANLIB" && RANLIB=:
34684+_LT_DECL([], [RANLIB], [1],
34685+ [Commands used to install an old-style archive])
34686+
34687+# Determine commands to create old-style static archives.
34688+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
34689+old_postinstall_cmds='chmod 644 $oldlib'
34690+old_postuninstall_cmds=
34691+
34692+if test -n "$RANLIB"; then
34693+ case $host_os in
34694+ openbsd*)
34695+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
34696+ ;;
34697+ *)
34698+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
34699+ ;;
34700+ esac
34701+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
34702+fi
34703+
34704+case $host_os in
34705+ darwin*)
34706+ lock_old_archive_extraction=yes ;;
34707+ *)
34708+ lock_old_archive_extraction=no ;;
34709+esac
34710+_LT_DECL([], [old_postinstall_cmds], [2])
34711+_LT_DECL([], [old_postuninstall_cmds], [2])
34712+_LT_TAGDECL([], [old_archive_cmds], [2],
34713+ [Commands used to build an old-style archive])
34714+_LT_DECL([], [lock_old_archive_extraction], [0],
34715+ [Whether to use a lock for old archive extraction])
34716+])# _LT_CMD_OLD_ARCHIVE
34717+
34718+
34719+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
34720+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
34721+# ----------------------------------------------------------------
34722+# Check whether the given compiler option works
34723+AC_DEFUN([_LT_COMPILER_OPTION],
34724+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
34725+m4_require([_LT_DECL_SED])dnl
34726+AC_CACHE_CHECK([$1], [$2],
34727+ [$2=no
34728+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
34729+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
34730+ lt_compiler_flag="$3"
34731+ # Insert the option either (1) after the last *FLAGS variable, or
34732+ # (2) before a word containing "conftest.", or (3) at the end.
34733+ # Note that $ac_compile itself does not contain backslashes and begins
34734+ # with a dollar sign (not a hyphen), so the echo should work correctly.
34735+ # The option is referenced via a variable to avoid confusing sed.
34736+ lt_compile=`echo "$ac_compile" | $SED \
34737+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
34738+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
34739+ -e 's:$: $lt_compiler_flag:'`
34740+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
34741+ (eval "$lt_compile" 2>conftest.err)
34742+ ac_status=$?
34743+ cat conftest.err >&AS_MESSAGE_LOG_FD
34744+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
34745+ if (exit $ac_status) && test -s "$ac_outfile"; then
34746+ # The compiler can only warn and ignore the option if not recognized
34747+ # So say no if there are warnings other than the usual output.
34748+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
34749+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
34750+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
34751+ $2=yes
34752+ fi
34753+ fi
34754+ $RM conftest*
34755+])
34756+
34757+if test x"[$]$2" = xyes; then
34758+ m4_if([$5], , :, [$5])
34759+else
34760+ m4_if([$6], , :, [$6])
34761+fi
34762+])# _LT_COMPILER_OPTION
34763+
34764+# Old name:
34765+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
34766+dnl aclocal-1.4 backwards compatibility:
34767+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
34768+
34769+
34770+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
34771+# [ACTION-SUCCESS], [ACTION-FAILURE])
34772+# ----------------------------------------------------
34773+# Check whether the given linker option works
34774+AC_DEFUN([_LT_LINKER_OPTION],
34775+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
34776+m4_require([_LT_DECL_SED])dnl
34777+AC_CACHE_CHECK([$1], [$2],
34778+ [$2=no
34779+ save_LDFLAGS="$LDFLAGS"
34780+ LDFLAGS="$LDFLAGS $3"
34781+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
34782+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
34783+ # The linker can only warn and ignore the option if not recognized
34784+ # So say no if there are warnings
34785+ if test -s conftest.err; then
34786+ # Append any errors to the config.log.
34787+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
34788+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
34789+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
34790+ if diff conftest.exp conftest.er2 >/dev/null; then
34791+ $2=yes
34792+ fi
34793+ else
34794+ $2=yes
34795+ fi
34796+ fi
34797+ $RM -r conftest*
34798+ LDFLAGS="$save_LDFLAGS"
34799+])
34800+
34801+if test x"[$]$2" = xyes; then
34802+ m4_if([$4], , :, [$4])
34803+else
34804+ m4_if([$5], , :, [$5])
34805+fi
34806+])# _LT_LINKER_OPTION
34807+
34808+# Old name:
34809+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
34810+dnl aclocal-1.4 backwards compatibility:
34811+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
34812+
34813+
34814+# LT_CMD_MAX_LEN
34815+#---------------
34816+AC_DEFUN([LT_CMD_MAX_LEN],
34817+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
34818+# find the maximum length of command line arguments
34819+AC_MSG_CHECKING([the maximum length of command line arguments])
34820+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
34821+ i=0
34822+ teststring="ABCD"
34823+
34824+ case $build_os in
34825+ msdosdjgpp*)
34826+ # On DJGPP, this test can blow up pretty badly due to problems in libc
34827+ # (any single argument exceeding 2000 bytes causes a buffer overrun
34828+ # during glob expansion). Even if it were fixed, the result of this
34829+ # check would be larger than it should be.
34830+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
34831+ ;;
34832+
34833+ gnu*)
34834+ # Under GNU Hurd, this test is not required because there is
34835+ # no limit to the length of command line arguments.
34836+ # Libtool will interpret -1 as no limit whatsoever
34837+ lt_cv_sys_max_cmd_len=-1;
34838+ ;;
34839+
34840+ cygwin* | mingw* | cegcc*)
34841+ # On Win9x/ME, this test blows up -- it succeeds, but takes
34842+ # about 5 minutes as the teststring grows exponentially.
34843+ # Worse, since 9x/ME are not pre-emptively multitasking,
34844+ # you end up with a "frozen" computer, even though with patience
34845+ # the test eventually succeeds (with a max line length of 256k).
34846+ # Instead, let's just punt: use the minimum linelength reported by
34847+ # all of the supported platforms: 8192 (on NT/2K/XP).
34848+ lt_cv_sys_max_cmd_len=8192;
34849+ ;;
34850+
34851+ mint*)
34852+ # On MiNT this can take a long time and run out of memory.
34853+ lt_cv_sys_max_cmd_len=8192;
34854+ ;;
34855+
34856+ amigaos*)
34857+ # On AmigaOS with pdksh, this test takes hours, literally.
34858+ # So we just punt and use a minimum line length of 8192.
34859+ lt_cv_sys_max_cmd_len=8192;
34860+ ;;
34861+
34862+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
34863+ # This has been around since 386BSD, at least. Likely further.
34864+ if test -x /sbin/sysctl; then
34865+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
34866+ elif test -x /usr/sbin/sysctl; then
34867+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
34868+ else
34869+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
34870+ fi
34871+ # And add a safety zone
34872+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
34873+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
34874+ ;;
34875+
34876+ interix*)
34877+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
34878+ lt_cv_sys_max_cmd_len=196608
34879+ ;;
34880+
34881+ os2*)
34882+ # The test takes a long time on OS/2.
34883+ lt_cv_sys_max_cmd_len=8192
34884+ ;;
34885+
34886+ osf*)
34887+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
34888+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
34889+ # nice to cause kernel panics so lets avoid the loop below.
34890+ # First set a reasonable default.
34891+ lt_cv_sys_max_cmd_len=16384
34892+ #
34893+ if test -x /sbin/sysconfig; then
34894+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
34895+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
34896+ esac
34897+ fi
34898+ ;;
34899+ sco3.2v5*)
34900+ lt_cv_sys_max_cmd_len=102400
34901+ ;;
34902+ sysv5* | sco5v6* | sysv4.2uw2*)
34903+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
34904+ if test -n "$kargmax"; then
34905+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
34906+ else
34907+ lt_cv_sys_max_cmd_len=32768
34908+ fi
34909+ ;;
34910+ *)
34911+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
34912+ if test -n "$lt_cv_sys_max_cmd_len"; then
34913+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
34914+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
34915+ else
34916+ # Make teststring a little bigger before we do anything with it.
34917+ # a 1K string should be a reasonable start.
34918+ for i in 1 2 3 4 5 6 7 8 ; do
34919+ teststring=$teststring$teststring
34920+ done
34921+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
34922+ # If test is not a shell built-in, we'll probably end up computing a
34923+ # maximum length that is only half of the actual maximum length, but
34924+ # we can't tell.
34925+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
34926+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
34927+ test $i != 17 # 1/2 MB should be enough
34928+ do
34929+ i=`expr $i + 1`
34930+ teststring=$teststring$teststring
34931+ done
34932+ # Only check the string length outside the loop.
34933+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
34934+ teststring=
34935+ # Add a significant safety factor because C++ compilers can tack on
34936+ # massive amounts of additional arguments before passing them to the
34937+ # linker. It appears as though 1/2 is a usable value.
34938+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
34939+ fi
34940+ ;;
34941+ esac
34942+])
34943+if test -n $lt_cv_sys_max_cmd_len ; then
34944+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
34945+else
34946+ AC_MSG_RESULT(none)
34947+fi
34948+max_cmd_len=$lt_cv_sys_max_cmd_len
34949+_LT_DECL([], [max_cmd_len], [0],
34950+ [What is the maximum length of a command?])
34951+])# LT_CMD_MAX_LEN
34952+
34953+# Old name:
34954+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
34955+dnl aclocal-1.4 backwards compatibility:
34956+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
34957+
34958+
34959+# _LT_HEADER_DLFCN
34960+# ----------------
34961+m4_defun([_LT_HEADER_DLFCN],
34962+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
34963+])# _LT_HEADER_DLFCN
34964+
34965+
34966+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
34967+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
34968+# ----------------------------------------------------------------
34969+m4_defun([_LT_TRY_DLOPEN_SELF],
34970+[m4_require([_LT_HEADER_DLFCN])dnl
34971+if test "$cross_compiling" = yes; then :
34972+ [$4]
34973+else
34974+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
34975+ lt_status=$lt_dlunknown
34976+ cat > conftest.$ac_ext <<_LT_EOF
34977+[#line $LINENO "configure"
34978+#include "confdefs.h"
34979+
34980+#if HAVE_DLFCN_H
34981+#include <dlfcn.h>
34982+#endif
34983+
34984+#include <stdio.h>
34985+
34986+#ifdef RTLD_GLOBAL
34987+# define LT_DLGLOBAL RTLD_GLOBAL
34988+#else
34989+# ifdef DL_GLOBAL
34990+# define LT_DLGLOBAL DL_GLOBAL
34991+# else
34992+# define LT_DLGLOBAL 0
34993+# endif
34994+#endif
34995+
34996+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
34997+ find out it does not work in some platform. */
34998+#ifndef LT_DLLAZY_OR_NOW
34999+# ifdef RTLD_LAZY
35000+# define LT_DLLAZY_OR_NOW RTLD_LAZY
35001+# else
35002+# ifdef DL_LAZY
35003+# define LT_DLLAZY_OR_NOW DL_LAZY
35004+# else
35005+# ifdef RTLD_NOW
35006+# define LT_DLLAZY_OR_NOW RTLD_NOW
35007+# else
35008+# ifdef DL_NOW
35009+# define LT_DLLAZY_OR_NOW DL_NOW
35010+# else
35011+# define LT_DLLAZY_OR_NOW 0
35012+# endif
35013+# endif
35014+# endif
35015+# endif
35016+#endif
35017+
35018+/* When -fvisbility=hidden is used, assume the code has been annotated
35019+ correspondingly for the symbols needed. */
35020+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
35021+int fnord () __attribute__((visibility("default")));
35022+#endif
35023+
35024+int fnord () { return 42; }
35025+int main ()
35026+{
35027+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
35028+ int status = $lt_dlunknown;
35029+
35030+ if (self)
35031+ {
35032+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
35033+ else
35034+ {
35035+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
35036+ else puts (dlerror ());
35037+ }
35038+ /* dlclose (self); */
35039+ }
35040+ else
35041+ puts (dlerror ());
35042+
35043+ return status;
35044+}]
35045+_LT_EOF
35046+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
35047+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
35048+ lt_status=$?
35049+ case x$lt_status in
35050+ x$lt_dlno_uscore) $1 ;;
35051+ x$lt_dlneed_uscore) $2 ;;
35052+ x$lt_dlunknown|x*) $3 ;;
35053+ esac
35054+ else :
35055+ # compilation failed
35056+ $3
35057+ fi
35058+fi
35059+rm -fr conftest*
35060+])# _LT_TRY_DLOPEN_SELF
35061+
35062+
35063+# LT_SYS_DLOPEN_SELF
35064+# ------------------
35065+AC_DEFUN([LT_SYS_DLOPEN_SELF],
35066+[m4_require([_LT_HEADER_DLFCN])dnl
35067+if test "x$enable_dlopen" != xyes; then
35068+ enable_dlopen=unknown
35069+ enable_dlopen_self=unknown
35070+ enable_dlopen_self_static=unknown
35071+else
35072+ lt_cv_dlopen=no
35073+ lt_cv_dlopen_libs=
35074+
35075+ case $host_os in
35076+ beos*)
35077+ lt_cv_dlopen="load_add_on"
35078+ lt_cv_dlopen_libs=
35079+ lt_cv_dlopen_self=yes
35080+ ;;
35081+
35082+ mingw* | pw32* | cegcc*)
35083+ lt_cv_dlopen="LoadLibrary"
35084+ lt_cv_dlopen_libs=
35085+ ;;
35086+
35087+ cygwin*)
35088+ lt_cv_dlopen="dlopen"
35089+ lt_cv_dlopen_libs=
35090+ ;;
35091+
35092+ darwin*)
35093+ # if libdl is installed we need to link against it
35094+ AC_CHECK_LIB([dl], [dlopen],
35095+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
35096+ lt_cv_dlopen="dyld"
35097+ lt_cv_dlopen_libs=
35098+ lt_cv_dlopen_self=yes
35099+ ])
35100+ ;;
35101+
35102+ *)
35103+ AC_CHECK_FUNC([shl_load],
35104+ [lt_cv_dlopen="shl_load"],
35105+ [AC_CHECK_LIB([dld], [shl_load],
35106+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
35107+ [AC_CHECK_FUNC([dlopen],
35108+ [lt_cv_dlopen="dlopen"],
35109+ [AC_CHECK_LIB([dl], [dlopen],
35110+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
35111+ [AC_CHECK_LIB([svld], [dlopen],
35112+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
35113+ [AC_CHECK_LIB([dld], [dld_link],
35114+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
35115+ ])
35116+ ])
35117+ ])
35118+ ])
35119+ ])
35120+ ;;
35121+ esac
35122+
35123+ if test "x$lt_cv_dlopen" != xno; then
35124+ enable_dlopen=yes
35125+ else
35126+ enable_dlopen=no
35127+ fi
35128+
35129+ case $lt_cv_dlopen in
35130+ dlopen)
35131+ save_CPPFLAGS="$CPPFLAGS"
35132+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
35133+
35134+ save_LDFLAGS="$LDFLAGS"
35135+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
35136+
35137+ save_LIBS="$LIBS"
35138+ LIBS="$lt_cv_dlopen_libs $LIBS"
35139+
35140+ AC_CACHE_CHECK([whether a program can dlopen itself],
35141+ lt_cv_dlopen_self, [dnl
35142+ _LT_TRY_DLOPEN_SELF(
35143+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
35144+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
35145+ ])
35146+
35147+ if test "x$lt_cv_dlopen_self" = xyes; then
35148+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
35149+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
35150+ lt_cv_dlopen_self_static, [dnl
35151+ _LT_TRY_DLOPEN_SELF(
35152+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
35153+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
35154+ ])
35155+ fi
35156+
35157+ CPPFLAGS="$save_CPPFLAGS"
35158+ LDFLAGS="$save_LDFLAGS"
35159+ LIBS="$save_LIBS"
35160+ ;;
35161+ esac
35162+
35163+ case $lt_cv_dlopen_self in
35164+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
35165+ *) enable_dlopen_self=unknown ;;
35166+ esac
35167+
35168+ case $lt_cv_dlopen_self_static in
35169+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
35170+ *) enable_dlopen_self_static=unknown ;;
35171+ esac
35172+fi
35173+_LT_DECL([dlopen_support], [enable_dlopen], [0],
35174+ [Whether dlopen is supported])
35175+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
35176+ [Whether dlopen of programs is supported])
35177+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
35178+ [Whether dlopen of statically linked programs is supported])
35179+])# LT_SYS_DLOPEN_SELF
35180+
35181+# Old name:
35182+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
35183+dnl aclocal-1.4 backwards compatibility:
35184+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
35185+
35186+
35187+# _LT_COMPILER_C_O([TAGNAME])
35188+# ---------------------------
35189+# Check to see if options -c and -o are simultaneously supported by compiler.
35190+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
35191+m4_defun([_LT_COMPILER_C_O],
35192+[m4_require([_LT_DECL_SED])dnl
35193+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
35194+m4_require([_LT_TAG_COMPILER])dnl
35195+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
35196+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
35197+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
35198+ $RM -r conftest 2>/dev/null
35199+ mkdir conftest
35200+ cd conftest
35201+ mkdir out
35202+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
35203+
35204+ lt_compiler_flag="-o out/conftest2.$ac_objext"
35205+ # Insert the option either (1) after the last *FLAGS variable, or
35206+ # (2) before a word containing "conftest.", or (3) at the end.
35207+ # Note that $ac_compile itself does not contain backslashes and begins
35208+ # with a dollar sign (not a hyphen), so the echo should work correctly.
35209+ lt_compile=`echo "$ac_compile" | $SED \
35210+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
35211+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
35212+ -e 's:$: $lt_compiler_flag:'`
35213+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
35214+ (eval "$lt_compile" 2>out/conftest.err)
35215+ ac_status=$?
35216+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
35217+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
35218+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
35219+ then
35220+ # The compiler can only warn and ignore the option if not recognized
35221+ # So say no if there are warnings
35222+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
35223+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
35224+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
35225+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
35226+ fi
35227+ fi
35228+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
35229+ $RM conftest*
35230+ # SGI C++ compiler will create directory out/ii_files/ for
35231+ # template instantiation
35232+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
35233+ $RM out/* && rmdir out
35234+ cd ..
35235+ $RM -r conftest
35236+ $RM conftest*
35237+])
35238+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
35239+ [Does compiler simultaneously support -c and -o options?])
35240+])# _LT_COMPILER_C_O
35241+
35242+
35243+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
35244+# ----------------------------------
35245+# Check to see if we can do hard links to lock some files if needed
35246+m4_defun([_LT_COMPILER_FILE_LOCKS],
35247+[m4_require([_LT_ENABLE_LOCK])dnl
35248+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
35249+_LT_COMPILER_C_O([$1])
35250+
35251+hard_links="nottested"
35252+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
35253+ # do not overwrite the value of need_locks provided by the user
35254+ AC_MSG_CHECKING([if we can lock with hard links])
35255+ hard_links=yes
35256+ $RM conftest*
35257+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
35258+ touch conftest.a
35259+ ln conftest.a conftest.b 2>&5 || hard_links=no
35260+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
35261+ AC_MSG_RESULT([$hard_links])
35262+ if test "$hard_links" = no; then
35263+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
35264+ need_locks=warn
35265+ fi
35266+else
35267+ need_locks=no
35268+fi
35269+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
35270+])# _LT_COMPILER_FILE_LOCKS
35271+
35272+
35273+# _LT_CHECK_OBJDIR
35274+# ----------------
35275+m4_defun([_LT_CHECK_OBJDIR],
35276+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
35277+[rm -f .libs 2>/dev/null
35278+mkdir .libs 2>/dev/null
35279+if test -d .libs; then
35280+ lt_cv_objdir=.libs
35281+else
35282+ # MS-DOS does not allow filenames that begin with a dot.
35283+ lt_cv_objdir=_libs
35284+fi
35285+rmdir .libs 2>/dev/null])
35286+objdir=$lt_cv_objdir
35287+_LT_DECL([], [objdir], [0],
35288+ [The name of the directory that contains temporary libtool files])dnl
35289+m4_pattern_allow([LT_OBJDIR])dnl
35290+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
35291+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
35292+])# _LT_CHECK_OBJDIR
35293+
35294+
35295+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
35296+# --------------------------------------
35297+# Check hardcoding attributes.
35298+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
35299+[AC_MSG_CHECKING([how to hardcode library paths into programs])
35300+_LT_TAGVAR(hardcode_action, $1)=
35301+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
35302+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
35303+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
35304+
35305+ # We can hardcode non-existent directories.
35306+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
35307+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
35308+ # have to relink, otherwise we might link with an installed library
35309+ # when we should be linking with a yet-to-be-installed one
35310+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
35311+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
35312+ # Linking always hardcodes the temporary library directory.
35313+ _LT_TAGVAR(hardcode_action, $1)=relink
35314+ else
35315+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
35316+ _LT_TAGVAR(hardcode_action, $1)=immediate
35317+ fi
35318+else
35319+ # We cannot hardcode anything, or else we can only hardcode existing
35320+ # directories.
35321+ _LT_TAGVAR(hardcode_action, $1)=unsupported
35322+fi
35323+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
35324+
35325+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
35326+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
35327+ # Fast installation is not supported
35328+ enable_fast_install=no
35329+elif test "$shlibpath_overrides_runpath" = yes ||
35330+ test "$enable_shared" = no; then
35331+ # Fast installation is not necessary
35332+ enable_fast_install=needless
35333+fi
35334+_LT_TAGDECL([], [hardcode_action], [0],
35335+ [How to hardcode a shared library path into an executable])
35336+])# _LT_LINKER_HARDCODE_LIBPATH
35337+
35338+
35339+# _LT_CMD_STRIPLIB
35340+# ----------------
35341+m4_defun([_LT_CMD_STRIPLIB],
35342+[m4_require([_LT_DECL_EGREP])
35343+striplib=
35344+old_striplib=
35345+AC_MSG_CHECKING([whether stripping libraries is possible])
35346+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
35347+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
35348+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
35349+ AC_MSG_RESULT([yes])
35350+else
35351+# FIXME - insert some real tests, host_os isn't really good enough
35352+ case $host_os in
35353+ darwin*)
35354+ if test -n "$STRIP" ; then
35355+ striplib="$STRIP -x"
35356+ old_striplib="$STRIP -S"
35357+ AC_MSG_RESULT([yes])
35358+ else
35359+ AC_MSG_RESULT([no])
35360+ fi
35361+ ;;
35362+ *)
35363+ AC_MSG_RESULT([no])
35364+ ;;
35365+ esac
35366+fi
35367+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
35368+_LT_DECL([], [striplib], [1])
35369+])# _LT_CMD_STRIPLIB
35370+
35371+
35372+# _LT_SYS_DYNAMIC_LINKER([TAG])
35373+# -----------------------------
35374+# PORTME Fill in your ld.so characteristics
35375+m4_defun([_LT_SYS_DYNAMIC_LINKER],
35376+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
35377+m4_require([_LT_DECL_EGREP])dnl
35378+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
35379+m4_require([_LT_DECL_OBJDUMP])dnl
35380+m4_require([_LT_DECL_SED])dnl
35381+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
35382+AC_MSG_CHECKING([dynamic linker characteristics])
35383+m4_if([$1],
35384+ [], [
35385+if test "$GCC" = yes; then
35386+ case $host_os in
35387+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
35388+ *) lt_awk_arg="/^libraries:/" ;;
35389+ esac
35390+ case $host_os in
35391+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
35392+ *) lt_sed_strip_eq="s,=/,/,g" ;;
35393+ esac
35394+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
35395+ case $lt_search_path_spec in
35396+ *\;*)
35397+ # if the path contains ";" then we assume it to be the separator
35398+ # otherwise default to the standard path separator (i.e. ":") - it is
35399+ # assumed that no part of a normal pathname contains ";" but that should
35400+ # okay in the real world where ";" in dirpaths is itself problematic.
35401+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
35402+ ;;
35403+ *)
35404+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
35405+ ;;
35406+ esac
35407+ # Ok, now we have the path, separated by spaces, we can step through it
35408+ # and add multilib dir if necessary.
35409+ lt_tmp_lt_search_path_spec=
35410+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
35411+ for lt_sys_path in $lt_search_path_spec; do
35412+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
35413+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
35414+ else
35415+ test -d "$lt_sys_path" && \
35416+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
35417+ fi
35418+ done
35419+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
35420+BEGIN {RS=" "; FS="/|\n";} {
35421+ lt_foo="";
35422+ lt_count=0;
35423+ for (lt_i = NF; lt_i > 0; lt_i--) {
35424+ if ($lt_i != "" && $lt_i != ".") {
35425+ if ($lt_i == "..") {
35426+ lt_count++;
35427+ } else {
35428+ if (lt_count == 0) {
35429+ lt_foo="/" $lt_i lt_foo;
35430+ } else {
35431+ lt_count--;
35432+ }
35433+ }
35434+ }
35435+ }
35436+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
35437+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
35438+}'`
35439+ # AWK program above erroneously prepends '/' to C:/dos/paths
35440+ # for these hosts.
35441+ case $host_os in
35442+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
35443+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
35444+ esac
35445+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
35446+else
35447+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
35448+fi])
35449+library_names_spec=
35450+libname_spec='lib$name'
35451+soname_spec=
35452+shrext_cmds=".so"
35453+postinstall_cmds=
35454+postuninstall_cmds=
35455+finish_cmds=
35456+finish_eval=
35457+shlibpath_var=
35458+shlibpath_overrides_runpath=unknown
35459+version_type=none
35460+dynamic_linker="$host_os ld.so"
35461+sys_lib_dlsearch_path_spec="/lib /usr/lib"
35462+need_lib_prefix=unknown
35463+hardcode_into_libs=no
35464+
35465+# when you set need_version to no, make sure it does not cause -set_version
35466+# flags to be left without arguments
35467+need_version=unknown
35468+
35469+case $host_os in
35470+aix3*)
35471+ version_type=linux # correct to gnu/linux during the next big refactor
35472+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
35473+ shlibpath_var=LIBPATH
35474+
35475+ # AIX 3 has no versioning support, so we append a major version to the name.
35476+ soname_spec='${libname}${release}${shared_ext}$major'
35477+ ;;
35478+
35479+aix[[4-9]]*)
35480+ version_type=linux # correct to gnu/linux during the next big refactor
35481+ need_lib_prefix=no
35482+ need_version=no
35483+ hardcode_into_libs=yes
35484+ if test "$host_cpu" = ia64; then
35485+ # AIX 5 supports IA64
35486+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
35487+ shlibpath_var=LD_LIBRARY_PATH
35488+ else
35489+ # With GCC up to 2.95.x, collect2 would create an import file
35490+ # for dependence libraries. The import file would start with
35491+ # the line `#! .'. This would cause the generated library to
35492+ # depend on `.', always an invalid library. This was fixed in
35493+ # development snapshots of GCC prior to 3.0.
35494+ case $host_os in
35495+ aix4 | aix4.[[01]] | aix4.[[01]].*)
35496+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
35497+ echo ' yes '
35498+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
35499+ :
35500+ else
35501+ can_build_shared=no
35502+ fi
35503+ ;;
35504+ esac
35505+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
35506+ # soname into executable. Probably we can add versioning support to
35507+ # collect2, so additional links can be useful in future.
35508+ if test "$aix_use_runtimelinking" = yes; then
35509+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
35510+ # instead of lib<name>.a to let people know that these are not
35511+ # typical AIX shared libraries.
35512+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35513+ else
35514+ # We preserve .a as extension for shared libraries through AIX4.2
35515+ # and later when we are not doing run time linking.
35516+ library_names_spec='${libname}${release}.a $libname.a'
35517+ soname_spec='${libname}${release}${shared_ext}$major'
35518+ fi
35519+ shlibpath_var=LIBPATH
35520+ fi
35521+ ;;
35522+
35523+amigaos*)
35524+ case $host_cpu in
35525+ powerpc)
35526+ # Since July 2007 AmigaOS4 officially supports .so libraries.
35527+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
35528+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35529+ ;;
35530+ m68k)
35531+ library_names_spec='$libname.ixlibrary $libname.a'
35532+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
35533+ 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'
35534+ ;;
35535+ esac
35536+ ;;
35537+
35538+beos*)
35539+ library_names_spec='${libname}${shared_ext}'
35540+ dynamic_linker="$host_os ld.so"
35541+ shlibpath_var=LIBRARY_PATH
35542+ ;;
35543+
35544+bsdi[[45]]*)
35545+ version_type=linux # correct to gnu/linux during the next big refactor
35546+ need_version=no
35547+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35548+ soname_spec='${libname}${release}${shared_ext}$major'
35549+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
35550+ shlibpath_var=LD_LIBRARY_PATH
35551+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
35552+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
35553+ # the default ld.so.conf also contains /usr/contrib/lib and
35554+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
35555+ # libtool to hard-code these into programs
35556+ ;;
35557+
35558+cygwin* | mingw* | pw32* | cegcc*)
35559+ version_type=windows
35560+ shrext_cmds=".dll"
35561+ need_version=no
35562+ need_lib_prefix=no
35563+
35564+ case $GCC,$cc_basename in
35565+ yes,*)
35566+ # gcc
35567+ library_names_spec='$libname.dll.a'
35568+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
35569+ postinstall_cmds='base_file=`basename \${file}`~
35570+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
35571+ dldir=$destdir/`dirname \$dlpath`~
35572+ test -d \$dldir || mkdir -p \$dldir~
35573+ $install_prog $dir/$dlname \$dldir/$dlname~
35574+ chmod a+x \$dldir/$dlname~
35575+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
35576+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
35577+ fi'
35578+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
35579+ dlpath=$dir/\$dldll~
35580+ $RM \$dlpath'
35581+ shlibpath_overrides_runpath=yes
35582+
35583+ case $host_os in
35584+ cygwin*)
35585+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
35586+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35587+m4_if([$1], [],[
35588+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
35589+ ;;
35590+ mingw* | cegcc*)
35591+ # MinGW DLLs use traditional 'lib' prefix
35592+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35593+ ;;
35594+ pw32*)
35595+ # pw32 DLLs use 'pw' prefix rather than 'lib'
35596+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35597+ ;;
35598+ esac
35599+ dynamic_linker='Win32 ld.exe'
35600+ ;;
35601+
35602+ *,cl*)
35603+ # Native MSVC
35604+ libname_spec='$name'
35605+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35606+ library_names_spec='${libname}.dll.lib'
35607+
35608+ case $build_os in
35609+ mingw*)
35610+ sys_lib_search_path_spec=
35611+ lt_save_ifs=$IFS
35612+ IFS=';'
35613+ for lt_path in $LIB
35614+ do
35615+ IFS=$lt_save_ifs
35616+ # Let DOS variable expansion print the short 8.3 style file name.
35617+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
35618+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
35619+ done
35620+ IFS=$lt_save_ifs
35621+ # Convert to MSYS style.
35622+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
35623+ ;;
35624+ cygwin*)
35625+ # Convert to unix form, then to dos form, then back to unix form
35626+ # but this time dos style (no spaces!) so that the unix form looks
35627+ # like /cygdrive/c/PROGRA~1:/cygdr...
35628+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
35629+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
35630+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
35631+ ;;
35632+ *)
35633+ sys_lib_search_path_spec="$LIB"
35634+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
35635+ # It is most probably a Windows format PATH.
35636+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
35637+ else
35638+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
35639+ fi
35640+ # FIXME: find the short name or the path components, as spaces are
35641+ # common. (e.g. "Program Files" -> "PROGRA~1")
35642+ ;;
35643+ esac
35644+
35645+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
35646+ postinstall_cmds='base_file=`basename \${file}`~
35647+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
35648+ dldir=$destdir/`dirname \$dlpath`~
35649+ test -d \$dldir || mkdir -p \$dldir~
35650+ $install_prog $dir/$dlname \$dldir/$dlname'
35651+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
35652+ dlpath=$dir/\$dldll~
35653+ $RM \$dlpath'
35654+ shlibpath_overrides_runpath=yes
35655+ dynamic_linker='Win32 link.exe'
35656+ ;;
35657+
35658+ *)
35659+ # Assume MSVC wrapper
35660+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
35661+ dynamic_linker='Win32 ld.exe'
35662+ ;;
35663+ esac
35664+ # FIXME: first we should search . and the directory the executable is in
35665+ shlibpath_var=PATH
35666+ ;;
35667+
35668+darwin* | rhapsody*)
35669+ dynamic_linker="$host_os dyld"
35670+ version_type=darwin
35671+ need_lib_prefix=no
35672+ need_version=no
35673+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
35674+ soname_spec='${libname}${release}${major}$shared_ext'
35675+ shlibpath_overrides_runpath=yes
35676+ shlibpath_var=DYLD_LIBRARY_PATH
35677+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
35678+m4_if([$1], [],[
35679+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
35680+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
35681+ ;;
35682+
35683+dgux*)
35684+ version_type=linux # correct to gnu/linux during the next big refactor
35685+ need_lib_prefix=no
35686+ need_version=no
35687+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
35688+ soname_spec='${libname}${release}${shared_ext}$major'
35689+ shlibpath_var=LD_LIBRARY_PATH
35690+ ;;
35691+
35692+freebsd* | dragonfly*)
35693+ # DragonFly does not have aout. When/if they implement a new
35694+ # versioning mechanism, adjust this.
35695+ if test -x /usr/bin/objformat; then
35696+ objformat=`/usr/bin/objformat`
35697+ else
35698+ case $host_os in
35699+ freebsd[[23]].*) objformat=aout ;;
35700+ *) objformat=elf ;;
35701+ esac
35702+ fi
35703+ version_type=freebsd-$objformat
35704+ case $version_type in
35705+ freebsd-elf*)
35706+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
35707+ need_version=no
35708+ need_lib_prefix=no
35709+ ;;
35710+ freebsd-*)
35711+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
35712+ need_version=yes
35713+ ;;
35714+ esac
35715+ shlibpath_var=LD_LIBRARY_PATH
35716+ case $host_os in
35717+ freebsd2.*)
35718+ shlibpath_overrides_runpath=yes
35719+ ;;
35720+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
35721+ shlibpath_overrides_runpath=yes
35722+ hardcode_into_libs=yes
35723+ ;;
35724+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
35725+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
35726+ shlibpath_overrides_runpath=no
35727+ hardcode_into_libs=yes
35728+ ;;
35729+ *) # from 4.6 on, and DragonFly
35730+ shlibpath_overrides_runpath=yes
35731+ hardcode_into_libs=yes
35732+ ;;
35733+ esac
35734+ ;;
35735+
35736+gnu*)
35737+ version_type=linux # correct to gnu/linux during the next big refactor
35738+ need_lib_prefix=no
35739+ need_version=no
35740+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
35741+ soname_spec='${libname}${release}${shared_ext}$major'
35742+ shlibpath_var=LD_LIBRARY_PATH
35743+ shlibpath_overrides_runpath=no
35744+ hardcode_into_libs=yes
35745+ ;;
35746+
35747+haiku*)
35748+ version_type=linux # correct to gnu/linux during the next big refactor
35749+ need_lib_prefix=no
35750+ need_version=no
35751+ dynamic_linker="$host_os runtime_loader"
35752+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
35753+ soname_spec='${libname}${release}${shared_ext}$major'
35754+ shlibpath_var=LIBRARY_PATH
35755+ shlibpath_overrides_runpath=yes
35756+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
35757+ hardcode_into_libs=yes
35758+ ;;
35759+
35760+hpux9* | hpux10* | hpux11*)
35761+ # Give a soname corresponding to the major version so that dld.sl refuses to
35762+ # link against other versions.
35763+ version_type=sunos
35764+ need_lib_prefix=no
35765+ need_version=no
35766+ case $host_cpu in
35767+ ia64*)
35768+ shrext_cmds='.so'
35769+ hardcode_into_libs=yes
35770+ dynamic_linker="$host_os dld.so"
35771+ shlibpath_var=LD_LIBRARY_PATH
35772+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
35773+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35774+ soname_spec='${libname}${release}${shared_ext}$major'
35775+ if test "X$HPUX_IA64_MODE" = X32; then
35776+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
35777+ else
35778+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
35779+ fi
35780+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
35781+ ;;
35782+ hppa*64*)
35783+ shrext_cmds='.sl'
35784+ hardcode_into_libs=yes
35785+ dynamic_linker="$host_os dld.sl"
35786+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
35787+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
35788+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35789+ soname_spec='${libname}${release}${shared_ext}$major'
35790+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
35791+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
35792+ ;;
35793+ *)
35794+ shrext_cmds='.sl'
35795+ dynamic_linker="$host_os dld.sl"
35796+ shlibpath_var=SHLIB_PATH
35797+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
35798+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35799+ soname_spec='${libname}${release}${shared_ext}$major'
35800+ ;;
35801+ esac
35802+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
35803+ postinstall_cmds='chmod 555 $lib'
35804+ # or fails outright, so override atomically:
35805+ install_override_mode=555
35806+ ;;
35807+
35808+interix[[3-9]]*)
35809+ version_type=linux # correct to gnu/linux during the next big refactor
35810+ need_lib_prefix=no
35811+ need_version=no
35812+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
35813+ soname_spec='${libname}${release}${shared_ext}$major'
35814+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
35815+ shlibpath_var=LD_LIBRARY_PATH
35816+ shlibpath_overrides_runpath=no
35817+ hardcode_into_libs=yes
35818+ ;;
35819+
35820+irix5* | irix6* | nonstopux*)
35821+ case $host_os in
35822+ nonstopux*) version_type=nonstopux ;;
35823+ *)
35824+ if test "$lt_cv_prog_gnu_ld" = yes; then
35825+ version_type=linux # correct to gnu/linux during the next big refactor
35826+ else
35827+ version_type=irix
35828+ fi ;;
35829+ esac
35830+ need_lib_prefix=no
35831+ need_version=no
35832+ soname_spec='${libname}${release}${shared_ext}$major'
35833+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
35834+ case $host_os in
35835+ irix5* | nonstopux*)
35836+ libsuff= shlibsuff=
35837+ ;;
35838+ *)
35839+ case $LD in # libtool.m4 will add one of these switches to LD
35840+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
35841+ libsuff= shlibsuff= libmagic=32-bit;;
35842+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
35843+ libsuff=32 shlibsuff=N32 libmagic=N32;;
35844+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
35845+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
35846+ *) libsuff= shlibsuff= libmagic=never-match;;
35847+ esac
35848+ ;;
35849+ esac
35850+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
35851+ shlibpath_overrides_runpath=no
35852+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
35853+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
35854+ hardcode_into_libs=yes
35855+ ;;
35856+
35857+# No shared lib support for Linux oldld, aout, or coff.
35858+linux*oldld* | linux*aout* | linux*coff*)
35859+ dynamic_linker=no
35860+ ;;
35861+
35862+# This must be glibc/ELF.
35863+linux* | k*bsd*-gnu | kopensolaris*-gnu)
35864+ version_type=linux # correct to gnu/linux during the next big refactor
35865+ need_lib_prefix=no
35866+ need_version=no
35867+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35868+ soname_spec='${libname}${release}${shared_ext}$major'
35869+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
35870+ shlibpath_var=LD_LIBRARY_PATH
35871+ shlibpath_overrides_runpath=no
35872+
35873+ # Some binutils ld are patched to set DT_RUNPATH
35874+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
35875+ [lt_cv_shlibpath_overrides_runpath=no
35876+ save_LDFLAGS=$LDFLAGS
35877+ save_libdir=$libdir
35878+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
35879+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
35880+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
35881+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
35882+ [lt_cv_shlibpath_overrides_runpath=yes])])
35883+ LDFLAGS=$save_LDFLAGS
35884+ libdir=$save_libdir
35885+ ])
35886+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
35887+
35888+ # This implies no fast_install, which is unacceptable.
35889+ # Some rework will be needed to allow for fast_install
35890+ # before this can be enabled.
35891+ hardcode_into_libs=yes
35892+
35893+ # Append ld.so.conf contents to the search path
35894+ if test -f /etc/ld.so.conf; then
35895+ 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' ' '`
35896+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
35897+ fi
35898+
35899+ # We used to test for /lib/ld.so.1 and disable shared libraries on
35900+ # powerpc, because MkLinux only supported shared libraries with the
35901+ # GNU dynamic linker. Since this was broken with cross compilers,
35902+ # most powerpc-linux boxes support dynamic linking these days and
35903+ # people can always --disable-shared, the test was removed, and we
35904+ # assume the GNU/Linux dynamic linker is in use.
35905+ dynamic_linker='GNU/Linux ld.so'
35906+ ;;
35907+
35908+netbsdelf*-gnu)
35909+ version_type=linux
35910+ need_lib_prefix=no
35911+ need_version=no
35912+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
35913+ soname_spec='${libname}${release}${shared_ext}$major'
35914+ shlibpath_var=LD_LIBRARY_PATH
35915+ shlibpath_overrides_runpath=no
35916+ hardcode_into_libs=yes
35917+ dynamic_linker='NetBSD ld.elf_so'
35918+ ;;
35919+
35920+netbsd*)
35921+ version_type=sunos
35922+ need_lib_prefix=no
35923+ need_version=no
35924+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
35925+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
35926+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
35927+ dynamic_linker='NetBSD (a.out) ld.so'
35928+ else
35929+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
35930+ soname_spec='${libname}${release}${shared_ext}$major'
35931+ dynamic_linker='NetBSD ld.elf_so'
35932+ fi
35933+ shlibpath_var=LD_LIBRARY_PATH
35934+ shlibpath_overrides_runpath=yes
35935+ hardcode_into_libs=yes
35936+ ;;
35937+
35938+newsos6)
35939+ version_type=linux # correct to gnu/linux during the next big refactor
35940+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35941+ shlibpath_var=LD_LIBRARY_PATH
35942+ shlibpath_overrides_runpath=yes
35943+ ;;
35944+
35945+*nto* | *qnx*)
35946+ version_type=qnx
35947+ need_lib_prefix=no
35948+ need_version=no
35949+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35950+ soname_spec='${libname}${release}${shared_ext}$major'
35951+ shlibpath_var=LD_LIBRARY_PATH
35952+ shlibpath_overrides_runpath=no
35953+ hardcode_into_libs=yes
35954+ dynamic_linker='ldqnx.so'
35955+ ;;
35956+
35957+openbsd*)
35958+ version_type=sunos
35959+ sys_lib_dlsearch_path_spec="/usr/lib"
35960+ need_lib_prefix=no
35961+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
35962+ case $host_os in
35963+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
35964+ *) need_version=no ;;
35965+ esac
35966+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
35967+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
35968+ shlibpath_var=LD_LIBRARY_PATH
35969+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
35970+ case $host_os in
35971+ openbsd2.[[89]] | openbsd2.[[89]].*)
35972+ shlibpath_overrides_runpath=no
35973+ ;;
35974+ *)
35975+ shlibpath_overrides_runpath=yes
35976+ ;;
35977+ esac
35978+ else
35979+ shlibpath_overrides_runpath=yes
35980+ fi
35981+ ;;
35982+
35983+os2*)
35984+ libname_spec='$name'
35985+ shrext_cmds=".dll"
35986+ need_lib_prefix=no
35987+ library_names_spec='$libname${shared_ext} $libname.a'
35988+ dynamic_linker='OS/2 ld.exe'
35989+ shlibpath_var=LIBPATH
35990+ ;;
35991+
35992+osf3* | osf4* | osf5*)
35993+ version_type=osf
35994+ need_lib_prefix=no
35995+ need_version=no
35996+ soname_spec='${libname}${release}${shared_ext}$major'
35997+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35998+ shlibpath_var=LD_LIBRARY_PATH
35999+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
36000+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
36001+ ;;
36002+
36003+rdos*)
36004+ dynamic_linker=no
36005+ ;;
36006+
36007+solaris*)
36008+ version_type=linux # correct to gnu/linux during the next big refactor
36009+ need_lib_prefix=no
36010+ need_version=no
36011+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36012+ soname_spec='${libname}${release}${shared_ext}$major'
36013+ shlibpath_var=LD_LIBRARY_PATH
36014+ shlibpath_overrides_runpath=yes
36015+ hardcode_into_libs=yes
36016+ # ldd complains unless libraries are executable
36017+ postinstall_cmds='chmod +x $lib'
36018+ ;;
36019+
36020+sunos4*)
36021+ version_type=sunos
36022+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
36023+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
36024+ shlibpath_var=LD_LIBRARY_PATH
36025+ shlibpath_overrides_runpath=yes
36026+ if test "$with_gnu_ld" = yes; then
36027+ need_lib_prefix=no
36028+ fi
36029+ need_version=yes
36030+ ;;
36031+
36032+sysv4 | sysv4.3*)
36033+ version_type=linux # correct to gnu/linux during the next big refactor
36034+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36035+ soname_spec='${libname}${release}${shared_ext}$major'
36036+ shlibpath_var=LD_LIBRARY_PATH
36037+ case $host_vendor in
36038+ sni)
36039+ shlibpath_overrides_runpath=no
36040+ need_lib_prefix=no
36041+ runpath_var=LD_RUN_PATH
36042+ ;;
36043+ siemens)
36044+ need_lib_prefix=no
36045+ ;;
36046+ motorola)
36047+ need_lib_prefix=no
36048+ need_version=no
36049+ shlibpath_overrides_runpath=no
36050+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
36051+ ;;
36052+ esac
36053+ ;;
36054+
36055+sysv4*MP*)
36056+ if test -d /usr/nec ;then
36057+ version_type=linux # correct to gnu/linux during the next big refactor
36058+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
36059+ soname_spec='$libname${shared_ext}.$major'
36060+ shlibpath_var=LD_LIBRARY_PATH
36061+ fi
36062+ ;;
36063+
36064+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
36065+ version_type=freebsd-elf
36066+ need_lib_prefix=no
36067+ need_version=no
36068+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
36069+ soname_spec='${libname}${release}${shared_ext}$major'
36070+ shlibpath_var=LD_LIBRARY_PATH
36071+ shlibpath_overrides_runpath=yes
36072+ hardcode_into_libs=yes
36073+ if test "$with_gnu_ld" = yes; then
36074+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
36075+ else
36076+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
36077+ case $host_os in
36078+ sco3.2v5*)
36079+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
36080+ ;;
36081+ esac
36082+ fi
36083+ sys_lib_dlsearch_path_spec='/usr/lib'
36084+ ;;
36085+
36086+tpf*)
36087+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
36088+ version_type=linux # correct to gnu/linux during the next big refactor
36089+ need_lib_prefix=no
36090+ need_version=no
36091+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36092+ shlibpath_var=LD_LIBRARY_PATH
36093+ shlibpath_overrides_runpath=no
36094+ hardcode_into_libs=yes
36095+ ;;
36096+
36097+uts4*)
36098+ version_type=linux # correct to gnu/linux during the next big refactor
36099+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36100+ soname_spec='${libname}${release}${shared_ext}$major'
36101+ shlibpath_var=LD_LIBRARY_PATH
36102+ ;;
36103+
36104+*)
36105+ dynamic_linker=no
36106+ ;;
36107+esac
36108+AC_MSG_RESULT([$dynamic_linker])
36109+test "$dynamic_linker" = no && can_build_shared=no
36110+
36111+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
36112+if test "$GCC" = yes; then
36113+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
36114+fi
36115+
36116+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
36117+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
36118+fi
36119+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
36120+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
36121+fi
36122+
36123+_LT_DECL([], [variables_saved_for_relink], [1],
36124+ [Variables whose values should be saved in libtool wrapper scripts and
36125+ restored at link time])
36126+_LT_DECL([], [need_lib_prefix], [0],
36127+ [Do we need the "lib" prefix for modules?])
36128+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
36129+_LT_DECL([], [version_type], [0], [Library versioning type])
36130+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
36131+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
36132+_LT_DECL([], [shlibpath_overrides_runpath], [0],
36133+ [Is shlibpath searched before the hard-coded library search path?])
36134+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
36135+_LT_DECL([], [library_names_spec], [1],
36136+ [[List of archive names. First name is the real one, the rest are links.
36137+ The last name is the one that the linker finds with -lNAME]])
36138+_LT_DECL([], [soname_spec], [1],
36139+ [[The coded name of the library, if different from the real name]])
36140+_LT_DECL([], [install_override_mode], [1],
36141+ [Permission mode override for installation of shared libraries])
36142+_LT_DECL([], [postinstall_cmds], [2],
36143+ [Command to use after installation of a shared archive])
36144+_LT_DECL([], [postuninstall_cmds], [2],
36145+ [Command to use after uninstallation of a shared archive])
36146+_LT_DECL([], [finish_cmds], [2],
36147+ [Commands used to finish a libtool library installation in a directory])
36148+_LT_DECL([], [finish_eval], [1],
36149+ [[As "finish_cmds", except a single script fragment to be evaled but
36150+ not shown]])
36151+_LT_DECL([], [hardcode_into_libs], [0],
36152+ [Whether we should hardcode library paths into libraries])
36153+_LT_DECL([], [sys_lib_search_path_spec], [2],
36154+ [Compile-time system search path for libraries])
36155+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
36156+ [Run-time system search path for libraries])
36157+])# _LT_SYS_DYNAMIC_LINKER
36158+
36159+
36160+# _LT_PATH_TOOL_PREFIX(TOOL)
36161+# --------------------------
36162+# find a file program which can recognize shared library
36163+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
36164+[m4_require([_LT_DECL_EGREP])dnl
36165+AC_MSG_CHECKING([for $1])
36166+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
36167+[case $MAGIC_CMD in
36168+[[\\/*] | ?:[\\/]*])
36169+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
36170+ ;;
36171+*)
36172+ lt_save_MAGIC_CMD="$MAGIC_CMD"
36173+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
36174+dnl $ac_dummy forces splitting on constant user-supplied paths.
36175+dnl POSIX.2 word splitting is done only on the output of word expansions,
36176+dnl not every word. This closes a longstanding sh security hole.
36177+ ac_dummy="m4_if([$2], , $PATH, [$2])"
36178+ for ac_dir in $ac_dummy; do
36179+ IFS="$lt_save_ifs"
36180+ test -z "$ac_dir" && ac_dir=.
36181+ if test -f $ac_dir/$1; then
36182+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
36183+ if test -n "$file_magic_test_file"; then
36184+ case $deplibs_check_method in
36185+ "file_magic "*)
36186+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
36187+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
36188+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
36189+ $EGREP "$file_magic_regex" > /dev/null; then
36190+ :
36191+ else
36192+ cat <<_LT_EOF 1>&2
36193+
36194+*** Warning: the command libtool uses to detect shared libraries,
36195+*** $file_magic_cmd, produces output that libtool cannot recognize.
36196+*** The result is that libtool may fail to recognize shared libraries
36197+*** as such. This will affect the creation of libtool libraries that
36198+*** depend on shared libraries, but programs linked with such libtool
36199+*** libraries will work regardless of this problem. Nevertheless, you
36200+*** may want to report the problem to your system manager and/or to
36201+*** bug-libtool@gnu.org
36202+
36203+_LT_EOF
36204+ fi ;;
36205+ esac
36206+ fi
36207+ break
36208+ fi
36209+ done
36210+ IFS="$lt_save_ifs"
36211+ MAGIC_CMD="$lt_save_MAGIC_CMD"
36212+ ;;
36213+esac])
36214+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
36215+if test -n "$MAGIC_CMD"; then
36216+ AC_MSG_RESULT($MAGIC_CMD)
36217+else
36218+ AC_MSG_RESULT(no)
36219+fi
36220+_LT_DECL([], [MAGIC_CMD], [0],
36221+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
36222+])# _LT_PATH_TOOL_PREFIX
36223+
36224+# Old name:
36225+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
36226+dnl aclocal-1.4 backwards compatibility:
36227+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
36228+
36229+
36230+# _LT_PATH_MAGIC
36231+# --------------
36232+# find a file program which can recognize a shared library
36233+m4_defun([_LT_PATH_MAGIC],
36234+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
36235+if test -z "$lt_cv_path_MAGIC_CMD"; then
36236+ if test -n "$ac_tool_prefix"; then
36237+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
36238+ else
36239+ MAGIC_CMD=:
36240+ fi
36241+fi
36242+])# _LT_PATH_MAGIC
36243+
36244+
36245+# LT_PATH_LD
36246+# ----------
36247+# find the pathname to the GNU or non-GNU linker
36248+AC_DEFUN([LT_PATH_LD],
36249+[AC_REQUIRE([AC_PROG_CC])dnl
36250+AC_REQUIRE([AC_CANONICAL_HOST])dnl
36251+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
36252+m4_require([_LT_DECL_SED])dnl
36253+m4_require([_LT_DECL_EGREP])dnl
36254+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
36255+
36256+AC_ARG_WITH([gnu-ld],
36257+ [AS_HELP_STRING([--with-gnu-ld],
36258+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
36259+ [test "$withval" = no || with_gnu_ld=yes],
36260+ [with_gnu_ld=no])dnl
36261+
36262+ac_prog=ld
36263+if test "$GCC" = yes; then
36264+ # Check if gcc -print-prog-name=ld gives a path.
36265+ AC_MSG_CHECKING([for ld used by $CC])
36266+ case $host in
36267+ *-*-mingw*)
36268+ # gcc leaves a trailing carriage return which upsets mingw
36269+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
36270+ *)
36271+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
36272+ esac
36273+ case $ac_prog in
36274+ # Accept absolute paths.
36275+ [[\\/]]* | ?:[[\\/]]*)
36276+ re_direlt='/[[^/]][[^/]]*/\.\./'
36277+ # Canonicalize the pathname of ld
36278+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
36279+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
36280+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
36281+ done
36282+ test -z "$LD" && LD="$ac_prog"
36283+ ;;
36284+ "")
36285+ # If it fails, then pretend we aren't using GCC.
36286+ ac_prog=ld
36287+ ;;
36288+ *)
36289+ # If it is relative, then search for the first ld in PATH.
36290+ with_gnu_ld=unknown
36291+ ;;
36292+ esac
36293+elif test "$with_gnu_ld" = yes; then
36294+ AC_MSG_CHECKING([for GNU ld])
36295+else
36296+ AC_MSG_CHECKING([for non-GNU ld])
36297+fi
36298+AC_CACHE_VAL(lt_cv_path_LD,
36299+[if test -z "$LD"; then
36300+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
36301+ for ac_dir in $PATH; do
36302+ IFS="$lt_save_ifs"
36303+ test -z "$ac_dir" && ac_dir=.
36304+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
36305+ lt_cv_path_LD="$ac_dir/$ac_prog"
36306+ # Check to see if the program is GNU ld. I'd rather use --version,
36307+ # but apparently some variants of GNU ld only accept -v.
36308+ # Break only if it was the GNU/non-GNU ld that we prefer.
36309+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
36310+ *GNU* | *'with BFD'*)
36311+ test "$with_gnu_ld" != no && break
36312+ ;;
36313+ *)
36314+ test "$with_gnu_ld" != yes && break
36315+ ;;
36316+ esac
36317+ fi
36318+ done
36319+ IFS="$lt_save_ifs"
36320+else
36321+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
36322+fi])
36323+LD="$lt_cv_path_LD"
36324+if test -n "$LD"; then
36325+ AC_MSG_RESULT($LD)
36326+else
36327+ AC_MSG_RESULT(no)
36328+fi
36329+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
36330+_LT_PATH_LD_GNU
36331+AC_SUBST([LD])
36332+
36333+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
36334+])# LT_PATH_LD
36335+
36336+# Old names:
36337+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
36338+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
36339+dnl aclocal-1.4 backwards compatibility:
36340+dnl AC_DEFUN([AM_PROG_LD], [])
36341+dnl AC_DEFUN([AC_PROG_LD], [])
36342+
36343+
36344+# _LT_PATH_LD_GNU
36345+#- --------------
36346+m4_defun([_LT_PATH_LD_GNU],
36347+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
36348+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
36349+case `$LD -v 2>&1 </dev/null` in
36350+*GNU* | *'with BFD'*)
36351+ lt_cv_prog_gnu_ld=yes
36352+ ;;
36353+*)
36354+ lt_cv_prog_gnu_ld=no
36355+ ;;
36356+esac])
36357+with_gnu_ld=$lt_cv_prog_gnu_ld
36358+])# _LT_PATH_LD_GNU
36359+
36360+
36361+# _LT_CMD_RELOAD
36362+# --------------
36363+# find reload flag for linker
36364+# -- PORTME Some linkers may need a different reload flag.
36365+m4_defun([_LT_CMD_RELOAD],
36366+[AC_CACHE_CHECK([for $LD option to reload object files],
36367+ lt_cv_ld_reload_flag,
36368+ [lt_cv_ld_reload_flag='-r'])
36369+reload_flag=$lt_cv_ld_reload_flag
36370+case $reload_flag in
36371+"" | " "*) ;;
36372+*) reload_flag=" $reload_flag" ;;
36373+esac
36374+reload_cmds='$LD$reload_flag -o $output$reload_objs'
36375+case $host_os in
36376+ cygwin* | mingw* | pw32* | cegcc*)
36377+ if test "$GCC" != yes; then
36378+ reload_cmds=false
36379+ fi
36380+ ;;
36381+ darwin*)
36382+ if test "$GCC" = yes; then
36383+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
36384+ else
36385+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
36386+ fi
36387+ ;;
36388+esac
36389+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
36390+_LT_TAGDECL([], [reload_cmds], [2])dnl
36391+])# _LT_CMD_RELOAD
36392+
36393+
36394+# _LT_CHECK_MAGIC_METHOD
36395+# ----------------------
36396+# how to check for library dependencies
36397+# -- PORTME fill in with the dynamic library characteristics
36398+m4_defun([_LT_CHECK_MAGIC_METHOD],
36399+[m4_require([_LT_DECL_EGREP])
36400+m4_require([_LT_DECL_OBJDUMP])
36401+AC_CACHE_CHECK([how to recognize dependent libraries],
36402+lt_cv_deplibs_check_method,
36403+[lt_cv_file_magic_cmd='$MAGIC_CMD'
36404+lt_cv_file_magic_test_file=
36405+lt_cv_deplibs_check_method='unknown'
36406+# Need to set the preceding variable on all platforms that support
36407+# interlibrary dependencies.
36408+# 'none' -- dependencies not supported.
36409+# `unknown' -- same as none, but documents that we really don't know.
36410+# 'pass_all' -- all dependencies passed with no checks.
36411+# 'test_compile' -- check by making test program.
36412+# 'file_magic [[regex]]' -- check by looking for files in library path
36413+# which responds to the $file_magic_cmd with a given extended regex.
36414+# If you have `file' or equivalent on your system and you're not sure
36415+# whether `pass_all' will *always* work, you probably want this one.
36416+
36417+case $host_os in
36418+aix[[4-9]]*)
36419+ lt_cv_deplibs_check_method=pass_all
36420+ ;;
36421+
36422+beos*)
36423+ lt_cv_deplibs_check_method=pass_all
36424+ ;;
36425+
36426+bsdi[[45]]*)
36427+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
36428+ lt_cv_file_magic_cmd='/usr/bin/file -L'
36429+ lt_cv_file_magic_test_file=/shlib/libc.so
36430+ ;;
36431+
36432+cygwin*)
36433+ # func_win32_libid is a shell function defined in ltmain.sh
36434+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
36435+ lt_cv_file_magic_cmd='func_win32_libid'
36436+ ;;
36437+
36438+mingw* | pw32*)
36439+ # Base MSYS/MinGW do not provide the 'file' command needed by
36440+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
36441+ # unless we find 'file', for example because we are cross-compiling.
36442+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
36443+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
36444+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
36445+ lt_cv_file_magic_cmd='func_win32_libid'
36446+ else
36447+ # Keep this pattern in sync with the one in func_win32_libid.
36448+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
36449+ lt_cv_file_magic_cmd='$OBJDUMP -f'
36450+ fi
36451+ ;;
36452+
36453+cegcc*)
36454+ # use the weaker test based on 'objdump'. See mingw*.
36455+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
36456+ lt_cv_file_magic_cmd='$OBJDUMP -f'
36457+ ;;
36458+
36459+darwin* | rhapsody*)
36460+ lt_cv_deplibs_check_method=pass_all
36461+ ;;
36462+
36463+freebsd* | dragonfly*)
36464+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
36465+ case $host_cpu in
36466+ i*86 )
36467+ # Not sure whether the presence of OpenBSD here was a mistake.
36468+ # Let's accept both of them until this is cleared up.
36469+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
36470+ lt_cv_file_magic_cmd=/usr/bin/file
36471+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
36472+ ;;
36473+ esac
36474+ else
36475+ lt_cv_deplibs_check_method=pass_all
36476+ fi
36477+ ;;
36478+
36479+gnu*)
36480+ lt_cv_deplibs_check_method=pass_all
36481+ ;;
36482+
36483+haiku*)
36484+ lt_cv_deplibs_check_method=pass_all
36485+ ;;
36486+
36487+hpux10.20* | hpux11*)
36488+ lt_cv_file_magic_cmd=/usr/bin/file
36489+ case $host_cpu in
36490+ ia64*)
36491+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
36492+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
36493+ ;;
36494+ hppa*64*)
36495+ [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]']
36496+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
36497+ ;;
36498+ *)
36499+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
36500+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
36501+ ;;
36502+ esac
36503+ ;;
36504+
36505+interix[[3-9]]*)
36506+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
36507+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
36508+ ;;
36509+
36510+irix5* | irix6* | nonstopux*)
36511+ case $LD in
36512+ *-32|*"-32 ") libmagic=32-bit;;
36513+ *-n32|*"-n32 ") libmagic=N32;;
36514+ *-64|*"-64 ") libmagic=64-bit;;
36515+ *) libmagic=never-match;;
36516+ esac
36517+ lt_cv_deplibs_check_method=pass_all
36518+ ;;
36519+
36520+# This must be glibc/ELF.
36521+linux* | k*bsd*-gnu | kopensolaris*-gnu)
36522+ lt_cv_deplibs_check_method=pass_all
36523+ ;;
36524+
36525+netbsd* | netbsdelf*-gnu)
36526+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
36527+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
36528+ else
36529+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
36530+ fi
36531+ ;;
36532+
36533+newos6*)
36534+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
36535+ lt_cv_file_magic_cmd=/usr/bin/file
36536+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
36537+ ;;
36538+
36539+*nto* | *qnx*)
36540+ lt_cv_deplibs_check_method=pass_all
36541+ ;;
36542+
36543+openbsd*)
36544+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
36545+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
36546+ else
36547+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
36548+ fi
36549+ ;;
36550+
36551+osf3* | osf4* | osf5*)
36552+ lt_cv_deplibs_check_method=pass_all
36553+ ;;
36554+
36555+rdos*)
36556+ lt_cv_deplibs_check_method=pass_all
36557+ ;;
36558+
36559+solaris*)
36560+ lt_cv_deplibs_check_method=pass_all
36561+ ;;
36562+
36563+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
36564+ lt_cv_deplibs_check_method=pass_all
36565+ ;;
36566+
36567+sysv4 | sysv4.3*)
36568+ case $host_vendor in
36569+ motorola)
36570+ 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]]'
36571+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
36572+ ;;
36573+ ncr)
36574+ lt_cv_deplibs_check_method=pass_all
36575+ ;;
36576+ sequent)
36577+ lt_cv_file_magic_cmd='/bin/file'
36578+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
36579+ ;;
36580+ sni)
36581+ lt_cv_file_magic_cmd='/bin/file'
36582+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
36583+ lt_cv_file_magic_test_file=/lib/libc.so
36584+ ;;
36585+ siemens)
36586+ lt_cv_deplibs_check_method=pass_all
36587+ ;;
36588+ pc)
36589+ lt_cv_deplibs_check_method=pass_all
36590+ ;;
36591+ esac
36592+ ;;
36593+
36594+tpf*)
36595+ lt_cv_deplibs_check_method=pass_all
36596+ ;;
36597+esac
36598+])
36599+
36600+file_magic_glob=
36601+want_nocaseglob=no
36602+if test "$build" = "$host"; then
36603+ case $host_os in
36604+ mingw* | pw32*)
36605+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
36606+ want_nocaseglob=yes
36607+ else
36608+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
36609+ fi
36610+ ;;
36611+ esac
36612+fi
36613+
36614+file_magic_cmd=$lt_cv_file_magic_cmd
36615+deplibs_check_method=$lt_cv_deplibs_check_method
36616+test -z "$deplibs_check_method" && deplibs_check_method=unknown
36617+
36618+_LT_DECL([], [deplibs_check_method], [1],
36619+ [Method to check whether dependent libraries are shared objects])
36620+_LT_DECL([], [file_magic_cmd], [1],
36621+ [Command to use when deplibs_check_method = "file_magic"])
36622+_LT_DECL([], [file_magic_glob], [1],
36623+ [How to find potential files when deplibs_check_method = "file_magic"])
36624+_LT_DECL([], [want_nocaseglob], [1],
36625+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
36626+])# _LT_CHECK_MAGIC_METHOD
36627+
36628+
36629+# LT_PATH_NM
36630+# ----------
36631+# find the pathname to a BSD- or MS-compatible name lister
36632+AC_DEFUN([LT_PATH_NM],
36633+[AC_REQUIRE([AC_PROG_CC])dnl
36634+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
36635+[if test -n "$NM"; then
36636+ # Let the user override the test.
36637+ lt_cv_path_NM="$NM"
36638+else
36639+ lt_nm_to_check="${ac_tool_prefix}nm"
36640+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
36641+ lt_nm_to_check="$lt_nm_to_check nm"
36642+ fi
36643+ for lt_tmp_nm in $lt_nm_to_check; do
36644+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
36645+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
36646+ IFS="$lt_save_ifs"
36647+ test -z "$ac_dir" && ac_dir=.
36648+ tmp_nm="$ac_dir/$lt_tmp_nm"
36649+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
36650+ # Check to see if the nm accepts a BSD-compat flag.
36651+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
36652+ # nm: unknown option "B" ignored
36653+ # Tru64's nm complains that /dev/null is an invalid object file
36654+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
36655+ */dev/null* | *'Invalid file or object type'*)
36656+ lt_cv_path_NM="$tmp_nm -B"
36657+ break
36658+ ;;
36659+ *)
36660+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
36661+ */dev/null*)
36662+ lt_cv_path_NM="$tmp_nm -p"
36663+ break
36664+ ;;
36665+ *)
36666+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
36667+ continue # so that we can try to find one that supports BSD flags
36668+ ;;
36669+ esac
36670+ ;;
36671+ esac
36672+ fi
36673+ done
36674+ IFS="$lt_save_ifs"
36675+ done
36676+ : ${lt_cv_path_NM=no}
36677+fi])
36678+if test "$lt_cv_path_NM" != "no"; then
36679+ NM="$lt_cv_path_NM"
36680+else
36681+ # Didn't find any BSD compatible name lister, look for dumpbin.
36682+ if test -n "$DUMPBIN"; then :
36683+ # Let the user override the test.
36684+ else
36685+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
36686+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
36687+ *COFF*)
36688+ DUMPBIN="$DUMPBIN -symbols"
36689+ ;;
36690+ *)
36691+ DUMPBIN=:
36692+ ;;
36693+ esac
36694+ fi
36695+ AC_SUBST([DUMPBIN])
36696+ if test "$DUMPBIN" != ":"; then
36697+ NM="$DUMPBIN"
36698+ fi
36699+fi
36700+test -z "$NM" && NM=nm
36701+AC_SUBST([NM])
36702+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
36703+
36704+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
36705+ [lt_cv_nm_interface="BSD nm"
36706+ echo "int some_variable = 0;" > conftest.$ac_ext
36707+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
36708+ (eval "$ac_compile" 2>conftest.err)
36709+ cat conftest.err >&AS_MESSAGE_LOG_FD
36710+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
36711+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
36712+ cat conftest.err >&AS_MESSAGE_LOG_FD
36713+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
36714+ cat conftest.out >&AS_MESSAGE_LOG_FD
36715+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
36716+ lt_cv_nm_interface="MS dumpbin"
36717+ fi
36718+ rm -f conftest*])
36719+])# LT_PATH_NM
36720+
36721+# Old names:
36722+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
36723+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
36724+dnl aclocal-1.4 backwards compatibility:
36725+dnl AC_DEFUN([AM_PROG_NM], [])
36726+dnl AC_DEFUN([AC_PROG_NM], [])
36727+
36728+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
36729+# --------------------------------
36730+# how to determine the name of the shared library
36731+# associated with a specific link library.
36732+# -- PORTME fill in with the dynamic library characteristics
36733+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
36734+[m4_require([_LT_DECL_EGREP])
36735+m4_require([_LT_DECL_OBJDUMP])
36736+m4_require([_LT_DECL_DLLTOOL])
36737+AC_CACHE_CHECK([how to associate runtime and link libraries],
36738+lt_cv_sharedlib_from_linklib_cmd,
36739+[lt_cv_sharedlib_from_linklib_cmd='unknown'
36740+
36741+case $host_os in
36742+cygwin* | mingw* | pw32* | cegcc*)
36743+ # two different shell functions defined in ltmain.sh
36744+ # decide which to use based on capabilities of $DLLTOOL
36745+ case `$DLLTOOL --help 2>&1` in
36746+ *--identify-strict*)
36747+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
36748+ ;;
36749+ *)
36750+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
36751+ ;;
36752+ esac
36753+ ;;
36754+*)
36755+ # fallback: assume linklib IS sharedlib
36756+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
36757+ ;;
36758+esac
36759+])
36760+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
36761+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
36762+
36763+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
36764+ [Command to associate shared and link libraries])
36765+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
36766+
36767+
36768+# _LT_PATH_MANIFEST_TOOL
36769+# ----------------------
36770+# locate the manifest tool
36771+m4_defun([_LT_PATH_MANIFEST_TOOL],
36772+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
36773+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
36774+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
36775+ [lt_cv_path_mainfest_tool=no
36776+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
36777+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
36778+ cat conftest.err >&AS_MESSAGE_LOG_FD
36779+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
36780+ lt_cv_path_mainfest_tool=yes
36781+ fi
36782+ rm -f conftest*])
36783+if test "x$lt_cv_path_mainfest_tool" != xyes; then
36784+ MANIFEST_TOOL=:
36785+fi
36786+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
36787+])# _LT_PATH_MANIFEST_TOOL
36788+
36789+
36790+# LT_LIB_M
36791+# --------
36792+# check for math library
36793+AC_DEFUN([LT_LIB_M],
36794+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
36795+LIBM=
36796+case $host in
36797+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
36798+ # These system don't have libm, or don't need it
36799+ ;;
36800+*-ncr-sysv4.3*)
36801+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
36802+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
36803+ ;;
36804+*)
36805+ AC_CHECK_LIB(m, cos, LIBM="-lm")
36806+ ;;
36807+esac
36808+AC_SUBST([LIBM])
36809+])# LT_LIB_M
36810+
36811+# Old name:
36812+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
36813+dnl aclocal-1.4 backwards compatibility:
36814+dnl AC_DEFUN([AC_CHECK_LIBM], [])
36815+
36816+
36817+# _LT_COMPILER_NO_RTTI([TAGNAME])
36818+# -------------------------------
36819+m4_defun([_LT_COMPILER_NO_RTTI],
36820+[m4_require([_LT_TAG_COMPILER])dnl
36821+
36822+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
36823+
36824+if test "$GCC" = yes; then
36825+ case $cc_basename in
36826+ nvcc*)
36827+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36828+ *)
36829+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
36830+ esac
36831+
36832+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
36833+ lt_cv_prog_compiler_rtti_exceptions,
36834+ [-fno-rtti -fno-exceptions], [],
36835+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
36836+fi
36837+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
36838+ [Compiler flag to turn off builtin functions])
36839+])# _LT_COMPILER_NO_RTTI
36840+
36841+
36842+# _LT_CMD_GLOBAL_SYMBOLS
36843+# ----------------------
36844+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
36845+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
36846+AC_REQUIRE([AC_PROG_CC])dnl
36847+AC_REQUIRE([AC_PROG_AWK])dnl
36848+AC_REQUIRE([LT_PATH_NM])dnl
36849+AC_REQUIRE([LT_PATH_LD])dnl
36850+m4_require([_LT_DECL_SED])dnl
36851+m4_require([_LT_DECL_EGREP])dnl
36852+m4_require([_LT_TAG_COMPILER])dnl
36853+
36854+# Check for command to grab the raw symbol name followed by C symbol from nm.
36855+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
36856+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
36857+[
36858+# These are sane defaults that work on at least a few old systems.
36859+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
36860+
36861+# Character class describing NM global symbol codes.
36862+symcode='[[BCDEGRST]]'
36863+
36864+# Regexp to match symbols that can be accessed directly from C.
36865+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
36866+
36867+# Define system-specific variables.
36868+case $host_os in
36869+aix*)
36870+ symcode='[[BCDT]]'
36871+ ;;
36872+cygwin* | mingw* | pw32* | cegcc*)
36873+ symcode='[[ABCDGISTW]]'
36874+ ;;
36875+hpux*)
36876+ if test "$host_cpu" = ia64; then
36877+ symcode='[[ABCDEGRST]]'
36878+ fi
36879+ ;;
36880+irix* | nonstopux*)
36881+ symcode='[[BCDEGRST]]'
36882+ ;;
36883+osf*)
36884+ symcode='[[BCDEGQRST]]'
36885+ ;;
36886+solaris*)
36887+ symcode='[[BDRT]]'
36888+ ;;
36889+sco3.2v5*)
36890+ symcode='[[DT]]'
36891+ ;;
36892+sysv4.2uw2*)
36893+ symcode='[[DT]]'
36894+ ;;
36895+sysv5* | sco5v6* | unixware* | OpenUNIX*)
36896+ symcode='[[ABDT]]'
36897+ ;;
36898+sysv4)
36899+ symcode='[[DFNSTU]]'
36900+ ;;
36901+esac
36902+
36903+# If we're using GNU nm, then use its standard symbol codes.
36904+case `$NM -V 2>&1` in
36905+*GNU* | *'with BFD'*)
36906+ symcode='[[ABCDGIRSTW]]' ;;
36907+esac
36908+
36909+# Transform an extracted symbol line into a proper C declaration.
36910+# Some systems (esp. on ia64) link data and code symbols differently,
36911+# so use this general approach.
36912+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
36913+
36914+# Transform an extracted symbol line into symbol name and symbol address
36915+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
36916+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'"
36917+
36918+# Handle CRLF in mingw tool chain
36919+opt_cr=
36920+case $build_os in
36921+mingw*)
36922+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
36923+ ;;
36924+esac
36925+
36926+# Try without a prefix underscore, then with it.
36927+for ac_symprfx in "" "_"; do
36928+
36929+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
36930+ symxfrm="\\1 $ac_symprfx\\2 \\2"
36931+
36932+ # Write the raw and C identifiers.
36933+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
36934+ # Fake it for dumpbin and say T for any non-static function
36935+ # and D for any global variable.
36936+ # Also find C++ and __fastcall symbols from MSVC++,
36937+ # which start with @ or ?.
36938+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
36939+" {last_section=section; section=\$ 3};"\
36940+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
36941+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
36942+" \$ 0!~/External *\|/{next};"\
36943+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
36944+" {if(hide[section]) next};"\
36945+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
36946+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
36947+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
36948+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
36949+" ' prfx=^$ac_symprfx]"
36950+ else
36951+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
36952+ fi
36953+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
36954+
36955+ # Check to see that the pipe works correctly.
36956+ pipe_works=no
36957+
36958+ rm -f conftest*
36959+ cat > conftest.$ac_ext <<_LT_EOF
36960+#ifdef __cplusplus
36961+extern "C" {
36962+#endif
36963+char nm_test_var;
36964+void nm_test_func(void);
36965+void nm_test_func(void){}
36966+#ifdef __cplusplus
36967+}
36968+#endif
36969+int main(){nm_test_var='a';nm_test_func();return(0);}
36970+_LT_EOF
36971+
36972+ if AC_TRY_EVAL(ac_compile); then
36973+ # Now try to grab the symbols.
36974+ nlist=conftest.nm
36975+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
36976+ # Try sorting and uniquifying the output.
36977+ if sort "$nlist" | uniq > "$nlist"T; then
36978+ mv -f "$nlist"T "$nlist"
36979+ else
36980+ rm -f "$nlist"T
36981+ fi
36982+
36983+ # Make sure that we snagged all the symbols we need.
36984+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
36985+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
36986+ cat <<_LT_EOF > conftest.$ac_ext
36987+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
36988+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
36989+/* DATA imports from DLLs on WIN32 con't be const, because runtime
36990+ relocations are performed -- see ld's documentation on pseudo-relocs. */
36991+# define LT@&t@_DLSYM_CONST
36992+#elif defined(__osf__)
36993+/* This system does not cope well with relocations in const data. */
36994+# define LT@&t@_DLSYM_CONST
36995+#else
36996+# define LT@&t@_DLSYM_CONST const
36997+#endif
36998+
36999+#ifdef __cplusplus
37000+extern "C" {
37001+#endif
37002+
37003+_LT_EOF
37004+ # Now generate the symbol file.
37005+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
37006+
37007+ cat <<_LT_EOF >> conftest.$ac_ext
37008+
37009+/* The mapping between symbol names and symbols. */
37010+LT@&t@_DLSYM_CONST struct {
37011+ const char *name;
37012+ void *address;
37013+}
37014+lt__PROGRAM__LTX_preloaded_symbols[[]] =
37015+{
37016+ { "@PROGRAM@", (void *) 0 },
37017+_LT_EOF
37018+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
37019+ cat <<\_LT_EOF >> conftest.$ac_ext
37020+ {0, (void *) 0}
37021+};
37022+
37023+/* This works around a problem in FreeBSD linker */
37024+#ifdef FREEBSD_WORKAROUND
37025+static const void *lt_preloaded_setup() {
37026+ return lt__PROGRAM__LTX_preloaded_symbols;
37027+}
37028+#endif
37029+
37030+#ifdef __cplusplus
37031+}
37032+#endif
37033+_LT_EOF
37034+ # Now try linking the two files.
37035+ mv conftest.$ac_objext conftstm.$ac_objext
37036+ lt_globsym_save_LIBS=$LIBS
37037+ lt_globsym_save_CFLAGS=$CFLAGS
37038+ LIBS="conftstm.$ac_objext"
37039+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
37040+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
37041+ pipe_works=yes
37042+ fi
37043+ LIBS=$lt_globsym_save_LIBS
37044+ CFLAGS=$lt_globsym_save_CFLAGS
37045+ else
37046+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
37047+ fi
37048+ else
37049+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
37050+ fi
37051+ else
37052+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
37053+ fi
37054+ else
37055+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
37056+ cat conftest.$ac_ext >&5
37057+ fi
37058+ rm -rf conftest* conftst*
37059+
37060+ # Do not use the global_symbol_pipe unless it works.
37061+ if test "$pipe_works" = yes; then
37062+ break
37063+ else
37064+ lt_cv_sys_global_symbol_pipe=
37065+ fi
37066+done
37067+])
37068+if test -z "$lt_cv_sys_global_symbol_pipe"; then
37069+ lt_cv_sys_global_symbol_to_cdecl=
37070+fi
37071+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
37072+ AC_MSG_RESULT(failed)
37073+else
37074+ AC_MSG_RESULT(ok)
37075+fi
37076+
37077+# Response file support.
37078+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
37079+ nm_file_list_spec='@'
37080+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
37081+ nm_file_list_spec='@'
37082+fi
37083+
37084+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
37085+ [Take the output of nm and produce a listing of raw symbols and C names])
37086+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
37087+ [Transform the output of nm in a proper C declaration])
37088+_LT_DECL([global_symbol_to_c_name_address],
37089+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
37090+ [Transform the output of nm in a C name address pair])
37091+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
37092+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
37093+ [Transform the output of nm in a C name address pair when lib prefix is needed])
37094+_LT_DECL([], [nm_file_list_spec], [1],
37095+ [Specify filename containing input files for $NM])
37096+]) # _LT_CMD_GLOBAL_SYMBOLS
37097+
37098+
37099+# _LT_COMPILER_PIC([TAGNAME])
37100+# ---------------------------
37101+m4_defun([_LT_COMPILER_PIC],
37102+[m4_require([_LT_TAG_COMPILER])dnl
37103+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
37104+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
37105+_LT_TAGVAR(lt_prog_compiler_static, $1)=
37106+
37107+m4_if([$1], [CXX], [
37108+ # C++ specific cases for pic, static, wl, etc.
37109+ if test "$GXX" = yes; then
37110+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37111+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37112+
37113+ case $host_os in
37114+ aix*)
37115+ # All AIX code is PIC.
37116+ if test "$host_cpu" = ia64; then
37117+ # AIX 5 now supports IA64 processor
37118+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37119+ fi
37120+ ;;
37121+
37122+ amigaos*)
37123+ case $host_cpu in
37124+ powerpc)
37125+ # see comment about AmigaOS4 .so support
37126+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37127+ ;;
37128+ m68k)
37129+ # FIXME: we need at least 68020 code to build shared libraries, but
37130+ # adding the `-m68020' flag to GCC prevents building anything better,
37131+ # like `-m68040'.
37132+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
37133+ ;;
37134+ esac
37135+ ;;
37136+
37137+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
37138+ # PIC is the default for these OSes.
37139+ ;;
37140+ mingw* | cygwin* | os2* | pw32* | cegcc*)
37141+ # This hack is so that the source file can tell whether it is being
37142+ # built for inclusion in a dll (and should export symbols for example).
37143+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
37144+ # (--disable-auto-import) libraries
37145+ m4_if([$1], [GCJ], [],
37146+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
37147+ ;;
37148+ darwin* | rhapsody*)
37149+ # PIC is the default on this platform
37150+ # Common symbols not allowed in MH_DYLIB files
37151+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
37152+ ;;
37153+ *djgpp*)
37154+ # DJGPP does not support shared libraries at all
37155+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
37156+ ;;
37157+ haiku*)
37158+ # PIC is the default for Haiku.
37159+ # The "-static" flag exists, but is broken.
37160+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
37161+ ;;
37162+ interix[[3-9]]*)
37163+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
37164+ # Instead, we relocate shared libraries at runtime.
37165+ ;;
37166+ sysv4*MP*)
37167+ if test -d /usr/nec; then
37168+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
37169+ fi
37170+ ;;
37171+ hpux*)
37172+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
37173+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
37174+ # sets the default TLS model and affects inlining.
37175+ case $host_cpu in
37176+ hppa*64*)
37177+ ;;
37178+ *)
37179+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37180+ ;;
37181+ esac
37182+ ;;
37183+ *qnx* | *nto*)
37184+ # QNX uses GNU C++, but need to define -shared option too, otherwise
37185+ # it will coredump.
37186+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
37187+ ;;
37188+ *)
37189+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37190+ ;;
37191+ esac
37192+ else
37193+ case $host_os in
37194+ aix[[4-9]]*)
37195+ # All AIX code is PIC.
37196+ if test "$host_cpu" = ia64; then
37197+ # AIX 5 now supports IA64 processor
37198+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37199+ else
37200+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
37201+ fi
37202+ ;;
37203+ chorus*)
37204+ case $cc_basename in
37205+ cxch68*)
37206+ # Green Hills C++ Compiler
37207+ # _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"
37208+ ;;
37209+ esac
37210+ ;;
37211+ mingw* | cygwin* | os2* | pw32* | cegcc*)
37212+ # This hack is so that the source file can tell whether it is being
37213+ # built for inclusion in a dll (and should export symbols for example).
37214+ m4_if([$1], [GCJ], [],
37215+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
37216+ ;;
37217+ dgux*)
37218+ case $cc_basename in
37219+ ec++*)
37220+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37221+ ;;
37222+ ghcx*)
37223+ # Green Hills C++ Compiler
37224+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
37225+ ;;
37226+ *)
37227+ ;;
37228+ esac
37229+ ;;
37230+ freebsd* | dragonfly*)
37231+ # FreeBSD uses GNU C++
37232+ ;;
37233+ hpux9* | hpux10* | hpux11*)
37234+ case $cc_basename in
37235+ CC*)
37236+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37237+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
37238+ if test "$host_cpu" != ia64; then
37239+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
37240+ fi
37241+ ;;
37242+ aCC*)
37243+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37244+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
37245+ case $host_cpu in
37246+ hppa*64*|ia64*)
37247+ # +Z the default
37248+ ;;
37249+ *)
37250+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
37251+ ;;
37252+ esac
37253+ ;;
37254+ *)
37255+ ;;
37256+ esac
37257+ ;;
37258+ interix*)
37259+ # This is c89, which is MS Visual C++ (no shared libs)
37260+ # Anyone wants to do a port?
37261+ ;;
37262+ irix5* | irix6* | nonstopux*)
37263+ case $cc_basename in
37264+ CC*)
37265+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37266+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37267+ # CC pic flag -KPIC is the default.
37268+ ;;
37269+ *)
37270+ ;;
37271+ esac
37272+ ;;
37273+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
37274+ case $cc_basename in
37275+ KCC*)
37276+ # KAI C++ Compiler
37277+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
37278+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37279+ ;;
37280+ ecpc* )
37281+ # old Intel C++ for x86_64 which still supported -KPIC.
37282+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37283+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37284+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37285+ ;;
37286+ icpc* )
37287+ # Intel C++, used to be incompatible with GCC.
37288+ # ICC 10 doesn't accept -KPIC any more.
37289+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37290+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37291+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37292+ ;;
37293+ pgCC* | pgcpp*)
37294+ # Portland Group C++ compiler
37295+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37296+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
37297+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37298+ ;;
37299+ cxx*)
37300+ # Compaq C++
37301+ # Make sure the PIC flag is empty. It appears that all Alpha
37302+ # Linux and Compaq Tru64 Unix objects are PIC.
37303+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
37304+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37305+ ;;
37306+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
37307+ # IBM XL 8.0, 9.0 on PPC and BlueGene
37308+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37309+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
37310+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
37311+ ;;
37312+ *)
37313+ case `$CC -V 2>&1 | sed 5q` in
37314+ *Sun\ C*)
37315+ # Sun C++ 5.9
37316+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37317+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37318+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
37319+ ;;
37320+ esac
37321+ ;;
37322+ esac
37323+ ;;
37324+ lynxos*)
37325+ ;;
37326+ m88k*)
37327+ ;;
37328+ mvs*)
37329+ case $cc_basename in
37330+ cxx*)
37331+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
37332+ ;;
37333+ *)
37334+ ;;
37335+ esac
37336+ ;;
37337+ netbsd* | netbsdelf*-gnu)
37338+ ;;
37339+ *qnx* | *nto*)
37340+ # QNX uses GNU C++, but need to define -shared option too, otherwise
37341+ # it will coredump.
37342+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
37343+ ;;
37344+ osf3* | osf4* | osf5*)
37345+ case $cc_basename in
37346+ KCC*)
37347+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
37348+ ;;
37349+ RCC*)
37350+ # Rational C++ 2.4.1
37351+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
37352+ ;;
37353+ cxx*)
37354+ # Digital/Compaq C++
37355+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37356+ # Make sure the PIC flag is empty. It appears that all Alpha
37357+ # Linux and Compaq Tru64 Unix objects are PIC.
37358+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
37359+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37360+ ;;
37361+ *)
37362+ ;;
37363+ esac
37364+ ;;
37365+ psos*)
37366+ ;;
37367+ solaris*)
37368+ case $cc_basename in
37369+ CC* | sunCC*)
37370+ # Sun C++ 4.2, 5.x and Centerline C++
37371+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37372+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37373+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
37374+ ;;
37375+ gcx*)
37376+ # Green Hills C++ Compiler
37377+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
37378+ ;;
37379+ *)
37380+ ;;
37381+ esac
37382+ ;;
37383+ sunos4*)
37384+ case $cc_basename in
37385+ CC*)
37386+ # Sun C++ 4.x
37387+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
37388+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37389+ ;;
37390+ lcc*)
37391+ # Lucid
37392+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
37393+ ;;
37394+ *)
37395+ ;;
37396+ esac
37397+ ;;
37398+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
37399+ case $cc_basename in
37400+ CC*)
37401+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37402+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37403+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37404+ ;;
37405+ esac
37406+ ;;
37407+ tandem*)
37408+ case $cc_basename in
37409+ NCC*)
37410+ # NonStop-UX NCC 3.20
37411+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37412+ ;;
37413+ *)
37414+ ;;
37415+ esac
37416+ ;;
37417+ vxworks*)
37418+ ;;
37419+ *)
37420+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
37421+ ;;
37422+ esac
37423+ fi
37424+],
37425+[
37426+ if test "$GCC" = yes; then
37427+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37428+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37429+
37430+ case $host_os in
37431+ aix*)
37432+ # All AIX code is PIC.
37433+ if test "$host_cpu" = ia64; then
37434+ # AIX 5 now supports IA64 processor
37435+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37436+ fi
37437+ ;;
37438+
37439+ amigaos*)
37440+ case $host_cpu in
37441+ powerpc)
37442+ # see comment about AmigaOS4 .so support
37443+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37444+ ;;
37445+ m68k)
37446+ # FIXME: we need at least 68020 code to build shared libraries, but
37447+ # adding the `-m68020' flag to GCC prevents building anything better,
37448+ # like `-m68040'.
37449+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
37450+ ;;
37451+ esac
37452+ ;;
37453+
37454+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
37455+ # PIC is the default for these OSes.
37456+ ;;
37457+
37458+ mingw* | cygwin* | pw32* | os2* | cegcc*)
37459+ # This hack is so that the source file can tell whether it is being
37460+ # built for inclusion in a dll (and should export symbols for example).
37461+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
37462+ # (--disable-auto-import) libraries
37463+ m4_if([$1], [GCJ], [],
37464+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
37465+ ;;
37466+
37467+ darwin* | rhapsody*)
37468+ # PIC is the default on this platform
37469+ # Common symbols not allowed in MH_DYLIB files
37470+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
37471+ ;;
37472+
37473+ haiku*)
37474+ # PIC is the default for Haiku.
37475+ # The "-static" flag exists, but is broken.
37476+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
37477+ ;;
37478+
37479+ hpux*)
37480+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
37481+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
37482+ # sets the default TLS model and affects inlining.
37483+ case $host_cpu in
37484+ hppa*64*)
37485+ # +Z the default
37486+ ;;
37487+ *)
37488+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37489+ ;;
37490+ esac
37491+ ;;
37492+
37493+ interix[[3-9]]*)
37494+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
37495+ # Instead, we relocate shared libraries at runtime.
37496+ ;;
37497+
37498+ msdosdjgpp*)
37499+ # Just because we use GCC doesn't mean we suddenly get shared libraries
37500+ # on systems that don't support them.
37501+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
37502+ enable_shared=no
37503+ ;;
37504+
37505+ *nto* | *qnx*)
37506+ # QNX uses GNU C++, but need to define -shared option too, otherwise
37507+ # it will coredump.
37508+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
37509+ ;;
37510+
37511+ sysv4*MP*)
37512+ if test -d /usr/nec; then
37513+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
37514+ fi
37515+ ;;
37516+
37517+ *)
37518+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37519+ ;;
37520+ esac
37521+
37522+ case $cc_basename in
37523+ nvcc*) # Cuda Compiler Driver 2.2
37524+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
37525+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
37526+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
37527+ fi
37528+ ;;
37529+ esac
37530+ else
37531+ # PORTME Check for flag to pass linker flags through the system compiler.
37532+ case $host_os in
37533+ aix*)
37534+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37535+ if test "$host_cpu" = ia64; then
37536+ # AIX 5 now supports IA64 processor
37537+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37538+ else
37539+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
37540+ fi
37541+ ;;
37542+
37543+ mingw* | cygwin* | pw32* | os2* | cegcc*)
37544+ # This hack is so that the source file can tell whether it is being
37545+ # built for inclusion in a dll (and should export symbols for example).
37546+ m4_if([$1], [GCJ], [],
37547+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
37548+ ;;
37549+
37550+ hpux9* | hpux10* | hpux11*)
37551+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37552+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
37553+ # not for PA HP-UX.
37554+ case $host_cpu in
37555+ hppa*64*|ia64*)
37556+ # +Z the default
37557+ ;;
37558+ *)
37559+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
37560+ ;;
37561+ esac
37562+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
37563+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
37564+ ;;
37565+
37566+ irix5* | irix6* | nonstopux*)
37567+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37568+ # PIC (with -KPIC) is the default.
37569+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37570+ ;;
37571+
37572+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
37573+ case $cc_basename in
37574+ # old Intel for x86_64 which still supported -KPIC.
37575+ ecc*)
37576+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37577+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37578+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37579+ ;;
37580+ # icc used to be incompatible with GCC.
37581+ # ICC 10 doesn't accept -KPIC any more.
37582+ icc* | ifort*)
37583+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37584+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37585+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37586+ ;;
37587+ # Lahey Fortran 8.1.
37588+ lf95*)
37589+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37590+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
37591+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
37592+ ;;
37593+ nagfor*)
37594+ # NAG Fortran compiler
37595+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
37596+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
37597+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37598+ ;;
37599+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
37600+ # Portland Group compilers (*not* the Pentium gcc compiler,
37601+ # which looks to be a dead project)
37602+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37603+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
37604+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37605+ ;;
37606+ ccc*)
37607+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37608+ # All Alpha code is PIC.
37609+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37610+ ;;
37611+ xl* | bgxl* | bgf* | mpixl*)
37612+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
37613+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37614+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
37615+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
37616+ ;;
37617+ *)
37618+ case `$CC -V 2>&1 | sed 5q` in
37619+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
37620+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
37621+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37622+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37623+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
37624+ ;;
37625+ *Sun\ F* | *Sun*Fortran*)
37626+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37627+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37628+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
37629+ ;;
37630+ *Sun\ C*)
37631+ # Sun C 5.9
37632+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37633+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37634+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37635+ ;;
37636+ *Intel*\ [[CF]]*Compiler*)
37637+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37638+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
37639+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
37640+ ;;
37641+ *Portland\ Group*)
37642+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37643+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
37644+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37645+ ;;
37646+ esac
37647+ ;;
37648+ esac
37649+ ;;
37650+
37651+ newsos6)
37652+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37653+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37654+ ;;
37655+
37656+ *nto* | *qnx*)
37657+ # QNX uses GNU C++, but need to define -shared option too, otherwise
37658+ # it will coredump.
37659+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
37660+ ;;
37661+
37662+ osf3* | osf4* | osf5*)
37663+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37664+ # All OSF/1 code is PIC.
37665+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37666+ ;;
37667+
37668+ rdos*)
37669+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
37670+ ;;
37671+
37672+ solaris*)
37673+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37674+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37675+ case $cc_basename in
37676+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
37677+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
37678+ *)
37679+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
37680+ esac
37681+ ;;
37682+
37683+ sunos4*)
37684+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
37685+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
37686+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37687+ ;;
37688+
37689+ sysv4 | sysv4.2uw2* | sysv4.3*)
37690+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37691+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37692+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37693+ ;;
37694+
37695+ sysv4*MP*)
37696+ if test -d /usr/nec ;then
37697+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
37698+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37699+ fi
37700+ ;;
37701+
37702+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
37703+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37704+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
37705+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37706+ ;;
37707+
37708+ unicos*)
37709+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
37710+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
37711+ ;;
37712+
37713+ uts4*)
37714+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
37715+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
37716+ ;;
37717+
37718+ *)
37719+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
37720+ ;;
37721+ esac
37722+ fi
37723+])
37724+case $host_os in
37725+ # For platforms which do not support PIC, -DPIC is meaningless:
37726+ *djgpp*)
37727+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
37728+ ;;
37729+ *)
37730+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
37731+ ;;
37732+esac
37733+
37734+AC_CACHE_CHECK([for $compiler option to produce PIC],
37735+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
37736+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
37737+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
37738+
37739+#
37740+# Check to make sure the PIC flag actually works.
37741+#
37742+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
37743+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
37744+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
37745+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
37746+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
37747+ "" | " "*) ;;
37748+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
37749+ esac],
37750+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
37751+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
37752+fi
37753+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
37754+ [Additional compiler flags for building library objects])
37755+
37756+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
37757+ [How to pass a linker flag through the compiler])
37758+#
37759+# Check to make sure the static flag actually works.
37760+#
37761+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
37762+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
37763+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
37764+ $lt_tmp_static_flag,
37765+ [],
37766+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
37767+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
37768+ [Compiler flag to prevent dynamic linking])
37769+])# _LT_COMPILER_PIC
37770+
37771+
37772+# _LT_LINKER_SHLIBS([TAGNAME])
37773+# ----------------------------
37774+# See if the linker supports building shared libraries.
37775+m4_defun([_LT_LINKER_SHLIBS],
37776+[AC_REQUIRE([LT_PATH_LD])dnl
37777+AC_REQUIRE([LT_PATH_NM])dnl
37778+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
37779+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
37780+m4_require([_LT_DECL_EGREP])dnl
37781+m4_require([_LT_DECL_SED])dnl
37782+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
37783+m4_require([_LT_TAG_COMPILER])dnl
37784+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
37785+m4_if([$1], [CXX], [
37786+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
37787+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
37788+ case $host_os in
37789+ aix[[4-9]]*)
37790+ # If we're using GNU nm, then we don't want the "-C" option.
37791+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
37792+ # Also, AIX nm treats weak defined symbols like other global defined
37793+ # symbols, whereas GNU nm marks them as "W".
37794+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
37795+ _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'
37796+ else
37797+ _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'
37798+ fi
37799+ ;;
37800+ pw32*)
37801+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
37802+ ;;
37803+ cygwin* | mingw* | cegcc*)
37804+ case $cc_basename in
37805+ cl*)
37806+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
37807+ ;;
37808+ *)
37809+ _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'
37810+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
37811+ ;;
37812+ esac
37813+ ;;
37814+ linux* | k*bsd*-gnu | gnu*)
37815+ _LT_TAGVAR(link_all_deplibs, $1)=no
37816+ ;;
37817+ *)
37818+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
37819+ ;;
37820+ esac
37821+], [
37822+ runpath_var=
37823+ _LT_TAGVAR(allow_undefined_flag, $1)=
37824+ _LT_TAGVAR(always_export_symbols, $1)=no
37825+ _LT_TAGVAR(archive_cmds, $1)=
37826+ _LT_TAGVAR(archive_expsym_cmds, $1)=
37827+ _LT_TAGVAR(compiler_needs_object, $1)=no
37828+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
37829+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
37830+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
37831+ _LT_TAGVAR(hardcode_automatic, $1)=no
37832+ _LT_TAGVAR(hardcode_direct, $1)=no
37833+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
37834+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
37835+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
37836+ _LT_TAGVAR(hardcode_minus_L, $1)=no
37837+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
37838+ _LT_TAGVAR(inherit_rpath, $1)=no
37839+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
37840+ _LT_TAGVAR(module_cmds, $1)=
37841+ _LT_TAGVAR(module_expsym_cmds, $1)=
37842+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
37843+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
37844+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
37845+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
37846+ # include_expsyms should be a list of space-separated symbols to be *always*
37847+ # included in the symbol list
37848+ _LT_TAGVAR(include_expsyms, $1)=
37849+ # exclude_expsyms can be an extended regexp of symbols to exclude
37850+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
37851+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
37852+ # as well as any symbol that contains `d'.
37853+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
37854+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
37855+ # platforms (ab)use it in PIC code, but their linkers get confused if
37856+ # the symbol is explicitly referenced. Since portable code cannot
37857+ # rely on this symbol name, it's probably fine to never include it in
37858+ # preloaded symbol tables.
37859+ # Exclude shared library initialization/finalization symbols.
37860+dnl Note also adjust exclude_expsyms for C++ above.
37861+ extract_expsyms_cmds=
37862+
37863+ case $host_os in
37864+ cygwin* | mingw* | pw32* | cegcc*)
37865+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
37866+ # When not using gcc, we currently assume that we are using
37867+ # Microsoft Visual C++.
37868+ if test "$GCC" != yes; then
37869+ with_gnu_ld=no
37870+ fi
37871+ ;;
37872+ interix*)
37873+ # we just hope/assume this is gcc and not c89 (= MSVC++)
37874+ with_gnu_ld=yes
37875+ ;;
37876+ openbsd*)
37877+ with_gnu_ld=no
37878+ ;;
37879+ linux* | k*bsd*-gnu | gnu*)
37880+ _LT_TAGVAR(link_all_deplibs, $1)=no
37881+ ;;
37882+ esac
37883+
37884+ _LT_TAGVAR(ld_shlibs, $1)=yes
37885+
37886+ # On some targets, GNU ld is compatible enough with the native linker
37887+ # that we're better off using the native interface for both.
37888+ lt_use_gnu_ld_interface=no
37889+ if test "$with_gnu_ld" = yes; then
37890+ case $host_os in
37891+ aix*)
37892+ # The AIX port of GNU ld has always aspired to compatibility
37893+ # with the native linker. However, as the warning in the GNU ld
37894+ # block says, versions before 2.19.5* couldn't really create working
37895+ # shared libraries, regardless of the interface used.
37896+ case `$LD -v 2>&1` in
37897+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
37898+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
37899+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
37900+ *)
37901+ lt_use_gnu_ld_interface=yes
37902+ ;;
37903+ esac
37904+ ;;
37905+ *)
37906+ lt_use_gnu_ld_interface=yes
37907+ ;;
37908+ esac
37909+ fi
37910+
37911+ if test "$lt_use_gnu_ld_interface" = yes; then
37912+ # If archive_cmds runs LD, not CC, wlarc should be empty
37913+ wlarc='${wl}'
37914+
37915+ # Set some defaults for GNU ld with shared library support. These
37916+ # are reset later if shared libraries are not supported. Putting them
37917+ # here allows them to be overridden if necessary.
37918+ runpath_var=LD_RUN_PATH
37919+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
37920+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
37921+ # ancient GNU ld didn't support --whole-archive et. al.
37922+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
37923+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
37924+ else
37925+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
37926+ fi
37927+ supports_anon_versioning=no
37928+ case `$LD -v 2>&1` in
37929+ *GNU\ gold*) supports_anon_versioning=yes ;;
37930+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
37931+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
37932+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
37933+ *\ 2.11.*) ;; # other 2.11 versions
37934+ *) supports_anon_versioning=yes ;;
37935+ esac
37936+
37937+ # See if GNU ld supports shared libraries.
37938+ case $host_os in
37939+ aix[[3-9]]*)
37940+ # On AIX/PPC, the GNU linker is very broken
37941+ if test "$host_cpu" != ia64; then
37942+ _LT_TAGVAR(ld_shlibs, $1)=no
37943+ cat <<_LT_EOF 1>&2
37944+
37945+*** Warning: the GNU linker, at least up to release 2.19, is reported
37946+*** to be unable to reliably create shared libraries on AIX.
37947+*** Therefore, libtool is disabling shared libraries support. If you
37948+*** really care for shared libraries, you may want to install binutils
37949+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
37950+*** You will then need to restart the configuration process.
37951+
37952+_LT_EOF
37953+ fi
37954+ ;;
37955+
37956+ amigaos*)
37957+ case $host_cpu in
37958+ powerpc)
37959+ # see comment about AmigaOS4 .so support
37960+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
37961+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
37962+ ;;
37963+ m68k)
37964+ _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)'
37965+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
37966+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
37967+ ;;
37968+ esac
37969+ ;;
37970+
37971+ beos*)
37972+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
37973+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
37974+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
37975+ # support --undefined. This deserves some investigation. FIXME
37976+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
37977+ else
37978+ _LT_TAGVAR(ld_shlibs, $1)=no
37979+ fi
37980+ ;;
37981+
37982+ cygwin* | mingw* | pw32* | cegcc*)
37983+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
37984+ # as there is no search path for DLLs.
37985+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
37986+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
37987+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
37988+ _LT_TAGVAR(always_export_symbols, $1)=no
37989+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
37990+ _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'
37991+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
37992+
37993+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
37994+ _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'
37995+ # If the export-symbols file already is a .def file (1st line
37996+ # is EXPORTS), use it as is; otherwise, prepend...
37997+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
37998+ cp $export_symbols $output_objdir/$soname.def;
37999+ else
38000+ echo EXPORTS > $output_objdir/$soname.def;
38001+ cat $export_symbols >> $output_objdir/$soname.def;
38002+ fi~
38003+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
38004+ else
38005+ _LT_TAGVAR(ld_shlibs, $1)=no
38006+ fi
38007+ ;;
38008+
38009+ haiku*)
38010+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
38011+ _LT_TAGVAR(link_all_deplibs, $1)=yes
38012+ ;;
38013+
38014+ interix[[3-9]]*)
38015+ _LT_TAGVAR(hardcode_direct, $1)=no
38016+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38017+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
38018+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
38019+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
38020+ # Instead, shared libraries are loaded at an image base (0x10000000 by
38021+ # default) and relocated if they conflict, which is a slow very memory
38022+ # consuming and fragmenting process. To avoid this, we pick a random,
38023+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
38024+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
38025+ _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'
38026+ _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'
38027+ ;;
38028+
38029+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
38030+ tmp_diet=no
38031+ if test "$host_os" = linux-dietlibc; then
38032+ case $cc_basename in
38033+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
38034+ esac
38035+ fi
38036+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
38037+ && test "$tmp_diet" = no
38038+ then
38039+ tmp_addflag=' $pic_flag'
38040+ tmp_sharedflag='-shared'
38041+ case $cc_basename,$host_cpu in
38042+ pgcc*) # Portland Group C compiler
38043+ _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'
38044+ tmp_addflag=' $pic_flag'
38045+ ;;
38046+ pgf77* | pgf90* | pgf95* | pgfortran*)
38047+ # Portland Group f77 and f90 compilers
38048+ _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'
38049+ tmp_addflag=' $pic_flag -Mnomain' ;;
38050+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
38051+ tmp_addflag=' -i_dynamic' ;;
38052+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
38053+ tmp_addflag=' -i_dynamic -nofor_main' ;;
38054+ ifc* | ifort*) # Intel Fortran compiler
38055+ tmp_addflag=' -nofor_main' ;;
38056+ lf95*) # Lahey Fortran 8.1
38057+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
38058+ tmp_sharedflag='--shared' ;;
38059+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
38060+ tmp_sharedflag='-qmkshrobj'
38061+ tmp_addflag= ;;
38062+ nvcc*) # Cuda Compiler Driver 2.2
38063+ _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'
38064+ _LT_TAGVAR(compiler_needs_object, $1)=yes
38065+ ;;
38066+ esac
38067+ case `$CC -V 2>&1 | sed 5q` in
38068+ *Sun\ C*) # Sun C 5.9
38069+ _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'
38070+ _LT_TAGVAR(compiler_needs_object, $1)=yes
38071+ tmp_sharedflag='-G' ;;
38072+ *Sun\ F*) # Sun Fortran 8.3
38073+ tmp_sharedflag='-G' ;;
38074+ esac
38075+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
38076+
38077+ if test "x$supports_anon_versioning" = xyes; then
38078+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
38079+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
38080+ echo "local: *; };" >> $output_objdir/$libname.ver~
38081+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
38082+ fi
38083+
38084+ case $cc_basename in
38085+ xlf* | bgf* | bgxlf* | mpixlf*)
38086+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
38087+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
38088+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
38089+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
38090+ if test "x$supports_anon_versioning" = xyes; then
38091+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
38092+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
38093+ echo "local: *; };" >> $output_objdir/$libname.ver~
38094+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
38095+ fi
38096+ ;;
38097+ esac
38098+ else
38099+ _LT_TAGVAR(ld_shlibs, $1)=no
38100+ fi
38101+ ;;
38102+
38103+ netbsd* | netbsdelf*-gnu)
38104+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
38105+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
38106+ wlarc=
38107+ else
38108+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
38109+ _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'
38110+ fi
38111+ ;;
38112+
38113+ solaris*)
38114+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
38115+ _LT_TAGVAR(ld_shlibs, $1)=no
38116+ cat <<_LT_EOF 1>&2
38117+
38118+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
38119+*** create shared libraries on Solaris systems. Therefore, libtool
38120+*** is disabling shared libraries support. We urge you to upgrade GNU
38121+*** binutils to release 2.9.1 or newer. Another option is to modify
38122+*** your PATH or compiler configuration so that the native linker is
38123+*** used, and then restart.
38124+
38125+_LT_EOF
38126+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
38127+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
38128+ _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'
38129+ else
38130+ _LT_TAGVAR(ld_shlibs, $1)=no
38131+ fi
38132+ ;;
38133+
38134+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
38135+ case `$LD -v 2>&1` in
38136+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
38137+ _LT_TAGVAR(ld_shlibs, $1)=no
38138+ cat <<_LT_EOF 1>&2
38139+
38140+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
38141+*** reliably create shared libraries on SCO systems. Therefore, libtool
38142+*** is disabling shared libraries support. We urge you to upgrade GNU
38143+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
38144+*** your PATH or compiler configuration so that the native linker is
38145+*** used, and then restart.
38146+
38147+_LT_EOF
38148+ ;;
38149+ *)
38150+ # For security reasons, it is highly recommended that you always
38151+ # use absolute paths for naming shared libraries, and exclude the
38152+ # DT_RUNPATH tag from executables and libraries. But doing so
38153+ # requires that you compile everything twice, which is a pain.
38154+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
38155+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
38156+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
38157+ _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'
38158+ else
38159+ _LT_TAGVAR(ld_shlibs, $1)=no
38160+ fi
38161+ ;;
38162+ esac
38163+ ;;
38164+
38165+ sunos4*)
38166+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
38167+ wlarc=
38168+ _LT_TAGVAR(hardcode_direct, $1)=yes
38169+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38170+ ;;
38171+
38172+ *)
38173+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
38174+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
38175+ _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'
38176+ else
38177+ _LT_TAGVAR(ld_shlibs, $1)=no
38178+ fi
38179+ ;;
38180+ esac
38181+
38182+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
38183+ runpath_var=
38184+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
38185+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
38186+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
38187+ fi
38188+ else
38189+ # PORTME fill in a description of your system's linker (not GNU ld)
38190+ case $host_os in
38191+ aix3*)
38192+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
38193+ _LT_TAGVAR(always_export_symbols, $1)=yes
38194+ _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'
38195+ # Note: this linker hardcodes the directories in LIBPATH if there
38196+ # are no directories specified by -L.
38197+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38198+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
38199+ # Neither direct hardcoding nor static linking is supported with a
38200+ # broken collect2.
38201+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
38202+ fi
38203+ ;;
38204+
38205+ aix[[4-9]]*)
38206+ if test "$host_cpu" = ia64; then
38207+ # On IA64, the linker does run time linking by default, so we don't
38208+ # have to do anything special.
38209+ aix_use_runtimelinking=no
38210+ exp_sym_flag='-Bexport'
38211+ no_entry_flag=""
38212+ else
38213+ # If we're using GNU nm, then we don't want the "-C" option.
38214+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
38215+ # Also, AIX nm treats weak defined symbols like other global
38216+ # defined symbols, whereas GNU nm marks them as "W".
38217+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
38218+ _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'
38219+ else
38220+ _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'
38221+ fi
38222+ aix_use_runtimelinking=no
38223+
38224+ # Test if we are trying to use run time linking or normal
38225+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
38226+ # need to do runtime linking.
38227+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
38228+ for ld_flag in $LDFLAGS; do
38229+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
38230+ aix_use_runtimelinking=yes
38231+ break
38232+ fi
38233+ done
38234+ ;;
38235+ esac
38236+
38237+ exp_sym_flag='-bexport'
38238+ no_entry_flag='-bnoentry'
38239+ fi
38240+
38241+ # When large executables or shared objects are built, AIX ld can
38242+ # have problems creating the table of contents. If linking a library
38243+ # or program results in "error TOC overflow" add -mminimal-toc to
38244+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
38245+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
38246+
38247+ _LT_TAGVAR(archive_cmds, $1)=''
38248+ _LT_TAGVAR(hardcode_direct, $1)=yes
38249+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
38250+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
38251+ _LT_TAGVAR(link_all_deplibs, $1)=yes
38252+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
38253+
38254+ if test "$GCC" = yes; then
38255+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
38256+ # We only want to do this on AIX 4.2 and lower, the check
38257+ # below for broken collect2 doesn't work under 4.3+
38258+ collect2name=`${CC} -print-prog-name=collect2`
38259+ if test -f "$collect2name" &&
38260+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
38261+ then
38262+ # We have reworked collect2
38263+ :
38264+ else
38265+ # We have old collect2
38266+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
38267+ # It fails to find uninstalled libraries when the uninstalled
38268+ # path is not listed in the libpath. Setting hardcode_minus_L
38269+ # to unsupported forces relinking
38270+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38271+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
38272+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
38273+ fi
38274+ ;;
38275+ esac
38276+ shared_flag='-shared'
38277+ if test "$aix_use_runtimelinking" = yes; then
38278+ shared_flag="$shared_flag "'${wl}-G'
38279+ fi
38280+ _LT_TAGVAR(link_all_deplibs, $1)=no
38281+ else
38282+ # not using gcc
38283+ if test "$host_cpu" = ia64; then
38284+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
38285+ # chokes on -Wl,-G. The following line is correct:
38286+ shared_flag='-G'
38287+ else
38288+ if test "$aix_use_runtimelinking" = yes; then
38289+ shared_flag='${wl}-G'
38290+ else
38291+ shared_flag='${wl}-bM:SRE'
38292+ fi
38293+ fi
38294+ fi
38295+
38296+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
38297+ # It seems that -bexpall does not export symbols beginning with
38298+ # underscore (_), so it is better to generate a list of symbols to export.
38299+ _LT_TAGVAR(always_export_symbols, $1)=yes
38300+ if test "$aix_use_runtimelinking" = yes; then
38301+ # Warning - without using the other runtime loading flags (-brtl),
38302+ # -berok will link without error, but may produce a broken library.
38303+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
38304+ # Determine the default libpath from the value encoded in an
38305+ # empty executable.
38306+ _LT_SYS_MODULE_PATH_AIX([$1])
38307+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
38308+ _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"
38309+ else
38310+ if test "$host_cpu" = ia64; then
38311+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
38312+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
38313+ _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"
38314+ else
38315+ # Determine the default libpath from the value encoded in an
38316+ # empty executable.
38317+ _LT_SYS_MODULE_PATH_AIX([$1])
38318+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
38319+ # Warning - without using the other run time loading flags,
38320+ # -berok will link without error, but may produce a broken library.
38321+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
38322+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
38323+ if test "$with_gnu_ld" = yes; then
38324+ # We only use this code for GNU lds that support --whole-archive.
38325+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
38326+ else
38327+ # Exported symbols can be pulled into shared objects from archives
38328+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
38329+ fi
38330+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
38331+ # This is similar to how AIX traditionally builds its shared libraries.
38332+ _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'
38333+ fi
38334+ fi
38335+ ;;
38336+
38337+ amigaos*)
38338+ case $host_cpu in
38339+ powerpc)
38340+ # see comment about AmigaOS4 .so support
38341+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
38342+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
38343+ ;;
38344+ m68k)
38345+ _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)'
38346+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
38347+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38348+ ;;
38349+ esac
38350+ ;;
38351+
38352+ bsdi[[45]]*)
38353+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
38354+ ;;
38355+
38356+ cygwin* | mingw* | pw32* | cegcc*)
38357+ # When not using gcc, we currently assume that we are using
38358+ # Microsoft Visual C++.
38359+ # hardcode_libdir_flag_spec is actually meaningless, as there is
38360+ # no search path for DLLs.
38361+ case $cc_basename in
38362+ cl*)
38363+ # Native MSVC
38364+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
38365+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
38366+ _LT_TAGVAR(always_export_symbols, $1)=yes
38367+ _LT_TAGVAR(file_list_spec, $1)='@'
38368+ # Tell ltmain to make .lib files, not .a files.
38369+ libext=lib
38370+ # Tell ltmain to make .dll files, not .so files.
38371+ shrext_cmds=".dll"
38372+ # FIXME: Setting linknames here is a bad hack.
38373+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
38374+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
38375+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
38376+ else
38377+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
38378+ fi~
38379+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
38380+ linknames='
38381+ # The linker will not automatically build a static lib if we build a DLL.
38382+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
38383+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
38384+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
38385+ _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'
38386+ # Don't use ranlib
38387+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
38388+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
38389+ lt_tool_outputfile="@TOOL_OUTPUT@"~
38390+ case $lt_outputfile in
38391+ *.exe|*.EXE) ;;
38392+ *)
38393+ lt_outputfile="$lt_outputfile.exe"
38394+ lt_tool_outputfile="$lt_tool_outputfile.exe"
38395+ ;;
38396+ esac~
38397+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
38398+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
38399+ $RM "$lt_outputfile.manifest";
38400+ fi'
38401+ ;;
38402+ *)
38403+ # Assume MSVC wrapper
38404+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
38405+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
38406+ # Tell ltmain to make .lib files, not .a files.
38407+ libext=lib
38408+ # Tell ltmain to make .dll files, not .so files.
38409+ shrext_cmds=".dll"
38410+ # FIXME: Setting linknames here is a bad hack.
38411+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
38412+ # The linker will automatically build a .lib file if we build a DLL.
38413+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
38414+ # FIXME: Should let the user specify the lib program.
38415+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
38416+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
38417+ ;;
38418+ esac
38419+ ;;
38420+
38421+ darwin* | rhapsody*)
38422+ _LT_DARWIN_LINKER_FEATURES($1)
38423+ ;;
38424+
38425+ dgux*)
38426+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
38427+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
38428+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38429+ ;;
38430+
38431+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
38432+ # support. Future versions do this automatically, but an explicit c++rt0.o
38433+ # does not break anything, and helps significantly (at the cost of a little
38434+ # extra space).
38435+ freebsd2.2*)
38436+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
38437+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
38438+ _LT_TAGVAR(hardcode_direct, $1)=yes
38439+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38440+ ;;
38441+
38442+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
38443+ freebsd2.*)
38444+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
38445+ _LT_TAGVAR(hardcode_direct, $1)=yes
38446+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38447+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38448+ ;;
38449+
38450+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
38451+ freebsd* | dragonfly*)
38452+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
38453+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
38454+ _LT_TAGVAR(hardcode_direct, $1)=yes
38455+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38456+ ;;
38457+
38458+ hpux9*)
38459+ if test "$GCC" = yes; then
38460+ _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'
38461+ else
38462+ _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'
38463+ fi
38464+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
38465+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
38466+ _LT_TAGVAR(hardcode_direct, $1)=yes
38467+
38468+ # hardcode_minus_L: Not really in the search PATH,
38469+ # but as the default location of the library.
38470+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38471+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
38472+ ;;
38473+
38474+ hpux10*)
38475+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
38476+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
38477+ else
38478+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
38479+ fi
38480+ if test "$with_gnu_ld" = no; then
38481+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
38482+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
38483+ _LT_TAGVAR(hardcode_direct, $1)=yes
38484+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
38485+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
38486+ # hardcode_minus_L: Not really in the search PATH,
38487+ # but as the default location of the library.
38488+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38489+ fi
38490+ ;;
38491+
38492+ hpux11*)
38493+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
38494+ case $host_cpu in
38495+ hppa*64*)
38496+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
38497+ ;;
38498+ ia64*)
38499+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
38500+ ;;
38501+ *)
38502+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
38503+ ;;
38504+ esac
38505+ else
38506+ case $host_cpu in
38507+ hppa*64*)
38508+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
38509+ ;;
38510+ ia64*)
38511+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
38512+ ;;
38513+ *)
38514+ m4_if($1, [], [
38515+ # Older versions of the 11.00 compiler do not understand -b yet
38516+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
38517+ _LT_LINKER_OPTION([if $CC understands -b],
38518+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
38519+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
38520+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
38521+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
38522+ ;;
38523+ esac
38524+ fi
38525+ if test "$with_gnu_ld" = no; then
38526+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
38527+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
38528+
38529+ case $host_cpu in
38530+ hppa*64*|ia64*)
38531+ _LT_TAGVAR(hardcode_direct, $1)=no
38532+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38533+ ;;
38534+ *)
38535+ _LT_TAGVAR(hardcode_direct, $1)=yes
38536+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
38537+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
38538+
38539+ # hardcode_minus_L: Not really in the search PATH,
38540+ # but as the default location of the library.
38541+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38542+ ;;
38543+ esac
38544+ fi
38545+ ;;
38546+
38547+ irix5* | irix6* | nonstopux*)
38548+ if test "$GCC" = yes; then
38549+ _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'
38550+ # Try to use the -exported_symbol ld option, if it does not
38551+ # work, assume that -exports_file does not work either and
38552+ # implicitly export all symbols.
38553+ # This should be the same for all languages, so no per-tag cache variable.
38554+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
38555+ [lt_cv_irix_exported_symbol],
38556+ [save_LDFLAGS="$LDFLAGS"
38557+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
38558+ AC_LINK_IFELSE(
38559+ [AC_LANG_SOURCE(
38560+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
38561+ [C++], [[int foo (void) { return 0; }]],
38562+ [Fortran 77], [[
38563+ subroutine foo
38564+ end]],
38565+ [Fortran], [[
38566+ subroutine foo
38567+ end]])])],
38568+ [lt_cv_irix_exported_symbol=yes],
38569+ [lt_cv_irix_exported_symbol=no])
38570+ LDFLAGS="$save_LDFLAGS"])
38571+ if test "$lt_cv_irix_exported_symbol" = yes; then
38572+ _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'
38573+ fi
38574+ else
38575+ _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'
38576+ _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'
38577+ fi
38578+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
38579+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
38580+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
38581+ _LT_TAGVAR(inherit_rpath, $1)=yes
38582+ _LT_TAGVAR(link_all_deplibs, $1)=yes
38583+ ;;
38584+
38585+ netbsd* | netbsdelf*-gnu)
38586+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
38587+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
38588+ else
38589+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
38590+ fi
38591+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
38592+ _LT_TAGVAR(hardcode_direct, $1)=yes
38593+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38594+ ;;
38595+
38596+ newsos6)
38597+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
38598+ _LT_TAGVAR(hardcode_direct, $1)=yes
38599+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
38600+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
38601+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38602+ ;;
38603+
38604+ *nto* | *qnx*)
38605+ ;;
38606+
38607+ openbsd*)
38608+ if test -f /usr/libexec/ld.so; then
38609+ _LT_TAGVAR(hardcode_direct, $1)=yes
38610+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38611+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
38612+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
38613+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
38614+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
38615+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
38616+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
38617+ else
38618+ case $host_os in
38619+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
38620+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
38621+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
38622+ ;;
38623+ *)
38624+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
38625+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
38626+ ;;
38627+ esac
38628+ fi
38629+ else
38630+ _LT_TAGVAR(ld_shlibs, $1)=no
38631+ fi
38632+ ;;
38633+
38634+ os2*)
38635+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
38636+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38637+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
38638+ _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'
38639+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
38640+ ;;
38641+
38642+ osf3*)
38643+ if test "$GCC" = yes; then
38644+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
38645+ _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'
38646+ else
38647+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
38648+ _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'
38649+ fi
38650+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
38651+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
38652+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
38653+ ;;
38654+
38655+ osf4* | osf5*) # as osf3* with the addition of -msym flag
38656+ if test "$GCC" = yes; then
38657+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
38658+ _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'
38659+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
38660+ else
38661+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
38662+ _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'
38663+ _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~
38664+ $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'
38665+
38666+ # Both c and cxx compiler support -rpath directly
38667+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
38668+ fi
38669+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
38670+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
38671+ ;;
38672+
38673+ solaris*)
38674+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
38675+ if test "$GCC" = yes; then
38676+ wlarc='${wl}'
38677+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
38678+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
38679+ $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'
38680+ else
38681+ case `$CC -V 2>&1` in
38682+ *"Compilers 5.0"*)
38683+ wlarc=''
38684+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
38685+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
38686+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
38687+ ;;
38688+ *)
38689+ wlarc='${wl}'
38690+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
38691+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
38692+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
38693+ ;;
38694+ esac
38695+ fi
38696+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
38697+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38698+ case $host_os in
38699+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
38700+ *)
38701+ # The compiler driver will combine and reorder linker options,
38702+ # but understands `-z linker_flag'. GCC discards it without `$wl',
38703+ # but is careful enough not to reorder.
38704+ # Supported since Solaris 2.6 (maybe 2.5.1?)
38705+ if test "$GCC" = yes; then
38706+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
38707+ else
38708+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
38709+ fi
38710+ ;;
38711+ esac
38712+ _LT_TAGVAR(link_all_deplibs, $1)=yes
38713+ ;;
38714+
38715+ sunos4*)
38716+ if test "x$host_vendor" = xsequent; then
38717+ # Use $CC to link under sequent, because it throws in some extra .o
38718+ # files that make .init and .fini sections work.
38719+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
38720+ else
38721+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
38722+ fi
38723+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
38724+ _LT_TAGVAR(hardcode_direct, $1)=yes
38725+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
38726+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38727+ ;;
38728+
38729+ sysv4)
38730+ case $host_vendor in
38731+ sni)
38732+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
38733+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
38734+ ;;
38735+ siemens)
38736+ ## LD is ld it makes a PLAMLIB
38737+ ## CC just makes a GrossModule.
38738+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
38739+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
38740+ _LT_TAGVAR(hardcode_direct, $1)=no
38741+ ;;
38742+ motorola)
38743+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
38744+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
38745+ ;;
38746+ esac
38747+ runpath_var='LD_RUN_PATH'
38748+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38749+ ;;
38750+
38751+ sysv4.3*)
38752+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
38753+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38754+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
38755+ ;;
38756+
38757+ sysv4*MP*)
38758+ if test -d /usr/nec; then
38759+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
38760+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38761+ runpath_var=LD_RUN_PATH
38762+ hardcode_runpath_var=yes
38763+ _LT_TAGVAR(ld_shlibs, $1)=yes
38764+ fi
38765+ ;;
38766+
38767+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
38768+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
38769+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
38770+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38771+ runpath_var='LD_RUN_PATH'
38772+
38773+ if test "$GCC" = yes; then
38774+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38775+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38776+ else
38777+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38778+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38779+ fi
38780+ ;;
38781+
38782+ sysv5* | sco3.2v5* | sco5v6*)
38783+ # Note: We can NOT use -z defs as we might desire, because we do not
38784+ # link with -lc, and that would cause any symbols used from libc to
38785+ # always be unresolved, which means just about no library would
38786+ # ever link correctly. If we're not using GNU ld we use -z text
38787+ # though, which does catch some bad symbols but isn't as heavy-handed
38788+ # as -z defs.
38789+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
38790+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
38791+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
38792+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38793+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
38794+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
38795+ _LT_TAGVAR(link_all_deplibs, $1)=yes
38796+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
38797+ runpath_var='LD_RUN_PATH'
38798+
38799+ if test "$GCC" = yes; then
38800+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38801+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38802+ else
38803+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38804+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
38805+ fi
38806+ ;;
38807+
38808+ uts4*)
38809+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
38810+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
38811+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
38812+ ;;
38813+
38814+ *)
38815+ _LT_TAGVAR(ld_shlibs, $1)=no
38816+ ;;
38817+ esac
38818+
38819+ if test x$host_vendor = xsni; then
38820+ case $host in
38821+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
38822+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
38823+ ;;
38824+ esac
38825+ fi
38826+ fi
38827+])
38828+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
38829+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
38830+
38831+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
38832+
38833+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
38834+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
38835+_LT_DECL([], [extract_expsyms_cmds], [2],
38836+ [The commands to extract the exported symbol list from a shared archive])
38837+
38838+#
38839+# Do we need to explicitly link libc?
38840+#
38841+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
38842+x|xyes)
38843+ # Assume -lc should be added
38844+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
38845+
38846+ if test "$enable_shared" = yes && test "$GCC" = yes; then
38847+ case $_LT_TAGVAR(archive_cmds, $1) in
38848+ *'~'*)
38849+ # FIXME: we may have to deal with multi-command sequences.
38850+ ;;
38851+ '$CC '*)
38852+ # Test whether the compiler implicitly links with -lc since on some
38853+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
38854+ # to ld, don't add -lc before -lgcc.
38855+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
38856+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
38857+ [$RM conftest*
38858+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
38859+
38860+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
38861+ soname=conftest
38862+ lib=conftest
38863+ libobjs=conftest.$ac_objext
38864+ deplibs=
38865+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
38866+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
38867+ compiler_flags=-v
38868+ linker_flags=-v
38869+ verstring=
38870+ output_objdir=.
38871+ libname=conftest
38872+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
38873+ _LT_TAGVAR(allow_undefined_flag, $1)=
38874+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
38875+ then
38876+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
38877+ else
38878+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
38879+ fi
38880+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
38881+ else
38882+ cat conftest.err 1>&5
38883+ fi
38884+ $RM conftest*
38885+ ])
38886+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
38887+ ;;
38888+ esac
38889+ fi
38890+ ;;
38891+esac
38892+
38893+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
38894+ [Whether or not to add -lc for building shared libraries])
38895+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
38896+ [enable_shared_with_static_runtimes], [0],
38897+ [Whether or not to disallow shared libs when runtime libs are static])
38898+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
38899+ [Compiler flag to allow reflexive dlopens])
38900+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
38901+ [Compiler flag to generate shared objects directly from archives])
38902+_LT_TAGDECL([], [compiler_needs_object], [1],
38903+ [Whether the compiler copes with passing no objects directly])
38904+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
38905+ [Create an old-style archive from a shared archive])
38906+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
38907+ [Create a temporary old-style archive to link instead of a shared archive])
38908+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
38909+_LT_TAGDECL([], [archive_expsym_cmds], [2])
38910+_LT_TAGDECL([], [module_cmds], [2],
38911+ [Commands used to build a loadable module if different from building
38912+ a shared archive.])
38913+_LT_TAGDECL([], [module_expsym_cmds], [2])
38914+_LT_TAGDECL([], [with_gnu_ld], [1],
38915+ [Whether we are building with GNU ld or not])
38916+_LT_TAGDECL([], [allow_undefined_flag], [1],
38917+ [Flag that allows shared libraries with undefined symbols to be built])
38918+_LT_TAGDECL([], [no_undefined_flag], [1],
38919+ [Flag that enforces no undefined symbols])
38920+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
38921+ [Flag to hardcode $libdir into a binary during linking.
38922+ This must work even if $libdir does not exist])
38923+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
38924+ [Whether we need a single "-rpath" flag with a separated argument])
38925+_LT_TAGDECL([], [hardcode_direct], [0],
38926+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
38927+ DIR into the resulting binary])
38928+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
38929+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
38930+ DIR into the resulting binary and the resulting library dependency is
38931+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
38932+ library is relocated])
38933+_LT_TAGDECL([], [hardcode_minus_L], [0],
38934+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
38935+ into the resulting binary])
38936+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
38937+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
38938+ into the resulting binary])
38939+_LT_TAGDECL([], [hardcode_automatic], [0],
38940+ [Set to "yes" if building a shared library automatically hardcodes DIR
38941+ into the library and all subsequent libraries and executables linked
38942+ against it])
38943+_LT_TAGDECL([], [inherit_rpath], [0],
38944+ [Set to yes if linker adds runtime paths of dependent libraries
38945+ to runtime path list])
38946+_LT_TAGDECL([], [link_all_deplibs], [0],
38947+ [Whether libtool must link a program against all its dependency libraries])
38948+_LT_TAGDECL([], [always_export_symbols], [0],
38949+ [Set to "yes" if exported symbols are required])
38950+_LT_TAGDECL([], [export_symbols_cmds], [2],
38951+ [The commands to list exported symbols])
38952+_LT_TAGDECL([], [exclude_expsyms], [1],
38953+ [Symbols that should not be listed in the preloaded symbols])
38954+_LT_TAGDECL([], [include_expsyms], [1],
38955+ [Symbols that must always be exported])
38956+_LT_TAGDECL([], [prelink_cmds], [2],
38957+ [Commands necessary for linking programs (against libraries) with templates])
38958+_LT_TAGDECL([], [postlink_cmds], [2],
38959+ [Commands necessary for finishing linking programs])
38960+_LT_TAGDECL([], [file_list_spec], [1],
38961+ [Specify filename containing input files])
38962+dnl FIXME: Not yet implemented
38963+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
38964+dnl [Compiler flag to generate thread safe objects])
38965+])# _LT_LINKER_SHLIBS
38966+
38967+
38968+# _LT_LANG_C_CONFIG([TAG])
38969+# ------------------------
38970+# Ensure that the configuration variables for a C compiler are suitably
38971+# defined. These variables are subsequently used by _LT_CONFIG to write
38972+# the compiler configuration to `libtool'.
38973+m4_defun([_LT_LANG_C_CONFIG],
38974+[m4_require([_LT_DECL_EGREP])dnl
38975+lt_save_CC="$CC"
38976+AC_LANG_PUSH(C)
38977+
38978+# Source file extension for C test sources.
38979+ac_ext=c
38980+
38981+# Object file extension for compiled C test sources.
38982+objext=o
38983+_LT_TAGVAR(objext, $1)=$objext
38984+
38985+# Code to be used in simple compile tests
38986+lt_simple_compile_test_code="int some_variable = 0;"
38987+
38988+# Code to be used in simple link tests
38989+lt_simple_link_test_code='int main(){return(0);}'
38990+
38991+_LT_TAG_COMPILER
38992+# Save the default compiler, since it gets overwritten when the other
38993+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
38994+compiler_DEFAULT=$CC
38995+
38996+# save warnings/boilerplate of simple test code
38997+_LT_COMPILER_BOILERPLATE
38998+_LT_LINKER_BOILERPLATE
38999+
39000+## CAVEAT EMPTOR:
39001+## There is no encapsulation within the following macros, do not change
39002+## the running order or otherwise move them around unless you know exactly
39003+## what you are doing...
39004+if test -n "$compiler"; then
39005+ _LT_COMPILER_NO_RTTI($1)
39006+ _LT_COMPILER_PIC($1)
39007+ _LT_COMPILER_C_O($1)
39008+ _LT_COMPILER_FILE_LOCKS($1)
39009+ _LT_LINKER_SHLIBS($1)
39010+ _LT_SYS_DYNAMIC_LINKER($1)
39011+ _LT_LINKER_HARDCODE_LIBPATH($1)
39012+ LT_SYS_DLOPEN_SELF
39013+ _LT_CMD_STRIPLIB
39014+
39015+ # Report which library types will actually be built
39016+ AC_MSG_CHECKING([if libtool supports shared libraries])
39017+ AC_MSG_RESULT([$can_build_shared])
39018+
39019+ AC_MSG_CHECKING([whether to build shared libraries])
39020+ test "$can_build_shared" = "no" && enable_shared=no
39021+
39022+ # On AIX, shared libraries and static libraries use the same namespace, and
39023+ # are all built from PIC.
39024+ case $host_os in
39025+ aix3*)
39026+ test "$enable_shared" = yes && enable_static=no
39027+ if test -n "$RANLIB"; then
39028+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
39029+ postinstall_cmds='$RANLIB $lib'
39030+ fi
39031+ ;;
39032+
39033+ aix[[4-9]]*)
39034+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
39035+ test "$enable_shared" = yes && enable_static=no
39036+ fi
39037+ ;;
39038+ esac
39039+ AC_MSG_RESULT([$enable_shared])
39040+
39041+ AC_MSG_CHECKING([whether to build static libraries])
39042+ # Make sure either enable_shared or enable_static is yes.
39043+ test "$enable_shared" = yes || enable_static=yes
39044+ AC_MSG_RESULT([$enable_static])
39045+
39046+ _LT_CONFIG($1)
39047+fi
39048+AC_LANG_POP
39049+CC="$lt_save_CC"
39050+])# _LT_LANG_C_CONFIG
39051+
39052+
39053+# _LT_LANG_CXX_CONFIG([TAG])
39054+# --------------------------
39055+# Ensure that the configuration variables for a C++ compiler are suitably
39056+# defined. These variables are subsequently used by _LT_CONFIG to write
39057+# the compiler configuration to `libtool'.
39058+m4_defun([_LT_LANG_CXX_CONFIG],
39059+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
39060+m4_require([_LT_DECL_EGREP])dnl
39061+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
39062+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
39063+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
39064+ (test "X$CXX" != "Xg++"))) ; then
39065+ AC_PROG_CXXCPP
39066+else
39067+ _lt_caught_CXX_error=yes
39068+fi
39069+
39070+AC_LANG_PUSH(C++)
39071+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
39072+_LT_TAGVAR(allow_undefined_flag, $1)=
39073+_LT_TAGVAR(always_export_symbols, $1)=no
39074+_LT_TAGVAR(archive_expsym_cmds, $1)=
39075+_LT_TAGVAR(compiler_needs_object, $1)=no
39076+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
39077+_LT_TAGVAR(hardcode_direct, $1)=no
39078+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
39079+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
39080+_LT_TAGVAR(hardcode_libdir_separator, $1)=
39081+_LT_TAGVAR(hardcode_minus_L, $1)=no
39082+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
39083+_LT_TAGVAR(hardcode_automatic, $1)=no
39084+_LT_TAGVAR(inherit_rpath, $1)=no
39085+_LT_TAGVAR(module_cmds, $1)=
39086+_LT_TAGVAR(module_expsym_cmds, $1)=
39087+_LT_TAGVAR(link_all_deplibs, $1)=unknown
39088+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
39089+_LT_TAGVAR(reload_flag, $1)=$reload_flag
39090+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
39091+_LT_TAGVAR(no_undefined_flag, $1)=
39092+_LT_TAGVAR(whole_archive_flag_spec, $1)=
39093+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
39094+
39095+# Source file extension for C++ test sources.
39096+ac_ext=cpp
39097+
39098+# Object file extension for compiled C++ test sources.
39099+objext=o
39100+_LT_TAGVAR(objext, $1)=$objext
39101+
39102+# No sense in running all these tests if we already determined that
39103+# the CXX compiler isn't working. Some variables (like enable_shared)
39104+# are currently assumed to apply to all compilers on this platform,
39105+# and will be corrupted by setting them based on a non-working compiler.
39106+if test "$_lt_caught_CXX_error" != yes; then
39107+ # Code to be used in simple compile tests
39108+ lt_simple_compile_test_code="int some_variable = 0;"
39109+
39110+ # Code to be used in simple link tests
39111+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
39112+
39113+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
39114+ _LT_TAG_COMPILER
39115+
39116+ # save warnings/boilerplate of simple test code
39117+ _LT_COMPILER_BOILERPLATE
39118+ _LT_LINKER_BOILERPLATE
39119+
39120+ # Allow CC to be a program name with arguments.
39121+ lt_save_CC=$CC
39122+ lt_save_CFLAGS=$CFLAGS
39123+ lt_save_LD=$LD
39124+ lt_save_GCC=$GCC
39125+ GCC=$GXX
39126+ lt_save_with_gnu_ld=$with_gnu_ld
39127+ lt_save_path_LD=$lt_cv_path_LD
39128+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
39129+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
39130+ else
39131+ $as_unset lt_cv_prog_gnu_ld
39132+ fi
39133+ if test -n "${lt_cv_path_LDCXX+set}"; then
39134+ lt_cv_path_LD=$lt_cv_path_LDCXX
39135+ else
39136+ $as_unset lt_cv_path_LD
39137+ fi
39138+ test -z "${LDCXX+set}" || LD=$LDCXX
39139+ CC=${CXX-"c++"}
39140+ CFLAGS=$CXXFLAGS
39141+ compiler=$CC
39142+ _LT_TAGVAR(compiler, $1)=$CC
39143+ _LT_CC_BASENAME([$compiler])
39144+
39145+ if test -n "$compiler"; then
39146+ # We don't want -fno-exception when compiling C++ code, so set the
39147+ # no_builtin_flag separately
39148+ if test "$GXX" = yes; then
39149+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
39150+ else
39151+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
39152+ fi
39153+
39154+ if test "$GXX" = yes; then
39155+ # Set up default GNU C++ configuration
39156+
39157+ LT_PATH_LD
39158+
39159+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
39160+ # archiving commands below assume that GNU ld is being used.
39161+ if test "$with_gnu_ld" = yes; then
39162+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
39163+ _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'
39164+
39165+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
39166+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
39167+
39168+ # If archive_cmds runs LD, not CC, wlarc should be empty
39169+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
39170+ # investigate it a little bit more. (MM)
39171+ wlarc='${wl}'
39172+
39173+ # ancient GNU ld didn't support --whole-archive et. al.
39174+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
39175+ $GREP 'no-whole-archive' > /dev/null; then
39176+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
39177+ else
39178+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
39179+ fi
39180+ else
39181+ with_gnu_ld=no
39182+ wlarc=
39183+
39184+ # A generic and very simple default shared library creation
39185+ # command for GNU C++ for the case where it uses the native
39186+ # linker, instead of GNU ld. If possible, this setting should
39187+ # overridden to take advantage of the native linker features on
39188+ # the platform it is being used on.
39189+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
39190+ fi
39191+
39192+ # Commands to make compiler produce verbose output that lists
39193+ # what "hidden" libraries, object files and flags are used when
39194+ # linking a shared library.
39195+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
39196+
39197+ else
39198+ GXX=no
39199+ with_gnu_ld=no
39200+ wlarc=
39201+ fi
39202+
39203+ # PORTME: fill in a description of your system's C++ link characteristics
39204+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
39205+ _LT_TAGVAR(ld_shlibs, $1)=yes
39206+ case $host_os in
39207+ aix3*)
39208+ # FIXME: insert proper C++ library support
39209+ _LT_TAGVAR(ld_shlibs, $1)=no
39210+ ;;
39211+ aix[[4-9]]*)
39212+ if test "$host_cpu" = ia64; then
39213+ # On IA64, the linker does run time linking by default, so we don't
39214+ # have to do anything special.
39215+ aix_use_runtimelinking=no
39216+ exp_sym_flag='-Bexport'
39217+ no_entry_flag=""
39218+ else
39219+ aix_use_runtimelinking=no
39220+
39221+ # Test if we are trying to use run time linking or normal
39222+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
39223+ # need to do runtime linking.
39224+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
39225+ for ld_flag in $LDFLAGS; do
39226+ case $ld_flag in
39227+ *-brtl*)
39228+ aix_use_runtimelinking=yes
39229+ break
39230+ ;;
39231+ esac
39232+ done
39233+ ;;
39234+ esac
39235+
39236+ exp_sym_flag='-bexport'
39237+ no_entry_flag='-bnoentry'
39238+ fi
39239+
39240+ # When large executables or shared objects are built, AIX ld can
39241+ # have problems creating the table of contents. If linking a library
39242+ # or program results in "error TOC overflow" add -mminimal-toc to
39243+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
39244+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
39245+
39246+ _LT_TAGVAR(archive_cmds, $1)=''
39247+ _LT_TAGVAR(hardcode_direct, $1)=yes
39248+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
39249+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
39250+ _LT_TAGVAR(link_all_deplibs, $1)=yes
39251+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
39252+
39253+ if test "$GXX" = yes; then
39254+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
39255+ # We only want to do this on AIX 4.2 and lower, the check
39256+ # below for broken collect2 doesn't work under 4.3+
39257+ collect2name=`${CC} -print-prog-name=collect2`
39258+ if test -f "$collect2name" &&
39259+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
39260+ then
39261+ # We have reworked collect2
39262+ :
39263+ else
39264+ # We have old collect2
39265+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
39266+ # It fails to find uninstalled libraries when the uninstalled
39267+ # path is not listed in the libpath. Setting hardcode_minus_L
39268+ # to unsupported forces relinking
39269+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
39270+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
39271+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
39272+ fi
39273+ esac
39274+ shared_flag='-shared'
39275+ if test "$aix_use_runtimelinking" = yes; then
39276+ shared_flag="$shared_flag "'${wl}-G'
39277+ fi
39278+ else
39279+ # not using gcc
39280+ if test "$host_cpu" = ia64; then
39281+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
39282+ # chokes on -Wl,-G. The following line is correct:
39283+ shared_flag='-G'
39284+ else
39285+ if test "$aix_use_runtimelinking" = yes; then
39286+ shared_flag='${wl}-G'
39287+ else
39288+ shared_flag='${wl}-bM:SRE'
39289+ fi
39290+ fi
39291+ fi
39292+
39293+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
39294+ # It seems that -bexpall does not export symbols beginning with
39295+ # underscore (_), so it is better to generate a list of symbols to
39296+ # export.
39297+ _LT_TAGVAR(always_export_symbols, $1)=yes
39298+ if test "$aix_use_runtimelinking" = yes; then
39299+ # Warning - without using the other runtime loading flags (-brtl),
39300+ # -berok will link without error, but may produce a broken library.
39301+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
39302+ # Determine the default libpath from the value encoded in an empty
39303+ # executable.
39304+ _LT_SYS_MODULE_PATH_AIX([$1])
39305+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
39306+
39307+ _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"
39308+ else
39309+ if test "$host_cpu" = ia64; then
39310+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
39311+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
39312+ _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"
39313+ else
39314+ # Determine the default libpath from the value encoded in an
39315+ # empty executable.
39316+ _LT_SYS_MODULE_PATH_AIX([$1])
39317+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
39318+ # Warning - without using the other run time loading flags,
39319+ # -berok will link without error, but may produce a broken library.
39320+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
39321+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
39322+ if test "$with_gnu_ld" = yes; then
39323+ # We only use this code for GNU lds that support --whole-archive.
39324+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
39325+ else
39326+ # Exported symbols can be pulled into shared objects from archives
39327+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
39328+ fi
39329+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
39330+ # This is similar to how AIX traditionally builds its shared
39331+ # libraries.
39332+ _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'
39333+ fi
39334+ fi
39335+ ;;
39336+
39337+ beos*)
39338+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
39339+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
39340+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
39341+ # support --undefined. This deserves some investigation. FIXME
39342+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
39343+ else
39344+ _LT_TAGVAR(ld_shlibs, $1)=no
39345+ fi
39346+ ;;
39347+
39348+ chorus*)
39349+ case $cc_basename in
39350+ *)
39351+ # FIXME: insert proper C++ library support
39352+ _LT_TAGVAR(ld_shlibs, $1)=no
39353+ ;;
39354+ esac
39355+ ;;
39356+
39357+ cygwin* | mingw* | pw32* | cegcc*)
39358+ case $GXX,$cc_basename in
39359+ ,cl* | no,cl*)
39360+ # Native MSVC
39361+ # hardcode_libdir_flag_spec is actually meaningless, as there is
39362+ # no search path for DLLs.
39363+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
39364+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
39365+ _LT_TAGVAR(always_export_symbols, $1)=yes
39366+ _LT_TAGVAR(file_list_spec, $1)='@'
39367+ # Tell ltmain to make .lib files, not .a files.
39368+ libext=lib
39369+ # Tell ltmain to make .dll files, not .so files.
39370+ shrext_cmds=".dll"
39371+ # FIXME: Setting linknames here is a bad hack.
39372+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
39373+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
39374+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
39375+ else
39376+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
39377+ fi~
39378+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
39379+ linknames='
39380+ # The linker will not automatically build a static lib if we build a DLL.
39381+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
39382+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
39383+ # Don't use ranlib
39384+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
39385+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
39386+ lt_tool_outputfile="@TOOL_OUTPUT@"~
39387+ case $lt_outputfile in
39388+ *.exe|*.EXE) ;;
39389+ *)
39390+ lt_outputfile="$lt_outputfile.exe"
39391+ lt_tool_outputfile="$lt_tool_outputfile.exe"
39392+ ;;
39393+ esac~
39394+ func_to_tool_file "$lt_outputfile"~
39395+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
39396+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
39397+ $RM "$lt_outputfile.manifest";
39398+ fi'
39399+ ;;
39400+ *)
39401+ # g++
39402+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
39403+ # as there is no search path for DLLs.
39404+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
39405+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
39406+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
39407+ _LT_TAGVAR(always_export_symbols, $1)=no
39408+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
39409+
39410+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
39411+ _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'
39412+ # If the export-symbols file already is a .def file (1st line
39413+ # is EXPORTS), use it as is; otherwise, prepend...
39414+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
39415+ cp $export_symbols $output_objdir/$soname.def;
39416+ else
39417+ echo EXPORTS > $output_objdir/$soname.def;
39418+ cat $export_symbols >> $output_objdir/$soname.def;
39419+ fi~
39420+ $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'
39421+ else
39422+ _LT_TAGVAR(ld_shlibs, $1)=no
39423+ fi
39424+ ;;
39425+ esac
39426+ ;;
39427+ darwin* | rhapsody*)
39428+ _LT_DARWIN_LINKER_FEATURES($1)
39429+ ;;
39430+
39431+ dgux*)
39432+ case $cc_basename in
39433+ ec++*)
39434+ # FIXME: insert proper C++ library support
39435+ _LT_TAGVAR(ld_shlibs, $1)=no
39436+ ;;
39437+ ghcx*)
39438+ # Green Hills C++ Compiler
39439+ # FIXME: insert proper C++ library support
39440+ _LT_TAGVAR(ld_shlibs, $1)=no
39441+ ;;
39442+ *)
39443+ # FIXME: insert proper C++ library support
39444+ _LT_TAGVAR(ld_shlibs, $1)=no
39445+ ;;
39446+ esac
39447+ ;;
39448+
39449+ freebsd2.*)
39450+ # C++ shared libraries reported to be fairly broken before
39451+ # switch to ELF
39452+ _LT_TAGVAR(ld_shlibs, $1)=no
39453+ ;;
39454+
39455+ freebsd-elf*)
39456+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
39457+ ;;
39458+
39459+ freebsd* | dragonfly*)
39460+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
39461+ # conventions
39462+ _LT_TAGVAR(ld_shlibs, $1)=yes
39463+ ;;
39464+
39465+ gnu*)
39466+ ;;
39467+
39468+ haiku*)
39469+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
39470+ _LT_TAGVAR(link_all_deplibs, $1)=yes
39471+ ;;
39472+
39473+ hpux9*)
39474+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
39475+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
39476+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
39477+ _LT_TAGVAR(hardcode_direct, $1)=yes
39478+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
39479+ # but as the default
39480+ # location of the library.
39481+
39482+ case $cc_basename in
39483+ CC*)
39484+ # FIXME: insert proper C++ library support
39485+ _LT_TAGVAR(ld_shlibs, $1)=no
39486+ ;;
39487+ aCC*)
39488+ _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'
39489+ # Commands to make compiler produce verbose output that lists
39490+ # what "hidden" libraries, object files and flags are used when
39491+ # linking a shared library.
39492+ #
39493+ # There doesn't appear to be a way to prevent this compiler from
39494+ # explicitly linking system object files so we need to strip them
39495+ # from the output so that they don't get included in the library
39496+ # dependencies.
39497+ 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"'
39498+ ;;
39499+ *)
39500+ if test "$GXX" = yes; then
39501+ _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'
39502+ else
39503+ # FIXME: insert proper C++ library support
39504+ _LT_TAGVAR(ld_shlibs, $1)=no
39505+ fi
39506+ ;;
39507+ esac
39508+ ;;
39509+
39510+ hpux10*|hpux11*)
39511+ if test $with_gnu_ld = no; then
39512+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
39513+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
39514+
39515+ case $host_cpu in
39516+ hppa*64*|ia64*)
39517+ ;;
39518+ *)
39519+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
39520+ ;;
39521+ esac
39522+ fi
39523+ case $host_cpu in
39524+ hppa*64*|ia64*)
39525+ _LT_TAGVAR(hardcode_direct, $1)=no
39526+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
39527+ ;;
39528+ *)
39529+ _LT_TAGVAR(hardcode_direct, $1)=yes
39530+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
39531+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
39532+ # but as the default
39533+ # location of the library.
39534+ ;;
39535+ esac
39536+
39537+ case $cc_basename in
39538+ CC*)
39539+ # FIXME: insert proper C++ library support
39540+ _LT_TAGVAR(ld_shlibs, $1)=no
39541+ ;;
39542+ aCC*)
39543+ case $host_cpu in
39544+ hppa*64*)
39545+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
39546+ ;;
39547+ ia64*)
39548+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
39549+ ;;
39550+ *)
39551+ _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'
39552+ ;;
39553+ esac
39554+ # Commands to make compiler produce verbose output that lists
39555+ # what "hidden" libraries, object files and flags are used when
39556+ # linking a shared library.
39557+ #
39558+ # There doesn't appear to be a way to prevent this compiler from
39559+ # explicitly linking system object files so we need to strip them
39560+ # from the output so that they don't get included in the library
39561+ # dependencies.
39562+ 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"'
39563+ ;;
39564+ *)
39565+ if test "$GXX" = yes; then
39566+ if test $with_gnu_ld = no; then
39567+ case $host_cpu in
39568+ hppa*64*)
39569+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
39570+ ;;
39571+ ia64*)
39572+ _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'
39573+ ;;
39574+ *)
39575+ _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'
39576+ ;;
39577+ esac
39578+ fi
39579+ else
39580+ # FIXME: insert proper C++ library support
39581+ _LT_TAGVAR(ld_shlibs, $1)=no
39582+ fi
39583+ ;;
39584+ esac
39585+ ;;
39586+
39587+ interix[[3-9]]*)
39588+ _LT_TAGVAR(hardcode_direct, $1)=no
39589+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
39590+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
39591+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
39592+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
39593+ # Instead, shared libraries are loaded at an image base (0x10000000 by
39594+ # default) and relocated if they conflict, which is a slow very memory
39595+ # consuming and fragmenting process. To avoid this, we pick a random,
39596+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
39597+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
39598+ _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'
39599+ _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'
39600+ ;;
39601+ irix5* | irix6*)
39602+ case $cc_basename in
39603+ CC*)
39604+ # SGI C++
39605+ _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'
39606+
39607+ # Archives containing C++ object files must be created using
39608+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
39609+ # necessary to make sure instantiated templates are included
39610+ # in the archive.
39611+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
39612+ ;;
39613+ *)
39614+ if test "$GXX" = yes; then
39615+ if test "$with_gnu_ld" = no; then
39616+ _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'
39617+ else
39618+ _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'
39619+ fi
39620+ fi
39621+ _LT_TAGVAR(link_all_deplibs, $1)=yes
39622+ ;;
39623+ esac
39624+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
39625+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
39626+ _LT_TAGVAR(inherit_rpath, $1)=yes
39627+ ;;
39628+
39629+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
39630+ case $cc_basename in
39631+ KCC*)
39632+ # Kuck and Associates, Inc. (KAI) C++ Compiler
39633+
39634+ # KCC will only create a shared library if the output file
39635+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
39636+ # to its proper name (with version) after linking.
39637+ _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'
39638+ _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'
39639+ # Commands to make compiler produce verbose output that lists
39640+ # what "hidden" libraries, object files and flags are used when
39641+ # linking a shared library.
39642+ #
39643+ # There doesn't appear to be a way to prevent this compiler from
39644+ # explicitly linking system object files so we need to strip them
39645+ # from the output so that they don't get included in the library
39646+ # dependencies.
39647+ 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"'
39648+
39649+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
39650+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
39651+
39652+ # Archives containing C++ object files must be created using
39653+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
39654+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
39655+ ;;
39656+ icpc* | ecpc* )
39657+ # Intel C++
39658+ with_gnu_ld=yes
39659+ # version 8.0 and above of icpc choke on multiply defined symbols
39660+ # if we add $predep_objects and $postdep_objects, however 7.1 and
39661+ # earlier do not add the objects themselves.
39662+ case `$CC -V 2>&1` in
39663+ *"Version 7."*)
39664+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
39665+ _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'
39666+ ;;
39667+ *) # Version 8.0 or newer
39668+ tmp_idyn=
39669+ case $host_cpu in
39670+ ia64*) tmp_idyn=' -i_dynamic';;
39671+ esac
39672+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
39673+ _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'
39674+ ;;
39675+ esac
39676+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
39677+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
39678+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
39679+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
39680+ ;;
39681+ pgCC* | pgcpp*)
39682+ # Portland Group C++ compiler
39683+ case `$CC -V` in
39684+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
39685+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
39686+ rm -rf $tpldir~
39687+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
39688+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
39689+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
39690+ rm -rf $tpldir~
39691+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
39692+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
39693+ $RANLIB $oldlib'
39694+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
39695+ rm -rf $tpldir~
39696+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
39697+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
39698+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
39699+ rm -rf $tpldir~
39700+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
39701+ $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'
39702+ ;;
39703+ *) # Version 6 and above use weak symbols
39704+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
39705+ _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'
39706+ ;;
39707+ esac
39708+
39709+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
39710+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
39711+ _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'
39712+ ;;
39713+ cxx*)
39714+ # Compaq C++
39715+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
39716+ _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'
39717+
39718+ runpath_var=LD_RUN_PATH
39719+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
39720+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
39721+
39722+ # Commands to make compiler produce verbose output that lists
39723+ # what "hidden" libraries, object files and flags are used when
39724+ # linking a shared library.
39725+ #
39726+ # There doesn't appear to be a way to prevent this compiler from
39727+ # explicitly linking system object files so we need to strip them
39728+ # from the output so that they don't get included in the library
39729+ # dependencies.
39730+ 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'
39731+ ;;
39732+ xl* | mpixl* | bgxl*)
39733+ # IBM XL 8.0 on PPC, with GNU ld
39734+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
39735+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
39736+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
39737+ if test "x$supports_anon_versioning" = xyes; then
39738+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
39739+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
39740+ echo "local: *; };" >> $output_objdir/$libname.ver~
39741+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
39742+ fi
39743+ ;;
39744+ *)
39745+ case `$CC -V 2>&1 | sed 5q` in
39746+ *Sun\ C*)
39747+ # Sun C++ 5.9
39748+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
39749+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
39750+ _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'
39751+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
39752+ _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'
39753+ _LT_TAGVAR(compiler_needs_object, $1)=yes
39754+
39755+ # Not sure whether something based on
39756+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
39757+ # would be better.
39758+ output_verbose_link_cmd='func_echo_all'
39759+
39760+ # Archives containing C++ object files must be created using
39761+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
39762+ # necessary to make sure instantiated templates are included
39763+ # in the archive.
39764+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
39765+ ;;
39766+ esac
39767+ ;;
39768+ esac
39769+ ;;
39770+
39771+ lynxos*)
39772+ # FIXME: insert proper C++ library support
39773+ _LT_TAGVAR(ld_shlibs, $1)=no
39774+ ;;
39775+
39776+ m88k*)
39777+ # FIXME: insert proper C++ library support
39778+ _LT_TAGVAR(ld_shlibs, $1)=no
39779+ ;;
39780+
39781+ mvs*)
39782+ case $cc_basename in
39783+ cxx*)
39784+ # FIXME: insert proper C++ library support
39785+ _LT_TAGVAR(ld_shlibs, $1)=no
39786+ ;;
39787+ *)
39788+ # FIXME: insert proper C++ library support
39789+ _LT_TAGVAR(ld_shlibs, $1)=no
39790+ ;;
39791+ esac
39792+ ;;
39793+
39794+ netbsd*)
39795+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
39796+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
39797+ wlarc=
39798+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
39799+ _LT_TAGVAR(hardcode_direct, $1)=yes
39800+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
39801+ fi
39802+ # Workaround some broken pre-1.5 toolchains
39803+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
39804+ ;;
39805+
39806+ *nto* | *qnx*)
39807+ _LT_TAGVAR(ld_shlibs, $1)=yes
39808+ ;;
39809+
39810+ openbsd2*)
39811+ # C++ shared libraries are fairly broken
39812+ _LT_TAGVAR(ld_shlibs, $1)=no
39813+ ;;
39814+
39815+ openbsd*)
39816+ if test -f /usr/libexec/ld.so; then
39817+ _LT_TAGVAR(hardcode_direct, $1)=yes
39818+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
39819+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
39820+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
39821+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
39822+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
39823+ _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'
39824+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
39825+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
39826+ fi
39827+ output_verbose_link_cmd=func_echo_all
39828+ else
39829+ _LT_TAGVAR(ld_shlibs, $1)=no
39830+ fi
39831+ ;;
39832+
39833+ osf3* | osf4* | osf5*)
39834+ case $cc_basename in
39835+ KCC*)
39836+ # Kuck and Associates, Inc. (KAI) C++ Compiler
39837+
39838+ # KCC will only create a shared library if the output file
39839+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
39840+ # to its proper name (with version) after linking.
39841+ _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'
39842+
39843+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
39844+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
39845+
39846+ # Archives containing C++ object files must be created using
39847+ # the KAI C++ compiler.
39848+ case $host in
39849+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
39850+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
39851+ esac
39852+ ;;
39853+ RCC*)
39854+ # Rational C++ 2.4.1
39855+ # FIXME: insert proper C++ library support
39856+ _LT_TAGVAR(ld_shlibs, $1)=no
39857+ ;;
39858+ cxx*)
39859+ case $host in
39860+ osf3*)
39861+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
39862+ _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'
39863+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
39864+ ;;
39865+ *)
39866+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
39867+ _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'
39868+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
39869+ echo "-hidden">> $lib.exp~
39870+ $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~
39871+ $RM $lib.exp'
39872+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
39873+ ;;
39874+ esac
39875+
39876+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
39877+
39878+ # Commands to make compiler produce verbose output that lists
39879+ # what "hidden" libraries, object files and flags are used when
39880+ # linking a shared library.
39881+ #
39882+ # There doesn't appear to be a way to prevent this compiler from
39883+ # explicitly linking system object files so we need to strip them
39884+ # from the output so that they don't get included in the library
39885+ # dependencies.
39886+ 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"'
39887+ ;;
39888+ *)
39889+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
39890+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
39891+ case $host in
39892+ osf3*)
39893+ _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'
39894+ ;;
39895+ *)
39896+ _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'
39897+ ;;
39898+ esac
39899+
39900+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
39901+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
39902+
39903+ # Commands to make compiler produce verbose output that lists
39904+ # what "hidden" libraries, object files and flags are used when
39905+ # linking a shared library.
39906+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
39907+
39908+ else
39909+ # FIXME: insert proper C++ library support
39910+ _LT_TAGVAR(ld_shlibs, $1)=no
39911+ fi
39912+ ;;
39913+ esac
39914+ ;;
39915+
39916+ psos*)
39917+ # FIXME: insert proper C++ library support
39918+ _LT_TAGVAR(ld_shlibs, $1)=no
39919+ ;;
39920+
39921+ sunos4*)
39922+ case $cc_basename in
39923+ CC*)
39924+ # Sun C++ 4.x
39925+ # FIXME: insert proper C++ library support
39926+ _LT_TAGVAR(ld_shlibs, $1)=no
39927+ ;;
39928+ lcc*)
39929+ # Lucid
39930+ # FIXME: insert proper C++ library support
39931+ _LT_TAGVAR(ld_shlibs, $1)=no
39932+ ;;
39933+ *)
39934+ # FIXME: insert proper C++ library support
39935+ _LT_TAGVAR(ld_shlibs, $1)=no
39936+ ;;
39937+ esac
39938+ ;;
39939+
39940+ solaris*)
39941+ case $cc_basename in
39942+ CC* | sunCC*)
39943+ # Sun C++ 4.2, 5.x and Centerline C++
39944+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
39945+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
39946+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
39947+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
39948+ $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'
39949+
39950+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
39951+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
39952+ case $host_os in
39953+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
39954+ *)
39955+ # The compiler driver will combine and reorder linker options,
39956+ # but understands `-z linker_flag'.
39957+ # Supported since Solaris 2.6 (maybe 2.5.1?)
39958+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
39959+ ;;
39960+ esac
39961+ _LT_TAGVAR(link_all_deplibs, $1)=yes
39962+
39963+ output_verbose_link_cmd='func_echo_all'
39964+
39965+ # Archives containing C++ object files must be created using
39966+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
39967+ # necessary to make sure instantiated templates are included
39968+ # in the archive.
39969+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
39970+ ;;
39971+ gcx*)
39972+ # Green Hills C++ Compiler
39973+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
39974+
39975+ # The C++ compiler must be used to create the archive.
39976+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
39977+ ;;
39978+ *)
39979+ # GNU C++ compiler with Solaris linker
39980+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
39981+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
39982+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
39983+ _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'
39984+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
39985+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
39986+
39987+ # Commands to make compiler produce verbose output that lists
39988+ # what "hidden" libraries, object files and flags are used when
39989+ # linking a shared library.
39990+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
39991+ else
39992+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
39993+ # platform.
39994+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
39995+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
39996+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
39997+
39998+ # Commands to make compiler produce verbose output that lists
39999+ # what "hidden" libraries, object files and flags are used when
40000+ # linking a shared library.
40001+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
40002+ fi
40003+
40004+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
40005+ case $host_os in
40006+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
40007+ *)
40008+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
40009+ ;;
40010+ esac
40011+ fi
40012+ ;;
40013+ esac
40014+ ;;
40015+
40016+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
40017+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
40018+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
40019+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
40020+ runpath_var='LD_RUN_PATH'
40021+
40022+ case $cc_basename in
40023+ CC*)
40024+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40025+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40026+ ;;
40027+ *)
40028+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40029+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40030+ ;;
40031+ esac
40032+ ;;
40033+
40034+ sysv5* | sco3.2v5* | sco5v6*)
40035+ # Note: We can NOT use -z defs as we might desire, because we do not
40036+ # link with -lc, and that would cause any symbols used from libc to
40037+ # always be unresolved, which means just about no library would
40038+ # ever link correctly. If we're not using GNU ld we use -z text
40039+ # though, which does catch some bad symbols but isn't as heavy-handed
40040+ # as -z defs.
40041+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
40042+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
40043+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
40044+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
40045+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
40046+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
40047+ _LT_TAGVAR(link_all_deplibs, $1)=yes
40048+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
40049+ runpath_var='LD_RUN_PATH'
40050+
40051+ case $cc_basename in
40052+ CC*)
40053+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40054+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40055+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
40056+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
40057+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
40058+ '"$_LT_TAGVAR(reload_cmds, $1)"
40059+ ;;
40060+ *)
40061+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40062+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
40063+ ;;
40064+ esac
40065+ ;;
40066+
40067+ tandem*)
40068+ case $cc_basename in
40069+ NCC*)
40070+ # NonStop-UX NCC 3.20
40071+ # FIXME: insert proper C++ library support
40072+ _LT_TAGVAR(ld_shlibs, $1)=no
40073+ ;;
40074+ *)
40075+ # FIXME: insert proper C++ library support
40076+ _LT_TAGVAR(ld_shlibs, $1)=no
40077+ ;;
40078+ esac
40079+ ;;
40080+
40081+ vxworks*)
40082+ # FIXME: insert proper C++ library support
40083+ _LT_TAGVAR(ld_shlibs, $1)=no
40084+ ;;
40085+
40086+ *)
40087+ # FIXME: insert proper C++ library support
40088+ _LT_TAGVAR(ld_shlibs, $1)=no
40089+ ;;
40090+ esac
40091+
40092+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
40093+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
40094+
40095+ _LT_TAGVAR(GCC, $1)="$GXX"
40096+ _LT_TAGVAR(LD, $1)="$LD"
40097+
40098+ ## CAVEAT EMPTOR:
40099+ ## There is no encapsulation within the following macros, do not change
40100+ ## the running order or otherwise move them around unless you know exactly
40101+ ## what you are doing...
40102+ _LT_SYS_HIDDEN_LIBDEPS($1)
40103+ _LT_COMPILER_PIC($1)
40104+ _LT_COMPILER_C_O($1)
40105+ _LT_COMPILER_FILE_LOCKS($1)
40106+ _LT_LINKER_SHLIBS($1)
40107+ _LT_SYS_DYNAMIC_LINKER($1)
40108+ _LT_LINKER_HARDCODE_LIBPATH($1)
40109+
40110+ _LT_CONFIG($1)
40111+ fi # test -n "$compiler"
40112+
40113+ CC=$lt_save_CC
40114+ CFLAGS=$lt_save_CFLAGS
40115+ LDCXX=$LD
40116+ LD=$lt_save_LD
40117+ GCC=$lt_save_GCC
40118+ with_gnu_ld=$lt_save_with_gnu_ld
40119+ lt_cv_path_LDCXX=$lt_cv_path_LD
40120+ lt_cv_path_LD=$lt_save_path_LD
40121+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
40122+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
40123+fi # test "$_lt_caught_CXX_error" != yes
40124+
40125+AC_LANG_POP
40126+])# _LT_LANG_CXX_CONFIG
40127+
40128+
40129+# _LT_FUNC_STRIPNAME_CNF
40130+# ----------------------
40131+# func_stripname_cnf prefix suffix name
40132+# strip PREFIX and SUFFIX off of NAME.
40133+# PREFIX and SUFFIX must not contain globbing or regex special
40134+# characters, hashes, percent signs, but SUFFIX may contain a leading
40135+# dot (in which case that matches only a dot).
40136+#
40137+# This function is identical to the (non-XSI) version of func_stripname,
40138+# except this one can be used by m4 code that may be executed by configure,
40139+# rather than the libtool script.
40140+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
40141+AC_REQUIRE([_LT_DECL_SED])
40142+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
40143+func_stripname_cnf ()
40144+{
40145+ case ${2} in
40146+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
40147+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
40148+ esac
40149+} # func_stripname_cnf
40150+])# _LT_FUNC_STRIPNAME_CNF
40151+
40152+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
40153+# ---------------------------------
40154+# Figure out "hidden" library dependencies from verbose
40155+# compiler output when linking a shared library.
40156+# Parse the compiler output and extract the necessary
40157+# objects, libraries and library flags.
40158+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
40159+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
40160+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
40161+# Dependencies to place before and after the object being linked:
40162+_LT_TAGVAR(predep_objects, $1)=
40163+_LT_TAGVAR(postdep_objects, $1)=
40164+_LT_TAGVAR(predeps, $1)=
40165+_LT_TAGVAR(postdeps, $1)=
40166+_LT_TAGVAR(compiler_lib_search_path, $1)=
40167+
40168+dnl we can't use the lt_simple_compile_test_code here,
40169+dnl because it contains code intended for an executable,
40170+dnl not a library. It's possible we should let each
40171+dnl tag define a new lt_????_link_test_code variable,
40172+dnl but it's only used here...
40173+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
40174+int a;
40175+void foo (void) { a = 0; }
40176+_LT_EOF
40177+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
40178+class Foo
40179+{
40180+public:
40181+ Foo (void) { a = 0; }
40182+private:
40183+ int a;
40184+};
40185+_LT_EOF
40186+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
40187+ subroutine foo
40188+ implicit none
40189+ integer*4 a
40190+ a=0
40191+ return
40192+ end
40193+_LT_EOF
40194+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
40195+ subroutine foo
40196+ implicit none
40197+ integer a
40198+ a=0
40199+ return
40200+ end
40201+_LT_EOF
40202+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
40203+public class foo {
40204+ private int a;
40205+ public void bar (void) {
40206+ a = 0;
40207+ }
40208+};
40209+_LT_EOF
40210+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
40211+package foo
40212+func foo() {
40213+}
40214+_LT_EOF
40215+])
40216+
40217+_lt_libdeps_save_CFLAGS=$CFLAGS
40218+case "$CC $CFLAGS " in #(
40219+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
40220+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
40221+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
40222+esac
40223+
40224+dnl Parse the compiler output and extract the necessary
40225+dnl objects, libraries and library flags.
40226+if AC_TRY_EVAL(ac_compile); then
40227+ # Parse the compiler output and extract the necessary
40228+ # objects, libraries and library flags.
40229+
40230+ # Sentinel used to keep track of whether or not we are before
40231+ # the conftest object file.
40232+ pre_test_object_deps_done=no
40233+
40234+ for p in `eval "$output_verbose_link_cmd"`; do
40235+ case ${prev}${p} in
40236+
40237+ -L* | -R* | -l*)
40238+ # Some compilers place space between "-{L,R}" and the path.
40239+ # Remove the space.
40240+ if test $p = "-L" ||
40241+ test $p = "-R"; then
40242+ prev=$p
40243+ continue
40244+ fi
40245+
40246+ # Expand the sysroot to ease extracting the directories later.
40247+ if test -z "$prev"; then
40248+ case $p in
40249+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
40250+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
40251+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
40252+ esac
40253+ fi
40254+ case $p in
40255+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
40256+ esac
40257+ if test "$pre_test_object_deps_done" = no; then
40258+ case ${prev} in
40259+ -L | -R)
40260+ # Internal compiler library paths should come after those
40261+ # provided the user. The postdeps already come after the
40262+ # user supplied libs so there is no need to process them.
40263+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
40264+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
40265+ else
40266+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
40267+ fi
40268+ ;;
40269+ # The "-l" case would never come before the object being
40270+ # linked, so don't bother handling this case.
40271+ esac
40272+ else
40273+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
40274+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
40275+ else
40276+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
40277+ fi
40278+ fi
40279+ prev=
40280+ ;;
40281+
40282+ *.lto.$objext) ;; # Ignore GCC LTO objects
40283+ *.$objext)
40284+ # This assumes that the test object file only shows up
40285+ # once in the compiler output.
40286+ if test "$p" = "conftest.$objext"; then
40287+ pre_test_object_deps_done=yes
40288+ continue
40289+ fi
40290+
40291+ if test "$pre_test_object_deps_done" = no; then
40292+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
40293+ _LT_TAGVAR(predep_objects, $1)="$p"
40294+ else
40295+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
40296+ fi
40297+ else
40298+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
40299+ _LT_TAGVAR(postdep_objects, $1)="$p"
40300+ else
40301+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
40302+ fi
40303+ fi
40304+ ;;
40305+
40306+ *) ;; # Ignore the rest.
40307+
40308+ esac
40309+ done
40310+
40311+ # Clean up.
40312+ rm -f a.out a.exe
40313+else
40314+ echo "libtool.m4: error: problem compiling $1 test program"
40315+fi
40316+
40317+$RM -f confest.$objext
40318+CFLAGS=$_lt_libdeps_save_CFLAGS
40319+
40320+# PORTME: override above test on systems where it is broken
40321+m4_if([$1], [CXX],
40322+[case $host_os in
40323+interix[[3-9]]*)
40324+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
40325+ # hack all around it, let's just trust "g++" to DTRT.
40326+ _LT_TAGVAR(predep_objects,$1)=
40327+ _LT_TAGVAR(postdep_objects,$1)=
40328+ _LT_TAGVAR(postdeps,$1)=
40329+ ;;
40330+
40331+linux*)
40332+ case `$CC -V 2>&1 | sed 5q` in
40333+ *Sun\ C*)
40334+ # Sun C++ 5.9
40335+
40336+ # The more standards-conforming stlport4 library is
40337+ # incompatible with the Cstd library. Avoid specifying
40338+ # it if it's in CXXFLAGS. Ignore libCrun as
40339+ # -library=stlport4 depends on it.
40340+ case " $CXX $CXXFLAGS " in
40341+ *" -library=stlport4 "*)
40342+ solaris_use_stlport4=yes
40343+ ;;
40344+ esac
40345+
40346+ if test "$solaris_use_stlport4" != yes; then
40347+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
40348+ fi
40349+ ;;
40350+ esac
40351+ ;;
40352+
40353+solaris*)
40354+ case $cc_basename in
40355+ CC* | sunCC*)
40356+ # The more standards-conforming stlport4 library is
40357+ # incompatible with the Cstd library. Avoid specifying
40358+ # it if it's in CXXFLAGS. Ignore libCrun as
40359+ # -library=stlport4 depends on it.
40360+ case " $CXX $CXXFLAGS " in
40361+ *" -library=stlport4 "*)
40362+ solaris_use_stlport4=yes
40363+ ;;
40364+ esac
40365+
40366+ # Adding this requires a known-good setup of shared libraries for
40367+ # Sun compiler versions before 5.6, else PIC objects from an old
40368+ # archive will be linked into the output, leading to subtle bugs.
40369+ if test "$solaris_use_stlport4" != yes; then
40370+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
40371+ fi
40372+ ;;
40373+ esac
40374+ ;;
40375+esac
40376+])
40377+
40378+case " $_LT_TAGVAR(postdeps, $1) " in
40379+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
40380+esac
40381+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
40382+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
40383+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
40384+fi
40385+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
40386+ [The directories searched by this compiler when creating a shared library])
40387+_LT_TAGDECL([], [predep_objects], [1],
40388+ [Dependencies to place before and after the objects being linked to
40389+ create a shared library])
40390+_LT_TAGDECL([], [postdep_objects], [1])
40391+_LT_TAGDECL([], [predeps], [1])
40392+_LT_TAGDECL([], [postdeps], [1])
40393+_LT_TAGDECL([], [compiler_lib_search_path], [1],
40394+ [The library search path used internally by the compiler when linking
40395+ a shared library])
40396+])# _LT_SYS_HIDDEN_LIBDEPS
40397+
40398+
40399+# _LT_LANG_F77_CONFIG([TAG])
40400+# --------------------------
40401+# Ensure that the configuration variables for a Fortran 77 compiler are
40402+# suitably defined. These variables are subsequently used by _LT_CONFIG
40403+# to write the compiler configuration to `libtool'.
40404+m4_defun([_LT_LANG_F77_CONFIG],
40405+[AC_LANG_PUSH(Fortran 77)
40406+if test -z "$F77" || test "X$F77" = "Xno"; then
40407+ _lt_disable_F77=yes
40408+fi
40409+
40410+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
40411+_LT_TAGVAR(allow_undefined_flag, $1)=
40412+_LT_TAGVAR(always_export_symbols, $1)=no
40413+_LT_TAGVAR(archive_expsym_cmds, $1)=
40414+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
40415+_LT_TAGVAR(hardcode_direct, $1)=no
40416+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
40417+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
40418+_LT_TAGVAR(hardcode_libdir_separator, $1)=
40419+_LT_TAGVAR(hardcode_minus_L, $1)=no
40420+_LT_TAGVAR(hardcode_automatic, $1)=no
40421+_LT_TAGVAR(inherit_rpath, $1)=no
40422+_LT_TAGVAR(module_cmds, $1)=
40423+_LT_TAGVAR(module_expsym_cmds, $1)=
40424+_LT_TAGVAR(link_all_deplibs, $1)=unknown
40425+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
40426+_LT_TAGVAR(reload_flag, $1)=$reload_flag
40427+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
40428+_LT_TAGVAR(no_undefined_flag, $1)=
40429+_LT_TAGVAR(whole_archive_flag_spec, $1)=
40430+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
40431+
40432+# Source file extension for f77 test sources.
40433+ac_ext=f
40434+
40435+# Object file extension for compiled f77 test sources.
40436+objext=o
40437+_LT_TAGVAR(objext, $1)=$objext
40438+
40439+# No sense in running all these tests if we already determined that
40440+# the F77 compiler isn't working. Some variables (like enable_shared)
40441+# are currently assumed to apply to all compilers on this platform,
40442+# and will be corrupted by setting them based on a non-working compiler.
40443+if test "$_lt_disable_F77" != yes; then
40444+ # Code to be used in simple compile tests
40445+ lt_simple_compile_test_code="\
40446+ subroutine t
40447+ return
40448+ end
40449+"
40450+
40451+ # Code to be used in simple link tests
40452+ lt_simple_link_test_code="\
40453+ program t
40454+ end
40455+"
40456+
40457+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
40458+ _LT_TAG_COMPILER
40459+
40460+ # save warnings/boilerplate of simple test code
40461+ _LT_COMPILER_BOILERPLATE
40462+ _LT_LINKER_BOILERPLATE
40463+
40464+ # Allow CC to be a program name with arguments.
40465+ lt_save_CC="$CC"
40466+ lt_save_GCC=$GCC
40467+ lt_save_CFLAGS=$CFLAGS
40468+ CC=${F77-"f77"}
40469+ CFLAGS=$FFLAGS
40470+ compiler=$CC
40471+ _LT_TAGVAR(compiler, $1)=$CC
40472+ _LT_CC_BASENAME([$compiler])
40473+ GCC=$G77
40474+ if test -n "$compiler"; then
40475+ AC_MSG_CHECKING([if libtool supports shared libraries])
40476+ AC_MSG_RESULT([$can_build_shared])
40477+
40478+ AC_MSG_CHECKING([whether to build shared libraries])
40479+ test "$can_build_shared" = "no" && enable_shared=no
40480+
40481+ # On AIX, shared libraries and static libraries use the same namespace, and
40482+ # are all built from PIC.
40483+ case $host_os in
40484+ aix3*)
40485+ test "$enable_shared" = yes && enable_static=no
40486+ if test -n "$RANLIB"; then
40487+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
40488+ postinstall_cmds='$RANLIB $lib'
40489+ fi
40490+ ;;
40491+ aix[[4-9]]*)
40492+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
40493+ test "$enable_shared" = yes && enable_static=no
40494+ fi
40495+ ;;
40496+ esac
40497+ AC_MSG_RESULT([$enable_shared])
40498+
40499+ AC_MSG_CHECKING([whether to build static libraries])
40500+ # Make sure either enable_shared or enable_static is yes.
40501+ test "$enable_shared" = yes || enable_static=yes
40502+ AC_MSG_RESULT([$enable_static])
40503+
40504+ _LT_TAGVAR(GCC, $1)="$G77"
40505+ _LT_TAGVAR(LD, $1)="$LD"
40506+
40507+ ## CAVEAT EMPTOR:
40508+ ## There is no encapsulation within the following macros, do not change
40509+ ## the running order or otherwise move them around unless you know exactly
40510+ ## what you are doing...
40511+ _LT_COMPILER_PIC($1)
40512+ _LT_COMPILER_C_O($1)
40513+ _LT_COMPILER_FILE_LOCKS($1)
40514+ _LT_LINKER_SHLIBS($1)
40515+ _LT_SYS_DYNAMIC_LINKER($1)
40516+ _LT_LINKER_HARDCODE_LIBPATH($1)
40517+
40518+ _LT_CONFIG($1)
40519+ fi # test -n "$compiler"
40520+
40521+ GCC=$lt_save_GCC
40522+ CC="$lt_save_CC"
40523+ CFLAGS="$lt_save_CFLAGS"
40524+fi # test "$_lt_disable_F77" != yes
40525+
40526+AC_LANG_POP
40527+])# _LT_LANG_F77_CONFIG
40528+
40529+
40530+# _LT_LANG_FC_CONFIG([TAG])
40531+# -------------------------
40532+# Ensure that the configuration variables for a Fortran compiler are
40533+# suitably defined. These variables are subsequently used by _LT_CONFIG
40534+# to write the compiler configuration to `libtool'.
40535+m4_defun([_LT_LANG_FC_CONFIG],
40536+[AC_LANG_PUSH(Fortran)
40537+
40538+if test -z "$FC" || test "X$FC" = "Xno"; then
40539+ _lt_disable_FC=yes
40540+fi
40541+
40542+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
40543+_LT_TAGVAR(allow_undefined_flag, $1)=
40544+_LT_TAGVAR(always_export_symbols, $1)=no
40545+_LT_TAGVAR(archive_expsym_cmds, $1)=
40546+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
40547+_LT_TAGVAR(hardcode_direct, $1)=no
40548+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
40549+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
40550+_LT_TAGVAR(hardcode_libdir_separator, $1)=
40551+_LT_TAGVAR(hardcode_minus_L, $1)=no
40552+_LT_TAGVAR(hardcode_automatic, $1)=no
40553+_LT_TAGVAR(inherit_rpath, $1)=no
40554+_LT_TAGVAR(module_cmds, $1)=
40555+_LT_TAGVAR(module_expsym_cmds, $1)=
40556+_LT_TAGVAR(link_all_deplibs, $1)=unknown
40557+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
40558+_LT_TAGVAR(reload_flag, $1)=$reload_flag
40559+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
40560+_LT_TAGVAR(no_undefined_flag, $1)=
40561+_LT_TAGVAR(whole_archive_flag_spec, $1)=
40562+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
40563+
40564+# Source file extension for fc test sources.
40565+ac_ext=${ac_fc_srcext-f}
40566+
40567+# Object file extension for compiled fc test sources.
40568+objext=o
40569+_LT_TAGVAR(objext, $1)=$objext
40570+
40571+# No sense in running all these tests if we already determined that
40572+# the FC compiler isn't working. Some variables (like enable_shared)
40573+# are currently assumed to apply to all compilers on this platform,
40574+# and will be corrupted by setting them based on a non-working compiler.
40575+if test "$_lt_disable_FC" != yes; then
40576+ # Code to be used in simple compile tests
40577+ lt_simple_compile_test_code="\
40578+ subroutine t
40579+ return
40580+ end
40581+"
40582+
40583+ # Code to be used in simple link tests
40584+ lt_simple_link_test_code="\
40585+ program t
40586+ end
40587+"
40588+
40589+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
40590+ _LT_TAG_COMPILER
40591+
40592+ # save warnings/boilerplate of simple test code
40593+ _LT_COMPILER_BOILERPLATE
40594+ _LT_LINKER_BOILERPLATE
40595+
40596+ # Allow CC to be a program name with arguments.
40597+ lt_save_CC="$CC"
40598+ lt_save_GCC=$GCC
40599+ lt_save_CFLAGS=$CFLAGS
40600+ CC=${FC-"f95"}
40601+ CFLAGS=$FCFLAGS
40602+ compiler=$CC
40603+ GCC=$ac_cv_fc_compiler_gnu
40604+
40605+ _LT_TAGVAR(compiler, $1)=$CC
40606+ _LT_CC_BASENAME([$compiler])
40607+
40608+ if test -n "$compiler"; then
40609+ AC_MSG_CHECKING([if libtool supports shared libraries])
40610+ AC_MSG_RESULT([$can_build_shared])
40611+
40612+ AC_MSG_CHECKING([whether to build shared libraries])
40613+ test "$can_build_shared" = "no" && enable_shared=no
40614+
40615+ # On AIX, shared libraries and static libraries use the same namespace, and
40616+ # are all built from PIC.
40617+ case $host_os in
40618+ aix3*)
40619+ test "$enable_shared" = yes && enable_static=no
40620+ if test -n "$RANLIB"; then
40621+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
40622+ postinstall_cmds='$RANLIB $lib'
40623+ fi
40624+ ;;
40625+ aix[[4-9]]*)
40626+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
40627+ test "$enable_shared" = yes && enable_static=no
40628+ fi
40629+ ;;
40630+ esac
40631+ AC_MSG_RESULT([$enable_shared])
40632+
40633+ AC_MSG_CHECKING([whether to build static libraries])
40634+ # Make sure either enable_shared or enable_static is yes.
40635+ test "$enable_shared" = yes || enable_static=yes
40636+ AC_MSG_RESULT([$enable_static])
40637+
40638+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
40639+ _LT_TAGVAR(LD, $1)="$LD"
40640+
40641+ ## CAVEAT EMPTOR:
40642+ ## There is no encapsulation within the following macros, do not change
40643+ ## the running order or otherwise move them around unless you know exactly
40644+ ## what you are doing...
40645+ _LT_SYS_HIDDEN_LIBDEPS($1)
40646+ _LT_COMPILER_PIC($1)
40647+ _LT_COMPILER_C_O($1)
40648+ _LT_COMPILER_FILE_LOCKS($1)
40649+ _LT_LINKER_SHLIBS($1)
40650+ _LT_SYS_DYNAMIC_LINKER($1)
40651+ _LT_LINKER_HARDCODE_LIBPATH($1)
40652+
40653+ _LT_CONFIG($1)
40654+ fi # test -n "$compiler"
40655+
40656+ GCC=$lt_save_GCC
40657+ CC=$lt_save_CC
40658+ CFLAGS=$lt_save_CFLAGS
40659+fi # test "$_lt_disable_FC" != yes
40660+
40661+AC_LANG_POP
40662+])# _LT_LANG_FC_CONFIG
40663+
40664+
40665+# _LT_LANG_GCJ_CONFIG([TAG])
40666+# --------------------------
40667+# Ensure that the configuration variables for the GNU Java Compiler compiler
40668+# are suitably defined. These variables are subsequently used by _LT_CONFIG
40669+# to write the compiler configuration to `libtool'.
40670+m4_defun([_LT_LANG_GCJ_CONFIG],
40671+[AC_REQUIRE([LT_PROG_GCJ])dnl
40672+AC_LANG_SAVE
40673+
40674+# Source file extension for Java test sources.
40675+ac_ext=java
40676+
40677+# Object file extension for compiled Java test sources.
40678+objext=o
40679+_LT_TAGVAR(objext, $1)=$objext
40680+
40681+# Code to be used in simple compile tests
40682+lt_simple_compile_test_code="class foo {}"
40683+
40684+# Code to be used in simple link tests
40685+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
40686+
40687+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
40688+_LT_TAG_COMPILER
40689+
40690+# save warnings/boilerplate of simple test code
40691+_LT_COMPILER_BOILERPLATE
40692+_LT_LINKER_BOILERPLATE
40693+
40694+# Allow CC to be a program name with arguments.
40695+lt_save_CC=$CC
40696+lt_save_CFLAGS=$CFLAGS
40697+lt_save_GCC=$GCC
40698+GCC=yes
40699+CC=${GCJ-"gcj"}
40700+CFLAGS=$GCJFLAGS
40701+compiler=$CC
40702+_LT_TAGVAR(compiler, $1)=$CC
40703+_LT_TAGVAR(LD, $1)="$LD"
40704+_LT_CC_BASENAME([$compiler])
40705+
40706+# GCJ did not exist at the time GCC didn't implicitly link libc in.
40707+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
40708+
40709+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
40710+_LT_TAGVAR(reload_flag, $1)=$reload_flag
40711+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
40712+
40713+## CAVEAT EMPTOR:
40714+## There is no encapsulation within the following macros, do not change
40715+## the running order or otherwise move them around unless you know exactly
40716+## what you are doing...
40717+if test -n "$compiler"; then
40718+ _LT_COMPILER_NO_RTTI($1)
40719+ _LT_COMPILER_PIC($1)
40720+ _LT_COMPILER_C_O($1)
40721+ _LT_COMPILER_FILE_LOCKS($1)
40722+ _LT_LINKER_SHLIBS($1)
40723+ _LT_LINKER_HARDCODE_LIBPATH($1)
40724+
40725+ _LT_CONFIG($1)
40726+fi
40727+
40728+AC_LANG_RESTORE
40729+
40730+GCC=$lt_save_GCC
40731+CC=$lt_save_CC
40732+CFLAGS=$lt_save_CFLAGS
40733+])# _LT_LANG_GCJ_CONFIG
40734+
40735+
40736+# _LT_LANG_GO_CONFIG([TAG])
40737+# --------------------------
40738+# Ensure that the configuration variables for the GNU Go compiler
40739+# are suitably defined. These variables are subsequently used by _LT_CONFIG
40740+# to write the compiler configuration to `libtool'.
40741+m4_defun([_LT_LANG_GO_CONFIG],
40742+[AC_REQUIRE([LT_PROG_GO])dnl
40743+AC_LANG_SAVE
40744+
40745+# Source file extension for Go test sources.
40746+ac_ext=go
40747+
40748+# Object file extension for compiled Go test sources.
40749+objext=o
40750+_LT_TAGVAR(objext, $1)=$objext
40751+
40752+# Code to be used in simple compile tests
40753+lt_simple_compile_test_code="package main; func main() { }"
40754+
40755+# Code to be used in simple link tests
40756+lt_simple_link_test_code='package main; func main() { }'
40757+
40758+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
40759+_LT_TAG_COMPILER
40760+
40761+# save warnings/boilerplate of simple test code
40762+_LT_COMPILER_BOILERPLATE
40763+_LT_LINKER_BOILERPLATE
40764+
40765+# Allow CC to be a program name with arguments.
40766+lt_save_CC=$CC
40767+lt_save_CFLAGS=$CFLAGS
40768+lt_save_GCC=$GCC
40769+GCC=yes
40770+CC=${GOC-"gccgo"}
40771+CFLAGS=$GOFLAGS
40772+compiler=$CC
40773+_LT_TAGVAR(compiler, $1)=$CC
40774+_LT_TAGVAR(LD, $1)="$LD"
40775+_LT_CC_BASENAME([$compiler])
40776+
40777+# Go did not exist at the time GCC didn't implicitly link libc in.
40778+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
40779+
40780+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
40781+_LT_TAGVAR(reload_flag, $1)=$reload_flag
40782+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
40783+
40784+## CAVEAT EMPTOR:
40785+## There is no encapsulation within the following macros, do not change
40786+## the running order or otherwise move them around unless you know exactly
40787+## what you are doing...
40788+if test -n "$compiler"; then
40789+ _LT_COMPILER_NO_RTTI($1)
40790+ _LT_COMPILER_PIC($1)
40791+ _LT_COMPILER_C_O($1)
40792+ _LT_COMPILER_FILE_LOCKS($1)
40793+ _LT_LINKER_SHLIBS($1)
40794+ _LT_LINKER_HARDCODE_LIBPATH($1)
40795+
40796+ _LT_CONFIG($1)
40797+fi
40798+
40799+AC_LANG_RESTORE
40800+
40801+GCC=$lt_save_GCC
40802+CC=$lt_save_CC
40803+CFLAGS=$lt_save_CFLAGS
40804+])# _LT_LANG_GO_CONFIG
40805+
40806+
40807+# _LT_LANG_RC_CONFIG([TAG])
40808+# -------------------------
40809+# Ensure that the configuration variables for the Windows resource compiler
40810+# are suitably defined. These variables are subsequently used by _LT_CONFIG
40811+# to write the compiler configuration to `libtool'.
40812+m4_defun([_LT_LANG_RC_CONFIG],
40813+[AC_REQUIRE([LT_PROG_RC])dnl
40814+AC_LANG_SAVE
40815+
40816+# Source file extension for RC test sources.
40817+ac_ext=rc
40818+
40819+# Object file extension for compiled RC test sources.
40820+objext=o
40821+_LT_TAGVAR(objext, $1)=$objext
40822+
40823+# Code to be used in simple compile tests
40824+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
40825+
40826+# Code to be used in simple link tests
40827+lt_simple_link_test_code="$lt_simple_compile_test_code"
40828+
40829+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
40830+_LT_TAG_COMPILER
40831+
40832+# save warnings/boilerplate of simple test code
40833+_LT_COMPILER_BOILERPLATE
40834+_LT_LINKER_BOILERPLATE
40835+
40836+# Allow CC to be a program name with arguments.
40837+lt_save_CC="$CC"
40838+lt_save_CFLAGS=$CFLAGS
40839+lt_save_GCC=$GCC
40840+GCC=
40841+CC=${RC-"windres"}
40842+CFLAGS=
40843+compiler=$CC
40844+_LT_TAGVAR(compiler, $1)=$CC
40845+_LT_CC_BASENAME([$compiler])
40846+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
40847+
40848+if test -n "$compiler"; then
40849+ :
40850+ _LT_CONFIG($1)
40851+fi
40852+
40853+GCC=$lt_save_GCC
40854+AC_LANG_RESTORE
40855+CC=$lt_save_CC
40856+CFLAGS=$lt_save_CFLAGS
40857+])# _LT_LANG_RC_CONFIG
40858+
40859+
40860+# LT_PROG_GCJ
40861+# -----------
40862+AC_DEFUN([LT_PROG_GCJ],
40863+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
40864+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
40865+ [AC_CHECK_TOOL(GCJ, gcj,)
40866+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
40867+ AC_SUBST(GCJFLAGS)])])[]dnl
40868+])
40869+
40870+# Old name:
40871+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
40872+dnl aclocal-1.4 backwards compatibility:
40873+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
40874+
40875+
40876+# LT_PROG_GO
40877+# ----------
40878+AC_DEFUN([LT_PROG_GO],
40879+[AC_CHECK_TOOL(GOC, gccgo,)
40880+])
40881+
40882+
40883+# LT_PROG_RC
40884+# ----------
40885+AC_DEFUN([LT_PROG_RC],
40886+[AC_CHECK_TOOL(RC, windres,)
40887+])
40888+
40889+# Old name:
40890+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
40891+dnl aclocal-1.4 backwards compatibility:
40892+dnl AC_DEFUN([LT_AC_PROG_RC], [])
40893+
40894+
40895+# _LT_DECL_EGREP
40896+# --------------
40897+# If we don't have a new enough Autoconf to choose the best grep
40898+# available, choose the one first in the user's PATH.
40899+m4_defun([_LT_DECL_EGREP],
40900+[AC_REQUIRE([AC_PROG_EGREP])dnl
40901+AC_REQUIRE([AC_PROG_FGREP])dnl
40902+test -z "$GREP" && GREP=grep
40903+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
40904+_LT_DECL([], [EGREP], [1], [An ERE matcher])
40905+_LT_DECL([], [FGREP], [1], [A literal string matcher])
40906+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
40907+AC_SUBST([GREP])
40908+])
40909+
40910+
40911+# _LT_DECL_OBJDUMP
40912+# --------------
40913+# If we don't have a new enough Autoconf to choose the best objdump
40914+# available, choose the one first in the user's PATH.
40915+m4_defun([_LT_DECL_OBJDUMP],
40916+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
40917+test -z "$OBJDUMP" && OBJDUMP=objdump
40918+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
40919+AC_SUBST([OBJDUMP])
40920+])
40921+
40922+# _LT_DECL_DLLTOOL
40923+# ----------------
40924+# Ensure DLLTOOL variable is set.
40925+m4_defun([_LT_DECL_DLLTOOL],
40926+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
40927+test -z "$DLLTOOL" && DLLTOOL=dlltool
40928+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
40929+AC_SUBST([DLLTOOL])
40930+])
40931+
40932+# _LT_DECL_SED
40933+# ------------
40934+# Check for a fully-functional sed program, that truncates
40935+# as few characters as possible. Prefer GNU sed if found.
40936+m4_defun([_LT_DECL_SED],
40937+[AC_PROG_SED
40938+test -z "$SED" && SED=sed
40939+Xsed="$SED -e 1s/^X//"
40940+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
40941+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
40942+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
40943+])# _LT_DECL_SED
40944+
40945+m4_ifndef([AC_PROG_SED], [
40946+############################################################
40947+# NOTE: This macro has been submitted for inclusion into #
40948+# GNU Autoconf as AC_PROG_SED. When it is available in #
40949+# a released version of Autoconf we should remove this #
40950+# macro and use it instead. #
40951+############################################################
40952+
40953+m4_defun([AC_PROG_SED],
40954+[AC_MSG_CHECKING([for a sed that does not truncate output])
40955+AC_CACHE_VAL(lt_cv_path_SED,
40956+[# Loop through the user's path and test for sed and gsed.
40957+# Then use that list of sed's as ones to test for truncation.
40958+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
40959+for as_dir in $PATH
40960+do
40961+ IFS=$as_save_IFS
40962+ test -z "$as_dir" && as_dir=.
40963+ for lt_ac_prog in sed gsed; do
40964+ for ac_exec_ext in '' $ac_executable_extensions; do
40965+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
40966+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
40967+ fi
40968+ done
40969+ done
40970+done
40971+IFS=$as_save_IFS
40972+lt_ac_max=0
40973+lt_ac_count=0
40974+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
40975+# along with /bin/sed that truncates output.
40976+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
40977+ test ! -f $lt_ac_sed && continue
40978+ cat /dev/null > conftest.in
40979+ lt_ac_count=0
40980+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
40981+ # Check for GNU sed and select it if it is found.
40982+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
40983+ lt_cv_path_SED=$lt_ac_sed
40984+ break
40985+ fi
40986+ while true; do
40987+ cat conftest.in conftest.in >conftest.tmp
40988+ mv conftest.tmp conftest.in
40989+ cp conftest.in conftest.nl
40990+ echo >>conftest.nl
40991+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
40992+ cmp -s conftest.out conftest.nl || break
40993+ # 10000 chars as input seems more than enough
40994+ test $lt_ac_count -gt 10 && break
40995+ lt_ac_count=`expr $lt_ac_count + 1`
40996+ if test $lt_ac_count -gt $lt_ac_max; then
40997+ lt_ac_max=$lt_ac_count
40998+ lt_cv_path_SED=$lt_ac_sed
40999+ fi
41000+ done
41001+done
41002+])
41003+SED=$lt_cv_path_SED
41004+AC_SUBST([SED])
41005+AC_MSG_RESULT([$SED])
41006+])#AC_PROG_SED
41007+])#m4_ifndef
41008+
41009+# Old name:
41010+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
41011+dnl aclocal-1.4 backwards compatibility:
41012+dnl AC_DEFUN([LT_AC_PROG_SED], [])
41013+
41014+
41015+# _LT_CHECK_SHELL_FEATURES
41016+# ------------------------
41017+# Find out whether the shell is Bourne or XSI compatible,
41018+# or has some other useful features.
41019+m4_defun([_LT_CHECK_SHELL_FEATURES],
41020+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
41021+# Try some XSI features
41022+xsi_shell=no
41023+( _lt_dummy="a/b/c"
41024+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
41025+ = c,a/b,b/c, \
41026+ && eval 'test $(( 1 + 1 )) -eq 2 \
41027+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
41028+ && xsi_shell=yes
41029+AC_MSG_RESULT([$xsi_shell])
41030+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
41031+
41032+AC_MSG_CHECKING([whether the shell understands "+="])
41033+lt_shell_append=no
41034+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
41035+ >/dev/null 2>&1 \
41036+ && lt_shell_append=yes
41037+AC_MSG_RESULT([$lt_shell_append])
41038+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
41039+
41040+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
41041+ lt_unset=unset
41042+else
41043+ lt_unset=false
41044+fi
41045+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
41046+
41047+# test EBCDIC or ASCII
41048+case `echo X|tr X '\101'` in
41049+ A) # ASCII based system
41050+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
41051+ lt_SP2NL='tr \040 \012'
41052+ lt_NL2SP='tr \015\012 \040\040'
41053+ ;;
41054+ *) # EBCDIC based system
41055+ lt_SP2NL='tr \100 \n'
41056+ lt_NL2SP='tr \r\n \100\100'
41057+ ;;
41058+esac
41059+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
41060+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
41061+])# _LT_CHECK_SHELL_FEATURES
41062+
41063+
41064+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
41065+# ------------------------------------------------------
41066+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
41067+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
41068+m4_defun([_LT_PROG_FUNCTION_REPLACE],
41069+[dnl {
41070+sed -e '/^$1 ()$/,/^} # $1 /c\
41071+$1 ()\
41072+{\
41073+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
41074+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
41075+ && mv -f "$cfgfile.tmp" "$cfgfile" \
41076+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
41077+test 0 -eq $? || _lt_function_replace_fail=:
41078+])
41079+
41080+
41081+# _LT_PROG_REPLACE_SHELLFNS
41082+# -------------------------
41083+# Replace existing portable implementations of several shell functions with
41084+# equivalent extended shell implementations where those features are available..
41085+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
41086+[if test x"$xsi_shell" = xyes; then
41087+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
41088+ case ${1} in
41089+ */*) func_dirname_result="${1%/*}${2}" ;;
41090+ * ) func_dirname_result="${3}" ;;
41091+ esac])
41092+
41093+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
41094+ func_basename_result="${1##*/}"])
41095+
41096+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
41097+ case ${1} in
41098+ */*) func_dirname_result="${1%/*}${2}" ;;
41099+ * ) func_dirname_result="${3}" ;;
41100+ esac
41101+ func_basename_result="${1##*/}"])
41102+
41103+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
41104+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
41105+ # positional parameters, so assign one to ordinary parameter first.
41106+ func_stripname_result=${3}
41107+ func_stripname_result=${func_stripname_result#"${1}"}
41108+ func_stripname_result=${func_stripname_result%"${2}"}])
41109+
41110+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
41111+ func_split_long_opt_name=${1%%=*}
41112+ func_split_long_opt_arg=${1#*=}])
41113+
41114+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
41115+ func_split_short_opt_arg=${1#??}
41116+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
41117+
41118+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
41119+ case ${1} in
41120+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
41121+ *) func_lo2o_result=${1} ;;
41122+ esac])
41123+
41124+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
41125+
41126+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
41127+
41128+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
41129+fi
41130+
41131+if test x"$lt_shell_append" = xyes; then
41132+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
41133+
41134+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
41135+ func_quote_for_eval "${2}"
41136+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
41137+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
41138+
41139+ # Save a `func_append' function call where possible by direct use of '+='
41140+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
41141+ && mv -f "$cfgfile.tmp" "$cfgfile" \
41142+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
41143+ test 0 -eq $? || _lt_function_replace_fail=:
41144+else
41145+ # Save a `func_append' function call even when '+=' is not available
41146+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
41147+ && mv -f "$cfgfile.tmp" "$cfgfile" \
41148+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
41149+ test 0 -eq $? || _lt_function_replace_fail=:
41150+fi
41151+
41152+if test x"$_lt_function_replace_fail" = x":"; then
41153+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
41154+fi
41155+])
41156+
41157+# _LT_PATH_CONVERSION_FUNCTIONS
41158+# -----------------------------
41159+# Determine which file name conversion functions should be used by
41160+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
41161+# for certain cross-compile configurations and native mingw.
41162+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
41163+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
41164+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
41165+AC_MSG_CHECKING([how to convert $build file names to $host format])
41166+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
41167+[case $host in
41168+ *-*-mingw* )
41169+ case $build in
41170+ *-*-mingw* ) # actually msys
41171+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
41172+ ;;
41173+ *-*-cygwin* )
41174+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
41175+ ;;
41176+ * ) # otherwise, assume *nix
41177+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
41178+ ;;
41179+ esac
41180+ ;;
41181+ *-*-cygwin* )
41182+ case $build in
41183+ *-*-mingw* ) # actually msys
41184+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
41185+ ;;
41186+ *-*-cygwin* )
41187+ lt_cv_to_host_file_cmd=func_convert_file_noop
41188+ ;;
41189+ * ) # otherwise, assume *nix
41190+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
41191+ ;;
41192+ esac
41193+ ;;
41194+ * ) # unhandled hosts (and "normal" native builds)
41195+ lt_cv_to_host_file_cmd=func_convert_file_noop
41196+ ;;
41197+esac
41198+])
41199+to_host_file_cmd=$lt_cv_to_host_file_cmd
41200+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
41201+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
41202+ [0], [convert $build file names to $host format])dnl
41203+
41204+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
41205+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
41206+[#assume ordinary cross tools, or native build.
41207+lt_cv_to_tool_file_cmd=func_convert_file_noop
41208+case $host in
41209+ *-*-mingw* )
41210+ case $build in
41211+ *-*-mingw* ) # actually msys
41212+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
41213+ ;;
41214+ esac
41215+ ;;
41216+esac
41217+])
41218+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
41219+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
41220+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
41221+ [0], [convert $build files to toolchain format])dnl
41222+])# _LT_PATH_CONVERSION_FUNCTIONS
41223diff --git a/libclamav/libmspack-0.4alpha/m4/ltoptions.m4 b/libclamav/libmspack-0.4alpha/m4/ltoptions.m4
41224new file mode 100644
41225index 000000000000..5d9acd8e23bc
41226--- /dev/null
41227+++ b/libclamav/libmspack-0.4alpha/m4/ltoptions.m4
41228@@ -0,0 +1,384 @@
41229+# Helper functions for option handling. -*- Autoconf -*-
41230+#
41231+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
41232+# Inc.
41233+# Written by Gary V. Vaughan, 2004
41234+#
41235+# This file is free software; the Free Software Foundation gives
41236+# unlimited permission to copy and/or distribute it, with or without
41237+# modifications, as long as this notice is preserved.
41238+
41239+# serial 7 ltoptions.m4
41240+
41241+# This is to help aclocal find these macros, as it can't see m4_define.
41242+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
41243+
41244+
41245+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
41246+# ------------------------------------------
41247+m4_define([_LT_MANGLE_OPTION],
41248+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
41249+
41250+
41251+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
41252+# ---------------------------------------
41253+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
41254+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
41255+# saved as a flag.
41256+m4_define([_LT_SET_OPTION],
41257+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
41258+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
41259+ _LT_MANGLE_DEFUN([$1], [$2]),
41260+ [m4_warning([Unknown $1 option `$2'])])[]dnl
41261+])
41262+
41263+
41264+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
41265+# ------------------------------------------------------------
41266+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
41267+m4_define([_LT_IF_OPTION],
41268+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
41269+
41270+
41271+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
41272+# -------------------------------------------------------
41273+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
41274+# are set.
41275+m4_define([_LT_UNLESS_OPTIONS],
41276+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
41277+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
41278+ [m4_define([$0_found])])])[]dnl
41279+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
41280+])[]dnl
41281+])
41282+
41283+
41284+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
41285+# ----------------------------------------
41286+# OPTION-LIST is a space-separated list of Libtool options associated
41287+# with MACRO-NAME. If any OPTION has a matching handler declared with
41288+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
41289+# the unknown option and exit.
41290+m4_defun([_LT_SET_OPTIONS],
41291+[# Set options
41292+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
41293+ [_LT_SET_OPTION([$1], _LT_Option)])
41294+
41295+m4_if([$1],[LT_INIT],[
41296+ dnl
41297+ dnl Simply set some default values (i.e off) if boolean options were not
41298+ dnl specified:
41299+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
41300+ ])
41301+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
41302+ ])
41303+ dnl
41304+ dnl If no reference was made to various pairs of opposing options, then
41305+ dnl we run the default mode handler for the pair. For example, if neither
41306+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
41307+ dnl archives by default:
41308+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
41309+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
41310+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
41311+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
41312+ [_LT_ENABLE_FAST_INSTALL])
41313+ ])
41314+])# _LT_SET_OPTIONS
41315+
41316+
41317+## --------------------------------- ##
41318+## Macros to handle LT_INIT options. ##
41319+## --------------------------------- ##
41320+
41321+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
41322+# -----------------------------------------
41323+m4_define([_LT_MANGLE_DEFUN],
41324+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
41325+
41326+
41327+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
41328+# -----------------------------------------------
41329+m4_define([LT_OPTION_DEFINE],
41330+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
41331+])# LT_OPTION_DEFINE
41332+
41333+
41334+# dlopen
41335+# ------
41336+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
41337+])
41338+
41339+AU_DEFUN([AC_LIBTOOL_DLOPEN],
41340+[_LT_SET_OPTION([LT_INIT], [dlopen])
41341+AC_DIAGNOSE([obsolete],
41342+[$0: Remove this warning and the call to _LT_SET_OPTION when you
41343+put the `dlopen' option into LT_INIT's first parameter.])
41344+])
41345+
41346+dnl aclocal-1.4 backwards compatibility:
41347+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
41348+
41349+
41350+# win32-dll
41351+# ---------
41352+# Declare package support for building win32 dll's.
41353+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
41354+[enable_win32_dll=yes
41355+
41356+case $host in
41357+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
41358+ AC_CHECK_TOOL(AS, as, false)
41359+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
41360+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
41361+ ;;
41362+esac
41363+
41364+test -z "$AS" && AS=as
41365+_LT_DECL([], [AS], [1], [Assembler program])dnl
41366+
41367+test -z "$DLLTOOL" && DLLTOOL=dlltool
41368+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
41369+
41370+test -z "$OBJDUMP" && OBJDUMP=objdump
41371+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
41372+])# win32-dll
41373+
41374+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
41375+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
41376+_LT_SET_OPTION([LT_INIT], [win32-dll])
41377+AC_DIAGNOSE([obsolete],
41378+[$0: Remove this warning and the call to _LT_SET_OPTION when you
41379+put the `win32-dll' option into LT_INIT's first parameter.])
41380+])
41381+
41382+dnl aclocal-1.4 backwards compatibility:
41383+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
41384+
41385+
41386+# _LT_ENABLE_SHARED([DEFAULT])
41387+# ----------------------------
41388+# implement the --enable-shared flag, and supports the `shared' and
41389+# `disable-shared' LT_INIT options.
41390+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
41391+m4_define([_LT_ENABLE_SHARED],
41392+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
41393+AC_ARG_ENABLE([shared],
41394+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
41395+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
41396+ [p=${PACKAGE-default}
41397+ case $enableval in
41398+ yes) enable_shared=yes ;;
41399+ no) enable_shared=no ;;
41400+ *)
41401+ enable_shared=no
41402+ # Look at the argument we got. We use all the common list separators.
41403+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
41404+ for pkg in $enableval; do
41405+ IFS="$lt_save_ifs"
41406+ if test "X$pkg" = "X$p"; then
41407+ enable_shared=yes
41408+ fi
41409+ done
41410+ IFS="$lt_save_ifs"
41411+ ;;
41412+ esac],
41413+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
41414+
41415+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
41416+ [Whether or not to build shared libraries])
41417+])# _LT_ENABLE_SHARED
41418+
41419+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
41420+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
41421+
41422+# Old names:
41423+AC_DEFUN([AC_ENABLE_SHARED],
41424+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
41425+])
41426+
41427+AC_DEFUN([AC_DISABLE_SHARED],
41428+[_LT_SET_OPTION([LT_INIT], [disable-shared])
41429+])
41430+
41431+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
41432+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
41433+
41434+dnl aclocal-1.4 backwards compatibility:
41435+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
41436+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
41437+
41438+
41439+
41440+# _LT_ENABLE_STATIC([DEFAULT])
41441+# ----------------------------
41442+# implement the --enable-static flag, and support the `static' and
41443+# `disable-static' LT_INIT options.
41444+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
41445+m4_define([_LT_ENABLE_STATIC],
41446+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
41447+AC_ARG_ENABLE([static],
41448+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
41449+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
41450+ [p=${PACKAGE-default}
41451+ case $enableval in
41452+ yes) enable_static=yes ;;
41453+ no) enable_static=no ;;
41454+ *)
41455+ enable_static=no
41456+ # Look at the argument we got. We use all the common list separators.
41457+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
41458+ for pkg in $enableval; do
41459+ IFS="$lt_save_ifs"
41460+ if test "X$pkg" = "X$p"; then
41461+ enable_static=yes
41462+ fi
41463+ done
41464+ IFS="$lt_save_ifs"
41465+ ;;
41466+ esac],
41467+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
41468+
41469+ _LT_DECL([build_old_libs], [enable_static], [0],
41470+ [Whether or not to build static libraries])
41471+])# _LT_ENABLE_STATIC
41472+
41473+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
41474+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
41475+
41476+# Old names:
41477+AC_DEFUN([AC_ENABLE_STATIC],
41478+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
41479+])
41480+
41481+AC_DEFUN([AC_DISABLE_STATIC],
41482+[_LT_SET_OPTION([LT_INIT], [disable-static])
41483+])
41484+
41485+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
41486+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
41487+
41488+dnl aclocal-1.4 backwards compatibility:
41489+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
41490+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
41491+
41492+
41493+
41494+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
41495+# ----------------------------------
41496+# implement the --enable-fast-install flag, and support the `fast-install'
41497+# and `disable-fast-install' LT_INIT options.
41498+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
41499+m4_define([_LT_ENABLE_FAST_INSTALL],
41500+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
41501+AC_ARG_ENABLE([fast-install],
41502+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
41503+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
41504+ [p=${PACKAGE-default}
41505+ case $enableval in
41506+ yes) enable_fast_install=yes ;;
41507+ no) enable_fast_install=no ;;
41508+ *)
41509+ enable_fast_install=no
41510+ # Look at the argument we got. We use all the common list separators.
41511+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
41512+ for pkg in $enableval; do
41513+ IFS="$lt_save_ifs"
41514+ if test "X$pkg" = "X$p"; then
41515+ enable_fast_install=yes
41516+ fi
41517+ done
41518+ IFS="$lt_save_ifs"
41519+ ;;
41520+ esac],
41521+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
41522+
41523+_LT_DECL([fast_install], [enable_fast_install], [0],
41524+ [Whether or not to optimize for fast installation])dnl
41525+])# _LT_ENABLE_FAST_INSTALL
41526+
41527+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
41528+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
41529+
41530+# Old names:
41531+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
41532+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
41533+AC_DIAGNOSE([obsolete],
41534+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
41535+the `fast-install' option into LT_INIT's first parameter.])
41536+])
41537+
41538+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
41539+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
41540+AC_DIAGNOSE([obsolete],
41541+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
41542+the `disable-fast-install' option into LT_INIT's first parameter.])
41543+])
41544+
41545+dnl aclocal-1.4 backwards compatibility:
41546+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
41547+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
41548+
41549+
41550+# _LT_WITH_PIC([MODE])
41551+# --------------------
41552+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
41553+# LT_INIT options.
41554+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
41555+m4_define([_LT_WITH_PIC],
41556+[AC_ARG_WITH([pic],
41557+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
41558+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
41559+ [lt_p=${PACKAGE-default}
41560+ case $withval in
41561+ yes|no) pic_mode=$withval ;;
41562+ *)
41563+ pic_mode=default
41564+ # Look at the argument we got. We use all the common list separators.
41565+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
41566+ for lt_pkg in $withval; do
41567+ IFS="$lt_save_ifs"
41568+ if test "X$lt_pkg" = "X$lt_p"; then
41569+ pic_mode=yes
41570+ fi
41571+ done
41572+ IFS="$lt_save_ifs"
41573+ ;;
41574+ esac],
41575+ [pic_mode=default])
41576+
41577+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
41578+
41579+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
41580+])# _LT_WITH_PIC
41581+
41582+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
41583+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
41584+
41585+# Old name:
41586+AU_DEFUN([AC_LIBTOOL_PICMODE],
41587+[_LT_SET_OPTION([LT_INIT], [pic-only])
41588+AC_DIAGNOSE([obsolete],
41589+[$0: Remove this warning and the call to _LT_SET_OPTION when you
41590+put the `pic-only' option into LT_INIT's first parameter.])
41591+])
41592+
41593+dnl aclocal-1.4 backwards compatibility:
41594+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
41595+
41596+## ----------------- ##
41597+## LTDL_INIT Options ##
41598+## ----------------- ##
41599+
41600+m4_define([_LTDL_MODE], [])
41601+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
41602+ [m4_define([_LTDL_MODE], [nonrecursive])])
41603+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
41604+ [m4_define([_LTDL_MODE], [recursive])])
41605+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
41606+ [m4_define([_LTDL_MODE], [subproject])])
41607+
41608+m4_define([_LTDL_TYPE], [])
41609+LT_OPTION_DEFINE([LTDL_INIT], [installable],
41610+ [m4_define([_LTDL_TYPE], [installable])])
41611+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
41612+ [m4_define([_LTDL_TYPE], [convenience])])
41613diff --git a/libclamav/libmspack-0.4alpha/m4/ltsugar.m4 b/libclamav/libmspack-0.4alpha/m4/ltsugar.m4
41614new file mode 100644
41615index 000000000000..9000a057d31d
41616--- /dev/null
41617+++ b/libclamav/libmspack-0.4alpha/m4/ltsugar.m4
41618@@ -0,0 +1,123 @@
41619+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
41620+#
41621+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
41622+# Written by Gary V. Vaughan, 2004
41623+#
41624+# This file is free software; the Free Software Foundation gives
41625+# unlimited permission to copy and/or distribute it, with or without
41626+# modifications, as long as this notice is preserved.
41627+
41628+# serial 6 ltsugar.m4
41629+
41630+# This is to help aclocal find these macros, as it can't see m4_define.
41631+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
41632+
41633+
41634+# lt_join(SEP, ARG1, [ARG2...])
41635+# -----------------------------
41636+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
41637+# associated separator.
41638+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
41639+# versions in m4sugar had bugs.
41640+m4_define([lt_join],
41641+[m4_if([$#], [1], [],
41642+ [$#], [2], [[$2]],
41643+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
41644+m4_define([_lt_join],
41645+[m4_if([$#$2], [2], [],
41646+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
41647+
41648+
41649+# lt_car(LIST)
41650+# lt_cdr(LIST)
41651+# ------------
41652+# Manipulate m4 lists.
41653+# These macros are necessary as long as will still need to support
41654+# Autoconf-2.59 which quotes differently.
41655+m4_define([lt_car], [[$1]])
41656+m4_define([lt_cdr],
41657+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
41658+ [$#], 1, [],
41659+ [m4_dquote(m4_shift($@))])])
41660+m4_define([lt_unquote], $1)
41661+
41662+
41663+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
41664+# ------------------------------------------
41665+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
41666+# Note that neither SEPARATOR nor STRING are expanded; they are appended
41667+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
41668+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
41669+# than defined and empty).
41670+#
41671+# This macro is needed until we can rely on Autoconf 2.62, since earlier
41672+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
41673+m4_define([lt_append],
41674+[m4_define([$1],
41675+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
41676+
41677+
41678+
41679+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
41680+# ----------------------------------------------------------
41681+# Produce a SEP delimited list of all paired combinations of elements of
41682+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
41683+# has the form PREFIXmINFIXSUFFIXn.
41684+# Needed until we can rely on m4_combine added in Autoconf 2.62.
41685+m4_define([lt_combine],
41686+[m4_if(m4_eval([$# > 3]), [1],
41687+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
41688+[[m4_foreach([_Lt_prefix], [$2],
41689+ [m4_foreach([_Lt_suffix],
41690+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
41691+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
41692+
41693+
41694+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
41695+# -----------------------------------------------------------------------
41696+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
41697+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
41698+m4_define([lt_if_append_uniq],
41699+[m4_ifdef([$1],
41700+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
41701+ [lt_append([$1], [$2], [$3])$4],
41702+ [$5])],
41703+ [lt_append([$1], [$2], [$3])$4])])
41704+
41705+
41706+# lt_dict_add(DICT, KEY, VALUE)
41707+# -----------------------------
41708+m4_define([lt_dict_add],
41709+[m4_define([$1($2)], [$3])])
41710+
41711+
41712+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
41713+# --------------------------------------------
41714+m4_define([lt_dict_add_subkey],
41715+[m4_define([$1($2:$3)], [$4])])
41716+
41717+
41718+# lt_dict_fetch(DICT, KEY, [SUBKEY])
41719+# ----------------------------------
41720+m4_define([lt_dict_fetch],
41721+[m4_ifval([$3],
41722+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
41723+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
41724+
41725+
41726+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
41727+# -----------------------------------------------------------------
41728+m4_define([lt_if_dict_fetch],
41729+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
41730+ [$5],
41731+ [$6])])
41732+
41733+
41734+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
41735+# --------------------------------------------------------------
41736+m4_define([lt_dict_filter],
41737+[m4_if([$5], [], [],
41738+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
41739+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
41740+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
41741+])
41742diff --git a/libclamav/libmspack-0.4alpha/m4/ltversion.m4 b/libclamav/libmspack-0.4alpha/m4/ltversion.m4
41743new file mode 100644
41744index 000000000000..07a8602d48d6
41745--- /dev/null
41746+++ b/libclamav/libmspack-0.4alpha/m4/ltversion.m4
41747@@ -0,0 +1,23 @@
41748+# ltversion.m4 -- version numbers -*- Autoconf -*-
41749+#
41750+# Copyright (C) 2004 Free Software Foundation, Inc.
41751+# Written by Scott James Remnant, 2004
41752+#
41753+# This file is free software; the Free Software Foundation gives
41754+# unlimited permission to copy and/or distribute it, with or without
41755+# modifications, as long as this notice is preserved.
41756+
41757+# @configure_input@
41758+
41759+# serial 3337 ltversion.m4
41760+# This file is part of GNU Libtool
41761+
41762+m4_define([LT_PACKAGE_VERSION], [2.4.2])
41763+m4_define([LT_PACKAGE_REVISION], [1.3337])
41764+
41765+AC_DEFUN([LTVERSION_VERSION],
41766+[macro_version='2.4.2'
41767+macro_revision='1.3337'
41768+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
41769+_LT_DECL(, macro_revision, 0)
41770+])
41771diff --git a/libclamav/libmspack-0.4alpha/m4/lt~obsolete.m4 b/libclamav/libmspack-0.4alpha/m4/lt~obsolete.m4
41772new file mode 100644
41773index 000000000000..c573da90c5cc
41774--- /dev/null
41775+++ b/libclamav/libmspack-0.4alpha/m4/lt~obsolete.m4
41776@@ -0,0 +1,98 @@
41777+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
41778+#
41779+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
41780+# Written by Scott James Remnant, 2004.
41781+#
41782+# This file is free software; the Free Software Foundation gives
41783+# unlimited permission to copy and/or distribute it, with or without
41784+# modifications, as long as this notice is preserved.
41785+
41786+# serial 5 lt~obsolete.m4
41787+
41788+# These exist entirely to fool aclocal when bootstrapping libtool.
41789+#
41790+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
41791+# which have later been changed to m4_define as they aren't part of the
41792+# exported API, or moved to Autoconf or Automake where they belong.
41793+#
41794+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
41795+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
41796+# using a macro with the same name in our local m4/libtool.m4 it'll
41797+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
41798+# and doesn't know about Autoconf macros at all.)
41799+#
41800+# So we provide this file, which has a silly filename so it's always
41801+# included after everything else. This provides aclocal with the
41802+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
41803+# because those macros already exist, or will be overwritten later.
41804+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
41805+#
41806+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
41807+# Yes, that means every name once taken will need to remain here until
41808+# we give up compatibility with versions before 1.7, at which point
41809+# we need to keep only those names which we still refer to.
41810+
41811+# This is to help aclocal find these macros, as it can't see m4_define.
41812+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
41813+
41814+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
41815+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
41816+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
41817+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
41818+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
41819+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
41820+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
41821+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
41822+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
41823+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
41824+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
41825+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
41826+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
41827+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
41828+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
41829+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
41830+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
41831+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
41832+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
41833+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
41834+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
41835+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
41836+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
41837+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
41838+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
41839+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
41840+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
41841+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
41842+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
41843+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
41844+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
41845+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
41846+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
41847+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
41848+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
41849+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
41850+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
41851+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
41852+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
41853+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
41854+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
41855+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
41856+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
41857+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
41858+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
41859+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
41860+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
41861+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
41862+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
41863+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
41864+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
41865+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
41866+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
41867+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
41868+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
41869+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
41870+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
41871+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
41872+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
41873+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
41874+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
41875diff --git a/libclamav/libmspack-0.4alpha/missing b/libclamav/libmspack-0.4alpha/missing
41876new file mode 100755
41877index 000000000000..86a8fc31e3c2
41878--- /dev/null
41879+++ b/libclamav/libmspack-0.4alpha/missing
41880@@ -0,0 +1,331 @@
41881+#! /bin/sh
41882+# Common stub for a few missing GNU programs while installing.
41883+
41884+scriptversion=2012-01-06.13; # UTC
41885+
41886+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
41887+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
41888+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
41889+
41890+# This program is free software; you can redistribute it and/or modify
41891+# it under the terms of the GNU General Public License as published by
41892+# the Free Software Foundation; either version 2, or (at your option)
41893+# any later version.
41894+
41895+# This program is distributed in the hope that it will be useful,
41896+# but WITHOUT ANY WARRANTY; without even the implied warranty of
41897+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41898+# GNU General Public License for more details.
41899+
41900+# You should have received a copy of the GNU General Public License
41901+# along with this program. If not, see <http://www.gnu.org/licenses/>.
41902+
41903+# As a special exception to the GNU General Public License, if you
41904+# distribute this file as part of a program that contains a
41905+# configuration script generated by Autoconf, you may include it under
41906+# the same distribution terms that you use for the rest of that program.
41907+
41908+if test $# -eq 0; then
41909+ echo 1>&2 "Try \`$0 --help' for more information"
41910+ exit 1
41911+fi
41912+
41913+run=:
41914+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
41915+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
41916+
41917+# In the cases where this matters, `missing' is being run in the
41918+# srcdir already.
41919+if test -f configure.ac; then
41920+ configure_ac=configure.ac
41921+else
41922+ configure_ac=configure.in
41923+fi
41924+
41925+msg="missing on your system"
41926+
41927+case $1 in
41928+--run)
41929+ # Try to run requested program, and just exit if it succeeds.
41930+ run=
41931+ shift
41932+ "$@" && exit 0
41933+ # Exit code 63 means version mismatch. This often happens
41934+ # when the user try to use an ancient version of a tool on
41935+ # a file that requires a minimum version. In this case we
41936+ # we should proceed has if the program had been absent, or
41937+ # if --run hadn't been passed.
41938+ if test $? = 63; then
41939+ run=:
41940+ msg="probably too old"
41941+ fi
41942+ ;;
41943+
41944+ -h|--h|--he|--hel|--help)
41945+ echo "\
41946+$0 [OPTION]... PROGRAM [ARGUMENT]...
41947+
41948+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
41949+error status if there is no known handling for PROGRAM.
41950+
41951+Options:
41952+ -h, --help display this help and exit
41953+ -v, --version output version information and exit
41954+ --run try to run the given command, and emulate it if it fails
41955+
41956+Supported PROGRAM values:
41957+ aclocal touch file \`aclocal.m4'
41958+ autoconf touch file \`configure'
41959+ autoheader touch file \`config.h.in'
41960+ autom4te touch the output file, or create a stub one
41961+ automake touch all \`Makefile.in' files
41962+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
41963+ flex create \`lex.yy.c', if possible, from existing .c
41964+ help2man touch the output file
41965+ lex create \`lex.yy.c', if possible, from existing .c
41966+ makeinfo touch the output file
41967+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
41968+
41969+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
41970+\`g' are ignored when checking the name.
41971+
41972+Send bug reports to <bug-automake@gnu.org>."
41973+ exit $?
41974+ ;;
41975+
41976+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
41977+ echo "missing $scriptversion (GNU Automake)"
41978+ exit $?
41979+ ;;
41980+
41981+ -*)
41982+ echo 1>&2 "$0: Unknown \`$1' option"
41983+ echo 1>&2 "Try \`$0 --help' for more information"
41984+ exit 1
41985+ ;;
41986+
41987+esac
41988+
41989+# normalize program name to check for.
41990+program=`echo "$1" | sed '
41991+ s/^gnu-//; t
41992+ s/^gnu//; t
41993+ s/^g//; t'`
41994+
41995+# Now exit if we have it, but it failed. Also exit now if we
41996+# don't have it and --version was passed (most likely to detect
41997+# the program). This is about non-GNU programs, so use $1 not
41998+# $program.
41999+case $1 in
42000+ lex*|yacc*)
42001+ # Not GNU programs, they don't have --version.
42002+ ;;
42003+
42004+ *)
42005+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
42006+ # We have it, but it failed.
42007+ exit 1
42008+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
42009+ # Could not run --version or --help. This is probably someone
42010+ # running `$TOOL --version' or `$TOOL --help' to check whether
42011+ # $TOOL exists and not knowing $TOOL uses missing.
42012+ exit 1
42013+ fi
42014+ ;;
42015+esac
42016+
42017+# If it does not exist, or fails to run (possibly an outdated version),
42018+# try to emulate it.
42019+case $program in
42020+ aclocal*)
42021+ echo 1>&2 "\
42022+WARNING: \`$1' is $msg. You should only need it if
42023+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
42024+ to install the \`Automake' and \`Perl' packages. Grab them from
42025+ any GNU archive site."
42026+ touch aclocal.m4
42027+ ;;
42028+
42029+ autoconf*)
42030+ echo 1>&2 "\
42031+WARNING: \`$1' is $msg. You should only need it if
42032+ you modified \`${configure_ac}'. You might want to install the
42033+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
42034+ archive site."
42035+ touch configure
42036+ ;;
42037+
42038+ autoheader*)
42039+ echo 1>&2 "\
42040+WARNING: \`$1' is $msg. You should only need it if
42041+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
42042+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
42043+ from any GNU archive site."
42044+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
42045+ test -z "$files" && files="config.h"
42046+ touch_files=
42047+ for f in $files; do
42048+ case $f in
42049+ *:*) touch_files="$touch_files "`echo "$f" |
42050+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
42051+ *) touch_files="$touch_files $f.in";;
42052+ esac
42053+ done
42054+ touch $touch_files
42055+ ;;
42056+
42057+ automake*)
42058+ echo 1>&2 "\
42059+WARNING: \`$1' is $msg. You should only need it if
42060+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
42061+ You might want to install the \`Automake' and \`Perl' packages.
42062+ Grab them from any GNU archive site."
42063+ find . -type f -name Makefile.am -print |
42064+ sed 's/\.am$/.in/' |
42065+ while read f; do touch "$f"; done
42066+ ;;
42067+
42068+ autom4te*)
42069+ echo 1>&2 "\
42070+WARNING: \`$1' is needed, but is $msg.
42071+ You might have modified some files without having the
42072+ proper tools for further handling them.
42073+ You can get \`$1' as part of \`Autoconf' from any GNU
42074+ archive site."
42075+
42076+ file=`echo "$*" | sed -n "$sed_output"`
42077+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
42078+ if test -f "$file"; then
42079+ touch $file
42080+ else
42081+ test -z "$file" || exec >$file
42082+ echo "#! /bin/sh"
42083+ echo "# Created by GNU Automake missing as a replacement of"
42084+ echo "# $ $@"
42085+ echo "exit 0"
42086+ chmod +x $file
42087+ exit 1
42088+ fi
42089+ ;;
42090+
42091+ bison*|yacc*)
42092+ echo 1>&2 "\
42093+WARNING: \`$1' $msg. You should only need it if
42094+ you modified a \`.y' file. You may need the \`Bison' package
42095+ in order for those modifications to take effect. You can get
42096+ \`Bison' from any GNU archive site."
42097+ rm -f y.tab.c y.tab.h
42098+ if test $# -ne 1; then
42099+ eval LASTARG=\${$#}
42100+ case $LASTARG in
42101+ *.y)
42102+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
42103+ if test -f "$SRCFILE"; then
42104+ cp "$SRCFILE" y.tab.c
42105+ fi
42106+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
42107+ if test -f "$SRCFILE"; then
42108+ cp "$SRCFILE" y.tab.h
42109+ fi
42110+ ;;
42111+ esac
42112+ fi
42113+ if test ! -f y.tab.h; then
42114+ echo >y.tab.h
42115+ fi
42116+ if test ! -f y.tab.c; then
42117+ echo 'main() { return 0; }' >y.tab.c
42118+ fi
42119+ ;;
42120+
42121+ lex*|flex*)
42122+ echo 1>&2 "\
42123+WARNING: \`$1' is $msg. You should only need it if
42124+ you modified a \`.l' file. You may need the \`Flex' package
42125+ in order for those modifications to take effect. You can get
42126+ \`Flex' from any GNU archive site."
42127+ rm -f lex.yy.c
42128+ if test $# -ne 1; then
42129+ eval LASTARG=\${$#}
42130+ case $LASTARG in
42131+ *.l)
42132+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
42133+ if test -f "$SRCFILE"; then
42134+ cp "$SRCFILE" lex.yy.c
42135+ fi
42136+ ;;
42137+ esac
42138+ fi
42139+ if test ! -f lex.yy.c; then
42140+ echo 'main() { return 0; }' >lex.yy.c
42141+ fi
42142+ ;;
42143+
42144+ help2man*)
42145+ echo 1>&2 "\
42146+WARNING: \`$1' is $msg. You should only need it if
42147+ you modified a dependency of a manual page. You may need the
42148+ \`Help2man' package in order for those modifications to take
42149+ effect. You can get \`Help2man' from any GNU archive site."
42150+
42151+ file=`echo "$*" | sed -n "$sed_output"`
42152+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
42153+ if test -f "$file"; then
42154+ touch $file
42155+ else
42156+ test -z "$file" || exec >$file
42157+ echo ".ab help2man is required to generate this page"
42158+ exit $?
42159+ fi
42160+ ;;
42161+
42162+ makeinfo*)
42163+ echo 1>&2 "\
42164+WARNING: \`$1' is $msg. You should only need it if
42165+ you modified a \`.texi' or \`.texinfo' file, or any other file
42166+ indirectly affecting the aspect of the manual. The spurious
42167+ call might also be the consequence of using a buggy \`make' (AIX,
42168+ DU, IRIX). You might want to install the \`Texinfo' package or
42169+ the \`GNU make' package. Grab either from any GNU archive site."
42170+ # The file to touch is that specified with -o ...
42171+ file=`echo "$*" | sed -n "$sed_output"`
42172+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
42173+ if test -z "$file"; then
42174+ # ... or it is the one specified with @setfilename ...
42175+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
42176+ file=`sed -n '
42177+ /^@setfilename/{
42178+ s/.* \([^ ]*\) *$/\1/
42179+ p
42180+ q
42181+ }' $infile`
42182+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
42183+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
42184+ fi
42185+ # If the file does not exist, the user really needs makeinfo;
42186+ # let's fail without touching anything.
42187+ test -f $file || exit 1
42188+ touch $file
42189+ ;;
42190+
42191+ *)
42192+ echo 1>&2 "\
42193+WARNING: \`$1' is needed, and is $msg.
42194+ You might have modified some files without having the
42195+ proper tools for further handling them. Check the \`README' file,
42196+ it often tells you about the needed prerequisites for installing
42197+ this package. You may also peek at any GNU archive site, in case
42198+ some other package would contain this missing \`$1' program."
42199+ exit 1
42200+ ;;
42201+esac
42202+
42203+exit 0
42204+
42205+# Local variables:
42206+# eval: (add-hook 'write-file-hooks 'time-stamp)
42207+# time-stamp-start: "scriptversion="
42208+# time-stamp-format: "%:y-%02m-%02d.%02H"
42209+# time-stamp-time-zone: "UTC"
42210+# time-stamp-end: "; # UTC"
42211+# End:
42212diff --git a/libclamav/libmspack-0.4alpha/mspack/cab.h b/libclamav/libmspack-0.4alpha/mspack/cab.h
42213new file mode 100644
42214index 000000000000..9f449d1f29bd
42215--- /dev/null
42216+++ b/libclamav/libmspack-0.4alpha/mspack/cab.h
42217@@ -0,0 +1,127 @@
42218+/* This file is part of libmspack.
42219+ * (C) 2003-2004 Stuart Caie.
42220+ *
42221+ * libmspack is free software; you can redistribute it and/or modify it under
42222+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
42223+ *
42224+ * For further details, see the file COPYING.LIB distributed with libmspack
42225+ */
42226+
42227+#ifndef MSPACK_CAB_H
42228+#define MSPACK_CAB_H 1
42229+
42230+#include <mszip.h>
42231+#include <qtm.h>
42232+#include <lzx.h>
42233+
42234+/* generic CAB definitions */
42235+
42236+/* structure offsets */
42237+#define cfhead_Signature (0x00)
42238+#define cfhead_CabinetSize (0x08)
42239+#define cfhead_FileOffset (0x10)
42240+#define cfhead_MinorVersion (0x18)
42241+#define cfhead_MajorVersion (0x19)
42242+#define cfhead_NumFolders (0x1A)
42243+#define cfhead_NumFiles (0x1C)
42244+#define cfhead_Flags (0x1E)
42245+#define cfhead_SetID (0x20)
42246+#define cfhead_CabinetIndex (0x22)
42247+#define cfhead_SIZEOF (0x24)
42248+#define cfheadext_HeaderReserved (0x00)
42249+#define cfheadext_FolderReserved (0x02)
42250+#define cfheadext_DataReserved (0x03)
42251+#define cfheadext_SIZEOF (0x04)
42252+#define cffold_DataOffset (0x00)
42253+#define cffold_NumBlocks (0x04)
42254+#define cffold_CompType (0x06)
42255+#define cffold_SIZEOF (0x08)
42256+#define cffile_UncompressedSize (0x00)
42257+#define cffile_FolderOffset (0x04)
42258+#define cffile_FolderIndex (0x08)
42259+#define cffile_Date (0x0A)
42260+#define cffile_Time (0x0C)
42261+#define cffile_Attribs (0x0E)
42262+#define cffile_SIZEOF (0x10)
42263+#define cfdata_CheckSum (0x00)
42264+#define cfdata_CompressedSize (0x04)
42265+#define cfdata_UncompressedSize (0x06)
42266+#define cfdata_SIZEOF (0x08)
42267+
42268+/* flags */
42269+#define cffoldCOMPTYPE_MASK (0x000f)
42270+#define cffoldCOMPTYPE_NONE (0x0000)
42271+#define cffoldCOMPTYPE_MSZIP (0x0001)
42272+#define cffoldCOMPTYPE_QUANTUM (0x0002)
42273+#define cffoldCOMPTYPE_LZX (0x0003)
42274+#define cfheadPREV_CABINET (0x0001)
42275+#define cfheadNEXT_CABINET (0x0002)
42276+#define cfheadRESERVE_PRESENT (0x0004)
42277+#define cffileCONTINUED_FROM_PREV (0xFFFD)
42278+#define cffileCONTINUED_TO_NEXT (0xFFFE)
42279+#define cffileCONTINUED_PREV_AND_NEXT (0xFFFF)
42280+
42281+/* CAB data blocks are <= 32768 bytes in uncompressed form. Uncompressed
42282+ * blocks have zero growth. MSZIP guarantees that it won't grow above
42283+ * uncompressed size by more than 12 bytes. LZX guarantees it won't grow
42284+ * more than 6144 bytes. Quantum has no documentation, but the largest
42285+ * block seen in the wild is 337 bytes above uncompressed size.
42286+ */
42287+#define CAB_BLOCKMAX (32768)
42288+#define CAB_INPUTMAX (CAB_BLOCKMAX+6144)
42289+
42290+/* CAB compression definitions */
42291+
42292+struct mscab_compressor_p {
42293+ struct mscab_compressor base;
42294+ struct mspack_system *system;
42295+ /* todo */
42296+};
42297+
42298+/* CAB decompression definitions */
42299+
42300+struct mscabd_decompress_state {
42301+ struct mscabd_folder_p *folder; /* current folder we're extracting from */
42302+ struct mscabd_folder_data *data; /* current folder split we're in */
42303+ unsigned int offset; /* uncompressed offset within folder */
42304+ unsigned int block; /* which block are we decompressing? */
42305+ struct mspack_system sys; /* special I/O code for decompressor */
42306+ int comp_type; /* type of compression used by folder */
42307+ int (*decompress)(void *, off_t); /* decompressor code */
42308+ void *state; /* decompressor state */
42309+ struct mscabd_cabinet_p *incab; /* cabinet where input data comes from */
42310+ struct mspack_file *infh; /* input file handle */
42311+ struct mspack_file *outfh; /* output file handle */
42312+ unsigned char *i_ptr, *i_end; /* input data consumed, end */
42313+ unsigned char input[CAB_INPUTMAX]; /* one input block of data */
42314+};
42315+
42316+struct mscab_decompressor_p {
42317+ struct mscab_decompressor base;
42318+ struct mscabd_decompress_state *d;
42319+ struct mspack_system *system;
42320+ int param[3]; /* !!! MATCH THIS TO NUM OF PARAMS IN MSPACK.H !!! */
42321+ int error, read_error;
42322+};
42323+
42324+struct mscabd_cabinet_p {
42325+ struct mscabd_cabinet base;
42326+ off_t blocks_off; /* offset to data blocks */
42327+ int block_resv; /* reserved space in data blocks */
42328+};
42329+
42330+/* there is one of these for every cabinet a folder spans */
42331+struct mscabd_folder_data {
42332+ struct mscabd_folder_data *next;
42333+ struct mscabd_cabinet_p *cab; /* cabinet file of this folder span */
42334+ off_t offset; /* cabinet offset of first datablock */
42335+};
42336+
42337+struct mscabd_folder_p {
42338+ struct mscabd_folder base;
42339+ struct mscabd_folder_data data; /* where are the data blocks? */
42340+ struct mscabd_file *merge_prev; /* first file needing backwards merge */
42341+ struct mscabd_file *merge_next; /* first file needing forwards merge */
42342+};
42343+
42344+#endif
42345diff --git a/libclamav/libmspack-0.4alpha/mspack/cabc.c b/libclamav/libmspack-0.4alpha/mspack/cabc.c
42346new file mode 100644
42347index 000000000000..242e0347c3f9
42348--- /dev/null
42349+++ b/libclamav/libmspack-0.4alpha/mspack/cabc.c
42350@@ -0,0 +1,24 @@
42351+/* This file is part of libmspack.
42352+ * (C) 2003-2004 Stuart Caie.
42353+ *
42354+ * libmspack is free software; you can redistribute it and/or modify it under
42355+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
42356+ *
42357+ * For further details, see the file COPYING.LIB distributed with libmspack
42358+ */
42359+
42360+/* CAB compression implementation */
42361+
42362+#include <system.h>
42363+#include <cab.h>
42364+
42365+struct mscab_compressor *
42366+ mspack_create_cab_compressor(struct mspack_system *sys)
42367+{
42368+ /* todo */
42369+ return NULL;
42370+}
42371+
42372+void mspack_destroy_cab_compressor(struct mscab_compressor *self) {
42373+ /* todo */
42374+}
42375diff --git a/libclamav/libmspack-0.4alpha/mspack/cabd.c b/libclamav/libmspack-0.4alpha/mspack/cabd.c
42376new file mode 100644
42377index 000000000000..cce5c60e869a
42378--- /dev/null
42379+++ b/libclamav/libmspack-0.4alpha/mspack/cabd.c
42380@@ -0,0 +1,1444 @@
42381+/* This file is part of libmspack.
42382+ * (C) 2003-2011 Stuart Caie.
42383+ *
42384+ * libmspack is free software; you can redistribute it and/or modify it under
42385+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
42386+ *
42387+ * For further details, see the file COPYING.LIB distributed with libmspack
42388+ */
42389+
42390+/* Cabinet (.CAB) files are a form of file archive. Each cabinet contains
42391+ * "folders", which are compressed spans of data. Each cabinet has
42392+ * "files", whose metadata is in the cabinet header, but whose actual data
42393+ * is stored compressed in one of the "folders". Cabinets can span more
42394+ * than one physical file on disk, in which case they are a "cabinet set",
42395+ * and usually the last folder of each cabinet extends into the next
42396+ * cabinet.
42397+ *
42398+ * For a complete description of the format, see the MSDN site:
42399+ * http://msdn.microsoft.com/en-us/library/bb267310.aspx
42400+ */
42401+
42402+/* CAB decompression implementation */
42403+
42404+#include <system.h>
42405+#include <cab.h>
42406+#include <assert.h>
42407+
42408+/* Notes on compliance with cabinet specification:
42409+ *
42410+ * One of the main changes between cabextract 0.6 and libmspack's cab
42411+ * decompressor is the move from block-oriented decompression to
42412+ * stream-oriented decompression.
42413+ *
42414+ * cabextract would read one data block from disk, decompress it with the
42415+ * appropriate method, then write the decompressed data. The CAB
42416+ * specification is specifically designed to work like this, as it ensures
42417+ * compression matches do not span the maximum decompressed block size
42418+ * limit of 32kb.
42419+ *
42420+ * However, the compression algorithms used are stream oriented, with
42421+ * specific hacks added to them to enforce the "individual 32kb blocks"
42422+ * rule in CABs. In other file formats, they do not have this limitation.
42423+ *
42424+ * In order to make more generalised decompressors, libmspack's CAB
42425+ * decompressor has moved from being block-oriented to more stream
42426+ * oriented. This also makes decompression slightly faster.
42427+ *
42428+ * However, this leads to incompliance with the CAB specification. The
42429+ * CAB controller can no longer ensure each block of input given to the
42430+ * decompressors is matched with their output. The "decompressed size" of
42431+ * each individual block is thrown away.
42432+ *
42433+ * Each CAB block is supposed to be seen as individually compressed. This
42434+ * means each consecutive data block can have completely different
42435+ * "uncompressed" sizes, ranging from 1 to 32768 bytes. However, in
42436+ * reality, all data blocks in a folder decompress to exactly 32768 bytes,
42437+ * excepting the final block.
42438+ *
42439+ * Given this situation, the decompression algorithms are designed to
42440+ * realign their input bitstreams on 32768 output-byte boundaries, and
42441+ * various other special cases have been made. libmspack will not
42442+ * correctly decompress LZX or Quantum compressed folders where the blocks
42443+ * do not follow this "32768 bytes until last block" pattern. It could be
42444+ * implemented if needed, but hopefully this is not necessary -- it has
42445+ * not been seen in over 3Gb of CAB archives.
42446+ */
42447+
42448+/* prototypes */
42449+static struct mscabd_cabinet * cabd_open(
42450+ struct mscab_decompressor *base, const char *filename);
42451+static void cabd_close(
42452+ struct mscab_decompressor *base, struct mscabd_cabinet *origcab);
42453+static int cabd_read_headers(
42454+ struct mspack_system *sys, struct mspack_file *fh,
42455+ struct mscabd_cabinet_p *cab, off_t offset, int quiet);
42456+static char *cabd_read_string(
42457+ struct mspack_system *sys, struct mspack_file *fh,
42458+ struct mscabd_cabinet_p *cab, int *error);
42459+
42460+static struct mscabd_cabinet *cabd_search(
42461+ struct mscab_decompressor *base, const char *filename);
42462+static int cabd_find(
42463+ struct mscab_decompressor_p *self, unsigned char *buf,
42464+ struct mspack_file *fh, const char *filename, off_t flen,
42465+ off_t *firstlen, struct mscabd_cabinet_p **firstcab);
42466+
42467+static int cabd_prepend(
42468+ struct mscab_decompressor *base, struct mscabd_cabinet *cab,
42469+ struct mscabd_cabinet *prevcab);
42470+static int cabd_append(
42471+ struct mscab_decompressor *base, struct mscabd_cabinet *cab,
42472+ struct mscabd_cabinet *nextcab);
42473+static int cabd_merge(
42474+ struct mscab_decompressor *base, struct mscabd_cabinet *lcab,
42475+ struct mscabd_cabinet *rcab);
42476+static int cabd_can_merge_folders(
42477+ struct mspack_system *sys, struct mscabd_folder_p *lfol,
42478+ struct mscabd_folder_p *rfol);
42479+
42480+static int cabd_extract(
42481+ struct mscab_decompressor *base, struct mscabd_file *file,
42482+ const char *filename);
42483+static int cabd_init_decomp(
42484+ struct mscab_decompressor_p *self, unsigned int ct);
42485+static void cabd_free_decomp(
42486+ struct mscab_decompressor_p *self);
42487+static int cabd_sys_read(
42488+ struct mspack_file *file, void *buffer, int bytes);
42489+static int cabd_sys_write(
42490+ struct mspack_file *file, void *buffer, int bytes);
42491+static int cabd_sys_read_block(
42492+ struct mspack_system *sys, struct mscabd_decompress_state *d, int *out,
42493+ int ignore_cksum);
42494+static unsigned int cabd_checksum(
42495+ unsigned char *data, unsigned int bytes, unsigned int cksum);
42496+static struct noned_state *noned_init(
42497+ struct mspack_system *sys, struct mspack_file *in, struct mspack_file *out,
42498+ int bufsize);
42499+
42500+static int noned_decompress(
42501+ struct noned_state *s, off_t bytes);
42502+static void noned_free(
42503+ struct noned_state *state);
42504+
42505+static int cabd_param(
42506+ struct mscab_decompressor *base, int param, int value);
42507+
42508+static int cabd_error(
42509+ struct mscab_decompressor *base);
42510+
42511+
42512+/***************************************
42513+ * MSPACK_CREATE_CAB_DECOMPRESSOR
42514+ ***************************************
42515+ * constructor
42516+ */
42517+struct mscab_decompressor *
42518+ mspack_create_cab_decompressor(struct mspack_system *sys)
42519+{
42520+ struct mscab_decompressor_p *self = NULL;
42521+
42522+ if (!sys) sys = mspack_default_system;
42523+ if (!mspack_valid_system(sys)) return NULL;
42524+
42525+ if ((self = (struct mscab_decompressor_p *) sys->alloc(sys, sizeof(struct mscab_decompressor_p)))) {
42526+ self->base.open = &cabd_open;
42527+ self->base.close = &cabd_close;
42528+ self->base.search = &cabd_search;
42529+ self->base.extract = &cabd_extract;
42530+ self->base.prepend = &cabd_prepend;
42531+ self->base.append = &cabd_append;
42532+ self->base.set_param = &cabd_param;
42533+ self->base.last_error = &cabd_error;
42534+ self->system = sys;
42535+ self->d = NULL;
42536+ self->error = MSPACK_ERR_OK;
42537+
42538+ self->param[MSCABD_PARAM_SEARCHBUF] = 32768;
42539+ self->param[MSCABD_PARAM_FIXMSZIP] = 0;
42540+ self->param[MSCABD_PARAM_DECOMPBUF] = 4096;
42541+ }
42542+ return (struct mscab_decompressor *) self;
42543+}
42544+
42545+/***************************************
42546+ * MSPACK_DESTROY_CAB_DECOMPRESSOR
42547+ ***************************************
42548+ * destructor
42549+ */
42550+void mspack_destroy_cab_decompressor(struct mscab_decompressor *base) {
42551+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
42552+ if (self) {
42553+ struct mspack_system *sys = self->system;
42554+ cabd_free_decomp(self);
42555+ if (self->d) {
42556+ if (self->d->infh) sys->close(self->d->infh);
42557+ sys->free(self->d);
42558+ }
42559+ sys->free(self);
42560+ }
42561+}
42562+
42563+
42564+/***************************************
42565+ * CABD_OPEN
42566+ ***************************************
42567+ * opens a file and tries to read it as a cabinet file
42568+ */
42569+static struct mscabd_cabinet *cabd_open(struct mscab_decompressor *base,
42570+ const char *filename)
42571+{
42572+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
42573+ struct mscabd_cabinet_p *cab = NULL;
42574+ struct mspack_system *sys;
42575+ struct mspack_file *fh;
42576+ int error;
42577+
42578+ if (!base) return NULL;
42579+ sys = self->system;
42580+
42581+ if ((fh = sys->open(sys, filename, MSPACK_SYS_OPEN_READ))) {
42582+ if ((cab = (struct mscabd_cabinet_p *) sys->alloc(sys, sizeof(struct mscabd_cabinet_p)))) {
42583+ cab->base.filename = filename;
42584+ error = cabd_read_headers(sys, fh, cab, (off_t) 0, 0);
42585+ if (error) {
42586+ cabd_close(base, (struct mscabd_cabinet *) cab);
42587+ cab = NULL;
42588+ }
42589+ self->error = error;
42590+ }
42591+ else {
42592+ self->error = MSPACK_ERR_NOMEMORY;
42593+ }
42594+ sys->close(fh);
42595+ }
42596+ else {
42597+ self->error = MSPACK_ERR_OPEN;
42598+ }
42599+ return (struct mscabd_cabinet *) cab;
42600+}
42601+
42602+/***************************************
42603+ * CABD_CLOSE
42604+ ***************************************
42605+ * frees all memory associated with a given mscabd_cabinet.
42606+ */
42607+static void cabd_close(struct mscab_decompressor *base,
42608+ struct mscabd_cabinet *origcab)
42609+{
42610+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
42611+ struct mscabd_folder_data *dat, *ndat;
42612+ struct mscabd_cabinet *cab, *ncab;
42613+ struct mscabd_folder *fol, *nfol;
42614+ struct mscabd_file *fi, *nfi;
42615+ struct mspack_system *sys;
42616+
42617+ if (!base) return;
42618+ sys = self->system;
42619+
42620+ self->error = MSPACK_ERR_OK;
42621+
42622+ while (origcab) {
42623+ /* free files */
42624+ for (fi = origcab->files; fi; fi = nfi) {
42625+ nfi = fi->next;
42626+ sys->free(fi->filename);
42627+ sys->free(fi);
42628+ }
42629+
42630+ /* free folders */
42631+ for (fol = origcab->folders; fol; fol = nfol) {
42632+ nfol = fol->next;
42633+
42634+ /* free folder decompression state if it has been decompressed */
42635+ if (self->d && (self->d->folder == (struct mscabd_folder_p *) fol)) {
42636+ if (self->d->infh) sys->close(self->d->infh);
42637+ cabd_free_decomp(self);
42638+ sys->free(self->d);
42639+ self->d = NULL;
42640+ }
42641+
42642+ /* free folder data segments */
42643+ for (dat = ((struct mscabd_folder_p *)fol)->data.next; dat; dat = ndat) {
42644+ ndat = dat->next;
42645+ sys->free(dat);
42646+ }
42647+ sys->free(fol);
42648+ }
42649+
42650+ /* free predecessor cabinets (and the original cabinet's strings) */
42651+ for (cab = origcab; cab; cab = ncab) {
42652+ ncab = cab->prevcab;
42653+ sys->free(cab->prevname);
42654+ sys->free(cab->nextname);
42655+ sys->free(cab->previnfo);
42656+ sys->free(cab->nextinfo);
42657+ if (cab != origcab) sys->free(cab);
42658+ }
42659+
42660+ /* free successor cabinets */
42661+ for (cab = origcab->nextcab; cab; cab = ncab) {
42662+ ncab = cab->nextcab;
42663+ sys->free(cab->prevname);
42664+ sys->free(cab->nextname);
42665+ sys->free(cab->previnfo);
42666+ sys->free(cab->nextinfo);
42667+ sys->free(cab);
42668+ }
42669+
42670+ /* free actual cabinet structure */
42671+ cab = origcab->next;
42672+ sys->free(origcab);
42673+
42674+ /* repeat full procedure again with the cab->next pointer (if set) */
42675+ origcab = cab;
42676+ }
42677+}
42678+
42679+/***************************************
42680+ * CABD_READ_HEADERS
42681+ ***************************************
42682+ * reads the cabinet file header, folder list and file list.
42683+ * fills out a pre-existing mscabd_cabinet structure, allocates memory
42684+ * for folders and files as necessary
42685+ */
42686+static int cabd_read_headers(struct mspack_system *sys,
42687+ struct mspack_file *fh,
42688+ struct mscabd_cabinet_p *cab,
42689+ off_t offset, int quiet)
42690+{
42691+ int num_folders, num_files, folder_resv, i, x;
42692+ struct mscabd_folder_p *fol, *linkfol = NULL;
42693+ struct mscabd_file *file, *linkfile = NULL;
42694+ unsigned char buf[64];
42695+
42696+ /* initialise pointers */
42697+ cab->base.next = NULL;
42698+ cab->base.files = NULL;
42699+ cab->base.folders = NULL;
42700+ cab->base.prevcab = cab->base.nextcab = NULL;
42701+ cab->base.prevname = cab->base.nextname = NULL;
42702+ cab->base.previnfo = cab->base.nextinfo = NULL;
42703+
42704+ cab->base.base_offset = offset;
42705+
42706+ /* seek to CFHEADER */
42707+ if (sys->seek(fh, offset, MSPACK_SYS_SEEK_START)) {
42708+ return MSPACK_ERR_SEEK;
42709+ }
42710+
42711+ /* read in the CFHEADER */
42712+ if (sys->read(fh, &buf[0], cfhead_SIZEOF) != cfhead_SIZEOF) {
42713+ return MSPACK_ERR_READ;
42714+ }
42715+
42716+ /* check for "MSCF" signature */
42717+ if (EndGetI32(&buf[cfhead_Signature]) != 0x4643534D) {
42718+ return MSPACK_ERR_SIGNATURE;
42719+ }
42720+
42721+ /* some basic header fields */
42722+ cab->base.length = EndGetI32(&buf[cfhead_CabinetSize]);
42723+ cab->base.set_id = EndGetI16(&buf[cfhead_SetID]);
42724+ cab->base.set_index = EndGetI16(&buf[cfhead_CabinetIndex]);
42725+
42726+ /* get the number of folders */
42727+ num_folders = EndGetI16(&buf[cfhead_NumFolders]);
42728+ if (num_folders == 0) {
42729+ if (!quiet) sys->message(fh, "no folders in cabinet.");
42730+ return MSPACK_ERR_DATAFORMAT;
42731+ }
42732+
42733+ /* get the number of files */
42734+ num_files = EndGetI16(&buf[cfhead_NumFiles]);
42735+ if (num_files == 0) {
42736+ if (!quiet) sys->message(fh, "no files in cabinet.");
42737+ return MSPACK_ERR_DATAFORMAT;
42738+ }
42739+
42740+ /* check cabinet version */
42741+ if ((buf[cfhead_MajorVersion] != 1) && (buf[cfhead_MinorVersion] != 3)) {
42742+ if (!quiet) sys->message(fh, "WARNING; cabinet version is not 1.3");
42743+ }
42744+
42745+ /* read the reserved-sizes part of header, if present */
42746+ cab->base.flags = EndGetI16(&buf[cfhead_Flags]);
42747+ if (cab->base.flags & cfheadRESERVE_PRESENT) {
42748+ if (sys->read(fh, &buf[0], cfheadext_SIZEOF) != cfheadext_SIZEOF) {
42749+ return MSPACK_ERR_READ;
42750+ }
42751+ cab->base.header_resv = EndGetI16(&buf[cfheadext_HeaderReserved]);
42752+ folder_resv = buf[cfheadext_FolderReserved];
42753+ cab->block_resv = buf[cfheadext_DataReserved];
42754+
42755+ if (cab->base.header_resv > 60000) {
42756+ if (!quiet) sys->message(fh, "WARNING; reserved header > 60000.");
42757+ }
42758+
42759+ /* skip the reserved header */
42760+ if (cab->base.header_resv) {
42761+ if (sys->seek(fh, (off_t) cab->base.header_resv, MSPACK_SYS_SEEK_CUR)) {
42762+ return MSPACK_ERR_SEEK;
42763+ }
42764+ }
42765+ }
42766+ else {
42767+ cab->base.header_resv = 0;
42768+ folder_resv = 0;
42769+ cab->block_resv = 0;
42770+ }
42771+
42772+ /* read name and info of preceeding cabinet in set, if present */
42773+ if (cab->base.flags & cfheadPREV_CABINET) {
42774+ cab->base.prevname = cabd_read_string(sys, fh, cab, &x); if (x) return x;
42775+ cab->base.previnfo = cabd_read_string(sys, fh, cab, &x); if (x) return x;
42776+ }
42777+
42778+ /* read name and info of next cabinet in set, if present */
42779+ if (cab->base.flags & cfheadNEXT_CABINET) {
42780+ cab->base.nextname = cabd_read_string(sys, fh, cab, &x); if (x) return x;
42781+ cab->base.nextinfo = cabd_read_string(sys, fh, cab, &x); if (x) return x;
42782+ }
42783+
42784+ /* read folders */
42785+ for (i = 0; i < num_folders; i++) {
42786+ if (sys->read(fh, &buf[0], cffold_SIZEOF) != cffold_SIZEOF) {
42787+ return MSPACK_ERR_READ;
42788+ }
42789+ if (folder_resv) {
42790+ if (sys->seek(fh, (off_t) folder_resv, MSPACK_SYS_SEEK_CUR)) {
42791+ return MSPACK_ERR_SEEK;
42792+ }
42793+ }
42794+
42795+ if (!(fol = (struct mscabd_folder_p *) sys->alloc(sys, sizeof(struct mscabd_folder_p)))) {
42796+ return MSPACK_ERR_NOMEMORY;
42797+ }
42798+ fol->base.next = NULL;
42799+ fol->base.comp_type = EndGetI16(&buf[cffold_CompType]);
42800+ fol->base.num_blocks = EndGetI16(&buf[cffold_NumBlocks]);
42801+ fol->data.next = NULL;
42802+ fol->data.cab = (struct mscabd_cabinet_p *) cab;
42803+ fol->data.offset = offset + (off_t)
42804+ ( (unsigned int) EndGetI32(&buf[cffold_DataOffset]) );
42805+ fol->merge_prev = NULL;
42806+ fol->merge_next = NULL;
42807+
42808+ /* link folder into list of folders */
42809+ if (!linkfol) cab->base.folders = (struct mscabd_folder *) fol;
42810+ else linkfol->base.next = (struct mscabd_folder *) fol;
42811+ linkfol = fol;
42812+ }
42813+
42814+ /* read files */
42815+ for (i = 0; i < num_files; i++) {
42816+ if (sys->read(fh, &buf[0], cffile_SIZEOF) != cffile_SIZEOF) {
42817+ return MSPACK_ERR_READ;
42818+ }
42819+
42820+ if (!(file = (struct mscabd_file *) sys->alloc(sys, sizeof(struct mscabd_file)))) {
42821+ return MSPACK_ERR_NOMEMORY;
42822+ }
42823+
42824+ file->next = NULL;
42825+ file->length = EndGetI32(&buf[cffile_UncompressedSize]);
42826+ file->attribs = EndGetI16(&buf[cffile_Attribs]);
42827+ file->offset = EndGetI32(&buf[cffile_FolderOffset]);
42828+
42829+ /* set folder pointer */
42830+ x = EndGetI16(&buf[cffile_FolderIndex]);
42831+ if (x < cffileCONTINUED_FROM_PREV) {
42832+ /* normal folder index; count up to the correct folder. the folder
42833+ * pointer will be NULL if folder index is invalid */
42834+ struct mscabd_folder *ifol = cab->base.folders;
42835+ while (x--) if (ifol) ifol = ifol->next;
42836+ file->folder = ifol;
42837+
42838+ if (!ifol) {
42839+ sys->free(file);
42840+ D(("invalid folder index"))
42841+ return MSPACK_ERR_DATAFORMAT;
42842+ }
42843+ }
42844+ else {
42845+ /* either CONTINUED_TO_NEXT, CONTINUED_FROM_PREV or
42846+ * CONTINUED_PREV_AND_NEXT */
42847+ if ((x == cffileCONTINUED_TO_NEXT) ||
42848+ (x == cffileCONTINUED_PREV_AND_NEXT))
42849+ {
42850+ /* get last folder */
42851+ struct mscabd_folder *ifol = cab->base.folders;
42852+ while (ifol->next) ifol = ifol->next;
42853+ file->folder = ifol;
42854+
42855+ /* set "merge next" pointer */
42856+ fol = (struct mscabd_folder_p *) ifol;
42857+ if (!fol->merge_next) fol->merge_next = file;
42858+ }
42859+
42860+ if ((x == cffileCONTINUED_FROM_PREV) ||
42861+ (x == cffileCONTINUED_PREV_AND_NEXT))
42862+ {
42863+ /* get first folder */
42864+ file->folder = cab->base.folders;
42865+
42866+ /* set "merge prev" pointer */
42867+ fol = (struct mscabd_folder_p *) file->folder;
42868+ if (!fol->merge_prev) fol->merge_prev = file;
42869+ }
42870+ }
42871+
42872+ /* get time */
42873+ x = EndGetI16(&buf[cffile_Time]);
42874+ file->time_h = x >> 11;
42875+ file->time_m = (x >> 5) & 0x3F;
42876+ file->time_s = (x << 1) & 0x3E;
42877+
42878+ /* get date */
42879+ x = EndGetI16(&buf[cffile_Date]);
42880+ file->date_d = x & 0x1F;
42881+ file->date_m = (x >> 5) & 0xF;
42882+ file->date_y = (x >> 9) + 1980;
42883+
42884+ /* get filename */
42885+ file->filename = cabd_read_string(sys, fh, cab, &x);
42886+ if (x) {
42887+ sys->free(file);
42888+ return x;
42889+ }
42890+
42891+ /* link file entry into file list */
42892+ if (!linkfile) cab->base.files = file;
42893+ else linkfile->next = file;
42894+ linkfile = file;
42895+ }
42896+
42897+ return MSPACK_ERR_OK;
42898+}
42899+
42900+static char *cabd_read_string(struct mspack_system *sys,
42901+ struct mspack_file *fh,
42902+ struct mscabd_cabinet_p *cab, int *error)
42903+{
42904+ off_t base = sys->tell(fh);
42905+ char buf[256], *str;
42906+ unsigned int len, i, ok;
42907+
42908+ /* read up to 256 bytes */
42909+ len = sys->read(fh, &buf[0], 256);
42910+
42911+ /* search for a null terminator in the buffer */
42912+ for (i = 0, ok = 0; i < len; i++) if (!buf[i]) { ok = 1; break; }
42913+ if (!ok) {
42914+ *error = MSPACK_ERR_DATAFORMAT;
42915+ return NULL;
42916+ }
42917+
42918+ len = i + 1;
42919+
42920+ /* set the data stream to just after the string and return */
42921+ if (sys->seek(fh, base + (off_t)len, MSPACK_SYS_SEEK_START)) {
42922+ *error = MSPACK_ERR_SEEK;
42923+ return NULL;
42924+ }
42925+
42926+ if (!(str = (char *) sys->alloc(sys, len))) {
42927+ *error = MSPACK_ERR_NOMEMORY;
42928+ return NULL;
42929+ }
42930+
42931+ sys->copy(&buf[0], str, len);
42932+ *error = MSPACK_ERR_OK;
42933+ return str;
42934+}
42935+
42936+/***************************************
42937+ * CABD_SEARCH, CABD_FIND
42938+ ***************************************
42939+ * cabd_search opens a file, finds its extent, allocates a search buffer,
42940+ * then reads through the whole file looking for possible cabinet headers.
42941+ * if it finds any, it tries to read them as real cabinets. returns a linked
42942+ * list of results
42943+ *
42944+ * cabd_find is the inner loop of cabd_search, to make it easier to
42945+ * break out of the loop and be sure that all resources are freed
42946+ */
42947+static struct mscabd_cabinet *cabd_search(struct mscab_decompressor *base,
42948+ const char *filename)
42949+{
42950+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
42951+ struct mscabd_cabinet_p *cab = NULL;
42952+ struct mspack_system *sys;
42953+ unsigned char *search_buf;
42954+ struct mspack_file *fh;
42955+ off_t filelen, firstlen = 0;
42956+
42957+ if (!base) return NULL;
42958+ sys = self->system;
42959+
42960+ /* allocate a search buffer */
42961+ search_buf = (unsigned char *) sys->alloc(sys, (size_t) self->param[MSCABD_PARAM_SEARCHBUF]);
42962+ if (!search_buf) {
42963+ self->error = MSPACK_ERR_NOMEMORY;
42964+ return NULL;
42965+ }
42966+
42967+ /* open file and get its full file length */
42968+ if ((fh = sys->open(sys, filename, MSPACK_SYS_OPEN_READ))) {
42969+ if (!(self->error = mspack_sys_filelen(sys, fh, &filelen))) {
42970+ self->error = cabd_find(self, search_buf, fh, filename,
42971+ filelen, &firstlen, &cab);
42972+ }
42973+
42974+ /* truncated / extraneous data warning: */
42975+ if (firstlen && (firstlen != filelen) &&
42976+ (!cab || (cab->base.base_offset == 0)))
42977+ {
42978+ if (firstlen < filelen) {
42979+ sys->message(fh, "WARNING; possible %" LD
42980+ " extra bytes at end of file.",
42981+ filelen - firstlen);
42982+ }
42983+ else {
42984+ sys->message(fh, "WARNING; file possibly truncated by %" LD " bytes.",
42985+ firstlen - filelen);
42986+ }
42987+ }
42988+
42989+ sys->close(fh);
42990+ }
42991+ else {
42992+ self->error = MSPACK_ERR_OPEN;
42993+ }
42994+
42995+ /* free the search buffer */
42996+ sys->free(search_buf);
42997+
42998+ return (struct mscabd_cabinet *) cab;
42999+}
43000+
43001+static int cabd_find(struct mscab_decompressor_p *self, unsigned char *buf,
43002+ struct mspack_file *fh, const char *filename, off_t flen,
43003+ off_t *firstlen, struct mscabd_cabinet_p **firstcab)
43004+{
43005+ struct mscabd_cabinet_p *cab, *link = NULL;
43006+ off_t caboff, offset, length;
43007+ struct mspack_system *sys = self->system;
43008+ unsigned char *p, *pend, state = 0;
43009+ unsigned int cablen_u32 = 0, foffset_u32 = 0;
43010+ int false_cabs = 0;
43011+
43012+#ifndef LARGEFILE_SUPPORT
43013+ /* detect 32-bit off_t overflow */
43014+ if (flen < 0) {
43015+ sys->message(fh, largefile_msg);
43016+ return MSPACK_ERR_OK;
43017+ }
43018+#endif
43019+
43020+ /* search through the full file length */
43021+ for (offset = 0; offset < flen; offset += length) {
43022+ /* search length is either the full length of the search buffer, or the
43023+ * amount of data remaining to the end of the file, whichever is less. */
43024+ length = flen - offset;
43025+ if (length > self->param[MSCABD_PARAM_SEARCHBUF]) {
43026+ length = self->param[MSCABD_PARAM_SEARCHBUF];
43027+ }
43028+
43029+ /* fill the search buffer with data from disk */
43030+ if (sys->read(fh, &buf[0], (int) length) != (int) length) {
43031+ return MSPACK_ERR_READ;
43032+ }
43033+
43034+ /* FAQ avoidance strategy */
43035+ if ((offset == 0) && (EndGetI32(&buf[0]) == 0x28635349)) {
43036+ sys->message(fh, "WARNING; found InstallShield header. "
43037+ "This is probably an InstallShield file. "
43038+ "Use UNSHIELD from www.synce.org to unpack it.");
43039+ }
43040+
43041+ /* read through the entire buffer. */
43042+ for (p = &buf[0], pend = &buf[length]; p < pend; ) {
43043+ switch (state) {
43044+ /* starting state */
43045+ case 0:
43046+ /* we spend most of our time in this while loop, looking for
43047+ * a leading 'M' of the 'MSCF' signature */
43048+ while (p < pend && *p != 0x4D) p++;
43049+ /* if we found tht 'M', advance state */
43050+ if (p++ < pend) state = 1;
43051+ break;
43052+
43053+ /* verify that the next 3 bytes are 'S', 'C' and 'F' */
43054+ case 1: state = (*p++ == 0x53) ? 2 : 0; break;
43055+ case 2: state = (*p++ == 0x43) ? 3 : 0; break;
43056+ case 3: state = (*p++ == 0x46) ? 4 : 0; break;
43057+
43058+ /* we don't care about bytes 4-7 (see default: for action) */
43059+
43060+ /* bytes 8-11 are the overall length of the cabinet */
43061+ case 8: cablen_u32 = *p++; state++; break;
43062+ case 9: cablen_u32 |= *p++ << 8; state++; break;
43063+ case 10: cablen_u32 |= *p++ << 16; state++; break;
43064+ case 11: cablen_u32 |= *p++ << 24; state++; break;
43065+
43066+ /* we don't care about bytes 12-15 (see default: for action) */
43067+
43068+ /* bytes 16-19 are the offset within the cabinet of the filedata */
43069+ case 16: foffset_u32 = *p++; state++; break;
43070+ case 17: foffset_u32 |= *p++ << 8; state++; break;
43071+ case 18: foffset_u32 |= *p++ << 16; state++; break;
43072+ case 19: foffset_u32 |= *p++ << 24;
43073+ /* now we have recieved 20 bytes of potential cab header. work out
43074+ * the offset in the file of this potential cabinet */
43075+ caboff = offset + (p - &buf[0]) - 20;
43076+
43077+ /* should reading cabinet fail, restart search just after 'MSCF' */
43078+ offset = caboff + 4;
43079+
43080+ /* capture the "length of cabinet" field if there is a cabinet at
43081+ * offset 0 in the file, regardless of whether the cabinet can be
43082+ * read correctly or not */
43083+ if (caboff == 0) *firstlen = (off_t) cablen_u32;
43084+
43085+ /* check that the files offset is less than the alleged length of
43086+ * the cabinet, and that the offset + the alleged length are
43087+ * 'roughly' within the end of overall file length */
43088+ if ((foffset_u32 < cablen_u32) &&
43089+ ((caboff + (off_t) foffset_u32) < (flen + 32)) &&
43090+ ((caboff + (off_t) cablen_u32) < (flen + 32)) )
43091+ {
43092+ /* likely cabinet found -- try reading it */
43093+ if (!(cab = (struct mscabd_cabinet_p *) sys->alloc(sys, sizeof(struct mscabd_cabinet_p)))) {
43094+ return MSPACK_ERR_NOMEMORY;
43095+ }
43096+ cab->base.filename = filename;
43097+ if (cabd_read_headers(sys, fh, cab, caboff, 1)) {
43098+ /* destroy the failed cabinet */
43099+ cabd_close((struct mscab_decompressor *) self,
43100+ (struct mscabd_cabinet *) cab);
43101+ false_cabs++;
43102+ }
43103+ else {
43104+ /* cabinet read correctly! */
43105+
43106+ /* link the cab into the list */
43107+ if (!link) *firstcab = cab;
43108+ else link->base.next = (struct mscabd_cabinet *) cab;
43109+ link = cab;
43110+
43111+ /* cause the search to restart after this cab's data. */
43112+ offset = caboff + (off_t) cablen_u32;
43113+
43114+#ifndef LARGEFILE_SUPPORT
43115+ /* detect 32-bit off_t overflow */
43116+ if (offset < caboff) {
43117+ sys->message(fh, largefile_msg);
43118+ return MSPACK_ERR_OK;
43119+ }
43120+#endif
43121+ }
43122+ }
43123+
43124+ /* restart search */
43125+ if (offset >= flen) return MSPACK_ERR_OK;
43126+ if (sys->seek(fh, offset, MSPACK_SYS_SEEK_START)) {
43127+ return MSPACK_ERR_SEEK;
43128+ }
43129+ length = 0;
43130+ p = pend;
43131+ state = 0;
43132+ break;
43133+
43134+ /* for bytes 4-7 and 12-15, just advance state/pointer */
43135+ default:
43136+ p++, state++;
43137+ } /* switch(state) */
43138+ } /* for (... p < pend ...) */
43139+ } /* for (... offset < length ...) */
43140+
43141+ if (false_cabs) {
43142+ D(("%d false cabinets found", false_cabs))
43143+ }
43144+
43145+ return MSPACK_ERR_OK;
43146+}
43147+
43148+/***************************************
43149+ * CABD_MERGE, CABD_PREPEND, CABD_APPEND
43150+ ***************************************
43151+ * joins cabinets together, also merges split folders between these two
43152+ * cabinets only. This includes freeing the duplicate folder and file(s)
43153+ * and allocating a further mscabd_folder_data structure to append to the
43154+ * merged folder's data parts list.
43155+ */
43156+static int cabd_prepend(struct mscab_decompressor *base,
43157+ struct mscabd_cabinet *cab,
43158+ struct mscabd_cabinet *prevcab)
43159+{
43160+ return cabd_merge(base, prevcab, cab);
43161+}
43162+
43163+static int cabd_append(struct mscab_decompressor *base,
43164+ struct mscabd_cabinet *cab,
43165+ struct mscabd_cabinet *nextcab)
43166+{
43167+ return cabd_merge(base, cab, nextcab);
43168+}
43169+
43170+static int cabd_merge(struct mscab_decompressor *base,
43171+ struct mscabd_cabinet *lcab,
43172+ struct mscabd_cabinet *rcab)
43173+{
43174+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
43175+ struct mscabd_folder_data *data, *ndata;
43176+ struct mscabd_folder_p *lfol, *rfol;
43177+ struct mscabd_file *fi, *rfi, *lfi;
43178+ struct mscabd_cabinet *cab;
43179+ struct mspack_system *sys;
43180+
43181+ if (!self) return MSPACK_ERR_ARGS;
43182+ sys = self->system;
43183+
43184+ /* basic args check */
43185+ if (!lcab || !rcab || (lcab == rcab)) {
43186+ D(("lcab NULL, rcab NULL or lcab = rcab"))
43187+ return self->error = MSPACK_ERR_ARGS;
43188+ }
43189+
43190+ /* check there's not already a cabinet attached */
43191+ if (lcab->nextcab || rcab->prevcab) {
43192+ D(("cabs already joined"))
43193+ return self->error = MSPACK_ERR_ARGS;
43194+ }
43195+
43196+ /* do not create circular cabinet chains */
43197+ for (cab = lcab->prevcab; cab; cab = cab->prevcab) {
43198+ if (cab == rcab) {D(("circular!")) return self->error = MSPACK_ERR_ARGS;}
43199+ }
43200+ for (cab = rcab->nextcab; cab; cab = cab->nextcab) {
43201+ if (cab == lcab) {D(("circular!")) return self->error = MSPACK_ERR_ARGS;}
43202+ }
43203+
43204+ /* warn about odd set IDs or indices */
43205+ if (lcab->set_id != rcab->set_id) {
43206+ sys->message(NULL, "WARNING; merged cabinets with differing Set IDs.");
43207+ }
43208+
43209+ if (lcab->set_index > rcab->set_index) {
43210+ sys->message(NULL, "WARNING; merged cabinets with odd order.");
43211+ }
43212+
43213+ /* merging the last folder in lcab with the first folder in rcab */
43214+ lfol = (struct mscabd_folder_p *) lcab->folders;
43215+ rfol = (struct mscabd_folder_p *) rcab->folders;
43216+ while (lfol->base.next) lfol = (struct mscabd_folder_p *) lfol->base.next;
43217+
43218+ /* do we need to merge folders? */
43219+ if (!lfol->merge_next && !rfol->merge_prev) {
43220+ /* no, at least one of the folders is not for merging */
43221+
43222+ /* attach cabs */
43223+ lcab->nextcab = rcab;
43224+ rcab->prevcab = lcab;
43225+
43226+ /* attach folders */
43227+ lfol->base.next = (struct mscabd_folder *) rfol;
43228+
43229+ /* attach files */
43230+ fi = lcab->files;
43231+ while (fi->next) fi = fi->next;
43232+ fi->next = rcab->files;
43233+ }
43234+ else {
43235+ /* folder merge required - do the files match? */
43236+ if (! cabd_can_merge_folders(sys, lfol, rfol)) {
43237+ return self->error = MSPACK_ERR_DATAFORMAT;
43238+ }
43239+
43240+ /* allocate a new folder data structure */
43241+ if (!(data = (struct mscabd_folder_data *) sys->alloc(sys, sizeof(struct mscabd_folder_data)))) {
43242+ return self->error = MSPACK_ERR_NOMEMORY;
43243+ }
43244+
43245+ /* attach cabs */
43246+ lcab->nextcab = rcab;
43247+ rcab->prevcab = lcab;
43248+
43249+ /* append rfol's data to lfol */
43250+ ndata = &lfol->data;
43251+ while (ndata->next) ndata = ndata->next;
43252+ ndata->next = data;
43253+ *data = rfol->data;
43254+ rfol->data.next = NULL;
43255+
43256+ /* lfol becomes rfol.
43257+ * NOTE: special case, don't merge if rfol is merge prev and next,
43258+ * rfol->merge_next is going to be deleted, so keep lfol's version
43259+ * instead */
43260+ lfol->base.num_blocks += rfol->base.num_blocks - 1;
43261+ if ((rfol->merge_next == NULL) ||
43262+ (rfol->merge_next->folder != (struct mscabd_folder *) rfol))
43263+ {
43264+ lfol->merge_next = rfol->merge_next;
43265+ }
43266+
43267+ /* attach the rfol's folder (except the merge folder) */
43268+ while (lfol->base.next) lfol = (struct mscabd_folder_p *) lfol->base.next;
43269+ lfol->base.next = rfol->base.next;
43270+
43271+ /* free disused merge folder */
43272+ sys->free(rfol);
43273+
43274+ /* attach rfol's files */
43275+ fi = lcab->files;
43276+ while (fi->next) fi = fi->next;
43277+ fi->next = rcab->files;
43278+
43279+ /* delete all files from rfol's merge folder */
43280+ lfi = NULL;
43281+ for (fi = lcab->files; fi ; fi = rfi) {
43282+ rfi = fi->next;
43283+ /* if file's folder matches the merge folder, unlink and free it */
43284+ if (fi->folder == (struct mscabd_folder *) rfol) {
43285+ if (lfi) lfi->next = rfi; else lcab->files = rfi;
43286+ sys->free(fi->filename);
43287+ sys->free(fi);
43288+ }
43289+ else lfi = fi;
43290+ }
43291+ }
43292+
43293+ /* all done! fix files and folders pointers in all cabs so they all
43294+ * point to the same list */
43295+ for (cab = lcab->prevcab; cab; cab = cab->prevcab) {
43296+ cab->files = lcab->files;
43297+ cab->folders = lcab->folders;
43298+ }
43299+
43300+ for (cab = lcab->nextcab; cab; cab = cab->nextcab) {
43301+ cab->files = lcab->files;
43302+ cab->folders = lcab->folders;
43303+ }
43304+
43305+ return self->error = MSPACK_ERR_OK;
43306+}
43307+
43308+/* decides if two folders are OK to merge */
43309+static int cabd_can_merge_folders(struct mspack_system *sys,
43310+ struct mscabd_folder_p *lfol,
43311+ struct mscabd_folder_p *rfol)
43312+{
43313+ struct mscabd_file *lfi, *rfi, *l, *r;
43314+ int matching = 1;
43315+
43316+ /* check that both folders use the same compression method/settings */
43317+ if (lfol->base.comp_type != rfol->base.comp_type) {
43318+ D(("folder merge: compression type mismatch"))
43319+ return 0;
43320+ }
43321+
43322+ if (!(lfi = lfol->merge_next) || !(rfi = rfol->merge_prev)) {
43323+ D(("folder merge: one cabinet has no files to merge"))
43324+ return 0;
43325+ }
43326+
43327+ /* for all files in lfol (which is the last folder in whichever cab and
43328+ * only has files to merge), compare them to the files from rfol. They
43329+ * should be identical in number and order. to verify this, check the
43330+ * offset and length of each file. */
43331+ for (l=lfi, r=rfi; l; l=l->next, r=r->next) {
43332+ if (!r || (l->offset != r->offset) || (l->length != r->length)) {
43333+ matching = 0;
43334+ break;
43335+ }
43336+ }
43337+
43338+ if (matching) return 1;
43339+
43340+ /* if rfol does not begin with an identical copy of the files in lfol, make
43341+ * make a judgement call; if at least ONE file from lfol is in rfol, allow
43342+ * the merge with a warning about missing files. */
43343+ matching = 0;
43344+ for (l = lfi; l; l = l->next) {
43345+ for (r = rfi; r; r = r->next) {
43346+ if (l->offset == r->offset && l->length == r->length) break;
43347+ }
43348+ if (r) matching = 1; else sys->message(NULL,
43349+ "WARNING; merged file %s not listed in both cabinets", l->filename);
43350+ }
43351+ return matching;
43352+}
43353+
43354+
43355+/***************************************
43356+ * CABD_EXTRACT
43357+ ***************************************
43358+ * extracts a file from a cabinet
43359+ */
43360+static int cabd_extract(struct mscab_decompressor *base,
43361+ struct mscabd_file *file, const char *filename)
43362+{
43363+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
43364+ struct mscabd_folder_p *fol;
43365+ struct mspack_system *sys;
43366+ struct mspack_file *fh;
43367+
43368+ if (!self) return MSPACK_ERR_ARGS;
43369+ if (!file) return self->error = MSPACK_ERR_ARGS;
43370+
43371+ sys = self->system;
43372+ fol = (struct mscabd_folder_p *) file->folder;
43373+
43374+ /* check if file can be extracted */
43375+ if ((!fol) || (fol->merge_prev) ||
43376+ (((file->offset + file->length) / CAB_BLOCKMAX) > fol->base.num_blocks))
43377+ {
43378+ sys->message(NULL, "ERROR; file \"%s\" cannot be extracted, "
43379+ "cabinet set is incomplete.", file->filename);
43380+ return self->error = MSPACK_ERR_DATAFORMAT;
43381+ }
43382+
43383+ /* allocate generic decompression state */
43384+ if (!self->d) {
43385+ self->d = (struct mscabd_decompress_state *) sys->alloc(sys, sizeof(struct mscabd_decompress_state));
43386+ if (!self->d) return self->error = MSPACK_ERR_NOMEMORY;
43387+ self->d->folder = NULL;
43388+ self->d->data = NULL;
43389+ self->d->sys = *sys;
43390+ self->d->sys.read = &cabd_sys_read;
43391+ self->d->sys.write = &cabd_sys_write;
43392+ self->d->state = NULL;
43393+ self->d->infh = NULL;
43394+ self->d->incab = NULL;
43395+ }
43396+
43397+ /* do we need to change folder or reset the current folder? */
43398+ if ((self->d->folder != fol) || (self->d->offset > file->offset)) {
43399+ /* do we need to open a new cab file? */
43400+ if (!self->d->infh || (fol->data.cab != self->d->incab)) {
43401+ /* close previous file handle if from a different cab */
43402+ if (self->d->infh) sys->close(self->d->infh);
43403+ self->d->incab = fol->data.cab;
43404+ self->d->infh = sys->open(sys, fol->data.cab->base.filename,
43405+ MSPACK_SYS_OPEN_READ);
43406+ if (!self->d->infh) return self->error = MSPACK_ERR_OPEN;
43407+ }
43408+ /* seek to start of data blocks */
43409+ if (sys->seek(self->d->infh, fol->data.offset, MSPACK_SYS_SEEK_START)) {
43410+ return self->error = MSPACK_ERR_SEEK;
43411+ }
43412+
43413+ /* set up decompressor */
43414+ if (cabd_init_decomp(self, (unsigned int) fol->base.comp_type)) {
43415+ return self->error;
43416+ }
43417+
43418+ /* initialise new folder state */
43419+ self->d->folder = fol;
43420+ self->d->data = &fol->data;
43421+ self->d->offset = 0;
43422+ self->d->block = 0;
43423+ self->d->i_ptr = self->d->i_end = &self->d->input[0];
43424+
43425+ /* read_error lasts for the lifetime of a decompressor */
43426+ self->read_error = MSPACK_ERR_OK;
43427+ }
43428+
43429+ /* open file for output */
43430+ if (!(fh = sys->open(sys, filename, MSPACK_SYS_OPEN_WRITE))) {
43431+ return self->error = MSPACK_ERR_OPEN;
43432+ }
43433+
43434+ self->error = MSPACK_ERR_OK;
43435+
43436+ /* if file has more than 0 bytes */
43437+ if (file->length) {
43438+ off_t bytes;
43439+ int error;
43440+ /* get to correct offset.
43441+ * - use NULL fh to say 'no writing' to cabd_sys_write()
43442+ * - if cabd_sys_read() has an error, it will set self->read_error
43443+ * and pass back MSPACK_ERR_READ
43444+ */
43445+ self->d->outfh = NULL;
43446+ if ((bytes = file->offset - self->d->offset)) {
43447+ error = self->d->decompress(self->d->state, bytes);
43448+ self->error = (error == MSPACK_ERR_READ) ? self->read_error : error;
43449+ }
43450+
43451+ /* if getting to the correct offset was error free, unpack file */
43452+ if (!self->error) {
43453+ self->d->outfh = fh;
43454+ error = self->d->decompress(self->d->state, (off_t) file->length);
43455+ self->error = (error == MSPACK_ERR_READ) ? self->read_error : error;
43456+ }
43457+ }
43458+
43459+ /* close output file */
43460+ sys->close(fh);
43461+ self->d->outfh = NULL;
43462+
43463+ return self->error;
43464+}
43465+
43466+/***************************************
43467+ * CABD_INIT_DECOMP, CABD_FREE_DECOMP
43468+ ***************************************
43469+ * cabd_init_decomp initialises decompression state, according to which
43470+ * decompression method was used. relies on self->d->folder being the same
43471+ * as when initialised.
43472+ *
43473+ * cabd_free_decomp frees decompression state, according to which method
43474+ * was used.
43475+ */
43476+static int cabd_init_decomp(struct mscab_decompressor_p *self, unsigned int ct)
43477+{
43478+ struct mspack_file *fh = (struct mspack_file *) self;
43479+
43480+ assert(self && self->d);
43481+
43482+ /* free any existing decompressor */
43483+ cabd_free_decomp(self);
43484+
43485+ self->d->comp_type = ct;
43486+
43487+ switch (ct & cffoldCOMPTYPE_MASK) {
43488+ case cffoldCOMPTYPE_NONE:
43489+ self->d->decompress = (int (*)(void *, off_t)) &noned_decompress;
43490+ self->d->state = noned_init(&self->d->sys, fh, fh,
43491+ self->param[MSCABD_PARAM_DECOMPBUF]);
43492+ break;
43493+ case cffoldCOMPTYPE_MSZIP:
43494+ self->d->decompress = (int (*)(void *, off_t)) &mszipd_decompress;
43495+ self->d->state = mszipd_init(&self->d->sys, fh, fh,
43496+ self->param[MSCABD_PARAM_DECOMPBUF],
43497+ self->param[MSCABD_PARAM_FIXMSZIP]);
43498+ break;
43499+ case cffoldCOMPTYPE_QUANTUM:
43500+ self->d->decompress = (int (*)(void *, off_t)) &qtmd_decompress;
43501+ self->d->state = qtmd_init(&self->d->sys, fh, fh, (int) (ct >> 8) & 0x1f,
43502+ self->param[MSCABD_PARAM_DECOMPBUF]);
43503+ break;
43504+ case cffoldCOMPTYPE_LZX:
43505+ self->d->decompress = (int (*)(void *, off_t)) &lzxd_decompress;
43506+ self->d->state = lzxd_init(&self->d->sys, fh, fh, (int) (ct >> 8) & 0x1f, 0,
43507+ self->param[MSCABD_PARAM_DECOMPBUF], (off_t)0,0);
43508+ break;
43509+ default:
43510+ return self->error = MSPACK_ERR_DATAFORMAT;
43511+ }
43512+ return self->error = (self->d->state) ? MSPACK_ERR_OK : MSPACK_ERR_NOMEMORY;
43513+}
43514+
43515+static void cabd_free_decomp(struct mscab_decompressor_p *self) {
43516+ if (!self || !self->d || !self->d->folder || !self->d->state) return;
43517+
43518+ switch (self->d->comp_type & cffoldCOMPTYPE_MASK) {
43519+ case cffoldCOMPTYPE_NONE: noned_free((struct noned_state *) self->d->state); break;
43520+ case cffoldCOMPTYPE_MSZIP: mszipd_free((struct mszipd_stream *) self->d->state); break;
43521+ case cffoldCOMPTYPE_QUANTUM: qtmd_free((struct qtmd_stream *) self->d->state); break;
43522+ case cffoldCOMPTYPE_LZX: lzxd_free((struct lzxd_stream *) self->d->state); break;
43523+ }
43524+ self->d->decompress = NULL;
43525+ self->d->state = NULL;
43526+}
43527+
43528+/***************************************
43529+ * CABD_SYS_READ, CABD_SYS_WRITE
43530+ ***************************************
43531+ * cabd_sys_read is the internal reader function which the decompressors
43532+ * use. will read data blocks (and merge split blocks) from the cabinet
43533+ * and serve the read bytes to the decompressors
43534+ *
43535+ * cabd_sys_write is the internal writer function which the decompressors
43536+ * use. it either writes data to disk (self->d->outfh) with the real
43537+ * sys->write() function, or does nothing with the data when
43538+ * self->d->outfh == NULL. advances self->d->offset
43539+ */
43540+static int cabd_sys_read(struct mspack_file *file, void *buffer, int bytes) {
43541+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) file;
43542+ unsigned char *buf = (unsigned char *) buffer;
43543+ struct mspack_system *sys = self->system;
43544+ int avail, todo, outlen, ignore_cksum;
43545+
43546+ ignore_cksum = self->param[MSCABD_PARAM_FIXMSZIP] &&
43547+ ((self->d->comp_type & cffoldCOMPTYPE_MASK) == cffoldCOMPTYPE_MSZIP);
43548+
43549+ todo = bytes;
43550+ while (todo > 0) {
43551+ avail = self->d->i_end - self->d->i_ptr;
43552+
43553+ /* if out of input data, read a new block */
43554+ if (avail) {
43555+ /* copy as many input bytes available as possible */
43556+ if (avail > todo) avail = todo;
43557+ sys->copy(self->d->i_ptr, buf, (size_t) avail);
43558+ self->d->i_ptr += avail;
43559+ buf += avail;
43560+ todo -= avail;
43561+ }
43562+ else {
43563+ /* out of data, read a new block */
43564+
43565+ /* check if we're out of input blocks, advance block counter */
43566+ if (self->d->block++ >= self->d->folder->base.num_blocks) {
43567+ self->read_error = MSPACK_ERR_DATAFORMAT;
43568+ break;
43569+ }
43570+
43571+ /* read a block */
43572+ self->read_error = cabd_sys_read_block(sys, self->d, &outlen, ignore_cksum);
43573+ if (self->read_error) return -1;
43574+
43575+ /* special Quantum hack -- trailer byte to allow the decompressor
43576+ * to realign itself. CAB Quantum blocks, unlike LZX blocks, can have
43577+ * anything from 0 to 4 trailing null bytes. */
43578+ if ((self->d->comp_type & cffoldCOMPTYPE_MASK)==cffoldCOMPTYPE_QUANTUM) {
43579+ *self->d->i_end++ = 0xFF;
43580+ }
43581+
43582+ /* is this the last block? */
43583+ if (self->d->block >= self->d->folder->base.num_blocks) {
43584+ /* last block */
43585+ if ((self->d->comp_type & cffoldCOMPTYPE_MASK) == cffoldCOMPTYPE_LZX) {
43586+ /* special LZX hack -- on the last block, inform LZX of the
43587+ * size of the output data stream. */
43588+ lzxd_set_output_length((struct lzxd_stream *) self->d->state, (off_t)
43589+ ((self->d->block-1) * CAB_BLOCKMAX + outlen));
43590+ }
43591+ }
43592+ else {
43593+ /* not the last block */
43594+ if (outlen != CAB_BLOCKMAX) {
43595+ self->system->message(self->d->infh,
43596+ "WARNING; non-maximal data block");
43597+ }
43598+ }
43599+ } /* if (avail) */
43600+ } /* while (todo > 0) */
43601+ return bytes - todo;
43602+}
43603+
43604+static int cabd_sys_write(struct mspack_file *file, void *buffer, int bytes) {
43605+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) file;
43606+ self->d->offset += bytes;
43607+ if (self->d->outfh) {
43608+ return self->system->write(self->d->outfh, buffer, bytes);
43609+ }
43610+ return bytes;
43611+}
43612+
43613+/***************************************
43614+ * CABD_SYS_READ_BLOCK
43615+ ***************************************
43616+ * reads a whole data block from a cab file. the block may span more than
43617+ * one cab file, if it does then the fragments will be reassembled
43618+ */
43619+static int cabd_sys_read_block(struct mspack_system *sys,
43620+ struct mscabd_decompress_state *d,
43621+ int *out, int ignore_cksum)
43622+{
43623+ unsigned char hdr[cfdata_SIZEOF];
43624+ unsigned int cksum;
43625+ int len;
43626+
43627+ /* reset the input block pointer and end of block pointer */
43628+ d->i_ptr = d->i_end = &d->input[0];
43629+
43630+ do {
43631+ /* read the block header */
43632+ if (sys->read(d->infh, &hdr[0], cfdata_SIZEOF) != cfdata_SIZEOF) {
43633+ return MSPACK_ERR_READ;
43634+ }
43635+
43636+ /* skip any reserved block headers */
43637+ if (d->data->cab->block_resv &&
43638+ sys->seek(d->infh, (off_t) d->data->cab->block_resv,
43639+ MSPACK_SYS_SEEK_CUR))
43640+ {
43641+ return MSPACK_ERR_SEEK;
43642+ }
43643+
43644+ /* blocks must not be over CAB_INPUTMAX in size */
43645+ len = EndGetI16(&hdr[cfdata_CompressedSize]);
43646+ if (((d->i_end - d->i_ptr) + len) > CAB_INPUTMAX) {
43647+ D(("block size > CAB_INPUTMAX (%ld + %d)", d->i_end - d->i_ptr, len))
43648+ return MSPACK_ERR_DATAFORMAT;
43649+ }
43650+
43651+ /* blocks must not expand to more than CAB_BLOCKMAX */
43652+ if (EndGetI16(&hdr[cfdata_UncompressedSize]) > CAB_BLOCKMAX) {
43653+ D(("block size > CAB_BLOCKMAX"))
43654+ return MSPACK_ERR_DATAFORMAT;
43655+ }
43656+
43657+ /* read the block data */
43658+ if (sys->read(d->infh, d->i_end, len) != len) {
43659+ return MSPACK_ERR_READ;
43660+ }
43661+
43662+ /* perform checksum test on the block (if one is stored) */
43663+ if ((cksum = EndGetI32(&hdr[cfdata_CheckSum]))) {
43664+ unsigned int sum2 = cabd_checksum(d->i_end, (unsigned int) len, 0);
43665+ if (cabd_checksum(&hdr[4], 4, sum2) != cksum) {
43666+ if (!ignore_cksum) return MSPACK_ERR_CHECKSUM;
43667+ sys->message(d->infh, "WARNING; bad block checksum found");
43668+ }
43669+ }
43670+
43671+ /* advance end of block pointer to include newly read data */
43672+ d->i_end += len;
43673+
43674+ /* uncompressed size == 0 means this block was part of a split block
43675+ * and it continues as the first block of the next cabinet in the set.
43676+ * otherwise, this is the last part of the block, and no more block
43677+ * reading needs to be done.
43678+ */
43679+ /* EXIT POINT OF LOOP -- uncompressed size != 0 */
43680+ if ((*out = EndGetI16(&hdr[cfdata_UncompressedSize]))) {
43681+ return MSPACK_ERR_OK;
43682+ }
43683+
43684+ /* otherwise, advance to next cabinet */
43685+
43686+ /* close current file handle */
43687+ sys->close(d->infh);
43688+ d->infh = NULL;
43689+
43690+ /* advance to next member in the cabinet set */
43691+ if (!(d->data = d->data->next)) {
43692+ D(("ran out of splits in cabinet set"))
43693+ return MSPACK_ERR_DATAFORMAT;
43694+ }
43695+
43696+ /* open next cab file */
43697+ d->incab = d->data->cab;
43698+ if (!(d->infh = sys->open(sys, d->incab->base.filename,
43699+ MSPACK_SYS_OPEN_READ)))
43700+ {
43701+ return MSPACK_ERR_OPEN;
43702+ }
43703+
43704+ /* seek to start of data blocks */
43705+ if (sys->seek(d->infh, d->data->offset, MSPACK_SYS_SEEK_START)) {
43706+ return MSPACK_ERR_SEEK;
43707+ }
43708+ } while (1);
43709+
43710+ /* not reached */
43711+ return MSPACK_ERR_OK;
43712+}
43713+
43714+static unsigned int cabd_checksum(unsigned char *data, unsigned int bytes,
43715+ unsigned int cksum)
43716+{
43717+ unsigned int len, ul = 0;
43718+
43719+ for (len = bytes >> 2; len--; data += 4) {
43720+ cksum ^= ((data[0]) | (data[1]<<8) | (data[2]<<16) | (data[3]<<24));
43721+ }
43722+
43723+ switch (bytes & 3) {
43724+ case 3: ul |= *data++ << 16;
43725+ case 2: ul |= *data++ << 8;
43726+ case 1: ul |= *data;
43727+ }
43728+ cksum ^= ul;
43729+
43730+ return cksum;
43731+}
43732+
43733+/***************************************
43734+ * NONED_INIT, NONED_DECOMPRESS, NONED_FREE
43735+ ***************************************
43736+ * the "not compressed" method decompressor
43737+ */
43738+struct noned_state {
43739+ struct mspack_system *sys;
43740+ struct mspack_file *i;
43741+ struct mspack_file *o;
43742+ unsigned char *buf;
43743+ int bufsize;
43744+};
43745+
43746+static struct noned_state *noned_init(struct mspack_system *sys,
43747+ struct mspack_file *in,
43748+ struct mspack_file *out,
43749+ int bufsize)
43750+{
43751+ struct noned_state *state = (struct noned_state *) sys->alloc(sys, sizeof(struct noned_state));
43752+ unsigned char *buf = (unsigned char *) sys->alloc(sys, (size_t) bufsize);
43753+ if (state && buf) {
43754+ state->sys = sys;
43755+ state->i = in;
43756+ state->o = out;
43757+ state->buf = buf;
43758+ state->bufsize = bufsize;
43759+ }
43760+ else {
43761+ sys->free(buf);
43762+ sys->free(state);
43763+ state = NULL;
43764+ }
43765+ return state;
43766+}
43767+
43768+static int noned_decompress(struct noned_state *s, off_t bytes) {
43769+ int run;
43770+ while (bytes > 0) {
43771+ run = (bytes > s->bufsize) ? s->bufsize : (int) bytes;
43772+ if (s->sys->read(s->i, &s->buf[0], run) != run) return MSPACK_ERR_READ;
43773+ if (s->sys->write(s->o, &s->buf[0], run) != run) return MSPACK_ERR_WRITE;
43774+ bytes -= run;
43775+ }
43776+ return MSPACK_ERR_OK;
43777+}
43778+
43779+static void noned_free(struct noned_state *state) {
43780+ struct mspack_system *sys;
43781+ if (state) {
43782+ sys = state->sys;
43783+ sys->free(state->buf);
43784+ sys->free(state);
43785+ }
43786+}
43787+
43788+
43789+/***************************************
43790+ * CABD_PARAM
43791+ ***************************************
43792+ * allows a parameter to be set
43793+ */
43794+static int cabd_param(struct mscab_decompressor *base, int param, int value) {
43795+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
43796+ if (!self) return MSPACK_ERR_ARGS;
43797+
43798+ switch (param) {
43799+ case MSCABD_PARAM_SEARCHBUF:
43800+ if (value < 4) return MSPACK_ERR_ARGS;
43801+ self->param[MSCABD_PARAM_SEARCHBUF] = value;
43802+ break;
43803+ case MSCABD_PARAM_FIXMSZIP:
43804+ self->param[MSCABD_PARAM_FIXMSZIP] = value;
43805+ break;
43806+ case MSCABD_PARAM_DECOMPBUF:
43807+ if (value < 4) return MSPACK_ERR_ARGS;
43808+ self->param[MSCABD_PARAM_DECOMPBUF] = value;
43809+ break;
43810+ default:
43811+ return MSPACK_ERR_ARGS;
43812+ }
43813+ return MSPACK_ERR_OK;
43814+}
43815+
43816+/***************************************
43817+ * CABD_ERROR
43818+ ***************************************
43819+ * returns the last error that occurred
43820+ */
43821+static int cabd_error(struct mscab_decompressor *base) {
43822+ struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base;
43823+ return (self) ? self->error : MSPACK_ERR_ARGS;
43824+}
43825diff --git a/libclamav/libmspack-0.4alpha/mspack/chm.h b/libclamav/libmspack-0.4alpha/mspack/chm.h
43826new file mode 100644
43827index 000000000000..a85d2e173157
43828--- /dev/null
43829+++ b/libclamav/libmspack-0.4alpha/mspack/chm.h
43830@@ -0,0 +1,122 @@
43831+/* This file is part of libmspack.
43832+ * (C) 2003-2004 Stuart Caie.
43833+ *
43834+ * libmspack is free software; you can redistribute it and/or modify it under
43835+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
43836+ *
43837+ * For further details, see the file COPYING.LIB distributed with libmspack
43838+ */
43839+
43840+#ifndef MSPACK_CHM_H
43841+#define MSPACK_CHM_H 1
43842+
43843+#include <lzx.h>
43844+
43845+/* generic CHM definitions */
43846+
43847+#define chmhead_Signature (0x0000)
43848+#define chmhead_Version (0x0004)
43849+#define chmhead_HeaderLen (0x0008)
43850+#define chmhead_Unknown1 (0x000C)
43851+#define chmhead_Timestamp (0x0010)
43852+#define chmhead_LanguageID (0x0014)
43853+#define chmhead_GUID1 (0x0018)
43854+#define chmhead_GUID2 (0x0028)
43855+#define chmhead_SIZEOF (0x0038)
43856+
43857+#define chmhst_OffsetHS0 (0x0000)
43858+#define chmhst_LengthHS0 (0x0008)
43859+#define chmhst_OffsetHS1 (0x0010)
43860+#define chmhst_LengthHS1 (0x0018)
43861+#define chmhst_SIZEOF (0x0020)
43862+#define chmhst3_OffsetCS0 (0x0020)
43863+#define chmhst3_SIZEOF (0x0028)
43864+
43865+#define chmhs0_Unknown1 (0x0000)
43866+#define chmhs0_Unknown2 (0x0004)
43867+#define chmhs0_FileLen (0x0008)
43868+#define chmhs0_Unknown3 (0x0010)
43869+#define chmhs0_Unknown4 (0x0014)
43870+#define chmhs0_SIZEOF (0x0018)
43871+
43872+#define chmhs1_Signature (0x0000)
43873+#define chmhs1_Version (0x0004)
43874+#define chmhs1_HeaderLen (0x0008)
43875+#define chmhs1_Unknown1 (0x000C)
43876+#define chmhs1_ChunkSize (0x0010)
43877+#define chmhs1_Density (0x0014)
43878+#define chmhs1_Depth (0x0018)
43879+#define chmhs1_IndexRoot (0x001C)
43880+#define chmhs1_FirstPMGL (0x0020)
43881+#define chmhs1_LastPMGL (0x0024)
43882+#define chmhs1_Unknown2 (0x0028)
43883+#define chmhs1_NumChunks (0x002C)
43884+#define chmhs1_LanguageID (0x0030)
43885+#define chmhs1_GUID (0x0034)
43886+#define chmhs1_Unknown3 (0x0044)
43887+#define chmhs1_Unknown4 (0x0048)
43888+#define chmhs1_Unknown5 (0x004C)
43889+#define chmhs1_Unknown6 (0x0050)
43890+#define chmhs1_SIZEOF (0x0054)
43891+
43892+#define pmgl_Signature (0x0000)
43893+#define pmgl_QuickRefSize (0x0004)
43894+#define pmgl_Unknown1 (0x0008)
43895+#define pmgl_PrevChunk (0x000C)
43896+#define pmgl_NextChunk (0x0010)
43897+#define pmgl_Entries (0x0014)
43898+#define pmgl_headerSIZEOF (0x0014)
43899+
43900+#define pmgi_Signature (0x0000)
43901+#define pmgi_QuickRefSize (0x0004)
43902+#define pmgi_Entries (0x0008)
43903+#define pmgi_headerSIZEOF (0x000C)
43904+
43905+#define lzxcd_Length (0x0000)
43906+#define lzxcd_Signature (0x0004)
43907+#define lzxcd_Version (0x0008)
43908+#define lzxcd_ResetInterval (0x000C)
43909+#define lzxcd_WindowSize (0x0010)
43910+#define lzxcd_CacheSize (0x0014)
43911+#define lzxcd_Unknown1 (0x0018)
43912+#define lzxcd_SIZEOF (0x001C)
43913+
43914+#define lzxrt_Unknown1 (0x0000)
43915+#define lzxrt_NumEntries (0x0004)
43916+#define lzxrt_EntrySize (0x0008)
43917+#define lzxrt_TableOffset (0x000C)
43918+#define lzxrt_UncompLen (0x0010)
43919+#define lzxrt_CompLen (0x0018)
43920+#define lzxrt_FrameLen (0x0020)
43921+#define lzxrt_Entries (0x0028)
43922+#define lzxrt_headerSIZEOF (0x0028)
43923+
43924+/* CHM compression definitions */
43925+
43926+struct mschm_compressor_p {
43927+ struct mschm_compressor base;
43928+ struct mspack_system *system;
43929+ char *temp_file;
43930+ int use_temp_file;
43931+ int error;
43932+};
43933+
43934+/* CHM decompression definitions */
43935+struct mschmd_decompress_state {
43936+ struct mschmd_header *chm; /* CHM file being decompressed */
43937+ off_t offset; /* uncompressed offset within folder */
43938+ off_t inoffset; /* offset in input file */
43939+ struct lzxd_stream *state; /* LZX decompressor state */
43940+ struct mspack_system sys; /* special I/O code for decompressor */
43941+ struct mspack_file *infh; /* input file handle */
43942+ struct mspack_file *outfh; /* output file handle */
43943+};
43944+
43945+struct mschm_decompressor_p {
43946+ struct mschm_decompressor base;
43947+ struct mspack_system *system;
43948+ struct mschmd_decompress_state *d;
43949+ int error;
43950+};
43951+
43952+#endif
43953diff --git a/libclamav/libmspack-0.4alpha/mspack/chmc.c b/libclamav/libmspack-0.4alpha/mspack/chmc.c
43954new file mode 100644
43955index 000000000000..72f6c5b389e4
43956--- /dev/null
43957+++ b/libclamav/libmspack-0.4alpha/mspack/chmc.c
43958@@ -0,0 +1,24 @@
43959+/* This file is part of libmspack.
43960+ * (C) 2003-2004 Stuart Caie.
43961+ *
43962+ * libmspack is free software; you can redistribute it and/or modify it under
43963+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
43964+ *
43965+ * For further details, see the file COPYING.LIB distributed with libmspack
43966+ */
43967+
43968+/* CHM compression implementation */
43969+
43970+#include <system.h>
43971+#include <chm.h>
43972+
43973+struct mschm_compressor *
43974+ mspack_create_chm_compressor(struct mspack_system *sys)
43975+{
43976+ /* todo */
43977+ return NULL;
43978+}
43979+
43980+void mspack_destroy_chm_compressor(struct mschm_compressor *self) {
43981+ /* todo */
43982+}
43983diff --git a/libclamav/libmspack-0.4alpha/mspack/chmd.c b/libclamav/libmspack-0.4alpha/mspack/chmd.c
43984new file mode 100644
43985index 000000000000..19dc47b56ec0
43986--- /dev/null
43987+++ b/libclamav/libmspack-0.4alpha/mspack/chmd.c
43988@@ -0,0 +1,1392 @@
43989+/* This file is part of libmspack.
43990+ * (C) 2003-2011 Stuart Caie.
43991+ *
43992+ * libmspack is free software; you can redistribute it and/or modify it under
43993+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
43994+ *
43995+ * For further details, see the file COPYING.LIB distributed with libmspack
43996+ */
43997+
43998+/* CHM decompression implementation */
43999+
44000+#include <system.h>
44001+#include <chm.h>
44002+
44003+/* prototypes */
44004+static struct mschmd_header * chmd_open(
44005+ struct mschm_decompressor *base, const char *filename);
44006+static struct mschmd_header * chmd_fast_open(
44007+ struct mschm_decompressor *base, const char *filename);
44008+static struct mschmd_header *chmd_real_open(
44009+ struct mschm_decompressor *base, const char *filename, int entire);
44010+static void chmd_close(
44011+ struct mschm_decompressor *base, struct mschmd_header *chm);
44012+static int chmd_read_headers(
44013+ struct mspack_system *sys, struct mspack_file *fh,
44014+ struct mschmd_header *chm, int entire);
44015+static int chmd_fast_find(
44016+ struct mschm_decompressor *base, struct mschmd_header *chm,
44017+ const char *filename, struct mschmd_file *f_ptr, int f_size);
44018+static unsigned char *read_chunk(
44019+ struct mschm_decompressor_p *self, struct mschmd_header *chm,
44020+ struct mspack_file *fh, unsigned int chunk);
44021+static int search_chunk(
44022+ struct mschmd_header *chm, const unsigned char *chunk, const char *filename,
44023+ const unsigned char **result, const unsigned char **result_end);
44024+static inline int compare(
44025+ const char *s1, const char *s2, int l1, int l2);
44026+static int chmd_extract(
44027+ struct mschm_decompressor *base, struct mschmd_file *file,
44028+ const char *filename);
44029+static int chmd_sys_write(
44030+ struct mspack_file *file, void *buffer, int bytes);
44031+static int chmd_init_decomp(
44032+ struct mschm_decompressor_p *self, struct mschmd_file *file);
44033+static int read_reset_table(
44034+ struct mschm_decompressor_p *self, struct mschmd_sec_mscompressed *sec,
44035+ int entry, off_t *length_ptr, off_t *offset_ptr);
44036+static int read_spaninfo(
44037+ struct mschm_decompressor_p *self, struct mschmd_sec_mscompressed *sec,
44038+ off_t *length_ptr);
44039+static int find_sys_file(
44040+ struct mschm_decompressor_p *self, struct mschmd_sec_mscompressed *sec,
44041+ struct mschmd_file **f_ptr, const char *name);
44042+static unsigned char *read_sys_file(
44043+ struct mschm_decompressor_p *self, struct mschmd_file *file);
44044+static int chmd_error(
44045+ struct mschm_decompressor *base);
44046+static int read_off64(
44047+ off_t *var, unsigned char *mem, struct mspack_system *sys,
44048+ struct mspack_file *fh);
44049+
44050+/* filenames of the system files used for decompression.
44051+ * Content and ControlData are essential.
44052+ * ResetTable is preferred, but SpanInfo can be used if not available
44053+ */
44054+static const char *content_name = "::DataSpace/Storage/MSCompressed/Content";
44055+static const char *control_name = "::DataSpace/Storage/MSCompressed/ControlData";
44056+static const char *spaninfo_name = "::DataSpace/Storage/MSCompressed/SpanInfo";
44057+static const char *rtable_name = "::DataSpace/Storage/MSCompressed/Transform/"
44058+ "{7FC28940-9D31-11D0-9B27-00A0C91E9C7C}/InstanceData/ResetTable";
44059+
44060+/***************************************
44061+ * MSPACK_CREATE_CHM_DECOMPRESSOR
44062+ ***************************************
44063+ * constructor
44064+ */
44065+struct mschm_decompressor *
44066+ mspack_create_chm_decompressor(struct mspack_system *sys)
44067+{
44068+ struct mschm_decompressor_p *self = NULL;
44069+
44070+ if (!sys) sys = mspack_default_system;
44071+ if (!mspack_valid_system(sys)) return NULL;
44072+
44073+ if ((self = (struct mschm_decompressor_p *) sys->alloc(sys, sizeof(struct mschm_decompressor_p)))) {
44074+ self->base.open = &chmd_open;
44075+ self->base.close = &chmd_close;
44076+ self->base.extract = &chmd_extract;
44077+ self->base.last_error = &chmd_error;
44078+ self->base.fast_open = &chmd_fast_open;
44079+ self->base.fast_find = &chmd_fast_find;
44080+ self->system = sys;
44081+ self->error = MSPACK_ERR_OK;
44082+ self->d = NULL;
44083+ }
44084+ return (struct mschm_decompressor *) self;
44085+}
44086+
44087+/***************************************
44088+ * MSPACK_DESTROY_CAB_DECOMPRESSOR
44089+ ***************************************
44090+ * destructor
44091+ */
44092+void mspack_destroy_chm_decompressor(struct mschm_decompressor *base) {
44093+ struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) base;
44094+ if (self) {
44095+ struct mspack_system *sys = self->system;
44096+ if (self->d) {
44097+ if (self->d->infh) sys->close(self->d->infh);
44098+ if (self->d->state) lzxd_free(self->d->state);
44099+ sys->free(self->d);
44100+ }
44101+ sys->free(self);
44102+ }
44103+}
44104+
44105+/***************************************
44106+ * CHMD_OPEN
44107+ ***************************************
44108+ * opens a file and tries to read it as a CHM file.
44109+ * Calls chmd_real_open() with entire=1.
44110+ */
44111+static struct mschmd_header *chmd_open(struct mschm_decompressor *base,
44112+ const char *filename)
44113+{
44114+ return chmd_real_open(base, filename, 1);
44115+}
44116+
44117+/***************************************
44118+ * CHMD_FAST_OPEN
44119+ ***************************************
44120+ * opens a file and tries to read it as a CHM file, but does not read
44121+ * the file headers. Calls chmd_real_open() with entire=0
44122+ */
44123+static struct mschmd_header *chmd_fast_open(struct mschm_decompressor *base,
44124+ const char *filename)
44125+{
44126+ return chmd_real_open(base, filename, 0);
44127+}
44128+
44129+/***************************************
44130+ * CHMD_REAL_OPEN
44131+ ***************************************
44132+ * the real implementation of chmd_open() and chmd_fast_open(). It simply
44133+ * passes the "entire" parameter to chmd_read_headers(), which will then
44134+ * either read all headers, or a bare mininum.
44135+ */
44136+static struct mschmd_header *chmd_real_open(struct mschm_decompressor *base,
44137+ const char *filename, int entire)
44138+{
44139+ struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) base;
44140+ struct mschmd_header *chm = NULL;
44141+ struct mspack_system *sys;
44142+ struct mspack_file *fh;
44143+ int error;
44144+
44145+ if (!base) return NULL;
44146+ sys = self->system;
44147+
44148+ if ((fh = sys->open(sys, filename, MSPACK_SYS_OPEN_READ))) {
44149+ if ((chm = (struct mschmd_header *) sys->alloc(sys, sizeof(struct mschmd_header)))) {
44150+ chm->filename = filename;
44151+ error = chmd_read_headers(sys, fh, chm, entire);
44152+ if (error) {
44153+ /* if the error is DATAFORMAT, and there are some results, return
44154+ * partial results with a warning, rather than nothing */
44155+ if (error == MSPACK_ERR_DATAFORMAT && (chm->files || chm->sysfiles)) {
44156+ sys->message(fh, "WARNING; contents are corrupt");
44157+ error = MSPACK_ERR_OK;
44158+ }
44159+ else {
44160+ chmd_close(base, chm);
44161+ chm = NULL;
44162+ }
44163+ }
44164+ self->error = error;
44165+ }
44166+ else {
44167+ self->error = MSPACK_ERR_NOMEMORY;
44168+ }
44169+ sys->close(fh);
44170+ }
44171+ else {
44172+ self->error = MSPACK_ERR_OPEN;
44173+ }
44174+ return chm;
44175+}
44176+
44177+/***************************************
44178+ * CHMD_CLOSE
44179+ ***************************************
44180+ * frees all memory associated with a given mschmd_header
44181+ */
44182+static void chmd_close(struct mschm_decompressor *base,
44183+ struct mschmd_header *chm)
44184+{
44185+ struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) base;
44186+ struct mschmd_file *fi, *nfi;
44187+ struct mspack_system *sys;
44188+ unsigned int i;
44189+
44190+ if (!base) return;
44191+ sys = self->system;
44192+
44193+ self->error = MSPACK_ERR_OK;
44194+
44195+ /* free files */
44196+ for (fi = chm->files; fi; fi = nfi) {
44197+ nfi = fi->next;
44198+ sys->free(fi);
44199+ }
44200+ for (fi = chm->sysfiles; fi; fi = nfi) {
44201+ nfi = fi->next;
44202+ sys->free(fi);
44203+ }
44204+
44205+ /* if this CHM was being decompressed, free decompression state */
44206+ if (self->d && (self->d->chm == chm)) {
44207+ if (self->d->infh) sys->close(self->d->infh);
44208+ if (self->d->state) lzxd_free(self->d->state);
44209+ sys->free(self->d);
44210+ self->d = NULL;
44211+ }
44212+
44213+ /* if this CHM had a chunk cache, free it and contents */
44214+ if (chm->chunk_cache) {
44215+ for (i = 0; i < chm->num_chunks; i++) sys->free(chm->chunk_cache[i]);
44216+ sys->free(chm->chunk_cache);
44217+ }
44218+
44219+ sys->free(chm);
44220+}
44221+
44222+/***************************************
44223+ * CHMD_READ_HEADERS
44224+ ***************************************
44225+ * reads the basic CHM file headers. If the "entire" parameter is
44226+ * non-zero, all file entries will also be read. fills out a pre-existing
44227+ * mschmd_header structure, allocates memory for files as necessary
44228+ */
44229+
44230+/* The GUIDs found in CHM headers */
44231+static const unsigned char guids[32] = {
44232+ /* {7C01FD10-7BAA-11D0-9E0C-00A0-C922-E6EC} */
44233+ 0x10, 0xFD, 0x01, 0x7C, 0xAA, 0x7B, 0xD0, 0x11,
44234+ 0x9E, 0x0C, 0x00, 0xA0, 0xC9, 0x22, 0xE6, 0xEC,
44235+ /* {7C01FD11-7BAA-11D0-9E0C-00A0-C922-E6EC} */
44236+ 0x11, 0xFD, 0x01, 0x7C, 0xAA, 0x7B, 0xD0, 0x11,
44237+ 0x9E, 0x0C, 0x00, 0xA0, 0xC9, 0x22, 0xE6, 0xEC
44238+};
44239+
44240+/* reads an encoded integer into a variable; 7 bits of data per byte,
44241+ * the high bit is used to indicate that there is another byte */
44242+#define READ_ENCINT(var) do { \
44243+ (var) = 0; \
44244+ do { \
44245+ if (p > end) goto chunk_end; \
44246+ (var) = ((var) << 7) | (*p & 0x7F); \
44247+ } while (*p++ & 0x80); \
44248+} while (0)
44249+
44250+static int chmd_read_headers(struct mspack_system *sys, struct mspack_file *fh,
44251+ struct mschmd_header *chm, int entire)
44252+{
44253+ unsigned int section, name_len, x, errors, num_chunks;
44254+ unsigned char buf[0x54], *chunk = NULL, *name, *p, *end;
44255+ struct mschmd_file *fi, *link = NULL;
44256+ off_t offset, length;
44257+ int num_entries, i;
44258+
44259+ /* initialise pointers */
44260+ chm->files = NULL;
44261+ chm->sysfiles = NULL;
44262+ chm->chunk_cache = NULL;
44263+ chm->sec0.base.chm = chm;
44264+ chm->sec0.base.id = 0;
44265+ chm->sec1.base.chm = chm;
44266+ chm->sec1.base.id = 1;
44267+ chm->sec1.content = NULL;
44268+ chm->sec1.control = NULL;
44269+ chm->sec1.spaninfo = NULL;
44270+ chm->sec1.rtable = NULL;
44271+
44272+ /* read the first header */
44273+ if (sys->read(fh, &buf[0], chmhead_SIZEOF) != chmhead_SIZEOF) {
44274+ return MSPACK_ERR_READ;
44275+ }
44276+
44277+ /* check ITSF signature */
44278+ if (EndGetI32(&buf[chmhead_Signature]) != 0x46535449) {
44279+ return MSPACK_ERR_SIGNATURE;
44280+ }
44281+
44282+ /* check both header GUIDs */
44283+ if (mspack_memcmp(&buf[chmhead_GUID1], &guids[0], 32L) != 0) {
44284+ D(("incorrect GUIDs"))
44285+ return MSPACK_ERR_SIGNATURE;
44286+ }
44287+
44288+ chm->version = EndGetI32(&buf[chmhead_Version]);
44289+ chm->timestamp = EndGetM32(&buf[chmhead_Timestamp]);
44290+ chm->language = EndGetI32(&buf[chmhead_LanguageID]);
44291+ if (chm->version > 3) {
44292+ sys->message(fh, "WARNING; CHM version > 3");
44293+ }
44294+
44295+ /* read the header section table */
44296+ if (sys->read(fh, &buf[0], chmhst3_SIZEOF) != chmhst3_SIZEOF) {
44297+ return MSPACK_ERR_READ;
44298+ }
44299+
44300+ /* chmhst3_OffsetCS0 does not exist in version 1 or 2 CHM files.
44301+ * The offset will be corrected later, once HS1 is read.
44302+ */
44303+ if (read_off64(&offset, &buf[chmhst_OffsetHS0], sys, fh) ||
44304+ read_off64(&chm->dir_offset, &buf[chmhst_OffsetHS1], sys, fh) ||
44305+ read_off64(&chm->sec0.offset, &buf[chmhst3_OffsetCS0], sys, fh))
44306+ {
44307+ return MSPACK_ERR_DATAFORMAT;
44308+ }
44309+
44310+ /* seek to header section 0 */
44311+ if (sys->seek(fh, offset, MSPACK_SYS_SEEK_START)) {
44312+ return MSPACK_ERR_SEEK;
44313+ }
44314+
44315+ /* read header section 0 */
44316+ if (sys->read(fh, &buf[0], chmhs0_SIZEOF) != chmhs0_SIZEOF) {
44317+ return MSPACK_ERR_READ;
44318+ }
44319+ if (read_off64(&chm->length, &buf[chmhs0_FileLen], sys, fh)) {
44320+ return MSPACK_ERR_DATAFORMAT;
44321+ }
44322+
44323+ /* seek to header section 1 */
44324+ if (sys->seek(fh, chm->dir_offset, MSPACK_SYS_SEEK_START)) {
44325+ return MSPACK_ERR_SEEK;
44326+ }
44327+
44328+ /* read header section 1 */
44329+ if (sys->read(fh, &buf[0], chmhs1_SIZEOF) != chmhs1_SIZEOF) {
44330+ return MSPACK_ERR_READ;
44331+ }
44332+
44333+ chm->dir_offset = sys->tell(fh);
44334+ chm->chunk_size = EndGetI32(&buf[chmhs1_ChunkSize]);
44335+ chm->density = EndGetI32(&buf[chmhs1_Density]);
44336+ chm->depth = EndGetI32(&buf[chmhs1_Depth]);
44337+ chm->index_root = EndGetI32(&buf[chmhs1_IndexRoot]);
44338+ chm->num_chunks = EndGetI32(&buf[chmhs1_NumChunks]);
44339+ chm->first_pmgl = EndGetI32(&buf[chmhs1_FirstPMGL]);
44340+ chm->last_pmgl = EndGetI32(&buf[chmhs1_LastPMGL]);
44341+
44342+ if (chm->version < 3) {
44343+ /* versions before 3 don't have chmhst3_OffsetCS0 */
44344+ chm->sec0.offset = chm->dir_offset + (chm->chunk_size * chm->num_chunks);
44345+ }
44346+
44347+ /* check if content offset or file size is wrong */
44348+ if (chm->sec0.offset > chm->length) {
44349+ D(("content section begins after file has ended"))
44350+ return MSPACK_ERR_DATAFORMAT;
44351+ }
44352+
44353+ /* ensure there are chunks and that chunk size is
44354+ * large enough for signature and num_entries */
44355+ if (chm->chunk_size < (pmgl_Entries + 2)) {
44356+ D(("chunk size not large enough"))
44357+ return MSPACK_ERR_DATAFORMAT;
44358+ }
44359+ if (chm->num_chunks == 0) {
44360+ D(("no chunks"))
44361+ return MSPACK_ERR_DATAFORMAT;
44362+ }
44363+
44364+ /* The chunk_cache data structure is not great; large values for num_chunks
44365+ * or num_chunks*chunk_size can exhaust all memory. Until a better chunk
44366+ * cache is implemented, put arbitrary limits on num_chunks and chunk size.
44367+ */
44368+ if (chm->num_chunks > 100000) {
44369+ D(("more than 100,000 chunks"))
44370+ return MSPACK_ERR_DATAFORMAT;
44371+ }
44372+ if ((off_t)chm->chunk_size * (off_t)chm->num_chunks > chm->length) {
44373+ D(("chunks larger than entire file"))
44374+ return MSPACK_ERR_DATAFORMAT;
44375+ }
44376+
44377+ /* common sense checks on header section 1 fields */
44378+ if ((chm->chunk_size & (chm->chunk_size - 1)) != 0) {
44379+ sys->message(fh, "WARNING; chunk size is not a power of two");
44380+ }
44381+ if (chm->first_pmgl != 0) {
44382+ sys->message(fh, "WARNING; first PMGL chunk is not zero");
44383+ }
44384+ if (chm->first_pmgl > chm->last_pmgl) {
44385+ D(("first pmgl chunk is after last pmgl chunk"))
44386+ return MSPACK_ERR_DATAFORMAT;
44387+ }
44388+ if (chm->index_root != 0xFFFFFFFF && chm->index_root > chm->num_chunks) {
44389+ D(("index_root outside valid range"))
44390+ return MSPACK_ERR_DATAFORMAT;
44391+ }
44392+
44393+ /* if we are doing a quick read, stop here! */
44394+ if (!entire) {
44395+ return MSPACK_ERR_OK;
44396+ }
44397+
44398+ /* seek to the first PMGL chunk, and reduce the number of chunks to read */
44399+ if ((x = chm->first_pmgl) != 0) {
44400+ if (sys->seek(fh,(off_t) (x * chm->chunk_size), MSPACK_SYS_SEEK_CUR)) {
44401+ return MSPACK_ERR_SEEK;
44402+ }
44403+ }
44404+ num_chunks = chm->last_pmgl - x + 1;
44405+
44406+ if (!(chunk = (unsigned char *) sys->alloc(sys, (size_t)chm->chunk_size))) {
44407+ return MSPACK_ERR_NOMEMORY;
44408+ }
44409+
44410+ /* read and process all chunks from FirstPMGL to LastPMGL */
44411+ errors = 0;
44412+ while (num_chunks--) {
44413+ /* read next chunk */
44414+ if (sys->read(fh, chunk, (int)chm->chunk_size) != (int)chm->chunk_size) {
44415+ sys->free(chunk);
44416+ return MSPACK_ERR_READ;
44417+ }
44418+
44419+ /* process only directory (PMGL) chunks */
44420+ if (EndGetI32(&chunk[pmgl_Signature]) != 0x4C474D50) continue;
44421+
44422+ if (EndGetI32(&chunk[pmgl_QuickRefSize]) < 2) {
44423+ sys->message(fh, "WARNING; PMGL quickref area is too small");
44424+ }
44425+ if (EndGetI32(&chunk[pmgl_QuickRefSize]) >
44426+ ((int)chm->chunk_size - pmgl_Entries))
44427+ {
44428+ sys->message(fh, "WARNING; PMGL quickref area is too large");
44429+ }
44430+
44431+ p = &chunk[pmgl_Entries];
44432+ end = &chunk[chm->chunk_size - 2];
44433+ num_entries = EndGetI16(end);
44434+
44435+ while (num_entries--) {
44436+ READ_ENCINT(name_len); name = p; p += name_len;
44437+ READ_ENCINT(section);
44438+ READ_ENCINT(offset);
44439+ READ_ENCINT(length);
44440+
44441+ /* empty files and directory names are stored as a file entry at
44442+ * offset 0 with length 0. We want to keep empty files, but not
44443+ * directory names, which end with a "/" */
44444+ if ((offset == 0) && (length == 0)) {
44445+ if ((name_len > 0) && (name[name_len-1] == '/')) continue;
44446+ }
44447+
44448+ if (section > 1) {
44449+ sys->message(fh, "invalid section number '%u'.", section);
44450+ continue;
44451+ }
44452+
44453+ if (!(fi = (struct mschmd_file *) sys->alloc(sys, sizeof(struct mschmd_file) + name_len + 1))) {
44454+ sys->free(chunk);
44455+ return MSPACK_ERR_NOMEMORY;
44456+ }
44457+
44458+ fi->next = NULL;
44459+ fi->filename = (char *) &fi[1];
44460+ fi->section = ((section == 0) ? (struct mschmd_section *) (&chm->sec0)
44461+ : (struct mschmd_section *) (&chm->sec1));
44462+ fi->offset = offset;
44463+ fi->length = length;
44464+ sys->copy(name, fi->filename, (size_t) name_len);
44465+ fi->filename[name_len] = '\0';
44466+
44467+ if (name[0] == ':' && name[1] == ':') {
44468+ /* system file */
44469+ if (mspack_memcmp(&name[2], &content_name[2], 31L) == 0) {
44470+ if (mspack_memcmp(&name[33], &content_name[33], 8L) == 0) {
44471+ chm->sec1.content = fi;
44472+ }
44473+ else if (mspack_memcmp(&name[33], &control_name[33], 11L) == 0) {
44474+ chm->sec1.control = fi;
44475+ }
44476+ else if (mspack_memcmp(&name[33], &spaninfo_name[33], 8L) == 0) {
44477+ chm->sec1.spaninfo = fi;
44478+ }
44479+ else if (mspack_memcmp(&name[33], &rtable_name[33], 72L) == 0) {
44480+ chm->sec1.rtable = fi;
44481+ }
44482+ }
44483+ fi->next = chm->sysfiles;
44484+ chm->sysfiles = fi;
44485+ }
44486+ else {
44487+ /* normal file */
44488+ if (link) link->next = fi; else chm->files = fi;
44489+ link = fi;
44490+ }
44491+ }
44492+
44493+ /* this is reached either when num_entries runs out, or if
44494+ * reading data from the chunk reached a premature end of chunk */
44495+ chunk_end:
44496+ if (num_entries >= 0) {
44497+ D(("chunk ended before all entries could be read"))
44498+ errors++;
44499+ }
44500+
44501+ }
44502+ sys->free(chunk);
44503+ return (errors > 0) ? MSPACK_ERR_DATAFORMAT : MSPACK_ERR_OK;
44504+}
44505+
44506+/***************************************
44507+ * CHMD_FAST_FIND
44508+ ***************************************
44509+ * uses PMGI index chunks and quickref data to quickly locate a file
44510+ * directly from the on-disk index.
44511+ *
44512+ * TODO: protect against infinite loops in chunks (where pgml_NextChunk
44513+ * or a PGMI index entry point to an already visited chunk)
44514+ */
44515+static int chmd_fast_find(struct mschm_decompressor *base,
44516+ struct mschmd_header *chm, const char *filename,
44517+ struct mschmd_file *f_ptr, int f_size)
44518+{
44519+ struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) base;
44520+ struct mspack_system *sys;
44521+ struct mspack_file *fh;
44522+ const unsigned char *chunk, *p, *end;
44523+ int err = MSPACK_ERR_OK, result = -1;
44524+ unsigned int n, sec;
44525+
44526+ if (!self || !chm || !f_ptr || (f_size != sizeof(struct mschmd_file))) {
44527+ return MSPACK_ERR_ARGS;
44528+ }
44529+ sys = self->system;
44530+
44531+ /* clear the results structure */
44532+ memset(f_ptr, 0, f_size);
44533+
44534+ if (!(fh = sys->open(sys, chm->filename, MSPACK_SYS_OPEN_READ))) {
44535+ return MSPACK_ERR_OPEN;
44536+ }
44537+
44538+ /* go through PMGI chunk hierarchy to reach PMGL chunk */
44539+ if (chm->index_root < chm->num_chunks) {
44540+ n = chm->index_root;
44541+ for (;;) {
44542+ if (!(chunk = read_chunk(self, chm, fh, n))) {
44543+ sys->close(fh);
44544+ return self->error;
44545+ }
44546+
44547+ /* search PMGI/PMGL chunk. exit early if no entry found */
44548+ if ((result = search_chunk(chm, chunk, filename, &p, &end)) <= 0) {
44549+ break;
44550+ }
44551+
44552+ /* found result. loop around for next chunk if this is PMGI */
44553+ if (chunk[3] == 0x4C) break; else READ_ENCINT(n);
44554+ }
44555+ }
44556+ else {
44557+ /* PMGL chunks only, search from first_pmgl to last_pmgl */
44558+ for (n = chm->first_pmgl; n <= chm->last_pmgl;
44559+ n = EndGetI32(&chunk[pmgl_NextChunk]))
44560+ {
44561+ if (!(chunk = read_chunk(self, chm, fh, n))) {
44562+ err = self->error;
44563+ break;
44564+ }
44565+
44566+ /* search PMGL chunk. exit if file found */
44567+ if ((result = search_chunk(chm, chunk, filename, &p, &end)) > 0) {
44568+ break;
44569+ }
44570+
44571+ /* stop simple infinite loops: can't visit the same chunk twice */
44572+ if ((int)n == EndGetI32(&chunk[pmgl_NextChunk])) {
44573+ break;
44574+ }
44575+ }
44576+ }
44577+
44578+ /* if we found a file, read it */
44579+ if (result > 0) {
44580+ READ_ENCINT(sec);
44581+ f_ptr->section = (sec == 0) ? (struct mschmd_section *) &chm->sec0
44582+ : (struct mschmd_section *) &chm->sec1;
44583+ READ_ENCINT(f_ptr->offset);
44584+ READ_ENCINT(f_ptr->length);
44585+ }
44586+ else if (result < 0) {
44587+ err = MSPACK_ERR_DATAFORMAT;
44588+ }
44589+
44590+ sys->close(fh);
44591+ return self->error = err;
44592+
44593+ chunk_end:
44594+ D(("read beyond end of chunk entries"))
44595+ sys->close(fh);
44596+ return self->error = MSPACK_ERR_DATAFORMAT;
44597+}
44598+
44599+/* reads the given chunk into memory, storing it in a chunk cache
44600+ * so it doesn't need to be read from disk more than once
44601+ */
44602+static unsigned char *read_chunk(struct mschm_decompressor_p *self,
44603+ struct mschmd_header *chm,
44604+ struct mspack_file *fh,
44605+ unsigned int chunk_num)
44606+{
44607+ struct mspack_system *sys = self->system;
44608+ unsigned char *buf;
44609+
44610+ /* check arguments - most are already checked by chmd_fast_find */
44611+ if (chunk_num > chm->num_chunks) return NULL;
44612+
44613+ /* ensure chunk cache is available */
44614+ if (!chm->chunk_cache) {
44615+ size_t size = sizeof(unsigned char *) * chm->num_chunks;
44616+ if (!(chm->chunk_cache = (unsigned char **) sys->alloc(sys, size))) {
44617+ self->error = MSPACK_ERR_NOMEMORY;
44618+ return NULL;
44619+ }
44620+ memset(chm->chunk_cache, 0, size);
44621+ }
44622+
44623+ /* try to answer out of chunk cache */
44624+ if (chm->chunk_cache[chunk_num]) return chm->chunk_cache[chunk_num];
44625+
44626+ /* need to read chunk - allocate memory for it */
44627+ if (!(buf = (unsigned char *) sys->alloc(sys, chm->chunk_size))) {
44628+ self->error = MSPACK_ERR_NOMEMORY;
44629+ return NULL;
44630+ }
44631+
44632+ /* seek to block and read it */
44633+ if (sys->seek(fh, (off_t) (chm->dir_offset + (chunk_num * chm->chunk_size)),
44634+ MSPACK_SYS_SEEK_START))
44635+ {
44636+ self->error = MSPACK_ERR_SEEK;
44637+ sys->free(buf);
44638+ return NULL;
44639+ }
44640+ if (sys->read(fh, buf, (int)chm->chunk_size) != (int)chm->chunk_size) {
44641+ self->error = MSPACK_ERR_READ;
44642+ sys->free(buf);
44643+ return NULL;
44644+ }
44645+
44646+ /* check the signature. Is is PMGL or PMGI? */
44647+ if (!((buf[0] == 0x50) && (buf[1] == 0x4D) && (buf[2] == 0x47) &&
44648+ ((buf[3] == 0x4C) || (buf[3] == 0x49))))
44649+ {
44650+ self->error = MSPACK_ERR_SEEK;
44651+ sys->free(buf);
44652+ return NULL;
44653+ }
44654+
44655+ /* all OK. Store chunk in cache and return it */
44656+ return chm->chunk_cache[chunk_num] = buf;
44657+}
44658+
44659+/* searches a PMGI/PMGL chunk for a given filename entry. Returns -1 on
44660+ * data format error, 0 if entry definitely not found, 1 if entry
44661+ * found. In the latter case, *result and *result_end are set pointing
44662+ * to that entry's data (either the "next chunk" ENCINT for a PMGI or
44663+ * the section, offset and length ENCINTs for a PMGL).
44664+ *
44665+ * In the case of PMGL chunks, the entry has definitely been
44666+ * found. In the case of PMGI chunks, the entry which points to the
44667+ * chunk that may eventually contain that entry has been found.
44668+ */
44669+static int search_chunk(struct mschmd_header *chm,
44670+ const unsigned char *chunk,
44671+ const char *filename,
44672+ const unsigned char **result,
44673+ const unsigned char **result_end)
44674+{
44675+ const unsigned char *start, *end, *p;
44676+ unsigned int qr_size, num_entries, qr_entries, qr_density, name_len;
44677+ unsigned int L, R, M, sec, fname_len, entries_off, is_pmgl;
44678+ int cmp;
44679+
44680+ fname_len = strlen(filename);
44681+
44682+ /* PMGL chunk or PMGI chunk? (note: read_chunk() has already
44683+ * checked the rest of the characters in the chunk signature) */
44684+ if (chunk[3] == 0x4C) {
44685+ is_pmgl = 1;
44686+ entries_off = pmgl_Entries;
44687+ }
44688+ else {
44689+ is_pmgl = 0;
44690+ entries_off = pmgi_Entries;
44691+ }
44692+
44693+ /* Step 1: binary search first filename of each QR entry
44694+ * - target filename == entry
44695+ * found file
44696+ * - target filename < all entries
44697+ * file not found
44698+ * - target filename > all entries
44699+ * proceed to step 2 using final entry
44700+ * - target filename between two searched entries
44701+ * proceed to step 2
44702+ */
44703+ qr_size = EndGetI32(&chunk[pmgl_QuickRefSize]);
44704+ start = &chunk[chm->chunk_size - 2];
44705+ end = &chunk[chm->chunk_size - qr_size];
44706+ num_entries = EndGetI16(start);
44707+ qr_density = 1 + (1 << chm->density);
44708+ qr_entries = (num_entries + qr_density-1) / qr_density;
44709+
44710+ if (num_entries == 0) {
44711+ D(("chunk has no entries"))
44712+ return -1;
44713+ }
44714+
44715+ if (qr_size > chm->chunk_size) {
44716+ D(("quickref size > chunk size"))
44717+ return -1;
44718+ }
44719+
44720+ *result_end = end;
44721+
44722+ if (((int)qr_entries * 2) > (start - end)) {
44723+ D(("WARNING; more quickrefs than quickref space"))
44724+ qr_entries = 0; /* but we can live with it */
44725+ }
44726+
44727+ if (qr_entries > 0) {
44728+ L = 0;
44729+ R = qr_entries - 1;
44730+ do {
44731+ /* pick new midpoint */
44732+ M = (L + R) >> 1;
44733+
44734+ /* compare filename with entry QR points to */
44735+ p = &chunk[entries_off + (M ? EndGetI16(start - (M << 1)) : 0)];
44736+ READ_ENCINT(name_len);
44737+ if (p + name_len > end) goto chunk_end;
44738+ cmp = compare(filename, (char *)p, fname_len, name_len);
44739+
44740+ if (cmp == 0) break;
44741+ else if (cmp < 0) { if (M) R = M - 1; else return 0; }
44742+ else if (cmp > 0) L = M + 1;
44743+ } while (L <= R);
44744+ M = (L + R) >> 1;
44745+
44746+ if (cmp == 0) {
44747+ /* exact match! */
44748+ p += name_len;
44749+ *result = p;
44750+ return 1;
44751+ }
44752+
44753+ /* otherwise, read the group of entries for QR entry M */
44754+ p = &chunk[entries_off + (M ? EndGetI16(start - (M << 1)) : 0)];
44755+ num_entries -= (M * qr_density);
44756+ if (num_entries > qr_density) num_entries = qr_density;
44757+ }
44758+ else {
44759+ p = &chunk[entries_off];
44760+ }
44761+
44762+ /* Step 2: linear search through the set of entries reached in step 1.
44763+ * - filename == any entry
44764+ * found entry
44765+ * - filename < all entries (PMGI) or any entry (PMGL)
44766+ * entry not found, stop now
44767+ * - filename > all entries
44768+ * entry not found (PMGL) / maybe found (PMGI)
44769+ * -
44770+ */
44771+ *result = NULL;
44772+ while (num_entries-- > 0) {
44773+ READ_ENCINT(name_len);
44774+ if (p + name_len > end) goto chunk_end;
44775+ cmp = compare(filename, (char *)p, fname_len, name_len);
44776+ p += name_len;
44777+
44778+ if (cmp == 0) {
44779+ /* entry found */
44780+ *result = p;
44781+ return 1;
44782+ }
44783+
44784+ if (cmp < 0) {
44785+ /* entry not found (PMGL) / maybe found (PMGI) */
44786+ break;
44787+ }
44788+
44789+ /* read and ignore the rest of this entry */
44790+ if (is_pmgl) {
44791+ READ_ENCINT(R); /* skip section */
44792+ READ_ENCINT(R); /* skip offset */
44793+ READ_ENCINT(R); /* skip length */
44794+ }
44795+ else {
44796+ *result = p; /* store potential final result */
44797+ READ_ENCINT(R); /* skip chunk number */
44798+ }
44799+ }
44800+
44801+ /* PMGL? not found. PMGI? maybe found */
44802+ return (is_pmgl) ? 0 : (*result ? 1 : 0);
44803+
44804+ chunk_end:
44805+ D(("reached end of chunk data while searching"))
44806+ return -1;
44807+}
44808+
44809+#if HAVE_TOWLOWER
44810+# if HAVE_WCTYPE_H
44811+# include <wctype.h>
44812+# endif
44813+# define TOLOWER(x) towlower(x)
44814+#elif HAVE_TOLOWER
44815+# if HAVE_CTYPE_H
44816+# include <ctype.h>
44817+# endif
44818+# define TOLOWER(x) tolower(x)
44819+#else
44820+# define TOLOWER(x) (((x)<0||(x)>256)?(x):mspack_tolower_map[(x)])
44821+/* Map of char -> lowercase char for the first 256 chars. Generated with:
44822+ * LC_CTYPE=en_GB.utf-8 perl -Mlocale -le 'print map{ord(lc chr).","} 0..255'
44823+ */
44824+static const unsigned char mspack_tolower_map[256] = {
44825+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
44826+ 28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,
44827+ 53,54,55,56,57,58,59,60,61,62,63,64,97,98,99,100,101,102,103,104,105,106,
44828+ 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,
44829+ 95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,
44830+ 115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,
44831+ 134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,
44832+ 153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,
44833+ 172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,
44834+ 191,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,
44835+ 242,243,244,245,246,215,248,249,250,251,252,253,254,223,224,225,226,227,228,
44836+ 229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
44837+ 248,249,250,251,252,253,254,255
44838+};
44839+#endif
44840+
44841+/* decodes a UTF-8 character from s[] into c. Will not read past e. */
44842+#define GET_UTF8_CHAR(s, e, c) do { \
44843+ unsigned char x = *s++; \
44844+ if (x < 0x80) c = x; \
44845+ else if (x < 0xC0) c = -1; \
44846+ else if (x < 0xE0) { \
44847+ c = (s >= e) ? -1 : ((x & 0x1F) << 6) | (*s++ & 0x3F); \
44848+ } \
44849+ else if (x < 0xF0) { \
44850+ c = (s+2 > e) ? -1 : ((x & 0x0F) << 12) | ((s[0] & 0x3F) << 6) \
44851+ | (s[1] & 0x3F); \
44852+ s += 2; \
44853+ } \
44854+ else if (x < 0xF8) { \
44855+ c = (s+3 > e) ? -1 : ((x & 0x07) << 18) | ((s[0] & 0x3F) << 12) \
44856+ | ((s[1] & 0x3F) << 6) | (s[2] & 0x3F); \
44857+ s += 3; \
44858+ } \
44859+ else if (x < 0xFC) { \
44860+ c = (s+4 > e) ? -1 : ((x & 0x03) << 24) | ((s[0] & 0x3F) << 18) \
44861+ | ((s[1] & 0x3F) << 12)|((s[2] & 0x3F) << 6)|(s[3] & 0x3F); \
44862+ s += 4; \
44863+ } \
44864+ else if (x < 0xFE) { \
44865+ c = (s+5>e)?-1:((x&1)<<30)|((s[0]&0x3F)<<24)|((s[1]&0x3F)<<18)| \
44866+ ((s[2] & 0x3F) << 12) | ((s[3] & 0x3F) << 6)|(s[4] & 0x3F); \
44867+ s += 5; \
44868+ } \
44869+ else c = -1; \
44870+} while (0)
44871+
44872+/* case-insensitively compares two UTF8 encoded strings. String length for
44873+ * both strings must be provided, null bytes are not terminators */
44874+static inline int compare(const char *s1, const char *s2, int l1, int l2) {
44875+ register const unsigned char *p1 = (const unsigned char *) s1;
44876+ register const unsigned char *p2 = (const unsigned char *) s2;
44877+ register const unsigned char *e1 = p1 + l1, *e2 = p2 + l2;
44878+ int c1, c2;
44879+
44880+ while (p1 < e1 && p2 < e2) {
44881+ GET_UTF8_CHAR(p1, e1, c1);
44882+ GET_UTF8_CHAR(p2, e2, c2);
44883+ if (c1 == c2) continue;
44884+ c1 = TOLOWER(c1);
44885+ c2 = TOLOWER(c2);
44886+ if (c1 != c2) return c1 - c2;
44887+ }
44888+ return l1 - l2;
44889+}
44890+
44891+
44892+/***************************************
44893+ * CHMD_EXTRACT
44894+ ***************************************
44895+ * extracts a file from a CHM helpfile
44896+ */
44897+static int chmd_extract(struct mschm_decompressor *base,
44898+ struct mschmd_file *file, const char *filename)
44899+{
44900+ struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) base;
44901+ struct mspack_system *sys;
44902+ struct mschmd_header *chm;
44903+ struct mspack_file *fh;
44904+ off_t bytes;
44905+
44906+ if (!self) return MSPACK_ERR_ARGS;
44907+ if (!file || !file->section) return self->error = MSPACK_ERR_ARGS;
44908+ sys = self->system;
44909+ chm = file->section->chm;
44910+
44911+ /* create decompression state if it doesn't exist */
44912+ if (!self->d) {
44913+ self->d = (struct mschmd_decompress_state *) sys->alloc(sys, sizeof(struct mschmd_decompress_state));
44914+ if (!self->d) return self->error = MSPACK_ERR_NOMEMORY;
44915+ self->d->chm = chm;
44916+ self->d->offset = 0;
44917+ self->d->state = NULL;
44918+ self->d->sys = *sys;
44919+ self->d->sys.write = &chmd_sys_write;
44920+ self->d->infh = NULL;
44921+ self->d->outfh = NULL;
44922+ }
44923+
44924+ /* open input chm file if not open, or the open one is a different chm */
44925+ if (!self->d->infh || (self->d->chm != chm)) {
44926+ if (self->d->infh) sys->close(self->d->infh);
44927+ if (self->d->state) lzxd_free(self->d->state);
44928+ self->d->chm = chm;
44929+ self->d->offset = 0;
44930+ self->d->state = NULL;
44931+ self->d->infh = sys->open(sys, chm->filename, MSPACK_SYS_OPEN_READ);
44932+ if (!self->d->infh) return self->error = MSPACK_ERR_OPEN;
44933+ }
44934+
44935+ /* open file for output */
44936+ if (!(fh = sys->open(sys, filename, MSPACK_SYS_OPEN_WRITE))) {
44937+ return self->error = MSPACK_ERR_OPEN;
44938+ }
44939+
44940+ /* if file is empty, simply creating it is enough */
44941+ if (!file->length) {
44942+ sys->close(fh);
44943+ return self->error = MSPACK_ERR_OK;
44944+ }
44945+
44946+ self->error = MSPACK_ERR_OK;
44947+
44948+ switch (file->section->id) {
44949+ case 0: /* Uncompressed section file */
44950+ /* simple seek + copy */
44951+ if (sys->seek(self->d->infh, file->section->chm->sec0.offset
44952+ + file->offset, MSPACK_SYS_SEEK_START))
44953+ {
44954+ self->error = MSPACK_ERR_SEEK;
44955+ }
44956+ else {
44957+ unsigned char buf[512];
44958+ off_t length = file->length;
44959+ while (length > 0) {
44960+ int run = sizeof(buf);
44961+ if ((off_t)run > length) run = (int)length;
44962+ if (sys->read(self->d->infh, &buf[0], run) != run) {
44963+ self->error = MSPACK_ERR_READ;
44964+ break;
44965+ }
44966+ if (sys->write(fh, &buf[0], run) != run) {
44967+ self->error = MSPACK_ERR_WRITE;
44968+ break;
44969+ }
44970+ length -= run;
44971+ }
44972+ }
44973+ break;
44974+
44975+ case 1: /* MSCompressed section file */
44976+ /* (re)initialise compression state if we it is not yet initialised,
44977+ * or we have advanced too far and have to backtrack
44978+ */
44979+ if (!self->d->state || (file->offset < self->d->offset)) {
44980+ if (self->d->state) {
44981+ lzxd_free(self->d->state);
44982+ self->d->state = NULL;
44983+ }
44984+ if (chmd_init_decomp(self, file)) break;
44985+ }
44986+
44987+ /* seek to input data */
44988+ if (sys->seek(self->d->infh, self->d->inoffset, MSPACK_SYS_SEEK_START)) {
44989+ self->error = MSPACK_ERR_SEEK;
44990+ break;
44991+ }
44992+
44993+ /* get to correct offset. */
44994+ self->d->outfh = NULL;
44995+ if ((bytes = file->offset - self->d->offset)) {
44996+ self->error = lzxd_decompress(self->d->state, bytes);
44997+ }
44998+
44999+ /* if getting to the correct offset was error free, unpack file */
45000+ if (!self->error) {
45001+ self->d->outfh = fh;
45002+ self->error = lzxd_decompress(self->d->state, file->length);
45003+ }
45004+
45005+ /* save offset in input source stream, in case there is a section 0
45006+ * file between now and the next section 1 file extracted */
45007+ self->d->inoffset = sys->tell(self->d->infh);
45008+
45009+ /* if an LZX error occured, the LZX decompressor is now useless */
45010+ if (self->error) {
45011+ if (self->d->state) lzxd_free(self->d->state);
45012+ self->d->state = NULL;
45013+ }
45014+ break;
45015+ }
45016+
45017+ sys->close(fh);
45018+ return self->error;
45019+}
45020+
45021+/***************************************
45022+ * CHMD_SYS_WRITE
45023+ ***************************************
45024+ * chmd_sys_write is the internal writer function which the decompressor
45025+ * uses. If either writes data to disk (self->d->outfh) with the real
45026+ * sys->write() function, or does nothing with the data when
45027+ * self->d->outfh == NULL. advances self->d->offset.
45028+ */
45029+static int chmd_sys_write(struct mspack_file *file, void *buffer, int bytes) {
45030+ struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) file;
45031+ self->d->offset += bytes;
45032+ if (self->d->outfh) {
45033+ return self->system->write(self->d->outfh, buffer, bytes);
45034+ }
45035+ return bytes;
45036+}
45037+
45038+/***************************************
45039+ * CHMD_INIT_DECOMP
45040+ ***************************************
45041+ * Initialises the LZX decompressor to decompress the compressed stream,
45042+ * from the nearest reset offset and length that is needed for the given
45043+ * file.
45044+ */
45045+static int chmd_init_decomp(struct mschm_decompressor_p *self,
45046+ struct mschmd_file *file)
45047+{
45048+ int window_size, window_bits, reset_interval, entry, err;
45049+ struct mspack_system *sys = self->system;
45050+ struct mschmd_sec_mscompressed *sec;
45051+ unsigned char *data;
45052+ off_t length, offset;
45053+
45054+ sec = (struct mschmd_sec_mscompressed *) file->section;
45055+
45056+ /* ensure we have a mscompressed content section */
45057+ err = find_sys_file(self, sec, &sec->content, content_name);
45058+ if (err) return self->error = err;
45059+
45060+ /* ensure we have a ControlData file */
45061+ err = find_sys_file(self, sec, &sec->control, control_name);
45062+ if (err) return self->error = err;
45063+
45064+ /* read ControlData */
45065+ if (sec->control->length < lzxcd_SIZEOF) {
45066+ D(("ControlData file is too short"))
45067+ return self->error = MSPACK_ERR_DATAFORMAT;
45068+ }
45069+ if (!(data = read_sys_file(self, sec->control))) {
45070+ D(("can't read mscompressed control data file"))
45071+ return self->error;
45072+ }
45073+
45074+ /* check LZXC signature */
45075+ if (EndGetI32(&data[lzxcd_Signature]) != 0x43585A4C) {
45076+ sys->free(data);
45077+ return self->error = MSPACK_ERR_SIGNATURE;
45078+ }
45079+
45080+ /* read reset_interval and window_size and validate version number */
45081+ switch (EndGetI32(&data[lzxcd_Version])) {
45082+ case 1:
45083+ reset_interval = EndGetI32(&data[lzxcd_ResetInterval]);
45084+ window_size = EndGetI32(&data[lzxcd_WindowSize]);
45085+ break;
45086+ case 2:
45087+ reset_interval = EndGetI32(&data[lzxcd_ResetInterval]) * LZX_FRAME_SIZE;
45088+ window_size = EndGetI32(&data[lzxcd_WindowSize]) * LZX_FRAME_SIZE;
45089+ break;
45090+ default:
45091+ D(("bad controldata version"))
45092+ sys->free(data);
45093+ return self->error = MSPACK_ERR_DATAFORMAT;
45094+ }
45095+
45096+ /* free ControlData */
45097+ sys->free(data);
45098+
45099+ /* find window_bits from window_size */
45100+ switch (window_size) {
45101+ case 0x008000: window_bits = 15; break;
45102+ case 0x010000: window_bits = 16; break;
45103+ case 0x020000: window_bits = 17; break;
45104+ case 0x040000: window_bits = 18; break;
45105+ case 0x080000: window_bits = 19; break;
45106+ case 0x100000: window_bits = 20; break;
45107+ case 0x200000: window_bits = 21; break;
45108+ default:
45109+ D(("bad controldata window size"))
45110+ return self->error = MSPACK_ERR_DATAFORMAT;
45111+ }
45112+
45113+ /* validate reset_interval */
45114+ if (reset_interval % LZX_FRAME_SIZE) {
45115+ D(("bad controldata reset interval"))
45116+ return self->error = MSPACK_ERR_DATAFORMAT;
45117+ }
45118+
45119+ /* which reset table entry would we like? */
45120+ entry = file->offset / reset_interval;
45121+ /* convert from reset interval multiple (usually 64k) to 32k frames */
45122+ entry *= reset_interval / LZX_FRAME_SIZE;
45123+
45124+ /* read the reset table entry */
45125+ if (read_reset_table(self, sec, entry, &length, &offset)) {
45126+ /* the uncompressed length given in the reset table is dishonest.
45127+ * the uncompressed data is always padded out from the given
45128+ * uncompressed length up to the next reset interval */
45129+ length += reset_interval - 1;
45130+ length &= -reset_interval;
45131+ }
45132+ else {
45133+ /* if we can't read the reset table entry, just start from
45134+ * the beginning. Use spaninfo to get the uncompressed length */
45135+ entry = 0;
45136+ offset = 0;
45137+ err = read_spaninfo(self, sec, &length);
45138+ }
45139+ if (err) return self->error = err;
45140+
45141+ /* get offset of compressed data stream:
45142+ * = offset of uncompressed section from start of file
45143+ * + offset of compressed stream from start of uncompressed section
45144+ * + offset of chosen reset interval from start of compressed stream */
45145+ self->d->inoffset = file->section->chm->sec0.offset + sec->content->offset + offset;
45146+
45147+ /* set start offset and overall remaining stream length */
45148+ self->d->offset = entry * LZX_FRAME_SIZE;
45149+ length -= self->d->offset;
45150+
45151+ /* initialise LZX stream */
45152+ self->d->state = lzxd_init(&self->d->sys, self->d->infh,
45153+ (struct mspack_file *) self, window_bits,
45154+ reset_interval / LZX_FRAME_SIZE,
45155+ 4096, length, 0);
45156+ if (!self->d->state) self->error = MSPACK_ERR_NOMEMORY;
45157+ return self->error;
45158+}
45159+
45160+/***************************************
45161+ * READ_RESET_TABLE
45162+ ***************************************
45163+ * Reads one entry out of the reset table. Also reads the uncompressed
45164+ * data length. Writes these to offset_ptr and length_ptr respectively.
45165+ * Returns non-zero for success, zero for failure.
45166+ */
45167+static int read_reset_table(struct mschm_decompressor_p *self,
45168+ struct mschmd_sec_mscompressed *sec,
45169+ int entry, off_t *length_ptr, off_t *offset_ptr)
45170+{
45171+ struct mspack_system *sys = self->system;
45172+ unsigned char *data;
45173+ unsigned int pos, entrysize;
45174+
45175+ /* do we have a ResetTable file? */
45176+ int err = find_sys_file(self, sec, &sec->rtable, rtable_name);
45177+ if (err) return 0;
45178+
45179+ /* read ResetTable file */
45180+ if (sec->rtable->length < lzxrt_headerSIZEOF) {
45181+ D(("ResetTable file is too short"))
45182+ return 0;
45183+ }
45184+ if (!(data = read_sys_file(self, sec->rtable))) {
45185+ D(("can't read reset table"))
45186+ return 0;
45187+ }
45188+
45189+ /* check sanity of reset table */
45190+ if (EndGetI32(&data[lzxrt_FrameLen]) != LZX_FRAME_SIZE) {
45191+ D(("bad reset table frame length"))
45192+ sys->free(data);
45193+ return 0;
45194+ }
45195+
45196+ /* get the uncompressed length of the LZX stream */
45197+ if (read_off64(length_ptr, &data[lzxrt_UncompLen], sys, self->d->infh)) {
45198+ sys->free(data);
45199+ return 0;
45200+ }
45201+
45202+ entrysize = EndGetI32(&data[lzxrt_EntrySize]);
45203+ pos = EndGetI32(&data[lzxrt_TableOffset]) + (entry * entrysize);
45204+
45205+ /* ensure reset table entry for this offset exists */
45206+ if (entry < EndGetI32(&data[lzxrt_NumEntries]) &&
45207+ pos <= (sec->rtable->length - entrysize))
45208+ {
45209+ switch (entrysize) {
45210+ case 4:
45211+ *offset_ptr = EndGetI32(&data[pos]);
45212+ err = 0;
45213+ break;
45214+ case 8:
45215+ err = read_off64(offset_ptr, &data[pos], sys, self->d->infh);
45216+ break;
45217+ default:
45218+ D(("reset table entry size neither 4 nor 8"))
45219+ err = 1;
45220+ break;
45221+ }
45222+ }
45223+ else {
45224+ D(("bad reset interval"))
45225+ err = 1;
45226+ }
45227+
45228+ /* free the reset table */
45229+ sys->free(data);
45230+
45231+ /* return success */
45232+ return (err == 0);
45233+}
45234+
45235+/***************************************
45236+ * READ_SPANINFO
45237+ ***************************************
45238+ * Reads the uncompressed data length from the spaninfo file.
45239+ * Returns zero for success or a non-zero error code for failure.
45240+ */
45241+static int read_spaninfo(struct mschm_decompressor_p *self,
45242+ struct mschmd_sec_mscompressed *sec,
45243+ off_t *length_ptr)
45244+{
45245+ struct mspack_system *sys = self->system;
45246+ unsigned char *data;
45247+
45248+ /* find SpanInfo file */
45249+ int err = find_sys_file(self, sec, &sec->spaninfo, spaninfo_name);
45250+ if (err) return MSPACK_ERR_DATAFORMAT;
45251+
45252+ /* check it's large enough */
45253+ if (sec->spaninfo->length != 8) {
45254+ D(("SpanInfo file is wrong size"))
45255+ return MSPACK_ERR_DATAFORMAT;
45256+ }
45257+
45258+ /* read the SpanInfo file */
45259+ if (!(data = read_sys_file(self, sec->spaninfo))) {
45260+ D(("can't read SpanInfo file"))
45261+ return self->error;
45262+ }
45263+
45264+ /* get the uncompressed length of the LZX stream */
45265+ err = read_off64(length_ptr, data, sys, self->d->infh);
45266+
45267+ sys->free(data);
45268+ return (err) ? MSPACK_ERR_DATAFORMAT : MSPACK_ERR_OK;
45269+}
45270+
45271+/***************************************
45272+ * FIND_SYS_FILE
45273+ ***************************************
45274+ * Uses chmd_fast_find to locate a system file, and fills out that system
45275+ * file's entry and links it into the list of system files. Returns zero
45276+ * for success, non-zero for both failure and the file not existing.
45277+ */
45278+static int find_sys_file(struct mschm_decompressor_p *self,
45279+ struct mschmd_sec_mscompressed *sec,
45280+ struct mschmd_file **f_ptr, const char *name)
45281+{
45282+ struct mspack_system *sys = self->system;
45283+ struct mschmd_file result;
45284+
45285+ /* already loaded */
45286+ if (*f_ptr) return MSPACK_ERR_OK;
45287+
45288+ /* try using fast_find to find the file - return DATAFORMAT error if
45289+ * it fails, or successfully doesn't find the file */
45290+ if (chmd_fast_find((struct mschm_decompressor *) self, sec->base.chm,
45291+ name, &result, (int)sizeof(result)) || !result.section)
45292+ {
45293+ return MSPACK_ERR_DATAFORMAT;
45294+ }
45295+
45296+ if (!(*f_ptr = (struct mschmd_file *) sys->alloc(sys, sizeof(result)))) {
45297+ return MSPACK_ERR_NOMEMORY;
45298+ }
45299+
45300+ /* copy result */
45301+ *(*f_ptr) = result;
45302+ (*f_ptr)->filename = (char *) name;
45303+
45304+ /* link file into sysfiles list */
45305+ (*f_ptr)->next = sec->base.chm->sysfiles;
45306+ sec->base.chm->sysfiles = *f_ptr;
45307+ return MSPACK_ERR_OK;
45308+}
45309+
45310+/***************************************
45311+ * READ_SYS_FILE
45312+ ***************************************
45313+ * Allocates memory for a section 0 (uncompressed) file and reads it into
45314+ * memory.
45315+ */
45316+static unsigned char *read_sys_file(struct mschm_decompressor_p *self,
45317+ struct mschmd_file *file)
45318+{
45319+ struct mspack_system *sys = self->system;
45320+ unsigned char *data = NULL;
45321+ int len;
45322+
45323+ if (!file || !file->section || (file->section->id != 0)) {
45324+ self->error = MSPACK_ERR_DATAFORMAT;
45325+ return NULL;
45326+ }
45327+
45328+ len = (int) file->length;
45329+
45330+ if (!(data = (unsigned char *) sys->alloc(sys, (size_t) len))) {
45331+ self->error = MSPACK_ERR_NOMEMORY;
45332+ return NULL;
45333+ }
45334+ if (sys->seek(self->d->infh, file->section->chm->sec0.offset
45335+ + file->offset, MSPACK_SYS_SEEK_START))
45336+ {
45337+ self->error = MSPACK_ERR_SEEK;
45338+ sys->free(data);
45339+ return NULL;
45340+ }
45341+ if (sys->read(self->d->infh, data, len) != len) {
45342+ self->error = MSPACK_ERR_READ;
45343+ sys->free(data);
45344+ return NULL;
45345+ }
45346+ return data;
45347+}
45348+
45349+/***************************************
45350+ * CHMD_ERROR
45351+ ***************************************
45352+ * returns the last error that occurred
45353+ */
45354+static int chmd_error(struct mschm_decompressor *base) {
45355+ struct mschm_decompressor_p *self = (struct mschm_decompressor_p *) base;
45356+ return (self) ? self->error : MSPACK_ERR_ARGS;
45357+}
45358+
45359+/***************************************
45360+ * READ_OFF64
45361+ ***************************************
45362+ * Reads a 64-bit signed integer from memory in Intel byte order.
45363+ * If running on a system with a 64-bit off_t, this is simply done.
45364+ * If running on a system with a 32-bit off_t, offsets up to 0x7FFFFFFF
45365+ * are accepted, offsets beyond that cause an error message.
45366+ */
45367+static int read_off64(off_t *var, unsigned char *mem,
45368+ struct mspack_system *sys, struct mspack_file *fh)
45369+{
45370+#ifdef LARGEFILE_SUPPORT
45371+ *var = EndGetI64(mem);
45372+#else
45373+ *var = EndGetI32(mem);
45374+ if ((*var & 0x80000000) || EndGetI32(mem+4)) {
45375+ sys->message(fh, (char *)largefile_msg);
45376+ return 1;
45377+ }
45378+#endif
45379+ return 0;
45380+}
45381diff --git a/libclamav/libmspack-0.4alpha/mspack/crc32.c b/libclamav/libmspack-0.4alpha/mspack/crc32.c
45382new file mode 100644
45383index 000000000000..4bb0ef49ba29
45384--- /dev/null
45385+++ b/libclamav/libmspack-0.4alpha/mspack/crc32.c
45386@@ -0,0 +1,95 @@
45387+/*
45388+ * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or
45389+ * code or tables extracted from it, as desired without restriction.
45390+ *
45391+ * First, the polynomial itself and its table of feedback terms. The
45392+ * polynomial is
45393+ * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
45394+ *
45395+ * Note that we take it "backwards" and put the highest-order term in
45396+ * the lowest-order bit. The X^32 term is "implied"; the LSB is the
45397+ * X^31 term, etc. The X^0 term (usually shown as "+1") results in
45398+ * the MSB being 1
45399+ *
45400+ * Note that the usual hardware shift register implementation, which
45401+ * is what we're using (we're merely optimizing it by doing eight-bit
45402+ * chunks at a time) shifts bits into the lowest-order term. In our
45403+ * implementation, that means shifting towards the right. Why do we
45404+ * do it this way? Because the calculated CRC must be transmitted in
45405+ * order from highest-order term to lowest-order term. UARTs transmit
45406+ * characters in order from LSB to MSB. By storing the CRC this way
45407+ * we hand it to the UART in the order low-byte to high-byte; the UART
45408+ * sends each low-bit to hight-bit; and the result is transmission bit
45409+ * by bit from highest- to lowest-order term without requiring any bit
45410+ * shuffling on our part. Reception works similarly
45411+ *
45412+ * The feedback terms table consists of 256, 32-bit entries. Notes
45413+ *
45414+ * The table can be generated at runtime if desired; code to do so
45415+ * is shown later. It might not be obvious, but the feedback
45416+ * terms simply represent the results of eight shift/xor opera
45417+ * tions for all combinations of data and CRC register values
45418+ *
45419+ * The values must be right-shifted by eight bits by the "updcrc
45420+ * logic; the shift must be unsigned (bring in zeroes). On some
45421+ * hardware you could probably optimize the shift in assembler by
45422+ * using byte-swap instructions
45423+ * polynomial $edb88320
45424+ */
45425+
45426+#include "crc32.h"
45427+
45428+const unsigned int crc32_table[256] = {
45429+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
45430+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
45431+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
45432+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
45433+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
45434+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
45435+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
45436+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
45437+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
45438+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
45439+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
45440+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
45441+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
45442+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
45443+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
45444+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
45445+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
45446+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
45447+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
45448+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
45449+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
45450+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
45451+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
45452+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
45453+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
45454+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
45455+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
45456+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
45457+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
45458+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
45459+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
45460+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
45461+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
45462+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
45463+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
45464+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
45465+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
45466+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
45467+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
45468+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
45469+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
45470+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
45471+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
45472+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
45473+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
45474+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
45475+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
45476+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
45477+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
45478+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
45479+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
45480+ 0x2d02ef8dL
45481+};
45482diff --git a/libclamav/libmspack-0.4alpha/mspack/crc32.h b/libclamav/libmspack-0.4alpha/mspack/crc32.h
45483new file mode 100644
45484index 000000000000..8415f2eef602
45485--- /dev/null
45486+++ b/libclamav/libmspack-0.4alpha/mspack/crc32.h
45487@@ -0,0 +1,17 @@
45488+#ifndef CRC32_H
45489+#define CRC32_H
45490+
45491+extern const unsigned int crc32_table[256];
45492+
45493+/* Return a 32-bit CRC of the contents of the buffer. */
45494+
45495+static inline unsigned int
45496+crc32(unsigned int val, const void *ss, int len)
45497+{
45498+ const unsigned char *s = ss;
45499+ while (--len >= 0)
45500+ val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
45501+ return val;
45502+}
45503+
45504+#endif
45505diff --git a/libclamav/libmspack-0.4alpha/mspack/des.h b/libclamav/libmspack-0.4alpha/mspack/des.h
45506new file mode 100644
45507index 000000000000..64a1ed27e4d4
45508--- /dev/null
45509+++ b/libclamav/libmspack-0.4alpha/mspack/des.h
45510@@ -0,0 +1,15 @@
45511+/* This file is part of libmspack.
45512+ * (C) 2003-2004 Stuart Caie.
45513+ *
45514+ * libmspack is free software; you can redistribute it and/or modify it under
45515+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
45516+ *
45517+ * For further details, see the file COPYING.LIB distributed with libmspack
45518+ */
45519+
45520+#ifndef MSPACK_DES_H
45521+#define MSPACK_DES_H 1
45522+
45523+/* DES encryption / decryption definitions */
45524+
45525+#endif
45526diff --git a/libclamav/libmspack-0.4alpha/mspack/hlp.h b/libclamav/libmspack-0.4alpha/mspack/hlp.h
45527new file mode 100644
45528index 000000000000..b7486fa16068
45529--- /dev/null
45530+++ b/libclamav/libmspack-0.4alpha/mspack/hlp.h
45531@@ -0,0 +1,33 @@
45532+/* This file is part of libmspack.
45533+ * (C) 2003-2004 Stuart Caie.
45534+ *
45535+ * libmspack is free software; you can redistribute it and/or modify it under
45536+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
45537+ *
45538+ * For further details, see the file COPYING.LIB distributed with libmspack
45539+ */
45540+
45541+#ifndef MSPACK_HLP_H
45542+#define MSPACK_HLP_H 1
45543+
45544+#include <lzss.h>
45545+
45546+/* generic HLP definitions */
45547+
45548+/* HLP compression definitions */
45549+
45550+struct mshlp_compressor_p {
45551+ struct mshlp_compressor base;
45552+ struct mspack_system *system;
45553+ /* todo */
45554+};
45555+
45556+/* HLP decompression definitions */
45557+
45558+struct mshlp_decompressor_p {
45559+ struct mshlp_decompressor base;
45560+ struct mspack_system *system;
45561+ /* todo */
45562+};
45563+
45564+#endif
45565diff --git a/libclamav/libmspack-0.4alpha/mspack/hlpc.c b/libclamav/libmspack-0.4alpha/mspack/hlpc.c
45566new file mode 100644
45567index 000000000000..60eabfe207d8
45568--- /dev/null
45569+++ b/libclamav/libmspack-0.4alpha/mspack/hlpc.c
45570@@ -0,0 +1,24 @@
45571+/* This file is part of libmspack.
45572+ * (C) 2003-2004 Stuart Caie.
45573+ *
45574+ * libmspack is free software; you can redistribute it and/or modify it under
45575+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
45576+ *
45577+ * For further details, see the file COPYING.LIB distributed with libmspack
45578+ */
45579+
45580+/* HLP compression implementation */
45581+
45582+#include <system.h>
45583+#include <hlp.h>
45584+
45585+struct mshlp_compressor *
45586+ mspack_create_hlp_compressor(struct mspack_system *sys)
45587+{
45588+ /* todo */
45589+ return NULL;
45590+}
45591+
45592+void mspack_destroy_hlp_compressor(struct mshlp_compressor *self) {
45593+ /* todo */
45594+}
45595diff --git a/libclamav/libmspack-0.4alpha/mspack/hlpd.c b/libclamav/libmspack-0.4alpha/mspack/hlpd.c
45596new file mode 100644
45597index 000000000000..43354f008f4f
45598--- /dev/null
45599+++ b/libclamav/libmspack-0.4alpha/mspack/hlpd.c
45600@@ -0,0 +1,24 @@
45601+/* This file is part of libmspack.
45602+ * (C) 2003-2004 Stuart Caie.
45603+ *
45604+ * libmspack is free software; you can redistribute it and/or modify it under
45605+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
45606+ *
45607+ * For further details, see the file COPYING.LIB distributed with libmspack
45608+ */
45609+
45610+/* HLP decompression implementation */
45611+
45612+#include <system.h>
45613+#include <hlp.h>
45614+
45615+struct mshlp_decompressor *
45616+ mspack_create_hlp_decompressor(struct mspack_system *sys)
45617+{
45618+ /* todo */
45619+ return NULL;
45620+}
45621+
45622+void mspack_destroy_hlp_decompressor(struct mshlp_decompressor *self) {
45623+ /* todo */
45624+}
45625diff --git a/libclamav/libmspack-0.4alpha/mspack/kwaj.h b/libclamav/libmspack-0.4alpha/mspack/kwaj.h
45626new file mode 100644
45627index 000000000000..09673c07793e
45628--- /dev/null
45629+++ b/libclamav/libmspack-0.4alpha/mspack/kwaj.h
45630@@ -0,0 +1,118 @@
45631+/* This file is part of libmspack.
45632+ * (C) 2003-2010 Stuart Caie.
45633+ *
45634+ * libmspack is free software; you can redistribute it and/or modify it under
45635+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
45636+ *
45637+ * For further details, see the file COPYING.LIB distributed with libmspack
45638+ */
45639+
45640+#ifndef MSPACK_KWAJ_H
45641+#define MSPACK_KWAJ_H 1
45642+
45643+#include <lzss.h>
45644+
45645+/* generic KWAJ definitions */
45646+#define kwajh_Signature1 (0x00)
45647+#define kwajh_Signature2 (0x04)
45648+#define kwajh_CompMethod (0x08)
45649+#define kwajh_DataOffset (0x0a)
45650+#define kwajh_Flags (0x0c)
45651+#define kwajh_SIZEOF (0x0e)
45652+
45653+/* KWAJ compression definitions */
45654+
45655+struct mskwaj_compressor_p {
45656+ struct mskwaj_compressor base;
45657+ struct mspack_system *system;
45658+ /* todo */
45659+ int param[2]; /* !!! MATCH THIS TO NUM OF PARAMS IN MSPACK.H !!! */
45660+ int error;
45661+};
45662+
45663+/* KWAJ decompression definitions */
45664+
45665+struct mskwaj_decompressor_p {
45666+ struct mskwaj_decompressor base;
45667+ struct mspack_system *system;
45668+ int error;
45669+};
45670+
45671+struct mskwajd_header_p {
45672+ struct mskwajd_header base;
45673+ struct mspack_file *fh;
45674+};
45675+
45676+/* input buffer size during decompression - not worth parameterising IMHO */
45677+#define KWAJ_INPUT_SIZE (2048)
45678+
45679+/* huffman codes that are 9 bits or less are decoded immediately */
45680+#define KWAJ_TABLEBITS (9)
45681+
45682+/* number of codes in each huffman table */
45683+#define KWAJ_MATCHLEN1_SYMS (16)
45684+#define KWAJ_MATCHLEN2_SYMS (16)
45685+#define KWAJ_LITLEN_SYMS (32)
45686+#define KWAJ_OFFSET_SYMS (64)
45687+#define KWAJ_LITERAL_SYMS (256)
45688+
45689+/* define decoding table sizes */
45690+#define KWAJ_TABLESIZE (1 << KWAJ_TABLEBITS)
45691+#if KWAJ_TABLESIZE < (KWAJ_MATCHLEN1_SYMS * 2)
45692+# define KWAJ_MATCHLEN1_TBLSIZE (KWAJ_MATCHLEN1_SYMS * 4)
45693+#else
45694+# define KWAJ_MATCHLEN1_TBLSIZE (KWAJ_TABLESIZE + (KWAJ_MATCHLEN1_SYMS * 2))
45695+#endif
45696+#if KWAJ_TABLESIZE < (KWAJ_MATCHLEN2_SYMS * 2)
45697+# define KWAJ_MATCHLEN2_TBLSIZE (KWAJ_MATCHLEN2_SYMS * 4)
45698+#else
45699+# define KWAJ_MATCHLEN2_TBLSIZE (KWAJ_TABLESIZE + (KWAJ_MATCHLEN2_SYMS * 2))
45700+#endif
45701+#if KWAJ_TABLESIZE < (KWAJ_LITLEN_SYMS * 2)
45702+# define KWAJ_LITLEN_TBLSIZE (KWAJ_LITLEN_SYMS * 4)
45703+#else
45704+# define KWAJ_LITLEN_TBLSIZE (KWAJ_TABLESIZE + (KWAJ_LITLEN_SYMS * 2))
45705+#endif
45706+#if KWAJ_TABLESIZE < (KWAJ_OFFSET_SYMS * 2)
45707+# define KWAJ_OFFSET_TBLSIZE (KWAJ_OFFSET_SYMS * 4)
45708+#else
45709+# define KWAJ_OFFSET_TBLSIZE (KWAJ_TABLESIZE + (KWAJ_OFFSET_SYMS * 2))
45710+#endif
45711+#if KWAJ_TABLESIZE < (KWAJ_LITERAL_SYMS * 2)
45712+# define KWAJ_LITERAL_TBLSIZE (KWAJ_LITERAL_SYMS * 4)
45713+#else
45714+# define KWAJ_LITERAL_TBLSIZE (KWAJ_TABLESIZE + (KWAJ_LITERAL_SYMS * 2))
45715+#endif
45716+
45717+struct kwajd_stream {
45718+ /* I/O buffering */
45719+ struct mspack_system *sys;
45720+ struct mspack_file *input;
45721+ struct mspack_file *output;
45722+ unsigned char *i_ptr, *i_end;
45723+ unsigned int bit_buffer, bits_left;
45724+ int input_end;
45725+
45726+ /* huffman code lengths */
45727+ unsigned char MATCHLEN1_len [KWAJ_MATCHLEN1_SYMS];
45728+ unsigned char MATCHLEN2_len [KWAJ_MATCHLEN2_SYMS];
45729+ unsigned char LITLEN_len [KWAJ_LITLEN_SYMS];
45730+ unsigned char OFFSET_len [KWAJ_OFFSET_SYMS];
45731+ unsigned char LITERAL_len [KWAJ_LITERAL_SYMS];
45732+
45733+ /* huffman decoding tables */
45734+ unsigned short MATCHLEN1_table [KWAJ_MATCHLEN1_TBLSIZE];
45735+ unsigned short MATCHLEN2_table [KWAJ_MATCHLEN2_TBLSIZE];
45736+ unsigned short LITLEN_table [KWAJ_LITLEN_TBLSIZE];
45737+ unsigned short OFFSET_table [KWAJ_OFFSET_TBLSIZE];
45738+ unsigned short LITERAL_table [KWAJ_LITERAL_TBLSIZE];
45739+
45740+ /* input buffer */
45741+ unsigned char inbuf[KWAJ_INPUT_SIZE];
45742+
45743+ /* history window */
45744+ unsigned char window[LZSS_WINDOW_SIZE];
45745+};
45746+
45747+
45748+#endif
45749diff --git a/libclamav/libmspack-0.4alpha/mspack/kwajc.c b/libclamav/libmspack-0.4alpha/mspack/kwajc.c
45750new file mode 100644
45751index 000000000000..b88ed7690a8a
45752--- /dev/null
45753+++ b/libclamav/libmspack-0.4alpha/mspack/kwajc.c
45754@@ -0,0 +1,24 @@
45755+/* This file is part of libmspack.
45756+ * (C) 2003-2004 Stuart Caie.
45757+ *
45758+ * libmspack is free software; you can redistribute it and/or modify it under
45759+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
45760+ *
45761+ * For further details, see the file COPYING.LIB distributed with libmspack
45762+ */
45763+
45764+/* KWAJ compression implementation */
45765+
45766+#include <system.h>
45767+#include <kwaj.h>
45768+
45769+struct mskwaj_compressor *
45770+ mspack_create_kwaj_compressor(struct mspack_system *sys)
45771+{
45772+ /* todo */
45773+ return NULL;
45774+}
45775+
45776+void mspack_destroy_kwaj_compressor(struct mskwaj_compressor *self) {
45777+ /* todo */
45778+}
45779diff --git a/libclamav/libmspack-0.4alpha/mspack/kwajd.c b/libclamav/libmspack-0.4alpha/mspack/kwajd.c
45780new file mode 100644
45781index 000000000000..bd4ee87739a0
45782--- /dev/null
45783+++ b/libclamav/libmspack-0.4alpha/mspack/kwajd.c
45784@@ -0,0 +1,561 @@
45785+/* This file is part of libmspack.
45786+ * (C) 2003-2011 Stuart Caie.
45787+ *
45788+ * KWAJ is a format very similar to SZDD. KWAJ method 3 (LZH) was
45789+ * written by Jeff Johnson.
45790+ *
45791+ * libmspack is free software; you can redistribute it and/or modify it under
45792+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
45793+ *
45794+ * For further details, see the file COPYING.LIB distributed with libmspack
45795+ */
45796+
45797+/* KWAJ decompression implementation */
45798+
45799+#include <system.h>
45800+#include <kwaj.h>
45801+#include <mszip.h>
45802+
45803+/* prototypes */
45804+static struct mskwajd_header *kwajd_open(
45805+ struct mskwaj_decompressor *base, const char *filename);
45806+static void kwajd_close(
45807+ struct mskwaj_decompressor *base, struct mskwajd_header *hdr);
45808+static int kwajd_read_headers(
45809+ struct mspack_system *sys, struct mspack_file *fh,
45810+ struct mskwajd_header *hdr);
45811+static int kwajd_extract(
45812+ struct mskwaj_decompressor *base, struct mskwajd_header *hdr,
45813+ const char *filename);
45814+static int kwajd_decompress(
45815+ struct mskwaj_decompressor *base, const char *input, const char *output);
45816+static int kwajd_error(
45817+ struct mskwaj_decompressor *base);
45818+
45819+static struct kwajd_stream *lzh_init(
45820+ struct mspack_system *sys, struct mspack_file *in, struct mspack_file *out);
45821+static int lzh_decompress(
45822+ struct kwajd_stream *kwaj);
45823+static void lzh_free(
45824+ struct kwajd_stream *kwaj);
45825+static int lzh_read_lens(
45826+ struct kwajd_stream *kwaj,
45827+ unsigned int type, unsigned int numsyms,
45828+ unsigned char *lens, unsigned short *table);
45829+static int lzh_read_input(
45830+ struct kwajd_stream *kwaj);
45831+
45832+
45833+/***************************************
45834+ * MSPACK_CREATE_KWAJ_DECOMPRESSOR
45835+ ***************************************
45836+ * constructor
45837+ */
45838+struct mskwaj_decompressor *
45839+ mspack_create_kwaj_decompressor(struct mspack_system *sys)
45840+{
45841+ struct mskwaj_decompressor_p *self = NULL;
45842+
45843+ if (!sys) sys = mspack_default_system;
45844+ if (!mspack_valid_system(sys)) return NULL;
45845+
45846+ if ((self = (struct mskwaj_decompressor_p *) sys->alloc(sys, sizeof(struct mskwaj_decompressor_p)))) {
45847+ self->base.open = &kwajd_open;
45848+ self->base.close = &kwajd_close;
45849+ self->base.extract = &kwajd_extract;
45850+ self->base.decompress = &kwajd_decompress;
45851+ self->base.last_error = &kwajd_error;
45852+ self->system = sys;
45853+ self->error = MSPACK_ERR_OK;
45854+ }
45855+ return (struct mskwaj_decompressor *) self;
45856+}
45857+
45858+/***************************************
45859+ * MSPACK_DESTROY_KWAJ_DECOMPRESSOR
45860+ ***************************************
45861+ * destructor
45862+ */
45863+void mspack_destroy_kwaj_decompressor(struct mskwaj_decompressor *base)
45864+{
45865+ struct mskwaj_decompressor_p *self = (struct mskwaj_decompressor_p *) base;
45866+ if (self) {
45867+ struct mspack_system *sys = self->system;
45868+ sys->free(self);
45869+ }
45870+}
45871+
45872+/***************************************
45873+ * KWAJD_OPEN
45874+ ***************************************
45875+ * opens a KWAJ file without decompressing, reads header
45876+ */
45877+static struct mskwajd_header *kwajd_open(struct mskwaj_decompressor *base,
45878+ const char *filename)
45879+{
45880+ struct mskwaj_decompressor_p *self = (struct mskwaj_decompressor_p *) base;
45881+ struct mskwajd_header *hdr;
45882+ struct mspack_system *sys;
45883+ struct mspack_file *fh;
45884+
45885+ if (!self) return NULL;
45886+ sys = self->system;
45887+
45888+ fh = sys->open(sys, filename, MSPACK_SYS_OPEN_READ);
45889+ hdr = (struct mskwajd_header *) sys->alloc(sys, sizeof(struct mskwajd_header_p));
45890+ if (fh && hdr) {
45891+ ((struct mskwajd_header_p *) hdr)->fh = fh;
45892+ self->error = kwajd_read_headers(sys, fh, hdr);
45893+ }
45894+ else {
45895+ if (!fh) self->error = MSPACK_ERR_OPEN;
45896+ if (!hdr) self->error = MSPACK_ERR_NOMEMORY;
45897+ }
45898+
45899+ if (self->error) {
45900+ if (fh) sys->close(fh);
45901+ if (hdr) sys->free(hdr);
45902+ hdr = NULL;
45903+ }
45904+
45905+ return hdr;
45906+}
45907+
45908+/***************************************
45909+ * KWAJD_CLOSE
45910+ ***************************************
45911+ * closes a KWAJ file
45912+ */
45913+static void kwajd_close(struct mskwaj_decompressor *base,
45914+ struct mskwajd_header *hdr)
45915+{
45916+ struct mskwaj_decompressor_p *self = (struct mskwaj_decompressor_p *) base;
45917+ struct mskwajd_header_p *hdr_p = (struct mskwajd_header_p *) hdr;
45918+
45919+ if (!self || !self->system) return;
45920+
45921+ /* close the file handle associated */
45922+ self->system->close(hdr_p->fh);
45923+
45924+ /* free the memory associated */
45925+ self->system->free(hdr);
45926+
45927+ self->error = MSPACK_ERR_OK;
45928+}
45929+
45930+/***************************************
45931+ * KWAJD_READ_HEADERS
45932+ ***************************************
45933+ * reads the headers of a KWAJ format file
45934+ */
45935+static int kwajd_read_headers(struct mspack_system *sys,
45936+ struct mspack_file *fh,
45937+ struct mskwajd_header *hdr)
45938+{
45939+ unsigned char buf[16];
45940+ int i;
45941+
45942+ /* read in the header */
45943+ if (sys->read(fh, &buf[0], kwajh_SIZEOF) != kwajh_SIZEOF) {
45944+ return MSPACK_ERR_READ;
45945+ }
45946+
45947+ /* check for "KWAJ" signature */
45948+ if (((unsigned int) EndGetI32(&buf[kwajh_Signature1]) != 0x4A41574B) ||
45949+ ((unsigned int) EndGetI32(&buf[kwajh_Signature2]) != 0xD127F088))
45950+ {
45951+ return MSPACK_ERR_SIGNATURE;
45952+ }
45953+
45954+ /* basic header fields */
45955+ hdr->comp_type = EndGetI16(&buf[kwajh_CompMethod]);
45956+ hdr->data_offset = EndGetI16(&buf[kwajh_DataOffset]);
45957+ hdr->headers = EndGetI16(&buf[kwajh_Flags]);
45958+ hdr->length = 0;
45959+ hdr->filename = NULL;
45960+ hdr->extra = NULL;
45961+ hdr->extra_length = 0;
45962+
45963+ /* optional headers */
45964+
45965+ /* 4 bytes: length of unpacked file */
45966+ if (hdr->headers & MSKWAJ_HDR_HASLENGTH) {
45967+ if (sys->read(fh, &buf[0], 4) != 4) return MSPACK_ERR_READ;
45968+ hdr->length = EndGetI32(&buf[0]);
45969+ }
45970+
45971+ /* 2 bytes: unknown purpose */
45972+ if (hdr->headers & MSKWAJ_HDR_HASUNKNOWN1) {
45973+ if (sys->read(fh, &buf[0], 2) != 2) return MSPACK_ERR_READ;
45974+ }
45975+
45976+ /* 2 bytes: length of section, then [length] bytes: unknown purpose */
45977+ if (hdr->headers & MSKWAJ_HDR_HASUNKNOWN2) {
45978+ if (sys->read(fh, &buf[0], 2) != 2) return MSPACK_ERR_READ;
45979+ i = EndGetI16(&buf[0]);
45980+ if (sys->seek(fh, (off_t)i, MSPACK_SYS_SEEK_CUR)) return MSPACK_ERR_SEEK;
45981+ }
45982+
45983+ /* filename and extension */
45984+ if (hdr->headers & (MSKWAJ_HDR_HASFILENAME | MSKWAJ_HDR_HASFILEEXT)) {
45985+ off_t pos = sys->tell(fh);
45986+ char *fn = (char *) sys->alloc(sys, (size_t) 13);
45987+
45988+ /* allocate memory for maximum length filename */
45989+ if (! fn) return MSPACK_ERR_NOMEMORY;
45990+ hdr->filename = fn;
45991+
45992+ /* copy filename if present */
45993+ if (hdr->headers & MSKWAJ_HDR_HASFILENAME) {
45994+ if (sys->read(fh, &buf[0], 9) != 9) return MSPACK_ERR_READ;
45995+ for (i = 0; i < 9; i++, fn++) if (!(*fn = buf[i])) break;
45996+ pos += (i < 9) ? i+1 : 9;
45997+ if (sys->seek(fh, pos, MSPACK_SYS_SEEK_START))
45998+ return MSPACK_ERR_SEEK;
45999+ }
46000+
46001+ /* copy extension if present */
46002+ if (hdr->headers & MSKWAJ_HDR_HASFILEEXT) {
46003+ *fn++ = '.';
46004+ if (sys->read(fh, &buf[0], 4) != 4) return MSPACK_ERR_READ;
46005+ for (i = 0; i < 4; i++, fn++) if (!(*fn = buf[i])) break;
46006+ pos += (i < 4) ? i+1 : 4;
46007+ if (sys->seek(fh, pos, MSPACK_SYS_SEEK_START))
46008+ return MSPACK_ERR_SEEK;
46009+ }
46010+ *fn = '\0';
46011+ }
46012+
46013+ /* 2 bytes: extra text length then [length] bytes of extra text data */
46014+ if (hdr->headers & MSKWAJ_HDR_HASEXTRATEXT) {
46015+ if (sys->read(fh, &buf[0], 2) != 2) return MSPACK_ERR_READ;
46016+ i = EndGetI16(&buf[0]);
46017+ hdr->extra = (char *) sys->alloc(sys, (size_t)i+1);
46018+ if (! hdr->extra) return MSPACK_ERR_NOMEMORY;
46019+ if (sys->read(fh, hdr->extra, i) != i) return MSPACK_ERR_READ;
46020+ hdr->extra[i] = '\0';
46021+ hdr->extra_length = i;
46022+ }
46023+ return MSPACK_ERR_OK;
46024+}
46025+
46026+/***************************************
46027+ * KWAJD_EXTRACT
46028+ ***************************************
46029+ * decompresses a KWAJ file
46030+ */
46031+static int kwajd_extract(struct mskwaj_decompressor *base,
46032+ struct mskwajd_header *hdr, const char *filename)
46033+{
46034+ struct mskwaj_decompressor_p *self = (struct mskwaj_decompressor_p *) base;
46035+ struct mspack_system *sys;
46036+ struct mspack_file *fh, *outfh;
46037+
46038+ if (!self) return MSPACK_ERR_ARGS;
46039+ if (!hdr) return self->error = MSPACK_ERR_ARGS;
46040+
46041+ sys = self->system;
46042+ fh = ((struct mskwajd_header_p *) hdr)->fh;
46043+
46044+ /* seek to the compressed data */
46045+ if (sys->seek(fh, hdr->data_offset, MSPACK_SYS_SEEK_START)) {
46046+ return self->error = MSPACK_ERR_SEEK;
46047+ }
46048+
46049+ /* open file for output */
46050+ if (!(outfh = sys->open(sys, filename, MSPACK_SYS_OPEN_WRITE))) {
46051+ return self->error = MSPACK_ERR_OPEN;
46052+ }
46053+
46054+ self->error = MSPACK_ERR_OK;
46055+
46056+ /* decompress based on format */
46057+ if (hdr->comp_type == MSKWAJ_COMP_NONE ||
46058+ hdr->comp_type == MSKWAJ_COMP_XOR)
46059+ {
46060+ /* NONE is a straight copy. XOR is a copy xored with 0xFF */
46061+ unsigned char *buf = (unsigned char *) sys->alloc(sys, (size_t) KWAJ_INPUT_SIZE);
46062+ if (buf) {
46063+ int read, i;
46064+ while ((read = sys->read(fh, buf, KWAJ_INPUT_SIZE)) > 0) {
46065+ if (hdr->comp_type == MSKWAJ_COMP_XOR) {
46066+ for (i = 0; i < read; i++) buf[i] ^= 0xFF;
46067+ }
46068+ if (sys->write(outfh, buf, read) != read) {
46069+ self->error = MSPACK_ERR_WRITE;
46070+ break;
46071+ }
46072+ }
46073+ if (read < 0) self->error = MSPACK_ERR_READ;
46074+ sys->free(buf);
46075+ }
46076+ else {
46077+ self->error = MSPACK_ERR_NOMEMORY;
46078+ }
46079+ }
46080+ else if (hdr->comp_type == MSKWAJ_COMP_SZDD) {
46081+ self->error = lzss_decompress(sys, fh, outfh, KWAJ_INPUT_SIZE,
46082+ LZSS_MODE_EXPAND);
46083+ }
46084+ else if (hdr->comp_type == MSKWAJ_COMP_LZH) {
46085+ struct kwajd_stream *lzh = lzh_init(sys, fh, outfh);
46086+ self->error = (lzh) ? lzh_decompress(lzh) : MSPACK_ERR_NOMEMORY;
46087+ lzh_free(lzh);
46088+ }
46089+ else if (hdr->comp_type == MSKWAJ_COMP_MSZIP) {
46090+ struct mszipd_stream *zip = mszipd_init(sys,fh,outfh,KWAJ_INPUT_SIZE,0);
46091+ self->error = (zip) ? mszipd_decompress_kwaj(zip) : MSPACK_ERR_NOMEMORY;
46092+ mszipd_free(zip);
46093+ }
46094+ else {
46095+ self->error = MSPACK_ERR_DATAFORMAT;
46096+ }
46097+
46098+ /* close output file */
46099+ sys->close(outfh);
46100+
46101+ return self->error;
46102+}
46103+
46104+/***************************************
46105+ * KWAJD_DECOMPRESS
46106+ ***************************************
46107+ * unpacks directly from input to output
46108+ */
46109+static int kwajd_decompress(struct mskwaj_decompressor *base,
46110+ const char *input, const char *output)
46111+{
46112+ struct mskwaj_decompressor_p *self = (struct mskwaj_decompressor_p *) base;
46113+ struct mskwajd_header *hdr;
46114+ int error;
46115+
46116+ if (!self) return MSPACK_ERR_ARGS;
46117+
46118+ if (!(hdr = kwajd_open(base, input))) return self->error;
46119+ error = kwajd_extract(base, hdr, output);
46120+ kwajd_close(base, hdr);
46121+ return self->error = error;
46122+}
46123+
46124+/***************************************
46125+ * KWAJD_ERROR
46126+ ***************************************
46127+ * returns the last error that occurred
46128+ */
46129+static int kwajd_error(struct mskwaj_decompressor *base)
46130+{
46131+ struct mskwaj_decompressor_p *self = (struct mskwaj_decompressor_p *) base;
46132+ return (self) ? self->error : MSPACK_ERR_ARGS;
46133+}
46134+
46135+/***************************************
46136+ * LZH_INIT, LZH_DECOMPRESS, LZH_FREE
46137+ ***************************************
46138+ * unpacks KWAJ method 3 files
46139+ */
46140+
46141+/* import bit-reading macros and code */
46142+#define BITS_TYPE struct kwajd_stream
46143+#define BITS_VAR lzh
46144+#define BITS_ORDER_MSB
46145+#define BITS_NO_READ_INPUT
46146+#define READ_BYTES do { \
46147+ if (i_ptr >= i_end) { \
46148+ if ((err = lzh_read_input(lzh))) return err; \
46149+ i_ptr = lzh->i_ptr; \
46150+ i_end = lzh->i_end; \
46151+ } \
46152+ INJECT_BITS(*i_ptr++, 8); \
46153+} while (0)
46154+#include <readbits.h>
46155+
46156+/* import huffman-reading macros and code */
46157+#define TABLEBITS(tbl) KWAJ_TABLEBITS
46158+#define MAXSYMBOLS(tbl) KWAJ_##tbl##_SYMS
46159+#define HUFF_TABLE(tbl,idx) lzh->tbl##_table[idx]
46160+#define HUFF_LEN(tbl,idx) lzh->tbl##_len[idx]
46161+#define HUFF_ERROR return MSPACK_ERR_DATAFORMAT
46162+#include <readhuff.h>
46163+
46164+/* In the KWAJ LZH format, there is no special 'eof' marker, it just
46165+ * ends. Depending on how many bits are left in the final byte when
46166+ * the stream ends, that might be enough to start another literal or
46167+ * match. The only easy way to detect that we've come to an end is to
46168+ * guard all bit-reading. We allow fake bits to be read once we reach
46169+ * the end of the stream, but we check if we then consumed any of
46170+ * those fake bits, after doing the READ_BITS / READ_HUFFSYM. This
46171+ * isn't how the default readbits.h read_input() works (it simply lets
46172+ * 2 fake bytes in then stops), so we implement our own.
46173+ */
46174+#define READ_BITS_SAFE(val, n) do { \
46175+ READ_BITS(val, n); \
46176+ if (lzh->input_end && bits_left < lzh->input_end) \
46177+ return MSPACK_ERR_OK; \
46178+} while (0)
46179+
46180+#define READ_HUFFSYM_SAFE(tbl, val) do { \
46181+ READ_HUFFSYM(tbl, val); \
46182+ if (lzh->input_end && bits_left < lzh->input_end) \
46183+ return MSPACK_ERR_OK; \
46184+} while (0)
46185+
46186+#define BUILD_TREE(tbl, type) \
46187+ STORE_BITS; \
46188+ err = lzh_read_lens(lzh, type, MAXSYMBOLS(tbl), \
46189+ &HUFF_LEN(tbl,0), &HUFF_TABLE(tbl,0)); \
46190+ if (err) return err; \
46191+ RESTORE_BITS; \
46192+ if (make_decode_table(MAXSYMBOLS(tbl), TABLEBITS(tbl), \
46193+ &HUFF_LEN(tbl,0), &HUFF_TABLE(tbl,0))) \
46194+ return MSPACK_ERR_DATAFORMAT;
46195+
46196+#define WRITE_BYTE do { \
46197+ if (lzh->sys->write(lzh->output, &lzh->window[pos], 1) != 1) \
46198+ return MSPACK_ERR_WRITE; \
46199+} while (0)
46200+
46201+static struct kwajd_stream *lzh_init(struct mspack_system *sys,
46202+ struct mspack_file *in, struct mspack_file *out)
46203+{
46204+ struct kwajd_stream *lzh;
46205+
46206+ if (!sys || !in || !out) return NULL;
46207+ if (!(lzh = (struct kwajd_stream *) sys->alloc(sys, sizeof(struct kwajd_stream)))) return NULL;
46208+
46209+ lzh->sys = sys;
46210+ lzh->input = in;
46211+ lzh->output = out;
46212+ return lzh;
46213+}
46214+
46215+static int lzh_decompress(struct kwajd_stream *lzh)
46216+{
46217+ register unsigned int bit_buffer;
46218+ register int bits_left, i;
46219+ register unsigned short sym;
46220+ unsigned char *i_ptr, *i_end, lit_run = 0;
46221+ int j, pos = 0, len, offset, err;
46222+ unsigned int types[6];
46223+
46224+ /* reset global state */
46225+ INIT_BITS;
46226+ RESTORE_BITS;
46227+ memset(&lzh->window[0], LZSS_WINDOW_FILL, (size_t) LZSS_WINDOW_SIZE);
46228+
46229+ /* read 6 encoding types (for byte alignment) but only 5 are needed */
46230+ for (i = 0; i < 6; i++) READ_BITS_SAFE(types[i], 4);
46231+
46232+ /* read huffman table symbol lengths and build huffman trees */
46233+ BUILD_TREE(MATCHLEN1, types[0]);
46234+ BUILD_TREE(MATCHLEN2, types[1]);
46235+ BUILD_TREE(LITLEN, types[2]);
46236+ BUILD_TREE(OFFSET, types[3]);
46237+ BUILD_TREE(LITERAL, types[4]);
46238+
46239+ while (!lzh->input_end) {
46240+ if (lit_run) READ_HUFFSYM_SAFE(MATCHLEN2, len);
46241+ else READ_HUFFSYM_SAFE(MATCHLEN1, len);
46242+
46243+ if (len > 0) {
46244+ len += 2;
46245+ lit_run = 0; /* not the end of a literal run */
46246+ READ_HUFFSYM_SAFE(OFFSET, j); offset = j << 6;
46247+ READ_BITS_SAFE(j, 6); offset |= j;
46248+
46249+ /* copy match as output and into the ring buffer */
46250+ while (len-- > 0) {
46251+ lzh->window[pos] = lzh->window[(pos+4096-offset) & 4095];
46252+ WRITE_BYTE;
46253+ pos++; pos &= 4095;
46254+ }
46255+ }
46256+ else {
46257+ READ_HUFFSYM_SAFE(LITLEN, len); len++;
46258+ lit_run = (len == 32) ? 0 : 1; /* end of a literal run? */
46259+ while (len-- > 0) {
46260+ READ_HUFFSYM_SAFE(LITERAL, j);
46261+ /* copy as output and into the ring buffer */
46262+ lzh->window[pos] = j;
46263+ WRITE_BYTE;
46264+ pos++; pos &= 4095;
46265+ }
46266+ }
46267+ }
46268+ return MSPACK_ERR_OK;
46269+}
46270+
46271+static void lzh_free(struct kwajd_stream *lzh)
46272+{
46273+ struct mspack_system *sys;
46274+ if (!lzh || !lzh->sys) return;
46275+ sys = lzh->sys;
46276+ sys->free(lzh);
46277+}
46278+
46279+static int lzh_read_lens(struct kwajd_stream *lzh,
46280+ unsigned int type, unsigned int numsyms,
46281+ unsigned char *lens, unsigned short *table)
46282+{
46283+ register unsigned int bit_buffer;
46284+ register int bits_left;
46285+ unsigned char *i_ptr, *i_end;
46286+ unsigned int i, c, sel;
46287+ int err;
46288+
46289+ RESTORE_BITS;
46290+ switch (type) {
46291+ case 0:
46292+ i = numsyms; c = (i==16)?4: (i==32)?5: (i==64)?6: (i==256)?8 :0;
46293+ for (i = 0; i < numsyms; i++) lens[i] = c;
46294+ break;
46295+
46296+ case 1:
46297+ READ_BITS_SAFE(c, 4); lens[0] = c;
46298+ for (i = 1; i < numsyms; i++) {
46299+ READ_BITS_SAFE(sel, 1); if (sel == 0) lens[i] = c;
46300+ else { READ_BITS_SAFE(sel, 1); if (sel == 0) lens[i] = ++c;
46301+ else { READ_BITS_SAFE(c, 4); lens[i] = c; }}
46302+ }
46303+ break;
46304+
46305+ case 2:
46306+ READ_BITS_SAFE(c, 4); lens[0] = c;
46307+ for (i = 1; i < numsyms; i++) {
46308+ READ_BITS_SAFE(sel, 2);
46309+ if (sel == 3) READ_BITS_SAFE(c, 4); else c += (char) sel-1;
46310+ lens[i] = c;
46311+ }
46312+ break;
46313+
46314+ case 3:
46315+ for (i = 0; i < numsyms; i++) {
46316+ READ_BITS_SAFE(c, 4); lens[i] = c;
46317+ }
46318+ break;
46319+ }
46320+ STORE_BITS;
46321+ return MSPACK_ERR_OK;
46322+}
46323+
46324+static int lzh_read_input(struct kwajd_stream *lzh) {
46325+ int read;
46326+ if (lzh->input_end) {
46327+ lzh->input_end += 8;
46328+ lzh->inbuf[0] = 0;
46329+ read = 1;
46330+ }
46331+ else {
46332+ read = lzh->sys->read(lzh->input, &lzh->inbuf[0], KWAJ_INPUT_SIZE);
46333+ if (read < 0) return MSPACK_ERR_READ;
46334+ if (read == 0) {
46335+ lzh->input_end = 8;
46336+ lzh->inbuf[0] = 0;
46337+ read = 1;
46338+ }
46339+ }
46340+
46341+ /* update i_ptr and i_end */
46342+ lzh->i_ptr = &lzh->inbuf[0];
46343+ lzh->i_end = &lzh->inbuf[read];
46344+ return MSPACK_ERR_OK;
46345+}
46346diff --git a/libclamav/libmspack-0.4alpha/mspack/lit.h b/libclamav/libmspack-0.4alpha/mspack/lit.h
46347new file mode 100644
46348index 000000000000..79ba44d87729
46349--- /dev/null
46350+++ b/libclamav/libmspack-0.4alpha/mspack/lit.h
46351@@ -0,0 +1,35 @@
46352+/* This file is part of libmspack.
46353+ * (C) 2003-2004 Stuart Caie.
46354+ *
46355+ * libmspack is free software; you can redistribute it and/or modify it under
46356+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46357+ *
46358+ * For further details, see the file COPYING.LIB distributed with libmspack
46359+ */
46360+
46361+#ifndef MSPACK_LIT_H
46362+#define MSPACK_LIT_H 1
46363+
46364+#include <lzx.h>
46365+#include <des.h>
46366+#include <sha.h>
46367+
46368+/* generic LIT definitions */
46369+
46370+/* LIT compression definitions */
46371+
46372+struct mslit_compressor_p {
46373+ struct mslit_compressor base;
46374+ struct mspack_system *system;
46375+ /* todo */
46376+};
46377+
46378+/* LIT decompression definitions */
46379+
46380+struct mslit_decompressor_p {
46381+ struct mslit_decompressor base;
46382+ struct mspack_system *system;
46383+ /* todo */
46384+};
46385+
46386+#endif
46387diff --git a/libclamav/libmspack-0.4alpha/mspack/litc.c b/libclamav/libmspack-0.4alpha/mspack/litc.c
46388new file mode 100644
46389index 000000000000..a8a709af07af
46390--- /dev/null
46391+++ b/libclamav/libmspack-0.4alpha/mspack/litc.c
46392@@ -0,0 +1,24 @@
46393+/* This file is part of libmspack.
46394+ * (C) 2003-2004 Stuart Caie.
46395+ *
46396+ * libmspack is free software; you can redistribute it and/or modify it under
46397+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46398+ *
46399+ * For further details, see the file COPYING.LIB distributed with libmspack
46400+ */
46401+
46402+/* LIT compression implementation */
46403+
46404+#include <system.h>
46405+#include <lit.h>
46406+
46407+struct mslit_compressor *
46408+ mspack_create_lit_compressor(struct mspack_system *sys)
46409+{
46410+ /* todo */
46411+ return NULL;
46412+}
46413+
46414+void mspack_destroy_lit_compressor(struct mslit_compressor *self) {
46415+ /* todo */
46416+}
46417diff --git a/libclamav/libmspack-0.4alpha/mspack/litd.c b/libclamav/libmspack-0.4alpha/mspack/litd.c
46418new file mode 100644
46419index 000000000000..6e0dc9af27c4
46420--- /dev/null
46421+++ b/libclamav/libmspack-0.4alpha/mspack/litd.c
46422@@ -0,0 +1,24 @@
46423+/* This file is part of libmspack.
46424+ * (C) 2003-2004 Stuart Caie.
46425+ *
46426+ * libmspack is free software; you can redistribute it and/or modify it under
46427+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46428+ *
46429+ * For further details, see the file COPYING.LIB distributed with libmspack
46430+ */
46431+
46432+/* LIT decompression implementation */
46433+
46434+#include <system.h>
46435+#include <lit.h>
46436+
46437+struct mslit_decompressor *
46438+ mspack_create_lit_decompressor(struct mspack_system *sys)
46439+{
46440+ /* todo */
46441+ return NULL;
46442+}
46443+
46444+void mspack_destroy_lit_decompressor(struct mslit_decompressor *self) {
46445+ /* todo */
46446+}
46447diff --git a/libclamav/libmspack-0.4alpha/mspack/lzss.h b/libclamav/libmspack-0.4alpha/mspack/lzss.h
46448new file mode 100644
46449index 000000000000..55e761b5bf91
46450--- /dev/null
46451+++ b/libclamav/libmspack-0.4alpha/mspack/lzss.h
46452@@ -0,0 +1,66 @@
46453+/* This file is part of libmspack.
46454+ * (C) 2003-2004 Stuart Caie.
46455+ *
46456+ * libmspack is free software; you can redistribute it and/or modify it under
46457+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46458+ *
46459+ * For further details, see the file COPYING.LIB distributed with libmspack
46460+ */
46461+
46462+#ifndef MSPACK_LZSS_H
46463+#define MSPACK_LZSS_H 1
46464+
46465+#ifdef __cplusplus
46466+extern "C" {
46467+#endif
46468+
46469+/* LZSS compression / decompression definitions */
46470+
46471+#define LZSS_WINDOW_SIZE (4096)
46472+#define LZSS_WINDOW_FILL (0x20)
46473+
46474+#define LZSS_MODE_EXPAND (0)
46475+#define LZSS_MODE_MSHELP (1)
46476+#define LZSS_MODE_QBASIC (2)
46477+
46478+/**
46479+ * Decompresses an LZSS stream.
46480+ *
46481+ * Input bytes will be read in as necessary using the system->read()
46482+ * function with the input file handle given. This will continue until
46483+ * system->read() returns 0 bytes, or an error. Errors will be passed
46484+ * out of the function as MSPACK_ERR_READ errors. Input streams should
46485+ * convey an "end of input stream" by refusing to supply all the bytes
46486+ * that LZSS asks for when they reach the end of the stream, rather
46487+ * than return an error code.
46488+ *
46489+ * Output bytes will be passed to the system->write() function, using
46490+ * the output file handle given. More than one call may be made to
46491+ * system->write().
46492+ *
46493+ * As EXPAND.EXE (SZDD/KWAJ), Microsoft Help and QBasic have slightly
46494+ * different encodings for the control byte and matches, a "mode"
46495+ * parameter is allowed, to choose the encoding.
46496+ *
46497+ * @param system an mspack_system structure used to read from
46498+ * the input stream and write to the output
46499+ * stream, also to allocate and free memory.
46500+ * @param input an input stream with the LZSS data.
46501+ * @param output an output stream to write the decoded data to.
46502+ * @param input_buffer_size the number of bytes to use as an input
46503+ * bitstream buffer.
46504+ * @param mode one of #LZSS_MODE_EXPAND, #LZSS_MODE_MSHELP or
46505+ * #LZSS_MODE_QBASIC
46506+ * @return an error code, or MSPACK_ERR_OK if successful
46507+ */
46508+extern int lzss_decompress(struct mspack_system *system,
46509+ struct mspack_file *input,
46510+ struct mspack_file *output,
46511+ int input_buffer_size,
46512+ int mode);
46513+
46514+#ifdef __cplusplus
46515+}
46516+#endif
46517+
46518+#endif
46519diff --git a/libclamav/libmspack-0.4alpha/mspack/lzssd.c b/libclamav/libmspack-0.4alpha/mspack/lzssd.c
46520new file mode 100644
46521index 000000000000..df294bc13258
46522--- /dev/null
46523+++ b/libclamav/libmspack-0.4alpha/mspack/lzssd.c
46524@@ -0,0 +1,93 @@
46525+/* This file is part of libmspack.
46526+ * (C) 2003-2010 Stuart Caie.
46527+ *
46528+ * LZSS is a derivative of LZ77 and was created by James Storer and
46529+ * Thomas Szymanski in 1982. Haruhiko Okumura wrote a very popular C
46530+ * implementation.
46531+ *
46532+ * libmspack is free software; you can redistribute it and/or modify it under
46533+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46534+ *
46535+ * For further details, see the file COPYING.LIB distributed with libmspack
46536+ */
46537+
46538+#include <system.h>
46539+#include <lzss.h>
46540+
46541+#define ENSURE_BYTES do { \
46542+ if (i_ptr >= i_end) { \
46543+ read = system->read(input, &inbuf[0], \
46544+ input_buffer_size); \
46545+ if (read <= 0) { \
46546+ system->free(window); \
46547+ return (read < 0) ? MSPACK_ERR_READ \
46548+ : MSPACK_ERR_OK; \
46549+ } \
46550+ i_ptr = &inbuf[0]; i_end = &inbuf[read]; \
46551+ } \
46552+} while (0)
46553+
46554+#define WRITE_BYTE do { \
46555+ if (system->write(output, &window[pos], 1) != 1) { \
46556+ system->free(window); \
46557+ return MSPACK_ERR_WRITE; \
46558+ } \
46559+} while (0)
46560+
46561+int lzss_decompress(struct mspack_system *system,
46562+ struct mspack_file *input,
46563+ struct mspack_file *output,
46564+ int input_buffer_size,
46565+ int mode)
46566+{
46567+ unsigned char *window, *inbuf, *i_ptr, *i_end;
46568+ unsigned int pos, i, c, invert, mpos, len;
46569+ int read;
46570+
46571+ /* check parameters */
46572+ if (!system || input_buffer_size < 1 || (mode != LZSS_MODE_EXPAND &&
46573+ mode != LZSS_MODE_MSHELP && mode != LZSS_MODE_QBASIC))
46574+ {
46575+ return MSPACK_ERR_ARGS;
46576+ }
46577+
46578+ /* allocate memory */
46579+ window = (unsigned char *) system->alloc(system, LZSS_WINDOW_SIZE + input_buffer_size);
46580+ if (!window) return MSPACK_ERR_NOMEMORY;
46581+
46582+ /* initialise decompression */
46583+ inbuf = &window[LZSS_WINDOW_SIZE];
46584+ memset(window, LZSS_WINDOW_FILL, (size_t) LZSS_WINDOW_SIZE);
46585+ pos = LZSS_WINDOW_SIZE - ((mode == LZSS_MODE_QBASIC) ? 18 : 16);
46586+ invert = (mode == LZSS_MODE_MSHELP) ? ~0 : 0;
46587+ i_ptr = i_end = &inbuf[0];
46588+
46589+ /* loop forever; exit condition is in ENSURE_BYTES macro */
46590+ for (;;) {
46591+ ENSURE_BYTES; c = *i_ptr++ ^ invert;
46592+ for (i = 0x01; i & 0xFF; i <<= 1) {
46593+ if (c & i) {
46594+ /* literal */
46595+ ENSURE_BYTES; window[pos] = *i_ptr++;
46596+ WRITE_BYTE;
46597+ pos++; pos &= LZSS_WINDOW_SIZE - 1;
46598+ }
46599+ else {
46600+ /* match */
46601+ ENSURE_BYTES; mpos = *i_ptr++;
46602+ ENSURE_BYTES; mpos |= (*i_ptr & 0xF0) << 4;
46603+ len = (*i_ptr++ & 0x0F) + 3;
46604+ while (len--) {
46605+ window[pos] = window[mpos];
46606+ WRITE_BYTE;
46607+ pos++; pos &= LZSS_WINDOW_SIZE - 1;
46608+ mpos++; mpos &= LZSS_WINDOW_SIZE - 1;
46609+ }
46610+ }
46611+ }
46612+ }
46613+
46614+ /* not reached */
46615+ system->free(window);
46616+ return MSPACK_ERR_OK;
46617+}
46618diff --git a/libclamav/libmspack-0.4alpha/mspack/lzx.h b/libclamav/libmspack-0.4alpha/mspack/lzx.h
46619new file mode 100644
46620index 000000000000..4d3189ea5730
46621--- /dev/null
46622+++ b/libclamav/libmspack-0.4alpha/mspack/lzx.h
46623@@ -0,0 +1,221 @@
46624+/* This file is part of libmspack.
46625+ * (C) 2003-2013 Stuart Caie.
46626+ *
46627+ * The LZX method was created by Jonathan Forbes and Tomi Poutanen, adapted
46628+ * by Microsoft Corporation.
46629+ *
46630+ * libmspack is free software; you can redistribute it and/or modify it under
46631+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46632+ *
46633+ * For further details, see the file COPYING.LIB distributed with libmspack
46634+ */
46635+
46636+#ifndef MSPACK_LZX_H
46637+#define MSPACK_LZX_H 1
46638+
46639+#ifdef __cplusplus
46640+extern "C" {
46641+#endif
46642+
46643+/* LZX compression / decompression definitions */
46644+
46645+/* some constants defined by the LZX specification */
46646+#define LZX_MIN_MATCH (2)
46647+#define LZX_MAX_MATCH (257)
46648+#define LZX_NUM_CHARS (256)
46649+#define LZX_BLOCKTYPE_INVALID (0) /* also blocktypes 4-7 invalid */
46650+#define LZX_BLOCKTYPE_VERBATIM (1)
46651+#define LZX_BLOCKTYPE_ALIGNED (2)
46652+#define LZX_BLOCKTYPE_UNCOMPRESSED (3)
46653+#define LZX_PRETREE_NUM_ELEMENTS (20)
46654+#define LZX_ALIGNED_NUM_ELEMENTS (8) /* aligned offset tree #elements */
46655+#define LZX_NUM_PRIMARY_LENGTHS (7) /* this one missing from spec! */
46656+#define LZX_NUM_SECONDARY_LENGTHS (249) /* length tree #elements */
46657+
46658+/* LZX huffman defines: tweak tablebits as desired */
46659+#define LZX_PRETREE_MAXSYMBOLS (LZX_PRETREE_NUM_ELEMENTS)
46660+#define LZX_PRETREE_TABLEBITS (6)
46661+#define LZX_MAINTREE_MAXSYMBOLS (LZX_NUM_CHARS + 290*8)
46662+#define LZX_MAINTREE_TABLEBITS (12)
46663+#define LZX_LENGTH_MAXSYMBOLS (LZX_NUM_SECONDARY_LENGTHS+1)
46664+#define LZX_LENGTH_TABLEBITS (12)
46665+#define LZX_ALIGNED_MAXSYMBOLS (LZX_ALIGNED_NUM_ELEMENTS)
46666+#define LZX_ALIGNED_TABLEBITS (7)
46667+#define LZX_LENTABLE_SAFETY (64) /* table decoding overruns are allowed */
46668+
46669+#define LZX_FRAME_SIZE (32768) /* the size of a frame in LZX */
46670+
46671+struct lzxd_stream {
46672+ struct mspack_system *sys; /* I/O routines */
46673+ struct mspack_file *input; /* input file handle */
46674+ struct mspack_file *output; /* output file handle */
46675+
46676+ off_t offset; /* number of bytes actually output */
46677+ off_t length; /* overall decompressed length of stream */
46678+
46679+ unsigned char *window; /* decoding window */
46680+ unsigned int window_size; /* window size */
46681+ unsigned int ref_data_size; /* LZX DELTA reference data size */
46682+ unsigned int num_offsets; /* number of match_offset entries in table */
46683+ unsigned int window_posn; /* decompression offset within window */
46684+ unsigned int frame_posn; /* current frame offset within in window */
46685+ unsigned int frame; /* the number of 32kb frames processed */
46686+ unsigned int reset_interval; /* which frame do we reset the compressor? */
46687+
46688+ unsigned int R0, R1, R2; /* for the LRU offset system */
46689+ unsigned int block_length; /* uncompressed length of this LZX block */
46690+ unsigned int block_remaining; /* uncompressed bytes still left to decode */
46691+
46692+ signed int intel_filesize; /* magic header value used for transform */
46693+ signed int intel_curpos; /* current offset in transform space */
46694+
46695+ unsigned char intel_started; /* has intel E8 decoding started? */
46696+ unsigned char block_type; /* type of the current block */
46697+ unsigned char header_read; /* have we started decoding at all yet? */
46698+ unsigned char input_end; /* have we reached the end of input? */
46699+ unsigned char is_delta; /* does stream follow LZX DELTA spec? */
46700+
46701+ int error;
46702+
46703+ /* I/O buffering */
46704+ unsigned char *inbuf, *i_ptr, *i_end, *o_ptr, *o_end;
46705+ unsigned int bit_buffer, bits_left, inbuf_size;
46706+
46707+ /* huffman code lengths */
46708+ unsigned char PRETREE_len [LZX_PRETREE_MAXSYMBOLS + LZX_LENTABLE_SAFETY];
46709+ unsigned char MAINTREE_len [LZX_MAINTREE_MAXSYMBOLS + LZX_LENTABLE_SAFETY];
46710+ unsigned char LENGTH_len [LZX_LENGTH_MAXSYMBOLS + LZX_LENTABLE_SAFETY];
46711+ unsigned char ALIGNED_len [LZX_ALIGNED_MAXSYMBOLS + LZX_LENTABLE_SAFETY];
46712+
46713+ /* huffman decoding tables */
46714+ unsigned short PRETREE_table [(1 << LZX_PRETREE_TABLEBITS) +
46715+ (LZX_PRETREE_MAXSYMBOLS * 2)];
46716+ unsigned short MAINTREE_table[(1 << LZX_MAINTREE_TABLEBITS) +
46717+ (LZX_MAINTREE_MAXSYMBOLS * 2)];
46718+ unsigned short LENGTH_table [(1 << LZX_LENGTH_TABLEBITS) +
46719+ (LZX_LENGTH_MAXSYMBOLS * 2)];
46720+ unsigned short ALIGNED_table [(1 << LZX_ALIGNED_TABLEBITS) +
46721+ (LZX_ALIGNED_MAXSYMBOLS * 2)];
46722+ unsigned char LENGTH_empty;
46723+
46724+ /* this is used purely for doing the intel E8 transform */
46725+ unsigned char e8_buf[LZX_FRAME_SIZE];
46726+};
46727+
46728+/**
46729+ * Allocates and initialises LZX decompression state for decoding an LZX
46730+ * stream.
46731+ *
46732+ * This routine uses system->alloc() to allocate memory. If memory
46733+ * allocation fails, or the parameters to this function are invalid,
46734+ * NULL is returned.
46735+ *
46736+ * @param system an mspack_system structure used to read from
46737+ * the input stream and write to the output
46738+ * stream, also to allocate and free memory.
46739+ * @param input an input stream with the LZX data.
46740+ * @param output an output stream to write the decoded data to.
46741+ * @param window_bits the size of the decoding window, which must be
46742+ * between 15 and 21 inclusive for regular LZX
46743+ * data, or between 17 and 25 inclusive for
46744+ * LZX DELTA data.
46745+ * @param reset_interval the interval at which the LZX bitstream is
46746+ * reset, in multiples of LZX frames (32678
46747+ * bytes), e.g. a value of 2 indicates the input
46748+ * stream resets after every 65536 output bytes.
46749+ * A value of 0 indicates that the bitstream never
46750+ * resets, such as in CAB LZX streams.
46751+ * @param input_buffer_size the number of bytes to use as an input
46752+ * bitstream buffer.
46753+ * @param output_length the length in bytes of the entirely
46754+ * decompressed output stream, if known in
46755+ * advance. It is used to correctly perform the
46756+ * Intel E8 transformation, which must stop 6
46757+ * bytes before the very end of the
46758+ * decompressed stream. It is not otherwise used
46759+ * or adhered to. If the full decompressed
46760+ * length is known in advance, set it here.
46761+ * If it is NOT known, use the value 0, and call
46762+ * lzxd_set_output_length() once it is
46763+ * known. If never set, 4 of the final 6 bytes
46764+ * of the output stream may be incorrect.
46765+ * @param is_delta should be zero for all regular LZX data,
46766+ * non-zero for LZX DELTA encoded data.
46767+ * @return a pointer to an initialised lzxd_stream structure, or NULL if
46768+ * there was not enough memory or parameters to the function were wrong.
46769+ */
46770+extern struct lzxd_stream *lzxd_init(struct mspack_system *system,
46771+ struct mspack_file *input,
46772+ struct mspack_file *output,
46773+ int window_bits,
46774+ int reset_interval,
46775+ int input_buffer_size,
46776+ off_t output_length,
46777+ char is_delta);
46778+
46779+/* see description of output_length in lzxd_init() */
46780+extern void lzxd_set_output_length(struct lzxd_stream *lzx,
46781+ off_t output_length);
46782+
46783+/**
46784+ * Reads LZX DELTA reference data into the window and allows
46785+ * lzxd_decompress() to reference it.
46786+ *
46787+ * Call this before the first call to lzxd_decompress().
46788+
46789+ * @param lzx the LZX stream to apply this reference data to
46790+ * @param system an mspack_system implementation to use with the
46791+ * input param. Only read() will be called.
46792+ * @param input an input file handle to read reference data using
46793+ * system->read().
46794+ * @param length the length of the reference data. Cannot be longer
46795+ * than the LZX window size.
46796+ * @return an error code, or MSPACK_ERR_OK if successful
46797+ */
46798+extern int lzxd_set_reference_data(struct lzxd_stream *lzx,
46799+ struct mspack_system *system,
46800+ struct mspack_file *input,
46801+ unsigned int length);
46802+
46803+/**
46804+ * Decompresses entire or partial LZX streams.
46805+ *
46806+ * The number of bytes of data that should be decompressed is given as the
46807+ * out_bytes parameter. If more bytes are decoded than are needed, they
46808+ * will be kept over for a later invocation.
46809+ *
46810+ * The output bytes will be passed to the system->write() function given in
46811+ * lzxd_init(), using the output file handle given in lzxd_init(). More than
46812+ * one call may be made to system->write().
46813+
46814+ * Input bytes will be read in as necessary using the system->read()
46815+ * function given in lzxd_init(), using the input file handle given in
46816+ * lzxd_init(). This will continue until system->read() returns 0 bytes,
46817+ * or an error. Errors will be passed out of the function as
46818+ * MSPACK_ERR_READ errors. Input streams should convey an "end of input
46819+ * stream" by refusing to supply all the bytes that LZX asks for when they
46820+ * reach the end of the stream, rather than return an error code.
46821+ *
46822+ * If any error code other than MSPACK_ERR_OK is returned, the stream
46823+ * should be considered unusable and lzxd_decompress() should not be
46824+ * called again on this stream.
46825+ *
46826+ * @param lzx LZX decompression state, as allocated by lzxd_init().
46827+ * @param out_bytes the number of bytes of data to decompress.
46828+ * @return an error code, or MSPACK_ERR_OK if successful
46829+ */
46830+extern int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes);
46831+
46832+/**
46833+ * Frees all state associated with an LZX data stream. This will call
46834+ * system->free() using the system pointer given in lzxd_init().
46835+ *
46836+ * @param lzx LZX decompression state to free.
46837+ */
46838+void lzxd_free(struct lzxd_stream *lzx);
46839+
46840+#ifdef __cplusplus
46841+}
46842+#endif
46843+
46844+#endif
46845diff --git a/libclamav/libmspack-0.4alpha/mspack/lzxc.c b/libclamav/libmspack-0.4alpha/mspack/lzxc.c
46846new file mode 100644
46847index 000000000000..1207a0d747d5
46848--- /dev/null
46849+++ b/libclamav/libmspack-0.4alpha/mspack/lzxc.c
46850@@ -0,0 +1,18 @@
46851+/* This file is part of libmspack.
46852+ * (C) 2003-2004 Stuart Caie.
46853+ *
46854+ * The LZX method was created by Jonathan Forbes and Tomi Poutanen, adapted
46855+ * by Microsoft Corporation.
46856+ *
46857+ * libmspack is free software; you can redistribute it and/or modify it under
46858+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46859+ *
46860+ * For further details, see the file COPYING.LIB distributed with libmspack
46861+ */
46862+
46863+/* LZX compression implementation */
46864+
46865+#include <system.h>
46866+#include <lzx.h>
46867+
46868+/* todo */
46869diff --git a/libclamav/libmspack-0.4alpha/mspack/lzxd.c b/libclamav/libmspack-0.4alpha/mspack/lzxd.c
46870new file mode 100644
46871index 000000000000..b552e78414c1
46872--- /dev/null
46873+++ b/libclamav/libmspack-0.4alpha/mspack/lzxd.c
46874@@ -0,0 +1,895 @@
46875+/* This file is part of libmspack.
46876+ * (C) 2003-2013 Stuart Caie.
46877+ *
46878+ * The LZX method was created by Jonathan Forbes and Tomi Poutanen, adapted
46879+ * by Microsoft Corporation.
46880+ *
46881+ * libmspack is free software; you can redistribute it and/or modify it under
46882+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
46883+ *
46884+ * For further details, see the file COPYING.LIB distributed with libmspack
46885+ */
46886+
46887+/* LZX decompression implementation */
46888+
46889+#include <system.h>
46890+#include <lzx.h>
46891+
46892+/* Microsoft's LZX document (in cab-sdk.exe) and their implementation
46893+ * of the com.ms.util.cab Java package do not concur.
46894+ *
46895+ * In the LZX document, there is a table showing the correlation between
46896+ * window size and the number of position slots. It states that the 1MB
46897+ * window = 40 slots and the 2MB window = 42 slots. In the implementation,
46898+ * 1MB = 42 slots, 2MB = 50 slots. The actual calculation is 'find the
46899+ * first slot whose position base is equal to or more than the required
46900+ * window size'. This would explain why other tables in the document refer
46901+ * to 50 slots rather than 42.
46902+ *
46903+ * The constant NUM_PRIMARY_LENGTHS used in the decompression pseudocode
46904+ * is not defined in the specification.
46905+ *
46906+ * The LZX document does not state the uncompressed block has an
46907+ * uncompressed length field. Where does this length field come from, so
46908+ * we can know how large the block is? The implementation has it as the 24
46909+ * bits following after the 3 blocktype bits, before the alignment
46910+ * padding.
46911+ *
46912+ * The LZX document states that aligned offset blocks have their aligned
46913+ * offset huffman tree AFTER the main and length trees. The implementation
46914+ * suggests that the aligned offset tree is BEFORE the main and length
46915+ * trees.
46916+ *
46917+ * The LZX document decoding algorithm states that, in an aligned offset
46918+ * block, if an extra_bits value is 1, 2 or 3, then that number of bits
46919+ * should be read and the result added to the match offset. This is
46920+ * correct for 1 and 2, but not 3, where just a huffman symbol (using the
46921+ * aligned tree) should be read.
46922+ *
46923+ * Regarding the E8 preprocessing, the LZX document states 'No translation
46924+ * may be performed on the last 6 bytes of the input block'. This is
46925+ * correct. However, the pseudocode provided checks for the *E8 leader*
46926+ * up to the last 6 bytes. If the leader appears between -10 and -7 bytes
46927+ * from the end, this would cause the next four bytes to be modified, at
46928+ * least one of which would be in the last 6 bytes, which is not allowed
46929+ * according to the spec.
46930+ *
46931+ * The specification states that the huffman trees must always contain at
46932+ * least one element. However, many CAB files contain blocks where the
46933+ * length tree is completely empty (because there are no matches), and
46934+ * this is expected to succeed.
46935+ *
46936+ * The errors in LZX documentation appear have been corrected in the
46937+ * new documentation for the LZX DELTA format.
46938+ *
46939+ * http://msdn.microsoft.com/en-us/library/cc483133.aspx
46940+ *
46941+ * However, this is a different format, an extension of regular LZX.
46942+ * I have noticed the following differences, there may be more:
46943+ *
46944+ * The maximum window size has increased from 2MB to 32MB. This also
46945+ * increases the maximum number of position slots, etc.
46946+ *
46947+ * If the match length is 257 (the maximum possible), this signals
46948+ * a further length decoding step, that allows for matches up to
46949+ * 33024 bytes long.
46950+ *
46951+ * The format now allows for "reference data", supplied by the caller.
46952+ * If match offsets go further back than the number of bytes
46953+ * decompressed so far, that is them accessing the reference data.
46954+ */
46955+
46956+/* import bit-reading macros and code */
46957+#define BITS_TYPE struct lzxd_stream
46958+#define BITS_VAR lzx
46959+#define BITS_ORDER_MSB
46960+#define READ_BYTES do { \
46961+ unsigned char b0, b1; \
46962+ READ_IF_NEEDED; b0 = *i_ptr++; \
46963+ READ_IF_NEEDED; b1 = *i_ptr++; \
46964+ INJECT_BITS((b1 << 8) | b0, 16); \
46965+} while (0)
46966+#include <readbits.h>
46967+
46968+/* import huffman-reading macros and code */
46969+#define TABLEBITS(tbl) LZX_##tbl##_TABLEBITS
46970+#define MAXSYMBOLS(tbl) LZX_##tbl##_MAXSYMBOLS
46971+#define HUFF_TABLE(tbl,idx) lzx->tbl##_table[idx]
46972+#define HUFF_LEN(tbl,idx) lzx->tbl##_len[idx]
46973+#define HUFF_ERROR return lzx->error = MSPACK_ERR_DECRUNCH
46974+#include <readhuff.h>
46975+
46976+/* BUILD_TABLE(tbl) builds a huffman lookup table from code lengths */
46977+#define BUILD_TABLE(tbl) \
46978+ if (make_decode_table(MAXSYMBOLS(tbl), TABLEBITS(tbl), \
46979+ &HUFF_LEN(tbl,0), &HUFF_TABLE(tbl,0))) \
46980+ { \
46981+ D(("failed to build %s table", #tbl)) \
46982+ return lzx->error = MSPACK_ERR_DECRUNCH; \
46983+ }
46984+
46985+#define BUILD_TABLE_MAYBE_EMPTY(tbl) do { \
46986+ lzx->tbl##_empty = 0; \
46987+ if (make_decode_table(MAXSYMBOLS(tbl), TABLEBITS(tbl), \
46988+ &HUFF_LEN(tbl,0), &HUFF_TABLE(tbl,0))) \
46989+ { \
46990+ for (i = 0; i < MAXSYMBOLS(tbl); i++) { \
46991+ if (HUFF_LEN(tbl, i) > 0) { \
46992+ D(("failed to build %s table", #tbl)) \
46993+ return lzx->error = MSPACK_ERR_DECRUNCH; \
46994+ } \
46995+ } \
46996+ /* empty tree - allow it, but don't decode symbols with it */ \
46997+ lzx->tbl##_empty = 1; \
46998+ } \
46999+} while (0)
47000+
47001+/* READ_LENGTHS(tablename, first, last) reads in code lengths for symbols
47002+ * first to last in the given table. The code lengths are stored in their
47003+ * own special LZX way.
47004+ */
47005+#define READ_LENGTHS(tbl, first, last) do { \
47006+ STORE_BITS; \
47007+ if (lzxd_read_lens(lzx, &HUFF_LEN(tbl, 0), (first), \
47008+ (unsigned int)(last))) return lzx->error; \
47009+ RESTORE_BITS; \
47010+} while (0)
47011+
47012+static int lzxd_read_lens(struct lzxd_stream *lzx, unsigned char *lens,
47013+ unsigned int first, unsigned int last)
47014+{
47015+ /* bit buffer and huffman symbol decode variables */
47016+ register unsigned int bit_buffer;
47017+ register int bits_left, i;
47018+ register unsigned short sym;
47019+ unsigned char *i_ptr, *i_end;
47020+
47021+ unsigned int x, y;
47022+ int z;
47023+
47024+ RESTORE_BITS;
47025+
47026+ /* read lengths for pretree (20 symbols, lengths stored in fixed 4 bits) */
47027+ for (x = 0; x < 20; x++) {
47028+ READ_BITS(y, 4);
47029+ lzx->PRETREE_len[x] = y;
47030+ }
47031+ BUILD_TABLE(PRETREE);
47032+
47033+ for (x = first; x < last; ) {
47034+ READ_HUFFSYM(PRETREE, z);
47035+ if (z == 17) {
47036+ /* code = 17, run of ([read 4 bits]+4) zeros */
47037+ READ_BITS(y, 4); y += 4;
47038+ while (y--) lens[x++] = 0;
47039+ }
47040+ else if (z == 18) {
47041+ /* code = 18, run of ([read 5 bits]+20) zeros */
47042+ READ_BITS(y, 5); y += 20;
47043+ while (y--) lens[x++] = 0;
47044+ }
47045+ else if (z == 19) {
47046+ /* code = 19, run of ([read 1 bit]+4) [read huffman symbol] */
47047+ READ_BITS(y, 1); y += 4;
47048+ READ_HUFFSYM(PRETREE, z);
47049+ z = lens[x] - z; if (z < 0) z += 17;
47050+ while (y--) lens[x++] = z;
47051+ }
47052+ else {
47053+ /* code = 0 to 16, delta current length entry */
47054+ z = lens[x] - z; if (z < 0) z += 17;
47055+ lens[x++] = z;
47056+ }
47057+ }
47058+
47059+ STORE_BITS;
47060+
47061+ return MSPACK_ERR_OK;
47062+}
47063+
47064+/* LZX static data tables:
47065+ *
47066+ * LZX uses 'position slots' to represent match offsets. For every match,
47067+ * a small 'position slot' number and a small offset from that slot are
47068+ * encoded instead of one large offset.
47069+ *
47070+ * The number of slots is decided by how many are needed to encode the
47071+ * largest offset for a given window size. This is easy when the gap between
47072+ * slots is less than 128Kb, it's a linear relationship. But when extra_bits
47073+ * reaches its limit of 17 (because LZX can only ensure reading 17 bits of
47074+ * data at a time), we can only jump 128Kb at a time and have to start
47075+ * using more and more position slots as each window size doubles.
47076+ *
47077+ * position_base[] is an index to the position slot bases
47078+ *
47079+ * extra_bits[] states how many bits of offset-from-base data is needed.
47080+ *
47081+ * They are calculated as follows:
47082+ * extra_bits[i] = 0 where i < 4
47083+ * extra_bits[i] = floor(i/2)-1 where i >= 4 && i < 36
47084+ * extra_bits[i] = 17 where i >= 36
47085+ * position_base[0] = 0
47086+ * position_base[i] = position_base[i-1] + (1 << extra_bits[i-1])
47087+ */
47088+static const unsigned int position_slots[11] = {
47089+ 30, 32, 34, 36, 38, 42, 50, 66, 98, 162, 290
47090+};
47091+static const unsigned char extra_bits[36] = {
47092+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
47093+ 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16
47094+};
47095+static const unsigned int position_base[290] = {
47096+ 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512,
47097+ 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768,
47098+ 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 655360,
47099+ 786432, 917504, 1048576, 1179648, 1310720, 1441792, 1572864, 1703936,
47100+ 1835008, 1966080, 2097152, 2228224, 2359296, 2490368, 2621440, 2752512,
47101+ 2883584, 3014656, 3145728, 3276800, 3407872, 3538944, 3670016, 3801088,
47102+ 3932160, 4063232, 4194304, 4325376, 4456448, 4587520, 4718592, 4849664,
47103+ 4980736, 5111808, 5242880, 5373952, 5505024, 5636096, 5767168, 5898240,
47104+ 6029312, 6160384, 6291456, 6422528, 6553600, 6684672, 6815744, 6946816,
47105+ 7077888, 7208960, 7340032, 7471104, 7602176, 7733248, 7864320, 7995392,
47106+ 8126464, 8257536, 8388608, 8519680, 8650752, 8781824, 8912896, 9043968,
47107+ 9175040, 9306112, 9437184, 9568256, 9699328, 9830400, 9961472, 10092544,
47108+ 10223616, 10354688, 10485760, 10616832, 10747904, 10878976, 11010048,
47109+ 11141120, 11272192, 11403264, 11534336, 11665408, 11796480, 11927552,
47110+ 12058624, 12189696, 12320768, 12451840, 12582912, 12713984, 12845056,
47111+ 12976128, 13107200, 13238272, 13369344, 13500416, 13631488, 13762560,
47112+ 13893632, 14024704, 14155776, 14286848, 14417920, 14548992, 14680064,
47113+ 14811136, 14942208, 15073280, 15204352, 15335424, 15466496, 15597568,
47114+ 15728640, 15859712, 15990784, 16121856, 16252928, 16384000, 16515072,
47115+ 16646144, 16777216, 16908288, 17039360, 17170432, 17301504, 17432576,
47116+ 17563648, 17694720, 17825792, 17956864, 18087936, 18219008, 18350080,
47117+ 18481152, 18612224, 18743296, 18874368, 19005440, 19136512, 19267584,
47118+ 19398656, 19529728, 19660800, 19791872, 19922944, 20054016, 20185088,
47119+ 20316160, 20447232, 20578304, 20709376, 20840448, 20971520, 21102592,
47120+ 21233664, 21364736, 21495808, 21626880, 21757952, 21889024, 22020096,
47121+ 22151168, 22282240, 22413312, 22544384, 22675456, 22806528, 22937600,
47122+ 23068672, 23199744, 23330816, 23461888, 23592960, 23724032, 23855104,
47123+ 23986176, 24117248, 24248320, 24379392, 24510464, 24641536, 24772608,
47124+ 24903680, 25034752, 25165824, 25296896, 25427968, 25559040, 25690112,
47125+ 25821184, 25952256, 26083328, 26214400, 26345472, 26476544, 26607616,
47126+ 26738688, 26869760, 27000832, 27131904, 27262976, 27394048, 27525120,
47127+ 27656192, 27787264, 27918336, 28049408, 28180480, 28311552, 28442624,
47128+ 28573696, 28704768, 28835840, 28966912, 29097984, 29229056, 29360128,
47129+ 29491200, 29622272, 29753344, 29884416, 30015488, 30146560, 30277632,
47130+ 30408704, 30539776, 30670848, 30801920, 30932992, 31064064, 31195136,
47131+ 31326208, 31457280, 31588352, 31719424, 31850496, 31981568, 32112640,
47132+ 32243712, 32374784, 32505856, 32636928, 32768000, 32899072, 33030144,
47133+ 33161216, 33292288, 33423360
47134+};
47135+
47136+static void lzxd_reset_state(struct lzxd_stream *lzx) {
47137+ int i;
47138+
47139+ lzx->R0 = 1;
47140+ lzx->R1 = 1;
47141+ lzx->R2 = 1;
47142+ lzx->header_read = 0;
47143+ lzx->block_remaining = 0;
47144+ lzx->block_type = LZX_BLOCKTYPE_INVALID;
47145+
47146+ /* initialise tables to 0 (because deltas will be applied to them) */
47147+ for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS; i++) lzx->MAINTREE_len[i] = 0;
47148+ for (i = 0; i < LZX_LENGTH_MAXSYMBOLS; i++) lzx->LENGTH_len[i] = 0;
47149+}
47150+
47151+/*-------- main LZX code --------*/
47152+
47153+struct lzxd_stream *lzxd_init(struct mspack_system *system,
47154+ struct mspack_file *input,
47155+ struct mspack_file *output,
47156+ int window_bits,
47157+ int reset_interval,
47158+ int input_buffer_size,
47159+ off_t output_length,
47160+ char is_delta)
47161+{
47162+ unsigned int window_size = 1 << window_bits;
47163+ struct lzxd_stream *lzx;
47164+
47165+ if (!system) return NULL;
47166+
47167+ /* LZX DELTA window sizes are between 2^17 (128KiB) and 2^25 (32MiB),
47168+ * regular LZX windows are between 2^15 (32KiB) and 2^21 (2MiB)
47169+ */
47170+ if (is_delta) {
47171+ if (window_bits < 17 || window_bits > 25) return NULL;
47172+ }
47173+ else {
47174+ if (window_bits < 15 || window_bits > 21) return NULL;
47175+ }
47176+
47177+ input_buffer_size = (input_buffer_size + 1) & -2;
47178+ if (!input_buffer_size) return NULL;
47179+
47180+ /* allocate decompression state */
47181+ if (!(lzx = (struct lzxd_stream *) system->alloc(system, sizeof(struct lzxd_stream)))) {
47182+ return NULL;
47183+ }
47184+
47185+ /* allocate decompression window and input buffer */
47186+ lzx->window = (unsigned char *) system->alloc(system, (size_t) window_size);
47187+ lzx->inbuf = (unsigned char *) system->alloc(system, (size_t) input_buffer_size);
47188+ if (!lzx->window || !lzx->inbuf) {
47189+ system->free(lzx->window);
47190+ system->free(lzx->inbuf);
47191+ system->free(lzx);
47192+ return NULL;
47193+ }
47194+
47195+ /* initialise decompression state */
47196+ lzx->sys = system;
47197+ lzx->input = input;
47198+ lzx->output = output;
47199+ lzx->offset = 0;
47200+ lzx->length = output_length;
47201+
47202+ lzx->inbuf_size = input_buffer_size;
47203+ lzx->window_size = 1 << window_bits;
47204+ lzx->ref_data_size = 0;
47205+ lzx->window_posn = 0;
47206+ lzx->frame_posn = 0;
47207+ lzx->frame = 0;
47208+ lzx->reset_interval = reset_interval;
47209+ lzx->intel_filesize = 0;
47210+ lzx->intel_curpos = 0;
47211+ lzx->intel_started = 0;
47212+ lzx->error = MSPACK_ERR_OK;
47213+ lzx->num_offsets = position_slots[window_bits - 15] << 3;
47214+ lzx->is_delta = is_delta;
47215+
47216+ lzx->o_ptr = lzx->o_end = &lzx->e8_buf[0];
47217+ lzxd_reset_state(lzx);
47218+ INIT_BITS;
47219+ return lzx;
47220+}
47221+
47222+int lzxd_set_reference_data(struct lzxd_stream *lzx,
47223+ struct mspack_system *system,
47224+ struct mspack_file *input,
47225+ unsigned int length)
47226+{
47227+ if (!lzx) return MSPACK_ERR_ARGS;
47228+
47229+ if (!lzx->is_delta) {
47230+ D(("only LZX DELTA streams support reference data"))
47231+ return MSPACK_ERR_ARGS;
47232+ }
47233+ if (lzx->offset) {
47234+ D(("too late to set reference data after decoding starts"))
47235+ return MSPACK_ERR_ARGS;
47236+ }
47237+ if (length > lzx->window_size) {
47238+ D(("reference length (%u) is longer than the window", length))
47239+ return MSPACK_ERR_ARGS;
47240+ }
47241+ if (length > 0 && (!system || !input)) {
47242+ D(("length > 0 but no system or input"))
47243+ return MSPACK_ERR_ARGS;
47244+ }
47245+
47246+ lzx->ref_data_size = length;
47247+ if (length > 0) {
47248+ /* copy reference data */
47249+ unsigned char *pos = &lzx->window[lzx->window_size - length];
47250+ int bytes = system->read(input, pos, length);
47251+ /* length can't be more than 2^25, so no signedness problem */
47252+ if (bytes < (int)length) return MSPACK_ERR_READ;
47253+ }
47254+ lzx->ref_data_size = length;
47255+ return MSPACK_ERR_OK;
47256+}
47257+
47258+void lzxd_set_output_length(struct lzxd_stream *lzx, off_t out_bytes) {
47259+ if (lzx) lzx->length = out_bytes;
47260+}
47261+
47262+int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) {
47263+ /* bitstream and huffman reading variables */
47264+ register unsigned int bit_buffer;
47265+ register int bits_left, i=0;
47266+ unsigned char *i_ptr, *i_end;
47267+ register unsigned short sym;
47268+
47269+ int match_length, length_footer, extra, verbatim_bits, bytes_todo;
47270+ int this_run, main_element, aligned_bits, j;
47271+ unsigned char *window, *runsrc, *rundest, buf[12];
47272+ unsigned int frame_size=0, end_frame, match_offset, window_posn;
47273+ unsigned int R0, R1, R2;
47274+
47275+ /* easy answers */
47276+ if (!lzx || (out_bytes < 0)) return MSPACK_ERR_ARGS;
47277+ if (lzx->error) return lzx->error;
47278+
47279+ /* flush out any stored-up bytes before we begin */
47280+ i = lzx->o_end - lzx->o_ptr;
47281+ if ((off_t) i > out_bytes) i = (int) out_bytes;
47282+ if (i) {
47283+ if (lzx->sys->write(lzx->output, lzx->o_ptr, i) != i) {
47284+ return lzx->error = MSPACK_ERR_WRITE;
47285+ }
47286+ lzx->o_ptr += i;
47287+ lzx->offset += i;
47288+ out_bytes -= i;
47289+ }
47290+ if (out_bytes == 0) return MSPACK_ERR_OK;
47291+
47292+ /* restore local state */
47293+ RESTORE_BITS;
47294+ window = lzx->window;
47295+ window_posn = lzx->window_posn;
47296+ R0 = lzx->R0;
47297+ R1 = lzx->R1;
47298+ R2 = lzx->R2;
47299+
47300+ end_frame = (unsigned int)((lzx->offset + out_bytes) / LZX_FRAME_SIZE) + 1;
47301+
47302+ while (lzx->frame < end_frame) {
47303+ /* have we reached the reset interval? (if there is one?) */
47304+ if (lzx->reset_interval && ((lzx->frame % lzx->reset_interval) == 0)) {
47305+ if (lzx->block_remaining) {
47306+ D(("%d bytes remaining at reset interval", lzx->block_remaining))
47307+ return lzx->error = MSPACK_ERR_DECRUNCH;
47308+ }
47309+
47310+ /* re-read the intel header and reset the huffman lengths */
47311+ lzxd_reset_state(lzx);
47312+ R0 = lzx->R0;
47313+ R1 = lzx->R1;
47314+ R2 = lzx->R2;
47315+ }
47316+
47317+ /* LZX DELTA format has chunk_size, not present in LZX format */
47318+ if (lzx->is_delta) {
47319+ ENSURE_BITS(16);
47320+ REMOVE_BITS(16);
47321+ }
47322+
47323+ /* read header if necessary */
47324+ if (!lzx->header_read) {
47325+ /* read 1 bit. if bit=0, intel filesize = 0.
47326+ * if bit=1, read intel filesize (32 bits) */
47327+ j = 0; READ_BITS(i, 1); if (i) { READ_BITS(i, 16); READ_BITS(j, 16); }
47328+ lzx->intel_filesize = (i << 16) | j;
47329+ lzx->header_read = 1;
47330+ }
47331+
47332+ /* calculate size of frame: all frames are 32k except the final frame
47333+ * which is 32kb or less. this can only be calculated when lzx->length
47334+ * has been filled in. */
47335+ frame_size = LZX_FRAME_SIZE;
47336+ if (lzx->length && (lzx->length - lzx->offset) < (off_t)frame_size) {
47337+ frame_size = lzx->length - lzx->offset;
47338+ }
47339+
47340+ /* decode until one more frame is available */
47341+ bytes_todo = lzx->frame_posn + frame_size - window_posn;
47342+ while (bytes_todo > 0) {
47343+ /* initialise new block, if one is needed */
47344+ if (lzx->block_remaining == 0) {
47345+ /* realign if previous block was an odd-sized UNCOMPRESSED block */
47346+ if ((lzx->block_type == LZX_BLOCKTYPE_UNCOMPRESSED) &&
47347+ (lzx->block_length & 1))
47348+ {
47349+ READ_IF_NEEDED;
47350+ i_ptr++;
47351+ }
47352+
47353+ /* read block type (3 bits) and block length (24 bits) */
47354+ READ_BITS(lzx->block_type, 3);
47355+ READ_BITS(i, 16); READ_BITS(j, 8);
47356+ lzx->block_remaining = lzx->block_length = (i << 8) | j;
47357+ /*D(("new block t%d len %u", lzx->block_type, lzx->block_length))*/
47358+
47359+ /* read individual block headers */
47360+ switch (lzx->block_type) {
47361+ case LZX_BLOCKTYPE_ALIGNED:
47362+ /* read lengths of and build aligned huffman decoding tree */
47363+ for (i = 0; i < 8; i++) { READ_BITS(j, 3); lzx->ALIGNED_len[i] = j; }
47364+ BUILD_TABLE(ALIGNED);
47365+ /* no break -- rest of aligned header is same as verbatim */
47366+ case LZX_BLOCKTYPE_VERBATIM:
47367+ /* read lengths of and build main huffman decoding tree */
47368+ READ_LENGTHS(MAINTREE, 0, 256);
47369+ READ_LENGTHS(MAINTREE, 256, LZX_NUM_CHARS + lzx->num_offsets);
47370+ BUILD_TABLE(MAINTREE);
47371+ /* if the literal 0xE8 is anywhere in the block... */
47372+ if (lzx->MAINTREE_len[0xE8] != 0) lzx->intel_started = 1;
47373+ /* read lengths of and build lengths huffman decoding tree */
47374+ READ_LENGTHS(LENGTH, 0, LZX_NUM_SECONDARY_LENGTHS);
47375+ BUILD_TABLE_MAYBE_EMPTY(LENGTH);
47376+ break;
47377+
47378+ case LZX_BLOCKTYPE_UNCOMPRESSED:
47379+ /* because we can't assume otherwise */
47380+ lzx->intel_started = 1;
47381+
47382+ /* read 1-16 (not 0-15) bits to align to bytes */
47383+ ENSURE_BITS(16);
47384+ if (bits_left > 16) i_ptr -= 2;
47385+ bits_left = 0; bit_buffer = 0;
47386+
47387+ /* read 12 bytes of stored R0 / R1 / R2 values */
47388+ for (rundest = &buf[0], i = 0; i < 12; i++) {
47389+ READ_IF_NEEDED;
47390+ *rundest++ = *i_ptr++;
47391+ }
47392+ R0 = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
47393+ R1 = buf[4] | (buf[5] << 8) | (buf[6] << 16) | (buf[7] << 24);
47394+ R2 = buf[8] | (buf[9] << 8) | (buf[10] << 16) | (buf[11] << 24);
47395+ break;
47396+
47397+ default:
47398+ D(("bad block type"))
47399+ return lzx->error = MSPACK_ERR_DECRUNCH;
47400+ }
47401+ }
47402+
47403+ /* decode more of the block:
47404+ * run = min(what's available, what's needed) */
47405+ this_run = lzx->block_remaining;
47406+ if (this_run > bytes_todo) this_run = bytes_todo;
47407+
47408+ /* assume we decode exactly this_run bytes, for now */
47409+ bytes_todo -= this_run;
47410+ lzx->block_remaining -= this_run;
47411+
47412+ /* decode at least this_run bytes */
47413+ switch (lzx->block_type) {
47414+ case LZX_BLOCKTYPE_VERBATIM:
47415+ while (this_run > 0) {
47416+ READ_HUFFSYM(MAINTREE, main_element);
47417+ if (main_element < LZX_NUM_CHARS) {
47418+ /* literal: 0 to LZX_NUM_CHARS-1 */
47419+ window[window_posn++] = main_element;
47420+ this_run--;
47421+ }
47422+ else {
47423+ /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */
47424+ main_element -= LZX_NUM_CHARS;
47425+
47426+ /* get match length */
47427+ match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;
47428+ if (match_length == LZX_NUM_PRIMARY_LENGTHS) {
47429+ if (lzx->LENGTH_empty) {
47430+ D(("LENGTH symbol needed but tree is empty"))
47431+ return lzx->error = MSPACK_ERR_DECRUNCH;
47432+ }
47433+ READ_HUFFSYM(LENGTH, length_footer);
47434+ match_length += length_footer;
47435+ }
47436+ match_length += LZX_MIN_MATCH;
47437+
47438+ /* get match offset */
47439+ switch ((match_offset = (main_element >> 3))) {
47440+ case 0: match_offset = R0; break;
47441+ case 1: match_offset = R1; R1=R0; R0 = match_offset; break;
47442+ case 2: match_offset = R2; R2=R0; R0 = match_offset; break;
47443+ case 3: match_offset = 1; R2=R1; R1=R0; R0 = match_offset; break;
47444+ default:
47445+ extra = (match_offset >= 36) ? 17 : extra_bits[match_offset];
47446+ READ_BITS(verbatim_bits, extra);
47447+ match_offset = position_base[match_offset] - 2 + verbatim_bits;
47448+ R2 = R1; R1 = R0; R0 = match_offset;
47449+ }
47450+
47451+ /* LZX DELTA uses max match length to signal even longer match */
47452+ if (match_length == LZX_MAX_MATCH && lzx->is_delta) {
47453+ int extra_len = 0;
47454+ ENSURE_BITS(3); /* 4 entry huffman tree */
47455+ if (PEEK_BITS(1) == 0) {
47456+ REMOVE_BITS(1); /* '0' -> 8 extra length bits */
47457+ READ_BITS(extra_len, 8);
47458+ }
47459+ else if (PEEK_BITS(2) == 2) {
47460+ REMOVE_BITS(2); /* '10' -> 10 extra length bits + 0x100 */
47461+ READ_BITS(extra_len, 10);
47462+ extra_len += 0x100;
47463+ }
47464+ else if (PEEK_BITS(3) == 6) {
47465+ REMOVE_BITS(3); /* '110' -> 12 extra length bits + 0x500 */
47466+ READ_BITS(extra_len, 12);
47467+ extra_len += 0x500;
47468+ }
47469+ else {
47470+ REMOVE_BITS(3); /* '111' -> 15 extra length bits */
47471+ READ_BITS(extra_len, 15);
47472+ }
47473+ match_length += extra_len;
47474+ }
47475+
47476+ if ((window_posn + match_length) > lzx->window_size) {
47477+ D(("match ran over window wrap"))
47478+ return lzx->error = MSPACK_ERR_DECRUNCH;
47479+ }
47480+
47481+ /* copy match */
47482+ rundest = &window[window_posn];
47483+ i = match_length;
47484+ /* does match offset wrap the window? */
47485+ if (match_offset > window_posn) {
47486+ if (match_offset > lzx->offset &&
47487+ (match_offset - window_posn) > lzx->ref_data_size)
47488+ {
47489+ D(("match offset beyond LZX stream"))
47490+ return lzx->error = MSPACK_ERR_DECRUNCH;
47491+ }
47492+ /* j = length from match offset to end of window */
47493+ j = match_offset - window_posn;
47494+ if (j > (int) lzx->window_size) {
47495+ D(("match offset beyond window boundaries"))
47496+ return lzx->error = MSPACK_ERR_DECRUNCH;
47497+ }
47498+ runsrc = &window[lzx->window_size - j];
47499+ if (j < i) {
47500+ /* if match goes over the window edge, do two copy runs */
47501+ i -= j; while (j-- > 0) *rundest++ = *runsrc++;
47502+ runsrc = window;
47503+ }
47504+ while (i-- > 0) *rundest++ = *runsrc++;
47505+ }
47506+ else {
47507+ runsrc = rundest - match_offset;
47508+ while (i-- > 0) *rundest++ = *runsrc++;
47509+ }
47510+
47511+ this_run -= match_length;
47512+ window_posn += match_length;
47513+ }
47514+ } /* while (this_run > 0) */
47515+ break;
47516+
47517+ case LZX_BLOCKTYPE_ALIGNED:
47518+ while (this_run > 0) {
47519+ READ_HUFFSYM(MAINTREE, main_element);
47520+ if (main_element < LZX_NUM_CHARS) {
47521+ /* literal: 0 to LZX_NUM_CHARS-1 */
47522+ window[window_posn++] = main_element;
47523+ this_run--;
47524+ }
47525+ else {
47526+ /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */
47527+ main_element -= LZX_NUM_CHARS;
47528+
47529+ /* get match length */
47530+ match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;
47531+ if (match_length == LZX_NUM_PRIMARY_LENGTHS) {
47532+ if (lzx->LENGTH_empty) {
47533+ D(("LENGTH symbol needed but tree is empty"))
47534+ return lzx->error = MSPACK_ERR_DECRUNCH;
47535+ }
47536+ READ_HUFFSYM(LENGTH, length_footer);
47537+ match_length += length_footer;
47538+ }
47539+ match_length += LZX_MIN_MATCH;
47540+
47541+ /* get match offset */
47542+ switch ((match_offset = (main_element >> 3))) {
47543+ case 0: match_offset = R0; break;
47544+ case 1: match_offset = R1; R1 = R0; R0 = match_offset; break;
47545+ case 2: match_offset = R2; R2 = R0; R0 = match_offset; break;
47546+ default:
47547+ extra = (match_offset >= 36) ? 17 : extra_bits[match_offset];
47548+ match_offset = position_base[match_offset] - 2;
47549+ if (extra > 3) {
47550+ /* verbatim and aligned bits */
47551+ extra -= 3;
47552+ READ_BITS(verbatim_bits, extra);
47553+ match_offset += (verbatim_bits << 3);
47554+ READ_HUFFSYM(ALIGNED, aligned_bits);
47555+ match_offset += aligned_bits;
47556+ }
47557+ else if (extra == 3) {
47558+ /* aligned bits only */
47559+ READ_HUFFSYM(ALIGNED, aligned_bits);
47560+ match_offset += aligned_bits;
47561+ }
47562+ else if (extra > 0) { /* extra==1, extra==2 */
47563+ /* verbatim bits only */
47564+ READ_BITS(verbatim_bits, extra);
47565+ match_offset += verbatim_bits;
47566+ }
47567+ else /* extra == 0 */ {
47568+ /* ??? not defined in LZX specification! */
47569+ match_offset = 1;
47570+ }
47571+ /* update repeated offset LRU queue */
47572+ R2 = R1; R1 = R0; R0 = match_offset;
47573+ }
47574+
47575+ /* LZX DELTA uses max match length to signal even longer match */
47576+ if (match_length == LZX_MAX_MATCH && lzx->is_delta) {
47577+ int extra_len = 0;
47578+ ENSURE_BITS(3); /* 4 entry huffman tree */
47579+ if (PEEK_BITS(1) == 0) {
47580+ REMOVE_BITS(1); /* '0' -> 8 extra length bits */
47581+ READ_BITS(extra_len, 8);
47582+ }
47583+ else if (PEEK_BITS(2) == 2) {
47584+ REMOVE_BITS(2); /* '10' -> 10 extra length bits + 0x100 */
47585+ READ_BITS(extra_len, 10);
47586+ extra_len += 0x100;
47587+ }
47588+ else if (PEEK_BITS(3) == 6) {
47589+ REMOVE_BITS(3); /* '110' -> 12 extra length bits + 0x500 */
47590+ READ_BITS(extra_len, 12);
47591+ extra_len += 0x500;
47592+ }
47593+ else {
47594+ REMOVE_BITS(3); /* '111' -> 15 extra length bits */
47595+ READ_BITS(extra_len, 15);
47596+ }
47597+ match_length += extra_len;
47598+ }
47599+
47600+ if ((window_posn + match_length) > lzx->window_size) {
47601+ D(("match ran over window wrap"))
47602+ return lzx->error = MSPACK_ERR_DECRUNCH;
47603+ }
47604+
47605+ /* copy match */
47606+ rundest = &window[window_posn];
47607+ i = match_length;
47608+ /* does match offset wrap the window? */
47609+ if (match_offset > window_posn) {
47610+ if (match_offset > lzx->offset &&
47611+ (match_offset - window_posn) > lzx->ref_data_size)
47612+ {
47613+ D(("match offset beyond LZX stream"))
47614+ return lzx->error = MSPACK_ERR_DECRUNCH;
47615+ }
47616+ /* j = length from match offset to end of window */
47617+ j = match_offset - window_posn;
47618+ if (j > (int) lzx->window_size) {
47619+ D(("match offset beyond window boundaries"))
47620+ return lzx->error = MSPACK_ERR_DECRUNCH;
47621+ }
47622+ runsrc = &window[lzx->window_size - j];
47623+ if (j < i) {
47624+ /* if match goes over the window edge, do two copy runs */
47625+ i -= j; while (j-- > 0) *rundest++ = *runsrc++;
47626+ runsrc = window;
47627+ }
47628+ while (i-- > 0) *rundest++ = *runsrc++;
47629+ }
47630+ else {
47631+ runsrc = rundest - match_offset;
47632+ while (i-- > 0) *rundest++ = *runsrc++;
47633+ }
47634+
47635+ this_run -= match_length;
47636+ window_posn += match_length;
47637+ }
47638+ } /* while (this_run > 0) */
47639+ break;
47640+
47641+ case LZX_BLOCKTYPE_UNCOMPRESSED:
47642+ /* as this_run is limited not to wrap a frame, this also means it
47643+ * won't wrap the window (as the window is a multiple of 32k) */
47644+ rundest = &window[window_posn];
47645+ window_posn += this_run;
47646+ while (this_run > 0) {
47647+ if ((i = i_end - i_ptr) == 0) {
47648+ READ_IF_NEEDED;
47649+ }
47650+ else {
47651+ if (i > this_run) i = this_run;
47652+ lzx->sys->copy(i_ptr, rundest, (size_t) i);
47653+ rundest += i;
47654+ i_ptr += i;
47655+ this_run -= i;
47656+ }
47657+ }
47658+ break;
47659+
47660+ default:
47661+ return lzx->error = MSPACK_ERR_DECRUNCH; /* might as well */
47662+ }
47663+
47664+ /* did the final match overrun our desired this_run length? */
47665+ if (this_run < 0) {
47666+ if ((unsigned int)(-this_run) > lzx->block_remaining) {
47667+ D(("overrun went past end of block by %d (%d remaining)",
47668+ -this_run, lzx->block_remaining ))
47669+ return lzx->error = MSPACK_ERR_DECRUNCH;
47670+ }
47671+ lzx->block_remaining -= -this_run;
47672+ }
47673+ } /* while (bytes_todo > 0) */
47674+
47675+ /* streams don't extend over frame boundaries */
47676+ if ((window_posn - lzx->frame_posn) != frame_size) {
47677+ D(("decode beyond output frame limits! %d != %d",
47678+ window_posn - lzx->frame_posn, frame_size))
47679+ return lzx->error = MSPACK_ERR_DECRUNCH;
47680+ }
47681+
47682+ /* re-align input bitstream */
47683+ if (bits_left > 0) ENSURE_BITS(16);
47684+ if (bits_left & 15) REMOVE_BITS(bits_left & 15);
47685+
47686+ /* check that we've used all of the previous frame first */
47687+ if (lzx->o_ptr != lzx->o_end) {
47688+ D(("%ld avail bytes, new %d frame", lzx->o_end-lzx->o_ptr, frame_size))
47689+ return lzx->error = MSPACK_ERR_DECRUNCH;
47690+ }
47691+
47692+ /* does this intel block _really_ need decoding? */
47693+ if (lzx->intel_started && lzx->intel_filesize &&
47694+ (lzx->frame <= 32768) && (frame_size > 10))
47695+ {
47696+ unsigned char *data = &lzx->e8_buf[0];
47697+ unsigned char *dataend = &lzx->e8_buf[frame_size - 10];
47698+ signed int curpos = lzx->intel_curpos;
47699+ signed int filesize = lzx->intel_filesize;
47700+ signed int abs_off, rel_off;
47701+
47702+ /* copy e8 block to the e8 buffer and tweak if needed */
47703+ lzx->o_ptr = data;
47704+ lzx->sys->copy(&lzx->window[lzx->frame_posn], data, frame_size);
47705+
47706+ while (data < dataend) {
47707+ if (*data++ != 0xE8) { curpos++; continue; }
47708+ abs_off = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24);
47709+ if ((abs_off >= -curpos) && (abs_off < filesize)) {
47710+ rel_off = (abs_off >= 0) ? abs_off - curpos : abs_off + filesize;
47711+ data[0] = (unsigned char) rel_off;
47712+ data[1] = (unsigned char) (rel_off >> 8);
47713+ data[2] = (unsigned char) (rel_off >> 16);
47714+ data[3] = (unsigned char) (rel_off >> 24);
47715+ }
47716+ data += 4;
47717+ curpos += 5;
47718+ }
47719+ lzx->intel_curpos += frame_size;
47720+ }
47721+ else {
47722+ lzx->o_ptr = &lzx->window[lzx->frame_posn];
47723+ if (lzx->intel_filesize) lzx->intel_curpos += frame_size;
47724+ }
47725+ lzx->o_end = &lzx->o_ptr[frame_size];
47726+
47727+ /* write a frame */
47728+ i = (out_bytes < (off_t)frame_size) ? (unsigned int)out_bytes : frame_size;
47729+ if (lzx->sys->write(lzx->output, lzx->o_ptr, i) != i) {
47730+ return lzx->error = MSPACK_ERR_WRITE;
47731+ }
47732+ lzx->o_ptr += i;
47733+ lzx->offset += i;
47734+ out_bytes -= i;
47735+
47736+ /* advance frame start position */
47737+ lzx->frame_posn += frame_size;
47738+ lzx->frame++;
47739+
47740+ /* wrap window / frame position pointers */
47741+ if (window_posn == lzx->window_size) window_posn = 0;
47742+ if (lzx->frame_posn == lzx->window_size) lzx->frame_posn = 0;
47743+
47744+ } /* while (lzx->frame < end_frame) */
47745+
47746+ if (out_bytes) {
47747+ D(("bytes left to output"))
47748+ return lzx->error = MSPACK_ERR_DECRUNCH;
47749+ }
47750+
47751+ /* store local state */
47752+ STORE_BITS;
47753+ lzx->window_posn = window_posn;
47754+ lzx->R0 = R0;
47755+ lzx->R1 = R1;
47756+ lzx->R2 = R2;
47757+
47758+ return MSPACK_ERR_OK;
47759+}
47760+
47761+void lzxd_free(struct lzxd_stream *lzx) {
47762+ struct mspack_system *sys;
47763+ if (lzx) {
47764+ sys = lzx->sys;
47765+ sys->free(lzx->inbuf);
47766+ sys->free(lzx->window);
47767+ sys->free(lzx);
47768+ }
47769+}
47770diff --git a/libclamav/libmspack-0.4alpha/mspack/mspack.h b/libclamav/libmspack-0.4alpha/mspack/mspack.h
47771new file mode 100755
47772index 000000000000..9d05e23fec35
47773--- /dev/null
47774+++ b/libclamav/libmspack-0.4alpha/mspack/mspack.h
47775@@ -0,0 +1,2353 @@
47776+/* libmspack -- a library for working with Microsoft compression formats.
47777+ * (C) 2003-2013 Stuart Caie <kyzer@4u.net>
47778+ *
47779+ * libmspack is free software; you can redistribute it and/or modify it under
47780+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
47781+ *
47782+ * This program is distributed in the hope that it will be useful,
47783+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
47784+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47785+ * GNU Lesser General Public License for more details.
47786+ *
47787+ * You should have received a copy of the GNU Lesser General Public License
47788+ * along with this program; if not, write to the Free Software
47789+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
47790+ */
47791+
47792+/** \mainpage
47793+ *
47794+ * \section intro Introduction
47795+ *
47796+ * libmspack is a library which provides compressors and decompressors,
47797+ * archivers and dearchivers for Microsoft compression formats.
47798+ *
47799+ * \section formats Formats supported
47800+ *
47801+ * The following file formats are supported:
47802+ * - SZDD files, which use LZSS compression
47803+ * - KWAJ files, which use LZSS, LZSS+Huffman or deflate compression
47804+ * - .HLP (MS Help) files, which use LZSS compression
47805+ * - .CAB (MS Cabinet) files, which use deflate, LZX or Quantum compression
47806+ * - .CHM (HTML Help) files, which use LZX compression
47807+ * - .LIT (MS EBook) files, which use LZX compression and DES encryption
47808+ * - .LZX (Exchange Offline Addressbook) files, which use LZX compression
47809+ *
47810+ * To determine the capabilities of the library, and the binary
47811+ * compatibility version of any particular compressor or decompressor, use
47812+ * the mspack_version() function. The UNIX library interface version is
47813+ * defined as the highest-versioned library component.
47814+ *
47815+ * \section starting Getting started
47816+ *
47817+ * The macro MSPACK_SYS_SELFTEST() should be used to ensure the library can
47818+ * be used. In particular, it checks if the caller is using 32-bit file I/O
47819+ * when the library is compiled for 64-bit file I/O and vice versa.
47820+ *
47821+ * If compiled normally, the library includes basic file I/O and memory
47822+ * management functionality using the standard C library. This can be
47823+ * customised and replaced entirely by creating a mspack_system structure.
47824+ *
47825+ * A compressor or decompressor for the required format must be
47826+ * instantiated before it can be used. Each construction function takes
47827+ * one parameter, which is either a pointer to a custom mspack_system
47828+ * structure, or NULL to use the default. The instantiation returned, if
47829+ * not NULL, contains function pointers (methods) to work with the given
47830+ * file format.
47831+ *
47832+ * For compression:
47833+ * - mspack_create_cab_compressor() creates a mscab_compressor
47834+ * - mspack_create_chm_compressor() creates a mschm_compressor
47835+ * - mspack_create_lit_compressor() creates a mslit_compressor
47836+ * - mspack_create_hlp_compressor() creates a mshlp_compressor
47837+ * - mspack_create_szdd_compressor() creates a msszdd_compressor
47838+ * - mspack_create_kwaj_compressor() creates a mskwaj_compressor
47839+ * - mspack_create_oab_compressor() creates a msoab_compressor
47840+ *
47841+ * For decompression:
47842+ * - mspack_create_cab_decompressor() creates a mscab_decompressor
47843+ * - mspack_create_chm_decompressor() creates a mschm_decompressor
47844+ * - mspack_create_lit_decompressor() creates a mslit_decompressor
47845+ * - mspack_create_hlp_decompressor() creates a mshlp_decompressor
47846+ * - mspack_create_szdd_decompressor() creates a msszdd_decompressor
47847+ * - mspack_create_kwaj_decompressor() creates a mskwaj_decompressor
47848+ * - mspack_create_oab_decompressor() creates a msoab_decompressor
47849+ *
47850+ * Once finished working with a format, each kind of
47851+ * compressor/decompressor has its own specific destructor:
47852+ * - mspack_destroy_cab_compressor()
47853+ * - mspack_destroy_cab_decompressor()
47854+ * - mspack_destroy_chm_compressor()
47855+ * - mspack_destroy_chm_decompressor()
47856+ * - mspack_destroy_lit_compressor()
47857+ * - mspack_destroy_lit_decompressor()
47858+ * - mspack_destroy_hlp_compressor()
47859+ * - mspack_destroy_hlp_decompressor()
47860+ * - mspack_destroy_szdd_compressor()
47861+ * - mspack_destroy_szdd_decompressor()
47862+ * - mspack_destroy_kwaj_compressor()
47863+ * - mspack_destroy_kwaj_decompressor()
47864+ * - mspack_destroy_oab_compressor()
47865+ * - mspack_destroy_oab_decompressor()
47866+ *
47867+ * Destroying a compressor or decompressor does not destroy any objects,
47868+ * structures or handles that have been created using that compressor or
47869+ * decompressor. Ensure that everything created or opened is destroyed or
47870+ * closed before compressor/decompressor is itself destroyed.
47871+ *
47872+ * \section errors Error codes
47873+ *
47874+ * All compressors and decompressors use the same set of error codes. Most
47875+ * methods return an error code directly. For methods which do not
47876+ * return error codes directly, the error code can be obtained with the
47877+ * last_error() method.
47878+ *
47879+ * - #MSPACK_ERR_OK is used to indicate success. This error code is defined
47880+ * as zero, all other code are non-zero.
47881+ * - #MSPACK_ERR_ARGS indicates that a method was called with inappropriate
47882+ * arguments.
47883+ * - #MSPACK_ERR_OPEN indicates that mspack_system::open() failed.
47884+ * - #MSPACK_ERR_READ indicates that mspack_system::read() failed.
47885+ * - #MSPACK_ERR_WRITE indicates that mspack_system::write() failed.
47886+ * - #MSPACK_ERR_SEEK indicates that mspack_system::seek() failed.
47887+ * - #MSPACK_ERR_NOMEMORY indicates that mspack_system::alloc() failed.
47888+ * - #MSPACK_ERR_SIGNATURE indicates that the file being read does not
47889+ * have the correct "signature". It is probably not a valid file for
47890+ * whatever format is being read.
47891+ * - #MSPACK_ERR_DATAFORMAT indicates that the file being used or read
47892+ * is corrupt.
47893+ * - #MSPACK_ERR_CHECKSUM indicates that a data checksum has failed.
47894+ * - #MSPACK_ERR_CRUNCH indicates an error occured during compression.
47895+ * - #MSPACK_ERR_DECRUNCH indicates an error occured during decompression.
47896+ *
47897+ * \section threading Multi-threading
47898+ *
47899+ * libmspack methods are reentrant and multithreading-safe when each
47900+ * thread has its own compressor or decompressor.
47901+
47902+ * You should not call multiple methods simultaneously on a single
47903+ * compressor or decompressor instance.
47904+ *
47905+ * If this may happen, you can either use one compressor or
47906+ * decompressor per thread, or you can use your preferred lock,
47907+ * semaphore or mutex library to ensure no more than one method on a
47908+ * compressor/decompressor is called simultaneously. libmspack will
47909+ * not do this locking for you.
47910+ *
47911+ * Example of incorrect behaviour:
47912+ * - thread 1 calls mspack_create_cab_decompressor()
47913+ * - thread 1 calls open()
47914+ * - thread 1 calls extract() for one file
47915+ * - thread 2 simultaneously calls extract() for another file
47916+ *
47917+ * Correct behaviour:
47918+ * - thread 1 calls mspack_create_cab_decompressor()
47919+ * - thread 2 calls mspack_create_cab_decompressor()
47920+ * - thread 1 calls its own open() / extract()
47921+ * - thread 2 simultaneously calls its own open() / extract()
47922+ *
47923+ * Also correct behaviour:
47924+ * - thread 1 calls mspack_create_cab_decompressor()
47925+ * - thread 1 locks a mutex for with the decompressor before
47926+ * calling any methods on it, and unlocks the mutex after each
47927+ * method returns.
47928+ * - thread 1 can share the results of open() with thread 2, and both
47929+ * can call extract(), provided they both guard against simultaneous
47930+ * use of extract(), and any other methods, with the mutex
47931+ */
47932+
47933+#ifndef LIB_MSPACK_H
47934+#define LIB_MSPACK_H 1
47935+
47936+#ifdef __cplusplus
47937+extern "C" {
47938+#endif
47939+
47940+#include <sys/types.h>
47941+#include <stdlib.h>
47942+
47943+/**
47944+ * System self-test function, to ensure both library and calling program
47945+ * can use one another.
47946+ *
47947+ * A result of MSPACK_ERR_OK means the library and caller are
47948+ * compatible. Any other result indicates that the library and caller are
47949+ * not compatible and should not be used. In particular, a value of
47950+ * MSPACK_ERR_SEEK means the library and caller use different off_t
47951+ * datatypes.
47952+ *
47953+ * It should be used like so:
47954+ *
47955+ * @code
47956+ * int selftest_result;
47957+ * MSPACK_SYS_SELFTEST(selftest_result);
47958+ * if (selftest_result != MSPACK_ERR_OK) {
47959+ * fprintf(stderr, "incompatible with this build of libmspack\n");
47960+ * exit(0);
47961+ * }
47962+ * @endcode
47963+ *
47964+ * @param result an int variable to store the result of the self-test
47965+ */
47966+#define MSPACK_SYS_SELFTEST(result) do { \
47967+ (result) = mspack_sys_selftest_internal(sizeof(off_t)); \
47968+} while (0)
47969+
47970+/** Part of the MSPACK_SYS_SELFTEST() macro, must not be used directly. */
47971+extern int mspack_sys_selftest_internal(int);
47972+
47973+/**
47974+ * Enquire about the binary compatibility version of a specific interface in
47975+ * the library. Currently, the following interfaces are defined:
47976+ *
47977+ * - #MSPACK_VER_LIBRARY: the overall library
47978+ * - #MSPACK_VER_SYSTEM: the mspack_system interface
47979+ * - #MSPACK_VER_MSCABD: the mscab_decompressor interface
47980+ * - #MSPACK_VER_MSCABC: the mscab_compressor interface
47981+ * - #MSPACK_VER_MSCHMD: the mschm_decompressor interface
47982+ * - #MSPACK_VER_MSCHMC: the mschm_compressor interface
47983+ * - #MSPACK_VER_MSLITD: the mslit_decompressor interface
47984+ * - #MSPACK_VER_MSLITC: the mslit_compressor interface
47985+ * - #MSPACK_VER_MSHLPD: the mshlp_decompressor interface
47986+ * - #MSPACK_VER_MSHLPC: the mshlp_compressor interface
47987+ * - #MSPACK_VER_MSSZDDD: the msszdd_decompressor interface
47988+ * - #MSPACK_VER_MSSZDDC: the msszdd_compressor interface
47989+ * - #MSPACK_VER_MSKWAJD: the mskwaj_decompressor interface
47990+ * - #MSPACK_VER_MSKWAJC: the mskwaj_compressor interface
47991+ * - #MSPACK_VER_MSOABD: the msoab_decompressor interface
47992+ * - #MSPACK_VER_MSOABC: the msoab_compressor interface
47993+ *
47994+ * The result of the function should be interpreted as follows:
47995+ * - -1: this interface is completely unknown to the library
47996+ * - 0: this interface is known, but non-functioning
47997+ * - 1: this interface has all basic functionality
47998+ * - 2, 3, ...: this interface has additional functionality, clearly marked
47999+ * in the documentation as "version 2", "version 3" and so on.
48000+ *
48001+ * @param entity the interface to request current version of
48002+ * @return the version of the requested interface
48003+ */
48004+extern int mspack_version(int entity);
48005+
48006+/** Pass to mspack_version() to get the overall library version */
48007+#define MSPACK_VER_LIBRARY (0)
48008+/** Pass to mspack_version() to get the mspack_system version */
48009+#define MSPACK_VER_SYSTEM (1)
48010+/** Pass to mspack_version() to get the mscab_decompressor version */
48011+#define MSPACK_VER_MSCABD (2)
48012+/** Pass to mspack_version() to get the mscab_compressor version */
48013+#define MSPACK_VER_MSCABC (3)
48014+/** Pass to mspack_version() to get the mschm_decompressor version */
48015+#define MSPACK_VER_MSCHMD (4)
48016+/** Pass to mspack_version() to get the mschm_compressor version */
48017+#define MSPACK_VER_MSCHMC (5)
48018+/** Pass to mspack_version() to get the mslit_decompressor version */
48019+#define MSPACK_VER_MSLITD (6)
48020+/** Pass to mspack_version() to get the mslit_compressor version */
48021+#define MSPACK_VER_MSLITC (7)
48022+/** Pass to mspack_version() to get the mshlp_decompressor version */
48023+#define MSPACK_VER_MSHLPD (8)
48024+/** Pass to mspack_version() to get the mshlp_compressor version */
48025+#define MSPACK_VER_MSHLPC (9)
48026+/** Pass to mspack_version() to get the msszdd_decompressor version */
48027+#define MSPACK_VER_MSSZDDD (10)
48028+/** Pass to mspack_version() to get the msszdd_compressor version */
48029+#define MSPACK_VER_MSSZDDC (11)
48030+/** Pass to mspack_version() to get the mskwaj_decompressor version */
48031+#define MSPACK_VER_MSKWAJD (12)
48032+/** Pass to mspack_version() to get the mskwaj_compressor version */
48033+#define MSPACK_VER_MSKWAJC (13)
48034+/** Pass to mspack_version() to get the msoab_decompressor version */
48035+#define MSPACK_VER_MSOABD (14)
48036+/** Pass to mspack_version() to get the msoab_compressor version */
48037+#define MSPACK_VER_MSOABC (15)
48038+
48039+/* --- file I/O abstraction ------------------------------------------------ */
48040+
48041+/**
48042+ * A structure which abstracts file I/O and memory management.
48043+ *
48044+ * The library always uses the mspack_system structure for interaction
48045+ * with the file system and to allocate, free and copy all memory. It also
48046+ * uses it to send literal messages to the library user.
48047+ *
48048+ * When the library is compiled normally, passing NULL to a compressor or
48049+ * decompressor constructor will result in a default mspack_system being
48050+ * used, where all methods are implemented with the standard C library.
48051+ * However, all constructors support being given a custom created
48052+ * mspack_system structure, with the library user's own methods. This
48053+ * allows for more abstract interaction, such as reading and writing files
48054+ * directly to memory, or from a network socket or pipe.
48055+ *
48056+ * Implementors of an mspack_system structure should read all
48057+ * documentation entries for every structure member, and write methods
48058+ * which conform to those standards.
48059+ */
48060+struct mspack_system {
48061+ /**
48062+ * Opens a file for reading, writing, appending or updating.
48063+ *
48064+ * @param self a self-referential pointer to the mspack_system
48065+ * structure whose open() method is being called. If
48066+ * this pointer is required by close(), read(), write(),
48067+ * seek() or tell(), it should be stored in the result
48068+ * structure at this time.
48069+ * @param filename the file to be opened. It is passed directly from the
48070+ * library caller without being modified, so it is up to
48071+ * the caller what this parameter actually represents.
48072+ * @param mode one of #MSPACK_SYS_OPEN_READ (open an existing file
48073+ * for reading), #MSPACK_SYS_OPEN_WRITE (open a new file
48074+ * for writing), #MSPACK_SYS_OPEN_UPDATE (open an existing
48075+ * file for reading/writing from the start of the file) or
48076+ * #MSPACK_SYS_OPEN_APPEND (open an existing file for
48077+ * reading/writing from the end of the file)
48078+ * @return a pointer to a mspack_file structure. This structure officially
48079+ * contains no members, its true contents are up to the
48080+ * mspack_system implementor. It should contain whatever is needed
48081+ * for other mspack_system methods to operate. Returning the NULL
48082+ * pointer indicates an error condition.
48083+ * @see close(), read(), write(), seek(), tell(), message()
48084+ */
48085+ struct mspack_file * (*open)(struct mspack_system *self,
48086+ const char *filename,
48087+ int mode);
48088+
48089+ /**
48090+ * Closes a previously opened file. If any memory was allocated for this
48091+ * particular file handle, it should be freed at this time.
48092+ *
48093+ * @param file the file to close
48094+ * @see open()
48095+ */
48096+ void (*close)(struct mspack_file *file);
48097+
48098+ /**
48099+ * Reads a given number of bytes from an open file.
48100+ *
48101+ * @param file the file to read from
48102+ * @param buffer the location where the read bytes should be stored
48103+ * @param bytes the number of bytes to read from the file.
48104+ * @return the number of bytes successfully read (this can be less than
48105+ * the number requested), zero to mark the end of file, or less
48106+ * than zero to indicate an error.
48107+ * @see open(), write()
48108+ */
48109+ int (*read)(struct mspack_file *file,
48110+ void *buffer,
48111+ int bytes);
48112+
48113+ /**
48114+ * Writes a given number of bytes to an open file.
48115+ *
48116+ * @param file the file to write to
48117+ * @param buffer the location where the written bytes should be read from
48118+ * @param bytes the number of bytes to write to the file.
48119+ * @return the number of bytes successfully written, this can be less
48120+ * than the number requested. Zero or less can indicate an error
48121+ * where no bytes at all could be written. All cases where less
48122+ * bytes were written than requested are considered by the library
48123+ * to be an error.
48124+ * @see open(), read()
48125+ */
48126+ int (*write)(struct mspack_file *file,
48127+ void *buffer,
48128+ int bytes);
48129+
48130+ /**
48131+ * Seeks to a specific file offset within an open file.
48132+ *
48133+ * Sometimes the library needs to know the length of a file. It does
48134+ * this by seeking to the end of the file with seek(file, 0,
48135+ * MSPACK_SYS_SEEK_END), then calling tell(). Implementations may want
48136+ * to make a special case for this.
48137+ *
48138+ * Due to the potentially varying 32/64 bit datatype off_t on some
48139+ * architectures, the #MSPACK_SYS_SELFTEST macro MUST be used before
48140+ * using the library. If not, the error caused by the library passing an
48141+ * inappropriate stackframe to seek() is subtle and hard to trace.
48142+ *
48143+ * @param file the file to be seeked
48144+ * @param offset an offset to seek, measured in bytes
48145+ * @param mode one of #MSPACK_SYS_SEEK_START (the offset should be
48146+ * measured from the start of the file), #MSPACK_SYS_SEEK_CUR
48147+ * (the offset should be measured from the current file offset)
48148+ * or #MSPACK_SYS_SEEK_END (the offset should be measured from
48149+ * the end of the file)
48150+ * @return zero for success, non-zero for an error
48151+ * @see open(), tell()
48152+ */
48153+ int (*seek)(struct mspack_file *file,
48154+ off_t offset,
48155+ int mode);
48156+
48157+ /**
48158+ * Returns the current file position (in bytes) of the given file.
48159+ *
48160+ * @param file the file whose file position is wanted
48161+ * @return the current file position of the file
48162+ * @see open(), seek()
48163+ */
48164+ off_t (*tell)(struct mspack_file *file);
48165+
48166+ /**
48167+ * Used to send messages from the library to the user.
48168+ *
48169+ * Occasionally, the library generates warnings or other messages in
48170+ * plain english to inform the human user. These are informational only
48171+ * and can be ignored if not wanted.
48172+ *
48173+ * @param file may be a file handle returned from open() if this message
48174+ * pertains to a specific open file, or NULL if not related to
48175+ * a specific file.
48176+ * @param format a printf() style format string. It does NOT include a
48177+ * trailing newline.
48178+ * @see open()
48179+ */
48180+ void (*message)(struct mspack_file *file,
48181+ const char *format,
48182+ ...);
48183+
48184+ /**
48185+ * Allocates memory.
48186+ *
48187+ * @param self a self-referential pointer to the mspack_system
48188+ * structure whose alloc() method is being called.
48189+ * @param bytes the number of bytes to allocate
48190+ * @result a pointer to the requested number of bytes, or NULL if
48191+ * not enough memory is available
48192+ * @see free()
48193+ */
48194+ void * (*alloc)(struct mspack_system *self,
48195+ size_t bytes);
48196+
48197+ /**
48198+ * Frees memory.
48199+ *
48200+ * @param ptr the memory to be freed.
48201+ * @see alloc()
48202+ */
48203+ void (*free)(void *ptr);
48204+
48205+ /**
48206+ * Copies from one region of memory to another.
48207+ *
48208+ * The regions of memory are guaranteed not to overlap, are usually less
48209+ * than 256 bytes, and may not be aligned. Please note that the source
48210+ * parameter comes before the destination parameter, unlike the standard
48211+ * C function memcpy().
48212+ *
48213+ * @param src the region of memory to copy from
48214+ * @param dest the region of memory to copy to
48215+ * @param bytes the size of the memory region, in bytes
48216+ */
48217+ void (*copy)(void *src,
48218+ void *dest,
48219+ size_t bytes);
48220+
48221+ /**
48222+ * A null pointer to mark the end of mspack_system. It must equal NULL.
48223+ *
48224+ * Should the mspack_system structure extend in the future, this NULL
48225+ * will be seen, rather than have an invalid method pointer called.
48226+ */
48227+ void *null_ptr;
48228+};
48229+
48230+/** mspack_system::open() mode: open existing file for reading. */
48231+#define MSPACK_SYS_OPEN_READ (0)
48232+/** mspack_system::open() mode: open new file for writing */
48233+#define MSPACK_SYS_OPEN_WRITE (1)
48234+/** mspack_system::open() mode: open existing file for writing */
48235+#define MSPACK_SYS_OPEN_UPDATE (2)
48236+/** mspack_system::open() mode: open existing file for writing */
48237+#define MSPACK_SYS_OPEN_APPEND (3)
48238+
48239+/** mspack_system::seek() mode: seek relative to start of file */
48240+#define MSPACK_SYS_SEEK_START (0)
48241+/** mspack_system::seek() mode: seek relative to current offset */
48242+#define MSPACK_SYS_SEEK_CUR (1)
48243+/** mspack_system::seek() mode: seek relative to end of file */
48244+#define MSPACK_SYS_SEEK_END (2)
48245+
48246+/**
48247+ * A structure which represents an open file handle. The contents of this
48248+ * structure are determined by the implementation of the
48249+ * mspack_system::open() method.
48250+ */
48251+struct mspack_file {
48252+ int dummy;
48253+};
48254+
48255+/* --- error codes --------------------------------------------------------- */
48256+
48257+/** Error code: no error */
48258+#define MSPACK_ERR_OK (0)
48259+/** Error code: bad arguments to method */
48260+#define MSPACK_ERR_ARGS (1)
48261+/** Error code: error opening file */
48262+#define MSPACK_ERR_OPEN (2)
48263+/** Error code: error reading file */
48264+#define MSPACK_ERR_READ (3)
48265+/** Error code: error writing file */
48266+#define MSPACK_ERR_WRITE (4)
48267+/** Error code: seek error */
48268+#define MSPACK_ERR_SEEK (5)
48269+/** Error code: out of memory */
48270+#define MSPACK_ERR_NOMEMORY (6)
48271+/** Error code: bad "magic id" in file */
48272+#define MSPACK_ERR_SIGNATURE (7)
48273+/** Error code: bad or corrupt file format */
48274+#define MSPACK_ERR_DATAFORMAT (8)
48275+/** Error code: bad checksum or CRC */
48276+#define MSPACK_ERR_CHECKSUM (9)
48277+/** Error code: error during compression */
48278+#define MSPACK_ERR_CRUNCH (10)
48279+/** Error code: error during decompression */
48280+#define MSPACK_ERR_DECRUNCH (11)
48281+
48282+/* --- functions available in library -------------------------------------- */
48283+
48284+/** Creates a new CAB compressor.
48285+ * @param sys a custom mspack_system structure, or NULL to use the default
48286+ * @return a #mscab_compressor or NULL
48287+ */
48288+extern struct mscab_compressor *
48289+ mspack_create_cab_compressor(struct mspack_system *sys);
48290+
48291+/** Creates a new CAB decompressor.
48292+ * @param sys a custom mspack_system structure, or NULL to use the default
48293+ * @return a #mscab_decompressor or NULL
48294+ */
48295+extern struct mscab_decompressor *
48296+ mspack_create_cab_decompressor(struct mspack_system *sys);
48297+
48298+/** Destroys an existing CAB compressor.
48299+ * @param self the #mscab_compressor to destroy
48300+ */
48301+extern void mspack_destroy_cab_compressor(struct mscab_compressor *self);
48302+
48303+/** Destroys an existing CAB decompressor.
48304+ * @param self the #mscab_decompressor to destroy
48305+ */
48306+extern void mspack_destroy_cab_decompressor(struct mscab_decompressor *self);
48307+
48308+
48309+/** Creates a new CHM compressor.
48310+ * @param sys a custom mspack_system structure, or NULL to use the default
48311+ * @return a #mschm_compressor or NULL
48312+ */
48313+extern struct mschm_compressor *
48314+ mspack_create_chm_compressor(struct mspack_system *sys);
48315+
48316+/** Creates a new CHM decompressor.
48317+ * @param sys a custom mspack_system structure, or NULL to use the default
48318+ * @return a #mschm_decompressor or NULL
48319+ */
48320+extern struct mschm_decompressor *
48321+ mspack_create_chm_decompressor(struct mspack_system *sys);
48322+
48323+/** Destroys an existing CHM compressor.
48324+ * @param self the #mschm_compressor to destroy
48325+ */
48326+extern void mspack_destroy_chm_compressor(struct mschm_compressor *self);
48327+
48328+/** Destroys an existing CHM decompressor.
48329+ * @param self the #mschm_decompressor to destroy
48330+ */
48331+extern void mspack_destroy_chm_decompressor(struct mschm_decompressor *self);
48332+
48333+
48334+/** Creates a new LIT compressor.
48335+ * @param sys a custom mspack_system structure, or NULL to use the default
48336+ * @return a #mslit_compressor or NULL
48337+ */
48338+extern struct mslit_compressor *
48339+ mspack_create_lit_compressor(struct mspack_system *sys);
48340+
48341+/** Creates a new LIT decompressor.
48342+ * @param sys a custom mspack_system structure, or NULL to use the default
48343+ * @return a #mslit_decompressor or NULL
48344+ */
48345+extern struct mslit_decompressor *
48346+ mspack_create_lit_decompressor(struct mspack_system *sys);
48347+
48348+/** Destroys an existing LIT compressor.
48349+ * @param self the #mslit_compressor to destroy
48350+ */
48351+extern void mspack_destroy_lit_compressor(struct mslit_compressor *self);
48352+
48353+/** Destroys an existing LIT decompressor.
48354+ * @param self the #mslit_decompressor to destroy
48355+ */
48356+extern void mspack_destroy_lit_decompressor(struct mslit_decompressor *self);
48357+
48358+
48359+/** Creates a new HLP compressor.
48360+ * @param sys a custom mspack_system structure, or NULL to use the default
48361+ * @return a #mshlp_compressor or NULL
48362+ */
48363+extern struct mshlp_compressor *
48364+ mspack_create_hlp_compressor(struct mspack_system *sys);
48365+
48366+/** Creates a new HLP decompressor.
48367+ * @param sys a custom mspack_system structure, or NULL to use the default
48368+ * @return a #mshlp_decompressor or NULL
48369+ */
48370+extern struct mshlp_decompressor *
48371+ mspack_create_hlp_decompressor(struct mspack_system *sys);
48372+
48373+/** Destroys an existing hlp compressor.
48374+ * @param self the #mshlp_compressor to destroy
48375+ */
48376+extern void mspack_destroy_hlp_compressor(struct mshlp_compressor *self);
48377+
48378+/** Destroys an existing hlp decompressor.
48379+ * @param self the #mshlp_decompressor to destroy
48380+ */
48381+extern void mspack_destroy_hlp_decompressor(struct mshlp_decompressor *self);
48382+
48383+
48384+/** Creates a new SZDD compressor.
48385+ * @param sys a custom mspack_system structure, or NULL to use the default
48386+ * @return a #msszdd_compressor or NULL
48387+ */
48388+extern struct msszdd_compressor *
48389+ mspack_create_szdd_compressor(struct mspack_system *sys);
48390+
48391+/** Creates a new SZDD decompressor.
48392+ * @param sys a custom mspack_system structure, or NULL to use the default
48393+ * @return a #msszdd_decompressor or NULL
48394+ */
48395+extern struct msszdd_decompressor *
48396+ mspack_create_szdd_decompressor(struct mspack_system *sys);
48397+
48398+/** Destroys an existing SZDD compressor.
48399+ * @param self the #msszdd_compressor to destroy
48400+ */
48401+extern void mspack_destroy_szdd_compressor(struct msszdd_compressor *self);
48402+
48403+/** Destroys an existing SZDD decompressor.
48404+ * @param self the #msszdd_decompressor to destroy
48405+ */
48406+extern void mspack_destroy_szdd_decompressor(struct msszdd_decompressor *self);
48407+
48408+
48409+/** Creates a new KWAJ compressor.
48410+ * @param sys a custom mspack_system structure, or NULL to use the default
48411+ * @return a #mskwaj_compressor or NULL
48412+ */
48413+extern struct mskwaj_compressor *
48414+ mspack_create_kwaj_compressor(struct mspack_system *sys);
48415+
48416+/** Creates a new KWAJ decompressor.
48417+ * @param sys a custom mspack_system structure, or NULL to use the default
48418+ * @return a #mskwaj_decompressor or NULL
48419+ */
48420+extern struct mskwaj_decompressor *
48421+ mspack_create_kwaj_decompressor(struct mspack_system *sys);
48422+
48423+/** Destroys an existing KWAJ compressor.
48424+ * @param self the #mskwaj_compressor to destroy
48425+ */
48426+extern void mspack_destroy_kwaj_compressor(struct mskwaj_compressor *self);
48427+
48428+/** Destroys an existing KWAJ decompressor.
48429+ * @param self the #mskwaj_decompressor to destroy
48430+ */
48431+extern void mspack_destroy_kwaj_decompressor(struct mskwaj_decompressor *self);
48432+
48433+
48434+/** Creates a new OAB compressor.
48435+ * @param sys a custom mspack_system structure, or NULL to use the default
48436+ * @return a #msoab_compressor or NULL
48437+ */
48438+extern struct msoab_compressor *
48439+ mspack_create_oab_compressor(struct mspack_system *sys);
48440+
48441+/** Creates a new OAB decompressor.
48442+ * @param sys a custom mspack_system structure, or NULL to use the default
48443+ * @return a #msoab_decompressor or NULL
48444+ */
48445+extern struct msoab_decompressor *
48446+ mspack_create_oab_decompressor(struct mspack_system *sys);
48447+
48448+/** Destroys an existing OAB compressor.
48449+ * @param self the #msoab_compressor to destroy
48450+ */
48451+extern void mspack_destroy_oab_compressor(struct msoab_compressor *self);
48452+
48453+/** Destroys an existing OAB decompressor.
48454+ * @param self the #msoab_decompressor to destroy
48455+ */
48456+extern void mspack_destroy_oab_decompressor(struct msoab_decompressor *self);
48457+
48458+
48459+/* --- support for .CAB (MS Cabinet) file format --------------------------- */
48460+
48461+/**
48462+ * A structure which represents a single cabinet file.
48463+ *
48464+ * All fields are READ ONLY.
48465+ *
48466+ * If this cabinet is part of a merged cabinet set, the #files and #folders
48467+ * fields are common to all cabinets in the set, and will be identical.
48468+ *
48469+ * @see mscab_decompressor::open(), mscab_decompressor::close(),
48470+ * mscab_decompressor::search()
48471+ */
48472+struct mscabd_cabinet {
48473+ /**
48474+ * The next cabinet in a chained list, if this cabinet was opened with
48475+ * mscab_decompressor::search(). May be NULL to mark the end of the
48476+ * list.
48477+ */
48478+ struct mscabd_cabinet *next;
48479+
48480+ /**
48481+ * The filename of the cabinet. More correctly, the filename of the
48482+ * physical file that the cabinet resides in. This is given by the
48483+ * library user and may be in any format.
48484+ */
48485+ const char *filename;
48486+
48487+ /** The file offset of cabinet within the physical file it resides in. */
48488+ off_t base_offset;
48489+
48490+ /** The length of the cabinet file in bytes. */
48491+ unsigned int length;
48492+
48493+ /** The previous cabinet in a cabinet set, or NULL. */
48494+ struct mscabd_cabinet *prevcab;
48495+
48496+ /** The next cabinet in a cabinet set, or NULL. */
48497+ struct mscabd_cabinet *nextcab;
48498+
48499+ /** The filename of the previous cabinet in a cabinet set, or NULL. */
48500+ char *prevname;
48501+
48502+ /** The filename of the next cabinet in a cabinet set, or NULL. */
48503+ char *nextname;
48504+
48505+ /** The name of the disk containing the previous cabinet in a cabinet
48506+ * set, or NULL.
48507+ */
48508+ char *previnfo;
48509+
48510+ /** The name of the disk containing the next cabinet in a cabinet set,
48511+ * or NULL.
48512+ */
48513+ char *nextinfo;
48514+
48515+ /** A list of all files in the cabinet or cabinet set. */
48516+ struct mscabd_file *files;
48517+
48518+ /** A list of all folders in the cabinet or cabinet set. */
48519+ struct mscabd_folder *folders;
48520+
48521+ /**
48522+ * The set ID of the cabinet. All cabinets in the same set should have
48523+ * the same set ID.
48524+ */
48525+ unsigned short set_id;
48526+
48527+ /**
48528+ * The index number of the cabinet within the set. Numbering should
48529+ * start from 0 for the first cabinet in the set, and increment by 1 for
48530+ * each following cabinet.
48531+ */
48532+ unsigned short set_index;
48533+
48534+ /**
48535+ * The number of bytes reserved in the header area of the cabinet.
48536+ *
48537+ * If this is non-zero and flags has MSCAB_HDR_RESV set, this data can
48538+ * be read by the calling application. It is of the given length,
48539+ * located at offset (base_offset + MSCAB_HDR_RESV_OFFSET) in the
48540+ * cabinet file.
48541+ *
48542+ * @see flags
48543+ */
48544+ unsigned short header_resv;
48545+
48546+ /**
48547+ * Header flags.
48548+ *
48549+ * - MSCAB_HDR_PREVCAB indicates the cabinet is part of a cabinet set, and
48550+ * has a predecessor cabinet.
48551+ * - MSCAB_HDR_NEXTCAB indicates the cabinet is part of a cabinet set, and
48552+ * has a successor cabinet.
48553+ * - MSCAB_HDR_RESV indicates the cabinet has reserved header space.
48554+ *
48555+ * @see prevname, previnfo, nextname, nextinfo, header_resv
48556+ */
48557+ int flags;
48558+};
48559+
48560+/** Offset from start of cabinet to the reserved header data (if present). */
48561+#define MSCAB_HDR_RESV_OFFSET (0x28)
48562+
48563+/** Cabinet header flag: cabinet has a predecessor */
48564+#define MSCAB_HDR_PREVCAB (0x01)
48565+/** Cabinet header flag: cabinet has a successor */
48566+#define MSCAB_HDR_NEXTCAB (0x02)
48567+/** Cabinet header flag: cabinet has reserved header space */
48568+#define MSCAB_HDR_RESV (0x04)
48569+
48570+/**
48571+ * A structure which represents a single folder in a cabinet or cabinet set.
48572+ *
48573+ * All fields are READ ONLY.
48574+ *
48575+ * A folder is a single compressed stream of data. When uncompressed, it
48576+ * holds the data of one or more files. A folder may be split across more
48577+ * than one cabinet.
48578+ */
48579+struct mscabd_folder {
48580+ /**
48581+ * A pointer to the next folder in this cabinet or cabinet set, or NULL
48582+ * if this is the final folder.
48583+ */
48584+ struct mscabd_folder *next;
48585+
48586+ /**
48587+ * The compression format used by this folder.
48588+ *
48589+ * The macro MSCABD_COMP_METHOD() should be used on this field to get
48590+ * the algorithm used. The macro MSCABD_COMP_LEVEL() should be used to get
48591+ * the "compression level".
48592+ *
48593+ * @see MSCABD_COMP_METHOD(), MSCABD_COMP_LEVEL()
48594+ */
48595+ int comp_type;
48596+
48597+ /**
48598+ * The total number of data blocks used by this folder. This includes
48599+ * data blocks present in other files, if this folder spans more than
48600+ * one cabinet.
48601+ */
48602+ unsigned int num_blocks;
48603+};
48604+
48605+/**
48606+ * Returns the compression method used by a folder.
48607+ *
48608+ * @param comp_type a mscabd_folder::comp_type value
48609+ * @return one of #MSCAB_COMP_NONE, #MSCAB_COMP_MSZIP, #MSCAB_COMP_QUANTUM
48610+ * or #MSCAB_COMP_LZX
48611+ */
48612+#define MSCABD_COMP_METHOD(comp_type) ((comp_type) & 0x0F)
48613+/**
48614+ * Returns the compression level used by a folder.
48615+ *
48616+ * @param comp_type a mscabd_folder::comp_type value
48617+ * @return the compression level. This is only defined by LZX and Quantum
48618+ * compression
48619+ */
48620+#define MSCABD_COMP_LEVEL(comp_type) (((comp_type) >> 8) & 0x1F)
48621+
48622+/** Compression mode: no compression. */
48623+#define MSCAB_COMP_NONE (0)
48624+/** Compression mode: MSZIP (deflate) compression. */
48625+#define MSCAB_COMP_MSZIP (1)
48626+/** Compression mode: Quantum compression */
48627+#define MSCAB_COMP_QUANTUM (2)
48628+/** Compression mode: LZX compression */
48629+#define MSCAB_COMP_LZX (3)
48630+
48631+/**
48632+ * A structure which represents a single file in a cabinet or cabinet set.
48633+ *
48634+ * All fields are READ ONLY.
48635+ */
48636+struct mscabd_file {
48637+ /**
48638+ * The next file in the cabinet or cabinet set, or NULL if this is the
48639+ * final file.
48640+ */
48641+ struct mscabd_file *next;
48642+
48643+ /**
48644+ * The filename of the file.
48645+ *
48646+ * A null terminated string of up to 255 bytes in length, it may be in
48647+ * either ISO-8859-1 or UTF8 format, depending on the file attributes.
48648+ *
48649+ * @see attribs
48650+ */
48651+ char *filename;
48652+
48653+ /** The uncompressed length of the file, in bytes. */
48654+ unsigned int length;
48655+
48656+ /**
48657+ * File attributes.
48658+ *
48659+ * The following attributes are defined:
48660+ * - #MSCAB_ATTRIB_RDONLY indicates the file is write protected.
48661+ * - #MSCAB_ATTRIB_HIDDEN indicates the file is hidden.
48662+ * - #MSCAB_ATTRIB_SYSTEM indicates the file is a operating system file.
48663+ * - #MSCAB_ATTRIB_ARCH indicates the file is "archived".
48664+ * - #MSCAB_ATTRIB_EXEC indicates the file is an executable program.
48665+ * - #MSCAB_ATTRIB_UTF_NAME indicates the filename is in UTF8 format rather
48666+ * than ISO-8859-1.
48667+ */
48668+ int attribs;
48669+
48670+ /** File's last modified time, hour field. */
48671+ char time_h;
48672+ /** File's last modified time, minute field. */
48673+ char time_m;
48674+ /** File's last modified time, second field. */
48675+ char time_s;
48676+
48677+ /** File's last modified date, day field. */
48678+ char date_d;
48679+ /** File's last modified date, month field. */
48680+ char date_m;
48681+ /** File's last modified date, year field. */
48682+ int date_y;
48683+
48684+ /** A pointer to the folder that contains this file. */
48685+ struct mscabd_folder *folder;
48686+
48687+ /** The uncompressed offset of this file in its folder. */
48688+ unsigned int offset;
48689+};
48690+
48691+/** mscabd_file::attribs attribute: file is read-only. */
48692+#define MSCAB_ATTRIB_RDONLY (0x01)
48693+/** mscabd_file::attribs attribute: file is hidden. */
48694+#define MSCAB_ATTRIB_HIDDEN (0x02)
48695+/** mscabd_file::attribs attribute: file is an operating system file. */
48696+#define MSCAB_ATTRIB_SYSTEM (0x04)
48697+/** mscabd_file::attribs attribute: file is "archived". */
48698+#define MSCAB_ATTRIB_ARCH (0x20)
48699+/** mscabd_file::attribs attribute: file is an executable program. */
48700+#define MSCAB_ATTRIB_EXEC (0x40)
48701+/** mscabd_file::attribs attribute: filename is UTF8, not ISO-8859-1. */
48702+#define MSCAB_ATTRIB_UTF_NAME (0x80)
48703+
48704+/** mscab_decompressor::set_param() parameter: search buffer size. */
48705+#define MSCABD_PARAM_SEARCHBUF (0)
48706+/** mscab_decompressor::set_param() parameter: repair MS-ZIP streams? */
48707+#define MSCABD_PARAM_FIXMSZIP (1)
48708+/** mscab_decompressor::set_param() parameter: size of decompression buffer */
48709+#define MSCABD_PARAM_DECOMPBUF (2)
48710+
48711+/** TODO */
48712+struct mscab_compressor {
48713+ int dummy;
48714+};
48715+
48716+/**
48717+ * A decompressor for .CAB (Microsoft Cabinet) files
48718+ *
48719+ * All fields are READ ONLY.
48720+ *
48721+ * @see mspack_create_cab_decompressor(), mspack_destroy_cab_decompressor()
48722+ */
48723+struct mscab_decompressor {
48724+ /**
48725+ * Opens a cabinet file and reads its contents.
48726+ *
48727+ * If the file opened is a valid cabinet file, all headers will be read
48728+ * and a mscabd_cabinet structure will be returned, with a full list of
48729+ * folders and files.
48730+ *
48731+ * In the case of an error occuring, NULL is returned and the error code
48732+ * is available from last_error().
48733+ *
48734+ * The filename pointer should be considered "in use" until close() is
48735+ * called on the cabinet.
48736+ *
48737+ * @param self a self-referential pointer to the mscab_decompressor
48738+ * instance being called
48739+ * @param filename the filename of the cabinet file. This is passed
48740+ * directly to mspack_system::open().
48741+ * @return a pointer to a mscabd_cabinet structure, or NULL on failure
48742+ * @see close(), search(), last_error()
48743+ */
48744+ struct mscabd_cabinet * (*open) (struct mscab_decompressor *self,
48745+ const char *filename);
48746+
48747+ /**
48748+ * Closes a previously opened cabinet or cabinet set.
48749+ *
48750+ * This closes a cabinet, all cabinets associated with it via the
48751+ * mscabd_cabinet::next, mscabd_cabinet::prevcab and
48752+ * mscabd_cabinet::nextcab pointers, and all folders and files. All
48753+ * memory used by these entities is freed.
48754+ *
48755+ * The cabinet pointer is now invalid and cannot be used again. All
48756+ * mscabd_folder and mscabd_file pointers from that cabinet or cabinet
48757+ * set are also now invalid, and cannot be used again.
48758+ *
48759+ * If the cabinet pointer given was created using search(), it MUST be
48760+ * the cabinet pointer returned by search() and not one of the later
48761+ * cabinet pointers further along the mscabd_cabinet::next chain.
48762+
48763+ * If extra cabinets have been added using append() or prepend(), these
48764+ * will all be freed, even if the cabinet pointer given is not the first
48765+ * cabinet in the set. Do NOT close() more than one cabinet in the set.
48766+ *
48767+ * The mscabd_cabinet::filename is not freed by the library, as it is
48768+ * not allocated by the library. The caller should free this itself if
48769+ * necessary, before it is lost forever.
48770+ *
48771+ * @param self a self-referential pointer to the mscab_decompressor
48772+ * instance being called
48773+ * @param cab the cabinet to close
48774+ * @see open(), search(), append(), prepend()
48775+ */
48776+ void (*close)(struct mscab_decompressor *self,
48777+ struct mscabd_cabinet *cab);
48778+
48779+ /**
48780+ * Searches a regular file for embedded cabinets.
48781+ *
48782+ * This opens a normal file with the given filename and will search the
48783+ * entire file for embedded cabinet files
48784+ *
48785+ * If any cabinets are found, the equivalent of open() is called on each
48786+ * potential cabinet file at the offset it was found. All successfully
48787+ * open()ed cabinets are kept in a list.
48788+ *
48789+ * The first cabinet found will be returned directly as the result of
48790+ * this method. Any further cabinets found will be chained in a list
48791+ * using the mscabd_cabinet::next field.
48792+ *
48793+ * In the case of an error occuring anywhere other than the simulated
48794+ * open(), NULL is returned and the error code is available from
48795+ * last_error().
48796+ *
48797+ * If no error occurs, but no cabinets can be found in the file, NULL is
48798+ * returned and last_error() returns MSPACK_ERR_OK.
48799+ *
48800+ * The filename pointer should be considered in use until close() is
48801+ * called on the cabinet.
48802+ *
48803+ * close() should only be called on the result of search(), not on any
48804+ * subsequent cabinets in the mscabd_cabinet::next chain.
48805+ *
48806+ * @param self a self-referential pointer to the mscab_decompressor
48807+ * instance being called
48808+ * @param filename the filename of the file to search for cabinets. This
48809+ * is passed directly to mspack_system::open().
48810+ * @return a pointer to a mscabd_cabinet structure, or NULL
48811+ * @see close(), open(), last_error()
48812+ */
48813+ struct mscabd_cabinet * (*search) (struct mscab_decompressor *self,
48814+ const char *filename);
48815+
48816+ /**
48817+ * Appends one mscabd_cabinet to another, forming or extending a cabinet
48818+ * set.
48819+ *
48820+ * This will attempt to append one cabinet to another such that
48821+ * <tt>(cab->nextcab == nextcab) && (nextcab->prevcab == cab)</tt> and
48822+ * any folders split between the two cabinets are merged.
48823+ *
48824+ * The cabinets MUST be part of a cabinet set -- a cabinet set is a
48825+ * cabinet that spans more than one physical cabinet file on disk -- and
48826+ * must be appropriately matched.
48827+ *
48828+ * It can be determined if a cabinet has further parts to load by
48829+ * examining the mscabd_cabinet::flags field:
48830+ *
48831+ * - if <tt>(flags & MSCAB_HDR_PREVCAB)</tt> is non-zero, there is a
48832+ * predecessor cabinet to open() and prepend(). Its MS-DOS
48833+ * case-insensitive filename is mscabd_cabinet::prevname
48834+ * - if <tt>(flags & MSCAB_HDR_NEXTCAB)</tt> is non-zero, there is a
48835+ * successor cabinet to open() and append(). Its MS-DOS case-insensitive
48836+ * filename is mscabd_cabinet::nextname
48837+ *
48838+ * If the cabinets do not match, an error code will be returned. Neither
48839+ * cabinet has been altered, and both should be closed seperately.
48840+ *
48841+ * Files and folders in a cabinet set are a single entity. All cabinets
48842+ * in a set use the same file list, which is updated as cabinets in the
48843+ * set are added. All pointers to mscabd_folder and mscabd_file
48844+ * structures in either cabinet must be discarded and re-obtained after
48845+ * merging.
48846+ *
48847+ * @param self a self-referential pointer to the mscab_decompressor
48848+ * instance being called
48849+ * @param cab the cabinet which will be appended to,
48850+ * predecessor of nextcab
48851+ * @param nextcab the cabinet which will be appended,
48852+ * successor of cab
48853+ * @return an error code, or MSPACK_ERR_OK if successful
48854+ * @see prepend(), open(), close()
48855+ */
48856+ int (*append) (struct mscab_decompressor *self,
48857+ struct mscabd_cabinet *cab,
48858+ struct mscabd_cabinet *nextcab);
48859+
48860+ /**
48861+ * Prepends one mscabd_cabinet to another, forming or extending a
48862+ * cabinet set.
48863+ *
48864+ * This will attempt to prepend one cabinet to another, such that
48865+ * <tt>(cab->prevcab == prevcab) && (prevcab->nextcab == cab)</tt>. In
48866+ * all other respects, it is identical to append(). See append() for the
48867+ * full documentation.
48868+ *
48869+ * @param self a self-referential pointer to the mscab_decompressor
48870+ * instance being called
48871+ * @param cab the cabinet which will be prepended to,
48872+ * successor of prevcab
48873+ * @param prevcab the cabinet which will be prepended,
48874+ * predecessor of cab
48875+ * @return an error code, or MSPACK_ERR_OK if successful
48876+ * @see append(), open(), close()
48877+ */
48878+ int (*prepend) (struct mscab_decompressor *self,
48879+ struct mscabd_cabinet *cab,
48880+ struct mscabd_cabinet *prevcab);
48881+
48882+ /**
48883+ * Extracts a file from a cabinet or cabinet set.
48884+ *
48885+ * This extracts a compressed file in a cabinet and writes it to the given
48886+ * filename.
48887+ *
48888+ * The MS-DOS filename of the file, mscabd_file::filename, is NOT USED
48889+ * by extract(). The caller must examine this MS-DOS filename, copy and
48890+ * change it as necessary, create directories as necessary, and provide
48891+ * the correct filename as a parameter, which will be passed unchanged
48892+ * to the decompressor's mspack_system::open()
48893+ *
48894+ * If the file belongs to a split folder in a multi-part cabinet set,
48895+ * and not enough parts of the cabinet set have been loaded and appended
48896+ * or prepended, an error will be returned immediately.
48897+ *
48898+ * @param self a self-referential pointer to the mscab_decompressor
48899+ * instance being called
48900+ * @param file the file to be decompressed
48901+ * @param filename the filename of the file being written to
48902+ * @return an error code, or MSPACK_ERR_OK if successful
48903+ */
48904+ int (*extract)(struct mscab_decompressor *self,
48905+ struct mscabd_file *file,
48906+ const char *filename);
48907+
48908+ /**
48909+ * Sets a CAB decompression engine parameter.
48910+ *
48911+ * The following parameters are defined:
48912+ * - #MSCABD_PARAM_SEARCHBUF: How many bytes should be allocated as a
48913+ * buffer when using search()? The minimum value is 4. The default
48914+ * value is 32768.
48915+ * - #MSCABD_PARAM_FIXMSZIP: If non-zero, extract() will ignore bad
48916+ * checksums and recover from decompression errors in MS-ZIP
48917+ * compressed folders. The default value is 0 (don't recover).
48918+ * - #MSCABD_PARAM_DECOMPBUF: How many bytes should be used as an input
48919+ * bit buffer by decompressors? The minimum value is 4. The default
48920+ * value is 4096.
48921+ *
48922+ * @param self a self-referential pointer to the mscab_decompressor
48923+ * instance being called
48924+ * @param param the parameter to set
48925+ * @param value the value to set the parameter to
48926+ * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there
48927+ * is a problem with either parameter or value.
48928+ * @see search(), extract()
48929+ */
48930+ int (*set_param)(struct mscab_decompressor *self,
48931+ int param,
48932+ int value);
48933+
48934+ /**
48935+ * Returns the error code set by the most recently called method.
48936+ *
48937+ * This is useful for open() and search(), which do not return an error
48938+ * code directly.
48939+ *
48940+ * @param self a self-referential pointer to the mscab_decompressor
48941+ * instance being called
48942+ * @return the most recent error code
48943+ * @see open(), search()
48944+ */
48945+ int (*last_error)(struct mscab_decompressor *self);
48946+};
48947+
48948+/* --- support for .CHM (HTMLHelp) file format ----------------------------- */
48949+
48950+/**
48951+ * A structure which represents a file to be placed in a CHM helpfile.
48952+ *
48953+ * A contiguous array of these structures should be passed to
48954+ * mschm_compressor::generate(). The array list is terminated with an
48955+ * entry whose mschmc_file::section field is set to #MSCHMC_ENDLIST, the
48956+ * other fields in this entry are ignored.
48957+ */
48958+struct mschmc_file {
48959+ /** One of #MSCHMC_ENDLIST, #MSCHMC_UNCOMP or #MSCHMC_MSCOMP. */
48960+ int section;
48961+
48962+ /** The filename of the source file that will be added to the CHM. This
48963+ * is passed directly to mspack_system::open(). */
48964+ const char *filename;
48965+
48966+ /** The full path and filename of the file within the CHM helpfile, a
48967+ * UTF-1 encoded null-terminated string. */
48968+ char *chm_filename;
48969+
48970+ /** The length of the file, in bytes. This will be adhered to strictly
48971+ * and a read error will be issued if this many bytes cannot be read
48972+ * from the real file at CHM generation time. */
48973+ off_t length;
48974+};
48975+
48976+/**
48977+ * A structure which represents a section of a CHM helpfile.
48978+ *
48979+ * All fields are READ ONLY.
48980+ *
48981+ * Not used directly, but used as a generic base type for
48982+ * mschmd_sec_uncompressed and mschmd_sec_mscompressed.
48983+ */
48984+struct mschmd_section {
48985+ /** A pointer to the CHM helpfile that contains this section. */
48986+ struct mschmd_header *chm;
48987+
48988+ /**
48989+ * The section ID. Either 0 for the uncompressed section
48990+ * mschmd_sec_uncompressed, or 1 for the LZX compressed section
48991+ * mschmd_sec_mscompressed. No other section IDs are known.
48992+ */
48993+ unsigned int id;
48994+};
48995+
48996+/**
48997+ * A structure which represents the uncompressed section of a CHM helpfile.
48998+ *
48999+ * All fields are READ ONLY.
49000+ */
49001+struct mschmd_sec_uncompressed {
49002+ /** Generic section data. */
49003+ struct mschmd_section base;
49004+
49005+ /** The file offset of where this section begins in the CHM helpfile. */
49006+ off_t offset;
49007+};
49008+
49009+/**
49010+ * A structure which represents the LZX compressed section of a CHM helpfile.
49011+ *
49012+ * All fields are READ ONLY.
49013+ */
49014+struct mschmd_sec_mscompressed {
49015+ /** Generic section data. */
49016+ struct mschmd_section base;
49017+
49018+ /** A pointer to the meta-file which represents all LZX compressed data. */
49019+ struct mschmd_file *content;
49020+
49021+ /** A pointer to the file which contains the LZX control data. */
49022+ struct mschmd_file *control;
49023+
49024+ /** A pointer to the file which contains the LZX reset table. */
49025+ struct mschmd_file *rtable;
49026+
49027+ /** A pointer to the file which contains the LZX span information.
49028+ * Available only in CHM decoder version 2 and above.
49029+ */
49030+ struct mschmd_file *spaninfo;
49031+};
49032+
49033+/**
49034+ * A structure which represents a CHM helpfile.
49035+ *
49036+ * All fields are READ ONLY.
49037+ */
49038+struct mschmd_header {
49039+ /** The version of the CHM file format used in this file. */
49040+ unsigned int version;
49041+
49042+ /**
49043+ * The "timestamp" of the CHM helpfile.
49044+ *
49045+ * It is the lower 32 bits of a 64-bit value representing the number of
49046+ * centiseconds since 1601-01-01 00:00:00 UTC, plus 42. It is not useful
49047+ * as a timestamp, but it is useful as a semi-unique ID.
49048+ */
49049+ unsigned int timestamp;
49050+
49051+ /**
49052+ * The default Language and Country ID (LCID) of the user who ran the
49053+ * HTMLHelp Compiler. This is not the language of the CHM file itself.
49054+ */
49055+ unsigned int language;
49056+
49057+ /**
49058+ * The filename of the CHM helpfile. This is given by the library user
49059+ * and may be in any format.
49060+ */
49061+ const char *filename;
49062+
49063+ /** The length of the CHM helpfile, in bytes. */
49064+ off_t length;
49065+
49066+ /** A list of all non-system files in the CHM helpfile. */
49067+ struct mschmd_file *files;
49068+
49069+ /**
49070+ * A list of all system files in the CHM helpfile.
49071+ *
49072+ * System files are files which begin with "::". They are meta-files
49073+ * generated by the CHM creation process.
49074+ */
49075+ struct mschmd_file *sysfiles;
49076+
49077+ /** The section 0 (uncompressed) data in this CHM helpfile. */
49078+ struct mschmd_sec_uncompressed sec0;
49079+
49080+ /** The section 1 (MSCompressed) data in this CHM helpfile. */
49081+ struct mschmd_sec_mscompressed sec1;
49082+
49083+ /** The file offset of the first PMGL/PMGI directory chunk. */
49084+ off_t dir_offset;
49085+
49086+ /** The number of PMGL/PMGI directory chunks in this CHM helpfile. */
49087+ unsigned int num_chunks;
49088+
49089+ /** The size of each PMGL/PMGI chunk, in bytes. */
49090+ unsigned int chunk_size;
49091+
49092+ /** The "density" of the quick-reference section in PMGL/PMGI chunks. */
49093+ unsigned int density;
49094+
49095+ /** The depth of the index tree.
49096+ *
49097+ * - if 1, there are no PMGI chunks, only PMGL chunks.
49098+ * - if 2, there is 1 PMGI chunk. All chunk indices point to PMGL chunks.
49099+ * - if 3, the root PMGI chunk points to secondary PMGI chunks, which in
49100+ * turn point to PMGL chunks.
49101+ * - and so on...
49102+ */
49103+ unsigned int depth;
49104+
49105+ /**
49106+ * The number of the root PMGI chunk.
49107+ *
49108+ * If there is no index in the CHM helpfile, this will be 0xFFFFFFFF.
49109+ */
49110+ unsigned int index_root;
49111+
49112+ /**
49113+ * The number of the first PMGL chunk. Usually zero.
49114+ * Available only in CHM decoder version 2 and above.
49115+ */
49116+ unsigned int first_pmgl;
49117+
49118+ /**
49119+ * The number of the last PMGL chunk. Usually num_chunks-1.
49120+ * Available only in CHM decoder version 2 and above.
49121+ */
49122+ unsigned int last_pmgl;
49123+
49124+ /**
49125+ * A cache of loaded chunks, filled in by mschm_decoder::fast_find().
49126+ * Available only in CHM decoder version 2 and above.
49127+ */
49128+ unsigned char **chunk_cache;
49129+};
49130+
49131+/**
49132+ * A structure which represents a file stored in a CHM helpfile.
49133+ *
49134+ * All fields are READ ONLY.
49135+ */
49136+struct mschmd_file {
49137+ /**
49138+ * A pointer to the next file in the list, or NULL if this is the final
49139+ * file.
49140+ */
49141+ struct mschmd_file *next;
49142+
49143+ /**
49144+ * A pointer to the section that this file is located in. Indirectly,
49145+ * it also points to the CHM helpfile the file is located in.
49146+ */
49147+ struct mschmd_section *section;
49148+
49149+ /** The offset within the section data that this file is located at. */
49150+ off_t offset;
49151+
49152+ /** The length of this file, in bytes */
49153+ off_t length;
49154+
49155+ /** The filename of this file -- a null terminated string in UTF-8. */
49156+ char *filename;
49157+};
49158+
49159+/** mschmc_file::section value: end of CHM file list */
49160+#define MSCHMC_ENDLIST (0)
49161+/** mschmc_file::section value: this file is in the Uncompressed section */
49162+#define MSCHMC_UNCOMP (1)
49163+/** mschmc_file::section value: this file is in the MSCompressed section */
49164+#define MSCHMC_MSCOMP (2)
49165+
49166+/** mschm_compressor::set_param() parameter: "timestamp" header */
49167+#define MSCHMC_PARAM_TIMESTAMP (0)
49168+/** mschm_compressor::set_param() parameter: "language" header */
49169+#define MSCHMC_PARAM_LANGUAGE (1)
49170+/** mschm_compressor::set_param() parameter: LZX window size */
49171+#define MSCHMC_PARAM_LZXWINDOW (2)
49172+/** mschm_compressor::set_param() parameter: intra-chunk quickref density */
49173+#define MSCHMC_PARAM_DENSITY (3)
49174+/** mschm_compressor::set_param() parameter: whether to create indices */
49175+#define MSCHMC_PARAM_INDEX (4)
49176+
49177+/**
49178+ * A compressor for .CHM (Microsoft HTMLHelp) files.
49179+ *
49180+ * All fields are READ ONLY.
49181+ *
49182+ * @see mspack_create_chm_compressor(), mspack_destroy_chm_compressor()
49183+ */
49184+struct mschm_compressor {
49185+ /**
49186+ * Generates a CHM help file.
49187+ *
49188+ * The help file will contain up to two sections, an Uncompressed
49189+ * section and potentially an MSCompressed (LZX compressed)
49190+ * section.
49191+ *
49192+ * While the contents listing of a CHM file is always in lexical order,
49193+ * the file list passed in will be taken as the correct order for files
49194+ * within the sections. It is in your interest to place similar files
49195+ * together for better compression.
49196+ *
49197+ * There are two modes of generation, to use a temporary file or not to
49198+ * use one. See use_temporary_file() for the behaviour of generate() in
49199+ * these two different modes.
49200+ *
49201+ * @param self a self-referential pointer to the mschm_compressor
49202+ * instance being called
49203+ * @param file_list an array of mschmc_file structures, terminated
49204+ * with an entry whose mschmc_file::section field is
49205+ * #MSCHMC_ENDLIST. The order of the list is
49206+ * preserved within each section. The length of any
49207+ * mschmc_file::chm_filename string cannot exceed
49208+ * roughly 4096 bytes. Each source file must be able
49209+ * to supply as many bytes as given in the
49210+ * mschmc_file::length field.
49211+ * @param output_file the file to write the generated CHM helpfile to.
49212+ * This is passed directly to mspack_system::open()
49213+ * @return an error code, or MSPACK_ERR_OK if successful
49214+ * @see use_temporary_file() set_param()
49215+ */
49216+ int (*generate)(struct mschm_compressor *self,
49217+ struct mschmc_file file_list[],
49218+ const char *output_file);
49219+
49220+ /**
49221+ * Specifies whether a temporary file is used during CHM generation.
49222+ *
49223+ * The CHM file format includes data about the compressed section (such
49224+ * as its overall size) that is stored in the output CHM file prior to
49225+ * the compressed section itself. This unavoidably requires that the
49226+ * compressed section has to be generated, before these details can be
49227+ * set. There are several ways this can be handled. Firstly, the
49228+ * compressed section could be generated entirely in memory before
49229+ * writing any of the output CHM file. This approach is not used in
49230+ * libmspack, as the compressed section can exceed the addressable
49231+ * memory space on most architectures.
49232+ *
49233+ * libmspack has two options, either to write these unknowable sections
49234+ * with blank data, generate the compressed section, then re-open the
49235+ * output file for update once the compressed section has been
49236+ * completed, or to write the compressed section to a temporary file,
49237+ * then write the entire output file at once, performing a simple
49238+ * file-to-file copy for the compressed section.
49239+ *
49240+ * The simple solution of buffering the entire compressed section in
49241+ * memory can still be used, if desired. As the temporary file's
49242+ * filename is passed directly to mspack_system::open(), it is possible
49243+ * for a custom mspack_system implementation to hold this file in memory,
49244+ * without writing to a disk.
49245+ *
49246+ * If a temporary file is set, generate() performs the following
49247+ * sequence of events: the temporary file is opened for writing, the
49248+ * compression algorithm writes to the temporary file, the temporary
49249+ * file is closed. Then the output file is opened for writing and the
49250+ * temporary file is re-opened for reading. The output file is written
49251+ * and the temporary file is read from. Both files are then closed. The
49252+ * temporary file itself is not deleted. If that is desired, the
49253+ * temporary file should be deleted after the completion of generate(),
49254+ * if it exists.
49255+ *
49256+ * If a temporary file is set not to be used, generate() performs the
49257+ * following sequence of events: the output file is opened for writing,
49258+ * then it is written and closed. The output file is then re-opened for
49259+ * update, the appropriate sections are seek()ed to and re-written, then
49260+ * the output file is closed.
49261+ *
49262+ * @param self a self-referential pointer to the
49263+ * mschm_compressor instance being called
49264+ * @param use_temp_file non-zero if the temporary file should be used,
49265+ * zero if the temporary file should not be used.
49266+ * @param temp_file a file to temporarily write compressed data to,
49267+ * before opening it for reading and copying the
49268+ * contents to the output file. This is passed
49269+ * directly to mspack_system::open().
49270+ * @return an error code, or MSPACK_ERR_OK if successful
49271+ * @see generate()
49272+ */
49273+ int (*use_temporary_file)(struct mschm_compressor *self,
49274+ int use_temp_file,
49275+ const char *temp_file);
49276+ /**
49277+ * Sets a CHM compression engine parameter.
49278+ *
49279+ * The following parameters are defined:
49280+
49281+ * - #MSCHMC_PARAM_TIMESTAMP: Sets the "timestamp" of the CHM file
49282+ * generated. This is not a timestamp, see mschmd_header::timestamp
49283+ * for a description. If this timestamp is 0, generate() will use its
49284+ * own algorithm for making a unique ID, based on the lengths and
49285+ * names of files in the CHM itself. Defaults to 0, any value between
49286+ * 0 and (2^32)-1 is valid.
49287+ * - #MSCHMC_PARAM_LANGUAGE: Sets the "language" of the CHM file
49288+ * generated. This is not the language used in the CHM file, but the
49289+ * language setting of the user who ran the HTMLHelp compiler. It
49290+ * defaults to 0x0409. The valid range is between 0x0000 and 0x7F7F.
49291+ * - #MSCHMC_PARAM_LZXWINDOW: Sets the size of the LZX history window,
49292+ * which is also the interval at which the compressed data stream can be
49293+ * randomly accessed. The value is not a size in bytes, but a power of
49294+ * two. The default value is 16 (which makes the window 2^16 bytes, or
49295+ * 64 kilobytes), the valid range is from 15 (32 kilobytes) to 21 (2
49296+ * megabytes).
49297+ * - #MSCHMC_PARAM_DENSITY: Sets the "density" of quick reference
49298+ * entries stored at the end of directory listing chunk. Each chunk is
49299+ * 4096 bytes in size, and contains as many file entries as there is
49300+ * room for. At the other end of the chunk, a list of "quick reference"
49301+ * pointers is included. The offset of every 'N'th file entry is given a
49302+ * quick reference, where N = (2^density) + 1. The default density is
49303+ * 2. The smallest density is 0 (N=2), the maximum is 10 (N=1025). As
49304+ * each file entry requires at least 5 bytes, the maximum number of
49305+ * entries in a single chunk is roughly 800, so the maximum value 10
49306+ * can be used to indicate there are no quickrefs at all.
49307+ * - #MSCHMC_PARAM_INDEX: Sets whether or not to include quick lookup
49308+ * index chunk(s), in addition to normal directory listing chunks. A
49309+ * value of zero means no index chunks will be created, a non-zero value
49310+ * means index chunks will be created. The default is zero, "don't
49311+ * create an index".
49312+ *
49313+ * @param self a self-referential pointer to the mschm_compressor
49314+ * instance being called
49315+ * @param param the parameter to set
49316+ * @param value the value to set the parameter to
49317+ * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there
49318+ * is a problem with either parameter or value.
49319+ * @see generate()
49320+ */
49321+ int (*set_param)(struct mschm_compressor *self,
49322+ int param,
49323+ unsigned int value);
49324+
49325+ /**
49326+ * Returns the error code set by the most recently called method.
49327+ *
49328+ * @param self a self-referential pointer to the mschm_compressor
49329+ * instance being called
49330+ * @return the most recent error code
49331+ * @see set_param(), generate()
49332+ */
49333+ int (*last_error)(struct mschm_compressor *self);
49334+};
49335+
49336+/**
49337+ * A decompressor for .CHM (Microsoft HTMLHelp) files
49338+ *
49339+ * All fields are READ ONLY.
49340+ *
49341+ * @see mspack_create_chm_decompressor(), mspack_destroy_chm_decompressor()
49342+ */
49343+struct mschm_decompressor {
49344+ /**
49345+ * Opens a CHM helpfile and reads its contents.
49346+ *
49347+ * If the file opened is a valid CHM helpfile, all headers will be read
49348+ * and a mschmd_header structure will be returned, with a full list of
49349+ * files.
49350+ *
49351+ * In the case of an error occuring, NULL is returned and the error code
49352+ * is available from last_error().
49353+ *
49354+ * The filename pointer should be considered "in use" until close() is
49355+ * called on the CHM helpfile.
49356+ *
49357+ * @param self a self-referential pointer to the mschm_decompressor
49358+ * instance being called
49359+ * @param filename the filename of the CHM helpfile. This is passed
49360+ * directly to mspack_system::open().
49361+ * @return a pointer to a mschmd_header structure, or NULL on failure
49362+ * @see close()
49363+ */
49364+ struct mschmd_header *(*open)(struct mschm_decompressor *self,
49365+ const char *filename);
49366+
49367+ /**
49368+ * Closes a previously opened CHM helpfile.
49369+ *
49370+ * This closes a CHM helpfile, frees the mschmd_header and all
49371+ * mschmd_file structures associated with it (if any). This works on
49372+ * both helpfiles opened with open() and helpfiles opened with
49373+ * fast_open().
49374+ *
49375+ * The CHM header pointer is now invalid and cannot be used again. All
49376+ * mschmd_file pointers referencing that CHM are also now invalid, and
49377+ * cannot be used again.
49378+ *
49379+ * @param self a self-referential pointer to the mschm_decompressor
49380+ * instance being called
49381+ * @param chm the CHM helpfile to close
49382+ * @see open(), fast_open()
49383+ */
49384+ void (*close)(struct mschm_decompressor *self,
49385+ struct mschmd_header *chm);
49386+
49387+ /**
49388+ * Extracts a file from a CHM helpfile.
49389+ *
49390+ * This extracts a file from a CHM helpfile and writes it to the given
49391+ * filename. The filename of the file, mscabd_file::filename, is not
49392+ * used by extract(), but can be used by the caller as a guide for
49393+ * constructing an appropriate filename.
49394+ *
49395+ * This method works both with files found in the mschmd_header::files
49396+ * and mschmd_header::sysfiles list and mschmd_file structures generated
49397+ * on the fly by fast_find().
49398+ *
49399+ * @param self a self-referential pointer to the mschm_decompressor
49400+ * instance being called
49401+ * @param file the file to be decompressed
49402+ * @param filename the filename of the file being written to
49403+ * @return an error code, or MSPACK_ERR_OK if successful
49404+ */
49405+ int (*extract)(struct mschm_decompressor *self,
49406+ struct mschmd_file *file,
49407+ const char *filename);
49408+
49409+ /**
49410+ * Returns the error code set by the most recently called method.
49411+ *
49412+ * This is useful for open() and fast_open(), which do not return an
49413+ * error code directly.
49414+ *
49415+ * @param self a self-referential pointer to the mschm_decompressor
49416+ * instance being called
49417+ * @return the most recent error code
49418+ * @see open(), extract()
49419+ */
49420+ int (*last_error)(struct mschm_decompressor *self);
49421+
49422+ /**
49423+ * Opens a CHM helpfile quickly.
49424+ *
49425+ * If the file opened is a valid CHM helpfile, only essential headers
49426+ * will be read. A mschmd_header structure will be still be returned, as
49427+ * with open(), but the mschmd_header::files field will be NULL. No
49428+ * files details will be automatically read. The fast_find() method
49429+ * must be used to obtain file details.
49430+ *
49431+ * In the case of an error occuring, NULL is returned and the error code
49432+ * is available from last_error().
49433+ *
49434+ * The filename pointer should be considered "in use" until close() is
49435+ * called on the CHM helpfile.
49436+ *
49437+ * @param self a self-referential pointer to the mschm_decompressor
49438+ * instance being called
49439+ * @param filename the filename of the CHM helpfile. This is passed
49440+ * directly to mspack_system::open().
49441+ * @return a pointer to a mschmd_header structure, or NULL on failure
49442+ * @see open(), close(), fast_find(), extract()
49443+ */
49444+ struct mschmd_header *(*fast_open)(struct mschm_decompressor *self,
49445+ const char *filename);
49446+
49447+ /**
49448+ * Finds file details quickly.
49449+ *
49450+ * Instead of reading all CHM helpfile headers and building a list of
49451+ * files, fast_open() and fast_find() are intended for finding file
49452+ * details only when they are needed. The CHM file format includes an
49453+ * on-disk file index to allow this.
49454+ *
49455+ * Given a case-sensitive filename, fast_find() will search the on-disk
49456+ * index for that file.
49457+ *
49458+ * If the file was found, the caller-provided mschmd_file structure will
49459+ * be filled out like so:
49460+ * - section: the correct value for the found file
49461+ * - offset: the correct value for the found file
49462+ * - length: the correct value for the found file
49463+ * - all other structure elements: NULL or 0
49464+ *
49465+ * If the file was not found, MSPACK_ERR_OK will still be returned as the
49466+ * result, but the caller-provided structure will be filled out like so:
49467+ * - section: NULL
49468+ * - offset: 0
49469+ * - length: 0
49470+ * - all other structure elements: NULL or 0
49471+ *
49472+ * This method is intended to be used in conjunction with CHM helpfiles
49473+ * opened with fast_open(), but it also works with helpfiles opened
49474+ * using the regular open().
49475+ *
49476+ * @param self a self-referential pointer to the mschm_decompressor
49477+ * instance being called
49478+ * @param chm the CHM helpfile to search for the file
49479+ * @param filename the filename of the file to search for
49480+ * @param f_ptr a pointer to a caller-provded mschmd_file structure
49481+ * @param f_size <tt>sizeof(struct mschmd_file)</tt>
49482+ * @return an error code, or MSPACK_ERR_OK if successful
49483+ * @see open(), close(), fast_find(), extract()
49484+ */
49485+ int (*fast_find)(struct mschm_decompressor *self,
49486+ struct mschmd_header *chm,
49487+ const char *filename,
49488+ struct mschmd_file *f_ptr,
49489+ int f_size);
49490+};
49491+
49492+/* --- support for .LIT (EBook) file format -------------------------------- */
49493+
49494+/** TODO */
49495+struct mslit_compressor {
49496+ int dummy;
49497+};
49498+
49499+/** TODO */
49500+struct mslit_decompressor {
49501+ int dummy;
49502+};
49503+
49504+
49505+/* --- support for .HLP (MS Help) file format ------------------------------ */
49506+
49507+/** TODO */
49508+struct mshlp_compressor {
49509+ int dummy;
49510+};
49511+
49512+/** TODO */
49513+struct mshlp_decompressor {
49514+ int dummy;
49515+};
49516+
49517+
49518+/* --- support for SZDD file format ---------------------------------------- */
49519+
49520+/** msszdd_compressor::set_param() parameter: the missing character */
49521+#define MSSZDDC_PARAM_MISSINGCHAR (0)
49522+
49523+/** msszddd_header::format value - a regular SZDD file */
49524+#define MSSZDD_FMT_NORMAL (0)
49525+
49526+/** msszddd_header::format value - a special QBasic SZDD file */
49527+#define MSSZDD_FMT_QBASIC (1)
49528+
49529+/**
49530+ * A structure which represents an SZDD compressed file.
49531+ *
49532+ * All fields are READ ONLY.
49533+ */
49534+struct msszddd_header {
49535+ /** The file format; either #MSSZDD_FMT_NORMAL or #MSSZDD_FMT_QBASIC */
49536+ int format;
49537+
49538+ /** The amount of data in the SZDD file once uncompressed. */
49539+ off_t length;
49540+
49541+ /**
49542+ * The last character in the filename, traditionally replaced with an
49543+ * underscore to show the file is compressed. The null character is used
49544+ * to show that this character has not been stored (e.g. because the
49545+ * filename is not known). Generally, only characters that may appear in
49546+ * an MS-DOS filename (except ".") are valid.
49547+ */
49548+ char missing_char;
49549+};
49550+
49551+/**
49552+ * A compressor for the SZDD file format.
49553+ *
49554+ * All fields are READ ONLY.
49555+ *
49556+ * @see mspack_create_szdd_compressor(), mspack_destroy_szdd_compressor()
49557+ */
49558+struct msszdd_compressor {
49559+ /**
49560+ * Reads an input file and creates a compressed output file in the
49561+ * SZDD compressed file format. The SZDD compression format is quick
49562+ * but gives poor compression. It is possible for the compressed output
49563+ * file to be larger than the input file.
49564+ *
49565+ * Conventionally, SZDD compressed files have the final character in
49566+ * their filename replaced with an underscore, to show they are
49567+ * compressed. The missing character is stored in the compressed file
49568+ * itself. This is due to the restricted filename conventions of MS-DOS,
49569+ * most operating systems, such as UNIX, simply append another file
49570+ * extension to the existing filename. As mspack does not deal with
49571+ * filenames, this is left up to you. If you wish to set the missing
49572+ * character stored in the file header, use set_param() with the
49573+ * #MSSZDDC_PARAM_MISSINGCHAR parameter.
49574+ *
49575+ * "Stream" compression (where the length of the input data is not
49576+ * known) is not possible. The length of the input data is stored in the
49577+ * header of the SZDD file and must therefore be known before any data
49578+ * is compressed. Due to technical limitations of the file format, the
49579+ * maximum size of uncompressed file that will be accepted is 2147483647
49580+ * bytes.
49581+ *
49582+ * @param self a self-referential pointer to the msszdd_compressor
49583+ * instance being called
49584+ * @param input the name of the file to compressed. This is passed
49585+ * passed directly to mspack_system::open()
49586+ * @param output the name of the file to write compressed data to.
49587+ * This is passed directly to mspack_system::open().
49588+ * @param length the length of the uncompressed file, or -1 to indicate
49589+ * that this should be determined automatically by using
49590+ * mspack_system::seek() on the input file.
49591+ * @return an error code, or MSPACK_ERR_OK if successful
49592+ * @see set_param()
49593+ */
49594+ int (*compress)(struct msszdd_compressor *self,
49595+ const char *input,
49596+ const char *output,
49597+ off_t length);
49598+
49599+ /**
49600+ * Sets an SZDD compression engine parameter.
49601+ *
49602+ * The following parameters are defined:
49603+
49604+ * - #MSSZDDC_PARAM_CHARACTER: the "missing character", the last character
49605+ * in the uncompressed file's filename, which is traditionally replaced
49606+ * with an underscore to show the file is compressed. Traditionally,
49607+ * this can only be a character that is a valid part of an MS-DOS,
49608+ * filename, but libmspack permits any character between 0x00 and 0xFF
49609+ * to be stored. 0x00 is the default, and it represents "no character
49610+ * stored".
49611+ *
49612+ * @param self a self-referential pointer to the msszdd_compressor
49613+ * instance being called
49614+ * @param param the parameter to set
49615+ * @param value the value to set the parameter to
49616+ * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there
49617+ * is a problem with either parameter or value.
49618+ * @see compress()
49619+ */
49620+ int (*set_param)(struct msszdd_compressor *self,
49621+ int param,
49622+ unsigned int value);
49623+
49624+ /**
49625+ * Returns the error code set by the most recently called method.
49626+ *
49627+ * @param self a self-referential pointer to the msszdd_compressor
49628+ * instance being called
49629+ * @return the most recent error code
49630+ * @see compress()
49631+ */
49632+ int (*last_error)(struct mschm_decompressor *self);
49633+};
49634+
49635+/**
49636+ * A decompressor for SZDD compressed files.
49637+ *
49638+ * All fields are READ ONLY.
49639+ *
49640+ * @see mspack_create_szdd_decompressor(), mspack_destroy_szdd_decompressor()
49641+ */
49642+struct msszdd_decompressor {
49643+ /**
49644+ * Opens a SZDD file and reads the header.
49645+ *
49646+ * If the file opened is a valid SZDD file, all headers will be read and
49647+ * a msszddd_header structure will be returned.
49648+ *
49649+ * In the case of an error occuring, NULL is returned and the error code
49650+ * is available from last_error().
49651+ *
49652+ * The filename pointer should be considered "in use" until close() is
49653+ * called on the SZDD file.
49654+ *
49655+ * @param self a self-referential pointer to the msszdd_decompressor
49656+ * instance being called
49657+ * @param filename the filename of the SZDD compressed file. This is
49658+ * passed directly to mspack_system::open().
49659+ * @return a pointer to a msszddd_header structure, or NULL on failure
49660+ * @see close()
49661+ */
49662+ struct msszddd_header *(*open)(struct msszdd_decompressor *self,
49663+ const char *filename);
49664+
49665+ /**
49666+ * Closes a previously opened SZDD file.
49667+ *
49668+ * This closes a SZDD file and frees the msszddd_header associated with
49669+ * it.
49670+ *
49671+ * The SZDD header pointer is now invalid and cannot be used again.
49672+ *
49673+ * @param self a self-referential pointer to the msszdd_decompressor
49674+ * instance being called
49675+ * @param szdd the SZDD file to close
49676+ * @see open()
49677+ */
49678+ void (*close)(struct msszdd_decompressor *self,
49679+ struct msszddd_header *szdd);
49680+
49681+ /**
49682+ * Extracts the compressed data from a SZDD file.
49683+ *
49684+ * This decompresses the compressed SZDD data stream and writes it to
49685+ * an output file.
49686+ *
49687+ * @param self a self-referential pointer to the msszdd_decompressor
49688+ * instance being called
49689+ * @param szdd the SZDD file to extract data from
49690+ * @param filename the filename to write the decompressed data to. This
49691+ * is passed directly to mspack_system::open().
49692+ * @return an error code, or MSPACK_ERR_OK if successful
49693+ */
49694+ int (*extract)(struct msszdd_decompressor *self,
49695+ struct msszddd_header *szdd,
49696+ const char *filename);
49697+
49698+ /**
49699+ * Decompresses an SZDD file to an output file in one step.
49700+ *
49701+ * This opens an SZDD file as input, reads the header, then decompresses
49702+ * the compressed data immediately to an output file, finally closing
49703+ * both the input and output file. It is more convenient to use than
49704+ * open() then extract() then close(), if you do not need to know the
49705+ * SZDD output size or missing character.
49706+ *
49707+ * @param self a self-referential pointer to the msszdd_decompressor
49708+ * instance being called
49709+ * @param input the filename of the input SZDD file. This is passed
49710+ * directly to mspack_system::open().
49711+ * @param output the filename to write the decompressed data to. This
49712+ * is passed directly to mspack_system::open().
49713+ * @return an error code, or MSPACK_ERR_OK if successful
49714+ */
49715+ int (*decompress)(struct msszdd_decompressor *self,
49716+ const char *input,
49717+ const char *output);
49718+
49719+ /**
49720+ * Returns the error code set by the most recently called method.
49721+ *
49722+ * This is useful for open() which does not return an
49723+ * error code directly.
49724+ *
49725+ * @param self a self-referential pointer to the msszdd_decompressor
49726+ * instance being called
49727+ * @return the most recent error code
49728+ * @see open(), extract(), decompress()
49729+ */
49730+ int (*last_error)(struct msszdd_decompressor *self);
49731+};
49732+
49733+/* --- support for KWAJ file format ---------------------------------------- */
49734+
49735+/** mskwaj_compressor::set_param() parameter: compression type */
49736+#define MSKWAJC_PARAM_COMP_TYPE (0)
49737+
49738+/** mskwaj_compressor::set_param() parameter: include the length of the
49739+ * uncompressed file in the header?
49740+ */
49741+#define MSKWAJC_PARAM_INCLUDE_LENGTH (1)
49742+
49743+/** KWAJ compression type: no compression. */
49744+#define MSKWAJ_COMP_NONE (0)
49745+/** KWAJ compression type: no compression, 0xFF XOR "encryption". */
49746+#define MSKWAJ_COMP_XOR (1)
49747+/** KWAJ compression type: LZSS (same method as SZDD) */
49748+#define MSKWAJ_COMP_SZDD (2)
49749+/** KWAJ compression type: LZ+Huffman compression */
49750+#define MSKWAJ_COMP_LZH (3)
49751+/** KWAJ compression type: MSZIP */
49752+#define MSKWAJ_COMP_MSZIP (4)
49753+
49754+/** KWAJ optional header flag: decompressed file length is included */
49755+#define MSKWAJ_HDR_HASLENGTH (0x01)
49756+
49757+/** KWAJ optional header flag: unknown 2-byte structure is included */
49758+#define MSKWAJ_HDR_HASUNKNOWN1 (0x02)
49759+
49760+/** KWAJ optional header flag: unknown multi-sized structure is included */
49761+#define MSKWAJ_HDR_HASUNKNOWN2 (0x04)
49762+
49763+/** KWAJ optional header flag: file name (no extension) is included */
49764+#define MSKWAJ_HDR_HASFILENAME (0x08)
49765+
49766+/** KWAJ optional header flag: file extension is included */
49767+#define MSKWAJ_HDR_HASFILEEXT (0x10)
49768+
49769+/** KWAJ optional header flag: extra text is included */
49770+#define MSKWAJ_HDR_HASEXTRATEXT (0x20)
49771+
49772+/**
49773+ * A structure which represents an KWAJ compressed file.
49774+ *
49775+ * All fields are READ ONLY.
49776+ */
49777+struct mskwajd_header {
49778+ /** The compression type; should be one of #MSKWAJ_COMP_NONE,
49779+ * #MSKWAJ_COMP_XOR, #MSKWAJ_COMP_SZDD or #MSKWAJ_COMP_LZH
49780+ */
49781+ unsigned short comp_type;
49782+
49783+ /** The offset in the file where the compressed data stream begins */
49784+ off_t data_offset;
49785+
49786+ /** Flags indicating which optional headers were included. */
49787+ int headers;
49788+
49789+ /** The amount of uncompressed data in the file, or 0 if not present. */
49790+ off_t length;
49791+
49792+ /** output filename, or NULL if not present */
49793+ char *filename;
49794+
49795+ /** extra uncompressed data (usually text) in the header.
49796+ * This data can contain nulls so use extra_length to get the size.
49797+ */
49798+ char *extra;
49799+
49800+ /** length of extra uncompressed data in the header */
49801+ unsigned short extra_length;
49802+};
49803+
49804+/**
49805+ * A compressor for the KWAJ file format.
49806+ *
49807+ * All fields are READ ONLY.
49808+ *
49809+ * @see mspack_create_kwaj_compressor(), mspack_destroy_kwaj_compressor()
49810+ */
49811+struct mskwaj_compressor {
49812+ /**
49813+ * Reads an input file and creates a compressed output file in the
49814+ * KWAJ compressed file format. The KWAJ compression format is quick
49815+ * but gives poor compression. It is possible for the compressed output
49816+ * file to be larger than the input file.
49817+ *
49818+ * @param self a self-referential pointer to the mskwaj_compressor
49819+ * instance being called
49820+ * @param input the name of the file to compressed. This is passed
49821+ * passed directly to mspack_system::open()
49822+ * @param output the name of the file to write compressed data to.
49823+ * This is passed directly to mspack_system::open().
49824+ * @param length the length of the uncompressed file, or -1 to indicate
49825+ * that this should be determined automatically by using
49826+ * mspack_system::seek() on the input file.
49827+ * @return an error code, or MSPACK_ERR_OK if successful
49828+ * @see set_param()
49829+ */
49830+ int (*compress)(struct mskwaj_compressor *self,
49831+ const char *input,
49832+ const char *output,
49833+ off_t length);
49834+
49835+ /**
49836+ * Sets an KWAJ compression engine parameter.
49837+ *
49838+ * The following parameters are defined:
49839+ *
49840+ * - #MSKWAJC_PARAM_COMP_TYPE: the compression method to use. Must
49841+ * be one of #MSKWAJC_COMP_NONE, #MSKWAJC_COMP_XOR, #MSKWAJ_COMP_SZDD
49842+ * or #MSKWAJ_COMP_LZH. The default is #MSKWAJ_COMP_LZH.
49843+ *
49844+ * - #MSKWAJC_PARAM_INCLUDE_LENGTH: a boolean; should the compressed
49845+ * output file should include the uncompressed length of the input
49846+ * file in the header? This adds 4 bytes to the size of the output
49847+ * file. A value of zero says "no", non-zero says "yes". The default
49848+ * is "no".
49849+ *
49850+ * @param self a self-referential pointer to the mskwaj_compressor
49851+ * instance being called
49852+ * @param param the parameter to set
49853+ * @param value the value to set the parameter to
49854+ * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there
49855+ * is a problem with either parameter or value.
49856+ * @see generate()
49857+ */
49858+ int (*set_param)(struct mskwaj_compressor *self,
49859+ int param,
49860+ unsigned int value);
49861+
49862+
49863+ /**
49864+ * Sets the original filename of the file before compression,
49865+ * which will be stored in the header of the output file.
49866+ *
49867+ * The filename should be a null-terminated string, it must be an
49868+ * MS-DOS "8.3" type filename (up to 8 bytes for the filename, then
49869+ * optionally a "." and up to 3 bytes for a filename extension).
49870+ *
49871+ * If NULL is passed as the filename, no filename is included in the
49872+ * header. This is the default.
49873+ *
49874+ * @param self a self-referential pointer to the mskwaj_compressor
49875+ * instance being called
49876+ * @param filename the original filename to use
49877+ * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if the
49878+ * filename is too long
49879+ */
49880+ int (*set_filename)(struct mskwaj_compressor *self,
49881+ const char *filename);
49882+
49883+ /**
49884+ * Sets arbitrary data that will be stored in the header of the
49885+ * output file, uncompressed. It can be up to roughly 64 kilobytes,
49886+ * as the overall size of the header must not exceed 65535 bytes.
49887+ * The data can contain null bytes if desired.
49888+ *
49889+ * If NULL is passed as the data pointer, or zero is passed as the
49890+ * length, no extra data is included in the header. This is the
49891+ * default.
49892+ *
49893+ * @param self a self-referential pointer to the mskwaj_compressor
49894+ * instance being called
49895+ * @param data a pointer to the data to be stored in the header
49896+ * @param bytes the length of the data in bytes
49897+ * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS extra data
49898+ * is too long
49899+ */
49900+ int (*set_extra_data)(struct mskwaj_compressor *self,
49901+ void *data,
49902+ size_t bytes);
49903+
49904+ /**
49905+ * Returns the error code set by the most recently called method.
49906+ *
49907+ * @param self a self-referential pointer to the mskwaj_compressor
49908+ * instance being called
49909+ * @return the most recent error code
49910+ * @see compress()
49911+ */
49912+ int (*last_error)(struct mschm_decompressor *self);
49913+};
49914+
49915+/**
49916+ * A decompressor for KWAJ compressed files.
49917+ *
49918+ * All fields are READ ONLY.
49919+ *
49920+ * @see mspack_create_kwaj_decompressor(), mspack_destroy_kwaj_decompressor()
49921+ */
49922+struct mskwaj_decompressor {
49923+ /**
49924+ * Opens a KWAJ file and reads the header.
49925+ *
49926+ * If the file opened is a valid KWAJ file, all headers will be read and
49927+ * a mskwajd_header structure will be returned.
49928+ *
49929+ * In the case of an error occuring, NULL is returned and the error code
49930+ * is available from last_error().
49931+ *
49932+ * The filename pointer should be considered "in use" until close() is
49933+ * called on the KWAJ file.
49934+ *
49935+ * @param self a self-referential pointer to the mskwaj_decompressor
49936+ * instance being called
49937+ * @param filename the filename of the KWAJ compressed file. This is
49938+ * passed directly to mspack_system::open().
49939+ * @return a pointer to a mskwajd_header structure, or NULL on failure
49940+ * @see close()
49941+ */
49942+ struct mskwajd_header *(*open)(struct mskwaj_decompressor *self,
49943+ const char *filename);
49944+
49945+ /**
49946+ * Closes a previously opened KWAJ file.
49947+ *
49948+ * This closes a KWAJ file and frees the mskwajd_header associated
49949+ * with it. The KWAJ header pointer is now invalid and cannot be
49950+ * used again.
49951+ *
49952+ * @param self a self-referential pointer to the mskwaj_decompressor
49953+ * instance being called
49954+ * @param kwaj the KWAJ file to close
49955+ * @see open()
49956+ */
49957+ void (*close)(struct mskwaj_decompressor *self,
49958+ struct mskwajd_header *kwaj);
49959+
49960+ /**
49961+ * Extracts the compressed data from a KWAJ file.
49962+ *
49963+ * This decompresses the compressed KWAJ data stream and writes it to
49964+ * an output file.
49965+ *
49966+ * @param self a self-referential pointer to the mskwaj_decompressor
49967+ * instance being called
49968+ * @param kwaj the KWAJ file to extract data from
49969+ * @param filename the filename to write the decompressed data to. This
49970+ * is passed directly to mspack_system::open().
49971+ * @return an error code, or MSPACK_ERR_OK if successful
49972+ */
49973+ int (*extract)(struct mskwaj_decompressor *self,
49974+ struct mskwajd_header *kwaj,
49975+ const char *filename);
49976+
49977+ /**
49978+ * Decompresses an KWAJ file to an output file in one step.
49979+ *
49980+ * This opens an KWAJ file as input, reads the header, then decompresses
49981+ * the compressed data immediately to an output file, finally closing
49982+ * both the input and output file. It is more convenient to use than
49983+ * open() then extract() then close(), if you do not need to know the
49984+ * KWAJ output size or output filename.
49985+ *
49986+ * @param self a self-referential pointer to the mskwaj_decompressor
49987+ * instance being called
49988+ * @param input the filename of the input KWAJ file. This is passed
49989+ * directly to mspack_system::open().
49990+ * @param output the filename to write the decompressed data to. This
49991+ * is passed directly to mspack_system::open().
49992+ * @return an error code, or MSPACK_ERR_OK if successful
49993+ */
49994+ int (*decompress)(struct mskwaj_decompressor *self,
49995+ const char *input,
49996+ const char *output);
49997+
49998+ /**
49999+ * Returns the error code set by the most recently called method.
50000+ *
50001+ * This is useful for open() which does not return an
50002+ * error code directly.
50003+ *
50004+ * @param self a self-referential pointer to the mskwaj_decompressor
50005+ * instance being called
50006+ * @return the most recent error code
50007+ * @see open(), search()
50008+ */
50009+ int (*last_error)(struct mskwaj_decompressor *self);
50010+};
50011+
50012+/* --- support for .LZX (Offline Address Book) file format ----------------- */
50013+
50014+/**
50015+ * A compressor for the Offline Address Book (OAB) format.
50016+ *
50017+ * All fields are READ ONLY.
50018+ *
50019+ * @see mspack_create_oab_compressor(), mspack_destroy_oab_compressor()
50020+ */
50021+struct msoab_compressor {
50022+ /**
50023+ * Compress a full OAB file.
50024+ *
50025+ * The input file will be read and the compressed contents written to the
50026+ * output file.
50027+ *
50028+ * @param self a self-referential pointer to the msoab_decompressor
50029+ * instance being called
50030+ * @param input the filename of the input file. This is passed
50031+ * directly to mspack_system::open().
50032+ * @param output the filename of the output file. This is passed
50033+ * directly to mspack_system::open().
50034+ * @return an error code, or MSPACK_ERR_OK if successful
50035+ */
50036+ int (*compress) (struct msoab_compressor *self,
50037+ const char *input,
50038+ const char *output);
50039+
50040+ /**
50041+ * Generate a compressed incremental OAB patch file.
50042+ *
50043+ * The two uncompressed files "input" and "base" will be read, and an
50044+ * incremental patch to generate "input" from "base" will be written to
50045+ * the output file.
50046+ *
50047+ * @param self a self-referential pointer to the msoab_compressor
50048+ * instance being called
50049+ * @param input the filename of the input file containing the new
50050+ * version of its contents. This is passed directly
50051+ * to mspack_system::open().
50052+ * @param base the filename of the original base file containing
50053+ * the old version of its contents, against which the
50054+ * incremental patch shall generated. This is passed
50055+ * directly to mspack_system::open().
50056+ * @param output the filename of the output file. This is passed
50057+ * directly to mspack_system::open().
50058+ * @return an error code, or MSPACK_ERR_OK if successful
50059+ */
50060+ int (*compress_incremental) (struct msoab_compressor *self,
50061+ const char *input,
50062+ const char *base,
50063+ const char *output);
50064+};
50065+
50066+/**
50067+ * A decompressor for .LZX (Offline Address Book) files
50068+ *
50069+ * All fields are READ ONLY.
50070+ *
50071+ * @see mspack_create_oab_decompressor(), mspack_destroy_oab_decompressor()
50072+ */
50073+struct msoab_decompressor {
50074+ /**
50075+ * Decompresses a full Offline Address Book file.
50076+ *
50077+ * If the input file is a valid compressed Offline Address Book file,
50078+ * it will be read and the decompressed contents will be written to
50079+ * the output file.
50080+ *
50081+ * @param self a self-referential pointer to the msoab_decompressor
50082+ * instance being called
50083+ * @param input the filename of the input file. This is passed
50084+ * directly to mspack_system::open().
50085+ * @param output the filename of the output file. This is passed
50086+ * directly to mspack_system::open().
50087+ * @return an error code, or MSPACK_ERR_OK if successful
50088+ */
50089+ int (*decompress) (struct msoab_decompressor *self,
50090+ const char *input,
50091+ const char *output);
50092+
50093+ /**
50094+ * Decompresses an Offline Address Book with an incremental patch file.
50095+ *
50096+ * This requires both a full UNCOMPRESSED Offline Address Book file to
50097+ * act as the "base", and a compressed incremental patch file as input.
50098+ * If the input file is valid, it will be decompressed with reference to
50099+ * the base file, and the decompressed contents will be written to the
50100+ * output file.
50101+ *
50102+ * There is no way to tell what the right base file is for the given
50103+ * incremental patch, but if you get it wrong, this will usually result
50104+ * in incorrect data being decompressed, which will then fail a checksum
50105+ * test.
50106+ *
50107+ * @param self a self-referential pointer to the msoab_decompressor
50108+ * instance being called
50109+ * @param input the filename of the input file. This is passed
50110+ * directly to mspack_system::open().
50111+ * @param base the filename of the base file to which the
50112+ * incremental patch shall be applied. This is passed
50113+ * directly to mspack_system::open().
50114+ * @param output the filename of the output file. This is passed
50115+ * directly to mspack_system::open().
50116+ * @return an error code, or MSPACK_ERR_OK if successful
50117+ */
50118+ int (*decompress_incremental) (struct msoab_decompressor *self,
50119+ const char *input,
50120+ const char *base,
50121+ const char *output);
50122+};
50123+
50124+#ifdef __cplusplus
50125+}
50126+#endif
50127+
50128+#endif
50129diff --git a/libclamav/libmspack-0.4alpha/mspack/mszip.h b/libclamav/libmspack-0.4alpha/mspack/mszip.h
50130new file mode 100644
50131index 000000000000..0fe79e4af516
50132--- /dev/null
50133+++ b/libclamav/libmspack-0.4alpha/mspack/mszip.h
50134@@ -0,0 +1,126 @@
50135+/* This file is part of libmspack.
50136+ * (C) 2003-2004 Stuart Caie.
50137+ *
50138+ * The deflate method was created by Phil Katz. MSZIP is equivalent to the
50139+ * deflate method.
50140+ *
50141+ * libmspack is free software; you can redistribute it and/or modify it under
50142+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
50143+ *
50144+ * For further details, see the file COPYING.LIB distributed with libmspack
50145+ */
50146+
50147+#ifndef MSPACK_MSZIP_H
50148+#define MSPACK_MSZIP_H 1
50149+
50150+#ifdef __cplusplus
50151+extern "C" {
50152+#endif
50153+
50154+/* MSZIP (deflate) compression / (inflate) decompression definitions */
50155+
50156+#define MSZIP_FRAME_SIZE (32768) /* size of LZ history window */
50157+#define MSZIP_LITERAL_MAXSYMBOLS (288) /* literal/length huffman tree */
50158+#define MSZIP_LITERAL_TABLEBITS (9)
50159+#define MSZIP_DISTANCE_MAXSYMBOLS (32) /* distance huffman tree */
50160+#define MSZIP_DISTANCE_TABLEBITS (6)
50161+
50162+/* if there are less direct lookup entries than symbols, the longer
50163+ * code pointers will be <= maxsymbols. This must not happen, or we
50164+ * will decode entries badly */
50165+#if (1 << MSZIP_LITERAL_TABLEBITS) < (MSZIP_LITERAL_MAXSYMBOLS * 2)
50166+# define MSZIP_LITERAL_TABLESIZE (MSZIP_LITERAL_MAXSYMBOLS * 4)
50167+#else
50168+# define MSZIP_LITERAL_TABLESIZE ((1 << MSZIP_LITERAL_TABLEBITS) + \
50169+ (MSZIP_LITERAL_MAXSYMBOLS * 2))
50170+#endif
50171+
50172+#if (1 << MSZIP_DISTANCE_TABLEBITS) < (MSZIP_DISTANCE_MAXSYMBOLS * 2)
50173+# define MSZIP_DISTANCE_TABLESIZE (MSZIP_DISTANCE_MAXSYMBOLS * 4)
50174+#else
50175+# define MSZIP_DISTANCE_TABLESIZE ((1 << MSZIP_DISTANCE_TABLEBITS) + \
50176+ (MSZIP_DISTANCE_MAXSYMBOLS * 2))
50177+#endif
50178+
50179+struct mszipd_stream {
50180+ struct mspack_system *sys; /* I/O routines */
50181+ struct mspack_file *input; /* input file handle */
50182+ struct mspack_file *output; /* output file handle */
50183+ unsigned int window_posn; /* offset within window */
50184+
50185+ /* inflate() will call this whenever the window should be emptied. */
50186+ int (*flush_window)(struct mszipd_stream *, unsigned int);
50187+
50188+ int error, repair_mode, bytes_output;
50189+
50190+ /* I/O buffering */
50191+ unsigned char *inbuf, *i_ptr, *i_end, *o_ptr, *o_end, input_end;
50192+ unsigned int bit_buffer, bits_left, inbuf_size;
50193+
50194+
50195+ /* huffman code lengths */
50196+ unsigned char LITERAL_len[MSZIP_LITERAL_MAXSYMBOLS];
50197+ unsigned char DISTANCE_len[MSZIP_DISTANCE_MAXSYMBOLS];
50198+
50199+ /* huffman decoding tables */
50200+ unsigned short LITERAL_table [MSZIP_LITERAL_TABLESIZE];
50201+ unsigned short DISTANCE_table[MSZIP_DISTANCE_TABLESIZE];
50202+
50203+ /* 32kb history window */
50204+ unsigned char window[MSZIP_FRAME_SIZE];
50205+};
50206+
50207+/* allocates MS-ZIP decompression stream for decoding the given stream.
50208+ *
50209+ * - uses system->alloc() to allocate memory
50210+ *
50211+ * - returns NULL if not enough memory
50212+ *
50213+ * - input_buffer_size is how many bytes to use as an input bitstream buffer
50214+ *
50215+ * - if repair_mode is non-zero, errors in decompression will be skipped
50216+ * and 'holes' left will be filled with zero bytes. This allows at least
50217+ * a partial recovery of erroneous data.
50218+ */
50219+extern struct mszipd_stream *mszipd_init(struct mspack_system *system,
50220+ struct mspack_file *input,
50221+ struct mspack_file *output,
50222+ int input_buffer_size,
50223+ int repair_mode);
50224+
50225+/* decompresses, or decompresses more of, an MS-ZIP stream.
50226+ *
50227+ * - out_bytes of data will be decompressed and the function will return
50228+ * with an MSPACK_ERR_OK return code.
50229+ *
50230+ * - decompressing will stop as soon as out_bytes is reached. if the true
50231+ * amount of bytes decoded spills over that amount, they will be kept for
50232+ * a later invocation of mszipd_decompress().
50233+ *
50234+ * - the output bytes will be passed to the system->write() function given in
50235+ * mszipd_init(), using the output file handle given in mszipd_init(). More
50236+ * than one call may be made to system->write()
50237+ *
50238+ * - MS-ZIP will read input bytes as necessary using the system->read()
50239+ * function given in mszipd_init(), using the input file handle given in
50240+ * mszipd_init(). This will continue until system->read() returns 0 bytes,
50241+ * or an error.
50242+ */
50243+extern int mszipd_decompress(struct mszipd_stream *zip, off_t out_bytes);
50244+
50245+/* decompresses an entire MS-ZIP stream in a KWAJ file. Acts very much
50246+ * like mszipd_decompress(), but doesn't take an out_bytes parameter
50247+ */
50248+extern int mszipd_decompress_kwaj(struct mszipd_stream *zip);
50249+
50250+/* frees all stream associated with an MS-ZIP data stream
50251+ *
50252+ * - calls system->free() using the system pointer given in mszipd_init()
50253+ */
50254+void mszipd_free(struct mszipd_stream *zip);
50255+
50256+#ifdef __cplusplus
50257+}
50258+#endif
50259+
50260+#endif
50261diff --git a/libclamav/libmspack-0.4alpha/mspack/mszipc.c b/libclamav/libmspack-0.4alpha/mspack/mszipc.c
50262new file mode 100644
50263index 000000000000..2f1ecb2e8757
50264--- /dev/null
50265+++ b/libclamav/libmspack-0.4alpha/mspack/mszipc.c
50266@@ -0,0 +1,18 @@
50267+/* This file is part of libmspack.
50268+ * (C) 2003-2004 Stuart Caie.
50269+ *
50270+ * The deflate method was created by Phil Katz. MSZIP is equivalent to the
50271+ * deflate method.
50272+ *
50273+ * libmspack is free software; you can redistribute it and/or modify it under
50274+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
50275+ *
50276+ * For further details, see the file COPYING.LIB distributed with libmspack
50277+ */
50278+
50279+/* MS-ZIP compression implementation */
50280+
50281+#include <system.h>
50282+#include <mszip.h>
50283+
50284+/* todo */
50285diff --git a/libclamav/libmspack-0.4alpha/mspack/mszipd.c b/libclamav/libmspack-0.4alpha/mspack/mszipd.c
50286new file mode 100644
50287index 000000000000..cd85bb9fa1ca
50288--- /dev/null
50289+++ b/libclamav/libmspack-0.4alpha/mspack/mszipd.c
50290@@ -0,0 +1,514 @@
50291+/* This file is part of libmspack.
50292+ * (C) 2003-2010 Stuart Caie.
50293+ *
50294+ * The deflate method was created by Phil Katz. MSZIP is equivalent to the
50295+ * deflate method.
50296+ *
50297+ * libmspack is free software; you can redistribute it and/or modify it under
50298+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
50299+ *
50300+ * For further details, see the file COPYING.LIB distributed with libmspack
50301+ */
50302+
50303+/* MS-ZIP decompression implementation. */
50304+
50305+#include <system.h>
50306+#include <mszip.h>
50307+
50308+/* import bit-reading macros and code */
50309+#define BITS_TYPE struct mszipd_stream
50310+#define BITS_VAR zip
50311+#define BITS_ORDER_LSB
50312+#define BITS_LSB_TABLE
50313+#define READ_BYTES do { \
50314+ READ_IF_NEEDED; \
50315+ INJECT_BITS(*i_ptr++, 8); \
50316+} while (0)
50317+#include <readbits.h>
50318+
50319+/* import huffman macros and code */
50320+#define TABLEBITS(tbl) MSZIP_##tbl##_TABLEBITS
50321+#define MAXSYMBOLS(tbl) MSZIP_##tbl##_MAXSYMBOLS
50322+#define HUFF_TABLE(tbl,idx) zip->tbl##_table[idx]
50323+#define HUFF_LEN(tbl,idx) zip->tbl##_len[idx]
50324+#define HUFF_ERROR return INF_ERR_HUFFSYM
50325+#include <readhuff.h>
50326+
50327+#define FLUSH_IF_NEEDED do { \
50328+ if (zip->window_posn == MSZIP_FRAME_SIZE) { \
50329+ if (zip->flush_window(zip, MSZIP_FRAME_SIZE)) { \
50330+ return INF_ERR_FLUSH; \
50331+ } \
50332+ zip->window_posn = 0; \
50333+ } \
50334+} while (0)
50335+
50336+/* match lengths for literal codes 257.. 285 */
50337+static const unsigned short lit_lengths[29] = {
50338+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27,
50339+ 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258
50340+};
50341+
50342+/* match offsets for distance codes 0 .. 29 */
50343+static const unsigned short dist_offsets[30] = {
50344+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385,
50345+ 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
50346+};
50347+
50348+/* extra bits required for literal codes 257.. 285 */
50349+static const unsigned char lit_extrabits[29] = {
50350+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2,
50351+ 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0
50352+};
50353+
50354+/* extra bits required for distance codes 0 .. 29 */
50355+static const unsigned char dist_extrabits[30] = {
50356+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6,
50357+ 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13
50358+};
50359+
50360+/* the order of the bit length Huffman code lengths */
50361+static const unsigned char bitlen_order[19] = {
50362+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
50363+};
50364+
50365+/* inflate() error codes */
50366+#define INF_ERR_BLOCKTYPE (-1) /* unknown block type */
50367+#define INF_ERR_COMPLEMENT (-2) /* block size complement mismatch */
50368+#define INF_ERR_FLUSH (-3) /* error from flush_window() callback */
50369+#define INF_ERR_BITBUF (-4) /* too many bits in bit buffer */
50370+#define INF_ERR_SYMLENS (-5) /* too many symbols in blocktype 2 header */
50371+#define INF_ERR_BITLENTBL (-6) /* failed to build bitlens huffman table */
50372+#define INF_ERR_LITERALTBL (-7) /* failed to build literals huffman table */
50373+#define INF_ERR_DISTANCETBL (-8) /* failed to build distance huffman table */
50374+#define INF_ERR_BITOVERRUN (-9) /* bitlen RLE code goes over table size */
50375+#define INF_ERR_BADBITLEN (-10) /* invalid bit-length code */
50376+#define INF_ERR_LITCODE (-11) /* out-of-range literal code */
50377+#define INF_ERR_DISTCODE (-12) /* out-of-range distance code */
50378+#define INF_ERR_DISTANCE (-13) /* somehow, distance is beyond 32k */
50379+#define INF_ERR_HUFFSYM (-14) /* out of bits decoding huffman symbol */
50380+
50381+static int zip_read_lens(struct mszipd_stream *zip) {
50382+ /* for the bit buffer and huffman decoding */
50383+ register unsigned int bit_buffer;
50384+ register int bits_left;
50385+ unsigned char *i_ptr, *i_end;
50386+
50387+ /* bitlen Huffman codes -- immediate lookup, 7 bit max code length */
50388+ unsigned short bl_table[(1 << 7)];
50389+ unsigned char bl_len[19];
50390+
50391+ unsigned char lens[MSZIP_LITERAL_MAXSYMBOLS + MSZIP_DISTANCE_MAXSYMBOLS];
50392+ unsigned int lit_codes, dist_codes, code, last_code=0, bitlen_codes, i, run;
50393+
50394+ RESTORE_BITS;
50395+
50396+ /* read the number of codes */
50397+ READ_BITS(lit_codes, 5); lit_codes += 257;
50398+ READ_BITS(dist_codes, 5); dist_codes += 1;
50399+ READ_BITS(bitlen_codes, 4); bitlen_codes += 4;
50400+ if (lit_codes > MSZIP_LITERAL_MAXSYMBOLS) return INF_ERR_SYMLENS;
50401+ if (dist_codes > MSZIP_DISTANCE_MAXSYMBOLS) return INF_ERR_SYMLENS;
50402+
50403+ /* read in the bit lengths in their unusual order */
50404+ for (i = 0; i < bitlen_codes; i++) READ_BITS(bl_len[bitlen_order[i]], 3);
50405+ while (i < 19) bl_len[bitlen_order[i++]] = 0;
50406+
50407+ /* create decoding table with an immediate lookup */
50408+ if (make_decode_table(19, 7, &bl_len[0], &bl_table[0])) {
50409+ return INF_ERR_BITLENTBL;
50410+ }
50411+
50412+ /* read literal / distance code lengths */
50413+ for (i = 0; i < (lit_codes + dist_codes); i++) {
50414+ /* single-level huffman lookup */
50415+ ENSURE_BITS(7);
50416+ code = bl_table[PEEK_BITS(7)];
50417+ REMOVE_BITS(bl_len[code]);
50418+
50419+ if (code < 16) lens[i] = last_code = code;
50420+ else {
50421+ switch (code) {
50422+ case 16: READ_BITS(run, 2); run += 3; code = last_code; break;
50423+ case 17: READ_BITS(run, 3); run += 3; code = 0; break;
50424+ case 18: READ_BITS(run, 7); run += 11; code = 0; break;
50425+ default: D(("bad code!: %u", code)) return INF_ERR_BADBITLEN;
50426+ }
50427+ if ((i + run) > (lit_codes + dist_codes)) return INF_ERR_BITOVERRUN;
50428+ while (run--) lens[i++] = code;
50429+ i--;
50430+ }
50431+ }
50432+
50433+ /* copy LITERAL code lengths and clear any remaining */
50434+ i = lit_codes;
50435+ zip->sys->copy(&lens[0], &zip->LITERAL_len[0], i);
50436+ while (i < MSZIP_LITERAL_MAXSYMBOLS) zip->LITERAL_len[i++] = 0;
50437+
50438+ i = dist_codes;
50439+ zip->sys->copy(&lens[lit_codes], &zip->DISTANCE_len[0], i);
50440+ while (i < MSZIP_DISTANCE_MAXSYMBOLS) zip->DISTANCE_len[i++] = 0;
50441+
50442+ STORE_BITS;
50443+ return 0;
50444+}
50445+
50446+/* a clean implementation of RFC 1951 / inflate */
50447+static int inflate(struct mszipd_stream *zip) {
50448+ unsigned int last_block, block_type, distance, length, this_run, i;
50449+
50450+ /* for the bit buffer and huffman decoding */
50451+ register unsigned int bit_buffer;
50452+ register int bits_left;
50453+ register unsigned short sym;
50454+ unsigned char *i_ptr, *i_end;
50455+
50456+ RESTORE_BITS;
50457+
50458+ do {
50459+ /* read in last block bit */
50460+ READ_BITS(last_block, 1);
50461+
50462+ /* read in block type */
50463+ READ_BITS(block_type, 2);
50464+
50465+ if (block_type == 0) {
50466+ /* uncompressed block */
50467+ unsigned char lens_buf[4];
50468+
50469+ /* go to byte boundary */
50470+ i = bits_left & 7; REMOVE_BITS(i);
50471+
50472+ /* read 4 bytes of data, emptying the bit-buffer if necessary */
50473+ for (i = 0; (bits_left >= 8); i++) {
50474+ if (i == 4) return INF_ERR_BITBUF;
50475+ lens_buf[i] = PEEK_BITS(8);
50476+ REMOVE_BITS(8);
50477+ }
50478+ if (bits_left != 0) return INF_ERR_BITBUF;
50479+ while (i < 4) {
50480+ READ_IF_NEEDED;
50481+ lens_buf[i++] = *i_ptr++;
50482+ }
50483+
50484+ /* get the length and its complement */
50485+ length = lens_buf[0] | (lens_buf[1] << 8);
50486+ i = lens_buf[2] | (lens_buf[3] << 8);
50487+ if (length != (~i & 0xFFFF)) return INF_ERR_COMPLEMENT;
50488+
50489+ /* read and copy the uncompressed data into the window */
50490+ while (length > 0) {
50491+ READ_IF_NEEDED;
50492+
50493+ this_run = length;
50494+ if (this_run > (unsigned int)(i_end - i_ptr)) this_run = i_end - i_ptr;
50495+ if (this_run > (MSZIP_FRAME_SIZE - zip->window_posn))
50496+ this_run = MSZIP_FRAME_SIZE - zip->window_posn;
50497+
50498+ zip->sys->copy(i_ptr, &zip->window[zip->window_posn], this_run);
50499+ zip->window_posn += this_run;
50500+ i_ptr += this_run;
50501+ length -= this_run;
50502+ FLUSH_IF_NEEDED;
50503+ }
50504+ }
50505+ else if ((block_type == 1) || (block_type == 2)) {
50506+ /* Huffman-compressed LZ77 block */
50507+ unsigned int match_posn, code;
50508+
50509+ if (block_type == 1) {
50510+ /* block with fixed Huffman codes */
50511+ i = 0;
50512+ while (i < 144) zip->LITERAL_len[i++] = 8;
50513+ while (i < 256) zip->LITERAL_len[i++] = 9;
50514+ while (i < 280) zip->LITERAL_len[i++] = 7;
50515+ while (i < 288) zip->LITERAL_len[i++] = 8;
50516+ for (i = 0; i < 32; i++) zip->DISTANCE_len[i] = 5;
50517+ }
50518+ else {
50519+ /* block with dynamic Huffman codes */
50520+ STORE_BITS;
50521+ if ((i = zip_read_lens(zip))) return i;
50522+ RESTORE_BITS;
50523+ }
50524+
50525+ /* now huffman lengths are read for either kind of block,
50526+ * create huffman decoding tables */
50527+ if (make_decode_table(MSZIP_LITERAL_MAXSYMBOLS, MSZIP_LITERAL_TABLEBITS,
50528+ &zip->LITERAL_len[0], &zip->LITERAL_table[0]))
50529+ {
50530+ return INF_ERR_LITERALTBL;
50531+ }
50532+
50533+ if (make_decode_table(MSZIP_DISTANCE_MAXSYMBOLS,MSZIP_DISTANCE_TABLEBITS,
50534+ &zip->DISTANCE_len[0], &zip->DISTANCE_table[0]))
50535+ {
50536+ return INF_ERR_DISTANCETBL;
50537+ }
50538+
50539+ /* decode forever until end of block code */
50540+ for (;;) {
50541+ READ_HUFFSYM(LITERAL, code);
50542+ if (code < 256) {
50543+ zip->window[zip->window_posn++] = (unsigned char) code;
50544+ FLUSH_IF_NEEDED;
50545+ }
50546+ else if (code == 256) {
50547+ /* END OF BLOCK CODE: loop break point */
50548+ break;
50549+ }
50550+ else {
50551+ code -= 257; /* codes 257-285 are matches */
50552+ if (code >= 29) return INF_ERR_LITCODE; /* codes 286-287 are illegal */
50553+ READ_BITS_T(length, lit_extrabits[code]);
50554+ length += lit_lengths[code];
50555+
50556+ READ_HUFFSYM(DISTANCE, code);
50557+ if (code > 30) return INF_ERR_DISTCODE;
50558+ READ_BITS_T(distance, dist_extrabits[code]);
50559+ distance += dist_offsets[code];
50560+
50561+ /* match position is window position minus distance. If distance
50562+ * is more than window position numerically, it must 'wrap
50563+ * around' the frame size. */
50564+ match_posn = ((distance > zip->window_posn) ? MSZIP_FRAME_SIZE : 0)
50565+ + zip->window_posn - distance;
50566+
50567+ /* copy match */
50568+ if (length < 12) {
50569+ /* short match, use slower loop but no loop setup code */
50570+ while (length--) {
50571+ zip->window[zip->window_posn++] = zip->window[match_posn++];
50572+ match_posn &= MSZIP_FRAME_SIZE - 1;
50573+ FLUSH_IF_NEEDED;
50574+ }
50575+ }
50576+ else {
50577+ /* longer match, use faster loop but with setup expense */
50578+ unsigned char *runsrc, *rundest;
50579+ do {
50580+ this_run = length;
50581+ if ((match_posn + this_run) > MSZIP_FRAME_SIZE)
50582+ this_run = MSZIP_FRAME_SIZE - match_posn;
50583+ if ((zip->window_posn + this_run) > MSZIP_FRAME_SIZE)
50584+ this_run = MSZIP_FRAME_SIZE - zip->window_posn;
50585+
50586+ rundest = &zip->window[zip->window_posn]; zip->window_posn += this_run;
50587+ runsrc = &zip->window[match_posn]; match_posn += this_run;
50588+ length -= this_run;
50589+ while (this_run--) *rundest++ = *runsrc++;
50590+ if (match_posn == MSZIP_FRAME_SIZE) match_posn = 0;
50591+ FLUSH_IF_NEEDED;
50592+ } while (length > 0);
50593+ }
50594+
50595+ } /* else (code >= 257) */
50596+
50597+ } /* for(;;) -- break point at 'code == 256' */
50598+ }
50599+ else {
50600+ /* block_type == 3 -- bad block type */
50601+ return INF_ERR_BLOCKTYPE;
50602+ }
50603+ } while (!last_block);
50604+
50605+ /* flush the remaining data */
50606+ if (zip->window_posn) {
50607+ if (zip->flush_window(zip, zip->window_posn)) return INF_ERR_FLUSH;
50608+ }
50609+ STORE_BITS;
50610+
50611+ /* return success */
50612+ return 0;
50613+}
50614+
50615+/* inflate() calls this whenever the window should be flushed. As
50616+ * MSZIP only expands to the size of the window, the implementation used
50617+ * simply keeps track of the amount of data flushed, and if more than 32k
50618+ * is flushed, an error is raised.
50619+ */
50620+static int mszipd_flush_window(struct mszipd_stream *zip,
50621+ unsigned int data_flushed)
50622+{
50623+ zip->bytes_output += data_flushed;
50624+ if (zip->bytes_output > MSZIP_FRAME_SIZE) {
50625+ D(("overflow: %u bytes flushed, total is now %u",
50626+ data_flushed, zip->bytes_output))
50627+ return 1;
50628+ }
50629+ return 0;
50630+}
50631+
50632+struct mszipd_stream *mszipd_init(struct mspack_system *system,
50633+ struct mspack_file *input,
50634+ struct mspack_file *output,
50635+ int input_buffer_size,
50636+ int repair_mode)
50637+{
50638+ struct mszipd_stream *zip;
50639+
50640+ if (!system) return NULL;
50641+
50642+ input_buffer_size = (input_buffer_size + 1) & -2;
50643+ if (!input_buffer_size) return NULL;
50644+
50645+ /* allocate decompression state */
50646+ if (!(zip = (struct mszipd_stream *) system->alloc(system, sizeof(struct mszipd_stream)))) {
50647+ return NULL;
50648+ }
50649+
50650+ /* allocate input buffer */
50651+ zip->inbuf = (unsigned char *) system->alloc(system, (size_t) input_buffer_size);
50652+ if (!zip->inbuf) {
50653+ system->free(zip);
50654+ return NULL;
50655+ }
50656+
50657+ /* initialise decompression state */
50658+ zip->sys = system;
50659+ zip->input = input;
50660+ zip->output = output;
50661+ zip->inbuf_size = input_buffer_size;
50662+ zip->input_end = 0;
50663+ zip->error = MSPACK_ERR_OK;
50664+ zip->repair_mode = repair_mode;
50665+ zip->flush_window = &mszipd_flush_window;
50666+
50667+ zip->i_ptr = zip->i_end = &zip->inbuf[0];
50668+ zip->o_ptr = zip->o_end = NULL;
50669+ zip->bit_buffer = 0; zip->bits_left = 0;
50670+ return zip;
50671+}
50672+
50673+int mszipd_decompress(struct mszipd_stream *zip, off_t out_bytes) {
50674+ /* for the bit buffer */
50675+ register unsigned int bit_buffer;
50676+ register int bits_left;
50677+ unsigned char *i_ptr, *i_end;
50678+
50679+ int i, state, error;
50680+
50681+ /* easy answers */
50682+ if (!zip || (out_bytes < 0)) return MSPACK_ERR_ARGS;
50683+ if (zip->error) return zip->error;
50684+
50685+ /* flush out any stored-up bytes before we begin */
50686+ i = zip->o_end - zip->o_ptr;
50687+ if ((off_t) i > out_bytes) i = (int) out_bytes;
50688+ if (i) {
50689+ if (zip->sys->write(zip->output, zip->o_ptr, i) != i) {
50690+ return zip->error = MSPACK_ERR_WRITE;
50691+ }
50692+ zip->o_ptr += i;
50693+ out_bytes -= i;
50694+ }
50695+ if (out_bytes == 0) return MSPACK_ERR_OK;
50696+
50697+
50698+ while (out_bytes > 0) {
50699+ /* unpack another block */
50700+ RESTORE_BITS;
50701+
50702+ /* skip to next read 'CK' header */
50703+ i = bits_left & 7; REMOVE_BITS(i); /* align to bytestream */
50704+ state = 0;
50705+ do {
50706+ READ_BITS(i, 8);
50707+ if (i == 'C') state = 1;
50708+ else if ((state == 1) && (i == 'K')) state = 2;
50709+ else state = 0;
50710+ } while (state != 2);
50711+
50712+ /* inflate a block, repair and realign if necessary */
50713+ zip->window_posn = 0;
50714+ zip->bytes_output = 0;
50715+ STORE_BITS;
50716+ if ((error = inflate(zip))) {
50717+ D(("inflate error %d", error))
50718+ if (zip->repair_mode) {
50719+ /* recover partially-inflated buffers */
50720+ if (zip->bytes_output == 0 && zip->window_posn > 0) {
50721+ zip->flush_window(zip, zip->window_posn);
50722+ }
50723+ zip->sys->message(NULL, "MSZIP error, %u bytes of data lost.",
50724+ MSZIP_FRAME_SIZE - zip->bytes_output);
50725+ for (i = zip->bytes_output; i < MSZIP_FRAME_SIZE; i++) {
50726+ zip->window[i] = '\0';
50727+ }
50728+ zip->bytes_output = MSZIP_FRAME_SIZE;
50729+ }
50730+ else {
50731+ return zip->error = (error > 0) ? error : MSPACK_ERR_DECRUNCH;
50732+ }
50733+ }
50734+ zip->o_ptr = &zip->window[0];
50735+ zip->o_end = &zip->o_ptr[zip->bytes_output];
50736+
50737+ /* write a frame */
50738+ i = (out_bytes < (off_t)zip->bytes_output) ?
50739+ (int)out_bytes : zip->bytes_output;
50740+ if (zip->sys->write(zip->output, zip->o_ptr, i) != i) {
50741+ return zip->error = MSPACK_ERR_WRITE;
50742+ }
50743+
50744+ /* mspack errors (i.e. read errors) are fatal and can't be recovered */
50745+ if ((error > 0) && zip->repair_mode) return error;
50746+
50747+ zip->o_ptr += i;
50748+ out_bytes -= i;
50749+ }
50750+
50751+ if (out_bytes) {
50752+ D(("bytes left to output"))
50753+ return zip->error = MSPACK_ERR_DECRUNCH;
50754+ }
50755+ return MSPACK_ERR_OK;
50756+}
50757+
50758+int mszipd_decompress_kwaj(struct mszipd_stream *zip) {
50759+ /* for the bit buffer */
50760+ register unsigned int bit_buffer;
50761+ register int bits_left;
50762+ unsigned char *i_ptr, *i_end;
50763+
50764+ int i, error, block_len;
50765+
50766+ /* unpack blocks until block_len == 0 */
50767+ for (;;) {
50768+ RESTORE_BITS;
50769+
50770+ /* align to bytestream, read block_len */
50771+ i = bits_left & 7; REMOVE_BITS(i);
50772+ READ_BITS(block_len, 8);
50773+ READ_BITS(i, 8); block_len |= i << 8;
50774+
50775+ if (block_len == 0) break;
50776+
50777+ /* read "CK" header */
50778+ READ_BITS(i, 8); if (i != 'C') return MSPACK_ERR_DATAFORMAT;
50779+ READ_BITS(i, 8); if (i != 'K') return MSPACK_ERR_DATAFORMAT;
50780+
50781+ /* inflate block */
50782+ zip->window_posn = 0;
50783+ zip->bytes_output = 0;
50784+ STORE_BITS;
50785+ if ((error = inflate(zip))) {
50786+ D(("inflate error %d", error))
50787+ return zip->error = (error > 0) ? error : MSPACK_ERR_DECRUNCH;
50788+ }
50789+
50790+ /* write inflated block */
50791+ if (zip->sys->write(zip->output, &zip->window[0], zip->bytes_output)
50792+ != zip->bytes_output) return zip->error = MSPACK_ERR_WRITE;
50793+ }
50794+ return MSPACK_ERR_OK;
50795+}
50796+
50797+void mszipd_free(struct mszipd_stream *zip) {
50798+ struct mspack_system *sys;
50799+ if (zip) {
50800+ sys = zip->sys;
50801+ sys->free(zip->inbuf);
50802+ sys->free(zip);
50803+ }
50804+}
50805diff --git a/libclamav/libmspack-0.4alpha/mspack/oab.h b/libclamav/libmspack-0.4alpha/mspack/oab.h
50806new file mode 100644
50807index 000000000000..565220888097
50808--- /dev/null
50809+++ b/libclamav/libmspack-0.4alpha/mspack/oab.h
50810@@ -0,0 +1,60 @@
50811+/* This file is part of libmspack.
50812+ * © 2013 Intel Corporation
50813+ *
50814+ * libmspack is free software; you can redistribute it and/or modify it under
50815+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
50816+ *
50817+ * For further details, see the file COPYING.LIB distributed with libmspack
50818+ */
50819+
50820+#ifndef MSPACK_OAB_H
50821+#define MSPACK_OAB_H 1
50822+
50823+#include <system.h>
50824+
50825+/* generic OAB definitions */
50826+
50827+/* OAB compression definitions */
50828+
50829+struct msoab_compressor_p {
50830+ struct msoab_compressor base;
50831+ struct mspack_system *system;
50832+ /* todo */
50833+};
50834+
50835+/* OAB decompression definitions */
50836+
50837+struct msoab_decompressor_p {
50838+ struct msoab_decompressor base;
50839+ struct mspack_system *system;
50840+ /* todo */
50841+};
50842+
50843+#define oabhead_VersionHi (0x0000)
50844+#define oabhead_VersionLo (0x0004)
50845+#define oabhead_BlockMax (0x0008)
50846+#define oabhead_TargetSize (0x000c)
50847+#define oabhead_SIZEOF (0x0010)
50848+
50849+#define oabblk_Flags (0x0000)
50850+#define oabblk_CompSize (0x0004)
50851+#define oabblk_UncompSize (0x0008)
50852+#define oabblk_CRC (0x000c)
50853+#define oabblk_SIZEOF (0x0010)
50854+
50855+#define patchhead_VersionHi (0x0000)
50856+#define patchhead_VersionLo (0x0004)
50857+#define patchhead_BlockMax (0x0008)
50858+#define patchhead_SourceSize (0x000c)
50859+#define patchhead_TargetSize (0x0010)
50860+#define patchhead_SourceCRC (0x0014)
50861+#define patchhead_TargetCRC (0x0018)
50862+#define patchhead_SIZEOF (0x001c)
50863+
50864+#define patchblk_PatchSize (0x0000)
50865+#define patchblk_TargetSize (0x0004)
50866+#define patchblk_SourceSize (0x0008)
50867+#define patchblk_CRC (0x000c)
50868+#define patchblk_SIZEOF (0x0010)
50869+
50870+#endif
50871diff --git a/libclamav/libmspack-0.4alpha/mspack/oabc.c b/libclamav/libmspack-0.4alpha/mspack/oabc.c
50872new file mode 100644
50873index 000000000000..327ce61ba12c
50874--- /dev/null
50875+++ b/libclamav/libmspack-0.4alpha/mspack/oabc.c
50876@@ -0,0 +1,24 @@
50877+/* This file is part of libmspack.
50878+ * © 2013 Intel Corporation
50879+ *
50880+ * libmspack is free software; you can redistribute it and/or modify it under
50881+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
50882+ *
50883+ * For further details, see the file COPYING.LIB distributed with libmspack
50884+ */
50885+
50886+/* OAB compression implementation */
50887+
50888+#include <system.h>
50889+#include <oab.h>
50890+
50891+struct msoab_compressor *
50892+ mspack_create_oab_compressor(struct mspack_system *sys)
50893+{
50894+ /* todo */
50895+ return NULL;
50896+}
50897+
50898+void mspack_destroy_oab_compressor(struct msoab_compressor *self) {
50899+ /* todo */
50900+}
50901diff --git a/libclamav/libmspack-0.4alpha/mspack/oabd.c b/libclamav/libmspack-0.4alpha/mspack/oabd.c
50902new file mode 100644
50903index 000000000000..e4b9e4bbc084
50904--- /dev/null
50905+++ b/libclamav/libmspack-0.4alpha/mspack/oabd.c
50906@@ -0,0 +1,408 @@
50907+/* This file is part of libmspack.
50908+ * © 2013 Intel Corporation
50909+ *
50910+ * libmspack is free software; you can redistribute it and/or modify it under
50911+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
50912+ *
50913+ * For further details, see the file COPYING.LIB distributed with libmspack
50914+ */
50915+
50916+/* The Exchange Online Addressbook (OAB or sometimes OAL) is distributed
50917+ * as a .LZX file in one of two forms. Either a "full download" containing
50918+ * the entire address list, or an incremental binary patch which should be
50919+ * applied to a previous version of the full decompressed data.
50920+ *
50921+ * The contents and format of the decompressed OAB are not handled here.
50922+ *
50923+ * For a complete description of the format, see the MSDN site:
50924+ *
50925+ * http://msdn.microsoft.com/en-us/library/cc463914 - [MS-OXOAB].pdf
50926+ * http://msdn.microsoft.com/en-us/library/cc483133 - [MS-PATCH].pdf
50927+ */
50928+
50929+/* OAB decompression implementation */
50930+
50931+#include <system.h>
50932+#include <oab.h>
50933+#include <lzx.h>
50934+#include <crc32.h>
50935+
50936+/* prototypes */
50937+static int oabd_decompress(struct msoab_decompressor *self, const char *input,
50938+ const char *output);
50939+static int oabd_decompress_incremental(struct msoab_decompressor *self,
50940+ const char *input, const char *base,
50941+ const char *output);
50942+
50943+struct msoab_decompressor *
50944+ mspack_create_oab_decompressor(struct mspack_system *sys)
50945+{
50946+ struct msoab_decompressor_p *self = NULL;
50947+
50948+ if (!sys) sys = mspack_default_system;
50949+ if (!mspack_valid_system(sys)) return NULL;
50950+
50951+ if ((self = (struct msoab_decompressor_p *) sys->alloc(sys, sizeof(struct msoab_decompressor_p)))) {
50952+ self->base.decompress = &oabd_decompress;
50953+ self->base.decompress_incremental = &oabd_decompress_incremental;
50954+ self->system = sys;
50955+ }
50956+ return (struct msoab_decompressor *) self;
50957+}
50958+
50959+void mspack_destroy_oab_decompressor(struct msoab_decompressor *base) {
50960+ struct msoab_decompressor_p *self = (struct msoab_decompressor_p *)base;
50961+ if (self) {
50962+ struct mspack_system *sys = self->system;
50963+ sys->free(self);
50964+ }
50965+}
50966+
50967+struct oabd_file {
50968+ struct mspack_system *orig_sys;
50969+ struct mspack_file *orig_file;
50970+ unsigned int crc;
50971+ size_t available;
50972+};
50973+
50974+
50975+static int oabd_sys_read (struct mspack_file *base_file, void *buf, int size)
50976+{
50977+ struct oabd_file *file = (struct oabd_file *)base_file;
50978+ int bytes_read;
50979+
50980+ if ((size_t)size > file->available)
50981+ size = file->available;
50982+
50983+ bytes_read = file->orig_sys->read(file->orig_file, buf, size);
50984+ if (bytes_read < 0)
50985+ return bytes_read;
50986+
50987+ file->available -= bytes_read;
50988+ return bytes_read;
50989+}
50990+
50991+static int oabd_sys_write (struct mspack_file *base_file, void *buf, int size)
50992+{
50993+ struct oabd_file *file = (struct oabd_file *)base_file;
50994+ int bytes_written = file->orig_sys->write(file->orig_file, buf, size);
50995+
50996+ if (bytes_written > 0)
50997+ file->crc = crc32(file->crc, buf, bytes_written);
50998+
50999+ return bytes_written;
51000+}
51001+
51002+static int oabd_decompress(struct msoab_decompressor *_self, const char *input,
51003+ const char *output)
51004+{
51005+ struct msoab_decompressor_p *self = (struct msoab_decompressor_p *) _self;
51006+ struct mspack_system *sys;
51007+ struct mspack_file *infh = NULL;
51008+ struct mspack_file *outfh = NULL;
51009+ unsigned char *buf = NULL;
51010+ unsigned char hdrbuf[oabhead_SIZEOF];
51011+ unsigned int block_max, target_size;
51012+ struct lzxd_stream *lzx = NULL;
51013+ struct mspack_system oabd_sys;
51014+ struct oabd_file in_ofh, out_ofh;
51015+ unsigned int window_bits;
51016+ int ret = MSPACK_ERR_OK;
51017+
51018+ if (!self) return MSPACK_ERR_ARGS;
51019+ sys = self->system;
51020+
51021+ infh = sys->open(sys, input, MSPACK_SYS_OPEN_READ);
51022+ if (!infh) {
51023+ ret = MSPACK_ERR_OPEN;
51024+ goto out;
51025+ }
51026+
51027+ if (sys->read(infh, hdrbuf, oabhead_SIZEOF) != oabhead_SIZEOF) {
51028+ ret = MSPACK_ERR_READ;
51029+ goto out;
51030+ }
51031+
51032+ if (EndGetI32(&hdrbuf[oabhead_VersionHi]) != 3 ||
51033+ EndGetI32(&hdrbuf[oabhead_VersionLo]) != 1) {
51034+ ret = MSPACK_ERR_SIGNATURE;
51035+ goto out;
51036+ }
51037+
51038+ block_max = EndGetI32(&hdrbuf[oabhead_BlockMax]);
51039+ target_size = EndGetI32(&hdrbuf[oabhead_TargetSize]);
51040+
51041+ /* We use it for reading block headers too */
51042+ if (block_max < oabblk_SIZEOF)
51043+ block_max = oabblk_SIZEOF;
51044+
51045+ outfh = sys->open(sys, output, MSPACK_SYS_OPEN_WRITE);
51046+ if (!outfh) {
51047+ ret = MSPACK_ERR_OPEN;
51048+ goto out;
51049+ }
51050+
51051+ buf = sys->alloc(sys, block_max);
51052+ if (!buf) {
51053+ ret = MSPACK_ERR_NOMEMORY;
51054+ goto out;
51055+ }
51056+
51057+ oabd_sys = *sys;
51058+ oabd_sys.read = oabd_sys_read;
51059+ oabd_sys.write = oabd_sys_write;
51060+
51061+ in_ofh.orig_sys = sys;
51062+ in_ofh.orig_file = infh;
51063+
51064+ out_ofh.orig_sys = sys;
51065+ out_ofh.orig_file = outfh;
51066+
51067+ while (target_size) {
51068+ unsigned int blk_csize, blk_dsize, blk_crc, blk_flags;
51069+
51070+ if (sys->read(infh, buf, oabblk_SIZEOF) != oabblk_SIZEOF) {
51071+ ret = MSPACK_ERR_READ;
51072+ goto out;
51073+ }
51074+ blk_flags = EndGetI32(&buf[oabblk_Flags]);
51075+ blk_csize = EndGetI32(&buf[oabblk_CompSize]);
51076+ blk_dsize = EndGetI32(&buf[oabblk_UncompSize]);
51077+ blk_crc = EndGetI32(&buf[oabblk_CRC]);
51078+
51079+ if (blk_dsize > block_max || blk_dsize > target_size || blk_flags > 1) {
51080+ ret = MSPACK_ERR_DATAFORMAT;
51081+ goto out;
51082+ }
51083+
51084+ if (!blk_flags) {
51085+ /* Uncompressed block */
51086+ if (blk_dsize != blk_csize) {
51087+ ret = MSPACK_ERR_DATAFORMAT;
51088+ goto out;
51089+ }
51090+ if (sys->read(infh, buf, blk_dsize) != (int)blk_dsize) {
51091+ ret = MSPACK_ERR_READ;
51092+ goto out;
51093+ }
51094+ if (sys->write(outfh, buf, blk_dsize) != (int)blk_dsize) {
51095+ ret = MSPACK_ERR_WRITE;
51096+ goto out;
51097+ }
51098+ } else {
51099+ /* LZX compressed block */
51100+ window_bits = 17;
51101+
51102+ while (window_bits < 25 && (1U << window_bits) < blk_dsize)
51103+ window_bits++;
51104+
51105+ in_ofh.available = blk_csize;
51106+ out_ofh.crc = 0xffffffff;
51107+
51108+ lzx = lzxd_init(&oabd_sys, (void *)&in_ofh, (void *)&out_ofh, window_bits,
51109+ 0, 4096, blk_dsize, 1);
51110+ if (!lzx) {
51111+ ret = MSPACK_ERR_NOMEMORY;
51112+ goto out;
51113+ }
51114+
51115+ ret = lzxd_decompress(lzx, blk_dsize);
51116+ if (ret != MSPACK_ERR_OK)
51117+ goto out;
51118+
51119+ lzxd_free(lzx);
51120+ lzx = NULL;
51121+
51122+ /* Consume any trailing padding bytes before the next block */
51123+ while (in_ofh.available) {
51124+ int count = block_max;
51125+ if ((size_t)count > in_ofh.available)
51126+ count = in_ofh.available;
51127+
51128+ count = sys->read(infh, buf, count);
51129+ if (count < 0) {
51130+ ret = MSPACK_ERR_READ;
51131+ goto out;
51132+ }
51133+ in_ofh.available -= count;
51134+ }
51135+
51136+ if (out_ofh.crc != blk_crc) {
51137+ ret = MSPACK_ERR_CHECKSUM;
51138+ goto out;
51139+ }
51140+ }
51141+ target_size -= blk_dsize;
51142+ }
51143+
51144+ out:
51145+ if (lzx)
51146+ lzxd_free(lzx);
51147+ if (buf)
51148+ sys->free(buf);
51149+ if (outfh)
51150+ sys->close(outfh);
51151+ if (infh)
51152+ sys->close(infh);
51153+
51154+ return ret;
51155+}
51156+
51157+static int oabd_decompress_incremental(struct msoab_decompressor *_self,
51158+ const char *input, const char *base,
51159+ const char *output)
51160+{
51161+ struct msoab_decompressor_p *self = (struct msoab_decompressor_p *) _self;
51162+ struct mspack_system *sys;
51163+ struct mspack_file *infh = NULL;
51164+ struct mspack_file *basefh = NULL;
51165+ struct mspack_file *outfh = NULL;
51166+ unsigned char *buf = NULL;
51167+ unsigned char hdrbuf[patchhead_SIZEOF];
51168+ unsigned int block_max, source_size, target_size, source_crc, target_crc;
51169+ struct lzxd_stream *lzx = NULL;
51170+ struct mspack_system oabd_sys;
51171+ struct oabd_file in_ofh, out_ofh;
51172+ unsigned int window_bits, window_size;
51173+ int ret = MSPACK_ERR_OK;
51174+
51175+ if (!self) return MSPACK_ERR_ARGS;
51176+ sys = self->system;
51177+
51178+ infh = sys->open(sys, input, MSPACK_SYS_OPEN_READ);
51179+ if (!infh) {
51180+ ret = MSPACK_ERR_OPEN;
51181+ goto out;
51182+ }
51183+
51184+ if (sys->read(infh, hdrbuf, patchhead_SIZEOF) != patchhead_SIZEOF) {
51185+ ret = MSPACK_ERR_READ;
51186+ goto out;
51187+ }
51188+
51189+ if (EndGetI32(&hdrbuf[patchhead_VersionHi]) != 3 ||
51190+ EndGetI32(&hdrbuf[patchhead_VersionLo]) != 2) {
51191+ ret = MSPACK_ERR_SIGNATURE;
51192+ goto out;
51193+ }
51194+
51195+ block_max = EndGetI32(&hdrbuf[patchhead_BlockMax]);
51196+ source_size = EndGetI32(&hdrbuf[patchhead_SourceSize]);
51197+ target_size = EndGetI32(&hdrbuf[patchhead_TargetSize]);
51198+ source_crc = EndGetI32(&hdrbuf[patchhead_SourceCRC]);
51199+ target_crc = EndGetI32(&hdrbuf[patchhead_TargetCRC]);
51200+
51201+ /* We use it for reading block headers too */
51202+ if (block_max < patchblk_SIZEOF)
51203+ block_max = patchblk_SIZEOF;
51204+
51205+ basefh = sys->open(sys, base, MSPACK_SYS_OPEN_READ);
51206+ if (!basefh) {
51207+ ret = MSPACK_ERR_OPEN;
51208+ goto out;
51209+ }
51210+
51211+ outfh = sys->open(sys, output, MSPACK_SYS_OPEN_WRITE);
51212+ if (!outfh) {
51213+ ret = MSPACK_ERR_OPEN;
51214+ goto out;
51215+ }
51216+
51217+ buf = sys->alloc(sys, block_max);
51218+ if (!buf) {
51219+ ret = MSPACK_ERR_NOMEMORY;
51220+ goto out;
51221+ }
51222+
51223+ oabd_sys = *sys;
51224+ oabd_sys.read = oabd_sys_read;
51225+ oabd_sys.write = oabd_sys_write;
51226+
51227+ in_ofh.orig_sys = sys;
51228+ in_ofh.orig_file = infh;
51229+
51230+ out_ofh.orig_sys = sys;
51231+ out_ofh.orig_file = outfh;
51232+
51233+ while (target_size) {
51234+ unsigned int blk_csize, blk_dsize, blk_ssize, blk_crc;
51235+
51236+ if (sys->read(infh, buf, patchblk_SIZEOF) != patchblk_SIZEOF) {
51237+ ret = MSPACK_ERR_READ;
51238+ goto out;
51239+ }
51240+ blk_csize = EndGetI32(&buf[patchblk_PatchSize]);
51241+ blk_dsize = EndGetI32(&buf[patchblk_TargetSize]);
51242+ blk_ssize = EndGetI32(&buf[patchblk_SourceSize]);
51243+ blk_crc = EndGetI32(&buf[patchblk_CRC]);
51244+
51245+ if (blk_dsize > block_max || blk_dsize > target_size ||
51246+ blk_ssize > block_max) {
51247+ ret = MSPACK_ERR_DATAFORMAT;
51248+ goto out;
51249+ }
51250+
51251+
51252+ window_size = (blk_ssize + 32767) & ~32767;
51253+ window_size += blk_dsize;
51254+ window_bits = 17;
51255+
51256+ while (window_bits < 25 && (1U << window_bits) < window_size)
51257+ window_bits++;
51258+
51259+ in_ofh.available = blk_csize;
51260+ out_ofh.crc = 0xffffffff;
51261+
51262+ lzx = lzxd_init(&oabd_sys, (void *)&in_ofh, (void *)&out_ofh, window_bits,
51263+ 0, 4096, blk_dsize, 1);
51264+ if (!lzx) {
51265+ ret = MSPACK_ERR_NOMEMORY;
51266+ goto out;
51267+ }
51268+ ret = lzxd_set_reference_data(lzx, sys, basefh, blk_ssize);
51269+ if (ret != MSPACK_ERR_OK)
51270+ goto out;
51271+
51272+ ret = lzxd_decompress(lzx, blk_dsize);
51273+ if (ret != MSPACK_ERR_OK)
51274+ goto out;
51275+
51276+ lzxd_free(lzx);
51277+ lzx = NULL;
51278+
51279+ /* Consume any trailing padding bytes before the next block */
51280+ while (in_ofh.available) {
51281+ int count = block_max;
51282+ if ((size_t)count > in_ofh.available)
51283+ count = in_ofh.available;
51284+
51285+ count = sys->read(infh, buf, count);
51286+ if (count < 0) {
51287+ ret = MSPACK_ERR_READ;
51288+ goto out;
51289+ }
51290+ in_ofh.available -= count;
51291+ }
51292+
51293+ if (out_ofh.crc != blk_crc) {
51294+ ret = MSPACK_ERR_CHECKSUM;
51295+ goto out;
51296+ }
51297+
51298+ target_size -= blk_dsize;
51299+ }
51300+
51301+ out:
51302+ if (lzx)
51303+ lzxd_free(lzx);
51304+ if (buf)
51305+ sys->free(buf);
51306+ if (outfh)
51307+ sys->close(outfh);
51308+ if (basefh)
51309+ sys->close(basefh);
51310+ if (infh)
51311+ sys->close(infh);
51312+
51313+ return ret;
51314+}
51315diff --git a/libclamav/libmspack-0.4alpha/mspack/qtm.h b/libclamav/libmspack-0.4alpha/mspack/qtm.h
51316new file mode 100644
51317index 000000000000..ab0bb4c32cc2
51318--- /dev/null
51319+++ b/libclamav/libmspack-0.4alpha/mspack/qtm.h
51320@@ -0,0 +1,128 @@
51321+/* This file is part of libmspack.
51322+ * (C) 2003-2004 Stuart Caie.
51323+ *
51324+ * The Quantum method was created by David Stafford, adapted by Microsoft
51325+ * Corporation.
51326+ *
51327+ * libmspack is free software; you can redistribute it and/or modify it under
51328+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
51329+ *
51330+ * For further details, see the file COPYING.LIB distributed with libmspack
51331+ */
51332+
51333+#ifndef MSPACK_QTM_H
51334+#define MSPACK_QTM_H 1
51335+
51336+#ifdef __cplusplus
51337+extern "C" {
51338+#endif
51339+
51340+/* Quantum compression / decompression definitions */
51341+
51342+#define QTM_FRAME_SIZE (32768)
51343+
51344+struct qtmd_modelsym {
51345+ unsigned short sym, cumfreq;
51346+};
51347+
51348+struct qtmd_model {
51349+ int shiftsleft, entries;
51350+ struct qtmd_modelsym *syms;
51351+};
51352+
51353+struct qtmd_stream {
51354+ struct mspack_system *sys; /* I/O routines */
51355+ struct mspack_file *input; /* input file handle */
51356+ struct mspack_file *output; /* output file handle */
51357+
51358+ unsigned char *window; /* decoding window */
51359+ unsigned int window_size; /* window size */
51360+ unsigned int window_posn; /* decompression offset within window */
51361+ unsigned int frame_todo; /* bytes remaining for current frame */
51362+
51363+ unsigned short H, L, C; /* high/low/current: arith coding state */
51364+ unsigned char header_read; /* have we started decoding a new frame? */
51365+
51366+ int error;
51367+
51368+ /* I/O buffers */
51369+ unsigned char *inbuf, *i_ptr, *i_end, *o_ptr, *o_end;
51370+ unsigned int bit_buffer, inbuf_size;
51371+ unsigned char bits_left, input_end;
51372+
51373+ /* four literal models, each representing 64 symbols
51374+ * model0 for literals from 0 to 63 (selector = 0)
51375+ * model1 for literals from 64 to 127 (selector = 1)
51376+ * model2 for literals from 128 to 191 (selector = 2)
51377+ * model3 for literals from 129 to 255 (selector = 3) */
51378+ struct qtmd_model model0, model1, model2, model3;
51379+
51380+ /* three match models.
51381+ * model4 for match with fixed length of 3 bytes
51382+ * model5 for match with fixed length of 4 bytes
51383+ * model6 for variable length match, encoded with model6len model */
51384+ struct qtmd_model model4, model5, model6, model6len;
51385+
51386+ /* selector model. 0-6 to say literal (0,1,2,3) or match (4,5,6) */
51387+ struct qtmd_model model7;
51388+
51389+ /* symbol arrays for all models */
51390+ struct qtmd_modelsym m0sym[64 + 1];
51391+ struct qtmd_modelsym m1sym[64 + 1];
51392+ struct qtmd_modelsym m2sym[64 + 1];
51393+ struct qtmd_modelsym m3sym[64 + 1];
51394+ struct qtmd_modelsym m4sym[24 + 1];
51395+ struct qtmd_modelsym m5sym[36 + 1];
51396+ struct qtmd_modelsym m6sym[42 + 1], m6lsym[27 + 1];
51397+ struct qtmd_modelsym m7sym[7 + 1];
51398+};
51399+
51400+/* allocates Quantum decompression state for decoding the given stream.
51401+ *
51402+ * - returns NULL if window_bits is outwith the range 10 to 21 (inclusive).
51403+ *
51404+ * - uses system->alloc() to allocate memory
51405+ *
51406+ * - returns NULL if not enough memory
51407+ *
51408+ * - window_bits is the size of the Quantum window, from 1Kb (10) to 2Mb (21).
51409+ *
51410+ * - input_buffer_size is the number of bytes to use to store bitstream data.
51411+ */
51412+extern struct qtmd_stream *qtmd_init(struct mspack_system *system,
51413+ struct mspack_file *input,
51414+ struct mspack_file *output,
51415+ int window_bits,
51416+ int input_buffer_size);
51417+
51418+/* decompresses, or decompresses more of, a Quantum stream.
51419+ *
51420+ * - out_bytes of data will be decompressed and the function will return
51421+ * with an MSPACK_ERR_OK return code.
51422+ *
51423+ * - decompressing will stop as soon as out_bytes is reached. if the true
51424+ * amount of bytes decoded spills over that amount, they will be kept for
51425+ * a later invocation of qtmd_decompress().
51426+ *
51427+ * - the output bytes will be passed to the system->write() function given in
51428+ * qtmd_init(), using the output file handle given in qtmd_init(). More
51429+ * than one call may be made to system->write()
51430+ *
51431+ * - Quantum will read input bytes as necessary using the system->read()
51432+ * function given in qtmd_init(), using the input file handle given in
51433+ * qtmd_init(). This will continue until system->read() returns 0 bytes,
51434+ * or an error.
51435+ */
51436+extern int qtmd_decompress(struct qtmd_stream *qtm, off_t out_bytes);
51437+
51438+/* frees all state associated with a Quantum data stream
51439+ *
51440+ * - calls system->free() using the system pointer given in qtmd_init()
51441+ */
51442+void qtmd_free(struct qtmd_stream *qtm);
51443+
51444+#ifdef __cplusplus
51445+}
51446+#endif
51447+
51448+#endif
51449diff --git a/libclamav/libmspack-0.4alpha/mspack/qtmd.c b/libclamav/libmspack-0.4alpha/mspack/qtmd.c
51450new file mode 100644
51451index 000000000000..12b27f5608c4
51452--- /dev/null
51453+++ b/libclamav/libmspack-0.4alpha/mspack/qtmd.c
51454@@ -0,0 +1,489 @@
51455+/* This file is part of libmspack.
51456+ * (C) 2003-2004 Stuart Caie.
51457+ *
51458+ * The Quantum method was created by David Stafford, adapted by Microsoft
51459+ * Corporation.
51460+ *
51461+ * This decompressor is based on an implementation by Matthew Russotto, used
51462+ * with permission.
51463+ *
51464+ * libmspack is free software; you can redistribute it and/or modify it under
51465+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
51466+ *
51467+ * For further details, see the file COPYING.LIB distributed with libmspack
51468+ */
51469+
51470+/* Quantum decompression implementation */
51471+
51472+/* This decompressor was researched and implemented by Matthew Russotto. It
51473+ * has since been tidied up by Stuart Caie. More information can be found at
51474+ * http://www.speakeasy.org/~russotto/quantumcomp.html
51475+ */
51476+
51477+#include <system.h>
51478+#include <qtm.h>
51479+
51480+/* import bit-reading macros and code */
51481+#define BITS_TYPE struct qtmd_stream
51482+#define BITS_VAR qtm
51483+#define BITS_ORDER_MSB
51484+#define READ_BYTES do { \
51485+ unsigned char b0, b1; \
51486+ READ_IF_NEEDED; b0 = *i_ptr++; \
51487+ READ_IF_NEEDED; b1 = *i_ptr++; \
51488+ INJECT_BITS((b0 << 8) | b1, 16); \
51489+} while (0)
51490+#include <readbits.h>
51491+
51492+/* Quantum static data tables:
51493+ *
51494+ * Quantum uses 'position slots' to represent match offsets. For every
51495+ * match, a small 'position slot' number and a small offset from that slot
51496+ * are encoded instead of one large offset.
51497+ *
51498+ * position_base[] is an index to the position slot bases
51499+ *
51500+ * extra_bits[] states how many bits of offset-from-base data is needed.
51501+ *
51502+ * length_base[] and length_extra[] are equivalent in function, but are
51503+ * used for encoding selector 6 (variable length match) match lengths,
51504+ * instead of match offsets.
51505+ *
51506+ * They are generated with the following code:
51507+ * unsigned int i, offset;
51508+ * for (i = 0, offset = 0; i < 42; i++) {
51509+ * position_base[i] = offset;
51510+ * extra_bits[i] = ((i < 2) ? 0 : (i - 2)) >> 1;
51511+ * offset += 1 << extra_bits[i];
51512+ * }
51513+ * for (i = 0, offset = 0; i < 26; i++) {
51514+ * length_base[i] = offset;
51515+ * length_extra[i] = (i < 2 ? 0 : i - 2) >> 2;
51516+ * offset += 1 << length_extra[i];
51517+ * }
51518+ * length_base[26] = 254; length_extra[26] = 0;
51519+ */
51520+static const unsigned int position_base[42] = {
51521+ 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
51522+ 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152,
51523+ 65536, 98304, 131072, 196608, 262144, 393216, 524288, 786432, 1048576, 1572864
51524+};
51525+static const unsigned char extra_bits[42] = {
51526+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,
51527+ 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19
51528+};
51529+static const unsigned char length_base[27] = {
51530+ 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 18, 22, 26,
51531+ 30, 38, 46, 54, 62, 78, 94, 110, 126, 158, 190, 222, 254
51532+};
51533+static const unsigned char length_extra[27] = {
51534+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
51535+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0
51536+};
51537+
51538+
51539+/* Arithmetic decoder:
51540+ *
51541+ * GET_SYMBOL(model, var) fetches the next symbol from the stated model
51542+ * and puts it in var.
51543+ *
51544+ * If necessary, qtmd_update_model() is called.
51545+ */
51546+#define GET_SYMBOL(model, var) do { \
51547+ range = ((H - L) & 0xFFFF) + 1; \
51548+ symf = ((((C - L + 1) * model.syms[0].cumfreq)-1) / range) & 0xFFFF; \
51549+ \
51550+ for (i = 1; i < model.entries; i++) { \
51551+ if (model.syms[i].cumfreq <= symf) break; \
51552+ } \
51553+ (var) = model.syms[i-1].sym; \
51554+ \
51555+ range = (H - L) + 1; \
51556+ symf = model.syms[0].cumfreq; \
51557+ H = L + ((model.syms[i-1].cumfreq * range) / symf) - 1; \
51558+ L = L + ((model.syms[i].cumfreq * range) / symf); \
51559+ \
51560+ do { model.syms[--i].cumfreq += 8; } while (i > 0); \
51561+ if (model.syms[0].cumfreq > 3800) qtmd_update_model(&model); \
51562+ \
51563+ while (1) { \
51564+ if ((L & 0x8000) != (H & 0x8000)) { \
51565+ if ((L & 0x4000) && !(H & 0x4000)) { \
51566+ /* underflow case */ \
51567+ C ^= 0x4000; L &= 0x3FFF; H |= 0x4000; \
51568+ } \
51569+ else break; \
51570+ } \
51571+ L <<= 1; H = (H << 1) | 1; \
51572+ ENSURE_BITS(1); \
51573+ C = (C << 1) | PEEK_BITS(1); \
51574+ REMOVE_BITS(1); \
51575+ } \
51576+} while (0)
51577+
51578+static void qtmd_update_model(struct qtmd_model *model) {
51579+ struct qtmd_modelsym tmp;
51580+ int i, j;
51581+
51582+ if (--model->shiftsleft) {
51583+ for (i = model->entries - 1; i >= 0; i--) {
51584+ /* -1, not -2; the 0 entry saves this */
51585+ model->syms[i].cumfreq >>= 1;
51586+ if (model->syms[i].cumfreq <= model->syms[i+1].cumfreq) {
51587+ model->syms[i].cumfreq = model->syms[i+1].cumfreq + 1;
51588+ }
51589+ }
51590+ }
51591+ else {
51592+ model->shiftsleft = 50;
51593+ for (i = 0; i < model->entries; i++) {
51594+ /* no -1, want to include the 0 entry */
51595+ /* this converts cumfreqs into frequencies, then shifts right */
51596+ model->syms[i].cumfreq -= model->syms[i+1].cumfreq;
51597+ model->syms[i].cumfreq++; /* avoid losing things entirely */
51598+ model->syms[i].cumfreq >>= 1;
51599+ }
51600+
51601+ /* now sort by frequencies, decreasing order -- this must be an
51602+ * inplace selection sort, or a sort with the same (in)stability
51603+ * characteristics */
51604+ for (i = 0; i < model->entries - 1; i++) {
51605+ for (j = i + 1; j < model->entries; j++) {
51606+ if (model->syms[i].cumfreq < model->syms[j].cumfreq) {
51607+ tmp = model->syms[i];
51608+ model->syms[i] = model->syms[j];
51609+ model->syms[j] = tmp;
51610+ }
51611+ }
51612+ }
51613+
51614+ /* then convert frequencies back to cumfreq */
51615+ for (i = model->entries - 1; i >= 0; i--) {
51616+ model->syms[i].cumfreq += model->syms[i+1].cumfreq;
51617+ }
51618+ }
51619+}
51620+
51621+/* Initialises a model to decode symbols from [start] to [start]+[len]-1 */
51622+static void qtmd_init_model(struct qtmd_model *model,
51623+ struct qtmd_modelsym *syms, int start, int len)
51624+{
51625+ int i;
51626+
51627+ model->shiftsleft = 4;
51628+ model->entries = len;
51629+ model->syms = syms;
51630+
51631+ for (i = 0; i <= len; i++) {
51632+ syms[i].sym = start + i; /* actual symbol */
51633+ syms[i].cumfreq = len - i; /* current frequency of that symbol */
51634+ }
51635+}
51636+
51637+
51638+/*-------- main Quantum code --------*/
51639+
51640+struct qtmd_stream *qtmd_init(struct mspack_system *system,
51641+ struct mspack_file *input,
51642+ struct mspack_file *output,
51643+ int window_bits, int input_buffer_size)
51644+{
51645+ unsigned int window_size = 1 << window_bits;
51646+ struct qtmd_stream *qtm;
51647+ int i;
51648+
51649+ if (!system) return NULL;
51650+
51651+ /* Quantum supports window sizes of 2^10 (1Kb) through 2^21 (2Mb) */
51652+ if (window_bits < 10 || window_bits > 21) return NULL;
51653+
51654+ input_buffer_size = (input_buffer_size + 1) & -2;
51655+ if (input_buffer_size < 2) return NULL;
51656+
51657+ /* allocate decompression state */
51658+ if (!(qtm = (struct qtmd_stream *) system->alloc(system, sizeof(struct qtmd_stream)))) {
51659+ return NULL;
51660+ }
51661+
51662+ /* allocate decompression window and input buffer */
51663+ qtm->window = (unsigned char *) system->alloc(system, (size_t) window_size);
51664+ qtm->inbuf = (unsigned char *) system->alloc(system, (size_t) input_buffer_size);
51665+ if (!qtm->window || !qtm->inbuf) {
51666+ system->free(qtm->window);
51667+ system->free(qtm->inbuf);
51668+ system->free(qtm);
51669+ return NULL;
51670+ }
51671+
51672+ /* initialise decompression state */
51673+ qtm->sys = system;
51674+ qtm->input = input;
51675+ qtm->output = output;
51676+ qtm->inbuf_size = input_buffer_size;
51677+ qtm->window_size = window_size;
51678+ qtm->window_posn = 0;
51679+ qtm->frame_todo = QTM_FRAME_SIZE;
51680+ qtm->header_read = 0;
51681+ qtm->error = MSPACK_ERR_OK;
51682+
51683+ qtm->i_ptr = qtm->i_end = &qtm->inbuf[0];
51684+ qtm->o_ptr = qtm->o_end = &qtm->window[0];
51685+ qtm->input_end = 0;
51686+ qtm->bits_left = 0;
51687+ qtm->bit_buffer = 0;
51688+
51689+ /* initialise arithmetic coding models
51690+ * - model 4 depends on window size, ranges from 20 to 24
51691+ * - model 5 depends on window size, ranges from 20 to 36
51692+ * - model 6pos depends on window size, ranges from 20 to 42
51693+ */
51694+ i = window_bits * 2;
51695+ qtmd_init_model(&qtm->model0, &qtm->m0sym[0], 0, 64);
51696+ qtmd_init_model(&qtm->model1, &qtm->m1sym[0], 64, 64);
51697+ qtmd_init_model(&qtm->model2, &qtm->m2sym[0], 128, 64);
51698+ qtmd_init_model(&qtm->model3, &qtm->m3sym[0], 192, 64);
51699+ qtmd_init_model(&qtm->model4, &qtm->m4sym[0], 0, (i > 24) ? 24 : i);
51700+ qtmd_init_model(&qtm->model5, &qtm->m5sym[0], 0, (i > 36) ? 36 : i);
51701+ qtmd_init_model(&qtm->model6, &qtm->m6sym[0], 0, i);
51702+ qtmd_init_model(&qtm->model6len, &qtm->m6lsym[0], 0, 27);
51703+ qtmd_init_model(&qtm->model7, &qtm->m7sym[0], 0, 7);
51704+
51705+ /* all ok */
51706+ return qtm;
51707+}
51708+
51709+int qtmd_decompress(struct qtmd_stream *qtm, off_t out_bytes) {
51710+ unsigned int frame_todo, frame_end, window_posn, match_offset, range;
51711+ unsigned char *window, *i_ptr, *i_end, *runsrc, *rundest;
51712+ int i, j, selector, extra, sym, match_length;
51713+ unsigned short H, L, C, symf;
51714+
51715+ register unsigned int bit_buffer;
51716+ register unsigned char bits_left;
51717+
51718+ /* easy answers */
51719+ if (!qtm || (out_bytes < 0)) return MSPACK_ERR_ARGS;
51720+ if (qtm->error) return qtm->error;
51721+
51722+ /* flush out any stored-up bytes before we begin */
51723+ i = qtm->o_end - qtm->o_ptr;
51724+ if ((off_t) i > out_bytes) i = (int) out_bytes;
51725+ if (i) {
51726+ if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) {
51727+ return qtm->error = MSPACK_ERR_WRITE;
51728+ }
51729+ qtm->o_ptr += i;
51730+ out_bytes -= i;
51731+ }
51732+ if (out_bytes == 0) return MSPACK_ERR_OK;
51733+
51734+ /* restore local state */
51735+ RESTORE_BITS;
51736+ window = qtm->window;
51737+ window_posn = qtm->window_posn;
51738+ frame_todo = qtm->frame_todo;
51739+ H = qtm->H;
51740+ L = qtm->L;
51741+ C = qtm->C;
51742+
51743+ /* while we do not have enough decoded bytes in reserve: */
51744+ while ((qtm->o_end - qtm->o_ptr) < out_bytes) {
51745+ /* read header if necessary. Initialises H, L and C */
51746+ if (!qtm->header_read) {
51747+ H = 0xFFFF; L = 0; READ_BITS(C, 16);
51748+ qtm->header_read = 1;
51749+ }
51750+
51751+ /* decode more, up to the number of bytes needed, the frame boundary,
51752+ * or the window boundary, whichever comes first */
51753+ frame_end = window_posn + (out_bytes - (qtm->o_end - qtm->o_ptr));
51754+ if ((window_posn + frame_todo) < frame_end) {
51755+ frame_end = window_posn + frame_todo;
51756+ }
51757+ if (frame_end > qtm->window_size) {
51758+ frame_end = qtm->window_size;
51759+ }
51760+
51761+ while (window_posn < frame_end) {
51762+ GET_SYMBOL(qtm->model7, selector);
51763+ if (selector < 4) {
51764+ /* literal byte */
51765+ struct qtmd_model *mdl = (selector == 0) ? &qtm->model0 :
51766+ ((selector == 1) ? &qtm->model1 :
51767+ ((selector == 2) ? &qtm->model2 :
51768+ &qtm->model3));
51769+ GET_SYMBOL((*mdl), sym);
51770+ window[window_posn++] = sym;
51771+ frame_todo--;
51772+ }
51773+ else {
51774+ /* match repeated string */
51775+ switch (selector) {
51776+ case 4: /* selector 4 = fixed length match (3 bytes) */
51777+ GET_SYMBOL(qtm->model4, sym);
51778+ READ_MANY_BITS(extra, extra_bits[sym]);
51779+ match_offset = position_base[sym] + extra + 1;
51780+ match_length = 3;
51781+ break;
51782+
51783+ case 5: /* selector 5 = fixed length match (4 bytes) */
51784+ GET_SYMBOL(qtm->model5, sym);
51785+ READ_MANY_BITS(extra, extra_bits[sym]);
51786+ match_offset = position_base[sym] + extra + 1;
51787+ match_length = 4;
51788+ break;
51789+
51790+ case 6: /* selector 6 = variable length match */
51791+ GET_SYMBOL(qtm->model6len, sym);
51792+ READ_MANY_BITS(extra, length_extra[sym]);
51793+ match_length = length_base[sym] + extra + 5;
51794+
51795+ GET_SYMBOL(qtm->model6, sym);
51796+ READ_MANY_BITS(extra, extra_bits[sym]);
51797+ match_offset = position_base[sym] + extra + 1;
51798+ break;
51799+
51800+ default:
51801+ /* should be impossible, model7 can only return 0-6 */
51802+ D(("got %d from selector", selector))
51803+ return qtm->error = MSPACK_ERR_DECRUNCH;
51804+ }
51805+
51806+ rundest = &window[window_posn];
51807+ frame_todo -= match_length;
51808+
51809+ /* does match destination wrap the window? This situation is possible
51810+ * where the window size is less than the 32k frame size, but matches
51811+ * must not go beyond a frame boundary */
51812+ if ((window_posn + match_length) > qtm->window_size) {
51813+ /* copy first part of match, before window end */
51814+ i = qtm->window_size - window_posn;
51815+ j = window_posn - match_offset;
51816+ while (i--) *rundest++ = window[j++ & (qtm->window_size - 1)];
51817+
51818+ /* flush currently stored data */
51819+ i = (&window[qtm->window_size] - qtm->o_ptr);
51820+
51821+ /* this should not happen, but if it does then this code
51822+ * can't handle the situation (can't flush up to the end of
51823+ * the window, but can't break out either because we haven't
51824+ * finished writing the match). bail out in this case */
51825+ if (i > out_bytes) {
51826+ D(("during window-wrap match; %d bytes to flush but only need %d",
51827+ i, (int) out_bytes))
51828+ return qtm->error = MSPACK_ERR_DECRUNCH;
51829+ }
51830+ if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) {
51831+ return qtm->error = MSPACK_ERR_WRITE;
51832+ }
51833+ out_bytes -= i;
51834+ qtm->o_ptr = &window[0];
51835+ qtm->o_end = &window[0];
51836+
51837+ /* copy second part of match, after window wrap */
51838+ rundest = &window[0];
51839+ i = match_length - (qtm->window_size - window_posn);
51840+ while (i--) *rundest++ = window[j++ & (qtm->window_size - 1)];
51841+ window_posn = window_posn + match_length - qtm->window_size;
51842+
51843+ break; /* because "window_posn < frame_end" has now failed */
51844+ }
51845+ else {
51846+ /* normal match - output won't wrap window or frame end */
51847+ i = match_length;
51848+
51849+ /* does match _offset_ wrap the window? */
51850+ if (match_offset > window_posn) {
51851+ /* j = length from match offset to end of window */
51852+ j = match_offset - window_posn;
51853+ if (j > (int) qtm->window_size) {
51854+ D(("match offset beyond window boundaries"))
51855+ return qtm->error = MSPACK_ERR_DECRUNCH;
51856+ }
51857+ runsrc = &window[qtm->window_size - j];
51858+ if (j < i) {
51859+ /* if match goes over the window edge, do two copy runs */
51860+ i -= j; while (j-- > 0) *rundest++ = *runsrc++;
51861+ runsrc = window;
51862+ }
51863+ while (i-- > 0) *rundest++ = *runsrc++;
51864+ }
51865+ else {
51866+ runsrc = rundest - match_offset;
51867+ while (i-- > 0) *rundest++ = *runsrc++;
51868+ }
51869+ window_posn += match_length;
51870+ }
51871+ } /* if (window_posn+match_length > frame_end) */
51872+ } /* while (window_posn < frame_end) */
51873+
51874+ qtm->o_end = &window[window_posn];
51875+
51876+ /* if we subtracted too much from frame_todo, it will
51877+ * wrap around past zero and go above its max value */
51878+ if (frame_todo > QTM_FRAME_SIZE) {
51879+ D(("overshot frame alignment"))
51880+ return qtm->error = MSPACK_ERR_DECRUNCH;
51881+ }
51882+
51883+ /* another frame completed? */
51884+ if (frame_todo == 0) {
51885+ /* re-align input */
51886+ if (bits_left & 7) REMOVE_BITS(bits_left & 7);
51887+
51888+ /* special Quantum hack -- cabd.c injects a trailer byte to allow the
51889+ * decompressor to realign itself. CAB Quantum blocks, unlike LZX
51890+ * blocks, can have anything from 0 to 4 trailing null bytes. */
51891+ do { READ_BITS(i, 8); } while (i != 0xFF);
51892+
51893+ qtm->header_read = 0;
51894+
51895+ frame_todo = QTM_FRAME_SIZE;
51896+ }
51897+
51898+ /* window wrap? */
51899+ if (window_posn == qtm->window_size) {
51900+ /* flush all currently stored data */
51901+ i = (qtm->o_end - qtm->o_ptr);
51902+ /* break out if we have more than enough to finish this request */
51903+ if (i >= out_bytes) break;
51904+ if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) {
51905+ return qtm->error = MSPACK_ERR_WRITE;
51906+ }
51907+ out_bytes -= i;
51908+ qtm->o_ptr = &window[0];
51909+ qtm->o_end = &window[0];
51910+ window_posn = 0;
51911+ }
51912+
51913+ } /* while (more bytes needed) */
51914+
51915+ if (out_bytes) {
51916+ i = (int) out_bytes;
51917+ if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) {
51918+ return qtm->error = MSPACK_ERR_WRITE;
51919+ }
51920+ qtm->o_ptr += i;
51921+ }
51922+
51923+ /* store local state */
51924+
51925+ STORE_BITS;
51926+ qtm->window_posn = window_posn;
51927+ qtm->frame_todo = frame_todo;
51928+ qtm->H = H;
51929+ qtm->L = L;
51930+ qtm->C = C;
51931+
51932+ return MSPACK_ERR_OK;
51933+}
51934+
51935+void qtmd_free(struct qtmd_stream *qtm) {
51936+ struct mspack_system *sys;
51937+ if (qtm) {
51938+ sys = qtm->sys;
51939+ sys->free(qtm->window);
51940+ sys->free(qtm->inbuf);
51941+ sys->free(qtm);
51942+ }
51943+}
51944diff --git a/libclamav/libmspack-0.4alpha/mspack/readbits.h b/libclamav/libmspack-0.4alpha/mspack/readbits.h
51945new file mode 100644
51946index 000000000000..457cbdd7d4cc
51947--- /dev/null
51948+++ b/libclamav/libmspack-0.4alpha/mspack/readbits.h
51949@@ -0,0 +1,207 @@
51950+/* This file is part of libmspack.
51951+ * (C) 2003-2010 Stuart Caie.
51952+ *
51953+ * libmspack is free software; you can redistribute it and/or modify it under
51954+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
51955+ *
51956+ * For further details, see the file COPYING.LIB distributed with libmspack
51957+ */
51958+
51959+#ifndef MSPACK_READBITS_H
51960+#define MSPACK_READBITS_H 1
51961+
51962+/* this header defines macros that read data streams by
51963+ * the individual bits
51964+ *
51965+ * INIT_BITS initialises bitstream state in state structure
51966+ * STORE_BITS stores bitstream state in state structure
51967+ * RESTORE_BITS restores bitstream state from state structure
51968+ * ENSURE_BITS(n) ensure there are at least N bits in the bit buffer
51969+ * READ_BITS(var,n) takes N bits from the buffer and puts them in var
51970+ * PEEK_BITS(n) extracts without removing N bits from the bit buffer
51971+ * REMOVE_BITS(n) removes N bits from the bit buffer
51972+ *
51973+ * READ_BITS simply calls ENSURE_BITS, PEEK_BITS and REMOVE_BITS,
51974+ * which means it's limited to reading the number of bits you can
51975+ * ensure at any one time. It also fails if asked to read zero bits.
51976+ * If you need to read zero bits, or more bits than can be ensured in
51977+ * one go, use READ_MANY_BITS instead.
51978+ *
51979+ * These macros have variable names baked into them, so to use them
51980+ * you have to define some macros:
51981+ * - BITS_TYPE: the type name of your state structure
51982+ * - BITS_VAR: the variable that points to your state structure
51983+ * - define BITS_ORDER_MSB if bits are read from the MSB, or
51984+ * define BITS_ORDER_LSB if bits are read from the LSB
51985+ * - READ_BYTES: some code that reads more data into the bit buffer,
51986+ * it should use READ_IF_NEEDED (calls read_input if the byte buffer
51987+ * is empty), then INJECT_BITS(data,n) to put data from the byte
51988+ * buffer into the bit buffer.
51989+ *
51990+ * You also need to define some variables and structure members:
51991+ * - unsigned char *i_ptr; // current position in the byte buffer
51992+ * - unsigned char *i_end; // end of the byte buffer
51993+ * - unsigned int bit_buffer; // the bit buffer itself
51994+ * - unsigned int bits_left; // number of bits remaining
51995+ *
51996+ * If you use read_input() and READ_IF_NEEDED, they also expect these
51997+ * structure members:
51998+ * - struct mspack_system *sys; // to access sys->read()
51999+ * - unsigned int error; // to record/return read errors
52000+ * - unsigned char input_end; // to mark reaching the EOF
52001+ * - unsigned char *inbuf; // the input byte buffer
52002+ * - unsigned int inbuf_size; // the size of the input byte buffer
52003+ *
52004+ * Your READ_BYTES implementation should read data from *i_ptr and
52005+ * put them in the bit buffer. READ_IF_NEEDED will call read_input()
52006+ * if i_ptr reaches i_end, and will fill up inbuf and set i_ptr to
52007+ * the start of inbuf and i_end to the end of inbuf.
52008+ *
52009+ * If you're reading in MSB order, the routines work by using the area
52010+ * beyond the MSB and the LSB of the bit buffer as a free source of
52011+ * zeroes when shifting. This avoids having to mask any bits. So we
52012+ * have to know the bit width of the bit buffer variable. We use
52013+ * <limits.h> and CHAR_BIT to find the size of the bit buffer in bits.
52014+ *
52015+ * If you are reading in LSB order, bits need to be masked. Normally
52016+ * this is done by computing the mask: N bits are masked by the value
52017+ * (1<<N)-1). However, you can define BITS_LSB_TABLE to use a lookup
52018+ * table instead of computing this. This adds two new macros,
52019+ * PEEK_BITS_T and READ_BITS_T which work the same way as PEEK_BITS
52020+ * and READ_BITS, except they use this lookup table. This is useful if
52021+ * you need to look up a number of bits that are only known at
52022+ * runtime, so the bit mask can't be turned into a constant by the
52023+ * compiler.
52024+
52025+ * The bit buffer datatype should be at least 32 bits wide: it must be
52026+ * possible to ENSURE_BITS(17), so it must be possible to add 16 new bits
52027+ * to the bit buffer when the bit buffer already has 1 to 15 bits left.
52028+ */
52029+
52030+#ifndef BITS_VAR
52031+# error "define BITS_VAR as the state structure poiner variable name"
52032+#endif
52033+#ifndef BITS_TYPE
52034+# error "define BITS_TYPE as the state structure type"
52035+#endif
52036+#if defined(BITS_ORDER_MSB) && defined(BITS_ORDER_LSB)
52037+# error "you must define either BITS_ORDER_MSB or BITS_ORDER_LSB"
52038+#else
52039+# if !(defined(BITS_ORDER_MSB) || defined(BITS_ORDER_LSB))
52040+# error "you must define BITS_ORDER_MSB or BITS_ORDER_LSB"
52041+# endif
52042+#endif
52043+
52044+#if HAVE_LIMITS_H
52045+# include <limits.h>
52046+#endif
52047+#ifndef CHAR_BIT
52048+# define CHAR_BIT (8)
52049+#endif
52050+#define BITBUF_WIDTH (sizeof(bit_buffer) * CHAR_BIT)
52051+
52052+#define INIT_BITS do { \
52053+ BITS_VAR->i_ptr = &BITS_VAR->inbuf[0]; \
52054+ BITS_VAR->i_end = &BITS_VAR->inbuf[0]; \
52055+ BITS_VAR->bit_buffer = 0; \
52056+ BITS_VAR->bits_left = 0; \
52057+ BITS_VAR->input_end = 0; \
52058+} while (0)
52059+
52060+#define STORE_BITS do { \
52061+ BITS_VAR->i_ptr = i_ptr; \
52062+ BITS_VAR->i_end = i_end; \
52063+ BITS_VAR->bit_buffer = bit_buffer; \
52064+ BITS_VAR->bits_left = bits_left; \
52065+} while (0)
52066+
52067+#define RESTORE_BITS do { \
52068+ i_ptr = BITS_VAR->i_ptr; \
52069+ i_end = BITS_VAR->i_end; \
52070+ bit_buffer = BITS_VAR->bit_buffer; \
52071+ bits_left = BITS_VAR->bits_left; \
52072+} while (0)
52073+
52074+#define ENSURE_BITS(nbits) do { \
52075+ while (bits_left < (nbits)) READ_BYTES; \
52076+} while (0)
52077+
52078+#define READ_BITS(val, nbits) do { \
52079+ ENSURE_BITS(nbits); \
52080+ (val) = PEEK_BITS(nbits); \
52081+ REMOVE_BITS(nbits); \
52082+} while (0)
52083+
52084+#define READ_MANY_BITS(val, bits) do { \
52085+ unsigned char needed = (bits), bitrun; \
52086+ (val) = 0; \
52087+ while (needed > 0) { \
52088+ if (bits_left <= (BITBUF_WIDTH - 16)) READ_BYTES; \
52089+ bitrun = (bits_left < needed) ? bits_left : needed; \
52090+ (val) = ((val) << bitrun) | PEEK_BITS(bitrun); \
52091+ REMOVE_BITS(bitrun); \
52092+ needed -= bitrun; \
52093+ } \
52094+} while (0)
52095+
52096+#ifdef BITS_ORDER_MSB
52097+# define PEEK_BITS(nbits) (bit_buffer >> (BITBUF_WIDTH - (nbits)))
52098+# define REMOVE_BITS(nbits) ((bit_buffer <<= (nbits)), (bits_left -= (nbits)))
52099+# define INJECT_BITS(bitdata,nbits) ((bit_buffer |= \
52100+ (bitdata) << (BITBUF_WIDTH - (nbits) - bits_left)), (bits_left += (nbits)))
52101+#else /* BITS_ORDER_LSB */
52102+# define PEEK_BITS(nbits) (bit_buffer & ((1 << (nbits))-1))
52103+# define REMOVE_BITS(nbits) ((bit_buffer >>= (nbits)), (bits_left -= (nbits)))
52104+# define INJECT_BITS(bitdata,nbits) ((bit_buffer |= \
52105+ (bitdata) << bits_left), (bits_left += (nbits)))
52106+#endif
52107+
52108+#ifdef BITS_LSB_TABLE
52109+/* lsb_bit_mask[n] = (1 << n) - 1 */
52110+static const unsigned short lsb_bit_mask[17] = {
52111+ 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
52112+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
52113+};
52114+# define PEEK_BITS_T(nbits) (bit_buffer & lsb_bit_mask[(nbits)])
52115+# define READ_BITS_T(val, nbits) do { \
52116+ ENSURE_BITS(nbits); \
52117+ (val) = PEEK_BITS_T(nbits); \
52118+ REMOVE_BITS(nbits); \
52119+} while (0)
52120+#endif
52121+
52122+#ifndef BITS_NO_READ_INPUT
52123+# define READ_IF_NEEDED do { \
52124+ if (i_ptr >= i_end) { \
52125+ if (read_input(BITS_VAR)) \
52126+ return BITS_VAR->error; \
52127+ i_ptr = BITS_VAR->i_ptr; \
52128+ i_end = BITS_VAR->i_end; \
52129+ } \
52130+} while (0)
52131+
52132+static int read_input(BITS_TYPE *p) {
52133+ int read = p->sys->read(p->input, &p->inbuf[0], (int)p->inbuf_size);
52134+ if (read < 0) return p->error = MSPACK_ERR_READ;
52135+
52136+ /* we might overrun the input stream by asking for bits we don't use,
52137+ * so fake 2 more bytes at the end of input */
52138+ if (read == 0) {
52139+ if (p->input_end) {
52140+ D(("out of input bytes"))
52141+ return p->error = MSPACK_ERR_READ;
52142+ }
52143+ else {
52144+ read = 2;
52145+ p->inbuf[0] = p->inbuf[1] = 0;
52146+ p->input_end = 1;
52147+ }
52148+ }
52149+
52150+ /* update i_ptr and i_end */
52151+ p->i_ptr = &p->inbuf[0];
52152+ p->i_end = &p->inbuf[read];
52153+ return MSPACK_ERR_OK;
52154+}
52155+#endif
52156+#endif
52157diff --git a/libclamav/libmspack-0.4alpha/mspack/readhuff.h b/libclamav/libmspack-0.4alpha/mspack/readhuff.h
52158new file mode 100644
52159index 000000000000..bb15c0a12362
52160--- /dev/null
52161+++ b/libclamav/libmspack-0.4alpha/mspack/readhuff.h
52162@@ -0,0 +1,173 @@
52163+/* This file is part of libmspack.
52164+ * (C) 2003-2010 Stuart Caie.
52165+ *
52166+ * libmspack is free software; you can redistribute it and/or modify it under
52167+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
52168+ *
52169+ * For further details, see the file COPYING.LIB distributed with libmspack
52170+ */
52171+
52172+#ifndef MSPACK_READHUFF_H
52173+#define MSPACK_READHUFF_H 1
52174+
52175+/* This implements a fast Huffman tree decoding system.
52176+ */
52177+
52178+#if !(defined(BITS_ORDER_MSB) || defined(BITS_ORDER_LSB))
52179+# error "readhuff.h is used in conjunction with readbits.h, include that first"
52180+#endif
52181+#if !(defined(TABLEBITS) && defined(MAXSYMBOLS))
52182+# error "define TABLEBITS(tbl) and MAXSYMBOLS(tbl) before using readhuff.h"
52183+#endif
52184+#if !(defined(HUFF_TABLE) && defined(HUFF_LEN))
52185+# error "define HUFF_TABLE(tbl) and HUFF_LEN(tbl) before using readhuff.h"
52186+#endif
52187+#ifndef HUFF_ERROR
52188+# error "define HUFF_ERROR before using readhuff.h"
52189+#endif
52190+#ifndef HUFF_MAXBITS
52191+# define HUFF_MAXBITS 16
52192+#endif
52193+
52194+/* Decodes the next huffman symbol from the input bitstream into var.
52195+ * Do not use this macro on a table unless build_decode_table() succeeded.
52196+ */
52197+#define READ_HUFFSYM(tbl, var) do { \
52198+ ENSURE_BITS(HUFF_MAXBITS); \
52199+ sym = HUFF_TABLE(tbl, PEEK_BITS(TABLEBITS(tbl))); \
52200+ if (sym >= MAXSYMBOLS(tbl)) HUFF_TRAVERSE(tbl); \
52201+ (var) = sym; \
52202+ i = HUFF_LEN(tbl, sym); \
52203+ REMOVE_BITS(i); \
52204+} while (0)
52205+
52206+#ifdef BITS_ORDER_LSB
52207+# define HUFF_TRAVERSE(tbl) do { \
52208+ i = TABLEBITS(tbl) - 1; \
52209+ do { \
52210+ if (i++ > HUFF_MAXBITS) HUFF_ERROR; \
52211+ sym = HUFF_TABLE(tbl, \
52212+ (sym << 1) | ((bit_buffer >> i) & 1)); \
52213+ } while (sym >= MAXSYMBOLS(tbl)); \
52214+} while (0)
52215+#else
52216+#define HUFF_TRAVERSE(tbl) do { \
52217+ i = 1 << (BITBUF_WIDTH - TABLEBITS(tbl)); \
52218+ do { \
52219+ if ((i >>= 1) == 0) HUFF_ERROR; \
52220+ sym = HUFF_TABLE(tbl, \
52221+ (sym << 1) | ((bit_buffer & i) ? 1 : 0)); \
52222+ } while (sym >= MAXSYMBOLS(tbl)); \
52223+} while (0)
52224+#endif
52225+
52226+/* make_decode_table(nsyms, nbits, length[], table[])
52227+ *
52228+ * This function was originally coded by David Tritscher.
52229+ * It builds a fast huffman decoding table from
52230+ * a canonical huffman code lengths table.
52231+ *
52232+ * nsyms = total number of symbols in this huffman tree.
52233+ * nbits = any symbols with a code length of nbits or less can be decoded
52234+ * in one lookup of the table.
52235+ * length = A table to get code lengths from [0 to nsyms-1]
52236+ * table = The table to fill up with decoded symbols and pointers.
52237+ * Should be ((1<<nbits) + (nsyms*2)) in length.
52238+ *
52239+ * Returns 0 for OK or 1 for error
52240+ */
52241+static int make_decode_table(unsigned int nsyms, unsigned int nbits,
52242+ unsigned char *length, unsigned short *table)
52243+{
52244+ register unsigned short sym, next_symbol;
52245+ register unsigned int leaf, fill;
52246+#ifdef BITS_ORDER_LSB
52247+ register unsigned int reverse;
52248+#endif
52249+ register unsigned char bit_num;
52250+ unsigned int pos = 0; /* the current position in the decode table */
52251+ unsigned int table_mask = 1 << nbits;
52252+ unsigned int bit_mask = table_mask >> 1; /* don't do 0 length codes */
52253+
52254+ /* fill entries for codes short enough for a direct mapping */
52255+ for (bit_num = 1; bit_num <= nbits; bit_num++) {
52256+ for (sym = 0; sym < nsyms; sym++) {
52257+ if (length[sym] != bit_num) continue;
52258+#ifdef BITS_ORDER_MSB
52259+ leaf = pos;
52260+#else
52261+ /* reverse the significant bits */
52262+ fill = length[sym]; reverse = pos >> (nbits - fill); leaf = 0;
52263+ do {leaf <<= 1; leaf |= reverse & 1; reverse >>= 1;} while (--fill);
52264+#endif
52265+
52266+ if((pos += bit_mask) > table_mask) return 1; /* table overrun */
52267+
52268+ /* fill all possible lookups of this symbol with the symbol itself */
52269+#ifdef BITS_ORDER_MSB
52270+ for (fill = bit_mask; fill-- > 0;) table[leaf++] = sym;
52271+#else
52272+ fill = bit_mask; next_symbol = 1 << bit_num;
52273+ do { table[leaf] = sym; leaf += next_symbol; } while (--fill);
52274+#endif
52275+ }
52276+ bit_mask >>= 1;
52277+ }
52278+
52279+ /* exit with success if table is now complete */
52280+ if (pos == table_mask) return 0;
52281+
52282+ /* mark all remaining table entries as unused */
52283+ for (sym = pos; sym < table_mask; sym++) {
52284+#ifdef BITS_ORDER_MSB
52285+ table[sym] = 0xFFFF;
52286+#else
52287+ reverse = sym; leaf = 0; fill = nbits;
52288+ do { leaf <<= 1; leaf |= reverse & 1; reverse >>= 1; } while (--fill);
52289+ table[leaf] = 0xFFFF;
52290+#endif
52291+ }
52292+
52293+ /* next_symbol = base of allocation for long codes */
52294+ next_symbol = ((table_mask >> 1) < nsyms) ? nsyms : (table_mask >> 1);
52295+
52296+ /* give ourselves room for codes to grow by up to 16 more bits.
52297+ * codes now start at bit nbits+16 and end at (nbits+16-codelength) */
52298+ pos <<= 16;
52299+ table_mask <<= 16;
52300+ bit_mask = 1 << 15;
52301+
52302+ for (bit_num = nbits+1; bit_num <= HUFF_MAXBITS; bit_num++) {
52303+ for (sym = 0; sym < nsyms; sym++) {
52304+ if (length[sym] != bit_num) continue;
52305+
52306+#ifdef BITS_ORDER_MSB
52307+ leaf = pos >> 16;
52308+#else
52309+ /* leaf = the first nbits of the code, reversed */
52310+ reverse = pos >> 16; leaf = 0; fill = nbits;
52311+ do {leaf <<= 1; leaf |= reverse & 1; reverse >>= 1;} while (--fill);
52312+#endif
52313+ for (fill = 0; fill < (bit_num - nbits); fill++) {
52314+ /* if this path hasn't been taken yet, 'allocate' two entries */
52315+ if (table[leaf] == 0xFFFF) {
52316+ table[(next_symbol << 1) ] = 0xFFFF;
52317+ table[(next_symbol << 1) + 1 ] = 0xFFFF;
52318+ table[leaf] = next_symbol++;
52319+ }
52320+
52321+ /* follow the path and select either left or right for next bit */
52322+ leaf = table[leaf] << 1;
52323+ if ((pos >> (15-fill)) & 1) leaf++;
52324+ }
52325+ table[leaf] = sym;
52326+
52327+ if ((pos += bit_mask) > table_mask) return 1; /* table overflow */
52328+ }
52329+ bit_mask >>= 1;
52330+ }
52331+
52332+ /* full table? */
52333+ return (pos == table_mask) ? 0 : 1;
52334+}
52335+#endif
52336diff --git a/libclamav/libmspack-0.4alpha/mspack/sha.h b/libclamav/libmspack-0.4alpha/mspack/sha.h
52337new file mode 100644
52338index 000000000000..360521519beb
52339--- /dev/null
52340+++ b/libclamav/libmspack-0.4alpha/mspack/sha.h
52341@@ -0,0 +1,15 @@
52342+/* This file is part of libmspack.
52343+ * (C) 2003-2004 Stuart Caie.
52344+ *
52345+ * libmspack is free software; you can redistribute it and/or modify it under
52346+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
52347+ *
52348+ * For further details, see the file COPYING.LIB distributed with libmspack
52349+ */
52350+
52351+#ifndef MSPACK_LZSS_H
52352+#define MSPACK_LZSS_H 1
52353+
52354+/* SHA-1 message digest definitions */
52355+
52356+#endif
52357diff --git a/libclamav/libmspack-0.4alpha/mspack/system.c b/libclamav/libmspack-0.4alpha/mspack/system.c
52358new file mode 100644
52359index 000000000000..978a4d7e2357
52360--- /dev/null
52361+++ b/libclamav/libmspack-0.4alpha/mspack/system.c
52362@@ -0,0 +1,239 @@
52363+/* This file is part of libmspack.
52364+ * (C) 2003-2004 Stuart Caie.
52365+ *
52366+ * libmspack is free software; you can redistribute it and/or modify it under
52367+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
52368+ *
52369+ * For further details, see the file COPYING.LIB distributed with libmspack
52370+ */
52371+
52372+#ifdef HAVE_CONFIG_H
52373+# include <config.h>
52374+#endif
52375+
52376+#include <system.h>
52377+
52378+#ifndef LARGEFILE_SUPPORT
52379+const char *largefile_msg = "library not compiled to support large files.";
52380+#endif
52381+
52382+
52383+int mspack_version(int entity) {
52384+ switch (entity) {
52385+ /* CHM decoder version 1 -> 2 changes:
52386+ * - added mschmd_sec_mscompressed::spaninfo
52387+ * - added mschmd_header::first_pmgl
52388+ * - added mschmd_header::last_pmgl
52389+ * - added mschmd_header::chunk_cache;
52390+ */
52391+ case MSPACK_VER_MSCHMD:
52392+ return 2;
52393+ case MSPACK_VER_LIBRARY:
52394+ case MSPACK_VER_SYSTEM:
52395+ case MSPACK_VER_MSCABD:
52396+ case MSPACK_VER_MSSZDDD:
52397+ case MSPACK_VER_MSKWAJD:
52398+ case MSPACK_VER_MSOABD:
52399+ return 1;
52400+ case MSPACK_VER_MSCABC:
52401+ case MSPACK_VER_MSCHMC:
52402+ case MSPACK_VER_MSLITD:
52403+ case MSPACK_VER_MSLITC:
52404+ case MSPACK_VER_MSHLPD:
52405+ case MSPACK_VER_MSHLPC:
52406+ case MSPACK_VER_MSSZDDC:
52407+ case MSPACK_VER_MSKWAJC:
52408+ case MSPACK_VER_MSOABC:
52409+ return 0;
52410+ }
52411+ return -1;
52412+}
52413+
52414+int mspack_sys_selftest_internal(int offt_size) {
52415+ return (sizeof(off_t) == offt_size) ? MSPACK_ERR_OK : MSPACK_ERR_SEEK;
52416+}
52417+
52418+/* validates a system structure */
52419+int mspack_valid_system(struct mspack_system *sys) {
52420+ return (sys != NULL) && (sys->open != NULL) && (sys->close != NULL) &&
52421+ (sys->read != NULL) && (sys->write != NULL) && (sys->seek != NULL) &&
52422+ (sys->tell != NULL) && (sys->message != NULL) && (sys->alloc != NULL) &&
52423+ (sys->free != NULL) && (sys->copy != NULL) && (sys->null_ptr == NULL);
52424+}
52425+
52426+/* returns the length of a file opened for reading */
52427+int mspack_sys_filelen(struct mspack_system *system,
52428+ struct mspack_file *file, off_t *length)
52429+{
52430+ off_t current;
52431+
52432+ if (!system || !file || !length) return MSPACK_ERR_OPEN;
52433+
52434+ /* get current offset */
52435+ current = system->tell(file);
52436+
52437+ /* seek to end of file */
52438+ if (system->seek(file, (off_t) 0, MSPACK_SYS_SEEK_END)) {
52439+ return MSPACK_ERR_SEEK;
52440+ }
52441+
52442+ /* get offset of end of file */
52443+ *length = system->tell(file);
52444+
52445+ /* seek back to original offset */
52446+ if (system->seek(file, current, MSPACK_SYS_SEEK_START)) {
52447+ return MSPACK_ERR_SEEK;
52448+ }
52449+
52450+ return MSPACK_ERR_OK;
52451+}
52452+
52453+
52454+
52455+/* definition of mspack_default_system -- if the library is compiled with
52456+ * MSPACK_NO_DEFAULT_SYSTEM, no default system will be provided. Otherwise,
52457+ * an appropriate default system (e.g. the standard C library, or some native
52458+ * API calls)
52459+ */
52460+
52461+#ifdef MSPACK_NO_DEFAULT_SYSTEM
52462+struct mspack_system *mspack_default_system = NULL;
52463+#else
52464+
52465+/* implementation of mspack_default_system for standard C library */
52466+
52467+#include <stdio.h>
52468+#include <stdlib.h>
52469+#include <string.h>
52470+#include <stdarg.h>
52471+
52472+struct mspack_file_p {
52473+ FILE *fh;
52474+ const char *name;
52475+};
52476+
52477+static struct mspack_file *msp_open(struct mspack_system *self,
52478+ const char *filename, int mode)
52479+{
52480+ struct mspack_file_p *fh;
52481+ const char *fmode;
52482+
52483+ switch (mode) {
52484+ case MSPACK_SYS_OPEN_READ: fmode = "rb"; break;
52485+ case MSPACK_SYS_OPEN_WRITE: fmode = "wb"; break;
52486+ case MSPACK_SYS_OPEN_UPDATE: fmode = "r+b"; break;
52487+ case MSPACK_SYS_OPEN_APPEND: fmode = "ab"; break;
52488+ default: return NULL;
52489+ }
52490+
52491+ if ((fh = (struct mspack_file_p *) malloc(sizeof(struct mspack_file_p)))) {
52492+ fh->name = filename;
52493+ if ((fh->fh = fopen(filename, fmode))) return (struct mspack_file *) fh;
52494+ free(fh);
52495+ }
52496+ return NULL;
52497+}
52498+
52499+static void msp_close(struct mspack_file *file) {
52500+ struct mspack_file_p *self = (struct mspack_file_p *) file;
52501+ if (self) {
52502+ fclose(self->fh);
52503+ free(self);
52504+ }
52505+}
52506+
52507+static int msp_read(struct mspack_file *file, void *buffer, int bytes) {
52508+ struct mspack_file_p *self = (struct mspack_file_p *) file;
52509+ if (self && buffer && bytes >= 0) {
52510+ size_t count = fread(buffer, 1, (size_t) bytes, self->fh);
52511+ if (!ferror(self->fh)) return (int) count;
52512+ }
52513+ return -1;
52514+}
52515+
52516+static int msp_write(struct mspack_file *file, void *buffer, int bytes) {
52517+ struct mspack_file_p *self = (struct mspack_file_p *) file;
52518+ if (self && buffer && bytes >= 0) {
52519+ size_t count = fwrite(buffer, 1, (size_t) bytes, self->fh);
52520+ if (!ferror(self->fh)) return (int) count;
52521+ }
52522+ return -1;
52523+}
52524+
52525+static int msp_seek(struct mspack_file *file, off_t offset, int mode) {
52526+ struct mspack_file_p *self = (struct mspack_file_p *) file;
52527+ if (self) {
52528+ switch (mode) {
52529+ case MSPACK_SYS_SEEK_START: mode = SEEK_SET; break;
52530+ case MSPACK_SYS_SEEK_CUR: mode = SEEK_CUR; break;
52531+ case MSPACK_SYS_SEEK_END: mode = SEEK_END; break;
52532+ default: return -1;
52533+ }
52534+#ifdef HAVE_FSEEKO
52535+ return fseeko(self->fh, offset, mode);
52536+#else
52537+ return fseek(self->fh, offset, mode);
52538+#endif
52539+ }
52540+ return -1;
52541+}
52542+
52543+static off_t msp_tell(struct mspack_file *file) {
52544+ struct mspack_file_p *self = (struct mspack_file_p *) file;
52545+#ifdef HAVE_FSEEKO
52546+ return (self) ? (off_t) ftello(self->fh) : 0;
52547+#else
52548+ return (self) ? (off_t) ftell(self->fh) : 0;
52549+#endif
52550+}
52551+
52552+static void msp_msg(struct mspack_file *file, const char *format, ...) {
52553+ va_list ap;
52554+ if (file) fprintf(stderr, "%s: ", ((struct mspack_file_p *) file)->name);
52555+ va_start(ap, format);
52556+ vfprintf(stderr, format, ap);
52557+ va_end(ap);
52558+ fputc((int) '\n', stderr);
52559+ fflush(stderr);
52560+}
52561+
52562+static void *msp_alloc(struct mspack_system *self, size_t bytes) {
52563+#ifdef DEBUG
52564+ /* make uninitialised data obvious */
52565+ char *buf = malloc(bytes + 8);
52566+ if (buf) memset(buf, 0xDC, bytes);
52567+ *((size_t *)buf) = bytes;
52568+ return &buf[8];
52569+#else
52570+ return malloc(bytes);
52571+#endif
52572+}
52573+
52574+static void msp_free(void *buffer) {
52575+#ifdef DEBUG
52576+ char *buf = buffer;
52577+ size_t bytes;
52578+ if (buf) {
52579+ buf -= 8;
52580+ bytes = *((size_t *)buf);
52581+ /* make freed data obvious */
52582+ memset(buf, 0xED, bytes);
52583+ free(buf);
52584+ }
52585+#else
52586+ free(buffer);
52587+#endif
52588+}
52589+
52590+static void msp_copy(void *src, void *dest, size_t bytes) {
52591+ memcpy(dest, src, bytes);
52592+}
52593+
52594+static struct mspack_system msp_system = {
52595+ &msp_open, &msp_close, &msp_read, &msp_write, &msp_seek,
52596+ &msp_tell, &msp_msg, &msp_alloc, &msp_free, &msp_copy, NULL
52597+};
52598+
52599+struct mspack_system *mspack_default_system = &msp_system;
52600+
52601+#endif
52602diff --git a/libclamav/libmspack-0.4alpha/mspack/system.h b/libclamav/libmspack-0.4alpha/mspack/system.h
52603new file mode 100644
52604index 000000000000..4a400850aa52
52605--- /dev/null
52606+++ b/libclamav/libmspack-0.4alpha/mspack/system.h
52607@@ -0,0 +1,124 @@
52608+/* This file is part of libmspack.
52609+ * (C) 2003-2004 Stuart Caie.
52610+ *
52611+ * libmspack is free software; you can redistribute it and/or modify it under
52612+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
52613+ *
52614+ * For further details, see the file COPYING.LIB distributed with libmspack
52615+ */
52616+
52617+#ifndef MSPACK_SYSTEM_H
52618+#define MSPACK_SYSTEM_H 1
52619+
52620+#ifdef __cplusplus
52621+extern "C" {
52622+#endif
52623+
52624+/* ensure config.h is read before mspack.h */
52625+#ifdef HAVE_CONFIG_H
52626+# include <config.h>
52627+#endif
52628+
52629+#include <mspack.h>
52630+
52631+/* fix for problem with GCC 4 and glibc (thanks to Ville Skytta)
52632+ * http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=150429
52633+ */
52634+#ifdef read
52635+# undef read
52636+#endif
52637+
52638+#ifdef DEBUG
52639+# include <stdio.h>
52640+/* Old GCCs don't have __func__, but __FUNCTION__:
52641+ * http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html
52642+ */
52643+# if __STDC_VERSION__ < 199901L
52644+# if __GNUC__ >= 2
52645+# define __func__ __FUNCTION__
52646+# else
52647+# define __func__ "<unknown>"
52648+# endif
52649+# endif
52650+# define D(x) do { printf("%s:%d (%s) ",__FILE__, __LINE__, __func__); \
52651+ printf x ; fputc('\n', stdout); fflush(stdout);} while (0);
52652+#else
52653+# define D(x)
52654+#endif
52655+
52656+/* CAB supports searching through files over 4GB in size, and the CHM file
52657+ * format actively uses 64-bit offsets. These can only be fully supported
52658+ * if the system the code runs on supports large files. If not, the library
52659+ * will work as normal using only 32-bit arithmetic, but if an offset
52660+ * greater than 2GB is detected, an error message indicating the library
52661+ * can't support the file should be printed.
52662+ */
52663+#ifdef HAVE_LIMITS_H
52664+# include <limits.h>
52665+#endif
52666+
52667+#if ((defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS >= 64) || \
52668+ (defined(FILESIZEBITS) && FILESIZEBITS >= 64) || \
52669+ (defined(SIZEOF_OFF_T) && SIZEOF_OFF_T >= 8) || \
52670+ defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE))
52671+# define LARGEFILE_SUPPORT
52672+# define LD "lld"
52673+# define LU "llu"
52674+#else
52675+extern const char *largefile_msg;
52676+# define LD "ld"
52677+# define LU "lu"
52678+#endif
52679+
52680+/* endian-neutral reading of little-endian data */
52681+#define __egi32(a,n) ( ((((unsigned char *) a)[n+3]) << 24) | \
52682+ ((((unsigned char *) a)[n+2]) << 16) | \
52683+ ((((unsigned char *) a)[n+1]) << 8) | \
52684+ ((((unsigned char *) a)[n+0])))
52685+#define EndGetI64(a) ((((unsigned long long int) __egi32(a,4)) << 32) | \
52686+ ((unsigned int) __egi32(a,0)))
52687+#define EndGetI32(a) __egi32(a,0)
52688+#define EndGetI16(a) ((((a)[1])<<8)|((a)[0]))
52689+
52690+/* endian-neutral reading of big-endian data */
52691+#define EndGetM32(a) (((((unsigned char *) a)[0]) << 24) | \
52692+ ((((unsigned char *) a)[1]) << 16) | \
52693+ ((((unsigned char *) a)[2]) << 8) | \
52694+ ((((unsigned char *) a)[3])))
52695+#define EndGetM16(a) ((((a)[0])<<8)|((a)[1]))
52696+
52697+extern struct mspack_system *mspack_default_system;
52698+
52699+/* returns the length of a file opened for reading */
52700+extern int mspack_sys_filelen(struct mspack_system *system,
52701+ struct mspack_file *file, off_t *length);
52702+
52703+/* validates a system structure */
52704+extern int mspack_valid_system(struct mspack_system *sys);
52705+
52706+#if HAVE_STRINGS_H
52707+# include <strings.h>
52708+#endif
52709+
52710+#if HAVE_STRING_H
52711+# include <string.h>
52712+#endif
52713+
52714+#if HAVE_MEMCMP
52715+# define mspack_memcmp memcmp
52716+#else
52717+/* inline memcmp() */
52718+static inline int mspack_memcmp(const void *s1, const void *s2, size_t n) {
52719+ unsigned char *c1 = (unsigned char *) s1;
52720+ unsigned char *c2 = (unsigned char *) s2;
52721+ if (n == 0) return 0;
52722+ while (--n && (*c1 == *c2)) c1++, c2++;
52723+ return *c1 - *c2;
52724+}
52725+#endif
52726+
52727+#ifdef __cplusplus
52728+}
52729+#endif
52730+
52731+#endif
52732diff --git a/libclamav/libmspack-0.4alpha/mspack/szdd.h b/libclamav/libmspack-0.4alpha/mspack/szdd.h
52733new file mode 100644
52734index 000000000000..e07c6b7c8edd
52735--- /dev/null
52736+++ b/libclamav/libmspack-0.4alpha/mspack/szdd.h
52737@@ -0,0 +1,39 @@
52738+/* This file is part of libmspack.
52739+ * (C) 2003-2004 Stuart Caie.
52740+ *
52741+ * libmspack is free software; you can redistribute it and/or modify it under
52742+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
52743+ *
52744+ * For further details, see the file COPYING.LIB distributed with libmspack
52745+ */
52746+
52747+#ifndef MSPACK_SZDD_H
52748+#define MSPACK_SZDD_H 1
52749+
52750+#include <lzss.h>
52751+
52752+/* input buffer size during decompression - not worth parameterising IMHO */
52753+#define SZDD_INPUT_SIZE (2048)
52754+
52755+/* SZDD compression definitions */
52756+
52757+struct msszdd_compressor_p {
52758+ struct msszdd_compressor base;
52759+ struct mspack_system *system;
52760+ int error;
52761+};
52762+
52763+/* SZDD decompression definitions */
52764+
52765+struct msszdd_decompressor_p {
52766+ struct msszdd_decompressor base;
52767+ struct mspack_system *system;
52768+ int error;
52769+};
52770+
52771+struct msszddd_header_p {
52772+ struct msszddd_header base;
52773+ struct mspack_file *fh;
52774+};
52775+
52776+#endif
52777diff --git a/libclamav/libmspack-0.4alpha/mspack/szddc.c b/libclamav/libmspack-0.4alpha/mspack/szddc.c
52778new file mode 100644
52779index 000000000000..cdd39a630532
52780--- /dev/null
52781+++ b/libclamav/libmspack-0.4alpha/mspack/szddc.c
52782@@ -0,0 +1,24 @@
52783+/* This file is part of libmspack.
52784+ * (C) 2003-2004 Stuart Caie.
52785+ *
52786+ * libmspack is free software; you can redistribute it and/or modify it under
52787+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
52788+ *
52789+ * For further details, see the file COPYING.LIB distributed with libmspack
52790+ */
52791+
52792+/* SZDD compression implementation */
52793+
52794+#include <system.h>
52795+#include <szdd.h>
52796+
52797+struct msszdd_compressor *
52798+ mspack_create_szdd_compressor(struct mspack_system *sys)
52799+{
52800+ /* todo */
52801+ return NULL;
52802+}
52803+
52804+void mspack_destroy_szdd_compressor(struct msszdd_compressor *self) {
52805+ /* todo */
52806+}
52807diff --git a/libclamav/libmspack-0.4alpha/mspack/szddd.c b/libclamav/libmspack-0.4alpha/mspack/szddd.c
52808new file mode 100644
52809index 000000000000..99c5aa465852
52810--- /dev/null
52811+++ b/libclamav/libmspack-0.4alpha/mspack/szddd.c
52812@@ -0,0 +1,247 @@
52813+/* This file is part of libmspack.
52814+ * (C) 2003-2010 Stuart Caie.
52815+ *
52816+ * SZDD is a format used in the MS-DOS commands COMPRESS.EXE and
52817+ * EXPAND.EXE. The compression method is attributed to Steven Zeck,
52818+ * however it's pretty much identical to LZSS.
52819+ *
52820+ * libmspack is free software; you can redistribute it and/or modify it under
52821+ * the terms of the GNU Lesser General Public License (LGPL) version 2.1
52822+ *
52823+ * For further details, see the file COPYING.LIB distributed with libmspack
52824+ */
52825+
52826+/* SZDD decompression implementation */
52827+
52828+#include <system.h>
52829+#include <szdd.h>
52830+
52831+/* prototypes */
52832+static struct msszddd_header *szddd_open(
52833+ struct msszdd_decompressor *base, const char *filename);
52834+static void szddd_close(
52835+ struct msszdd_decompressor *base, struct msszddd_header *hdr);
52836+static int szddd_read_headers(
52837+ struct mspack_system *sys, struct mspack_file *fh,
52838+ struct msszddd_header *hdr);
52839+static int szddd_extract(
52840+ struct msszdd_decompressor *base, struct msszddd_header *hdr,
52841+ const char *filename);
52842+static int szddd_decompress(
52843+ struct msszdd_decompressor *base, const char *input, const char *output);
52844+static int szddd_error(
52845+ struct msszdd_decompressor *base);
52846+
52847+/***************************************
52848+ * MSPACK_CREATE_SZDD_DECOMPRESSOR
52849+ ***************************************
52850+ * constructor
52851+ */
52852+struct msszdd_decompressor *
52853+ mspack_create_szdd_decompressor(struct mspack_system *sys)
52854+{
52855+ struct msszdd_decompressor_p *self = NULL;
52856+
52857+ if (!sys) sys = mspack_default_system;
52858+ if (!mspack_valid_system(sys)) return NULL;
52859+
52860+ if ((self = (struct msszdd_decompressor_p *) sys->alloc(sys, sizeof(struct msszdd_decompressor_p)))) {
52861+ self->base.open = &szddd_open;
52862+ self->base.close = &szddd_close;
52863+ self->base.extract = &szddd_extract;
52864+ self->base.decompress = &szddd_decompress;
52865+ self->base.last_error = &szddd_error;
52866+ self->system = sys;
52867+ self->error = MSPACK_ERR_OK;
52868+ }
52869+ return (struct msszdd_decompressor *) self;
52870+}
52871+
52872+/***************************************
52873+ * MSPACK_DESTROY_SZDD_DECOMPRESSOR
52874+ ***************************************
52875+ * destructor
52876+ */
52877+void mspack_destroy_szdd_decompressor(struct msszdd_decompressor *base)
52878+{
52879+ struct msszdd_decompressor_p *self = (struct msszdd_decompressor_p *) base;
52880+ if (self) {
52881+ struct mspack_system *sys = self->system;
52882+ sys->free(self);
52883+ }
52884+}
52885+
52886+/***************************************
52887+ * SZDDD_OPEN
52888+ ***************************************
52889+ * opens an SZDD file without decompressing, reads header
52890+ */
52891+static struct msszddd_header *szddd_open(struct msszdd_decompressor *base,
52892+ const char *filename)
52893+{
52894+ struct msszdd_decompressor_p *self = (struct msszdd_decompressor_p *) base;
52895+ struct msszddd_header *hdr;
52896+ struct mspack_system *sys;
52897+ struct mspack_file *fh;
52898+
52899+ if (!self) return NULL;
52900+ sys = self->system;
52901+
52902+ fh = sys->open(sys, filename, MSPACK_SYS_OPEN_READ);
52903+ hdr = (struct msszddd_header *) sys->alloc(sys, sizeof(struct msszddd_header_p));
52904+ if (fh && hdr) {
52905+ ((struct msszddd_header_p *) hdr)->fh = fh;
52906+ self->error = szddd_read_headers(sys, fh, hdr);
52907+ }
52908+ else {
52909+ if (!fh) self->error = MSPACK_ERR_OPEN;
52910+ if (!hdr) self->error = MSPACK_ERR_NOMEMORY;
52911+ }
52912+
52913+ if (self->error) {
52914+ if (fh) sys->close(fh);
52915+ if (hdr) sys->free(hdr);
52916+ hdr = NULL;
52917+ }
52918+
52919+ return hdr;
52920+}
52921+
52922+/***************************************
52923+ * SZDDD_CLOSE
52924+ ***************************************
52925+ * closes an SZDD file
52926+ */
52927+static void szddd_close(struct msszdd_decompressor *base,
52928+ struct msszddd_header *hdr)
52929+{
52930+ struct msszdd_decompressor_p *self = (struct msszdd_decompressor_p *) base;
52931+ struct msszddd_header_p *hdr_p = (struct msszddd_header_p *) hdr;
52932+
52933+ if (!self || !self->system) return;
52934+
52935+ /* close the file handle associated */
52936+ self->system->close(hdr_p->fh);
52937+
52938+ /* free the memory associated */
52939+ self->system->free(hdr);
52940+
52941+ self->error = MSPACK_ERR_OK;
52942+}
52943+
52944+/***************************************
52945+ * SZDDD_READ_HEADERS
52946+ ***************************************
52947+ * reads the headers of an SZDD format file
52948+ */
52949+static unsigned char szdd_signature_expand[8] = {
52950+ 0x53, 0x5A, 0x44, 0x44, 0x88, 0xF0, 0x27, 0x33
52951+};
52952+static unsigned char szdd_signature_qbasic[8] = {
52953+ 0x53, 0x5A, 0x20, 0x88, 0xF0, 0x27, 0x33, 0xD1
52954+};
52955+
52956+static int szddd_read_headers(struct mspack_system *sys,
52957+ struct mspack_file *fh,
52958+ struct msszddd_header *hdr)
52959+{
52960+ unsigned char buf[8];
52961+
52962+ /* read and check signature */
52963+ if (sys->read(fh, buf, 8) != 8) return MSPACK_ERR_READ;
52964+
52965+ if ((mspack_memcmp(buf, szdd_signature_expand, 8) == 0)) {
52966+ /* common SZDD */
52967+ hdr->format = MSSZDD_FMT_NORMAL;
52968+
52969+ /* read the rest of the header */
52970+ if (sys->read(fh, buf, 6) != 6) return MSPACK_ERR_READ;
52971+ if (buf[0] != 0x41) return MSPACK_ERR_DATAFORMAT;
52972+ hdr->missing_char = buf[1];
52973+ hdr->length = EndGetI32(&buf[2]);
52974+ }
52975+ else if ((mspack_memcmp(buf, szdd_signature_qbasic, 8) == 0)) {
52976+ /* special QBasic SZDD */
52977+ hdr->format = MSSZDD_FMT_QBASIC;
52978+ if (sys->read(fh, buf, 4) != 4) return MSPACK_ERR_READ;
52979+ hdr->missing_char = '\0';
52980+ hdr->length = EndGetI32(buf);
52981+ }
52982+ else {
52983+ return MSPACK_ERR_SIGNATURE;
52984+ }
52985+ return MSPACK_ERR_OK;
52986+}
52987+
52988+/***************************************
52989+ * SZDDD_EXTRACT
52990+ ***************************************
52991+ * decompresses an SZDD file
52992+ */
52993+static int szddd_extract(struct msszdd_decompressor *base,
52994+ struct msszddd_header *hdr, const char *filename)
52995+{
52996+ struct msszdd_decompressor_p *self = (struct msszdd_decompressor_p *) base;
52997+ struct mspack_file *fh, *outfh;
52998+ struct mspack_system *sys;
52999+ off_t data_offset;
53000+
53001+ if (!self) return MSPACK_ERR_ARGS;
53002+ if (!hdr) return self->error = MSPACK_ERR_ARGS;
53003+ sys = self->system;
53004+
53005+ fh = ((struct msszddd_header_p *) hdr)->fh;
53006+
53007+ /* seek to the compressed data */
53008+ data_offset = (hdr->format == MSSZDD_FMT_NORMAL) ? 14 : 12;
53009+ if (sys->seek(fh, data_offset, MSPACK_SYS_SEEK_START)) {
53010+ return self->error = MSPACK_ERR_SEEK;
53011+ }
53012+
53013+ /* open file for output */
53014+ if (!(outfh = sys->open(sys, filename, MSPACK_SYS_OPEN_WRITE))) {
53015+ return self->error = MSPACK_ERR_OPEN;
53016+ }
53017+
53018+ /* decompress the data */
53019+ self->error = lzss_decompress(sys, fh, outfh, SZDD_INPUT_SIZE,
53020+ hdr->format == MSSZDD_FMT_NORMAL
53021+ ? LZSS_MODE_EXPAND
53022+ : LZSS_MODE_QBASIC);
53023+
53024+ /* close output file */
53025+ sys->close(outfh);
53026+
53027+ return self->error;
53028+}
53029+
53030+/***************************************
53031+ * SZDDD_DECOMPRESS
53032+ ***************************************
53033+ * unpacks directly from input to output
53034+ */
53035+static int szddd_decompress(struct msszdd_decompressor *base,
53036+ const char *input, const char *output)
53037+{
53038+ struct msszdd_decompressor_p *self = (struct msszdd_decompressor_p *) base;
53039+ struct msszddd_header *hdr;
53040+ int error;
53041+
53042+ if (!self) return MSPACK_ERR_ARGS;
53043+
53044+ if (!(hdr = szddd_open(base, input))) return self->error;
53045+ error = szddd_extract(base, hdr, output);
53046+ szddd_close(base, hdr);
53047+ return self->error = error;
53048+}
53049+
53050+/***************************************
53051+ * SZDDD_ERROR
53052+ ***************************************
53053+ * returns the last error that occurred
53054+ */
53055+static int szddd_error(struct msszdd_decompressor *base)
53056+{
53057+ struct msszdd_decompressor_p *self = (struct msszdd_decompressor_p *) base;
53058+ return (self) ? self->error : MSPACK_ERR_ARGS;
53059+}
53060diff --git a/libclamav/libmspack-0.4alpha/test/cabd_md5.c b/libclamav/libmspack-0.4alpha/test/cabd_md5.c
53061new file mode 100644
53062index 000000000000..6a00dbda3f0d
53063--- /dev/null
53064+++ b/libclamav/libmspack-0.4alpha/test/cabd_md5.c
53065@@ -0,0 +1,161 @@
53066+#ifdef HAVE_CONFIG_H
53067+#include <config.h>
53068+#endif
53069+
53070+#include <stdio.h>
53071+#include <stdlib.h>
53072+#include <string.h>
53073+#include <mspack.h>
53074+#include <sys/stat.h>
53075+#include <dirent.h>
53076+
53077+#include <md5_fh.h>
53078+#include <error.h>
53079+
53080+/**
53081+ * Matches a cabinet's filename case-insensitively in the filesystem and
53082+ * returns the case-correct form.
53083+ *
53084+ * @param origcab if this is non-NULL, the pathname part of this filename
53085+ * will be extracted, and the search will be conducted in
53086+ * that directory.
53087+ * @param cabname the internal CAB filename to search for.
53088+ * @return a copy of the full, case-correct filename of the given cabinet
53089+ * filename, or NULL if the specified filename does not exist on disk.
53090+ */
53091+static char *find_cabinet_file(char *origcab, char *cabname) {
53092+ struct dirent *entry;
53093+ struct stat st_buf;
53094+ int found = 0, len;
53095+ char *tail, *cab;
53096+ DIR *dir;
53097+
53098+ /* ensure we have a cabinet name at all */
53099+ if (!cabname || !cabname[0]) return NULL;
53100+
53101+ /* find if there's a directory path in the origcab */
53102+ tail = origcab ? strrchr(origcab, '/') : NULL;
53103+ len = (tail - origcab) + 1;
53104+
53105+ /* allocate memory for our copy */
53106+ if (!(cab = (char *) malloc((tail ? len : 2) + strlen(cabname) + 1))) return NULL;
53107+
53108+ /* add the directory path from the original cabinet name, or "." */
53109+ if (tail) memcpy(cab, origcab, (size_t) len);
53110+ else cab[0]='.', cab[1]='/', len=2;
53111+ cab[len] = '\0';
53112+
53113+ /* try accessing the cabinet with its current name (case-sensitive) */
53114+ strcpy(&cab[len], cabname);
53115+ if (stat(cab, &st_buf) == 0) {
53116+ found = 1;
53117+ }
53118+ else {
53119+ /* cabinet was not found, look for it in the current dir */
53120+ cab[len] = '\0';
53121+ if ((dir = opendir(cab))) {
53122+ while ((entry = readdir(dir))) {
53123+ if (strcasecmp(cabname, entry->d_name) == 0) {
53124+ strcat(cab, entry->d_name);
53125+ found = (stat(cab, &st_buf) == 0);
53126+ break;
53127+ }
53128+ }
53129+ closedir(dir);
53130+ }
53131+ }
53132+
53133+ if (!found || !S_ISREG(st_buf.st_mode)) {
53134+ /* cabinet not found, or not a regular file */
53135+ free(cab);
53136+ cab = NULL;
53137+ }
53138+
53139+ return cab;
53140+}
53141+
53142+
53143+int main(int argc, char *argv[]) {
53144+ struct mscab_decompressor *cabd;
53145+ struct mscabd_cabinet *cab, *c, *c2;
53146+ struct mscabd_file *file;
53147+ char *cabname, *newname;
53148+ int err;
53149+
53150+ setbuf(stdout, NULL);
53151+ setbuf(stderr, NULL);
53152+
53153+ /* if self-test reveals an error */
53154+ MSPACK_SYS_SELFTEST(err);
53155+ if (err) return 1;
53156+
53157+ if (!(cabd = mspack_create_cab_decompressor(&read_files_write_md5))) {
53158+ fprintf(stderr, "can't make decompressor\n");
53159+ return 1;
53160+ }
53161+
53162+ for (argv++; (cabname = *argv); argv++) {
53163+ printf("*** %s\n", cabname);
53164+
53165+ if (!(cab = cabd->open(cabd, cabname))) {
53166+ fprintf(stderr, "cab open error: %s\n", ERROR(cabd));
53167+ continue;
53168+ }
53169+
53170+ /* prepend any spanning cabinets */
53171+ for (c = cab; c && (c->flags & MSCAB_HDR_PREVCAB); c = c->prevcab) {
53172+ if (!(newname = find_cabinet_file(cabname, c->prevname))) {
53173+ fprintf(stderr, "%s: can't find \"%s\" to prepend\n",
53174+ cabname, c->prevname);
53175+ break;
53176+ }
53177+ if (!(c2 = cabd->open(cabd, newname))) {
53178+ fprintf(stderr, "%s: error opening \"%s\" for prepend: %s\n",
53179+ cabname, newname, ERROR(cabd));
53180+ break;
53181+ }
53182+ if (cabd->prepend(cabd, c, c2) != MSPACK_ERR_OK) {
53183+ fprintf(stderr, "%s: error prepending \"%s\": %s\n",
53184+ cabname, newname, ERROR(cabd));
53185+ break;
53186+ }
53187+ }
53188+
53189+ /* append any spanning cabinets */
53190+ for (c = cab; c && (c->flags & MSCAB_HDR_NEXTCAB); c = c->nextcab) {
53191+ if (!(newname = find_cabinet_file(cabname, c->nextname))) {
53192+ fprintf(stderr, "%s: can't find \"%s\" to append\n",
53193+ cabname, c->nextname);
53194+ break;
53195+ }
53196+ if (!(c2 = cabd->open(cabd, newname))) {
53197+ fprintf(stderr, "%s: error opening \"%s\" for append: %s\n",
53198+ cabname, newname, ERROR(cabd));
53199+ break;
53200+ }
53201+ if (cabd->append(cabd, c, c2) != MSPACK_ERR_OK) {
53202+ fprintf(stderr, "%s: error appending \"%s\": %s\n",
53203+ cabname, newname, ERROR(cabd));
53204+ break;
53205+ }
53206+ }
53207+
53208+ /* extract files */
53209+ for (file = cab->files; file; file = file->next ) {
53210+ if (cabd->extract(cabd, file, NULL) == MSPACK_ERR_OK) {
53211+ printf("%s %s\n", md5_string, file->filename);
53212+ }
53213+ else {
53214+ fprintf(stderr, "%s: error extracting \"%s\": %s\n",
53215+ cabname, file->filename, ERROR(cabd));
53216+ }
53217+ }
53218+
53219+ /* free all resources */
53220+ for (c2 = cab->prevcab; c2; c2 = c2->prevcab) free((void*)c2->filename);
53221+ for (c2 = cab->nextcab; c2; c2 = c2->nextcab) free((void*)c2->filename);
53222+ cabd->close(cabd, cab);
53223+ }
53224+ mspack_destroy_cab_decompressor(cabd);
53225+ return 0;
53226+}
53227diff --git a/libclamav/libmspack-0.4alpha/test/cabd_memory.c b/libclamav/libmspack-0.4alpha/test/cabd_memory.c
53228new file mode 100644
53229index 000000000000..f7a78972c8e4
53230--- /dev/null
53231+++ b/libclamav/libmspack-0.4alpha/test/cabd_memory.c
53232@@ -0,0 +1,179 @@
53233+/* An implementation of the mspack_system interface using only memory */
53234+
53235+#ifdef HAVE_CONFIG_H
53236+#include <config.h>
53237+#endif
53238+
53239+#include <stdio.h>
53240+#include <stdlib.h>
53241+#include <string.h>
53242+#include <mspack.h>
53243+
53244+/* use a pointer to a mem_buf structure as "filenames" */
53245+struct mem_buf {
53246+ void *data;
53247+ size_t length;
53248+};
53249+
53250+struct mem_file {
53251+ char *data;
53252+ size_t length, posn;
53253+};
53254+
53255+static void *mem_alloc(struct mspack_system *self, size_t bytes) {
53256+ /* put your memory allocator here */
53257+ return malloc(bytes);
53258+}
53259+
53260+static void mem_free(void *buffer) {
53261+ /* put your memory deallocator here */
53262+ free(buffer);
53263+}
53264+
53265+static void mem_copy(void *src, void *dest, size_t bytes) {
53266+ /* put your own memory copy routine here */
53267+ memcpy(dest, src, bytes);
53268+}
53269+
53270+static void mem_msg(struct mem_file *file, const char *format, ...) {
53271+ /* put your own printf-type routine here, or leave it empty */
53272+}
53273+
53274+static struct mem_file *mem_open(struct mspack_system *self,
53275+ struct mem_buf *fn, int mode)
53276+{
53277+ struct mem_file *fh;
53278+ if (!fn || !fn->data || !fn->length) return NULL;
53279+ if ((fh = (struct mem_file *) mem_alloc(self, sizeof(struct mem_file)))) {
53280+ fh->data = (char *) fn->data;
53281+ fh->length = fn->length;
53282+ fh->posn = (mode == MSPACK_SYS_OPEN_APPEND) ? fn->length : 0;
53283+ }
53284+ return fh;
53285+}
53286+
53287+static void mem_close(struct mem_file *fh) {
53288+ if (fh) mem_free(fh);
53289+}
53290+
53291+static int mem_read(struct mem_file *fh, void *buffer, int bytes) {
53292+ int todo;
53293+ if (!fh || !buffer || bytes < 0) return -1;
53294+ todo = fh->length - fh->posn;
53295+ if (todo > bytes) todo = bytes;
53296+ if (todo > 0) mem_copy(&fh->data[fh->posn], buffer, (size_t) todo);
53297+ fh->posn += todo; return todo;
53298+}
53299+
53300+static int mem_write(struct mem_file *fh, void *buffer, int bytes) {
53301+ int todo;
53302+ if (!fh || !buffer || bytes < 0) return -1;
53303+ todo = fh->length - fh->posn;
53304+ if (todo > bytes) todo = bytes;
53305+ if (todo > 0) mem_copy(buffer, &fh->data[fh->posn], (size_t) todo);
53306+ fh->posn += todo; return todo;
53307+}
53308+
53309+static int mem_seek(struct mem_file *fh, off_t offset, int mode) {
53310+ if (!fh) return 1;
53311+ switch (mode) {
53312+ case MSPACK_SYS_SEEK_START: break;
53313+ case MSPACK_SYS_SEEK_CUR: offset += (off_t) fh->posn; break;
53314+ case MSPACK_SYS_SEEK_END: offset += (off_t) fh->length; break;
53315+ default: return 1;
53316+ }
53317+ if ((offset < 0) || (offset > (off_t) fh->length)) return 1;
53318+ fh->posn = (size_t) offset;
53319+ return 0;
53320+}
53321+
53322+static off_t mem_tell(struct mem_file *fh) {
53323+ return (fh) ? (off_t) fh->posn : -1;
53324+}
53325+
53326+static struct mspack_system mem_system = {
53327+ (struct mspack_file * (*)(struct mspack_system *, const char *, int)) &mem_open,
53328+ (void (*)(struct mspack_file *)) &mem_close,
53329+ (int (*)(struct mspack_file *, void *, int)) &mem_read,
53330+ (int (*)(struct mspack_file *, void *, int)) &mem_write,
53331+ (int (*)(struct mspack_file *, off_t, int)) &mem_seek,
53332+ (off_t (*)(struct mspack_file *)) &mem_tell,
53333+ (void (*)(struct mspack_file *, const char *, ...)) &mem_msg,
53334+ &mem_alloc,
53335+ &mem_free,
53336+ &mem_copy,
53337+ NULL
53338+};
53339+
53340+/* example of usage with mscab_decompressor */
53341+
53342+/* a simple cabinet */
53343+static unsigned char embedded_cab[] = {
53344+ 0x4D,0x53,0x43,0x46,0x00,0x00,0x00,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0x00,
53345+ 0x00,0x2C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x01,0x00,0x02,0x00,
53346+ 0x00,0x00,0x22,0x06,0x00,0x00,0x5E,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x4D,
53347+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x22,0xBA,0x59,0x20,0x00,
53348+ 0x68,0x65,0x6C,0x6C,0x6F,0x2E,0x63,0x00,0x4A,0x00,0x00,0x00,0x4D,0x00,0x00,
53349+ 0x00,0x00,0x00,0x6C,0x22,0xE7,0x59,0x20,0x00,0x77,0x65,0x6C,0x63,0x6F,0x6D,
53350+ 0x65,0x2E,0x63,0x00,0xBD,0x5A,0xA6,0x30,0x97,0x00,0x97,0x00,0x23,0x69,0x6E,
53351+ 0x63,0x6C,0x75,0x64,0x65,0x20,0x3C,0x73,0x74,0x64,0x69,0x6F,0x2E,0x68,0x3E,
53352+ 0x0D,0x0A,0x0D,0x0A,0x76,0x6F,0x69,0x64,0x20,0x6D,0x61,0x69,0x6E,0x28,0x76,
53353+ 0x6F,0x69,0x64,0x29,0x0D,0x0A,0x7B,0x0D,0x0A,0x20,0x20,0x20,0x20,0x70,0x72,
53354+ 0x69,0x6E,0x74,0x66,0x28,0x22,0x48,0x65,0x6C,0x6C,0x6F,0x2C,0x20,0x77,0x6F,
53355+ 0x72,0x6C,0x64,0x21,0x5C,0x6E,0x22,0x29,0x3B,0x0D,0x0A,0x7D,0x0D,0x0A,0x23,
53356+ 0x69,0x6E,0x63,0x6C,0x75,0x64,0x65,0x20,0x3C,0x73,0x74,0x64,0x69,0x6F,0x2E,
53357+ 0x68,0x3E,0x0D,0x0A,0x0D,0x0A,0x76,0x6F,0x69,0x64,0x20,0x6D,0x61,0x69,0x6E,
53358+ 0x28,0x76,0x6F,0x69,0x64,0x29,0x0D,0x0A,0x7B,0x0D,0x0A,0x20,0x20,0x20,0x20,
53359+ 0x70,0x72,0x69,0x6E,0x74,0x66,0x28,0x22,0x57,0x65,0x6C,0x63,0x6F,0x6D,0x65,
53360+ 0x21,0x5C,0x6E,0x22,0x29,0x3B,0x0D,0x0A,0x7D,0x0D,0x0A,0x0D,0x0A
53361+};
53362+
53363+int main() {
53364+ struct mscab_decompressor *cabd;
53365+ struct mscabd_cabinet *cab;
53366+ struct mscabd_file *file;
53367+ struct mem_buf source = { &embedded_cab[0], sizeof(embedded_cab) };
53368+ struct mem_buf output;
53369+ int err;
53370+
53371+ /* if self-test reveals an error */
53372+ MSPACK_SYS_SELFTEST(err);
53373+ if (err) return 1;
53374+
53375+ /* create a cab decompressor using our custom mspack_system interface */
53376+ if ((cabd = mspack_create_cab_decompressor(&mem_system))) {
53377+
53378+ /* open a cab file direct from memory */
53379+ if ((cab = cabd->open(cabd, (char *) &source))) {
53380+
53381+ /* for all files */
53382+ for (file = cab->files; file; file = file->next) {
53383+ /* fill out our "filename" (memory pointer and length) */
53384+ output.data = (char *) malloc(file->length);
53385+ output.length = file->length;
53386+
53387+ /* let cabd extract this file to our memory buffer */
53388+ if (output.data && cabd->extract(cabd, file, (char *) &output)) {
53389+ exit(1);
53390+ }
53391+
53392+ /* dump the memory buffer to stdout (for display purposes) */
53393+ printf("Filename: %s\nContents:\n", file->filename);
53394+ fwrite(output.data, 1, output.length, stdout);
53395+
53396+ /* free our buffer */
53397+ free(output.data);
53398+ }
53399+ cabd->close(cabd, cab);
53400+ }
53401+ else {
53402+ fprintf(stderr, "can't open cabinet (%d)\n", cabd->last_error(cabd));
53403+ }
53404+ mspack_destroy_cab_decompressor(cabd);
53405+ }
53406+ else {
53407+ fprintf(stderr, "can't make decompressor\n");
53408+ }
53409+ return 0;
53410+
53411+}
53412diff --git a/libclamav/libmspack-0.4alpha/test/cabd_test.c b/libclamav/libmspack-0.4alpha/test/cabd_test.c
53413new file mode 100644
53414index 000000000000..5e8851ce9f0e
53415--- /dev/null
53416+++ b/libclamav/libmspack-0.4alpha/test/cabd_test.c
53417@@ -0,0 +1,386 @@
53418+/* cabinet decompression regression test suite */
53419+
53420+#ifdef HAVE_CONFIG_H
53421+#include <config.h>
53422+#endif
53423+
53424+#include <stdio.h>
53425+#include <stdlib.h>
53426+#include <string.h>
53427+#include <mspack.h>
53428+
53429+unsigned int test_count = 0;
53430+
53431+#define TEST(x) do {\
53432+ test_count++; \
53433+ if (!(x)) {printf("%s:%d FAILED %s\n",__FUNCTION__,__LINE__,#x);exit(1);} \
53434+} while (0)
53435+
53436+/* open where cab file doesn't exist */
53437+void cabd_open_test_01() {
53438+ struct mscab_decompressor *cabd;
53439+ struct mscabd_cabinet *cab;
53440+
53441+ cabd = mspack_create_cab_decompressor(NULL);
53442+ TEST(cabd != NULL);
53443+
53444+ cab = cabd->open(cabd, "!!!FILE_WHICH_DOES_NOT_EXIST");
53445+ TEST(cab == NULL);
53446+ TEST(cabd->last_error(cabd) == MSPACK_ERR_OPEN);
53447+
53448+ mspack_destroy_cab_decompressor(cabd);
53449+}
53450+
53451+/* normal cab file with 2 files and one folder.
53452+ * check ALL headers are read correctly */
53453+void cabd_open_test_02() {
53454+ struct mscab_decompressor *cabd;
53455+ struct mscabd_cabinet *cab;
53456+ struct mscabd_folder *folder;
53457+ struct mscabd_file *file;
53458+
53459+ cabd = mspack_create_cab_decompressor(NULL);
53460+ TEST(cabd != NULL);
53461+
53462+ cab = cabd->open(cabd, "test_files/cabd/normal_2files_1folder.cab");
53463+ TEST(cab != NULL);
53464+
53465+ TEST(cab->next == NULL);
53466+ TEST(cab->base_offset == 0);
53467+ TEST(cab->length == 253);
53468+ TEST(cab->prevcab == NULL); TEST(cab->nextcab == NULL);
53469+ TEST(cab->prevname == NULL); TEST(cab->nextname == NULL);
53470+ TEST(cab->previnfo == NULL); TEST(cab->nextinfo == NULL);
53471+ TEST(cab->set_id = 1570); TEST(cab->set_index == 0);
53472+ TEST(cab->header_resv == 0);
53473+ TEST(cab->flags == 0);
53474+
53475+ folder = cab->folders;
53476+ TEST(folder != NULL);
53477+ TEST(folder->next == NULL);
53478+ TEST(folder->comp_type == 0);
53479+ TEST(folder->num_blocks == 1);
53480+
53481+ file = cab->files;
53482+ TEST(file != NULL);
53483+ TEST(strcmp(file->filename, "hello.c") == 0);
53484+ TEST(file->length == 77);
53485+ TEST(file->attribs == 0x20);
53486+ TEST(file->time_h == 11);TEST(file->time_m == 13);TEST(file->time_s == 52);
53487+ TEST(file->date_d == 12);TEST(file->date_m == 3);TEST(file->date_y == 1997);
53488+ TEST(file->folder == folder); TEST(file->offset == 0);
53489+
53490+ file = file->next;
53491+ TEST(file != NULL);
53492+ TEST(strcmp(file->filename, "welcome.c") == 0);
53493+ TEST(file->length == 74);
53494+ TEST(file->attribs == 0x20);
53495+ TEST(file->time_h == 11);TEST(file->time_m == 15);TEST(file->time_s == 14);
53496+ TEST(file->date_d == 12);TEST(file->date_m == 3);TEST(file->date_y == 1997);
53497+ TEST(file->folder == folder); TEST(file->offset == 77);
53498+
53499+ cabd->close(cabd, cab);
53500+ mspack_destroy_cab_decompressor(cabd);
53501+}
53502+
53503+/* cabs with reserve headers set, ensure they all load correctly */
53504+void cabd_open_test_03() {
53505+ struct mscab_decompressor *cabd;
53506+ struct mscabd_cabinet *cab;
53507+ unsigned int i;
53508+ const char *files[] = {
53509+ "test_files/cabd/reserve_---.cab",
53510+ "test_files/cabd/reserve_--D.cab",
53511+ "test_files/cabd/reserve_-F-.cab",
53512+ "test_files/cabd/reserve_-FD.cab",
53513+ "test_files/cabd/reserve_H--.cab",
53514+ "test_files/cabd/reserve_H-D.cab",
53515+ "test_files/cabd/reserve_HF-.cab",
53516+ "test_files/cabd/reserve_HFD.cab"
53517+ };
53518+
53519+ cabd = mspack_create_cab_decompressor(NULL);
53520+ TEST(cabd != NULL);
53521+
53522+ for (i = 0; i < (sizeof(files)/sizeof(char *)); i++) {
53523+ cab = cabd->open(cabd, files[i]);
53524+ TEST(cab != NULL);
53525+ TEST(cab->files != NULL);
53526+ TEST(cab->files->next != NULL);
53527+ TEST(strcmp(cab->files->filename, "test1.txt") == 0);
53528+ TEST(strcmp(cab->files->next->filename, "test2.txt") == 0);
53529+ cabd->close(cabd, cab);
53530+ }
53531+
53532+ mspack_destroy_cab_decompressor(cabd);
53533+}
53534+
53535+/* some bad cabs, should not load */
53536+void cabd_open_test_04() {
53537+ struct mscab_decompressor *cabd;
53538+ struct mscabd_cabinet *cab;
53539+
53540+ cabd = mspack_create_cab_decompressor(NULL);
53541+ TEST(cabd != NULL);
53542+
53543+ /* cab has enough data for a header, but does not contain real cab data
53544+ * result should be MSPACK_ERR_SIGNATURE */
53545+ cab = cabd->open(cabd, "test_files/cabd/bad_signature.cab");
53546+ TEST(cab == NULL);
53547+
53548+ /* cab has 0 folders */
53549+ cab = cabd->open(cabd, "test_files/cabd/bad_nofolders.cab");
53550+ TEST(cab == NULL);
53551+
53552+ /* cab has 0 files */
53553+ cab = cabd->open(cabd, "test_files/cabd/bad_nofiles.cab");
53554+ TEST(cab == NULL);
53555+
53556+ /* second file in the cab has a folder index for a non-existant folder */
53557+ cab = cabd->open(cabd, "test_files/cabd/bad_folderindex.cab");
53558+ TEST(cab == NULL);
53559+
53560+ mspack_destroy_cab_decompressor(cabd);
53561+}
53562+
53563+/* cabs which have been cut short
53564+ * result should be MSPACK_ERR_READ for missing headers or
53565+ * MSPACK_ERR_DATAFORMAT for missing/partial strings.
53566+ * If only data blocks are missing, the cab should open()
53567+ */
53568+void cabd_open_test_05() {
53569+ struct mscab_decompressor *cabd;
53570+ struct mscabd_cabinet *cab;
53571+ unsigned int i;
53572+ const char *files[] = {
53573+ "test_files/cabd/partial_shortheader.cab",
53574+ "test_files/cabd/partial_shortextheader.cab",
53575+ "test_files/cabd/partial_nofolder.cab",
53576+ "test_files/cabd/partial_shortfolder.cab",
53577+ "test_files/cabd/partial_nofiles.cab",
53578+ "test_files/cabd/partial_shortfile1.cab",
53579+ "test_files/cabd/partial_shortfile2.cab"
53580+ };
53581+ const char *str_files[] = {
53582+ "test_files/cabd/partial_str_nopname.cab",
53583+ "test_files/cabd/partial_str_shortpname.cab",
53584+ "test_files/cabd/partial_str_nopinfo.cab",
53585+ "test_files/cabd/partial_str_shortpinfo.cab",
53586+ "test_files/cabd/partial_str_nonname.cab",
53587+ "test_files/cabd/partial_str_shortnname.cab",
53588+ "test_files/cabd/partial_str_noninfo.cab",
53589+ "test_files/cabd/partial_str_shortninfo.cab",
53590+ "test_files/cabd/partial_str_nofname.cab",
53591+ "test_files/cabd/partial_str_shortfname.cab",
53592+ };
53593+
53594+ cabd = mspack_create_cab_decompressor(NULL);
53595+ TEST(cabd != NULL);
53596+
53597+ for (i = 0; i < (sizeof(files)/sizeof(char *)); i++) {
53598+ cab = cabd->open(cabd, files[i]);
53599+ TEST(cab == NULL);
53600+ TEST(cabd->last_error(cabd) == MSPACK_ERR_READ);
53601+ }
53602+
53603+ for (i = 0; i < (sizeof(str_files)/sizeof(char *)); i++) {
53604+ cab = cabd->open(cabd, str_files[i]);
53605+ TEST(cab == NULL);
53606+ TEST(cabd->last_error(cabd) == MSPACK_ERR_DATAFORMAT);
53607+ }
53608+
53609+ /* lack of data blocks should NOT be a problem for merely reading */
53610+ cab = cabd->open(cabd, "test_files/cabd/partial_nodata.cab");
53611+ TEST(cab != NULL);
53612+
53613+ cabd->close(cabd, cab);
53614+ mspack_destroy_cab_decompressor(cabd);
53615+}
53616+
53617+/* open cab with 255 character filename (maximum allowed) */
53618+void cabd_open_test_06() {
53619+ struct mscab_decompressor *cabd;
53620+ struct mscabd_cabinet *cab;
53621+
53622+ cabd = mspack_create_cab_decompressor(NULL);
53623+ TEST(cabd != NULL);
53624+
53625+ cab = cabd->open(cabd, "test_files/cabd/normal_255c_filename.cab");
53626+ TEST(cab != NULL);
53627+
53628+ cabd->close(cabd, cab);
53629+ mspack_destroy_cab_decompressor(cabd);
53630+}
53631+
53632+
53633+/* open where search file doesn't exist */
53634+void cabd_search_test_01() {
53635+ struct mscab_decompressor *cabd;
53636+ struct mscabd_cabinet *cab;
53637+
53638+ cabd = mspack_create_cab_decompressor(NULL);
53639+ TEST(cabd != NULL);
53640+
53641+ cab = cabd->search(cabd, "!!!FILE_WHICH_DOES_NOT_EXIST");
53642+ TEST(cab == NULL);
53643+ TEST(cabd->last_error(cabd) == MSPACK_ERR_OPEN);
53644+
53645+ mspack_destroy_cab_decompressor(cabd);
53646+}
53647+
53648+/* search file using 1-byte buffer */
53649+void cabd_search_test_02() {
53650+ struct mscab_decompressor *cabd;
53651+ struct mscabd_cabinet *cab;
53652+
53653+ cabd = mspack_create_cab_decompressor(NULL);
53654+ TEST(cabd != NULL);
53655+
53656+ cabd->set_param(cabd, MSCABD_PARAM_SEARCHBUF, 1);
53657+ cab = cabd->search(cabd, "test_files/cabd/search_basic.cab");
53658+ cabd->set_param(cabd, MSCABD_PARAM_SEARCHBUF, 32768);
53659+
53660+ TEST(cab != NULL);
53661+ TEST(cab->files != NULL);
53662+ TEST(cab->base_offset == 6);
53663+ TEST(cab->files->next != NULL);
53664+ TEST(strcmp(cab->files->filename, "hello.c") == 0);
53665+ TEST(strcmp(cab->files->next->filename, "welcome.c") == 0);
53666+
53667+ TEST(cab->next != NULL);
53668+ TEST(cab->next->base_offset == 265);
53669+ TEST(cab->next->files != NULL);
53670+ TEST(cab->next->files->next != NULL);
53671+ TEST(strcmp(cab->next->files->filename, "hello.c") == 0);
53672+ TEST(strcmp(cab->next->files->next->filename, "welcome.c") == 0);
53673+
53674+ TEST(cab->next->next == NULL);
53675+
53676+ cabd->close(cabd, cab);
53677+ mspack_destroy_cab_decompressor(cabd);
53678+}
53679+
53680+/* tricky searches */
53681+void cabd_search_test_03() {
53682+ struct mscab_decompressor *cabd;
53683+ struct mscabd_cabinet *cab;
53684+
53685+ cabd = mspack_create_cab_decompressor(NULL);
53686+ TEST(cabd != NULL);
53687+
53688+ /* there is only ONE cab in this file. it is prepended by 4 bytes, "MSCF"
53689+ * (heh) and reserved fields in the real cab are filled in so the fake one
53690+ * looks real to the scanner but not the real reader
53691+ */
53692+ cab = cabd->search(cabd, "test_files/cabd/search_tricky1.cab");
53693+ TEST(cab != NULL);
53694+ TEST(cab->next == NULL);
53695+ TEST(cab->files != NULL);
53696+ TEST(cab->base_offset == 4);
53697+ TEST(cab->files->next != NULL);
53698+ TEST(strcmp(cab->files->filename, "hello.c") == 0);
53699+ TEST(strcmp(cab->files->next->filename, "welcome.c") == 0);
53700+
53701+ cabd->close(cabd, cab);
53702+ mspack_destroy_cab_decompressor(cabd);
53703+}
53704+
53705+/* basic parameter failures */
53706+void cabd_merge_test_01() {
53707+ struct mscab_decompressor *cabd;
53708+ struct mscabd_cabinet *cab1, *cab2;
53709+
53710+ cabd = mspack_create_cab_decompressor(NULL);
53711+ TEST(cabd != NULL);
53712+
53713+ cab1 = cabd->open(cabd, "test_files/cabd/multi_basic_pt1.cab");
53714+ cab2 = cabd->open(cabd, "test_files/cabd/multi_basic_pt2.cab");
53715+ TEST(cab1 != NULL);
53716+ TEST(cab2 != NULL);
53717+ TEST(cabd->append(cabd, cab1, NULL) != MSPACK_ERR_OK);
53718+ TEST(cabd->append(cabd, NULL, cab1) != MSPACK_ERR_OK);
53719+ TEST(cabd->append(cabd, cab1, cab1) != MSPACK_ERR_OK);
53720+ TEST(cabd->prepend(cabd, cab1, NULL) != MSPACK_ERR_OK);
53721+ TEST(cabd->prepend(cabd, NULL, cab1) != MSPACK_ERR_OK);
53722+ TEST(cabd->prepend(cabd, cab1, cab1) != MSPACK_ERR_OK);
53723+
53724+ /* merge cabs, then try merging again every other way */
53725+ TEST(cabd->append(cabd, cab1, cab2) == MSPACK_ERR_OK);
53726+ TEST(cabd->append(cabd, cab2, cab1) != MSPACK_ERR_OK);
53727+ TEST(cabd->prepend(cabd, cab1, cab2) != MSPACK_ERR_OK);
53728+ TEST(cabd->prepend(cabd, cab2, cab1) != MSPACK_ERR_OK);
53729+ TEST(cabd->append(cabd, cab1, cab2) != MSPACK_ERR_OK);
53730+
53731+ cabd->close(cabd, cab1);
53732+ mspack_destroy_cab_decompressor(cabd);
53733+}
53734+
53735+/* test merging a normal 5 part single folder cabinet set with slightly
53736+ * haphazard ordering. should still merge fine */
53737+void cabd_merge_test_02() {
53738+ struct mscab_decompressor *cabd;
53739+ struct mscabd_cabinet *cab[5];
53740+
53741+ cabd = mspack_create_cab_decompressor(NULL);
53742+ TEST(cabd != NULL);
53743+
53744+ cab[0] = cabd->open(cabd, "test_files/cabd/multi_basic_pt1.cab");
53745+ cab[1] = cabd->open(cabd, "test_files/cabd/multi_basic_pt2.cab");
53746+ cab[2] = cabd->open(cabd, "test_files/cabd/multi_basic_pt3.cab");
53747+ cab[3] = cabd->open(cabd, "test_files/cabd/multi_basic_pt4.cab");
53748+ cab[4] = cabd->open(cabd, "test_files/cabd/multi_basic_pt5.cab");
53749+ TEST(cab[0] != NULL);
53750+ TEST(cab[1] != NULL);
53751+ TEST(cab[2] != NULL);
53752+ TEST(cab[3] != NULL);
53753+ TEST(cab[4] != NULL);
53754+ TEST(cabd->append(cabd, cab[0], cab[1]) == MSPACK_ERR_OK);
53755+ TEST(cabd->prepend(cabd, cab[2], cab[1]) == MSPACK_ERR_OK);
53756+ TEST(cabd->append(cabd, cab[3], cab[4]) == MSPACK_ERR_OK);
53757+ TEST(cabd->prepend(cabd, cab[3], cab[2]) == MSPACK_ERR_OK);
53758+
53759+ TEST(cab[0]->files != NULL);
53760+ TEST(cab[0]->files->next != NULL);
53761+ TEST(cab[0]->files->next->next != NULL);
53762+ TEST(cab[0]->files->next->next->next == NULL);
53763+ TEST(cab[0]->files == cab[1]->files);
53764+ TEST(cab[1]->files == cab[2]->files);
53765+ TEST(cab[2]->files == cab[3]->files);
53766+ TEST(cab[3]->files == cab[4]->files);
53767+
53768+ TEST(cab[0]->folders != NULL);
53769+ TEST(cab[0]->folders->next == NULL);
53770+ TEST(cab[0]->folders == cab[1]->folders);
53771+ TEST(cab[1]->folders == cab[2]->folders);
53772+ TEST(cab[2]->folders == cab[3]->folders);
53773+ TEST(cab[3]->folders == cab[4]->folders);
53774+
53775+ cabd->close(cabd, cab[0]);
53776+ mspack_destroy_cab_decompressor(cabd);
53777+}
53778+
53779+int main() {
53780+ int selftest;
53781+
53782+ MSPACK_SYS_SELFTEST(selftest);
53783+ TEST(selftest == MSPACK_ERR_OK);
53784+
53785+ cabd_open_test_01();
53786+ cabd_open_test_02();
53787+ cabd_open_test_03();
53788+ cabd_open_test_04();
53789+ cabd_open_test_05();
53790+ cabd_open_test_06();
53791+
53792+ cabd_search_test_01();
53793+ cabd_search_test_02();
53794+ cabd_search_test_03();
53795+
53796+ cabd_merge_test_01();
53797+ cabd_merge_test_02();
53798+
53799+ /* extract() tests */
53800+
53801+ printf("ALL %d TESTS PASSED.\n", test_count);
53802+ return 0;
53803+}
53804diff --git a/libclamav/libmspack-0.4alpha/test/cabrip.c b/libclamav/libmspack-0.4alpha/test/cabrip.c
53805new file mode 100644
53806index 000000000000..5df9a44b3920
53807--- /dev/null
53808+++ b/libclamav/libmspack-0.4alpha/test/cabrip.c
53809@@ -0,0 +1,81 @@
53810+#ifdef HAVE_CONFIG_H
53811+#include <config.h>
53812+#endif
53813+
53814+#include <stdio.h>
53815+#include <stdlib.h>
53816+#include <sys/stat.h>
53817+#include <mspack.h>
53818+#include <system.h>
53819+
53820+#define BUF_SIZE (1024*4096)
53821+char buf[BUF_SIZE];
53822+
53823+void rip(char *fname, off_t offset, unsigned int length) {
53824+ static unsigned int counter = 1;
53825+ struct stat st_buf;
53826+ char outname[13];
53827+ FILE *in, *out;
53828+
53829+ do {
53830+ snprintf(outname, 13, "%08u.cab", counter++);
53831+ } while (stat(outname, &st_buf) == 0);
53832+
53833+ printf("ripping %s offset %" LD " length %u to %s\n",
53834+ fname, offset, length, outname);
53835+
53836+ if ((in = fopen(fname, "rb"))) {
53837+#ifdef HAVE_FSEEKO
53838+ if (!fseeko(in, offset, SEEK_SET)) {
53839+#else
53840+ if (!fseek(in, offset, SEEK_SET)) {
53841+#endif
53842+ if ((out = fopen(outname, "wb"))) {
53843+ while (length > 0) {
53844+ unsigned int run = BUF_SIZE;
53845+ if (run > length) run = length;
53846+ if (fread(&buf[0], 1, run, in) != run) {
53847+ perror(fname);
53848+ break;
53849+ }
53850+ if (fwrite(&buf[0], 1, run, out) != run) {
53851+ perror(outname);
53852+ break;
53853+ }
53854+ length -= run;
53855+ }
53856+ fclose(out);
53857+ }
53858+ else {
53859+ perror(outname);
53860+ }
53861+ }
53862+ else {
53863+ perror(fname);
53864+ }
53865+ fclose(in);
53866+ }
53867+ else {
53868+ perror(fname);
53869+ }
53870+}
53871+
53872+int main(int argc, char *argv[]) {
53873+ struct mscab_decompressor *cabd;
53874+ struct mscabd_cabinet *cab, *c;
53875+ int err;
53876+
53877+ MSPACK_SYS_SELFTEST(err);
53878+ if (err) return 0;
53879+
53880+ if ((cabd = mspack_create_cab_decompressor(NULL))) {
53881+ for (argv++; *argv; argv++) {
53882+ if ((cab = cabd->search(cabd, *argv))) {
53883+ for (c = cab; c; c = c->next) rip(*argv, c->base_offset, c->length);
53884+ cabd->close(cabd, cab);
53885+ }
53886+ }
53887+ mspack_destroy_cab_decompressor(cabd);
53888+ }
53889+ return 0;
53890+}
53891diff --git a/libclamav/libmspack-0.4alpha/test/chmd_find.c b/libclamav/libmspack-0.4alpha/test/chmd_find.c
53892new file mode 100644
53893index 000000000000..c30a972c57d8
53894--- /dev/null
53895+++ b/libclamav/libmspack-0.4alpha/test/chmd_find.c
53896@@ -0,0 +1,95 @@
53897+/* chmd_find: tests fast-find functionality
53898+ */
53899+#ifdef HAVE_CONFIG_H
53900+#include <config.h>
53901+#endif
53902+
53903+#include <stdio.h>
53904+#include <stdlib.h>
53905+#include <string.h>
53906+#include <mspack.h>
53907+
53908+#include <error.h>
53909+#include <system.h>
53910+
53911+void find(struct mschm_decompressor *chmd, struct mschmd_header *chm,
53912+ char *archive, char *filename, struct mschmd_file *compare)
53913+{
53914+ struct mschmd_file result;
53915+ if (chmd->fast_find(chmd, chm, filename, &result, sizeof(result))) {
53916+ fprintf(stderr, "%s: find error on \"%s\": %s\n",
53917+ archive, filename, ERROR(chmd));
53918+ }
53919+ else if (!result.section) {
53920+ if (compare) {
53921+ fprintf(stderr, "%s: file \"%s\" not found\n", archive, filename);
53922+ }
53923+ else {
53924+ printf("%s: file \"%s\" not found\n", archive, filename);
53925+ }
53926+ }
53927+ else {
53928+ printf("%s\n", filename);
53929+ printf(" section: %d\n", result.section->id);
53930+ printf(" offset: %" LD "\n", result.offset);
53931+ printf(" length: %" LD "\n", result.length);
53932+ if (compare) {
53933+ if (result.section->id != compare->section->id) {
53934+ fprintf(stderr, "%s: found file \"%s\" section is wrong "
53935+ "(%d vs %d)\n", archive, filename,
53936+ result.section->id, compare->section->id);
53937+ }
53938+
53939+ if (result.offset != compare->offset) {
53940+ fprintf(stderr, "%s: found file \"%s\" offset is wrong "
53941+ "(%" LD " vs %" LD ")\n", archive, filename,
53942+ result.offset, compare->offset);
53943+ }
53944+
53945+ if (result.length != compare->length) {
53946+ fprintf(stderr, "%s: found file \"%s\" length is wrong "
53947+ "(%" LD " vs %" LD ")\n", archive, filename,
53948+ result.length, compare->length);
53949+ }
53950+ }
53951+ }
53952+}
53953+
53954+int main(int argc, char *argv[]) {
53955+ struct mschm_decompressor *chmd;
53956+ struct mschmd_header *chm, *chm2;
53957+ unsigned int i;
53958+
53959+ if (argc < 2 || argc > 3) {
53960+ printf("Usage: %s <file.chm> [filename to find]\n", argv[0]);
53961+ return 1;
53962+ }
53963+
53964+ MSPACK_SYS_SELFTEST(i);
53965+ if (i) return 0;
53966+
53967+ if ((chmd = mspack_create_chm_decompressor(NULL))) {
53968+ if ((chm = chmd->fast_open(chmd, argv[1]))) {
53969+ if (argv[2]) {
53970+ find(chmd, chm, argv[1], argv[2], NULL);
53971+ }
53972+ else {
53973+ if ((chm2 = chmd->open(chmd, argv[1]))) {
53974+ struct mschmd_file *file;
53975+ for (file = chm2->files; file; file = file->next) {
53976+ find(chmd, chm, argv[1], file->filename, file);
53977+ }
53978+ }
53979+ else {
53980+ printf("%s: can't open -- %s\n", argv[1], ERROR(chmd));
53981+ }
53982+ }
53983+ chmd->close(chmd, chm);
53984+ }
53985+ else {
53986+ printf("%s: can't open -- %s\n", argv[1], ERROR(chmd));
53987+ }
53988+ mspack_destroy_chm_decompressor(chmd);
53989+ }
53990+ return 0;
53991+}
53992diff --git a/libclamav/libmspack-0.4alpha/test/chmd_md5.c b/libclamav/libmspack-0.4alpha/test/chmd_md5.c
53993new file mode 100644
53994index 000000000000..6187fa460914
53995--- /dev/null
53996+++ b/libclamav/libmspack-0.4alpha/test/chmd_md5.c
53997@@ -0,0 +1,67 @@
53998+#ifdef HAVE_CONFIG_H
53999+#include <config.h>
54000+#endif
54001+
54002+#include <stdio.h>
54003+#include <stdlib.h>
54004+#include <string.h>
54005+#include <mspack.h>
54006+
54007+#include <md5_fh.h>
54008+#include <error.h>
54009+
54010+static int sortfunc(const void *a, const void *b) {
54011+ off_t diff =
54012+ ((* ((struct mschmd_file **) a))->offset) -
54013+ ((* ((struct mschmd_file **) b))->offset);
54014+ return (diff < 0) ? -1 : ((diff > 0) ? 1 : 0);
54015+}
54016+
54017+int main(int argc, char *argv[]) {
54018+ struct mschm_decompressor *chmd;
54019+ struct mschmd_header *chm;
54020+ struct mschmd_file *file, **f;
54021+ unsigned int numf, i;
54022+ int err;
54023+
54024+ setbuf(stdout, NULL);
54025+ setbuf(stderr, NULL);
54026+
54027+ MSPACK_SYS_SELFTEST(err);
54028+ if (err) return 0;
54029+
54030+ if ((chmd = mspack_create_chm_decompressor(&read_files_write_md5))) {
54031+ for (argv++; *argv; argv++) {
54032+ printf("*** %s\n", *argv);
54033+ if ((chm = chmd->open(chmd, *argv))) {
54034+
54035+ /* extract in order of the offset into content section - faster */
54036+ for (numf=0, file=chm->files; file; file = file->next) numf++;
54037+ if ((f = (struct mschmd_file **) calloc(numf, sizeof(struct mschmd_file *)))) {
54038+ for (i=0, file=chm->files; file; file = file->next) f[i++] = file;
54039+ qsort(f, numf, sizeof(struct mschmd_file *), &sortfunc);
54040+ for (i = 0; i < numf; i++) {
54041+ if (chmd->extract(chmd, f[i], NULL)) {
54042+ fprintf(stderr, "%s: extract error on \"%s\": %s\n",
54043+ *argv, f[i]->filename, ERROR(chmd));
54044+ }
54045+ else {
54046+ printf("%s %s\n", md5_string, f[i]->filename);
54047+ }
54048+ }
54049+ free(f);
54050+ }
54051+
54052+ chmd->close(chmd, chm);
54053+ }
54054+ else {
54055+ fprintf(stderr, "%s: can't open -- %s\n", *argv, ERROR(chmd));
54056+ }
54057+ }
54058+ mspack_destroy_chm_decompressor(chmd);
54059+ }
54060+ else {
54061+ fprintf(stderr, "%s: can't make CHM decompressor\n", *argv);
54062+ }
54063+ return 0;
54064+}
54065diff --git a/libclamav/libmspack-0.4alpha/test/chmd_order.c b/libclamav/libmspack-0.4alpha/test/chmd_order.c
54066new file mode 100644
54067index 000000000000..cb7f47d0e99f
54068--- /dev/null
54069+++ b/libclamav/libmspack-0.4alpha/test/chmd_order.c
54070@@ -0,0 +1,144 @@
54071+/* chmd_order: test that extracting a CHM file in different ways works
54072+ * and all give the same results:
54073+ * - extracting files in the order they're listed (generally alphabetical)
54074+ * - extracting files ordered by their content section offset
54075+ * - extracting files using fast_find() to find them
54076+ * - extracting files from two chms at the same time with one decompressor
54077+ */
54078+#ifdef HAVE_CONFIG_H
54079+#include <config.h>
54080+#endif
54081+
54082+#include <stdio.h>
54083+#include <stdlib.h>
54084+#include <string.h>
54085+#include <mspack.h>
54086+
54087+#include <md5_fh.h>
54088+#include <error.h>
54089+
54090+struct my_file {
54091+ struct mschmd_file *file;
54092+ struct mschmd_file result;
54093+ char ordered[32], sorted[32], fast_find[32], mixed[32];
54094+};
54095+
54096+static int sortfunc(const void *a, const void *b) {
54097+ off_t diff =
54098+ ((struct my_file *) a)->file->offset -
54099+ ((struct my_file *) b)->file->offset;
54100+ return (diff < 0) ? -1 : ((diff > 0) ? 1 : 0);
54101+}
54102+
54103+int main(int argc, char *argv[]) {
54104+ struct mschm_decompressor *chmd;
54105+ struct mschmd_header *chm, *chm2;
54106+ struct mschmd_file *file;
54107+ struct my_file *f;
54108+ unsigned int N, i;
54109+
54110+ MSPACK_SYS_SELFTEST(i);
54111+ if (i) return 0;
54112+
54113+ if ((chmd = mspack_create_chm_decompressor(&read_files_write_md5))) {
54114+ for (argv++; *argv; argv++) {
54115+ printf("%s\n", *argv);
54116+
54117+ if ((chm = chmd->open(chmd, *argv))) {
54118+ if ((chm2 = chmd->fast_open(chmd, *argv))) {
54119+
54120+ /* count the number of files, allocate a results structure */
54121+ for (N=0, file = chm->files; file; file = file->next) N++;
54122+ if ((f = (struct my_file *) calloc(N, sizeof(struct my_file)))) {
54123+
54124+ /* fill out results structure while doing ordered extraction */
54125+ for (i = 0, file = chm->files; file; file = file->next, i++) {
54126+ printf("OX %s\n", file->filename);
54127+ f[i].file = file;
54128+ if (chmd->extract(chmd, file, NULL)) {
54129+ fprintf(stderr, "%s: O extract error on \"%s\": %s\n",
54130+ *argv, file->filename, ERROR(chmd));
54131+ continue;
54132+ }
54133+ memcpy(&f[i].ordered[0], md5_string, 32);
54134+ }
54135+
54136+ /* sort the list into offset order */
54137+ qsort(f, N, sizeof(struct my_file), &sortfunc);
54138+
54139+ /* extract in offset order */
54140+ for (i = 0; i < N; i++) {
54141+ printf("SX %s\n", f[i].file->filename);
54142+ if (chmd->extract(chmd, f[i].file, NULL)) {
54143+ fprintf(stderr, "%s: S extract error on \"%s\": %s\n",
54144+ *argv, f[i].file->filename, ERROR(chmd));
54145+ continue;
54146+ }
54147+ memcpy(&f[i].sorted[0], md5_string, 32);
54148+ }
54149+
54150+ /* extract using fast_find */
54151+ for (i = 0; i < N; i++) {
54152+ printf("FX %s\n", f[i].file->filename);
54153+
54154+ if (chmd->fast_find(chmd, chm2,
54155+ f[i].file->filename,
54156+ &f[i].result, sizeof(struct mschmd_file)))
54157+ {
54158+ fprintf(stderr, "%s: find error on \"%s\": %s\n",
54159+ *argv, f[i].file->filename, ERROR(chmd));
54160+ continue;
54161+ }
54162+ if (!f[i].result.section) {
54163+ fprintf(stderr, "%s: can't find file \"%s\"\n",
54164+ *argv, f[i].file->filename);
54165+ continue;
54166+ }
54167+ if (chmd->extract(chmd, &f[i].result, NULL)) {
54168+ fprintf(stderr, "%s: F extract error on \"%s\": %s\n",
54169+ *argv, f[i].file->filename, ERROR(chmd));
54170+ continue;
54171+ }
54172+ memcpy(&f[i].fast_find[0], md5_string, 32);
54173+ }
54174+
54175+ /* extract two chms at once */
54176+ for (i = 0; i < N; i++) {
54177+ printf("MX %s\n", f[i].file->filename);
54178+ chmd->extract(chmd, f[i].file, NULL);
54179+ if (chmd->extract(chmd, &f[i].result, NULL)) {
54180+ fprintf(stderr, "%s: M extract error on \"%s\": %s\n",
54181+ *argv, f[i].file->filename, ERROR(chmd));
54182+ continue;
54183+ }
54184+ memcpy(&f[i].mixed[0], md5_string, 32);
54185+ }
54186+
54187+ /* check all the MD5 sums match */
54188+ for (i = 0; i < N; i++) {
54189+ if (memcmp(&f[i].ordered, &f[i].sorted, 32) ||
54190+ memcmp(&f[i].ordered, &f[i].fast_find, 32) ||
54191+ memcmp(&f[i].ordered, &f[i].mixed, 32))
54192+ {
54193+ fprintf(stderr, "%s: sums mismatch on %s "
54194+ "(O=%32.32s,S=%32.32s,F=%32.32s,M=%32.32s)\n",
54195+ *argv, f[i].file->filename,
54196+ &f[i].ordered[0], &f[i].sorted[0],
54197+ &f[i].fast_find[0], &f[i].mixed[0]);
54198+ }
54199+ }
54200+
54201+ free(f);
54202+ }
54203+ chmd->close(chmd, chm2);
54204+ }
54205+ chmd->close(chmd, chm);
54206+ }
54207+ else {
54208+ printf("%s: can't open -- %s\n", *argv, ERROR(chmd));
54209+ }
54210+ }
54211+ mspack_destroy_chm_decompressor(chmd);
54212+ }
54213+ return 0;
54214+}
54215diff --git a/libclamav/libmspack-0.4alpha/test/chminfo.c b/libclamav/libmspack-0.4alpha/test/chminfo.c
54216new file mode 100644
54217index 000000000000..b21ec6427b42
54218--- /dev/null
54219+++ b/libclamav/libmspack-0.4alpha/test/chminfo.c
54220@@ -0,0 +1,284 @@
54221+#ifdef HAVE_CONFIG_H
54222+#include <config.h>
54223+#endif
54224+
54225+#include <stdio.h>
54226+#include <stdlib.h>
54227+#include <unistd.h>
54228+#include <string.h>
54229+#include <mspack.h>
54230+#include <system.h>
54231+
54232+#define FILENAME ".chminfo-temp"
54233+
54234+unsigned char *load_sys_data(struct mschm_decompressor *chmd,
54235+ struct mschmd_header *chm,
54236+ const char *filename,
54237+ off_t *length_ptr)
54238+{
54239+ struct mschmd_file *file;
54240+ unsigned char *data;
54241+ FILE *fh;
54242+
54243+ for (file = chm->sysfiles; file; file = file->next) {
54244+ if (strcmp(file->filename, filename) == 0) break;
54245+ }
54246+ if (!file || file->section->id != 0) return NULL;
54247+ if (chmd->extract(chmd, file, FILENAME)) return NULL;
54248+ if (length_ptr) *length_ptr = file->length;
54249+ if (!(data = (unsigned char *) malloc((size_t) file->length))) return NULL;
54250+ if ((fh = fopen(FILENAME, "rb"))) {
54251+ fread(data, (size_t) file->length, 1, fh);
54252+ fclose(fh);
54253+ }
54254+ else {
54255+ free(data);
54256+ data = NULL;
54257+ }
54258+ unlink(FILENAME);
54259+ return data;
54260+}
54261+
54262+char *guid(unsigned char *data) {
54263+ static char result[43];
54264+ snprintf(result, sizeof(result),
54265+ "{%08X-%04X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X}",
54266+ EndGetI32(&data[0]),
54267+ data[4] | (data[5] << 8),
54268+ data[6] | (data[7] << 8),
54269+ data[8] | (data[9] << 8),
54270+ data[10], data[11], data[12], data[13],
54271+ data[14], data[15], data[16], data[17]);
54272+ return result;
54273+}
54274+
54275+#define READ_ENCINT(var, label) do { \
54276+ (var) = 0; \
54277+ do { \
54278+ if (p > &chunk[chm->chunk_size-2]) goto label; \
54279+ (var) = ((var) << 7) | (*p & 0x7F); \
54280+ } while (*p++ & 0x80); \
54281+} while (0)
54282+
54283+void print_dir(struct mschmd_header *chm, char *filename) {
54284+ unsigned char dir[0x54], *chunk;
54285+ unsigned int i;
54286+ FILE *fh;
54287+
54288+ if (!(chunk = (unsigned char *) malloc(chm->chunk_size))) return;
54289+
54290+ if ((fh = fopen(filename, "rb"))) {
54291+#ifdef HAVE_FSEEKO
54292+ fseeko(fh, chm->dir_offset - 84, SEEK_SET);
54293+#else
54294+ fseek(fh, chm->dir_offset - 84, SEEK_SET);
54295+#endif
54296+ fread(&dir[0], 84, 1, fh);
54297+ printf(" chmhs1_Signature = %4.4s\n", &dir[0]);
54298+ printf(" chmhs1_Version = %d\n", EndGetI32(&dir[4]));
54299+ printf(" chmhs1_HeaderLen = %d\n", EndGetI32(&dir[8]));
54300+ printf(" chmhs1_Unknown1 = %d\n", EndGetI32(&dir[12]));
54301+ printf(" chmhs1_ChunkSize = %d\n", EndGetI32(&dir[16]));
54302+ printf(" chmhs1_Density = %d\n", EndGetI32(&dir[20]));
54303+ printf(" chmhs1_Depth = %d\n", EndGetI32(&dir[24]));
54304+ printf(" chmhs1_IndexRoot = %d\n", EndGetI32(&dir[28]));
54305+ printf(" chmhs1_FirstPMGL = %d\n", EndGetI32(&dir[32]));
54306+ printf(" chmhs1_LastPMGL = %d\n", EndGetI32(&dir[36]));
54307+ printf(" chmhs1_Unknown2 = %d\n", EndGetI32(&dir[40]));
54308+ printf(" chmhs1_NumChunks = %d\n", EndGetI32(&dir[44]));
54309+ printf(" chmhs1_LanguageID = %d\n", EndGetI32(&dir[48]));
54310+ printf(" chmhs1_GUID = %s\n", guid(&dir[52]));
54311+ printf(" chmhs1_Unknown3 = %d\n", EndGetI32(&dir[68]));
54312+ printf(" chmhs1_Unknown4 = %d\n", EndGetI32(&dir[72]));
54313+ printf(" chmhs1_Unknown5 = %d\n", EndGetI32(&dir[76]));
54314+ printf(" chmhs1_Unknown6 = %d\n", EndGetI32(&dir[80]));
54315+
54316+ for (i = 0; i < chm->num_chunks; i++) {
54317+ unsigned int num_entries, quickref_size, j, k;
54318+ unsigned char *p, *name;
54319+ printf(" CHUNK %u:\n", i);
54320+ fread(chunk, chm->chunk_size, 1, fh);
54321+
54322+ if ((chunk[0] == 'P') && (chunk[1] == 'M') &&
54323+ (chunk[2] == 'G') && (chunk[3] == 'L'))
54324+ {
54325+ k = chm->chunk_size - 2;
54326+ num_entries = chunk[k] | (chunk[k+1] << 8);
54327+ quickref_size = EndGetI32(&chunk[4]);
54328+ if (quickref_size > (chm->chunk_size - 20)) {
54329+ printf(" QR size of %d too large (max is %d)\n",
54330+ quickref_size, chm->chunk_size - 20);
54331+ quickref_size = chm->chunk_size - 20;
54332+ }
54333+ printf(" PMGL entries=%u qrsize=%u zero=%u prev=%d next=%d\n",
54334+ num_entries, quickref_size, EndGetI32(&chunk[8]),
54335+ EndGetI32(&chunk[12]), EndGetI32(&chunk[16]));
54336+
54337+ printf(" QR: entry %4u = offset %u\n", 0, 20);
54338+ j = (1 << chm->density) + 1;
54339+ while (j < num_entries) {
54340+ k -= 2;
54341+ if (k < (chm->chunk_size - quickref_size)) break;
54342+ printf(" QR: entry %4u = offset %u\n",
54343+ j, (chunk[k] | (chunk[k+1] << 8)) + 20);
54344+ j += (1 << chm->density) + 1;
54345+ }
54346+
54347+ p = &chunk[20];
54348+ for (j = 0; j < num_entries; j++) {
54349+ unsigned int name_len = 0, section = 0, offset = 0, length = 0;
54350+ printf(" %4d: ", (int) (p - &chunk[0]));
54351+ READ_ENCINT(name_len, PMGL_end); name = p; p += name_len;
54352+ READ_ENCINT(section, PMGL_end);
54353+ READ_ENCINT(offset, PMGL_end);
54354+ READ_ENCINT(length, PMGL_end);
54355+ printf("sec=%u off=%-10u len=%-10u name=\"",section,offset,length);
54356+ if (name_len) fwrite(name, 1, name_len, stdout);
54357+ printf("\"\n");
54358+ }
54359+ PMGL_end:
54360+ if (j != num_entries) printf("premature end of chunk\n");
54361+
54362+ }
54363+ else if ((chunk[0] == 'P') && (chunk[1] == 'M') &&
54364+ (chunk[2] == 'G') && (chunk[3] == 'I'))
54365+ {
54366+ k = chm->chunk_size - 2;
54367+ num_entries = chunk[k] | (chunk[k+1] << 8);
54368+ quickref_size = EndGetI32(&chunk[4]);
54369+ printf(" PMGI entries=%u free=%u\n", num_entries, quickref_size);
54370+
54371+ printf(" QR: entry %4u = offset %u\n", 0, 8);
54372+ j = (1 << chm->density) + 1;
54373+ while (j < num_entries) {
54374+ k -= 2;
54375+ printf(" QR: entry %4u = offset %u\n",
54376+ j, (chunk[k] | (chunk[k+1] << 8)) + 8);
54377+ j += (1 << chm->density) + 1;
54378+ }
54379+
54380+ p = &chunk[8];
54381+ for (j = 0; j < num_entries; j++) {
54382+ unsigned int name_len, section;
54383+ printf(" %4d: ", (int) (p - &chunk[0]));
54384+ READ_ENCINT(name_len, PMGI_end); name = p; p += name_len;
54385+ READ_ENCINT(section, PMGI_end);
54386+ printf("chunk=%-4u name=\"",section);
54387+ if (name_len) fwrite(name, 1, name_len, stdout);
54388+ printf("\"\n");
54389+ }
54390+ PMGI_end:
54391+ if (j != num_entries) printf("premature end of chunk\n");
54392+ }
54393+ else {
54394+ printf(" unknown format\n");
54395+ }
54396+ }
54397+
54398+ fclose(fh);
54399+ }
54400+}
54401+
54402+
54403+int main(int argc, char *argv[]) {
54404+ struct mschm_decompressor *chmd;
54405+ struct mschmd_header *chm;
54406+ struct mschmd_file *file;
54407+ unsigned int numf, i;
54408+ unsigned char *data;
54409+ off_t pos, len;
54410+
54411+ setbuf(stdout, NULL);
54412+ setbuf(stderr, NULL);
54413+
54414+ MSPACK_SYS_SELFTEST(i);
54415+ if (i) return 0;
54416+
54417+ if ((chmd = mspack_create_chm_decompressor(NULL))) {
54418+ for (argv++; *argv; argv++) {
54419+ printf("%s\n", *argv);
54420+ if ((chm = chmd->open(chmd, *argv))) {
54421+ printf(" chmhead_Version %u\n", chm->version);
54422+ printf(" chmhead_Timestamp %u\n", chm->timestamp);
54423+ printf(" chmhead_LanguageID %u\n", chm->language);
54424+ printf(" chmhs0_FileLen %" LD "\n", chm->length);
54425+ printf(" chmhst_OffsetHS1 %" LD "\n", chm->dir_offset);
54426+ printf(" chmhst3_OffsetCS0 %" LD "\n", chm->sec0.offset);
54427+
54428+ print_dir(chm, *argv);
54429+
54430+ if ((data = load_sys_data(chmd, chm,
54431+ "::DataSpace/Storage/MSCompressed/ControlData", &len)))
54432+ {
54433+ printf(" lzxcd_Length %u\n", EndGetI32(&data[0]));
54434+ printf(" lzxcd_Signature %4.4s\n", &data[4]);
54435+ printf(" lzxcd_Version %u\n", EndGetI32(&data[8]));
54436+ printf(" lzxcd_ResetInterval %u\n", EndGetI32(&data[12]));
54437+ printf(" lzxcd_WindowSize %u\n", EndGetI32(&data[16]));
54438+ printf(" lzxcd_CacheSize %u\n", EndGetI32(&data[20]));
54439+ printf(" lzxcd_Unknown1 %u\n", EndGetI32(&data[24]));
54440+ free(data);
54441+ }
54442+
54443+ if ((data = load_sys_data(chmd, chm,
54444+ "::DataSpace/Storage/MSCompressed/Transform/{7FC28940-"
54445+ "9D31-11D0-9B27-00A0C91E9C7C}/InstanceData/ResetTable", &len)))
54446+ {
54447+ off_t contents = chm->sec0.offset;
54448+ printf(" lzxrt_Unknown1 %u\n", EndGetI32(&data[0]));
54449+ printf(" lzxrt_NumEntries %u\n", EndGetI32(&data[4]));
54450+ printf(" lzxrt_EntrySize %u\n", EndGetI32(&data[8]));
54451+ printf(" lzxrt_TableOffset %u\n", EndGetI32(&data[12]));
54452+ printf(" lzxrt_UncompLen %" LU "\n", EndGetI64(&data[16]));
54453+ printf(" lzxrt_CompLen %" LU "\n", EndGetI64(&data[24]));
54454+ printf(" lzxrt_FrameLen %u\n", EndGetI32(&data[32]));
54455+
54456+ for (file = chm->sysfiles; file; file = file->next) {
54457+ if (strcmp(file->filename,
54458+ "::DataSpace/Storage/MSCompressed/Content") == 0)
54459+ {
54460+ contents += file->offset;
54461+ break;
54462+ }
54463+ }
54464+
54465+ printf(" - reset table (uncomp offset -> stream offset "
54466+ "[real offset, length in file]\n");
54467+
54468+ numf = EndGetI32(&data[4]);
54469+ pos = ((unsigned int) EndGetI32(&data[12]));
54470+ switch (EndGetI32(&data[8])) {
54471+ case 4:
54472+ for (i = 0; i < numf && pos < len; i++, pos += 4) {
54473+ unsigned int rtdata = EndGetI32(&data[pos]);
54474+ printf(" %-10u -> %-10u [ %" LU " %u ]\n",
54475+ i * EndGetI32(&data[32]),
54476+ rtdata,
54477+ contents + rtdata,
54478+ (i == (numf-1))
54479+ ? (EndGetI32(&data[24]) - rtdata)
54480+ : (EndGetI32(&data[pos + 4]) - rtdata)
54481+ );
54482+ }
54483+ break;
54484+ case 8:
54485+ for (i = 0; i < numf && pos < len; i++, pos += 8) {
54486+ unsigned long long int rtdata = EndGetI64(&data[pos]);
54487+ printf(" %-10" LU " -> %-10" LU " [ %" LU " %" LU " ]\n",
54488+ i * EndGetI64(&data[32]), rtdata, contents + rtdata,
54489+ (i == (numf-1))
54490+ ? (EndGetI64(&data[24]) - rtdata)
54491+ : (EndGetI64(&data[pos + 8]) - rtdata)
54492+ );
54493+ }
54494+ break;
54495+ }
54496+ free(data);
54497+ }
54498+ chmd->close(chmd, chm);
54499+ }
54500+ }
54501+ mspack_destroy_chm_decompressor(chmd);
54502+ }
54503+ return 0;
54504+}
54505diff --git a/libclamav/libmspack-0.4alpha/test/chmx.c b/libclamav/libmspack-0.4alpha/test/chmx.c
54506new file mode 100644
54507index 000000000000..0d0b3c2221ef
54508--- /dev/null
54509+++ b/libclamav/libmspack-0.4alpha/test/chmx.c
54510@@ -0,0 +1,216 @@
54511+#ifdef HAVE_CONFIG_H
54512+#include <config.h>
54513+#endif
54514+
54515+#include <stdio.h>
54516+#include <stdlib.h>
54517+#include <string.h>
54518+#include <mspack.h>
54519+#include <ctype.h>
54520+#include <sys/stat.h>
54521+
54522+#include <error.h>
54523+
54524+mode_t user_umask;
54525+
54526+#define FILENAME ".test.chmx"
54527+
54528+/**
54529+ * Ensures that all directory components in a filepath exist. New directory
54530+ * components are created, if necessary.
54531+ *
54532+ * @param path the filepath to check
54533+ * @return non-zero if all directory components in a filepath exist, zero
54534+ * if components do not exist and cannot be created
54535+ */
54536+static int ensure_filepath(char *path) {
54537+ struct stat st_buf;
54538+ char *p;
54539+ int ok;
54540+
54541+ for (p = &path[1]; *p; p++) {
54542+ if (*p != '/') continue;
54543+ *p = '\0';
54544+ ok = (stat(path, &st_buf) == 0) && S_ISDIR(st_buf.st_mode);
54545+ if (!ok) ok = (mkdir(path, 0777 & ~user_umask) == 0);
54546+ *p = '/';
54547+ if (!ok) return 0;
54548+ }
54549+ return 1;
54550+}
54551+
54552+/**
54553+ * Creates a UNIX filename from the internal CAB filename and the given
54554+ * parameters.
54555+ *
54556+ * @param fname the internal CAB filename.
54557+ * @param dir a directory path to prepend to the output filename.
54558+ * @param lower if non-zero, filename should be made lower-case.
54559+ * @param isunix if zero, MS-DOS path seperators are used in the internal
54560+ * CAB filename. If non-zero, UNIX path seperators are used.
54561+ * @param utf8 if non-zero, the internal CAB filename is encoded in UTF8.
54562+ * @return a freshly allocated and created filename, or NULL if there was
54563+ * not enough memory.
54564+ * @see unix_path_seperators()
54565+ */
54566+static char *create_output_name(unsigned char *fname, unsigned char *dir,
54567+ int lower, int isunix, int utf8)
54568+{
54569+ unsigned char *p, *name, c, *fe, sep, slash;
54570+ unsigned int x;
54571+
54572+ sep = (isunix) ? '/' : '\\'; /* the path-seperator */
54573+ slash = (isunix) ? '\\' : '/'; /* the other slash */
54574+
54575+ /* length of filename */
54576+ x = strlen((char *) fname);
54577+ /* UTF8 worst case scenario: tolower() expands all chars from 1 to 3 bytes */
54578+ if (utf8) x *= 3;
54579+ /* length of output directory */
54580+ if (dir) x += strlen((char *) dir);
54581+
54582+ if (!(name = (unsigned char *) malloc(x + 2))) {
54583+ fprintf(stderr, "out of memory!\n");
54584+ return NULL;
54585+ }
54586+
54587+ /* start with blank name */
54588+ *name = '\0';
54589+
54590+ /* add output directory if needed */
54591+ if (dir) {
54592+ strcpy((char *) name, (char *) dir);
54593+ strcat((char *) name, "/");
54594+ }
54595+
54596+ /* remove leading slashes */
54597+ while (*fname == sep) fname++;
54598+
54599+ /* copy from fi->filename to new name, converting MS-DOS slashes to UNIX
54600+ * slashes as we go. Also lowercases characters if needed.
54601+ */
54602+ p = &name[strlen((char *)name)];
54603+ fe = &fname[strlen((char *)fname)];
54604+
54605+ if (utf8) {
54606+ /* UTF8 translates two-byte unicode characters into 1, 2 or 3 bytes.
54607+ * %000000000xxxxxxx -> %0xxxxxxx
54608+ * %00000xxxxxyyyyyy -> %110xxxxx %10yyyyyy
54609+ * %xxxxyyyyyyzzzzzz -> %1110xxxx %10yyyyyy %10zzzzzz
54610+ *
54611+ * Therefore, the inverse is as follows:
54612+ * First char:
54613+ * 0x00 - 0x7F = one byte char
54614+ * 0x80 - 0xBF = invalid
54615+ * 0xC0 - 0xDF = 2 byte char (next char only 0x80-0xBF is valid)
54616+ * 0xE0 - 0xEF = 3 byte char (next 2 chars only 0x80-0xBF is valid)
54617+ * 0xF0 - 0xFF = invalid
54618+ */
54619+ do {
54620+ if (fname >= fe) {
54621+ free(name);
54622+ return NULL;
54623+ }
54624+
54625+ /* get next UTF8 char */
54626+ if ((c = *fname++) < 0x80) x = c;
54627+ else {
54628+ if ((c >= 0xC0) && (c < 0xE0)) {
54629+ x = (c & 0x1F) << 6;
54630+ x |= *fname++ & 0x3F;
54631+ }
54632+ else if ((c >= 0xE0) && (c < 0xF0)) {
54633+ x = (c & 0xF) << 12;
54634+ x |= (*fname++ & 0x3F) << 6;
54635+ x |= *fname++ & 0x3F;
54636+ }
54637+ else x = '?';
54638+ }
54639+
54640+ /* whatever is the path seperator -> '/'
54641+ * whatever is the other slash -> '\\'
54642+ * otherwise, if lower is set, the lowercase version */
54643+ if (x == sep) x = '/';
54644+ else if (x == slash) x = '\\';
54645+ else if (lower) x = (unsigned int) tolower((int) x);
54646+
54647+ /* integer back to UTF8 */
54648+ if (x < 0x80) {
54649+ *p++ = (unsigned char) x;
54650+ }
54651+ else if (x < 0x800) {
54652+ *p++ = 0xC0 | (x >> 6);
54653+ *p++ = 0x80 | (x & 0x3F);
54654+ }
54655+ else {
54656+ *p++ = 0xE0 | (x >> 12);
54657+ *p++ = 0x80 | ((x >> 6) & 0x3F);
54658+ *p++ = 0x80 | (x & 0x3F);
54659+ }
54660+ } while (x);
54661+ }
54662+ else {
54663+ /* regular non-utf8 version */
54664+ do {
54665+ c = *fname++;
54666+ if (c == sep) c = '/';
54667+ else if (c == slash) c = '\\';
54668+ else if (lower) c = (unsigned char) tolower((int) c);
54669+ } while ((*p++ = c));
54670+ }
54671+ return (char *) name;
54672+}
54673+
54674+static int sortfunc(const void *a, const void *b) {
54675+ off_t diff =
54676+ ((* ((struct mschmd_file **) a))->offset) -
54677+ ((* ((struct mschmd_file **) b))->offset);
54678+ return (diff < 0) ? -1 : ((diff > 0) ? 1 : 0);
54679+}
54680+
54681+int main(int argc, char *argv[]) {
54682+ struct mschm_decompressor *chmd;
54683+ struct mschmd_header *chm;
54684+ struct mschmd_file *file, **f;
54685+ unsigned int numf, i;
54686+
54687+ setbuf(stdout, NULL);
54688+ setbuf(stderr, NULL);
54689+ user_umask = umask(0); umask(user_umask);
54690+
54691+ MSPACK_SYS_SELFTEST(i);
54692+ if (i) return 0;
54693+
54694+ if ((chmd = mspack_create_chm_decompressor(NULL))) {
54695+ for (argv++; *argv; argv++) {
54696+ printf("%s\n", *argv);
54697+ if ((chm = chmd->open(chmd, *argv))) {
54698+
54699+ /* build an ordered list of files for maximum extraction speed */
54700+ for (numf=0, file=chm->files; file; file = file->next) numf++;
54701+ if ((f = (struct mschmd_file **) calloc(numf, sizeof(struct mschmd_file *)))) {
54702+ for (i=0, file=chm->files; file; file = file->next) f[i++] = file;
54703+ qsort(f, numf, sizeof(struct mschmd_file *), &sortfunc);
54704+
54705+ for (i = 0; i < numf; i++) {
54706+ char *outname = create_output_name((unsigned char *)f[i]->filename,NULL,0,1,0);
54707+ printf("Extracting %s\n", outname);
54708+ ensure_filepath(outname);
54709+ if (chmd->extract(chmd, f[i], outname)) {
54710+ printf("%s: extract error on \"%s\": %s\n",
54711+ *argv, f[i]->filename, ERROR(chmd));
54712+ }
54713+ free(outname);
54714+ }
54715+ free(f);
54716+ }
54717+ chmd->close(chmd, chm);
54718+ }
54719+ else {
54720+ printf("%s: can't open -- %s\n", *argv, ERROR(chmd));
54721+ }
54722+ }
54723+ mspack_destroy_chm_decompressor(chmd);
54724+ }
54725+ return 0;
54726+}
54727diff --git a/libclamav/libmspack-0.4alpha/test/error.h b/libclamav/libmspack-0.4alpha/test/error.h
54728new file mode 100644
54729index 000000000000..b1d627b27c09
54730--- /dev/null
54731+++ b/libclamav/libmspack-0.4alpha/test/error.h
54732@@ -0,0 +1,22 @@
54733+#define ERROR(base) error_msg(base->last_error(base))
54734+
54735+const char *error_msg(int error) {
54736+ static char buf[32];
54737+ switch (error) {
54738+ case MSPACK_ERR_OK: return "no error";
54739+ case MSPACK_ERR_ARGS: return "bad arguments to library function";
54740+ case MSPACK_ERR_OPEN: return "error opening file";
54741+ case MSPACK_ERR_READ: return "read error";
54742+ case MSPACK_ERR_WRITE: return "write error";
54743+ case MSPACK_ERR_SEEK: return "seek error";
54744+ case MSPACK_ERR_NOMEMORY: return "out of memory";
54745+ case MSPACK_ERR_SIGNATURE: return "bad signature";
54746+ case MSPACK_ERR_DATAFORMAT: return "error in data format";
54747+ case MSPACK_ERR_CHECKSUM: return "checksum error";
54748+ case MSPACK_ERR_CRUNCH: return "compression error";
54749+ case MSPACK_ERR_DECRUNCH: return "decompression error";
54750+ }
54751+
54752+ snprintf(buf, sizeof(buf), "unknown error %d", error);
54753+ return buf;
54754+}
54755diff --git a/libclamav/libmspack-0.4alpha/test/expand.c b/libclamav/libmspack-0.4alpha/test/expand.c
54756new file mode 100644
54757index 000000000000..215ef7ba17d5
54758--- /dev/null
54759+++ b/libclamav/libmspack-0.4alpha/test/expand.c
54760@@ -0,0 +1,79 @@
54761+/* acts like Microsoft's EXPAND.EXE */
54762+#ifdef HAVE_CONFIG_H
54763+#include <config.h>
54764+#endif
54765+
54766+#include <stdio.h>
54767+#include <stdlib.h>
54768+#include <string.h>
54769+
54770+#include <mspack.h>
54771+#include <error.h>
54772+
54773+int main(int argc, char *argv[]) {
54774+ struct msszdd_decompressor *szddd;
54775+ struct mskwaj_decompressor *kwajd;
54776+ struct msszddd_header *szdd;
54777+ struct mskwajd_header *kwaj;
54778+ int err;
54779+
54780+ if (argc != 3) {
54781+ fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
54782+ return 1;
54783+ }
54784+
54785+ /* if self-test reveals an error */
54786+ MSPACK_SYS_SELFTEST(err);
54787+ if (err) return 1;
54788+
54789+ szddd = mspack_create_szdd_decompressor(NULL);
54790+ kwajd = mspack_create_kwaj_decompressor(NULL);
54791+
54792+ if (!szddd || !kwajd) {
54793+ fprintf(stderr, "can't make either SZDD or KWAJ decompressor\n");
54794+ mspack_destroy_szdd_decompressor(szddd);
54795+ mspack_destroy_kwaj_decompressor(kwajd);
54796+ return 1;
54797+ }
54798+
54799+ /* open then extract; try SZDD */
54800+ if ((szdd = szddd->open(szddd, argv[1]))) {
54801+ if (szddd->extract(szddd, szdd, argv[2]) != MSPACK_ERR_OK) {
54802+ fprintf(stderr, "%s: SZDD extract error: %s\n", argv[2], ERROR(szddd));
54803+ }
54804+ szddd->close(szddd, szdd);
54805+ }
54806+ else {
54807+ if (szddd->last_error(szddd) == MSPACK_ERR_SIGNATURE) {
54808+ /* try KWAJ */
54809+ if ((kwaj = kwajd->open(kwajd, argv[1]))) {
54810+ if (kwajd->extract(kwajd, kwaj, argv[2]) != MSPACK_ERR_OK) {
54811+ fprintf(stderr, "%s: KWAJ extract error: %s\n", argv[2], ERROR(kwajd));
54812+ }
54813+ kwajd->close(kwajd, kwaj);
54814+ }
54815+ else {
54816+ fprintf(stderr, "%s: KWAJ open error: %s\n", argv[1], ERROR(kwajd));
54817+ }
54818+ }
54819+ else {
54820+ fprintf(stderr, "%s: SZDD open error: %s\n", argv[1], ERROR(szddd));
54821+ }
54822+ }
54823+
54824+ /* decompress in a single step; try KWAJ */
54825+ if (kwajd->decompress(kwajd, argv[1], argv[2]) != MSPACK_ERR_OK) {
54826+ if (kwajd->last_error(kwajd) == MSPACK_ERR_SIGNATURE) {
54827+ if (szddd->decompress(szddd, argv[1], argv[2]) != MSPACK_ERR_OK) {
54828+ fprintf(stderr, "%s -> %s: SZDD decompress error: %s\n", argv[1], argv[2], ERROR(szddd));
54829+ }
54830+ }
54831+ else {
54832+ fprintf(stderr, "%s -> %s: KWAJ decompress error: %s\n", argv[1], argv[2], ERROR(kwajd));
54833+ }
54834+ }
54835+
54836+ mspack_destroy_szdd_decompressor(szddd);
54837+ mspack_destroy_kwaj_decompressor(kwajd);
54838+ return 0;
54839+}
54840diff --git a/libclamav/libmspack-0.4alpha/test/md5.c b/libclamav/libmspack-0.4alpha/test/md5.c
54841new file mode 100644
54842index 000000000000..208740689392
54843--- /dev/null
54844+++ b/libclamav/libmspack-0.4alpha/test/md5.c
54845@@ -0,0 +1,457 @@
54846+/* md5.c - Functions to compute MD5 message digest of files or memory blocks
54847+ according to the definition of MD5 in RFC 1321 from April 1992.
54848+ Copyright (C) 1995, 1996, 2001, 2003 Free Software Foundation, Inc.
54849+ NOTE: The canonical source of this file is maintained with the GNU C
54850+ Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
54851+
54852+ This program is free software; you can redistribute it and/or modify it
54853+ under the terms of the GNU General Public License as published by the
54854+ Free Software Foundation; either version 2, or (at your option) any
54855+ later version.
54856+
54857+ This program is distributed in the hope that it will be useful,
54858+ but WITHOUT ANY WARRANTY; without even the implied warranty of
54859+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54860+ GNU General Public License for more details.
54861+
54862+ You should have received a copy of the GNU General Public License
54863+ along with this program; if not, write to the Free Software Foundation,
54864+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
54865+
54866+/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
54867+
54868+#ifdef HAVE_CONFIG_H
54869+# include <config.h>
54870+#endif
54871+
54872+#include <sys/types.h>
54873+
54874+#if STDC_HEADERS || defined _LIBC
54875+# include <stdlib.h>
54876+# include <string.h>
54877+#else
54878+# ifndef HAVE_MEMCPY
54879+# define memcpy(d, s, n) bcopy ((s), (d), (n))
54880+# endif
54881+#endif
54882+
54883+#include <md5.h>
54884+
54885+#ifdef _LIBC
54886+# include <endian.h>
54887+# if __BYTE_ORDER == __BIG_ENDIAN
54888+# define WORDS_BIGENDIAN 1
54889+# endif
54890+/* We need to keep the namespace clean so define the MD5 function
54891+ protected using leading __ . */
54892+# define md5_init_ctx __md5_init_ctx
54893+# define md5_process_block __md5_process_block
54894+# define md5_process_bytes __md5_process_bytes
54895+# define md5_finish_ctx __md5_finish_ctx
54896+# define md5_read_ctx __md5_read_ctx
54897+# define md5_stream __md5_stream
54898+# define md5_buffer __md5_buffer
54899+#endif
54900+
54901+#ifdef WORDS_BIGENDIAN
54902+# define SWAP(n) \
54903+ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
54904+#else
54905+# define SWAP(n) (n)
54906+#endif
54907+
54908+#define BLOCKSIZE 4096
54909+/* Ensure that BLOCKSIZE is a multiple of 64. */
54910+#if BLOCKSIZE % 64 != 0
54911+/* FIXME-someday (soon?): use #error instead of this kludge. */
54912+"invalid BLOCKSIZE"
54913+#endif
54914+
54915+/* This array contains the bytes used to pad the buffer to the next
54916+ 64-byte boundary. (RFC 1321, 3.1: Step 1) */
54917+static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
54918+
54919+
54920+/* Initialize structure containing state of computation.
54921+ (RFC 1321, 3.3: Step 3) */
54922+void
54923+md5_init_ctx (struct md5_ctx *ctx)
54924+{
54925+ ctx->A = 0x67452301;
54926+ ctx->B = 0xefcdab89;
54927+ ctx->C = 0x98badcfe;
54928+ ctx->D = 0x10325476;
54929+
54930+ ctx->total[0] = ctx->total[1] = 0;
54931+ ctx->buflen = 0;
54932+}
54933+
54934+/* Put result from CTX in first 16 bytes following RESBUF. The result
54935+ must be in little endian byte order.
54936+
54937+ IMPORTANT: On some systems it is required that RESBUF is correctly
54938+ aligned for a 32 bits value. */
54939+void *
54940+md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
54941+{
54942+ ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
54943+ ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
54944+ ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C);
54945+ ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D);
54946+
54947+ return resbuf;
54948+}
54949+
54950+/* Process the remaining bytes in the internal buffer and the usual
54951+ prolog according to the standard and write the result to RESBUF.
54952+
54953+ IMPORTANT: On some systems it is required that RESBUF is correctly
54954+ aligned for a 32 bits value. */
54955+void *
54956+md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
54957+{
54958+ /* Take yet unprocessed bytes into account. */
54959+ md5_uint32 bytes = ctx->buflen;
54960+ size_t pad;
54961+
54962+ /* Now count remaining bytes. */
54963+ ctx->total[0] += bytes;
54964+ if (ctx->total[0] < bytes)
54965+ ++ctx->total[1];
54966+
54967+ pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
54968+ memcpy (&ctx->buffer[bytes], fillbuf, pad);
54969+
54970+ /* Put the 64-bit file length in *bits* at the end of the buffer. */
54971+ *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
54972+ *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
54973+ (ctx->total[0] >> 29));
54974+
54975+ /* Process last bytes. */
54976+ md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
54977+
54978+ return md5_read_ctx (ctx, resbuf);
54979+}
54980+
54981+/* Compute MD5 message digest for bytes read from STREAM. The
54982+ resulting message digest number will be written into the 16 bytes
54983+ beginning at RESBLOCK. */
54984+int
54985+md5_stream (FILE *stream, void *resblock)
54986+{
54987+ struct md5_ctx ctx;
54988+ char buffer[BLOCKSIZE + 72];
54989+ size_t sum;
54990+
54991+ /* Initialize the computation context. */
54992+ md5_init_ctx (&ctx);
54993+
54994+ /* Iterate over full file contents. */
54995+ while (1)
54996+ {
54997+ /* We read the file in blocks of BLOCKSIZE bytes. One call of the
54998+ computation function processes the whole buffer so that with the
54999+ next round of the loop another block can be read. */
55000+ size_t n;
55001+ sum = 0;
55002+
55003+ /* Read block. Take care for partial reads. */
55004+ while (1)
55005+ {
55006+ n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
55007+
55008+ sum += n;
55009+
55010+ if (sum == BLOCKSIZE)
55011+ break;
55012+
55013+ if (n == 0)
55014+ {
55015+ /* Check for the error flag IFF N == 0, so that we don't
55016+ exit the loop after a partial read due to e.g., EAGAIN
55017+ or EWOULDBLOCK. */
55018+ if (ferror (stream))
55019+ return 1;
55020+ goto process_partial_block;
55021+ }
55022+
55023+ /* We've read at least one byte, so ignore errors. But always
55024+ check for EOF, since feof may be true even though N > 0.
55025+ Otherwise, we could end up calling fread after EOF. */
55026+ if (feof (stream))
55027+ goto process_partial_block;
55028+ }
55029+
55030+ /* Process buffer with BLOCKSIZE bytes. Note that
55031+ BLOCKSIZE % 64 == 0
55032+ */
55033+ md5_process_block (buffer, BLOCKSIZE, &ctx);
55034+ }
55035+
55036+ process_partial_block:;
55037+
55038+ /* Process any remaining bytes. */
55039+ if (sum > 0)
55040+ md5_process_bytes (buffer, sum, &ctx);
55041+
55042+ /* Construct result in desired memory. */
55043+ md5_finish_ctx (&ctx, resblock);
55044+ return 0;
55045+}
55046+
55047+/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
55048+ result is always in little endian byte order, so that a byte-wise
55049+ output yields to the wanted ASCII representation of the message
55050+ digest. */
55051+void *
55052+md5_buffer (const char *buffer, size_t len, void *resblock)
55053+{
55054+ struct md5_ctx ctx;
55055+
55056+ /* Initialize the computation context. */
55057+ md5_init_ctx (&ctx);
55058+
55059+ /* Process whole buffer but last len % 64 bytes. */
55060+ md5_process_bytes (buffer, len, &ctx);
55061+
55062+ /* Put result in desired memory area. */
55063+ return md5_finish_ctx (&ctx, resblock);
55064+}
55065+
55066+
55067+void
55068+md5_process_bytes ( const void *buffer, size_t len, struct md5_ctx *ctx)
55069+{
55070+ /* When we already have some bits in our internal buffer concatenate
55071+ both inputs first. */
55072+ if (ctx->buflen != 0)
55073+ {
55074+ size_t left_over = ctx->buflen;
55075+ size_t add = 128 - left_over > len ? len : 128 - left_over;
55076+
55077+ memcpy (&ctx->buffer[left_over], buffer, add);
55078+ ctx->buflen += add;
55079+
55080+ if (ctx->buflen > 64)
55081+ {
55082+ md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
55083+
55084+ ctx->buflen &= 63;
55085+ /* The regions in the following copy operation cannot overlap. */
55086+ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
55087+ ctx->buflen);
55088+ }
55089+
55090+ buffer = (const char *) buffer + add;
55091+ len -= add;
55092+ }
55093+
55094+ /* Process available complete blocks. */
55095+ if (len >= 64)
55096+ {
55097+#if !_STRING_ARCH_unaligned
55098+/* To check alignment gcc has an appropriate operator. Other
55099+ compilers don't. */
55100+# if __GNUC__ >= 2
55101+# define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0)
55102+# else
55103+# define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0)
55104+# endif
55105+ if (UNALIGNED_P (buffer))
55106+ while (len > 64)
55107+ {
55108+ memcpy (ctx->buffer, buffer, 64);
55109+ md5_process_block (ctx->buffer, 64, ctx);
55110+ buffer = (const char *) buffer + 64;
55111+ len -= 64;
55112+ }
55113+ else
55114+#endif
55115+ {
55116+ md5_process_block (buffer, len & ~63, ctx);
55117+ buffer = (const char *) buffer + (len & ~63);
55118+ len &= 63;
55119+ }
55120+ }
55121+
55122+ /* Move remaining bytes in internal buffer. */
55123+ if (len > 0)
55124+ {
55125+ size_t left_over = ctx->buflen;
55126+
55127+ memcpy (&ctx->buffer[left_over], buffer, len);
55128+ left_over += len;
55129+ if (left_over >= 64)
55130+ {
55131+ md5_process_block (ctx->buffer, 64, ctx);
55132+ left_over -= 64;
55133+ memcpy (ctx->buffer, &ctx->buffer[64], left_over);
55134+ }
55135+ ctx->buflen = left_over;
55136+ }
55137+}
55138+
55139+
55140+/* These are the four functions used in the four steps of the MD5 algorithm
55141+ and defined in the RFC 1321. The first function is a little bit optimized
55142+ (as found in Colin Plumbs public domain implementation). */
55143+/* #define FF(b, c, d) ((b & c) | (~b & d)) */
55144+#define FF(b, c, d) (d ^ (b & (c ^ d)))
55145+#define FG(b, c, d) FF (d, b, c)
55146+#define FH(b, c, d) (b ^ c ^ d)
55147+#define FI(b, c, d) (c ^ (b | ~d))
55148+
55149+/* Process LEN bytes of BUFFER, accumulating context into CTX.
55150+ It is assumed that LEN % 64 == 0. */
55151+
55152+void
55153+md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
55154+{
55155+ md5_uint32 correct_words[16];
55156+ const md5_uint32 *words = (const md5_uint32 *) buffer;
55157+ size_t nwords = len / sizeof (md5_uint32);
55158+ const md5_uint32 *endp = words + nwords;
55159+ md5_uint32 A = ctx->A;
55160+ md5_uint32 B = ctx->B;
55161+ md5_uint32 C = ctx->C;
55162+ md5_uint32 D = ctx->D;
55163+
55164+ /* First increment the byte count. RFC 1321 specifies the possible
55165+ length of the file up to 2^64 bits. Here we only compute the
55166+ number of bytes. Do a double word increment. */
55167+ ctx->total[0] += len;
55168+ if (ctx->total[0] < len)
55169+ ++ctx->total[1];
55170+
55171+ /* Process all bytes in the buffer with 64 bytes in each round of
55172+ the loop. */
55173+ while (words < endp)
55174+ {
55175+ md5_uint32 *cwp = correct_words;
55176+ md5_uint32 A_save = A;
55177+ md5_uint32 B_save = B;
55178+ md5_uint32 C_save = C;
55179+ md5_uint32 D_save = D;
55180+
55181+ /* First round: using the given function, the context and a constant
55182+ the next context is computed. Because the algorithms processing
55183+ unit is a 32-bit word and it is determined to work on words in
55184+ little endian byte order we perhaps have to change the byte order
55185+ before the computation. To reduce the work for the next steps
55186+ we store the swapped words in the array CORRECT_WORDS. */
55187+
55188+#define OP(a, b, c, d, s, T) \
55189+ do \
55190+ { \
55191+ a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
55192+ ++words; \
55193+ a = rol (a, s); \
55194+ a += b; \
55195+ } \
55196+ while (0)
55197+
55198+ /* Before we start, one word to the strange constants.
55199+ They are defined in RFC 1321 as
55200+
55201+ T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or
55202+ perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}'
55203+ */
55204+
55205+ /* Round 1. */
55206+ OP (A, B, C, D, 7, 0xd76aa478);
55207+ OP (D, A, B, C, 12, 0xe8c7b756);
55208+ OP (C, D, A, B, 17, 0x242070db);
55209+ OP (B, C, D, A, 22, 0xc1bdceee);
55210+ OP (A, B, C, D, 7, 0xf57c0faf);
55211+ OP (D, A, B, C, 12, 0x4787c62a);
55212+ OP (C, D, A, B, 17, 0xa8304613);
55213+ OP (B, C, D, A, 22, 0xfd469501);
55214+ OP (A, B, C, D, 7, 0x698098d8);
55215+ OP (D, A, B, C, 12, 0x8b44f7af);
55216+ OP (C, D, A, B, 17, 0xffff5bb1);
55217+ OP (B, C, D, A, 22, 0x895cd7be);
55218+ OP (A, B, C, D, 7, 0x6b901122);
55219+ OP (D, A, B, C, 12, 0xfd987193);
55220+ OP (C, D, A, B, 17, 0xa679438e);
55221+ OP (B, C, D, A, 22, 0x49b40821);
55222+
55223+ /* For the second to fourth round we have the possibly swapped words
55224+ in CORRECT_WORDS. Redefine the macro to take an additional first
55225+ argument specifying the function to use. */
55226+#undef OP
55227+#define OP(f, a, b, c, d, k, s, T) \
55228+ do \
55229+ { \
55230+ a += f (b, c, d) + correct_words[k] + T; \
55231+ a = rol (a, s); \
55232+ a += b; \
55233+ } \
55234+ while (0)
55235+
55236+ /* Round 2. */
55237+ OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
55238+ OP (FG, D, A, B, C, 6, 9, 0xc040b340);
55239+ OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
55240+ OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
55241+ OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
55242+ OP (FG, D, A, B, C, 10, 9, 0x02441453);
55243+ OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
55244+ OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
55245+ OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
55246+ OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
55247+ OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
55248+ OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
55249+ OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
55250+ OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
55251+ OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
55252+ OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
55253+
55254+ /* Round 3. */
55255+ OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
55256+ OP (FH, D, A, B, C, 8, 11, 0x8771f681);
55257+ OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
55258+ OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
55259+ OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
55260+ OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
55261+ OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
55262+ OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
55263+ OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
55264+ OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
55265+ OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
55266+ OP (FH, B, C, D, A, 6, 23, 0x04881d05);
55267+ OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
55268+ OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
55269+ OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
55270+ OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
55271+
55272+ /* Round 4. */
55273+ OP (FI, A, B, C, D, 0, 6, 0xf4292244);
55274+ OP (FI, D, A, B, C, 7, 10, 0x432aff97);
55275+ OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
55276+ OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
55277+ OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
55278+ OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
55279+ OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
55280+ OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
55281+ OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
55282+ OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
55283+ OP (FI, C, D, A, B, 6, 15, 0xa3014314);
55284+ OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
55285+ OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
55286+ OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
55287+ OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
55288+ OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
55289+
55290+ /* Add the starting values of the context. */
55291+ A += A_save;
55292+ B += B_save;
55293+ C += C_save;
55294+ D += D_save;
55295+ }
55296+
55297+ /* Put checksum in context given as argument. */
55298+ ctx->A = A;
55299+ ctx->B = B;
55300+ ctx->C = C;
55301+ ctx->D = D;
55302+}
55303diff --git a/libclamav/libmspack-0.4alpha/test/md5.h b/libclamav/libmspack-0.4alpha/test/md5.h
55304new file mode 100644
55305index 000000000000..0d22a70a2ccd
55306--- /dev/null
55307+++ b/libclamav/libmspack-0.4alpha/test/md5.h
55308@@ -0,0 +1,165 @@
55309+/* md5.h - Declaration of functions and data types used for MD5 sum
55310+ computing library functions.
55311+ Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
55312+ NOTE: The canonical source of this file is maintained with the GNU C
55313+ Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
55314+
55315+ This program is free software; you can redistribute it and/or modify it
55316+ under the terms of the GNU General Public License as published by the
55317+ Free Software Foundation; either version 2, or (at your option) any
55318+ later version.
55319+
55320+ This program is distributed in the hope that it will be useful,
55321+ but WITHOUT ANY WARRANTY; without even the implied warranty of
55322+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55323+ GNU General Public License for more details.
55324+
55325+ You should have received a copy of the GNU General Public License
55326+ along with this program; if not, write to the Free Software Foundation,
55327+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
55328+
55329+#ifndef _MD5_H
55330+#define _MD5_H 1
55331+
55332+#include <stdio.h>
55333+
55334+#if defined HAVE_LIMITS_H || _LIBC
55335+# include <limits.h>
55336+#endif
55337+
55338+/* The following contortions are an attempt to use the C preprocessor
55339+ to determine an unsigned integral type that is 32 bits wide. An
55340+ alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
55341+ doing that would require that the configure script compile and *run*
55342+ the resulting executable. Locally running cross-compiled executables
55343+ is usually not possible. */
55344+
55345+#ifdef _LIBC
55346+# include <stdint.h>
55347+typedef uint32_t md5_uint32;
55348+typedef uintptr_t md5_uintptr;
55349+#else
55350+# if defined __STDC__ && __STDC__
55351+# define UINT_MAX_32_BITS 4294967295U
55352+# else
55353+# define UINT_MAX_32_BITS 0xFFFFFFFF
55354+# endif
55355+
55356+/* If UINT_MAX isn't defined, assume it's a 32-bit type.
55357+ This should be valid for all systems GNU cares about because
55358+ that doesn't include 16-bit systems, and only modern systems
55359+ (that certainly have <limits.h>) have 64+-bit integral types. */
55360+
55361+# ifndef UINT_MAX
55362+# define UINT_MAX UINT_MAX_32_BITS
55363+# endif
55364+
55365+# if UINT_MAX == UINT_MAX_32_BITS
55366+ typedef unsigned int md5_uint32;
55367+# else
55368+# if USHRT_MAX == UINT_MAX_32_BITS
55369+ typedef unsigned short md5_uint32;
55370+# else
55371+# if ULONG_MAX == UINT_MAX_32_BITS
55372+ typedef unsigned long md5_uint32;
55373+# else
55374+ /* The following line is intended to evoke an error.
55375+ Using #error is not portable enough. */
55376+ "Cannot determine unsigned 32-bit data type."
55377+# endif
55378+# endif
55379+# endif
55380+/* We have to make a guess about the integer type equivalent in size
55381+ to pointers which should always be correct. */
55382+typedef unsigned long int md5_uintptr;
55383+#endif
55384+
55385+#undef __P
55386+#if defined (__STDC__) && __STDC__
55387+#define __P(x) x
55388+#else
55389+#define __P(x) ()
55390+#endif
55391+
55392+/* Structure to save state of computation between the single steps. */
55393+struct md5_ctx
55394+{
55395+ md5_uint32 A;
55396+ md5_uint32 B;
55397+ md5_uint32 C;
55398+ md5_uint32 D;
55399+
55400+ md5_uint32 total[2];
55401+ md5_uint32 buflen;
55402+ char buffer[128];
55403+};
55404+
55405+/*
55406+ * The following three functions are build up the low level used in
55407+ * the functions `md5_stream' and `md5_buffer'.
55408+ */
55409+
55410+/* Initialize structure containing state of computation.
55411+ (RFC 1321, 3.3: Step 3) */
55412+extern void md5_init_ctx __P ((struct md5_ctx *ctx));
55413+
55414+/* Starting with the result of former calls of this function (or the
55415+ initialization function update the context for the next LEN bytes
55416+ starting at BUFFER.
55417+ It is necessary that LEN is a multiple of 64!!! */
55418+extern void md5_process_block __P ((const void *buffer, size_t len,
55419+ struct md5_ctx *ctx));
55420+
55421+/* Starting with the result of former calls of this function (or the
55422+ initialization function update the context for the next LEN bytes
55423+ starting at BUFFER.
55424+ It is NOT required that LEN is a multiple of 64. */
55425+extern void md5_process_bytes __P ((const void *buffer, size_t len,
55426+ struct md5_ctx *ctx));
55427+
55428+/* Process the remaining bytes in the buffer and put result from CTX
55429+ in first 16 bytes following RESBUF. The result is always in little
55430+ endian byte order, so that a byte-wise output yields to the wanted
55431+ ASCII representation of the message digest.
55432+
55433+ IMPORTANT: On some systems it is required that RESBUF be correctly
55434+ aligned for a 32 bits value. */
55435+extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));
55436+
55437+
55438+/* Put result from CTX in first 16 bytes following RESBUF. The result is
55439+ always in little endian byte order, so that a byte-wise output yields
55440+ to the wanted ASCII representation of the message digest.
55441+
55442+ IMPORTANT: On some systems it is required that RESBUF is correctly
55443+ aligned for a 32 bits value. */
55444+extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
55445+
55446+
55447+/* Compute MD5 message digest for bytes read from STREAM. The
55448+ resulting message digest number will be written into the 16 bytes
55449+ beginning at RESBLOCK. */
55450+extern int md5_stream __P ((FILE *stream, void *resblock));
55451+
55452+/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
55453+ result is always in little endian byte order, so that a byte-wise
55454+ output yields to the wanted ASCII representation of the message
55455+ digest. */
55456+extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
55457+
55458+/* The following is from gnupg-1.0.2's cipher/bithelp.h. */
55459+/* Rotate a 32 bit integer by n bytes */
55460+#if defined __GNUC__ && defined __i386__
55461+static inline md5_uint32
55462+rol(md5_uint32 x, int n)
55463+{
55464+ __asm__("roll %%cl,%0"
55465+ :"=r" (x)
55466+ :"0" (x),"c" (n));
55467+ return x;
55468+}
55469+#else
55470+# define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) )
55471+#endif
55472+
55473+#endif
55474diff --git a/libclamav/libmspack-0.4alpha/test/md5_fh.h b/libclamav/libmspack-0.4alpha/test/md5_fh.h
55475new file mode 100644
55476index 000000000000..385426e2e81f
55477--- /dev/null
55478+++ b/libclamav/libmspack-0.4alpha/test/md5_fh.h
55479@@ -0,0 +1,123 @@
55480+/* an mspack_system implementation which reads one or more files, and
55481+ * only writes to one file; the file is not actually written to, but
55482+ * an MD5 sum is computed and is available once the written-to file is
55483+ * closed. You can use anything for the written-to filename, NULL is
55484+ * probably the most obvious. The code is not multithreadable.
55485+ */
55486+
55487+#include <md5.h>
55488+#include <stdio.h>
55489+#include <stdarg.h>
55490+
55491+struct md5_ctx md5_context;
55492+char md5_string[33];
55493+
55494+struct mspack_file_p {
55495+ FILE *fh;
55496+};
55497+
55498+static struct mspack_file *m_open(struct mspack_system *self, const char *filename, int mode) {
55499+ struct mspack_file_p *fh;
55500+ if (mode != MSPACK_SYS_OPEN_WRITE &&
55501+ mode != MSPACK_SYS_OPEN_READ) return NULL;
55502+
55503+ if ((fh = (struct mspack_file_p *) malloc(sizeof(struct mspack_file_p)))) {
55504+ if (mode == MSPACK_SYS_OPEN_WRITE) {
55505+ fh->fh = NULL;
55506+ md5_init_ctx(&md5_context);
55507+ return (struct mspack_file *) fh;
55508+ }
55509+ else {
55510+ if ((fh->fh = fopen(filename, "rb")))
55511+ return (struct mspack_file *) fh;
55512+ }
55513+ /* error - free file handle and return NULL */
55514+ free(fh);
55515+ }
55516+ return NULL;
55517+}
55518+
55519+static void m_close(struct mspack_file *file) {
55520+ struct mspack_file_p *self = (struct mspack_file_p *) file;
55521+ if (self) {
55522+ if (self->fh) fclose(self->fh);
55523+ else {
55524+ unsigned char md5[16];
55525+ md5_finish_ctx(&md5_context, (void *) &md5);
55526+ snprintf(md5_string, sizeof(md5_string),
55527+ "%02x%02x%02x%02x%02x%02x%02x%02x"
55528+ "%02x%02x%02x%02x%02x%02x%02x%02x",
55529+ md5[0], md5[1], md5[2], md5[3],
55530+ md5[4], md5[5], md5[6], md5[7],
55531+ md5[8], md5[9], md5[10], md5[11],
55532+ md5[12], md5[13], md5[14], md5[15]);
55533+ }
55534+ free(self);
55535+ }
55536+}
55537+
55538+static int m_read(struct mspack_file *file, void *buffer, int bytes) {
55539+ struct mspack_file_p *self = (struct mspack_file_p *) file;
55540+ if (self && self->fh && buffer && bytes >= 0) {
55541+ size_t count = fread(buffer, 1, bytes, self->fh);
55542+ if (!ferror(self->fh)) return (int) count;
55543+ }
55544+ return -1;
55545+}
55546+
55547+static int m_write(struct mspack_file *file, void *buffer, int bytes) {
55548+ struct mspack_file_p *self = (struct mspack_file_p *) file;
55549+ if (!self || self->fh || !buffer || bytes < 0) return -1;
55550+ md5_process_bytes(buffer, bytes, &md5_context);
55551+ return bytes;
55552+}
55553+
55554+static int m_seek(struct mspack_file *file, off_t offset, int mode) {
55555+ struct mspack_file_p *self = (struct mspack_file_p *) file;
55556+ if (self && self->fh) {
55557+ switch (mode) {
55558+ case MSPACK_SYS_SEEK_START: mode = SEEK_SET; break;
55559+ case MSPACK_SYS_SEEK_CUR: mode = SEEK_CUR; break;
55560+ case MSPACK_SYS_SEEK_END: mode = SEEK_END; break;
55561+ default: return -1;
55562+ }
55563+#if HAVE_FSEEKO
55564+ return fseeko(self->fh, offset, mode);
55565+#else
55566+ return fseek(self->fh, offset, mode);
55567+#endif
55568+ }
55569+ return -1;
55570+}
55571+
55572+static off_t m_tell(struct mspack_file *file) {
55573+ struct mspack_file_p *self = (struct mspack_file_p *) file;
55574+#if HAVE_FSEEKO
55575+ return (self && self->fh) ? (off_t) ftello(self->fh) : 0;
55576+#else
55577+ return (self && self->fh) ? (off_t) ftell(self->fh) : 0;
55578+#endif
55579+}
55580+
55581+static void m_msg(struct mspack_file *file, const char *format, ...) {
55582+ va_list ap;
55583+ va_start(ap, format);
55584+ vfprintf(stderr, format, ap);
55585+ va_end(ap);
55586+ fputc((int) '\n', stderr);
55587+ fflush(stderr);
55588+}
55589+static void *m_alloc(struct mspack_system *self, size_t bytes) {
55590+ return malloc(bytes);
55591+}
55592+static void m_free(void *buffer) {
55593+ free(buffer);
55594+}
55595+static void m_copy(void *src, void *dest, size_t bytes) {
55596+ memcpy(dest, src, bytes);
55597+}
55598+
55599+static struct mspack_system read_files_write_md5 = {
55600+ &m_open, &m_close, &m_read, &m_write, &m_seek,
55601+ &m_tell, &m_msg, &m_alloc, &m_free, &m_copy, NULL
55602+};
55603diff --git a/libclamav/libmspack-0.4alpha/test/multifh.c b/libclamav/libmspack-0.4alpha/test/multifh.c
55604new file mode 100644
55605index 000000000000..f7ed758c4da1
55606--- /dev/null
55607+++ b/libclamav/libmspack-0.4alpha/test/multifh.c
55608@@ -0,0 +1,435 @@
55609+/* An implementation of the mspack_system interface which can access many
55610+ * things:
55611+ * - regular disk files
55612+ * - already opened stdio FILE* file pointers
55613+ * - open file descriptors
55614+ * - blocks of memory
55615+ */
55616+
55617+#ifdef HAVE_CONFIG_H
55618+#include <config.h>
55619+#endif
55620+
55621+#include <stdio.h>
55622+#include <stdlib.h>
55623+#include <stdarg.h>
55624+#include <string.h>
55625+#include <mspack.h>
55626+
55627+/* definitions */
55628+
55629+#define MTYPE_DISKFILE (0x01)
55630+#define MTYPE_STDIOFH (0x02)
55631+#define MTYPE_FILEDESC (0x03)
55632+#define MTYPE_MEMORY (0x04)
55633+
55634+struct m_filename {
55635+ unsigned char type; /* one of MTYPE_DISKFILE, STDIOFH, FILEDESC or MEMORY */
55636+ const char *filename; /* the user-friendly printable filename (may be NULL) */
55637+ union {
55638+ const char *diskfile; /* char *filename for MTYPE_DISKFILE */
55639+ FILE *stdiofh; /* FILE *existing_fh for MTYPE_STDIOFH */
55640+ int filedesc; /* int file_descriptor for MTYPE_FILEDESC */
55641+ struct {
55642+ unsigned char *data;
55643+ size_t length;
55644+ } memory;
55645+ } x;
55646+};
55647+
55648+struct m_file {
55649+ struct m_filename *file; /* pointer back to the m_filename data */
55650+ union {
55651+ FILE *fh; /* only used in DISKFILE, STDIOFH and FILEDESC types */
55652+ size_t position; /* only used in MEMORY types */
55653+ } x;
55654+};
55655+
55656+/* ------------------------------------------------------------------------ */
55657+/* mspack_system implementation */
55658+
55659+static void *m_alloc(struct mspack_system *self, size_t bytes) {
55660+ return malloc(bytes);
55661+}
55662+
55663+static void m_free(void *buffer) {
55664+ free(buffer);
55665+}
55666+
55667+static void m_copy(void *src, void *dest, size_t bytes) {
55668+ memcpy(dest, src, bytes);
55669+}
55670+
55671+/* A message printer that prints to stderr */
55672+static void m_msg(struct m_file *file, const char *format, ...) {
55673+ va_list ap;
55674+ if (file && file->file && file->file->filename) {
55675+ fprintf(stderr, "%s: ", file->file->filename);
55676+ }
55677+ va_start(ap, format);
55678+ vfprintf(stderr, format, ap);
55679+ va_end(ap);
55680+ fputc((int) '\n', stderr);
55681+ fflush(stderr);
55682+}
55683+
55684+
55685+static struct m_file *m_open_mem(struct mspack_system *self,
55686+ struct m_filename *fn, int mode)
55687+{
55688+ struct m_file *fh;
55689+
55690+ /* validate arguments of the filename */
55691+ if (!fn->x.memory.data) return NULL;
55692+ if (!fn->x.memory.length) return NULL;
55693+
55694+ if ((fh = (struct m_file *) m_alloc(self, sizeof(struct m_file)))) {
55695+ fh->x.position = (mode == MSPACK_SYS_OPEN_APPEND) ?
55696+ fn->x.memory.length : 0;
55697+ fh->file = fn;
55698+ }
55699+ return fh;
55700+}
55701+
55702+static struct m_file *m_open_file(struct mspack_system *self,
55703+ struct m_filename *fn, int mode)
55704+{
55705+ struct m_file *fh;
55706+ const char *fmode;
55707+ int fd;
55708+
55709+ switch (mode) {
55710+ case MSPACK_SYS_OPEN_READ: fmode = "rb"; break;
55711+ case MSPACK_SYS_OPEN_WRITE: fmode = "wb"; break;
55712+ case MSPACK_SYS_OPEN_UPDATE: fmode = "r+b"; break;
55713+ case MSPACK_SYS_OPEN_APPEND: fmode = "ab"; break;
55714+ default: return NULL;
55715+ }
55716+
55717+ /* validate the arguments in the provided filename */
55718+ switch (fn->type) {
55719+ case MTYPE_DISKFILE: if (!fn->x.diskfile) return NULL; break;
55720+ case MTYPE_STDIOFH: if (!fn->x.stdiofh) return NULL; break;
55721+ case MTYPE_FILEDESC: if (fn->x.filedesc < 0) return NULL; break;
55722+ }
55723+
55724+ /* allocate memory for the file handle */
55725+ if (!(fh = (struct m_file *) m_alloc(self, sizeof(struct m_file)))) return NULL;
55726+
55727+ /* open or duplicate the filehandle */
55728+ switch (fn->type) {
55729+ case MTYPE_DISKFILE:
55730+ fh->x.fh = fopen(fn->x.diskfile, fmode);
55731+ break;
55732+
55733+ case MTYPE_STDIOFH:
55734+ fd = fileno(fn->x.stdiofh);
55735+ fh->x.fh = (fd >= 0) ? fdopen(fd, fmode) : NULL;
55736+ break;
55737+
55738+ case MTYPE_FILEDESC:
55739+ fh->x.fh = fdopen(fn->x.filedesc, fmode);
55740+ break;
55741+ }
55742+
55743+ /* validate the new stdio filehandle */
55744+ if (fh->x.fh) {
55745+ fh->file = fn;
55746+ }
55747+ else {
55748+ free(fh);
55749+ fh = NULL;
55750+ }
55751+
55752+ return fh;
55753+}
55754+
55755+static struct m_file *m_open(struct mspack_system *self,
55756+ struct m_filename *fn, int mode)
55757+{
55758+ if (!self || !fn) return NULL;
55759+
55760+ switch (fn->type) {
55761+ case MTYPE_DISKFILE:
55762+ case MTYPE_STDIOFH:
55763+ case MTYPE_FILEDESC:
55764+ return m_open_file(self, fn, mode);
55765+
55766+ case MTYPE_MEMORY:
55767+ return m_open_mem(self, fn, mode);
55768+ }
55769+ return NULL;
55770+}
55771+
55772+static void m_close(struct m_file *fh) {
55773+ if (!fh || !fh->file) return;
55774+ if (fh->file->type != MTYPE_MEMORY) fclose(fh->x.fh);
55775+ m_free(fh);
55776+}
55777+
55778+
55779+static int m_read(struct m_file *fh, void *buffer, int bytes) {
55780+ if (!fh || !fh->file || !buffer || bytes < 0) return -1;
55781+
55782+ if (fh->file->type == MTYPE_MEMORY) {
55783+ int count = fh->file->x.memory.length - fh->x.position;
55784+ if (count > bytes) count = bytes;
55785+ if (count > 0) {
55786+ m_copy(&fh->file->x.memory.data[fh->x.position], buffer, (size_t) count);
55787+ }
55788+ fh->x.position += count;
55789+ return count;
55790+ }
55791+ else {
55792+ size_t count = fread(buffer, 1, (size_t) bytes, fh->x.fh);
55793+ if (!ferror(fh->x.fh)) return (int) count;
55794+ }
55795+ return -1;
55796+}
55797+
55798+
55799+static int m_write(struct m_file *fh, void *buffer, int bytes) {
55800+ if (!fh || !fh->file || !buffer || bytes < 0) return -1;
55801+
55802+ if (fh->file->type == MTYPE_MEMORY) {
55803+ int count = fh->file->x.memory.length - fh->x.position;
55804+ if (count > bytes) count = bytes;
55805+ if (count > 0) {
55806+ m_copy(buffer, &fh->file->x.memory.data[fh->x.position], (size_t) count);
55807+ }
55808+ fh->x.position += count;
55809+ return count;
55810+ }
55811+ else {
55812+ size_t count = fwrite(buffer, 1, (size_t) bytes, fh->x.fh);
55813+ if (!ferror(fh->x.fh)) return (int) count;
55814+ }
55815+ return -1;
55816+}
55817+
55818+
55819+static int m_seek(struct m_file *fh, off_t offset, int mode) {
55820+ if (!fh || !fh->file) return 1;
55821+
55822+ if (fh->file->type == MTYPE_MEMORY) {
55823+ switch (mode) {
55824+ case MSPACK_SYS_SEEK_START:
55825+ break;
55826+ case MSPACK_SYS_SEEK_CUR:
55827+ offset += (off_t) fh->x.position;
55828+ break;
55829+ case MSPACK_SYS_SEEK_END:
55830+ offset += (off_t) fh->file->x.memory.length;
55831+ break;
55832+ default:
55833+ return 1;
55834+ }
55835+
55836+ if (offset < 0) return 1;
55837+ if (offset > (off_t) fh->file->x.memory.length) return 1;
55838+ fh->x.position = (size_t) offset;
55839+ return 0;
55840+ }
55841+
55842+ /* file IO based method */
55843+ switch (mode) {
55844+ case MSPACK_SYS_SEEK_START: mode = SEEK_SET; break;
55845+ case MSPACK_SYS_SEEK_CUR: mode = SEEK_CUR; break;
55846+ case MSPACK_SYS_SEEK_END: mode = SEEK_END; break;
55847+ default: return 1;
55848+ }
55849+#if HAVE_FSEEKO
55850+ return fseeko(fh->x.fh, offset, mode);
55851+#else
55852+ return fseek(fh->x.fh, offset, mode);
55853+#endif
55854+}
55855+
55856+
55857+static off_t m_tell(struct m_file *fh) {
55858+ if (!fh || !fh->file) return -1;
55859+ if (fh->file->type == MTYPE_MEMORY) {
55860+ return (off_t) fh->x.position;
55861+ }
55862+#if HAVE_FSEEKO
55863+ return (off_t) ftello(fh->x.fh);
55864+#else
55865+ return (off_t) ftell(fh->x.fh);
55866+#endif
55867+}
55868+
55869+
55870+static struct mspack_system multi_system = {
55871+ (struct mspack_file * (*)(struct mspack_system *, const char *, int)) &m_open,
55872+ (void (*)(struct mspack_file *)) &m_close,
55873+ (int (*)(struct mspack_file *, void *, int)) &m_read,
55874+ (int (*)(struct mspack_file *, void *, int)) &m_write,
55875+ (int (*)(struct mspack_file *, off_t, int)) &m_seek,
55876+ (off_t (*)(struct mspack_file *)) &m_tell,
55877+ (void (*)(struct mspack_file *, const char *, ...)) &m_msg,
55878+ &m_alloc,
55879+ &m_free,
55880+ &m_copy,
55881+ NULL
55882+};
55883+
55884+/* ------------------------------------------------------------------------ */
55885+/* constructors and destructor */
55886+
55887+const char *create_filename(const char *filename) {
55888+ struct m_filename *fn;
55889+
55890+ if (!filename) return NULL; /* filename must not be null */
55891+
55892+ if ((fn = (struct m_filename *) malloc(sizeof(struct m_filename)))) {
55893+ fn->type = MTYPE_DISKFILE;
55894+ fn->filename = filename; /* pretty-printable filename */
55895+ fn->x.diskfile = filename;
55896+ }
55897+ return (const char *) fn;
55898+}
55899+
55900+const char *create_filename_from_handle(FILE *fh) {
55901+ struct m_filename *fn;
55902+
55903+ if (!fh) return NULL; /* file handle must not be null */
55904+
55905+ if ((fn = (struct m_filename *) malloc(sizeof(struct m_filename)))) {
55906+ fn->type = MTYPE_STDIOFH;
55907+ fn->filename = NULL; /* pretty-printable filename */
55908+ fn->x.stdiofh = fh;
55909+ }
55910+ return (const char *) fn;
55911+}
55912+
55913+const char *create_filename_from_descriptor(int fd) {
55914+ struct m_filename *fn;
55915+
55916+ if (fd < 0) return NULL; /* file descriptor must be valid */
55917+
55918+ if ((fn = (struct m_filename *) malloc(sizeof(struct m_filename)))) {
55919+ fn->type = MTYPE_FILEDESC;
55920+ fn->filename = NULL; /* pretty-printable filename */
55921+ fn->x.filedesc = fd;
55922+ }
55923+ return (const char *) fn;
55924+}
55925+
55926+const char *create_filename_from_memory(void *data, size_t length) {
55927+ struct m_filename *fn;
55928+
55929+ if (!data) return NULL; /* data pointer must not be NULL */
55930+ if (length == 0) return NULL; /* length must not be zero */
55931+
55932+ if ((fn = (struct m_filename *) malloc(sizeof(struct m_filename)))) {
55933+ fn->type = MTYPE_MEMORY;
55934+ fn->filename = NULL; /* pretty-printable filename */
55935+ fn->x.memory.data = (unsigned char *) data;
55936+ fn->x.memory.length = length;
55937+ }
55938+ return (const char *) fn;
55939+}
55940+
55941+void set_filename_printable_name(const char *filename, const char *name) {
55942+ struct m_filename *fn = (struct m_filename *) filename;
55943+ if (!fn) return;
55944+ /* very basic validation of structure */
55945+ if ((fn->type < MTYPE_DISKFILE) || (fn->type > MTYPE_MEMORY)) return;
55946+ fn->filename = name;
55947+}
55948+
55949+void free_filename(const char *filename) {
55950+ free((void *) filename);
55951+}
55952+
55953+/* ------------------------------------------------------------------------ */
55954+/* example of usage with mscab_decompressor */
55955+
55956+/* a simple cabinet */
55957+static unsigned char memory_cab[] = {
55958+ 0x4D,0x53,0x43,0x46,0x00,0x00,0x00,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0x00,
55959+ 0x00,0x2C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x01,0x01,0x00,0x02,0x00,
55960+ 0x00,0x00,0x22,0x06,0x00,0x00,0x5E,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x4D,
55961+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x22,0xBA,0x59,0x20,0x00,
55962+ 0x68,0x65,0x6C,0x6C,0x6F,0x2E,0x63,0x00,0x4A,0x00,0x00,0x00,0x4D,0x00,0x00,
55963+ 0x00,0x00,0x00,0x6C,0x22,0xE7,0x59,0x20,0x00,0x77,0x65,0x6C,0x63,0x6F,0x6D,
55964+ 0x65,0x2E,0x63,0x00,0xBD,0x5A,0xA6,0x30,0x97,0x00,0x97,0x00,0x23,0x69,0x6E,
55965+ 0x63,0x6C,0x75,0x64,0x65,0x20,0x3C,0x73,0x74,0x64,0x69,0x6F,0x2E,0x68,0x3E,
55966+ 0x0D,0x0A,0x0D,0x0A,0x76,0x6F,0x69,0x64,0x20,0x6D,0x61,0x69,0x6E,0x28,0x76,
55967+ 0x6F,0x69,0x64,0x29,0x0D,0x0A,0x7B,0x0D,0x0A,0x20,0x20,0x20,0x20,0x70,0x72,
55968+ 0x69,0x6E,0x74,0x66,0x28,0x22,0x48,0x65,0x6C,0x6C,0x6F,0x2C,0x20,0x77,0x6F,
55969+ 0x72,0x6C,0x64,0x21,0x5C,0x6E,0x22,0x29,0x3B,0x0D,0x0A,0x7D,0x0D,0x0A,0x23,
55970+ 0x69,0x6E,0x63,0x6C,0x75,0x64,0x65,0x20,0x3C,0x73,0x74,0x64,0x69,0x6F,0x2E,
55971+ 0x68,0x3E,0x0D,0x0A,0x0D,0x0A,0x76,0x6F,0x69,0x64,0x20,0x6D,0x61,0x69,0x6E,
55972+ 0x28,0x76,0x6F,0x69,0x64,0x29,0x0D,0x0A,0x7B,0x0D,0x0A,0x20,0x20,0x20,0x20,
55973+ 0x70,0x72,0x69,0x6E,0x74,0x66,0x28,0x22,0x57,0x65,0x6C,0x63,0x6F,0x6D,0x65,
55974+ 0x21,0x5C,0x6E,0x22,0x29,0x3B,0x0D,0x0A,0x7D,0x0D,0x0A,0x0D,0x0A
55975+};
55976+
55977+int main() {
55978+ const char *mem_cab, *std_out, *std_err, *example;
55979+ struct mscab_decompressor *cabd;
55980+ struct mscabd_cabinet *cab;
55981+ struct mscabd_file *file;
55982+ int err;
55983+
55984+ mem_cab = create_filename_from_memory(&memory_cab[0], sizeof(memory_cab));
55985+ if (!mem_cab) exit(1);
55986+
55987+ std_out = create_filename_from_descriptor(1);
55988+ if (!std_out) exit(1);
55989+
55990+ std_err = create_filename_from_handle(stderr);
55991+ if (!std_err) exit(1);
55992+
55993+ example = create_filename("example.txt");
55994+ if (!example) exit(1);
55995+
55996+ set_filename_printable_name(mem_cab, "internal");
55997+ set_filename_printable_name(std_out, "stdout");
55998+ set_filename_printable_name(std_err, "stderr");
55999+
56000+ /* if self-test reveals an error */
56001+ MSPACK_SYS_SELFTEST(err);
56002+ if (err) exit(1);
56003+
56004+ /* create a cab decompressor using our custom mspack_system interface */
56005+ if ((cabd = mspack_create_cab_decompressor(&multi_system))) {
56006+
56007+ /* open a cab file direct from memory */
56008+ if ((cab = cabd->open(cabd, mem_cab))) {
56009+
56010+ /* first file in the cabinet: print it to stdout */
56011+ file = cab->files;
56012+ if (cabd->extract(cabd, file, std_out)) {
56013+ exit(1);
56014+ }
56015+
56016+ /* second file in the cabinet: print it to stderr */
56017+ file = file->next;
56018+ if (cabd->extract(cabd, file, std_err)) {
56019+ exit(1);
56020+ }
56021+ /* also write it to "example.txt" */
56022+ if (cabd->extract(cabd, file, example)) {
56023+ exit(1);
56024+ }
56025+ cabd->close(cabd, cab);
56026+ }
56027+ else {
56028+ fprintf(stderr, "can't open cabinet (%d)\n", cabd->last_error(cabd));
56029+ }
56030+ mspack_destroy_cab_decompressor(cabd);
56031+ }
56032+ else {
56033+ fprintf(stderr, "can't make decompressor\n");
56034+ }
56035+
56036+ free_filename(example);
56037+ free_filename(std_err);
56038+ free_filename(std_out);
56039+ free_filename(mem_cab);
56040+
56041+ return 0;
56042+
56043+}
56044diff --git a/libclamav/libmspack-0.4alpha/test/oabx.c b/libclamav/libmspack-0.4alpha/test/oabx.c
56045new file mode 100644
56046index 000000000000..53f675c68219
56047--- /dev/null
56048+++ b/libclamav/libmspack-0.4alpha/test/oabx.c
56049@@ -0,0 +1,41 @@
56050+#ifdef HAVE_CONFIG_H
56051+#include <config.h>
56052+#endif
56053+
56054+#include <stdio.h>
56055+#include <stdlib.h>
56056+#include <string.h>
56057+#include <mspack.h>
56058+
56059+#include <error.h>
56060+
56061+int main(int argc, char *argv[]) {
56062+ struct msoab_decompressor *oabd;
56063+ int err;
56064+
56065+ setbuf(stdout, NULL);
56066+ setbuf(stderr, NULL);
56067+
56068+ MSPACK_SYS_SELFTEST(err);
56069+ if (err) return 0;
56070+
56071+ if ((oabd = mspack_create_oab_decompressor(NULL))) {
56072+ if (argc == 3) {
56073+ err = oabd->decompress(oabd, argv[1], argv[2]);
56074+ if (err) fprintf(stderr, "%s -> %s: %s\n", argv[1], argv[2], error_msg(err));
56075+ }
56076+ else if (argc == 4) {
56077+ err = oabd->decompress_incremental(oabd, argv[2], argv[1], argv[3]);
56078+ if (err) fprintf(stderr, "%s + %s -> %s: %s\n", argv[1], argv[2], argv[3], error_msg(err));
56079+ }
56080+ else {
56081+ fprintf(stderr, "Usage: %s <input> <output>\n", *argv);
56082+ fprintf(stderr, " or %s <base> <patch> <output>\n", *argv);
56083+ }
56084+ mspack_destroy_oab_decompressor(oabd);
56085+ }
56086+ else {
56087+ fprintf(stderr, "%s: can't make OAB decompressor\n", *argv);
56088+ }
56089+ return 0;
56090+}