Codebase list libatasmart / b7607a7
Imported Upstream version 0.13 Michael Biebl 14 years ago
35 changed file(s) with 51476 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
+510
-0
LGPL less more
0
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 2.1, February 1999
3
4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 [This is the first released version of the Lesser GPL. It also counts
10 as the successor of the GNU Library Public License, version 2, hence
11 the version number 2.1.]
12
13 Preamble
14
15 The licenses for most software are designed to take away your
16 freedom to share and change it. By contrast, the GNU General Public
17 Licenses are intended to guarantee your freedom to share and change
18 free software--to make sure the software is free for all its users.
19
20 This license, the Lesser General Public License, applies to some
21 specially designated software packages--typically libraries--of the
22 Free Software Foundation and other authors who decide to use it. You
23 can use it too, but we suggest you first think carefully about whether
24 this license or the ordinary General Public License is the better
25 strategy to use in any particular case, based on the explanations
26 below.
27
28 When we speak of free software, we are referring to freedom of use,
29 not price. Our General Public Licenses are designed to make sure that
30 you have the freedom to distribute copies of free software (and charge
31 for this service if you wish); that you receive source code or can get
32 it if you want it; that you can change the software and use pieces of
33 it in new free programs; and that you are informed that you can do
34 these things.
35
36 To protect your rights, we need to make restrictions that forbid
37 distributors to deny you these rights or to ask you to surrender these
38 rights. These restrictions translate to certain responsibilities for
39 you if you distribute copies of the library or if you modify it.
40
41 For example, if you distribute copies of the library, whether gratis
42 or for a fee, you must give the recipients all the rights that we gave
43 you. You must make sure that they, too, receive or can get the source
44 code. If you link other code with the library, you must provide
45 complete object files to the recipients, so that they can relink them
46 with the library after making changes to the library and recompiling
47 it. And you must show them these terms so they know their rights.
48
49 We protect your rights with a two-step method: (1) we copyright the
50 library, and (2) we offer you this license, which gives you legal
51 permission to copy, distribute and/or modify the library.
52
53 To protect each distributor, we want to make it very clear that
54 there is no warranty for the free library. Also, if the library is
55 modified by someone else and passed on, the recipients should know
56 that what they have is not the original version, so that the original
57 author's reputation will not be affected by problems that might be
58 introduced by others.
59
60 Finally, software patents pose a constant threat to the existence of
61 any free program. We wish to make sure that a company cannot
62 effectively restrict the users of a free program by obtaining a
63 restrictive license from a patent holder. Therefore, we insist that
64 any patent license obtained for a version of the library must be
65 consistent with the full freedom of use specified in this license.
66
67 Most GNU software, including some libraries, is covered by the
68 ordinary GNU General Public License. This license, the GNU Lesser
69 General Public License, applies to certain designated libraries, and
70 is quite different from the ordinary General Public License. We use
71 this license for certain libraries in order to permit linking those
72 libraries into non-free programs.
73
74 When a program is linked with a library, whether statically or using
75 a shared library, the combination of the two is legally speaking a
76 combined work, a derivative of the original library. The ordinary
77 General Public License therefore permits such linking only if the
78 entire combination fits its criteria of freedom. The Lesser General
79 Public License permits more lax criteria for linking other code with
80 the library.
81
82 We call this license the "Lesser" General Public License because it
83 does Less to protect the user's freedom than the ordinary General
84 Public License. It also provides other free software developers Less
85 of an advantage over competing non-free programs. These disadvantages
86 are the reason we use the ordinary General Public License for many
87 libraries. However, the Lesser license provides advantages in certain
88 special circumstances.
89
90 For example, on rare occasions, there may be a special need to
91 encourage the widest possible use of a certain library, so that it
92 becomes a de-facto standard. To achieve this, non-free programs must
93 be allowed to use the library. A more frequent case is that a free
94 library does the same job as widely used non-free libraries. In this
95 case, there is little to gain by limiting the free library to free
96 software only, so we use the Lesser General Public License.
97
98 In other cases, permission to use a particular library in non-free
99 programs enables a greater number of people to use a large body of
100 free software. For example, permission to use the GNU C Library in
101 non-free programs enables many more people to use the whole GNU
102 operating system, as well as its variant, the GNU/Linux operating
103 system.
104
105 Although the Lesser General Public License is Less protective of the
106 users' freedom, it does ensure that the user of a program that is
107 linked with the Library has the freedom and the wherewithal to run
108 that program using a modified version of the Library.
109
110 The precise terms and conditions for copying, distribution and
111 modification follow. Pay close attention to the difference between a
112 "work based on the library" and a "work that uses the library". The
113 former contains code derived from the library, whereas the latter must
114 be combined with the library in order to run.
115
116 GNU LESSER GENERAL PUBLIC LICENSE
117 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
118
119 0. This License Agreement applies to any software library or other
120 program which contains a notice placed by the copyright holder or
121 other authorized party saying it may be distributed under the terms of
122 this Lesser General Public License (also called "this License").
123 Each licensee is addressed as "you".
124
125 A "library" means a collection of software functions and/or data
126 prepared so as to be conveniently linked with application programs
127 (which use some of those functions and data) to form executables.
128
129 The "Library", below, refers to any such software library or work
130 which has been distributed under these terms. A "work based on the
131 Library" means either the Library or any derivative work under
132 copyright law: that is to say, a work containing the Library or a
133 portion of it, either verbatim or with modifications and/or translated
134 straightforwardly into another language. (Hereinafter, translation is
135 included without limitation in the term "modification".)
136
137 "Source code" for a work means the preferred form of the work for
138 making modifications to it. For a library, complete source code means
139 all the source code for all modules it contains, plus any associated
140 interface definition files, plus the scripts used to control
141 compilation and installation of the library.
142
143 Activities other than copying, distribution and modification are not
144 covered by this License; they are outside its scope. The act of
145 running a program using the Library is not restricted, and output from
146 such a program is covered only if its contents constitute a work based
147 on the Library (independent of the use of the Library in a tool for
148 writing it). Whether that is true depends on what the Library does
149 and what the program that uses the Library does.
150
151 1. You may copy and distribute verbatim copies of the Library's
152 complete source code as you receive it, in any medium, provided that
153 you conspicuously and appropriately publish on each copy an
154 appropriate copyright notice and disclaimer of warranty; keep intact
155 all the notices that refer to this License and to the absence of any
156 warranty; and distribute a copy of this License along with the
157 Library.
158
159 You may charge a fee for the physical act of transferring a copy,
160 and you may at your option offer warranty protection in exchange for a
161 fee.
162
163 2. You may modify your copy or copies of the Library or any portion
164 of it, thus forming a work based on the Library, and copy and
165 distribute such modifications or work under the terms of Section 1
166 above, provided that you also meet all of these conditions:
167
168 a) The modified work must itself be a software library.
169
170 b) You must cause the files modified to carry prominent notices
171 stating that you changed the files and the date of any change.
172
173 c) You must cause the whole of the work to be licensed at no
174 charge to all third parties under the terms of this License.
175
176 d) If a facility in the modified Library refers to a function or a
177 table of data to be supplied by an application program that uses
178 the facility, other than as an argument passed when the facility
179 is invoked, then you must make a good faith effort to ensure that,
180 in the event an application does not supply such function or
181 table, the facility still operates, and performs whatever part of
182 its purpose remains meaningful.
183
184 (For example, a function in a library to compute square roots has
185 a purpose that is entirely well-defined independent of the
186 application. Therefore, Subsection 2d requires that any
187 application-supplied function or table used by this function must
188 be optional: if the application does not supply it, the square
189 root function must still compute square roots.)
190
191 These requirements apply to the modified work as a whole. If
192 identifiable sections of that work are not derived from the Library,
193 and can be reasonably considered independent and separate works in
194 themselves, then this License, and its terms, do not apply to those
195 sections when you distribute them as separate works. But when you
196 distribute the same sections as part of a whole which is a work based
197 on the Library, the distribution of the whole must be on the terms of
198 this License, whose permissions for other licensees extend to the
199 entire whole, and thus to each and every part regardless of who wrote
200 it.
201
202 Thus, it is not the intent of this section to claim rights or contest
203 your rights to work written entirely by you; rather, the intent is to
204 exercise the right to control the distribution of derivative or
205 collective works based on the Library.
206
207 In addition, mere aggregation of another work not based on the Library
208 with the Library (or with a work based on the Library) on a volume of
209 a storage or distribution medium does not bring the other work under
210 the scope of this License.
211
212 3. You may opt to apply the terms of the ordinary GNU General Public
213 License instead of this License to a given copy of the Library. To do
214 this, you must alter all the notices that refer to this License, so
215 that they refer to the ordinary GNU General Public License, version 2,
216 instead of to this License. (If a newer version than version 2 of the
217 ordinary GNU General Public License has appeared, then you can specify
218 that version instead if you wish.) Do not make any other change in
219 these notices.
220
221 Once this change is made in a given copy, it is irreversible for
222 that copy, so the ordinary GNU General Public License applies to all
223 subsequent copies and derivative works made from that copy.
224
225 This option is useful when you wish to copy part of the code of
226 the Library into a program that is not a library.
227
228 4. You may copy and distribute the Library (or a portion or
229 derivative of it, under Section 2) in object code or executable form
230 under the terms of Sections 1 and 2 above provided that you accompany
231 it with the complete corresponding machine-readable source code, which
232 must be distributed under the terms of Sections 1 and 2 above on a
233 medium customarily used for software interchange.
234
235 If distribution of object code is made by offering access to copy
236 from a designated place, then offering equivalent access to copy the
237 source code from the same place satisfies the requirement to
238 distribute the source code, even though third parties are not
239 compelled to copy the source along with the object code.
240
241 5. A program that contains no derivative of any portion of the
242 Library, but is designed to work with the Library by being compiled or
243 linked with it, is called a "work that uses the Library". Such a
244 work, in isolation, is not a derivative work of the Library, and
245 therefore falls outside the scope of this License.
246
247 However, linking a "work that uses the Library" with the Library
248 creates an executable that is a derivative of the Library (because it
249 contains portions of the Library), rather than a "work that uses the
250 library". The executable is therefore covered by this License.
251 Section 6 states terms for distribution of such executables.
252
253 When a "work that uses the Library" uses material from a header file
254 that is part of the Library, the object code for the work may be a
255 derivative work of the Library even though the source code is not.
256 Whether this is true is especially significant if the work can be
257 linked without the Library, or if the work is itself a library. The
258 threshold for this to be true is not precisely defined by law.
259
260 If such an object file uses only numerical parameters, data
261 structure layouts and accessors, and small macros and small inline
262 functions (ten lines or less in length), then the use of the object
263 file is unrestricted, regardless of whether it is legally a derivative
264 work. (Executables containing this object code plus portions of the
265 Library will still fall under Section 6.)
266
267 Otherwise, if the work is a derivative of the Library, you may
268 distribute the object code for the work under the terms of Section 6.
269 Any executables containing that work also fall under Section 6,
270 whether or not they are linked directly with the Library itself.
271
272 6. As an exception to the Sections above, you may also combine or
273 link a "work that uses the Library" with the Library to produce a
274 work containing portions of the Library, and distribute that work
275 under terms of your choice, provided that the terms permit
276 modification of the work for the customer's own use and reverse
277 engineering for debugging such modifications.
278
279 You must give prominent notice with each copy of the work that the
280 Library is used in it and that the Library and its use are covered by
281 this License. You must supply a copy of this License. If the work
282 during execution displays copyright notices, you must include the
283 copyright notice for the Library among them, as well as a reference
284 directing the user to the copy of this License. Also, you must do one
285 of these things:
286
287 a) Accompany the work with the complete corresponding
288 machine-readable source code for the Library including whatever
289 changes were used in the work (which must be distributed under
290 Sections 1 and 2 above); and, if the work is an executable linked
291 with the Library, with the complete machine-readable "work that
292 uses the Library", as object code and/or source code, so that the
293 user can modify the Library and then relink to produce a modified
294 executable containing the modified Library. (It is understood
295 that the user who changes the contents of definitions files in the
296 Library will not necessarily be able to recompile the application
297 to use the modified definitions.)
298
299 b) Use a suitable shared library mechanism for linking with the
300 Library. A suitable mechanism is one that (1) uses at run time a
301 copy of the library already present on the user's computer system,
302 rather than copying library functions into the executable, and (2)
303 will operate properly with a modified version of the library, if
304 the user installs one, as long as the modified version is
305 interface-compatible with the version that the work was made with.
306
307 c) Accompany the work with a written offer, valid for at least
308 three years, to give the same user the materials specified in
309 Subsection 6a, above, for a charge no more than the cost of
310 performing this distribution.
311
312 d) If distribution of the work is made by offering access to copy
313 from a designated place, offer equivalent access to copy the above
314 specified materials from the same place.
315
316 e) Verify that the user has already received a copy of these
317 materials or that you have already sent this user a copy.
318
319 For an executable, the required form of the "work that uses the
320 Library" must include any data and utility programs needed for
321 reproducing the executable from it. However, as a special exception,
322 the materials to be distributed need not include anything that is
323 normally distributed (in either source or binary form) with the major
324 components (compiler, kernel, and so on) of the operating system on
325 which the executable runs, unless that component itself accompanies
326 the executable.
327
328 It may happen that this requirement contradicts the license
329 restrictions of other proprietary libraries that do not normally
330 accompany the operating system. Such a contradiction means you cannot
331 use both them and the Library together in an executable that you
332 distribute.
333
334 7. You may place library facilities that are a work based on the
335 Library side-by-side in a single library together with other library
336 facilities not covered by this License, and distribute such a combined
337 library, provided that the separate distribution of the work based on
338 the Library and of the other library facilities is otherwise
339 permitted, and provided that you do these two things:
340
341 a) Accompany the combined library with a copy of the same work
342 based on the Library, uncombined with any other library
343 facilities. This must be distributed under the terms of the
344 Sections above.
345
346 b) Give prominent notice with the combined library of the fact
347 that part of it is a work based on the Library, and explaining
348 where to find the accompanying uncombined form of the same work.
349
350 8. You may not copy, modify, sublicense, link with, or distribute
351 the Library except as expressly provided under this License. Any
352 attempt otherwise to copy, modify, sublicense, link with, or
353 distribute the Library is void, and will automatically terminate your
354 rights under this License. However, parties who have received copies,
355 or rights, from you under this License will not have their licenses
356 terminated so long as such parties remain in full compliance.
357
358 9. You are not required to accept this License, since you have not
359 signed it. However, nothing else grants you permission to modify or
360 distribute the Library or its derivative works. These actions are
361 prohibited by law if you do not accept this License. Therefore, by
362 modifying or distributing the Library (or any work based on the
363 Library), you indicate your acceptance of this License to do so, and
364 all its terms and conditions for copying, distributing or modifying
365 the Library or works based on it.
366
367 10. Each time you redistribute the Library (or any work based on the
368 Library), the recipient automatically receives a license from the
369 original licensor to copy, distribute, link with or modify the Library
370 subject to these terms and conditions. You may not impose any further
371 restrictions on the recipients' exercise of the rights granted herein.
372 You are not responsible for enforcing compliance by third parties with
373 this License.
374
375 11. If, as a consequence of a court judgment or allegation of patent
376 infringement or for any other reason (not limited to patent issues),
377 conditions are imposed on you (whether by court order, agreement or
378 otherwise) that contradict the conditions of this License, they do not
379 excuse you from the conditions of this License. If you cannot
380 distribute so as to satisfy simultaneously your obligations under this
381 License and any other pertinent obligations, then as a consequence you
382 may not distribute the Library at all. For example, if a patent
383 license would not permit royalty-free redistribution of the Library by
384 all those who receive copies directly or indirectly through you, then
385 the only way you could satisfy both it and this License would be to
386 refrain entirely from distribution of the Library.
387
388 If any portion of this section is held invalid or unenforceable under
389 any particular circumstance, the balance of the section is intended to
390 apply, and the section as a whole is intended to apply in other
391 circumstances.
392
393 It is not the purpose of this section to induce you to infringe any
394 patents or other property right claims or to contest validity of any
395 such claims; this section has the sole purpose of protecting the
396 integrity of the free software distribution system which is
397 implemented by public license practices. Many people have made
398 generous contributions to the wide range of software distributed
399 through that system in reliance on consistent application of that
400 system; it is up to the author/donor to decide if he or she is willing
401 to distribute software through any other system and a licensee cannot
402 impose that choice.
403
404 This section is intended to make thoroughly clear what is believed to
405 be a consequence of the rest of this License.
406
407 12. If the distribution and/or use of the Library is restricted in
408 certain countries either by patents or by copyrighted interfaces, the
409 original copyright holder who places the Library under this License
410 may add an explicit geographical distribution limitation excluding those
411 countries, so that distribution is permitted only in or among
412 countries not thus excluded. In such case, this License incorporates
413 the limitation as if written in the body of this License.
414
415 13. The Free Software Foundation may publish revised and/or new
416 versions of the Lesser General Public License from time to time.
417 Such new versions will be similar in spirit to the present version,
418 but may differ in detail to address new problems or concerns.
419
420 Each version is given a distinguishing version number. If the Library
421 specifies a version number of this License which applies to it and
422 "any later version", you have the option of following the terms and
423 conditions either of that version or of any later version published by
424 the Free Software Foundation. If the Library does not specify a
425 license version number, you may choose any version ever published by
426 the Free Software Foundation.
427
428 14. If you wish to incorporate parts of the Library into other free
429 programs whose distribution conditions are incompatible with these,
430 write to the author to ask for permission. For software which is
431 copyrighted by the Free Software Foundation, write to the Free
432 Software Foundation; we sometimes make exceptions for this. Our
433 decision will be guided by the two goals of preserving the free status
434 of all derivatives of our free software and of promoting the sharing
435 and reuse of software generally.
436
437 NO WARRANTY
438
439 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
440 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
441 EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
442 OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
443 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
444 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
445 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
446 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
447 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
448
449 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
450 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
451 AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
452 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
453 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
454 LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
455 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
456 FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
457 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
458 DAMAGES.
459
460 END OF TERMS AND CONDITIONS
461
462 How to Apply These Terms to Your New Libraries
463
464 If you develop a new library, and you want it to be of the greatest
465 possible use to the public, we recommend making it free software that
466 everyone can redistribute and change. You can do so by permitting
467 redistribution under these terms (or, alternatively, under the terms
468 of the ordinary General Public License).
469
470 To apply these terms, attach the following notices to the library.
471 It is safest to attach them to the start of each source file to most
472 effectively convey the exclusion of warranty; and each file should
473 have at least the "copyright" line and a pointer to where the full
474 notice is found.
475
476
477 <one line to give the library's name and a brief idea of what it does.>
478 Copyright (C) <year> <name of author>
479
480 This library is free software; you can redistribute it and/or
481 modify it under the terms of the GNU Lesser General Public
482 License as published by the Free Software Foundation; either
483 version 2.1 of the License, or (at your option) any later version.
484
485 This library is distributed in the hope that it will be useful,
486 but WITHOUT ANY WARRANTY; without even the implied warranty of
487 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
488 Lesser General Public License for more details.
489
490 You should have received a copy of the GNU Lesser General Public
491 License along with this library; if not, write to the Free Software
492 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
493
494 Also add information on how to contact you by electronic and paper mail.
495
496 You should also get your employer (if you work as a programmer) or
497 your school, if any, to sign a "copyright disclaimer" for the library,
498 if necessary. Here is a sample; alter the names:
499
500 Yoyodyne, Inc., hereby disclaims all copyright interest in the
501 library `Frob' (a library for tweaking knobs) written by James
502 Random Hacker.
503
504 <signature of Ty Coon>, 1 April 1990
505 Ty Coon, President of Vice
506
507 That's all there is to it!
508
509
0 # This file is part of libatasmart.
1 #
2 # Copyright 2008 Lennart Poettering
3 #
4 # libatasmart is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU Lesser General Public License as
6 # published by the Free Software Foundation, either version 2.1 of the
7 # License, or (at your option) any later version.
8 #
9 # libatasmart is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with libatasmart. If not, If not, see
16 # <http://www.gnu.org/licenses/>.
17
18 EXTRA_DIST = \
19 bootstrap.sh \
20 LGPL \
21 README \
22 atasmart.vapi \
23 atasmart.c \
24 blob-examples/README \
25 blob-examples/FUJITSU_MHY2120BH--0084000D \
26 blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \
27 blob-examples/Maxtor_96147H8--BAC51KJ0 \
28 blob-examples/SAMSUNG_HD501LJ--CR100-12 \
29 blob-examples/ST320410A--3.39 \
30 blob-examples/ST9160821AS--3.CLH \
31 blob-examples/WDC_WD2500JB--00REA0-20.00K20 \
32 blob-examples/WDC_WD2500JS-75NCB3--10.02E04 \
33 blob-examples/WDC_WD5000AAKS--00TMA0-12.01C01
34
35 SUBDIRS =
36
37 CLEANFILES = atasmart.strpool.c
38
39 MAINTAINERCLEANFILES =
40 noinst_DATA =
41
42 pkgconfigdir = $(libdir)/pkgconfig
43 pkgconfig_DATA = libatasmart.pc
44
45 include_HEADERS = \
46 atasmart.h
47
48 sbin_PROGRAMS = \
49 skdump \
50 sktest
51
52 noinst_PROGRAMS = \
53 strpool
54
55 lib_LTLIBRARIES = \
56 libatasmart.la
57
58 skdump_SOURCES = \
59 skdump.c
60 skdump_LDADD = \
61 libatasmart.la
62
63 sktest_SOURCE = \
64 sktest.c
65 sktest_LDADD = \
66 libatasmart.la
67
68 libatasmart_la_SOURCES = \
69 atasmart.strpool.c atasmart.h
70 libatasmart_la_LDFLAGS = \
71 -version-info $(LIBATASMART_VERSION_INFO)
72 libatasmart_la_LIBADD = \
73 $(LIBUDEV_LIBS)
74 libatasmart_la_CFLAGS = \
75 $(LIBUDEV_CFLAGS)
76
77 strpool_SOURCES = \
78 strpool.c
79
80 BUILT_SOURCES = \
81 atasmart.strpool.c
82
83 atasmart.strpool.c: atasmart.c strpool
84 $(top_builddir)/strpool $< $@
0 # Makefile.in generated by automake 1.10.2 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 # This file is part of libatasmart.
17 #
18 # Copyright 2008 Lennart Poettering
19 #
20 # libatasmart is free software; you can redistribute it and/or modify
21 # it under the terms of the GNU Lesser General Public License as
22 # published by the Free Software Foundation, either version 2.1 of the
23 # License, or (at your option) any later version.
24 #
25 # libatasmart is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 # Lesser General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public
31 # License along with libatasmart. If not, If not, see
32 # <http://www.gnu.org/licenses/>.
33
34
35
36
37 VPATH = @srcdir@
38 pkgdatadir = $(datadir)/@PACKAGE@
39 pkglibdir = $(libdir)/@PACKAGE@
40 pkgincludedir = $(includedir)/@PACKAGE@
41 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
42 install_sh_DATA = $(install_sh) -c -m 644
43 install_sh_PROGRAM = $(install_sh) -c
44 install_sh_SCRIPT = $(install_sh) -c
45 INSTALL_HEADER = $(INSTALL_DATA)
46 transform = $(program_transform_name)
47 NORMAL_INSTALL = :
48 PRE_INSTALL = :
49 POST_INSTALL = :
50 NORMAL_UNINSTALL = :
51 PRE_UNINSTALL = :
52 POST_UNINSTALL = :
53 build_triplet = @build@
54 host_triplet = @host@
55 sbin_PROGRAMS = skdump$(EXEEXT) sktest$(EXEEXT)
56 noinst_PROGRAMS = strpool$(EXEEXT)
57 subdir = .
58 DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
59 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
60 $(srcdir)/config.h.in $(srcdir)/libatasmart.pc.in \
61 $(top_srcdir)/configure compile config.guess config.rpath \
62 config.sub depcomp install-sh ltmain.sh missing
63 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
64 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
65 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
66 $(ACLOCAL_M4)
67 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
68 configure.lineno config.status.lineno
69 mkinstalldirs = $(install_sh) -d
70 CONFIG_HEADER = config.h
71 CONFIG_CLEAN_FILES = libatasmart.pc
72 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
73 am__vpath_adj = case $$p in \
74 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
75 *) f=$$p;; \
76 esac;
77 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
78 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" \
79 "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"
80 libLTLIBRARIES_INSTALL = $(INSTALL)
81 LTLIBRARIES = $(lib_LTLIBRARIES)
82 am__DEPENDENCIES_1 =
83 libatasmart_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
84 am_libatasmart_la_OBJECTS = libatasmart_la-atasmart.strpool.lo
85 libatasmart_la_OBJECTS = $(am_libatasmart_la_OBJECTS)
86 libatasmart_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
87 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libatasmart_la_CFLAGS) \
88 $(CFLAGS) $(libatasmart_la_LDFLAGS) $(LDFLAGS) -o $@
89 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
90 PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
91 am_skdump_OBJECTS = skdump.$(OBJEXT)
92 skdump_OBJECTS = $(am_skdump_OBJECTS)
93 skdump_DEPENDENCIES = libatasmart.la
94 sktest_SOURCES = sktest.c
95 sktest_OBJECTS = sktest.$(OBJEXT)
96 sktest_DEPENDENCIES = libatasmart.la
97 am_strpool_OBJECTS = strpool.$(OBJEXT)
98 strpool_OBJECTS = $(am_strpool_OBJECTS)
99 strpool_LDADD = $(LDADD)
100 DEFAULT_INCLUDES = -I.@am__isrc@
101 depcomp = $(SHELL) $(top_srcdir)/depcomp
102 am__depfiles_maybe = depfiles
103 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
104 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
105 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
106 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
107 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
108 CCLD = $(CC)
109 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
110 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
111 $(LDFLAGS) -o $@
112 SOURCES = $(libatasmart_la_SOURCES) $(skdump_SOURCES) sktest.c \
113 $(strpool_SOURCES)
114 DIST_SOURCES = $(libatasmart_la_SOURCES) $(skdump_SOURCES) sktest.c \
115 $(strpool_SOURCES)
116 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
117 html-recursive info-recursive install-data-recursive \
118 install-dvi-recursive install-exec-recursive \
119 install-html-recursive install-info-recursive \
120 install-pdf-recursive install-ps-recursive install-recursive \
121 installcheck-recursive installdirs-recursive pdf-recursive \
122 ps-recursive uninstall-recursive
123 pkgconfigDATA_INSTALL = $(INSTALL_DATA)
124 DATA = $(noinst_DATA) $(pkgconfig_DATA)
125 includeHEADERS_INSTALL = $(INSTALL_HEADER)
126 HEADERS = $(include_HEADERS)
127 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
128 distclean-recursive maintainer-clean-recursive
129 ETAGS = etags
130 CTAGS = ctags
131 DIST_SUBDIRS = $(SUBDIRS)
132 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
133 distdir = $(PACKAGE)-$(VERSION)
134 top_distdir = $(distdir)
135 am__remove_distdir = \
136 { test ! -d $(distdir) \
137 || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
138 && rm -fr $(distdir); }; }
139 DIST_ARCHIVES = $(distdir).tar.gz
140 GZIP_ENV = --best
141 distuninstallcheck_listfiles = find . -type f -print
142 distcleancheck_listfiles = find . -type f -print
143 ACLOCAL = @ACLOCAL@
144 AMTAR = @AMTAR@
145 AR = @AR@
146 AUTOCONF = @AUTOCONF@
147 AUTOHEADER = @AUTOHEADER@
148 AUTOMAKE = @AUTOMAKE@
149 AWK = @AWK@
150 CC = @CC@
151 CCDEPMODE = @CCDEPMODE@
152 CFLAGS = @CFLAGS@
153 CPP = @CPP@
154 CPPFLAGS = @CPPFLAGS@
155 CXX = @CXX@
156 CXXCPP = @CXXCPP@
157 CXXDEPMODE = @CXXDEPMODE@
158 CXXFLAGS = @CXXFLAGS@
159 CYGPATH_W = @CYGPATH_W@
160 DEFS = @DEFS@
161 DEPDIR = @DEPDIR@
162 DSYMUTIL = @DSYMUTIL@
163 DUMPBIN = @DUMPBIN@
164 ECHO_C = @ECHO_C@
165 ECHO_N = @ECHO_N@
166 ECHO_T = @ECHO_T@
167 EGREP = @EGREP@
168 EXEEXT = @EXEEXT@
169 FGREP = @FGREP@
170 GREP = @GREP@
171 INSTALL = @INSTALL@
172 INSTALL_DATA = @INSTALL_DATA@
173 INSTALL_PROGRAM = @INSTALL_PROGRAM@
174 INSTALL_SCRIPT = @INSTALL_SCRIPT@
175 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
176 LD = @LD@
177 LDFLAGS = @LDFLAGS@
178 LIBATASMART_VERSION_INFO = @LIBATASMART_VERSION_INFO@
179 LIBOBJS = @LIBOBJS@
180 LIBS = @LIBS@
181 LIBTOOL = @LIBTOOL@
182 LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
183 LIBUDEV_LIBS = @LIBUDEV_LIBS@
184 LIPO = @LIPO@
185 LN_S = @LN_S@
186 LTLIBOBJS = @LTLIBOBJS@
187 MAKEINFO = @MAKEINFO@
188 MKDIR_P = @MKDIR_P@
189 NM = @NM@
190 NMEDIT = @NMEDIT@
191 OBJDUMP = @OBJDUMP@
192 OBJEXT = @OBJEXT@
193 OTOOL = @OTOOL@
194 OTOOL64 = @OTOOL64@
195 PACKAGE = @PACKAGE@
196 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
197 PACKAGE_NAME = @PACKAGE_NAME@
198 PACKAGE_STRING = @PACKAGE_STRING@
199 PACKAGE_TARNAME = @PACKAGE_TARNAME@
200 PACKAGE_URL = @PACKAGE_URL@
201 PACKAGE_VERSION = @PACKAGE_VERSION@
202 PATH_SEPARATOR = @PATH_SEPARATOR@
203 PKG_CONFIG = @PKG_CONFIG@
204 RANLIB = @RANLIB@
205 SED = @SED@
206 SET_MAKE = @SET_MAKE@
207 SHELL = @SHELL@
208 STRIP = @STRIP@
209 VERSION = @VERSION@
210 abs_builddir = @abs_builddir@
211 abs_srcdir = @abs_srcdir@
212 abs_top_builddir = @abs_top_builddir@
213 abs_top_srcdir = @abs_top_srcdir@
214 ac_ct_CC = @ac_ct_CC@
215 ac_ct_CXX = @ac_ct_CXX@
216 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
217 am__include = @am__include@
218 am__leading_dot = @am__leading_dot@
219 am__quote = @am__quote@
220 am__tar = @am__tar@
221 am__untar = @am__untar@
222 bindir = @bindir@
223 build = @build@
224 build_alias = @build_alias@
225 build_cpu = @build_cpu@
226 build_os = @build_os@
227 build_vendor = @build_vendor@
228 builddir = @builddir@
229 datadir = @datadir@
230 datarootdir = @datarootdir@
231 docdir = @docdir@
232 dvidir = @dvidir@
233 exec_prefix = @exec_prefix@
234 host = @host@
235 host_alias = @host_alias@
236 host_cpu = @host_cpu@
237 host_os = @host_os@
238 host_vendor = @host_vendor@
239 htmldir = @htmldir@
240 includedir = @includedir@
241 infodir = @infodir@
242 install_sh = @install_sh@
243 libdir = @libdir@
244 libexecdir = @libexecdir@
245 localedir = @localedir@
246 localstatedir = @localstatedir@
247 lt_ECHO = @lt_ECHO@
248 mandir = @mandir@
249 mkdir_p = @mkdir_p@
250 oldincludedir = @oldincludedir@
251 pdfdir = @pdfdir@
252 prefix = @prefix@
253 program_transform_name = @program_transform_name@
254 psdir = @psdir@
255 sbindir = @sbindir@
256 sharedstatedir = @sharedstatedir@
257 srcdir = @srcdir@
258 sysconfdir = @sysconfdir@
259 target_alias = @target_alias@
260 top_build_prefix = @top_build_prefix@
261 top_builddir = @top_builddir@
262 top_srcdir = @top_srcdir@
263 EXTRA_DIST = \
264 bootstrap.sh \
265 LGPL \
266 README \
267 atasmart.vapi \
268 atasmart.c \
269 blob-examples/README \
270 blob-examples/FUJITSU_MHY2120BH--0084000D \
271 blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \
272 blob-examples/Maxtor_96147H8--BAC51KJ0 \
273 blob-examples/SAMSUNG_HD501LJ--CR100-12 \
274 blob-examples/ST320410A--3.39 \
275 blob-examples/ST9160821AS--3.CLH \
276 blob-examples/WDC_WD2500JB--00REA0-20.00K20 \
277 blob-examples/WDC_WD2500JS-75NCB3--10.02E04 \
278 blob-examples/WDC_WD5000AAKS--00TMA0-12.01C01
279
280 SUBDIRS =
281 CLEANFILES = atasmart.strpool.c
282 MAINTAINERCLEANFILES =
283 noinst_DATA =
284 pkgconfigdir = $(libdir)/pkgconfig
285 pkgconfig_DATA = libatasmart.pc
286 include_HEADERS = \
287 atasmart.h
288
289 lib_LTLIBRARIES = \
290 libatasmart.la
291
292 skdump_SOURCES = \
293 skdump.c
294
295 skdump_LDADD = \
296 libatasmart.la
297
298 sktest_SOURCE = \
299 sktest.c
300
301 sktest_LDADD = \
302 libatasmart.la
303
304 libatasmart_la_SOURCES = \
305 atasmart.strpool.c atasmart.h
306
307 libatasmart_la_LDFLAGS = \
308 -version-info $(LIBATASMART_VERSION_INFO)
309
310 libatasmart_la_LIBADD = \
311 $(LIBUDEV_LIBS)
312
313 libatasmart_la_CFLAGS = \
314 $(LIBUDEV_CFLAGS)
315
316 strpool_SOURCES = \
317 strpool.c
318
319 BUILT_SOURCES = \
320 atasmart.strpool.c
321
322 all: $(BUILT_SOURCES) config.h
323 $(MAKE) $(AM_MAKEFLAGS) all-recursive
324
325 .SUFFIXES:
326 .SUFFIXES: .c .lo .o .obj
327 am--refresh:
328 @:
329 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
330 @for dep in $?; do \
331 case '$(am__configure_deps)' in \
332 *$$dep*) \
333 echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
334 cd $(srcdir) && $(AUTOMAKE) --foreign \
335 && exit 0; \
336 exit 1;; \
337 esac; \
338 done; \
339 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
340 cd $(top_srcdir) && \
341 $(AUTOMAKE) --foreign Makefile
342 .PRECIOUS: Makefile
343 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
344 @case '$?' in \
345 *config.status*) \
346 echo ' $(SHELL) ./config.status'; \
347 $(SHELL) ./config.status;; \
348 *) \
349 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
350 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
351 esac;
352
353 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
354 $(SHELL) ./config.status --recheck
355
356 $(top_srcdir)/configure: $(am__configure_deps)
357 cd $(srcdir) && $(AUTOCONF)
358 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
359 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
360
361 config.h: stamp-h1
362 @if test ! -f $@; then \
363 rm -f stamp-h1; \
364 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
365 else :; fi
366
367 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
368 @rm -f stamp-h1
369 cd $(top_builddir) && $(SHELL) ./config.status config.h
370 $(srcdir)/config.h.in: $(am__configure_deps)
371 cd $(top_srcdir) && $(AUTOHEADER)
372 rm -f stamp-h1
373 touch $@
374
375 distclean-hdr:
376 -rm -f config.h stamp-h1
377 libatasmart.pc: $(top_builddir)/config.status $(srcdir)/libatasmart.pc.in
378 cd $(top_builddir) && $(SHELL) ./config.status $@
379 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
380 @$(NORMAL_INSTALL)
381 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
382 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
383 if test -f $$p; then \
384 f=$(am__strip_dir) \
385 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
386 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
387 else :; fi; \
388 done
389
390 uninstall-libLTLIBRARIES:
391 @$(NORMAL_UNINSTALL)
392 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
393 p=$(am__strip_dir) \
394 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
395 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
396 done
397
398 clean-libLTLIBRARIES:
399 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
400 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
401 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
402 test "$$dir" != "$$p" || dir=.; \
403 echo "rm -f \"$${dir}/so_locations\""; \
404 rm -f "$${dir}/so_locations"; \
405 done
406 libatasmart.la: $(libatasmart_la_OBJECTS) $(libatasmart_la_DEPENDENCIES)
407 $(libatasmart_la_LINK) -rpath $(libdir) $(libatasmart_la_OBJECTS) $(libatasmart_la_LIBADD) $(LIBS)
408
409 clean-noinstPROGRAMS:
410 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
411 f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
412 echo " rm -f $$p $$f"; \
413 rm -f $$p $$f ; \
414 done
415 install-sbinPROGRAMS: $(sbin_PROGRAMS)
416 @$(NORMAL_INSTALL)
417 test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
418 @list='$(sbin_PROGRAMS)'; for p in $$list; do \
419 p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
420 if test -f $$p \
421 || test -f $$p1 \
422 ; then \
423 f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
424 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
425 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
426 else :; fi; \
427 done
428
429 uninstall-sbinPROGRAMS:
430 @$(NORMAL_UNINSTALL)
431 @list='$(sbin_PROGRAMS)'; for p in $$list; do \
432 f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
433 echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
434 rm -f "$(DESTDIR)$(sbindir)/$$f"; \
435 done
436
437 clean-sbinPROGRAMS:
438 @list='$(sbin_PROGRAMS)'; for p in $$list; do \
439 f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
440 echo " rm -f $$p $$f"; \
441 rm -f $$p $$f ; \
442 done
443 skdump$(EXEEXT): $(skdump_OBJECTS) $(skdump_DEPENDENCIES)
444 @rm -f skdump$(EXEEXT)
445 $(LINK) $(skdump_OBJECTS) $(skdump_LDADD) $(LIBS)
446 sktest$(EXEEXT): $(sktest_OBJECTS) $(sktest_DEPENDENCIES)
447 @rm -f sktest$(EXEEXT)
448 $(LINK) $(sktest_OBJECTS) $(sktest_LDADD) $(LIBS)
449 strpool$(EXEEXT): $(strpool_OBJECTS) $(strpool_DEPENDENCIES)
450 @rm -f strpool$(EXEEXT)
451 $(LINK) $(strpool_OBJECTS) $(strpool_LDADD) $(LIBS)
452
453 mostlyclean-compile:
454 -rm -f *.$(OBJEXT)
455
456 distclean-compile:
457 -rm -f *.tab.c
458
459 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libatasmart_la-atasmart.strpool.Plo@am__quote@
460 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skdump.Po@am__quote@
461 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sktest.Po@am__quote@
462 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strpool.Po@am__quote@
463
464 .c.o:
465 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
466 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
467 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
468 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
469 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
470
471 .c.obj:
472 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
473 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
474 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
475 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
476 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
477
478 .c.lo:
479 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
480 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
481 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
482 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
483 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
484
485 libatasmart_la-atasmart.strpool.lo: atasmart.strpool.c
486 @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -MT libatasmart_la-atasmart.strpool.lo -MD -MP -MF $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
487 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo $(DEPDIR)/libatasmart_la-atasmart.strpool.Plo
488 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atasmart.strpool.c' object='libatasmart_la-atasmart.strpool.lo' libtool=yes @AMDEPBACKSLASH@
489 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
490 @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
491
492 mostlyclean-libtool:
493 -rm -f *.lo
494
495 clean-libtool:
496 -rm -rf .libs _libs
497
498 distclean-libtool:
499 -rm -f libtool config.lt
500 install-pkgconfigDATA: $(pkgconfig_DATA)
501 @$(NORMAL_INSTALL)
502 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
503 @list='$(pkgconfig_DATA)'; for p in $$list; do \
504 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
505 f=$(am__strip_dir) \
506 echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
507 $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
508 done
509
510 uninstall-pkgconfigDATA:
511 @$(NORMAL_UNINSTALL)
512 @list='$(pkgconfig_DATA)'; for p in $$list; do \
513 f=$(am__strip_dir) \
514 echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
515 rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
516 done
517 install-includeHEADERS: $(include_HEADERS)
518 @$(NORMAL_INSTALL)
519 test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
520 @list='$(include_HEADERS)'; for p in $$list; do \
521 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
522 f=$(am__strip_dir) \
523 echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
524 $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
525 done
526
527 uninstall-includeHEADERS:
528 @$(NORMAL_UNINSTALL)
529 @list='$(include_HEADERS)'; for p in $$list; do \
530 f=$(am__strip_dir) \
531 echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
532 rm -f "$(DESTDIR)$(includedir)/$$f"; \
533 done
534
535 # This directory's subdirectories are mostly independent; you can cd
536 # into them and run `make' without going through this Makefile.
537 # To change the values of `make' variables: instead of editing Makefiles,
538 # (1) if the variable is set in `config.status', edit `config.status'
539 # (which will cause the Makefiles to be regenerated when you run `make');
540 # (2) otherwise, pass the desired values on the `make' command line.
541 $(RECURSIVE_TARGETS):
542 @failcom='exit 1'; \
543 for f in x $$MAKEFLAGS; do \
544 case $$f in \
545 *=* | --[!k]*);; \
546 *k*) failcom='fail=yes';; \
547 esac; \
548 done; \
549 dot_seen=no; \
550 target=`echo $@ | sed s/-recursive//`; \
551 list='$(SUBDIRS)'; for subdir in $$list; do \
552 echo "Making $$target in $$subdir"; \
553 if test "$$subdir" = "."; then \
554 dot_seen=yes; \
555 local_target="$$target-am"; \
556 else \
557 local_target="$$target"; \
558 fi; \
559 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
560 || eval $$failcom; \
561 done; \
562 if test "$$dot_seen" = "no"; then \
563 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
564 fi; test -z "$$fail"
565
566 $(RECURSIVE_CLEAN_TARGETS):
567 @failcom='exit 1'; \
568 for f in x $$MAKEFLAGS; do \
569 case $$f in \
570 *=* | --[!k]*);; \
571 *k*) failcom='fail=yes';; \
572 esac; \
573 done; \
574 dot_seen=no; \
575 case "$@" in \
576 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
577 *) list='$(SUBDIRS)' ;; \
578 esac; \
579 rev=''; for subdir in $$list; do \
580 if test "$$subdir" = "."; then :; else \
581 rev="$$subdir $$rev"; \
582 fi; \
583 done; \
584 rev="$$rev ."; \
585 target=`echo $@ | sed s/-recursive//`; \
586 for subdir in $$rev; do \
587 echo "Making $$target in $$subdir"; \
588 if test "$$subdir" = "."; then \
589 local_target="$$target-am"; \
590 else \
591 local_target="$$target"; \
592 fi; \
593 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
594 || eval $$failcom; \
595 done && test -z "$$fail"
596 tags-recursive:
597 list='$(SUBDIRS)'; for subdir in $$list; do \
598 test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
599 done
600 ctags-recursive:
601 list='$(SUBDIRS)'; for subdir in $$list; do \
602 test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
603 done
604
605 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
606 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
607 unique=`for i in $$list; do \
608 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
609 done | \
610 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
611 END { if (nonempty) { for (i in files) print i; }; }'`; \
612 mkid -fID $$unique
613 tags: TAGS
614
615 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
616 $(TAGS_FILES) $(LISP)
617 tags=; \
618 here=`pwd`; \
619 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
620 include_option=--etags-include; \
621 empty_fix=.; \
622 else \
623 include_option=--include; \
624 empty_fix=; \
625 fi; \
626 list='$(SUBDIRS)'; for subdir in $$list; do \
627 if test "$$subdir" = .; then :; else \
628 test ! -f $$subdir/TAGS || \
629 tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
630 fi; \
631 done; \
632 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
633 unique=`for i in $$list; do \
634 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
635 done | \
636 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
637 END { if (nonempty) { for (i in files) print i; }; }'`; \
638 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
639 test -n "$$unique" || unique=$$empty_fix; \
640 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
641 $$tags $$unique; \
642 fi
643 ctags: CTAGS
644 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
645 $(TAGS_FILES) $(LISP)
646 tags=; \
647 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
648 unique=`for i in $$list; do \
649 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
650 done | \
651 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
652 END { if (nonempty) { for (i in files) print i; }; }'`; \
653 test -z "$(CTAGS_ARGS)$$tags$$unique" \
654 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
655 $$tags $$unique
656
657 GTAGS:
658 here=`$(am__cd) $(top_builddir) && pwd` \
659 && cd $(top_srcdir) \
660 && gtags -i $(GTAGS_ARGS) $$here
661
662 distclean-tags:
663 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
664
665 distdir: $(DISTFILES)
666 $(am__remove_distdir)
667 test -d $(distdir) || mkdir $(distdir)
668 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
669 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
670 list='$(DISTFILES)'; \
671 dist_files=`for file in $$list; do echo $$file; done | \
672 sed -e "s|^$$srcdirstrip/||;t" \
673 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
674 case $$dist_files in \
675 */*) $(MKDIR_P) `echo "$$dist_files" | \
676 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
677 sort -u` ;; \
678 esac; \
679 for file in $$dist_files; do \
680 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
681 if test -d $$d/$$file; then \
682 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
683 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
684 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
685 fi; \
686 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
687 else \
688 test -f $(distdir)/$$file \
689 || cp -p $$d/$$file $(distdir)/$$file \
690 || exit 1; \
691 fi; \
692 done
693 list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
694 if test "$$subdir" = .; then :; else \
695 test -d "$(distdir)/$$subdir" \
696 || $(MKDIR_P) "$(distdir)/$$subdir" \
697 || exit 1; \
698 distdir=`$(am__cd) $(distdir) && pwd`; \
699 top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
700 (cd $$subdir && \
701 $(MAKE) $(AM_MAKEFLAGS) \
702 top_distdir="$$top_distdir" \
703 distdir="$$distdir/$$subdir" \
704 am__remove_distdir=: \
705 am__skip_length_check=: \
706 distdir) \
707 || exit 1; \
708 fi; \
709 done
710 -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
711 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
712 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
713 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
714 || chmod -R a+r $(distdir)
715 dist-gzip: distdir
716 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
717 $(am__remove_distdir)
718
719 dist-bzip2: distdir
720 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
721 $(am__remove_distdir)
722
723 dist-lzma: distdir
724 tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
725 $(am__remove_distdir)
726
727 dist-tarZ: distdir
728 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
729 $(am__remove_distdir)
730
731 dist-shar: distdir
732 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
733 $(am__remove_distdir)
734
735 dist-zip: distdir
736 -rm -f $(distdir).zip
737 zip -rq $(distdir).zip $(distdir)
738 $(am__remove_distdir)
739
740 dist dist-all: distdir
741 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
742 $(am__remove_distdir)
743
744 # This target untars the dist file and tries a VPATH configuration. Then
745 # it guarantees that the distribution is self-contained by making another
746 # tarfile.
747 distcheck: dist
748 case '$(DIST_ARCHIVES)' in \
749 *.tar.gz*) \
750 GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
751 *.tar.bz2*) \
752 bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
753 *.tar.lzma*) \
754 unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
755 *.tar.Z*) \
756 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
757 *.shar.gz*) \
758 GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
759 *.zip*) \
760 unzip $(distdir).zip ;;\
761 esac
762 chmod -R a-w $(distdir); chmod a+w $(distdir)
763 mkdir $(distdir)/_build
764 mkdir $(distdir)/_inst
765 chmod a-w $(distdir)
766 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
767 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
768 && cd $(distdir)/_build \
769 && ../configure --srcdir=.. --prefix="$$dc_install_base" \
770 $(DISTCHECK_CONFIGURE_FLAGS) \
771 && $(MAKE) $(AM_MAKEFLAGS) \
772 && $(MAKE) $(AM_MAKEFLAGS) dvi \
773 && $(MAKE) $(AM_MAKEFLAGS) check \
774 && $(MAKE) $(AM_MAKEFLAGS) install \
775 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
776 && $(MAKE) $(AM_MAKEFLAGS) uninstall \
777 && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
778 distuninstallcheck \
779 && chmod -R a-w "$$dc_install_base" \
780 && ({ \
781 (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
782 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
783 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
784 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
785 distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
786 } || { rm -rf "$$dc_destdir"; exit 1; }) \
787 && rm -rf "$$dc_destdir" \
788 && $(MAKE) $(AM_MAKEFLAGS) dist \
789 && rm -rf $(DIST_ARCHIVES) \
790 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
791 $(am__remove_distdir)
792 @(echo "$(distdir) archives ready for distribution: "; \
793 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
794 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
795 distuninstallcheck:
796 @cd $(distuninstallcheck_dir) \
797 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
798 || { echo "ERROR: files left after uninstall:" ; \
799 if test -n "$(DESTDIR)"; then \
800 echo " (check DESTDIR support)"; \
801 fi ; \
802 $(distuninstallcheck_listfiles) ; \
803 exit 1; } >&2
804 distcleancheck: distclean
805 @if test '$(srcdir)' = . ; then \
806 echo "ERROR: distcleancheck can only run from a VPATH build" ; \
807 exit 1 ; \
808 fi
809 @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
810 || { echo "ERROR: files left in build directory after distclean:" ; \
811 $(distcleancheck_listfiles) ; \
812 exit 1; } >&2
813 check-am: all-am
814 check: $(BUILT_SOURCES)
815 $(MAKE) $(AM_MAKEFLAGS) check-recursive
816 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \
817 config.h
818 installdirs: installdirs-recursive
819 installdirs-am:
820 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
821 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
822 done
823 install: $(BUILT_SOURCES)
824 $(MAKE) $(AM_MAKEFLAGS) install-recursive
825 install-exec: install-exec-recursive
826 install-data: install-data-recursive
827 uninstall: uninstall-recursive
828
829 install-am: all-am
830 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
831
832 installcheck: installcheck-recursive
833 install-strip:
834 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
835 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
836 `test -z '$(STRIP)' || \
837 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
838 mostlyclean-generic:
839
840 clean-generic:
841 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
842
843 distclean-generic:
844 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
845
846 maintainer-clean-generic:
847 @echo "This command is intended for maintainers to use"
848 @echo "it deletes files that may require special tools to rebuild."
849 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
850 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
851 clean: clean-recursive
852
853 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
854 clean-noinstPROGRAMS clean-sbinPROGRAMS mostlyclean-am
855
856 distclean: distclean-recursive
857 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
858 -rm -rf ./$(DEPDIR)
859 -rm -f Makefile
860 distclean-am: clean-am distclean-compile distclean-generic \
861 distclean-hdr distclean-libtool distclean-tags
862
863 dvi: dvi-recursive
864
865 dvi-am:
866
867 html: html-recursive
868
869 info: info-recursive
870
871 info-am:
872
873 install-data-am: install-includeHEADERS install-pkgconfigDATA
874
875 install-dvi: install-dvi-recursive
876
877 install-exec-am: install-libLTLIBRARIES install-sbinPROGRAMS
878
879 install-html: install-html-recursive
880
881 install-info: install-info-recursive
882
883 install-man:
884
885 install-pdf: install-pdf-recursive
886
887 install-ps: install-ps-recursive
888
889 installcheck-am:
890
891 maintainer-clean: maintainer-clean-recursive
892 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
893 -rm -rf $(top_srcdir)/autom4te.cache
894 -rm -rf ./$(DEPDIR)
895 -rm -f Makefile
896 maintainer-clean-am: distclean-am maintainer-clean-generic
897
898 mostlyclean: mostlyclean-recursive
899
900 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
901 mostlyclean-libtool
902
903 pdf: pdf-recursive
904
905 pdf-am:
906
907 ps: ps-recursive
908
909 ps-am:
910
911 uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
912 uninstall-pkgconfigDATA uninstall-sbinPROGRAMS
913
914 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
915 install-strip
916
917 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
918 all all-am am--refresh check check-am clean clean-generic \
919 clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
920 clean-sbinPROGRAMS ctags ctags-recursive dist dist-all \
921 dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-zip \
922 distcheck distclean distclean-compile distclean-generic \
923 distclean-hdr distclean-libtool distclean-tags distcleancheck \
924 distdir distuninstallcheck dvi dvi-am html html-am info \
925 info-am install install-am install-data install-data-am \
926 install-dvi install-dvi-am install-exec install-exec-am \
927 install-html install-html-am install-includeHEADERS \
928 install-info install-info-am install-libLTLIBRARIES \
929 install-man install-pdf install-pdf-am install-pkgconfigDATA \
930 install-ps install-ps-am install-sbinPROGRAMS install-strip \
931 installcheck installcheck-am installdirs installdirs-am \
932 maintainer-clean maintainer-clean-generic mostlyclean \
933 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
934 pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
935 uninstall-includeHEADERS uninstall-libLTLIBRARIES \
936 uninstall-pkgconfigDATA uninstall-sbinPROGRAMS
937
938
939 atasmart.strpool.c: atasmart.c strpool
940 $(top_builddir)/strpool $< $@
941 # Tell versions [3.59,3.63) of GNU make to not export all variables.
942 # Otherwise a system limit (for SysV at least) may be exceeded.
943 .NOEXPORT:
0 LIBATASMART ATA S.M.A.R.T. Reading and Parsing Library
1
2 GIT:
3 git://git.0pointer.de/libatasmart.git
4
5 GITWEB:
6 http://git.0pointer.de/?p=libatasmart.git
7
8 NOTES:
9 As the name suggests libatasmart only does ATA S.M.A.R.T.,
10 there is no support for SCSI harddisks. SCSI S.M.A.R.T. is a
11 very different system, support for it should be implemented in
12 a separate library "libscsismart" if there should ever be
13 demand for it.
14
15 This library is supposed to be lean and small and thus
16 supports only a subset of the S.M.A.R.T. functionality.
17 However, I claim that it implements the relevant part of it.
18 If you need full control over all S.M.A.R.T. functionality of
19 your hardware please refer to Buce Allen's smartmontools.
20
21 This runs on Linux only. Patches to port it to other operating
22 systems are welcome, as long as they don't make the code
23 difficult to read and come with more than one or two
24 #ifdefs. I am happy to include patches for non-Linux systems
25 -- please note however that non-Linux operating systems are
26 not relevant for release management. i.e. I won't make sure
27 that libatasmart compiles fine on non-Linux systems before
28 release.
29
30 libatasmart supports classic ATA/IDE disks (i.e. /dev/hda) as
31 well as ATA disks that are connected through a SCSI layer
32 (SAT) (such as a SATA /dev/sda).
33
34 USB disks generally don't support SAT and thus generally
35 cannot be queried for S.M.A.R.T. data.
36
37 ACKNOWLEDGMENTS:
38 This library is inspired by Bruce Allen's smartmontools and by
39 Emmanuel Varagnat's hddtemp. However libatasmart is completely
40 new code, not a single line has been copied from those two
41 projects.
42
43 LICENSE:
44 LGPLv2.1+
45
46 AUTHOR:
47 Lennart Poettering
48
49 REQUIREMENTS:
50 None (except Linux with a GLibc)
0 # generated automatically by aclocal 1.10.2 -*- Autoconf -*-
1
2 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 # PARTICULAR PURPOSE.
12
13 m4_ifndef([AC_AUTOCONF_VERSION],
14 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
15 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
16 [m4_warning([this file was generated for autoconf 2.63.
17 You have another version of autoconf. It may work, but is not guaranteed to.
18 If you have problems, you may need to regenerate the build system entirely.
19 To do so, use the procedure documented by the package, typically `autoreconf'.])])
20
21 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
22 #
23 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
24 # 2006, 2007, 2008 Free Software Foundation, Inc.
25 # Written by Gordon Matzigkeit, 1996
26 #
27 # This file is free software; the Free Software Foundation gives
28 # unlimited permission to copy and/or distribute it, with or without
29 # modifications, as long as this notice is preserved.
30
31 m4_define([_LT_COPYING], [dnl
32 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
33 # 2006, 2007, 2008 Free Software Foundation, Inc.
34 # Written by Gordon Matzigkeit, 1996
35 #
36 # This file is part of GNU Libtool.
37 #
38 # GNU Libtool is free software; you can redistribute it and/or
39 # modify it under the terms of the GNU General Public License as
40 # published by the Free Software Foundation; either version 2 of
41 # the License, or (at your option) any later version.
42 #
43 # As a special exception to the GNU General Public License,
44 # if you distribute this file as part of a program or library that
45 # is built using GNU Libtool, you may include this file under the
46 # same distribution terms that you use for the rest of that program.
47 #
48 # GNU Libtool is distributed in the hope that it will be useful,
49 # but WITHOUT ANY WARRANTY; without even the implied warranty of
50 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 # GNU General Public License for more details.
52 #
53 # You should have received a copy of the GNU General Public License
54 # along with GNU Libtool; see the file COPYING. If not, a copy
55 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
56 # obtained by writing to the Free Software Foundation, Inc.,
57 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
58 ])
59
60 # serial 56 LT_INIT
61
62
63 # LT_PREREQ(VERSION)
64 # ------------------
65 # Complain and exit if this libtool version is less that VERSION.
66 m4_defun([LT_PREREQ],
67 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
68 [m4_default([$3],
69 [m4_fatal([Libtool version $1 or higher is required],
70 63)])],
71 [$2])])
72
73
74 # _LT_CHECK_BUILDDIR
75 # ------------------
76 # Complain if the absolute build directory name contains unusual characters
77 m4_defun([_LT_CHECK_BUILDDIR],
78 [case `pwd` in
79 *\ * | *\ *)
80 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
81 esac
82 ])
83
84
85 # LT_INIT([OPTIONS])
86 # ------------------
87 AC_DEFUN([LT_INIT],
88 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
89 AC_BEFORE([$0], [LT_LANG])dnl
90 AC_BEFORE([$0], [LT_OUTPUT])dnl
91 AC_BEFORE([$0], [LTDL_INIT])dnl
92 m4_require([_LT_CHECK_BUILDDIR])dnl
93
94 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
95 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
96 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
97 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
98 dnl unless we require an AC_DEFUNed macro:
99 AC_REQUIRE([LTOPTIONS_VERSION])dnl
100 AC_REQUIRE([LTSUGAR_VERSION])dnl
101 AC_REQUIRE([LTVERSION_VERSION])dnl
102 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
103 m4_require([_LT_PROG_LTMAIN])dnl
104
105 dnl Parse OPTIONS
106 _LT_SET_OPTIONS([$0], [$1])
107
108 # This can be used to rebuild libtool when needed
109 LIBTOOL_DEPS="$ltmain"
110
111 # Always use our own libtool.
112 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
113 AC_SUBST(LIBTOOL)dnl
114
115 _LT_SETUP
116
117 # Only expand once:
118 m4_define([LT_INIT])
119 ])# LT_INIT
120
121 # Old names:
122 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
123 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
124 dnl aclocal-1.4 backwards compatibility:
125 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
126 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
127
128
129 # _LT_CC_BASENAME(CC)
130 # -------------------
131 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
132 m4_defun([_LT_CC_BASENAME],
133 [for cc_temp in $1""; do
134 case $cc_temp in
135 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
136 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
137 \-*) ;;
138 *) break;;
139 esac
140 done
141 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
142 ])
143
144
145 # _LT_FILEUTILS_DEFAULTS
146 # ----------------------
147 # It is okay to use these file commands and assume they have been set
148 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
149 m4_defun([_LT_FILEUTILS_DEFAULTS],
150 [: ${CP="cp -f"}
151 : ${MV="mv -f"}
152 : ${RM="rm -f"}
153 ])# _LT_FILEUTILS_DEFAULTS
154
155
156 # _LT_SETUP
157 # ---------
158 m4_defun([_LT_SETUP],
159 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
160 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
161 _LT_DECL([], [host_alias], [0], [The host system])dnl
162 _LT_DECL([], [host], [0])dnl
163 _LT_DECL([], [host_os], [0])dnl
164 dnl
165 _LT_DECL([], [build_alias], [0], [The build system])dnl
166 _LT_DECL([], [build], [0])dnl
167 _LT_DECL([], [build_os], [0])dnl
168 dnl
169 AC_REQUIRE([AC_PROG_CC])dnl
170 AC_REQUIRE([LT_PATH_LD])dnl
171 AC_REQUIRE([LT_PATH_NM])dnl
172 dnl
173 AC_REQUIRE([AC_PROG_LN_S])dnl
174 test -z "$LN_S" && LN_S="ln -s"
175 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
176 dnl
177 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
178 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
179 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
180 dnl
181 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
182 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
183 m4_require([_LT_CMD_RELOAD])dnl
184 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
185 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
186 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
187
188 _LT_CONFIG_LIBTOOL_INIT([
189 # See if we are running on zsh, and set the options which allow our
190 # commands through without removal of \ escapes INIT.
191 if test -n "\${ZSH_VERSION+set}" ; then
192 setopt NO_GLOB_SUBST
193 fi
194 ])
195 if test -n "${ZSH_VERSION+set}" ; then
196 setopt NO_GLOB_SUBST
197 fi
198
199 _LT_CHECK_OBJDIR
200
201 m4_require([_LT_TAG_COMPILER])dnl
202 _LT_PROG_ECHO_BACKSLASH
203
204 case $host_os in
205 aix3*)
206 # AIX sometimes has problems with the GCC collect2 program. For some
207 # reason, if we set the COLLECT_NAMES environment variable, the problems
208 # vanish in a puff of smoke.
209 if test "X${COLLECT_NAMES+set}" != Xset; then
210 COLLECT_NAMES=
211 export COLLECT_NAMES
212 fi
213 ;;
214 esac
215
216 # Sed substitution that helps us do robust quoting. It backslashifies
217 # metacharacters that are still active within double-quoted strings.
218 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
219
220 # Same as above, but do not quote variable references.
221 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
222
223 # Sed substitution to delay expansion of an escaped shell variable in a
224 # double_quote_subst'ed string.
225 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
226
227 # Sed substitution to delay expansion of an escaped single quote.
228 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
229
230 # Sed substitution to avoid accidental globbing in evaled expressions
231 no_glob_subst='s/\*/\\\*/g'
232
233 # Global variables:
234 ofile=libtool
235 can_build_shared=yes
236
237 # All known linkers require a `.a' archive for static linking (except MSVC,
238 # which needs '.lib').
239 libext=a
240
241 with_gnu_ld="$lt_cv_prog_gnu_ld"
242
243 old_CC="$CC"
244 old_CFLAGS="$CFLAGS"
245
246 # Set sane defaults for various variables
247 test -z "$CC" && CC=cc
248 test -z "$LTCC" && LTCC=$CC
249 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
250 test -z "$LD" && LD=ld
251 test -z "$ac_objext" && ac_objext=o
252
253 _LT_CC_BASENAME([$compiler])
254
255 # Only perform the check for file, if the check method requires it
256 test -z "$MAGIC_CMD" && MAGIC_CMD=file
257 case $deplibs_check_method in
258 file_magic*)
259 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
260 _LT_PATH_MAGIC
261 fi
262 ;;
263 esac
264
265 # Use C for the default configuration in the libtool script
266 LT_SUPPORTED_TAG([CC])
267 _LT_LANG_C_CONFIG
268 _LT_LANG_DEFAULT_CONFIG
269 _LT_CONFIG_COMMANDS
270 ])# _LT_SETUP
271
272
273 # _LT_PROG_LTMAIN
274 # ---------------
275 # Note that this code is called both from `configure', and `config.status'
276 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
277 # `config.status' has no value for ac_aux_dir unless we are using Automake,
278 # so we pass a copy along to make sure it has a sensible value anyway.
279 m4_defun([_LT_PROG_LTMAIN],
280 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
281 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
282 ltmain="$ac_aux_dir/ltmain.sh"
283 ])# _LT_PROG_LTMAIN
284
285
286
287 # So that we can recreate a full libtool script including additional
288 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
289 # in macros and then make a single call at the end using the `libtool'
290 # label.
291
292
293 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
294 # ----------------------------------------
295 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
296 m4_define([_LT_CONFIG_LIBTOOL_INIT],
297 [m4_ifval([$1],
298 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
299 [$1
300 ])])])
301
302 # Initialize.
303 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
304
305
306 # _LT_CONFIG_LIBTOOL([COMMANDS])
307 # ------------------------------
308 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
309 m4_define([_LT_CONFIG_LIBTOOL],
310 [m4_ifval([$1],
311 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
312 [$1
313 ])])])
314
315 # Initialize.
316 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
317
318
319 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
320 # -----------------------------------------------------
321 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
322 [_LT_CONFIG_LIBTOOL([$1])
323 _LT_CONFIG_LIBTOOL_INIT([$2])
324 ])
325
326
327 # _LT_FORMAT_COMMENT([COMMENT])
328 # -----------------------------
329 # Add leading comment marks to the start of each line, and a trailing
330 # full-stop to the whole comment if one is not present already.
331 m4_define([_LT_FORMAT_COMMENT],
332 [m4_ifval([$1], [
333 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
334 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
335 )])
336
337
338
339
340
341 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
342 # -------------------------------------------------------------------
343 # CONFIGNAME is the name given to the value in the libtool script.
344 # VARNAME is the (base) name used in the configure script.
345 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
346 # VARNAME. Any other value will be used directly.
347 m4_define([_LT_DECL],
348 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
349 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
350 [m4_ifval([$1], [$1], [$2])])
351 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
352 m4_ifval([$4],
353 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
354 lt_dict_add_subkey([lt_decl_dict], [$2],
355 [tagged?], [m4_ifval([$5], [yes], [no])])])
356 ])
357
358
359 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
360 # --------------------------------------------------------
361 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
362
363
364 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
365 # ------------------------------------------------
366 m4_define([lt_decl_tag_varnames],
367 [_lt_decl_filter([tagged?], [yes], $@)])
368
369
370 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
371 # ---------------------------------------------------------
372 m4_define([_lt_decl_filter],
373 [m4_case([$#],
374 [0], [m4_fatal([$0: too few arguments: $#])],
375 [1], [m4_fatal([$0: too few arguments: $#: $1])],
376 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
377 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
378 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
379 ])
380
381
382 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
383 # --------------------------------------------------
384 m4_define([lt_decl_quote_varnames],
385 [_lt_decl_filter([value], [1], $@)])
386
387
388 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
389 # ---------------------------------------------------
390 m4_define([lt_decl_dquote_varnames],
391 [_lt_decl_filter([value], [2], $@)])
392
393
394 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
395 # ---------------------------------------------------
396 m4_define([lt_decl_varnames_tagged],
397 [m4_assert([$# <= 2])dnl
398 _$0(m4_quote(m4_default([$1], [[, ]])),
399 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
400 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
401 m4_define([_lt_decl_varnames_tagged],
402 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
403
404
405 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
406 # ------------------------------------------------
407 m4_define([lt_decl_all_varnames],
408 [_$0(m4_quote(m4_default([$1], [[, ]])),
409 m4_if([$2], [],
410 m4_quote(lt_decl_varnames),
411 m4_quote(m4_shift($@))))[]dnl
412 ])
413 m4_define([_lt_decl_all_varnames],
414 [lt_join($@, lt_decl_varnames_tagged([$1],
415 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
416 ])
417
418
419 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
420 # ------------------------------------
421 # Quote a variable value, and forward it to `config.status' so that its
422 # declaration there will have the same value as in `configure'. VARNAME
423 # must have a single quote delimited value for this to work.
424 m4_define([_LT_CONFIG_STATUS_DECLARE],
425 [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
426
427
428 # _LT_CONFIG_STATUS_DECLARATIONS
429 # ------------------------------
430 # We delimit libtool config variables with single quotes, so when
431 # we write them to config.status, we have to be sure to quote all
432 # embedded single quotes properly. In configure, this macro expands
433 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
434 #
435 # <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
436 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
437 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
438 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
439
440
441 # _LT_LIBTOOL_TAGS
442 # ----------------
443 # Output comment and list of tags supported by the script
444 m4_defun([_LT_LIBTOOL_TAGS],
445 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
446 available_tags="_LT_TAGS"dnl
447 ])
448
449
450 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
451 # -----------------------------------
452 # Extract the dictionary values for VARNAME (optionally with TAG) and
453 # expand to a commented shell variable setting:
454 #
455 # # Some comment about what VAR is for.
456 # visible_name=$lt_internal_name
457 m4_define([_LT_LIBTOOL_DECLARE],
458 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
459 [description])))[]dnl
460 m4_pushdef([_libtool_name],
461 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
462 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
463 [0], [_libtool_name=[$]$1],
464 [1], [_libtool_name=$lt_[]$1],
465 [2], [_libtool_name=$lt_[]$1],
466 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
467 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
468 ])
469
470
471 # _LT_LIBTOOL_CONFIG_VARS
472 # -----------------------
473 # Produce commented declarations of non-tagged libtool config variables
474 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
475 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
476 # section) are produced by _LT_LIBTOOL_TAG_VARS.
477 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
478 [m4_foreach([_lt_var],
479 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
480 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
481
482
483 # _LT_LIBTOOL_TAG_VARS(TAG)
484 # -------------------------
485 m4_define([_LT_LIBTOOL_TAG_VARS],
486 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
487 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
488
489
490 # _LT_TAGVAR(VARNAME, [TAGNAME])
491 # ------------------------------
492 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
493
494
495 # _LT_CONFIG_COMMANDS
496 # -------------------
497 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
498 # variables for single and double quote escaping we saved from calls
499 # to _LT_DECL, we can put quote escaped variables declarations
500 # into `config.status', and then the shell code to quote escape them in
501 # for loops in `config.status'. Finally, any additional code accumulated
502 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
503 m4_defun([_LT_CONFIG_COMMANDS],
504 [AC_PROVIDE_IFELSE([LT_OUTPUT],
505 dnl If the libtool generation code has been placed in $CONFIG_LT,
506 dnl instead of duplicating it all over again into config.status,
507 dnl then we will have config.status run $CONFIG_LT later, so it
508 dnl needs to know what name is stored there:
509 [AC_CONFIG_COMMANDS([libtool],
510 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
511 dnl If the libtool generation code is destined for config.status,
512 dnl expand the accumulated commands and init code now:
513 [AC_CONFIG_COMMANDS([libtool],
514 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
515 ])#_LT_CONFIG_COMMANDS
516
517
518 # Initialize.
519 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
520 [
521
522 # The HP-UX ksh and POSIX shell print the target directory to stdout
523 # if CDPATH is set.
524 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
525
526 sed_quote_subst='$sed_quote_subst'
527 double_quote_subst='$double_quote_subst'
528 delay_variable_subst='$delay_variable_subst'
529 _LT_CONFIG_STATUS_DECLARATIONS
530 LTCC='$LTCC'
531 LTCFLAGS='$LTCFLAGS'
532 compiler='$compiler_DEFAULT'
533
534 # Quote evaled strings.
535 for var in lt_decl_all_varnames([[ \
536 ]], lt_decl_quote_varnames); do
537 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
538 *[[\\\\\\\`\\"\\\$]]*)
539 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
540 ;;
541 *)
542 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
543 ;;
544 esac
545 done
546
547 # Double-quote double-evaled strings.
548 for var in lt_decl_all_varnames([[ \
549 ]], lt_decl_dquote_varnames); do
550 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
551 *[[\\\\\\\`\\"\\\$]]*)
552 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
553 ;;
554 *)
555 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
556 ;;
557 esac
558 done
559
560 # Fix-up fallback echo if it was mangled by the above quoting rules.
561 case \$lt_ECHO in
562 *'\\\[$]0 --fallback-echo"')dnl "
563 lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
564 ;;
565 esac
566
567 _LT_OUTPUT_LIBTOOL_INIT
568 ])
569
570
571 # LT_OUTPUT
572 # ---------
573 # This macro allows early generation of the libtool script (before
574 # AC_OUTPUT is called), incase it is used in configure for compilation
575 # tests.
576 AC_DEFUN([LT_OUTPUT],
577 [: ${CONFIG_LT=./config.lt}
578 AC_MSG_NOTICE([creating $CONFIG_LT])
579 cat >"$CONFIG_LT" <<_LTEOF
580 #! $SHELL
581 # Generated by $as_me.
582 # Run this file to recreate a libtool stub with the current configuration.
583
584 lt_cl_silent=false
585 SHELL=\${CONFIG_SHELL-$SHELL}
586 _LTEOF
587
588 cat >>"$CONFIG_LT" <<\_LTEOF
589 AS_SHELL_SANITIZE
590 _AS_PREPARE
591
592 exec AS_MESSAGE_FD>&1
593 exec AS_MESSAGE_LOG_FD>>config.log
594 {
595 echo
596 AS_BOX([Running $as_me.])
597 } >&AS_MESSAGE_LOG_FD
598
599 lt_cl_help="\
600 \`$as_me' creates a local libtool stub from the current configuration,
601 for use in further configure time tests before the real libtool is
602 generated.
603
604 Usage: $[0] [[OPTIONS]]
605
606 -h, --help print this help, then exit
607 -V, --version print version number, then exit
608 -q, --quiet do not print progress messages
609 -d, --debug don't remove temporary files
610
611 Report bugs to <bug-libtool@gnu.org>."
612
613 lt_cl_version="\
614 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
615 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
616 configured by $[0], generated by m4_PACKAGE_STRING.
617
618 Copyright (C) 2008 Free Software Foundation, Inc.
619 This config.lt script is free software; the Free Software Foundation
620 gives unlimited permision to copy, distribute and modify it."
621
622 while test $[#] != 0
623 do
624 case $[1] in
625 --version | --v* | -V )
626 echo "$lt_cl_version"; exit 0 ;;
627 --help | --h* | -h )
628 echo "$lt_cl_help"; exit 0 ;;
629 --debug | --d* | -d )
630 debug=: ;;
631 --quiet | --q* | --silent | --s* | -q )
632 lt_cl_silent=: ;;
633
634 -*) AC_MSG_ERROR([unrecognized option: $[1]
635 Try \`$[0] --help' for more information.]) ;;
636
637 *) AC_MSG_ERROR([unrecognized argument: $[1]
638 Try \`$[0] --help' for more information.]) ;;
639 esac
640 shift
641 done
642
643 if $lt_cl_silent; then
644 exec AS_MESSAGE_FD>/dev/null
645 fi
646 _LTEOF
647
648 cat >>"$CONFIG_LT" <<_LTEOF
649 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
650 _LTEOF
651
652 cat >>"$CONFIG_LT" <<\_LTEOF
653 AC_MSG_NOTICE([creating $ofile])
654 _LT_OUTPUT_LIBTOOL_COMMANDS
655 AS_EXIT(0)
656 _LTEOF
657 chmod +x "$CONFIG_LT"
658
659 # configure is writing to config.log, but config.lt does its own redirection,
660 # appending to config.log, which fails on DOS, as config.log is still kept
661 # open by configure. Here we exec the FD to /dev/null, effectively closing
662 # config.log, so it can be properly (re)opened and appended to by config.lt.
663 if test "$no_create" != yes; then
664 lt_cl_success=:
665 test "$silent" = yes &&
666 lt_config_lt_args="$lt_config_lt_args --quiet"
667 exec AS_MESSAGE_LOG_FD>/dev/null
668 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
669 exec AS_MESSAGE_LOG_FD>>config.log
670 $lt_cl_success || AS_EXIT(1)
671 fi
672 ])# LT_OUTPUT
673
674
675 # _LT_CONFIG(TAG)
676 # ---------------
677 # If TAG is the built-in tag, create an initial libtool script with a
678 # default configuration from the untagged config vars. Otherwise add code
679 # to config.status for appending the configuration named by TAG from the
680 # matching tagged config vars.
681 m4_defun([_LT_CONFIG],
682 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
683 _LT_CONFIG_SAVE_COMMANDS([
684 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
685 m4_if(_LT_TAG, [C], [
686 # See if we are running on zsh, and set the options which allow our
687 # commands through without removal of \ escapes.
688 if test -n "${ZSH_VERSION+set}" ; then
689 setopt NO_GLOB_SUBST
690 fi
691
692 cfgfile="${ofile}T"
693 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
694 $RM "$cfgfile"
695
696 cat <<_LT_EOF >> "$cfgfile"
697 #! $SHELL
698
699 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
700 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
701 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
702 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
703 #
704 _LT_COPYING
705 _LT_LIBTOOL_TAGS
706
707 # ### BEGIN LIBTOOL CONFIG
708 _LT_LIBTOOL_CONFIG_VARS
709 _LT_LIBTOOL_TAG_VARS
710 # ### END LIBTOOL CONFIG
711
712 _LT_EOF
713
714 case $host_os in
715 aix3*)
716 cat <<\_LT_EOF >> "$cfgfile"
717 # AIX sometimes has problems with the GCC collect2 program. For some
718 # reason, if we set the COLLECT_NAMES environment variable, the problems
719 # vanish in a puff of smoke.
720 if test "X${COLLECT_NAMES+set}" != Xset; then
721 COLLECT_NAMES=
722 export COLLECT_NAMES
723 fi
724 _LT_EOF
725 ;;
726 esac
727
728 _LT_PROG_LTMAIN
729
730 # We use sed instead of cat because bash on DJGPP gets confused if
731 # if finds mixed CR/LF and LF-only lines. Since sed operates in
732 # text mode, it properly converts lines to CR/LF. This bash problem
733 # is reportedly fixed, but why not run on old versions too?
734 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
735 || (rm -f "$cfgfile"; exit 1)
736
737 _LT_PROG_XSI_SHELLFNS
738
739 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
740 || (rm -f "$cfgfile"; exit 1)
741
742 mv -f "$cfgfile" "$ofile" ||
743 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
744 chmod +x "$ofile"
745 ],
746 [cat <<_LT_EOF >> "$ofile"
747
748 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
749 dnl in a comment (ie after a #).
750 # ### BEGIN LIBTOOL TAG CONFIG: $1
751 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
752 # ### END LIBTOOL TAG CONFIG: $1
753 _LT_EOF
754 ])dnl /m4_if
755 ],
756 [m4_if([$1], [], [
757 PACKAGE='$PACKAGE'
758 VERSION='$VERSION'
759 TIMESTAMP='$TIMESTAMP'
760 RM='$RM'
761 ofile='$ofile'], [])
762 ])dnl /_LT_CONFIG_SAVE_COMMANDS
763 ])# _LT_CONFIG
764
765
766 # LT_SUPPORTED_TAG(TAG)
767 # ---------------------
768 # Trace this macro to discover what tags are supported by the libtool
769 # --tag option, using:
770 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
771 AC_DEFUN([LT_SUPPORTED_TAG], [])
772
773
774 # C support is built-in for now
775 m4_define([_LT_LANG_C_enabled], [])
776 m4_define([_LT_TAGS], [])
777
778
779 # LT_LANG(LANG)
780 # -------------
781 # Enable libtool support for the given language if not already enabled.
782 AC_DEFUN([LT_LANG],
783 [AC_BEFORE([$0], [LT_OUTPUT])dnl
784 m4_case([$1],
785 [C], [_LT_LANG(C)],
786 [C++], [_LT_LANG(CXX)],
787 [Java], [_LT_LANG(GCJ)],
788 [Fortran 77], [_LT_LANG(F77)],
789 [Fortran], [_LT_LANG(FC)],
790 [Windows Resource], [_LT_LANG(RC)],
791 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
792 [_LT_LANG($1)],
793 [m4_fatal([$0: unsupported language: "$1"])])])dnl
794 ])# LT_LANG
795
796
797 # _LT_LANG(LANGNAME)
798 # ------------------
799 m4_defun([_LT_LANG],
800 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
801 [LT_SUPPORTED_TAG([$1])dnl
802 m4_append([_LT_TAGS], [$1 ])dnl
803 m4_define([_LT_LANG_]$1[_enabled], [])dnl
804 _LT_LANG_$1_CONFIG($1)])dnl
805 ])# _LT_LANG
806
807
808 # _LT_LANG_DEFAULT_CONFIG
809 # -----------------------
810 m4_defun([_LT_LANG_DEFAULT_CONFIG],
811 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
812 [LT_LANG(CXX)],
813 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
814
815 AC_PROVIDE_IFELSE([AC_PROG_F77],
816 [LT_LANG(F77)],
817 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
818
819 AC_PROVIDE_IFELSE([AC_PROG_FC],
820 [LT_LANG(FC)],
821 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
822
823 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
824 dnl pulling things in needlessly.
825 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
826 [LT_LANG(GCJ)],
827 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
828 [LT_LANG(GCJ)],
829 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
830 [LT_LANG(GCJ)],
831 [m4_ifdef([AC_PROG_GCJ],
832 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
833 m4_ifdef([A][M_PROG_GCJ],
834 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
835 m4_ifdef([LT_PROG_GCJ],
836 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
837
838 AC_PROVIDE_IFELSE([LT_PROG_RC],
839 [LT_LANG(RC)],
840 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
841 ])# _LT_LANG_DEFAULT_CONFIG
842
843 # Obsolete macros:
844 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
845 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
846 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
847 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
848 dnl aclocal-1.4 backwards compatibility:
849 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
850 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
851 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
852 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
853
854
855 # _LT_TAG_COMPILER
856 # ----------------
857 m4_defun([_LT_TAG_COMPILER],
858 [AC_REQUIRE([AC_PROG_CC])dnl
859
860 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
861 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
862 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
863 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
864
865 # If no C compiler was specified, use CC.
866 LTCC=${LTCC-"$CC"}
867
868 # If no C compiler flags were specified, use CFLAGS.
869 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
870
871 # Allow CC to be a program name with arguments.
872 compiler=$CC
873 ])# _LT_TAG_COMPILER
874
875
876 # _LT_COMPILER_BOILERPLATE
877 # ------------------------
878 # Check for compiler boilerplate output or warnings with
879 # the simple compiler test code.
880 m4_defun([_LT_COMPILER_BOILERPLATE],
881 [m4_require([_LT_DECL_SED])dnl
882 ac_outfile=conftest.$ac_objext
883 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
884 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
885 _lt_compiler_boilerplate=`cat conftest.err`
886 $RM conftest*
887 ])# _LT_COMPILER_BOILERPLATE
888
889
890 # _LT_LINKER_BOILERPLATE
891 # ----------------------
892 # Check for linker boilerplate output or warnings with
893 # the simple link test code.
894 m4_defun([_LT_LINKER_BOILERPLATE],
895 [m4_require([_LT_DECL_SED])dnl
896 ac_outfile=conftest.$ac_objext
897 echo "$lt_simple_link_test_code" >conftest.$ac_ext
898 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
899 _lt_linker_boilerplate=`cat conftest.err`
900 $RM -r conftest*
901 ])# _LT_LINKER_BOILERPLATE
902
903 # _LT_REQUIRED_DARWIN_CHECKS
904 # -------------------------
905 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
906 case $host_os in
907 rhapsody* | darwin*)
908 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
909 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
910 AC_CHECK_TOOL([LIPO], [lipo], [:])
911 AC_CHECK_TOOL([OTOOL], [otool], [:])
912 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
913 _LT_DECL([], [DSYMUTIL], [1],
914 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
915 _LT_DECL([], [NMEDIT], [1],
916 [Tool to change global to local symbols on Mac OS X])
917 _LT_DECL([], [LIPO], [1],
918 [Tool to manipulate fat objects and archives on Mac OS X])
919 _LT_DECL([], [OTOOL], [1],
920 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
921 _LT_DECL([], [OTOOL64], [1],
922 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
923
924 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
925 [lt_cv_apple_cc_single_mod=no
926 if test -z "${LT_MULTI_MODULE}"; then
927 # By default we will add the -single_module flag. You can override
928 # by either setting the environment variable LT_MULTI_MODULE
929 # non-empty at configure time, or by adding -multi_module to the
930 # link flags.
931 rm -rf libconftest.dylib*
932 echo "int foo(void){return 1;}" > conftest.c
933 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
934 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
935 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
936 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
937 _lt_result=$?
938 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
939 lt_cv_apple_cc_single_mod=yes
940 else
941 cat conftest.err >&AS_MESSAGE_LOG_FD
942 fi
943 rm -rf libconftest.dylib*
944 rm -f conftest.*
945 fi])
946 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
947 [lt_cv_ld_exported_symbols_list],
948 [lt_cv_ld_exported_symbols_list=no
949 save_LDFLAGS=$LDFLAGS
950 echo "_main" > conftest.sym
951 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
952 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
953 [lt_cv_ld_exported_symbols_list=yes],
954 [lt_cv_ld_exported_symbols_list=no])
955 LDFLAGS="$save_LDFLAGS"
956 ])
957 case $host_os in
958 rhapsody* | darwin1.[[012]])
959 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
960 darwin1.*)
961 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
962 darwin*) # darwin 5.x on
963 # if running on 10.5 or later, the deployment target defaults
964 # to the OS version, if on x86, and 10.4, the deployment
965 # target defaults to 10.4. Don't you love it?
966 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
967 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
968 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
969 10.[[012]]*)
970 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
971 10.*)
972 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
973 esac
974 ;;
975 esac
976 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
977 _lt_dar_single_mod='$single_module'
978 fi
979 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
980 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
981 else
982 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
983 fi
984 if test "$DSYMUTIL" != ":"; then
985 _lt_dsymutil='~$DSYMUTIL $lib || :'
986 else
987 _lt_dsymutil=
988 fi
989 ;;
990 esac
991 ])
992
993
994 # _LT_DARWIN_LINKER_FEATURES
995 # --------------------------
996 # Checks for linker and compiler features on darwin
997 m4_defun([_LT_DARWIN_LINKER_FEATURES],
998 [
999 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1000 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1001 _LT_TAGVAR(hardcode_direct, $1)=no
1002 _LT_TAGVAR(hardcode_automatic, $1)=yes
1003 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1004 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1005 _LT_TAGVAR(link_all_deplibs, $1)=yes
1006 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1007 case $cc_basename in
1008 ifort*) _lt_dar_can_shared=yes ;;
1009 *) _lt_dar_can_shared=$GCC ;;
1010 esac
1011 if test "$_lt_dar_can_shared" = "yes"; then
1012 output_verbose_link_cmd=echo
1013 _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}"
1014 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1015 _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}"
1016 _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}"
1017 m4_if([$1], [CXX],
1018 [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1019 _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}"
1020 _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}"
1021 fi
1022 ],[])
1023 else
1024 _LT_TAGVAR(ld_shlibs, $1)=no
1025 fi
1026 ])
1027
1028 # _LT_SYS_MODULE_PATH_AIX
1029 # -----------------------
1030 # Links a minimal program and checks the executable
1031 # for the system default hardcoded library path. In most cases,
1032 # this is /usr/lib:/lib, but when the MPI compilers are used
1033 # the location of the communication and MPI libs are included too.
1034 # If we don't find anything, use the default library path according
1035 # to the aix ld manual.
1036 m4_defun([_LT_SYS_MODULE_PATH_AIX],
1037 [m4_require([_LT_DECL_SED])dnl
1038 AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1039 lt_aix_libpath_sed='
1040 /Import File Strings/,/^$/ {
1041 /^0/ {
1042 s/^0 *\(.*\)$/\1/
1043 p
1044 }
1045 }'
1046 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1047 # Check for a 64-bit object if we didn't find anything.
1048 if test -z "$aix_libpath"; then
1049 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1050 fi],[])
1051 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1052 ])# _LT_SYS_MODULE_PATH_AIX
1053
1054
1055 # _LT_SHELL_INIT(ARG)
1056 # -------------------
1057 m4_define([_LT_SHELL_INIT],
1058 [ifdef([AC_DIVERSION_NOTICE],
1059 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1060 [AC_DIVERT_PUSH(NOTICE)])
1061 $1
1062 AC_DIVERT_POP
1063 ])# _LT_SHELL_INIT
1064
1065
1066 # _LT_PROG_ECHO_BACKSLASH
1067 # -----------------------
1068 # Add some code to the start of the generated configure script which
1069 # will find an echo command which doesn't interpret backslashes.
1070 m4_defun([_LT_PROG_ECHO_BACKSLASH],
1071 [_LT_SHELL_INIT([
1072 # Check that we are running under the correct shell.
1073 SHELL=${CONFIG_SHELL-/bin/sh}
1074
1075 case X$lt_ECHO in
1076 X*--fallback-echo)
1077 # Remove one level of quotation (which was required for Make).
1078 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1079 ;;
1080 esac
1081
1082 ECHO=${lt_ECHO-echo}
1083 if test "X[$]1" = X--no-reexec; then
1084 # Discard the --no-reexec flag, and continue.
1085 shift
1086 elif test "X[$]1" = X--fallback-echo; then
1087 # Avoid inline document here, it may be left over
1088 :
1089 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1090 # Yippee, $ECHO works!
1091 :
1092 else
1093 # Restart under the correct shell.
1094 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1095 fi
1096
1097 if test "X[$]1" = X--fallback-echo; then
1098 # used as fallback echo
1099 shift
1100 cat <<_LT_EOF
1101 [$]*
1102 _LT_EOF
1103 exit 0
1104 fi
1105
1106 # The HP-UX ksh and POSIX shell print the target directory to stdout
1107 # if CDPATH is set.
1108 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1109
1110 if test -z "$lt_ECHO"; then
1111 if test "X${echo_test_string+set}" != Xset; then
1112 # find a string as large as possible, as long as the shell can cope with it
1113 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1114 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1115 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1116 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1117 then
1118 break
1119 fi
1120 done
1121 fi
1122
1123 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1124 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1125 test "X$echo_testing_string" = "X$echo_test_string"; then
1126 :
1127 else
1128 # The Solaris, AIX, and Digital Unix default echo programs unquote
1129 # backslashes. This makes it impossible to quote backslashes using
1130 # echo "$something" | sed 's/\\/\\\\/g'
1131 #
1132 # So, first we look for a working echo in the user's PATH.
1133
1134 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1135 for dir in $PATH /usr/ucb; do
1136 IFS="$lt_save_ifs"
1137 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1138 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1139 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1140 test "X$echo_testing_string" = "X$echo_test_string"; then
1141 ECHO="$dir/echo"
1142 break
1143 fi
1144 done
1145 IFS="$lt_save_ifs"
1146
1147 if test "X$ECHO" = Xecho; then
1148 # We didn't find a better echo, so look for alternatives.
1149 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1150 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1151 test "X$echo_testing_string" = "X$echo_test_string"; then
1152 # This shell has a builtin print -r that does the trick.
1153 ECHO='print -r'
1154 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1155 test "X$CONFIG_SHELL" != X/bin/ksh; then
1156 # If we have ksh, try running configure again with it.
1157 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1158 export ORIGINAL_CONFIG_SHELL
1159 CONFIG_SHELL=/bin/ksh
1160 export CONFIG_SHELL
1161 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1162 else
1163 # Try using printf.
1164 ECHO='printf %s\n'
1165 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1166 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1167 test "X$echo_testing_string" = "X$echo_test_string"; then
1168 # Cool, printf works
1169 :
1170 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1171 test "X$echo_testing_string" = 'X\t' &&
1172 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1173 test "X$echo_testing_string" = "X$echo_test_string"; then
1174 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1175 export CONFIG_SHELL
1176 SHELL="$CONFIG_SHELL"
1177 export SHELL
1178 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1179 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1180 test "X$echo_testing_string" = 'X\t' &&
1181 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1182 test "X$echo_testing_string" = "X$echo_test_string"; then
1183 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1184 else
1185 # maybe with a smaller string...
1186 prev=:
1187
1188 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1189 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1190 then
1191 break
1192 fi
1193 prev="$cmd"
1194 done
1195
1196 if test "$prev" != 'sed 50q "[$]0"'; then
1197 echo_test_string=`eval $prev`
1198 export echo_test_string
1199 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1200 else
1201 # Oops. We lost completely, so just stick with echo.
1202 ECHO=echo
1203 fi
1204 fi
1205 fi
1206 fi
1207 fi
1208 fi
1209
1210 # Copy echo and quote the copy suitably for passing to libtool from
1211 # the Makefile, instead of quoting the original, which is used later.
1212 lt_ECHO=$ECHO
1213 if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1214 lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1215 fi
1216
1217 AC_SUBST(lt_ECHO)
1218 ])
1219 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1220 _LT_DECL([], [ECHO], [1],
1221 [An echo program that does not interpret backslashes])
1222 ])# _LT_PROG_ECHO_BACKSLASH
1223
1224
1225 # _LT_ENABLE_LOCK
1226 # ---------------
1227 m4_defun([_LT_ENABLE_LOCK],
1228 [AC_ARG_ENABLE([libtool-lock],
1229 [AS_HELP_STRING([--disable-libtool-lock],
1230 [avoid locking (might break parallel builds)])])
1231 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1232
1233 # Some flags need to be propagated to the compiler or linker for good
1234 # libtool support.
1235 case $host in
1236 ia64-*-hpux*)
1237 # Find out which ABI we are using.
1238 echo 'int i;' > conftest.$ac_ext
1239 if AC_TRY_EVAL(ac_compile); then
1240 case `/usr/bin/file conftest.$ac_objext` in
1241 *ELF-32*)
1242 HPUX_IA64_MODE="32"
1243 ;;
1244 *ELF-64*)
1245 HPUX_IA64_MODE="64"
1246 ;;
1247 esac
1248 fi
1249 rm -rf conftest*
1250 ;;
1251 *-*-irix6*)
1252 # Find out which ABI we are using.
1253 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1254 if AC_TRY_EVAL(ac_compile); then
1255 if test "$lt_cv_prog_gnu_ld" = yes; then
1256 case `/usr/bin/file conftest.$ac_objext` in
1257 *32-bit*)
1258 LD="${LD-ld} -melf32bsmip"
1259 ;;
1260 *N32*)
1261 LD="${LD-ld} -melf32bmipn32"
1262 ;;
1263 *64-bit*)
1264 LD="${LD-ld} -melf64bmip"
1265 ;;
1266 esac
1267 else
1268 case `/usr/bin/file conftest.$ac_objext` in
1269 *32-bit*)
1270 LD="${LD-ld} -32"
1271 ;;
1272 *N32*)
1273 LD="${LD-ld} -n32"
1274 ;;
1275 *64-bit*)
1276 LD="${LD-ld} -64"
1277 ;;
1278 esac
1279 fi
1280 fi
1281 rm -rf conftest*
1282 ;;
1283
1284 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1285 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1286 # Find out which ABI we are using.
1287 echo 'int i;' > conftest.$ac_ext
1288 if AC_TRY_EVAL(ac_compile); then
1289 case `/usr/bin/file conftest.o` in
1290 *32-bit*)
1291 case $host in
1292 x86_64-*kfreebsd*-gnu)
1293 LD="${LD-ld} -m elf_i386_fbsd"
1294 ;;
1295 x86_64-*linux*)
1296 LD="${LD-ld} -m elf_i386"
1297 ;;
1298 ppc64-*linux*|powerpc64-*linux*)
1299 LD="${LD-ld} -m elf32ppclinux"
1300 ;;
1301 s390x-*linux*)
1302 LD="${LD-ld} -m elf_s390"
1303 ;;
1304 sparc64-*linux*)
1305 LD="${LD-ld} -m elf32_sparc"
1306 ;;
1307 esac
1308 ;;
1309 *64-bit*)
1310 case $host in
1311 x86_64-*kfreebsd*-gnu)
1312 LD="${LD-ld} -m elf_x86_64_fbsd"
1313 ;;
1314 x86_64-*linux*)
1315 LD="${LD-ld} -m elf_x86_64"
1316 ;;
1317 ppc*-*linux*|powerpc*-*linux*)
1318 LD="${LD-ld} -m elf64ppc"
1319 ;;
1320 s390*-*linux*|s390*-*tpf*)
1321 LD="${LD-ld} -m elf64_s390"
1322 ;;
1323 sparc*-*linux*)
1324 LD="${LD-ld} -m elf64_sparc"
1325 ;;
1326 esac
1327 ;;
1328 esac
1329 fi
1330 rm -rf conftest*
1331 ;;
1332
1333 *-*-sco3.2v5*)
1334 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1335 SAVE_CFLAGS="$CFLAGS"
1336 CFLAGS="$CFLAGS -belf"
1337 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1338 [AC_LANG_PUSH(C)
1339 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1340 AC_LANG_POP])
1341 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1342 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1343 CFLAGS="$SAVE_CFLAGS"
1344 fi
1345 ;;
1346 sparc*-*solaris*)
1347 # Find out which ABI we are using.
1348 echo 'int i;' > conftest.$ac_ext
1349 if AC_TRY_EVAL(ac_compile); then
1350 case `/usr/bin/file conftest.o` in
1351 *64-bit*)
1352 case $lt_cv_prog_gnu_ld in
1353 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1354 *)
1355 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1356 LD="${LD-ld} -64"
1357 fi
1358 ;;
1359 esac
1360 ;;
1361 esac
1362 fi
1363 rm -rf conftest*
1364 ;;
1365 esac
1366
1367 need_locks="$enable_libtool_lock"
1368 ])# _LT_ENABLE_LOCK
1369
1370
1371 # _LT_CMD_OLD_ARCHIVE
1372 # -------------------
1373 m4_defun([_LT_CMD_OLD_ARCHIVE],
1374 [AC_CHECK_TOOL(AR, ar, false)
1375 test -z "$AR" && AR=ar
1376 test -z "$AR_FLAGS" && AR_FLAGS=cru
1377 _LT_DECL([], [AR], [1], [The archiver])
1378 _LT_DECL([], [AR_FLAGS], [1])
1379
1380 AC_CHECK_TOOL(STRIP, strip, :)
1381 test -z "$STRIP" && STRIP=:
1382 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
1383
1384 AC_CHECK_TOOL(RANLIB, ranlib, :)
1385 test -z "$RANLIB" && RANLIB=:
1386 _LT_DECL([], [RANLIB], [1],
1387 [Commands used to install an old-style archive])
1388
1389 # Determine commands to create old-style static archives.
1390 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1391 old_postinstall_cmds='chmod 644 $oldlib'
1392 old_postuninstall_cmds=
1393
1394 if test -n "$RANLIB"; then
1395 case $host_os in
1396 openbsd*)
1397 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1398 ;;
1399 *)
1400 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1401 ;;
1402 esac
1403 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1404 fi
1405 _LT_DECL([], [old_postinstall_cmds], [2])
1406 _LT_DECL([], [old_postuninstall_cmds], [2])
1407 _LT_TAGDECL([], [old_archive_cmds], [2],
1408 [Commands used to build an old-style archive])
1409 ])# _LT_CMD_OLD_ARCHIVE
1410
1411
1412 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1413 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1414 # ----------------------------------------------------------------
1415 # Check whether the given compiler option works
1416 AC_DEFUN([_LT_COMPILER_OPTION],
1417 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1418 m4_require([_LT_DECL_SED])dnl
1419 AC_CACHE_CHECK([$1], [$2],
1420 [$2=no
1421 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1422 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1423 lt_compiler_flag="$3"
1424 # Insert the option either (1) after the last *FLAGS variable, or
1425 # (2) before a word containing "conftest.", or (3) at the end.
1426 # Note that $ac_compile itself does not contain backslashes and begins
1427 # with a dollar sign (not a hyphen), so the echo should work correctly.
1428 # The option is referenced via a variable to avoid confusing sed.
1429 lt_compile=`echo "$ac_compile" | $SED \
1430 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1431 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1432 -e 's:$: $lt_compiler_flag:'`
1433 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1434 (eval "$lt_compile" 2>conftest.err)
1435 ac_status=$?
1436 cat conftest.err >&AS_MESSAGE_LOG_FD
1437 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1438 if (exit $ac_status) && test -s "$ac_outfile"; then
1439 # The compiler can only warn and ignore the option if not recognized
1440 # So say no if there are warnings other than the usual output.
1441 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1442 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1443 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1444 $2=yes
1445 fi
1446 fi
1447 $RM conftest*
1448 ])
1449
1450 if test x"[$]$2" = xyes; then
1451 m4_if([$5], , :, [$5])
1452 else
1453 m4_if([$6], , :, [$6])
1454 fi
1455 ])# _LT_COMPILER_OPTION
1456
1457 # Old name:
1458 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1459 dnl aclocal-1.4 backwards compatibility:
1460 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1461
1462
1463 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1464 # [ACTION-SUCCESS], [ACTION-FAILURE])
1465 # ----------------------------------------------------
1466 # Check whether the given linker option works
1467 AC_DEFUN([_LT_LINKER_OPTION],
1468 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1469 m4_require([_LT_DECL_SED])dnl
1470 AC_CACHE_CHECK([$1], [$2],
1471 [$2=no
1472 save_LDFLAGS="$LDFLAGS"
1473 LDFLAGS="$LDFLAGS $3"
1474 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1475 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1476 # The linker can only warn and ignore the option if not recognized
1477 # So say no if there are warnings
1478 if test -s conftest.err; then
1479 # Append any errors to the config.log.
1480 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1481 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1482 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1483 if diff conftest.exp conftest.er2 >/dev/null; then
1484 $2=yes
1485 fi
1486 else
1487 $2=yes
1488 fi
1489 fi
1490 $RM -r conftest*
1491 LDFLAGS="$save_LDFLAGS"
1492 ])
1493
1494 if test x"[$]$2" = xyes; then
1495 m4_if([$4], , :, [$4])
1496 else
1497 m4_if([$5], , :, [$5])
1498 fi
1499 ])# _LT_LINKER_OPTION
1500
1501 # Old name:
1502 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1503 dnl aclocal-1.4 backwards compatibility:
1504 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1505
1506
1507 # LT_CMD_MAX_LEN
1508 #---------------
1509 AC_DEFUN([LT_CMD_MAX_LEN],
1510 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1511 # find the maximum length of command line arguments
1512 AC_MSG_CHECKING([the maximum length of command line arguments])
1513 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1514 i=0
1515 teststring="ABCD"
1516
1517 case $build_os in
1518 msdosdjgpp*)
1519 # On DJGPP, this test can blow up pretty badly due to problems in libc
1520 # (any single argument exceeding 2000 bytes causes a buffer overrun
1521 # during glob expansion). Even if it were fixed, the result of this
1522 # check would be larger than it should be.
1523 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1524 ;;
1525
1526 gnu*)
1527 # Under GNU Hurd, this test is not required because there is
1528 # no limit to the length of command line arguments.
1529 # Libtool will interpret -1 as no limit whatsoever
1530 lt_cv_sys_max_cmd_len=-1;
1531 ;;
1532
1533 cygwin* | mingw* | cegcc*)
1534 # On Win9x/ME, this test blows up -- it succeeds, but takes
1535 # about 5 minutes as the teststring grows exponentially.
1536 # Worse, since 9x/ME are not pre-emptively multitasking,
1537 # you end up with a "frozen" computer, even though with patience
1538 # the test eventually succeeds (with a max line length of 256k).
1539 # Instead, let's just punt: use the minimum linelength reported by
1540 # all of the supported platforms: 8192 (on NT/2K/XP).
1541 lt_cv_sys_max_cmd_len=8192;
1542 ;;
1543
1544 amigaos*)
1545 # On AmigaOS with pdksh, this test takes hours, literally.
1546 # So we just punt and use a minimum line length of 8192.
1547 lt_cv_sys_max_cmd_len=8192;
1548 ;;
1549
1550 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1551 # This has been around since 386BSD, at least. Likely further.
1552 if test -x /sbin/sysctl; then
1553 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1554 elif test -x /usr/sbin/sysctl; then
1555 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1556 else
1557 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1558 fi
1559 # And add a safety zone
1560 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1561 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1562 ;;
1563
1564 interix*)
1565 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1566 lt_cv_sys_max_cmd_len=196608
1567 ;;
1568
1569 osf*)
1570 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1571 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1572 # nice to cause kernel panics so lets avoid the loop below.
1573 # First set a reasonable default.
1574 lt_cv_sys_max_cmd_len=16384
1575 #
1576 if test -x /sbin/sysconfig; then
1577 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1578 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1579 esac
1580 fi
1581 ;;
1582 sco3.2v5*)
1583 lt_cv_sys_max_cmd_len=102400
1584 ;;
1585 sysv5* | sco5v6* | sysv4.2uw2*)
1586 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1587 if test -n "$kargmax"; then
1588 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1589 else
1590 lt_cv_sys_max_cmd_len=32768
1591 fi
1592 ;;
1593 *)
1594 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1595 if test -n "$lt_cv_sys_max_cmd_len"; then
1596 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1597 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1598 else
1599 # Make teststring a little bigger before we do anything with it.
1600 # a 1K string should be a reasonable start.
1601 for i in 1 2 3 4 5 6 7 8 ; do
1602 teststring=$teststring$teststring
1603 done
1604 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1605 # If test is not a shell built-in, we'll probably end up computing a
1606 # maximum length that is only half of the actual maximum length, but
1607 # we can't tell.
1608 while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1609 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1610 test $i != 17 # 1/2 MB should be enough
1611 do
1612 i=`expr $i + 1`
1613 teststring=$teststring$teststring
1614 done
1615 # Only check the string length outside the loop.
1616 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1617 teststring=
1618 # Add a significant safety factor because C++ compilers can tack on
1619 # massive amounts of additional arguments before passing them to the
1620 # linker. It appears as though 1/2 is a usable value.
1621 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1622 fi
1623 ;;
1624 esac
1625 ])
1626 if test -n $lt_cv_sys_max_cmd_len ; then
1627 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1628 else
1629 AC_MSG_RESULT(none)
1630 fi
1631 max_cmd_len=$lt_cv_sys_max_cmd_len
1632 _LT_DECL([], [max_cmd_len], [0],
1633 [What is the maximum length of a command?])
1634 ])# LT_CMD_MAX_LEN
1635
1636 # Old name:
1637 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1638 dnl aclocal-1.4 backwards compatibility:
1639 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1640
1641
1642 # _LT_HEADER_DLFCN
1643 # ----------------
1644 m4_defun([_LT_HEADER_DLFCN],
1645 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1646 ])# _LT_HEADER_DLFCN
1647
1648
1649 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1650 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1651 # ----------------------------------------------------------------
1652 m4_defun([_LT_TRY_DLOPEN_SELF],
1653 [m4_require([_LT_HEADER_DLFCN])dnl
1654 if test "$cross_compiling" = yes; then :
1655 [$4]
1656 else
1657 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1658 lt_status=$lt_dlunknown
1659 cat > conftest.$ac_ext <<_LT_EOF
1660 [#line __oline__ "configure"
1661 #include "confdefs.h"
1662
1663 #if HAVE_DLFCN_H
1664 #include <dlfcn.h>
1665 #endif
1666
1667 #include <stdio.h>
1668
1669 #ifdef RTLD_GLOBAL
1670 # define LT_DLGLOBAL RTLD_GLOBAL
1671 #else
1672 # ifdef DL_GLOBAL
1673 # define LT_DLGLOBAL DL_GLOBAL
1674 # else
1675 # define LT_DLGLOBAL 0
1676 # endif
1677 #endif
1678
1679 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1680 find out it does not work in some platform. */
1681 #ifndef LT_DLLAZY_OR_NOW
1682 # ifdef RTLD_LAZY
1683 # define LT_DLLAZY_OR_NOW RTLD_LAZY
1684 # else
1685 # ifdef DL_LAZY
1686 # define LT_DLLAZY_OR_NOW DL_LAZY
1687 # else
1688 # ifdef RTLD_NOW
1689 # define LT_DLLAZY_OR_NOW RTLD_NOW
1690 # else
1691 # ifdef DL_NOW
1692 # define LT_DLLAZY_OR_NOW DL_NOW
1693 # else
1694 # define LT_DLLAZY_OR_NOW 0
1695 # endif
1696 # endif
1697 # endif
1698 # endif
1699 #endif
1700
1701 void fnord() { int i=42;}
1702 int main ()
1703 {
1704 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1705 int status = $lt_dlunknown;
1706
1707 if (self)
1708 {
1709 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1710 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1711 /* dlclose (self); */
1712 }
1713 else
1714 puts (dlerror ());
1715
1716 return status;
1717 }]
1718 _LT_EOF
1719 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1720 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1721 lt_status=$?
1722 case x$lt_status in
1723 x$lt_dlno_uscore) $1 ;;
1724 x$lt_dlneed_uscore) $2 ;;
1725 x$lt_dlunknown|x*) $3 ;;
1726 esac
1727 else :
1728 # compilation failed
1729 $3
1730 fi
1731 fi
1732 rm -fr conftest*
1733 ])# _LT_TRY_DLOPEN_SELF
1734
1735
1736 # LT_SYS_DLOPEN_SELF
1737 # ------------------
1738 AC_DEFUN([LT_SYS_DLOPEN_SELF],
1739 [m4_require([_LT_HEADER_DLFCN])dnl
1740 if test "x$enable_dlopen" != xyes; then
1741 enable_dlopen=unknown
1742 enable_dlopen_self=unknown
1743 enable_dlopen_self_static=unknown
1744 else
1745 lt_cv_dlopen=no
1746 lt_cv_dlopen_libs=
1747
1748 case $host_os in
1749 beos*)
1750 lt_cv_dlopen="load_add_on"
1751 lt_cv_dlopen_libs=
1752 lt_cv_dlopen_self=yes
1753 ;;
1754
1755 mingw* | pw32* | cegcc*)
1756 lt_cv_dlopen="LoadLibrary"
1757 lt_cv_dlopen_libs=
1758 ;;
1759
1760 cygwin*)
1761 lt_cv_dlopen="dlopen"
1762 lt_cv_dlopen_libs=
1763 ;;
1764
1765 darwin*)
1766 # if libdl is installed we need to link against it
1767 AC_CHECK_LIB([dl], [dlopen],
1768 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1769 lt_cv_dlopen="dyld"
1770 lt_cv_dlopen_libs=
1771 lt_cv_dlopen_self=yes
1772 ])
1773 ;;
1774
1775 *)
1776 AC_CHECK_FUNC([shl_load],
1777 [lt_cv_dlopen="shl_load"],
1778 [AC_CHECK_LIB([dld], [shl_load],
1779 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1780 [AC_CHECK_FUNC([dlopen],
1781 [lt_cv_dlopen="dlopen"],
1782 [AC_CHECK_LIB([dl], [dlopen],
1783 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1784 [AC_CHECK_LIB([svld], [dlopen],
1785 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1786 [AC_CHECK_LIB([dld], [dld_link],
1787 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1788 ])
1789 ])
1790 ])
1791 ])
1792 ])
1793 ;;
1794 esac
1795
1796 if test "x$lt_cv_dlopen" != xno; then
1797 enable_dlopen=yes
1798 else
1799 enable_dlopen=no
1800 fi
1801
1802 case $lt_cv_dlopen in
1803 dlopen)
1804 save_CPPFLAGS="$CPPFLAGS"
1805 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1806
1807 save_LDFLAGS="$LDFLAGS"
1808 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1809
1810 save_LIBS="$LIBS"
1811 LIBS="$lt_cv_dlopen_libs $LIBS"
1812
1813 AC_CACHE_CHECK([whether a program can dlopen itself],
1814 lt_cv_dlopen_self, [dnl
1815 _LT_TRY_DLOPEN_SELF(
1816 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1817 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1818 ])
1819
1820 if test "x$lt_cv_dlopen_self" = xyes; then
1821 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1822 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1823 lt_cv_dlopen_self_static, [dnl
1824 _LT_TRY_DLOPEN_SELF(
1825 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1826 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1827 ])
1828 fi
1829
1830 CPPFLAGS="$save_CPPFLAGS"
1831 LDFLAGS="$save_LDFLAGS"
1832 LIBS="$save_LIBS"
1833 ;;
1834 esac
1835
1836 case $lt_cv_dlopen_self in
1837 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1838 *) enable_dlopen_self=unknown ;;
1839 esac
1840
1841 case $lt_cv_dlopen_self_static in
1842 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1843 *) enable_dlopen_self_static=unknown ;;
1844 esac
1845 fi
1846 _LT_DECL([dlopen_support], [enable_dlopen], [0],
1847 [Whether dlopen is supported])
1848 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1849 [Whether dlopen of programs is supported])
1850 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1851 [Whether dlopen of statically linked programs is supported])
1852 ])# LT_SYS_DLOPEN_SELF
1853
1854 # Old name:
1855 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1856 dnl aclocal-1.4 backwards compatibility:
1857 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1858
1859
1860 # _LT_COMPILER_C_O([TAGNAME])
1861 # ---------------------------
1862 # Check to see if options -c and -o are simultaneously supported by compiler.
1863 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
1864 m4_defun([_LT_COMPILER_C_O],
1865 [m4_require([_LT_DECL_SED])dnl
1866 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1867 m4_require([_LT_TAG_COMPILER])dnl
1868 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1869 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1870 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1871 $RM -r conftest 2>/dev/null
1872 mkdir conftest
1873 cd conftest
1874 mkdir out
1875 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1876
1877 lt_compiler_flag="-o out/conftest2.$ac_objext"
1878 # Insert the option either (1) after the last *FLAGS variable, or
1879 # (2) before a word containing "conftest.", or (3) at the end.
1880 # Note that $ac_compile itself does not contain backslashes and begins
1881 # with a dollar sign (not a hyphen), so the echo should work correctly.
1882 lt_compile=`echo "$ac_compile" | $SED \
1883 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1884 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1885 -e 's:$: $lt_compiler_flag:'`
1886 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1887 (eval "$lt_compile" 2>out/conftest.err)
1888 ac_status=$?
1889 cat out/conftest.err >&AS_MESSAGE_LOG_FD
1890 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1891 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1892 then
1893 # The compiler can only warn and ignore the option if not recognized
1894 # So say no if there are warnings
1895 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1896 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1897 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1898 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1899 fi
1900 fi
1901 chmod u+w . 2>&AS_MESSAGE_LOG_FD
1902 $RM conftest*
1903 # SGI C++ compiler will create directory out/ii_files/ for
1904 # template instantiation
1905 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1906 $RM out/* && rmdir out
1907 cd ..
1908 $RM -r conftest
1909 $RM conftest*
1910 ])
1911 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1912 [Does compiler simultaneously support -c and -o options?])
1913 ])# _LT_COMPILER_C_O
1914
1915
1916 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
1917 # ----------------------------------
1918 # Check to see if we can do hard links to lock some files if needed
1919 m4_defun([_LT_COMPILER_FILE_LOCKS],
1920 [m4_require([_LT_ENABLE_LOCK])dnl
1921 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1922 _LT_COMPILER_C_O([$1])
1923
1924 hard_links="nottested"
1925 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1926 # do not overwrite the value of need_locks provided by the user
1927 AC_MSG_CHECKING([if we can lock with hard links])
1928 hard_links=yes
1929 $RM conftest*
1930 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1931 touch conftest.a
1932 ln conftest.a conftest.b 2>&5 || hard_links=no
1933 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1934 AC_MSG_RESULT([$hard_links])
1935 if test "$hard_links" = no; then
1936 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1937 need_locks=warn
1938 fi
1939 else
1940 need_locks=no
1941 fi
1942 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1943 ])# _LT_COMPILER_FILE_LOCKS
1944
1945
1946 # _LT_CHECK_OBJDIR
1947 # ----------------
1948 m4_defun([_LT_CHECK_OBJDIR],
1949 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1950 [rm -f .libs 2>/dev/null
1951 mkdir .libs 2>/dev/null
1952 if test -d .libs; then
1953 lt_cv_objdir=.libs
1954 else
1955 # MS-DOS does not allow filenames that begin with a dot.
1956 lt_cv_objdir=_libs
1957 fi
1958 rmdir .libs 2>/dev/null])
1959 objdir=$lt_cv_objdir
1960 _LT_DECL([], [objdir], [0],
1961 [The name of the directory that contains temporary libtool files])dnl
1962 m4_pattern_allow([LT_OBJDIR])dnl
1963 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1964 [Define to the sub-directory in which libtool stores uninstalled libraries.])
1965 ])# _LT_CHECK_OBJDIR
1966
1967
1968 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1969 # --------------------------------------
1970 # Check hardcoding attributes.
1971 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1972 [AC_MSG_CHECKING([how to hardcode library paths into programs])
1973 _LT_TAGVAR(hardcode_action, $1)=
1974 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1975 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1976 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1977
1978 # We can hardcode non-existent directories.
1979 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1980 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1981 # have to relink, otherwise we might link with an installed library
1982 # when we should be linking with a yet-to-be-installed one
1983 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1984 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1985 # Linking always hardcodes the temporary library directory.
1986 _LT_TAGVAR(hardcode_action, $1)=relink
1987 else
1988 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1989 _LT_TAGVAR(hardcode_action, $1)=immediate
1990 fi
1991 else
1992 # We cannot hardcode anything, or else we can only hardcode existing
1993 # directories.
1994 _LT_TAGVAR(hardcode_action, $1)=unsupported
1995 fi
1996 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1997
1998 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
1999 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2000 # Fast installation is not supported
2001 enable_fast_install=no
2002 elif test "$shlibpath_overrides_runpath" = yes ||
2003 test "$enable_shared" = no; then
2004 # Fast installation is not necessary
2005 enable_fast_install=needless
2006 fi
2007 _LT_TAGDECL([], [hardcode_action], [0],
2008 [How to hardcode a shared library path into an executable])
2009 ])# _LT_LINKER_HARDCODE_LIBPATH
2010
2011
2012 # _LT_CMD_STRIPLIB
2013 # ----------------
2014 m4_defun([_LT_CMD_STRIPLIB],
2015 [m4_require([_LT_DECL_EGREP])
2016 striplib=
2017 old_striplib=
2018 AC_MSG_CHECKING([whether stripping libraries is possible])
2019 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2020 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2021 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2022 AC_MSG_RESULT([yes])
2023 else
2024 # FIXME - insert some real tests, host_os isn't really good enough
2025 case $host_os in
2026 darwin*)
2027 if test -n "$STRIP" ; then
2028 striplib="$STRIP -x"
2029 old_striplib="$STRIP -S"
2030 AC_MSG_RESULT([yes])
2031 else
2032 AC_MSG_RESULT([no])
2033 fi
2034 ;;
2035 *)
2036 AC_MSG_RESULT([no])
2037 ;;
2038 esac
2039 fi
2040 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2041 _LT_DECL([], [striplib], [1])
2042 ])# _LT_CMD_STRIPLIB
2043
2044
2045 # _LT_SYS_DYNAMIC_LINKER([TAG])
2046 # -----------------------------
2047 # PORTME Fill in your ld.so characteristics
2048 m4_defun([_LT_SYS_DYNAMIC_LINKER],
2049 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2050 m4_require([_LT_DECL_EGREP])dnl
2051 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2052 m4_require([_LT_DECL_OBJDUMP])dnl
2053 m4_require([_LT_DECL_SED])dnl
2054 AC_MSG_CHECKING([dynamic linker characteristics])
2055 m4_if([$1],
2056 [], [
2057 if test "$GCC" = yes; then
2058 case $host_os in
2059 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2060 *) lt_awk_arg="/^libraries:/" ;;
2061 esac
2062 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2063 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2064 # if the path contains ";" then we assume it to be the separator
2065 # otherwise default to the standard path separator (i.e. ":") - it is
2066 # assumed that no part of a normal pathname contains ";" but that should
2067 # okay in the real world where ";" in dirpaths is itself problematic.
2068 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2069 else
2070 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2071 fi
2072 # Ok, now we have the path, separated by spaces, we can step through it
2073 # and add multilib dir if necessary.
2074 lt_tmp_lt_search_path_spec=
2075 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2076 for lt_sys_path in $lt_search_path_spec; do
2077 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2078 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2079 else
2080 test -d "$lt_sys_path" && \
2081 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2082 fi
2083 done
2084 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2085 BEGIN {RS=" "; FS="/|\n";} {
2086 lt_foo="";
2087 lt_count=0;
2088 for (lt_i = NF; lt_i > 0; lt_i--) {
2089 if ($lt_i != "" && $lt_i != ".") {
2090 if ($lt_i == "..") {
2091 lt_count++;
2092 } else {
2093 if (lt_count == 0) {
2094 lt_foo="/" $lt_i lt_foo;
2095 } else {
2096 lt_count--;
2097 }
2098 }
2099 }
2100 }
2101 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2102 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2103 }'`
2104 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2105 else
2106 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2107 fi])
2108 library_names_spec=
2109 libname_spec='lib$name'
2110 soname_spec=
2111 shrext_cmds=".so"
2112 postinstall_cmds=
2113 postuninstall_cmds=
2114 finish_cmds=
2115 finish_eval=
2116 shlibpath_var=
2117 shlibpath_overrides_runpath=unknown
2118 version_type=none
2119 dynamic_linker="$host_os ld.so"
2120 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2121 need_lib_prefix=unknown
2122 hardcode_into_libs=no
2123
2124 # when you set need_version to no, make sure it does not cause -set_version
2125 # flags to be left without arguments
2126 need_version=unknown
2127
2128 case $host_os in
2129 aix3*)
2130 version_type=linux
2131 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2132 shlibpath_var=LIBPATH
2133
2134 # AIX 3 has no versioning support, so we append a major version to the name.
2135 soname_spec='${libname}${release}${shared_ext}$major'
2136 ;;
2137
2138 aix[[4-9]]*)
2139 version_type=linux
2140 need_lib_prefix=no
2141 need_version=no
2142 hardcode_into_libs=yes
2143 if test "$host_cpu" = ia64; then
2144 # AIX 5 supports IA64
2145 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2146 shlibpath_var=LD_LIBRARY_PATH
2147 else
2148 # With GCC up to 2.95.x, collect2 would create an import file
2149 # for dependence libraries. The import file would start with
2150 # the line `#! .'. This would cause the generated library to
2151 # depend on `.', always an invalid library. This was fixed in
2152 # development snapshots of GCC prior to 3.0.
2153 case $host_os in
2154 aix4 | aix4.[[01]] | aix4.[[01]].*)
2155 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2156 echo ' yes '
2157 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2158 :
2159 else
2160 can_build_shared=no
2161 fi
2162 ;;
2163 esac
2164 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2165 # soname into executable. Probably we can add versioning support to
2166 # collect2, so additional links can be useful in future.
2167 if test "$aix_use_runtimelinking" = yes; then
2168 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2169 # instead of lib<name>.a to let people know that these are not
2170 # typical AIX shared libraries.
2171 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2172 else
2173 # We preserve .a as extension for shared libraries through AIX4.2
2174 # and later when we are not doing run time linking.
2175 library_names_spec='${libname}${release}.a $libname.a'
2176 soname_spec='${libname}${release}${shared_ext}$major'
2177 fi
2178 shlibpath_var=LIBPATH
2179 fi
2180 ;;
2181
2182 amigaos*)
2183 case $host_cpu in
2184 powerpc)
2185 # Since July 2007 AmigaOS4 officially supports .so libraries.
2186 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2187 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2188 ;;
2189 m68k)
2190 library_names_spec='$libname.ixlibrary $libname.a'
2191 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2192 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2193 ;;
2194 esac
2195 ;;
2196
2197 beos*)
2198 library_names_spec='${libname}${shared_ext}'
2199 dynamic_linker="$host_os ld.so"
2200 shlibpath_var=LIBRARY_PATH
2201 ;;
2202
2203 bsdi[[45]]*)
2204 version_type=linux
2205 need_version=no
2206 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2207 soname_spec='${libname}${release}${shared_ext}$major'
2208 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2209 shlibpath_var=LD_LIBRARY_PATH
2210 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2211 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2212 # the default ld.so.conf also contains /usr/contrib/lib and
2213 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2214 # libtool to hard-code these into programs
2215 ;;
2216
2217 cygwin* | mingw* | pw32* | cegcc*)
2218 version_type=windows
2219 shrext_cmds=".dll"
2220 need_version=no
2221 need_lib_prefix=no
2222
2223 case $GCC,$host_os in
2224 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2225 library_names_spec='$libname.dll.a'
2226 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2227 postinstall_cmds='base_file=`basename \${file}`~
2228 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2229 dldir=$destdir/`dirname \$dlpath`~
2230 test -d \$dldir || mkdir -p \$dldir~
2231 $install_prog $dir/$dlname \$dldir/$dlname~
2232 chmod a+x \$dldir/$dlname~
2233 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2234 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2235 fi'
2236 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2237 dlpath=$dir/\$dldll~
2238 $RM \$dlpath'
2239 shlibpath_overrides_runpath=yes
2240
2241 case $host_os in
2242 cygwin*)
2243 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2244 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2245 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2246 ;;
2247 mingw* | cegcc*)
2248 # MinGW DLLs use traditional 'lib' prefix
2249 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2250 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2251 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2252 # It is most probably a Windows format PATH printed by
2253 # mingw gcc, but we are running on Cygwin. Gcc prints its search
2254 # path with ; separators, and with drive letters. We can handle the
2255 # drive letters (cygwin fileutils understands them), so leave them,
2256 # especially as we might pass files found there to a mingw objdump,
2257 # which wouldn't understand a cygwinified path. Ahh.
2258 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2259 else
2260 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2261 fi
2262 ;;
2263 pw32*)
2264 # pw32 DLLs use 'pw' prefix rather than 'lib'
2265 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2266 ;;
2267 esac
2268 ;;
2269
2270 *)
2271 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2272 ;;
2273 esac
2274 dynamic_linker='Win32 ld.exe'
2275 # FIXME: first we should search . and the directory the executable is in
2276 shlibpath_var=PATH
2277 ;;
2278
2279 darwin* | rhapsody*)
2280 dynamic_linker="$host_os dyld"
2281 version_type=darwin
2282 need_lib_prefix=no
2283 need_version=no
2284 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2285 soname_spec='${libname}${release}${major}$shared_ext'
2286 shlibpath_overrides_runpath=yes
2287 shlibpath_var=DYLD_LIBRARY_PATH
2288 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2289 m4_if([$1], [],[
2290 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2291 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2292 ;;
2293
2294 dgux*)
2295 version_type=linux
2296 need_lib_prefix=no
2297 need_version=no
2298 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2299 soname_spec='${libname}${release}${shared_ext}$major'
2300 shlibpath_var=LD_LIBRARY_PATH
2301 ;;
2302
2303 freebsd1*)
2304 dynamic_linker=no
2305 ;;
2306
2307 freebsd* | dragonfly*)
2308 # DragonFly does not have aout. When/if they implement a new
2309 # versioning mechanism, adjust this.
2310 if test -x /usr/bin/objformat; then
2311 objformat=`/usr/bin/objformat`
2312 else
2313 case $host_os in
2314 freebsd[[123]]*) objformat=aout ;;
2315 *) objformat=elf ;;
2316 esac
2317 fi
2318 version_type=freebsd-$objformat
2319 case $version_type in
2320 freebsd-elf*)
2321 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2322 need_version=no
2323 need_lib_prefix=no
2324 ;;
2325 freebsd-*)
2326 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2327 need_version=yes
2328 ;;
2329 esac
2330 shlibpath_var=LD_LIBRARY_PATH
2331 case $host_os in
2332 freebsd2*)
2333 shlibpath_overrides_runpath=yes
2334 ;;
2335 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2336 shlibpath_overrides_runpath=yes
2337 hardcode_into_libs=yes
2338 ;;
2339 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2340 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2341 shlibpath_overrides_runpath=no
2342 hardcode_into_libs=yes
2343 ;;
2344 *) # from 4.6 on, and DragonFly
2345 shlibpath_overrides_runpath=yes
2346 hardcode_into_libs=yes
2347 ;;
2348 esac
2349 ;;
2350
2351 gnu*)
2352 version_type=linux
2353 need_lib_prefix=no
2354 need_version=no
2355 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2356 soname_spec='${libname}${release}${shared_ext}$major'
2357 shlibpath_var=LD_LIBRARY_PATH
2358 hardcode_into_libs=yes
2359 ;;
2360
2361 hpux9* | hpux10* | hpux11*)
2362 # Give a soname corresponding to the major version so that dld.sl refuses to
2363 # link against other versions.
2364 version_type=sunos
2365 need_lib_prefix=no
2366 need_version=no
2367 case $host_cpu in
2368 ia64*)
2369 shrext_cmds='.so'
2370 hardcode_into_libs=yes
2371 dynamic_linker="$host_os dld.so"
2372 shlibpath_var=LD_LIBRARY_PATH
2373 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2374 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2375 soname_spec='${libname}${release}${shared_ext}$major'
2376 if test "X$HPUX_IA64_MODE" = X32; then
2377 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2378 else
2379 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2380 fi
2381 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2382 ;;
2383 hppa*64*)
2384 shrext_cmds='.sl'
2385 hardcode_into_libs=yes
2386 dynamic_linker="$host_os dld.sl"
2387 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2388 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2389 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2390 soname_spec='${libname}${release}${shared_ext}$major'
2391 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2392 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2393 ;;
2394 *)
2395 shrext_cmds='.sl'
2396 dynamic_linker="$host_os dld.sl"
2397 shlibpath_var=SHLIB_PATH
2398 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2399 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2400 soname_spec='${libname}${release}${shared_ext}$major'
2401 ;;
2402 esac
2403 # HP-UX runs *really* slowly unless shared libraries are mode 555.
2404 postinstall_cmds='chmod 555 $lib'
2405 ;;
2406
2407 interix[[3-9]]*)
2408 version_type=linux
2409 need_lib_prefix=no
2410 need_version=no
2411 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2412 soname_spec='${libname}${release}${shared_ext}$major'
2413 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2414 shlibpath_var=LD_LIBRARY_PATH
2415 shlibpath_overrides_runpath=no
2416 hardcode_into_libs=yes
2417 ;;
2418
2419 irix5* | irix6* | nonstopux*)
2420 case $host_os in
2421 nonstopux*) version_type=nonstopux ;;
2422 *)
2423 if test "$lt_cv_prog_gnu_ld" = yes; then
2424 version_type=linux
2425 else
2426 version_type=irix
2427 fi ;;
2428 esac
2429 need_lib_prefix=no
2430 need_version=no
2431 soname_spec='${libname}${release}${shared_ext}$major'
2432 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2433 case $host_os in
2434 irix5* | nonstopux*)
2435 libsuff= shlibsuff=
2436 ;;
2437 *)
2438 case $LD in # libtool.m4 will add one of these switches to LD
2439 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2440 libsuff= shlibsuff= libmagic=32-bit;;
2441 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2442 libsuff=32 shlibsuff=N32 libmagic=N32;;
2443 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2444 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2445 *) libsuff= shlibsuff= libmagic=never-match;;
2446 esac
2447 ;;
2448 esac
2449 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2450 shlibpath_overrides_runpath=no
2451 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2452 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2453 hardcode_into_libs=yes
2454 ;;
2455
2456 # No shared lib support for Linux oldld, aout, or coff.
2457 linux*oldld* | linux*aout* | linux*coff*)
2458 dynamic_linker=no
2459 ;;
2460
2461 # This must be Linux ELF.
2462 linux* | k*bsd*-gnu)
2463 version_type=linux
2464 need_lib_prefix=no
2465 need_version=no
2466 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2467 soname_spec='${libname}${release}${shared_ext}$major'
2468 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2469 shlibpath_var=LD_LIBRARY_PATH
2470 shlibpath_overrides_runpath=no
2471 # Some binutils ld are patched to set DT_RUNPATH
2472 save_LDFLAGS=$LDFLAGS
2473 save_libdir=$libdir
2474 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2475 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2476 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2477 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2478 [shlibpath_overrides_runpath=yes])])
2479 LDFLAGS=$save_LDFLAGS
2480 libdir=$save_libdir
2481
2482 # This implies no fast_install, which is unacceptable.
2483 # Some rework will be needed to allow for fast_install
2484 # before this can be enabled.
2485 hardcode_into_libs=yes
2486
2487 # Add ABI-specific directories to the system library path.
2488 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2489
2490 # Append ld.so.conf contents to the search path
2491 if test -f /etc/ld.so.conf; then
2492 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2493 sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2494 fi
2495
2496 # We used to test for /lib/ld.so.1 and disable shared libraries on
2497 # powerpc, because MkLinux only supported shared libraries with the
2498 # GNU dynamic linker. Since this was broken with cross compilers,
2499 # most powerpc-linux boxes support dynamic linking these days and
2500 # people can always --disable-shared, the test was removed, and we
2501 # assume the GNU/Linux dynamic linker is in use.
2502 dynamic_linker='GNU/Linux ld.so'
2503 ;;
2504
2505 netbsd*)
2506 version_type=sunos
2507 need_lib_prefix=no
2508 need_version=no
2509 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2510 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2511 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2512 dynamic_linker='NetBSD (a.out) ld.so'
2513 else
2514 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2515 soname_spec='${libname}${release}${shared_ext}$major'
2516 dynamic_linker='NetBSD ld.elf_so'
2517 fi
2518 shlibpath_var=LD_LIBRARY_PATH
2519 shlibpath_overrides_runpath=yes
2520 hardcode_into_libs=yes
2521 ;;
2522
2523 newsos6)
2524 version_type=linux
2525 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2526 shlibpath_var=LD_LIBRARY_PATH
2527 shlibpath_overrides_runpath=yes
2528 ;;
2529
2530 *nto* | *qnx*)
2531 version_type=qnx
2532 need_lib_prefix=no
2533 need_version=no
2534 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2535 soname_spec='${libname}${release}${shared_ext}$major'
2536 shlibpath_var=LD_LIBRARY_PATH
2537 shlibpath_overrides_runpath=no
2538 hardcode_into_libs=yes
2539 dynamic_linker='ldqnx.so'
2540 ;;
2541
2542 openbsd*)
2543 version_type=sunos
2544 sys_lib_dlsearch_path_spec="/usr/lib"
2545 need_lib_prefix=no
2546 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2547 case $host_os in
2548 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2549 *) need_version=no ;;
2550 esac
2551 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2552 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2553 shlibpath_var=LD_LIBRARY_PATH
2554 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2555 case $host_os in
2556 openbsd2.[[89]] | openbsd2.[[89]].*)
2557 shlibpath_overrides_runpath=no
2558 ;;
2559 *)
2560 shlibpath_overrides_runpath=yes
2561 ;;
2562 esac
2563 else
2564 shlibpath_overrides_runpath=yes
2565 fi
2566 ;;
2567
2568 os2*)
2569 libname_spec='$name'
2570 shrext_cmds=".dll"
2571 need_lib_prefix=no
2572 library_names_spec='$libname${shared_ext} $libname.a'
2573 dynamic_linker='OS/2 ld.exe'
2574 shlibpath_var=LIBPATH
2575 ;;
2576
2577 osf3* | osf4* | osf5*)
2578 version_type=osf
2579 need_lib_prefix=no
2580 need_version=no
2581 soname_spec='${libname}${release}${shared_ext}$major'
2582 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2583 shlibpath_var=LD_LIBRARY_PATH
2584 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2585 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2586 ;;
2587
2588 rdos*)
2589 dynamic_linker=no
2590 ;;
2591
2592 solaris*)
2593 version_type=linux
2594 need_lib_prefix=no
2595 need_version=no
2596 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2597 soname_spec='${libname}${release}${shared_ext}$major'
2598 shlibpath_var=LD_LIBRARY_PATH
2599 shlibpath_overrides_runpath=yes
2600 hardcode_into_libs=yes
2601 # ldd complains unless libraries are executable
2602 postinstall_cmds='chmod +x $lib'
2603 ;;
2604
2605 sunos4*)
2606 version_type=sunos
2607 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2608 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2609 shlibpath_var=LD_LIBRARY_PATH
2610 shlibpath_overrides_runpath=yes
2611 if test "$with_gnu_ld" = yes; then
2612 need_lib_prefix=no
2613 fi
2614 need_version=yes
2615 ;;
2616
2617 sysv4 | sysv4.3*)
2618 version_type=linux
2619 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2620 soname_spec='${libname}${release}${shared_ext}$major'
2621 shlibpath_var=LD_LIBRARY_PATH
2622 case $host_vendor in
2623 sni)
2624 shlibpath_overrides_runpath=no
2625 need_lib_prefix=no
2626 runpath_var=LD_RUN_PATH
2627 ;;
2628 siemens)
2629 need_lib_prefix=no
2630 ;;
2631 motorola)
2632 need_lib_prefix=no
2633 need_version=no
2634 shlibpath_overrides_runpath=no
2635 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2636 ;;
2637 esac
2638 ;;
2639
2640 sysv4*MP*)
2641 if test -d /usr/nec ;then
2642 version_type=linux
2643 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2644 soname_spec='$libname${shared_ext}.$major'
2645 shlibpath_var=LD_LIBRARY_PATH
2646 fi
2647 ;;
2648
2649 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2650 version_type=freebsd-elf
2651 need_lib_prefix=no
2652 need_version=no
2653 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2654 soname_spec='${libname}${release}${shared_ext}$major'
2655 shlibpath_var=LD_LIBRARY_PATH
2656 shlibpath_overrides_runpath=yes
2657 hardcode_into_libs=yes
2658 if test "$with_gnu_ld" = yes; then
2659 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2660 else
2661 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2662 case $host_os in
2663 sco3.2v5*)
2664 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2665 ;;
2666 esac
2667 fi
2668 sys_lib_dlsearch_path_spec='/usr/lib'
2669 ;;
2670
2671 tpf*)
2672 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
2673 version_type=linux
2674 need_lib_prefix=no
2675 need_version=no
2676 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2677 shlibpath_var=LD_LIBRARY_PATH
2678 shlibpath_overrides_runpath=no
2679 hardcode_into_libs=yes
2680 ;;
2681
2682 uts4*)
2683 version_type=linux
2684 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2685 soname_spec='${libname}${release}${shared_ext}$major'
2686 shlibpath_var=LD_LIBRARY_PATH
2687 ;;
2688
2689 *)
2690 dynamic_linker=no
2691 ;;
2692 esac
2693 AC_MSG_RESULT([$dynamic_linker])
2694 test "$dynamic_linker" = no && can_build_shared=no
2695
2696 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2697 if test "$GCC" = yes; then
2698 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2699 fi
2700
2701 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2702 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2703 fi
2704 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2705 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2706 fi
2707
2708 _LT_DECL([], [variables_saved_for_relink], [1],
2709 [Variables whose values should be saved in libtool wrapper scripts and
2710 restored at link time])
2711 _LT_DECL([], [need_lib_prefix], [0],
2712 [Do we need the "lib" prefix for modules?])
2713 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2714 _LT_DECL([], [version_type], [0], [Library versioning type])
2715 _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
2716 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2717 _LT_DECL([], [shlibpath_overrides_runpath], [0],
2718 [Is shlibpath searched before the hard-coded library search path?])
2719 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2720 _LT_DECL([], [library_names_spec], [1],
2721 [[List of archive names. First name is the real one, the rest are links.
2722 The last name is the one that the linker finds with -lNAME]])
2723 _LT_DECL([], [soname_spec], [1],
2724 [[The coded name of the library, if different from the real name]])
2725 _LT_DECL([], [postinstall_cmds], [2],
2726 [Command to use after installation of a shared archive])
2727 _LT_DECL([], [postuninstall_cmds], [2],
2728 [Command to use after uninstallation of a shared archive])
2729 _LT_DECL([], [finish_cmds], [2],
2730 [Commands used to finish a libtool library installation in a directory])
2731 _LT_DECL([], [finish_eval], [1],
2732 [[As "finish_cmds", except a single script fragment to be evaled but
2733 not shown]])
2734 _LT_DECL([], [hardcode_into_libs], [0],
2735 [Whether we should hardcode library paths into libraries])
2736 _LT_DECL([], [sys_lib_search_path_spec], [2],
2737 [Compile-time system search path for libraries])
2738 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2739 [Run-time system search path for libraries])
2740 ])# _LT_SYS_DYNAMIC_LINKER
2741
2742
2743 # _LT_PATH_TOOL_PREFIX(TOOL)
2744 # --------------------------
2745 # find a file program which can recognize shared library
2746 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
2747 [m4_require([_LT_DECL_EGREP])dnl
2748 AC_MSG_CHECKING([for $1])
2749 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2750 [case $MAGIC_CMD in
2751 [[\\/*] | ?:[\\/]*])
2752 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2753 ;;
2754 *)
2755 lt_save_MAGIC_CMD="$MAGIC_CMD"
2756 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2757 dnl $ac_dummy forces splitting on constant user-supplied paths.
2758 dnl POSIX.2 word splitting is done only on the output of word expansions,
2759 dnl not every word. This closes a longstanding sh security hole.
2760 ac_dummy="m4_if([$2], , $PATH, [$2])"
2761 for ac_dir in $ac_dummy; do
2762 IFS="$lt_save_ifs"
2763 test -z "$ac_dir" && ac_dir=.
2764 if test -f $ac_dir/$1; then
2765 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2766 if test -n "$file_magic_test_file"; then
2767 case $deplibs_check_method in
2768 "file_magic "*)
2769 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2770 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2771 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2772 $EGREP "$file_magic_regex" > /dev/null; then
2773 :
2774 else
2775 cat <<_LT_EOF 1>&2
2776
2777 *** Warning: the command libtool uses to detect shared libraries,
2778 *** $file_magic_cmd, produces output that libtool cannot recognize.
2779 *** The result is that libtool may fail to recognize shared libraries
2780 *** as such. This will affect the creation of libtool libraries that
2781 *** depend on shared libraries, but programs linked with such libtool
2782 *** libraries will work regardless of this problem. Nevertheless, you
2783 *** may want to report the problem to your system manager and/or to
2784 *** bug-libtool@gnu.org
2785
2786 _LT_EOF
2787 fi ;;
2788 esac
2789 fi
2790 break
2791 fi
2792 done
2793 IFS="$lt_save_ifs"
2794 MAGIC_CMD="$lt_save_MAGIC_CMD"
2795 ;;
2796 esac])
2797 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2798 if test -n "$MAGIC_CMD"; then
2799 AC_MSG_RESULT($MAGIC_CMD)
2800 else
2801 AC_MSG_RESULT(no)
2802 fi
2803 _LT_DECL([], [MAGIC_CMD], [0],
2804 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2805 ])# _LT_PATH_TOOL_PREFIX
2806
2807 # Old name:
2808 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2809 dnl aclocal-1.4 backwards compatibility:
2810 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2811
2812
2813 # _LT_PATH_MAGIC
2814 # --------------
2815 # find a file program which can recognize a shared library
2816 m4_defun([_LT_PATH_MAGIC],
2817 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2818 if test -z "$lt_cv_path_MAGIC_CMD"; then
2819 if test -n "$ac_tool_prefix"; then
2820 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2821 else
2822 MAGIC_CMD=:
2823 fi
2824 fi
2825 ])# _LT_PATH_MAGIC
2826
2827
2828 # LT_PATH_LD
2829 # ----------
2830 # find the pathname to the GNU or non-GNU linker
2831 AC_DEFUN([LT_PATH_LD],
2832 [AC_REQUIRE([AC_PROG_CC])dnl
2833 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2834 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2835 m4_require([_LT_DECL_SED])dnl
2836 m4_require([_LT_DECL_EGREP])dnl
2837
2838 AC_ARG_WITH([gnu-ld],
2839 [AS_HELP_STRING([--with-gnu-ld],
2840 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
2841 [test "$withval" = no || with_gnu_ld=yes],
2842 [with_gnu_ld=no])dnl
2843
2844 ac_prog=ld
2845 if test "$GCC" = yes; then
2846 # Check if gcc -print-prog-name=ld gives a path.
2847 AC_MSG_CHECKING([for ld used by $CC])
2848 case $host in
2849 *-*-mingw*)
2850 # gcc leaves a trailing carriage return which upsets mingw
2851 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2852 *)
2853 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2854 esac
2855 case $ac_prog in
2856 # Accept absolute paths.
2857 [[\\/]]* | ?:[[\\/]]*)
2858 re_direlt='/[[^/]][[^/]]*/\.\./'
2859 # Canonicalize the pathname of ld
2860 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2861 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2862 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2863 done
2864 test -z "$LD" && LD="$ac_prog"
2865 ;;
2866 "")
2867 # If it fails, then pretend we aren't using GCC.
2868 ac_prog=ld
2869 ;;
2870 *)
2871 # If it is relative, then search for the first ld in PATH.
2872 with_gnu_ld=unknown
2873 ;;
2874 esac
2875 elif test "$with_gnu_ld" = yes; then
2876 AC_MSG_CHECKING([for GNU ld])
2877 else
2878 AC_MSG_CHECKING([for non-GNU ld])
2879 fi
2880 AC_CACHE_VAL(lt_cv_path_LD,
2881 [if test -z "$LD"; then
2882 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2883 for ac_dir in $PATH; do
2884 IFS="$lt_save_ifs"
2885 test -z "$ac_dir" && ac_dir=.
2886 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2887 lt_cv_path_LD="$ac_dir/$ac_prog"
2888 # Check to see if the program is GNU ld. I'd rather use --version,
2889 # but apparently some variants of GNU ld only accept -v.
2890 # Break only if it was the GNU/non-GNU ld that we prefer.
2891 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2892 *GNU* | *'with BFD'*)
2893 test "$with_gnu_ld" != no && break
2894 ;;
2895 *)
2896 test "$with_gnu_ld" != yes && break
2897 ;;
2898 esac
2899 fi
2900 done
2901 IFS="$lt_save_ifs"
2902 else
2903 lt_cv_path_LD="$LD" # Let the user override the test with a path.
2904 fi])
2905 LD="$lt_cv_path_LD"
2906 if test -n "$LD"; then
2907 AC_MSG_RESULT($LD)
2908 else
2909 AC_MSG_RESULT(no)
2910 fi
2911 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2912 _LT_PATH_LD_GNU
2913 AC_SUBST([LD])
2914
2915 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2916 ])# LT_PATH_LD
2917
2918 # Old names:
2919 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2920 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2921 dnl aclocal-1.4 backwards compatibility:
2922 dnl AC_DEFUN([AM_PROG_LD], [])
2923 dnl AC_DEFUN([AC_PROG_LD], [])
2924
2925
2926 # _LT_PATH_LD_GNU
2927 #- --------------
2928 m4_defun([_LT_PATH_LD_GNU],
2929 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2930 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
2931 case `$LD -v 2>&1 </dev/null` in
2932 *GNU* | *'with BFD'*)
2933 lt_cv_prog_gnu_ld=yes
2934 ;;
2935 *)
2936 lt_cv_prog_gnu_ld=no
2937 ;;
2938 esac])
2939 with_gnu_ld=$lt_cv_prog_gnu_ld
2940 ])# _LT_PATH_LD_GNU
2941
2942
2943 # _LT_CMD_RELOAD
2944 # --------------
2945 # find reload flag for linker
2946 # -- PORTME Some linkers may need a different reload flag.
2947 m4_defun([_LT_CMD_RELOAD],
2948 [AC_CACHE_CHECK([for $LD option to reload object files],
2949 lt_cv_ld_reload_flag,
2950 [lt_cv_ld_reload_flag='-r'])
2951 reload_flag=$lt_cv_ld_reload_flag
2952 case $reload_flag in
2953 "" | " "*) ;;
2954 *) reload_flag=" $reload_flag" ;;
2955 esac
2956 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2957 case $host_os in
2958 darwin*)
2959 if test "$GCC" = yes; then
2960 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2961 else
2962 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2963 fi
2964 ;;
2965 esac
2966 _LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2967 _LT_DECL([], [reload_cmds], [2])dnl
2968 ])# _LT_CMD_RELOAD
2969
2970
2971 # _LT_CHECK_MAGIC_METHOD
2972 # ----------------------
2973 # how to check for library dependencies
2974 # -- PORTME fill in with the dynamic library characteristics
2975 m4_defun([_LT_CHECK_MAGIC_METHOD],
2976 [m4_require([_LT_DECL_EGREP])
2977 m4_require([_LT_DECL_OBJDUMP])
2978 AC_CACHE_CHECK([how to recognize dependent libraries],
2979 lt_cv_deplibs_check_method,
2980 [lt_cv_file_magic_cmd='$MAGIC_CMD'
2981 lt_cv_file_magic_test_file=
2982 lt_cv_deplibs_check_method='unknown'
2983 # Need to set the preceding variable on all platforms that support
2984 # interlibrary dependencies.
2985 # 'none' -- dependencies not supported.
2986 # `unknown' -- same as none, but documents that we really don't know.
2987 # 'pass_all' -- all dependencies passed with no checks.
2988 # 'test_compile' -- check by making test program.
2989 # 'file_magic [[regex]]' -- check by looking for files in library path
2990 # which responds to the $file_magic_cmd with a given extended regex.
2991 # If you have `file' or equivalent on your system and you're not sure
2992 # whether `pass_all' will *always* work, you probably want this one.
2993
2994 case $host_os in
2995 aix[[4-9]]*)
2996 lt_cv_deplibs_check_method=pass_all
2997 ;;
2998
2999 beos*)
3000 lt_cv_deplibs_check_method=pass_all
3001 ;;
3002
3003 bsdi[[45]]*)
3004 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3005 lt_cv_file_magic_cmd='/usr/bin/file -L'
3006 lt_cv_file_magic_test_file=/shlib/libc.so
3007 ;;
3008
3009 cygwin*)
3010 # func_win32_libid is a shell function defined in ltmain.sh
3011 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3012 lt_cv_file_magic_cmd='func_win32_libid'
3013 ;;
3014
3015 mingw* | pw32*)
3016 # Base MSYS/MinGW do not provide the 'file' command needed by
3017 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3018 # unless we find 'file', for example because we are cross-compiling.
3019 if ( file / ) >/dev/null 2>&1; then
3020 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3021 lt_cv_file_magic_cmd='func_win32_libid'
3022 else
3023 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3024 lt_cv_file_magic_cmd='$OBJDUMP -f'
3025 fi
3026 ;;
3027
3028 cegcc)
3029 # use the weaker test based on 'objdump'. See mingw*.
3030 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3031 lt_cv_file_magic_cmd='$OBJDUMP -f'
3032 ;;
3033
3034 darwin* | rhapsody*)
3035 lt_cv_deplibs_check_method=pass_all
3036 ;;
3037
3038 freebsd* | dragonfly*)
3039 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3040 case $host_cpu in
3041 i*86 )
3042 # Not sure whether the presence of OpenBSD here was a mistake.
3043 # Let's accept both of them until this is cleared up.
3044 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3045 lt_cv_file_magic_cmd=/usr/bin/file
3046 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3047 ;;
3048 esac
3049 else
3050 lt_cv_deplibs_check_method=pass_all
3051 fi
3052 ;;
3053
3054 gnu*)
3055 lt_cv_deplibs_check_method=pass_all
3056 ;;
3057
3058 hpux10.20* | hpux11*)
3059 lt_cv_file_magic_cmd=/usr/bin/file
3060 case $host_cpu in
3061 ia64*)
3062 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3063 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3064 ;;
3065 hppa*64*)
3066 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
3067 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3068 ;;
3069 *)
3070 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3071 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3072 ;;
3073 esac
3074 ;;
3075
3076 interix[[3-9]]*)
3077 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3078 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3079 ;;
3080
3081 irix5* | irix6* | nonstopux*)
3082 case $LD in
3083 *-32|*"-32 ") libmagic=32-bit;;
3084 *-n32|*"-n32 ") libmagic=N32;;
3085 *-64|*"-64 ") libmagic=64-bit;;
3086 *) libmagic=never-match;;
3087 esac
3088 lt_cv_deplibs_check_method=pass_all
3089 ;;
3090
3091 # This must be Linux ELF.
3092 linux* | k*bsd*-gnu)
3093 lt_cv_deplibs_check_method=pass_all
3094 ;;
3095
3096 netbsd*)
3097 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3098 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3099 else
3100 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3101 fi
3102 ;;
3103
3104 newos6*)
3105 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3106 lt_cv_file_magic_cmd=/usr/bin/file
3107 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3108 ;;
3109
3110 *nto* | *qnx*)
3111 lt_cv_deplibs_check_method=pass_all
3112 ;;
3113
3114 openbsd*)
3115 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3116 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3117 else
3118 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3119 fi
3120 ;;
3121
3122 osf3* | osf4* | osf5*)
3123 lt_cv_deplibs_check_method=pass_all
3124 ;;
3125
3126 rdos*)
3127 lt_cv_deplibs_check_method=pass_all
3128 ;;
3129
3130 solaris*)
3131 lt_cv_deplibs_check_method=pass_all
3132 ;;
3133
3134 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3135 lt_cv_deplibs_check_method=pass_all
3136 ;;
3137
3138 sysv4 | sysv4.3*)
3139 case $host_vendor in
3140 motorola)
3141 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]]'
3142 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3143 ;;
3144 ncr)
3145 lt_cv_deplibs_check_method=pass_all
3146 ;;
3147 sequent)
3148 lt_cv_file_magic_cmd='/bin/file'
3149 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3150 ;;
3151 sni)
3152 lt_cv_file_magic_cmd='/bin/file'
3153 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3154 lt_cv_file_magic_test_file=/lib/libc.so
3155 ;;
3156 siemens)
3157 lt_cv_deplibs_check_method=pass_all
3158 ;;
3159 pc)
3160 lt_cv_deplibs_check_method=pass_all
3161 ;;
3162 esac
3163 ;;
3164
3165 tpf*)
3166 lt_cv_deplibs_check_method=pass_all
3167 ;;
3168 esac
3169 ])
3170 file_magic_cmd=$lt_cv_file_magic_cmd
3171 deplibs_check_method=$lt_cv_deplibs_check_method
3172 test -z "$deplibs_check_method" && deplibs_check_method=unknown
3173
3174 _LT_DECL([], [deplibs_check_method], [1],
3175 [Method to check whether dependent libraries are shared objects])
3176 _LT_DECL([], [file_magic_cmd], [1],
3177 [Command to use when deplibs_check_method == "file_magic"])
3178 ])# _LT_CHECK_MAGIC_METHOD
3179
3180
3181 # LT_PATH_NM
3182 # ----------
3183 # find the pathname to a BSD- or MS-compatible name lister
3184 AC_DEFUN([LT_PATH_NM],
3185 [AC_REQUIRE([AC_PROG_CC])dnl
3186 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3187 [if test -n "$NM"; then
3188 # Let the user override the test.
3189 lt_cv_path_NM="$NM"
3190 else
3191 lt_nm_to_check="${ac_tool_prefix}nm"
3192 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3193 lt_nm_to_check="$lt_nm_to_check nm"
3194 fi
3195 for lt_tmp_nm in $lt_nm_to_check; do
3196 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3197 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3198 IFS="$lt_save_ifs"
3199 test -z "$ac_dir" && ac_dir=.
3200 tmp_nm="$ac_dir/$lt_tmp_nm"
3201 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3202 # Check to see if the nm accepts a BSD-compat flag.
3203 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3204 # nm: unknown option "B" ignored
3205 # Tru64's nm complains that /dev/null is an invalid object file
3206 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3207 */dev/null* | *'Invalid file or object type'*)
3208 lt_cv_path_NM="$tmp_nm -B"
3209 break
3210 ;;
3211 *)
3212 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3213 */dev/null*)
3214 lt_cv_path_NM="$tmp_nm -p"
3215 break
3216 ;;
3217 *)
3218 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3219 continue # so that we can try to find one that supports BSD flags
3220 ;;
3221 esac
3222 ;;
3223 esac
3224 fi
3225 done
3226 IFS="$lt_save_ifs"
3227 done
3228 : ${lt_cv_path_NM=no}
3229 fi])
3230 if test "$lt_cv_path_NM" != "no"; then
3231 NM="$lt_cv_path_NM"
3232 else
3233 # Didn't find any BSD compatible name lister, look for dumpbin.
3234 AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3235 AC_SUBST([DUMPBIN])
3236 if test "$DUMPBIN" != ":"; then
3237 NM="$DUMPBIN"
3238 fi
3239 fi
3240 test -z "$NM" && NM=nm
3241 AC_SUBST([NM])
3242 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3243
3244 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3245 [lt_cv_nm_interface="BSD nm"
3246 echo "int some_variable = 0;" > conftest.$ac_ext
3247 (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3248 (eval "$ac_compile" 2>conftest.err)
3249 cat conftest.err >&AS_MESSAGE_LOG_FD
3250 (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3251 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3252 cat conftest.err >&AS_MESSAGE_LOG_FD
3253 (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3254 cat conftest.out >&AS_MESSAGE_LOG_FD
3255 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3256 lt_cv_nm_interface="MS dumpbin"
3257 fi
3258 rm -f conftest*])
3259 ])# LT_PATH_NM
3260
3261 # Old names:
3262 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3263 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3264 dnl aclocal-1.4 backwards compatibility:
3265 dnl AC_DEFUN([AM_PROG_NM], [])
3266 dnl AC_DEFUN([AC_PROG_NM], [])
3267
3268
3269 # LT_LIB_M
3270 # --------
3271 # check for math library
3272 AC_DEFUN([LT_LIB_M],
3273 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3274 LIBM=
3275 case $host in
3276 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3277 # These system don't have libm, or don't need it
3278 ;;
3279 *-ncr-sysv4.3*)
3280 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3281 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3282 ;;
3283 *)
3284 AC_CHECK_LIB(m, cos, LIBM="-lm")
3285 ;;
3286 esac
3287 AC_SUBST([LIBM])
3288 ])# LT_LIB_M
3289
3290 # Old name:
3291 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3292 dnl aclocal-1.4 backwards compatibility:
3293 dnl AC_DEFUN([AC_CHECK_LIBM], [])
3294
3295
3296 # _LT_COMPILER_NO_RTTI([TAGNAME])
3297 # -------------------------------
3298 m4_defun([_LT_COMPILER_NO_RTTI],
3299 [m4_require([_LT_TAG_COMPILER])dnl
3300
3301 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3302
3303 if test "$GCC" = yes; then
3304 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3305
3306 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3307 lt_cv_prog_compiler_rtti_exceptions,
3308 [-fno-rtti -fno-exceptions], [],
3309 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3310 fi
3311 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3312 [Compiler flag to turn off builtin functions])
3313 ])# _LT_COMPILER_NO_RTTI
3314
3315
3316 # _LT_CMD_GLOBAL_SYMBOLS
3317 # ----------------------
3318 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3319 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3320 AC_REQUIRE([AC_PROG_CC])dnl
3321 AC_REQUIRE([LT_PATH_NM])dnl
3322 AC_REQUIRE([LT_PATH_LD])dnl
3323 m4_require([_LT_DECL_SED])dnl
3324 m4_require([_LT_DECL_EGREP])dnl
3325 m4_require([_LT_TAG_COMPILER])dnl
3326
3327 # Check for command to grab the raw symbol name followed by C symbol from nm.
3328 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3329 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3330 [
3331 # These are sane defaults that work on at least a few old systems.
3332 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
3333
3334 # Character class describing NM global symbol codes.
3335 symcode='[[BCDEGRST]]'
3336
3337 # Regexp to match symbols that can be accessed directly from C.
3338 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3339
3340 # Define system-specific variables.
3341 case $host_os in
3342 aix*)
3343 symcode='[[BCDT]]'
3344 ;;
3345 cygwin* | mingw* | pw32* | cegcc*)
3346 symcode='[[ABCDGISTW]]'
3347 ;;
3348 hpux*)
3349 if test "$host_cpu" = ia64; then
3350 symcode='[[ABCDEGRST]]'
3351 fi
3352 ;;
3353 irix* | nonstopux*)
3354 symcode='[[BCDEGRST]]'
3355 ;;
3356 osf*)
3357 symcode='[[BCDEGQRST]]'
3358 ;;
3359 solaris*)
3360 symcode='[[BDRT]]'
3361 ;;
3362 sco3.2v5*)
3363 symcode='[[DT]]'
3364 ;;
3365 sysv4.2uw2*)
3366 symcode='[[DT]]'
3367 ;;
3368 sysv5* | sco5v6* | unixware* | OpenUNIX*)
3369 symcode='[[ABDT]]'
3370 ;;
3371 sysv4)
3372 symcode='[[DFNSTU]]'
3373 ;;
3374 esac
3375
3376 # If we're using GNU nm, then use its standard symbol codes.
3377 case `$NM -V 2>&1` in
3378 *GNU* | *'with BFD'*)
3379 symcode='[[ABCDGIRSTW]]' ;;
3380 esac
3381
3382 # Transform an extracted symbol line into a proper C declaration.
3383 # Some systems (esp. on ia64) link data and code symbols differently,
3384 # so use this general approach.
3385 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3386
3387 # Transform an extracted symbol line into symbol name and symbol address
3388 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3389 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'"
3390
3391 # Handle CRLF in mingw tool chain
3392 opt_cr=
3393 case $build_os in
3394 mingw*)
3395 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3396 ;;
3397 esac
3398
3399 # Try without a prefix underscore, then with it.
3400 for ac_symprfx in "" "_"; do
3401
3402 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3403 symxfrm="\\1 $ac_symprfx\\2 \\2"
3404
3405 # Write the raw and C identifiers.
3406 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3407 # Fake it for dumpbin and say T for any non-static function
3408 # and D for any global variable.
3409 # Also find C++ and __fastcall symbols from MSVC++,
3410 # which start with @ or ?.
3411 lt_cv_sys_global_symbol_pipe="$AWK ['"\
3412 " {last_section=section; section=\$ 3};"\
3413 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3414 " \$ 0!~/External *\|/{next};"\
3415 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3416 " {if(hide[section]) next};"\
3417 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3418 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3419 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
3420 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3421 " ' prfx=^$ac_symprfx]"
3422 else
3423 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3424 fi
3425
3426 # Check to see that the pipe works correctly.
3427 pipe_works=no
3428
3429 rm -f conftest*
3430 cat > conftest.$ac_ext <<_LT_EOF
3431 #ifdef __cplusplus
3432 extern "C" {
3433 #endif
3434 char nm_test_var;
3435 void nm_test_func(void);
3436 void nm_test_func(void){}
3437 #ifdef __cplusplus
3438 }
3439 #endif
3440 int main(){nm_test_var='a';nm_test_func();return(0);}
3441 _LT_EOF
3442
3443 if AC_TRY_EVAL(ac_compile); then
3444 # Now try to grab the symbols.
3445 nlist=conftest.nm
3446 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3447 # Try sorting and uniquifying the output.
3448 if sort "$nlist" | uniq > "$nlist"T; then
3449 mv -f "$nlist"T "$nlist"
3450 else
3451 rm -f "$nlist"T
3452 fi
3453
3454 # Make sure that we snagged all the symbols we need.
3455 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3456 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3457 cat <<_LT_EOF > conftest.$ac_ext
3458 #ifdef __cplusplus
3459 extern "C" {
3460 #endif
3461
3462 _LT_EOF
3463 # Now generate the symbol file.
3464 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3465
3466 cat <<_LT_EOF >> conftest.$ac_ext
3467
3468 /* The mapping between symbol names and symbols. */
3469 const struct {
3470 const char *name;
3471 void *address;
3472 }
3473 lt__PROGRAM__LTX_preloaded_symbols[[]] =
3474 {
3475 { "@PROGRAM@", (void *) 0 },
3476 _LT_EOF
3477 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3478 cat <<\_LT_EOF >> conftest.$ac_ext
3479 {0, (void *) 0}
3480 };
3481
3482 /* This works around a problem in FreeBSD linker */
3483 #ifdef FREEBSD_WORKAROUND
3484 static const void *lt_preloaded_setup() {
3485 return lt__PROGRAM__LTX_preloaded_symbols;
3486 }
3487 #endif
3488
3489 #ifdef __cplusplus
3490 }
3491 #endif
3492 _LT_EOF
3493 # Now try linking the two files.
3494 mv conftest.$ac_objext conftstm.$ac_objext
3495 lt_save_LIBS="$LIBS"
3496 lt_save_CFLAGS="$CFLAGS"
3497 LIBS="conftstm.$ac_objext"
3498 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3499 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3500 pipe_works=yes
3501 fi
3502 LIBS="$lt_save_LIBS"
3503 CFLAGS="$lt_save_CFLAGS"
3504 else
3505 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3506 fi
3507 else
3508 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3509 fi
3510 else
3511 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3512 fi
3513 else
3514 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3515 cat conftest.$ac_ext >&5
3516 fi
3517 rm -rf conftest* conftst*
3518
3519 # Do not use the global_symbol_pipe unless it works.
3520 if test "$pipe_works" = yes; then
3521 break
3522 else
3523 lt_cv_sys_global_symbol_pipe=
3524 fi
3525 done
3526 ])
3527 if test -z "$lt_cv_sys_global_symbol_pipe"; then
3528 lt_cv_sys_global_symbol_to_cdecl=
3529 fi
3530 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3531 AC_MSG_RESULT(failed)
3532 else
3533 AC_MSG_RESULT(ok)
3534 fi
3535
3536 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3537 [Take the output of nm and produce a listing of raw symbols and C names])
3538 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3539 [Transform the output of nm in a proper C declaration])
3540 _LT_DECL([global_symbol_to_c_name_address],
3541 [lt_cv_sys_global_symbol_to_c_name_address], [1],
3542 [Transform the output of nm in a C name address pair])
3543 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3544 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3545 [Transform the output of nm in a C name address pair when lib prefix is needed])
3546 ]) # _LT_CMD_GLOBAL_SYMBOLS
3547
3548
3549 # _LT_COMPILER_PIC([TAGNAME])
3550 # ---------------------------
3551 m4_defun([_LT_COMPILER_PIC],
3552 [m4_require([_LT_TAG_COMPILER])dnl
3553 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
3554 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3555 _LT_TAGVAR(lt_prog_compiler_static, $1)=
3556
3557 AC_MSG_CHECKING([for $compiler option to produce PIC])
3558 m4_if([$1], [CXX], [
3559 # C++ specific cases for pic, static, wl, etc.
3560 if test "$GXX" = yes; then
3561 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3562 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3563
3564 case $host_os in
3565 aix*)
3566 # All AIX code is PIC.
3567 if test "$host_cpu" = ia64; then
3568 # AIX 5 now supports IA64 processor
3569 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3570 fi
3571 ;;
3572
3573 amigaos*)
3574 case $host_cpu in
3575 powerpc)
3576 # see comment about AmigaOS4 .so support
3577 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3578 ;;
3579 m68k)
3580 # FIXME: we need at least 68020 code to build shared libraries, but
3581 # adding the `-m68020' flag to GCC prevents building anything better,
3582 # like `-m68040'.
3583 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3584 ;;
3585 esac
3586 ;;
3587
3588 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3589 # PIC is the default for these OSes.
3590 ;;
3591 mingw* | cygwin* | os2* | pw32* | cegcc*)
3592 # This hack is so that the source file can tell whether it is being
3593 # built for inclusion in a dll (and should export symbols for example).
3594 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3595 # (--disable-auto-import) libraries
3596 m4_if([$1], [GCJ], [],
3597 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3598 ;;
3599 darwin* | rhapsody*)
3600 # PIC is the default on this platform
3601 # Common symbols not allowed in MH_DYLIB files
3602 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3603 ;;
3604 *djgpp*)
3605 # DJGPP does not support shared libraries at all
3606 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3607 ;;
3608 interix[[3-9]]*)
3609 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3610 # Instead, we relocate shared libraries at runtime.
3611 ;;
3612 sysv4*MP*)
3613 if test -d /usr/nec; then
3614 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3615 fi
3616 ;;
3617 hpux*)
3618 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3619 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3620 # sets the default TLS model and affects inlining.
3621 case $host_cpu in
3622 hppa*64*)
3623 ;;
3624 *)
3625 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3626 ;;
3627 esac
3628 ;;
3629 *qnx* | *nto*)
3630 # QNX uses GNU C++, but need to define -shared option too, otherwise
3631 # it will coredump.
3632 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3633 ;;
3634 *)
3635 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3636 ;;
3637 esac
3638 else
3639 case $host_os in
3640 aix[[4-9]]*)
3641 # All AIX code is PIC.
3642 if test "$host_cpu" = ia64; then
3643 # AIX 5 now supports IA64 processor
3644 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3645 else
3646 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3647 fi
3648 ;;
3649 chorus*)
3650 case $cc_basename in
3651 cxch68*)
3652 # Green Hills C++ Compiler
3653 # _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"
3654 ;;
3655 esac
3656 ;;
3657 dgux*)
3658 case $cc_basename in
3659 ec++*)
3660 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3661 ;;
3662 ghcx*)
3663 # Green Hills C++ Compiler
3664 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3665 ;;
3666 *)
3667 ;;
3668 esac
3669 ;;
3670 freebsd* | dragonfly*)
3671 # FreeBSD uses GNU C++
3672 ;;
3673 hpux9* | hpux10* | hpux11*)
3674 case $cc_basename in
3675 CC*)
3676 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3677 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3678 if test "$host_cpu" != ia64; then
3679 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3680 fi
3681 ;;
3682 aCC*)
3683 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3684 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3685 case $host_cpu in
3686 hppa*64*|ia64*)
3687 # +Z the default
3688 ;;
3689 *)
3690 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3691 ;;
3692 esac
3693 ;;
3694 *)
3695 ;;
3696 esac
3697 ;;
3698 interix*)
3699 # This is c89, which is MS Visual C++ (no shared libs)
3700 # Anyone wants to do a port?
3701 ;;
3702 irix5* | irix6* | nonstopux*)
3703 case $cc_basename in
3704 CC*)
3705 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3706 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3707 # CC pic flag -KPIC is the default.
3708 ;;
3709 *)
3710 ;;
3711 esac
3712 ;;
3713 linux* | k*bsd*-gnu)
3714 case $cc_basename in
3715 KCC*)
3716 # KAI C++ Compiler
3717 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3718 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3719 ;;
3720 ecpc* )
3721 # old Intel C++ for x86_64 which still supported -KPIC.
3722 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3723 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3724 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3725 ;;
3726 icpc* )
3727 # Intel C++, used to be incompatible with GCC.
3728 # ICC 10 doesn't accept -KPIC any more.
3729 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3730 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3731 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3732 ;;
3733 pgCC* | pgcpp*)
3734 # Portland Group C++ compiler
3735 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3736 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3737 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3738 ;;
3739 cxx*)
3740 # Compaq C++
3741 # Make sure the PIC flag is empty. It appears that all Alpha
3742 # Linux and Compaq Tru64 Unix objects are PIC.
3743 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3744 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3745 ;;
3746 xlc* | xlC*)
3747 # IBM XL 8.0 on PPC
3748 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3749 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3750 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3751 ;;
3752 *)
3753 case `$CC -V 2>&1 | sed 5q` in
3754 *Sun\ C*)
3755 # Sun C++ 5.9
3756 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3757 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3758 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3759 ;;
3760 esac
3761 ;;
3762 esac
3763 ;;
3764 lynxos*)
3765 ;;
3766 m88k*)
3767 ;;
3768 mvs*)
3769 case $cc_basename in
3770 cxx*)
3771 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3772 ;;
3773 *)
3774 ;;
3775 esac
3776 ;;
3777 netbsd*)
3778 ;;
3779 *qnx* | *nto*)
3780 # QNX uses GNU C++, but need to define -shared option too, otherwise
3781 # it will coredump.
3782 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3783 ;;
3784 osf3* | osf4* | osf5*)
3785 case $cc_basename in
3786 KCC*)
3787 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3788 ;;
3789 RCC*)
3790 # Rational C++ 2.4.1
3791 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3792 ;;
3793 cxx*)
3794 # Digital/Compaq C++
3795 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3796 # Make sure the PIC flag is empty. It appears that all Alpha
3797 # Linux and Compaq Tru64 Unix objects are PIC.
3798 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3799 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3800 ;;
3801 *)
3802 ;;
3803 esac
3804 ;;
3805 psos*)
3806 ;;
3807 solaris*)
3808 case $cc_basename in
3809 CC*)
3810 # Sun C++ 4.2, 5.x and Centerline C++
3811 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3812 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3813 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3814 ;;
3815 gcx*)
3816 # Green Hills C++ Compiler
3817 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3818 ;;
3819 *)
3820 ;;
3821 esac
3822 ;;
3823 sunos4*)
3824 case $cc_basename in
3825 CC*)
3826 # Sun C++ 4.x
3827 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3828 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3829 ;;
3830 lcc*)
3831 # Lucid
3832 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3833 ;;
3834 *)
3835 ;;
3836 esac
3837 ;;
3838 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3839 case $cc_basename in
3840 CC*)
3841 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3842 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3843 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3844 ;;
3845 esac
3846 ;;
3847 tandem*)
3848 case $cc_basename in
3849 NCC*)
3850 # NonStop-UX NCC 3.20
3851 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3852 ;;
3853 *)
3854 ;;
3855 esac
3856 ;;
3857 vxworks*)
3858 ;;
3859 *)
3860 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3861 ;;
3862 esac
3863 fi
3864 ],
3865 [
3866 if test "$GCC" = yes; then
3867 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3868 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3869
3870 case $host_os in
3871 aix*)
3872 # All AIX code is PIC.
3873 if test "$host_cpu" = ia64; then
3874 # AIX 5 now supports IA64 processor
3875 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3876 fi
3877 ;;
3878
3879 amigaos*)
3880 case $host_cpu in
3881 powerpc)
3882 # see comment about AmigaOS4 .so support
3883 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3884 ;;
3885 m68k)
3886 # FIXME: we need at least 68020 code to build shared libraries, but
3887 # adding the `-m68020' flag to GCC prevents building anything better,
3888 # like `-m68040'.
3889 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3890 ;;
3891 esac
3892 ;;
3893
3894 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3895 # PIC is the default for these OSes.
3896 ;;
3897
3898 mingw* | cygwin* | pw32* | os2* | cegcc*)
3899 # This hack is so that the source file can tell whether it is being
3900 # built for inclusion in a dll (and should export symbols for example).
3901 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3902 # (--disable-auto-import) libraries
3903 m4_if([$1], [GCJ], [],
3904 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3905 ;;
3906
3907 darwin* | rhapsody*)
3908 # PIC is the default on this platform
3909 # Common symbols not allowed in MH_DYLIB files
3910 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3911 ;;
3912
3913 hpux*)
3914 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3915 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3916 # sets the default TLS model and affects inlining.
3917 case $host_cpu in
3918 hppa*64*)
3919 # +Z the default
3920 ;;
3921 *)
3922 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3923 ;;
3924 esac
3925 ;;
3926
3927 interix[[3-9]]*)
3928 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3929 # Instead, we relocate shared libraries at runtime.
3930 ;;
3931
3932 msdosdjgpp*)
3933 # Just because we use GCC doesn't mean we suddenly get shared libraries
3934 # on systems that don't support them.
3935 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3936 enable_shared=no
3937 ;;
3938
3939 *nto* | *qnx*)
3940 # QNX uses GNU C++, but need to define -shared option too, otherwise
3941 # it will coredump.
3942 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3943 ;;
3944
3945 sysv4*MP*)
3946 if test -d /usr/nec; then
3947 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3948 fi
3949 ;;
3950
3951 *)
3952 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3953 ;;
3954 esac
3955 else
3956 # PORTME Check for flag to pass linker flags through the system compiler.
3957 case $host_os in
3958 aix*)
3959 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3960 if test "$host_cpu" = ia64; then
3961 # AIX 5 now supports IA64 processor
3962 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3963 else
3964 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3965 fi
3966 ;;
3967
3968 mingw* | cygwin* | pw32* | os2* | cegcc*)
3969 # This hack is so that the source file can tell whether it is being
3970 # built for inclusion in a dll (and should export symbols for example).
3971 m4_if([$1], [GCJ], [],
3972 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3973 ;;
3974
3975 hpux9* | hpux10* | hpux11*)
3976 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3977 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3978 # not for PA HP-UX.
3979 case $host_cpu in
3980 hppa*64*|ia64*)
3981 # +Z the default
3982 ;;
3983 *)
3984 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3985 ;;
3986 esac
3987 # Is there a better lt_prog_compiler_static that works with the bundled CC?
3988 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3989 ;;
3990
3991 irix5* | irix6* | nonstopux*)
3992 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3993 # PIC (with -KPIC) is the default.
3994 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3995 ;;
3996
3997 linux* | k*bsd*-gnu)
3998 case $cc_basename in
3999 # old Intel for x86_64 which still supported -KPIC.
4000 ecc*)
4001 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4002 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4003 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4004 ;;
4005 # icc used to be incompatible with GCC.
4006 # ICC 10 doesn't accept -KPIC any more.
4007 icc* | ifort*)
4008 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4009 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4010 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4011 ;;
4012 # Lahey Fortran 8.1.
4013 lf95*)
4014 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4015 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4016 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4017 ;;
4018 pgcc* | pgf77* | pgf90* | pgf95*)
4019 # Portland Group compilers (*not* the Pentium gcc compiler,
4020 # which looks to be a dead project)
4021 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4022 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4023 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4024 ;;
4025 ccc*)
4026 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4027 # All Alpha code is PIC.
4028 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4029 ;;
4030 xl*)
4031 # IBM XL C 8.0/Fortran 10.1 on PPC
4032 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4033 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4034 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4035 ;;
4036 *)
4037 case `$CC -V 2>&1 | sed 5q` in
4038 *Sun\ C*)
4039 # Sun C 5.9
4040 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4041 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4042 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4043 ;;
4044 *Sun\ F*)
4045 # Sun Fortran 8.3 passes all unrecognized flags to the linker
4046 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4047 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4048 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4049 ;;
4050 esac
4051 ;;
4052 esac
4053 ;;
4054
4055 newsos6)
4056 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4057 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4058 ;;
4059
4060 *nto* | *qnx*)
4061 # QNX uses GNU C++, but need to define -shared option too, otherwise
4062 # it will coredump.
4063 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4064 ;;
4065
4066 osf3* | osf4* | osf5*)
4067 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4068 # All OSF/1 code is PIC.
4069 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4070 ;;
4071
4072 rdos*)
4073 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4074 ;;
4075
4076 solaris*)
4077 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4078 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4079 case $cc_basename in
4080 f77* | f90* | f95*)
4081 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4082 *)
4083 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4084 esac
4085 ;;
4086
4087 sunos4*)
4088 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4089 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4090 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4091 ;;
4092
4093 sysv4 | sysv4.2uw2* | sysv4.3*)
4094 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4095 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4096 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4097 ;;
4098
4099 sysv4*MP*)
4100 if test -d /usr/nec ;then
4101 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4102 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4103 fi
4104 ;;
4105
4106 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4107 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4108 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4109 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4110 ;;
4111
4112 unicos*)
4113 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4114 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4115 ;;
4116
4117 uts4*)
4118 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4119 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4120 ;;
4121
4122 *)
4123 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4124 ;;
4125 esac
4126 fi
4127 ])
4128 case $host_os in
4129 # For platforms which do not support PIC, -DPIC is meaningless:
4130 *djgpp*)
4131 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4132 ;;
4133 *)
4134 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4135 ;;
4136 esac
4137 AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4138 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4139 [How to pass a linker flag through the compiler])
4140
4141 #
4142 # Check to make sure the PIC flag actually works.
4143 #
4144 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4145 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4146 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4147 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4148 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4149 "" | " "*) ;;
4150 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4151 esac],
4152 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4153 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4154 fi
4155 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4156 [Additional compiler flags for building library objects])
4157
4158 #
4159 # Check to make sure the static flag actually works.
4160 #
4161 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4162 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4163 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4164 $lt_tmp_static_flag,
4165 [],
4166 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4167 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4168 [Compiler flag to prevent dynamic linking])
4169 ])# _LT_COMPILER_PIC
4170
4171
4172 # _LT_LINKER_SHLIBS([TAGNAME])
4173 # ----------------------------
4174 # See if the linker supports building shared libraries.
4175 m4_defun([_LT_LINKER_SHLIBS],
4176 [AC_REQUIRE([LT_PATH_LD])dnl
4177 AC_REQUIRE([LT_PATH_NM])dnl
4178 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4179 m4_require([_LT_DECL_EGREP])dnl
4180 m4_require([_LT_DECL_SED])dnl
4181 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4182 m4_require([_LT_TAG_COMPILER])dnl
4183 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4184 m4_if([$1], [CXX], [
4185 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4186 case $host_os in
4187 aix[[4-9]]*)
4188 # If we're using GNU nm, then we don't want the "-C" option.
4189 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4190 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4191 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4192 else
4193 _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'
4194 fi
4195 ;;
4196 pw32*)
4197 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4198 ;;
4199 cygwin* | mingw* | cegcc*)
4200 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4201 ;;
4202 *)
4203 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4204 ;;
4205 esac
4206 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4207 ], [
4208 runpath_var=
4209 _LT_TAGVAR(allow_undefined_flag, $1)=
4210 _LT_TAGVAR(always_export_symbols, $1)=no
4211 _LT_TAGVAR(archive_cmds, $1)=
4212 _LT_TAGVAR(archive_expsym_cmds, $1)=
4213 _LT_TAGVAR(compiler_needs_object, $1)=no
4214 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4215 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4216 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4217 _LT_TAGVAR(hardcode_automatic, $1)=no
4218 _LT_TAGVAR(hardcode_direct, $1)=no
4219 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4220 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4221 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4222 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4223 _LT_TAGVAR(hardcode_minus_L, $1)=no
4224 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4225 _LT_TAGVAR(inherit_rpath, $1)=no
4226 _LT_TAGVAR(link_all_deplibs, $1)=unknown
4227 _LT_TAGVAR(module_cmds, $1)=
4228 _LT_TAGVAR(module_expsym_cmds, $1)=
4229 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4230 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4231 _LT_TAGVAR(thread_safe_flag_spec, $1)=
4232 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4233 # include_expsyms should be a list of space-separated symbols to be *always*
4234 # included in the symbol list
4235 _LT_TAGVAR(include_expsyms, $1)=
4236 # exclude_expsyms can be an extended regexp of symbols to exclude
4237 # it will be wrapped by ` (' and `)$', so one must not match beginning or
4238 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4239 # as well as any symbol that contains `d'.
4240 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4241 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4242 # platforms (ab)use it in PIC code, but their linkers get confused if
4243 # the symbol is explicitly referenced. Since portable code cannot
4244 # rely on this symbol name, it's probably fine to never include it in
4245 # preloaded symbol tables.
4246 # Exclude shared library initialization/finalization symbols.
4247 dnl Note also adjust exclude_expsyms for C++ above.
4248 extract_expsyms_cmds=
4249
4250 case $host_os in
4251 cygwin* | mingw* | pw32* | cegcc*)
4252 # FIXME: the MSVC++ port hasn't been tested in a loooong time
4253 # When not using gcc, we currently assume that we are using
4254 # Microsoft Visual C++.
4255 if test "$GCC" != yes; then
4256 with_gnu_ld=no
4257 fi
4258 ;;
4259 interix*)
4260 # we just hope/assume this is gcc and not c89 (= MSVC++)
4261 with_gnu_ld=yes
4262 ;;
4263 openbsd*)
4264 with_gnu_ld=no
4265 ;;
4266 esac
4267
4268 _LT_TAGVAR(ld_shlibs, $1)=yes
4269 if test "$with_gnu_ld" = yes; then
4270 # If archive_cmds runs LD, not CC, wlarc should be empty
4271 wlarc='${wl}'
4272
4273 # Set some defaults for GNU ld with shared library support. These
4274 # are reset later if shared libraries are not supported. Putting them
4275 # here allows them to be overridden if necessary.
4276 runpath_var=LD_RUN_PATH
4277 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4278 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4279 # ancient GNU ld didn't support --whole-archive et. al.
4280 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4281 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4282 else
4283 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4284 fi
4285 supports_anon_versioning=no
4286 case `$LD -v 2>&1` in
4287 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4288 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4289 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4290 *\ 2.11.*) ;; # other 2.11 versions
4291 *) supports_anon_versioning=yes ;;
4292 esac
4293
4294 # See if GNU ld supports shared libraries.
4295 case $host_os in
4296 aix[[3-9]]*)
4297 # On AIX/PPC, the GNU linker is very broken
4298 if test "$host_cpu" != ia64; then
4299 _LT_TAGVAR(ld_shlibs, $1)=no
4300 cat <<_LT_EOF 1>&2
4301
4302 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
4303 *** to be unable to reliably create shared libraries on AIX.
4304 *** Therefore, libtool is disabling shared libraries support. If you
4305 *** really care for shared libraries, you may want to modify your PATH
4306 *** so that a non-GNU linker is found, and then restart.
4307
4308 _LT_EOF
4309 fi
4310 ;;
4311
4312 amigaos*)
4313 case $host_cpu in
4314 powerpc)
4315 # see comment about AmigaOS4 .so support
4316 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4317 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4318 ;;
4319 m68k)
4320 _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)'
4321 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4322 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4323 ;;
4324 esac
4325 ;;
4326
4327 beos*)
4328 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4329 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4330 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4331 # support --undefined. This deserves some investigation. FIXME
4332 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4333 else
4334 _LT_TAGVAR(ld_shlibs, $1)=no
4335 fi
4336 ;;
4337
4338 cygwin* | mingw* | pw32* | cegcc*)
4339 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4340 # as there is no search path for DLLs.
4341 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4342 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4343 _LT_TAGVAR(always_export_symbols, $1)=no
4344 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4345 _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'
4346
4347 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4348 _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'
4349 # If the export-symbols file already is a .def file (1st line
4350 # is EXPORTS), use it as is; otherwise, prepend...
4351 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4352 cp $export_symbols $output_objdir/$soname.def;
4353 else
4354 echo EXPORTS > $output_objdir/$soname.def;
4355 cat $export_symbols >> $output_objdir/$soname.def;
4356 fi~
4357 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4358 else
4359 _LT_TAGVAR(ld_shlibs, $1)=no
4360 fi
4361 ;;
4362
4363 interix[[3-9]]*)
4364 _LT_TAGVAR(hardcode_direct, $1)=no
4365 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4366 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4367 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4368 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4369 # Instead, shared libraries are loaded at an image base (0x10000000 by
4370 # default) and relocated if they conflict, which is a slow very memory
4371 # consuming and fragmenting process. To avoid this, we pick a random,
4372 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4373 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
4374 _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'
4375 _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'
4376 ;;
4377
4378 gnu* | linux* | tpf* | k*bsd*-gnu)
4379 tmp_diet=no
4380 if test "$host_os" = linux-dietlibc; then
4381 case $cc_basename in
4382 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
4383 esac
4384 fi
4385 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4386 && test "$tmp_diet" = no
4387 then
4388 tmp_addflag=
4389 tmp_sharedflag='-shared'
4390 case $cc_basename,$host_cpu in
4391 pgcc*) # Portland Group C compiler
4392 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4393 tmp_addflag=' $pic_flag'
4394 ;;
4395 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
4396 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4397 tmp_addflag=' $pic_flag -Mnomain' ;;
4398 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
4399 tmp_addflag=' -i_dynamic' ;;
4400 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
4401 tmp_addflag=' -i_dynamic -nofor_main' ;;
4402 ifc* | ifort*) # Intel Fortran compiler
4403 tmp_addflag=' -nofor_main' ;;
4404 lf95*) # Lahey Fortran 8.1
4405 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4406 tmp_sharedflag='--shared' ;;
4407 xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4408 tmp_sharedflag='-qmkshrobj'
4409 tmp_addflag= ;;
4410 esac
4411 case `$CC -V 2>&1 | sed 5q` in
4412 *Sun\ C*) # Sun C 5.9
4413 _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4414 _LT_TAGVAR(compiler_needs_object, $1)=yes
4415 tmp_sharedflag='-G' ;;
4416 *Sun\ F*) # Sun Fortran 8.3
4417 tmp_sharedflag='-G' ;;
4418 esac
4419 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4420
4421 if test "x$supports_anon_versioning" = xyes; then
4422 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4423 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4424 echo "local: *; };" >> $output_objdir/$libname.ver~
4425 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4426 fi
4427
4428 case $cc_basename in
4429 xlf*)
4430 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4431 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4432 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4433 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4434 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4435 if test "x$supports_anon_versioning" = xyes; then
4436 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4437 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4438 echo "local: *; };" >> $output_objdir/$libname.ver~
4439 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4440 fi
4441 ;;
4442 esac
4443 else
4444 _LT_TAGVAR(ld_shlibs, $1)=no
4445 fi
4446 ;;
4447
4448 netbsd*)
4449 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4450 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4451 wlarc=
4452 else
4453 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4454 _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'
4455 fi
4456 ;;
4457
4458 solaris*)
4459 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4460 _LT_TAGVAR(ld_shlibs, $1)=no
4461 cat <<_LT_EOF 1>&2
4462
4463 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
4464 *** create shared libraries on Solaris systems. Therefore, libtool
4465 *** is disabling shared libraries support. We urge you to upgrade GNU
4466 *** binutils to release 2.9.1 or newer. Another option is to modify
4467 *** your PATH or compiler configuration so that the native linker is
4468 *** used, and then restart.
4469
4470 _LT_EOF
4471 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4472 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4473 _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'
4474 else
4475 _LT_TAGVAR(ld_shlibs, $1)=no
4476 fi
4477 ;;
4478
4479 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4480 case `$LD -v 2>&1` in
4481 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4482 _LT_TAGVAR(ld_shlibs, $1)=no
4483 cat <<_LT_EOF 1>&2
4484
4485 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4486 *** reliably create shared libraries on SCO systems. Therefore, libtool
4487 *** is disabling shared libraries support. We urge you to upgrade GNU
4488 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
4489 *** your PATH or compiler configuration so that the native linker is
4490 *** used, and then restart.
4491
4492 _LT_EOF
4493 ;;
4494 *)
4495 # For security reasons, it is highly recommended that you always
4496 # use absolute paths for naming shared libraries, and exclude the
4497 # DT_RUNPATH tag from executables and libraries. But doing so
4498 # requires that you compile everything twice, which is a pain.
4499 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4500 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4501 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4502 _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'
4503 else
4504 _LT_TAGVAR(ld_shlibs, $1)=no
4505 fi
4506 ;;
4507 esac
4508 ;;
4509
4510 sunos4*)
4511 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4512 wlarc=
4513 _LT_TAGVAR(hardcode_direct, $1)=yes
4514 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4515 ;;
4516
4517 *)
4518 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4519 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4520 _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'
4521 else
4522 _LT_TAGVAR(ld_shlibs, $1)=no
4523 fi
4524 ;;
4525 esac
4526
4527 if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4528 runpath_var=
4529 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4530 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4531 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4532 fi
4533 else
4534 # PORTME fill in a description of your system's linker (not GNU ld)
4535 case $host_os in
4536 aix3*)
4537 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4538 _LT_TAGVAR(always_export_symbols, $1)=yes
4539 _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'
4540 # Note: this linker hardcodes the directories in LIBPATH if there
4541 # are no directories specified by -L.
4542 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4543 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4544 # Neither direct hardcoding nor static linking is supported with a
4545 # broken collect2.
4546 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4547 fi
4548 ;;
4549
4550 aix[[4-9]]*)
4551 if test "$host_cpu" = ia64; then
4552 # On IA64, the linker does run time linking by default, so we don't
4553 # have to do anything special.
4554 aix_use_runtimelinking=no
4555 exp_sym_flag='-Bexport'
4556 no_entry_flag=""
4557 else
4558 # If we're using GNU nm, then we don't want the "-C" option.
4559 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4560 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4561 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4562 else
4563 _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'
4564 fi
4565 aix_use_runtimelinking=no
4566
4567 # Test if we are trying to use run time linking or normal
4568 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
4569 # need to do runtime linking.
4570 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4571 for ld_flag in $LDFLAGS; do
4572 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4573 aix_use_runtimelinking=yes
4574 break
4575 fi
4576 done
4577 ;;
4578 esac
4579
4580 exp_sym_flag='-bexport'
4581 no_entry_flag='-bnoentry'
4582 fi
4583
4584 # When large executables or shared objects are built, AIX ld can
4585 # have problems creating the table of contents. If linking a library
4586 # or program results in "error TOC overflow" add -mminimal-toc to
4587 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
4588 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4589
4590 _LT_TAGVAR(archive_cmds, $1)=''
4591 _LT_TAGVAR(hardcode_direct, $1)=yes
4592 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4593 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4594 _LT_TAGVAR(link_all_deplibs, $1)=yes
4595 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4596
4597 if test "$GCC" = yes; then
4598 case $host_os in aix4.[[012]]|aix4.[[012]].*)
4599 # We only want to do this on AIX 4.2 and lower, the check
4600 # below for broken collect2 doesn't work under 4.3+
4601 collect2name=`${CC} -print-prog-name=collect2`
4602 if test -f "$collect2name" &&
4603 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4604 then
4605 # We have reworked collect2
4606 :
4607 else
4608 # We have old collect2
4609 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4610 # It fails to find uninstalled libraries when the uninstalled
4611 # path is not listed in the libpath. Setting hardcode_minus_L
4612 # to unsupported forces relinking
4613 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4614 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4615 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4616 fi
4617 ;;
4618 esac
4619 shared_flag='-shared'
4620 if test "$aix_use_runtimelinking" = yes; then
4621 shared_flag="$shared_flag "'${wl}-G'
4622 fi
4623 else
4624 # not using gcc
4625 if test "$host_cpu" = ia64; then
4626 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4627 # chokes on -Wl,-G. The following line is correct:
4628 shared_flag='-G'
4629 else
4630 if test "$aix_use_runtimelinking" = yes; then
4631 shared_flag='${wl}-G'
4632 else
4633 shared_flag='${wl}-bM:SRE'
4634 fi
4635 fi
4636 fi
4637
4638 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4639 # It seems that -bexpall does not export symbols beginning with
4640 # underscore (_), so it is better to generate a list of symbols to export.
4641 _LT_TAGVAR(always_export_symbols, $1)=yes
4642 if test "$aix_use_runtimelinking" = yes; then
4643 # Warning - without using the other runtime loading flags (-brtl),
4644 # -berok will link without error, but may produce a broken library.
4645 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4646 # Determine the default libpath from the value encoded in an
4647 # empty executable.
4648 _LT_SYS_MODULE_PATH_AIX
4649 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4650 _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4651 else
4652 if test "$host_cpu" = ia64; then
4653 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4654 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4655 _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"
4656 else
4657 # Determine the default libpath from the value encoded in an
4658 # empty executable.
4659 _LT_SYS_MODULE_PATH_AIX
4660 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4661 # Warning - without using the other run time loading flags,
4662 # -berok will link without error, but may produce a broken library.
4663 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4664 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4665 # Exported symbols can be pulled into shared objects from archives
4666 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4667 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4668 # This is similar to how AIX traditionally builds its shared libraries.
4669 _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'
4670 fi
4671 fi
4672 ;;
4673
4674 amigaos*)
4675 case $host_cpu in
4676 powerpc)
4677 # see comment about AmigaOS4 .so support
4678 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4679 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4680 ;;
4681 m68k)
4682 _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)'
4683 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4684 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4685 ;;
4686 esac
4687 ;;
4688
4689 bsdi[[45]]*)
4690 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4691 ;;
4692
4693 cygwin* | mingw* | pw32* | cegcc*)
4694 # When not using gcc, we currently assume that we are using
4695 # Microsoft Visual C++.
4696 # hardcode_libdir_flag_spec is actually meaningless, as there is
4697 # no search path for DLLs.
4698 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4699 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4700 # Tell ltmain to make .lib files, not .a files.
4701 libext=lib
4702 # Tell ltmain to make .dll files, not .so files.
4703 shrext_cmds=".dll"
4704 # FIXME: Setting linknames here is a bad hack.
4705 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4706 # The linker will automatically build a .lib file if we build a DLL.
4707 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4708 # FIXME: Should let the user specify the lib program.
4709 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4710 _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4711 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4712 ;;
4713
4714 darwin* | rhapsody*)
4715 _LT_DARWIN_LINKER_FEATURES($1)
4716 ;;
4717
4718 dgux*)
4719 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4720 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4721 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4722 ;;
4723
4724 freebsd1*)
4725 _LT_TAGVAR(ld_shlibs, $1)=no
4726 ;;
4727
4728 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4729 # support. Future versions do this automatically, but an explicit c++rt0.o
4730 # does not break anything, and helps significantly (at the cost of a little
4731 # extra space).
4732 freebsd2.2*)
4733 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4734 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4735 _LT_TAGVAR(hardcode_direct, $1)=yes
4736 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4737 ;;
4738
4739 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4740 freebsd2*)
4741 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4742 _LT_TAGVAR(hardcode_direct, $1)=yes
4743 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4744 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4745 ;;
4746
4747 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4748 freebsd* | dragonfly*)
4749 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4750 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4751 _LT_TAGVAR(hardcode_direct, $1)=yes
4752 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4753 ;;
4754
4755 hpux9*)
4756 if test "$GCC" = yes; then
4757 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4758 else
4759 _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'
4760 fi
4761 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4762 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4763 _LT_TAGVAR(hardcode_direct, $1)=yes
4764
4765 # hardcode_minus_L: Not really in the search PATH,
4766 # but as the default location of the library.
4767 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4768 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4769 ;;
4770
4771 hpux10*)
4772 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4773 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4774 else
4775 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4776 fi
4777 if test "$with_gnu_ld" = no; then
4778 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4779 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4780 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4781 _LT_TAGVAR(hardcode_direct, $1)=yes
4782 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4783 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4784 # hardcode_minus_L: Not really in the search PATH,
4785 # but as the default location of the library.
4786 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4787 fi
4788 ;;
4789
4790 hpux11*)
4791 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4792 case $host_cpu in
4793 hppa*64*)
4794 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4795 ;;
4796 ia64*)
4797 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4798 ;;
4799 *)
4800 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4801 ;;
4802 esac
4803 else
4804 case $host_cpu in
4805 hppa*64*)
4806 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4807 ;;
4808 ia64*)
4809 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4810 ;;
4811 *)
4812 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4813 ;;
4814 esac
4815 fi
4816 if test "$with_gnu_ld" = no; then
4817 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4818 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4819
4820 case $host_cpu in
4821 hppa*64*|ia64*)
4822 _LT_TAGVAR(hardcode_direct, $1)=no
4823 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4824 ;;
4825 *)
4826 _LT_TAGVAR(hardcode_direct, $1)=yes
4827 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4828 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4829
4830 # hardcode_minus_L: Not really in the search PATH,
4831 # but as the default location of the library.
4832 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4833 ;;
4834 esac
4835 fi
4836 ;;
4837
4838 irix5* | irix6* | nonstopux*)
4839 if test "$GCC" = yes; then
4840 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4841 # Try to use the -exported_symbol ld option, if it does not
4842 # work, assume that -exports_file does not work either and
4843 # implicitly export all symbols.
4844 save_LDFLAGS="$LDFLAGS"
4845 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4846 AC_LINK_IFELSE(int foo(void) {},
4847 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4848 )
4849 LDFLAGS="$save_LDFLAGS"
4850 else
4851 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4852 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
4853 fi
4854 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4855 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4856 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4857 _LT_TAGVAR(inherit_rpath, $1)=yes
4858 _LT_TAGVAR(link_all_deplibs, $1)=yes
4859 ;;
4860
4861 netbsd*)
4862 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4863 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
4864 else
4865 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
4866 fi
4867 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4868 _LT_TAGVAR(hardcode_direct, $1)=yes
4869 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4870 ;;
4871
4872 newsos6)
4873 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4874 _LT_TAGVAR(hardcode_direct, $1)=yes
4875 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4876 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4877 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4878 ;;
4879
4880 *nto* | *qnx*)
4881 ;;
4882
4883 openbsd*)
4884 if test -f /usr/libexec/ld.so; then
4885 _LT_TAGVAR(hardcode_direct, $1)=yes
4886 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4887 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4888 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4889 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4890 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4891 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4892 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4893 else
4894 case $host_os in
4895 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4896 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4897 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4898 ;;
4899 *)
4900 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4901 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4902 ;;
4903 esac
4904 fi
4905 else
4906 _LT_TAGVAR(ld_shlibs, $1)=no
4907 fi
4908 ;;
4909
4910 os2*)
4911 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4912 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4913 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4914 _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'
4915 _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4916 ;;
4917
4918 osf3*)
4919 if test "$GCC" = yes; then
4920 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4921 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4922 else
4923 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4924 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4925 fi
4926 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4927 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4928 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4929 ;;
4930
4931 osf4* | osf5*) # as osf3* with the addition of -msym flag
4932 if test "$GCC" = yes; then
4933 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4934 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4935 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4936 else
4937 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4938 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4939 _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~
4940 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
4941
4942 # Both c and cxx compiler support -rpath directly
4943 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4944 fi
4945 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4946 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4947 ;;
4948
4949 solaris*)
4950 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4951 if test "$GCC" = yes; then
4952 wlarc='${wl}'
4953 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4954 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4955 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4956 else
4957 case `$CC -V 2>&1` in
4958 *"Compilers 5.0"*)
4959 wlarc=''
4960 _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4961 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4962 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4963 ;;
4964 *)
4965 wlarc='${wl}'
4966 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4967 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4968 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4969 ;;
4970 esac
4971 fi
4972 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4973 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4974 case $host_os in
4975 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4976 *)
4977 # The compiler driver will combine and reorder linker options,
4978 # but understands `-z linker_flag'. GCC discards it without `$wl',
4979 # but is careful enough not to reorder.
4980 # Supported since Solaris 2.6 (maybe 2.5.1?)
4981 if test "$GCC" = yes; then
4982 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4983 else
4984 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4985 fi
4986 ;;
4987 esac
4988 _LT_TAGVAR(link_all_deplibs, $1)=yes
4989 ;;
4990
4991 sunos4*)
4992 if test "x$host_vendor" = xsequent; then
4993 # Use $CC to link under sequent, because it throws in some extra .o
4994 # files that make .init and .fini sections work.
4995 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4996 else
4997 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
4998 fi
4999 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5000 _LT_TAGVAR(hardcode_direct, $1)=yes
5001 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5002 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5003 ;;
5004
5005 sysv4)
5006 case $host_vendor in
5007 sni)
5008 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5009 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5010 ;;
5011 siemens)
5012 ## LD is ld it makes a PLAMLIB
5013 ## CC just makes a GrossModule.
5014 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5015 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5016 _LT_TAGVAR(hardcode_direct, $1)=no
5017 ;;
5018 motorola)
5019 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5020 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5021 ;;
5022 esac
5023 runpath_var='LD_RUN_PATH'
5024 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5025 ;;
5026
5027 sysv4.3*)
5028 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5029 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5030 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5031 ;;
5032
5033 sysv4*MP*)
5034 if test -d /usr/nec; then
5035 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5036 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5037 runpath_var=LD_RUN_PATH
5038 hardcode_runpath_var=yes
5039 _LT_TAGVAR(ld_shlibs, $1)=yes
5040 fi
5041 ;;
5042
5043 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5044 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5045 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5046 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5047 runpath_var='LD_RUN_PATH'
5048
5049 if test "$GCC" = yes; then
5050 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5051 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5052 else
5053 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5054 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5055 fi
5056 ;;
5057
5058 sysv5* | sco3.2v5* | sco5v6*)
5059 # Note: We can NOT use -z defs as we might desire, because we do not
5060 # link with -lc, and that would cause any symbols used from libc to
5061 # always be unresolved, which means just about no library would
5062 # ever link correctly. If we're not using GNU ld we use -z text
5063 # though, which does catch some bad symbols but isn't as heavy-handed
5064 # as -z defs.
5065 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5066 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5067 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5068 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5069 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5070 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5071 _LT_TAGVAR(link_all_deplibs, $1)=yes
5072 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5073 runpath_var='LD_RUN_PATH'
5074
5075 if test "$GCC" = yes; then
5076 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5077 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5078 else
5079 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5080 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5081 fi
5082 ;;
5083
5084 uts4*)
5085 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5086 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5087 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5088 ;;
5089
5090 *)
5091 _LT_TAGVAR(ld_shlibs, $1)=no
5092 ;;
5093 esac
5094
5095 if test x$host_vendor = xsni; then
5096 case $host in
5097 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5098 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5099 ;;
5100 esac
5101 fi
5102 fi
5103 ])
5104 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5105 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5106
5107 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5108
5109 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5110 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5111 _LT_DECL([], [extract_expsyms_cmds], [2],
5112 [The commands to extract the exported symbol list from a shared archive])
5113
5114 #
5115 # Do we need to explicitly link libc?
5116 #
5117 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5118 x|xyes)
5119 # Assume -lc should be added
5120 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5121
5122 if test "$enable_shared" = yes && test "$GCC" = yes; then
5123 case $_LT_TAGVAR(archive_cmds, $1) in
5124 *'~'*)
5125 # FIXME: we may have to deal with multi-command sequences.
5126 ;;
5127 '$CC '*)
5128 # Test whether the compiler implicitly links with -lc since on some
5129 # systems, -lgcc has to come before -lc. If gcc already passes -lc
5130 # to ld, don't add -lc before -lgcc.
5131 AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5132 $RM conftest*
5133 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5134
5135 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5136 soname=conftest
5137 lib=conftest
5138 libobjs=conftest.$ac_objext
5139 deplibs=
5140 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5141 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5142 compiler_flags=-v
5143 linker_flags=-v
5144 verstring=
5145 output_objdir=.
5146 libname=conftest
5147 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5148 _LT_TAGVAR(allow_undefined_flag, $1)=
5149 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5150 then
5151 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5152 else
5153 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5154 fi
5155 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5156 else
5157 cat conftest.err 1>&5
5158 fi
5159 $RM conftest*
5160 AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5161 ;;
5162 esac
5163 fi
5164 ;;
5165 esac
5166
5167 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5168 [Whether or not to add -lc for building shared libraries])
5169 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5170 [enable_shared_with_static_runtimes], [0],
5171 [Whether or not to disallow shared libs when runtime libs are static])
5172 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5173 [Compiler flag to allow reflexive dlopens])
5174 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
5175 [Compiler flag to generate shared objects directly from archives])
5176 _LT_TAGDECL([], [compiler_needs_object], [1],
5177 [Whether the compiler copes with passing no objects directly])
5178 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5179 [Create an old-style archive from a shared archive])
5180 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5181 [Create a temporary old-style archive to link instead of a shared archive])
5182 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5183 _LT_TAGDECL([], [archive_expsym_cmds], [2])
5184 _LT_TAGDECL([], [module_cmds], [2],
5185 [Commands used to build a loadable module if different from building
5186 a shared archive.])
5187 _LT_TAGDECL([], [module_expsym_cmds], [2])
5188 _LT_TAGDECL([], [with_gnu_ld], [1],
5189 [Whether we are building with GNU ld or not])
5190 _LT_TAGDECL([], [allow_undefined_flag], [1],
5191 [Flag that allows shared libraries with undefined symbols to be built])
5192 _LT_TAGDECL([], [no_undefined_flag], [1],
5193 [Flag that enforces no undefined symbols])
5194 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5195 [Flag to hardcode $libdir into a binary during linking.
5196 This must work even if $libdir does not exist])
5197 _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5198 [[If ld is used when linking, flag to hardcode $libdir into a binary
5199 during linking. This must work even if $libdir does not exist]])
5200 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
5201 [Whether we need a single "-rpath" flag with a separated argument])
5202 _LT_TAGDECL([], [hardcode_direct], [0],
5203 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5204 DIR into the resulting binary])
5205 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
5206 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5207 DIR into the resulting binary and the resulting library dependency is
5208 "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5209 library is relocated])
5210 _LT_TAGDECL([], [hardcode_minus_L], [0],
5211 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5212 into the resulting binary])
5213 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5214 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5215 into the resulting binary])
5216 _LT_TAGDECL([], [hardcode_automatic], [0],
5217 [Set to "yes" if building a shared library automatically hardcodes DIR
5218 into the library and all subsequent libraries and executables linked
5219 against it])
5220 _LT_TAGDECL([], [inherit_rpath], [0],
5221 [Set to yes if linker adds runtime paths of dependent libraries
5222 to runtime path list])
5223 _LT_TAGDECL([], [link_all_deplibs], [0],
5224 [Whether libtool must link a program against all its dependency libraries])
5225 _LT_TAGDECL([], [fix_srcfile_path], [1],
5226 [Fix the shell variable $srcfile for the compiler])
5227 _LT_TAGDECL([], [always_export_symbols], [0],
5228 [Set to "yes" if exported symbols are required])
5229 _LT_TAGDECL([], [export_symbols_cmds], [2],
5230 [The commands to list exported symbols])
5231 _LT_TAGDECL([], [exclude_expsyms], [1],
5232 [Symbols that should not be listed in the preloaded symbols])
5233 _LT_TAGDECL([], [include_expsyms], [1],
5234 [Symbols that must always be exported])
5235 _LT_TAGDECL([], [prelink_cmds], [2],
5236 [Commands necessary for linking programs (against libraries) with templates])
5237 _LT_TAGDECL([], [file_list_spec], [1],
5238 [Specify filename containing input files])
5239 dnl FIXME: Not yet implemented
5240 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5241 dnl [Compiler flag to generate thread safe objects])
5242 ])# _LT_LINKER_SHLIBS
5243
5244
5245 # _LT_LANG_C_CONFIG([TAG])
5246 # ------------------------
5247 # Ensure that the configuration variables for a C compiler are suitably
5248 # defined. These variables are subsequently used by _LT_CONFIG to write
5249 # the compiler configuration to `libtool'.
5250 m4_defun([_LT_LANG_C_CONFIG],
5251 [m4_require([_LT_DECL_EGREP])dnl
5252 lt_save_CC="$CC"
5253 AC_LANG_PUSH(C)
5254
5255 # Source file extension for C test sources.
5256 ac_ext=c
5257
5258 # Object file extension for compiled C test sources.
5259 objext=o
5260 _LT_TAGVAR(objext, $1)=$objext
5261
5262 # Code to be used in simple compile tests
5263 lt_simple_compile_test_code="int some_variable = 0;"
5264
5265 # Code to be used in simple link tests
5266 lt_simple_link_test_code='int main(){return(0);}'
5267
5268 _LT_TAG_COMPILER
5269 # Save the default compiler, since it gets overwritten when the other
5270 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5271 compiler_DEFAULT=$CC
5272
5273 # save warnings/boilerplate of simple test code
5274 _LT_COMPILER_BOILERPLATE
5275 _LT_LINKER_BOILERPLATE
5276
5277 if test -n "$compiler"; then
5278 _LT_COMPILER_NO_RTTI($1)
5279 _LT_COMPILER_PIC($1)
5280 _LT_COMPILER_C_O($1)
5281 _LT_COMPILER_FILE_LOCKS($1)
5282 _LT_LINKER_SHLIBS($1)
5283 _LT_SYS_DYNAMIC_LINKER($1)
5284 _LT_LINKER_HARDCODE_LIBPATH($1)
5285 LT_SYS_DLOPEN_SELF
5286 _LT_CMD_STRIPLIB
5287
5288 # Report which library types will actually be built
5289 AC_MSG_CHECKING([if libtool supports shared libraries])
5290 AC_MSG_RESULT([$can_build_shared])
5291
5292 AC_MSG_CHECKING([whether to build shared libraries])
5293 test "$can_build_shared" = "no" && enable_shared=no
5294
5295 # On AIX, shared libraries and static libraries use the same namespace, and
5296 # are all built from PIC.
5297 case $host_os in
5298 aix3*)
5299 test "$enable_shared" = yes && enable_static=no
5300 if test -n "$RANLIB"; then
5301 archive_cmds="$archive_cmds~\$RANLIB \$lib"
5302 postinstall_cmds='$RANLIB $lib'
5303 fi
5304 ;;
5305
5306 aix[[4-9]]*)
5307 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5308 test "$enable_shared" = yes && enable_static=no
5309 fi
5310 ;;
5311 esac
5312 AC_MSG_RESULT([$enable_shared])
5313
5314 AC_MSG_CHECKING([whether to build static libraries])
5315 # Make sure either enable_shared or enable_static is yes.
5316 test "$enable_shared" = yes || enable_static=yes
5317 AC_MSG_RESULT([$enable_static])
5318
5319 _LT_CONFIG($1)
5320 fi
5321 AC_LANG_POP
5322 CC="$lt_save_CC"
5323 ])# _LT_LANG_C_CONFIG
5324
5325
5326 # _LT_PROG_CXX
5327 # ------------
5328 # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5329 # compiler, we have our own version here.
5330 m4_defun([_LT_PROG_CXX],
5331 [
5332 pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5333 AC_PROG_CXX
5334 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5335 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5336 (test "X$CXX" != "Xg++"))) ; then
5337 AC_PROG_CXXCPP
5338 else
5339 _lt_caught_CXX_error=yes
5340 fi
5341 popdef([AC_MSG_ERROR])
5342 ])# _LT_PROG_CXX
5343
5344 dnl aclocal-1.4 backwards compatibility:
5345 dnl AC_DEFUN([_LT_PROG_CXX], [])
5346
5347
5348 # _LT_LANG_CXX_CONFIG([TAG])
5349 # --------------------------
5350 # Ensure that the configuration variables for a C++ compiler are suitably
5351 # defined. These variables are subsequently used by _LT_CONFIG to write
5352 # the compiler configuration to `libtool'.
5353 m4_defun([_LT_LANG_CXX_CONFIG],
5354 [AC_REQUIRE([_LT_PROG_CXX])dnl
5355 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5356 m4_require([_LT_DECL_EGREP])dnl
5357
5358 AC_LANG_PUSH(C++)
5359 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5360 _LT_TAGVAR(allow_undefined_flag, $1)=
5361 _LT_TAGVAR(always_export_symbols, $1)=no
5362 _LT_TAGVAR(archive_expsym_cmds, $1)=
5363 _LT_TAGVAR(compiler_needs_object, $1)=no
5364 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5365 _LT_TAGVAR(hardcode_direct, $1)=no
5366 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5367 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5368 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5369 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5370 _LT_TAGVAR(hardcode_minus_L, $1)=no
5371 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5372 _LT_TAGVAR(hardcode_automatic, $1)=no
5373 _LT_TAGVAR(inherit_rpath, $1)=no
5374 _LT_TAGVAR(module_cmds, $1)=
5375 _LT_TAGVAR(module_expsym_cmds, $1)=
5376 _LT_TAGVAR(link_all_deplibs, $1)=unknown
5377 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5378 _LT_TAGVAR(no_undefined_flag, $1)=
5379 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5380 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5381
5382 # Source file extension for C++ test sources.
5383 ac_ext=cpp
5384
5385 # Object file extension for compiled C++ test sources.
5386 objext=o
5387 _LT_TAGVAR(objext, $1)=$objext
5388
5389 # No sense in running all these tests if we already determined that
5390 # the CXX compiler isn't working. Some variables (like enable_shared)
5391 # are currently assumed to apply to all compilers on this platform,
5392 # and will be corrupted by setting them based on a non-working compiler.
5393 if test "$_lt_caught_CXX_error" != yes; then
5394 # Code to be used in simple compile tests
5395 lt_simple_compile_test_code="int some_variable = 0;"
5396
5397 # Code to be used in simple link tests
5398 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5399
5400 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5401 _LT_TAG_COMPILER
5402
5403 # save warnings/boilerplate of simple test code
5404 _LT_COMPILER_BOILERPLATE
5405 _LT_LINKER_BOILERPLATE
5406
5407 # Allow CC to be a program name with arguments.
5408 lt_save_CC=$CC
5409 lt_save_LD=$LD
5410 lt_save_GCC=$GCC
5411 GCC=$GXX
5412 lt_save_with_gnu_ld=$with_gnu_ld
5413 lt_save_path_LD=$lt_cv_path_LD
5414 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5415 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5416 else
5417 $as_unset lt_cv_prog_gnu_ld
5418 fi
5419 if test -n "${lt_cv_path_LDCXX+set}"; then
5420 lt_cv_path_LD=$lt_cv_path_LDCXX
5421 else
5422 $as_unset lt_cv_path_LD
5423 fi
5424 test -z "${LDCXX+set}" || LD=$LDCXX
5425 CC=${CXX-"c++"}
5426 compiler=$CC
5427 _LT_TAGVAR(compiler, $1)=$CC
5428 _LT_CC_BASENAME([$compiler])
5429
5430 if test -n "$compiler"; then
5431 # We don't want -fno-exception when compiling C++ code, so set the
5432 # no_builtin_flag separately
5433 if test "$GXX" = yes; then
5434 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5435 else
5436 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5437 fi
5438
5439 if test "$GXX" = yes; then
5440 # Set up default GNU C++ configuration
5441
5442 LT_PATH_LD
5443
5444 # Check if GNU C++ uses GNU ld as the underlying linker, since the
5445 # archiving commands below assume that GNU ld is being used.
5446 if test "$with_gnu_ld" = yes; then
5447 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5448 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5449
5450 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5451 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5452
5453 # If archive_cmds runs LD, not CC, wlarc should be empty
5454 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5455 # investigate it a little bit more. (MM)
5456 wlarc='${wl}'
5457
5458 # ancient GNU ld didn't support --whole-archive et. al.
5459 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5460 $GREP 'no-whole-archive' > /dev/null; then
5461 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5462 else
5463 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5464 fi
5465 else
5466 with_gnu_ld=no
5467 wlarc=
5468
5469 # A generic and very simple default shared library creation
5470 # command for GNU C++ for the case where it uses the native
5471 # linker, instead of GNU ld. If possible, this setting should
5472 # overridden to take advantage of the native linker features on
5473 # the platform it is being used on.
5474 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5475 fi
5476
5477 # Commands to make compiler produce verbose output that lists
5478 # what "hidden" libraries, object files and flags are used when
5479 # linking a shared library.
5480 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5481
5482 else
5483 GXX=no
5484 with_gnu_ld=no
5485 wlarc=
5486 fi
5487
5488 # PORTME: fill in a description of your system's C++ link characteristics
5489 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5490 _LT_TAGVAR(ld_shlibs, $1)=yes
5491 case $host_os in
5492 aix3*)
5493 # FIXME: insert proper C++ library support
5494 _LT_TAGVAR(ld_shlibs, $1)=no
5495 ;;
5496 aix[[4-9]]*)
5497 if test "$host_cpu" = ia64; then
5498 # On IA64, the linker does run time linking by default, so we don't
5499 # have to do anything special.
5500 aix_use_runtimelinking=no
5501 exp_sym_flag='-Bexport'
5502 no_entry_flag=""
5503 else
5504 aix_use_runtimelinking=no
5505
5506 # Test if we are trying to use run time linking or normal
5507 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5508 # need to do runtime linking.
5509 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5510 for ld_flag in $LDFLAGS; do
5511 case $ld_flag in
5512 *-brtl*)
5513 aix_use_runtimelinking=yes
5514 break
5515 ;;
5516 esac
5517 done
5518 ;;
5519 esac
5520
5521 exp_sym_flag='-bexport'
5522 no_entry_flag='-bnoentry'
5523 fi
5524
5525 # When large executables or shared objects are built, AIX ld can
5526 # have problems creating the table of contents. If linking a library
5527 # or program results in "error TOC overflow" add -mminimal-toc to
5528 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
5529 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5530
5531 _LT_TAGVAR(archive_cmds, $1)=''
5532 _LT_TAGVAR(hardcode_direct, $1)=yes
5533 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5534 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5535 _LT_TAGVAR(link_all_deplibs, $1)=yes
5536 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5537
5538 if test "$GXX" = yes; then
5539 case $host_os in aix4.[[012]]|aix4.[[012]].*)
5540 # We only want to do this on AIX 4.2 and lower, the check
5541 # below for broken collect2 doesn't work under 4.3+
5542 collect2name=`${CC} -print-prog-name=collect2`
5543 if test -f "$collect2name" &&
5544 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5545 then
5546 # We have reworked collect2
5547 :
5548 else
5549 # We have old collect2
5550 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5551 # It fails to find uninstalled libraries when the uninstalled
5552 # path is not listed in the libpath. Setting hardcode_minus_L
5553 # to unsupported forces relinking
5554 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5555 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5556 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5557 fi
5558 esac
5559 shared_flag='-shared'
5560 if test "$aix_use_runtimelinking" = yes; then
5561 shared_flag="$shared_flag "'${wl}-G'
5562 fi
5563 else
5564 # not using gcc
5565 if test "$host_cpu" = ia64; then
5566 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5567 # chokes on -Wl,-G. The following line is correct:
5568 shared_flag='-G'
5569 else
5570 if test "$aix_use_runtimelinking" = yes; then
5571 shared_flag='${wl}-G'
5572 else
5573 shared_flag='${wl}-bM:SRE'
5574 fi
5575 fi
5576 fi
5577
5578 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5579 # It seems that -bexpall does not export symbols beginning with
5580 # underscore (_), so it is better to generate a list of symbols to
5581 # export.
5582 _LT_TAGVAR(always_export_symbols, $1)=yes
5583 if test "$aix_use_runtimelinking" = yes; then
5584 # Warning - without using the other runtime loading flags (-brtl),
5585 # -berok will link without error, but may produce a broken library.
5586 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5587 # Determine the default libpath from the value encoded in an empty
5588 # executable.
5589 _LT_SYS_MODULE_PATH_AIX
5590 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5591
5592 _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5593 else
5594 if test "$host_cpu" = ia64; then
5595 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5596 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5597 _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"
5598 else
5599 # Determine the default libpath from the value encoded in an
5600 # empty executable.
5601 _LT_SYS_MODULE_PATH_AIX
5602 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5603 # Warning - without using the other run time loading flags,
5604 # -berok will link without error, but may produce a broken library.
5605 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5606 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5607 # Exported symbols can be pulled into shared objects from archives
5608 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5609 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5610 # This is similar to how AIX traditionally builds its shared
5611 # libraries.
5612 _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'
5613 fi
5614 fi
5615 ;;
5616
5617 beos*)
5618 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5619 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5620 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5621 # support --undefined. This deserves some investigation. FIXME
5622 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5623 else
5624 _LT_TAGVAR(ld_shlibs, $1)=no
5625 fi
5626 ;;
5627
5628 chorus*)
5629 case $cc_basename in
5630 *)
5631 # FIXME: insert proper C++ library support
5632 _LT_TAGVAR(ld_shlibs, $1)=no
5633 ;;
5634 esac
5635 ;;
5636
5637 cygwin* | mingw* | pw32* | cegcc*)
5638 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5639 # as there is no search path for DLLs.
5640 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5641 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5642 _LT_TAGVAR(always_export_symbols, $1)=no
5643 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5644
5645 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5646 _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'
5647 # If the export-symbols file already is a .def file (1st line
5648 # is EXPORTS), use it as is; otherwise, prepend...
5649 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5650 cp $export_symbols $output_objdir/$soname.def;
5651 else
5652 echo EXPORTS > $output_objdir/$soname.def;
5653 cat $export_symbols >> $output_objdir/$soname.def;
5654 fi~
5655 $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'
5656 else
5657 _LT_TAGVAR(ld_shlibs, $1)=no
5658 fi
5659 ;;
5660 darwin* | rhapsody*)
5661 _LT_DARWIN_LINKER_FEATURES($1)
5662 ;;
5663
5664 dgux*)
5665 case $cc_basename in
5666 ec++*)
5667 # FIXME: insert proper C++ library support
5668 _LT_TAGVAR(ld_shlibs, $1)=no
5669 ;;
5670 ghcx*)
5671 # Green Hills C++ Compiler
5672 # FIXME: insert proper C++ library support
5673 _LT_TAGVAR(ld_shlibs, $1)=no
5674 ;;
5675 *)
5676 # FIXME: insert proper C++ library support
5677 _LT_TAGVAR(ld_shlibs, $1)=no
5678 ;;
5679 esac
5680 ;;
5681
5682 freebsd[[12]]*)
5683 # C++ shared libraries reported to be fairly broken before
5684 # switch to ELF
5685 _LT_TAGVAR(ld_shlibs, $1)=no
5686 ;;
5687
5688 freebsd-elf*)
5689 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5690 ;;
5691
5692 freebsd* | dragonfly*)
5693 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5694 # conventions
5695 _LT_TAGVAR(ld_shlibs, $1)=yes
5696 ;;
5697
5698 gnu*)
5699 ;;
5700
5701 hpux9*)
5702 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5703 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5704 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5705 _LT_TAGVAR(hardcode_direct, $1)=yes
5706 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5707 # but as the default
5708 # location of the library.
5709
5710 case $cc_basename in
5711 CC*)
5712 # FIXME: insert proper C++ library support
5713 _LT_TAGVAR(ld_shlibs, $1)=no
5714 ;;
5715 aCC*)
5716 _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'
5717 # Commands to make compiler produce verbose output that lists
5718 # what "hidden" libraries, object files and flags are used when
5719 # linking a shared library.
5720 #
5721 # There doesn't appear to be a way to prevent this compiler from
5722 # explicitly linking system object files so we need to strip them
5723 # from the output so that they don't get included in the library
5724 # dependencies.
5725 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; $ECHO "X$list" | $Xsed'
5726 ;;
5727 *)
5728 if test "$GXX" = yes; then
5729 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5730 else
5731 # FIXME: insert proper C++ library support
5732 _LT_TAGVAR(ld_shlibs, $1)=no
5733 fi
5734 ;;
5735 esac
5736 ;;
5737
5738 hpux10*|hpux11*)
5739 if test $with_gnu_ld = no; then
5740 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5741 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5742
5743 case $host_cpu in
5744 hppa*64*|ia64*)
5745 ;;
5746 *)
5747 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5748 ;;
5749 esac
5750 fi
5751 case $host_cpu in
5752 hppa*64*|ia64*)
5753 _LT_TAGVAR(hardcode_direct, $1)=no
5754 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5755 ;;
5756 *)
5757 _LT_TAGVAR(hardcode_direct, $1)=yes
5758 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5759 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5760 # but as the default
5761 # location of the library.
5762 ;;
5763 esac
5764
5765 case $cc_basename in
5766 CC*)
5767 # FIXME: insert proper C++ library support
5768 _LT_TAGVAR(ld_shlibs, $1)=no
5769 ;;
5770 aCC*)
5771 case $host_cpu in
5772 hppa*64*)
5773 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5774 ;;
5775 ia64*)
5776 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5777 ;;
5778 *)
5779 _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'
5780 ;;
5781 esac
5782 # Commands to make compiler produce verbose output that lists
5783 # what "hidden" libraries, object files and flags are used when
5784 # linking a shared library.
5785 #
5786 # There doesn't appear to be a way to prevent this compiler from
5787 # explicitly linking system object files so we need to strip them
5788 # from the output so that they don't get included in the library
5789 # dependencies.
5790 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5791 ;;
5792 *)
5793 if test "$GXX" = yes; then
5794 if test $with_gnu_ld = no; then
5795 case $host_cpu in
5796 hppa*64*)
5797 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5798 ;;
5799 ia64*)
5800 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5801 ;;
5802 *)
5803 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5804 ;;
5805 esac
5806 fi
5807 else
5808 # FIXME: insert proper C++ library support
5809 _LT_TAGVAR(ld_shlibs, $1)=no
5810 fi
5811 ;;
5812 esac
5813 ;;
5814
5815 interix[[3-9]]*)
5816 _LT_TAGVAR(hardcode_direct, $1)=no
5817 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5818 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5819 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5820 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5821 # Instead, shared libraries are loaded at an image base (0x10000000 by
5822 # default) and relocated if they conflict, which is a slow very memory
5823 # consuming and fragmenting process. To avoid this, we pick a random,
5824 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5825 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
5826 _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'
5827 _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'
5828 ;;
5829 irix5* | irix6*)
5830 case $cc_basename in
5831 CC*)
5832 # SGI C++
5833 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
5834
5835 # Archives containing C++ object files must be created using
5836 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
5837 # necessary to make sure instantiated templates are included
5838 # in the archive.
5839 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5840 ;;
5841 *)
5842 if test "$GXX" = yes; then
5843 if test "$with_gnu_ld" = no; then
5844 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5845 else
5846 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
5847 fi
5848 fi
5849 _LT_TAGVAR(link_all_deplibs, $1)=yes
5850 ;;
5851 esac
5852 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5853 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5854 _LT_TAGVAR(inherit_rpath, $1)=yes
5855 ;;
5856
5857 linux* | k*bsd*-gnu)
5858 case $cc_basename in
5859 KCC*)
5860 # Kuck and Associates, Inc. (KAI) C++ Compiler
5861
5862 # KCC will only create a shared library if the output file
5863 # ends with ".so" (or ".sl" for HP-UX), so rename the library
5864 # to its proper name (with version) after linking.
5865 _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'
5866 _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'
5867 # Commands to make compiler produce verbose output that lists
5868 # what "hidden" libraries, object files and flags are used when
5869 # linking a shared library.
5870 #
5871 # There doesn't appear to be a way to prevent this compiler from
5872 # explicitly linking system object files so we need to strip them
5873 # from the output so that they don't get included in the library
5874 # dependencies.
5875 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5876
5877 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5878 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5879
5880 # Archives containing C++ object files must be created using
5881 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5882 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5883 ;;
5884 icpc* | ecpc* )
5885 # Intel C++
5886 with_gnu_ld=yes
5887 # version 8.0 and above of icpc choke on multiply defined symbols
5888 # if we add $predep_objects and $postdep_objects, however 7.1 and
5889 # earlier do not add the objects themselves.
5890 case `$CC -V 2>&1` in
5891 *"Version 7."*)
5892 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5893 _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'
5894 ;;
5895 *) # Version 8.0 or newer
5896 tmp_idyn=
5897 case $host_cpu in
5898 ia64*) tmp_idyn=' -i_dynamic';;
5899 esac
5900 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5901 _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'
5902 ;;
5903 esac
5904 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5905 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5906 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5907 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5908 ;;
5909 pgCC* | pgcpp*)
5910 # Portland Group C++ compiler
5911 case `$CC -V` in
5912 *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5913 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5914 rm -rf $tpldir~
5915 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5916 compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5917 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5918 rm -rf $tpldir~
5919 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5920 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5921 $RANLIB $oldlib'
5922 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5923 rm -rf $tpldir~
5924 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5925 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5926 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5927 rm -rf $tpldir~
5928 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5929 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5930 ;;
5931 *) # Version 6 will use weak symbols
5932 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5933 _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'
5934 ;;
5935 esac
5936
5937 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5938 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5939 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5940 ;;
5941 cxx*)
5942 # Compaq C++
5943 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5944 _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'
5945
5946 runpath_var=LD_RUN_PATH
5947 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5948 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5949
5950 # Commands to make compiler produce verbose output that lists
5951 # what "hidden" libraries, object files and flags are used when
5952 # linking a shared library.
5953 #
5954 # There doesn't appear to be a way to prevent this compiler from
5955 # explicitly linking system object files so we need to strip them
5956 # from the output so that they don't get included in the library
5957 # dependencies.
5958 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5959 ;;
5960 xl*)
5961 # IBM XL 8.0 on PPC, with GNU ld
5962 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5963 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5964 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5965 if test "x$supports_anon_versioning" = xyes; then
5966 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5967 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5968 echo "local: *; };" >> $output_objdir/$libname.ver~
5969 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5970 fi
5971 ;;
5972 *)
5973 case `$CC -V 2>&1 | sed 5q` in
5974 *Sun\ C*)
5975 # Sun C++ 5.9
5976 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5977 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5978 _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'
5979 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5980 _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5981 _LT_TAGVAR(compiler_needs_object, $1)=yes
5982
5983 # Not sure whether something based on
5984 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5985 # would be better.
5986 output_verbose_link_cmd='echo'
5987
5988 # Archives containing C++ object files must be created using
5989 # "CC -xar", where "CC" is the Sun C++ compiler. This is
5990 # necessary to make sure instantiated templates are included
5991 # in the archive.
5992 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5993 ;;
5994 esac
5995 ;;
5996 esac
5997 ;;
5998
5999 lynxos*)
6000 # FIXME: insert proper C++ library support
6001 _LT_TAGVAR(ld_shlibs, $1)=no
6002 ;;
6003
6004 m88k*)
6005 # FIXME: insert proper C++ library support
6006 _LT_TAGVAR(ld_shlibs, $1)=no
6007 ;;
6008
6009 mvs*)
6010 case $cc_basename in
6011 cxx*)
6012 # FIXME: insert proper C++ library support
6013 _LT_TAGVAR(ld_shlibs, $1)=no
6014 ;;
6015 *)
6016 # FIXME: insert proper C++ library support
6017 _LT_TAGVAR(ld_shlibs, $1)=no
6018 ;;
6019 esac
6020 ;;
6021
6022 netbsd*)
6023 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6024 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6025 wlarc=
6026 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6027 _LT_TAGVAR(hardcode_direct, $1)=yes
6028 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6029 fi
6030 # Workaround some broken pre-1.5 toolchains
6031 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6032 ;;
6033
6034 *nto* | *qnx*)
6035 _LT_TAGVAR(ld_shlibs, $1)=yes
6036 ;;
6037
6038 openbsd2*)
6039 # C++ shared libraries are fairly broken
6040 _LT_TAGVAR(ld_shlibs, $1)=no
6041 ;;
6042
6043 openbsd*)
6044 if test -f /usr/libexec/ld.so; then
6045 _LT_TAGVAR(hardcode_direct, $1)=yes
6046 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6047 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6048 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6049 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6050 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6051 _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'
6052 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6053 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6054 fi
6055 output_verbose_link_cmd=echo
6056 else
6057 _LT_TAGVAR(ld_shlibs, $1)=no
6058 fi
6059 ;;
6060
6061 osf3* | osf4* | osf5*)
6062 case $cc_basename in
6063 KCC*)
6064 # Kuck and Associates, Inc. (KAI) C++ Compiler
6065
6066 # KCC will only create a shared library if the output file
6067 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6068 # to its proper name (with version) after linking.
6069 _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'
6070
6071 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6072 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6073
6074 # Archives containing C++ object files must be created using
6075 # the KAI C++ compiler.
6076 case $host in
6077 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6078 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6079 esac
6080 ;;
6081 RCC*)
6082 # Rational C++ 2.4.1
6083 # FIXME: insert proper C++ library support
6084 _LT_TAGVAR(ld_shlibs, $1)=no
6085 ;;
6086 cxx*)
6087 case $host in
6088 osf3*)
6089 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6090 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6091 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6092 ;;
6093 *)
6094 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6095 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6096 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6097 echo "-hidden">> $lib.exp~
6098 $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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
6099 $RM $lib.exp'
6100 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6101 ;;
6102 esac
6103
6104 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6105
6106 # Commands to make compiler produce verbose output that lists
6107 # what "hidden" libraries, object files and flags are used when
6108 # linking a shared library.
6109 #
6110 # There doesn't appear to be a way to prevent this compiler from
6111 # explicitly linking system object files so we need to strip them
6112 # from the output so that they don't get included in the library
6113 # dependencies.
6114 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
6115 ;;
6116 *)
6117 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6118 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6119 case $host in
6120 osf3*)
6121 _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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6122 ;;
6123 *)
6124 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6125 ;;
6126 esac
6127
6128 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6129 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6130
6131 # Commands to make compiler produce verbose output that lists
6132 # what "hidden" libraries, object files and flags are used when
6133 # linking a shared library.
6134 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6135
6136 else
6137 # FIXME: insert proper C++ library support
6138 _LT_TAGVAR(ld_shlibs, $1)=no
6139 fi
6140 ;;
6141 esac
6142 ;;
6143
6144 psos*)
6145 # FIXME: insert proper C++ library support
6146 _LT_TAGVAR(ld_shlibs, $1)=no
6147 ;;
6148
6149 sunos4*)
6150 case $cc_basename in
6151 CC*)
6152 # Sun C++ 4.x
6153 # FIXME: insert proper C++ library support
6154 _LT_TAGVAR(ld_shlibs, $1)=no
6155 ;;
6156 lcc*)
6157 # Lucid
6158 # FIXME: insert proper C++ library support
6159 _LT_TAGVAR(ld_shlibs, $1)=no
6160 ;;
6161 *)
6162 # FIXME: insert proper C++ library support
6163 _LT_TAGVAR(ld_shlibs, $1)=no
6164 ;;
6165 esac
6166 ;;
6167
6168 solaris*)
6169 case $cc_basename in
6170 CC*)
6171 # Sun C++ 4.2, 5.x and Centerline C++
6172 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6173 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6174 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6175 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6176 $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'
6177
6178 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6179 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6180 case $host_os in
6181 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6182 *)
6183 # The compiler driver will combine and reorder linker options,
6184 # but understands `-z linker_flag'.
6185 # Supported since Solaris 2.6 (maybe 2.5.1?)
6186 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6187 ;;
6188 esac
6189 _LT_TAGVAR(link_all_deplibs, $1)=yes
6190
6191 output_verbose_link_cmd='echo'
6192
6193 # Archives containing C++ object files must be created using
6194 # "CC -xar", where "CC" is the Sun C++ compiler. This is
6195 # necessary to make sure instantiated templates are included
6196 # in the archive.
6197 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6198 ;;
6199 gcx*)
6200 # Green Hills C++ Compiler
6201 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6202
6203 # The C++ compiler must be used to create the archive.
6204 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6205 ;;
6206 *)
6207 # GNU C++ compiler with Solaris linker
6208 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6209 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6210 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6211 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6212 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6213 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6214
6215 # Commands to make compiler produce verbose output that lists
6216 # what "hidden" libraries, object files and flags are used when
6217 # linking a shared library.
6218 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6219 else
6220 # g++ 2.7 appears to require `-G' NOT `-shared' on this
6221 # platform.
6222 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6223 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6224 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6225
6226 # Commands to make compiler produce verbose output that lists
6227 # what "hidden" libraries, object files and flags are used when
6228 # linking a shared library.
6229 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6230 fi
6231
6232 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6233 case $host_os in
6234 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6235 *)
6236 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6237 ;;
6238 esac
6239 fi
6240 ;;
6241 esac
6242 ;;
6243
6244 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6245 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6246 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6247 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6248 runpath_var='LD_RUN_PATH'
6249
6250 case $cc_basename in
6251 CC*)
6252 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6253 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6254 ;;
6255 *)
6256 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6257 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6258 ;;
6259 esac
6260 ;;
6261
6262 sysv5* | sco3.2v5* | sco5v6*)
6263 # Note: We can NOT use -z defs as we might desire, because we do not
6264 # link with -lc, and that would cause any symbols used from libc to
6265 # always be unresolved, which means just about no library would
6266 # ever link correctly. If we're not using GNU ld we use -z text
6267 # though, which does catch some bad symbols but isn't as heavy-handed
6268 # as -z defs.
6269 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6270 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6271 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6272 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6273 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6274 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6275 _LT_TAGVAR(link_all_deplibs, $1)=yes
6276 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6277 runpath_var='LD_RUN_PATH'
6278
6279 case $cc_basename in
6280 CC*)
6281 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6282 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6283 ;;
6284 *)
6285 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6286 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6287 ;;
6288 esac
6289 ;;
6290
6291 tandem*)
6292 case $cc_basename in
6293 NCC*)
6294 # NonStop-UX NCC 3.20
6295 # FIXME: insert proper C++ library support
6296 _LT_TAGVAR(ld_shlibs, $1)=no
6297 ;;
6298 *)
6299 # FIXME: insert proper C++ library support
6300 _LT_TAGVAR(ld_shlibs, $1)=no
6301 ;;
6302 esac
6303 ;;
6304
6305 vxworks*)
6306 # FIXME: insert proper C++ library support
6307 _LT_TAGVAR(ld_shlibs, $1)=no
6308 ;;
6309
6310 *)
6311 # FIXME: insert proper C++ library support
6312 _LT_TAGVAR(ld_shlibs, $1)=no
6313 ;;
6314 esac
6315
6316 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6317 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6318
6319 _LT_TAGVAR(GCC, $1)="$GXX"
6320 _LT_TAGVAR(LD, $1)="$LD"
6321
6322 ## CAVEAT EMPTOR:
6323 ## There is no encapsulation within the following macros, do not change
6324 ## the running order or otherwise move them around unless you know exactly
6325 ## what you are doing...
6326 _LT_SYS_HIDDEN_LIBDEPS($1)
6327 _LT_COMPILER_PIC($1)
6328 _LT_COMPILER_C_O($1)
6329 _LT_COMPILER_FILE_LOCKS($1)
6330 _LT_LINKER_SHLIBS($1)
6331 _LT_SYS_DYNAMIC_LINKER($1)
6332 _LT_LINKER_HARDCODE_LIBPATH($1)
6333
6334 _LT_CONFIG($1)
6335 fi # test -n "$compiler"
6336
6337 CC=$lt_save_CC
6338 LDCXX=$LD
6339 LD=$lt_save_LD
6340 GCC=$lt_save_GCC
6341 with_gnu_ld=$lt_save_with_gnu_ld
6342 lt_cv_path_LDCXX=$lt_cv_path_LD
6343 lt_cv_path_LD=$lt_save_path_LD
6344 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6345 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6346 fi # test "$_lt_caught_CXX_error" != yes
6347
6348 AC_LANG_POP
6349 ])# _LT_LANG_CXX_CONFIG
6350
6351
6352 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6353 # ---------------------------------
6354 # Figure out "hidden" library dependencies from verbose
6355 # compiler output when linking a shared library.
6356 # Parse the compiler output and extract the necessary
6357 # objects, libraries and library flags.
6358 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6359 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6360 # Dependencies to place before and after the object being linked:
6361 _LT_TAGVAR(predep_objects, $1)=
6362 _LT_TAGVAR(postdep_objects, $1)=
6363 _LT_TAGVAR(predeps, $1)=
6364 _LT_TAGVAR(postdeps, $1)=
6365 _LT_TAGVAR(compiler_lib_search_path, $1)=
6366
6367 dnl we can't use the lt_simple_compile_test_code here,
6368 dnl because it contains code intended for an executable,
6369 dnl not a library. It's possible we should let each
6370 dnl tag define a new lt_????_link_test_code variable,
6371 dnl but it's only used here...
6372 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6373 int a;
6374 void foo (void) { a = 0; }
6375 _LT_EOF
6376 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6377 class Foo
6378 {
6379 public:
6380 Foo (void) { a = 0; }
6381 private:
6382 int a;
6383 };
6384 _LT_EOF
6385 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6386 subroutine foo
6387 implicit none
6388 integer*4 a
6389 a=0
6390 return
6391 end
6392 _LT_EOF
6393 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6394 subroutine foo
6395 implicit none
6396 integer a
6397 a=0
6398 return
6399 end
6400 _LT_EOF
6401 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6402 public class foo {
6403 private int a;
6404 public void bar (void) {
6405 a = 0;
6406 }
6407 };
6408 _LT_EOF
6409 ])
6410 dnl Parse the compiler output and extract the necessary
6411 dnl objects, libraries and library flags.
6412 if AC_TRY_EVAL(ac_compile); then
6413 # Parse the compiler output and extract the necessary
6414 # objects, libraries and library flags.
6415
6416 # Sentinel used to keep track of whether or not we are before
6417 # the conftest object file.
6418 pre_test_object_deps_done=no
6419
6420 for p in `eval "$output_verbose_link_cmd"`; do
6421 case $p in
6422
6423 -L* | -R* | -l*)
6424 # Some compilers place space between "-{L,R}" and the path.
6425 # Remove the space.
6426 if test $p = "-L" ||
6427 test $p = "-R"; then
6428 prev=$p
6429 continue
6430 else
6431 prev=
6432 fi
6433
6434 if test "$pre_test_object_deps_done" = no; then
6435 case $p in
6436 -L* | -R*)
6437 # Internal compiler library paths should come after those
6438 # provided the user. The postdeps already come after the
6439 # user supplied libs so there is no need to process them.
6440 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6441 _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6442 else
6443 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6444 fi
6445 ;;
6446 # The "-l" case would never come before the object being
6447 # linked, so don't bother handling this case.
6448 esac
6449 else
6450 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6451 _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6452 else
6453 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6454 fi
6455 fi
6456 ;;
6457
6458 *.$objext)
6459 # This assumes that the test object file only shows up
6460 # once in the compiler output.
6461 if test "$p" = "conftest.$objext"; then
6462 pre_test_object_deps_done=yes
6463 continue
6464 fi
6465
6466 if test "$pre_test_object_deps_done" = no; then
6467 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6468 _LT_TAGVAR(predep_objects, $1)="$p"
6469 else
6470 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6471 fi
6472 else
6473 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6474 _LT_TAGVAR(postdep_objects, $1)="$p"
6475 else
6476 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6477 fi
6478 fi
6479 ;;
6480
6481 *) ;; # Ignore the rest.
6482
6483 esac
6484 done
6485
6486 # Clean up.
6487 rm -f a.out a.exe
6488 else
6489 echo "libtool.m4: error: problem compiling $1 test program"
6490 fi
6491
6492 $RM -f confest.$objext
6493
6494 # PORTME: override above test on systems where it is broken
6495 m4_if([$1], [CXX],
6496 [case $host_os in
6497 interix[[3-9]]*)
6498 # Interix 3.5 installs completely hosed .la files for C++, so rather than
6499 # hack all around it, let's just trust "g++" to DTRT.
6500 _LT_TAGVAR(predep_objects,$1)=
6501 _LT_TAGVAR(postdep_objects,$1)=
6502 _LT_TAGVAR(postdeps,$1)=
6503 ;;
6504
6505 linux*)
6506 case `$CC -V 2>&1 | sed 5q` in
6507 *Sun\ C*)
6508 # Sun C++ 5.9
6509
6510 # The more standards-conforming stlport4 library is
6511 # incompatible with the Cstd library. Avoid specifying
6512 # it if it's in CXXFLAGS. Ignore libCrun as
6513 # -library=stlport4 depends on it.
6514 case " $CXX $CXXFLAGS " in
6515 *" -library=stlport4 "*)
6516 solaris_use_stlport4=yes
6517 ;;
6518 esac
6519
6520 if test "$solaris_use_stlport4" != yes; then
6521 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6522 fi
6523 ;;
6524 esac
6525 ;;
6526
6527 solaris*)
6528 case $cc_basename in
6529 CC*)
6530 # The more standards-conforming stlport4 library is
6531 # incompatible with the Cstd library. Avoid specifying
6532 # it if it's in CXXFLAGS. Ignore libCrun as
6533 # -library=stlport4 depends on it.
6534 case " $CXX $CXXFLAGS " in
6535 *" -library=stlport4 "*)
6536 solaris_use_stlport4=yes
6537 ;;
6538 esac
6539
6540 # Adding this requires a known-good setup of shared libraries for
6541 # Sun compiler versions before 5.6, else PIC objects from an old
6542 # archive will be linked into the output, leading to subtle bugs.
6543 if test "$solaris_use_stlport4" != yes; then
6544 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6545 fi
6546 ;;
6547 esac
6548 ;;
6549 esac
6550 ])
6551
6552 case " $_LT_TAGVAR(postdeps, $1) " in
6553 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6554 esac
6555 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6556 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6557 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6558 fi
6559 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6560 [The directories searched by this compiler when creating a shared library])
6561 _LT_TAGDECL([], [predep_objects], [1],
6562 [Dependencies to place before and after the objects being linked to
6563 create a shared library])
6564 _LT_TAGDECL([], [postdep_objects], [1])
6565 _LT_TAGDECL([], [predeps], [1])
6566 _LT_TAGDECL([], [postdeps], [1])
6567 _LT_TAGDECL([], [compiler_lib_search_path], [1],
6568 [The library search path used internally by the compiler when linking
6569 a shared library])
6570 ])# _LT_SYS_HIDDEN_LIBDEPS
6571
6572
6573 # _LT_PROG_F77
6574 # ------------
6575 # Since AC_PROG_F77 is broken, in that it returns the empty string
6576 # if there is no fortran compiler, we have our own version here.
6577 m4_defun([_LT_PROG_F77],
6578 [
6579 pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6580 AC_PROG_F77
6581 if test -z "$F77" || test "X$F77" = "Xno"; then
6582 _lt_disable_F77=yes
6583 fi
6584 popdef([AC_MSG_ERROR])
6585 ])# _LT_PROG_F77
6586
6587 dnl aclocal-1.4 backwards compatibility:
6588 dnl AC_DEFUN([_LT_PROG_F77], [])
6589
6590
6591 # _LT_LANG_F77_CONFIG([TAG])
6592 # --------------------------
6593 # Ensure that the configuration variables for a Fortran 77 compiler are
6594 # suitably defined. These variables are subsequently used by _LT_CONFIG
6595 # to write the compiler configuration to `libtool'.
6596 m4_defun([_LT_LANG_F77_CONFIG],
6597 [AC_REQUIRE([_LT_PROG_F77])dnl
6598 AC_LANG_PUSH(Fortran 77)
6599
6600 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6601 _LT_TAGVAR(allow_undefined_flag, $1)=
6602 _LT_TAGVAR(always_export_symbols, $1)=no
6603 _LT_TAGVAR(archive_expsym_cmds, $1)=
6604 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6605 _LT_TAGVAR(hardcode_direct, $1)=no
6606 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6607 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6608 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6609 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6610 _LT_TAGVAR(hardcode_minus_L, $1)=no
6611 _LT_TAGVAR(hardcode_automatic, $1)=no
6612 _LT_TAGVAR(inherit_rpath, $1)=no
6613 _LT_TAGVAR(module_cmds, $1)=
6614 _LT_TAGVAR(module_expsym_cmds, $1)=
6615 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6616 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6617 _LT_TAGVAR(no_undefined_flag, $1)=
6618 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6619 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6620
6621 # Source file extension for f77 test sources.
6622 ac_ext=f
6623
6624 # Object file extension for compiled f77 test sources.
6625 objext=o
6626 _LT_TAGVAR(objext, $1)=$objext
6627
6628 # No sense in running all these tests if we already determined that
6629 # the F77 compiler isn't working. Some variables (like enable_shared)
6630 # are currently assumed to apply to all compilers on this platform,
6631 # and will be corrupted by setting them based on a non-working compiler.
6632 if test "$_lt_disable_F77" != yes; then
6633 # Code to be used in simple compile tests
6634 lt_simple_compile_test_code="\
6635 subroutine t
6636 return
6637 end
6638 "
6639
6640 # Code to be used in simple link tests
6641 lt_simple_link_test_code="\
6642 program t
6643 end
6644 "
6645
6646 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6647 _LT_TAG_COMPILER
6648
6649 # save warnings/boilerplate of simple test code
6650 _LT_COMPILER_BOILERPLATE
6651 _LT_LINKER_BOILERPLATE
6652
6653 # Allow CC to be a program name with arguments.
6654 lt_save_CC="$CC"
6655 lt_save_GCC=$GCC
6656 CC=${F77-"f77"}
6657 compiler=$CC
6658 _LT_TAGVAR(compiler, $1)=$CC
6659 _LT_CC_BASENAME([$compiler])
6660 GCC=$G77
6661 if test -n "$compiler"; then
6662 AC_MSG_CHECKING([if libtool supports shared libraries])
6663 AC_MSG_RESULT([$can_build_shared])
6664
6665 AC_MSG_CHECKING([whether to build shared libraries])
6666 test "$can_build_shared" = "no" && enable_shared=no
6667
6668 # On AIX, shared libraries and static libraries use the same namespace, and
6669 # are all built from PIC.
6670 case $host_os in
6671 aix3*)
6672 test "$enable_shared" = yes && enable_static=no
6673 if test -n "$RANLIB"; then
6674 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6675 postinstall_cmds='$RANLIB $lib'
6676 fi
6677 ;;
6678 aix[[4-9]]*)
6679 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6680 test "$enable_shared" = yes && enable_static=no
6681 fi
6682 ;;
6683 esac
6684 AC_MSG_RESULT([$enable_shared])
6685
6686 AC_MSG_CHECKING([whether to build static libraries])
6687 # Make sure either enable_shared or enable_static is yes.
6688 test "$enable_shared" = yes || enable_static=yes
6689 AC_MSG_RESULT([$enable_static])
6690
6691 _LT_TAGVAR(GCC, $1)="$G77"
6692 _LT_TAGVAR(LD, $1)="$LD"
6693
6694 ## CAVEAT EMPTOR:
6695 ## There is no encapsulation within the following macros, do not change
6696 ## the running order or otherwise move them around unless you know exactly
6697 ## what you are doing...
6698 _LT_COMPILER_PIC($1)
6699 _LT_COMPILER_C_O($1)
6700 _LT_COMPILER_FILE_LOCKS($1)
6701 _LT_LINKER_SHLIBS($1)
6702 _LT_SYS_DYNAMIC_LINKER($1)
6703 _LT_LINKER_HARDCODE_LIBPATH($1)
6704
6705 _LT_CONFIG($1)
6706 fi # test -n "$compiler"
6707
6708 GCC=$lt_save_GCC
6709 CC="$lt_save_CC"
6710 fi # test "$_lt_disable_F77" != yes
6711
6712 AC_LANG_POP
6713 ])# _LT_LANG_F77_CONFIG
6714
6715
6716 # _LT_PROG_FC
6717 # -----------
6718 # Since AC_PROG_FC is broken, in that it returns the empty string
6719 # if there is no fortran compiler, we have our own version here.
6720 m4_defun([_LT_PROG_FC],
6721 [
6722 pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6723 AC_PROG_FC
6724 if test -z "$FC" || test "X$FC" = "Xno"; then
6725 _lt_disable_FC=yes
6726 fi
6727 popdef([AC_MSG_ERROR])
6728 ])# _LT_PROG_FC
6729
6730 dnl aclocal-1.4 backwards compatibility:
6731 dnl AC_DEFUN([_LT_PROG_FC], [])
6732
6733
6734 # _LT_LANG_FC_CONFIG([TAG])
6735 # -------------------------
6736 # Ensure that the configuration variables for a Fortran compiler are
6737 # suitably defined. These variables are subsequently used by _LT_CONFIG
6738 # to write the compiler configuration to `libtool'.
6739 m4_defun([_LT_LANG_FC_CONFIG],
6740 [AC_REQUIRE([_LT_PROG_FC])dnl
6741 AC_LANG_PUSH(Fortran)
6742
6743 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6744 _LT_TAGVAR(allow_undefined_flag, $1)=
6745 _LT_TAGVAR(always_export_symbols, $1)=no
6746 _LT_TAGVAR(archive_expsym_cmds, $1)=
6747 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6748 _LT_TAGVAR(hardcode_direct, $1)=no
6749 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6750 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6751 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6752 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6753 _LT_TAGVAR(hardcode_minus_L, $1)=no
6754 _LT_TAGVAR(hardcode_automatic, $1)=no
6755 _LT_TAGVAR(inherit_rpath, $1)=no
6756 _LT_TAGVAR(module_cmds, $1)=
6757 _LT_TAGVAR(module_expsym_cmds, $1)=
6758 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6759 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6760 _LT_TAGVAR(no_undefined_flag, $1)=
6761 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6762 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6763
6764 # Source file extension for fc test sources.
6765 ac_ext=${ac_fc_srcext-f}
6766
6767 # Object file extension for compiled fc test sources.
6768 objext=o
6769 _LT_TAGVAR(objext, $1)=$objext
6770
6771 # No sense in running all these tests if we already determined that
6772 # the FC compiler isn't working. Some variables (like enable_shared)
6773 # are currently assumed to apply to all compilers on this platform,
6774 # and will be corrupted by setting them based on a non-working compiler.
6775 if test "$_lt_disable_FC" != yes; then
6776 # Code to be used in simple compile tests
6777 lt_simple_compile_test_code="\
6778 subroutine t
6779 return
6780 end
6781 "
6782
6783 # Code to be used in simple link tests
6784 lt_simple_link_test_code="\
6785 program t
6786 end
6787 "
6788
6789 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6790 _LT_TAG_COMPILER
6791
6792 # save warnings/boilerplate of simple test code
6793 _LT_COMPILER_BOILERPLATE
6794 _LT_LINKER_BOILERPLATE
6795
6796 # Allow CC to be a program name with arguments.
6797 lt_save_CC="$CC"
6798 lt_save_GCC=$GCC
6799 CC=${FC-"f95"}
6800 compiler=$CC
6801 GCC=$ac_cv_fc_compiler_gnu
6802
6803 _LT_TAGVAR(compiler, $1)=$CC
6804 _LT_CC_BASENAME([$compiler])
6805
6806 if test -n "$compiler"; then
6807 AC_MSG_CHECKING([if libtool supports shared libraries])
6808 AC_MSG_RESULT([$can_build_shared])
6809
6810 AC_MSG_CHECKING([whether to build shared libraries])
6811 test "$can_build_shared" = "no" && enable_shared=no
6812
6813 # On AIX, shared libraries and static libraries use the same namespace, and
6814 # are all built from PIC.
6815 case $host_os in
6816 aix3*)
6817 test "$enable_shared" = yes && enable_static=no
6818 if test -n "$RANLIB"; then
6819 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6820 postinstall_cmds='$RANLIB $lib'
6821 fi
6822 ;;
6823 aix[[4-9]]*)
6824 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6825 test "$enable_shared" = yes && enable_static=no
6826 fi
6827 ;;
6828 esac
6829 AC_MSG_RESULT([$enable_shared])
6830
6831 AC_MSG_CHECKING([whether to build static libraries])
6832 # Make sure either enable_shared or enable_static is yes.
6833 test "$enable_shared" = yes || enable_static=yes
6834 AC_MSG_RESULT([$enable_static])
6835
6836 _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6837 _LT_TAGVAR(LD, $1)="$LD"
6838
6839 ## CAVEAT EMPTOR:
6840 ## There is no encapsulation within the following macros, do not change
6841 ## the running order or otherwise move them around unless you know exactly
6842 ## what you are doing...
6843 _LT_SYS_HIDDEN_LIBDEPS($1)
6844 _LT_COMPILER_PIC($1)
6845 _LT_COMPILER_C_O($1)
6846 _LT_COMPILER_FILE_LOCKS($1)
6847 _LT_LINKER_SHLIBS($1)
6848 _LT_SYS_DYNAMIC_LINKER($1)
6849 _LT_LINKER_HARDCODE_LIBPATH($1)
6850
6851 _LT_CONFIG($1)
6852 fi # test -n "$compiler"
6853
6854 GCC=$lt_save_GCC
6855 CC="$lt_save_CC"
6856 fi # test "$_lt_disable_FC" != yes
6857
6858 AC_LANG_POP
6859 ])# _LT_LANG_FC_CONFIG
6860
6861
6862 # _LT_LANG_GCJ_CONFIG([TAG])
6863 # --------------------------
6864 # Ensure that the configuration variables for the GNU Java Compiler compiler
6865 # are suitably defined. These variables are subsequently used by _LT_CONFIG
6866 # to write the compiler configuration to `libtool'.
6867 m4_defun([_LT_LANG_GCJ_CONFIG],
6868 [AC_REQUIRE([LT_PROG_GCJ])dnl
6869 AC_LANG_SAVE
6870
6871 # Source file extension for Java test sources.
6872 ac_ext=java
6873
6874 # Object file extension for compiled Java test sources.
6875 objext=o
6876 _LT_TAGVAR(objext, $1)=$objext
6877
6878 # Code to be used in simple compile tests
6879 lt_simple_compile_test_code="class foo {}"
6880
6881 # Code to be used in simple link tests
6882 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6883
6884 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6885 _LT_TAG_COMPILER
6886
6887 # save warnings/boilerplate of simple test code
6888 _LT_COMPILER_BOILERPLATE
6889 _LT_LINKER_BOILERPLATE
6890
6891 # Allow CC to be a program name with arguments.
6892 lt_save_CC="$CC"
6893 lt_save_GCC=$GCC
6894 GCC=yes
6895 CC=${GCJ-"gcj"}
6896 compiler=$CC
6897 _LT_TAGVAR(compiler, $1)=$CC
6898 _LT_TAGVAR(LD, $1)="$LD"
6899 _LT_CC_BASENAME([$compiler])
6900
6901 # GCJ did not exist at the time GCC didn't implicitly link libc in.
6902 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6903
6904 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6905
6906 if test -n "$compiler"; then
6907 _LT_COMPILER_NO_RTTI($1)
6908 _LT_COMPILER_PIC($1)
6909 _LT_COMPILER_C_O($1)
6910 _LT_COMPILER_FILE_LOCKS($1)
6911 _LT_LINKER_SHLIBS($1)
6912 _LT_LINKER_HARDCODE_LIBPATH($1)
6913
6914 _LT_CONFIG($1)
6915 fi
6916
6917 AC_LANG_RESTORE
6918
6919 GCC=$lt_save_GCC
6920 CC="$lt_save_CC"
6921 ])# _LT_LANG_GCJ_CONFIG
6922
6923
6924 # _LT_LANG_RC_CONFIG([TAG])
6925 # -------------------------
6926 # Ensure that the configuration variables for the Windows resource compiler
6927 # are suitably defined. These variables are subsequently used by _LT_CONFIG
6928 # to write the compiler configuration to `libtool'.
6929 m4_defun([_LT_LANG_RC_CONFIG],
6930 [AC_REQUIRE([LT_PROG_RC])dnl
6931 AC_LANG_SAVE
6932
6933 # Source file extension for RC test sources.
6934 ac_ext=rc
6935
6936 # Object file extension for compiled RC test sources.
6937 objext=o
6938 _LT_TAGVAR(objext, $1)=$objext
6939
6940 # Code to be used in simple compile tests
6941 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6942
6943 # Code to be used in simple link tests
6944 lt_simple_link_test_code="$lt_simple_compile_test_code"
6945
6946 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6947 _LT_TAG_COMPILER
6948
6949 # save warnings/boilerplate of simple test code
6950 _LT_COMPILER_BOILERPLATE
6951 _LT_LINKER_BOILERPLATE
6952
6953 # Allow CC to be a program name with arguments.
6954 lt_save_CC="$CC"
6955 lt_save_GCC=$GCC
6956 GCC=
6957 CC=${RC-"windres"}
6958 compiler=$CC
6959 _LT_TAGVAR(compiler, $1)=$CC
6960 _LT_CC_BASENAME([$compiler])
6961 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6962
6963 if test -n "$compiler"; then
6964 :
6965 _LT_CONFIG($1)
6966 fi
6967
6968 GCC=$lt_save_GCC
6969 AC_LANG_RESTORE
6970 CC="$lt_save_CC"
6971 ])# _LT_LANG_RC_CONFIG
6972
6973
6974 # LT_PROG_GCJ
6975 # -----------
6976 AC_DEFUN([LT_PROG_GCJ],
6977 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6978 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6979 [AC_CHECK_TOOL(GCJ, gcj,)
6980 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6981 AC_SUBST(GCJFLAGS)])])[]dnl
6982 ])
6983
6984 # Old name:
6985 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6986 dnl aclocal-1.4 backwards compatibility:
6987 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6988
6989
6990 # LT_PROG_RC
6991 # ----------
6992 AC_DEFUN([LT_PROG_RC],
6993 [AC_CHECK_TOOL(RC, windres,)
6994 ])
6995
6996 # Old name:
6997 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
6998 dnl aclocal-1.4 backwards compatibility:
6999 dnl AC_DEFUN([LT_AC_PROG_RC], [])
7000
7001
7002 # _LT_DECL_EGREP
7003 # --------------
7004 # If we don't have a new enough Autoconf to choose the best grep
7005 # available, choose the one first in the user's PATH.
7006 m4_defun([_LT_DECL_EGREP],
7007 [AC_REQUIRE([AC_PROG_EGREP])dnl
7008 AC_REQUIRE([AC_PROG_FGREP])dnl
7009 test -z "$GREP" && GREP=grep
7010 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7011 _LT_DECL([], [EGREP], [1], [An ERE matcher])
7012 _LT_DECL([], [FGREP], [1], [A literal string matcher])
7013 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7014 AC_SUBST([GREP])
7015 ])
7016
7017
7018 # _LT_DECL_OBJDUMP
7019 # --------------
7020 # If we don't have a new enough Autoconf to choose the best objdump
7021 # available, choose the one first in the user's PATH.
7022 m4_defun([_LT_DECL_OBJDUMP],
7023 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
7024 test -z "$OBJDUMP" && OBJDUMP=objdump
7025 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7026 AC_SUBST([OBJDUMP])
7027 ])
7028
7029
7030 # _LT_DECL_SED
7031 # ------------
7032 # Check for a fully-functional sed program, that truncates
7033 # as few characters as possible. Prefer GNU sed if found.
7034 m4_defun([_LT_DECL_SED],
7035 [AC_PROG_SED
7036 test -z "$SED" && SED=sed
7037 Xsed="$SED -e 1s/^X//"
7038 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7039 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7040 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7041 ])# _LT_DECL_SED
7042
7043 m4_ifndef([AC_PROG_SED], [
7044 # NOTE: This macro has been submitted for inclusion into #
7045 # GNU Autoconf as AC_PROG_SED. When it is available in #
7046 # a released version of Autoconf we should remove this #
7047 # macro and use it instead. #
7048
7049 m4_defun([AC_PROG_SED],
7050 [AC_MSG_CHECKING([for a sed that does not truncate output])
7051 AC_CACHE_VAL(lt_cv_path_SED,
7052 [# Loop through the user's path and test for sed and gsed.
7053 # Then use that list of sed's as ones to test for truncation.
7054 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7055 for as_dir in $PATH
7056 do
7057 IFS=$as_save_IFS
7058 test -z "$as_dir" && as_dir=.
7059 for lt_ac_prog in sed gsed; do
7060 for ac_exec_ext in '' $ac_executable_extensions; do
7061 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7062 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7063 fi
7064 done
7065 done
7066 done
7067 IFS=$as_save_IFS
7068 lt_ac_max=0
7069 lt_ac_count=0
7070 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
7071 # along with /bin/sed that truncates output.
7072 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7073 test ! -f $lt_ac_sed && continue
7074 cat /dev/null > conftest.in
7075 lt_ac_count=0
7076 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7077 # Check for GNU sed and select it if it is found.
7078 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7079 lt_cv_path_SED=$lt_ac_sed
7080 break
7081 fi
7082 while true; do
7083 cat conftest.in conftest.in >conftest.tmp
7084 mv conftest.tmp conftest.in
7085 cp conftest.in conftest.nl
7086 echo >>conftest.nl
7087 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7088 cmp -s conftest.out conftest.nl || break
7089 # 10000 chars as input seems more than enough
7090 test $lt_ac_count -gt 10 && break
7091 lt_ac_count=`expr $lt_ac_count + 1`
7092 if test $lt_ac_count -gt $lt_ac_max; then
7093 lt_ac_max=$lt_ac_count
7094 lt_cv_path_SED=$lt_ac_sed
7095 fi
7096 done
7097 done
7098 ])
7099 SED=$lt_cv_path_SED
7100 AC_SUBST([SED])
7101 AC_MSG_RESULT([$SED])
7102 ])#AC_PROG_SED
7103 ])#m4_ifndef
7104
7105 # Old name:
7106 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7107 dnl aclocal-1.4 backwards compatibility:
7108 dnl AC_DEFUN([LT_AC_PROG_SED], [])
7109
7110
7111 # _LT_CHECK_SHELL_FEATURES
7112 # ------------------------
7113 # Find out whether the shell is Bourne or XSI compatible,
7114 # or has some other useful features.
7115 m4_defun([_LT_CHECK_SHELL_FEATURES],
7116 [AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7117 # Try some XSI features
7118 xsi_shell=no
7119 ( _lt_dummy="a/b/c"
7120 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7121 = c,a/b,, \
7122 && eval 'test $(( 1 + 1 )) -eq 2 \
7123 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7124 && xsi_shell=yes
7125 AC_MSG_RESULT([$xsi_shell])
7126 _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7127
7128 AC_MSG_CHECKING([whether the shell understands "+="])
7129 lt_shell_append=no
7130 ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7131 >/dev/null 2>&1 \
7132 && lt_shell_append=yes
7133 AC_MSG_RESULT([$lt_shell_append])
7134 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7135
7136 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7137 lt_unset=unset
7138 else
7139 lt_unset=false
7140 fi
7141 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7142
7143 # test EBCDIC or ASCII
7144 case `echo X|tr X '\101'` in
7145 A) # ASCII based system
7146 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7147 lt_SP2NL='tr \040 \012'
7148 lt_NL2SP='tr \015\012 \040\040'
7149 ;;
7150 *) # EBCDIC based system
7151 lt_SP2NL='tr \100 \n'
7152 lt_NL2SP='tr \r\n \100\100'
7153 ;;
7154 esac
7155 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7156 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7157 ])# _LT_CHECK_SHELL_FEATURES
7158
7159
7160 # _LT_PROG_XSI_SHELLFNS
7161 # ---------------------
7162 # Bourne and XSI compatible variants of some useful shell functions.
7163 m4_defun([_LT_PROG_XSI_SHELLFNS],
7164 [case $xsi_shell in
7165 yes)
7166 cat << \_LT_EOF >> "$cfgfile"
7167
7168 # func_dirname file append nondir_replacement
7169 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7170 # otherwise set result to NONDIR_REPLACEMENT.
7171 func_dirname ()
7172 {
7173 case ${1} in
7174 */*) func_dirname_result="${1%/*}${2}" ;;
7175 * ) func_dirname_result="${3}" ;;
7176 esac
7177 }
7178
7179 # func_basename file
7180 func_basename ()
7181 {
7182 func_basename_result="${1##*/}"
7183 }
7184
7185 # func_dirname_and_basename file append nondir_replacement
7186 # perform func_basename and func_dirname in a single function
7187 # call:
7188 # dirname: Compute the dirname of FILE. If nonempty,
7189 # add APPEND to the result, otherwise set result
7190 # to NONDIR_REPLACEMENT.
7191 # value returned in "$func_dirname_result"
7192 # basename: Compute filename of FILE.
7193 # value retuned in "$func_basename_result"
7194 # Implementation must be kept synchronized with func_dirname
7195 # and func_basename. For efficiency, we do not delegate to
7196 # those functions but instead duplicate the functionality here.
7197 func_dirname_and_basename ()
7198 {
7199 case ${1} in
7200 */*) func_dirname_result="${1%/*}${2}" ;;
7201 * ) func_dirname_result="${3}" ;;
7202 esac
7203 func_basename_result="${1##*/}"
7204 }
7205
7206 # func_stripname prefix suffix name
7207 # strip PREFIX and SUFFIX off of NAME.
7208 # PREFIX and SUFFIX must not contain globbing or regex special
7209 # characters, hashes, percent signs, but SUFFIX may contain a leading
7210 # dot (in which case that matches only a dot).
7211 func_stripname ()
7212 {
7213 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7214 # positional parameters, so assign one to ordinary parameter first.
7215 func_stripname_result=${3}
7216 func_stripname_result=${func_stripname_result#"${1}"}
7217 func_stripname_result=${func_stripname_result%"${2}"}
7218 }
7219
7220 # func_opt_split
7221 func_opt_split ()
7222 {
7223 func_opt_split_opt=${1%%=*}
7224 func_opt_split_arg=${1#*=}
7225 }
7226
7227 # func_lo2o object
7228 func_lo2o ()
7229 {
7230 case ${1} in
7231 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7232 *) func_lo2o_result=${1} ;;
7233 esac
7234 }
7235
7236 # func_xform libobj-or-source
7237 func_xform ()
7238 {
7239 func_xform_result=${1%.*}.lo
7240 }
7241
7242 # func_arith arithmetic-term...
7243 func_arith ()
7244 {
7245 func_arith_result=$(( $[*] ))
7246 }
7247
7248 # func_len string
7249 # STRING may not start with a hyphen.
7250 func_len ()
7251 {
7252 func_len_result=${#1}
7253 }
7254
7255 _LT_EOF
7256 ;;
7257 *) # Bourne compatible functions.
7258 cat << \_LT_EOF >> "$cfgfile"
7259
7260 # func_dirname file append nondir_replacement
7261 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
7262 # otherwise set result to NONDIR_REPLACEMENT.
7263 func_dirname ()
7264 {
7265 # Extract subdirectory from the argument.
7266 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7267 if test "X$func_dirname_result" = "X${1}"; then
7268 func_dirname_result="${3}"
7269 else
7270 func_dirname_result="$func_dirname_result${2}"
7271 fi
7272 }
7273
7274 # func_basename file
7275 func_basename ()
7276 {
7277 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7278 }
7279
7280 dnl func_dirname_and_basename
7281 dnl A portable version of this function is already defined in general.m4sh
7282 dnl so there is no need for it here.
7283
7284 # func_stripname prefix suffix name
7285 # strip PREFIX and SUFFIX off of NAME.
7286 # PREFIX and SUFFIX must not contain globbing or regex special
7287 # characters, hashes, percent signs, but SUFFIX may contain a leading
7288 # dot (in which case that matches only a dot).
7289 # func_strip_suffix prefix name
7290 func_stripname ()
7291 {
7292 case ${2} in
7293 .*) func_stripname_result=`$ECHO "X${3}" \
7294 | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7295 *) func_stripname_result=`$ECHO "X${3}" \
7296 | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7297 esac
7298 }
7299
7300 # sed scripts:
7301 my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7302 my_sed_long_arg='1s/^-[[^=]]*=//'
7303
7304 # func_opt_split
7305 func_opt_split ()
7306 {
7307 func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7308 func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7309 }
7310
7311 # func_lo2o object
7312 func_lo2o ()
7313 {
7314 func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7315 }
7316
7317 # func_xform libobj-or-source
7318 func_xform ()
7319 {
7320 func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7321 }
7322
7323 # func_arith arithmetic-term...
7324 func_arith ()
7325 {
7326 func_arith_result=`expr "$[@]"`
7327 }
7328
7329 # func_len string
7330 # STRING may not start with a hyphen.
7331 func_len ()
7332 {
7333 func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7334 }
7335
7336 _LT_EOF
7337 esac
7338
7339 case $lt_shell_append in
7340 yes)
7341 cat << \_LT_EOF >> "$cfgfile"
7342
7343 # func_append var value
7344 # Append VALUE to the end of shell variable VAR.
7345 func_append ()
7346 {
7347 eval "$[1]+=\$[2]"
7348 }
7349 _LT_EOF
7350 ;;
7351 *)
7352 cat << \_LT_EOF >> "$cfgfile"
7353
7354 # func_append var value
7355 # Append VALUE to the end of shell variable VAR.
7356 func_append ()
7357 {
7358 eval "$[1]=\$$[1]\$[2]"
7359 }
7360
7361 _LT_EOF
7362 ;;
7363 esac
7364 ])
7365
7366 # Helper functions for option handling. -*- Autoconf -*-
7367 #
7368 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7369 # Written by Gary V. Vaughan, 2004
7370 #
7371 # This file is free software; the Free Software Foundation gives
7372 # unlimited permission to copy and/or distribute it, with or without
7373 # modifications, as long as this notice is preserved.
7374
7375 # serial 6 ltoptions.m4
7376
7377 # This is to help aclocal find these macros, as it can't see m4_define.
7378 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7379
7380
7381 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
7382 # ------------------------------------------
7383 m4_define([_LT_MANGLE_OPTION],
7384 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
7385
7386
7387 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
7388 # ---------------------------------------
7389 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
7390 # matching handler defined, dispatch to it. Other OPTION-NAMEs are
7391 # saved as a flag.
7392 m4_define([_LT_SET_OPTION],
7393 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
7394 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
7395 _LT_MANGLE_DEFUN([$1], [$2]),
7396 [m4_warning([Unknown $1 option `$2'])])[]dnl
7397 ])
7398
7399
7400 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
7401 # ------------------------------------------------------------
7402 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7403 m4_define([_LT_IF_OPTION],
7404 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
7405
7406
7407 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
7408 # -------------------------------------------------------
7409 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
7410 # are set.
7411 m4_define([_LT_UNLESS_OPTIONS],
7412 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7413 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
7414 [m4_define([$0_found])])])[]dnl
7415 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
7416 ])[]dnl
7417 ])
7418
7419
7420 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
7421 # ----------------------------------------
7422 # OPTION-LIST is a space-separated list of Libtool options associated
7423 # with MACRO-NAME. If any OPTION has a matching handler declared with
7424 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
7425 # the unknown option and exit.
7426 m4_defun([_LT_SET_OPTIONS],
7427 [# Set options
7428 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7429 [_LT_SET_OPTION([$1], _LT_Option)])
7430
7431 m4_if([$1],[LT_INIT],[
7432 dnl
7433 dnl Simply set some default values (i.e off) if boolean options were not
7434 dnl specified:
7435 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
7436 ])
7437 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
7438 ])
7439 dnl
7440 dnl If no reference was made to various pairs of opposing options, then
7441 dnl we run the default mode handler for the pair. For example, if neither
7442 dnl `shared' nor `disable-shared' was passed, we enable building of shared
7443 dnl archives by default:
7444 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
7445 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
7446 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
7447 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
7448 [_LT_ENABLE_FAST_INSTALL])
7449 ])
7450 ])# _LT_SET_OPTIONS
7451
7452
7453
7454 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
7455 # -----------------------------------------
7456 m4_define([_LT_MANGLE_DEFUN],
7457 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7458
7459
7460 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
7461 # -----------------------------------------------
7462 m4_define([LT_OPTION_DEFINE],
7463 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
7464 ])# LT_OPTION_DEFINE
7465
7466
7467 # dlopen
7468 # ------
7469 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
7470 ])
7471
7472 AU_DEFUN([AC_LIBTOOL_DLOPEN],
7473 [_LT_SET_OPTION([LT_INIT], [dlopen])
7474 AC_DIAGNOSE([obsolete],
7475 [$0: Remove this warning and the call to _LT_SET_OPTION when you
7476 put the `dlopen' option into LT_INIT's first parameter.])
7477 ])
7478
7479 dnl aclocal-1.4 backwards compatibility:
7480 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
7481
7482
7483 # win32-dll
7484 # ---------
7485 # Declare package support for building win32 dll's.
7486 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
7487 [enable_win32_dll=yes
7488
7489 case $host in
7490 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
7491 AC_CHECK_TOOL(AS, as, false)
7492 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7493 AC_CHECK_TOOL(OBJDUMP, objdump, false)
7494 ;;
7495 esac
7496
7497 test -z "$AS" && AS=as
7498 _LT_DECL([], [AS], [0], [Assembler program])dnl
7499
7500 test -z "$DLLTOOL" && DLLTOOL=dlltool
7501 _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
7502
7503 test -z "$OBJDUMP" && OBJDUMP=objdump
7504 _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
7505 ])# win32-dll
7506
7507 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
7508 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
7509 _LT_SET_OPTION([LT_INIT], [win32-dll])
7510 AC_DIAGNOSE([obsolete],
7511 [$0: Remove this warning and the call to _LT_SET_OPTION when you
7512 put the `win32-dll' option into LT_INIT's first parameter.])
7513 ])
7514
7515 dnl aclocal-1.4 backwards compatibility:
7516 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
7517
7518
7519 # _LT_ENABLE_SHARED([DEFAULT])
7520 # ----------------------------
7521 # implement the --enable-shared flag, and supports the `shared' and
7522 # `disable-shared' LT_INIT options.
7523 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
7524 m4_define([_LT_ENABLE_SHARED],
7525 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
7526 AC_ARG_ENABLE([shared],
7527 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7528 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
7529 [p=${PACKAGE-default}
7530 case $enableval in
7531 yes) enable_shared=yes ;;
7532 no) enable_shared=no ;;
7533 *)
7534 enable_shared=no
7535 # Look at the argument we got. We use all the common list separators.
7536 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7537 for pkg in $enableval; do
7538 IFS="$lt_save_ifs"
7539 if test "X$pkg" = "X$p"; then
7540 enable_shared=yes
7541 fi
7542 done
7543 IFS="$lt_save_ifs"
7544 ;;
7545 esac],
7546 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
7547
7548 _LT_DECL([build_libtool_libs], [enable_shared], [0],
7549 [Whether or not to build shared libraries])
7550 ])# _LT_ENABLE_SHARED
7551
7552 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
7553 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
7554
7555 # Old names:
7556 AC_DEFUN([AC_ENABLE_SHARED],
7557 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
7558 ])
7559
7560 AC_DEFUN([AC_DISABLE_SHARED],
7561 [_LT_SET_OPTION([LT_INIT], [disable-shared])
7562 ])
7563
7564 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
7565 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
7566
7567 dnl aclocal-1.4 backwards compatibility:
7568 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
7569 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
7570
7571
7572
7573 # _LT_ENABLE_STATIC([DEFAULT])
7574 # ----------------------------
7575 # implement the --enable-static flag, and support the `static' and
7576 # `disable-static' LT_INIT options.
7577 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
7578 m4_define([_LT_ENABLE_STATIC],
7579 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
7580 AC_ARG_ENABLE([static],
7581 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7582 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
7583 [p=${PACKAGE-default}
7584 case $enableval in
7585 yes) enable_static=yes ;;
7586 no) enable_static=no ;;
7587 *)
7588 enable_static=no
7589 # Look at the argument we got. We use all the common list separators.
7590 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7591 for pkg in $enableval; do
7592 IFS="$lt_save_ifs"
7593 if test "X$pkg" = "X$p"; then
7594 enable_static=yes
7595 fi
7596 done
7597 IFS="$lt_save_ifs"
7598 ;;
7599 esac],
7600 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
7601
7602 _LT_DECL([build_old_libs], [enable_static], [0],
7603 [Whether or not to build static libraries])
7604 ])# _LT_ENABLE_STATIC
7605
7606 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
7607 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
7608
7609 # Old names:
7610 AC_DEFUN([AC_ENABLE_STATIC],
7611 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
7612 ])
7613
7614 AC_DEFUN([AC_DISABLE_STATIC],
7615 [_LT_SET_OPTION([LT_INIT], [disable-static])
7616 ])
7617
7618 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
7619 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7620
7621 dnl aclocal-1.4 backwards compatibility:
7622 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
7623 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
7624
7625
7626
7627 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
7628 # ----------------------------------
7629 # implement the --enable-fast-install flag, and support the `fast-install'
7630 # and `disable-fast-install' LT_INIT options.
7631 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
7632 m4_define([_LT_ENABLE_FAST_INSTALL],
7633 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
7634 AC_ARG_ENABLE([fast-install],
7635 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7636 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7637 [p=${PACKAGE-default}
7638 case $enableval in
7639 yes) enable_fast_install=yes ;;
7640 no) enable_fast_install=no ;;
7641 *)
7642 enable_fast_install=no
7643 # Look at the argument we got. We use all the common list separators.
7644 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7645 for pkg in $enableval; do
7646 IFS="$lt_save_ifs"
7647 if test "X$pkg" = "X$p"; then
7648 enable_fast_install=yes
7649 fi
7650 done
7651 IFS="$lt_save_ifs"
7652 ;;
7653 esac],
7654 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
7655
7656 _LT_DECL([fast_install], [enable_fast_install], [0],
7657 [Whether or not to optimize for fast installation])dnl
7658 ])# _LT_ENABLE_FAST_INSTALL
7659
7660 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
7661 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
7662
7663 # Old names:
7664 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
7665 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
7666 AC_DIAGNOSE([obsolete],
7667 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
7668 the `fast-install' option into LT_INIT's first parameter.])
7669 ])
7670
7671 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
7672 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
7673 AC_DIAGNOSE([obsolete],
7674 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
7675 the `disable-fast-install' option into LT_INIT's first parameter.])
7676 ])
7677
7678 dnl aclocal-1.4 backwards compatibility:
7679 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
7680 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
7681
7682
7683 # _LT_WITH_PIC([MODE])
7684 # --------------------
7685 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
7686 # LT_INIT options.
7687 # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
7688 m4_define([_LT_WITH_PIC],
7689 [AC_ARG_WITH([pic],
7690 [AS_HELP_STRING([--with-pic],
7691 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
7692 [pic_mode="$withval"],
7693 [pic_mode=default])
7694
7695 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
7696
7697 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
7698 ])# _LT_WITH_PIC
7699
7700 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
7701 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
7702
7703 # Old name:
7704 AU_DEFUN([AC_LIBTOOL_PICMODE],
7705 [_LT_SET_OPTION([LT_INIT], [pic-only])
7706 AC_DIAGNOSE([obsolete],
7707 [$0: Remove this warning and the call to _LT_SET_OPTION when you
7708 put the `pic-only' option into LT_INIT's first parameter.])
7709 ])
7710
7711 dnl aclocal-1.4 backwards compatibility:
7712 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7713
7714
7715 m4_define([_LTDL_MODE], [])
7716 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
7717 [m4_define([_LTDL_MODE], [nonrecursive])])
7718 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
7719 [m4_define([_LTDL_MODE], [recursive])])
7720 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
7721 [m4_define([_LTDL_MODE], [subproject])])
7722
7723 m4_define([_LTDL_TYPE], [])
7724 LT_OPTION_DEFINE([LTDL_INIT], [installable],
7725 [m4_define([_LTDL_TYPE], [installable])])
7726 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
7727 [m4_define([_LTDL_TYPE], [convenience])])
7728
7729 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
7730 #
7731 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7732 # Written by Gary V. Vaughan, 2004
7733 #
7734 # This file is free software; the Free Software Foundation gives
7735 # unlimited permission to copy and/or distribute it, with or without
7736 # modifications, as long as this notice is preserved.
7737
7738 # serial 6 ltsugar.m4
7739
7740 # This is to help aclocal find these macros, as it can't see m4_define.
7741 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
7742
7743
7744 # lt_join(SEP, ARG1, [ARG2...])
7745 # -----------------------------
7746 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
7747 # associated separator.
7748 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
7749 # versions in m4sugar had bugs.
7750 m4_define([lt_join],
7751 [m4_if([$#], [1], [],
7752 [$#], [2], [[$2]],
7753 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
7754 m4_define([_lt_join],
7755 [m4_if([$#$2], [2], [],
7756 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
7757
7758
7759 # lt_car(LIST)
7760 # lt_cdr(LIST)
7761 # ------------
7762 # Manipulate m4 lists.
7763 # These macros are necessary as long as will still need to support
7764 # Autoconf-2.59 which quotes differently.
7765 m4_define([lt_car], [[$1]])
7766 m4_define([lt_cdr],
7767 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
7768 [$#], 1, [],
7769 [m4_dquote(m4_shift($@))])])
7770 m4_define([lt_unquote], $1)
7771
7772
7773 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
7774 # ------------------------------------------
7775 # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
7776 # Note that neither SEPARATOR nor STRING are expanded; they are appended
7777 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
7778 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
7779 # than defined and empty).
7780 #
7781 # This macro is needed until we can rely on Autoconf 2.62, since earlier
7782 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
7783 m4_define([lt_append],
7784 [m4_define([$1],
7785 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
7786
7787
7788
7789 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
7790 # ----------------------------------------------------------
7791 # Produce a SEP delimited list of all paired combinations of elements of
7792 # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
7793 # has the form PREFIXmINFIXSUFFIXn.
7794 # Needed until we can rely on m4_combine added in Autoconf 2.62.
7795 m4_define([lt_combine],
7796 [m4_if(m4_eval([$# > 3]), [1],
7797 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
7798 [[m4_foreach([_Lt_prefix], [$2],
7799 [m4_foreach([_Lt_suffix],
7800 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
7801 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
7802
7803
7804 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
7805 # -----------------------------------------------------------------------
7806 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
7807 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
7808 m4_define([lt_if_append_uniq],
7809 [m4_ifdef([$1],
7810 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
7811 [lt_append([$1], [$2], [$3])$4],
7812 [$5])],
7813 [lt_append([$1], [$2], [$3])$4])])
7814
7815
7816 # lt_dict_add(DICT, KEY, VALUE)
7817 # -----------------------------
7818 m4_define([lt_dict_add],
7819 [m4_define([$1($2)], [$3])])
7820
7821
7822 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
7823 # --------------------------------------------
7824 m4_define([lt_dict_add_subkey],
7825 [m4_define([$1($2:$3)], [$4])])
7826
7827
7828 # lt_dict_fetch(DICT, KEY, [SUBKEY])
7829 # ----------------------------------
7830 m4_define([lt_dict_fetch],
7831 [m4_ifval([$3],
7832 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
7833 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
7834
7835
7836 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
7837 # -----------------------------------------------------------------
7838 m4_define([lt_if_dict_fetch],
7839 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
7840 [$5],
7841 [$6])])
7842
7843
7844 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
7845 # --------------------------------------------------------------
7846 m4_define([lt_dict_filter],
7847 [m4_if([$5], [], [],
7848 [lt_join(m4_quote(m4_default([$4], [[, ]])),
7849 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
7850 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
7851 ])
7852
7853 # ltversion.m4 -- version numbers -*- Autoconf -*-
7854 #
7855 # Copyright (C) 2004 Free Software Foundation, Inc.
7856 # Written by Scott James Remnant, 2004
7857 #
7858 # This file is free software; the Free Software Foundation gives
7859 # unlimited permission to copy and/or distribute it, with or without
7860 # modifications, as long as this notice is preserved.
7861
7862 # Generated from ltversion.in.
7863
7864 # serial 3012 ltversion.m4
7865 # This file is part of GNU Libtool
7866
7867 m4_define([LT_PACKAGE_VERSION], [2.2.6])
7868 m4_define([LT_PACKAGE_REVISION], [1.3012])
7869
7870 AC_DEFUN([LTVERSION_VERSION],
7871 [macro_version='2.2.6'
7872 macro_revision='1.3012'
7873 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
7874 _LT_DECL(, macro_revision, 0)
7875 ])
7876
7877 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
7878 #
7879 # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
7880 # Written by Scott James Remnant, 2004.
7881 #
7882 # This file is free software; the Free Software Foundation gives
7883 # unlimited permission to copy and/or distribute it, with or without
7884 # modifications, as long as this notice is preserved.
7885
7886 # serial 4 lt~obsolete.m4
7887
7888 # These exist entirely to fool aclocal when bootstrapping libtool.
7889 #
7890 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
7891 # which have later been changed to m4_define as they aren't part of the
7892 # exported API, or moved to Autoconf or Automake where they belong.
7893 #
7894 # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
7895 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
7896 # using a macro with the same name in our local m4/libtool.m4 it'll
7897 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
7898 # and doesn't know about Autoconf macros at all.)
7899 #
7900 # So we provide this file, which has a silly filename so it's always
7901 # included after everything else. This provides aclocal with the
7902 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
7903 # because those macros already exist, or will be overwritten later.
7904 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
7905 #
7906 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
7907 # Yes, that means every name once taken will need to remain here until
7908 # we give up compatibility with versions before 1.7, at which point
7909 # we need to keep only those names which we still refer to.
7910
7911 # This is to help aclocal find these macros, as it can't see m4_define.
7912 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
7913
7914 m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
7915 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
7916 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
7917 m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
7918 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
7919 m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
7920 m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
7921 m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
7922 m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
7923 m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
7924 m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
7925 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
7926 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
7927 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
7928 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
7929 m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
7930 m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
7931 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
7932 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
7933 m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
7934 m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
7935 m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
7936 m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
7937 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
7938 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
7939 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
7940 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
7941 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
7942 m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
7943 m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
7944 m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
7945 m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
7946 m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
7947 m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
7948 m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
7949 m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
7950 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
7951 m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
7952 m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
7953 m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
7954 m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
7955 m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
7956 m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
7957 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
7958 m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
7959 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
7960 m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
7961 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
7962 m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
7963 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
7964 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
7965 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
7966 m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
7967 m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
7968 m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
7969
7970 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
7971 #
7972 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
7973 #
7974 # This program is free software; you can redistribute it and/or modify
7975 # it under the terms of the GNU General Public License as published by
7976 # the Free Software Foundation; either version 2 of the License, or
7977 # (at your option) any later version.
7978 #
7979 # This program is distributed in the hope that it will be useful, but
7980 # WITHOUT ANY WARRANTY; without even the implied warranty of
7981 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7982 # General Public License for more details.
7983 #
7984 # You should have received a copy of the GNU General Public License
7985 # along with this program; if not, write to the Free Software
7986 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7987 #
7988 # As a special exception to the GNU General Public License, if you
7989 # distribute this file as part of a program that contains a
7990 # configuration script generated by Autoconf, you may include it under
7991 # the same distribution terms that you use for the rest of that program.
7992
7993 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
7994 # ----------------------------------
7995 AC_DEFUN([PKG_PROG_PKG_CONFIG],
7996 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
7997 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
7998 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
7999 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8000 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8001 fi
8002 if test -n "$PKG_CONFIG"; then
8003 _pkg_min_version=m4_default([$1], [0.9.0])
8004 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8005 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8006 AC_MSG_RESULT([yes])
8007 else
8008 AC_MSG_RESULT([no])
8009 PKG_CONFIG=""
8010 fi
8011
8012 fi[]dnl
8013 ])# PKG_PROG_PKG_CONFIG
8014
8015 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8016 #
8017 # Check to see whether a particular set of modules exists. Similar
8018 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
8019 #
8020 #
8021 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
8022 # this or PKG_CHECK_MODULES is called, or make sure to call
8023 # PKG_CHECK_EXISTS manually
8024 # --------------------------------------------------------------
8025 AC_DEFUN([PKG_CHECK_EXISTS],
8026 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8027 if test -n "$PKG_CONFIG" && \
8028 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8029 m4_ifval([$2], [$2], [:])
8030 m4_ifvaln([$3], [else
8031 $3])dnl
8032 fi])
8033
8034
8035 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8036 # ---------------------------------------------
8037 m4_define([_PKG_CONFIG],
8038 [if test -n "$$1"; then
8039 pkg_cv_[]$1="$$1"
8040 elif test -n "$PKG_CONFIG"; then
8041 PKG_CHECK_EXISTS([$3],
8042 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8043 [pkg_failed=yes])
8044 else
8045 pkg_failed=untried
8046 fi[]dnl
8047 ])# _PKG_CONFIG
8048
8049 # _PKG_SHORT_ERRORS_SUPPORTED
8050 # -----------------------------
8051 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8052 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8053 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8054 _pkg_short_errors_supported=yes
8055 else
8056 _pkg_short_errors_supported=no
8057 fi[]dnl
8058 ])# _PKG_SHORT_ERRORS_SUPPORTED
8059
8060
8061 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8062 # [ACTION-IF-NOT-FOUND])
8063 #
8064 #
8065 # Note that if there is a possibility the first call to
8066 # PKG_CHECK_MODULES might not happen, you should be sure to include an
8067 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8068 #
8069 #
8070 # --------------------------------------------------------------
8071 AC_DEFUN([PKG_CHECK_MODULES],
8072 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8073 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8074 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8075
8076 pkg_failed=no
8077 AC_MSG_CHECKING([for $1])
8078
8079 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8080 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
8081
8082 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8083 and $1[]_LIBS to avoid the need to call pkg-config.
8084 See the pkg-config man page for more details.])
8085
8086 if test $pkg_failed = yes; then
8087 _PKG_SHORT_ERRORS_SUPPORTED
8088 if test $_pkg_short_errors_supported = yes; then
8089 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
8090 else
8091 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
8092 fi
8093 # Put the nasty error message in config.log where it belongs
8094 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8095
8096 ifelse([$4], , [AC_MSG_ERROR(dnl
8097 [Package requirements ($2) were not met:
8098
8099 $$1_PKG_ERRORS
8100
8101 Consider adjusting the PKG_CONFIG_PATH environment variable if you
8102 installed software in a non-standard prefix.
8103
8104 _PKG_TEXT
8105 ])],
8106 [AC_MSG_RESULT([no])
8107 $4])
8108 elif test $pkg_failed = untried; then
8109 ifelse([$4], , [AC_MSG_FAILURE(dnl
8110 [The pkg-config script could not be found or is too old. Make sure it
8111 is in your PATH or set the PKG_CONFIG environment variable to the full
8112 path to pkg-config.
8113
8114 _PKG_TEXT
8115
8116 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
8117 [$4])
8118 else
8119 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8120 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8121 AC_MSG_RESULT([yes])
8122 ifelse([$3], , :, [$3])
8123 fi[]dnl
8124 ])# PKG_CHECK_MODULES
8125
8126 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
8127 #
8128 # This file is free software; the Free Software Foundation
8129 # gives unlimited permission to copy and/or distribute it,
8130 # with or without modifications, as long as this notice is preserved.
8131
8132 # AM_AUTOMAKE_VERSION(VERSION)
8133 # ----------------------------
8134 # Automake X.Y traces this macro to ensure aclocal.m4 has been
8135 # generated from the m4 files accompanying Automake X.Y.
8136 # (This private macro should not be called outside this file.)
8137 AC_DEFUN([AM_AUTOMAKE_VERSION],
8138 [am__api_version='1.10'
8139 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8140 dnl require some minimum version. Point them to the right macro.
8141 m4_if([$1], [1.10.2], [],
8142 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8143 ])
8144
8145 # _AM_AUTOCONF_VERSION(VERSION)
8146 # -----------------------------
8147 # aclocal traces this macro to find the Autoconf version.
8148 # This is a private macro too. Using m4_define simplifies
8149 # the logic in aclocal, which can simply ignore this definition.
8150 m4_define([_AM_AUTOCONF_VERSION], [])
8151
8152 # AM_SET_CURRENT_AUTOMAKE_VERSION
8153 # -------------------------------
8154 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8155 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
8156 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8157 [AM_AUTOMAKE_VERSION([1.10.2])dnl
8158 m4_ifndef([AC_AUTOCONF_VERSION],
8159 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8160 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
8161
8162 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
8163
8164 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
8165 #
8166 # This file is free software; the Free Software Foundation
8167 # gives unlimited permission to copy and/or distribute it,
8168 # with or without modifications, as long as this notice is preserved.
8169
8170 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
8171 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
8172 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
8173 #
8174 # Of course, Automake must honor this variable whenever it calls a
8175 # tool from the auxiliary directory. The problem is that $srcdir (and
8176 # therefore $ac_aux_dir as well) can be either absolute or relative,
8177 # depending on how configure is run. This is pretty annoying, since
8178 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
8179 # source directory, any form will work fine, but in subdirectories a
8180 # relative path needs to be adjusted first.
8181 #
8182 # $ac_aux_dir/missing
8183 # fails when called from a subdirectory if $ac_aux_dir is relative
8184 # $top_srcdir/$ac_aux_dir/missing
8185 # fails if $ac_aux_dir is absolute,
8186 # fails when called from a subdirectory in a VPATH build with
8187 # a relative $ac_aux_dir
8188 #
8189 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8190 # are both prefixed by $srcdir. In an in-source build this is usually
8191 # harmless because $srcdir is `.', but things will broke when you
8192 # start a VPATH build or use an absolute $srcdir.
8193 #
8194 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8195 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
8196 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8197 # and then we would define $MISSING as
8198 # MISSING="\${SHELL} $am_aux_dir/missing"
8199 # This will work as long as MISSING is not called from configure, because
8200 # unfortunately $(top_srcdir) has no meaning in configure.
8201 # However there are other variables, like CC, which are often used in
8202 # configure, and could therefore not use this "fixed" $ac_aux_dir.
8203 #
8204 # Another solution, used here, is to always expand $ac_aux_dir to an
8205 # absolute PATH. The drawback is that using absolute paths prevent a
8206 # configured tree to be moved without reconfiguration.
8207
8208 AC_DEFUN([AM_AUX_DIR_EXPAND],
8209 [dnl Rely on autoconf to set up CDPATH properly.
8210 AC_PREREQ([2.50])dnl
8211 # expand $ac_aux_dir to an absolute path
8212 am_aux_dir=`cd $ac_aux_dir && pwd`
8213 ])
8214
8215 # AM_CONDITIONAL -*- Autoconf -*-
8216
8217 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
8218 # Free Software Foundation, Inc.
8219 #
8220 # This file is free software; the Free Software Foundation
8221 # gives unlimited permission to copy and/or distribute it,
8222 # with or without modifications, as long as this notice is preserved.
8223
8224 # serial 8
8225
8226 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
8227 # -------------------------------------
8228 # Define a conditional.
8229 AC_DEFUN([AM_CONDITIONAL],
8230 [AC_PREREQ(2.52)dnl
8231 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
8232 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8233 AC_SUBST([$1_TRUE])dnl
8234 AC_SUBST([$1_FALSE])dnl
8235 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
8236 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
8237 if $2; then
8238 $1_TRUE=
8239 $1_FALSE='#'
8240 else
8241 $1_TRUE='#'
8242 $1_FALSE=
8243 fi
8244 AC_CONFIG_COMMANDS_PRE(
8245 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
8246 AC_MSG_ERROR([[conditional "$1" was never defined.
8247 Usually this means the macro was only invoked conditionally.]])
8248 fi])])
8249
8250 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
8251 # Free Software Foundation, Inc.
8252 #
8253 # This file is free software; the Free Software Foundation
8254 # gives unlimited permission to copy and/or distribute it,
8255 # with or without modifications, as long as this notice is preserved.
8256
8257 # serial 9
8258
8259 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
8260 # written in clear, in which case automake, when reading aclocal.m4,
8261 # will think it sees a *use*, and therefore will trigger all it's
8262 # C support machinery. Also note that it means that autoscan, seeing
8263 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8264
8265
8266 # _AM_DEPENDENCIES(NAME)
8267 # ----------------------
8268 # See how the compiler implements dependency checking.
8269 # NAME is "CC", "CXX", "GCJ", or "OBJC".
8270 # We try a few techniques and use that to set a single cache variable.
8271 #
8272 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8273 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8274 # dependency, and given that the user is not expected to run this macro,
8275 # just rely on AC_PROG_CC.
8276 AC_DEFUN([_AM_DEPENDENCIES],
8277 [AC_REQUIRE([AM_SET_DEPDIR])dnl
8278 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8279 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
8280 AC_REQUIRE([AM_DEP_TRACK])dnl
8281
8282 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
8283 [$1], CXX, [depcc="$CXX" am_compiler_list=],
8284 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8285 [$1], UPC, [depcc="$UPC" am_compiler_list=],
8286 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
8287 [depcc="$$1" am_compiler_list=])
8288
8289 AC_CACHE_CHECK([dependency style of $depcc],
8290 [am_cv_$1_dependencies_compiler_type],
8291 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8292 # We make a subdir and do the tests there. Otherwise we can end up
8293 # making bogus files that we don't know about and never remove. For
8294 # instance it was reported that on HP-UX the gcc test will end up
8295 # making a dummy file named `D' -- because `-MD' means `put the output
8296 # in D'.
8297 mkdir conftest.dir
8298 # Copy depcomp to subdir because otherwise we won't find it if we're
8299 # using a relative directory.
8300 cp "$am_depcomp" conftest.dir
8301 cd conftest.dir
8302 # We will build objects and dependencies in a subdirectory because
8303 # it helps to detect inapplicable dependency modes. For instance
8304 # both Tru64's cc and ICC support -MD to output dependencies as a
8305 # side effect of compilation, but ICC will put the dependencies in
8306 # the current directory while Tru64 will put them in the object
8307 # directory.
8308 mkdir sub
8309
8310 am_cv_$1_dependencies_compiler_type=none
8311 if test "$am_compiler_list" = ""; then
8312 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
8313 fi
8314 for depmode in $am_compiler_list; do
8315 # Setup a source with many dependencies, because some compilers
8316 # like to wrap large dependency lists on column 80 (with \), and
8317 # we should not choose a depcomp mode which is confused by this.
8318 #
8319 # We need to recreate these files for each test, as the compiler may
8320 # overwrite some of them when testing with obscure command lines.
8321 # This happens at least with the AIX C compiler.
8322 : > sub/conftest.c
8323 for i in 1 2 3 4 5 6; do
8324 echo '#include "conftst'$i'.h"' >> sub/conftest.c
8325 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
8326 # Solaris 8's {/usr,}/bin/sh.
8327 touch sub/conftst$i.h
8328 done
8329 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8330
8331 case $depmode in
8332 nosideeffect)
8333 # after this tag, mechanisms are not by side-effect, so they'll
8334 # only be used when explicitly requested
8335 if test "x$enable_dependency_tracking" = xyes; then
8336 continue
8337 else
8338 break
8339 fi
8340 ;;
8341 none) break ;;
8342 esac
8343 # We check with `-c' and `-o' for the sake of the "dashmstdout"
8344 # mode. It turns out that the SunPro C++ compiler does not properly
8345 # handle `-M -o', and we need to detect this.
8346 if depmode=$depmode \
8347 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
8348 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8349 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
8350 >/dev/null 2>conftest.err &&
8351 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
8352 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8353 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
8354 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
8355 # icc doesn't choke on unknown options, it will just issue warnings
8356 # or remarks (even with -Werror). So we grep stderr for any message
8357 # that says an option was ignored or not supported.
8358 # When given -MP, icc 7.0 and 7.1 complain thusly:
8359 # icc: Command line warning: ignoring option '-M'; no argument required
8360 # The diagnosis changed in icc 8.0:
8361 # icc: Command line remark: option '-MP' not supported
8362 if (grep 'ignoring option' conftest.err ||
8363 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
8364 am_cv_$1_dependencies_compiler_type=$depmode
8365 break
8366 fi
8367 fi
8368 done
8369
8370 cd ..
8371 rm -rf conftest.dir
8372 else
8373 am_cv_$1_dependencies_compiler_type=none
8374 fi
8375 ])
8376 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
8377 AM_CONDITIONAL([am__fastdep$1], [
8378 test "x$enable_dependency_tracking" != xno \
8379 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
8380 ])
8381
8382
8383 # AM_SET_DEPDIR
8384 # -------------
8385 # Choose a directory name for dependency files.
8386 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
8387 AC_DEFUN([AM_SET_DEPDIR],
8388 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
8389 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
8390 ])
8391
8392
8393 # AM_DEP_TRACK
8394 # ------------
8395 AC_DEFUN([AM_DEP_TRACK],
8396 [AC_ARG_ENABLE(dependency-tracking,
8397 [ --disable-dependency-tracking speeds up one-time build
8398 --enable-dependency-tracking do not reject slow dependency extractors])
8399 if test "x$enable_dependency_tracking" != xno; then
8400 am_depcomp="$ac_aux_dir/depcomp"
8401 AMDEPBACKSLASH='\'
8402 fi
8403 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
8404 AC_SUBST([AMDEPBACKSLASH])dnl
8405 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
8406 ])
8407
8408 # Generate code to set up dependency tracking. -*- Autoconf -*-
8409
8410 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
8411 # Free Software Foundation, Inc.
8412 #
8413 # This file is free software; the Free Software Foundation
8414 # gives unlimited permission to copy and/or distribute it,
8415 # with or without modifications, as long as this notice is preserved.
8416
8417 #serial 4
8418
8419 # _AM_OUTPUT_DEPENDENCY_COMMANDS
8420 # ------------------------------
8421 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
8422 [# Autoconf 2.62 quotes --file arguments for eval, but not when files
8423 # are listed without --file. Let's play safe and only enable the eval
8424 # if we detect the quoting.
8425 case $CONFIG_FILES in
8426 *\'*) eval set x "$CONFIG_FILES" ;;
8427 *) set x $CONFIG_FILES ;;
8428 esac
8429 shift
8430 for mf
8431 do
8432 # Strip MF so we end up with the name of the file.
8433 mf=`echo "$mf" | sed -e 's/:.*$//'`
8434 # Check whether this is an Automake generated Makefile or not.
8435 # We used to match only the files named `Makefile.in', but
8436 # some people rename them; so instead we look at the file content.
8437 # Grep'ing the first line is not enough: some people post-process
8438 # each Makefile.in and add a new line on top of each file to say so.
8439 # Grep'ing the whole file is not good either: AIX grep has a line
8440 # limit of 2048, but all sed's we know have understand at least 4000.
8441 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
8442 dirpart=`AS_DIRNAME("$mf")`
8443 else
8444 continue
8445 fi
8446 # Extract the definition of DEPDIR, am__include, and am__quote
8447 # from the Makefile without running `make'.
8448 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
8449 test -z "$DEPDIR" && continue
8450 am__include=`sed -n 's/^am__include = //p' < "$mf"`
8451 test -z "am__include" && continue
8452 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
8453 # When using ansi2knr, U may be empty or an underscore; expand it
8454 U=`sed -n 's/^U = //p' < "$mf"`
8455 # Find all dependency output files, they are included files with
8456 # $(DEPDIR) in their names. We invoke sed twice because it is the
8457 # simplest approach to changing $(DEPDIR) to its actual value in the
8458 # expansion.
8459 for file in `sed -n "
8460 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
8461 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
8462 # Make sure the directory exists.
8463 test -f "$dirpart/$file" && continue
8464 fdir=`AS_DIRNAME(["$file"])`
8465 AS_MKDIR_P([$dirpart/$fdir])
8466 # echo "creating $dirpart/$file"
8467 echo '# dummy' > "$dirpart/$file"
8468 done
8469 done
8470 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
8471
8472
8473 # AM_OUTPUT_DEPENDENCY_COMMANDS
8474 # -----------------------------
8475 # This macro should only be invoked once -- use via AC_REQUIRE.
8476 #
8477 # This code is only required when automatic dependency tracking
8478 # is enabled. FIXME. This creates each `.P' file that we will
8479 # need in order to bootstrap the dependency handling code.
8480 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
8481 [AC_CONFIG_COMMANDS([depfiles],
8482 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
8483 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
8484 ])
8485
8486 # Do all the work for Automake. -*- Autoconf -*-
8487
8488 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
8489 # 2005, 2006, 2008 Free Software Foundation, Inc.
8490 #
8491 # This file is free software; the Free Software Foundation
8492 # gives unlimited permission to copy and/or distribute it,
8493 # with or without modifications, as long as this notice is preserved.
8494
8495 # serial 13
8496
8497 # This macro actually does too much. Some checks are only needed if
8498 # your package does certain things. But this isn't really a big deal.
8499
8500 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
8501 # AM_INIT_AUTOMAKE([OPTIONS])
8502 # -----------------------------------------------
8503 # The call with PACKAGE and VERSION arguments is the old style
8504 # call (pre autoconf-2.50), which is being phased out. PACKAGE
8505 # and VERSION should now be passed to AC_INIT and removed from
8506 # the call to AM_INIT_AUTOMAKE.
8507 # We support both call styles for the transition. After
8508 # the next Automake release, Autoconf can make the AC_INIT
8509 # arguments mandatory, and then we can depend on a new Autoconf
8510 # release and drop the old call support.
8511 AC_DEFUN([AM_INIT_AUTOMAKE],
8512 [AC_PREREQ([2.60])dnl
8513 dnl Autoconf wants to disallow AM_ names. We explicitly allow
8514 dnl the ones we care about.
8515 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
8516 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
8517 AC_REQUIRE([AC_PROG_INSTALL])dnl
8518 if test "`cd $srcdir && pwd`" != "`pwd`"; then
8519 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
8520 # is not polluted with repeated "-I."
8521 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
8522 # test to see if srcdir already configured
8523 if test -f $srcdir/config.status; then
8524 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
8525 fi
8526 fi
8527
8528 # test whether we have cygpath
8529 if test -z "$CYGPATH_W"; then
8530 if (cygpath --version) >/dev/null 2>/dev/null; then
8531 CYGPATH_W='cygpath -w'
8532 else
8533 CYGPATH_W=echo
8534 fi
8535 fi
8536 AC_SUBST([CYGPATH_W])
8537
8538 # Define the identity of the package.
8539 dnl Distinguish between old-style and new-style calls.
8540 m4_ifval([$2],
8541 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
8542 AC_SUBST([PACKAGE], [$1])dnl
8543 AC_SUBST([VERSION], [$2])],
8544 [_AM_SET_OPTIONS([$1])dnl
8545 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
8546 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
8547 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
8548 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
8549 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
8550
8551 _AM_IF_OPTION([no-define],,
8552 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
8553 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
8554
8555 # Some tools Automake needs.
8556 AC_REQUIRE([AM_SANITY_CHECK])dnl
8557 AC_REQUIRE([AC_ARG_PROGRAM])dnl
8558 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
8559 AM_MISSING_PROG(AUTOCONF, autoconf)
8560 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
8561 AM_MISSING_PROG(AUTOHEADER, autoheader)
8562 AM_MISSING_PROG(MAKEINFO, makeinfo)
8563 AM_PROG_INSTALL_SH
8564 AM_PROG_INSTALL_STRIP
8565 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
8566 # We need awk for the "check" target. The system "awk" is bad on
8567 # some platforms.
8568 AC_REQUIRE([AC_PROG_AWK])dnl
8569 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
8570 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
8571 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
8572 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
8573 [_AM_PROG_TAR([v7])])])
8574 _AM_IF_OPTION([no-dependencies],,
8575 [AC_PROVIDE_IFELSE([AC_PROG_CC],
8576 [_AM_DEPENDENCIES(CC)],
8577 [define([AC_PROG_CC],
8578 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
8579 AC_PROVIDE_IFELSE([AC_PROG_CXX],
8580 [_AM_DEPENDENCIES(CXX)],
8581 [define([AC_PROG_CXX],
8582 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
8583 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
8584 [_AM_DEPENDENCIES(OBJC)],
8585 [define([AC_PROG_OBJC],
8586 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
8587 ])
8588 ])
8589
8590
8591 # When config.status generates a header, we must update the stamp-h file.
8592 # This file resides in the same directory as the config header
8593 # that is generated. The stamp files are numbered to have different names.
8594
8595 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
8596 # loop where config.status creates the headers, so we can generate
8597 # our stamp files there.
8598 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
8599 [# Compute $1's index in $config_headers.
8600 _am_arg=$1
8601 _am_stamp_count=1
8602 for _am_header in $config_headers :; do
8603 case $_am_header in
8604 $_am_arg | $_am_arg:* )
8605 break ;;
8606 * )
8607 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
8608 esac
8609 done
8610 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
8611
8612 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
8613 #
8614 # This file is free software; the Free Software Foundation
8615 # gives unlimited permission to copy and/or distribute it,
8616 # with or without modifications, as long as this notice is preserved.
8617
8618 # AM_PROG_INSTALL_SH
8619 # ------------------
8620 # Define $install_sh.
8621 AC_DEFUN([AM_PROG_INSTALL_SH],
8622 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8623 install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
8624 AC_SUBST(install_sh)])
8625
8626 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
8627 #
8628 # This file is free software; the Free Software Foundation
8629 # gives unlimited permission to copy and/or distribute it,
8630 # with or without modifications, as long as this notice is preserved.
8631
8632 # serial 2
8633
8634 # Check whether the underlying file-system supports filenames
8635 # with a leading dot. For instance MS-DOS doesn't.
8636 AC_DEFUN([AM_SET_LEADING_DOT],
8637 [rm -rf .tst 2>/dev/null
8638 mkdir .tst 2>/dev/null
8639 if test -d .tst; then
8640 am__leading_dot=.
8641 else
8642 am__leading_dot=_
8643 fi
8644 rmdir .tst 2>/dev/null
8645 AC_SUBST([am__leading_dot])])
8646
8647 # Check to see how 'make' treats includes. -*- Autoconf -*-
8648
8649 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
8650 #
8651 # This file is free software; the Free Software Foundation
8652 # gives unlimited permission to copy and/or distribute it,
8653 # with or without modifications, as long as this notice is preserved.
8654
8655 # serial 3
8656
8657 # AM_MAKE_INCLUDE()
8658 # -----------------
8659 # Check to see how make treats includes.
8660 AC_DEFUN([AM_MAKE_INCLUDE],
8661 [am_make=${MAKE-make}
8662 cat > confinc << 'END'
8663 am__doit:
8664 @echo done
8665 .PHONY: am__doit
8666 END
8667 # If we don't find an include directive, just comment out the code.
8668 AC_MSG_CHECKING([for style of include used by $am_make])
8669 am__include="#"
8670 am__quote=
8671 _am_result=none
8672 # First try GNU make style include.
8673 echo "include confinc" > confmf
8674 # We grep out `Entering directory' and `Leaving directory'
8675 # messages which can occur if `w' ends up in MAKEFLAGS.
8676 # In particular we don't look at `^make:' because GNU make might
8677 # be invoked under some other name (usually "gmake"), in which
8678 # case it prints its new name instead of `make'.
8679 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
8680 am__include=include
8681 am__quote=
8682 _am_result=GNU
8683 fi
8684 # Now try BSD make style include.
8685 if test "$am__include" = "#"; then
8686 echo '.include "confinc"' > confmf
8687 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
8688 am__include=.include
8689 am__quote="\""
8690 _am_result=BSD
8691 fi
8692 fi
8693 AC_SUBST([am__include])
8694 AC_SUBST([am__quote])
8695 AC_MSG_RESULT([$_am_result])
8696 rm -f confinc confmf
8697 ])
8698
8699 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
8700 # Free Software Foundation, Inc.
8701 #
8702 # This file is free software; the Free Software Foundation
8703 # gives unlimited permission to copy and/or distribute it,
8704 # with or without modifications, as long as this notice is preserved.
8705
8706 # serial 6
8707
8708 # AM_PROG_CC_C_O
8709 # --------------
8710 # Like AC_PROG_CC_C_O, but changed for automake.
8711 AC_DEFUN([AM_PROG_CC_C_O],
8712 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
8713 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8714 AC_REQUIRE_AUX_FILE([compile])dnl
8715 # FIXME: we rely on the cache variable name because
8716 # there is no other way.
8717 set dummy $CC
8718 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
8719 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
8720 if test "$am_t" != yes; then
8721 # Losing compiler, so override with the script.
8722 # FIXME: It is wrong to rewrite CC.
8723 # But if we don't then we get into trouble of one sort or another.
8724 # A longer-term fix would be to have automake use am__CC in this case,
8725 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
8726 CC="$am_aux_dir/compile $CC"
8727 fi
8728 dnl Make sure AC_PROG_CC is never called again, or it will override our
8729 dnl setting of CC.
8730 m4_define([AC_PROG_CC],
8731 [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
8732 ])
8733
8734 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
8735
8736 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
8737 # Free Software Foundation, Inc.
8738 #
8739 # This file is free software; the Free Software Foundation
8740 # gives unlimited permission to copy and/or distribute it,
8741 # with or without modifications, as long as this notice is preserved.
8742
8743 # serial 5
8744
8745 # AM_MISSING_PROG(NAME, PROGRAM)
8746 # ------------------------------
8747 AC_DEFUN([AM_MISSING_PROG],
8748 [AC_REQUIRE([AM_MISSING_HAS_RUN])
8749 $1=${$1-"${am_missing_run}$2"}
8750 AC_SUBST($1)])
8751
8752
8753 # AM_MISSING_HAS_RUN
8754 # ------------------
8755 # Define MISSING if not defined so far and test if it supports --run.
8756 # If it does, set am_missing_run to use it, otherwise, to nothing.
8757 AC_DEFUN([AM_MISSING_HAS_RUN],
8758 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8759 AC_REQUIRE_AUX_FILE([missing])dnl
8760 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
8761 # Use eval to expand $SHELL
8762 if eval "$MISSING --run true"; then
8763 am_missing_run="$MISSING --run "
8764 else
8765 am_missing_run=
8766 AC_MSG_WARN([`missing' script is too old or missing])
8767 fi
8768 ])
8769
8770 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
8771 #
8772 # This file is free software; the Free Software Foundation
8773 # gives unlimited permission to copy and/or distribute it,
8774 # with or without modifications, as long as this notice is preserved.
8775
8776 # AM_PROG_MKDIR_P
8777 # ---------------
8778 # Check for `mkdir -p'.
8779 AC_DEFUN([AM_PROG_MKDIR_P],
8780 [AC_PREREQ([2.60])dnl
8781 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
8782 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
8783 dnl while keeping a definition of mkdir_p for backward compatibility.
8784 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
8785 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
8786 dnl Makefile.ins that do not define MKDIR_P, so we do our own
8787 dnl adjustment using top_builddir (which is defined more often than
8788 dnl MKDIR_P).
8789 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
8790 case $mkdir_p in
8791 [[\\/$]]* | ?:[[\\/]]*) ;;
8792 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
8793 esac
8794 ])
8795
8796 # Helper functions for option handling. -*- Autoconf -*-
8797
8798 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
8799 #
8800 # This file is free software; the Free Software Foundation
8801 # gives unlimited permission to copy and/or distribute it,
8802 # with or without modifications, as long as this notice is preserved.
8803
8804 # serial 4
8805
8806 # _AM_MANGLE_OPTION(NAME)
8807 # -----------------------
8808 AC_DEFUN([_AM_MANGLE_OPTION],
8809 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
8810
8811 # _AM_SET_OPTION(NAME)
8812 # ------------------------------
8813 # Set option NAME. Presently that only means defining a flag for this option.
8814 AC_DEFUN([_AM_SET_OPTION],
8815 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
8816
8817 # _AM_SET_OPTIONS(OPTIONS)
8818 # ----------------------------------
8819 # OPTIONS is a space-separated list of Automake options.
8820 AC_DEFUN([_AM_SET_OPTIONS],
8821 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
8822
8823 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
8824 # -------------------------------------------
8825 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8826 AC_DEFUN([_AM_IF_OPTION],
8827 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
8828
8829 # Check to make sure that the build environment is sane. -*- Autoconf -*-
8830
8831 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
8832 # Free Software Foundation, Inc.
8833 #
8834 # This file is free software; the Free Software Foundation
8835 # gives unlimited permission to copy and/or distribute it,
8836 # with or without modifications, as long as this notice is preserved.
8837
8838 # serial 4
8839
8840 # AM_SANITY_CHECK
8841 # ---------------
8842 AC_DEFUN([AM_SANITY_CHECK],
8843 [AC_MSG_CHECKING([whether build environment is sane])
8844 # Just in case
8845 sleep 1
8846 echo timestamp > conftest.file
8847 # Do `set' in a subshell so we don't clobber the current shell's
8848 # arguments. Must try -L first in case configure is actually a
8849 # symlink; some systems play weird games with the mod time of symlinks
8850 # (eg FreeBSD returns the mod time of the symlink's containing
8851 # directory).
8852 if (
8853 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
8854 if test "$[*]" = "X"; then
8855 # -L didn't work.
8856 set X `ls -t $srcdir/configure conftest.file`
8857 fi
8858 rm -f conftest.file
8859 if test "$[*]" != "X $srcdir/configure conftest.file" \
8860 && test "$[*]" != "X conftest.file $srcdir/configure"; then
8861
8862 # If neither matched, then we have a broken ls. This can happen
8863 # if, for instance, CONFIG_SHELL is bash and it inherits a
8864 # broken ls alias from the environment. This has actually
8865 # happened. Such a system could not be considered "sane".
8866 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
8867 alias in your environment])
8868 fi
8869
8870 test "$[2]" = conftest.file
8871 )
8872 then
8873 # Ok.
8874 :
8875 else
8876 AC_MSG_ERROR([newly created file is older than distributed files!
8877 Check your system clock])
8878 fi
8879 AC_MSG_RESULT(yes)])
8880
8881 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
8882 #
8883 # This file is free software; the Free Software Foundation
8884 # gives unlimited permission to copy and/or distribute it,
8885 # with or without modifications, as long as this notice is preserved.
8886
8887 # AM_PROG_INSTALL_STRIP
8888 # ---------------------
8889 # One issue with vendor `install' (even GNU) is that you can't
8890 # specify the program used to strip binaries. This is especially
8891 # annoying in cross-compiling environments, where the build's strip
8892 # is unlikely to handle the host's binaries.
8893 # Fortunately install-sh will honor a STRIPPROG variable, so we
8894 # always use install-sh in `make install-strip', and initialize
8895 # STRIPPROG with the value of the STRIP variable (set by the user).
8896 AC_DEFUN([AM_PROG_INSTALL_STRIP],
8897 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8898 # Installed binaries are usually stripped using `strip' when the user
8899 # run `make install-strip'. However `strip' might not be the right
8900 # tool to use in cross-compilation environments, therefore Automake
8901 # will honor the `STRIP' environment variable to overrule this program.
8902 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
8903 if test "$cross_compiling" != no; then
8904 AC_CHECK_TOOL([STRIP], [strip], :)
8905 fi
8906 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
8907 AC_SUBST([INSTALL_STRIP_PROGRAM])])
8908
8909 # Copyright (C) 2006 Free Software Foundation, Inc.
8910 #
8911 # This file is free software; the Free Software Foundation
8912 # gives unlimited permission to copy and/or distribute it,
8913 # with or without modifications, as long as this notice is preserved.
8914
8915 # _AM_SUBST_NOTMAKE(VARIABLE)
8916 # ---------------------------
8917 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
8918 # This macro is traced by Automake.
8919 AC_DEFUN([_AM_SUBST_NOTMAKE])
8920
8921 # Check how to create a tarball. -*- Autoconf -*-
8922
8923 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
8924 #
8925 # This file is free software; the Free Software Foundation
8926 # gives unlimited permission to copy and/or distribute it,
8927 # with or without modifications, as long as this notice is preserved.
8928
8929 # serial 2
8930
8931 # _AM_PROG_TAR(FORMAT)
8932 # --------------------
8933 # Check how to create a tarball in format FORMAT.
8934 # FORMAT should be one of `v7', `ustar', or `pax'.
8935 #
8936 # Substitute a variable $(am__tar) that is a command
8937 # writing to stdout a FORMAT-tarball containing the directory
8938 # $tardir.
8939 # tardir=directory && $(am__tar) > result.tar
8940 #
8941 # Substitute a variable $(am__untar) that extract such
8942 # a tarball read from stdin.
8943 # $(am__untar) < result.tar
8944 AC_DEFUN([_AM_PROG_TAR],
8945 [# Always define AMTAR for backward compatibility.
8946 AM_MISSING_PROG([AMTAR], [tar])
8947 m4_if([$1], [v7],
8948 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
8949 [m4_case([$1], [ustar],, [pax],,
8950 [m4_fatal([Unknown tar format])])
8951 AC_MSG_CHECKING([how to create a $1 tar archive])
8952 # Loop over all known methods to create a tar archive until one works.
8953 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
8954 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
8955 # Do not fold the above two line into one, because Tru64 sh and
8956 # Solaris sh will not grok spaces in the rhs of `-'.
8957 for _am_tool in $_am_tools
8958 do
8959 case $_am_tool in
8960 gnutar)
8961 for _am_tar in tar gnutar gtar;
8962 do
8963 AM_RUN_LOG([$_am_tar --version]) && break
8964 done
8965 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8966 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8967 am__untar="$_am_tar -xf -"
8968 ;;
8969 plaintar)
8970 # Must skip GNU tar: if it does not support --format= it doesn't create
8971 # ustar tarball either.
8972 (tar --version) >/dev/null 2>&1 && continue
8973 am__tar='tar chf - "$$tardir"'
8974 am__tar_='tar chf - "$tardir"'
8975 am__untar='tar xf -'
8976 ;;
8977 pax)
8978 am__tar='pax -L -x $1 -w "$$tardir"'
8979 am__tar_='pax -L -x $1 -w "$tardir"'
8980 am__untar='pax -r'
8981 ;;
8982 cpio)
8983 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8984 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8985 am__untar='cpio -i -H $1 -d'
8986 ;;
8987 none)
8988 am__tar=false
8989 am__tar_=false
8990 am__untar=false
8991 ;;
8992 esac
8993
8994 # If the value was cached, stop now. We just wanted to have am__tar
8995 # and am__untar set.
8996 test -n "${am_cv_prog_tar_$1}" && break
8997
8998 # tar/untar a dummy directory, and stop if the command works
8999 rm -rf conftest.dir
9000 mkdir conftest.dir
9001 echo GrepMe > conftest.dir/file
9002 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9003 rm -rf conftest.dir
9004 if test -s conftest.tar; then
9005 AM_RUN_LOG([$am__untar <conftest.tar])
9006 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9007 fi
9008 done
9009 rm -rf conftest.dir
9010
9011 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9012 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
9013 AC_SUBST([am__tar])
9014 AC_SUBST([am__untar])
9015 ]) # _AM_PROG_TAR
9016
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libatasmart.
4
5 Copyright 2008 Lennart Poettering
6
7 libatasmart is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libatasmart is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libatasmart. If not, If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <arpa/inet.h>
27 #include <stdlib.h>
28 #include <alloca.h>
29 #include <assert.h>
30 #include <fcntl.h>
31 #include <unistd.h>
32 #include <errno.h>
33 #include <string.h>
34 #include <stdio.h>
35 #include <sys/stat.h>
36 #include <sys/ioctl.h>
37 #include <scsi/scsi.h>
38 #include <scsi/sg.h>
39 #include <scsi/scsi_ioctl.h>
40 #include <linux/hdreg.h>
41 #include <linux/fs.h>
42 #include <sys/types.h>
43 #include <regex.h>
44 #include <sys/param.h>
45 #include <libudev.h>
46
47 #include "atasmart.h"
48
49 #ifndef STRPOOL
50 #define _P(x) x
51 #endif
52
53 #define SK_TIMEOUT 2000
54
55 typedef enum SkDirection {
56 SK_DIRECTION_NONE,
57 SK_DIRECTION_IN,
58 SK_DIRECTION_OUT,
59 _SK_DIRECTION_MAX
60 } SkDirection;
61
62 typedef enum SkDiskType {
63 /* These three will be autotested for: */
64 SK_DISK_TYPE_ATA_PASSTHROUGH_12, /* ATA passthrough over SCSI transport, 12-byte version */
65 SK_DISK_TYPE_ATA_PASSTHROUGH_16, /* ATA passthrough over SCSI transport, 16-byte version */
66 SK_DISK_TYPE_ATA, /* Classic Linux /dev/hda ioctls */
67
68 /* These three will not be autotested for */
69 SK_DISK_TYPE_SUNPLUS, /* SunPlus USB/ATA bridges */
70 SK_DISK_TYPE_JMICRON, /* JMicron USB/ATA bridges */
71 SK_DISK_TYPE_BLOB,
72 SK_DISK_TYPE_UNKNOWN,
73 _SK_DISK_TYPE_MAX,
74 _SK_DISK_TYPE_TEST_MAX = SK_DISK_TYPE_SUNPLUS /* only auto test until here */
75 } SkDiskType;
76
77 #if __BYTE_ORDER == __LITTLE_ENDIAN
78 #define MAKE_TAG(a,b,c,d) \
79 (((uint32_t) d << 24) | \
80 ((uint32_t) c << 16) | \
81 ((uint32_t) b << 8) | \
82 ((uint32_t) a))
83 #else
84 #define MAKE_TAG(a,b,c,d) \
85 (((uint32_t) a << 24) | \
86 ((uint32_t) b << 16) | \
87 ((uint32_t) c << 8) | \
88 ((uint32_t) d))
89 #endif
90
91 typedef enum SkBlobTag {
92 SK_BLOB_TAG_IDENTIFY = MAKE_TAG('I', 'D', 'F', 'Y'),
93 SK_BLOB_TAG_SMART_STATUS = MAKE_TAG('S', 'M', 'S', 'T'),
94 SK_BLOB_TAG_SMART_DATA = MAKE_TAG('S', 'M', 'D', 'T'),
95 SK_BLOB_TAG_SMART_THRESHOLDS = MAKE_TAG('S', 'M', 'T', 'H')
96 } SkBlobTag;
97
98 struct SkDisk {
99 char *name;
100 int fd;
101 SkDiskType type;
102
103 uint64_t size;
104
105 uint8_t identify[512];
106 uint8_t smart_data[512];
107 uint8_t smart_thresholds[512];
108
109 SkBool identify_valid:1;
110 SkBool smart_data_valid:1;
111 SkBool smart_thresholds_valid:1;
112
113 SkBool blob_smart_status:1;
114 SkBool blob_smart_status_valid:1;
115
116 SkIdentifyParsedData identify_parsed_data;
117 SkSmartParsedData smart_parsed_data;
118
119 void *blob;
120 };
121
122 /* ATA commands */
123 typedef enum SkAtaCommand {
124 SK_ATA_COMMAND_IDENTIFY_DEVICE = 0xEC,
125 SK_ATA_COMMAND_IDENTIFY_PACKET_DEVICE = 0xA1,
126 SK_ATA_COMMAND_SMART = 0xB0,
127 SK_ATA_COMMAND_CHECK_POWER_MODE = 0xE5
128 } SkAtaCommand;
129
130 /* ATA SMART subcommands (ATA8 7.52.1) */
131 typedef enum SkSmartCommand {
132 SK_SMART_COMMAND_READ_DATA = 0xD0,
133 SK_SMART_COMMAND_READ_THRESHOLDS = 0xD1,
134 SK_SMART_COMMAND_EXECUTE_OFFLINE_IMMEDIATE = 0xD4,
135 SK_SMART_COMMAND_ENABLE_OPERATIONS = 0xD8,
136 SK_SMART_COMMAND_DISABLE_OPERATIONS = 0xD9,
137 SK_SMART_COMMAND_RETURN_STATUS = 0xDA
138 } SkSmartCommand;
139
140 static const char *disk_type_to_string(SkDiskType type) {
141
142 /* %STRINGPOOLSTART% */
143 static const char* const map[_SK_DISK_TYPE_MAX] = {
144 [SK_DISK_TYPE_ATA_PASSTHROUGH_16] = "16 Byte SCSI ATA SAT Passthru",
145 [SK_DISK_TYPE_ATA_PASSTHROUGH_12] = "12 Byte SCSI ATA SAT Passthru",
146 [SK_DISK_TYPE_ATA] = "Native Linux ATA",
147 [SK_DISK_TYPE_SUNPLUS] = "Sunplus SCSI ATA Passthru",
148 [SK_DISK_TYPE_JMICRON] = "JMicron SCSI ATA Passthru",
149 [SK_DISK_TYPE_BLOB] = "Blob",
150 [SK_DISK_TYPE_UNKNOWN] = "Unknown"
151 };
152 /* %STRINGPOOLSTOP% */
153
154 if (type >= _SK_DISK_TYPE_MAX)
155 return NULL;
156
157 return _P(map[type]);
158 }
159
160 static SkBool disk_smart_is_available(SkDisk *d) {
161 return d->identify_valid && !!(d->identify[164] & 1);
162 }
163
164 static SkBool disk_smart_is_enabled(SkDisk *d) {
165 return d->identify_valid && !!(d->identify[170] & 1);
166 }
167
168 static SkBool disk_smart_is_conveyance_test_available(SkDisk *d) {
169 assert(d->smart_data_valid);
170
171 return !!(d->smart_data[367] & 32);
172 }
173 static SkBool disk_smart_is_short_and_extended_test_available(SkDisk *d) {
174 assert(d->smart_data_valid);
175
176 return !!(d->smart_data[367] & 16);
177 }
178
179 static SkBool disk_smart_is_start_test_available(SkDisk *d) {
180 assert(d->smart_data_valid);
181
182 return !!(d->smart_data[367] & 1);
183 }
184
185 static SkBool disk_smart_is_abort_test_available(SkDisk *d) {
186 assert(d->smart_data_valid);
187
188 return !!(d->smart_data[367] & 41);
189 }
190
191 static int disk_ata_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
192 uint8_t *bytes = cmd_data;
193 int ret;
194
195 assert(d->type == SK_DISK_TYPE_ATA);
196
197 switch (direction) {
198
199 case SK_DIRECTION_OUT:
200
201 /* We could use HDIO_DRIVE_TASKFILE here, but
202 * that's a deprecated ioctl(), hence we don't
203 * do it. And we don't need writing anyway. */
204
205 errno = ENOTSUP;
206 return -1;
207
208 case SK_DIRECTION_IN: {
209 uint8_t *ioctl_data;
210
211 /* We have HDIO_DRIVE_CMD which can only read, but not write,
212 * and cannot do LBA. We use it for all read commands. */
213
214 ioctl_data = alloca(4 + *len);
215 memset(ioctl_data, 0, 4 + *len);
216
217 ioctl_data[0] = (uint8_t) command; /* COMMAND */
218 ioctl_data[1] = ioctl_data[0] == WIN_SMART ? bytes[9] : bytes[3]; /* SECTOR/NSECTOR */
219 ioctl_data[2] = bytes[1]; /* FEATURE */
220 ioctl_data[3] = bytes[3]; /* NSECTOR */
221
222 if ((ret = ioctl(d->fd, HDIO_DRIVE_CMD, ioctl_data)) < 0)
223 return ret;
224
225 memset(bytes, 0, 12);
226 bytes[11] = ioctl_data[0];
227 bytes[1] = ioctl_data[1];
228 bytes[3] = ioctl_data[2];
229
230 memcpy(data, ioctl_data+4, *len);
231
232 return ret;
233 }
234
235 case SK_DIRECTION_NONE: {
236 uint8_t ioctl_data[7];
237
238 /* We have HDIO_DRIVE_TASK which can neither read nor
239 * write, but can do LBA. We use it for all commands that
240 * do neither read nor write */
241
242 memset(ioctl_data, 0, sizeof(ioctl_data));
243
244 ioctl_data[0] = (uint8_t) command; /* COMMAND */
245 ioctl_data[1] = bytes[1]; /* FEATURE */
246 ioctl_data[2] = bytes[3]; /* NSECTOR */
247
248 ioctl_data[3] = bytes[9]; /* LBA LOW */
249 ioctl_data[4] = bytes[8]; /* LBA MID */
250 ioctl_data[5] = bytes[7]; /* LBA HIGH */
251 ioctl_data[6] = bytes[10]; /* SELECT */
252
253 if ((ret = ioctl(d->fd, HDIO_DRIVE_TASK, ioctl_data)))
254 return ret;
255
256 memset(bytes, 0, 12);
257 bytes[11] = ioctl_data[0];
258 bytes[1] = ioctl_data[1];
259 bytes[3] = ioctl_data[2];
260
261 bytes[9] = ioctl_data[3];
262 bytes[8] = ioctl_data[4];
263 bytes[7] = ioctl_data[5];
264
265 bytes[10] = ioctl_data[6];
266
267 return ret;
268 }
269
270 default:
271 assert(FALSE);
272 return -1;
273 }
274 }
275
276 /* Sends a SCSI command block */
277 static int sg_io(int fd, int direction,
278 const void *cdb, size_t cdb_len,
279 void *data, size_t data_len,
280 void *sense, size_t sense_len) {
281
282 struct sg_io_hdr io_hdr;
283
284 memset(&io_hdr, 0, sizeof(struct sg_io_hdr));
285
286 io_hdr.interface_id = 'S';
287 io_hdr.cmdp = (unsigned char*) cdb;
288 io_hdr.cmd_len = cdb_len;
289 io_hdr.dxferp = data;
290 io_hdr.dxfer_len = data_len;
291 io_hdr.sbp = sense;
292 io_hdr.mx_sb_len = sense_len;
293 io_hdr.dxfer_direction = direction;
294 io_hdr.timeout = SK_TIMEOUT;
295
296 return ioctl(fd, SG_IO, &io_hdr);
297 }
298
299 static int disk_passthrough_16_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
300 uint8_t *bytes = cmd_data;
301 uint8_t cdb[16];
302 uint8_t sense[32];
303 uint8_t *desc = sense+8;
304 int ret;
305
306 static const int direction_map[] = {
307 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
308 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
309 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
310 };
311
312 assert(d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_16);
313
314 /* ATA Pass-Through 16 byte command, as described in "T10 04-262r8
315 * ATA Command Pass-Through":
316 * http://www.t10.org/ftp/t10/document.04/04-262r8.pdf */
317
318 memset(cdb, 0, sizeof(cdb));
319
320 cdb[0] = 0x85; /* OPERATION CODE: 16 byte pass through */
321
322 if (direction == SK_DIRECTION_NONE) {
323 cdb[1] = 3 << 1; /* PROTOCOL: Non-Data */
324 cdb[2] = 0x20; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=0, T_LENGTH=0 */
325
326 } else if (direction == SK_DIRECTION_IN) {
327 cdb[1] = 4 << 1; /* PROTOCOL: PIO Data-in */
328 cdb[2] = 0x2e; /* OFF_LINE=0, CK_COND=1, T_DIR=1, BYT_BLOK=1, T_LENGTH=2 */
329
330 } else if (direction == SK_DIRECTION_OUT) {
331 cdb[1] = 5 << 1; /* PROTOCOL: PIO Data-Out */
332 cdb[2] = 0x26; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=1, T_LENGTH=2 */
333 }
334
335 cdb[3] = bytes[0]; /* FEATURES */
336 cdb[4] = bytes[1];
337
338 cdb[5] = bytes[2]; /* SECTORS */
339 cdb[6] = bytes[3];
340
341 cdb[8] = bytes[9]; /* LBA LOW */
342 cdb[10] = bytes[8]; /* LBA MID */
343 cdb[12] = bytes[7]; /* LBA HIGH */
344
345 cdb[13] = bytes[10] & 0x4F; /* SELECT */
346 cdb[14] = (uint8_t) command;
347
348 memset(sense, 0, sizeof(sense));
349
350 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len ? *len : 0, sense, sizeof(sense))) < 0)
351 return ret;
352
353 if (sense[0] != 0x72 || desc[0] != 0x9 || desc[1] != 0x0c) {
354 errno = EIO;
355 return -1;
356 }
357
358 memset(bytes, 0, 12);
359
360 bytes[1] = desc[3];
361 bytes[2] = desc[4];
362 bytes[3] = desc[5];
363 bytes[9] = desc[7];
364 bytes[8] = desc[9];
365 bytes[7] = desc[11];
366 bytes[10] = desc[12];
367 bytes[11] = desc[13];
368
369 return ret;
370 }
371
372 static int disk_passthrough_12_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
373 uint8_t *bytes = cmd_data;
374 uint8_t cdb[12];
375 uint8_t sense[32];
376 uint8_t *desc = sense+8;
377 int ret;
378
379 static const int direction_map[] = {
380 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
381 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
382 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
383 };
384
385 assert(d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12);
386
387 /* ATA Pass-Through 12 byte command, as described in "T10 04-262r8
388 * ATA Command Pass-Through":
389 * http://www.t10.org/ftp/t10/document.04/04-262r8.pdf */
390
391 memset(cdb, 0, sizeof(cdb));
392
393 cdb[0] = 0xa1; /* OPERATION CODE: 12 byte pass through */
394
395 if (direction == SK_DIRECTION_NONE) {
396 cdb[1] = 3 << 1; /* PROTOCOL: Non-Data */
397 cdb[2] = 0x20; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=0, T_LENGTH=0 */
398
399 } else if (direction == SK_DIRECTION_IN) {
400 cdb[1] = 4 << 1; /* PROTOCOL: PIO Data-in */
401 cdb[2] = 0x2e; /* OFF_LINE=0, CK_COND=1, T_DIR=1, BYT_BLOK=1, T_LENGTH=2 */
402
403 } else if (direction == SK_DIRECTION_OUT) {
404 cdb[1] = 5 << 1; /* PROTOCOL: PIO Data-Out */
405 cdb[2] = 0x26; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=1, T_LENGTH=2 */
406 }
407
408 cdb[3] = bytes[1]; /* FEATURES */
409 cdb[4] = bytes[3]; /* SECTORS */
410
411 cdb[5] = bytes[9]; /* LBA LOW */
412 cdb[6] = bytes[8]; /* LBA MID */
413 cdb[7] = bytes[7]; /* LBA HIGH */
414
415 cdb[8] = bytes[10] & 0x4F; /* SELECT */
416 cdb[9] = (uint8_t) command;
417
418 memset(sense, 0, sizeof(sense));
419
420 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len ? *len : 0, sense, sizeof(sense))) < 0)
421 return ret;
422
423 if (sense[0] != 0x72 || desc[0] != 0x9 || desc[1] != 0x0c) {
424 errno = EIO;
425 return -1;
426 }
427
428 memset(bytes, 0, 12);
429
430 bytes[1] = desc[3]; /* FEATURES */
431 bytes[2] = desc[4]; /* STATUS */
432 bytes[3] = desc[5]; /* SECTORS */
433 bytes[9] = desc[7]; /* LBA LOW */
434 bytes[8] = desc[9]; /* LBA MID */
435 bytes[7] = desc[11]; /* LBA HIGH */
436 bytes[10] = desc[12]; /* SELECT */
437 bytes[11] = desc[13]; /* ERROR */
438
439 return ret;
440 }
441
442 static int disk_sunplus_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
443 uint8_t *bytes = cmd_data;
444 uint8_t cdb[12];
445 uint8_t sense[32], buf[8];
446 int ret;
447 static const int direction_map[] = {
448 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
449 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
450 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
451 };
452
453 assert(d->type == SK_DISK_TYPE_SUNPLUS);
454
455 /* SunplusIT specific SCSI ATA pass-thru. Inspired by smartmonutils' support for these bridges */
456
457 memset(cdb, 0, sizeof(cdb));
458
459 cdb[0] = 0xF8; /* OPERATION CODE: Sunplus specific */
460 cdb[1] = 0x00; /* Subcommand: Pass-thru */
461 cdb[2] = 0x22;
462
463 if (direction == SK_DIRECTION_NONE)
464 cdb[3] = 0x00; /* protocol */
465 else if (direction == SK_DIRECTION_IN)
466 cdb[3] = 0x10; /* protocol */
467 else if (direction == SK_DIRECTION_OUT)
468 cdb[3] = 0x11; /* protocol */
469
470 cdb[4] = bytes[3]; /* size? */
471 cdb[5] = bytes[1]; /* FEATURES */
472 cdb[6] = bytes[3]; /* SECTORS */
473 cdb[7] = bytes[9]; /* LBA LOW */
474 cdb[8] = bytes[8]; /* LBA MID */
475 cdb[9] = bytes[7]; /* LBA HIGH */
476 cdb[10] = bytes[10] | 0xA0; /* SELECT */
477 cdb[11] = (uint8_t) command;
478
479 memset(sense, 0, sizeof(sense));
480
481 /* Issue request */
482 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len ? *len : 0, sense, sizeof(sense))) < 0)
483 return ret;
484
485 memset(cdb, 0, sizeof(cdb));
486
487 cdb[0] = 0xF8;
488 cdb[1] = 0x00;
489 cdb[2] = 0x21;
490
491 memset(buf, 0, sizeof(buf));
492
493 /* Ask for response */
494 if ((ret = sg_io(d->fd, SG_DXFER_FROM_DEV, cdb, sizeof(cdb), buf, sizeof(buf), sense, sizeof(sense))) < 0)
495 return ret;
496
497 memset(bytes, 0, 12);
498
499 bytes[2] = buf[1]; /* ERROR */
500 bytes[3] = buf[2]; /* SECTORS */
501 bytes[9] = buf[3]; /* LBA LOW */
502 bytes[8] = buf[4]; /* LBA MID */
503 bytes[7] = buf[5]; /* LBA HIGH */
504 bytes[10] = buf[6]; /* SELECT */
505 bytes[11] = buf[7]; /* STATUS */
506
507 return ret;
508 }
509
510 static int disk_jmicron_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* _data, size_t *_len) {
511 uint8_t *bytes = cmd_data;
512 uint8_t cdb[12];
513 uint8_t sense[32];
514 uint8_t port;
515 int ret;
516 SkBool is_smart_status = FALSE;
517 void *data = _data;
518 size_t len = _len ? *_len : 0;
519 uint8_t smart_status = 0;
520
521 static const int direction_map[] = {
522 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
523 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
524 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
525 };
526
527 assert(d->type == SK_DISK_TYPE_JMICRON);
528
529 /* JMicron specific SCSI ATA pass-thru. Inspired by smartmonutils' support for these bridges */
530
531 memset(cdb, 0, sizeof(cdb));
532
533 cdb[0] = 0xdf; /* operation code */
534 cdb[1] = 0x10;
535 cdb[2] = 0x00;
536 cdb[3] = 0x00; /* size HI */
537 cdb[4] = sizeof(port); /* size LO */
538 cdb[5] = 0x00;
539 cdb[6] = 0x72; /* register address HI */
540 cdb[7] = 0x0f; /* register address LO */
541 cdb[8] = 0x00;
542 cdb[9] = 0x00;
543 cdb[10] = 0x00;
544 cdb[11] = 0xfd;
545
546 memset(sense, 0, sizeof(sense));
547
548 if ((ret = sg_io(d->fd, SG_DXFER_FROM_DEV, cdb, sizeof(cdb), &port, sizeof(port), sense, sizeof(sense))) < 0)
549 return ret;
550
551 /* Port & 0x04 is port #0, Port & 0x40 is port #1 */
552 if (!(port & 0x44))
553 return -EIO;
554
555 cdb[0] = 0xdf; /* OPERATION CODE: 12 byte pass through */
556
557 if (command == SK_ATA_COMMAND_SMART && bytes[1] == SK_SMART_COMMAND_RETURN_STATUS) {
558 /* We need to rewrite the SMART status request */
559 is_smart_status = TRUE;
560 direction = SK_DIRECTION_IN;
561 data = &smart_status;
562 len = sizeof(smart_status);
563 cdb[1] = 0x10;
564 } else if (direction == SK_DIRECTION_NONE)
565 cdb[1] = 0x10;
566 else if (direction == SK_DIRECTION_IN)
567 cdb[1] = 0x10;
568 else if (direction == SK_DIRECTION_OUT)
569 cdb[1] = 0x00;
570
571 cdb[2] = 0x00;
572
573 cdb[3] = (uint8_t) (len >> 8);
574 cdb[4] = (uint8_t) (len & 0xFF);
575
576 cdb[5] = bytes[1]; /* FEATURES */
577 cdb[6] = bytes[3]; /* SECTORS */
578
579 cdb[7] = bytes[9]; /* LBA LOW */
580 cdb[8] = bytes[8]; /* LBA MID */
581 cdb[9] = bytes[7]; /* LBA HIGH */
582
583 cdb[10] = bytes[10] | ((port & 0x04) ? 0xA0 : 0xB0); /* SELECT */
584 cdb[11] = (uint8_t) command;
585
586 memset(sense, 0, sizeof(sense));
587
588 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len, sense, sizeof(sense))) < 0)
589 return ret;
590
591 memset(bytes, 0, 12);
592
593 if (is_smart_status) {
594 if (smart_status == 0x01 || smart_status == 0xc2) {
595 bytes[7] = 0xc2; /* LBA HIGH */
596 bytes[8] = 0x4f; /* LBA MID */
597 } else if (smart_status == 0x00 || smart_status == 0x2c) {
598 bytes[7] = 0x2c; /* LBA HIGH */
599 bytes[8] = 0xf4; /* LBA MID */
600 } else
601 return -EIO;
602 } else {
603 uint8_t regbuf[16];
604
605 cdb[0] = 0xdf; /* operation code */
606 cdb[1] = 0x10;
607 cdb[2] = 0x00;
608 cdb[3] = 0x00; /* size HI */
609 cdb[4] = sizeof(regbuf); /* size LO */
610 cdb[5] = 0x00;
611 cdb[6] = (port & 0x04) ? 0x80 : 0x90; /* register address HI */
612 cdb[7] = 0x00; /* register address LO */
613 cdb[8] = 0x00;
614 cdb[9] = 0x00;
615 cdb[10] = 0x00;
616 cdb[11] = 0xfd;
617
618 if ((ret = sg_io(d->fd, SG_DXFER_FROM_DEV, cdb, sizeof(cdb), regbuf, sizeof(regbuf), sense, sizeof(sense))) < 0)
619 return ret;
620
621 bytes[2] = regbuf[14]; /* STATUS */
622 bytes[3] = regbuf[0]; /* SECTORS */
623 bytes[9] = regbuf[6]; /* LBA LOW */
624 bytes[8] = regbuf[4]; /* LBA MID */
625 bytes[7] = regbuf[10]; /* LBA HIGH */
626 bytes[10] = regbuf[9]; /* SELECT */
627 bytes[11] = regbuf[13]; /* ERROR */
628 }
629
630 return ret;
631 }
632
633 static int disk_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
634
635 static int (* const disk_command_table[_SK_DISK_TYPE_MAX]) (SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) = {
636 [SK_DISK_TYPE_ATA] = disk_ata_command,
637 [SK_DISK_TYPE_ATA_PASSTHROUGH_12] = disk_passthrough_12_command,
638 [SK_DISK_TYPE_ATA_PASSTHROUGH_16] = disk_passthrough_16_command,
639 [SK_DISK_TYPE_SUNPLUS] = disk_sunplus_command,
640 [SK_DISK_TYPE_JMICRON] = disk_jmicron_command,
641 [SK_DISK_TYPE_BLOB] = NULL,
642 [SK_DISK_TYPE_UNKNOWN] = NULL
643 };
644
645 assert(d);
646 assert(d->type <= _SK_DISK_TYPE_MAX);
647 assert(direction <= _SK_DIRECTION_MAX);
648
649 assert(direction == SK_DIRECTION_NONE || (data && len && *len > 0));
650 assert(direction != SK_DIRECTION_NONE || (!data && !len));
651
652 if (!disk_command_table[d->type]) {
653 errno = -ENOTSUP;
654 return -1;
655 }
656
657 return disk_command_table[d->type](d, command, direction, cmd_data, data, len);
658 }
659
660 static int disk_identify_device(SkDisk *d) {
661 uint16_t cmd[6];
662 int ret;
663 size_t len = 512;
664 const uint8_t *p;
665
666 if (d->type == SK_DISK_TYPE_BLOB)
667 return 0;
668
669 memset(d->identify, 0, len);
670 memset(cmd, 0, sizeof(cmd));
671
672 cmd[1] = htons(1);
673
674 if ((ret = disk_command(d, SK_ATA_COMMAND_IDENTIFY_DEVICE, SK_DIRECTION_IN, cmd, d->identify, &len)) < 0)
675 return ret;
676
677 if (len != 512) {
678 errno = EIO;
679 return -1;
680 }
681
682 /* Check if IDENTIFY data is all NULs */
683 for (p = d->identify; p < (const uint8_t*) d->identify+len; p++)
684 if (*p) {
685 p = NULL;
686 break;
687 }
688
689 if (p) {
690 errno = EIO;
691 return -1;
692 }
693
694 d->identify_valid = TRUE;
695
696 return 0;
697 }
698
699 int sk_disk_check_sleep_mode(SkDisk *d, SkBool *awake) {
700 int ret;
701 uint16_t cmd[6];
702 uint8_t status;
703
704 if (!d->identify_valid) {
705 errno = ENOTSUP;
706 return -1;
707 }
708
709 if (d->type == SK_DISK_TYPE_BLOB) {
710 errno = ENOTSUP;
711 return -1;
712 }
713
714 memset(cmd, 0, sizeof(cmd));
715
716 if ((ret = disk_command(d, SK_ATA_COMMAND_CHECK_POWER_MODE, SK_DIRECTION_NONE, cmd, NULL, 0)) < 0)
717 return ret;
718
719 if (cmd[0] != 0 || (ntohs(cmd[5]) & 1) != 0) {
720 errno = EIO;
721 return -1;
722 }
723
724 status = ntohs(cmd[1]) & 0xFF;
725 *awake = status == 0xFF || status == 0x80; /* idle and active/idle is considered awake */
726
727 return 0;
728 }
729
730 static int disk_smart_enable(SkDisk *d, SkBool b) {
731 uint16_t cmd[6];
732
733 if (!disk_smart_is_available(d)) {
734 errno = ENOTSUP;
735 return -1;
736 }
737
738 if (d->type == SK_DISK_TYPE_BLOB) {
739 errno = ENOTSUP;
740 return -1;
741 }
742
743 memset(cmd, 0, sizeof(cmd));
744
745 cmd[0] = htons(b ? SK_SMART_COMMAND_ENABLE_OPERATIONS : SK_SMART_COMMAND_DISABLE_OPERATIONS);
746 cmd[2] = htons(0x0000U);
747 cmd[3] = htons(0x00C2U);
748 cmd[4] = htons(0x4F00U);
749
750 return disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_NONE, cmd, NULL, 0);
751 }
752
753 int sk_disk_smart_read_data(SkDisk *d) {
754 uint16_t cmd[6];
755 int ret;
756 size_t len = 512;
757
758 if (!disk_smart_is_available(d)) {
759 errno = ENOTSUP;
760 return -1;
761 }
762
763 if (d->type == SK_DISK_TYPE_BLOB)
764 return 0;
765
766 memset(cmd, 0, sizeof(cmd));
767
768 cmd[0] = htons(SK_SMART_COMMAND_READ_DATA);
769 cmd[1] = htons(1);
770 cmd[2] = htons(0x0000U);
771 cmd[3] = htons(0x00C2U);
772 cmd[4] = htons(0x4F00U);
773
774 if ((ret = disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_IN, cmd, d->smart_data, &len)) < 0)
775 return ret;
776
777 d->smart_data_valid = TRUE;
778
779 return ret;
780 }
781
782 static int disk_smart_read_thresholds(SkDisk *d) {
783 uint16_t cmd[6];
784 int ret;
785 size_t len = 512;
786
787 if (!disk_smart_is_available(d)) {
788 errno = ENOTSUP;
789 return -1;
790 }
791
792 if (d->type == SK_DISK_TYPE_BLOB)
793 return 0;
794
795 memset(cmd, 0, sizeof(cmd));
796
797 cmd[0] = htons(SK_SMART_COMMAND_READ_THRESHOLDS);
798 cmd[1] = htons(1);
799 cmd[2] = htons(0x0000U);
800 cmd[3] = htons(0x00C2U);
801 cmd[4] = htons(0x4F00U);
802
803 if ((ret = disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_IN, cmd, d->smart_thresholds, &len)) < 0)
804 return ret;
805
806 d->smart_thresholds_valid = TRUE;
807
808 return ret;
809 }
810
811 int sk_disk_smart_status(SkDisk *d, SkBool *good) {
812 uint16_t cmd[6];
813 int ret;
814
815 if (!disk_smart_is_available(d)) {
816 errno = ENOTSUP;
817 return -1;
818 }
819
820 if (d->type == SK_DISK_TYPE_BLOB) {
821
822 if (d->blob_smart_status_valid) {
823 *good = d->blob_smart_status;
824 return 0;
825 }
826
827 errno = ENXIO;
828 return -1;
829 }
830
831 memset(cmd, 0, sizeof(cmd));
832
833 cmd[0] = htons(SK_SMART_COMMAND_RETURN_STATUS);
834 cmd[1] = htons(0x0000U);
835 cmd[3] = htons(0x00C2U);
836 cmd[4] = htons(0x4F00U);
837
838 if ((ret = disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_NONE, cmd, NULL, 0)) < 0)
839 return ret;
840
841 /* SAT/USB bridges truncate packets, so we only check for 4F,
842 * not for 2C on those */
843 if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) &&
844 cmd[4] == htons(0x4F00U))
845 *good = TRUE;
846 else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) &&
847 cmd[4] == htons(0xF400U))
848 *good = FALSE;
849 else {
850 errno = EIO;
851 return -1;
852 }
853
854 return ret;
855 }
856
857 int sk_disk_smart_self_test(SkDisk *d, SkSmartSelfTest test) {
858 uint16_t cmd[6];
859 int ret;
860
861 if (!disk_smart_is_available(d)) {
862 errno = ENOTSUP;
863 return -1;
864 }
865
866 if (d->type == SK_DISK_TYPE_BLOB) {
867 errno = ENOTSUP;
868 return -1;
869 }
870
871 if (!d->smart_data_valid)
872 if ((ret = sk_disk_smart_read_data(d)) < 0)
873 return -1;
874
875 assert(d->smart_data_valid);
876
877 if (test != SK_SMART_SELF_TEST_SHORT &&
878 test != SK_SMART_SELF_TEST_EXTENDED &&
879 test != SK_SMART_SELF_TEST_CONVEYANCE &&
880 test != SK_SMART_SELF_TEST_ABORT) {
881 errno = EINVAL;
882 return -1;
883 }
884
885 if (!disk_smart_is_start_test_available(d)
886 || (test == SK_SMART_SELF_TEST_ABORT && !disk_smart_is_abort_test_available(d))
887 || ((test == SK_SMART_SELF_TEST_SHORT || test == SK_SMART_SELF_TEST_EXTENDED) && !disk_smart_is_short_and_extended_test_available(d))
888 || (test == SK_SMART_SELF_TEST_CONVEYANCE && !disk_smart_is_conveyance_test_available(d))) {
889 errno = ENOTSUP;
890 return -1;
891 }
892
893 if (test == SK_SMART_SELF_TEST_ABORT &&
894 !disk_smart_is_abort_test_available(d)) {
895 errno = ENOTSUP;
896 return -1;
897 }
898
899 memset(cmd, 0, sizeof(cmd));
900
901 cmd[0] = htons(SK_SMART_COMMAND_EXECUTE_OFFLINE_IMMEDIATE);
902 cmd[2] = htons(0x0000U);
903 cmd[3] = htons(0x00C2U);
904 cmd[4] = htons(0x4F00U | (uint16_t) test);
905
906 return disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_NONE, cmd, NULL, NULL);
907 }
908
909 static void swap_strings(char *s, size_t len) {
910 assert((len & 1) == 0);
911
912 for (; len > 0; s += 2, len -= 2) {
913 char t;
914 t = s[0];
915 s[0] = s[1];
916 s[1] = t;
917 }
918 }
919
920 static void clean_strings(char *s) {
921 char *e;
922
923 for (e = s; *e; e++)
924 if (*e < ' ' || *e >= 127)
925 *e = ' ';
926 }
927
928 static void drop_spaces(char *s) {
929 char *d = s;
930 SkBool prev_space = FALSE;
931
932 s += strspn(s, " ");
933
934 for (;*s; s++) {
935
936 if (prev_space) {
937 if (*s != ' ') {
938 prev_space = FALSE;
939 *(d++) = ' ';
940 *(d++) = *s;
941 }
942 } else {
943 if (*s == ' ')
944 prev_space = TRUE;
945 else
946 *(d++) = *s;
947 }
948 }
949
950 *d = 0;
951 }
952
953 static void read_string(char *d, uint8_t *s, size_t len) {
954 memcpy(d, s, len);
955 d[len] = 0;
956 swap_strings(d, len);
957 clean_strings(d);
958 drop_spaces(d);
959 }
960
961 int sk_disk_identify_parse(SkDisk *d, const SkIdentifyParsedData **ipd) {
962 assert(d);
963 assert(ipd);
964
965 if (!d->identify_valid) {
966 errno = ENOENT;
967 return -1;
968 }
969
970 read_string(d->identify_parsed_data.serial, d->identify+20, 20);
971 read_string(d->identify_parsed_data.firmware, d->identify+46, 8);
972 read_string(d->identify_parsed_data.model, d->identify+54, 40);
973
974 *ipd = &d->identify_parsed_data;
975
976 return 0;
977 }
978
979 int sk_disk_smart_is_available(SkDisk *d, SkBool *b) {
980 assert(d);
981 assert(b);
982
983 if (!d->identify_valid) {
984 errno = ENOTSUP;
985 return -1;
986 }
987
988 *b = disk_smart_is_available(d);
989 return 0;
990 }
991
992 int sk_disk_identify_is_available(SkDisk *d, SkBool *b) {
993 assert(d);
994 assert(b);
995
996 *b = d->identify_valid;
997 return 0;
998 }
999
1000 const char *sk_smart_offline_data_collection_status_to_string(SkSmartOfflineDataCollectionStatus status) {
1001
1002 /* %STRINGPOOLSTART% */
1003 static const char* const map[] = {
1004 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_NEVER] = "Off-line data collection activity was never started.",
1005 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUCCESS] = "Off-line data collection activity was completed without error.",
1006 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_INPROGRESS] = "Off-line activity in progress.",
1007 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUSPENDED] = "Off-line data collection activity was suspended by an interrupting command from host.",
1008 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_ABORTED] = "Off-line data collection activity was aborted by an interrupting command from host.",
1009 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL] = "Off-line data collection activity was aborted by the device with a fatal error.",
1010 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN] = "Unknown status"
1011 };
1012 /* %STRINGPOOLSTOP% */
1013
1014 if (status >= _SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_MAX)
1015 return NULL;
1016
1017 return _P(map[status]);
1018 }
1019
1020 const char *sk_smart_self_test_execution_status_to_string(SkSmartSelfTestExecutionStatus status) {
1021
1022 /* %STRINGPOOLSTART% */
1023 static const char* const map[] = {
1024 [SK_SMART_SELF_TEST_EXECUTION_STATUS_SUCCESS_OR_NEVER] = "The previous self-test routine completed without error or no self-test has ever been run.",
1025 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ABORTED] = "The self-test routine was aborted by the host.",
1026 [SK_SMART_SELF_TEST_EXECUTION_STATUS_INTERRUPTED] = "The self-test routine was interrupted by the host with a hardware or software reset.",
1027 [SK_SMART_SELF_TEST_EXECUTION_STATUS_FATAL] = "A fatal error or unknown test error occurred while the device was executing its self-test routine and the device was unable to complete the self-test routine.",
1028 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_UNKNOWN] = "The previous self-test completed having a test element that failed and the test element that failed.",
1029 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_ELECTRICAL] = "The previous self-test completed having the electrical element of the test failed.",
1030 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_SERVO] = "The previous self-test completed having the servo (and/or seek) test element of the test failed.",
1031 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_READ] = "The previous self-test completed having the read element of the test failed.",
1032 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_HANDLING] = "The previous self-test completed having a test element that failed and the device is suspected of having handling damage.",
1033 [SK_SMART_SELF_TEST_EXECUTION_STATUS_INPROGRESS] = "Self-test routine in progress"
1034 };
1035 /* %STRINGPOOLSTOP% */
1036
1037 if (status >= _SK_SMART_SELF_TEST_EXECUTION_STATUS_MAX)
1038 return NULL;
1039
1040 return _P(map[status]);
1041 }
1042
1043 const char* sk_smart_self_test_to_string(SkSmartSelfTest test) {
1044
1045 switch (test) {
1046 case SK_SMART_SELF_TEST_SHORT:
1047 return "short";
1048 case SK_SMART_SELF_TEST_EXTENDED:
1049 return "extended";
1050 case SK_SMART_SELF_TEST_CONVEYANCE:
1051 return "conveyance";
1052 case SK_SMART_SELF_TEST_ABORT:
1053 return "abort";
1054 }
1055
1056 return NULL;
1057 }
1058
1059 SkBool sk_smart_self_test_available(const SkSmartParsedData *d, SkSmartSelfTest test) {
1060 assert(d);
1061
1062 if (!d->start_test_available)
1063 return FALSE;
1064
1065 switch (test) {
1066 case SK_SMART_SELF_TEST_SHORT:
1067 case SK_SMART_SELF_TEST_EXTENDED:
1068 return d->short_and_extended_test_available;
1069 case SK_SMART_SELF_TEST_CONVEYANCE:
1070 return d->conveyance_test_available;
1071 case SK_SMART_SELF_TEST_ABORT:
1072 return d->abort_test_available;
1073 default:
1074 return FALSE;
1075 }
1076 }
1077
1078 unsigned sk_smart_self_test_polling_minutes(const SkSmartParsedData *d, SkSmartSelfTest test) {
1079 assert(d);
1080
1081 if (!sk_smart_self_test_available(d, test))
1082 return 0;
1083
1084 switch (test) {
1085 case SK_SMART_SELF_TEST_SHORT:
1086 return d->short_test_polling_minutes;
1087 case SK_SMART_SELF_TEST_EXTENDED:
1088 return d->extended_test_polling_minutes;
1089 case SK_SMART_SELF_TEST_CONVEYANCE:
1090 return d->conveyance_test_polling_minutes;
1091 default:
1092 return 0;
1093 }
1094 }
1095
1096 static void make_pretty(SkSmartAttributeParsedData *a) {
1097 uint64_t fourtyeight;
1098
1099 if (!a->name)
1100 return;
1101
1102 if (a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_UNKNOWN)
1103 return;
1104
1105 fourtyeight =
1106 ((uint64_t) a->raw[0]) |
1107 (((uint64_t) a->raw[1]) << 8) |
1108 (((uint64_t) a->raw[2]) << 16) |
1109 (((uint64_t) a->raw[3]) << 24) |
1110 (((uint64_t) a->raw[4]) << 32) |
1111 (((uint64_t) a->raw[5]) << 40);
1112
1113 if (!strcmp(a->name, "spin-up-time"))
1114 a->pretty_value = fourtyeight & 0xFFFF;
1115 else if (!strcmp(a->name, "airflow-temperature-celsius") ||
1116 !strcmp(a->name, "temperature-celsius") ||
1117 !strcmp(a->name, "temperature-celsius-2"))
1118 a->pretty_value = (fourtyeight & 0xFFFF)*1000 + 273150;
1119 else if (!strcmp(a->name, "temperature-centi-celsius"))
1120 a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150;
1121 else if (!strcmp(a->name, "power-on-minutes"))
1122 a->pretty_value = (((uint64_t) a->raw[0]) | (uint64_t) a->raw[1]) * 60 * 1000;
1123 else if (!strcmp(a->name, "power-on-seconds"))
1124 a->pretty_value = fourtyeight * 1000;
1125 else if (!strcmp(a->name, "power-on-half-minutes"))
1126 a->pretty_value = fourtyeight * 30 * 1000;
1127 else if (!strcmp(a->name, "power-on-hours") ||
1128 !strcmp(a->name, "loaded-hours") ||
1129 !strcmp(a->name, "head-flying-hours"))
1130 a->pretty_value = fourtyeight * 60 * 60 * 1000;
1131 else if (!strcmp(a->name, "reallocated-sector-count"))
1132 a->pretty_value = fourtyeight & 0xFFFFFFFFU;
1133 else
1134 a->pretty_value = fourtyeight;
1135 }
1136
1137 typedef struct SkSmartAttributeInfo {
1138 const char *name;
1139 SkSmartAttributeUnit unit;
1140 } SkSmartAttributeInfo;
1141
1142 /* This data is stolen from smartmontools */
1143
1144 /* %STRINGPOOLSTART% */
1145 static const SkSmartAttributeInfo const attribute_info[256] = {
1146 [1] = { "raw-read-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
1147 [2] = { "throughput-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1148 [3] = { "spin-up-time", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1149 [4] = { "start-stop-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1150 [5] = { "reallocated-sector-count", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1151 [6] = { "read-channel-margin", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1152 [7] = { "seek-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
1153 [8] = { "seek-time-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1154 [9] = { "power-on-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1155 [10] = { "spin-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1156 [11] = { "calibration-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1157 [12] = { "power-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1158 [13] = { "read-soft-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
1159 [187] = { "reported-uncorrect", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1160 [189] = { "high-fly-writes", SK_SMART_ATTRIBUTE_UNIT_NONE },
1161 [190] = { "airflow-temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
1162 [191] = { "g-sense-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
1163 [192] = { "power-off-retract-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1164 [193] = { "load-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1165 [194] = { "temperature-celsius-2", SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
1166 [195] = { "hardware-ecc-recovered", SK_SMART_ATTRIBUTE_UNIT_NONE },
1167 [196] = { "reallocated-event-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1168 [197] = { "current-pending-sector", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1169 [198] = { "offline-uncorrectable", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1170 [199] = { "udma-crc-error-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1171 [200] = { "multi-zone-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
1172 [201] = { "soft-read-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
1173 [202] = { "ta-increase-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1174 [203] = { "run-out-cancel", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1175 [204] = { "shock-count-write-open", SK_SMART_ATTRIBUTE_UNIT_NONE },
1176 [205] = { "shock-rate-write-open", SK_SMART_ATTRIBUTE_UNIT_NONE },
1177 [206] = { "flying-height", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1178 [207] = { "spin-high-current", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1179 [208] = { "spin-buzz", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN},
1180 [209] = { "offline-seek-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1181 [220] = { "disk-shift", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1182 [221] = { "g-sense-error-rate-2", SK_SMART_ATTRIBUTE_UNIT_NONE },
1183 [222] = { "loaded-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1184 [223] = { "load-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1185 [224] = { "load-friction", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1186 [225] = { "load-cycle-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE },
1187 [226] = { "load-in-time", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1188 [227] = { "torq-amp-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
1189 [228] = { "power-off-retract-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE },
1190 [230] = { "head-amplitude", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1191 [231] = { "temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
1192 [240] = { "head-flying-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1193 [250] = { "read-error-retry-rate", SK_SMART_ATTRIBUTE_UNIT_NONE }
1194 };
1195 /* %STRINGPOOLSTOP% */
1196
1197 typedef enum SkSmartQuirk {
1198 SK_SMART_QUIRK_9_POWERONMINUTES = 1,
1199 SK_SMART_QUIRK_9_POWERONSECONDS = 2,
1200 SK_SMART_QUIRK_9_POWERONHALFMINUTES = 4,
1201 SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT = 8,
1202 SK_SMART_QUIRK_193_LOADUNLOAD = 16,
1203 SK_SMART_QUIRK_194_10XCELSIUS = 32,
1204 SK_SMART_QUIRK_194_UNKNOWN = 64,
1205 SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128,
1206 SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256,
1207 SK_SMART_QUIRK_9_UNKNOWN = 512
1208 } SkSmartQuirk;
1209
1210 /* %STRINGPOOLSTART% */
1211 static const char *quirk_name[] = {
1212 "9_POWERONMINUTES",
1213 "9_POWERONSECONDS",
1214 "9_POWERONHALFMINUTES",
1215 "192_EMERGENCYRETRACTCYCLECT",
1216 "193_LOADUNLOAD",
1217 "194_10XCELSIUS",
1218 "194_UNKNOWN",
1219 "200_WRITEERRORCOUNT",
1220 "201_DETECTEDTACOUNT",
1221 "9_UNKNOWN",
1222 NULL
1223 };
1224 /* %STRINGPOOLSTOP% */
1225
1226 typedef struct SkSmartQuirkDatabase {
1227 const char *model;
1228 const char *firmware;
1229 SkSmartQuirk quirk;
1230 } SkSmartQuirkDatabase;
1231
1232 static const SkSmartQuirkDatabase quirk_database[] = { {
1233
1234 /*** Seagate */
1235 "^ST9160821AS$",
1236 NULL,
1237 SK_SMART_QUIRK_9_UNKNOWN
1238 }, {
1239
1240 /*** Fujitsu */
1241 "^FUJITSU MHR2040AT$",
1242 NULL,
1243 SK_SMART_QUIRK_9_POWERONSECONDS|
1244 SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT|
1245 SK_SMART_QUIRK_200_WRITEERRORCOUNT
1246 }, {
1247 "^FUJITSU MHS20[6432]0AT( .)?$",
1248 NULL,
1249 SK_SMART_QUIRK_9_POWERONSECONDS|
1250 SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT|
1251 SK_SMART_QUIRK_200_WRITEERRORCOUNT|
1252 SK_SMART_QUIRK_201_DETECTEDTACOUNT
1253 }, {
1254 "^("
1255 "FUJITSU M1623TAU|"
1256 "FUJITSU MHG2...ATU?.*|"
1257 "FUJITSU MHH2...ATU?.*|"
1258 "FUJITSU MHJ2...ATU?.*|"
1259 "FUJITSU MHK2...ATU?.*|"
1260 "FUJITSU MHL2300AT|"
1261 "FUJITSU MHM2(20|15|10|06)0AT|"
1262 "FUJITSU MHN2...AT|"
1263 "FUJITSU MHR2020AT|"
1264 "FUJITSU MHT2...(AH|AS|AT|BH)U?.*|"
1265 "FUJITSU MHU2...ATU?.*|"
1266 "FUJITSU MHV2...(AH|AS|AT|BH|BS|BT).*|"
1267 "FUJITSU MP[A-G]3...A[HTEV]U?.*"
1268 ")$",
1269 NULL,
1270 SK_SMART_QUIRK_9_POWERONSECONDS
1271 }, {
1272
1273 /*** Samsung ***/
1274 "^("
1275 "SAMSUNG SV4012H|"
1276 "SAMSUNG SP(0451|08[0124]2|12[0145]3|16[0145]4)[CN]"
1277 ")$",
1278 NULL,
1279 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1280 }, {
1281 "^("
1282 "SAMSUNG SV0412H|"
1283 "SAMSUNG SV1204H"
1284 ")$",
1285 NULL,
1286 SK_SMART_QUIRK_9_POWERONHALFMINUTES|
1287 SK_SMART_QUIRK_194_10XCELSIUS
1288 }, {
1289 "^SAMSUNG SP40A2H$",
1290 "^RR100-07$",
1291 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1292 }, {
1293 "^SAMSUNG SP80A4H$",
1294 "^RT100-06$",
1295 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1296 }, {
1297 "^SAMSUNG SP8004H$",
1298 "^QW100-61$",
1299 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1300 }, {
1301
1302 /*** Maxtor */
1303 "^("
1304 "Maxtor 2B0(0[468]|1[05]|20)H1|"
1305 "Maxtor 4G(120J6|160J[68])|"
1306 "Maxtor 4D0(20H1|40H2|60H3|80H4)"
1307 ")$",
1308 NULL,
1309 SK_SMART_QUIRK_9_POWERONMINUTES|
1310 SK_SMART_QUIRK_194_UNKNOWN
1311 }, {
1312 "^("
1313 "Maxtor 2F0[234]0[JL]0|"
1314 "Maxtor 8(1280A2|2160A4|2560A4|3840A6|4000A6|5120A8)|"
1315 "Maxtor 8(2160D2|3228D3|3240D3|4320D4|6480D6|8400D8|8455D8)|"
1316 "Maxtor 9(0510D4|0576D4|0648D5|0720D5|0840D6|0845D6|0864D6|1008D7|1080D8|1152D8)|"
1317 "Maxtor 9(1(360|350|202)D8|1190D7|10[12]0D6|0840D5|06[48]0D4|0510D3|1(350|202)E8|1010E6|0840E5|0640E4)|"
1318 "Maxtor 9(0512D2|0680D3|0750D3|0913D4|1024D4|1360D6|1536D6|1792D7|2048D8)|"
1319 "Maxtor 9(2732U8|2390U7|204[09]U6|1707U5|1366U4|1024U3|0845U3|0683U2)|"
1320 "Maxtor 4(R0[68]0[JL]0|R1[26]0L0|A160J0|R120L4)|"
1321 "Maxtor (91728D8|91512D7|91303D6|91080D5|90845D4|90645D3|90648D[34]|90432D2)|"
1322 "Maxtor 9(0431U1|0641U2|0871U2|1301U3|1741U4)|"
1323 "Maxtor (94091U8|93071U6|92561U5|92041U4|91731U4|91531U3|91361U3|91021U2|90841U2|90651U2)|"
1324 "Maxtor (33073U4|32049U3|31536U2|30768U1|33073H4|32305H3|31536H2|30768H1)|"
1325 "Maxtor (93652U8|92739U6|91826U4|91369U3|90913U2|90845U2|90435U1)|"
1326 "Maxtor 9(0684U2|1024U2|1362U3|1536U3|2049U4|2562U5|3073U6|4098U8)|"
1327 "Maxtor (54098[UH]8|53073[UH]6|52732[UH]6|52049[UH]4|51536[UH]3|51369[UH]3|51024[UH]2)|"
1328 "Maxtor 3(1024H1|1535H2|2049H2|3073H3|4098H4)( B)?|"
1329 "Maxtor 5(4610H6|4098H6|3073H4|2049H3|1536H2|1369H2|1023H2)|"
1330 "Maxtor 9(1023U2|1536U2|2049U3|2305U3|3073U4|4610U6|6147U8)|"
1331 "Maxtor 9(1023H2|1536H2|2049H3|2305H3|3073H4|4098H6|4610H6|6147H8)|"
1332 "Maxtor 5T0(60H6|40H4|30H3|20H2|10H1)|"
1333 "Maxtor (98196H8|96147H6)|"
1334 "Maxtor 4W(100H6|080H6|060H4|040H3|030H2)|"
1335 "Maxtor 6(E0[234]|K04)0L0|"
1336 "Maxtor 6(B(30|25|20|16|12|10|08)0[MPRS]|L(080[MLP]|(100|120)[MP]|160[MP]|200[MPRS]|250[RS]|300[RS]))0|"
1337 "Maxtor 6Y((060|080|120|160)L0|(060|080|120|160|200|250)P0|(060|080|120|160|200|250)M0)|"
1338 "Maxtor 7Y250[PM]0|"
1339 "Maxtor [45]A(25|30|32)0[JN]0|"
1340 "Maxtor 7L(25|30)0[SR]0"
1341 ")$",
1342 NULL,
1343 SK_SMART_QUIRK_9_POWERONMINUTES
1344 }, {
1345
1346
1347 /*** Hitachi */
1348 "^("
1349 "HITACHI_DK14FA-20B|"
1350 "HITACHI_DK23..-..B?|"
1351 "HITACHI_DK23FA-20J|HTA422020F9AT[JN]0|"
1352 "HE[JN]4230[23]0F9AT00|"
1353 "HTC4260[23]0G5CE00|HTC4260[56]0G8CE00"
1354 ")$",
1355 NULL,
1356 SK_SMART_QUIRK_9_POWERONMINUTES|
1357 SK_SMART_QUIRK_193_LOADUNLOAD
1358 }, {
1359
1360 NULL,
1361 NULL,
1362 0
1363 }
1364 };
1365
1366 static int match(const char*regex, const char *s, SkBool *result) {
1367 int k;
1368 regex_t re;
1369
1370 *result = FALSE;
1371
1372 if (regcomp(&re, regex, REG_EXTENDED|REG_NOSUB) != 0) {
1373 errno = EINVAL;
1374 return -1;
1375 }
1376
1377 if ((k = regexec(&re, s, 0, NULL, 0)) != 0) {
1378
1379 if (k != REG_NOMATCH) {
1380 regfree(&re);
1381 errno = EINVAL;
1382 return -1;
1383 }
1384
1385 } else
1386 *result = TRUE;
1387
1388 regfree(&re);
1389
1390 return 0;
1391 }
1392
1393 static int lookup_quirks(const char *model, const char *firmware, SkSmartQuirk *quirk) {
1394 int k;
1395 const SkSmartQuirkDatabase *db;
1396
1397 *quirk = 0;
1398
1399 for (db = quirk_database; db->model || db->firmware; db++) {
1400
1401 if (db->model) {
1402 SkBool matching = FALSE;
1403
1404 if ((k = match(db->model, model, &matching)) < 0)
1405 return k;
1406
1407 if (!matching)
1408 continue;
1409 }
1410
1411 if (db->firmware) {
1412 SkBool matching = FALSE;
1413
1414 if ((k = match(db->firmware, firmware, &matching)) < 0)
1415 return k;
1416
1417 if (!matching)
1418 continue;
1419 }
1420
1421 *quirk = db->quirk;
1422 return 0;
1423 }
1424
1425 return 0;
1426 }
1427
1428 static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) {
1429 const SkIdentifyParsedData *ipd;
1430 SkSmartQuirk quirk = 0;
1431
1432 /* These are the complex ones */
1433 if (sk_disk_identify_parse(d, &ipd) < 0)
1434 return NULL;
1435
1436 if (lookup_quirks(ipd->model, ipd->firmware, &quirk) < 0)
1437 return NULL;
1438
1439 if (quirk) {
1440 switch (id) {
1441
1442 case 9:
1443 /* %STRINGPOOLSTART% */
1444 if (quirk & SK_SMART_QUIRK_9_POWERONMINUTES) {
1445 static const SkSmartAttributeInfo a = {
1446 "power-on-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
1447 };
1448 return &a;
1449
1450 } else if (quirk & SK_SMART_QUIRK_9_POWERONSECONDS) {
1451 static const SkSmartAttributeInfo a = {
1452 "power-on-seconds", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
1453 };
1454 return &a;
1455
1456 } else if (quirk & SK_SMART_QUIRK_9_POWERONHALFMINUTES) {
1457 static const SkSmartAttributeInfo a = {
1458 "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
1459 };
1460 return &a;
1461 } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
1462 return NULL;
1463 /* %STRINGPOOLSTOP% */
1464
1465 break;
1466
1467 case 192:
1468 /* %STRINGPOOLSTART% */
1469 if (quirk & SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT) {
1470 static const SkSmartAttributeInfo a = {
1471 "emergency-retract-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE
1472 };
1473 return &a;
1474 }
1475 /* %STRINGPOOLSTOP% */
1476
1477 break;
1478
1479 case 194:
1480 /* %STRINGPOOLSTART% */
1481 if (quirk & SK_SMART_QUIRK_194_10XCELSIUS) {
1482 static const SkSmartAttributeInfo a = {
1483 "temperature-centi-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN
1484 };
1485 return &a;
1486 } else if (quirk & SK_SMART_QUIRK_194_UNKNOWN)
1487 return NULL;
1488 /* %STRINGPOOLSTOP% */
1489
1490 break;
1491
1492 case 200:
1493 /* %STRINGPOOLSTART% */
1494 if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) {
1495 static const SkSmartAttributeInfo a = {
1496 "write-error-count", SK_SMART_ATTRIBUTE_UNIT_NONE
1497 };
1498 return &a;
1499 }
1500 /* %STRINGPOOLSTOP% */
1501
1502 break;
1503
1504 case 201:
1505 /* %STRINGPOOLSTART% */
1506 if (quirk & SK_SMART_QUIRK_201_DETECTEDTACOUNT) {
1507 static const SkSmartAttributeInfo a = {
1508 "detected-ta-count", SK_SMART_ATTRIBUTE_UNIT_NONE
1509 };
1510 return &a;
1511 }
1512 /* %STRINGPOOLSTOP% */
1513
1514 break;
1515 }
1516 }
1517
1518 /* These are the simple cases */
1519 if (attribute_info[id].name)
1520 return &attribute_info[id];
1521
1522 return NULL;
1523 }
1524
1525 int sk_disk_smart_parse(SkDisk *d, const SkSmartParsedData **spd) {
1526
1527 if (!d->smart_data_valid) {
1528 errno = ENOENT;
1529 return -1;
1530 }
1531
1532 switch (d->smart_data[362]) {
1533 case 0x00:
1534 case 0x80:
1535 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_NEVER;
1536 break;
1537
1538 case 0x02:
1539 case 0x82:
1540 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUCCESS;
1541 break;
1542
1543 case 0x03:
1544 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_INPROGRESS;
1545 break;
1546
1547 case 0x04:
1548 case 0x84:
1549 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUSPENDED;
1550 break;
1551
1552 case 0x05:
1553 case 0x85:
1554 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_ABORTED;
1555 break;
1556
1557 case 0x06:
1558 case 0x86:
1559 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL;
1560 break;
1561
1562 default:
1563 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN;
1564 break;
1565 }
1566
1567 d->smart_parsed_data.self_test_execution_percent_remaining = 10*(d->smart_data[363] & 0xF);
1568 d->smart_parsed_data.self_test_execution_status = (d->smart_data[363] >> 4) & 0xF;
1569
1570 d->smart_parsed_data.total_offline_data_collection_seconds = (uint16_t) d->smart_data[364] | ((uint16_t) d->smart_data[365] << 8);
1571
1572 d->smart_parsed_data.conveyance_test_available = disk_smart_is_conveyance_test_available(d);
1573 d->smart_parsed_data.short_and_extended_test_available = disk_smart_is_short_and_extended_test_available(d);
1574 d->smart_parsed_data.start_test_available = disk_smart_is_start_test_available(d);
1575 d->smart_parsed_data.abort_test_available = disk_smart_is_abort_test_available(d);
1576
1577 d->smart_parsed_data.short_test_polling_minutes = d->smart_data[372];
1578 d->smart_parsed_data.extended_test_polling_minutes = d->smart_data[373] != 0xFF ? d->smart_data[373] : ((uint16_t) d->smart_data[376] << 8 | (uint16_t) d->smart_data[375]);
1579 d->smart_parsed_data.conveyance_test_polling_minutes = d->smart_data[374];
1580
1581 *spd = &d->smart_parsed_data;
1582
1583 return 0;
1584 }
1585
1586 static void find_threshold(SkDisk *d, SkSmartAttributeParsedData *a) {
1587 uint8_t *p;
1588 unsigned n;
1589
1590 if (!d->smart_thresholds_valid) {
1591 a->threshold_valid = FALSE;
1592 return;
1593 }
1594
1595 for (n = 0, p = d->smart_thresholds+2; n < 30; n++, p+=12)
1596 if (p[0] == a->id)
1597 break;
1598
1599 if (n >= 30) {
1600 a->threshold_valid = FALSE;
1601 a->good_valid = FALSE;
1602 return;
1603 }
1604
1605 a->threshold = p[1];
1606 a->threshold_valid = p[1] != 0xFE;
1607
1608 a->good_valid = FALSE;
1609 a->good = TRUE;
1610
1611 /* Always-Fail and Always-Passing thresholds are not relevant
1612 * for our assessment. */
1613 if (p[1] >= 1 && p[1] <= 0xFD) {
1614
1615 if (a->worst_value_valid) {
1616 a->good = a->good && (a->worst_value > a->threshold);
1617 a->good_valid = TRUE;
1618 }
1619
1620 if (a->current_value_valid) {
1621 a->good = a->good && (a->current_value > a->threshold);
1622 a->good_valid = TRUE;
1623 }
1624 }
1625 }
1626
1627 int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb, void* userdata) {
1628 uint8_t *p;
1629 unsigned n;
1630
1631 if (!d->smart_data_valid) {
1632 errno = ENOENT;
1633 return -1;
1634 }
1635
1636 for (n = 0, p = d->smart_data + 2; n < 30; n++, p+=12) {
1637 SkSmartAttributeParsedData a;
1638 const SkSmartAttributeInfo *i;
1639 char *an = NULL;
1640
1641 if (p[0] == 0)
1642 continue;
1643
1644 memset(&a, 0, sizeof(a));
1645 a.id = p[0];
1646 a.current_value = p[3];
1647 a.current_value_valid = p[3] >= 1 && p[3] <= 0xFD;
1648 a.worst_value = p[4];
1649 a.worst_value_valid = p[4] >= 1 && p[4] <= 0xFD;
1650
1651 a.flags = ((uint16_t) p[2] << 8) | p[1];
1652 a.prefailure = !!(p[1] & 1);
1653 a.online = !!(p[1] & 2);
1654
1655 memcpy(a.raw, p+5, 6);
1656
1657 if ((i = lookup_attribute(d, p[0]))) {
1658 a.name = _P(i->name);
1659 a.pretty_unit = i->unit;
1660 } else {
1661 if (asprintf(&an, "attribute-%u", a.id) < 0) {
1662 errno = ENOMEM;
1663 return -1;
1664 }
1665
1666 a.name = an;
1667 a.pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
1668 }
1669
1670 make_pretty(&a);
1671
1672 find_threshold(d, &a);
1673
1674 /* Handle a few fields specially */
1675 if ((!strcmp(a.name, "reallocated-sector-count") ||
1676 !strcmp(a.name, "current-pending-sector")) &&
1677 a.pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS &&
1678 a.pretty_value > 0) {
1679 a.good = FALSE;
1680 a.good_valid = TRUE;
1681 }
1682
1683 cb(d, &a, userdata);
1684 free(an);
1685 }
1686
1687 return 0;
1688 }
1689
1690 static const char *yes_no(SkBool b) {
1691 return b ? "yes" : "no";
1692 }
1693
1694 const char* sk_smart_attribute_unit_to_string(SkSmartAttributeUnit unit) {
1695
1696 /* %STRINGPOOLSTART% */
1697 const char * const map[] = {
1698 [SK_SMART_ATTRIBUTE_UNIT_UNKNOWN] = NULL,
1699 [SK_SMART_ATTRIBUTE_UNIT_NONE] = "",
1700 [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = "ms",
1701 [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = "sectors",
1702 [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = "mK"
1703 };
1704 /* %STRINGPOOLSTOP% */
1705
1706 if (unit >= _SK_SMART_ATTRIBUTE_UNIT_MAX)
1707 return NULL;
1708
1709 return _P(map[unit]);
1710 }
1711
1712 struct attr_helper {
1713 uint64_t *value;
1714 SkBool found;
1715 };
1716
1717 static void temperature_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1718
1719 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_MKELVIN)
1720 return;
1721
1722 if (!strcmp(a->name, "temperature-centi-celsius") ||
1723 !strcmp(a->name, "temperature-celsius") ||
1724 !strcmp(a->name, "temperature-celsius-2") ||
1725 !strcmp(a->name, "airflow-temperature-celsius")) {
1726
1727 if (!ah->found || a->pretty_value > *ah->value)
1728 *ah->value = a->pretty_value;
1729
1730 ah->found = TRUE;
1731 }
1732 }
1733
1734 int sk_disk_smart_get_temperature(SkDisk *d, uint64_t *kelvin) {
1735 struct attr_helper ah;
1736
1737 assert(d);
1738 assert(kelvin);
1739
1740 ah.found = FALSE;
1741 ah.value = kelvin;
1742
1743 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) temperature_cb, &ah) < 0)
1744 return -1;
1745
1746 if (!ah.found) {
1747 errno = ENOENT;
1748 return -1;
1749 }
1750
1751 return 0;
1752 }
1753
1754 static void power_on_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1755
1756 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_MSECONDS)
1757 return;
1758
1759 if (!strcmp(a->name, "power-on-minutes") ||
1760 !strcmp(a->name, "power-on-seconds") ||
1761 !strcmp(a->name, "power-on-half-minutes") ||
1762 !strcmp(a->name, "power-on-hours")) {
1763
1764 if (!ah->found || a->pretty_value > *ah->value)
1765 *ah->value = a->pretty_value;
1766
1767 ah->found = TRUE;
1768 }
1769 }
1770
1771 int sk_disk_smart_get_power_on(SkDisk *d, uint64_t *mseconds) {
1772 struct attr_helper ah;
1773
1774 assert(d);
1775 assert(mseconds);
1776
1777 ah.found = FALSE;
1778 ah.value = mseconds;
1779
1780 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) power_on_cb, &ah) < 0)
1781 return -1;
1782
1783 if (!ah.found) {
1784 errno = ENOENT;
1785 return -1;
1786 }
1787
1788 return 0;
1789 }
1790
1791 static void power_cycle_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1792
1793 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_NONE)
1794 return;
1795
1796 if (!strcmp(a->name, "power-cycle-count")) {
1797
1798 if (!ah->found || a->pretty_value > *ah->value)
1799 *ah->value = a->pretty_value;
1800
1801 ah->found = TRUE;
1802 }
1803 }
1804
1805 int sk_disk_smart_get_power_cycle(SkDisk *d, uint64_t *count) {
1806 struct attr_helper ah;
1807
1808 assert(d);
1809 assert(count);
1810
1811 ah.found = FALSE;
1812 ah.value = count;
1813
1814 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) power_cycle_cb, &ah) < 0)
1815 return -1;
1816
1817 if (!ah.found) {
1818 errno = ENOENT;
1819 return -1;
1820 }
1821
1822 return 0;
1823 }
1824
1825 static void reallocated_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1826
1827 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_SECTORS)
1828 return;
1829
1830 if (!strcmp(a->name, "reallocated-sector-count")) {
1831
1832 if (!ah->found || a->pretty_value > *ah->value)
1833 *ah->value = a->pretty_value;
1834
1835 ah->found = TRUE;
1836 }
1837 }
1838
1839 static void pending_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1840
1841 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_SECTORS)
1842 return;
1843
1844 if (!strcmp(a->name, "current-pending-sector")) {
1845
1846 if (!ah->found || a->pretty_value > *ah->value)
1847 *ah->value = a->pretty_value;
1848
1849 ah->found = TRUE;
1850 }
1851 }
1852
1853 int sk_disk_smart_get_bad(SkDisk *d, uint64_t *sectors) {
1854 struct attr_helper ah1, ah2;
1855 uint64_t sectors1, sectors2;
1856
1857 assert(d);
1858 assert(sectors);
1859
1860 ah1.found = FALSE;
1861 ah1.value = &sectors1;
1862
1863 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) reallocated_cb, &ah1) < 0)
1864 return -1;
1865
1866 ah2.found = FALSE;
1867 ah2.value = &sectors2;
1868
1869 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) pending_cb, &ah2) < 0)
1870 return -1;
1871
1872 if (!ah1.found && !ah2.found) {
1873 errno = ENOENT;
1874 return -1;
1875 }
1876
1877 if (ah1.found && ah2.found)
1878 *sectors = sectors1 + sectors2;
1879 else if (ah1.found)
1880 *sectors = sectors1;
1881 else
1882 *sectors = sectors2;
1883
1884 return 0;
1885 }
1886
1887 const char* sk_smart_overall_to_string(SkSmartOverall overall) {
1888
1889 /* %STRINGPOOLSTART% */
1890 const char * const map[] = {
1891 [SK_SMART_OVERALL_GOOD] = "GOOD",
1892 [SK_SMART_OVERALL_BAD_STATUS] = "BAD_STATUS",
1893 [SK_SMART_OVERALL_BAD_ATTRIBUTE] = "BAD_ATTRIBUTE",
1894 [SK_SMART_OVERALL_BAD_SECTOR] = "BAD_SECTOR"
1895 };
1896 /* %STRINGPOOLSTOP% */
1897
1898 if (overall >= _SK_SMART_OVERALL_MAX)
1899 return NULL;
1900
1901 return _P(map[overall]);
1902 }
1903
1904 static void bad_attribute_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
1905 if (a->prefailure && a->good_valid && !a->good)
1906 *good = FALSE;
1907 }
1908
1909 int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall) {
1910 SkBool good;
1911 uint64_t sectors;
1912
1913 assert(d);
1914 assert(overall);
1915
1916 if (sk_disk_smart_status(d, &good) < 0)
1917 return -1;
1918
1919 if (!good) {
1920 *overall = SK_SMART_OVERALL_BAD_STATUS;
1921 return 0;
1922 }
1923
1924 if (sk_disk_smart_get_bad(d, &sectors) < 0) {
1925 if (errno != ENOENT)
1926 return -1;
1927 } else if (sectors > 0) {
1928 *overall = SK_SMART_OVERALL_BAD_SECTOR;
1929 return 0;
1930 }
1931
1932 good = TRUE;
1933 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_cb, &good) < 0)
1934 return -1;
1935
1936 if (!good) {
1937 *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE;
1938 return 0;
1939 }
1940
1941 *overall = SK_SMART_OVERALL_GOOD;
1942 return 0;
1943 }
1944
1945 static char* print_name(char *s, size_t len, uint8_t id, const char *k) {
1946
1947 if (k)
1948 strncpy(s, k, len);
1949 else
1950 snprintf(s, len, "%u", id);
1951
1952 s[len-1] = 0;
1953
1954 return s;
1955 }
1956
1957 static char *print_value(char *s, size_t len, uint64_t pretty_value, SkSmartAttributeUnit pretty_unit) {
1958
1959 switch (pretty_unit) {
1960 case SK_SMART_ATTRIBUTE_UNIT_MSECONDS:
1961
1962 if (pretty_value >= 1000LLU*60LLU*60LLU*24LLU*365LLU)
1963 snprintf(s, len, "%0.1f years", ((double) pretty_value)/(1000.0*60*60*24*365));
1964 else if (pretty_value >= 1000LLU*60LLU*60LLU*24LLU*30LLU)
1965 snprintf(s, len, "%0.1f months", ((double) pretty_value)/(1000.0*60*60*24*30));
1966 else if (pretty_value >= 1000LLU*60LLU*60LLU*24LLU)
1967 snprintf(s, len, "%0.1f days", ((double) pretty_value)/(1000.0*60*60*24));
1968 else if (pretty_value >= 1000LLU*60LLU*60LLU)
1969 snprintf(s, len, "%0.1f h", ((double) pretty_value)/(1000.0*60*60));
1970 else if (pretty_value >= 1000LLU*60LLU)
1971 snprintf(s, len, "%0.1f min", ((double) pretty_value)/(1000.0*60));
1972 else if (pretty_value >= 1000LLU)
1973 snprintf(s, len, "%0.1f s", ((double) pretty_value)/(1000.0));
1974 else
1975 snprintf(s, len, "%llu ms", (unsigned long long) pretty_value);
1976
1977 break;
1978
1979 case SK_SMART_ATTRIBUTE_UNIT_MKELVIN:
1980 snprintf(s, len, "%0.1f C", ((double) pretty_value - 273150) / 1000);
1981 break;
1982
1983 case SK_SMART_ATTRIBUTE_UNIT_SECTORS:
1984 snprintf(s, len, "%llu sectors", (unsigned long long) pretty_value);
1985 break;
1986
1987 case SK_SMART_ATTRIBUTE_UNIT_NONE:
1988 snprintf(s, len, "%llu", (unsigned long long) pretty_value);
1989 break;
1990
1991 case SK_SMART_ATTRIBUTE_UNIT_UNKNOWN:
1992 snprintf(s, len, "n/a");
1993 break;
1994
1995 case _SK_SMART_ATTRIBUTE_UNIT_MAX:
1996 assert(FALSE);
1997 }
1998
1999 s[len-1] = 0;
2000
2001 return s;
2002 }
2003
2004 #define HIGHLIGHT "\x1B[1m"
2005 #define ENDHIGHLIGHT "\x1B[0m"
2006
2007 static void disk_dump_attributes(SkDisk *d, const SkSmartAttributeParsedData *a, void* userdata) {
2008 char name[32];
2009 char pretty[32];
2010 char tt[32], tw[32], tc[32];
2011 SkBool highlight;
2012
2013 snprintf(tt, sizeof(tt), "%3u", a->threshold);
2014 tt[sizeof(tt)-1] = 0;
2015 snprintf(tw, sizeof(tw), "%3u", a->worst_value);
2016 tw[sizeof(tw)-1] = 0;
2017 snprintf(tc, sizeof(tc), "%3u", a->current_value);
2018 tc[sizeof(tc)-1] = 0;
2019
2020 highlight = a->good_valid && !a->good && isatty(1);
2021
2022 if (highlight)
2023 fprintf(stderr, HIGHLIGHT);
2024
2025 printf("%3u %-27s %-3s %-3s %-3s %-11s 0x%02x%02x%02x%02x%02x%02x %-7s %-7s %-3s\n",
2026 a->id,
2027 print_name(name, sizeof(name), a->id, a->name),
2028 a->current_value_valid ? tc : "n/a",
2029 a->worst_value_valid ? tw : "n/a",
2030 a->threshold_valid ? tt : "n/a",
2031 print_value(pretty, sizeof(pretty), a->pretty_value, a->pretty_unit),
2032 a->raw[0], a->raw[1], a->raw[2], a->raw[3], a->raw[4], a->raw[5],
2033 a->prefailure ? "prefail" : "old-age",
2034 a->online ? "online" : "offline",
2035 a->good_valid ? yes_no(a->good) : "n/a");
2036
2037 if (highlight)
2038 fprintf(stderr, ENDHIGHLIGHT);
2039 }
2040
2041 int sk_disk_dump(SkDisk *d) {
2042 int ret;
2043 SkBool awake = FALSE;
2044 uint64_t size;
2045
2046 assert(d);
2047
2048 printf("Device: %s\n"
2049 "Type: %s\n",
2050 d->name ? d->name : "n/a",
2051 disk_type_to_string(d->type));
2052
2053 ret = sk_disk_get_size(d, &size);
2054 if (ret >= 0)
2055 printf("Size: %lu MiB\n", (unsigned long) (d->size/1024/1024));
2056 else
2057 printf("Size: %s\n", strerror(errno));
2058
2059 if (d->identify_valid) {
2060 const SkIdentifyParsedData *ipd;
2061 SkSmartQuirk quirk = 0;
2062 unsigned i;
2063
2064 if ((ret = sk_disk_identify_parse(d, &ipd)) < 0)
2065 return ret;
2066
2067 printf("Model: [%s]\n"
2068 "Serial: [%s]\n"
2069 "Firmware: [%s]\n"
2070 "SMART Available: %s\n",
2071 ipd->model,
2072 ipd->serial,
2073 ipd->firmware,
2074 yes_no(disk_smart_is_available(d)));
2075
2076 if ((ret = lookup_quirks(ipd->model, ipd->firmware, &quirk)))
2077 return ret;
2078
2079 printf("Quirks:");
2080
2081 for (i = 0; quirk_name[i]; i++)
2082 if (quirk & (1<<i))
2083 printf(" %s", _P(quirk_name[i]));
2084
2085 printf("\n");
2086
2087 }
2088
2089 ret = sk_disk_check_sleep_mode(d, &awake);
2090 printf("Awake: %s\n",
2091 ret >= 0 ? yes_no(awake) : strerror(errno));
2092
2093 if (disk_smart_is_available(d)) {
2094 SkSmartOverall overall;
2095 const SkSmartParsedData *spd;
2096 SkBool good;
2097 char pretty[32];
2098 uint64_t value, power_on;
2099
2100 ret = sk_disk_smart_status(d, &good);
2101 printf("SMART Disk Health Good: %s\n",
2102 ret >= 0 ? yes_no(good) : strerror(errno));
2103
2104 if ((ret = sk_disk_smart_read_data(d)) < 0)
2105 return ret;
2106
2107 if ((ret = sk_disk_smart_parse(d, &spd)) < 0)
2108 return ret;
2109
2110 printf("Off-line Data Collection Status: [%s]\n"
2111 "Total Time To Complete Off-Line Data Collection: %u s\n"
2112 "Self-Test Execution Status: [%s]\n"
2113 "Percent Self-Test Remaining: %u%%\n"
2114 "Conveyance Self-Test Available: %s\n"
2115 "Short/Extended Self-Test Available: %s\n"
2116 "Start Self-Test Available: %s\n"
2117 "Abort Self-Test Available: %s\n"
2118 "Short Self-Test Polling Time: %u min\n"
2119 "Extended Self-Test Polling Time: %u min\n"
2120 "Conveyance Self-Test Polling Time: %u min\n",
2121 sk_smart_offline_data_collection_status_to_string(spd->offline_data_collection_status),
2122 spd->total_offline_data_collection_seconds,
2123 sk_smart_self_test_execution_status_to_string(spd->self_test_execution_status),
2124 spd->self_test_execution_percent_remaining,
2125 yes_no(spd->conveyance_test_available),
2126 yes_no(spd->short_and_extended_test_available),
2127 yes_no(spd->start_test_available),
2128 yes_no(spd->abort_test_available),
2129 spd->short_test_polling_minutes,
2130 spd->extended_test_polling_minutes,
2131 spd->conveyance_test_polling_minutes);
2132
2133 if (sk_disk_smart_get_bad(d, &value) < 0)
2134 printf("Bad Sectors: %s\n", strerror(errno));
2135 else
2136 printf("%sBad Sectors: %s%s\n",
2137 value > 0 ? HIGHLIGHT : "",
2138 print_value(pretty, sizeof(pretty), value, SK_SMART_ATTRIBUTE_UNIT_SECTORS),
2139 value > 0 ? ENDHIGHLIGHT : "");
2140
2141 if (sk_disk_smart_get_power_on(d, &power_on) < 0) {
2142 printf("Powered On: %s\n", strerror(errno));
2143 power_on = 0;
2144 } else
2145 printf("Powered On: %s\n", print_value(pretty, sizeof(pretty), power_on, SK_SMART_ATTRIBUTE_UNIT_MSECONDS));
2146
2147 if (sk_disk_smart_get_power_cycle(d, &value) < 0)
2148 printf("Power Cycles: %s\n", strerror(errno));
2149 else {
2150 printf("Power Cycles: %llu\n", (unsigned long long) value);
2151
2152 if (value > 0 && power_on > 0)
2153 printf("Average Powered On Per Power Cycle: %s\n", print_value(pretty, sizeof(pretty), power_on/value, SK_SMART_ATTRIBUTE_UNIT_MSECONDS));
2154 }
2155
2156 if (sk_disk_smart_get_temperature(d, &value) < 0)
2157 printf("Temperature: %s\n", strerror(errno));
2158 else
2159 printf("Temperature: %s\n", print_value(pretty, sizeof(pretty), value, SK_SMART_ATTRIBUTE_UNIT_MKELVIN));
2160
2161 if (sk_disk_smart_get_overall(d, &overall) < 0)
2162 printf("Overall Status: %s\n", strerror(errno));
2163 else
2164 printf("%sOverall Status: %s%s\n",
2165 overall != SK_SMART_OVERALL_GOOD ? HIGHLIGHT : "",
2166 sk_smart_overall_to_string(overall),
2167 overall != SK_SMART_OVERALL_GOOD ? ENDHIGHLIGHT : "");
2168
2169 printf("%3s %-27s %5s %5s %5s %-11s %-14s %-7s %-7s %-3s\n",
2170 "ID#",
2171 "Name",
2172 "Value",
2173 "Worst",
2174 "Thres",
2175 "Pretty",
2176 "Raw",
2177 "Type",
2178 "Updates",
2179 "Good");
2180
2181 if ((ret = sk_disk_smart_parse_attributes(d, disk_dump_attributes, NULL)) < 0)
2182 return ret;
2183 } else
2184 printf("ATA SMART not supported.\n");
2185
2186 return 0;
2187 }
2188
2189 int sk_disk_get_size(SkDisk *d, uint64_t *bytes) {
2190 assert(d);
2191 assert(bytes);
2192
2193 if (d->size == (uint64_t) -1) {
2194 errno = ENODATA;
2195 return -1;
2196 }
2197
2198 *bytes = d->size;
2199 return 0;
2200 }
2201
2202 static int disk_find_type(SkDisk *d, dev_t devnum) {
2203 struct udev *udev;
2204 struct udev_device *dev = NULL, *usb;
2205 int r = -1;
2206
2207 assert(d);
2208
2209 if (!(udev = udev_new())) {
2210 errno = ENXIO;
2211 goto finish;
2212 }
2213
2214 if (!(dev = udev_device_new_from_devnum(udev, 'b', devnum))) {
2215 errno = ENODEV;
2216 goto finish;
2217 }
2218
2219 if ((usb = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device"))) {
2220 const char *product, *vendor;
2221 uint32_t pid, vid;
2222
2223 if (!(product = udev_device_get_sysattr_value(usb, "idProduct")) ||
2224 sscanf(product, "%04x", &pid) != 1) {
2225 errno = ENODEV;
2226 goto finish;
2227 }
2228
2229 if (!(vendor = udev_device_get_sysattr_value(usb, "idVendor")) ||
2230 sscanf(vendor, "%04x", &vid) != 1) {
2231 errno = ENODEV;
2232 goto finish;
2233 }
2234
2235 if ((vid == 0x0c0b && pid == 0xb159) ||
2236 (vid == 0x04fc && pid == 0x0c25))
2237 d->type = SK_DISK_TYPE_SUNPLUS;
2238 if ((vid == 0x152d && pid == 0x2329) ||
2239 (vid == 0x152d && pid == 0x2336) ||
2240 (vid == 0x152d && pid == 0x2338) ||
2241 (vid == 0x152d && pid == 0x2339))
2242 d->type = SK_DISK_TYPE_JMICRON;
2243 else
2244 d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_12;
2245
2246 } else if (udev_device_get_parent_with_subsystem_devtype(dev, "ide", NULL))
2247 d->type = SK_DISK_TYPE_ATA;
2248 else if (udev_device_get_parent_with_subsystem_devtype(dev, "scsi", NULL))
2249 d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_16;
2250 else
2251 d->type = SK_DISK_TYPE_UNKNOWN;
2252
2253 r = 0;
2254
2255 finish:
2256 if (dev)
2257 udev_device_unref(dev);
2258
2259 if (udev)
2260 udev_unref(udev);
2261
2262 return r;
2263 }
2264
2265 int sk_disk_open(const char *name, SkDisk **_d) {
2266 SkDisk *d;
2267 int ret = -1;
2268 struct stat st;
2269
2270 assert(_d);
2271
2272 if (!(d = calloc(1, sizeof(SkDisk)))) {
2273 errno = ENOMEM;
2274 goto fail;
2275 }
2276
2277 if (!name) {
2278 d->fd = -1;
2279 d->type = SK_DISK_TYPE_BLOB;
2280 d->size = (uint64_t) -1;
2281 } else {
2282
2283 if (!(d->name = strdup(name))) {
2284 errno = ENOMEM;
2285 goto fail;
2286 }
2287
2288 if ((d->fd = open(name,
2289 O_RDONLY|O_NOCTTY|O_NONBLOCK
2290 #ifdef O_CLOEXEC
2291 |O_CLOEXEC
2292 #endif
2293
2294 )) < 0) {
2295 ret = d->fd;
2296 goto fail;
2297 }
2298
2299 if ((ret = fstat(d->fd, &st)) < 0)
2300 goto fail;
2301
2302 if (!S_ISBLK(st.st_mode)) {
2303 errno = ENODEV;
2304 ret = -1;
2305 goto fail;
2306 }
2307
2308 /* So, it's a block device. Let's make sure the ioctls work */
2309 if ((ret = ioctl(d->fd, BLKGETSIZE64, &d->size)) < 0)
2310 goto fail;
2311
2312 if (d->size <= 0 || d->size == (uint64_t) -1) {
2313 errno = EIO;
2314 ret = -1;
2315 goto fail;
2316 }
2317
2318 /* OK, it's a real block device with a size. Now let's find the suitable API */
2319 if ((ret = disk_find_type(d, st.st_rdev)) < 0)
2320 goto fail;
2321
2322 if (d->type == SK_DISK_TYPE_UNKNOWN) {
2323 /* We have no clue, so let's autotest for a working API */
2324 for (d->type = 0; d->type < _SK_DISK_TYPE_TEST_MAX; d->type++)
2325 if (disk_identify_device(d) >= 0)
2326 break;
2327 if (d->type >= _SK_DISK_TYPE_TEST_MAX)
2328 d->type = SK_DISK_TYPE_UNKNOWN;
2329 } else
2330 disk_identify_device(d);
2331
2332 /* Check if driver can do SMART, and enable if necessary */
2333 if (disk_smart_is_available(d)) {
2334
2335 if (!disk_smart_is_enabled(d)) {
2336 if ((ret = disk_smart_enable(d, TRUE)) < 0)
2337 goto fail;
2338
2339 if ((ret = disk_identify_device(d)) < 0)
2340 goto fail;
2341
2342 if (!disk_smart_is_enabled(d)) {
2343 errno = EIO;
2344 ret = -1;
2345 goto fail;
2346 }
2347 }
2348
2349 disk_smart_read_thresholds(d);
2350 }
2351 }
2352
2353 *_d = d;
2354
2355 return 0;
2356
2357 fail:
2358
2359 if (d)
2360 sk_disk_free(d);
2361
2362 return ret;
2363 }
2364
2365 void sk_disk_free(SkDisk *d) {
2366 assert(d);
2367
2368 if (d->fd >= 0)
2369 close(d->fd);
2370
2371 free(d->name);
2372 free(d->blob);
2373 free(d);
2374 }
2375
2376 int sk_disk_get_blob(SkDisk *d, const void **blob, size_t *rsize) {
2377 size_t size;
2378 SkBool good, have_good = FALSE;
2379 uint32_t *p;
2380
2381 assert(d);
2382 assert(blob);
2383 assert(rsize);
2384
2385 size =
2386 (d->identify_valid ? 8 + sizeof(d->identify) : 0) +
2387 (d->smart_data_valid ? 8 + sizeof(d->smart_data) : 0) +
2388 (d->smart_thresholds ? 8 + sizeof(d->smart_thresholds) : 0);
2389
2390 if (sk_disk_smart_status(d, &good) >= 0) {
2391 size += 12;
2392 have_good = TRUE;
2393 }
2394
2395 if (size <= 0) {
2396 errno = ENODATA;
2397 return -1;
2398 }
2399
2400 free(d->blob);
2401 if (!(d->blob = malloc(size))) {
2402 errno = ENOMEM;
2403 return -1;
2404 }
2405
2406 p = d->blob;
2407
2408 /* These memory accesses are only OK as long as all our
2409 * objects are sensibly aligned, which they are... */
2410
2411 if (d->identify_valid) {
2412 p[0] = SK_BLOB_TAG_IDENTIFY;
2413 p[1] = htonl(sizeof(d->identify));
2414 p += 2;
2415
2416 memcpy(p, d->identify, sizeof(d->identify));
2417 p = (uint32_t*) ((uint8_t*) p + sizeof(d->identify));
2418 }
2419
2420 if (have_good) {
2421 p[0] = SK_BLOB_TAG_SMART_STATUS;
2422 p[1] = htonl(4);
2423 p[2] = htonl(!!good);
2424 p += 3;
2425 }
2426
2427 if (d->smart_data_valid) {
2428 p[0] = SK_BLOB_TAG_SMART_DATA;
2429 p[1] = htonl(sizeof(d->smart_data));
2430 p += 2;
2431
2432 memcpy(p, d->smart_data, sizeof(d->smart_data));
2433 p = (uint32_t*) ((uint8_t*) p + sizeof(d->smart_data));
2434 }
2435
2436 if (d->smart_thresholds_valid) {
2437 p[0] = SK_BLOB_TAG_SMART_THRESHOLDS;
2438 p[1] = htonl(sizeof(d->smart_thresholds));
2439 p += 2;
2440
2441 memcpy(p, d->smart_thresholds, sizeof(d->smart_thresholds));
2442 p = (uint32_t*) ((uint8_t*) p + sizeof(d->smart_thresholds));
2443 }
2444
2445 assert((size_t) ((uint8_t*) p - (uint8_t*) d->blob) == size);
2446
2447 *blob = d->blob;
2448 *rsize = size;
2449
2450 return 0;
2451 }
2452
2453 int sk_disk_set_blob(SkDisk *d, const void *blob, size_t size) {
2454 const uint32_t *p;
2455 size_t left;
2456 SkBool idv = FALSE, sdv = FALSE, stv = FALSE, bssv = FALSE;
2457
2458 assert(d);
2459 assert(blob);
2460
2461 if (d->type != SK_DISK_TYPE_BLOB) {
2462 errno = ENODEV;
2463 return -1;
2464 }
2465
2466 if (size <= 0) {
2467 errno = EINVAL;
2468 return -1;
2469 }
2470
2471 /* First run, verify if everything makes sense */
2472 p = blob;
2473 left = size;
2474 while (left > 0) {
2475 uint32_t tag, tsize;
2476
2477 if (left < 8) {
2478 errno = EINVAL;
2479 return -1;
2480 }
2481
2482 memcpy(&tag, p, 4);
2483 memcpy(&tsize, p+1, 4);
2484 p += 2;
2485 left -= 8;
2486
2487 if (left < ntohl(tsize)) {
2488 errno = EINVAL;
2489 return -1;
2490 }
2491
2492 switch (tag) {
2493
2494 case SK_BLOB_TAG_IDENTIFY:
2495 if (ntohl(tsize) != sizeof(d->identify) || idv) {
2496 errno = EINVAL;
2497 return -1;
2498 }
2499 idv = TRUE;
2500 break;
2501
2502 case SK_BLOB_TAG_SMART_STATUS:
2503 if (ntohl(tsize) != 4 || bssv) {
2504 errno = EINVAL;
2505 return -1;
2506 }
2507 bssv = TRUE;
2508 break;
2509
2510 case SK_BLOB_TAG_SMART_DATA:
2511 if (ntohl(tsize) != sizeof(d->smart_data) || sdv) {
2512 errno = EINVAL;
2513 return -1;
2514 }
2515 sdv = TRUE;
2516 break;
2517
2518 case SK_BLOB_TAG_SMART_THRESHOLDS:
2519 if (ntohl(tsize) != sizeof(d->smart_thresholds) || stv) {
2520 errno = EINVAL;
2521 return -1;
2522 }
2523 stv = TRUE;
2524 break;
2525 }
2526
2527 p = (uint32_t*) ((uint8_t*) p + ntohl(tsize));
2528 left -= ntohl(tsize);
2529 }
2530
2531 if (!idv) {
2532 errno = -ENODATA;
2533 return -1;
2534 }
2535
2536 d->identify_valid = idv;
2537 d->smart_data_valid = sdv;
2538 d->smart_thresholds_valid = stv;
2539 d->blob_smart_status_valid = bssv;
2540
2541 /* Second run, actually copy things in */
2542 p = blob;
2543 left = size;
2544 while (left > 0) {
2545 uint32_t tag, tsize;
2546
2547 assert(left >= 8);
2548 memcpy(&tag, p, 4);
2549 memcpy(&tsize, p+1, 4);
2550 p += 2;
2551 left -= 8;
2552
2553 assert(left >= ntohl(tsize));
2554
2555 switch (tag) {
2556
2557 case SK_BLOB_TAG_IDENTIFY:
2558 assert(ntohl(tsize) == sizeof(d->identify));
2559 memcpy(d->identify, p, sizeof(d->identify));
2560 break;
2561
2562 case SK_BLOB_TAG_SMART_STATUS: {
2563 uint32_t ok;
2564 assert(ntohl(tsize) == 4);
2565 memcpy(&ok, p, 4);
2566 d->blob_smart_status = !!ok;
2567 break;
2568 }
2569
2570 case SK_BLOB_TAG_SMART_DATA:
2571 assert(ntohl(tsize) == sizeof(d->smart_data));
2572 memcpy(d->smart_data, p, sizeof(d->smart_data));
2573 break;
2574
2575 case SK_BLOB_TAG_SMART_THRESHOLDS:
2576 assert(ntohl(tsize) == sizeof(d->smart_thresholds));
2577 memcpy(d->smart_thresholds, p, sizeof(d->smart_thresholds));
2578 break;
2579 }
2580
2581 p = (uint32_t*) ((uint8_t*) p + ntohl(tsize));
2582 left -= ntohl(tsize);
2583 }
2584
2585 return 0;
2586 }
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 #ifndef fooatasmarthfoo
3 #define fooatasmarthfoo
4
5 /***
6 This file is part of libatasmart.
7
8 Copyright 2008 Lennart Poettering
9
10 libatasmart is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as
12 published by the Free Software Foundation, either version 2.1 of the
13 License, or (at your option) any later version.
14
15 libatasmart is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with libatasmart. If not, If not, see
22 <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <inttypes.h>
26
27 /* Please note that all enums defined here may be extended at any time
28 * without this being considered an ABI change. So take care when
29 * using them as indexes! */
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef unsigned SkBool;
36
37 #ifndef FALSE
38 #define FALSE (0)
39 #endif
40
41 #ifndef TRUE
42 #define TRUE (!FALSE)
43 #endif
44
45 /* ATA SMART test type (ATA8 7.52.5.2) */
46 typedef enum SkSmartSelfTest {
47 SK_SMART_SELF_TEST_SHORT = 1,
48 SK_SMART_SELF_TEST_EXTENDED = 2,
49 SK_SMART_SELF_TEST_CONVEYANCE = 3,
50 SK_SMART_SELF_TEST_ABORT = 127
51
52 /* This enum may be extended at any time without this being
53 * considered an ABI change. So take care when you use this
54 * type! */
55 } SkSmartSelfTest;
56
57 const char* sk_smart_self_test_to_string(SkSmartSelfTest test);
58
59 typedef struct SkIdentifyParsedData {
60 char serial[21];
61 char firmware[9];
62 char model[41];
63
64 /* This structure may be extended at any time without this being
65 * considered an ABI change. So take care when you copy it. */
66 } SkIdentifyParsedData;
67
68 typedef enum SkSmartOfflineDataCollectionStatus {
69 SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_NEVER,
70 SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUCCESS,
71 SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_INPROGRESS,
72 SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUSPENDED,
73 SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_ABORTED,
74 SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL,
75 SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN,
76 _SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_MAX
77
78 /* This enum may be extended at any time without this being
79 * considered an ABI change. So take care when you use this
80 * type! */
81 } SkSmartOfflineDataCollectionStatus;
82
83 const char* sk_smart_offline_data_collection_status_to_string(SkSmartOfflineDataCollectionStatus status);
84
85 typedef enum SkSmartSelfTestExecutionStatus {
86 SK_SMART_SELF_TEST_EXECUTION_STATUS_SUCCESS_OR_NEVER = 0,
87 SK_SMART_SELF_TEST_EXECUTION_STATUS_ABORTED = 1,
88 SK_SMART_SELF_TEST_EXECUTION_STATUS_INTERRUPTED = 2,
89 SK_SMART_SELF_TEST_EXECUTION_STATUS_FATAL = 3,
90 SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_UNKNOWN = 4,
91 SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_ELECTRICAL = 5,
92 SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_SERVO = 6,
93 SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_READ = 7,
94 SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_HANDLING = 8,
95 SK_SMART_SELF_TEST_EXECUTION_STATUS_INPROGRESS = 15,
96 _SK_SMART_SELF_TEST_EXECUTION_STATUS_MAX
97
98 /* This enum may be extended at any time without this being
99 * considered an ABI change. So take care when you use this
100 * type! */
101 } SkSmartSelfTestExecutionStatus;
102
103 const char *sk_smart_self_test_execution_status_to_string(SkSmartSelfTestExecutionStatus status);
104
105 typedef struct SkSmartParsedData {
106 /* Volatile data */
107 SkSmartOfflineDataCollectionStatus offline_data_collection_status;
108 unsigned total_offline_data_collection_seconds;
109 SkSmartSelfTestExecutionStatus self_test_execution_status;
110 unsigned self_test_execution_percent_remaining;
111
112 /* Fixed data */
113 SkBool short_and_extended_test_available:1;
114 SkBool conveyance_test_available:1;
115 SkBool start_test_available:1;
116 SkBool abort_test_available:1;
117
118 unsigned short_test_polling_minutes;
119 unsigned extended_test_polling_minutes;
120 unsigned conveyance_test_polling_minutes;
121
122 /* This structure may be extended at any time without this being
123 * considered an ABI change. So take care when you copy it. */
124 } SkSmartParsedData;
125
126 SkBool sk_smart_self_test_available(const SkSmartParsedData *d, SkSmartSelfTest test);
127 unsigned sk_smart_self_test_polling_minutes(const SkSmartParsedData *d, SkSmartSelfTest test);
128
129 typedef enum SkSmartAttributeUnit {
130 SK_SMART_ATTRIBUTE_UNIT_UNKNOWN,
131 SK_SMART_ATTRIBUTE_UNIT_NONE,
132 SK_SMART_ATTRIBUTE_UNIT_MSECONDS, /* milliseconds */
133 SK_SMART_ATTRIBUTE_UNIT_SECTORS,
134 SK_SMART_ATTRIBUTE_UNIT_MKELVIN, /* millikelvin */
135 _SK_SMART_ATTRIBUTE_UNIT_MAX
136
137 /* This enum may be extended at any time without this being
138 * considered an ABI change. So take care when you use this
139 * type! */
140 } SkSmartAttributeUnit;
141
142 const char* sk_smart_attribute_unit_to_string(SkSmartAttributeUnit unit);
143
144 typedef struct SkSmartAttributeParsedData {
145 /* Fixed data */
146 uint8_t id;
147 const char *name;
148 SkSmartAttributeUnit pretty_unit; /* for pretty_value */
149
150 uint16_t flags;
151
152 uint8_t threshold;
153 SkBool threshold_valid:1;
154
155 SkBool online:1;
156 SkBool prefailure:1;
157
158 /* Volatile data */
159 SkBool good:1, good_valid:1;
160 SkBool current_value_valid:1, worst_value_valid:1;
161 uint8_t current_value, worst_value;
162 uint64_t pretty_value;
163 uint8_t raw[6];
164
165 /* This structure may be extended at any time without this being
166 * considered an ABI change. So take care when you copy it. */
167 } SkSmartAttributeParsedData;
168
169 typedef struct SkDisk SkDisk;
170
171 typedef enum SkSmartOverall {
172 SK_SMART_OVERALL_GOOD,
173 SK_SMART_OVERALL_BAD_STATUS, /* Smart Self Assessment negative */
174 SK_SMART_OVERALL_BAD_SECTOR, /* At least one bad sector */
175 SK_SMART_OVERALL_BAD_ATTRIBUTE, /* At least one pre-fail attribute exceeded its threshold in the past or now */
176 _SK_SMART_OVERALL_MAX
177
178 /* This enum may be extended at any time without this being
179 * considered an ABI change. So take care when you use this
180 * type! */
181 } SkSmartOverall;
182
183 const char* sk_smart_overall_to_string(SkSmartOverall overall);
184
185 int sk_disk_open(const char *name, SkDisk **d);
186
187 int sk_disk_get_size(SkDisk *d, uint64_t *bytes);
188
189 int sk_disk_check_sleep_mode(SkDisk *d, SkBool *awake);
190
191 int sk_disk_identify_is_available(SkDisk *d, SkBool *available);
192 int sk_disk_identify_parse(SkDisk *d, const SkIdentifyParsedData **data);
193
194 typedef void (*SkSmartAttributeParseCallback)(SkDisk *d, const SkSmartAttributeParsedData *a, void* userdata);
195
196 int sk_disk_smart_is_available(SkDisk *d, SkBool *available);
197 int sk_disk_smart_status(SkDisk *d, SkBool *good);
198
199 /* Reading SMART data might cause the disk to wake up from
200 * sleep. Hence from monitoring daemons make sure to call
201 * sk_disk_check_power_mode() to check wether the disk is sleeping and
202 * skip the read if so. */
203 int sk_disk_smart_read_data(SkDisk *d);
204
205 int sk_disk_get_blob(SkDisk *d, const void **blob, size_t *size);
206 int sk_disk_set_blob(SkDisk *d, const void *blob, size_t size);
207
208 int sk_disk_smart_parse(SkDisk *d, const SkSmartParsedData **data);
209 int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb, void* userdata);
210 int sk_disk_smart_self_test(SkDisk *d, SkSmartSelfTest test);
211
212 /* High level API to get the power on time */
213 int sk_disk_smart_get_power_on(SkDisk *d, uint64_t *mseconds);
214
215 /* High level API to get the power cycle count */
216 int sk_disk_smart_get_power_cycle(SkDisk *d, uint64_t *count);
217
218 /* High level API to get the number of bad sectors (i.e. pending and reallocated) */
219 int sk_disk_smart_get_bad(SkDisk *d, uint64_t *sectors);
220
221 /* High level API to get the temperature */
222 int sk_disk_smart_get_temperature(SkDisk *d, uint64_t *mkelvin);
223
224 /* Get overall status. This integrates the values of a couple of fields into a single overall status */
225 int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall);
226
227 /* Dump the current parsed status to STDOUT */
228 int sk_disk_dump(SkDisk *d);
229
230 void sk_disk_free(SkDisk *d);
231
232 #ifdef __cplusplus
233 }
234 #endif
235
236 #endif
0 /* Saved 96 relocations, saved 2 strings (19 b) due to suffix compression. */
1 static const char _strpool_[] =
2 "16 Byte SCSI ATA SAT Passthru\0"
3 "12 Byte SCSI ATA SAT Passthru\0"
4 "Native Linux ATA\0"
5 "Sunplus SCSI ATA Passthru\0"
6 "JMicron SCSI ATA Passthru\0"
7 "Blob\0"
8 "Unknown\0"
9 "Off-line data collection activity was never started.\0"
10 "Off-line data collection activity was completed without error.\0"
11 "Off-line activity in progress.\0"
12 "Off-line data collection activity was suspended by an interrupting command from host.\0"
13 "Off-line data collection activity was aborted by an interrupting command from host.\0"
14 "Off-line data collection activity was aborted by the device with a fatal error.\0"
15 "Unknown status\0"
16 "The previous self-test routine completed without error or no self-test has ever been run.\0"
17 "The self-test routine was aborted by the host.\0"
18 "The self-test routine was interrupted by the host with a hardware or software reset.\0"
19 "A fatal error or unknown test error occurred while the device was executing its self-test routine and the device was unable to complete the self-test routine.\0"
20 "The previous self-test completed having a test element that failed and the test element that failed.\0"
21 "The previous self-test completed having the electrical element of the test failed.\0"
22 "The previous self-test completed having the servo (and/or seek) test element of the test failed.\0"
23 "The previous self-test completed having the read element of the test failed.\0"
24 "The previous self-test completed having a test element that failed and the device is suspected of having handling damage.\0"
25 "Self-test routine in progress\0"
26 "raw-read-error-rate\0"
27 "throughput-performance\0"
28 "spin-up-time\0"
29 "start-stop-count\0"
30 "reallocated-sector-count\0"
31 "read-channel-margin\0"
32 "seek-error-rate\0"
33 "seek-time-performance\0"
34 "power-on-hours\0"
35 "spin-retry-count\0"
36 "calibration-retry-count\0"
37 "power-cycle-count\0"
38 "read-soft-error-rate\0"
39 "reported-uncorrect\0"
40 "high-fly-writes\0"
41 "airflow-temperature-celsius\0"
42 "g-sense-error-rate\0"
43 "power-off-retract-count\0"
44 "load-cycle-count\0"
45 "temperature-celsius-2\0"
46 "hardware-ecc-recovered\0"
47 "reallocated-event-count\0"
48 "current-pending-sector\0"
49 "offline-uncorrectable\0"
50 "udma-crc-error-count\0"
51 "multi-zone-error-rate\0"
52 "soft-read-error-rate\0"
53 "ta-increase-count\0"
54 "run-out-cancel\0"
55 "shock-count-write-open\0"
56 "shock-rate-write-open\0"
57 "flying-height\0"
58 "spin-high-current\0"
59 "spin-buzz\0"
60 "offline-seek-performance\0"
61 "disk-shift\0"
62 "g-sense-error-rate-2\0"
63 "loaded-hours\0"
64 "load-retry-count\0"
65 "load-friction\0"
66 "load-cycle-count-2\0"
67 "load-in-time\0"
68 "torq-amp-count\0"
69 "power-off-retract-count-2\0"
70 "head-amplitude\0"
71 /*** Suppressed due to suffix:
72 "temperature-celsius\0" ***/
73 "head-flying-hours\0"
74 "read-error-retry-rate\0"
75 "9_POWERONMINUTES\0"
76 "9_POWERONSECONDS\0"
77 "9_POWERONHALFMINUTES\0"
78 "192_EMERGENCYRETRACTCYCLECT\0"
79 "193_LOADUNLOAD\0"
80 "194_10XCELSIUS\0"
81 "194_UNKNOWN\0"
82 "200_WRITEERRORCOUNT\0"
83 "201_DETECTEDTACOUNT\0"
84 "9_UNKNOWN\0"
85 "power-on-minutes\0"
86 "power-on-seconds\0"
87 "power-on-half-minutes\0"
88 "emergency-retract-cycle-count\0"
89 "temperature-centi-celsius\0"
90 "write-error-count\0"
91 "detected-ta-count\0"
92 /*** Suppressed due to suffix:
93 "\0" ***/
94 "ms\0"
95 "sectors\0"
96 "mK\0"
97 "GOOD\0"
98 "BAD_STATUS\0"
99 "BAD_ATTRIBUTE\0"
100 "BAD_SECTOR\0";
101 #ifndef STRPOOL
102 #define STRPOOL
103 #endif
104 #ifndef _P
105 #define _P(x) (_strpool_ + ((x) - (const char*) 1))
106 #endif
107
108 #line 1 "atasmart.c"
109 /*-*- Mode: C; c-basic-offset: 8 -*-*/
110
111 /***
112 This file is part of libatasmart.
113
114 Copyright 2008 Lennart Poettering
115
116 libatasmart is free software; you can redistribute it and/or modify
117 it under the terms of the GNU Lesser General Public License as
118 published by the Free Software Foundation, either version 2.1 of the
119 License, or (at your option) any later version.
120
121 libatasmart is distributed in the hope that it will be useful, but
122 WITHOUT ANY WARRANTY; without even the implied warranty of
123 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
124 Lesser General Public License for more details.
125
126 You should have received a copy of the GNU Lesser General Public
127 License along with libatasmart. If not, If not, see
128 <http://www.gnu.org/licenses/>.
129 ***/
130
131 #ifdef HAVE_CONFIG_H
132 #include <config.h>
133 #endif
134
135 #include <arpa/inet.h>
136 #include <stdlib.h>
137 #include <alloca.h>
138 #include <assert.h>
139 #include <fcntl.h>
140 #include <unistd.h>
141 #include <errno.h>
142 #include <string.h>
143 #include <stdio.h>
144 #include <sys/stat.h>
145 #include <sys/ioctl.h>
146 #include <scsi/scsi.h>
147 #include <scsi/sg.h>
148 #include <scsi/scsi_ioctl.h>
149 #include <linux/hdreg.h>
150 #include <linux/fs.h>
151 #include <sys/types.h>
152 #include <regex.h>
153 #include <sys/param.h>
154 #include <libudev.h>
155
156 #include "atasmart.h"
157
158 #ifndef STRPOOL
159 #define _P(x) x
160 #endif
161
162 #define SK_TIMEOUT 2000
163
164 typedef enum SkDirection {
165 SK_DIRECTION_NONE,
166 SK_DIRECTION_IN,
167 SK_DIRECTION_OUT,
168 _SK_DIRECTION_MAX
169 } SkDirection;
170
171 typedef enum SkDiskType {
172 /* These three will be autotested for: */
173 SK_DISK_TYPE_ATA_PASSTHROUGH_12, /* ATA passthrough over SCSI transport, 12-byte version */
174 SK_DISK_TYPE_ATA_PASSTHROUGH_16, /* ATA passthrough over SCSI transport, 16-byte version */
175 SK_DISK_TYPE_ATA, /* Classic Linux /dev/hda ioctls */
176
177 /* These three will not be autotested for */
178 SK_DISK_TYPE_SUNPLUS, /* SunPlus USB/ATA bridges */
179 SK_DISK_TYPE_JMICRON, /* JMicron USB/ATA bridges */
180 SK_DISK_TYPE_BLOB,
181 SK_DISK_TYPE_UNKNOWN,
182 _SK_DISK_TYPE_MAX,
183 _SK_DISK_TYPE_TEST_MAX = SK_DISK_TYPE_SUNPLUS /* only auto test until here */
184 } SkDiskType;
185
186 #if __BYTE_ORDER == __LITTLE_ENDIAN
187 #define MAKE_TAG(a,b,c,d) \
188 (((uint32_t) d << 24) | \
189 ((uint32_t) c << 16) | \
190 ((uint32_t) b << 8) | \
191 ((uint32_t) a))
192 #else
193 #define MAKE_TAG(a,b,c,d) \
194 (((uint32_t) a << 24) | \
195 ((uint32_t) b << 16) | \
196 ((uint32_t) c << 8) | \
197 ((uint32_t) d))
198 #endif
199
200 typedef enum SkBlobTag {
201 SK_BLOB_TAG_IDENTIFY = MAKE_TAG('I', 'D', 'F', 'Y'),
202 SK_BLOB_TAG_SMART_STATUS = MAKE_TAG('S', 'M', 'S', 'T'),
203 SK_BLOB_TAG_SMART_DATA = MAKE_TAG('S', 'M', 'D', 'T'),
204 SK_BLOB_TAG_SMART_THRESHOLDS = MAKE_TAG('S', 'M', 'T', 'H')
205 } SkBlobTag;
206
207 struct SkDisk {
208 char *name;
209 int fd;
210 SkDiskType type;
211
212 uint64_t size;
213
214 uint8_t identify[512];
215 uint8_t smart_data[512];
216 uint8_t smart_thresholds[512];
217
218 SkBool identify_valid:1;
219 SkBool smart_data_valid:1;
220 SkBool smart_thresholds_valid:1;
221
222 SkBool blob_smart_status:1;
223 SkBool blob_smart_status_valid:1;
224
225 SkIdentifyParsedData identify_parsed_data;
226 SkSmartParsedData smart_parsed_data;
227
228 void *blob;
229 };
230
231 /* ATA commands */
232 typedef enum SkAtaCommand {
233 SK_ATA_COMMAND_IDENTIFY_DEVICE = 0xEC,
234 SK_ATA_COMMAND_IDENTIFY_PACKET_DEVICE = 0xA1,
235 SK_ATA_COMMAND_SMART = 0xB0,
236 SK_ATA_COMMAND_CHECK_POWER_MODE = 0xE5
237 } SkAtaCommand;
238
239 /* ATA SMART subcommands (ATA8 7.52.1) */
240 typedef enum SkSmartCommand {
241 SK_SMART_COMMAND_READ_DATA = 0xD0,
242 SK_SMART_COMMAND_READ_THRESHOLDS = 0xD1,
243 SK_SMART_COMMAND_EXECUTE_OFFLINE_IMMEDIATE = 0xD4,
244 SK_SMART_COMMAND_ENABLE_OPERATIONS = 0xD8,
245 SK_SMART_COMMAND_DISABLE_OPERATIONS = 0xD9,
246 SK_SMART_COMMAND_RETURN_STATUS = 0xDA
247 } SkSmartCommand;
248
249 static const char *disk_type_to_string(SkDiskType type) {
250
251 /* %STRINGPOOLSTART% */
252 static const char* const map[_SK_DISK_TYPE_MAX] = {
253 [SK_DISK_TYPE_ATA_PASSTHROUGH_16] = ((const char*) 1),
254 [SK_DISK_TYPE_ATA_PASSTHROUGH_12] = ((const char*) 31),
255 [SK_DISK_TYPE_ATA] = ((const char*) 61),
256 [SK_DISK_TYPE_SUNPLUS] = ((const char*) 78),
257 [SK_DISK_TYPE_JMICRON] = ((const char*) 104),
258 [SK_DISK_TYPE_BLOB] = ((const char*) 130),
259 [SK_DISK_TYPE_UNKNOWN] = ((const char*) 135)
260 };
261 /* %STRINGPOOLSTOP% */
262
263 if (type >= _SK_DISK_TYPE_MAX)
264 return NULL;
265
266 return _P(map[type]);
267 }
268
269 static SkBool disk_smart_is_available(SkDisk *d) {
270 return d->identify_valid && !!(d->identify[164] & 1);
271 }
272
273 static SkBool disk_smart_is_enabled(SkDisk *d) {
274 return d->identify_valid && !!(d->identify[170] & 1);
275 }
276
277 static SkBool disk_smart_is_conveyance_test_available(SkDisk *d) {
278 assert(d->smart_data_valid);
279
280 return !!(d->smart_data[367] & 32);
281 }
282 static SkBool disk_smart_is_short_and_extended_test_available(SkDisk *d) {
283 assert(d->smart_data_valid);
284
285 return !!(d->smart_data[367] & 16);
286 }
287
288 static SkBool disk_smart_is_start_test_available(SkDisk *d) {
289 assert(d->smart_data_valid);
290
291 return !!(d->smart_data[367] & 1);
292 }
293
294 static SkBool disk_smart_is_abort_test_available(SkDisk *d) {
295 assert(d->smart_data_valid);
296
297 return !!(d->smart_data[367] & 41);
298 }
299
300 static int disk_ata_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
301 uint8_t *bytes = cmd_data;
302 int ret;
303
304 assert(d->type == SK_DISK_TYPE_ATA);
305
306 switch (direction) {
307
308 case SK_DIRECTION_OUT:
309
310 /* We could use HDIO_DRIVE_TASKFILE here, but
311 * that's a deprecated ioctl(), hence we don't
312 * do it. And we don't need writing anyway. */
313
314 errno = ENOTSUP;
315 return -1;
316
317 case SK_DIRECTION_IN: {
318 uint8_t *ioctl_data;
319
320 /* We have HDIO_DRIVE_CMD which can only read, but not write,
321 * and cannot do LBA. We use it for all read commands. */
322
323 ioctl_data = alloca(4 + *len);
324 memset(ioctl_data, 0, 4 + *len);
325
326 ioctl_data[0] = (uint8_t) command; /* COMMAND */
327 ioctl_data[1] = ioctl_data[0] == WIN_SMART ? bytes[9] : bytes[3]; /* SECTOR/NSECTOR */
328 ioctl_data[2] = bytes[1]; /* FEATURE */
329 ioctl_data[3] = bytes[3]; /* NSECTOR */
330
331 if ((ret = ioctl(d->fd, HDIO_DRIVE_CMD, ioctl_data)) < 0)
332 return ret;
333
334 memset(bytes, 0, 12);
335 bytes[11] = ioctl_data[0];
336 bytes[1] = ioctl_data[1];
337 bytes[3] = ioctl_data[2];
338
339 memcpy(data, ioctl_data+4, *len);
340
341 return ret;
342 }
343
344 case SK_DIRECTION_NONE: {
345 uint8_t ioctl_data[7];
346
347 /* We have HDIO_DRIVE_TASK which can neither read nor
348 * write, but can do LBA. We use it for all commands that
349 * do neither read nor write */
350
351 memset(ioctl_data, 0, sizeof(ioctl_data));
352
353 ioctl_data[0] = (uint8_t) command; /* COMMAND */
354 ioctl_data[1] = bytes[1]; /* FEATURE */
355 ioctl_data[2] = bytes[3]; /* NSECTOR */
356
357 ioctl_data[3] = bytes[9]; /* LBA LOW */
358 ioctl_data[4] = bytes[8]; /* LBA MID */
359 ioctl_data[5] = bytes[7]; /* LBA HIGH */
360 ioctl_data[6] = bytes[10]; /* SELECT */
361
362 if ((ret = ioctl(d->fd, HDIO_DRIVE_TASK, ioctl_data)))
363 return ret;
364
365 memset(bytes, 0, 12);
366 bytes[11] = ioctl_data[0];
367 bytes[1] = ioctl_data[1];
368 bytes[3] = ioctl_data[2];
369
370 bytes[9] = ioctl_data[3];
371 bytes[8] = ioctl_data[4];
372 bytes[7] = ioctl_data[5];
373
374 bytes[10] = ioctl_data[6];
375
376 return ret;
377 }
378
379 default:
380 assert(FALSE);
381 return -1;
382 }
383 }
384
385 /* Sends a SCSI command block */
386 static int sg_io(int fd, int direction,
387 const void *cdb, size_t cdb_len,
388 void *data, size_t data_len,
389 void *sense, size_t sense_len) {
390
391 struct sg_io_hdr io_hdr;
392
393 memset(&io_hdr, 0, sizeof(struct sg_io_hdr));
394
395 io_hdr.interface_id = 'S';
396 io_hdr.cmdp = (unsigned char*) cdb;
397 io_hdr.cmd_len = cdb_len;
398 io_hdr.dxferp = data;
399 io_hdr.dxfer_len = data_len;
400 io_hdr.sbp = sense;
401 io_hdr.mx_sb_len = sense_len;
402 io_hdr.dxfer_direction = direction;
403 io_hdr.timeout = SK_TIMEOUT;
404
405 return ioctl(fd, SG_IO, &io_hdr);
406 }
407
408 static int disk_passthrough_16_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
409 uint8_t *bytes = cmd_data;
410 uint8_t cdb[16];
411 uint8_t sense[32];
412 uint8_t *desc = sense+8;
413 int ret;
414
415 static const int direction_map[] = {
416 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
417 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
418 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
419 };
420
421 assert(d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_16);
422
423 /* ATA Pass-Through 16 byte command, as described in "T10 04-262r8
424 * ATA Command Pass-Through":
425 * http://www.t10.org/ftp/t10/document.04/04-262r8.pdf */
426
427 memset(cdb, 0, sizeof(cdb));
428
429 cdb[0] = 0x85; /* OPERATION CODE: 16 byte pass through */
430
431 if (direction == SK_DIRECTION_NONE) {
432 cdb[1] = 3 << 1; /* PROTOCOL: Non-Data */
433 cdb[2] = 0x20; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=0, T_LENGTH=0 */
434
435 } else if (direction == SK_DIRECTION_IN) {
436 cdb[1] = 4 << 1; /* PROTOCOL: PIO Data-in */
437 cdb[2] = 0x2e; /* OFF_LINE=0, CK_COND=1, T_DIR=1, BYT_BLOK=1, T_LENGTH=2 */
438
439 } else if (direction == SK_DIRECTION_OUT) {
440 cdb[1] = 5 << 1; /* PROTOCOL: PIO Data-Out */
441 cdb[2] = 0x26; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=1, T_LENGTH=2 */
442 }
443
444 cdb[3] = bytes[0]; /* FEATURES */
445 cdb[4] = bytes[1];
446
447 cdb[5] = bytes[2]; /* SECTORS */
448 cdb[6] = bytes[3];
449
450 cdb[8] = bytes[9]; /* LBA LOW */
451 cdb[10] = bytes[8]; /* LBA MID */
452 cdb[12] = bytes[7]; /* LBA HIGH */
453
454 cdb[13] = bytes[10] & 0x4F; /* SELECT */
455 cdb[14] = (uint8_t) command;
456
457 memset(sense, 0, sizeof(sense));
458
459 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len ? *len : 0, sense, sizeof(sense))) < 0)
460 return ret;
461
462 if (sense[0] != 0x72 || desc[0] != 0x9 || desc[1] != 0x0c) {
463 errno = EIO;
464 return -1;
465 }
466
467 memset(bytes, 0, 12);
468
469 bytes[1] = desc[3];
470 bytes[2] = desc[4];
471 bytes[3] = desc[5];
472 bytes[9] = desc[7];
473 bytes[8] = desc[9];
474 bytes[7] = desc[11];
475 bytes[10] = desc[12];
476 bytes[11] = desc[13];
477
478 return ret;
479 }
480
481 static int disk_passthrough_12_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
482 uint8_t *bytes = cmd_data;
483 uint8_t cdb[12];
484 uint8_t sense[32];
485 uint8_t *desc = sense+8;
486 int ret;
487
488 static const int direction_map[] = {
489 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
490 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
491 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
492 };
493
494 assert(d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12);
495
496 /* ATA Pass-Through 12 byte command, as described in "T10 04-262r8
497 * ATA Command Pass-Through":
498 * http://www.t10.org/ftp/t10/document.04/04-262r8.pdf */
499
500 memset(cdb, 0, sizeof(cdb));
501
502 cdb[0] = 0xa1; /* OPERATION CODE: 12 byte pass through */
503
504 if (direction == SK_DIRECTION_NONE) {
505 cdb[1] = 3 << 1; /* PROTOCOL: Non-Data */
506 cdb[2] = 0x20; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=0, T_LENGTH=0 */
507
508 } else if (direction == SK_DIRECTION_IN) {
509 cdb[1] = 4 << 1; /* PROTOCOL: PIO Data-in */
510 cdb[2] = 0x2e; /* OFF_LINE=0, CK_COND=1, T_DIR=1, BYT_BLOK=1, T_LENGTH=2 */
511
512 } else if (direction == SK_DIRECTION_OUT) {
513 cdb[1] = 5 << 1; /* PROTOCOL: PIO Data-Out */
514 cdb[2] = 0x26; /* OFF_LINE=0, CK_COND=1, T_DIR=0, BYT_BLOK=1, T_LENGTH=2 */
515 }
516
517 cdb[3] = bytes[1]; /* FEATURES */
518 cdb[4] = bytes[3]; /* SECTORS */
519
520 cdb[5] = bytes[9]; /* LBA LOW */
521 cdb[6] = bytes[8]; /* LBA MID */
522 cdb[7] = bytes[7]; /* LBA HIGH */
523
524 cdb[8] = bytes[10] & 0x4F; /* SELECT */
525 cdb[9] = (uint8_t) command;
526
527 memset(sense, 0, sizeof(sense));
528
529 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len ? *len : 0, sense, sizeof(sense))) < 0)
530 return ret;
531
532 if (sense[0] != 0x72 || desc[0] != 0x9 || desc[1] != 0x0c) {
533 errno = EIO;
534 return -1;
535 }
536
537 memset(bytes, 0, 12);
538
539 bytes[1] = desc[3]; /* FEATURES */
540 bytes[2] = desc[4]; /* STATUS */
541 bytes[3] = desc[5]; /* SECTORS */
542 bytes[9] = desc[7]; /* LBA LOW */
543 bytes[8] = desc[9]; /* LBA MID */
544 bytes[7] = desc[11]; /* LBA HIGH */
545 bytes[10] = desc[12]; /* SELECT */
546 bytes[11] = desc[13]; /* ERROR */
547
548 return ret;
549 }
550
551 static int disk_sunplus_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
552 uint8_t *bytes = cmd_data;
553 uint8_t cdb[12];
554 uint8_t sense[32], buf[8];
555 int ret;
556 static const int direction_map[] = {
557 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
558 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
559 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
560 };
561
562 assert(d->type == SK_DISK_TYPE_SUNPLUS);
563
564 /* SunplusIT specific SCSI ATA pass-thru. Inspired by smartmonutils' support for these bridges */
565
566 memset(cdb, 0, sizeof(cdb));
567
568 cdb[0] = 0xF8; /* OPERATION CODE: Sunplus specific */
569 cdb[1] = 0x00; /* Subcommand: Pass-thru */
570 cdb[2] = 0x22;
571
572 if (direction == SK_DIRECTION_NONE)
573 cdb[3] = 0x00; /* protocol */
574 else if (direction == SK_DIRECTION_IN)
575 cdb[3] = 0x10; /* protocol */
576 else if (direction == SK_DIRECTION_OUT)
577 cdb[3] = 0x11; /* protocol */
578
579 cdb[4] = bytes[3]; /* size? */
580 cdb[5] = bytes[1]; /* FEATURES */
581 cdb[6] = bytes[3]; /* SECTORS */
582 cdb[7] = bytes[9]; /* LBA LOW */
583 cdb[8] = bytes[8]; /* LBA MID */
584 cdb[9] = bytes[7]; /* LBA HIGH */
585 cdb[10] = bytes[10] | 0xA0; /* SELECT */
586 cdb[11] = (uint8_t) command;
587
588 memset(sense, 0, sizeof(sense));
589
590 /* Issue request */
591 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len ? *len : 0, sense, sizeof(sense))) < 0)
592 return ret;
593
594 memset(cdb, 0, sizeof(cdb));
595
596 cdb[0] = 0xF8;
597 cdb[1] = 0x00;
598 cdb[2] = 0x21;
599
600 memset(buf, 0, sizeof(buf));
601
602 /* Ask for response */
603 if ((ret = sg_io(d->fd, SG_DXFER_FROM_DEV, cdb, sizeof(cdb), buf, sizeof(buf), sense, sizeof(sense))) < 0)
604 return ret;
605
606 memset(bytes, 0, 12);
607
608 bytes[2] = buf[1]; /* ERROR */
609 bytes[3] = buf[2]; /* SECTORS */
610 bytes[9] = buf[3]; /* LBA LOW */
611 bytes[8] = buf[4]; /* LBA MID */
612 bytes[7] = buf[5]; /* LBA HIGH */
613 bytes[10] = buf[6]; /* SELECT */
614 bytes[11] = buf[7]; /* STATUS */
615
616 return ret;
617 }
618
619 static int disk_jmicron_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* _data, size_t *_len) {
620 uint8_t *bytes = cmd_data;
621 uint8_t cdb[12];
622 uint8_t sense[32];
623 uint8_t port;
624 int ret;
625 SkBool is_smart_status = FALSE;
626 void *data = _data;
627 size_t len = _len ? *_len : 0;
628 uint8_t smart_status = 0;
629
630 static const int direction_map[] = {
631 [SK_DIRECTION_NONE] = SG_DXFER_NONE,
632 [SK_DIRECTION_IN] = SG_DXFER_FROM_DEV,
633 [SK_DIRECTION_OUT] = SG_DXFER_TO_DEV
634 };
635
636 assert(d->type == SK_DISK_TYPE_JMICRON);
637
638 /* JMicron specific SCSI ATA pass-thru. Inspired by smartmonutils' support for these bridges */
639
640 memset(cdb, 0, sizeof(cdb));
641
642 cdb[0] = 0xdf; /* operation code */
643 cdb[1] = 0x10;
644 cdb[2] = 0x00;
645 cdb[3] = 0x00; /* size HI */
646 cdb[4] = sizeof(port); /* size LO */
647 cdb[5] = 0x00;
648 cdb[6] = 0x72; /* register address HI */
649 cdb[7] = 0x0f; /* register address LO */
650 cdb[8] = 0x00;
651 cdb[9] = 0x00;
652 cdb[10] = 0x00;
653 cdb[11] = 0xfd;
654
655 memset(sense, 0, sizeof(sense));
656
657 if ((ret = sg_io(d->fd, SG_DXFER_FROM_DEV, cdb, sizeof(cdb), &port, sizeof(port), sense, sizeof(sense))) < 0)
658 return ret;
659
660 /* Port & 0x04 is port #0, Port & 0x40 is port #1 */
661 if (!(port & 0x44))
662 return -EIO;
663
664 cdb[0] = 0xdf; /* OPERATION CODE: 12 byte pass through */
665
666 if (command == SK_ATA_COMMAND_SMART && bytes[1] == SK_SMART_COMMAND_RETURN_STATUS) {
667 /* We need to rewrite the SMART status request */
668 is_smart_status = TRUE;
669 direction = SK_DIRECTION_IN;
670 data = &smart_status;
671 len = sizeof(smart_status);
672 cdb[1] = 0x10;
673 } else if (direction == SK_DIRECTION_NONE)
674 cdb[1] = 0x10;
675 else if (direction == SK_DIRECTION_IN)
676 cdb[1] = 0x10;
677 else if (direction == SK_DIRECTION_OUT)
678 cdb[1] = 0x00;
679
680 cdb[2] = 0x00;
681
682 cdb[3] = (uint8_t) (len >> 8);
683 cdb[4] = (uint8_t) (len & 0xFF);
684
685 cdb[5] = bytes[1]; /* FEATURES */
686 cdb[6] = bytes[3]; /* SECTORS */
687
688 cdb[7] = bytes[9]; /* LBA LOW */
689 cdb[8] = bytes[8]; /* LBA MID */
690 cdb[9] = bytes[7]; /* LBA HIGH */
691
692 cdb[10] = bytes[10] | ((port & 0x04) ? 0xA0 : 0xB0); /* SELECT */
693 cdb[11] = (uint8_t) command;
694
695 memset(sense, 0, sizeof(sense));
696
697 if ((ret = sg_io(d->fd, direction_map[direction], cdb, sizeof(cdb), data, len, sense, sizeof(sense))) < 0)
698 return ret;
699
700 memset(bytes, 0, 12);
701
702 if (is_smart_status) {
703 if (smart_status == 0x01 || smart_status == 0xc2) {
704 bytes[7] = 0xc2; /* LBA HIGH */
705 bytes[8] = 0x4f; /* LBA MID */
706 } else if (smart_status == 0x00 || smart_status == 0x2c) {
707 bytes[7] = 0x2c; /* LBA HIGH */
708 bytes[8] = 0xf4; /* LBA MID */
709 } else
710 return -EIO;
711 } else {
712 uint8_t regbuf[16];
713
714 cdb[0] = 0xdf; /* operation code */
715 cdb[1] = 0x10;
716 cdb[2] = 0x00;
717 cdb[3] = 0x00; /* size HI */
718 cdb[4] = sizeof(regbuf); /* size LO */
719 cdb[5] = 0x00;
720 cdb[6] = (port & 0x04) ? 0x80 : 0x90; /* register address HI */
721 cdb[7] = 0x00; /* register address LO */
722 cdb[8] = 0x00;
723 cdb[9] = 0x00;
724 cdb[10] = 0x00;
725 cdb[11] = 0xfd;
726
727 if ((ret = sg_io(d->fd, SG_DXFER_FROM_DEV, cdb, sizeof(cdb), regbuf, sizeof(regbuf), sense, sizeof(sense))) < 0)
728 return ret;
729
730 bytes[2] = regbuf[14]; /* STATUS */
731 bytes[3] = regbuf[0]; /* SECTORS */
732 bytes[9] = regbuf[6]; /* LBA LOW */
733 bytes[8] = regbuf[4]; /* LBA MID */
734 bytes[7] = regbuf[10]; /* LBA HIGH */
735 bytes[10] = regbuf[9]; /* SELECT */
736 bytes[11] = regbuf[13]; /* ERROR */
737 }
738
739 return ret;
740 }
741
742 static int disk_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
743
744 static int (* const disk_command_table[_SK_DISK_TYPE_MAX]) (SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) = {
745 [SK_DISK_TYPE_ATA] = disk_ata_command,
746 [SK_DISK_TYPE_ATA_PASSTHROUGH_12] = disk_passthrough_12_command,
747 [SK_DISK_TYPE_ATA_PASSTHROUGH_16] = disk_passthrough_16_command,
748 [SK_DISK_TYPE_SUNPLUS] = disk_sunplus_command,
749 [SK_DISK_TYPE_JMICRON] = disk_jmicron_command,
750 [SK_DISK_TYPE_BLOB] = NULL,
751 [SK_DISK_TYPE_UNKNOWN] = NULL
752 };
753
754 assert(d);
755 assert(d->type <= _SK_DISK_TYPE_MAX);
756 assert(direction <= _SK_DIRECTION_MAX);
757
758 assert(direction == SK_DIRECTION_NONE || (data && len && *len > 0));
759 assert(direction != SK_DIRECTION_NONE || (!data && !len));
760
761 if (!disk_command_table[d->type]) {
762 errno = -ENOTSUP;
763 return -1;
764 }
765
766 return disk_command_table[d->type](d, command, direction, cmd_data, data, len);
767 }
768
769 static int disk_identify_device(SkDisk *d) {
770 uint16_t cmd[6];
771 int ret;
772 size_t len = 512;
773 const uint8_t *p;
774
775 if (d->type == SK_DISK_TYPE_BLOB)
776 return 0;
777
778 memset(d->identify, 0, len);
779 memset(cmd, 0, sizeof(cmd));
780
781 cmd[1] = htons(1);
782
783 if ((ret = disk_command(d, SK_ATA_COMMAND_IDENTIFY_DEVICE, SK_DIRECTION_IN, cmd, d->identify, &len)) < 0)
784 return ret;
785
786 if (len != 512) {
787 errno = EIO;
788 return -1;
789 }
790
791 /* Check if IDENTIFY data is all NULs */
792 for (p = d->identify; p < (const uint8_t*) d->identify+len; p++)
793 if (*p) {
794 p = NULL;
795 break;
796 }
797
798 if (p) {
799 errno = EIO;
800 return -1;
801 }
802
803 d->identify_valid = TRUE;
804
805 return 0;
806 }
807
808 int sk_disk_check_sleep_mode(SkDisk *d, SkBool *awake) {
809 int ret;
810 uint16_t cmd[6];
811 uint8_t status;
812
813 if (!d->identify_valid) {
814 errno = ENOTSUP;
815 return -1;
816 }
817
818 if (d->type == SK_DISK_TYPE_BLOB) {
819 errno = ENOTSUP;
820 return -1;
821 }
822
823 memset(cmd, 0, sizeof(cmd));
824
825 if ((ret = disk_command(d, SK_ATA_COMMAND_CHECK_POWER_MODE, SK_DIRECTION_NONE, cmd, NULL, 0)) < 0)
826 return ret;
827
828 if (cmd[0] != 0 || (ntohs(cmd[5]) & 1) != 0) {
829 errno = EIO;
830 return -1;
831 }
832
833 status = ntohs(cmd[1]) & 0xFF;
834 *awake = status == 0xFF || status == 0x80; /* idle and active/idle is considered awake */
835
836 return 0;
837 }
838
839 static int disk_smart_enable(SkDisk *d, SkBool b) {
840 uint16_t cmd[6];
841
842 if (!disk_smart_is_available(d)) {
843 errno = ENOTSUP;
844 return -1;
845 }
846
847 if (d->type == SK_DISK_TYPE_BLOB) {
848 errno = ENOTSUP;
849 return -1;
850 }
851
852 memset(cmd, 0, sizeof(cmd));
853
854 cmd[0] = htons(b ? SK_SMART_COMMAND_ENABLE_OPERATIONS : SK_SMART_COMMAND_DISABLE_OPERATIONS);
855 cmd[2] = htons(0x0000U);
856 cmd[3] = htons(0x00C2U);
857 cmd[4] = htons(0x4F00U);
858
859 return disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_NONE, cmd, NULL, 0);
860 }
861
862 int sk_disk_smart_read_data(SkDisk *d) {
863 uint16_t cmd[6];
864 int ret;
865 size_t len = 512;
866
867 if (!disk_smart_is_available(d)) {
868 errno = ENOTSUP;
869 return -1;
870 }
871
872 if (d->type == SK_DISK_TYPE_BLOB)
873 return 0;
874
875 memset(cmd, 0, sizeof(cmd));
876
877 cmd[0] = htons(SK_SMART_COMMAND_READ_DATA);
878 cmd[1] = htons(1);
879 cmd[2] = htons(0x0000U);
880 cmd[3] = htons(0x00C2U);
881 cmd[4] = htons(0x4F00U);
882
883 if ((ret = disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_IN, cmd, d->smart_data, &len)) < 0)
884 return ret;
885
886 d->smart_data_valid = TRUE;
887
888 return ret;
889 }
890
891 static int disk_smart_read_thresholds(SkDisk *d) {
892 uint16_t cmd[6];
893 int ret;
894 size_t len = 512;
895
896 if (!disk_smart_is_available(d)) {
897 errno = ENOTSUP;
898 return -1;
899 }
900
901 if (d->type == SK_DISK_TYPE_BLOB)
902 return 0;
903
904 memset(cmd, 0, sizeof(cmd));
905
906 cmd[0] = htons(SK_SMART_COMMAND_READ_THRESHOLDS);
907 cmd[1] = htons(1);
908 cmd[2] = htons(0x0000U);
909 cmd[3] = htons(0x00C2U);
910 cmd[4] = htons(0x4F00U);
911
912 if ((ret = disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_IN, cmd, d->smart_thresholds, &len)) < 0)
913 return ret;
914
915 d->smart_thresholds_valid = TRUE;
916
917 return ret;
918 }
919
920 int sk_disk_smart_status(SkDisk *d, SkBool *good) {
921 uint16_t cmd[6];
922 int ret;
923
924 if (!disk_smart_is_available(d)) {
925 errno = ENOTSUP;
926 return -1;
927 }
928
929 if (d->type == SK_DISK_TYPE_BLOB) {
930
931 if (d->blob_smart_status_valid) {
932 *good = d->blob_smart_status;
933 return 0;
934 }
935
936 errno = ENXIO;
937 return -1;
938 }
939
940 memset(cmd, 0, sizeof(cmd));
941
942 cmd[0] = htons(SK_SMART_COMMAND_RETURN_STATUS);
943 cmd[1] = htons(0x0000U);
944 cmd[3] = htons(0x00C2U);
945 cmd[4] = htons(0x4F00U);
946
947 if ((ret = disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_NONE, cmd, NULL, 0)) < 0)
948 return ret;
949
950 /* SAT/USB bridges truncate packets, so we only check for 4F,
951 * not for 2C on those */
952 if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) &&
953 cmd[4] == htons(0x4F00U))
954 *good = TRUE;
955 else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) &&
956 cmd[4] == htons(0xF400U))
957 *good = FALSE;
958 else {
959 errno = EIO;
960 return -1;
961 }
962
963 return ret;
964 }
965
966 int sk_disk_smart_self_test(SkDisk *d, SkSmartSelfTest test) {
967 uint16_t cmd[6];
968 int ret;
969
970 if (!disk_smart_is_available(d)) {
971 errno = ENOTSUP;
972 return -1;
973 }
974
975 if (d->type == SK_DISK_TYPE_BLOB) {
976 errno = ENOTSUP;
977 return -1;
978 }
979
980 if (!d->smart_data_valid)
981 if ((ret = sk_disk_smart_read_data(d)) < 0)
982 return -1;
983
984 assert(d->smart_data_valid);
985
986 if (test != SK_SMART_SELF_TEST_SHORT &&
987 test != SK_SMART_SELF_TEST_EXTENDED &&
988 test != SK_SMART_SELF_TEST_CONVEYANCE &&
989 test != SK_SMART_SELF_TEST_ABORT) {
990 errno = EINVAL;
991 return -1;
992 }
993
994 if (!disk_smart_is_start_test_available(d)
995 || (test == SK_SMART_SELF_TEST_ABORT && !disk_smart_is_abort_test_available(d))
996 || ((test == SK_SMART_SELF_TEST_SHORT || test == SK_SMART_SELF_TEST_EXTENDED) && !disk_smart_is_short_and_extended_test_available(d))
997 || (test == SK_SMART_SELF_TEST_CONVEYANCE && !disk_smart_is_conveyance_test_available(d))) {
998 errno = ENOTSUP;
999 return -1;
1000 }
1001
1002 if (test == SK_SMART_SELF_TEST_ABORT &&
1003 !disk_smart_is_abort_test_available(d)) {
1004 errno = ENOTSUP;
1005 return -1;
1006 }
1007
1008 memset(cmd, 0, sizeof(cmd));
1009
1010 cmd[0] = htons(SK_SMART_COMMAND_EXECUTE_OFFLINE_IMMEDIATE);
1011 cmd[2] = htons(0x0000U);
1012 cmd[3] = htons(0x00C2U);
1013 cmd[4] = htons(0x4F00U | (uint16_t) test);
1014
1015 return disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_NONE, cmd, NULL, NULL);
1016 }
1017
1018 static void swap_strings(char *s, size_t len) {
1019 assert((len & 1) == 0);
1020
1021 for (; len > 0; s += 2, len -= 2) {
1022 char t;
1023 t = s[0];
1024 s[0] = s[1];
1025 s[1] = t;
1026 }
1027 }
1028
1029 static void clean_strings(char *s) {
1030 char *e;
1031
1032 for (e = s; *e; e++)
1033 if (*e < ' ' || *e >= 127)
1034 *e = ' ';
1035 }
1036
1037 static void drop_spaces(char *s) {
1038 char *d = s;
1039 SkBool prev_space = FALSE;
1040
1041 s += strspn(s, " ");
1042
1043 for (;*s; s++) {
1044
1045 if (prev_space) {
1046 if (*s != ' ') {
1047 prev_space = FALSE;
1048 *(d++) = ' ';
1049 *(d++) = *s;
1050 }
1051 } else {
1052 if (*s == ' ')
1053 prev_space = TRUE;
1054 else
1055 *(d++) = *s;
1056 }
1057 }
1058
1059 *d = 0;
1060 }
1061
1062 static void read_string(char *d, uint8_t *s, size_t len) {
1063 memcpy(d, s, len);
1064 d[len] = 0;
1065 swap_strings(d, len);
1066 clean_strings(d);
1067 drop_spaces(d);
1068 }
1069
1070 int sk_disk_identify_parse(SkDisk *d, const SkIdentifyParsedData **ipd) {
1071 assert(d);
1072 assert(ipd);
1073
1074 if (!d->identify_valid) {
1075 errno = ENOENT;
1076 return -1;
1077 }
1078
1079 read_string(d->identify_parsed_data.serial, d->identify+20, 20);
1080 read_string(d->identify_parsed_data.firmware, d->identify+46, 8);
1081 read_string(d->identify_parsed_data.model, d->identify+54, 40);
1082
1083 *ipd = &d->identify_parsed_data;
1084
1085 return 0;
1086 }
1087
1088 int sk_disk_smart_is_available(SkDisk *d, SkBool *b) {
1089 assert(d);
1090 assert(b);
1091
1092 if (!d->identify_valid) {
1093 errno = ENOTSUP;
1094 return -1;
1095 }
1096
1097 *b = disk_smart_is_available(d);
1098 return 0;
1099 }
1100
1101 int sk_disk_identify_is_available(SkDisk *d, SkBool *b) {
1102 assert(d);
1103 assert(b);
1104
1105 *b = d->identify_valid;
1106 return 0;
1107 }
1108
1109 const char *sk_smart_offline_data_collection_status_to_string(SkSmartOfflineDataCollectionStatus status) {
1110
1111 /* %STRINGPOOLSTART% */
1112 static const char* const map[] = {
1113 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_NEVER] = ((const char*) 143),
1114 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUCCESS] = ((const char*) 196),
1115 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_INPROGRESS] = ((const char*) 259),
1116 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUSPENDED] = ((const char*) 290),
1117 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_ABORTED] = ((const char*) 376),
1118 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL] = ((const char*) 460),
1119 [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN] = ((const char*) 540)
1120 };
1121 /* %STRINGPOOLSTOP% */
1122
1123 if (status >= _SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_MAX)
1124 return NULL;
1125
1126 return _P(map[status]);
1127 }
1128
1129 const char *sk_smart_self_test_execution_status_to_string(SkSmartSelfTestExecutionStatus status) {
1130
1131 /* %STRINGPOOLSTART% */
1132 static const char* const map[] = {
1133 [SK_SMART_SELF_TEST_EXECUTION_STATUS_SUCCESS_OR_NEVER] = ((const char*) 555),
1134 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ABORTED] = ((const char*) 645),
1135 [SK_SMART_SELF_TEST_EXECUTION_STATUS_INTERRUPTED] = ((const char*) 692),
1136 [SK_SMART_SELF_TEST_EXECUTION_STATUS_FATAL] = ((const char*) 777),
1137 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_UNKNOWN] = ((const char*) 936),
1138 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_ELECTRICAL] = ((const char*) 1037),
1139 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_SERVO] = ((const char*) 1120),
1140 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_READ] = ((const char*) 1217),
1141 [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_HANDLING] = ((const char*) 1294),
1142 [SK_SMART_SELF_TEST_EXECUTION_STATUS_INPROGRESS] = ((const char*) 1416)
1143 };
1144 /* %STRINGPOOLSTOP% */
1145
1146 if (status >= _SK_SMART_SELF_TEST_EXECUTION_STATUS_MAX)
1147 return NULL;
1148
1149 return _P(map[status]);
1150 }
1151
1152 const char* sk_smart_self_test_to_string(SkSmartSelfTest test) {
1153
1154 switch (test) {
1155 case SK_SMART_SELF_TEST_SHORT:
1156 return "short";
1157 case SK_SMART_SELF_TEST_EXTENDED:
1158 return "extended";
1159 case SK_SMART_SELF_TEST_CONVEYANCE:
1160 return "conveyance";
1161 case SK_SMART_SELF_TEST_ABORT:
1162 return "abort";
1163 }
1164
1165 return NULL;
1166 }
1167
1168 SkBool sk_smart_self_test_available(const SkSmartParsedData *d, SkSmartSelfTest test) {
1169 assert(d);
1170
1171 if (!d->start_test_available)
1172 return FALSE;
1173
1174 switch (test) {
1175 case SK_SMART_SELF_TEST_SHORT:
1176 case SK_SMART_SELF_TEST_EXTENDED:
1177 return d->short_and_extended_test_available;
1178 case SK_SMART_SELF_TEST_CONVEYANCE:
1179 return d->conveyance_test_available;
1180 case SK_SMART_SELF_TEST_ABORT:
1181 return d->abort_test_available;
1182 default:
1183 return FALSE;
1184 }
1185 }
1186
1187 unsigned sk_smart_self_test_polling_minutes(const SkSmartParsedData *d, SkSmartSelfTest test) {
1188 assert(d);
1189
1190 if (!sk_smart_self_test_available(d, test))
1191 return 0;
1192
1193 switch (test) {
1194 case SK_SMART_SELF_TEST_SHORT:
1195 return d->short_test_polling_minutes;
1196 case SK_SMART_SELF_TEST_EXTENDED:
1197 return d->extended_test_polling_minutes;
1198 case SK_SMART_SELF_TEST_CONVEYANCE:
1199 return d->conveyance_test_polling_minutes;
1200 default:
1201 return 0;
1202 }
1203 }
1204
1205 static void make_pretty(SkSmartAttributeParsedData *a) {
1206 uint64_t fourtyeight;
1207
1208 if (!a->name)
1209 return;
1210
1211 if (a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_UNKNOWN)
1212 return;
1213
1214 fourtyeight =
1215 ((uint64_t) a->raw[0]) |
1216 (((uint64_t) a->raw[1]) << 8) |
1217 (((uint64_t) a->raw[2]) << 16) |
1218 (((uint64_t) a->raw[3]) << 24) |
1219 (((uint64_t) a->raw[4]) << 32) |
1220 (((uint64_t) a->raw[5]) << 40);
1221
1222 if (!strcmp(a->name, "spin-up-time"))
1223 a->pretty_value = fourtyeight & 0xFFFF;
1224 else if (!strcmp(a->name, "airflow-temperature-celsius") ||
1225 !strcmp(a->name, "temperature-celsius") ||
1226 !strcmp(a->name, "temperature-celsius-2"))
1227 a->pretty_value = (fourtyeight & 0xFFFF)*1000 + 273150;
1228 else if (!strcmp(a->name, "temperature-centi-celsius"))
1229 a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150;
1230 else if (!strcmp(a->name, "power-on-minutes"))
1231 a->pretty_value = (((uint64_t) a->raw[0]) | (uint64_t) a->raw[1]) * 60 * 1000;
1232 else if (!strcmp(a->name, "power-on-seconds"))
1233 a->pretty_value = fourtyeight * 1000;
1234 else if (!strcmp(a->name, "power-on-half-minutes"))
1235 a->pretty_value = fourtyeight * 30 * 1000;
1236 else if (!strcmp(a->name, "power-on-hours") ||
1237 !strcmp(a->name, "loaded-hours") ||
1238 !strcmp(a->name, "head-flying-hours"))
1239 a->pretty_value = fourtyeight * 60 * 60 * 1000;
1240 else if (!strcmp(a->name, "reallocated-sector-count"))
1241 a->pretty_value = fourtyeight & 0xFFFFFFFFU;
1242 else
1243 a->pretty_value = fourtyeight;
1244 }
1245
1246 typedef struct SkSmartAttributeInfo {
1247 const char *name;
1248 SkSmartAttributeUnit unit;
1249 } SkSmartAttributeInfo;
1250
1251 /* This data is stolen from smartmontools */
1252
1253 /* %STRINGPOOLSTART% */
1254 static const SkSmartAttributeInfo const attribute_info[256] = {
1255 [1] = { ((const char*) 1446), SK_SMART_ATTRIBUTE_UNIT_NONE },
1256 [2] = { ((const char*) 1466), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1257 [3] = { ((const char*) 1489), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1258 [4] = { ((const char*) 1502), SK_SMART_ATTRIBUTE_UNIT_NONE },
1259 [5] = { ((const char*) 1519), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1260 [6] = { ((const char*) 1544), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1261 [7] = { ((const char*) 1564), SK_SMART_ATTRIBUTE_UNIT_NONE },
1262 [8] = { ((const char*) 1580), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1263 [9] = { ((const char*) 1602), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1264 [10] = { ((const char*) 1617), SK_SMART_ATTRIBUTE_UNIT_NONE },
1265 [11] = { ((const char*) 1634), SK_SMART_ATTRIBUTE_UNIT_NONE },
1266 [12] = { ((const char*) 1658), SK_SMART_ATTRIBUTE_UNIT_NONE },
1267 [13] = { ((const char*) 1676), SK_SMART_ATTRIBUTE_UNIT_NONE },
1268 [187] = { ((const char*) 1697), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1269 [189] = { ((const char*) 1716), SK_SMART_ATTRIBUTE_UNIT_NONE },
1270 [190] = { ((const char*) 1732), SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
1271 [191] = { ((const char*) 1760), SK_SMART_ATTRIBUTE_UNIT_NONE },
1272 [192] = { ((const char*) 1779), SK_SMART_ATTRIBUTE_UNIT_NONE },
1273 [193] = { ((const char*) 1803), SK_SMART_ATTRIBUTE_UNIT_NONE },
1274 [194] = { ((const char*) 1820), SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
1275 [195] = { ((const char*) 1842), SK_SMART_ATTRIBUTE_UNIT_NONE },
1276 [196] = { ((const char*) 1865), SK_SMART_ATTRIBUTE_UNIT_NONE },
1277 [197] = { ((const char*) 1889), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1278 [198] = { ((const char*) 1912), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
1279 [199] = { ((const char*) 1934), SK_SMART_ATTRIBUTE_UNIT_NONE },
1280 [200] = { ((const char*) 1955), SK_SMART_ATTRIBUTE_UNIT_NONE },
1281 [201] = { ((const char*) 1977), SK_SMART_ATTRIBUTE_UNIT_NONE },
1282 [202] = { ((const char*) 1998), SK_SMART_ATTRIBUTE_UNIT_NONE },
1283 [203] = { ((const char*) 2016), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1284 [204] = { ((const char*) 2031), SK_SMART_ATTRIBUTE_UNIT_NONE },
1285 [205] = { ((const char*) 2054), SK_SMART_ATTRIBUTE_UNIT_NONE },
1286 [206] = { ((const char*) 2076), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1287 [207] = { ((const char*) 2090), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1288 [208] = { ((const char*) 2108), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN},
1289 [209] = { ((const char*) 2118), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1290 [220] = { ((const char*) 2143), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1291 [221] = { ((const char*) 2154), SK_SMART_ATTRIBUTE_UNIT_NONE },
1292 [222] = { ((const char*) 2175), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1293 [223] = { ((const char*) 2188), SK_SMART_ATTRIBUTE_UNIT_NONE },
1294 [224] = { ((const char*) 2205), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1295 [225] = { ((const char*) 2219), SK_SMART_ATTRIBUTE_UNIT_NONE },
1296 [226] = { ((const char*) 2238), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1297 [227] = { ((const char*) 2251), SK_SMART_ATTRIBUTE_UNIT_NONE },
1298 [228] = { ((const char*) 2266), SK_SMART_ATTRIBUTE_UNIT_NONE },
1299 [230] = { ((const char*) 2292), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
1300 [231] = { ((const char*) 1740), SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
1301 [240] = { ((const char*) 2307), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
1302 [250] = { ((const char*) 2325), SK_SMART_ATTRIBUTE_UNIT_NONE }
1303 };
1304 /* %STRINGPOOLSTOP% */
1305
1306 typedef enum SkSmartQuirk {
1307 SK_SMART_QUIRK_9_POWERONMINUTES = 1,
1308 SK_SMART_QUIRK_9_POWERONSECONDS = 2,
1309 SK_SMART_QUIRK_9_POWERONHALFMINUTES = 4,
1310 SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT = 8,
1311 SK_SMART_QUIRK_193_LOADUNLOAD = 16,
1312 SK_SMART_QUIRK_194_10XCELSIUS = 32,
1313 SK_SMART_QUIRK_194_UNKNOWN = 64,
1314 SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128,
1315 SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256,
1316 SK_SMART_QUIRK_9_UNKNOWN = 512
1317 } SkSmartQuirk;
1318
1319 /* %STRINGPOOLSTART% */
1320 static const char *quirk_name[] = {
1321 ((const char*) 2347),
1322 ((const char*) 2364),
1323 ((const char*) 2381),
1324 ((const char*) 2402),
1325 ((const char*) 2430),
1326 ((const char*) 2445),
1327 ((const char*) 2460),
1328 ((const char*) 2472),
1329 ((const char*) 2492),
1330 ((const char*) 2512),
1331 NULL
1332 };
1333 /* %STRINGPOOLSTOP% */
1334
1335 typedef struct SkSmartQuirkDatabase {
1336 const char *model;
1337 const char *firmware;
1338 SkSmartQuirk quirk;
1339 } SkSmartQuirkDatabase;
1340
1341 static const SkSmartQuirkDatabase quirk_database[] = { {
1342
1343 /*** Seagate */
1344 "^ST9160821AS$",
1345 NULL,
1346 SK_SMART_QUIRK_9_UNKNOWN
1347 }, {
1348
1349 /*** Fujitsu */
1350 "^FUJITSU MHR2040AT$",
1351 NULL,
1352 SK_SMART_QUIRK_9_POWERONSECONDS|
1353 SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT|
1354 SK_SMART_QUIRK_200_WRITEERRORCOUNT
1355 }, {
1356 "^FUJITSU MHS20[6432]0AT( .)?$",
1357 NULL,
1358 SK_SMART_QUIRK_9_POWERONSECONDS|
1359 SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT|
1360 SK_SMART_QUIRK_200_WRITEERRORCOUNT|
1361 SK_SMART_QUIRK_201_DETECTEDTACOUNT
1362 }, {
1363 "^("
1364 "FUJITSU M1623TAU|"
1365 "FUJITSU MHG2...ATU?.*|"
1366 "FUJITSU MHH2...ATU?.*|"
1367 "FUJITSU MHJ2...ATU?.*|"
1368 "FUJITSU MHK2...ATU?.*|"
1369 "FUJITSU MHL2300AT|"
1370 "FUJITSU MHM2(20|15|10|06)0AT|"
1371 "FUJITSU MHN2...AT|"
1372 "FUJITSU MHR2020AT|"
1373 "FUJITSU MHT2...(AH|AS|AT|BH)U?.*|"
1374 "FUJITSU MHU2...ATU?.*|"
1375 "FUJITSU MHV2...(AH|AS|AT|BH|BS|BT).*|"
1376 "FUJITSU MP[A-G]3...A[HTEV]U?.*"
1377 ")$",
1378 NULL,
1379 SK_SMART_QUIRK_9_POWERONSECONDS
1380 }, {
1381
1382 /*** Samsung ***/
1383 "^("
1384 "SAMSUNG SV4012H|"
1385 "SAMSUNG SP(0451|08[0124]2|12[0145]3|16[0145]4)[CN]"
1386 ")$",
1387 NULL,
1388 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1389 }, {
1390 "^("
1391 "SAMSUNG SV0412H|"
1392 "SAMSUNG SV1204H"
1393 ")$",
1394 NULL,
1395 SK_SMART_QUIRK_9_POWERONHALFMINUTES|
1396 SK_SMART_QUIRK_194_10XCELSIUS
1397 }, {
1398 "^SAMSUNG SP40A2H$",
1399 "^RR100-07$",
1400 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1401 }, {
1402 "^SAMSUNG SP80A4H$",
1403 "^RT100-06$",
1404 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1405 }, {
1406 "^SAMSUNG SP8004H$",
1407 "^QW100-61$",
1408 SK_SMART_QUIRK_9_POWERONHALFMINUTES
1409 }, {
1410
1411 /*** Maxtor */
1412 "^("
1413 "Maxtor 2B0(0[468]|1[05]|20)H1|"
1414 "Maxtor 4G(120J6|160J[68])|"
1415 "Maxtor 4D0(20H1|40H2|60H3|80H4)"
1416 ")$",
1417 NULL,
1418 SK_SMART_QUIRK_9_POWERONMINUTES|
1419 SK_SMART_QUIRK_194_UNKNOWN
1420 }, {
1421 "^("
1422 "Maxtor 2F0[234]0[JL]0|"
1423 "Maxtor 8(1280A2|2160A4|2560A4|3840A6|4000A6|5120A8)|"
1424 "Maxtor 8(2160D2|3228D3|3240D3|4320D4|6480D6|8400D8|8455D8)|"
1425 "Maxtor 9(0510D4|0576D4|0648D5|0720D5|0840D6|0845D6|0864D6|1008D7|1080D8|1152D8)|"
1426 "Maxtor 9(1(360|350|202)D8|1190D7|10[12]0D6|0840D5|06[48]0D4|0510D3|1(350|202)E8|1010E6|0840E5|0640E4)|"
1427 "Maxtor 9(0512D2|0680D3|0750D3|0913D4|1024D4|1360D6|1536D6|1792D7|2048D8)|"
1428 "Maxtor 9(2732U8|2390U7|204[09]U6|1707U5|1366U4|1024U3|0845U3|0683U2)|"
1429 "Maxtor 4(R0[68]0[JL]0|R1[26]0L0|A160J0|R120L4)|"
1430 "Maxtor (91728D8|91512D7|91303D6|91080D5|90845D4|90645D3|90648D[34]|90432D2)|"
1431 "Maxtor 9(0431U1|0641U2|0871U2|1301U3|1741U4)|"
1432 "Maxtor (94091U8|93071U6|92561U5|92041U4|91731U4|91531U3|91361U3|91021U2|90841U2|90651U2)|"
1433 "Maxtor (33073U4|32049U3|31536U2|30768U1|33073H4|32305H3|31536H2|30768H1)|"
1434 "Maxtor (93652U8|92739U6|91826U4|91369U3|90913U2|90845U2|90435U1)|"
1435 "Maxtor 9(0684U2|1024U2|1362U3|1536U3|2049U4|2562U5|3073U6|4098U8)|"
1436 "Maxtor (54098[UH]8|53073[UH]6|52732[UH]6|52049[UH]4|51536[UH]3|51369[UH]3|51024[UH]2)|"
1437 "Maxtor 3(1024H1|1535H2|2049H2|3073H3|4098H4)( B)?|"
1438 "Maxtor 5(4610H6|4098H6|3073H4|2049H3|1536H2|1369H2|1023H2)|"
1439 "Maxtor 9(1023U2|1536U2|2049U3|2305U3|3073U4|4610U6|6147U8)|"
1440 "Maxtor 9(1023H2|1536H2|2049H3|2305H3|3073H4|4098H6|4610H6|6147H8)|"
1441 "Maxtor 5T0(60H6|40H4|30H3|20H2|10H1)|"
1442 "Maxtor (98196H8|96147H6)|"
1443 "Maxtor 4W(100H6|080H6|060H4|040H3|030H2)|"
1444 "Maxtor 6(E0[234]|K04)0L0|"
1445 "Maxtor 6(B(30|25|20|16|12|10|08)0[MPRS]|L(080[MLP]|(100|120)[MP]|160[MP]|200[MPRS]|250[RS]|300[RS]))0|"
1446 "Maxtor 6Y((060|080|120|160)L0|(060|080|120|160|200|250)P0|(060|080|120|160|200|250)M0)|"
1447 "Maxtor 7Y250[PM]0|"
1448 "Maxtor [45]A(25|30|32)0[JN]0|"
1449 "Maxtor 7L(25|30)0[SR]0"
1450 ")$",
1451 NULL,
1452 SK_SMART_QUIRK_9_POWERONMINUTES
1453 }, {
1454
1455
1456 /*** Hitachi */
1457 "^("
1458 "HITACHI_DK14FA-20B|"
1459 "HITACHI_DK23..-..B?|"
1460 "HITACHI_DK23FA-20J|HTA422020F9AT[JN]0|"
1461 "HE[JN]4230[23]0F9AT00|"
1462 "HTC4260[23]0G5CE00|HTC4260[56]0G8CE00"
1463 ")$",
1464 NULL,
1465 SK_SMART_QUIRK_9_POWERONMINUTES|
1466 SK_SMART_QUIRK_193_LOADUNLOAD
1467 }, {
1468
1469 NULL,
1470 NULL,
1471 0
1472 }
1473 };
1474
1475 static int match(const char*regex, const char *s, SkBool *result) {
1476 int k;
1477 regex_t re;
1478
1479 *result = FALSE;
1480
1481 if (regcomp(&re, regex, REG_EXTENDED|REG_NOSUB) != 0) {
1482 errno = EINVAL;
1483 return -1;
1484 }
1485
1486 if ((k = regexec(&re, s, 0, NULL, 0)) != 0) {
1487
1488 if (k != REG_NOMATCH) {
1489 regfree(&re);
1490 errno = EINVAL;
1491 return -1;
1492 }
1493
1494 } else
1495 *result = TRUE;
1496
1497 regfree(&re);
1498
1499 return 0;
1500 }
1501
1502 static int lookup_quirks(const char *model, const char *firmware, SkSmartQuirk *quirk) {
1503 int k;
1504 const SkSmartQuirkDatabase *db;
1505
1506 *quirk = 0;
1507
1508 for (db = quirk_database; db->model || db->firmware; db++) {
1509
1510 if (db->model) {
1511 SkBool matching = FALSE;
1512
1513 if ((k = match(db->model, model, &matching)) < 0)
1514 return k;
1515
1516 if (!matching)
1517 continue;
1518 }
1519
1520 if (db->firmware) {
1521 SkBool matching = FALSE;
1522
1523 if ((k = match(db->firmware, firmware, &matching)) < 0)
1524 return k;
1525
1526 if (!matching)
1527 continue;
1528 }
1529
1530 *quirk = db->quirk;
1531 return 0;
1532 }
1533
1534 return 0;
1535 }
1536
1537 static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) {
1538 const SkIdentifyParsedData *ipd;
1539 SkSmartQuirk quirk = 0;
1540
1541 /* These are the complex ones */
1542 if (sk_disk_identify_parse(d, &ipd) < 0)
1543 return NULL;
1544
1545 if (lookup_quirks(ipd->model, ipd->firmware, &quirk) < 0)
1546 return NULL;
1547
1548 if (quirk) {
1549 switch (id) {
1550
1551 case 9:
1552 /* %STRINGPOOLSTART% */
1553 if (quirk & SK_SMART_QUIRK_9_POWERONMINUTES) {
1554 static const SkSmartAttributeInfo a = {
1555 ((const char*) 2522), SK_SMART_ATTRIBUTE_UNIT_MSECONDS
1556 };
1557 return &a;
1558
1559 } else if (quirk & SK_SMART_QUIRK_9_POWERONSECONDS) {
1560 static const SkSmartAttributeInfo a = {
1561 ((const char*) 2539), SK_SMART_ATTRIBUTE_UNIT_MSECONDS
1562 };
1563 return &a;
1564
1565 } else if (quirk & SK_SMART_QUIRK_9_POWERONHALFMINUTES) {
1566 static const SkSmartAttributeInfo a = {
1567 ((const char*) 2556), SK_SMART_ATTRIBUTE_UNIT_MSECONDS
1568 };
1569 return &a;
1570 } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
1571 return NULL;
1572 /* %STRINGPOOLSTOP% */
1573
1574 break;
1575
1576 case 192:
1577 /* %STRINGPOOLSTART% */
1578 if (quirk & SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT) {
1579 static const SkSmartAttributeInfo a = {
1580 ((const char*) 2578), SK_SMART_ATTRIBUTE_UNIT_NONE
1581 };
1582 return &a;
1583 }
1584 /* %STRINGPOOLSTOP% */
1585
1586 break;
1587
1588 case 194:
1589 /* %STRINGPOOLSTART% */
1590 if (quirk & SK_SMART_QUIRK_194_10XCELSIUS) {
1591 static const SkSmartAttributeInfo a = {
1592 ((const char*) 2608), SK_SMART_ATTRIBUTE_UNIT_MKELVIN
1593 };
1594 return &a;
1595 } else if (quirk & SK_SMART_QUIRK_194_UNKNOWN)
1596 return NULL;
1597 /* %STRINGPOOLSTOP% */
1598
1599 break;
1600
1601 case 200:
1602 /* %STRINGPOOLSTART% */
1603 if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) {
1604 static const SkSmartAttributeInfo a = {
1605 ((const char*) 2634), SK_SMART_ATTRIBUTE_UNIT_NONE
1606 };
1607 return &a;
1608 }
1609 /* %STRINGPOOLSTOP% */
1610
1611 break;
1612
1613 case 201:
1614 /* %STRINGPOOLSTART% */
1615 if (quirk & SK_SMART_QUIRK_201_DETECTEDTACOUNT) {
1616 static const SkSmartAttributeInfo a = {
1617 ((const char*) 2652), SK_SMART_ATTRIBUTE_UNIT_NONE
1618 };
1619 return &a;
1620 }
1621 /* %STRINGPOOLSTOP% */
1622
1623 break;
1624 }
1625 }
1626
1627 /* These are the simple cases */
1628 if (attribute_info[id].name)
1629 return &attribute_info[id];
1630
1631 return NULL;
1632 }
1633
1634 int sk_disk_smart_parse(SkDisk *d, const SkSmartParsedData **spd) {
1635
1636 if (!d->smart_data_valid) {
1637 errno = ENOENT;
1638 return -1;
1639 }
1640
1641 switch (d->smart_data[362]) {
1642 case 0x00:
1643 case 0x80:
1644 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_NEVER;
1645 break;
1646
1647 case 0x02:
1648 case 0x82:
1649 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUCCESS;
1650 break;
1651
1652 case 0x03:
1653 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_INPROGRESS;
1654 break;
1655
1656 case 0x04:
1657 case 0x84:
1658 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUSPENDED;
1659 break;
1660
1661 case 0x05:
1662 case 0x85:
1663 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_ABORTED;
1664 break;
1665
1666 case 0x06:
1667 case 0x86:
1668 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL;
1669 break;
1670
1671 default:
1672 d->smart_parsed_data.offline_data_collection_status = SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN;
1673 break;
1674 }
1675
1676 d->smart_parsed_data.self_test_execution_percent_remaining = 10*(d->smart_data[363] & 0xF);
1677 d->smart_parsed_data.self_test_execution_status = (d->smart_data[363] >> 4) & 0xF;
1678
1679 d->smart_parsed_data.total_offline_data_collection_seconds = (uint16_t) d->smart_data[364] | ((uint16_t) d->smart_data[365] << 8);
1680
1681 d->smart_parsed_data.conveyance_test_available = disk_smart_is_conveyance_test_available(d);
1682 d->smart_parsed_data.short_and_extended_test_available = disk_smart_is_short_and_extended_test_available(d);
1683 d->smart_parsed_data.start_test_available = disk_smart_is_start_test_available(d);
1684 d->smart_parsed_data.abort_test_available = disk_smart_is_abort_test_available(d);
1685
1686 d->smart_parsed_data.short_test_polling_minutes = d->smart_data[372];
1687 d->smart_parsed_data.extended_test_polling_minutes = d->smart_data[373] != 0xFF ? d->smart_data[373] : ((uint16_t) d->smart_data[376] << 8 | (uint16_t) d->smart_data[375]);
1688 d->smart_parsed_data.conveyance_test_polling_minutes = d->smart_data[374];
1689
1690 *spd = &d->smart_parsed_data;
1691
1692 return 0;
1693 }
1694
1695 static void find_threshold(SkDisk *d, SkSmartAttributeParsedData *a) {
1696 uint8_t *p;
1697 unsigned n;
1698
1699 if (!d->smart_thresholds_valid) {
1700 a->threshold_valid = FALSE;
1701 return;
1702 }
1703
1704 for (n = 0, p = d->smart_thresholds+2; n < 30; n++, p+=12)
1705 if (p[0] == a->id)
1706 break;
1707
1708 if (n >= 30) {
1709 a->threshold_valid = FALSE;
1710 a->good_valid = FALSE;
1711 return;
1712 }
1713
1714 a->threshold = p[1];
1715 a->threshold_valid = p[1] != 0xFE;
1716
1717 a->good_valid = FALSE;
1718 a->good = TRUE;
1719
1720 /* Always-Fail and Always-Passing thresholds are not relevant
1721 * for our assessment. */
1722 if (p[1] >= 1 && p[1] <= 0xFD) {
1723
1724 if (a->worst_value_valid) {
1725 a->good = a->good && (a->worst_value > a->threshold);
1726 a->good_valid = TRUE;
1727 }
1728
1729 if (a->current_value_valid) {
1730 a->good = a->good && (a->current_value > a->threshold);
1731 a->good_valid = TRUE;
1732 }
1733 }
1734 }
1735
1736 int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb, void* userdata) {
1737 uint8_t *p;
1738 unsigned n;
1739
1740 if (!d->smart_data_valid) {
1741 errno = ENOENT;
1742 return -1;
1743 }
1744
1745 for (n = 0, p = d->smart_data + 2; n < 30; n++, p+=12) {
1746 SkSmartAttributeParsedData a;
1747 const SkSmartAttributeInfo *i;
1748 char *an = NULL;
1749
1750 if (p[0] == 0)
1751 continue;
1752
1753 memset(&a, 0, sizeof(a));
1754 a.id = p[0];
1755 a.current_value = p[3];
1756 a.current_value_valid = p[3] >= 1 && p[3] <= 0xFD;
1757 a.worst_value = p[4];
1758 a.worst_value_valid = p[4] >= 1 && p[4] <= 0xFD;
1759
1760 a.flags = ((uint16_t) p[2] << 8) | p[1];
1761 a.prefailure = !!(p[1] & 1);
1762 a.online = !!(p[1] & 2);
1763
1764 memcpy(a.raw, p+5, 6);
1765
1766 if ((i = lookup_attribute(d, p[0]))) {
1767 a.name = _P(i->name);
1768 a.pretty_unit = i->unit;
1769 } else {
1770 if (asprintf(&an, "attribute-%u", a.id) < 0) {
1771 errno = ENOMEM;
1772 return -1;
1773 }
1774
1775 a.name = an;
1776 a.pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
1777 }
1778
1779 make_pretty(&a);
1780
1781 find_threshold(d, &a);
1782
1783 /* Handle a few fields specially */
1784 if ((!strcmp(a.name, "reallocated-sector-count") ||
1785 !strcmp(a.name, "current-pending-sector")) &&
1786 a.pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS &&
1787 a.pretty_value > 0) {
1788 a.good = FALSE;
1789 a.good_valid = TRUE;
1790 }
1791
1792 cb(d, &a, userdata);
1793 free(an);
1794 }
1795
1796 return 0;
1797 }
1798
1799 static const char *yes_no(SkBool b) {
1800 return b ? "yes" : "no";
1801 }
1802
1803 const char* sk_smart_attribute_unit_to_string(SkSmartAttributeUnit unit) {
1804
1805 /* %STRINGPOOLSTART% */
1806 const char * const map[] = {
1807 [SK_SMART_ATTRIBUTE_UNIT_UNKNOWN] = NULL,
1808 [SK_SMART_ATTRIBUTE_UNIT_NONE] = ((const char*) 30),
1809 [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = ((const char*) 2670),
1810 [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = ((const char*) 2673),
1811 [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = ((const char*) 2681)
1812 };
1813 /* %STRINGPOOLSTOP% */
1814
1815 if (unit >= _SK_SMART_ATTRIBUTE_UNIT_MAX)
1816 return NULL;
1817
1818 return _P(map[unit]);
1819 }
1820
1821 struct attr_helper {
1822 uint64_t *value;
1823 SkBool found;
1824 };
1825
1826 static void temperature_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1827
1828 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_MKELVIN)
1829 return;
1830
1831 if (!strcmp(a->name, "temperature-centi-celsius") ||
1832 !strcmp(a->name, "temperature-celsius") ||
1833 !strcmp(a->name, "temperature-celsius-2") ||
1834 !strcmp(a->name, "airflow-temperature-celsius")) {
1835
1836 if (!ah->found || a->pretty_value > *ah->value)
1837 *ah->value = a->pretty_value;
1838
1839 ah->found = TRUE;
1840 }
1841 }
1842
1843 int sk_disk_smart_get_temperature(SkDisk *d, uint64_t *kelvin) {
1844 struct attr_helper ah;
1845
1846 assert(d);
1847 assert(kelvin);
1848
1849 ah.found = FALSE;
1850 ah.value = kelvin;
1851
1852 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) temperature_cb, &ah) < 0)
1853 return -1;
1854
1855 if (!ah.found) {
1856 errno = ENOENT;
1857 return -1;
1858 }
1859
1860 return 0;
1861 }
1862
1863 static void power_on_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1864
1865 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_MSECONDS)
1866 return;
1867
1868 if (!strcmp(a->name, "power-on-minutes") ||
1869 !strcmp(a->name, "power-on-seconds") ||
1870 !strcmp(a->name, "power-on-half-minutes") ||
1871 !strcmp(a->name, "power-on-hours")) {
1872
1873 if (!ah->found || a->pretty_value > *ah->value)
1874 *ah->value = a->pretty_value;
1875
1876 ah->found = TRUE;
1877 }
1878 }
1879
1880 int sk_disk_smart_get_power_on(SkDisk *d, uint64_t *mseconds) {
1881 struct attr_helper ah;
1882
1883 assert(d);
1884 assert(mseconds);
1885
1886 ah.found = FALSE;
1887 ah.value = mseconds;
1888
1889 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) power_on_cb, &ah) < 0)
1890 return -1;
1891
1892 if (!ah.found) {
1893 errno = ENOENT;
1894 return -1;
1895 }
1896
1897 return 0;
1898 }
1899
1900 static void power_cycle_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1901
1902 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_NONE)
1903 return;
1904
1905 if (!strcmp(a->name, "power-cycle-count")) {
1906
1907 if (!ah->found || a->pretty_value > *ah->value)
1908 *ah->value = a->pretty_value;
1909
1910 ah->found = TRUE;
1911 }
1912 }
1913
1914 int sk_disk_smart_get_power_cycle(SkDisk *d, uint64_t *count) {
1915 struct attr_helper ah;
1916
1917 assert(d);
1918 assert(count);
1919
1920 ah.found = FALSE;
1921 ah.value = count;
1922
1923 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) power_cycle_cb, &ah) < 0)
1924 return -1;
1925
1926 if (!ah.found) {
1927 errno = ENOENT;
1928 return -1;
1929 }
1930
1931 return 0;
1932 }
1933
1934 static void reallocated_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1935
1936 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_SECTORS)
1937 return;
1938
1939 if (!strcmp(a->name, "reallocated-sector-count")) {
1940
1941 if (!ah->found || a->pretty_value > *ah->value)
1942 *ah->value = a->pretty_value;
1943
1944 ah->found = TRUE;
1945 }
1946 }
1947
1948 static void pending_cb(SkDisk *d, const SkSmartAttributeParsedData *a, struct attr_helper *ah) {
1949
1950 if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_SECTORS)
1951 return;
1952
1953 if (!strcmp(a->name, "current-pending-sector")) {
1954
1955 if (!ah->found || a->pretty_value > *ah->value)
1956 *ah->value = a->pretty_value;
1957
1958 ah->found = TRUE;
1959 }
1960 }
1961
1962 int sk_disk_smart_get_bad(SkDisk *d, uint64_t *sectors) {
1963 struct attr_helper ah1, ah2;
1964 uint64_t sectors1, sectors2;
1965
1966 assert(d);
1967 assert(sectors);
1968
1969 ah1.found = FALSE;
1970 ah1.value = &sectors1;
1971
1972 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) reallocated_cb, &ah1) < 0)
1973 return -1;
1974
1975 ah2.found = FALSE;
1976 ah2.value = &sectors2;
1977
1978 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) pending_cb, &ah2) < 0)
1979 return -1;
1980
1981 if (!ah1.found && !ah2.found) {
1982 errno = ENOENT;
1983 return -1;
1984 }
1985
1986 if (ah1.found && ah2.found)
1987 *sectors = sectors1 + sectors2;
1988 else if (ah1.found)
1989 *sectors = sectors1;
1990 else
1991 *sectors = sectors2;
1992
1993 return 0;
1994 }
1995
1996 const char* sk_smart_overall_to_string(SkSmartOverall overall) {
1997
1998 /* %STRINGPOOLSTART% */
1999 const char * const map[] = {
2000 [SK_SMART_OVERALL_GOOD] = ((const char*) 2684),
2001 [SK_SMART_OVERALL_BAD_STATUS] = ((const char*) 2689),
2002 [SK_SMART_OVERALL_BAD_ATTRIBUTE] = ((const char*) 2700),
2003 [SK_SMART_OVERALL_BAD_SECTOR] = ((const char*) 2714)
2004 };
2005 /* %STRINGPOOLSTOP% */
2006
2007 if (overall >= _SK_SMART_OVERALL_MAX)
2008 return NULL;
2009
2010 return _P(map[overall]);
2011 }
2012
2013 static void bad_attribute_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
2014 if (a->prefailure && a->good_valid && !a->good)
2015 *good = FALSE;
2016 }
2017
2018 int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall) {
2019 SkBool good;
2020 uint64_t sectors;
2021
2022 assert(d);
2023 assert(overall);
2024
2025 if (sk_disk_smart_status(d, &good) < 0)
2026 return -1;
2027
2028 if (!good) {
2029 *overall = SK_SMART_OVERALL_BAD_STATUS;
2030 return 0;
2031 }
2032
2033 if (sk_disk_smart_get_bad(d, &sectors) < 0) {
2034 if (errno != ENOENT)
2035 return -1;
2036 } else if (sectors > 0) {
2037 *overall = SK_SMART_OVERALL_BAD_SECTOR;
2038 return 0;
2039 }
2040
2041 good = TRUE;
2042 if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_cb, &good) < 0)
2043 return -1;
2044
2045 if (!good) {
2046 *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE;
2047 return 0;
2048 }
2049
2050 *overall = SK_SMART_OVERALL_GOOD;
2051 return 0;
2052 }
2053
2054 static char* print_name(char *s, size_t len, uint8_t id, const char *k) {
2055
2056 if (k)
2057 strncpy(s, k, len);
2058 else
2059 snprintf(s, len, "%u", id);
2060
2061 s[len-1] = 0;
2062
2063 return s;
2064 }
2065
2066 static char *print_value(char *s, size_t len, uint64_t pretty_value, SkSmartAttributeUnit pretty_unit) {
2067
2068 switch (pretty_unit) {
2069 case SK_SMART_ATTRIBUTE_UNIT_MSECONDS:
2070
2071 if (pretty_value >= 1000LLU*60LLU*60LLU*24LLU*365LLU)
2072 snprintf(s, len, "%0.1f years", ((double) pretty_value)/(1000.0*60*60*24*365));
2073 else if (pretty_value >= 1000LLU*60LLU*60LLU*24LLU*30LLU)
2074 snprintf(s, len, "%0.1f months", ((double) pretty_value)/(1000.0*60*60*24*30));
2075 else if (pretty_value >= 1000LLU*60LLU*60LLU*24LLU)
2076 snprintf(s, len, "%0.1f days", ((double) pretty_value)/(1000.0*60*60*24));
2077 else if (pretty_value >= 1000LLU*60LLU*60LLU)
2078 snprintf(s, len, "%0.1f h", ((double) pretty_value)/(1000.0*60*60));
2079 else if (pretty_value >= 1000LLU*60LLU)
2080 snprintf(s, len, "%0.1f min", ((double) pretty_value)/(1000.0*60));
2081 else if (pretty_value >= 1000LLU)
2082 snprintf(s, len, "%0.1f s", ((double) pretty_value)/(1000.0));
2083 else
2084 snprintf(s, len, "%llu ms", (unsigned long long) pretty_value);
2085
2086 break;
2087
2088 case SK_SMART_ATTRIBUTE_UNIT_MKELVIN:
2089 snprintf(s, len, "%0.1f C", ((double) pretty_value - 273150) / 1000);
2090 break;
2091
2092 case SK_SMART_ATTRIBUTE_UNIT_SECTORS:
2093 snprintf(s, len, "%llu sectors", (unsigned long long) pretty_value);
2094 break;
2095
2096 case SK_SMART_ATTRIBUTE_UNIT_NONE:
2097 snprintf(s, len, "%llu", (unsigned long long) pretty_value);
2098 break;
2099
2100 case SK_SMART_ATTRIBUTE_UNIT_UNKNOWN:
2101 snprintf(s, len, "n/a");
2102 break;
2103
2104 case _SK_SMART_ATTRIBUTE_UNIT_MAX:
2105 assert(FALSE);
2106 }
2107
2108 s[len-1] = 0;
2109
2110 return s;
2111 }
2112
2113 #define HIGHLIGHT "\x1B[1m"
2114 #define ENDHIGHLIGHT "\x1B[0m"
2115
2116 static void disk_dump_attributes(SkDisk *d, const SkSmartAttributeParsedData *a, void* userdata) {
2117 char name[32];
2118 char pretty[32];
2119 char tt[32], tw[32], tc[32];
2120 SkBool highlight;
2121
2122 snprintf(tt, sizeof(tt), "%3u", a->threshold);
2123 tt[sizeof(tt)-1] = 0;
2124 snprintf(tw, sizeof(tw), "%3u", a->worst_value);
2125 tw[sizeof(tw)-1] = 0;
2126 snprintf(tc, sizeof(tc), "%3u", a->current_value);
2127 tc[sizeof(tc)-1] = 0;
2128
2129 highlight = a->good_valid && !a->good && isatty(1);
2130
2131 if (highlight)
2132 fprintf(stderr, HIGHLIGHT);
2133
2134 printf("%3u %-27s %-3s %-3s %-3s %-11s 0x%02x%02x%02x%02x%02x%02x %-7s %-7s %-3s\n",
2135 a->id,
2136 print_name(name, sizeof(name), a->id, a->name),
2137 a->current_value_valid ? tc : "n/a",
2138 a->worst_value_valid ? tw : "n/a",
2139 a->threshold_valid ? tt : "n/a",
2140 print_value(pretty, sizeof(pretty), a->pretty_value, a->pretty_unit),
2141 a->raw[0], a->raw[1], a->raw[2], a->raw[3], a->raw[4], a->raw[5],
2142 a->prefailure ? "prefail" : "old-age",
2143 a->online ? "online" : "offline",
2144 a->good_valid ? yes_no(a->good) : "n/a");
2145
2146 if (highlight)
2147 fprintf(stderr, ENDHIGHLIGHT);
2148 }
2149
2150 int sk_disk_dump(SkDisk *d) {
2151 int ret;
2152 SkBool awake = FALSE;
2153 uint64_t size;
2154
2155 assert(d);
2156
2157 printf("Device: %s\n"
2158 "Type: %s\n",
2159 d->name ? d->name : "n/a",
2160 disk_type_to_string(d->type));
2161
2162 ret = sk_disk_get_size(d, &size);
2163 if (ret >= 0)
2164 printf("Size: %lu MiB\n", (unsigned long) (d->size/1024/1024));
2165 else
2166 printf("Size: %s\n", strerror(errno));
2167
2168 if (d->identify_valid) {
2169 const SkIdentifyParsedData *ipd;
2170 SkSmartQuirk quirk = 0;
2171 unsigned i;
2172
2173 if ((ret = sk_disk_identify_parse(d, &ipd)) < 0)
2174 return ret;
2175
2176 printf("Model: [%s]\n"
2177 "Serial: [%s]\n"
2178 "Firmware: [%s]\n"
2179 "SMART Available: %s\n",
2180 ipd->model,
2181 ipd->serial,
2182 ipd->firmware,
2183 yes_no(disk_smart_is_available(d)));
2184
2185 if ((ret = lookup_quirks(ipd->model, ipd->firmware, &quirk)))
2186 return ret;
2187
2188 printf("Quirks:");
2189
2190 for (i = 0; quirk_name[i]; i++)
2191 if (quirk & (1<<i))
2192 printf(" %s", _P(quirk_name[i]));
2193
2194 printf("\n");
2195
2196 }
2197
2198 ret = sk_disk_check_sleep_mode(d, &awake);
2199 printf("Awake: %s\n",
2200 ret >= 0 ? yes_no(awake) : strerror(errno));
2201
2202 if (disk_smart_is_available(d)) {
2203 SkSmartOverall overall;
2204 const SkSmartParsedData *spd;
2205 SkBool good;
2206 char pretty[32];
2207 uint64_t value, power_on;
2208
2209 ret = sk_disk_smart_status(d, &good);
2210 printf("SMART Disk Health Good: %s\n",
2211 ret >= 0 ? yes_no(good) : strerror(errno));
2212
2213 if ((ret = sk_disk_smart_read_data(d)) < 0)
2214 return ret;
2215
2216 if ((ret = sk_disk_smart_parse(d, &spd)) < 0)
2217 return ret;
2218
2219 printf("Off-line Data Collection Status: [%s]\n"
2220 "Total Time To Complete Off-Line Data Collection: %u s\n"
2221 "Self-Test Execution Status: [%s]\n"
2222 "Percent Self-Test Remaining: %u%%\n"
2223 "Conveyance Self-Test Available: %s\n"
2224 "Short/Extended Self-Test Available: %s\n"
2225 "Start Self-Test Available: %s\n"
2226 "Abort Self-Test Available: %s\n"
2227 "Short Self-Test Polling Time: %u min\n"
2228 "Extended Self-Test Polling Time: %u min\n"
2229 "Conveyance Self-Test Polling Time: %u min\n",
2230 sk_smart_offline_data_collection_status_to_string(spd->offline_data_collection_status),
2231 spd->total_offline_data_collection_seconds,
2232 sk_smart_self_test_execution_status_to_string(spd->self_test_execution_status),
2233 spd->self_test_execution_percent_remaining,
2234 yes_no(spd->conveyance_test_available),
2235 yes_no(spd->short_and_extended_test_available),
2236 yes_no(spd->start_test_available),
2237 yes_no(spd->abort_test_available),
2238 spd->short_test_polling_minutes,
2239 spd->extended_test_polling_minutes,
2240 spd->conveyance_test_polling_minutes);
2241
2242 if (sk_disk_smart_get_bad(d, &value) < 0)
2243 printf("Bad Sectors: %s\n", strerror(errno));
2244 else
2245 printf("%sBad Sectors: %s%s\n",
2246 value > 0 ? HIGHLIGHT : "",
2247 print_value(pretty, sizeof(pretty), value, SK_SMART_ATTRIBUTE_UNIT_SECTORS),
2248 value > 0 ? ENDHIGHLIGHT : "");
2249
2250 if (sk_disk_smart_get_power_on(d, &power_on) < 0) {
2251 printf("Powered On: %s\n", strerror(errno));
2252 power_on = 0;
2253 } else
2254 printf("Powered On: %s\n", print_value(pretty, sizeof(pretty), power_on, SK_SMART_ATTRIBUTE_UNIT_MSECONDS));
2255
2256 if (sk_disk_smart_get_power_cycle(d, &value) < 0)
2257 printf("Power Cycles: %s\n", strerror(errno));
2258 else {
2259 printf("Power Cycles: %llu\n", (unsigned long long) value);
2260
2261 if (value > 0 && power_on > 0)
2262 printf("Average Powered On Per Power Cycle: %s\n", print_value(pretty, sizeof(pretty), power_on/value, SK_SMART_ATTRIBUTE_UNIT_MSECONDS));
2263 }
2264
2265 if (sk_disk_smart_get_temperature(d, &value) < 0)
2266 printf("Temperature: %s\n", strerror(errno));
2267 else
2268 printf("Temperature: %s\n", print_value(pretty, sizeof(pretty), value, SK_SMART_ATTRIBUTE_UNIT_MKELVIN));
2269
2270 if (sk_disk_smart_get_overall(d, &overall) < 0)
2271 printf("Overall Status: %s\n", strerror(errno));
2272 else
2273 printf("%sOverall Status: %s%s\n",
2274 overall != SK_SMART_OVERALL_GOOD ? HIGHLIGHT : "",
2275 sk_smart_overall_to_string(overall),
2276 overall != SK_SMART_OVERALL_GOOD ? ENDHIGHLIGHT : "");
2277
2278 printf("%3s %-27s %5s %5s %5s %-11s %-14s %-7s %-7s %-3s\n",
2279 "ID#",
2280 "Name",
2281 "Value",
2282 "Worst",
2283 "Thres",
2284 "Pretty",
2285 "Raw",
2286 "Type",
2287 "Updates",
2288 "Good");
2289
2290 if ((ret = sk_disk_smart_parse_attributes(d, disk_dump_attributes, NULL)) < 0)
2291 return ret;
2292 } else
2293 printf("ATA SMART not supported.\n");
2294
2295 return 0;
2296 }
2297
2298 int sk_disk_get_size(SkDisk *d, uint64_t *bytes) {
2299 assert(d);
2300 assert(bytes);
2301
2302 if (d->size == (uint64_t) -1) {
2303 errno = ENODATA;
2304 return -1;
2305 }
2306
2307 *bytes = d->size;
2308 return 0;
2309 }
2310
2311 static int disk_find_type(SkDisk *d, dev_t devnum) {
2312 struct udev *udev;
2313 struct udev_device *dev = NULL, *usb;
2314 int r = -1;
2315
2316 assert(d);
2317
2318 if (!(udev = udev_new())) {
2319 errno = ENXIO;
2320 goto finish;
2321 }
2322
2323 if (!(dev = udev_device_new_from_devnum(udev, 'b', devnum))) {
2324 errno = ENODEV;
2325 goto finish;
2326 }
2327
2328 if ((usb = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device"))) {
2329 const char *product, *vendor;
2330 uint32_t pid, vid;
2331
2332 if (!(product = udev_device_get_sysattr_value(usb, "idProduct")) ||
2333 sscanf(product, "%04x", &pid) != 1) {
2334 errno = ENODEV;
2335 goto finish;
2336 }
2337
2338 if (!(vendor = udev_device_get_sysattr_value(usb, "idVendor")) ||
2339 sscanf(vendor, "%04x", &vid) != 1) {
2340 errno = ENODEV;
2341 goto finish;
2342 }
2343
2344 if ((vid == 0x0c0b && pid == 0xb159) ||
2345 (vid == 0x04fc && pid == 0x0c25))
2346 d->type = SK_DISK_TYPE_SUNPLUS;
2347 if ((vid == 0x152d && pid == 0x2329) ||
2348 (vid == 0x152d && pid == 0x2336) ||
2349 (vid == 0x152d && pid == 0x2338) ||
2350 (vid == 0x152d && pid == 0x2339))
2351 d->type = SK_DISK_TYPE_JMICRON;
2352 else
2353 d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_12;
2354
2355 } else if (udev_device_get_parent_with_subsystem_devtype(dev, "ide", NULL))
2356 d->type = SK_DISK_TYPE_ATA;
2357 else if (udev_device_get_parent_with_subsystem_devtype(dev, "scsi", NULL))
2358 d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_16;
2359 else
2360 d->type = SK_DISK_TYPE_UNKNOWN;
2361
2362 r = 0;
2363
2364 finish:
2365 if (dev)
2366 udev_device_unref(dev);
2367
2368 if (udev)
2369 udev_unref(udev);
2370
2371 return r;
2372 }
2373
2374 int sk_disk_open(const char *name, SkDisk **_d) {
2375 SkDisk *d;
2376 int ret = -1;
2377 struct stat st;
2378
2379 assert(_d);
2380
2381 if (!(d = calloc(1, sizeof(SkDisk)))) {
2382 errno = ENOMEM;
2383 goto fail;
2384 }
2385
2386 if (!name) {
2387 d->fd = -1;
2388 d->type = SK_DISK_TYPE_BLOB;
2389 d->size = (uint64_t) -1;
2390 } else {
2391
2392 if (!(d->name = strdup(name))) {
2393 errno = ENOMEM;
2394 goto fail;
2395 }
2396
2397 if ((d->fd = open(name,
2398 O_RDONLY|O_NOCTTY|O_NONBLOCK
2399 #ifdef O_CLOEXEC
2400 |O_CLOEXEC
2401 #endif
2402
2403 )) < 0) {
2404 ret = d->fd;
2405 goto fail;
2406 }
2407
2408 if ((ret = fstat(d->fd, &st)) < 0)
2409 goto fail;
2410
2411 if (!S_ISBLK(st.st_mode)) {
2412 errno = ENODEV;
2413 ret = -1;
2414 goto fail;
2415 }
2416
2417 /* So, it's a block device. Let's make sure the ioctls work */
2418 if ((ret = ioctl(d->fd, BLKGETSIZE64, &d->size)) < 0)
2419 goto fail;
2420
2421 if (d->size <= 0 || d->size == (uint64_t) -1) {
2422 errno = EIO;
2423 ret = -1;
2424 goto fail;
2425 }
2426
2427 /* OK, it's a real block device with a size. Now let's find the suitable API */
2428 if ((ret = disk_find_type(d, st.st_rdev)) < 0)
2429 goto fail;
2430
2431 if (d->type == SK_DISK_TYPE_UNKNOWN) {
2432 /* We have no clue, so let's autotest for a working API */
2433 for (d->type = 0; d->type < _SK_DISK_TYPE_TEST_MAX; d->type++)
2434 if (disk_identify_device(d) >= 0)
2435 break;
2436 if (d->type >= _SK_DISK_TYPE_TEST_MAX)
2437 d->type = SK_DISK_TYPE_UNKNOWN;
2438 } else
2439 disk_identify_device(d);
2440
2441 /* Check if driver can do SMART, and enable if necessary */
2442 if (disk_smart_is_available(d)) {
2443
2444 if (!disk_smart_is_enabled(d)) {
2445 if ((ret = disk_smart_enable(d, TRUE)) < 0)
2446 goto fail;
2447
2448 if ((ret = disk_identify_device(d)) < 0)
2449 goto fail;
2450
2451 if (!disk_smart_is_enabled(d)) {
2452 errno = EIO;
2453 ret = -1;
2454 goto fail;
2455 }
2456 }
2457
2458 disk_smart_read_thresholds(d);
2459 }
2460 }
2461
2462 *_d = d;
2463
2464 return 0;
2465
2466 fail:
2467
2468 if (d)
2469 sk_disk_free(d);
2470
2471 return ret;
2472 }
2473
2474 void sk_disk_free(SkDisk *d) {
2475 assert(d);
2476
2477 if (d->fd >= 0)
2478 close(d->fd);
2479
2480 free(d->name);
2481 free(d->blob);
2482 free(d);
2483 }
2484
2485 int sk_disk_get_blob(SkDisk *d, const void **blob, size_t *rsize) {
2486 size_t size;
2487 SkBool good, have_good = FALSE;
2488 uint32_t *p;
2489
2490 assert(d);
2491 assert(blob);
2492 assert(rsize);
2493
2494 size =
2495 (d->identify_valid ? 8 + sizeof(d->identify) : 0) +
2496 (d->smart_data_valid ? 8 + sizeof(d->smart_data) : 0) +
2497 (d->smart_thresholds ? 8 + sizeof(d->smart_thresholds) : 0);
2498
2499 if (sk_disk_smart_status(d, &good) >= 0) {
2500 size += 12;
2501 have_good = TRUE;
2502 }
2503
2504 if (size <= 0) {
2505 errno = ENODATA;
2506 return -1;
2507 }
2508
2509 free(d->blob);
2510 if (!(d->blob = malloc(size))) {
2511 errno = ENOMEM;
2512 return -1;
2513 }
2514
2515 p = d->blob;
2516
2517 /* These memory accesses are only OK as long as all our
2518 * objects are sensibly aligned, which they are... */
2519
2520 if (d->identify_valid) {
2521 p[0] = SK_BLOB_TAG_IDENTIFY;
2522 p[1] = htonl(sizeof(d->identify));
2523 p += 2;
2524
2525 memcpy(p, d->identify, sizeof(d->identify));
2526 p = (uint32_t*) ((uint8_t*) p + sizeof(d->identify));
2527 }
2528
2529 if (have_good) {
2530 p[0] = SK_BLOB_TAG_SMART_STATUS;
2531 p[1] = htonl(4);
2532 p[2] = htonl(!!good);
2533 p += 3;
2534 }
2535
2536 if (d->smart_data_valid) {
2537 p[0] = SK_BLOB_TAG_SMART_DATA;
2538 p[1] = htonl(sizeof(d->smart_data));
2539 p += 2;
2540
2541 memcpy(p, d->smart_data, sizeof(d->smart_data));
2542 p = (uint32_t*) ((uint8_t*) p + sizeof(d->smart_data));
2543 }
2544
2545 if (d->smart_thresholds_valid) {
2546 p[0] = SK_BLOB_TAG_SMART_THRESHOLDS;
2547 p[1] = htonl(sizeof(d->smart_thresholds));
2548 p += 2;
2549
2550 memcpy(p, d->smart_thresholds, sizeof(d->smart_thresholds));
2551 p = (uint32_t*) ((uint8_t*) p + sizeof(d->smart_thresholds));
2552 }
2553
2554 assert((size_t) ((uint8_t*) p - (uint8_t*) d->blob) == size);
2555
2556 *blob = d->blob;
2557 *rsize = size;
2558
2559 return 0;
2560 }
2561
2562 int sk_disk_set_blob(SkDisk *d, const void *blob, size_t size) {
2563 const uint32_t *p;
2564 size_t left;
2565 SkBool idv = FALSE, sdv = FALSE, stv = FALSE, bssv = FALSE;
2566
2567 assert(d);
2568 assert(blob);
2569
2570 if (d->type != SK_DISK_TYPE_BLOB) {
2571 errno = ENODEV;
2572 return -1;
2573 }
2574
2575 if (size <= 0) {
2576 errno = EINVAL;
2577 return -1;
2578 }
2579
2580 /* First run, verify if everything makes sense */
2581 p = blob;
2582 left = size;
2583 while (left > 0) {
2584 uint32_t tag, tsize;
2585
2586 if (left < 8) {
2587 errno = EINVAL;
2588 return -1;
2589 }
2590
2591 memcpy(&tag, p, 4);
2592 memcpy(&tsize, p+1, 4);
2593 p += 2;
2594 left -= 8;
2595
2596 if (left < ntohl(tsize)) {
2597 errno = EINVAL;
2598 return -1;
2599 }
2600
2601 switch (tag) {
2602
2603 case SK_BLOB_TAG_IDENTIFY:
2604 if (ntohl(tsize) != sizeof(d->identify) || idv) {
2605 errno = EINVAL;
2606 return -1;
2607 }
2608 idv = TRUE;
2609 break;
2610
2611 case SK_BLOB_TAG_SMART_STATUS:
2612 if (ntohl(tsize) != 4 || bssv) {
2613 errno = EINVAL;
2614 return -1;
2615 }
2616 bssv = TRUE;
2617 break;
2618
2619 case SK_BLOB_TAG_SMART_DATA:
2620 if (ntohl(tsize) != sizeof(d->smart_data) || sdv) {
2621 errno = EINVAL;
2622 return -1;
2623 }
2624 sdv = TRUE;
2625 break;
2626
2627 case SK_BLOB_TAG_SMART_THRESHOLDS:
2628 if (ntohl(tsize) != sizeof(d->smart_thresholds) || stv) {
2629 errno = EINVAL;
2630 return -1;
2631 }
2632 stv = TRUE;
2633 break;
2634 }
2635
2636 p = (uint32_t*) ((uint8_t*) p + ntohl(tsize));
2637 left -= ntohl(tsize);
2638 }
2639
2640 if (!idv) {
2641 errno = -ENODATA;
2642 return -1;
2643 }
2644
2645 d->identify_valid = idv;
2646 d->smart_data_valid = sdv;
2647 d->smart_thresholds_valid = stv;
2648 d->blob_smart_status_valid = bssv;
2649
2650 /* Second run, actually copy things in */
2651 p = blob;
2652 left = size;
2653 while (left > 0) {
2654 uint32_t tag, tsize;
2655
2656 assert(left >= 8);
2657 memcpy(&tag, p, 4);
2658 memcpy(&tsize, p+1, 4);
2659 p += 2;
2660 left -= 8;
2661
2662 assert(left >= ntohl(tsize));
2663
2664 switch (tag) {
2665
2666 case SK_BLOB_TAG_IDENTIFY:
2667 assert(ntohl(tsize) == sizeof(d->identify));
2668 memcpy(d->identify, p, sizeof(d->identify));
2669 break;
2670
2671 case SK_BLOB_TAG_SMART_STATUS: {
2672 uint32_t ok;
2673 assert(ntohl(tsize) == 4);
2674 memcpy(&ok, p, 4);
2675 d->blob_smart_status = !!ok;
2676 break;
2677 }
2678
2679 case SK_BLOB_TAG_SMART_DATA:
2680 assert(ntohl(tsize) == sizeof(d->smart_data));
2681 memcpy(d->smart_data, p, sizeof(d->smart_data));
2682 break;
2683
2684 case SK_BLOB_TAG_SMART_THRESHOLDS:
2685 assert(ntohl(tsize) == sizeof(d->smart_thresholds));
2686 memcpy(d->smart_thresholds, p, sizeof(d->smart_thresholds));
2687 break;
2688 }
2689
2690 p = (uint32_t*) ((uint8_t*) p + ntohl(tsize));
2691 left -= ntohl(tsize);
2692 }
2693
2694 return 0;
2695 }
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libatasmart.
4
5 Copyright 2008 Lennart Poettering
6
7 libatasmart is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libatasmart is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libatasmart. If not, If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
22 using GLib;
23
24 [CCode (cheader_filename="atasmart.h")]
25 namespace Smart {
26
27 [CCode (cname="SkSmartSelfTest", cprefix="SK_SMART_SELF_TEST_")]
28 public enum SmartSelfTest {
29 SHORT, EXTENDED, CONVEYANCE, ABORT
30 }
31
32 [Immutable]
33 [CCode (cname="SkIdentifyParsedData")]
34 public struct IdentifyParsedData {
35 public string serial;
36 public string firmware;
37 public string model;
38 }
39
40 [CCode (cname="SkSmartOfflineDataCollectionStatus", cprefix="SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_")]
41 public enum SmartOfflineDataCollectionStatus {
42 NEVER, SUCCESS, INPROGRESS, SUSPENDED, ABORTED, FATAL, UNKNOWN
43 }
44
45 [CCode (cname="sk_smart_offline_data_collection_status_to_string")]
46 public weak string smart_offline_data_collection_status_to_string(SmartOfflineDataCollectionStatus status);
47
48
49 [CCode (cname="SkSmartSelfTestExecutionStatus", cprefix="SK_SMART_SELF_TEST_EXECUTION_STATUS_")]
50 public enum SmartSelfTestExecutionStatus {
51 SUCCESS_OR_NEVER, ABORTED, INTERRUPTED, FATAL, ERROR_UNKNOWN, ERROR_ELECTRICAL, ERROR_SERVO, ERROR_READ, ERROR_HANDLING, INPROGRESS
52 }
53
54 [CCode (cname="sk_smart_self_test_execution_status_to_string")]
55 public weak string smart_self_test_execution_status_to_string(SmartSelfTestExecutionStatus status);
56
57 [Immutable]
58 [CCode (cname="SkSmartParsedData")]
59 public struct SmartParsedData {
60 public SmartOfflineDataCollectionStatus offline_data_collection_status;
61 public uint total_offline_data_collection_seconds;
62 public SmartSelfTestExecutionStatus self_test_execution_status;
63 public uint self_test_execution_percent_remaining;
64
65 public bool conveyance_test_available;
66 public bool short_and_extended_test_available;
67 public bool start_test_available;
68 public bool abort_test_available;
69
70 public uint short_test_polling_minutes;
71 public uint extended_test_polling_minutes;
72 public uint conveyance_test_polling_minutes;
73
74 [CCode (cname="sk_smart_self_test_available")]
75 public bool self_test_available(SmartSelfTest test);
76
77 [CCode (cname="sk_smart_self_test_polling_minutes")]
78 public uint self_test_polling_minutes(SmartSelfTest test);
79 }
80
81 [CCode (cname="SkSmartAttributeUnit", cprefix="SK_SMART_ATTRIBUTE_UNIT_")]
82 public enum SmartAttributeUnit {
83 UNKNOWN, NONE, MSECONDS, SECTORS, MKELVIN
84 }
85
86 [CCode (cname="sk_smart_attribute_unit_to_string")]
87 public weak string smart_attribute_unit_to_string(SmartAttributeUnit unit);
88
89 [Immutable]
90 [CCode (cname="SkSmartAttributeParsedData")]
91 public struct SmartAttributeParsedData {
92 public uint8 id;
93 public string name;
94 public SmartAttributeUnit pretty_unit;
95 public uint16 flags;
96 public uint8 threshold;
97 public bool threshold_valid;
98 public bool online;
99 public bool prefailure;
100 public bool good;
101 public uint8 current_value;
102 public uint8 worst_value;
103 public uint64 pretty_value;
104 public uint8[6] raw;
105 }
106
107 [CCode (cname="SkSmartAttributeParseCallback")]
108 public delegate void SmartAttributeParseCallback(void* disk, SmartAttributeParsedData a);
109
110 [Compact]
111 [CCode (free_function="sk_disk_free", cname="SkDisk", cprefix="sk_disk_")]
112 public class Disk {
113
114 public static int open(string name, out Disk disk);
115
116 public int get_size(out uint64 bytes);
117
118 public int check_sleep_mode(out bool awake);
119
120 public int identify_is_available(out bool available);
121 public int identify_parse(out weak IdentifyParsedData* data);
122
123 public int smart_is_available(out bool available);
124 public int smart_status(out bool good);
125 public int smart_read_data();
126 public int smart_parse_attributes(SmartAttributeParseCallback cb);
127 public int smart_parse(out weak SmartParsedData* data);
128 public int smart_self_test(SmartSelfTest test);
129
130 public int dump();
131 }
132
133 /* These two should move to an official vala package */
134 [CCode (cname="errno", cheader_filename="errno.h")]
135 public int errno;
136
137 [CCode (cname="g_strerror", cheader_filename="glib.h")]
138 public weak string strerror(int err);
139 }
0 This directory contains SMART data of bad or weird drives for testing
1 purposes. Generated with "skdump --save". File name should follow the
2 format "MODEL--FIRMWARE". Also, replace spaces by underscores ('_') so
3 that these files can be handled properly by automake.
4
5 If you add another snapshot here, make sure to edit ../Makefile.am so
6 that it is included in the tarball.
0 #!/bin/bash
1
2 # This file is part of libatasmart.
3 #
4 # Copyright 2008 Lennart Poettering
5 #
6 # libatasmart is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation, either version 2.1 of the
9 # License, or (at your option) any later version.
10 #
11 # libatasmart is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with libatasmart. If not, If not, see
18 # <http://www.gnu.org/licenses/>.
19
20 VERSION=1.9
21
22 run_versioned() {
23 local P
24 local V
25
26 V=$(echo "$2" | sed -e 's,\.,,g')
27
28 if [ -e "`which $1$V 2> /dev/null`" ] ; then
29 P="$1$V"
30 else
31 if [ -e "`which $1-$2 2> /dev/null`" ] ; then
32 P="$1-$2"
33 else
34 P="$1"
35 fi
36 fi
37
38 shift 2
39 "$P" "$@"
40 }
41
42 set -ex
43
44 if [ "x$1" = "xam" ] ; then
45 run_versioned automake "$VERSION" -a -c --foreign
46 ./config.status
47 else
48 rm -rf autom4te.cache
49 rm -f config.cache
50
51 touch config.rpath
52 test "x$LIBTOOLIZE" = "x" && LIBTOOLIZE=libtoolize
53
54 mkdir -p m4
55 "$LIBTOOLIZE" -c --force
56 run_versioned aclocal "$VERSION"
57 run_versioned autoconf 2.59 -Wall
58 run_versioned autoheader 2.59
59 run_versioned automake "$VERSION" --copy --foreign --add-missing
60
61 if test "x$NOCONFIGURE" = "x"; then
62 CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var "$@"
63 make clean
64 fi
65 fi
0 #! /bin/sh
1 # Wrapper for compilers which do not understand `-c -o'.
2
3 scriptversion=2005-05-14.22
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
6 # Written by Tom Tromey <tromey@cygnus.com>.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # This file is maintained in Automake, please report
28 # bugs to <bug-automake@gnu.org> or send patches to
29 # <automake-patches@gnu.org>.
30
31 case $1 in
32 '')
33 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
34 exit 1;
35 ;;
36 -h | --h*)
37 cat <<\EOF
38 Usage: compile [--help] [--version] PROGRAM [ARGS]
39
40 Wrapper for compilers which do not understand `-c -o'.
41 Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
42 arguments, and rename the output as expected.
43
44 If you are trying to build a whole package this is not the
45 right script to run: please start by reading the file `INSTALL'.
46
47 Report bugs to <bug-automake@gnu.org>.
48 EOF
49 exit $?
50 ;;
51 -v | --v*)
52 echo "compile $scriptversion"
53 exit $?
54 ;;
55 esac
56
57 ofile=
58 cfile=
59 eat=
60
61 for arg
62 do
63 if test -n "$eat"; then
64 eat=
65 else
66 case $1 in
67 -o)
68 # configure might choose to run compile as `compile cc -o foo foo.c'.
69 # So we strip `-o arg' only if arg is an object.
70 eat=1
71 case $2 in
72 *.o | *.obj)
73 ofile=$2
74 ;;
75 *)
76 set x "$@" -o "$2"
77 shift
78 ;;
79 esac
80 ;;
81 *.c)
82 cfile=$1
83 set x "$@" "$1"
84 shift
85 ;;
86 *)
87 set x "$@" "$1"
88 shift
89 ;;
90 esac
91 fi
92 shift
93 done
94
95 if test -z "$ofile" || test -z "$cfile"; then
96 # If no `-o' option was seen then we might have been invoked from a
97 # pattern rule where we don't need one. That is ok -- this is a
98 # normal compilation that the losing compiler can handle. If no
99 # `.c' file was seen then we are probably linking. That is also
100 # ok.
101 exec "$@"
102 fi
103
104 # Name of file we expect compiler to create.
105 cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
106
107 # Create the lock directory.
108 # Note: use `[/.-]' here to ensure that we don't use the same name
109 # that we are using for the .o file. Also, base the name on the expected
110 # object file name, since that is what matters with a parallel build.
111 lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
112 while true; do
113 if mkdir "$lockdir" >/dev/null 2>&1; then
114 break
115 fi
116 sleep 1
117 done
118 # FIXME: race condition here if user kills between mkdir and trap.
119 trap "rmdir '$lockdir'; exit 1" 1 2 15
120
121 # Run the compile.
122 "$@"
123 ret=$?
124
125 if test -f "$cofile"; then
126 mv "$cofile" "$ofile"
127 elif test -f "${cofile}bj"; then
128 mv "${cofile}bj" "$ofile"
129 fi
130
131 rmdir "$lockdir"
132 exit $ret
133
134 # Local Variables:
135 # mode: shell-script
136 # sh-indentation: 2
137 # eval: (add-hook 'write-file-hooks 'time-stamp)
138 # time-stamp-start: "scriptversion="
139 # time-stamp-format: "%:y-%02m-%02d.%02H"
140 # time-stamp-end: "$"
141 # End:
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 # Free Software Foundation, Inc.
5
6 timestamp='2008-11-15'
7
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22 #
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28
29 # Originally written by Per Bothner <per@bothner.com>.
30 # Please send patches to <config-patches@gnu.org>. Submit a context
31 # diff and a properly formatted ChangeLog entry.
32 #
33 # This script attempts to guess a canonical system name similar to
34 # config.sub. If it succeeds, it prints the system name on stdout, and
35 # exits with 0. Otherwise, it exits with 1.
36 #
37 # The plan is that this can be called by configure scripts if you
38 # don't specify an explicit build system type.
39
40 me=`echo "$0" | sed -e 's,.*/,,'`
41
42 usage="\
43 Usage: $0 [OPTION]
44
45 Output the configuration name of the system \`$me' is run on.
46
47 Operation modes:
48 -h, --help print this help, then exit
49 -t, --time-stamp print date of last modification, then exit
50 -v, --version print version number, then exit
51
52 Report bugs and patches to <config-patches@gnu.org>."
53
54 version="\
55 GNU config.guess ($timestamp)
56
57 Originally written by Per Bothner.
58 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
59 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
60
61 This is free software; see the source for copying conditions. There is NO
62 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63
64 help="
65 Try \`$me --help' for more information."
66
67 # Parse command line
68 while test $# -gt 0 ; do
69 case $1 in
70 --time-stamp | --time* | -t )
71 echo "$timestamp" ; exit ;;
72 --version | -v )
73 echo "$version" ; exit ;;
74 --help | --h* | -h )
75 echo "$usage"; exit ;;
76 -- ) # Stop option processing
77 shift; break ;;
78 - ) # Use stdin as input.
79 break ;;
80 -* )
81 echo "$me: invalid option $1$help" >&2
82 exit 1 ;;
83 * )
84 break ;;
85 esac
86 done
87
88 if test $# != 0; then
89 echo "$me: too many arguments$help" >&2
90 exit 1
91 fi
92
93 trap 'exit 1' 1 2 15
94
95 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96 # compiler to aid in system detection is discouraged as it requires
97 # temporary files to be created and, as you can see below, it is a
98 # headache to deal with in a portable fashion.
99
100 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
101 # use `HOST_CC' if defined, but it is deprecated.
102
103 # Portable tmp directory creation inspired by the Autoconf team.
104
105 set_cc_for_build='
106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108 : ${TMPDIR=/tmp} ;
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
113 dummy=$tmp/dummy ;
114 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115 case $CC_FOR_BUILD,$HOST_CC,$CC in
116 ,,) echo "int x;" > $dummy.c ;
117 for c in cc gcc c89 c99 ; do
118 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
119 CC_FOR_BUILD="$c"; break ;
120 fi ;
121 done ;
122 if test x"$CC_FOR_BUILD" = x ; then
123 CC_FOR_BUILD=no_compiler_found ;
124 fi
125 ;;
126 ,,*) CC_FOR_BUILD=$CC ;;
127 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
128 esac ; set_cc_for_build= ;'
129
130 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131 # (ghazi@noc.rutgers.edu 1994-08-24)
132 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
133 PATH=$PATH:/.attbin ; export PATH
134 fi
135
136 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140
141 # Note: order is significant - the case branches are not exclusive.
142
143 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
144 *:NetBSD:*:*)
145 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
147 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
148 # switched to ELF, *-*-netbsd* would select the old
149 # object file format. This provides both forward
150 # compatibility and a consistent mechanism for selecting the
151 # object file format.
152 #
153 # Note: NetBSD doesn't particularly care about the vendor
154 # portion of the name. We always set it to "unknown".
155 sysctl="sysctl -n hw.machine_arch"
156 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158 case "${UNAME_MACHINE_ARCH}" in
159 armeb) machine=armeb-unknown ;;
160 arm*) machine=arm-unknown ;;
161 sh3el) machine=shl-unknown ;;
162 sh3eb) machine=sh-unknown ;;
163 sh5el) machine=sh5le-unknown ;;
164 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
165 esac
166 # The Operating System including object format, if it has switched
167 # to ELF recently, or will in the future.
168 case "${UNAME_MACHINE_ARCH}" in
169 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170 eval $set_cc_for_build
171 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep __ELF__ >/dev/null
173 then
174 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175 # Return netbsd for either. FIX?
176 os=netbsd
177 else
178 os=netbsdelf
179 fi
180 ;;
181 *)
182 os=netbsd
183 ;;
184 esac
185 # The OS release
186 # Debian GNU/NetBSD machines have a different userland, and
187 # thus, need a distinct triplet. However, they do not need
188 # kernel version information, so it can be replaced with a
189 # suitable tag, in the style of linux-gnu.
190 case "${UNAME_VERSION}" in
191 Debian*)
192 release='-gnu'
193 ;;
194 *)
195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
196 ;;
197 esac
198 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199 # contains redundant information, the shorter form:
200 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}"
202 exit ;;
203 *:OpenBSD:*:*)
204 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
206 exit ;;
207 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
209 exit ;;
210 *:SolidBSD:*:*)
211 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
212 exit ;;
213 macppc:MirBSD:*:*)
214 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
215 exit ;;
216 *:MirBSD:*:*)
217 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
218 exit ;;
219 alpha:OSF1:*:*)
220 case $UNAME_RELEASE in
221 *4.0)
222 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223 ;;
224 *5.*)
225 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
226 ;;
227 esac
228 # According to Compaq, /usr/sbin/psrinfo has been available on
229 # OSF/1 and Tru64 systems produced since 1995. I hope that
230 # covers most systems running today. This code pipes the CPU
231 # types through head -n 1, so we only detect the type of CPU 0.
232 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233 case "$ALPHA_CPU_TYPE" in
234 "EV4 (21064)")
235 UNAME_MACHINE="alpha" ;;
236 "EV4.5 (21064)")
237 UNAME_MACHINE="alpha" ;;
238 "LCA4 (21066/21068)")
239 UNAME_MACHINE="alpha" ;;
240 "EV5 (21164)")
241 UNAME_MACHINE="alphaev5" ;;
242 "EV5.6 (21164A)")
243 UNAME_MACHINE="alphaev56" ;;
244 "EV5.6 (21164PC)")
245 UNAME_MACHINE="alphapca56" ;;
246 "EV5.7 (21164PC)")
247 UNAME_MACHINE="alphapca57" ;;
248 "EV6 (21264)")
249 UNAME_MACHINE="alphaev6" ;;
250 "EV6.7 (21264A)")
251 UNAME_MACHINE="alphaev67" ;;
252 "EV6.8CB (21264C)")
253 UNAME_MACHINE="alphaev68" ;;
254 "EV6.8AL (21264B)")
255 UNAME_MACHINE="alphaev68" ;;
256 "EV6.8CX (21264D)")
257 UNAME_MACHINE="alphaev68" ;;
258 "EV6.9A (21264/EV69A)")
259 UNAME_MACHINE="alphaev69" ;;
260 "EV7 (21364)")
261 UNAME_MACHINE="alphaev7" ;;
262 "EV7.9 (21364A)")
263 UNAME_MACHINE="alphaev79" ;;
264 esac
265 # A Pn.n version is a patched version.
266 # A Vn.n version is a released version.
267 # A Tn.n version is a released field test version.
268 # A Xn.n version is an unreleased experimental baselevel.
269 # 1.2 uses "1.2" for uname -r.
270 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
271 exit ;;
272 Alpha\ *:Windows_NT*:*)
273 # How do we know it's Interix rather than the generic POSIX subsystem?
274 # Should we change UNAME_MACHINE based on the output of uname instead
275 # of the specific Alpha model?
276 echo alpha-pc-interix
277 exit ;;
278 21064:Windows_NT:50:3)
279 echo alpha-dec-winnt3.5
280 exit ;;
281 Amiga*:UNIX_System_V:4.0:*)
282 echo m68k-unknown-sysv4
283 exit ;;
284 *:[Aa]miga[Oo][Ss]:*:*)
285 echo ${UNAME_MACHINE}-unknown-amigaos
286 exit ;;
287 *:[Mm]orph[Oo][Ss]:*:*)
288 echo ${UNAME_MACHINE}-unknown-morphos
289 exit ;;
290 *:OS/390:*:*)
291 echo i370-ibm-openedition
292 exit ;;
293 *:z/VM:*:*)
294 echo s390-ibm-zvmoe
295 exit ;;
296 *:OS400:*:*)
297 echo powerpc-ibm-os400
298 exit ;;
299 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
300 echo arm-acorn-riscix${UNAME_RELEASE}
301 exit ;;
302 arm:riscos:*:*|arm:RISCOS:*:*)
303 echo arm-unknown-riscos
304 exit ;;
305 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
306 echo hppa1.1-hitachi-hiuxmpp
307 exit ;;
308 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
309 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
310 if test "`(/bin/universe) 2>/dev/null`" = att ; then
311 echo pyramid-pyramid-sysv3
312 else
313 echo pyramid-pyramid-bsd
314 fi
315 exit ;;
316 NILE*:*:*:dcosx)
317 echo pyramid-pyramid-svr4
318 exit ;;
319 DRS?6000:unix:4.0:6*)
320 echo sparc-icl-nx6
321 exit ;;
322 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
323 case `/usr/bin/uname -p` in
324 sparc) echo sparc-icl-nx7; exit ;;
325 esac ;;
326 sun4H:SunOS:5.*:*)
327 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
328 exit ;;
329 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
330 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
331 exit ;;
332 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
333 eval $set_cc_for_build
334 SUN_ARCH="i386"
335 # If there is a compiler, see if it is configured for 64-bit objects.
336 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
337 # This test works for both compilers.
338 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
339 if echo '\n#ifdef __amd64\nIS_64BIT_ARCH\n#endif' | \
340 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
341 grep IS_64BIT_ARCH >/dev/null
342 then
343 SUN_ARCH="x86_64"
344 fi
345 fi
346 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
347 exit ;;
348 sun4*:SunOS:6*:*)
349 # According to config.sub, this is the proper way to canonicalize
350 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
351 # it's likely to be more like Solaris than SunOS4.
352 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
353 exit ;;
354 sun4*:SunOS:*:*)
355 case "`/usr/bin/arch -k`" in
356 Series*|S4*)
357 UNAME_RELEASE=`uname -v`
358 ;;
359 esac
360 # Japanese Language versions have a version number like `4.1.3-JL'.
361 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
362 exit ;;
363 sun3*:SunOS:*:*)
364 echo m68k-sun-sunos${UNAME_RELEASE}
365 exit ;;
366 sun*:*:4.2BSD:*)
367 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
368 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
369 case "`/bin/arch`" in
370 sun3)
371 echo m68k-sun-sunos${UNAME_RELEASE}
372 ;;
373 sun4)
374 echo sparc-sun-sunos${UNAME_RELEASE}
375 ;;
376 esac
377 exit ;;
378 aushp:SunOS:*:*)
379 echo sparc-auspex-sunos${UNAME_RELEASE}
380 exit ;;
381 # The situation for MiNT is a little confusing. The machine name
382 # can be virtually everything (everything which is not
383 # "atarist" or "atariste" at least should have a processor
384 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
385 # to the lowercase version "mint" (or "freemint"). Finally
386 # the system name "TOS" denotes a system which is actually not
387 # MiNT. But MiNT is downward compatible to TOS, so this should
388 # be no problem.
389 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
390 echo m68k-atari-mint${UNAME_RELEASE}
391 exit ;;
392 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
393 echo m68k-atari-mint${UNAME_RELEASE}
394 exit ;;
395 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
396 echo m68k-atari-mint${UNAME_RELEASE}
397 exit ;;
398 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
399 echo m68k-milan-mint${UNAME_RELEASE}
400 exit ;;
401 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
402 echo m68k-hades-mint${UNAME_RELEASE}
403 exit ;;
404 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
405 echo m68k-unknown-mint${UNAME_RELEASE}
406 exit ;;
407 m68k:machten:*:*)
408 echo m68k-apple-machten${UNAME_RELEASE}
409 exit ;;
410 powerpc:machten:*:*)
411 echo powerpc-apple-machten${UNAME_RELEASE}
412 exit ;;
413 RISC*:Mach:*:*)
414 echo mips-dec-mach_bsd4.3
415 exit ;;
416 RISC*:ULTRIX:*:*)
417 echo mips-dec-ultrix${UNAME_RELEASE}
418 exit ;;
419 VAX*:ULTRIX*:*:*)
420 echo vax-dec-ultrix${UNAME_RELEASE}
421 exit ;;
422 2020:CLIX:*:* | 2430:CLIX:*:*)
423 echo clipper-intergraph-clix${UNAME_RELEASE}
424 exit ;;
425 mips:*:*:UMIPS | mips:*:*:RISCos)
426 eval $set_cc_for_build
427 sed 's/^ //' << EOF >$dummy.c
428 #ifdef __cplusplus
429 #include <stdio.h> /* for printf() prototype */
430 int main (int argc, char *argv[]) {
431 #else
432 int main (argc, argv) int argc; char *argv[]; {
433 #endif
434 #if defined (host_mips) && defined (MIPSEB)
435 #if defined (SYSTYPE_SYSV)
436 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
437 #endif
438 #if defined (SYSTYPE_SVR4)
439 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
440 #endif
441 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
442 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
443 #endif
444 #endif
445 exit (-1);
446 }
447 EOF
448 $CC_FOR_BUILD -o $dummy $dummy.c &&
449 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
450 SYSTEM_NAME=`$dummy $dummyarg` &&
451 { echo "$SYSTEM_NAME"; exit; }
452 echo mips-mips-riscos${UNAME_RELEASE}
453 exit ;;
454 Motorola:PowerMAX_OS:*:*)
455 echo powerpc-motorola-powermax
456 exit ;;
457 Motorola:*:4.3:PL8-*)
458 echo powerpc-harris-powermax
459 exit ;;
460 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
461 echo powerpc-harris-powermax
462 exit ;;
463 Night_Hawk:Power_UNIX:*:*)
464 echo powerpc-harris-powerunix
465 exit ;;
466 m88k:CX/UX:7*:*)
467 echo m88k-harris-cxux7
468 exit ;;
469 m88k:*:4*:R4*)
470 echo m88k-motorola-sysv4
471 exit ;;
472 m88k:*:3*:R3*)
473 echo m88k-motorola-sysv3
474 exit ;;
475 AViiON:dgux:*:*)
476 # DG/UX returns AViiON for all architectures
477 UNAME_PROCESSOR=`/usr/bin/uname -p`
478 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
479 then
480 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
481 [ ${TARGET_BINARY_INTERFACE}x = x ]
482 then
483 echo m88k-dg-dgux${UNAME_RELEASE}
484 else
485 echo m88k-dg-dguxbcs${UNAME_RELEASE}
486 fi
487 else
488 echo i586-dg-dgux${UNAME_RELEASE}
489 fi
490 exit ;;
491 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
492 echo m88k-dolphin-sysv3
493 exit ;;
494 M88*:*:R3*:*)
495 # Delta 88k system running SVR3
496 echo m88k-motorola-sysv3
497 exit ;;
498 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
499 echo m88k-tektronix-sysv3
500 exit ;;
501 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
502 echo m68k-tektronix-bsd
503 exit ;;
504 *:IRIX*:*:*)
505 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
506 exit ;;
507 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
508 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
509 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
510 i*86:AIX:*:*)
511 echo i386-ibm-aix
512 exit ;;
513 ia64:AIX:*:*)
514 if [ -x /usr/bin/oslevel ] ; then
515 IBM_REV=`/usr/bin/oslevel`
516 else
517 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
518 fi
519 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
520 exit ;;
521 *:AIX:2:3)
522 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
523 eval $set_cc_for_build
524 sed 's/^ //' << EOF >$dummy.c
525 #include <sys/systemcfg.h>
526
527 main()
528 {
529 if (!__power_pc())
530 exit(1);
531 puts("powerpc-ibm-aix3.2.5");
532 exit(0);
533 }
534 EOF
535 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
536 then
537 echo "$SYSTEM_NAME"
538 else
539 echo rs6000-ibm-aix3.2.5
540 fi
541 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
542 echo rs6000-ibm-aix3.2.4
543 else
544 echo rs6000-ibm-aix3.2
545 fi
546 exit ;;
547 *:AIX:*:[456])
548 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
549 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
550 IBM_ARCH=rs6000
551 else
552 IBM_ARCH=powerpc
553 fi
554 if [ -x /usr/bin/oslevel ] ; then
555 IBM_REV=`/usr/bin/oslevel`
556 else
557 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
558 fi
559 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
560 exit ;;
561 *:AIX:*:*)
562 echo rs6000-ibm-aix
563 exit ;;
564 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
565 echo romp-ibm-bsd4.4
566 exit ;;
567 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
568 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
569 exit ;; # report: romp-ibm BSD 4.3
570 *:BOSX:*:*)
571 echo rs6000-bull-bosx
572 exit ;;
573 DPX/2?00:B.O.S.:*:*)
574 echo m68k-bull-sysv3
575 exit ;;
576 9000/[34]??:4.3bsd:1.*:*)
577 echo m68k-hp-bsd
578 exit ;;
579 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
580 echo m68k-hp-bsd4.4
581 exit ;;
582 9000/[34678]??:HP-UX:*:*)
583 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
584 case "${UNAME_MACHINE}" in
585 9000/31? ) HP_ARCH=m68000 ;;
586 9000/[34]?? ) HP_ARCH=m68k ;;
587 9000/[678][0-9][0-9])
588 if [ -x /usr/bin/getconf ]; then
589 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
590 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
591 case "${sc_cpu_version}" in
592 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
593 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
594 532) # CPU_PA_RISC2_0
595 case "${sc_kernel_bits}" in
596 32) HP_ARCH="hppa2.0n" ;;
597 64) HP_ARCH="hppa2.0w" ;;
598 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
599 esac ;;
600 esac
601 fi
602 if [ "${HP_ARCH}" = "" ]; then
603 eval $set_cc_for_build
604 sed 's/^ //' << EOF >$dummy.c
605
606 #define _HPUX_SOURCE
607 #include <stdlib.h>
608 #include <unistd.h>
609
610 int main ()
611 {
612 #if defined(_SC_KERNEL_BITS)
613 long bits = sysconf(_SC_KERNEL_BITS);
614 #endif
615 long cpu = sysconf (_SC_CPU_VERSION);
616
617 switch (cpu)
618 {
619 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
620 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
621 case CPU_PA_RISC2_0:
622 #if defined(_SC_KERNEL_BITS)
623 switch (bits)
624 {
625 case 64: puts ("hppa2.0w"); break;
626 case 32: puts ("hppa2.0n"); break;
627 default: puts ("hppa2.0"); break;
628 } break;
629 #else /* !defined(_SC_KERNEL_BITS) */
630 puts ("hppa2.0"); break;
631 #endif
632 default: puts ("hppa1.0"); break;
633 }
634 exit (0);
635 }
636 EOF
637 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
638 test -z "$HP_ARCH" && HP_ARCH=hppa
639 fi ;;
640 esac
641 if [ ${HP_ARCH} = "hppa2.0w" ]
642 then
643 eval $set_cc_for_build
644
645 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
646 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
647 # generating 64-bit code. GNU and HP use different nomenclature:
648 #
649 # $ CC_FOR_BUILD=cc ./config.guess
650 # => hppa2.0w-hp-hpux11.23
651 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
652 # => hppa64-hp-hpux11.23
653
654 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
655 grep __LP64__ >/dev/null
656 then
657 HP_ARCH="hppa2.0w"
658 else
659 HP_ARCH="hppa64"
660 fi
661 fi
662 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
663 exit ;;
664 ia64:HP-UX:*:*)
665 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
666 echo ia64-hp-hpux${HPUX_REV}
667 exit ;;
668 3050*:HI-UX:*:*)
669 eval $set_cc_for_build
670 sed 's/^ //' << EOF >$dummy.c
671 #include <unistd.h>
672 int
673 main ()
674 {
675 long cpu = sysconf (_SC_CPU_VERSION);
676 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
677 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
678 results, however. */
679 if (CPU_IS_PA_RISC (cpu))
680 {
681 switch (cpu)
682 {
683 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
684 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
685 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
686 default: puts ("hppa-hitachi-hiuxwe2"); break;
687 }
688 }
689 else if (CPU_IS_HP_MC68K (cpu))
690 puts ("m68k-hitachi-hiuxwe2");
691 else puts ("unknown-hitachi-hiuxwe2");
692 exit (0);
693 }
694 EOF
695 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
696 { echo "$SYSTEM_NAME"; exit; }
697 echo unknown-hitachi-hiuxwe2
698 exit ;;
699 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
700 echo hppa1.1-hp-bsd
701 exit ;;
702 9000/8??:4.3bsd:*:*)
703 echo hppa1.0-hp-bsd
704 exit ;;
705 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
706 echo hppa1.0-hp-mpeix
707 exit ;;
708 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
709 echo hppa1.1-hp-osf
710 exit ;;
711 hp8??:OSF1:*:*)
712 echo hppa1.0-hp-osf
713 exit ;;
714 i*86:OSF1:*:*)
715 if [ -x /usr/sbin/sysversion ] ; then
716 echo ${UNAME_MACHINE}-unknown-osf1mk
717 else
718 echo ${UNAME_MACHINE}-unknown-osf1
719 fi
720 exit ;;
721 parisc*:Lites*:*:*)
722 echo hppa1.1-hp-lites
723 exit ;;
724 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
725 echo c1-convex-bsd
726 exit ;;
727 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
728 if getsysinfo -f scalar_acc
729 then echo c32-convex-bsd
730 else echo c2-convex-bsd
731 fi
732 exit ;;
733 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
734 echo c34-convex-bsd
735 exit ;;
736 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
737 echo c38-convex-bsd
738 exit ;;
739 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
740 echo c4-convex-bsd
741 exit ;;
742 CRAY*Y-MP:*:*:*)
743 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
744 exit ;;
745 CRAY*[A-Z]90:*:*:*)
746 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
747 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
748 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
749 -e 's/\.[^.]*$/.X/'
750 exit ;;
751 CRAY*TS:*:*:*)
752 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
753 exit ;;
754 CRAY*T3E:*:*:*)
755 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
756 exit ;;
757 CRAY*SV1:*:*:*)
758 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
759 exit ;;
760 *:UNICOS/mp:*:*)
761 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
762 exit ;;
763 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
764 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
765 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
766 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
767 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
768 exit ;;
769 5000:UNIX_System_V:4.*:*)
770 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
771 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
772 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
773 exit ;;
774 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
775 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
776 exit ;;
777 sparc*:BSD/OS:*:*)
778 echo sparc-unknown-bsdi${UNAME_RELEASE}
779 exit ;;
780 *:BSD/OS:*:*)
781 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
782 exit ;;
783 *:FreeBSD:*:*)
784 case ${UNAME_MACHINE} in
785 pc98)
786 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
787 amd64)
788 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
789 *)
790 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
791 esac
792 exit ;;
793 i*:CYGWIN*:*)
794 echo ${UNAME_MACHINE}-pc-cygwin
795 exit ;;
796 *:MINGW*:*)
797 echo ${UNAME_MACHINE}-pc-mingw32
798 exit ;;
799 i*:windows32*:*)
800 # uname -m includes "-pc" on this system.
801 echo ${UNAME_MACHINE}-mingw32
802 exit ;;
803 i*:PW*:*)
804 echo ${UNAME_MACHINE}-pc-pw32
805 exit ;;
806 *:Interix*:[3456]*)
807 case ${UNAME_MACHINE} in
808 x86)
809 echo i586-pc-interix${UNAME_RELEASE}
810 exit ;;
811 EM64T | authenticamd | genuineintel)
812 echo x86_64-unknown-interix${UNAME_RELEASE}
813 exit ;;
814 IA64)
815 echo ia64-unknown-interix${UNAME_RELEASE}
816 exit ;;
817 esac ;;
818 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
819 echo i${UNAME_MACHINE}-pc-mks
820 exit ;;
821 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
822 # How do we know it's Interix rather than the generic POSIX subsystem?
823 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
824 # UNAME_MACHINE based on the output of uname instead of i386?
825 echo i586-pc-interix
826 exit ;;
827 i*:UWIN*:*)
828 echo ${UNAME_MACHINE}-pc-uwin
829 exit ;;
830 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
831 echo x86_64-unknown-cygwin
832 exit ;;
833 p*:CYGWIN*:*)
834 echo powerpcle-unknown-cygwin
835 exit ;;
836 prep*:SunOS:5.*:*)
837 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
838 exit ;;
839 *:GNU:*:*)
840 # the GNU system
841 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
842 exit ;;
843 *:GNU/*:*:*)
844 # other systems with GNU libc and userland
845 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
846 exit ;;
847 i*86:Minix:*:*)
848 echo ${UNAME_MACHINE}-pc-minix
849 exit ;;
850 arm*:Linux:*:*)
851 eval $set_cc_for_build
852 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
853 | grep -q __ARM_EABI__
854 then
855 echo ${UNAME_MACHINE}-unknown-linux-gnu
856 else
857 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
858 fi
859 exit ;;
860 avr32*:Linux:*:*)
861 echo ${UNAME_MACHINE}-unknown-linux-gnu
862 exit ;;
863 cris:Linux:*:*)
864 echo cris-axis-linux-gnu
865 exit ;;
866 crisv32:Linux:*:*)
867 echo crisv32-axis-linux-gnu
868 exit ;;
869 frv:Linux:*:*)
870 echo frv-unknown-linux-gnu
871 exit ;;
872 ia64:Linux:*:*)
873 echo ${UNAME_MACHINE}-unknown-linux-gnu
874 exit ;;
875 m32r*:Linux:*:*)
876 echo ${UNAME_MACHINE}-unknown-linux-gnu
877 exit ;;
878 m68*:Linux:*:*)
879 echo ${UNAME_MACHINE}-unknown-linux-gnu
880 exit ;;
881 mips:Linux:*:*)
882 eval $set_cc_for_build
883 sed 's/^ //' << EOF >$dummy.c
884 #undef CPU
885 #undef mips
886 #undef mipsel
887 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
888 CPU=mipsel
889 #else
890 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
891 CPU=mips
892 #else
893 CPU=
894 #endif
895 #endif
896 EOF
897 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
898 /^CPU/{
899 s: ::g
900 p
901 }'`"
902 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
903 ;;
904 mips64:Linux:*:*)
905 eval $set_cc_for_build
906 sed 's/^ //' << EOF >$dummy.c
907 #undef CPU
908 #undef mips64
909 #undef mips64el
910 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
911 CPU=mips64el
912 #else
913 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
914 CPU=mips64
915 #else
916 CPU=
917 #endif
918 #endif
919 EOF
920 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
921 /^CPU/{
922 s: ::g
923 p
924 }'`"
925 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
926 ;;
927 or32:Linux:*:*)
928 echo or32-unknown-linux-gnu
929 exit ;;
930 ppc:Linux:*:*)
931 echo powerpc-unknown-linux-gnu
932 exit ;;
933 ppc64:Linux:*:*)
934 echo powerpc64-unknown-linux-gnu
935 exit ;;
936 alpha:Linux:*:*)
937 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
938 EV5) UNAME_MACHINE=alphaev5 ;;
939 EV56) UNAME_MACHINE=alphaev56 ;;
940 PCA56) UNAME_MACHINE=alphapca56 ;;
941 PCA57) UNAME_MACHINE=alphapca56 ;;
942 EV6) UNAME_MACHINE=alphaev6 ;;
943 EV67) UNAME_MACHINE=alphaev67 ;;
944 EV68*) UNAME_MACHINE=alphaev68 ;;
945 esac
946 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
947 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
948 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
949 exit ;;
950 padre:Linux:*:*)
951 echo sparc-unknown-linux-gnu
952 exit ;;
953 parisc:Linux:*:* | hppa:Linux:*:*)
954 # Look for CPU level
955 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
956 PA7*) echo hppa1.1-unknown-linux-gnu ;;
957 PA8*) echo hppa2.0-unknown-linux-gnu ;;
958 *) echo hppa-unknown-linux-gnu ;;
959 esac
960 exit ;;
961 parisc64:Linux:*:* | hppa64:Linux:*:*)
962 echo hppa64-unknown-linux-gnu
963 exit ;;
964 s390:Linux:*:* | s390x:Linux:*:*)
965 echo ${UNAME_MACHINE}-ibm-linux
966 exit ;;
967 sh64*:Linux:*:*)
968 echo ${UNAME_MACHINE}-unknown-linux-gnu
969 exit ;;
970 sh*:Linux:*:*)
971 echo ${UNAME_MACHINE}-unknown-linux-gnu
972 exit ;;
973 sparc:Linux:*:* | sparc64:Linux:*:*)
974 echo ${UNAME_MACHINE}-unknown-linux-gnu
975 exit ;;
976 vax:Linux:*:*)
977 echo ${UNAME_MACHINE}-dec-linux-gnu
978 exit ;;
979 x86_64:Linux:*:*)
980 echo x86_64-unknown-linux-gnu
981 exit ;;
982 xtensa*:Linux:*:*)
983 echo ${UNAME_MACHINE}-unknown-linux-gnu
984 exit ;;
985 i*86:Linux:*:*)
986 # The BFD linker knows what the default object file format is, so
987 # first see if it will tell us. cd to the root directory to prevent
988 # problems with other programs or directories called `ld' in the path.
989 # Set LC_ALL=C to ensure ld outputs messages in English.
990 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
991 | sed -ne '/supported targets:/!d
992 s/[ ][ ]*/ /g
993 s/.*supported targets: *//
994 s/ .*//
995 p'`
996 case "$ld_supported_targets" in
997 elf32-i386)
998 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
999 ;;
1000 a.out-i386-linux)
1001 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
1002 exit ;;
1003 "")
1004 # Either a pre-BFD a.out linker (linux-gnuoldld) or
1005 # one that does not give us useful --help.
1006 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
1007 exit ;;
1008 esac
1009 # Determine whether the default compiler is a.out or elf
1010 eval $set_cc_for_build
1011 sed 's/^ //' << EOF >$dummy.c
1012 #include <features.h>
1013 #ifdef __ELF__
1014 # ifdef __GLIBC__
1015 # if __GLIBC__ >= 2
1016 LIBC=gnu
1017 # else
1018 LIBC=gnulibc1
1019 # endif
1020 # else
1021 LIBC=gnulibc1
1022 # endif
1023 #else
1024 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1025 LIBC=gnu
1026 #else
1027 LIBC=gnuaout
1028 #endif
1029 #endif
1030 #ifdef __dietlibc__
1031 LIBC=dietlibc
1032 #endif
1033 EOF
1034 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1035 /^LIBC/{
1036 s: ::g
1037 p
1038 }'`"
1039 test x"${LIBC}" != x && {
1040 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1041 exit
1042 }
1043 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1044 ;;
1045 i*86:DYNIX/ptx:4*:*)
1046 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1047 # earlier versions are messed up and put the nodename in both
1048 # sysname and nodename.
1049 echo i386-sequent-sysv4
1050 exit ;;
1051 i*86:UNIX_SV:4.2MP:2.*)
1052 # Unixware is an offshoot of SVR4, but it has its own version
1053 # number series starting with 2...
1054 # I am not positive that other SVR4 systems won't match this,
1055 # I just have to hope. -- rms.
1056 # Use sysv4.2uw... so that sysv4* matches it.
1057 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1058 exit ;;
1059 i*86:OS/2:*:*)
1060 # If we were able to find `uname', then EMX Unix compatibility
1061 # is probably installed.
1062 echo ${UNAME_MACHINE}-pc-os2-emx
1063 exit ;;
1064 i*86:XTS-300:*:STOP)
1065 echo ${UNAME_MACHINE}-unknown-stop
1066 exit ;;
1067 i*86:atheos:*:*)
1068 echo ${UNAME_MACHINE}-unknown-atheos
1069 exit ;;
1070 i*86:syllable:*:*)
1071 echo ${UNAME_MACHINE}-pc-syllable
1072 exit ;;
1073 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1074 echo i386-unknown-lynxos${UNAME_RELEASE}
1075 exit ;;
1076 i*86:*DOS:*:*)
1077 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1078 exit ;;
1079 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1080 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1081 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1082 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1083 else
1084 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1085 fi
1086 exit ;;
1087 i*86:*:5:[678]*)
1088 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1089 case `/bin/uname -X | grep "^Machine"` in
1090 *486*) UNAME_MACHINE=i486 ;;
1091 *Pentium) UNAME_MACHINE=i586 ;;
1092 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1093 esac
1094 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1095 exit ;;
1096 i*86:*:3.2:*)
1097 if test -f /usr/options/cb.name; then
1098 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1099 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1100 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1101 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1102 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1103 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1104 && UNAME_MACHINE=i586
1105 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1106 && UNAME_MACHINE=i686
1107 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1108 && UNAME_MACHINE=i686
1109 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1110 else
1111 echo ${UNAME_MACHINE}-pc-sysv32
1112 fi
1113 exit ;;
1114 pc:*:*:*)
1115 # Left here for compatibility:
1116 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1117 # the processor, so we play safe by assuming i386.
1118 echo i386-pc-msdosdjgpp
1119 exit ;;
1120 Intel:Mach:3*:*)
1121 echo i386-pc-mach3
1122 exit ;;
1123 paragon:*:*:*)
1124 echo i860-intel-osf1
1125 exit ;;
1126 i860:*:4.*:*) # i860-SVR4
1127 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1128 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1129 else # Add other i860-SVR4 vendors below as they are discovered.
1130 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1131 fi
1132 exit ;;
1133 mini*:CTIX:SYS*5:*)
1134 # "miniframe"
1135 echo m68010-convergent-sysv
1136 exit ;;
1137 mc68k:UNIX:SYSTEM5:3.51m)
1138 echo m68k-convergent-sysv
1139 exit ;;
1140 M680?0:D-NIX:5.3:*)
1141 echo m68k-diab-dnix
1142 exit ;;
1143 M68*:*:R3V[5678]*:*)
1144 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1145 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)
1146 OS_REL=''
1147 test -r /etc/.relid \
1148 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1149 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1150 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1151 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1152 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1153 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1154 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1155 && { echo i486-ncr-sysv4; exit; } ;;
1156 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1157 echo m68k-unknown-lynxos${UNAME_RELEASE}
1158 exit ;;
1159 mc68030:UNIX_System_V:4.*:*)
1160 echo m68k-atari-sysv4
1161 exit ;;
1162 TSUNAMI:LynxOS:2.*:*)
1163 echo sparc-unknown-lynxos${UNAME_RELEASE}
1164 exit ;;
1165 rs6000:LynxOS:2.*:*)
1166 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1167 exit ;;
1168 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1169 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1170 exit ;;
1171 SM[BE]S:UNIX_SV:*:*)
1172 echo mips-dde-sysv${UNAME_RELEASE}
1173 exit ;;
1174 RM*:ReliantUNIX-*:*:*)
1175 echo mips-sni-sysv4
1176 exit ;;
1177 RM*:SINIX-*:*:*)
1178 echo mips-sni-sysv4
1179 exit ;;
1180 *:SINIX-*:*:*)
1181 if uname -p 2>/dev/null >/dev/null ; then
1182 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1183 echo ${UNAME_MACHINE}-sni-sysv4
1184 else
1185 echo ns32k-sni-sysv
1186 fi
1187 exit ;;
1188 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1189 # says <Richard.M.Bartel@ccMail.Census.GOV>
1190 echo i586-unisys-sysv4
1191 exit ;;
1192 *:UNIX_System_V:4*:FTX*)
1193 # From Gerald Hewes <hewes@openmarket.com>.
1194 # How about differentiating between stratus architectures? -djm
1195 echo hppa1.1-stratus-sysv4
1196 exit ;;
1197 *:*:*:FTX*)
1198 # From seanf@swdc.stratus.com.
1199 echo i860-stratus-sysv4
1200 exit ;;
1201 i*86:VOS:*:*)
1202 # From Paul.Green@stratus.com.
1203 echo ${UNAME_MACHINE}-stratus-vos
1204 exit ;;
1205 *:VOS:*:*)
1206 # From Paul.Green@stratus.com.
1207 echo hppa1.1-stratus-vos
1208 exit ;;
1209 mc68*:A/UX:*:*)
1210 echo m68k-apple-aux${UNAME_RELEASE}
1211 exit ;;
1212 news*:NEWS-OS:6*:*)
1213 echo mips-sony-newsos6
1214 exit ;;
1215 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1216 if [ -d /usr/nec ]; then
1217 echo mips-nec-sysv${UNAME_RELEASE}
1218 else
1219 echo mips-unknown-sysv${UNAME_RELEASE}
1220 fi
1221 exit ;;
1222 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1223 echo powerpc-be-beos
1224 exit ;;
1225 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1226 echo powerpc-apple-beos
1227 exit ;;
1228 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1229 echo i586-pc-beos
1230 exit ;;
1231 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1232 echo i586-pc-haiku
1233 exit ;;
1234 SX-4:SUPER-UX:*:*)
1235 echo sx4-nec-superux${UNAME_RELEASE}
1236 exit ;;
1237 SX-5:SUPER-UX:*:*)
1238 echo sx5-nec-superux${UNAME_RELEASE}
1239 exit ;;
1240 SX-6:SUPER-UX:*:*)
1241 echo sx6-nec-superux${UNAME_RELEASE}
1242 exit ;;
1243 SX-7:SUPER-UX:*:*)
1244 echo sx7-nec-superux${UNAME_RELEASE}
1245 exit ;;
1246 SX-8:SUPER-UX:*:*)
1247 echo sx8-nec-superux${UNAME_RELEASE}
1248 exit ;;
1249 SX-8R:SUPER-UX:*:*)
1250 echo sx8r-nec-superux${UNAME_RELEASE}
1251 exit ;;
1252 Power*:Rhapsody:*:*)
1253 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1254 exit ;;
1255 *:Rhapsody:*:*)
1256 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1257 exit ;;
1258 *:Darwin:*:*)
1259 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1260 case $UNAME_PROCESSOR in
1261 unknown) UNAME_PROCESSOR=powerpc ;;
1262 esac
1263 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1264 exit ;;
1265 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1266 UNAME_PROCESSOR=`uname -p`
1267 if test "$UNAME_PROCESSOR" = "x86"; then
1268 UNAME_PROCESSOR=i386
1269 UNAME_MACHINE=pc
1270 fi
1271 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1272 exit ;;
1273 *:QNX:*:4*)
1274 echo i386-pc-qnx
1275 exit ;;
1276 NSE-?:NONSTOP_KERNEL:*:*)
1277 echo nse-tandem-nsk${UNAME_RELEASE}
1278 exit ;;
1279 NSR-?:NONSTOP_KERNEL:*:*)
1280 echo nsr-tandem-nsk${UNAME_RELEASE}
1281 exit ;;
1282 *:NonStop-UX:*:*)
1283 echo mips-compaq-nonstopux
1284 exit ;;
1285 BS2000:POSIX*:*:*)
1286 echo bs2000-siemens-sysv
1287 exit ;;
1288 DS/*:UNIX_System_V:*:*)
1289 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1290 exit ;;
1291 *:Plan9:*:*)
1292 # "uname -m" is not consistent, so use $cputype instead. 386
1293 # is converted to i386 for consistency with other x86
1294 # operating systems.
1295 if test "$cputype" = "386"; then
1296 UNAME_MACHINE=i386
1297 else
1298 UNAME_MACHINE="$cputype"
1299 fi
1300 echo ${UNAME_MACHINE}-unknown-plan9
1301 exit ;;
1302 *:TOPS-10:*:*)
1303 echo pdp10-unknown-tops10
1304 exit ;;
1305 *:TENEX:*:*)
1306 echo pdp10-unknown-tenex
1307 exit ;;
1308 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1309 echo pdp10-dec-tops20
1310 exit ;;
1311 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1312 echo pdp10-xkl-tops20
1313 exit ;;
1314 *:TOPS-20:*:*)
1315 echo pdp10-unknown-tops20
1316 exit ;;
1317 *:ITS:*:*)
1318 echo pdp10-unknown-its
1319 exit ;;
1320 SEI:*:*:SEIUX)
1321 echo mips-sei-seiux${UNAME_RELEASE}
1322 exit ;;
1323 *:DragonFly:*:*)
1324 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1325 exit ;;
1326 *:*VMS:*:*)
1327 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1328 case "${UNAME_MACHINE}" in
1329 A*) echo alpha-dec-vms ; exit ;;
1330 I*) echo ia64-dec-vms ; exit ;;
1331 V*) echo vax-dec-vms ; exit ;;
1332 esac ;;
1333 *:XENIX:*:SysV)
1334 echo i386-pc-xenix
1335 exit ;;
1336 i*86:skyos:*:*)
1337 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1338 exit ;;
1339 i*86:rdos:*:*)
1340 echo ${UNAME_MACHINE}-pc-rdos
1341 exit ;;
1342 esac
1343
1344 #echo '(No uname command or uname output not recognized.)' 1>&2
1345 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1346
1347 eval $set_cc_for_build
1348 cat >$dummy.c <<EOF
1349 #ifdef _SEQUENT_
1350 # include <sys/types.h>
1351 # include <sys/utsname.h>
1352 #endif
1353 main ()
1354 {
1355 #if defined (sony)
1356 #if defined (MIPSEB)
1357 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1358 I don't know.... */
1359 printf ("mips-sony-bsd\n"); exit (0);
1360 #else
1361 #include <sys/param.h>
1362 printf ("m68k-sony-newsos%s\n",
1363 #ifdef NEWSOS4
1364 "4"
1365 #else
1366 ""
1367 #endif
1368 ); exit (0);
1369 #endif
1370 #endif
1371
1372 #if defined (__arm) && defined (__acorn) && defined (__unix)
1373 printf ("arm-acorn-riscix\n"); exit (0);
1374 #endif
1375
1376 #if defined (hp300) && !defined (hpux)
1377 printf ("m68k-hp-bsd\n"); exit (0);
1378 #endif
1379
1380 #if defined (NeXT)
1381 #if !defined (__ARCHITECTURE__)
1382 #define __ARCHITECTURE__ "m68k"
1383 #endif
1384 int version;
1385 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1386 if (version < 4)
1387 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1388 else
1389 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1390 exit (0);
1391 #endif
1392
1393 #if defined (MULTIMAX) || defined (n16)
1394 #if defined (UMAXV)
1395 printf ("ns32k-encore-sysv\n"); exit (0);
1396 #else
1397 #if defined (CMU)
1398 printf ("ns32k-encore-mach\n"); exit (0);
1399 #else
1400 printf ("ns32k-encore-bsd\n"); exit (0);
1401 #endif
1402 #endif
1403 #endif
1404
1405 #if defined (__386BSD__)
1406 printf ("i386-pc-bsd\n"); exit (0);
1407 #endif
1408
1409 #if defined (sequent)
1410 #if defined (i386)
1411 printf ("i386-sequent-dynix\n"); exit (0);
1412 #endif
1413 #if defined (ns32000)
1414 printf ("ns32k-sequent-dynix\n"); exit (0);
1415 #endif
1416 #endif
1417
1418 #if defined (_SEQUENT_)
1419 struct utsname un;
1420
1421 uname(&un);
1422
1423 if (strncmp(un.version, "V2", 2) == 0) {
1424 printf ("i386-sequent-ptx2\n"); exit (0);
1425 }
1426 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1427 printf ("i386-sequent-ptx1\n"); exit (0);
1428 }
1429 printf ("i386-sequent-ptx\n"); exit (0);
1430
1431 #endif
1432
1433 #if defined (vax)
1434 # if !defined (ultrix)
1435 # include <sys/param.h>
1436 # if defined (BSD)
1437 # if BSD == 43
1438 printf ("vax-dec-bsd4.3\n"); exit (0);
1439 # else
1440 # if BSD == 199006
1441 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1442 # else
1443 printf ("vax-dec-bsd\n"); exit (0);
1444 # endif
1445 # endif
1446 # else
1447 printf ("vax-dec-bsd\n"); exit (0);
1448 # endif
1449 # else
1450 printf ("vax-dec-ultrix\n"); exit (0);
1451 # endif
1452 #endif
1453
1454 #if defined (alliant) && defined (i860)
1455 printf ("i860-alliant-bsd\n"); exit (0);
1456 #endif
1457
1458 exit (1);
1459 }
1460 EOF
1461
1462 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1463 { echo "$SYSTEM_NAME"; exit; }
1464
1465 # Apollos put the system type in the environment.
1466
1467 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1468
1469 # Convex versions that predate uname can use getsysinfo(1)
1470
1471 if [ -x /usr/convex/getsysinfo ]
1472 then
1473 case `getsysinfo -f cpu_type` in
1474 c1*)
1475 echo c1-convex-bsd
1476 exit ;;
1477 c2*)
1478 if getsysinfo -f scalar_acc
1479 then echo c32-convex-bsd
1480 else echo c2-convex-bsd
1481 fi
1482 exit ;;
1483 c34*)
1484 echo c34-convex-bsd
1485 exit ;;
1486 c38*)
1487 echo c38-convex-bsd
1488 exit ;;
1489 c4*)
1490 echo c4-convex-bsd
1491 exit ;;
1492 esac
1493 fi
1494
1495 cat >&2 <<EOF
1496 $0: unable to guess system type
1497
1498 This script, last modified $timestamp, has failed to recognize
1499 the operating system you are using. It is advised that you
1500 download the most up to date version of the config scripts from
1501
1502 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1503 and
1504 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1505
1506 If the version you run ($0) is already up to date, please
1507 send the following data and any information you think might be
1508 pertinent to <config-patches@gnu.org> in order to provide the needed
1509 information to handle your system.
1510
1511 config.guess timestamp = $timestamp
1512
1513 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1514 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1515 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1516 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1517
1518 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1519 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1520
1521 hostinfo = `(hostinfo) 2>/dev/null`
1522 /bin/universe = `(/bin/universe) 2>/dev/null`
1523 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1524 /bin/arch = `(/bin/arch) 2>/dev/null`
1525 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1526 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1527
1528 UNAME_MACHINE = ${UNAME_MACHINE}
1529 UNAME_RELEASE = ${UNAME_RELEASE}
1530 UNAME_SYSTEM = ${UNAME_SYSTEM}
1531 UNAME_VERSION = ${UNAME_VERSION}
1532 EOF
1533
1534 exit 1
1535
1536 # Local variables:
1537 # eval: (add-hook 'write-file-hooks 'time-stamp)
1538 # time-stamp-start: "timestamp='"
1539 # time-stamp-format: "%:y-%02m-%02d"
1540 # time-stamp-end: "'"
1541 # End:
0 /* config.h.in. Generated from configure.ac by autoheader. */
1
2 /* Define if building universal (internal helper macro) */
3 #undef AC_APPLE_UNIVERSAL_BUILD
4
5 /* Define to 1 if you have the <byteswap.h> header file. */
6 #undef HAVE_BYTESWAP_H
7
8 /* Define to 1 if you have the <dlfcn.h> header file. */
9 #undef HAVE_DLFCN_H
10
11 /* Define to 1 if you have the <inttypes.h> header file. */
12 #undef HAVE_INTTYPES_H
13
14 /* Define to 1 if you have the <memory.h> header file. */
15 #undef HAVE_MEMORY_H
16
17 /* Define to 1 if the system has the type `ssize_t'. */
18 #undef HAVE_SSIZE_T
19
20 /* Define to 1 if you have the <stdint.h> header file. */
21 #undef HAVE_STDINT_H
22
23 /* Define to 1 if you have the <stdlib.h> header file. */
24 #undef HAVE_STDLIB_H
25
26 /* Define to 1 if you have the <strings.h> header file. */
27 #undef HAVE_STRINGS_H
28
29 /* Define to 1 if you have the <string.h> header file. */
30 #undef HAVE_STRING_H
31
32 /* Define to 1 if you have the <sys/ioctl.h> header file. */
33 #undef HAVE_SYS_IOCTL_H
34
35 /* Define to 1 if you have the <sys/poll.h> header file. */
36 #undef HAVE_SYS_POLL_H
37
38 /* Define to 1 if you have the <sys/stat.h> header file. */
39 #undef HAVE_SYS_STAT_H
40
41 /* Define to 1 if you have the <sys/types.h> header file. */
42 #undef HAVE_SYS_TYPES_H
43
44 /* Define to 1 if you have the <unistd.h> header file. */
45 #undef HAVE_UNISTD_H
46
47 /* I know the API is subject to change. */
48 #undef LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE
49
50 /* Define to the sub-directory in which libtool stores uninstalled libraries.
51 */
52 #undef LT_OBJDIR
53
54 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
55 #undef NO_MINUS_C_MINUS_O
56
57 /* Name of package */
58 #undef PACKAGE
59
60 /* Define to the address where bug reports for this package should be sent. */
61 #undef PACKAGE_BUGREPORT
62
63 /* Define to the full name of this package. */
64 #undef PACKAGE_NAME
65
66 /* Define to the full name and version of this package. */
67 #undef PACKAGE_STRING
68
69 /* Define to the one symbol short name of this package. */
70 #undef PACKAGE_TARNAME
71
72 /* Define to the version of this package. */
73 #undef PACKAGE_VERSION
74
75 /* Define as the return type of signal handlers (`int' or `void'). */
76 #undef RETSIGTYPE
77
78 /* Define to 1 if you have the ANSI C header files. */
79 #undef STDC_HEADERS
80
81 /* Enable extensions on AIX 3, Interix. */
82 #ifndef _ALL_SOURCE
83 # undef _ALL_SOURCE
84 #endif
85 /* Enable GNU extensions on systems that have them. */
86 #ifndef _GNU_SOURCE
87 # undef _GNU_SOURCE
88 #endif
89 /* Enable threading extensions on Solaris. */
90 #ifndef _POSIX_PTHREAD_SEMANTICS
91 # undef _POSIX_PTHREAD_SEMANTICS
92 #endif
93 /* Enable extensions on HP NonStop. */
94 #ifndef _TANDEM_SOURCE
95 # undef _TANDEM_SOURCE
96 #endif
97 /* Enable general extensions on Solaris. */
98 #ifndef __EXTENSIONS__
99 # undef __EXTENSIONS__
100 #endif
101
102
103 /* Version number of package */
104 #undef VERSION
105
106 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
107 significant byte first (like Motorola and SPARC, unlike Intel). */
108 #if defined AC_APPLE_UNIVERSAL_BUILD
109 # if defined __BIG_ENDIAN__
110 # define WORDS_BIGENDIAN 1
111 # endif
112 #else
113 # ifndef WORDS_BIGENDIAN
114 # undef WORDS_BIGENDIAN
115 # endif
116 #endif
117
118 /* Number of bits in a file offset, on hosts where this is settable. */
119 #undef _FILE_OFFSET_BITS
120
121 /* Define for large files, on AIX-style hosts. */
122 #undef _LARGE_FILES
123
124 /* Define to 1 if on MINIX. */
125 #undef _MINIX
126
127 /* Define to 2 if the system does not provide POSIX.1 features except with
128 this defined. */
129 #undef _POSIX_1_SOURCE
130
131 /* Define to 1 if you need to in order for `stat' and other things to work. */
132 #undef _POSIX_SOURCE
133
134 /* Define to empty if `const' does not conform to ANSI C. */
135 #undef const
136
137 /* Define to `int' if <sys/types.h> doesn't define. */
138 #undef gid_t
139
140 /* Define to `long int' if <sys/types.h> does not define. */
141 #undef off_t
142
143 /* Define to `int' if <sys/types.h> does not define. */
144 #undef pid_t
145
146 /* Define to `unsigned int' if <sys/types.h> does not define. */
147 #undef size_t
148
149 /* Define ssize_t if it is not done by the standard libs. */
150 #undef ssize_t
151
152 /* Define to `int' if <sys/types.h> doesn't define. */
153 #undef uid_t
(New empty file)
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 # Free Software Foundation, Inc.
5
6 timestamp='2008-09-08'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 # 02110-1301, USA.
26 #
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32
33 # Please send patches to <config-patches@gnu.org>. Submit a context
34 # diff and a properly formatted ChangeLog entry.
35 #
36 # Configuration subroutine to validate and canonicalize a configuration type.
37 # Supply the specified configuration type as an argument.
38 # If it is invalid, we print an error message on stderr and exit with code 1.
39 # Otherwise, we print the canonical config type on stdout and succeed.
40
41 # This file is supposed to be the same for all GNU packages
42 # and recognize all the CPU types, system types and aliases
43 # that are meaningful with *any* GNU software.
44 # Each package is responsible for reporting which valid configurations
45 # it does not support. The user should be able to distinguish
46 # a failure to support a valid configuration from a meaningless
47 # configuration.
48
49 # The goal of this file is to map all the various variations of a given
50 # machine specification into a single specification in the form:
51 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
52 # or in some cases, the newer four-part form:
53 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
54 # It is wrong to echo any other type of specification.
55
56 me=`echo "$0" | sed -e 's,.*/,,'`
57
58 usage="\
59 Usage: $0 [OPTION] CPU-MFR-OPSYS
60 $0 [OPTION] ALIAS
61
62 Canonicalize a configuration name.
63
64 Operation modes:
65 -h, --help print this help, then exit
66 -t, --time-stamp print date of last modification, then exit
67 -v, --version print version number, then exit
68
69 Report bugs and patches to <config-patches@gnu.org>."
70
71 version="\
72 GNU config.sub ($timestamp)
73
74 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
75 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
76
77 This is free software; see the source for copying conditions. There is NO
78 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
79
80 help="
81 Try \`$me --help' for more information."
82
83 # Parse command line
84 while test $# -gt 0 ; do
85 case $1 in
86 --time-stamp | --time* | -t )
87 echo "$timestamp" ; exit ;;
88 --version | -v )
89 echo "$version" ; exit ;;
90 --help | --h* | -h )
91 echo "$usage"; exit ;;
92 -- ) # Stop option processing
93 shift; break ;;
94 - ) # Use stdin as input.
95 break ;;
96 -* )
97 echo "$me: invalid option $1$help"
98 exit 1 ;;
99
100 *local*)
101 # First pass through any local machine types.
102 echo $1
103 exit ;;
104
105 * )
106 break ;;
107 esac
108 done
109
110 case $# in
111 0) echo "$me: missing argument$help" >&2
112 exit 1;;
113 1) ;;
114 *) echo "$me: too many arguments$help" >&2
115 exit 1;;
116 esac
117
118 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
119 # Here we must recognize all the valid KERNEL-OS combinations.
120 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
121 case $maybe_os in
122 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
123 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
124 storm-chaos* | os2-emx* | rtmk-nova*)
125 os=-$maybe_os
126 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
127 ;;
128 *)
129 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
130 if [ $basic_machine != $1 ]
131 then os=`echo $1 | sed 's/.*-/-/'`
132 else os=; fi
133 ;;
134 esac
135
136 ### Let's recognize common machines as not being operating systems so
137 ### that things like config.sub decstation-3100 work. We also
138 ### recognize some manufacturers as not being operating systems, so we
139 ### can provide default operating systems below.
140 case $os in
141 -sun*os*)
142 # Prevent following clause from handling this invalid input.
143 ;;
144 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
145 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
146 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
147 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
148 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
149 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
150 -apple | -axis | -knuth | -cray)
151 os=
152 basic_machine=$1
153 ;;
154 -sim | -cisco | -oki | -wec | -winbond)
155 os=
156 basic_machine=$1
157 ;;
158 -scout)
159 ;;
160 -wrs)
161 os=-vxworks
162 basic_machine=$1
163 ;;
164 -chorusos*)
165 os=-chorusos
166 basic_machine=$1
167 ;;
168 -chorusrdb)
169 os=-chorusrdb
170 basic_machine=$1
171 ;;
172 -hiux*)
173 os=-hiuxwe2
174 ;;
175 -sco6)
176 os=-sco5v6
177 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
178 ;;
179 -sco5)
180 os=-sco3.2v5
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco4)
184 os=-sco3.2v4
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco3.2.[4-9]*)
188 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2v[4-9]*)
192 # Don't forget version if it is 3.2v4 or newer.
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco5v6*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco*)
200 os=-sco3.2v2
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -udk*)
204 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
205 ;;
206 -isc)
207 os=-isc2.2
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -clix*)
211 basic_machine=clipper-intergraph
212 ;;
213 -isc*)
214 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
215 ;;
216 -lynx*)
217 os=-lynxos
218 ;;
219 -ptx*)
220 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
221 ;;
222 -windowsnt*)
223 os=`echo $os | sed -e 's/windowsnt/winnt/'`
224 ;;
225 -psos*)
226 os=-psos
227 ;;
228 -mint | -mint[0-9]*)
229 basic_machine=m68k-atari
230 os=-mint
231 ;;
232 esac
233
234 # Decode aliases for certain CPU-COMPANY combinations.
235 case $basic_machine in
236 # Recognize the basic CPU types without company name.
237 # Some are omitted here because they have special meanings below.
238 1750a | 580 \
239 | a29k \
240 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
241 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
242 | am33_2.0 \
243 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
244 | bfin \
245 | c4x | clipper \
246 | d10v | d30v | dlx | dsp16xx \
247 | fido | fr30 | frv \
248 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
249 | i370 | i860 | i960 | ia64 \
250 | ip2k | iq2000 \
251 | m32c | m32r | m32rle | m68000 | m68k | m88k \
252 | maxq | mb | microblaze | mcore | mep | metag \
253 | mips | mipsbe | mipseb | mipsel | mipsle \
254 | mips16 \
255 | mips64 | mips64el \
256 | mips64octeon | mips64octeonel \
257 | mips64orion | mips64orionel \
258 | mips64r5900 | mips64r5900el \
259 | mips64vr | mips64vrel \
260 | mips64vr4100 | mips64vr4100el \
261 | mips64vr4300 | mips64vr4300el \
262 | mips64vr5000 | mips64vr5000el \
263 | mips64vr5900 | mips64vr5900el \
264 | mipsisa32 | mipsisa32el \
265 | mipsisa32r2 | mipsisa32r2el \
266 | mipsisa64 | mipsisa64el \
267 | mipsisa64r2 | mipsisa64r2el \
268 | mipsisa64sb1 | mipsisa64sb1el \
269 | mipsisa64sr71k | mipsisa64sr71kel \
270 | mipstx39 | mipstx39el \
271 | mn10200 | mn10300 \
272 | mt \
273 | msp430 \
274 | nios | nios2 \
275 | ns16k | ns32k \
276 | or32 \
277 | pdp10 | pdp11 | pj | pjl \
278 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
279 | pyramid \
280 | score \
281 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
282 | sh64 | sh64le \
283 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
284 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
285 | spu | strongarm \
286 | tahoe | thumb | tic4x | tic80 | tron \
287 | v850 | v850e \
288 | we32k \
289 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
290 | z8k | z80)
291 basic_machine=$basic_machine-unknown
292 ;;
293 m6811 | m68hc11 | m6812 | m68hc12)
294 # Motorola 68HC11/12.
295 basic_machine=$basic_machine-unknown
296 os=-none
297 ;;
298 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
299 ;;
300 ms1)
301 basic_machine=mt-unknown
302 ;;
303
304 # We use `pc' rather than `unknown'
305 # because (1) that's what they normally are, and
306 # (2) the word "unknown" tends to confuse beginning users.
307 i*86 | x86_64)
308 basic_machine=$basic_machine-pc
309 ;;
310 # Object if more than one company name word.
311 *-*-*)
312 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
313 exit 1
314 ;;
315 # Recognize the basic CPU types with company name.
316 580-* \
317 | a29k-* \
318 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
319 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
320 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
321 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
322 | avr-* | avr32-* \
323 | bfin-* | bs2000-* \
324 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
325 | clipper-* | craynv-* | cydra-* \
326 | d10v-* | d30v-* | dlx-* \
327 | elxsi-* \
328 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
329 | h8300-* | h8500-* \
330 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
331 | i*86-* | i860-* | i960-* | ia64-* \
332 | ip2k-* | iq2000-* \
333 | m32c-* | m32r-* | m32rle-* \
334 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
335 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
336 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
337 | mips16-* \
338 | mips64-* | mips64el-* \
339 | mips64octeon-* | mips64octeonel-* \
340 | mips64orion-* | mips64orionel-* \
341 | mips64r5900-* | mips64r5900el-* \
342 | mips64vr-* | mips64vrel-* \
343 | mips64vr4100-* | mips64vr4100el-* \
344 | mips64vr4300-* | mips64vr4300el-* \
345 | mips64vr5000-* | mips64vr5000el-* \
346 | mips64vr5900-* | mips64vr5900el-* \
347 | mipsisa32-* | mipsisa32el-* \
348 | mipsisa32r2-* | mipsisa32r2el-* \
349 | mipsisa64-* | mipsisa64el-* \
350 | mipsisa64r2-* | mipsisa64r2el-* \
351 | mipsisa64sb1-* | mipsisa64sb1el-* \
352 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
353 | mipstx39-* | mipstx39el-* \
354 | mmix-* \
355 | mt-* \
356 | msp430-* \
357 | nios-* | nios2-* \
358 | none-* | np1-* | ns16k-* | ns32k-* \
359 | orion-* \
360 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
361 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
362 | pyramid-* \
363 | romp-* | rs6000-* \
364 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
365 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
366 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
367 | sparclite-* \
368 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
369 | tahoe-* | thumb-* \
370 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
371 | tron-* \
372 | v850-* | v850e-* | vax-* \
373 | we32k-* \
374 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
375 | xstormy16-* | xtensa*-* \
376 | ymp-* \
377 | z8k-* | z80-*)
378 ;;
379 # Recognize the basic CPU types without company name, with glob match.
380 xtensa*)
381 basic_machine=$basic_machine-unknown
382 ;;
383 # Recognize the various machine names and aliases which stand
384 # for a CPU type and a company and sometimes even an OS.
385 386bsd)
386 basic_machine=i386-unknown
387 os=-bsd
388 ;;
389 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
390 basic_machine=m68000-att
391 ;;
392 3b*)
393 basic_machine=we32k-att
394 ;;
395 a29khif)
396 basic_machine=a29k-amd
397 os=-udi
398 ;;
399 abacus)
400 basic_machine=abacus-unknown
401 ;;
402 adobe68k)
403 basic_machine=m68010-adobe
404 os=-scout
405 ;;
406 alliant | fx80)
407 basic_machine=fx80-alliant
408 ;;
409 altos | altos3068)
410 basic_machine=m68k-altos
411 ;;
412 am29k)
413 basic_machine=a29k-none
414 os=-bsd
415 ;;
416 amd64)
417 basic_machine=x86_64-pc
418 ;;
419 amd64-*)
420 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
421 ;;
422 amdahl)
423 basic_machine=580-amdahl
424 os=-sysv
425 ;;
426 amiga | amiga-*)
427 basic_machine=m68k-unknown
428 ;;
429 amigaos | amigados)
430 basic_machine=m68k-unknown
431 os=-amigaos
432 ;;
433 amigaunix | amix)
434 basic_machine=m68k-unknown
435 os=-sysv4
436 ;;
437 apollo68)
438 basic_machine=m68k-apollo
439 os=-sysv
440 ;;
441 apollo68bsd)
442 basic_machine=m68k-apollo
443 os=-bsd
444 ;;
445 aux)
446 basic_machine=m68k-apple
447 os=-aux
448 ;;
449 balance)
450 basic_machine=ns32k-sequent
451 os=-dynix
452 ;;
453 blackfin)
454 basic_machine=bfin-unknown
455 os=-linux
456 ;;
457 blackfin-*)
458 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
459 os=-linux
460 ;;
461 c90)
462 basic_machine=c90-cray
463 os=-unicos
464 ;;
465 cegcc)
466 basic_machine=arm-unknown
467 os=-cegcc
468 ;;
469 convex-c1)
470 basic_machine=c1-convex
471 os=-bsd
472 ;;
473 convex-c2)
474 basic_machine=c2-convex
475 os=-bsd
476 ;;
477 convex-c32)
478 basic_machine=c32-convex
479 os=-bsd
480 ;;
481 convex-c34)
482 basic_machine=c34-convex
483 os=-bsd
484 ;;
485 convex-c38)
486 basic_machine=c38-convex
487 os=-bsd
488 ;;
489 cray | j90)
490 basic_machine=j90-cray
491 os=-unicos
492 ;;
493 craynv)
494 basic_machine=craynv-cray
495 os=-unicosmp
496 ;;
497 cr16)
498 basic_machine=cr16-unknown
499 os=-elf
500 ;;
501 crds | unos)
502 basic_machine=m68k-crds
503 ;;
504 crisv32 | crisv32-* | etraxfs*)
505 basic_machine=crisv32-axis
506 ;;
507 cris | cris-* | etrax*)
508 basic_machine=cris-axis
509 ;;
510 crx)
511 basic_machine=crx-unknown
512 os=-elf
513 ;;
514 da30 | da30-*)
515 basic_machine=m68k-da30
516 ;;
517 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
518 basic_machine=mips-dec
519 ;;
520 decsystem10* | dec10*)
521 basic_machine=pdp10-dec
522 os=-tops10
523 ;;
524 decsystem20* | dec20*)
525 basic_machine=pdp10-dec
526 os=-tops20
527 ;;
528 delta | 3300 | motorola-3300 | motorola-delta \
529 | 3300-motorola | delta-motorola)
530 basic_machine=m68k-motorola
531 ;;
532 delta88)
533 basic_machine=m88k-motorola
534 os=-sysv3
535 ;;
536 dicos)
537 basic_machine=i686-pc
538 os=-dicos
539 ;;
540 djgpp)
541 basic_machine=i586-pc
542 os=-msdosdjgpp
543 ;;
544 dpx20 | dpx20-*)
545 basic_machine=rs6000-bull
546 os=-bosx
547 ;;
548 dpx2* | dpx2*-bull)
549 basic_machine=m68k-bull
550 os=-sysv3
551 ;;
552 ebmon29k)
553 basic_machine=a29k-amd
554 os=-ebmon
555 ;;
556 elxsi)
557 basic_machine=elxsi-elxsi
558 os=-bsd
559 ;;
560 encore | umax | mmax)
561 basic_machine=ns32k-encore
562 ;;
563 es1800 | OSE68k | ose68k | ose | OSE)
564 basic_machine=m68k-ericsson
565 os=-ose
566 ;;
567 fx2800)
568 basic_machine=i860-alliant
569 ;;
570 genix)
571 basic_machine=ns32k-ns
572 ;;
573 gmicro)
574 basic_machine=tron-gmicro
575 os=-sysv
576 ;;
577 go32)
578 basic_machine=i386-pc
579 os=-go32
580 ;;
581 h3050r* | hiux*)
582 basic_machine=hppa1.1-hitachi
583 os=-hiuxwe2
584 ;;
585 h8300hms)
586 basic_machine=h8300-hitachi
587 os=-hms
588 ;;
589 h8300xray)
590 basic_machine=h8300-hitachi
591 os=-xray
592 ;;
593 h8500hms)
594 basic_machine=h8500-hitachi
595 os=-hms
596 ;;
597 harris)
598 basic_machine=m88k-harris
599 os=-sysv3
600 ;;
601 hp300-*)
602 basic_machine=m68k-hp
603 ;;
604 hp300bsd)
605 basic_machine=m68k-hp
606 os=-bsd
607 ;;
608 hp300hpux)
609 basic_machine=m68k-hp
610 os=-hpux
611 ;;
612 hp3k9[0-9][0-9] | hp9[0-9][0-9])
613 basic_machine=hppa1.0-hp
614 ;;
615 hp9k2[0-9][0-9] | hp9k31[0-9])
616 basic_machine=m68000-hp
617 ;;
618 hp9k3[2-9][0-9])
619 basic_machine=m68k-hp
620 ;;
621 hp9k6[0-9][0-9] | hp6[0-9][0-9])
622 basic_machine=hppa1.0-hp
623 ;;
624 hp9k7[0-79][0-9] | hp7[0-79][0-9])
625 basic_machine=hppa1.1-hp
626 ;;
627 hp9k78[0-9] | hp78[0-9])
628 # FIXME: really hppa2.0-hp
629 basic_machine=hppa1.1-hp
630 ;;
631 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
632 # FIXME: really hppa2.0-hp
633 basic_machine=hppa1.1-hp
634 ;;
635 hp9k8[0-9][13679] | hp8[0-9][13679])
636 basic_machine=hppa1.1-hp
637 ;;
638 hp9k8[0-9][0-9] | hp8[0-9][0-9])
639 basic_machine=hppa1.0-hp
640 ;;
641 hppa-next)
642 os=-nextstep3
643 ;;
644 hppaosf)
645 basic_machine=hppa1.1-hp
646 os=-osf
647 ;;
648 hppro)
649 basic_machine=hppa1.1-hp
650 os=-proelf
651 ;;
652 i370-ibm* | ibm*)
653 basic_machine=i370-ibm
654 ;;
655 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
656 i*86v32)
657 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
658 os=-sysv32
659 ;;
660 i*86v4*)
661 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
662 os=-sysv4
663 ;;
664 i*86v)
665 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
666 os=-sysv
667 ;;
668 i*86sol2)
669 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
670 os=-solaris2
671 ;;
672 i386mach)
673 basic_machine=i386-mach
674 os=-mach
675 ;;
676 i386-vsta | vsta)
677 basic_machine=i386-unknown
678 os=-vsta
679 ;;
680 iris | iris4d)
681 basic_machine=mips-sgi
682 case $os in
683 -irix*)
684 ;;
685 *)
686 os=-irix4
687 ;;
688 esac
689 ;;
690 isi68 | isi)
691 basic_machine=m68k-isi
692 os=-sysv
693 ;;
694 m68knommu)
695 basic_machine=m68k-unknown
696 os=-linux
697 ;;
698 m68knommu-*)
699 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
700 os=-linux
701 ;;
702 m88k-omron*)
703 basic_machine=m88k-omron
704 ;;
705 magnum | m3230)
706 basic_machine=mips-mips
707 os=-sysv
708 ;;
709 merlin)
710 basic_machine=ns32k-utek
711 os=-sysv
712 ;;
713 mingw32)
714 basic_machine=i386-pc
715 os=-mingw32
716 ;;
717 mingw32ce)
718 basic_machine=arm-unknown
719 os=-mingw32ce
720 ;;
721 miniframe)
722 basic_machine=m68000-convergent
723 ;;
724 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
725 basic_machine=m68k-atari
726 os=-mint
727 ;;
728 mips3*-*)
729 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
730 ;;
731 mips3*)
732 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
733 ;;
734 monitor)
735 basic_machine=m68k-rom68k
736 os=-coff
737 ;;
738 morphos)
739 basic_machine=powerpc-unknown
740 os=-morphos
741 ;;
742 msdos)
743 basic_machine=i386-pc
744 os=-msdos
745 ;;
746 ms1-*)
747 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
748 ;;
749 mvs)
750 basic_machine=i370-ibm
751 os=-mvs
752 ;;
753 ncr3000)
754 basic_machine=i486-ncr
755 os=-sysv4
756 ;;
757 netbsd386)
758 basic_machine=i386-unknown
759 os=-netbsd
760 ;;
761 netwinder)
762 basic_machine=armv4l-rebel
763 os=-linux
764 ;;
765 news | news700 | news800 | news900)
766 basic_machine=m68k-sony
767 os=-newsos
768 ;;
769 news1000)
770 basic_machine=m68030-sony
771 os=-newsos
772 ;;
773 news-3600 | risc-news)
774 basic_machine=mips-sony
775 os=-newsos
776 ;;
777 necv70)
778 basic_machine=v70-nec
779 os=-sysv
780 ;;
781 next | m*-next )
782 basic_machine=m68k-next
783 case $os in
784 -nextstep* )
785 ;;
786 -ns2*)
787 os=-nextstep2
788 ;;
789 *)
790 os=-nextstep3
791 ;;
792 esac
793 ;;
794 nh3000)
795 basic_machine=m68k-harris
796 os=-cxux
797 ;;
798 nh[45]000)
799 basic_machine=m88k-harris
800 os=-cxux
801 ;;
802 nindy960)
803 basic_machine=i960-intel
804 os=-nindy
805 ;;
806 mon960)
807 basic_machine=i960-intel
808 os=-mon960
809 ;;
810 nonstopux)
811 basic_machine=mips-compaq
812 os=-nonstopux
813 ;;
814 np1)
815 basic_machine=np1-gould
816 ;;
817 nsr-tandem)
818 basic_machine=nsr-tandem
819 ;;
820 op50n-* | op60c-*)
821 basic_machine=hppa1.1-oki
822 os=-proelf
823 ;;
824 openrisc | openrisc-*)
825 basic_machine=or32-unknown
826 ;;
827 os400)
828 basic_machine=powerpc-ibm
829 os=-os400
830 ;;
831 OSE68000 | ose68000)
832 basic_machine=m68000-ericsson
833 os=-ose
834 ;;
835 os68k)
836 basic_machine=m68k-none
837 os=-os68k
838 ;;
839 pa-hitachi)
840 basic_machine=hppa1.1-hitachi
841 os=-hiuxwe2
842 ;;
843 paragon)
844 basic_machine=i860-intel
845 os=-osf
846 ;;
847 parisc)
848 basic_machine=hppa-unknown
849 os=-linux
850 ;;
851 parisc-*)
852 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
853 os=-linux
854 ;;
855 pbd)
856 basic_machine=sparc-tti
857 ;;
858 pbb)
859 basic_machine=m68k-tti
860 ;;
861 pc532 | pc532-*)
862 basic_machine=ns32k-pc532
863 ;;
864 pc98)
865 basic_machine=i386-pc
866 ;;
867 pc98-*)
868 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
869 ;;
870 pentium | p5 | k5 | k6 | nexgen | viac3)
871 basic_machine=i586-pc
872 ;;
873 pentiumpro | p6 | 6x86 | athlon | athlon_*)
874 basic_machine=i686-pc
875 ;;
876 pentiumii | pentium2 | pentiumiii | pentium3)
877 basic_machine=i686-pc
878 ;;
879 pentium4)
880 basic_machine=i786-pc
881 ;;
882 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
883 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
884 ;;
885 pentiumpro-* | p6-* | 6x86-* | athlon-*)
886 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
887 ;;
888 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
889 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
890 ;;
891 pentium4-*)
892 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
893 ;;
894 pn)
895 basic_machine=pn-gould
896 ;;
897 power) basic_machine=power-ibm
898 ;;
899 ppc) basic_machine=powerpc-unknown
900 ;;
901 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
902 ;;
903 ppcle | powerpclittle | ppc-le | powerpc-little)
904 basic_machine=powerpcle-unknown
905 ;;
906 ppcle-* | powerpclittle-*)
907 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
908 ;;
909 ppc64) basic_machine=powerpc64-unknown
910 ;;
911 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
912 ;;
913 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
914 basic_machine=powerpc64le-unknown
915 ;;
916 ppc64le-* | powerpc64little-*)
917 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
918 ;;
919 ps2)
920 basic_machine=i386-ibm
921 ;;
922 pw32)
923 basic_machine=i586-unknown
924 os=-pw32
925 ;;
926 rdos)
927 basic_machine=i386-pc
928 os=-rdos
929 ;;
930 rom68k)
931 basic_machine=m68k-rom68k
932 os=-coff
933 ;;
934 rm[46]00)
935 basic_machine=mips-siemens
936 ;;
937 rtpc | rtpc-*)
938 basic_machine=romp-ibm
939 ;;
940 s390 | s390-*)
941 basic_machine=s390-ibm
942 ;;
943 s390x | s390x-*)
944 basic_machine=s390x-ibm
945 ;;
946 sa29200)
947 basic_machine=a29k-amd
948 os=-udi
949 ;;
950 sb1)
951 basic_machine=mipsisa64sb1-unknown
952 ;;
953 sb1el)
954 basic_machine=mipsisa64sb1el-unknown
955 ;;
956 sde)
957 basic_machine=mipsisa32-sde
958 os=-elf
959 ;;
960 sei)
961 basic_machine=mips-sei
962 os=-seiux
963 ;;
964 sequent)
965 basic_machine=i386-sequent
966 ;;
967 sh)
968 basic_machine=sh-hitachi
969 os=-hms
970 ;;
971 sh5el)
972 basic_machine=sh5le-unknown
973 ;;
974 sh64)
975 basic_machine=sh64-unknown
976 ;;
977 sparclite-wrs | simso-wrs)
978 basic_machine=sparclite-wrs
979 os=-vxworks
980 ;;
981 sps7)
982 basic_machine=m68k-bull
983 os=-sysv2
984 ;;
985 spur)
986 basic_machine=spur-unknown
987 ;;
988 st2000)
989 basic_machine=m68k-tandem
990 ;;
991 stratus)
992 basic_machine=i860-stratus
993 os=-sysv4
994 ;;
995 sun2)
996 basic_machine=m68000-sun
997 ;;
998 sun2os3)
999 basic_machine=m68000-sun
1000 os=-sunos3
1001 ;;
1002 sun2os4)
1003 basic_machine=m68000-sun
1004 os=-sunos4
1005 ;;
1006 sun3os3)
1007 basic_machine=m68k-sun
1008 os=-sunos3
1009 ;;
1010 sun3os4)
1011 basic_machine=m68k-sun
1012 os=-sunos4
1013 ;;
1014 sun4os3)
1015 basic_machine=sparc-sun
1016 os=-sunos3
1017 ;;
1018 sun4os4)
1019 basic_machine=sparc-sun
1020 os=-sunos4
1021 ;;
1022 sun4sol2)
1023 basic_machine=sparc-sun
1024 os=-solaris2
1025 ;;
1026 sun3 | sun3-*)
1027 basic_machine=m68k-sun
1028 ;;
1029 sun4)
1030 basic_machine=sparc-sun
1031 ;;
1032 sun386 | sun386i | roadrunner)
1033 basic_machine=i386-sun
1034 ;;
1035 sv1)
1036 basic_machine=sv1-cray
1037 os=-unicos
1038 ;;
1039 symmetry)
1040 basic_machine=i386-sequent
1041 os=-dynix
1042 ;;
1043 t3e)
1044 basic_machine=alphaev5-cray
1045 os=-unicos
1046 ;;
1047 t90)
1048 basic_machine=t90-cray
1049 os=-unicos
1050 ;;
1051 tic54x | c54x*)
1052 basic_machine=tic54x-unknown
1053 os=-coff
1054 ;;
1055 tic55x | c55x*)
1056 basic_machine=tic55x-unknown
1057 os=-coff
1058 ;;
1059 tic6x | c6x*)
1060 basic_machine=tic6x-unknown
1061 os=-coff
1062 ;;
1063 tile*)
1064 basic_machine=tile-unknown
1065 os=-linux-gnu
1066 ;;
1067 tx39)
1068 basic_machine=mipstx39-unknown
1069 ;;
1070 tx39el)
1071 basic_machine=mipstx39el-unknown
1072 ;;
1073 toad1)
1074 basic_machine=pdp10-xkl
1075 os=-tops20
1076 ;;
1077 tower | tower-32)
1078 basic_machine=m68k-ncr
1079 ;;
1080 tpf)
1081 basic_machine=s390x-ibm
1082 os=-tpf
1083 ;;
1084 udi29k)
1085 basic_machine=a29k-amd
1086 os=-udi
1087 ;;
1088 ultra3)
1089 basic_machine=a29k-nyu
1090 os=-sym1
1091 ;;
1092 v810 | necv810)
1093 basic_machine=v810-nec
1094 os=-none
1095 ;;
1096 vaxv)
1097 basic_machine=vax-dec
1098 os=-sysv
1099 ;;
1100 vms)
1101 basic_machine=vax-dec
1102 os=-vms
1103 ;;
1104 vpp*|vx|vx-*)
1105 basic_machine=f301-fujitsu
1106 ;;
1107 vxworks960)
1108 basic_machine=i960-wrs
1109 os=-vxworks
1110 ;;
1111 vxworks68)
1112 basic_machine=m68k-wrs
1113 os=-vxworks
1114 ;;
1115 vxworks29k)
1116 basic_machine=a29k-wrs
1117 os=-vxworks
1118 ;;
1119 w65*)
1120 basic_machine=w65-wdc
1121 os=-none
1122 ;;
1123 w89k-*)
1124 basic_machine=hppa1.1-winbond
1125 os=-proelf
1126 ;;
1127 xbox)
1128 basic_machine=i686-pc
1129 os=-mingw32
1130 ;;
1131 xps | xps100)
1132 basic_machine=xps100-honeywell
1133 ;;
1134 ymp)
1135 basic_machine=ymp-cray
1136 os=-unicos
1137 ;;
1138 z8k-*-coff)
1139 basic_machine=z8k-unknown
1140 os=-sim
1141 ;;
1142 z80-*-coff)
1143 basic_machine=z80-unknown
1144 os=-sim
1145 ;;
1146 none)
1147 basic_machine=none-none
1148 os=-none
1149 ;;
1150
1151 # Here we handle the default manufacturer of certain CPU types. It is in
1152 # some cases the only manufacturer, in others, it is the most popular.
1153 w89k)
1154 basic_machine=hppa1.1-winbond
1155 ;;
1156 op50n)
1157 basic_machine=hppa1.1-oki
1158 ;;
1159 op60c)
1160 basic_machine=hppa1.1-oki
1161 ;;
1162 romp)
1163 basic_machine=romp-ibm
1164 ;;
1165 mmix)
1166 basic_machine=mmix-knuth
1167 ;;
1168 rs6000)
1169 basic_machine=rs6000-ibm
1170 ;;
1171 vax)
1172 basic_machine=vax-dec
1173 ;;
1174 pdp10)
1175 # there are many clones, so DEC is not a safe bet
1176 basic_machine=pdp10-unknown
1177 ;;
1178 pdp11)
1179 basic_machine=pdp11-dec
1180 ;;
1181 we32k)
1182 basic_machine=we32k-att
1183 ;;
1184 sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1185 basic_machine=sh-unknown
1186 ;;
1187 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1188 basic_machine=sparc-sun
1189 ;;
1190 cydra)
1191 basic_machine=cydra-cydrome
1192 ;;
1193 orion)
1194 basic_machine=orion-highlevel
1195 ;;
1196 orion105)
1197 basic_machine=clipper-highlevel
1198 ;;
1199 mac | mpw | mac-mpw)
1200 basic_machine=m68k-apple
1201 ;;
1202 pmac | pmac-mpw)
1203 basic_machine=powerpc-apple
1204 ;;
1205 *-unknown)
1206 # Make sure to match an already-canonicalized machine name.
1207 ;;
1208 *)
1209 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1210 exit 1
1211 ;;
1212 esac
1213
1214 # Here we canonicalize certain aliases for manufacturers.
1215 case $basic_machine in
1216 *-digital*)
1217 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1218 ;;
1219 *-commodore*)
1220 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1221 ;;
1222 *)
1223 ;;
1224 esac
1225
1226 # Decode manufacturer-specific aliases for certain operating systems.
1227
1228 if [ x"$os" != x"" ]
1229 then
1230 case $os in
1231 # First match some system type aliases
1232 # that might get confused with valid system types.
1233 # -solaris* is a basic system type, with this one exception.
1234 -solaris1 | -solaris1.*)
1235 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1236 ;;
1237 -solaris)
1238 os=-solaris2
1239 ;;
1240 -svr4*)
1241 os=-sysv4
1242 ;;
1243 -unixware*)
1244 os=-sysv4.2uw
1245 ;;
1246 -gnu/linux*)
1247 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1248 ;;
1249 # First accept the basic system types.
1250 # The portable systems comes first.
1251 # Each alternative MUST END IN A *, to match a version number.
1252 # -sysv* is not here because it comes later, after sysvr4.
1253 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1254 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1255 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1256 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1257 | -aos* \
1258 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1259 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1260 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1261 | -openbsd* | -solidbsd* \
1262 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1263 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1264 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1265 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1266 | -chorusos* | -chorusrdb* | -cegcc* \
1267 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1268 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1269 | -uxpv* | -beos* | -mpeix* | -udk* \
1270 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1271 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1272 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1273 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1274 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1275 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1276 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1277 # Remember, each alternative MUST END IN *, to match a version number.
1278 ;;
1279 -qnx*)
1280 case $basic_machine in
1281 x86-* | i*86-*)
1282 ;;
1283 *)
1284 os=-nto$os
1285 ;;
1286 esac
1287 ;;
1288 -nto-qnx*)
1289 ;;
1290 -nto*)
1291 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1292 ;;
1293 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1294 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1295 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1296 ;;
1297 -mac*)
1298 os=`echo $os | sed -e 's|mac|macos|'`
1299 ;;
1300 -linux-dietlibc)
1301 os=-linux-dietlibc
1302 ;;
1303 -linux*)
1304 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1305 ;;
1306 -sunos5*)
1307 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1308 ;;
1309 -sunos6*)
1310 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1311 ;;
1312 -opened*)
1313 os=-openedition
1314 ;;
1315 -os400*)
1316 os=-os400
1317 ;;
1318 -wince*)
1319 os=-wince
1320 ;;
1321 -osfrose*)
1322 os=-osfrose
1323 ;;
1324 -osf*)
1325 os=-osf
1326 ;;
1327 -utek*)
1328 os=-bsd
1329 ;;
1330 -dynix*)
1331 os=-bsd
1332 ;;
1333 -acis*)
1334 os=-aos
1335 ;;
1336 -atheos*)
1337 os=-atheos
1338 ;;
1339 -syllable*)
1340 os=-syllable
1341 ;;
1342 -386bsd)
1343 os=-bsd
1344 ;;
1345 -ctix* | -uts*)
1346 os=-sysv
1347 ;;
1348 -nova*)
1349 os=-rtmk-nova
1350 ;;
1351 -ns2 )
1352 os=-nextstep2
1353 ;;
1354 -nsk*)
1355 os=-nsk
1356 ;;
1357 # Preserve the version number of sinix5.
1358 -sinix5.*)
1359 os=`echo $os | sed -e 's|sinix|sysv|'`
1360 ;;
1361 -sinix*)
1362 os=-sysv4
1363 ;;
1364 -tpf*)
1365 os=-tpf
1366 ;;
1367 -triton*)
1368 os=-sysv3
1369 ;;
1370 -oss*)
1371 os=-sysv3
1372 ;;
1373 -svr4)
1374 os=-sysv4
1375 ;;
1376 -svr3)
1377 os=-sysv3
1378 ;;
1379 -sysvr4)
1380 os=-sysv4
1381 ;;
1382 # This must come after -sysvr4.
1383 -sysv*)
1384 ;;
1385 -ose*)
1386 os=-ose
1387 ;;
1388 -es1800*)
1389 os=-ose
1390 ;;
1391 -xenix)
1392 os=-xenix
1393 ;;
1394 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1395 os=-mint
1396 ;;
1397 -aros*)
1398 os=-aros
1399 ;;
1400 -kaos*)
1401 os=-kaos
1402 ;;
1403 -zvmoe)
1404 os=-zvmoe
1405 ;;
1406 -dicos*)
1407 os=-dicos
1408 ;;
1409 -none)
1410 ;;
1411 *)
1412 # Get rid of the `-' at the beginning of $os.
1413 os=`echo $os | sed 's/[^-]*-//'`
1414 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1415 exit 1
1416 ;;
1417 esac
1418 else
1419
1420 # Here we handle the default operating systems that come with various machines.
1421 # The value should be what the vendor currently ships out the door with their
1422 # machine or put another way, the most popular os provided with the machine.
1423
1424 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1425 # "-sun"), then you have to tell the case statement up towards the top
1426 # that MANUFACTURER isn't an operating system. Otherwise, code above
1427 # will signal an error saying that MANUFACTURER isn't an operating
1428 # system, and we'll never get to this point.
1429
1430 case $basic_machine in
1431 score-*)
1432 os=-elf
1433 ;;
1434 spu-*)
1435 os=-elf
1436 ;;
1437 *-acorn)
1438 os=-riscix1.2
1439 ;;
1440 arm*-rebel)
1441 os=-linux
1442 ;;
1443 arm*-semi)
1444 os=-aout
1445 ;;
1446 c4x-* | tic4x-*)
1447 os=-coff
1448 ;;
1449 # This must come before the *-dec entry.
1450 pdp10-*)
1451 os=-tops20
1452 ;;
1453 pdp11-*)
1454 os=-none
1455 ;;
1456 *-dec | vax-*)
1457 os=-ultrix4.2
1458 ;;
1459 m68*-apollo)
1460 os=-domain
1461 ;;
1462 i386-sun)
1463 os=-sunos4.0.2
1464 ;;
1465 m68000-sun)
1466 os=-sunos3
1467 # This also exists in the configure program, but was not the
1468 # default.
1469 # os=-sunos4
1470 ;;
1471 m68*-cisco)
1472 os=-aout
1473 ;;
1474 mep-*)
1475 os=-elf
1476 ;;
1477 mips*-cisco)
1478 os=-elf
1479 ;;
1480 mips*-*)
1481 os=-elf
1482 ;;
1483 or32-*)
1484 os=-coff
1485 ;;
1486 *-tti) # must be before sparc entry or we get the wrong os.
1487 os=-sysv3
1488 ;;
1489 sparc-* | *-sun)
1490 os=-sunos4.1.1
1491 ;;
1492 *-be)
1493 os=-beos
1494 ;;
1495 *-haiku)
1496 os=-haiku
1497 ;;
1498 *-ibm)
1499 os=-aix
1500 ;;
1501 *-knuth)
1502 os=-mmixware
1503 ;;
1504 *-wec)
1505 os=-proelf
1506 ;;
1507 *-winbond)
1508 os=-proelf
1509 ;;
1510 *-oki)
1511 os=-proelf
1512 ;;
1513 *-hp)
1514 os=-hpux
1515 ;;
1516 *-hitachi)
1517 os=-hiux
1518 ;;
1519 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1520 os=-sysv
1521 ;;
1522 *-cbm)
1523 os=-amigaos
1524 ;;
1525 *-dg)
1526 os=-dgux
1527 ;;
1528 *-dolphin)
1529 os=-sysv3
1530 ;;
1531 m68k-ccur)
1532 os=-rtu
1533 ;;
1534 m88k-omron*)
1535 os=-luna
1536 ;;
1537 *-next )
1538 os=-nextstep
1539 ;;
1540 *-sequent)
1541 os=-ptx
1542 ;;
1543 *-crds)
1544 os=-unos
1545 ;;
1546 *-ns)
1547 os=-genix
1548 ;;
1549 i370-*)
1550 os=-mvs
1551 ;;
1552 *-next)
1553 os=-nextstep3
1554 ;;
1555 *-gould)
1556 os=-sysv
1557 ;;
1558 *-highlevel)
1559 os=-bsd
1560 ;;
1561 *-encore)
1562 os=-bsd
1563 ;;
1564 *-sgi)
1565 os=-irix
1566 ;;
1567 *-siemens)
1568 os=-sysv4
1569 ;;
1570 *-masscomp)
1571 os=-rtu
1572 ;;
1573 f30[01]-fujitsu | f700-fujitsu)
1574 os=-uxpv
1575 ;;
1576 *-rom68k)
1577 os=-coff
1578 ;;
1579 *-*bug)
1580 os=-coff
1581 ;;
1582 *-apple)
1583 os=-macos
1584 ;;
1585 *-atari*)
1586 os=-mint
1587 ;;
1588 *)
1589 os=-none
1590 ;;
1591 esac
1592 fi
1593
1594 # Here we handle the case where we know the os, and the CPU type, but not the
1595 # manufacturer. We pick the logical manufacturer.
1596 vendor=unknown
1597 case $basic_machine in
1598 *-unknown)
1599 case $os in
1600 -riscix*)
1601 vendor=acorn
1602 ;;
1603 -sunos*)
1604 vendor=sun
1605 ;;
1606 -aix*)
1607 vendor=ibm
1608 ;;
1609 -beos*)
1610 vendor=be
1611 ;;
1612 -hpux*)
1613 vendor=hp
1614 ;;
1615 -mpeix*)
1616 vendor=hp
1617 ;;
1618 -hiux*)
1619 vendor=hitachi
1620 ;;
1621 -unos*)
1622 vendor=crds
1623 ;;
1624 -dgux*)
1625 vendor=dg
1626 ;;
1627 -luna*)
1628 vendor=omron
1629 ;;
1630 -genix*)
1631 vendor=ns
1632 ;;
1633 -mvs* | -opened*)
1634 vendor=ibm
1635 ;;
1636 -os400*)
1637 vendor=ibm
1638 ;;
1639 -ptx*)
1640 vendor=sequent
1641 ;;
1642 -tpf*)
1643 vendor=ibm
1644 ;;
1645 -vxsim* | -vxworks* | -windiss*)
1646 vendor=wrs
1647 ;;
1648 -aux*)
1649 vendor=apple
1650 ;;
1651 -hms*)
1652 vendor=hitachi
1653 ;;
1654 -mpw* | -macos*)
1655 vendor=apple
1656 ;;
1657 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1658 vendor=atari
1659 ;;
1660 -vos*)
1661 vendor=stratus
1662 ;;
1663 esac
1664 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1665 ;;
1666 esac
1667
1668 echo $basic_machine$os
1669 exit
1670
1671 # Local variables:
1672 # eval: (add-hook 'write-file-hooks 'time-stamp)
1673 # time-stamp-start: "timestamp='"
1674 # time-stamp-format: "%:y-%02m-%02d"
1675 # time-stamp-end: "'"
1676 # End:
0 #! /bin/sh
1 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.63 for libatasmart 0.13.
3 #
4 # Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>.
5 #
6 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
7 # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10 ## --------------------- ##
11 ## M4sh Initialization. ##
12 ## --------------------- ##
13
14 # Be more Bourne compatible
15 DUALCASE=1; export DUALCASE # for MKS sh
16 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17 emulate sh
18 NULLCMD=:
19 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
20 # is contrary to our usage. Disable this feature.
21 alias -g '${1+"$@"}'='"$@"'
22 setopt NO_GLOB_SUBST
23 else
24 case `(set -o) 2>/dev/null` in
25 *posix*) set -o posix ;;
26 esac
27
28 fi
29
30
31
32
33 # PATH needs CR
34 # Avoid depending upon Character Ranges.
35 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
36 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
37 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
38 as_cr_digits='0123456789'
39 as_cr_alnum=$as_cr_Letters$as_cr_digits
40
41 as_nl='
42 '
43 export as_nl
44 # Printing a long string crashes Solaris 7 /usr/bin/printf.
45 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
46 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
47 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
48 if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
49 as_echo='printf %s\n'
50 as_echo_n='printf %s'
51 else
52 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
53 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
54 as_echo_n='/usr/ucb/echo -n'
55 else
56 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
57 as_echo_n_body='eval
58 arg=$1;
59 case $arg in
60 *"$as_nl"*)
61 expr "X$arg" : "X\\(.*\\)$as_nl";
62 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
63 esac;
64 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
65 '
66 export as_echo_n_body
67 as_echo_n='sh -c $as_echo_n_body as_echo'
68 fi
69 export as_echo_body
70 as_echo='sh -c $as_echo_body as_echo'
71 fi
72
73 # The user is always right.
74 if test "${PATH_SEPARATOR+set}" != set; then
75 PATH_SEPARATOR=:
76 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
77 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
78 PATH_SEPARATOR=';'
79 }
80 fi
81
82 # Support unset when possible.
83 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
84 as_unset=unset
85 else
86 as_unset=false
87 fi
88
89
90 # IFS
91 # We need space, tab and new line, in precisely that order. Quoting is
92 # there to prevent editors from complaining about space-tab.
93 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
94 # splitting by setting IFS to empty value.)
95 IFS=" "" $as_nl"
96
97 # Find who we are. Look in the path if we contain no directory separator.
98 case $0 in
99 *[\\/]* ) as_myself=$0 ;;
100 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
101 for as_dir in $PATH
102 do
103 IFS=$as_save_IFS
104 test -z "$as_dir" && as_dir=.
105 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
106 done
107 IFS=$as_save_IFS
108
109 ;;
110 esac
111 # We did not find ourselves, most probably we were run as `sh COMMAND'
112 # in which case we are not to be found in the path.
113 if test "x$as_myself" = x; then
114 as_myself=$0
115 fi
116 if test ! -f "$as_myself"; then
117 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
118 { (exit 1); exit 1; }
119 fi
120
121 # Work around bugs in pre-3.0 UWIN ksh.
122 for as_var in ENV MAIL MAILPATH
123 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
124 done
125 PS1='$ '
126 PS2='> '
127 PS4='+ '
128
129 # NLS nuisances.
130 LC_ALL=C
131 export LC_ALL
132 LANGUAGE=C
133 export LANGUAGE
134
135 # Required to use basename.
136 if expr a : '\(a\)' >/dev/null 2>&1 &&
137 test "X`expr 00001 : '.*\(...\)'`" = X001; then
138 as_expr=expr
139 else
140 as_expr=false
141 fi
142
143 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
144 as_basename=basename
145 else
146 as_basename=false
147 fi
148
149
150 # Name of the executable.
151 as_me=`$as_basename -- "$0" ||
152 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
153 X"$0" : 'X\(//\)$' \| \
154 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
155 $as_echo X/"$0" |
156 sed '/^.*\/\([^/][^/]*\)\/*$/{
157 s//\1/
158 q
159 }
160 /^X\/\(\/\/\)$/{
161 s//\1/
162 q
163 }
164 /^X\/\(\/\).*/{
165 s//\1/
166 q
167 }
168 s/.*/./; q'`
169
170 # CDPATH.
171 $as_unset CDPATH
172
173
174 if test "x$CONFIG_SHELL" = x; then
175 if (eval ":") 2>/dev/null; then
176 as_have_required=yes
177 else
178 as_have_required=no
179 fi
180
181 if test $as_have_required = yes && (eval ":
182 (as_func_return () {
183 (exit \$1)
184 }
185 as_func_success () {
186 as_func_return 0
187 }
188 as_func_failure () {
189 as_func_return 1
190 }
191 as_func_ret_success () {
192 return 0
193 }
194 as_func_ret_failure () {
195 return 1
196 }
197
198 exitcode=0
199 if as_func_success; then
200 :
201 else
202 exitcode=1
203 echo as_func_success failed.
204 fi
205
206 if as_func_failure; then
207 exitcode=1
208 echo as_func_failure succeeded.
209 fi
210
211 if as_func_ret_success; then
212 :
213 else
214 exitcode=1
215 echo as_func_ret_success failed.
216 fi
217
218 if as_func_ret_failure; then
219 exitcode=1
220 echo as_func_ret_failure succeeded.
221 fi
222
223 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
224 :
225 else
226 exitcode=1
227 echo positional parameters were not saved.
228 fi
229
230 test \$exitcode = 0) || { (exit 1); exit 1; }
231
232 (
233 as_lineno_1=\$LINENO
234 as_lineno_2=\$LINENO
235 test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
236 test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
237 ") 2> /dev/null; then
238 :
239 else
240 as_candidate_shells=
241 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
242 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
243 do
244 IFS=$as_save_IFS
245 test -z "$as_dir" && as_dir=.
246 case $as_dir in
247 /*)
248 for as_base in sh bash ksh sh5; do
249 as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
250 done;;
251 esac
252 done
253 IFS=$as_save_IFS
254
255
256 for as_shell in $as_candidate_shells $SHELL; do
257 # Try only shells that exist, to save several forks.
258 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
259 { ("$as_shell") 2> /dev/null <<\_ASEOF
260 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
261 emulate sh
262 NULLCMD=:
263 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
264 # is contrary to our usage. Disable this feature.
265 alias -g '${1+"$@"}'='"$@"'
266 setopt NO_GLOB_SUBST
267 else
268 case `(set -o) 2>/dev/null` in
269 *posix*) set -o posix ;;
270 esac
271
272 fi
273
274
275 :
276 _ASEOF
277 }; then
278 CONFIG_SHELL=$as_shell
279 as_have_required=yes
280 if { "$as_shell" 2> /dev/null <<\_ASEOF
281 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
282 emulate sh
283 NULLCMD=:
284 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
285 # is contrary to our usage. Disable this feature.
286 alias -g '${1+"$@"}'='"$@"'
287 setopt NO_GLOB_SUBST
288 else
289 case `(set -o) 2>/dev/null` in
290 *posix*) set -o posix ;;
291 esac
292
293 fi
294
295
296 :
297 (as_func_return () {
298 (exit $1)
299 }
300 as_func_success () {
301 as_func_return 0
302 }
303 as_func_failure () {
304 as_func_return 1
305 }
306 as_func_ret_success () {
307 return 0
308 }
309 as_func_ret_failure () {
310 return 1
311 }
312
313 exitcode=0
314 if as_func_success; then
315 :
316 else
317 exitcode=1
318 echo as_func_success failed.
319 fi
320
321 if as_func_failure; then
322 exitcode=1
323 echo as_func_failure succeeded.
324 fi
325
326 if as_func_ret_success; then
327 :
328 else
329 exitcode=1
330 echo as_func_ret_success failed.
331 fi
332
333 if as_func_ret_failure; then
334 exitcode=1
335 echo as_func_ret_failure succeeded.
336 fi
337
338 if ( set x; as_func_ret_success y && test x = "$1" ); then
339 :
340 else
341 exitcode=1
342 echo positional parameters were not saved.
343 fi
344
345 test $exitcode = 0) || { (exit 1); exit 1; }
346
347 (
348 as_lineno_1=$LINENO
349 as_lineno_2=$LINENO
350 test "x$as_lineno_1" != "x$as_lineno_2" &&
351 test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
352
353 _ASEOF
354 }; then
355 break
356 fi
357
358 fi
359
360 done
361
362 if test "x$CONFIG_SHELL" != x; then
363 for as_var in BASH_ENV ENV
364 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
365 done
366 export CONFIG_SHELL
367 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
368 fi
369
370
371 if test $as_have_required = no; then
372 echo This script requires a shell more modern than all the
373 echo shells that I found on your system. Please install a
374 echo modern shell, or manually run the script under such a
375 echo shell if you do have one.
376 { (exit 1); exit 1; }
377 fi
378
379
380 fi
381
382 fi
383
384
385
386 (eval "as_func_return () {
387 (exit \$1)
388 }
389 as_func_success () {
390 as_func_return 0
391 }
392 as_func_failure () {
393 as_func_return 1
394 }
395 as_func_ret_success () {
396 return 0
397 }
398 as_func_ret_failure () {
399 return 1
400 }
401
402 exitcode=0
403 if as_func_success; then
404 :
405 else
406 exitcode=1
407 echo as_func_success failed.
408 fi
409
410 if as_func_failure; then
411 exitcode=1
412 echo as_func_failure succeeded.
413 fi
414
415 if as_func_ret_success; then
416 :
417 else
418 exitcode=1
419 echo as_func_ret_success failed.
420 fi
421
422 if as_func_ret_failure; then
423 exitcode=1
424 echo as_func_ret_failure succeeded.
425 fi
426
427 if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
428 :
429 else
430 exitcode=1
431 echo positional parameters were not saved.
432 fi
433
434 test \$exitcode = 0") || {
435 echo No shell found that supports shell functions.
436 echo Please tell bug-autoconf@gnu.org about your system,
437 echo including any error possibly output before this message.
438 echo This can help us improve future autoconf versions.
439 echo Configuration will now proceed without shell functions.
440 }
441
442
443
444 as_lineno_1=$LINENO
445 as_lineno_2=$LINENO
446 test "x$as_lineno_1" != "x$as_lineno_2" &&
447 test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
448
449 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
450 # uniformly replaced by the line number. The first 'sed' inserts a
451 # line-number line after each line using $LINENO; the second 'sed'
452 # does the real work. The second script uses 'N' to pair each
453 # line-number line with the line containing $LINENO, and appends
454 # trailing '-' during substitution so that $LINENO is not a special
455 # case at line end.
456 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
457 # scripts with optimization help from Paolo Bonzini. Blame Lee
458 # E. McMahon (1931-1989) for sed's syntax. :-)
459 sed -n '
460 p
461 /[$]LINENO/=
462 ' <$as_myself |
463 sed '
464 s/[$]LINENO.*/&-/
465 t lineno
466 b
467 :lineno
468 N
469 :loop
470 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
471 t loop
472 s/-\n.*//
473 ' >$as_me.lineno &&
474 chmod +x "$as_me.lineno" ||
475 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
476 { (exit 1); exit 1; }; }
477
478 # Don't try to exec as it changes $[0], causing all sort of problems
479 # (the dirname of $[0] is not the place where we might find the
480 # original and so on. Autoconf is especially sensitive to this).
481 . "./$as_me.lineno"
482 # Exit status is that of the last command.
483 exit
484 }
485
486
487 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
488 as_dirname=dirname
489 else
490 as_dirname=false
491 fi
492
493 ECHO_C= ECHO_N= ECHO_T=
494 case `echo -n x` in
495 -n*)
496 case `echo 'x\c'` in
497 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
498 *) ECHO_C='\c';;
499 esac;;
500 *)
501 ECHO_N='-n';;
502 esac
503 if expr a : '\(a\)' >/dev/null 2>&1 &&
504 test "X`expr 00001 : '.*\(...\)'`" = X001; then
505 as_expr=expr
506 else
507 as_expr=false
508 fi
509
510 rm -f conf$$ conf$$.exe conf$$.file
511 if test -d conf$$.dir; then
512 rm -f conf$$.dir/conf$$.file
513 else
514 rm -f conf$$.dir
515 mkdir conf$$.dir 2>/dev/null
516 fi
517 if (echo >conf$$.file) 2>/dev/null; then
518 if ln -s conf$$.file conf$$ 2>/dev/null; then
519 as_ln_s='ln -s'
520 # ... but there are two gotchas:
521 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
522 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
523 # In both cases, we have to default to `cp -p'.
524 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
525 as_ln_s='cp -p'
526 elif ln conf$$.file conf$$ 2>/dev/null; then
527 as_ln_s=ln
528 else
529 as_ln_s='cp -p'
530 fi
531 else
532 as_ln_s='cp -p'
533 fi
534 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
535 rmdir conf$$.dir 2>/dev/null
536
537 if mkdir -p . 2>/dev/null; then
538 as_mkdir_p=:
539 else
540 test -d ./-p && rmdir ./-p
541 as_mkdir_p=false
542 fi
543
544 if test -x / >/dev/null 2>&1; then
545 as_test_x='test -x'
546 else
547 if ls -dL / >/dev/null 2>&1; then
548 as_ls_L_option=L
549 else
550 as_ls_L_option=
551 fi
552 as_test_x='
553 eval sh -c '\''
554 if test -d "$1"; then
555 test -d "$1/.";
556 else
557 case $1 in
558 -*)set "./$1";;
559 esac;
560 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
561 ???[sx]*):;;*)false;;esac;fi
562 '\'' sh
563 '
564 fi
565 as_executable_p=$as_test_x
566
567 # Sed expression to map a string onto a valid CPP name.
568 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
569
570 # Sed expression to map a string onto a valid variable name.
571 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
572
573
574
575
576 # Check that we are running under the correct shell.
577 SHELL=${CONFIG_SHELL-/bin/sh}
578
579 case X$lt_ECHO in
580 X*--fallback-echo)
581 # Remove one level of quotation (which was required for Make).
582 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
583 ;;
584 esac
585
586 ECHO=${lt_ECHO-echo}
587 if test "X$1" = X--no-reexec; then
588 # Discard the --no-reexec flag, and continue.
589 shift
590 elif test "X$1" = X--fallback-echo; then
591 # Avoid inline document here, it may be left over
592 :
593 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
594 # Yippee, $ECHO works!
595 :
596 else
597 # Restart under the correct shell.
598 exec $SHELL "$0" --no-reexec ${1+"$@"}
599 fi
600
601 if test "X$1" = X--fallback-echo; then
602 # used as fallback echo
603 shift
604 cat <<_LT_EOF
605 $*
606 _LT_EOF
607 exit 0
608 fi
609
610 # The HP-UX ksh and POSIX shell print the target directory to stdout
611 # if CDPATH is set.
612 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
613
614 if test -z "$lt_ECHO"; then
615 if test "X${echo_test_string+set}" != Xset; then
616 # find a string as large as possible, as long as the shell can cope with it
617 for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
618 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
619 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
620 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
621 then
622 break
623 fi
624 done
625 fi
626
627 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
628 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
629 test "X$echo_testing_string" = "X$echo_test_string"; then
630 :
631 else
632 # The Solaris, AIX, and Digital Unix default echo programs unquote
633 # backslashes. This makes it impossible to quote backslashes using
634 # echo "$something" | sed 's/\\/\\\\/g'
635 #
636 # So, first we look for a working echo in the user's PATH.
637
638 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
639 for dir in $PATH /usr/ucb; do
640 IFS="$lt_save_ifs"
641 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
642 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
643 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
644 test "X$echo_testing_string" = "X$echo_test_string"; then
645 ECHO="$dir/echo"
646 break
647 fi
648 done
649 IFS="$lt_save_ifs"
650
651 if test "X$ECHO" = Xecho; then
652 # We didn't find a better echo, so look for alternatives.
653 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
654 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
655 test "X$echo_testing_string" = "X$echo_test_string"; then
656 # This shell has a builtin print -r that does the trick.
657 ECHO='print -r'
658 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
659 test "X$CONFIG_SHELL" != X/bin/ksh; then
660 # If we have ksh, try running configure again with it.
661 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
662 export ORIGINAL_CONFIG_SHELL
663 CONFIG_SHELL=/bin/ksh
664 export CONFIG_SHELL
665 exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
666 else
667 # Try using printf.
668 ECHO='printf %s\n'
669 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
670 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
671 test "X$echo_testing_string" = "X$echo_test_string"; then
672 # Cool, printf works
673 :
674 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
675 test "X$echo_testing_string" = 'X\t' &&
676 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
677 test "X$echo_testing_string" = "X$echo_test_string"; then
678 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
679 export CONFIG_SHELL
680 SHELL="$CONFIG_SHELL"
681 export SHELL
682 ECHO="$CONFIG_SHELL $0 --fallback-echo"
683 elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
684 test "X$echo_testing_string" = 'X\t' &&
685 echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
686 test "X$echo_testing_string" = "X$echo_test_string"; then
687 ECHO="$CONFIG_SHELL $0 --fallback-echo"
688 else
689 # maybe with a smaller string...
690 prev=:
691
692 for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
693 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
694 then
695 break
696 fi
697 prev="$cmd"
698 done
699
700 if test "$prev" != 'sed 50q "$0"'; then
701 echo_test_string=`eval $prev`
702 export echo_test_string
703 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
704 else
705 # Oops. We lost completely, so just stick with echo.
706 ECHO=echo
707 fi
708 fi
709 fi
710 fi
711 fi
712 fi
713
714 # Copy echo and quote the copy suitably for passing to libtool from
715 # the Makefile, instead of quoting the original, which is used later.
716 lt_ECHO=$ECHO
717 if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
718 lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
719 fi
720
721
722
723
724 exec 7<&0 </dev/null 6>&1
725
726 # Name of the host.
727 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
728 # so uname gets run too.
729 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
730
731 #
732 # Initializations.
733 #
734 ac_default_prefix=/usr/local
735 ac_clean_files=
736 ac_config_libobj_dir=.
737 LIBOBJS=
738 cross_compiling=no
739 subdirs=
740 MFLAGS=
741 MAKEFLAGS=
742 SHELL=${CONFIG_SHELL-/bin/sh}
743
744 # Identity of this package.
745 PACKAGE_NAME='libatasmart'
746 PACKAGE_TARNAME='libatasmart'
747 PACKAGE_VERSION='0.13'
748 PACKAGE_STRING='libatasmart 0.13'
749 PACKAGE_BUGREPORT='mzyvongnfzneg (at) 0pointer (dot) net'
750
751 ac_unique_file="atasmart.c"
752 # Factoring default headers for most tests.
753 ac_includes_default="\
754 #include <stdio.h>
755 #ifdef HAVE_SYS_TYPES_H
756 # include <sys/types.h>
757 #endif
758 #ifdef HAVE_SYS_STAT_H
759 # include <sys/stat.h>
760 #endif
761 #ifdef STDC_HEADERS
762 # include <stdlib.h>
763 # include <stddef.h>
764 #else
765 # ifdef HAVE_STDLIB_H
766 # include <stdlib.h>
767 # endif
768 #endif
769 #ifdef HAVE_STRING_H
770 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
771 # include <memory.h>
772 # endif
773 # include <string.h>
774 #endif
775 #ifdef HAVE_STRINGS_H
776 # include <strings.h>
777 #endif
778 #ifdef HAVE_INTTYPES_H
779 # include <inttypes.h>
780 #endif
781 #ifdef HAVE_STDINT_H
782 # include <stdint.h>
783 #endif
784 #ifdef HAVE_UNISTD_H
785 # include <unistd.h>
786 #endif"
787
788 ac_subst_vars='LTLIBOBJS
789 LIBOBJS
790 LIBUDEV_LIBS
791 LIBUDEV_CFLAGS
792 PKG_CONFIG
793 CXXCPP
794 OTOOL64
795 OTOOL
796 LIPO
797 NMEDIT
798 DSYMUTIL
799 lt_ECHO
800 RANLIB
801 AR
802 OBJDUMP
803 LN_S
804 NM
805 ac_ct_DUMPBIN
806 DUMPBIN
807 LD
808 FGREP
809 SED
810 LIBTOOL
811 am__fastdepCXX_FALSE
812 am__fastdepCXX_TRUE
813 CXXDEPMODE
814 ac_ct_CXX
815 CXXFLAGS
816 CXX
817 EGREP
818 GREP
819 CPP
820 am__fastdepCC_FALSE
821 am__fastdepCC_TRUE
822 CCDEPMODE
823 AMDEPBACKSLASH
824 AMDEP_FALSE
825 AMDEP_TRUE
826 am__quote
827 am__include
828 DEPDIR
829 OBJEXT
830 EXEEXT
831 ac_ct_CC
832 CPPFLAGS
833 LDFLAGS
834 CFLAGS
835 CC
836 host_os
837 host_vendor
838 host_cpu
839 host
840 build_os
841 build_vendor
842 build_cpu
843 build
844 LIBATASMART_VERSION_INFO
845 PACKAGE_URL
846 am__untar
847 am__tar
848 AMTAR
849 am__leading_dot
850 SET_MAKE
851 AWK
852 mkdir_p
853 MKDIR_P
854 INSTALL_STRIP_PROGRAM
855 STRIP
856 install_sh
857 MAKEINFO
858 AUTOHEADER
859 AUTOMAKE
860 AUTOCONF
861 ACLOCAL
862 VERSION
863 PACKAGE
864 CYGPATH_W
865 am__isrc
866 INSTALL_DATA
867 INSTALL_SCRIPT
868 INSTALL_PROGRAM
869 target_alias
870 host_alias
871 build_alias
872 LIBS
873 ECHO_T
874 ECHO_N
875 ECHO_C
876 DEFS
877 mandir
878 localedir
879 libdir
880 psdir
881 pdfdir
882 dvidir
883 htmldir
884 infodir
885 docdir
886 oldincludedir
887 includedir
888 localstatedir
889 sharedstatedir
890 sysconfdir
891 datadir
892 datarootdir
893 libexecdir
894 sbindir
895 bindir
896 program_transform_name
897 prefix
898 exec_prefix
899 PACKAGE_BUGREPORT
900 PACKAGE_STRING
901 PACKAGE_VERSION
902 PACKAGE_TARNAME
903 PACKAGE_NAME
904 PATH_SEPARATOR
905 SHELL'
906 ac_subst_files=''
907 ac_user_opts='
908 enable_option_checking
909 enable_dependency_tracking
910 enable_shared
911 enable_static
912 with_pic
913 enable_fast_install
914 with_gnu_ld
915 enable_libtool_lock
916 enable_largefile
917 '
918 ac_precious_vars='build_alias
919 host_alias
920 target_alias
921 CC
922 CFLAGS
923 LDFLAGS
924 LIBS
925 CPPFLAGS
926 CPP
927 CXX
928 CXXFLAGS
929 CCC
930 CXXCPP
931 PKG_CONFIG
932 LIBUDEV_CFLAGS
933 LIBUDEV_LIBS'
934
935
936 # Initialize some variables set by options.
937 ac_init_help=
938 ac_init_version=false
939 ac_unrecognized_opts=
940 ac_unrecognized_sep=
941 # The variables have the same names as the options, with
942 # dashes changed to underlines.
943 cache_file=/dev/null
944 exec_prefix=NONE
945 no_create=
946 no_recursion=
947 prefix=NONE
948 program_prefix=NONE
949 program_suffix=NONE
950 program_transform_name=s,x,x,
951 silent=
952 site=
953 srcdir=
954 verbose=
955 x_includes=NONE
956 x_libraries=NONE
957
958 # Installation directory options.
959 # These are left unexpanded so users can "make install exec_prefix=/foo"
960 # and all the variables that are supposed to be based on exec_prefix
961 # by default will actually change.
962 # Use braces instead of parens because sh, perl, etc. also accept them.
963 # (The list follows the same order as the GNU Coding Standards.)
964 bindir='${exec_prefix}/bin'
965 sbindir='${exec_prefix}/sbin'
966 libexecdir='${exec_prefix}/libexec'
967 datarootdir='${prefix}/share'
968 datadir='${datarootdir}'
969 sysconfdir='${prefix}/etc'
970 sharedstatedir='${prefix}/com'
971 localstatedir='${prefix}/var'
972 includedir='${prefix}/include'
973 oldincludedir='/usr/include'
974 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
975 infodir='${datarootdir}/info'
976 htmldir='${docdir}'
977 dvidir='${docdir}'
978 pdfdir='${docdir}'
979 psdir='${docdir}'
980 libdir='${exec_prefix}/lib'
981 localedir='${datarootdir}/locale'
982 mandir='${datarootdir}/man'
983
984 ac_prev=
985 ac_dashdash=
986 for ac_option
987 do
988 # If the previous option needs an argument, assign it.
989 if test -n "$ac_prev"; then
990 eval $ac_prev=\$ac_option
991 ac_prev=
992 continue
993 fi
994
995 case $ac_option in
996 *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
997 *) ac_optarg=yes ;;
998 esac
999
1000 # Accept the important Cygnus configure options, so we can diagnose typos.
1001
1002 case $ac_dashdash$ac_option in
1003 --)
1004 ac_dashdash=yes ;;
1005
1006 -bindir | --bindir | --bindi | --bind | --bin | --bi)
1007 ac_prev=bindir ;;
1008 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
1009 bindir=$ac_optarg ;;
1010
1011 -build | --build | --buil | --bui | --bu)
1012 ac_prev=build_alias ;;
1013 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
1014 build_alias=$ac_optarg ;;
1015
1016 -cache-file | --cache-file | --cache-fil | --cache-fi \
1017 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1018 ac_prev=cache_file ;;
1019 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1020 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1021 cache_file=$ac_optarg ;;
1022
1023 --config-cache | -C)
1024 cache_file=config.cache ;;
1025
1026 -datadir | --datadir | --datadi | --datad)
1027 ac_prev=datadir ;;
1028 -datadir=* | --datadir=* | --datadi=* | --datad=*)
1029 datadir=$ac_optarg ;;
1030
1031 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
1032 | --dataroo | --dataro | --datar)
1033 ac_prev=datarootdir ;;
1034 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
1035 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
1036 datarootdir=$ac_optarg ;;
1037
1038 -disable-* | --disable-*)
1039 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
1040 # Reject names that are not valid shell variable names.
1041 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1042 { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
1043 { (exit 1); exit 1; }; }
1044 ac_useropt_orig=$ac_useropt
1045 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1046 case $ac_user_opts in
1047 *"
1048 "enable_$ac_useropt"
1049 "*) ;;
1050 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
1051 ac_unrecognized_sep=', ';;
1052 esac
1053 eval enable_$ac_useropt=no ;;
1054
1055 -docdir | --docdir | --docdi | --doc | --do)
1056 ac_prev=docdir ;;
1057 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
1058 docdir=$ac_optarg ;;
1059
1060 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
1061 ac_prev=dvidir ;;
1062 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
1063 dvidir=$ac_optarg ;;
1064
1065 -enable-* | --enable-*)
1066 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
1067 # Reject names that are not valid shell variable names.
1068 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1069 { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
1070 { (exit 1); exit 1; }; }
1071 ac_useropt_orig=$ac_useropt
1072 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1073 case $ac_user_opts in
1074 *"
1075 "enable_$ac_useropt"
1076 "*) ;;
1077 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1078 ac_unrecognized_sep=', ';;
1079 esac
1080 eval enable_$ac_useropt=\$ac_optarg ;;
1081
1082 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1083 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1084 | --exec | --exe | --ex)
1085 ac_prev=exec_prefix ;;
1086 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1087 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1088 | --exec=* | --exe=* | --ex=*)
1089 exec_prefix=$ac_optarg ;;
1090
1091 -gas | --gas | --ga | --g)
1092 # Obsolete; use --with-gas.
1093 with_gas=yes ;;
1094
1095 -help | --help | --hel | --he | -h)
1096 ac_init_help=long ;;
1097 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1098 ac_init_help=recursive ;;
1099 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1100 ac_init_help=short ;;
1101
1102 -host | --host | --hos | --ho)
1103 ac_prev=host_alias ;;
1104 -host=* | --host=* | --hos=* | --ho=*)
1105 host_alias=$ac_optarg ;;
1106
1107 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1108 ac_prev=htmldir ;;
1109 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1110 | --ht=*)
1111 htmldir=$ac_optarg ;;
1112
1113 -includedir | --includedir | --includedi | --included | --include \
1114 | --includ | --inclu | --incl | --inc)
1115 ac_prev=includedir ;;
1116 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1117 | --includ=* | --inclu=* | --incl=* | --inc=*)
1118 includedir=$ac_optarg ;;
1119
1120 -infodir | --infodir | --infodi | --infod | --info | --inf)
1121 ac_prev=infodir ;;
1122 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1123 infodir=$ac_optarg ;;
1124
1125 -libdir | --libdir | --libdi | --libd)
1126 ac_prev=libdir ;;
1127 -libdir=* | --libdir=* | --libdi=* | --libd=*)
1128 libdir=$ac_optarg ;;
1129
1130 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1131 | --libexe | --libex | --libe)
1132 ac_prev=libexecdir ;;
1133 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1134 | --libexe=* | --libex=* | --libe=*)
1135 libexecdir=$ac_optarg ;;
1136
1137 -localedir | --localedir | --localedi | --localed | --locale)
1138 ac_prev=localedir ;;
1139 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1140 localedir=$ac_optarg ;;
1141
1142 -localstatedir | --localstatedir | --localstatedi | --localstated \
1143 | --localstate | --localstat | --localsta | --localst | --locals)
1144 ac_prev=localstatedir ;;
1145 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1146 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1147 localstatedir=$ac_optarg ;;
1148
1149 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1150 ac_prev=mandir ;;
1151 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1152 mandir=$ac_optarg ;;
1153
1154 -nfp | --nfp | --nf)
1155 # Obsolete; use --without-fp.
1156 with_fp=no ;;
1157
1158 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1159 | --no-cr | --no-c | -n)
1160 no_create=yes ;;
1161
1162 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1163 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1164 no_recursion=yes ;;
1165
1166 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1167 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1168 | --oldin | --oldi | --old | --ol | --o)
1169 ac_prev=oldincludedir ;;
1170 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1171 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1172 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1173 oldincludedir=$ac_optarg ;;
1174
1175 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1176 ac_prev=prefix ;;
1177 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1178 prefix=$ac_optarg ;;
1179
1180 -program-prefix | --program-prefix | --program-prefi | --program-pref \
1181 | --program-pre | --program-pr | --program-p)
1182 ac_prev=program_prefix ;;
1183 -program-prefix=* | --program-prefix=* | --program-prefi=* \
1184 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1185 program_prefix=$ac_optarg ;;
1186
1187 -program-suffix | --program-suffix | --program-suffi | --program-suff \
1188 | --program-suf | --program-su | --program-s)
1189 ac_prev=program_suffix ;;
1190 -program-suffix=* | --program-suffix=* | --program-suffi=* \
1191 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1192 program_suffix=$ac_optarg ;;
1193
1194 -program-transform-name | --program-transform-name \
1195 | --program-transform-nam | --program-transform-na \
1196 | --program-transform-n | --program-transform- \
1197 | --program-transform | --program-transfor \
1198 | --program-transfo | --program-transf \
1199 | --program-trans | --program-tran \
1200 | --progr-tra | --program-tr | --program-t)
1201 ac_prev=program_transform_name ;;
1202 -program-transform-name=* | --program-transform-name=* \
1203 | --program-transform-nam=* | --program-transform-na=* \
1204 | --program-transform-n=* | --program-transform-=* \
1205 | --program-transform=* | --program-transfor=* \
1206 | --program-transfo=* | --program-transf=* \
1207 | --program-trans=* | --program-tran=* \
1208 | --progr-tra=* | --program-tr=* | --program-t=*)
1209 program_transform_name=$ac_optarg ;;
1210
1211 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1212 ac_prev=pdfdir ;;
1213 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1214 pdfdir=$ac_optarg ;;
1215
1216 -psdir | --psdir | --psdi | --psd | --ps)
1217 ac_prev=psdir ;;
1218 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1219 psdir=$ac_optarg ;;
1220
1221 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1222 | -silent | --silent | --silen | --sile | --sil)
1223 silent=yes ;;
1224
1225 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1226 ac_prev=sbindir ;;
1227 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1228 | --sbi=* | --sb=*)
1229 sbindir=$ac_optarg ;;
1230
1231 -sharedstatedir | --sharedstatedir | --sharedstatedi \
1232 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1233 | --sharedst | --shareds | --shared | --share | --shar \
1234 | --sha | --sh)
1235 ac_prev=sharedstatedir ;;
1236 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1237 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1238 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1239 | --sha=* | --sh=*)
1240 sharedstatedir=$ac_optarg ;;
1241
1242 -site | --site | --sit)
1243 ac_prev=site ;;
1244 -site=* | --site=* | --sit=*)
1245 site=$ac_optarg ;;
1246
1247 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1248 ac_prev=srcdir ;;
1249 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1250 srcdir=$ac_optarg ;;
1251
1252 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1253 | --syscon | --sysco | --sysc | --sys | --sy)
1254 ac_prev=sysconfdir ;;
1255 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1256 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1257 sysconfdir=$ac_optarg ;;
1258
1259 -target | --target | --targe | --targ | --tar | --ta | --t)
1260 ac_prev=target_alias ;;
1261 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1262 target_alias=$ac_optarg ;;
1263
1264 -v | -verbose | --verbose | --verbos | --verbo | --verb)
1265 verbose=yes ;;
1266
1267 -version | --version | --versio | --versi | --vers | -V)
1268 ac_init_version=: ;;
1269
1270 -with-* | --with-*)
1271 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1272 # Reject names that are not valid shell variable names.
1273 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1274 { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
1275 { (exit 1); exit 1; }; }
1276 ac_useropt_orig=$ac_useropt
1277 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1278 case $ac_user_opts in
1279 *"
1280 "with_$ac_useropt"
1281 "*) ;;
1282 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1283 ac_unrecognized_sep=', ';;
1284 esac
1285 eval with_$ac_useropt=\$ac_optarg ;;
1286
1287 -without-* | --without-*)
1288 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1289 # Reject names that are not valid shell variable names.
1290 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1291 { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
1292 { (exit 1); exit 1; }; }
1293 ac_useropt_orig=$ac_useropt
1294 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1295 case $ac_user_opts in
1296 *"
1297 "with_$ac_useropt"
1298 "*) ;;
1299 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1300 ac_unrecognized_sep=', ';;
1301 esac
1302 eval with_$ac_useropt=no ;;
1303
1304 --x)
1305 # Obsolete; use --with-x.
1306 with_x=yes ;;
1307
1308 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1309 | --x-incl | --x-inc | --x-in | --x-i)
1310 ac_prev=x_includes ;;
1311 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1312 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1313 x_includes=$ac_optarg ;;
1314
1315 -x-libraries | --x-libraries | --x-librarie | --x-librari \
1316 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1317 ac_prev=x_libraries ;;
1318 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1319 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1320 x_libraries=$ac_optarg ;;
1321
1322 -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
1323 Try \`$0 --help' for more information." >&2
1324 { (exit 1); exit 1; }; }
1325 ;;
1326
1327 *=*)
1328 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1329 # Reject names that are not valid shell variable names.
1330 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
1331 { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
1332 { (exit 1); exit 1; }; }
1333 eval $ac_envvar=\$ac_optarg
1334 export $ac_envvar ;;
1335
1336 *)
1337 # FIXME: should be removed in autoconf 3.0.
1338 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1339 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1340 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1341 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
1342 ;;
1343
1344 esac
1345 done
1346
1347 if test -n "$ac_prev"; then
1348 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1349 { $as_echo "$as_me: error: missing argument to $ac_option" >&2
1350 { (exit 1); exit 1; }; }
1351 fi
1352
1353 if test -n "$ac_unrecognized_opts"; then
1354 case $enable_option_checking in
1355 no) ;;
1356 fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
1357 { (exit 1); exit 1; }; } ;;
1358 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1359 esac
1360 fi
1361
1362 # Check all directory arguments for consistency.
1363 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1364 datadir sysconfdir sharedstatedir localstatedir includedir \
1365 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1366 libdir localedir mandir
1367 do
1368 eval ac_val=\$$ac_var
1369 # Remove trailing slashes.
1370 case $ac_val in
1371 */ )
1372 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1373 eval $ac_var=\$ac_val;;
1374 esac
1375 # Be sure to have absolute directory names.
1376 case $ac_val in
1377 [\\/$]* | ?:[\\/]* ) continue;;
1378 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1379 esac
1380 { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
1381 { (exit 1); exit 1; }; }
1382 done
1383
1384 # There might be people who depend on the old broken behavior: `$host'
1385 # used to hold the argument of --host etc.
1386 # FIXME: To remove some day.
1387 build=$build_alias
1388 host=$host_alias
1389 target=$target_alias
1390
1391 # FIXME: To remove some day.
1392 if test "x$host_alias" != x; then
1393 if test "x$build_alias" = x; then
1394 cross_compiling=maybe
1395 $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
1396 If a cross compiler is detected then cross compile mode will be used." >&2
1397 elif test "x$build_alias" != "x$host_alias"; then
1398 cross_compiling=yes
1399 fi
1400 fi
1401
1402 ac_tool_prefix=
1403 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1404
1405 test "$silent" = yes && exec 6>/dev/null
1406
1407
1408 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1409 ac_ls_di=`ls -di .` &&
1410 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1411 { $as_echo "$as_me: error: working directory cannot be determined" >&2
1412 { (exit 1); exit 1; }; }
1413 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1414 { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
1415 { (exit 1); exit 1; }; }
1416
1417
1418 # Find the source files, if location was not specified.
1419 if test -z "$srcdir"; then
1420 ac_srcdir_defaulted=yes
1421 # Try the directory containing this script, then the parent directory.
1422 ac_confdir=`$as_dirname -- "$as_myself" ||
1423 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1424 X"$as_myself" : 'X\(//\)[^/]' \| \
1425 X"$as_myself" : 'X\(//\)$' \| \
1426 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1427 $as_echo X"$as_myself" |
1428 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1429 s//\1/
1430 q
1431 }
1432 /^X\(\/\/\)[^/].*/{
1433 s//\1/
1434 q
1435 }
1436 /^X\(\/\/\)$/{
1437 s//\1/
1438 q
1439 }
1440 /^X\(\/\).*/{
1441 s//\1/
1442 q
1443 }
1444 s/.*/./; q'`
1445 srcdir=$ac_confdir
1446 if test ! -r "$srcdir/$ac_unique_file"; then
1447 srcdir=..
1448 fi
1449 else
1450 ac_srcdir_defaulted=no
1451 fi
1452 if test ! -r "$srcdir/$ac_unique_file"; then
1453 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1454 { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
1455 { (exit 1); exit 1; }; }
1456 fi
1457 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1458 ac_abs_confdir=`(
1459 cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
1460 { (exit 1); exit 1; }; }
1461 pwd)`
1462 # When building in place, set srcdir=.
1463 if test "$ac_abs_confdir" = "$ac_pwd"; then
1464 srcdir=.
1465 fi
1466 # Remove unnecessary trailing slashes from srcdir.
1467 # Double slashes in file names in object file debugging info
1468 # mess up M-x gdb in Emacs.
1469 case $srcdir in
1470 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1471 esac
1472 for ac_var in $ac_precious_vars; do
1473 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1474 eval ac_env_${ac_var}_value=\$${ac_var}
1475 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1476 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1477 done
1478
1479 #
1480 # Report the --help message.
1481 #
1482 if test "$ac_init_help" = "long"; then
1483 # Omit some internal or obsolete options to make the list less imposing.
1484 # This message is too long to be a string in the A/UX 3.1 sh.
1485 cat <<_ACEOF
1486 \`configure' configures libatasmart 0.13 to adapt to many kinds of systems.
1487
1488 Usage: $0 [OPTION]... [VAR=VALUE]...
1489
1490 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1491 VAR=VALUE. See below for descriptions of some of the useful variables.
1492
1493 Defaults for the options are specified in brackets.
1494
1495 Configuration:
1496 -h, --help display this help and exit
1497 --help=short display options specific to this package
1498 --help=recursive display the short help of all the included packages
1499 -V, --version display version information and exit
1500 -q, --quiet, --silent do not print \`checking...' messages
1501 --cache-file=FILE cache test results in FILE [disabled]
1502 -C, --config-cache alias for \`--cache-file=config.cache'
1503 -n, --no-create do not create output files
1504 --srcdir=DIR find the sources in DIR [configure dir or \`..']
1505
1506 Installation directories:
1507 --prefix=PREFIX install architecture-independent files in PREFIX
1508 [$ac_default_prefix]
1509 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1510 [PREFIX]
1511
1512 By default, \`make install' will install all the files in
1513 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
1514 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1515 for instance \`--prefix=\$HOME'.
1516
1517 For better control, use the options below.
1518
1519 Fine tuning of the installation directories:
1520 --bindir=DIR user executables [EPREFIX/bin]
1521 --sbindir=DIR system admin executables [EPREFIX/sbin]
1522 --libexecdir=DIR program executables [EPREFIX/libexec]
1523 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1524 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1525 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1526 --libdir=DIR object code libraries [EPREFIX/lib]
1527 --includedir=DIR C header files [PREFIX/include]
1528 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1529 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
1530 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1531 --infodir=DIR info documentation [DATAROOTDIR/info]
1532 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
1533 --mandir=DIR man documentation [DATAROOTDIR/man]
1534 --docdir=DIR documentation root [DATAROOTDIR/doc/libatasmart]
1535 --htmldir=DIR html documentation [DOCDIR]
1536 --dvidir=DIR dvi documentation [DOCDIR]
1537 --pdfdir=DIR pdf documentation [DOCDIR]
1538 --psdir=DIR ps documentation [DOCDIR]
1539 _ACEOF
1540
1541 cat <<\_ACEOF
1542
1543 Program names:
1544 --program-prefix=PREFIX prepend PREFIX to installed program names
1545 --program-suffix=SUFFIX append SUFFIX to installed program names
1546 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1547
1548 System types:
1549 --build=BUILD configure for building on BUILD [guessed]
1550 --host=HOST cross-compile to build programs to run on HOST [BUILD]
1551 _ACEOF
1552 fi
1553
1554 if test -n "$ac_init_help"; then
1555 case $ac_init_help in
1556 short | recursive ) echo "Configuration of libatasmart 0.13:";;
1557 esac
1558 cat <<\_ACEOF
1559
1560 Optional Features:
1561 --disable-option-checking ignore unrecognized --enable/--with options
1562 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1563 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1564 --disable-dependency-tracking speeds up one-time build
1565 --enable-dependency-tracking do not reject slow dependency extractors
1566 --enable-shared[=PKGS] build shared libraries [default=yes]
1567 --enable-static[=PKGS] build static libraries [default=yes]
1568 --enable-fast-install[=PKGS]
1569 optimize for fast installation [default=yes]
1570 --disable-libtool-lock avoid locking (might break parallel builds)
1571 --disable-largefile omit support for large files
1572
1573 Optional Packages:
1574 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1575 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1576 --with-pic try to use only PIC/non-PIC objects [default=use
1577 both]
1578 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1579
1580 Some influential environment variables:
1581 CC C compiler command
1582 CFLAGS C compiler flags
1583 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
1584 nonstandard directory <lib dir>
1585 LIBS libraries to pass to the linker, e.g. -l<library>
1586 CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
1587 you have headers in a nonstandard directory <include dir>
1588 CPP C preprocessor
1589 CXX C++ compiler command
1590 CXXFLAGS C++ compiler flags
1591 CXXCPP C++ preprocessor
1592 PKG_CONFIG path to pkg-config utility
1593 LIBUDEV_CFLAGS
1594 C compiler flags for LIBUDEV, overriding pkg-config
1595 LIBUDEV_LIBS
1596 linker flags for LIBUDEV, overriding pkg-config
1597
1598 Use these variables to override the choices made by `configure' or to help
1599 it to find libraries and programs with nonstandard names/locations.
1600
1601 Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>.
1602 _ACEOF
1603 ac_status=$?
1604 fi
1605
1606 if test "$ac_init_help" = "recursive"; then
1607 # If there are subdirs, report their specific --help.
1608 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1609 test -d "$ac_dir" ||
1610 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1611 continue
1612 ac_builddir=.
1613
1614 case "$ac_dir" in
1615 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1616 *)
1617 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1618 # A ".." for each directory in $ac_dir_suffix.
1619 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1620 case $ac_top_builddir_sub in
1621 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1622 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1623 esac ;;
1624 esac
1625 ac_abs_top_builddir=$ac_pwd
1626 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1627 # for backward compatibility:
1628 ac_top_builddir=$ac_top_build_prefix
1629
1630 case $srcdir in
1631 .) # We are building in place.
1632 ac_srcdir=.
1633 ac_top_srcdir=$ac_top_builddir_sub
1634 ac_abs_top_srcdir=$ac_pwd ;;
1635 [\\/]* | ?:[\\/]* ) # Absolute name.
1636 ac_srcdir=$srcdir$ac_dir_suffix;
1637 ac_top_srcdir=$srcdir
1638 ac_abs_top_srcdir=$srcdir ;;
1639 *) # Relative name.
1640 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1641 ac_top_srcdir=$ac_top_build_prefix$srcdir
1642 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1643 esac
1644 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1645
1646 cd "$ac_dir" || { ac_status=$?; continue; }
1647 # Check for guested configure.
1648 if test -f "$ac_srcdir/configure.gnu"; then
1649 echo &&
1650 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1651 elif test -f "$ac_srcdir/configure"; then
1652 echo &&
1653 $SHELL "$ac_srcdir/configure" --help=recursive
1654 else
1655 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1656 fi || ac_status=$?
1657 cd "$ac_pwd" || { ac_status=$?; break; }
1658 done
1659 fi
1660
1661 test -n "$ac_init_help" && exit $ac_status
1662 if $ac_init_version; then
1663 cat <<\_ACEOF
1664 libatasmart configure 0.13
1665 generated by GNU Autoconf 2.63
1666
1667 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
1668 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1669 This configure script is free software; the Free Software Foundation
1670 gives unlimited permission to copy, distribute and modify it.
1671 _ACEOF
1672 exit
1673 fi
1674 cat >config.log <<_ACEOF
1675 This file contains any messages produced by compilers while
1676 running configure, to aid debugging if configure makes a mistake.
1677
1678 It was created by libatasmart $as_me 0.13, which was
1679 generated by GNU Autoconf 2.63. Invocation command line was
1680
1681 $ $0 $@
1682
1683 _ACEOF
1684 exec 5>>config.log
1685 {
1686 cat <<_ASUNAME
1687 ## --------- ##
1688 ## Platform. ##
1689 ## --------- ##
1690
1691 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1692 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1693 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1694 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1695 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1696
1697 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1698 /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
1699
1700 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
1701 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
1702 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1703 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
1704 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
1705 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1706 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1707
1708 _ASUNAME
1709
1710 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1711 for as_dir in $PATH
1712 do
1713 IFS=$as_save_IFS
1714 test -z "$as_dir" && as_dir=.
1715 $as_echo "PATH: $as_dir"
1716 done
1717 IFS=$as_save_IFS
1718
1719 } >&5
1720
1721 cat >&5 <<_ACEOF
1722
1723
1724 ## ----------- ##
1725 ## Core tests. ##
1726 ## ----------- ##
1727
1728 _ACEOF
1729
1730
1731 # Keep a trace of the command line.
1732 # Strip out --no-create and --no-recursion so they do not pile up.
1733 # Strip out --silent because we don't want to record it for future runs.
1734 # Also quote any args containing shell meta-characters.
1735 # Make two passes to allow for proper duplicate-argument suppression.
1736 ac_configure_args=
1737 ac_configure_args0=
1738 ac_configure_args1=
1739 ac_must_keep_next=false
1740 for ac_pass in 1 2
1741 do
1742 for ac_arg
1743 do
1744 case $ac_arg in
1745 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1746 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1747 | -silent | --silent | --silen | --sile | --sil)
1748 continue ;;
1749 *\'*)
1750 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1751 esac
1752 case $ac_pass in
1753 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
1754 2)
1755 ac_configure_args1="$ac_configure_args1 '$ac_arg'"
1756 if test $ac_must_keep_next = true; then
1757 ac_must_keep_next=false # Got value, back to normal.
1758 else
1759 case $ac_arg in
1760 *=* | --config-cache | -C | -disable-* | --disable-* \
1761 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1762 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1763 | -with-* | --with-* | -without-* | --without-* | --x)
1764 case "$ac_configure_args0 " in
1765 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1766 esac
1767 ;;
1768 -* ) ac_must_keep_next=true ;;
1769 esac
1770 fi
1771 ac_configure_args="$ac_configure_args '$ac_arg'"
1772 ;;
1773 esac
1774 done
1775 done
1776 $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
1777 $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
1778
1779 # When interrupted or exit'd, cleanup temporary files, and complete
1780 # config.log. We remove comments because anyway the quotes in there
1781 # would cause problems or look ugly.
1782 # WARNING: Use '\'' to represent an apostrophe within the trap.
1783 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1784 trap 'exit_status=$?
1785 # Save into config.log some information that might help in debugging.
1786 {
1787 echo
1788
1789 cat <<\_ASBOX
1790 ## ---------------- ##
1791 ## Cache variables. ##
1792 ## ---------------- ##
1793 _ASBOX
1794 echo
1795 # The following way of writing the cache mishandles newlines in values,
1796 (
1797 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
1798 eval ac_val=\$$ac_var
1799 case $ac_val in #(
1800 *${as_nl}*)
1801 case $ac_var in #(
1802 *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
1803 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
1804 esac
1805 case $ac_var in #(
1806 _ | IFS | as_nl) ;; #(
1807 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1808 *) $as_unset $ac_var ;;
1809 esac ;;
1810 esac
1811 done
1812 (set) 2>&1 |
1813 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
1814 *${as_nl}ac_space=\ *)
1815 sed -n \
1816 "s/'\''/'\''\\\\'\'''\''/g;
1817 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
1818 ;; #(
1819 *)
1820 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
1821 ;;
1822 esac |
1823 sort
1824 )
1825 echo
1826
1827 cat <<\_ASBOX
1828 ## ----------------- ##
1829 ## Output variables. ##
1830 ## ----------------- ##
1831 _ASBOX
1832 echo
1833 for ac_var in $ac_subst_vars
1834 do
1835 eval ac_val=\$$ac_var
1836 case $ac_val in
1837 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1838 esac
1839 $as_echo "$ac_var='\''$ac_val'\''"
1840 done | sort
1841 echo
1842
1843 if test -n "$ac_subst_files"; then
1844 cat <<\_ASBOX
1845 ## ------------------- ##
1846 ## File substitutions. ##
1847 ## ------------------- ##
1848 _ASBOX
1849 echo
1850 for ac_var in $ac_subst_files
1851 do
1852 eval ac_val=\$$ac_var
1853 case $ac_val in
1854 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1855 esac
1856 $as_echo "$ac_var='\''$ac_val'\''"
1857 done | sort
1858 echo
1859 fi
1860
1861 if test -s confdefs.h; then
1862 cat <<\_ASBOX
1863 ## ----------- ##
1864 ## confdefs.h. ##
1865 ## ----------- ##
1866 _ASBOX
1867 echo
1868 cat confdefs.h
1869 echo
1870 fi
1871 test "$ac_signal" != 0 &&
1872 $as_echo "$as_me: caught signal $ac_signal"
1873 $as_echo "$as_me: exit $exit_status"
1874 } >&5
1875 rm -f core *.core core.conftest.* &&
1876 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
1877 exit $exit_status
1878 ' 0
1879 for ac_signal in 1 2 13 15; do
1880 trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
1881 done
1882 ac_signal=0
1883
1884 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1885 rm -f -r conftest* confdefs.h
1886
1887 # Predefined preprocessor variables.
1888
1889 cat >>confdefs.h <<_ACEOF
1890 #define PACKAGE_NAME "$PACKAGE_NAME"
1891 _ACEOF
1892
1893
1894 cat >>confdefs.h <<_ACEOF
1895 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
1896 _ACEOF
1897
1898
1899 cat >>confdefs.h <<_ACEOF
1900 #define PACKAGE_VERSION "$PACKAGE_VERSION"
1901 _ACEOF
1902
1903
1904 cat >>confdefs.h <<_ACEOF
1905 #define PACKAGE_STRING "$PACKAGE_STRING"
1906 _ACEOF
1907
1908
1909 cat >>confdefs.h <<_ACEOF
1910 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
1911 _ACEOF
1912
1913
1914 # Let the site file select an alternate cache file if it wants to.
1915 # Prefer an explicitly selected file to automatically selected ones.
1916 ac_site_file1=NONE
1917 ac_site_file2=NONE
1918 if test -n "$CONFIG_SITE"; then
1919 ac_site_file1=$CONFIG_SITE
1920 elif test "x$prefix" != xNONE; then
1921 ac_site_file1=$prefix/share/config.site
1922 ac_site_file2=$prefix/etc/config.site
1923 else
1924 ac_site_file1=$ac_default_prefix/share/config.site
1925 ac_site_file2=$ac_default_prefix/etc/config.site
1926 fi
1927 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
1928 do
1929 test "x$ac_site_file" = xNONE && continue
1930 if test -r "$ac_site_file"; then
1931 { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
1932 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
1933 sed 's/^/| /' "$ac_site_file" >&5
1934 . "$ac_site_file"
1935 fi
1936 done
1937
1938 if test -r "$cache_file"; then
1939 # Some versions of bash will fail to source /dev/null (special
1940 # files actually), so we avoid doing that.
1941 if test -f "$cache_file"; then
1942 { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
1943 $as_echo "$as_me: loading cache $cache_file" >&6;}
1944 case $cache_file in
1945 [\\/]* | ?:[\\/]* ) . "$cache_file";;
1946 *) . "./$cache_file";;
1947 esac
1948 fi
1949 else
1950 { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
1951 $as_echo "$as_me: creating cache $cache_file" >&6;}
1952 >$cache_file
1953 fi
1954
1955 # Check that the precious variables saved in the cache have kept the same
1956 # value.
1957 ac_cache_corrupted=false
1958 for ac_var in $ac_precious_vars; do
1959 eval ac_old_set=\$ac_cv_env_${ac_var}_set
1960 eval ac_new_set=\$ac_env_${ac_var}_set
1961 eval ac_old_val=\$ac_cv_env_${ac_var}_value
1962 eval ac_new_val=\$ac_env_${ac_var}_value
1963 case $ac_old_set,$ac_new_set in
1964 set,)
1965 { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
1966 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
1967 ac_cache_corrupted=: ;;
1968 ,set)
1969 { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
1970 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
1971 ac_cache_corrupted=: ;;
1972 ,);;
1973 *)
1974 if test "x$ac_old_val" != "x$ac_new_val"; then
1975 # differences in whitespace do not lead to failure.
1976 ac_old_val_w=`echo x $ac_old_val`
1977 ac_new_val_w=`echo x $ac_new_val`
1978 if test "$ac_old_val_w" != "$ac_new_val_w"; then
1979 { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
1980 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
1981 ac_cache_corrupted=:
1982 else
1983 { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
1984 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
1985 eval $ac_var=\$ac_old_val
1986 fi
1987 { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
1988 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
1989 { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
1990 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
1991 fi;;
1992 esac
1993 # Pass precious variables to config.status.
1994 if test "$ac_new_set" = set; then
1995 case $ac_new_val in
1996 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
1997 *) ac_arg=$ac_var=$ac_new_val ;;
1998 esac
1999 case " $ac_configure_args " in
2000 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
2001 *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
2002 esac
2003 fi
2004 done
2005 if $ac_cache_corrupted; then
2006 { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
2007 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2008 { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
2009 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2010 { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
2011 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
2012 { (exit 1); exit 1; }; }
2013 fi
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039 ac_ext=c
2040 ac_cpp='$CPP $CPPFLAGS'
2041 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2042 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2043 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2044
2045
2046
2047 ac_config_headers="$ac_config_headers config.h"
2048
2049
2050
2051 am__api_version='1.10'
2052
2053 ac_aux_dir=
2054 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
2055 if test -f "$ac_dir/install-sh"; then
2056 ac_aux_dir=$ac_dir
2057 ac_install_sh="$ac_aux_dir/install-sh -c"
2058 break
2059 elif test -f "$ac_dir/install.sh"; then
2060 ac_aux_dir=$ac_dir
2061 ac_install_sh="$ac_aux_dir/install.sh -c"
2062 break
2063 elif test -f "$ac_dir/shtool"; then
2064 ac_aux_dir=$ac_dir
2065 ac_install_sh="$ac_aux_dir/shtool install -c"
2066 break
2067 fi
2068 done
2069 if test -z "$ac_aux_dir"; then
2070 { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
2071 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
2072 { (exit 1); exit 1; }; }
2073 fi
2074
2075 # These three variables are undocumented and unsupported,
2076 # and are intended to be withdrawn in a future Autoconf release.
2077 # They can cause serious problems if a builder's source tree is in a directory
2078 # whose full name contains unusual characters.
2079 ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
2080 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
2081 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
2082
2083
2084 # Find a good install program. We prefer a C program (faster),
2085 # so one script is as good as another. But avoid the broken or
2086 # incompatible versions:
2087 # SysV /etc/install, /usr/sbin/install
2088 # SunOS /usr/etc/install
2089 # IRIX /sbin/install
2090 # AIX /bin/install
2091 # AmigaOS /C/install, which installs bootblocks on floppy discs
2092 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2093 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2094 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2095 # OS/2's system install, which has a completely different semantic
2096 # ./install, which can be erroneously created by make from ./install.sh.
2097 # Reject install programs that cannot install multiple files.
2098 { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
2099 $as_echo_n "checking for a BSD-compatible install... " >&6; }
2100 if test -z "$INSTALL"; then
2101 if test "${ac_cv_path_install+set}" = set; then
2102 $as_echo_n "(cached) " >&6
2103 else
2104 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2105 for as_dir in $PATH
2106 do
2107 IFS=$as_save_IFS
2108 test -z "$as_dir" && as_dir=.
2109 # Account for people who put trailing slashes in PATH elements.
2110 case $as_dir/ in
2111 ./ | .// | /cC/* | \
2112 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
2113 ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
2114 /usr/ucb/* ) ;;
2115 *)
2116 # OSF1 and SCO ODT 3.0 have their own names for install.
2117 # Don't use installbsd from OSF since it installs stuff as root
2118 # by default.
2119 for ac_prog in ginstall scoinst install; do
2120 for ac_exec_ext in '' $ac_executable_extensions; do
2121 if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
2122 if test $ac_prog = install &&
2123 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2124 # AIX install. It has an incompatible calling convention.
2125 :
2126 elif test $ac_prog = install &&
2127 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2128 # program-specific install script used by HP pwplus--don't use.
2129 :
2130 else
2131 rm -rf conftest.one conftest.two conftest.dir
2132 echo one > conftest.one
2133 echo two > conftest.two
2134 mkdir conftest.dir
2135 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
2136 test -s conftest.one && test -s conftest.two &&
2137 test -s conftest.dir/conftest.one &&
2138 test -s conftest.dir/conftest.two
2139 then
2140 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
2141 break 3
2142 fi
2143 fi
2144 fi
2145 done
2146 done
2147 ;;
2148 esac
2149
2150 done
2151 IFS=$as_save_IFS
2152
2153 rm -rf conftest.one conftest.two conftest.dir
2154
2155 fi
2156 if test "${ac_cv_path_install+set}" = set; then
2157 INSTALL=$ac_cv_path_install
2158 else
2159 # As a last resort, use the slow shell script. Don't cache a
2160 # value for INSTALL within a source directory, because that will
2161 # break other packages using the cache if that directory is
2162 # removed, or if the value is a relative name.
2163 INSTALL=$ac_install_sh
2164 fi
2165 fi
2166 { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
2167 $as_echo "$INSTALL" >&6; }
2168
2169 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2170 # It thinks the first close brace ends the variable substitution.
2171 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2172
2173 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2174
2175 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2176
2177 { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
2178 $as_echo_n "checking whether build environment is sane... " >&6; }
2179 # Just in case
2180 sleep 1
2181 echo timestamp > conftest.file
2182 # Do `set' in a subshell so we don't clobber the current shell's
2183 # arguments. Must try -L first in case configure is actually a
2184 # symlink; some systems play weird games with the mod time of symlinks
2185 # (eg FreeBSD returns the mod time of the symlink's containing
2186 # directory).
2187 if (
2188 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
2189 if test "$*" = "X"; then
2190 # -L didn't work.
2191 set X `ls -t $srcdir/configure conftest.file`
2192 fi
2193 rm -f conftest.file
2194 if test "$*" != "X $srcdir/configure conftest.file" \
2195 && test "$*" != "X conftest.file $srcdir/configure"; then
2196
2197 # If neither matched, then we have a broken ls. This can happen
2198 # if, for instance, CONFIG_SHELL is bash and it inherits a
2199 # broken ls alias from the environment. This has actually
2200 # happened. Such a system could not be considered "sane".
2201 { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
2202 alias in your environment" >&5
2203 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
2204 alias in your environment" >&2;}
2205 { (exit 1); exit 1; }; }
2206 fi
2207
2208 test "$2" = conftest.file
2209 )
2210 then
2211 # Ok.
2212 :
2213 else
2214 { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
2215 Check your system clock" >&5
2216 $as_echo "$as_me: error: newly created file is older than distributed files!
2217 Check your system clock" >&2;}
2218 { (exit 1); exit 1; }; }
2219 fi
2220 { $as_echo "$as_me:$LINENO: result: yes" >&5
2221 $as_echo "yes" >&6; }
2222 test "$program_prefix" != NONE &&
2223 program_transform_name="s&^&$program_prefix&;$program_transform_name"
2224 # Use a double $ so make ignores it.
2225 test "$program_suffix" != NONE &&
2226 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
2227 # Double any \ or $.
2228 # By default was `s,x,x', remove it if useless.
2229 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
2230 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2231
2232 # expand $ac_aux_dir to an absolute path
2233 am_aux_dir=`cd $ac_aux_dir && pwd`
2234
2235 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
2236 # Use eval to expand $SHELL
2237 if eval "$MISSING --run true"; then
2238 am_missing_run="$MISSING --run "
2239 else
2240 am_missing_run=
2241 { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
2242 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
2243 fi
2244
2245 { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
2246 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
2247 if test -z "$MKDIR_P"; then
2248 if test "${ac_cv_path_mkdir+set}" = set; then
2249 $as_echo_n "(cached) " >&6
2250 else
2251 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2252 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
2253 do
2254 IFS=$as_save_IFS
2255 test -z "$as_dir" && as_dir=.
2256 for ac_prog in mkdir gmkdir; do
2257 for ac_exec_ext in '' $ac_executable_extensions; do
2258 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
2259 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
2260 'mkdir (GNU coreutils) '* | \
2261 'mkdir (coreutils) '* | \
2262 'mkdir (fileutils) '4.1*)
2263 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
2264 break 3;;
2265 esac
2266 done
2267 done
2268 done
2269 IFS=$as_save_IFS
2270
2271 fi
2272
2273 if test "${ac_cv_path_mkdir+set}" = set; then
2274 MKDIR_P="$ac_cv_path_mkdir -p"
2275 else
2276 # As a last resort, use the slow shell script. Don't cache a
2277 # value for MKDIR_P within a source directory, because that will
2278 # break other packages using the cache if that directory is
2279 # removed, or if the value is a relative name.
2280 test -d ./--version && rmdir ./--version
2281 MKDIR_P="$ac_install_sh -d"
2282 fi
2283 fi
2284 { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
2285 $as_echo "$MKDIR_P" >&6; }
2286
2287 mkdir_p="$MKDIR_P"
2288 case $mkdir_p in
2289 [\\/$]* | ?:[\\/]*) ;;
2290 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2291 esac
2292
2293 for ac_prog in gawk mawk nawk awk
2294 do
2295 # Extract the first word of "$ac_prog", so it can be a program name with args.
2296 set dummy $ac_prog; ac_word=$2
2297 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2298 $as_echo_n "checking for $ac_word... " >&6; }
2299 if test "${ac_cv_prog_AWK+set}" = set; then
2300 $as_echo_n "(cached) " >&6
2301 else
2302 if test -n "$AWK"; then
2303 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2304 else
2305 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2306 for as_dir in $PATH
2307 do
2308 IFS=$as_save_IFS
2309 test -z "$as_dir" && as_dir=.
2310 for ac_exec_ext in '' $ac_executable_extensions; do
2311 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2312 ac_cv_prog_AWK="$ac_prog"
2313 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2314 break 2
2315 fi
2316 done
2317 done
2318 IFS=$as_save_IFS
2319
2320 fi
2321 fi
2322 AWK=$ac_cv_prog_AWK
2323 if test -n "$AWK"; then
2324 { $as_echo "$as_me:$LINENO: result: $AWK" >&5
2325 $as_echo "$AWK" >&6; }
2326 else
2327 { $as_echo "$as_me:$LINENO: result: no" >&5
2328 $as_echo "no" >&6; }
2329 fi
2330
2331
2332 test -n "$AWK" && break
2333 done
2334
2335 { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
2336 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
2337 set x ${MAKE-make}
2338 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2339 if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
2340 $as_echo_n "(cached) " >&6
2341 else
2342 cat >conftest.make <<\_ACEOF
2343 SHELL = /bin/sh
2344 all:
2345 @echo '@@@%%%=$(MAKE)=@@@%%%'
2346 _ACEOF
2347 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2348 case `${MAKE-make} -f conftest.make 2>/dev/null` in
2349 *@@@%%%=?*=@@@%%%*)
2350 eval ac_cv_prog_make_${ac_make}_set=yes;;
2351 *)
2352 eval ac_cv_prog_make_${ac_make}_set=no;;
2353 esac
2354 rm -f conftest.make
2355 fi
2356 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
2357 { $as_echo "$as_me:$LINENO: result: yes" >&5
2358 $as_echo "yes" >&6; }
2359 SET_MAKE=
2360 else
2361 { $as_echo "$as_me:$LINENO: result: no" >&5
2362 $as_echo "no" >&6; }
2363 SET_MAKE="MAKE=${MAKE-make}"
2364 fi
2365
2366 rm -rf .tst 2>/dev/null
2367 mkdir .tst 2>/dev/null
2368 if test -d .tst; then
2369 am__leading_dot=.
2370 else
2371 am__leading_dot=_
2372 fi
2373 rmdir .tst 2>/dev/null
2374
2375 if test "`cd $srcdir && pwd`" != "`pwd`"; then
2376 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2377 # is not polluted with repeated "-I."
2378 am__isrc=' -I$(srcdir)'
2379 # test to see if srcdir already configured
2380 if test -f $srcdir/config.status; then
2381 { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
2382 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
2383 { (exit 1); exit 1; }; }
2384 fi
2385 fi
2386
2387 # test whether we have cygpath
2388 if test -z "$CYGPATH_W"; then
2389 if (cygpath --version) >/dev/null 2>/dev/null; then
2390 CYGPATH_W='cygpath -w'
2391 else
2392 CYGPATH_W=echo
2393 fi
2394 fi
2395
2396
2397 # Define the identity of the package.
2398 PACKAGE='libatasmart'
2399 VERSION='0.13'
2400
2401
2402 cat >>confdefs.h <<_ACEOF
2403 #define PACKAGE "$PACKAGE"
2404 _ACEOF
2405
2406
2407 cat >>confdefs.h <<_ACEOF
2408 #define VERSION "$VERSION"
2409 _ACEOF
2410
2411 # Some tools Automake needs.
2412
2413 ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
2414
2415
2416 AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
2417
2418
2419 AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
2420
2421
2422 AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
2423
2424
2425 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2426
2427 install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
2428
2429 # Installed binaries are usually stripped using `strip' when the user
2430 # run `make install-strip'. However `strip' might not be the right
2431 # tool to use in cross-compilation environments, therefore Automake
2432 # will honor the `STRIP' environment variable to overrule this program.
2433 if test "$cross_compiling" != no; then
2434 if test -n "$ac_tool_prefix"; then
2435 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
2436 set dummy ${ac_tool_prefix}strip; ac_word=$2
2437 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2438 $as_echo_n "checking for $ac_word... " >&6; }
2439 if test "${ac_cv_prog_STRIP+set}" = set; then
2440 $as_echo_n "(cached) " >&6
2441 else
2442 if test -n "$STRIP"; then
2443 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
2444 else
2445 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2446 for as_dir in $PATH
2447 do
2448 IFS=$as_save_IFS
2449 test -z "$as_dir" && as_dir=.
2450 for ac_exec_ext in '' $ac_executable_extensions; do
2451 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2452 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
2453 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2454 break 2
2455 fi
2456 done
2457 done
2458 IFS=$as_save_IFS
2459
2460 fi
2461 fi
2462 STRIP=$ac_cv_prog_STRIP
2463 if test -n "$STRIP"; then
2464 { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
2465 $as_echo "$STRIP" >&6; }
2466 else
2467 { $as_echo "$as_me:$LINENO: result: no" >&5
2468 $as_echo "no" >&6; }
2469 fi
2470
2471
2472 fi
2473 if test -z "$ac_cv_prog_STRIP"; then
2474 ac_ct_STRIP=$STRIP
2475 # Extract the first word of "strip", so it can be a program name with args.
2476 set dummy strip; ac_word=$2
2477 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2478 $as_echo_n "checking for $ac_word... " >&6; }
2479 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
2480 $as_echo_n "(cached) " >&6
2481 else
2482 if test -n "$ac_ct_STRIP"; then
2483 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
2484 else
2485 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2486 for as_dir in $PATH
2487 do
2488 IFS=$as_save_IFS
2489 test -z "$as_dir" && as_dir=.
2490 for ac_exec_ext in '' $ac_executable_extensions; do
2491 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2492 ac_cv_prog_ac_ct_STRIP="strip"
2493 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2494 break 2
2495 fi
2496 done
2497 done
2498 IFS=$as_save_IFS
2499
2500 fi
2501 fi
2502 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
2503 if test -n "$ac_ct_STRIP"; then
2504 { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
2505 $as_echo "$ac_ct_STRIP" >&6; }
2506 else
2507 { $as_echo "$as_me:$LINENO: result: no" >&5
2508 $as_echo "no" >&6; }
2509 fi
2510
2511 if test "x$ac_ct_STRIP" = x; then
2512 STRIP=":"
2513 else
2514 case $cross_compiling:$ac_tool_warned in
2515 yes:)
2516 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
2517 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2518 ac_tool_warned=yes ;;
2519 esac
2520 STRIP=$ac_ct_STRIP
2521 fi
2522 else
2523 STRIP="$ac_cv_prog_STRIP"
2524 fi
2525
2526 fi
2527 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2528
2529 # We need awk for the "check" target. The system "awk" is bad on
2530 # some platforms.
2531 # Always define AMTAR for backward compatibility.
2532
2533 AMTAR=${AMTAR-"${am_missing_run}tar"}
2534
2535 am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
2536
2537
2538
2539
2540
2541
2542 PACKAGE_URL=https://http://git.0pointer.de/?p=libatasmart.git
2543
2544
2545 LIBATASMART_VERSION_INFO=3:3:3
2546
2547
2548 # Make sure we can run config.sub.
2549 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2550 { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
2551 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
2552 { (exit 1); exit 1; }; }
2553
2554 { $as_echo "$as_me:$LINENO: checking build system type" >&5
2555 $as_echo_n "checking build system type... " >&6; }
2556 if test "${ac_cv_build+set}" = set; then
2557 $as_echo_n "(cached) " >&6
2558 else
2559 ac_build_alias=$build_alias
2560 test "x$ac_build_alias" = x &&
2561 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2562 test "x$ac_build_alias" = x &&
2563 { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
2564 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
2565 { (exit 1); exit 1; }; }
2566 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2567 { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
2568 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
2569 { (exit 1); exit 1; }; }
2570
2571 fi
2572 { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
2573 $as_echo "$ac_cv_build" >&6; }
2574 case $ac_cv_build in
2575 *-*-*) ;;
2576 *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
2577 $as_echo "$as_me: error: invalid value of canonical build" >&2;}
2578 { (exit 1); exit 1; }; };;
2579 esac
2580 build=$ac_cv_build
2581 ac_save_IFS=$IFS; IFS='-'
2582 set x $ac_cv_build
2583 shift
2584 build_cpu=$1
2585 build_vendor=$2
2586 shift; shift
2587 # Remember, the first character of IFS is used to create $*,
2588 # except with old shells:
2589 build_os=$*
2590 IFS=$ac_save_IFS
2591 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2592
2593
2594 { $as_echo "$as_me:$LINENO: checking host system type" >&5
2595 $as_echo_n "checking host system type... " >&6; }
2596 if test "${ac_cv_host+set}" = set; then
2597 $as_echo_n "(cached) " >&6
2598 else
2599 if test "x$host_alias" = x; then
2600 ac_cv_host=$ac_cv_build
2601 else
2602 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2603 { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
2604 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
2605 { (exit 1); exit 1; }; }
2606 fi
2607
2608 fi
2609 { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
2610 $as_echo "$ac_cv_host" >&6; }
2611 case $ac_cv_host in
2612 *-*-*) ;;
2613 *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
2614 $as_echo "$as_me: error: invalid value of canonical host" >&2;}
2615 { (exit 1); exit 1; }; };;
2616 esac
2617 host=$ac_cv_host
2618 ac_save_IFS=$IFS; IFS='-'
2619 set x $ac_cv_host
2620 shift
2621 host_cpu=$1
2622 host_vendor=$2
2623 shift; shift
2624 # Remember, the first character of IFS is used to create $*,
2625 # except with old shells:
2626 host_os=$*
2627 IFS=$ac_save_IFS
2628 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2629
2630
2631
2632 if type -p stow > /dev/null && test -d /usr/local/stow ; then
2633 { $as_echo "$as_me:$LINENO: *** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***" >&5
2634 $as_echo "$as_me: *** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***" >&6;}
2635 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
2636 fi
2637
2638 #### Checks for programs. ####
2639
2640 # CC
2641
2642 ac_ext=c
2643 ac_cpp='$CPP $CPPFLAGS'
2644 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2645 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2646 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2647 if test -n "$ac_tool_prefix"; then
2648 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2649 set dummy ${ac_tool_prefix}gcc; ac_word=$2
2650 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2651 $as_echo_n "checking for $ac_word... " >&6; }
2652 if test "${ac_cv_prog_CC+set}" = set; then
2653 $as_echo_n "(cached) " >&6
2654 else
2655 if test -n "$CC"; then
2656 ac_cv_prog_CC="$CC" # Let the user override the test.
2657 else
2658 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2659 for as_dir in $PATH
2660 do
2661 IFS=$as_save_IFS
2662 test -z "$as_dir" && as_dir=.
2663 for ac_exec_ext in '' $ac_executable_extensions; do
2664 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2665 ac_cv_prog_CC="${ac_tool_prefix}gcc"
2666 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2667 break 2
2668 fi
2669 done
2670 done
2671 IFS=$as_save_IFS
2672
2673 fi
2674 fi
2675 CC=$ac_cv_prog_CC
2676 if test -n "$CC"; then
2677 { $as_echo "$as_me:$LINENO: result: $CC" >&5
2678 $as_echo "$CC" >&6; }
2679 else
2680 { $as_echo "$as_me:$LINENO: result: no" >&5
2681 $as_echo "no" >&6; }
2682 fi
2683
2684
2685 fi
2686 if test -z "$ac_cv_prog_CC"; then
2687 ac_ct_CC=$CC
2688 # Extract the first word of "gcc", so it can be a program name with args.
2689 set dummy gcc; ac_word=$2
2690 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2691 $as_echo_n "checking for $ac_word... " >&6; }
2692 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
2693 $as_echo_n "(cached) " >&6
2694 else
2695 if test -n "$ac_ct_CC"; then
2696 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2697 else
2698 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2699 for as_dir in $PATH
2700 do
2701 IFS=$as_save_IFS
2702 test -z "$as_dir" && as_dir=.
2703 for ac_exec_ext in '' $ac_executable_extensions; do
2704 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2705 ac_cv_prog_ac_ct_CC="gcc"
2706 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2707 break 2
2708 fi
2709 done
2710 done
2711 IFS=$as_save_IFS
2712
2713 fi
2714 fi
2715 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2716 if test -n "$ac_ct_CC"; then
2717 { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2718 $as_echo "$ac_ct_CC" >&6; }
2719 else
2720 { $as_echo "$as_me:$LINENO: result: no" >&5
2721 $as_echo "no" >&6; }
2722 fi
2723
2724 if test "x$ac_ct_CC" = x; then
2725 CC=""
2726 else
2727 case $cross_compiling:$ac_tool_warned in
2728 yes:)
2729 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
2730 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2731 ac_tool_warned=yes ;;
2732 esac
2733 CC=$ac_ct_CC
2734 fi
2735 else
2736 CC="$ac_cv_prog_CC"
2737 fi
2738
2739 if test -z "$CC"; then
2740 if test -n "$ac_tool_prefix"; then
2741 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2742 set dummy ${ac_tool_prefix}cc; ac_word=$2
2743 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2744 $as_echo_n "checking for $ac_word... " >&6; }
2745 if test "${ac_cv_prog_CC+set}" = set; then
2746 $as_echo_n "(cached) " >&6
2747 else
2748 if test -n "$CC"; then
2749 ac_cv_prog_CC="$CC" # Let the user override the test.
2750 else
2751 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2752 for as_dir in $PATH
2753 do
2754 IFS=$as_save_IFS
2755 test -z "$as_dir" && as_dir=.
2756 for ac_exec_ext in '' $ac_executable_extensions; do
2757 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2758 ac_cv_prog_CC="${ac_tool_prefix}cc"
2759 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2760 break 2
2761 fi
2762 done
2763 done
2764 IFS=$as_save_IFS
2765
2766 fi
2767 fi
2768 CC=$ac_cv_prog_CC
2769 if test -n "$CC"; then
2770 { $as_echo "$as_me:$LINENO: result: $CC" >&5
2771 $as_echo "$CC" >&6; }
2772 else
2773 { $as_echo "$as_me:$LINENO: result: no" >&5
2774 $as_echo "no" >&6; }
2775 fi
2776
2777
2778 fi
2779 fi
2780 if test -z "$CC"; then
2781 # Extract the first word of "cc", so it can be a program name with args.
2782 set dummy cc; ac_word=$2
2783 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2784 $as_echo_n "checking for $ac_word... " >&6; }
2785 if test "${ac_cv_prog_CC+set}" = set; then
2786 $as_echo_n "(cached) " >&6
2787 else
2788 if test -n "$CC"; then
2789 ac_cv_prog_CC="$CC" # Let the user override the test.
2790 else
2791 ac_prog_rejected=no
2792 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2793 for as_dir in $PATH
2794 do
2795 IFS=$as_save_IFS
2796 test -z "$as_dir" && as_dir=.
2797 for ac_exec_ext in '' $ac_executable_extensions; do
2798 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2799 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2800 ac_prog_rejected=yes
2801 continue
2802 fi
2803 ac_cv_prog_CC="cc"
2804 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2805 break 2
2806 fi
2807 done
2808 done
2809 IFS=$as_save_IFS
2810
2811 if test $ac_prog_rejected = yes; then
2812 # We found a bogon in the path, so make sure we never use it.
2813 set dummy $ac_cv_prog_CC
2814 shift
2815 if test $# != 0; then
2816 # We chose a different compiler from the bogus one.
2817 # However, it has the same basename, so the bogon will be chosen
2818 # first if we set CC to just the basename; use the full file name.
2819 shift
2820 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
2821 fi
2822 fi
2823 fi
2824 fi
2825 CC=$ac_cv_prog_CC
2826 if test -n "$CC"; then
2827 { $as_echo "$as_me:$LINENO: result: $CC" >&5
2828 $as_echo "$CC" >&6; }
2829 else
2830 { $as_echo "$as_me:$LINENO: result: no" >&5
2831 $as_echo "no" >&6; }
2832 fi
2833
2834
2835 fi
2836 if test -z "$CC"; then
2837 if test -n "$ac_tool_prefix"; then
2838 for ac_prog in cl.exe
2839 do
2840 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
2841 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
2842 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2843 $as_echo_n "checking for $ac_word... " >&6; }
2844 if test "${ac_cv_prog_CC+set}" = set; then
2845 $as_echo_n "(cached) " >&6
2846 else
2847 if test -n "$CC"; then
2848 ac_cv_prog_CC="$CC" # Let the user override the test.
2849 else
2850 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2851 for as_dir in $PATH
2852 do
2853 IFS=$as_save_IFS
2854 test -z "$as_dir" && as_dir=.
2855 for ac_exec_ext in '' $ac_executable_extensions; do
2856 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2857 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
2858 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2859 break 2
2860 fi
2861 done
2862 done
2863 IFS=$as_save_IFS
2864
2865 fi
2866 fi
2867 CC=$ac_cv_prog_CC
2868 if test -n "$CC"; then
2869 { $as_echo "$as_me:$LINENO: result: $CC" >&5
2870 $as_echo "$CC" >&6; }
2871 else
2872 { $as_echo "$as_me:$LINENO: result: no" >&5
2873 $as_echo "no" >&6; }
2874 fi
2875
2876
2877 test -n "$CC" && break
2878 done
2879 fi
2880 if test -z "$CC"; then
2881 ac_ct_CC=$CC
2882 for ac_prog in cl.exe
2883 do
2884 # Extract the first word of "$ac_prog", so it can be a program name with args.
2885 set dummy $ac_prog; ac_word=$2
2886 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
2887 $as_echo_n "checking for $ac_word... " >&6; }
2888 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
2889 $as_echo_n "(cached) " >&6
2890 else
2891 if test -n "$ac_ct_CC"; then
2892 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2893 else
2894 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2895 for as_dir in $PATH
2896 do
2897 IFS=$as_save_IFS
2898 test -z "$as_dir" && as_dir=.
2899 for ac_exec_ext in '' $ac_executable_extensions; do
2900 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2901 ac_cv_prog_ac_ct_CC="$ac_prog"
2902 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2903 break 2
2904 fi
2905 done
2906 done
2907 IFS=$as_save_IFS
2908
2909 fi
2910 fi
2911 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2912 if test -n "$ac_ct_CC"; then
2913 { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
2914 $as_echo "$ac_ct_CC" >&6; }
2915 else
2916 { $as_echo "$as_me:$LINENO: result: no" >&5
2917 $as_echo "no" >&6; }
2918 fi
2919
2920
2921 test -n "$ac_ct_CC" && break
2922 done
2923
2924 if test "x$ac_ct_CC" = x; then
2925 CC=""
2926 else
2927 case $cross_compiling:$ac_tool_warned in
2928 yes:)
2929 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
2930 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2931 ac_tool_warned=yes ;;
2932 esac
2933 CC=$ac_ct_CC
2934 fi
2935 fi
2936
2937 fi
2938
2939
2940 test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
2941 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2942 { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
2943 See \`config.log' for more details." >&5
2944 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH
2945 See \`config.log' for more details." >&2;}
2946 { (exit 1); exit 1; }; }; }
2947
2948 # Provide some information about the compiler.
2949 $as_echo "$as_me:$LINENO: checking for C compiler version" >&5
2950 set X $ac_compile
2951 ac_compiler=$2
2952 { (ac_try="$ac_compiler --version >&5"
2953 case "(($ac_try" in
2954 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2955 *) ac_try_echo=$ac_try;;
2956 esac
2957 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
2958 $as_echo "$ac_try_echo") >&5
2959 (eval "$ac_compiler --version >&5") 2>&5
2960 ac_status=$?
2961 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
2962 (exit $ac_status); }
2963 { (ac_try="$ac_compiler -v >&5"
2964 case "(($ac_try" in
2965 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2966 *) ac_try_echo=$ac_try;;
2967 esac
2968 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
2969 $as_echo "$ac_try_echo") >&5
2970 (eval "$ac_compiler -v >&5") 2>&5
2971 ac_status=$?
2972 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
2973 (exit $ac_status); }
2974 { (ac_try="$ac_compiler -V >&5"
2975 case "(($ac_try" in
2976 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2977 *) ac_try_echo=$ac_try;;
2978 esac
2979 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
2980 $as_echo "$ac_try_echo") >&5
2981 (eval "$ac_compiler -V >&5") 2>&5
2982 ac_status=$?
2983 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
2984 (exit $ac_status); }
2985
2986 cat >conftest.$ac_ext <<_ACEOF
2987 /* confdefs.h. */
2988 _ACEOF
2989 cat confdefs.h >>conftest.$ac_ext
2990 cat >>conftest.$ac_ext <<_ACEOF
2991 /* end confdefs.h. */
2992
2993 int
2994 main ()
2995 {
2996
2997 ;
2998 return 0;
2999 }
3000 _ACEOF
3001 ac_clean_files_save=$ac_clean_files
3002 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3003 # Try to create an executable without -o first, disregard a.out.
3004 # It will help us diagnose broken compilers, and finding out an intuition
3005 # of exeext.
3006 { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
3007 $as_echo_n "checking for C compiler default output file name... " >&6; }
3008 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3009
3010 # The possible output files:
3011 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3012
3013 ac_rmfiles=
3014 for ac_file in $ac_files
3015 do
3016 case $ac_file in
3017 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3018 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3019 esac
3020 done
3021 rm -f $ac_rmfiles
3022
3023 if { (ac_try="$ac_link_default"
3024 case "(($ac_try" in
3025 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3026 *) ac_try_echo=$ac_try;;
3027 esac
3028 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3029 $as_echo "$ac_try_echo") >&5
3030 (eval "$ac_link_default") 2>&5
3031 ac_status=$?
3032 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3033 (exit $ac_status); }; then
3034 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3035 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3036 # in a Makefile. We should not override ac_cv_exeext if it was cached,
3037 # so that the user can short-circuit this test for compilers unknown to
3038 # Autoconf.
3039 for ac_file in $ac_files ''
3040 do
3041 test -f "$ac_file" || continue
3042 case $ac_file in
3043 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3044 ;;
3045 [ab].out )
3046 # We found the default executable, but exeext='' is most
3047 # certainly right.
3048 break;;
3049 *.* )
3050 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3051 then :; else
3052 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3053 fi
3054 # We set ac_cv_exeext here because the later test for it is not
3055 # safe: cross compilers may not add the suffix if given an `-o'
3056 # argument, so we may need to know it at that point already.
3057 # Even if this section looks crufty: it has the advantage of
3058 # actually working.
3059 break;;
3060 * )
3061 break;;
3062 esac
3063 done
3064 test "$ac_cv_exeext" = no && ac_cv_exeext=
3065
3066 else
3067 ac_file=''
3068 fi
3069
3070 { $as_echo "$as_me:$LINENO: result: $ac_file" >&5
3071 $as_echo "$ac_file" >&6; }
3072 if test -z "$ac_file"; then
3073 $as_echo "$as_me: failed program was:" >&5
3074 sed 's/^/| /' conftest.$ac_ext >&5
3075
3076 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3077 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3078 { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
3079 See \`config.log' for more details." >&5
3080 $as_echo "$as_me: error: C compiler cannot create executables
3081 See \`config.log' for more details." >&2;}
3082 { (exit 77); exit 77; }; }; }
3083 fi
3084
3085 ac_exeext=$ac_cv_exeext
3086
3087 # Check that the compiler produces executables we can run. If not, either
3088 # the compiler is broken, or we cross compile.
3089 { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
3090 $as_echo_n "checking whether the C compiler works... " >&6; }
3091 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
3092 # If not cross compiling, check that we can run a simple program.
3093 if test "$cross_compiling" != yes; then
3094 if { ac_try='./$ac_file'
3095 { (case "(($ac_try" in
3096 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3097 *) ac_try_echo=$ac_try;;
3098 esac
3099 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3100 $as_echo "$ac_try_echo") >&5
3101 (eval "$ac_try") 2>&5
3102 ac_status=$?
3103 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3104 (exit $ac_status); }; }; then
3105 cross_compiling=no
3106 else
3107 if test "$cross_compiling" = maybe; then
3108 cross_compiling=yes
3109 else
3110 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3111 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3112 { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
3113 If you meant to cross compile, use \`--host'.
3114 See \`config.log' for more details." >&5
3115 $as_echo "$as_me: error: cannot run C compiled programs.
3116 If you meant to cross compile, use \`--host'.
3117 See \`config.log' for more details." >&2;}
3118 { (exit 1); exit 1; }; }; }
3119 fi
3120 fi
3121 fi
3122 { $as_echo "$as_me:$LINENO: result: yes" >&5
3123 $as_echo "yes" >&6; }
3124
3125 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3126 ac_clean_files=$ac_clean_files_save
3127 # Check that the compiler produces executables we can run. If not, either
3128 # the compiler is broken, or we cross compile.
3129 { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
3130 $as_echo_n "checking whether we are cross compiling... " >&6; }
3131 { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
3132 $as_echo "$cross_compiling" >&6; }
3133
3134 { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
3135 $as_echo_n "checking for suffix of executables... " >&6; }
3136 if { (ac_try="$ac_link"
3137 case "(($ac_try" in
3138 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3139 *) ac_try_echo=$ac_try;;
3140 esac
3141 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3142 $as_echo "$ac_try_echo") >&5
3143 (eval "$ac_link") 2>&5
3144 ac_status=$?
3145 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3146 (exit $ac_status); }; then
3147 # If both `conftest.exe' and `conftest' are `present' (well, observable)
3148 # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
3149 # work properly (i.e., refer to `conftest.exe'), while it won't with
3150 # `rm'.
3151 for ac_file in conftest.exe conftest conftest.*; do
3152 test -f "$ac_file" || continue
3153 case $ac_file in
3154 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3155 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3156 break;;
3157 * ) break;;
3158 esac
3159 done
3160 else
3161 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3162 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3163 { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
3164 See \`config.log' for more details." >&5
3165 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
3166 See \`config.log' for more details." >&2;}
3167 { (exit 1); exit 1; }; }; }
3168 fi
3169
3170 rm -f conftest$ac_cv_exeext
3171 { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
3172 $as_echo "$ac_cv_exeext" >&6; }
3173
3174 rm -f conftest.$ac_ext
3175 EXEEXT=$ac_cv_exeext
3176 ac_exeext=$EXEEXT
3177 { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
3178 $as_echo_n "checking for suffix of object files... " >&6; }
3179 if test "${ac_cv_objext+set}" = set; then
3180 $as_echo_n "(cached) " >&6
3181 else
3182 cat >conftest.$ac_ext <<_ACEOF
3183 /* confdefs.h. */
3184 _ACEOF
3185 cat confdefs.h >>conftest.$ac_ext
3186 cat >>conftest.$ac_ext <<_ACEOF
3187 /* end confdefs.h. */
3188
3189 int
3190 main ()
3191 {
3192
3193 ;
3194 return 0;
3195 }
3196 _ACEOF
3197 rm -f conftest.o conftest.obj
3198 if { (ac_try="$ac_compile"
3199 case "(($ac_try" in
3200 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3201 *) ac_try_echo=$ac_try;;
3202 esac
3203 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3204 $as_echo "$ac_try_echo") >&5
3205 (eval "$ac_compile") 2>&5
3206 ac_status=$?
3207 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3208 (exit $ac_status); }; then
3209 for ac_file in conftest.o conftest.obj conftest.*; do
3210 test -f "$ac_file" || continue;
3211 case $ac_file in
3212 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3213 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3214 break;;
3215 esac
3216 done
3217 else
3218 $as_echo "$as_me: failed program was:" >&5
3219 sed 's/^/| /' conftest.$ac_ext >&5
3220
3221 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
3222 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3223 { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
3224 See \`config.log' for more details." >&5
3225 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
3226 See \`config.log' for more details." >&2;}
3227 { (exit 1); exit 1; }; }; }
3228 fi
3229
3230 rm -f conftest.$ac_cv_objext conftest.$ac_ext
3231 fi
3232 { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
3233 $as_echo "$ac_cv_objext" >&6; }
3234 OBJEXT=$ac_cv_objext
3235 ac_objext=$OBJEXT
3236 { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
3237 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3238 if test "${ac_cv_c_compiler_gnu+set}" = set; then
3239 $as_echo_n "(cached) " >&6
3240 else
3241 cat >conftest.$ac_ext <<_ACEOF
3242 /* confdefs.h. */
3243 _ACEOF
3244 cat confdefs.h >>conftest.$ac_ext
3245 cat >>conftest.$ac_ext <<_ACEOF
3246 /* end confdefs.h. */
3247
3248 int
3249 main ()
3250 {
3251 #ifndef __GNUC__
3252 choke me
3253 #endif
3254
3255 ;
3256 return 0;
3257 }
3258 _ACEOF
3259 rm -f conftest.$ac_objext
3260 if { (ac_try="$ac_compile"
3261 case "(($ac_try" in
3262 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3263 *) ac_try_echo=$ac_try;;
3264 esac
3265 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3266 $as_echo "$ac_try_echo") >&5
3267 (eval "$ac_compile") 2>conftest.er1
3268 ac_status=$?
3269 grep -v '^ *+' conftest.er1 >conftest.err
3270 rm -f conftest.er1
3271 cat conftest.err >&5
3272 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3273 (exit $ac_status); } && {
3274 test -z "$ac_c_werror_flag" ||
3275 test ! -s conftest.err
3276 } && test -s conftest.$ac_objext; then
3277 ac_compiler_gnu=yes
3278 else
3279 $as_echo "$as_me: failed program was:" >&5
3280 sed 's/^/| /' conftest.$ac_ext >&5
3281
3282 ac_compiler_gnu=no
3283 fi
3284
3285 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3286 ac_cv_c_compiler_gnu=$ac_compiler_gnu
3287
3288 fi
3289 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
3290 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
3291 if test $ac_compiler_gnu = yes; then
3292 GCC=yes
3293 else
3294 GCC=
3295 fi
3296 ac_test_CFLAGS=${CFLAGS+set}
3297 ac_save_CFLAGS=$CFLAGS
3298 { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
3299 $as_echo_n "checking whether $CC accepts -g... " >&6; }
3300 if test "${ac_cv_prog_cc_g+set}" = set; then
3301 $as_echo_n "(cached) " >&6
3302 else
3303 ac_save_c_werror_flag=$ac_c_werror_flag
3304 ac_c_werror_flag=yes
3305 ac_cv_prog_cc_g=no
3306 CFLAGS="-g"
3307 cat >conftest.$ac_ext <<_ACEOF
3308 /* confdefs.h. */
3309 _ACEOF
3310 cat confdefs.h >>conftest.$ac_ext
3311 cat >>conftest.$ac_ext <<_ACEOF
3312 /* end confdefs.h. */
3313
3314 int
3315 main ()
3316 {
3317
3318 ;
3319 return 0;
3320 }
3321 _ACEOF
3322 rm -f conftest.$ac_objext
3323 if { (ac_try="$ac_compile"
3324 case "(($ac_try" in
3325 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3326 *) ac_try_echo=$ac_try;;
3327 esac
3328 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3329 $as_echo "$ac_try_echo") >&5
3330 (eval "$ac_compile") 2>conftest.er1
3331 ac_status=$?
3332 grep -v '^ *+' conftest.er1 >conftest.err
3333 rm -f conftest.er1
3334 cat conftest.err >&5
3335 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3336 (exit $ac_status); } && {
3337 test -z "$ac_c_werror_flag" ||
3338 test ! -s conftest.err
3339 } && test -s conftest.$ac_objext; then
3340 ac_cv_prog_cc_g=yes
3341 else
3342 $as_echo "$as_me: failed program was:" >&5
3343 sed 's/^/| /' conftest.$ac_ext >&5
3344
3345 CFLAGS=""
3346 cat >conftest.$ac_ext <<_ACEOF
3347 /* confdefs.h. */
3348 _ACEOF
3349 cat confdefs.h >>conftest.$ac_ext
3350 cat >>conftest.$ac_ext <<_ACEOF
3351 /* end confdefs.h. */
3352
3353 int
3354 main ()
3355 {
3356
3357 ;
3358 return 0;
3359 }
3360 _ACEOF
3361 rm -f conftest.$ac_objext
3362 if { (ac_try="$ac_compile"
3363 case "(($ac_try" in
3364 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3365 *) ac_try_echo=$ac_try;;
3366 esac
3367 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3368 $as_echo "$ac_try_echo") >&5
3369 (eval "$ac_compile") 2>conftest.er1
3370 ac_status=$?
3371 grep -v '^ *+' conftest.er1 >conftest.err
3372 rm -f conftest.er1
3373 cat conftest.err >&5
3374 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3375 (exit $ac_status); } && {
3376 test -z "$ac_c_werror_flag" ||
3377 test ! -s conftest.err
3378 } && test -s conftest.$ac_objext; then
3379 :
3380 else
3381 $as_echo "$as_me: failed program was:" >&5
3382 sed 's/^/| /' conftest.$ac_ext >&5
3383
3384 ac_c_werror_flag=$ac_save_c_werror_flag
3385 CFLAGS="-g"
3386 cat >conftest.$ac_ext <<_ACEOF
3387 /* confdefs.h. */
3388 _ACEOF
3389 cat confdefs.h >>conftest.$ac_ext
3390 cat >>conftest.$ac_ext <<_ACEOF
3391 /* end confdefs.h. */
3392
3393 int
3394 main ()
3395 {
3396
3397 ;
3398 return 0;
3399 }
3400 _ACEOF
3401 rm -f conftest.$ac_objext
3402 if { (ac_try="$ac_compile"
3403 case "(($ac_try" in
3404 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3405 *) ac_try_echo=$ac_try;;
3406 esac
3407 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3408 $as_echo "$ac_try_echo") >&5
3409 (eval "$ac_compile") 2>conftest.er1
3410 ac_status=$?
3411 grep -v '^ *+' conftest.er1 >conftest.err
3412 rm -f conftest.er1
3413 cat conftest.err >&5
3414 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3415 (exit $ac_status); } && {
3416 test -z "$ac_c_werror_flag" ||
3417 test ! -s conftest.err
3418 } && test -s conftest.$ac_objext; then
3419 ac_cv_prog_cc_g=yes
3420 else
3421 $as_echo "$as_me: failed program was:" >&5
3422 sed 's/^/| /' conftest.$ac_ext >&5
3423
3424
3425 fi
3426
3427 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3428 fi
3429
3430 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3431 fi
3432
3433 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3434 ac_c_werror_flag=$ac_save_c_werror_flag
3435 fi
3436 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
3437 $as_echo "$ac_cv_prog_cc_g" >&6; }
3438 if test "$ac_test_CFLAGS" = set; then
3439 CFLAGS=$ac_save_CFLAGS
3440 elif test $ac_cv_prog_cc_g = yes; then
3441 if test "$GCC" = yes; then
3442 CFLAGS="-g -O2"
3443 else
3444 CFLAGS="-g"
3445 fi
3446 else
3447 if test "$GCC" = yes; then
3448 CFLAGS="-O2"
3449 else
3450 CFLAGS=
3451 fi
3452 fi
3453 { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
3454 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3455 if test "${ac_cv_prog_cc_c89+set}" = set; then
3456 $as_echo_n "(cached) " >&6
3457 else
3458 ac_cv_prog_cc_c89=no
3459 ac_save_CC=$CC
3460 cat >conftest.$ac_ext <<_ACEOF
3461 /* confdefs.h. */
3462 _ACEOF
3463 cat confdefs.h >>conftest.$ac_ext
3464 cat >>conftest.$ac_ext <<_ACEOF
3465 /* end confdefs.h. */
3466 #include <stdarg.h>
3467 #include <stdio.h>
3468 #include <sys/types.h>
3469 #include <sys/stat.h>
3470 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3471 struct buf { int x; };
3472 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3473 static char *e (p, i)
3474 char **p;
3475 int i;
3476 {
3477 return p[i];
3478 }
3479 static char *f (char * (*g) (char **, int), char **p, ...)
3480 {
3481 char *s;
3482 va_list v;
3483 va_start (v,p);
3484 s = g (p, va_arg (v,int));
3485 va_end (v);
3486 return s;
3487 }
3488
3489 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
3490 function prototypes and stuff, but not '\xHH' hex character constants.
3491 These don't provoke an error unfortunately, instead are silently treated
3492 as 'x'. The following induces an error, until -std is added to get
3493 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
3494 array size at least. It's necessary to write '\x00'==0 to get something
3495 that's true only with -std. */
3496 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3497
3498 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3499 inside strings and character constants. */
3500 #define FOO(x) 'x'
3501 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
3502
3503 int test (int i, double x);
3504 struct s1 {int (*f) (int a);};
3505 struct s2 {int (*f) (double a);};
3506 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3507 int argc;
3508 char **argv;
3509 int
3510 main ()
3511 {
3512 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
3513 ;
3514 return 0;
3515 }
3516 _ACEOF
3517 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
3518 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3519 do
3520 CC="$ac_save_CC $ac_arg"
3521 rm -f conftest.$ac_objext
3522 if { (ac_try="$ac_compile"
3523 case "(($ac_try" in
3524 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3525 *) ac_try_echo=$ac_try;;
3526 esac
3527 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3528 $as_echo "$ac_try_echo") >&5
3529 (eval "$ac_compile") 2>conftest.er1
3530 ac_status=$?
3531 grep -v '^ *+' conftest.er1 >conftest.err
3532 rm -f conftest.er1
3533 cat conftest.err >&5
3534 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3535 (exit $ac_status); } && {
3536 test -z "$ac_c_werror_flag" ||
3537 test ! -s conftest.err
3538 } && test -s conftest.$ac_objext; then
3539 ac_cv_prog_cc_c89=$ac_arg
3540 else
3541 $as_echo "$as_me: failed program was:" >&5
3542 sed 's/^/| /' conftest.$ac_ext >&5
3543
3544
3545 fi
3546
3547 rm -f core conftest.err conftest.$ac_objext
3548 test "x$ac_cv_prog_cc_c89" != "xno" && break
3549 done
3550 rm -f conftest.$ac_ext
3551 CC=$ac_save_CC
3552
3553 fi
3554 # AC_CACHE_VAL
3555 case "x$ac_cv_prog_cc_c89" in
3556 x)
3557 { $as_echo "$as_me:$LINENO: result: none needed" >&5
3558 $as_echo "none needed" >&6; } ;;
3559 xno)
3560 { $as_echo "$as_me:$LINENO: result: unsupported" >&5
3561 $as_echo "unsupported" >&6; } ;;
3562 *)
3563 CC="$CC $ac_cv_prog_cc_c89"
3564 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
3565 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
3566 esac
3567
3568
3569 ac_ext=c
3570 ac_cpp='$CPP $CPPFLAGS'
3571 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3572 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3573 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3574 DEPDIR="${am__leading_dot}deps"
3575
3576 ac_config_commands="$ac_config_commands depfiles"
3577
3578
3579 am_make=${MAKE-make}
3580 cat > confinc << 'END'
3581 am__doit:
3582 @echo done
3583 .PHONY: am__doit
3584 END
3585 # If we don't find an include directive, just comment out the code.
3586 { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
3587 $as_echo_n "checking for style of include used by $am_make... " >&6; }
3588 am__include="#"
3589 am__quote=
3590 _am_result=none
3591 # First try GNU make style include.
3592 echo "include confinc" > confmf
3593 # We grep out `Entering directory' and `Leaving directory'
3594 # messages which can occur if `w' ends up in MAKEFLAGS.
3595 # In particular we don't look at `^make:' because GNU make might
3596 # be invoked under some other name (usually "gmake"), in which
3597 # case it prints its new name instead of `make'.
3598 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
3599 am__include=include
3600 am__quote=
3601 _am_result=GNU
3602 fi
3603 # Now try BSD make style include.
3604 if test "$am__include" = "#"; then
3605 echo '.include "confinc"' > confmf
3606 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
3607 am__include=.include
3608 am__quote="\""
3609 _am_result=BSD
3610 fi
3611 fi
3612
3613
3614 { $as_echo "$as_me:$LINENO: result: $_am_result" >&5
3615 $as_echo "$_am_result" >&6; }
3616 rm -f confinc confmf
3617
3618 # Check whether --enable-dependency-tracking was given.
3619 if test "${enable_dependency_tracking+set}" = set; then
3620 enableval=$enable_dependency_tracking;
3621 fi
3622
3623 if test "x$enable_dependency_tracking" != xno; then
3624 am_depcomp="$ac_aux_dir/depcomp"
3625 AMDEPBACKSLASH='\'
3626 fi
3627 if test "x$enable_dependency_tracking" != xno; then
3628 AMDEP_TRUE=
3629 AMDEP_FALSE='#'
3630 else
3631 AMDEP_TRUE='#'
3632 AMDEP_FALSE=
3633 fi
3634
3635
3636
3637 depcc="$CC" am_compiler_list=
3638
3639 { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
3640 $as_echo_n "checking dependency style of $depcc... " >&6; }
3641 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
3642 $as_echo_n "(cached) " >&6
3643 else
3644 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3645 # We make a subdir and do the tests there. Otherwise we can end up
3646 # making bogus files that we don't know about and never remove. For
3647 # instance it was reported that on HP-UX the gcc test will end up
3648 # making a dummy file named `D' -- because `-MD' means `put the output
3649 # in D'.
3650 mkdir conftest.dir
3651 # Copy depcomp to subdir because otherwise we won't find it if we're
3652 # using a relative directory.
3653 cp "$am_depcomp" conftest.dir
3654 cd conftest.dir
3655 # We will build objects and dependencies in a subdirectory because
3656 # it helps to detect inapplicable dependency modes. For instance
3657 # both Tru64's cc and ICC support -MD to output dependencies as a
3658 # side effect of compilation, but ICC will put the dependencies in
3659 # the current directory while Tru64 will put them in the object
3660 # directory.
3661 mkdir sub
3662
3663 am_cv_CC_dependencies_compiler_type=none
3664 if test "$am_compiler_list" = ""; then
3665 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
3666 fi
3667 for depmode in $am_compiler_list; do
3668 # Setup a source with many dependencies, because some compilers
3669 # like to wrap large dependency lists on column 80 (with \), and
3670 # we should not choose a depcomp mode which is confused by this.
3671 #
3672 # We need to recreate these files for each test, as the compiler may
3673 # overwrite some of them when testing with obscure command lines.
3674 # This happens at least with the AIX C compiler.
3675 : > sub/conftest.c
3676 for i in 1 2 3 4 5 6; do
3677 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3678 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3679 # Solaris 8's {/usr,}/bin/sh.
3680 touch sub/conftst$i.h
3681 done
3682 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3683
3684 case $depmode in
3685 nosideeffect)
3686 # after this tag, mechanisms are not by side-effect, so they'll
3687 # only be used when explicitly requested
3688 if test "x$enable_dependency_tracking" = xyes; then
3689 continue
3690 else
3691 break
3692 fi
3693 ;;
3694 none) break ;;
3695 esac
3696 # We check with `-c' and `-o' for the sake of the "dashmstdout"
3697 # mode. It turns out that the SunPro C++ compiler does not properly
3698 # handle `-M -o', and we need to detect this.
3699 if depmode=$depmode \
3700 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
3701 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3702 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
3703 >/dev/null 2>conftest.err &&
3704 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3705 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3706 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
3707 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3708 # icc doesn't choke on unknown options, it will just issue warnings
3709 # or remarks (even with -Werror). So we grep stderr for any message
3710 # that says an option was ignored or not supported.
3711 # When given -MP, icc 7.0 and 7.1 complain thusly:
3712 # icc: Command line warning: ignoring option '-M'; no argument required
3713 # The diagnosis changed in icc 8.0:
3714 # icc: Command line remark: option '-MP' not supported
3715 if (grep 'ignoring option' conftest.err ||
3716 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3717 am_cv_CC_dependencies_compiler_type=$depmode
3718 break
3719 fi
3720 fi
3721 done
3722
3723 cd ..
3724 rm -rf conftest.dir
3725 else
3726 am_cv_CC_dependencies_compiler_type=none
3727 fi
3728
3729 fi
3730 { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
3731 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
3732 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
3733
3734 if
3735 test "x$enable_dependency_tracking" != xno \
3736 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
3737 am__fastdepCC_TRUE=
3738 am__fastdepCC_FALSE='#'
3739 else
3740 am__fastdepCC_TRUE='#'
3741 am__fastdepCC_FALSE=
3742 fi
3743
3744
3745 if test "x$CC" != xcc; then
3746 { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
3747 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
3748 else
3749 { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
3750 $as_echo_n "checking whether cc understands -c and -o together... " >&6; }
3751 fi
3752 set dummy $CC; ac_cc=`$as_echo "$2" |
3753 sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
3754 if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
3755 $as_echo_n "(cached) " >&6
3756 else
3757 cat >conftest.$ac_ext <<_ACEOF
3758 /* confdefs.h. */
3759 _ACEOF
3760 cat confdefs.h >>conftest.$ac_ext
3761 cat >>conftest.$ac_ext <<_ACEOF
3762 /* end confdefs.h. */
3763
3764 int
3765 main ()
3766 {
3767
3768 ;
3769 return 0;
3770 }
3771 _ACEOF
3772 # Make sure it works both with $CC and with simple cc.
3773 # We do the test twice because some compilers refuse to overwrite an
3774 # existing .o file with -o, though they will create one.
3775 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3776 rm -f conftest2.*
3777 if { (case "(($ac_try" in
3778 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3779 *) ac_try_echo=$ac_try;;
3780 esac
3781 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3782 $as_echo "$ac_try_echo") >&5
3783 (eval "$ac_try") 2>&5
3784 ac_status=$?
3785 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3786 (exit $ac_status); } &&
3787 test -f conftest2.$ac_objext && { (case "(($ac_try" in
3788 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3789 *) ac_try_echo=$ac_try;;
3790 esac
3791 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3792 $as_echo "$ac_try_echo") >&5
3793 (eval "$ac_try") 2>&5
3794 ac_status=$?
3795 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3796 (exit $ac_status); };
3797 then
3798 eval ac_cv_prog_cc_${ac_cc}_c_o=yes
3799 if test "x$CC" != xcc; then
3800 # Test first that cc exists at all.
3801 if { ac_try='cc -c conftest.$ac_ext >&5'
3802 { (case "(($ac_try" in
3803 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3804 *) ac_try_echo=$ac_try;;
3805 esac
3806 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3807 $as_echo "$ac_try_echo") >&5
3808 (eval "$ac_try") 2>&5
3809 ac_status=$?
3810 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3811 (exit $ac_status); }; }; then
3812 ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3813 rm -f conftest2.*
3814 if { (case "(($ac_try" in
3815 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3816 *) ac_try_echo=$ac_try;;
3817 esac
3818 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3819 $as_echo "$ac_try_echo") >&5
3820 (eval "$ac_try") 2>&5
3821 ac_status=$?
3822 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3823 (exit $ac_status); } &&
3824 test -f conftest2.$ac_objext && { (case "(($ac_try" in
3825 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3826 *) ac_try_echo=$ac_try;;
3827 esac
3828 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3829 $as_echo "$ac_try_echo") >&5
3830 (eval "$ac_try") 2>&5
3831 ac_status=$?
3832 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3833 (exit $ac_status); };
3834 then
3835 # cc works too.
3836 :
3837 else
3838 # cc exists but doesn't like -o.
3839 eval ac_cv_prog_cc_${ac_cc}_c_o=no
3840 fi
3841 fi
3842 fi
3843 else
3844 eval ac_cv_prog_cc_${ac_cc}_c_o=no
3845 fi
3846 rm -f core conftest*
3847
3848 fi
3849 if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
3850 { $as_echo "$as_me:$LINENO: result: yes" >&5
3851 $as_echo "yes" >&6; }
3852 else
3853 { $as_echo "$as_me:$LINENO: result: no" >&5
3854 $as_echo "no" >&6; }
3855
3856 cat >>confdefs.h <<\_ACEOF
3857 #define NO_MINUS_C_MINUS_O 1
3858 _ACEOF
3859
3860 fi
3861
3862 # FIXME: we rely on the cache variable name because
3863 # there is no other way.
3864 set dummy $CC
3865 am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
3866 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
3867 if test "$am_t" != yes; then
3868 # Losing compiler, so override with the script.
3869 # FIXME: It is wrong to rewrite CC.
3870 # But if we don't then we get into trouble of one sort or another.
3871 # A longer-term fix would be to have automake use am__CC in this case,
3872 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3873 CC="$am_aux_dir/compile $CC"
3874 fi
3875
3876
3877
3878 ac_ext=c
3879 ac_cpp='$CPP $CPPFLAGS'
3880 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3881 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3882 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3883 { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
3884 $as_echo_n "checking how to run the C preprocessor... " >&6; }
3885 # On Suns, sometimes $CPP names a directory.
3886 if test -n "$CPP" && test -d "$CPP"; then
3887 CPP=
3888 fi
3889 if test -z "$CPP"; then
3890 if test "${ac_cv_prog_CPP+set}" = set; then
3891 $as_echo_n "(cached) " >&6
3892 else
3893 # Double quotes because CPP needs to be expanded
3894 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3895 do
3896 ac_preproc_ok=false
3897 for ac_c_preproc_warn_flag in '' yes
3898 do
3899 # Use a header file that comes with gcc, so configuring glibc
3900 # with a fresh cross-compiler works.
3901 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3902 # <limits.h> exists even on freestanding compilers.
3903 # On the NeXT, cc -E runs the code through the compiler's parser,
3904 # not just through cpp. "Syntax error" is here to catch this case.
3905 cat >conftest.$ac_ext <<_ACEOF
3906 /* confdefs.h. */
3907 _ACEOF
3908 cat confdefs.h >>conftest.$ac_ext
3909 cat >>conftest.$ac_ext <<_ACEOF
3910 /* end confdefs.h. */
3911 #ifdef __STDC__
3912 # include <limits.h>
3913 #else
3914 # include <assert.h>
3915 #endif
3916 Syntax error
3917 _ACEOF
3918 if { (ac_try="$ac_cpp conftest.$ac_ext"
3919 case "(($ac_try" in
3920 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3921 *) ac_try_echo=$ac_try;;
3922 esac
3923 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3924 $as_echo "$ac_try_echo") >&5
3925 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
3926 ac_status=$?
3927 grep -v '^ *+' conftest.er1 >conftest.err
3928 rm -f conftest.er1
3929 cat conftest.err >&5
3930 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3931 (exit $ac_status); } >/dev/null && {
3932 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
3933 test ! -s conftest.err
3934 }; then
3935 :
3936 else
3937 $as_echo "$as_me: failed program was:" >&5
3938 sed 's/^/| /' conftest.$ac_ext >&5
3939
3940 # Broken: fails on valid input.
3941 continue
3942 fi
3943
3944 rm -f conftest.err conftest.$ac_ext
3945
3946 # OK, works on sane cases. Now check whether nonexistent headers
3947 # can be detected and how.
3948 cat >conftest.$ac_ext <<_ACEOF
3949 /* confdefs.h. */
3950 _ACEOF
3951 cat confdefs.h >>conftest.$ac_ext
3952 cat >>conftest.$ac_ext <<_ACEOF
3953 /* end confdefs.h. */
3954 #include <ac_nonexistent.h>
3955 _ACEOF
3956 if { (ac_try="$ac_cpp conftest.$ac_ext"
3957 case "(($ac_try" in
3958 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3959 *) ac_try_echo=$ac_try;;
3960 esac
3961 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
3962 $as_echo "$ac_try_echo") >&5
3963 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
3964 ac_status=$?
3965 grep -v '^ *+' conftest.er1 >conftest.err
3966 rm -f conftest.er1
3967 cat conftest.err >&5
3968 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
3969 (exit $ac_status); } >/dev/null && {
3970 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
3971 test ! -s conftest.err
3972 }; then
3973 # Broken: success on invalid input.
3974 continue
3975 else
3976 $as_echo "$as_me: failed program was:" >&5
3977 sed 's/^/| /' conftest.$ac_ext >&5
3978
3979 # Passes both tests.
3980 ac_preproc_ok=:
3981 break
3982 fi
3983
3984 rm -f conftest.err conftest.$ac_ext
3985
3986 done
3987 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3988 rm -f conftest.err conftest.$ac_ext
3989 if $ac_preproc_ok; then
3990 break
3991 fi
3992
3993 done
3994 ac_cv_prog_CPP=$CPP
3995
3996 fi
3997 CPP=$ac_cv_prog_CPP
3998 else
3999 ac_cv_prog_CPP=$CPP
4000 fi
4001 { $as_echo "$as_me:$LINENO: result: $CPP" >&5
4002 $as_echo "$CPP" >&6; }
4003 ac_preproc_ok=false
4004 for ac_c_preproc_warn_flag in '' yes
4005 do
4006 # Use a header file that comes with gcc, so configuring glibc
4007 # with a fresh cross-compiler works.
4008 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4009 # <limits.h> exists even on freestanding compilers.
4010 # On the NeXT, cc -E runs the code through the compiler's parser,
4011 # not just through cpp. "Syntax error" is here to catch this case.
4012 cat >conftest.$ac_ext <<_ACEOF
4013 /* confdefs.h. */
4014 _ACEOF
4015 cat confdefs.h >>conftest.$ac_ext
4016 cat >>conftest.$ac_ext <<_ACEOF
4017 /* end confdefs.h. */
4018 #ifdef __STDC__
4019 # include <limits.h>
4020 #else
4021 # include <assert.h>
4022 #endif
4023 Syntax error
4024 _ACEOF
4025 if { (ac_try="$ac_cpp conftest.$ac_ext"
4026 case "(($ac_try" in
4027 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4028 *) ac_try_echo=$ac_try;;
4029 esac
4030 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4031 $as_echo "$ac_try_echo") >&5
4032 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
4033 ac_status=$?
4034 grep -v '^ *+' conftest.er1 >conftest.err
4035 rm -f conftest.er1
4036 cat conftest.err >&5
4037 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4038 (exit $ac_status); } >/dev/null && {
4039 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
4040 test ! -s conftest.err
4041 }; then
4042 :
4043 else
4044 $as_echo "$as_me: failed program was:" >&5
4045 sed 's/^/| /' conftest.$ac_ext >&5
4046
4047 # Broken: fails on valid input.
4048 continue
4049 fi
4050
4051 rm -f conftest.err conftest.$ac_ext
4052
4053 # OK, works on sane cases. Now check whether nonexistent headers
4054 # can be detected and how.
4055 cat >conftest.$ac_ext <<_ACEOF
4056 /* confdefs.h. */
4057 _ACEOF
4058 cat confdefs.h >>conftest.$ac_ext
4059 cat >>conftest.$ac_ext <<_ACEOF
4060 /* end confdefs.h. */
4061 #include <ac_nonexistent.h>
4062 _ACEOF
4063 if { (ac_try="$ac_cpp conftest.$ac_ext"
4064 case "(($ac_try" in
4065 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4066 *) ac_try_echo=$ac_try;;
4067 esac
4068 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4069 $as_echo "$ac_try_echo") >&5
4070 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
4071 ac_status=$?
4072 grep -v '^ *+' conftest.er1 >conftest.err
4073 rm -f conftest.er1
4074 cat conftest.err >&5
4075 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4076 (exit $ac_status); } >/dev/null && {
4077 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
4078 test ! -s conftest.err
4079 }; then
4080 # Broken: success on invalid input.
4081 continue
4082 else
4083 $as_echo "$as_me: failed program was:" >&5
4084 sed 's/^/| /' conftest.$ac_ext >&5
4085
4086 # Passes both tests.
4087 ac_preproc_ok=:
4088 break
4089 fi
4090
4091 rm -f conftest.err conftest.$ac_ext
4092
4093 done
4094 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4095 rm -f conftest.err conftest.$ac_ext
4096 if $ac_preproc_ok; then
4097 :
4098 else
4099 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
4100 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4101 { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
4102 See \`config.log' for more details." >&5
4103 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
4104 See \`config.log' for more details." >&2;}
4105 { (exit 1); exit 1; }; }; }
4106 fi
4107
4108 ac_ext=c
4109 ac_cpp='$CPP $CPPFLAGS'
4110 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4111 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4112 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4113
4114
4115 { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
4116 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4117 if test "${ac_cv_path_GREP+set}" = set; then
4118 $as_echo_n "(cached) " >&6
4119 else
4120 if test -z "$GREP"; then
4121 ac_path_GREP_found=false
4122 # Loop through the user's path and test for each of PROGNAME-LIST
4123 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4124 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4125 do
4126 IFS=$as_save_IFS
4127 test -z "$as_dir" && as_dir=.
4128 for ac_prog in grep ggrep; do
4129 for ac_exec_ext in '' $ac_executable_extensions; do
4130 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4131 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
4132 # Check for GNU ac_path_GREP and select it if it is found.
4133 # Check for GNU $ac_path_GREP
4134 case `"$ac_path_GREP" --version 2>&1` in
4135 *GNU*)
4136 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4137 *)
4138 ac_count=0
4139 $as_echo_n 0123456789 >"conftest.in"
4140 while :
4141 do
4142 cat "conftest.in" "conftest.in" >"conftest.tmp"
4143 mv "conftest.tmp" "conftest.in"
4144 cp "conftest.in" "conftest.nl"
4145 $as_echo 'GREP' >> "conftest.nl"
4146 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4147 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4148 ac_count=`expr $ac_count + 1`
4149 if test $ac_count -gt ${ac_path_GREP_max-0}; then
4150 # Best one so far, save it but keep looking for a better one
4151 ac_cv_path_GREP="$ac_path_GREP"
4152 ac_path_GREP_max=$ac_count
4153 fi
4154 # 10*(2^10) chars as input seems more than enough
4155 test $ac_count -gt 10 && break
4156 done
4157 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4158 esac
4159
4160 $ac_path_GREP_found && break 3
4161 done
4162 done
4163 done
4164 IFS=$as_save_IFS
4165 if test -z "$ac_cv_path_GREP"; then
4166 { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
4167 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
4168 { (exit 1); exit 1; }; }
4169 fi
4170 else
4171 ac_cv_path_GREP=$GREP
4172 fi
4173
4174 fi
4175 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
4176 $as_echo "$ac_cv_path_GREP" >&6; }
4177 GREP="$ac_cv_path_GREP"
4178
4179
4180 { $as_echo "$as_me:$LINENO: checking for egrep" >&5
4181 $as_echo_n "checking for egrep... " >&6; }
4182 if test "${ac_cv_path_EGREP+set}" = set; then
4183 $as_echo_n "(cached) " >&6
4184 else
4185 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4186 then ac_cv_path_EGREP="$GREP -E"
4187 else
4188 if test -z "$EGREP"; then
4189 ac_path_EGREP_found=false
4190 # Loop through the user's path and test for each of PROGNAME-LIST
4191 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4192 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4193 do
4194 IFS=$as_save_IFS
4195 test -z "$as_dir" && as_dir=.
4196 for ac_prog in egrep; do
4197 for ac_exec_ext in '' $ac_executable_extensions; do
4198 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4199 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4200 # Check for GNU ac_path_EGREP and select it if it is found.
4201 # Check for GNU $ac_path_EGREP
4202 case `"$ac_path_EGREP" --version 2>&1` in
4203 *GNU*)
4204 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4205 *)
4206 ac_count=0
4207 $as_echo_n 0123456789 >"conftest.in"
4208 while :
4209 do
4210 cat "conftest.in" "conftest.in" >"conftest.tmp"
4211 mv "conftest.tmp" "conftest.in"
4212 cp "conftest.in" "conftest.nl"
4213 $as_echo 'EGREP' >> "conftest.nl"
4214 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4215 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4216 ac_count=`expr $ac_count + 1`
4217 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4218 # Best one so far, save it but keep looking for a better one
4219 ac_cv_path_EGREP="$ac_path_EGREP"
4220 ac_path_EGREP_max=$ac_count
4221 fi
4222 # 10*(2^10) chars as input seems more than enough
4223 test $ac_count -gt 10 && break
4224 done
4225 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4226 esac
4227
4228 $ac_path_EGREP_found && break 3
4229 done
4230 done
4231 done
4232 IFS=$as_save_IFS
4233 if test -z "$ac_cv_path_EGREP"; then
4234 { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
4235 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
4236 { (exit 1); exit 1; }; }
4237 fi
4238 else
4239 ac_cv_path_EGREP=$EGREP
4240 fi
4241
4242 fi
4243 fi
4244 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
4245 $as_echo "$ac_cv_path_EGREP" >&6; }
4246 EGREP="$ac_cv_path_EGREP"
4247
4248
4249 if test $ac_cv_c_compiler_gnu = yes; then
4250 { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
4251 $as_echo_n "checking whether $CC needs -traditional... " >&6; }
4252 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
4253 $as_echo_n "(cached) " >&6
4254 else
4255 ac_pattern="Autoconf.*'x'"
4256 cat >conftest.$ac_ext <<_ACEOF
4257 /* confdefs.h. */
4258 _ACEOF
4259 cat confdefs.h >>conftest.$ac_ext
4260 cat >>conftest.$ac_ext <<_ACEOF
4261 /* end confdefs.h. */
4262 #include <sgtty.h>
4263 Autoconf TIOCGETP
4264 _ACEOF
4265 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4266 $EGREP "$ac_pattern" >/dev/null 2>&1; then
4267 ac_cv_prog_gcc_traditional=yes
4268 else
4269 ac_cv_prog_gcc_traditional=no
4270 fi
4271 rm -f conftest*
4272
4273
4274 if test $ac_cv_prog_gcc_traditional = no; then
4275 cat >conftest.$ac_ext <<_ACEOF
4276 /* confdefs.h. */
4277 _ACEOF
4278 cat confdefs.h >>conftest.$ac_ext
4279 cat >>conftest.$ac_ext <<_ACEOF
4280 /* end confdefs.h. */
4281 #include <termio.h>
4282 Autoconf TCGETA
4283 _ACEOF
4284 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4285 $EGREP "$ac_pattern" >/dev/null 2>&1; then
4286 ac_cv_prog_gcc_traditional=yes
4287 fi
4288 rm -f conftest*
4289
4290 fi
4291 fi
4292 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
4293 $as_echo "$ac_cv_prog_gcc_traditional" >&6; }
4294 if test $ac_cv_prog_gcc_traditional = yes; then
4295 CC="$CC -traditional"
4296 fi
4297 fi
4298
4299 { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
4300 $as_echo_n "checking for ANSI C header files... " >&6; }
4301 if test "${ac_cv_header_stdc+set}" = set; then
4302 $as_echo_n "(cached) " >&6
4303 else
4304 cat >conftest.$ac_ext <<_ACEOF
4305 /* confdefs.h. */
4306 _ACEOF
4307 cat confdefs.h >>conftest.$ac_ext
4308 cat >>conftest.$ac_ext <<_ACEOF
4309 /* end confdefs.h. */
4310 #include <stdlib.h>
4311 #include <stdarg.h>
4312 #include <string.h>
4313 #include <float.h>
4314
4315 int
4316 main ()
4317 {
4318
4319 ;
4320 return 0;
4321 }
4322 _ACEOF
4323 rm -f conftest.$ac_objext
4324 if { (ac_try="$ac_compile"
4325 case "(($ac_try" in
4326 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4327 *) ac_try_echo=$ac_try;;
4328 esac
4329 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4330 $as_echo "$ac_try_echo") >&5
4331 (eval "$ac_compile") 2>conftest.er1
4332 ac_status=$?
4333 grep -v '^ *+' conftest.er1 >conftest.err
4334 rm -f conftest.er1
4335 cat conftest.err >&5
4336 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4337 (exit $ac_status); } && {
4338 test -z "$ac_c_werror_flag" ||
4339 test ! -s conftest.err
4340 } && test -s conftest.$ac_objext; then
4341 ac_cv_header_stdc=yes
4342 else
4343 $as_echo "$as_me: failed program was:" >&5
4344 sed 's/^/| /' conftest.$ac_ext >&5
4345
4346 ac_cv_header_stdc=no
4347 fi
4348
4349 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4350
4351 if test $ac_cv_header_stdc = yes; then
4352 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4353 cat >conftest.$ac_ext <<_ACEOF
4354 /* confdefs.h. */
4355 _ACEOF
4356 cat confdefs.h >>conftest.$ac_ext
4357 cat >>conftest.$ac_ext <<_ACEOF
4358 /* end confdefs.h. */
4359 #include <string.h>
4360
4361 _ACEOF
4362 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4363 $EGREP "memchr" >/dev/null 2>&1; then
4364 :
4365 else
4366 ac_cv_header_stdc=no
4367 fi
4368 rm -f conftest*
4369
4370 fi
4371
4372 if test $ac_cv_header_stdc = yes; then
4373 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4374 cat >conftest.$ac_ext <<_ACEOF
4375 /* confdefs.h. */
4376 _ACEOF
4377 cat confdefs.h >>conftest.$ac_ext
4378 cat >>conftest.$ac_ext <<_ACEOF
4379 /* end confdefs.h. */
4380 #include <stdlib.h>
4381
4382 _ACEOF
4383 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4384 $EGREP "free" >/dev/null 2>&1; then
4385 :
4386 else
4387 ac_cv_header_stdc=no
4388 fi
4389 rm -f conftest*
4390
4391 fi
4392
4393 if test $ac_cv_header_stdc = yes; then
4394 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4395 if test "$cross_compiling" = yes; then
4396 :
4397 else
4398 cat >conftest.$ac_ext <<_ACEOF
4399 /* confdefs.h. */
4400 _ACEOF
4401 cat confdefs.h >>conftest.$ac_ext
4402 cat >>conftest.$ac_ext <<_ACEOF
4403 /* end confdefs.h. */
4404 #include <ctype.h>
4405 #include <stdlib.h>
4406 #if ((' ' & 0x0FF) == 0x020)
4407 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4408 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4409 #else
4410 # define ISLOWER(c) \
4411 (('a' <= (c) && (c) <= 'i') \
4412 || ('j' <= (c) && (c) <= 'r') \
4413 || ('s' <= (c) && (c) <= 'z'))
4414 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
4415 #endif
4416
4417 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4418 int
4419 main ()
4420 {
4421 int i;
4422 for (i = 0; i < 256; i++)
4423 if (XOR (islower (i), ISLOWER (i))
4424 || toupper (i) != TOUPPER (i))
4425 return 2;
4426 return 0;
4427 }
4428 _ACEOF
4429 rm -f conftest$ac_exeext
4430 if { (ac_try="$ac_link"
4431 case "(($ac_try" in
4432 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4433 *) ac_try_echo=$ac_try;;
4434 esac
4435 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4436 $as_echo "$ac_try_echo") >&5
4437 (eval "$ac_link") 2>&5
4438 ac_status=$?
4439 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4440 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4441 { (case "(($ac_try" in
4442 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4443 *) ac_try_echo=$ac_try;;
4444 esac
4445 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4446 $as_echo "$ac_try_echo") >&5
4447 (eval "$ac_try") 2>&5
4448 ac_status=$?
4449 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4450 (exit $ac_status); }; }; then
4451 :
4452 else
4453 $as_echo "$as_me: program exited with status $ac_status" >&5
4454 $as_echo "$as_me: failed program was:" >&5
4455 sed 's/^/| /' conftest.$ac_ext >&5
4456
4457 ( exit $ac_status )
4458 ac_cv_header_stdc=no
4459 fi
4460 rm -rf conftest.dSYM
4461 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4462 fi
4463
4464
4465 fi
4466 fi
4467 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
4468 $as_echo "$ac_cv_header_stdc" >&6; }
4469 if test $ac_cv_header_stdc = yes; then
4470
4471 cat >>confdefs.h <<\_ACEOF
4472 #define STDC_HEADERS 1
4473 _ACEOF
4474
4475 fi
4476
4477 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
4488 inttypes.h stdint.h unistd.h
4489 do
4490 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
4491 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
4492 $as_echo_n "checking for $ac_header... " >&6; }
4493 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
4494 $as_echo_n "(cached) " >&6
4495 else
4496 cat >conftest.$ac_ext <<_ACEOF
4497 /* confdefs.h. */
4498 _ACEOF
4499 cat confdefs.h >>conftest.$ac_ext
4500 cat >>conftest.$ac_ext <<_ACEOF
4501 /* end confdefs.h. */
4502 $ac_includes_default
4503
4504 #include <$ac_header>
4505 _ACEOF
4506 rm -f conftest.$ac_objext
4507 if { (ac_try="$ac_compile"
4508 case "(($ac_try" in
4509 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4510 *) ac_try_echo=$ac_try;;
4511 esac
4512 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4513 $as_echo "$ac_try_echo") >&5
4514 (eval "$ac_compile") 2>conftest.er1
4515 ac_status=$?
4516 grep -v '^ *+' conftest.er1 >conftest.err
4517 rm -f conftest.er1
4518 cat conftest.err >&5
4519 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4520 (exit $ac_status); } && {
4521 test -z "$ac_c_werror_flag" ||
4522 test ! -s conftest.err
4523 } && test -s conftest.$ac_objext; then
4524 eval "$as_ac_Header=yes"
4525 else
4526 $as_echo "$as_me: failed program was:" >&5
4527 sed 's/^/| /' conftest.$ac_ext >&5
4528
4529 eval "$as_ac_Header=no"
4530 fi
4531
4532 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4533 fi
4534 ac_res=`eval 'as_val=${'$as_ac_Header'}
4535 $as_echo "$as_val"'`
4536 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
4537 $as_echo "$ac_res" >&6; }
4538 as_val=`eval 'as_val=${'$as_ac_Header'}
4539 $as_echo "$as_val"'`
4540 if test "x$as_val" = x""yes; then
4541 cat >>confdefs.h <<_ACEOF
4542 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
4543 _ACEOF
4544
4545 fi
4546
4547 done
4548
4549
4550
4551 if test "${ac_cv_header_minix_config_h+set}" = set; then
4552 { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
4553 $as_echo_n "checking for minix/config.h... " >&6; }
4554 if test "${ac_cv_header_minix_config_h+set}" = set; then
4555 $as_echo_n "(cached) " >&6
4556 fi
4557 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
4558 $as_echo "$ac_cv_header_minix_config_h" >&6; }
4559 else
4560 # Is the header compilable?
4561 { $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5
4562 $as_echo_n "checking minix/config.h usability... " >&6; }
4563 cat >conftest.$ac_ext <<_ACEOF
4564 /* confdefs.h. */
4565 _ACEOF
4566 cat confdefs.h >>conftest.$ac_ext
4567 cat >>conftest.$ac_ext <<_ACEOF
4568 /* end confdefs.h. */
4569 $ac_includes_default
4570 #include <minix/config.h>
4571 _ACEOF
4572 rm -f conftest.$ac_objext
4573 if { (ac_try="$ac_compile"
4574 case "(($ac_try" in
4575 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4576 *) ac_try_echo=$ac_try;;
4577 esac
4578 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4579 $as_echo "$ac_try_echo") >&5
4580 (eval "$ac_compile") 2>conftest.er1
4581 ac_status=$?
4582 grep -v '^ *+' conftest.er1 >conftest.err
4583 rm -f conftest.er1
4584 cat conftest.err >&5
4585 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4586 (exit $ac_status); } && {
4587 test -z "$ac_c_werror_flag" ||
4588 test ! -s conftest.err
4589 } && test -s conftest.$ac_objext; then
4590 ac_header_compiler=yes
4591 else
4592 $as_echo "$as_me: failed program was:" >&5
4593 sed 's/^/| /' conftest.$ac_ext >&5
4594
4595 ac_header_compiler=no
4596 fi
4597
4598 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4599 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
4600 $as_echo "$ac_header_compiler" >&6; }
4601
4602 # Is the header present?
4603 { $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5
4604 $as_echo_n "checking minix/config.h presence... " >&6; }
4605 cat >conftest.$ac_ext <<_ACEOF
4606 /* confdefs.h. */
4607 _ACEOF
4608 cat confdefs.h >>conftest.$ac_ext
4609 cat >>conftest.$ac_ext <<_ACEOF
4610 /* end confdefs.h. */
4611 #include <minix/config.h>
4612 _ACEOF
4613 if { (ac_try="$ac_cpp conftest.$ac_ext"
4614 case "(($ac_try" in
4615 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4616 *) ac_try_echo=$ac_try;;
4617 esac
4618 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4619 $as_echo "$ac_try_echo") >&5
4620 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
4621 ac_status=$?
4622 grep -v '^ *+' conftest.er1 >conftest.err
4623 rm -f conftest.er1
4624 cat conftest.err >&5
4625 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4626 (exit $ac_status); } >/dev/null && {
4627 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
4628 test ! -s conftest.err
4629 }; then
4630 ac_header_preproc=yes
4631 else
4632 $as_echo "$as_me: failed program was:" >&5
4633 sed 's/^/| /' conftest.$ac_ext >&5
4634
4635 ac_header_preproc=no
4636 fi
4637
4638 rm -f conftest.err conftest.$ac_ext
4639 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
4640 $as_echo "$ac_header_preproc" >&6; }
4641
4642 # So? What about this header?
4643 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
4644 yes:no: )
4645 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
4646 $as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
4647 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
4648 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
4649 ac_header_preproc=yes
4650 ;;
4651 no:yes:* )
4652 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
4653 $as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
4654 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
4655 $as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
4656 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
4657 $as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
4658 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5
4659 $as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;}
4660 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
4661 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
4662 { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
4663 $as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
4664 ( cat <<\_ASBOX
4665 ## ---------------------------------------------------- ##
4666 ## Report this to mzyvongnfzneg (at) 0pointer (dot) net ##
4667 ## ---------------------------------------------------- ##
4668 _ASBOX
4669 ) | sed "s/^/$as_me: WARNING: /" >&2
4670 ;;
4671 esac
4672 { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
4673 $as_echo_n "checking for minix/config.h... " >&6; }
4674 if test "${ac_cv_header_minix_config_h+set}" = set; then
4675 $as_echo_n "(cached) " >&6
4676 else
4677 ac_cv_header_minix_config_h=$ac_header_preproc
4678 fi
4679 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
4680 $as_echo "$ac_cv_header_minix_config_h" >&6; }
4681
4682 fi
4683 if test "x$ac_cv_header_minix_config_h" = x""yes; then
4684 MINIX=yes
4685 else
4686 MINIX=
4687 fi
4688
4689
4690 if test "$MINIX" = yes; then
4691
4692 cat >>confdefs.h <<\_ACEOF
4693 #define _POSIX_SOURCE 1
4694 _ACEOF
4695
4696
4697 cat >>confdefs.h <<\_ACEOF
4698 #define _POSIX_1_SOURCE 2
4699 _ACEOF
4700
4701
4702 cat >>confdefs.h <<\_ACEOF
4703 #define _MINIX 1
4704 _ACEOF
4705
4706 fi
4707
4708
4709
4710 { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
4711 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
4712 if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
4713 $as_echo_n "(cached) " >&6
4714 else
4715 cat >conftest.$ac_ext <<_ACEOF
4716 /* confdefs.h. */
4717 _ACEOF
4718 cat confdefs.h >>conftest.$ac_ext
4719 cat >>conftest.$ac_ext <<_ACEOF
4720 /* end confdefs.h. */
4721
4722 # define __EXTENSIONS__ 1
4723 $ac_includes_default
4724 int
4725 main ()
4726 {
4727
4728 ;
4729 return 0;
4730 }
4731 _ACEOF
4732 rm -f conftest.$ac_objext
4733 if { (ac_try="$ac_compile"
4734 case "(($ac_try" in
4735 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4736 *) ac_try_echo=$ac_try;;
4737 esac
4738 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4739 $as_echo "$ac_try_echo") >&5
4740 (eval "$ac_compile") 2>conftest.er1
4741 ac_status=$?
4742 grep -v '^ *+' conftest.er1 >conftest.err
4743 rm -f conftest.er1
4744 cat conftest.err >&5
4745 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4746 (exit $ac_status); } && {
4747 test -z "$ac_c_werror_flag" ||
4748 test ! -s conftest.err
4749 } && test -s conftest.$ac_objext; then
4750 ac_cv_safe_to_define___extensions__=yes
4751 else
4752 $as_echo "$as_me: failed program was:" >&5
4753 sed 's/^/| /' conftest.$ac_ext >&5
4754
4755 ac_cv_safe_to_define___extensions__=no
4756 fi
4757
4758 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4759 fi
4760 { $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
4761 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
4762 test $ac_cv_safe_to_define___extensions__ = yes &&
4763 cat >>confdefs.h <<\_ACEOF
4764 #define __EXTENSIONS__ 1
4765 _ACEOF
4766
4767 cat >>confdefs.h <<\_ACEOF
4768 #define _ALL_SOURCE 1
4769 _ACEOF
4770
4771 cat >>confdefs.h <<\_ACEOF
4772 #define _GNU_SOURCE 1
4773 _ACEOF
4774
4775 cat >>confdefs.h <<\_ACEOF
4776 #define _POSIX_PTHREAD_SEMANTICS 1
4777 _ACEOF
4778
4779 cat >>confdefs.h <<\_ACEOF
4780 #define _TANDEM_SOURCE 1
4781 _ACEOF
4782
4783
4784
4785 # C++
4786
4787 ac_ext=cpp
4788 ac_cpp='$CXXCPP $CPPFLAGS'
4789 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4790 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4791 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
4792 if test -z "$CXX"; then
4793 if test -n "$CCC"; then
4794 CXX=$CCC
4795 else
4796 if test -n "$ac_tool_prefix"; then
4797 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
4798 do
4799 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4800 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4801 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
4802 $as_echo_n "checking for $ac_word... " >&6; }
4803 if test "${ac_cv_prog_CXX+set}" = set; then
4804 $as_echo_n "(cached) " >&6
4805 else
4806 if test -n "$CXX"; then
4807 ac_cv_prog_CXX="$CXX" # Let the user override the test.
4808 else
4809 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4810 for as_dir in $PATH
4811 do
4812 IFS=$as_save_IFS
4813 test -z "$as_dir" && as_dir=.
4814 for ac_exec_ext in '' $ac_executable_extensions; do
4815 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4816 ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
4817 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
4818 break 2
4819 fi
4820 done
4821 done
4822 IFS=$as_save_IFS
4823
4824 fi
4825 fi
4826 CXX=$ac_cv_prog_CXX
4827 if test -n "$CXX"; then
4828 { $as_echo "$as_me:$LINENO: result: $CXX" >&5
4829 $as_echo "$CXX" >&6; }
4830 else
4831 { $as_echo "$as_me:$LINENO: result: no" >&5
4832 $as_echo "no" >&6; }
4833 fi
4834
4835
4836 test -n "$CXX" && break
4837 done
4838 fi
4839 if test -z "$CXX"; then
4840 ac_ct_CXX=$CXX
4841 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
4842 do
4843 # Extract the first word of "$ac_prog", so it can be a program name with args.
4844 set dummy $ac_prog; ac_word=$2
4845 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
4846 $as_echo_n "checking for $ac_word... " >&6; }
4847 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
4848 $as_echo_n "(cached) " >&6
4849 else
4850 if test -n "$ac_ct_CXX"; then
4851 ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
4852 else
4853 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4854 for as_dir in $PATH
4855 do
4856 IFS=$as_save_IFS
4857 test -z "$as_dir" && as_dir=.
4858 for ac_exec_ext in '' $ac_executable_extensions; do
4859 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4860 ac_cv_prog_ac_ct_CXX="$ac_prog"
4861 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
4862 break 2
4863 fi
4864 done
4865 done
4866 IFS=$as_save_IFS
4867
4868 fi
4869 fi
4870 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
4871 if test -n "$ac_ct_CXX"; then
4872 { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
4873 $as_echo "$ac_ct_CXX" >&6; }
4874 else
4875 { $as_echo "$as_me:$LINENO: result: no" >&5
4876 $as_echo "no" >&6; }
4877 fi
4878
4879
4880 test -n "$ac_ct_CXX" && break
4881 done
4882
4883 if test "x$ac_ct_CXX" = x; then
4884 CXX="g++"
4885 else
4886 case $cross_compiling:$ac_tool_warned in
4887 yes:)
4888 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
4889 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4890 ac_tool_warned=yes ;;
4891 esac
4892 CXX=$ac_ct_CXX
4893 fi
4894 fi
4895
4896 fi
4897 fi
4898 # Provide some information about the compiler.
4899 $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
4900 set X $ac_compile
4901 ac_compiler=$2
4902 { (ac_try="$ac_compiler --version >&5"
4903 case "(($ac_try" in
4904 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4905 *) ac_try_echo=$ac_try;;
4906 esac
4907 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4908 $as_echo "$ac_try_echo") >&5
4909 (eval "$ac_compiler --version >&5") 2>&5
4910 ac_status=$?
4911 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4912 (exit $ac_status); }
4913 { (ac_try="$ac_compiler -v >&5"
4914 case "(($ac_try" in
4915 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4916 *) ac_try_echo=$ac_try;;
4917 esac
4918 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4919 $as_echo "$ac_try_echo") >&5
4920 (eval "$ac_compiler -v >&5") 2>&5
4921 ac_status=$?
4922 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4923 (exit $ac_status); }
4924 { (ac_try="$ac_compiler -V >&5"
4925 case "(($ac_try" in
4926 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4927 *) ac_try_echo=$ac_try;;
4928 esac
4929 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4930 $as_echo "$ac_try_echo") >&5
4931 (eval "$ac_compiler -V >&5") 2>&5
4932 ac_status=$?
4933 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4934 (exit $ac_status); }
4935
4936 { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
4937 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
4938 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
4939 $as_echo_n "(cached) " >&6
4940 else
4941 cat >conftest.$ac_ext <<_ACEOF
4942 /* confdefs.h. */
4943 _ACEOF
4944 cat confdefs.h >>conftest.$ac_ext
4945 cat >>conftest.$ac_ext <<_ACEOF
4946 /* end confdefs.h. */
4947
4948 int
4949 main ()
4950 {
4951 #ifndef __GNUC__
4952 choke me
4953 #endif
4954
4955 ;
4956 return 0;
4957 }
4958 _ACEOF
4959 rm -f conftest.$ac_objext
4960 if { (ac_try="$ac_compile"
4961 case "(($ac_try" in
4962 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4963 *) ac_try_echo=$ac_try;;
4964 esac
4965 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4966 $as_echo "$ac_try_echo") >&5
4967 (eval "$ac_compile") 2>conftest.er1
4968 ac_status=$?
4969 grep -v '^ *+' conftest.er1 >conftest.err
4970 rm -f conftest.er1
4971 cat conftest.err >&5
4972 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4973 (exit $ac_status); } && {
4974 test -z "$ac_cxx_werror_flag" ||
4975 test ! -s conftest.err
4976 } && test -s conftest.$ac_objext; then
4977 ac_compiler_gnu=yes
4978 else
4979 $as_echo "$as_me: failed program was:" >&5
4980 sed 's/^/| /' conftest.$ac_ext >&5
4981
4982 ac_compiler_gnu=no
4983 fi
4984
4985 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4986 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
4987
4988 fi
4989 { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
4990 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
4991 if test $ac_compiler_gnu = yes; then
4992 GXX=yes
4993 else
4994 GXX=
4995 fi
4996 ac_test_CXXFLAGS=${CXXFLAGS+set}
4997 ac_save_CXXFLAGS=$CXXFLAGS
4998 { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
4999 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
5000 if test "${ac_cv_prog_cxx_g+set}" = set; then
5001 $as_echo_n "(cached) " >&6
5002 else
5003 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5004 ac_cxx_werror_flag=yes
5005 ac_cv_prog_cxx_g=no
5006 CXXFLAGS="-g"
5007 cat >conftest.$ac_ext <<_ACEOF
5008 /* confdefs.h. */
5009 _ACEOF
5010 cat confdefs.h >>conftest.$ac_ext
5011 cat >>conftest.$ac_ext <<_ACEOF
5012 /* end confdefs.h. */
5013
5014 int
5015 main ()
5016 {
5017
5018 ;
5019 return 0;
5020 }
5021 _ACEOF
5022 rm -f conftest.$ac_objext
5023 if { (ac_try="$ac_compile"
5024 case "(($ac_try" in
5025 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5026 *) ac_try_echo=$ac_try;;
5027 esac
5028 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5029 $as_echo "$ac_try_echo") >&5
5030 (eval "$ac_compile") 2>conftest.er1
5031 ac_status=$?
5032 grep -v '^ *+' conftest.er1 >conftest.err
5033 rm -f conftest.er1
5034 cat conftest.err >&5
5035 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5036 (exit $ac_status); } && {
5037 test -z "$ac_cxx_werror_flag" ||
5038 test ! -s conftest.err
5039 } && test -s conftest.$ac_objext; then
5040 ac_cv_prog_cxx_g=yes
5041 else
5042 $as_echo "$as_me: failed program was:" >&5
5043 sed 's/^/| /' conftest.$ac_ext >&5
5044
5045 CXXFLAGS=""
5046 cat >conftest.$ac_ext <<_ACEOF
5047 /* confdefs.h. */
5048 _ACEOF
5049 cat confdefs.h >>conftest.$ac_ext
5050 cat >>conftest.$ac_ext <<_ACEOF
5051 /* end confdefs.h. */
5052
5053 int
5054 main ()
5055 {
5056
5057 ;
5058 return 0;
5059 }
5060 _ACEOF
5061 rm -f conftest.$ac_objext
5062 if { (ac_try="$ac_compile"
5063 case "(($ac_try" in
5064 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5065 *) ac_try_echo=$ac_try;;
5066 esac
5067 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5068 $as_echo "$ac_try_echo") >&5
5069 (eval "$ac_compile") 2>conftest.er1
5070 ac_status=$?
5071 grep -v '^ *+' conftest.er1 >conftest.err
5072 rm -f conftest.er1
5073 cat conftest.err >&5
5074 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5075 (exit $ac_status); } && {
5076 test -z "$ac_cxx_werror_flag" ||
5077 test ! -s conftest.err
5078 } && test -s conftest.$ac_objext; then
5079 :
5080 else
5081 $as_echo "$as_me: failed program was:" >&5
5082 sed 's/^/| /' conftest.$ac_ext >&5
5083
5084 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5085 CXXFLAGS="-g"
5086 cat >conftest.$ac_ext <<_ACEOF
5087 /* confdefs.h. */
5088 _ACEOF
5089 cat confdefs.h >>conftest.$ac_ext
5090 cat >>conftest.$ac_ext <<_ACEOF
5091 /* end confdefs.h. */
5092
5093 int
5094 main ()
5095 {
5096
5097 ;
5098 return 0;
5099 }
5100 _ACEOF
5101 rm -f conftest.$ac_objext
5102 if { (ac_try="$ac_compile"
5103 case "(($ac_try" in
5104 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5105 *) ac_try_echo=$ac_try;;
5106 esac
5107 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5108 $as_echo "$ac_try_echo") >&5
5109 (eval "$ac_compile") 2>conftest.er1
5110 ac_status=$?
5111 grep -v '^ *+' conftest.er1 >conftest.err
5112 rm -f conftest.er1
5113 cat conftest.err >&5
5114 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5115 (exit $ac_status); } && {
5116 test -z "$ac_cxx_werror_flag" ||
5117 test ! -s conftest.err
5118 } && test -s conftest.$ac_objext; then
5119 ac_cv_prog_cxx_g=yes
5120 else
5121 $as_echo "$as_me: failed program was:" >&5
5122 sed 's/^/| /' conftest.$ac_ext >&5
5123
5124
5125 fi
5126
5127 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5128 fi
5129
5130 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5131 fi
5132
5133 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5134 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5135 fi
5136 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
5137 $as_echo "$ac_cv_prog_cxx_g" >&6; }
5138 if test "$ac_test_CXXFLAGS" = set; then
5139 CXXFLAGS=$ac_save_CXXFLAGS
5140 elif test $ac_cv_prog_cxx_g = yes; then
5141 if test "$GXX" = yes; then
5142 CXXFLAGS="-g -O2"
5143 else
5144 CXXFLAGS="-g"
5145 fi
5146 else
5147 if test "$GXX" = yes; then
5148 CXXFLAGS="-O2"
5149 else
5150 CXXFLAGS=
5151 fi
5152 fi
5153 ac_ext=c
5154 ac_cpp='$CPP $CPPFLAGS'
5155 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5156 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5157 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5158
5159 depcc="$CXX" am_compiler_list=
5160
5161 { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
5162 $as_echo_n "checking dependency style of $depcc... " >&6; }
5163 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
5164 $as_echo_n "(cached) " >&6
5165 else
5166 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
5167 # We make a subdir and do the tests there. Otherwise we can end up
5168 # making bogus files that we don't know about and never remove. For
5169 # instance it was reported that on HP-UX the gcc test will end up
5170 # making a dummy file named `D' -- because `-MD' means `put the output
5171 # in D'.
5172 mkdir conftest.dir
5173 # Copy depcomp to subdir because otherwise we won't find it if we're
5174 # using a relative directory.
5175 cp "$am_depcomp" conftest.dir
5176 cd conftest.dir
5177 # We will build objects and dependencies in a subdirectory because
5178 # it helps to detect inapplicable dependency modes. For instance
5179 # both Tru64's cc and ICC support -MD to output dependencies as a
5180 # side effect of compilation, but ICC will put the dependencies in
5181 # the current directory while Tru64 will put them in the object
5182 # directory.
5183 mkdir sub
5184
5185 am_cv_CXX_dependencies_compiler_type=none
5186 if test "$am_compiler_list" = ""; then
5187 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
5188 fi
5189 for depmode in $am_compiler_list; do
5190 # Setup a source with many dependencies, because some compilers
5191 # like to wrap large dependency lists on column 80 (with \), and
5192 # we should not choose a depcomp mode which is confused by this.
5193 #
5194 # We need to recreate these files for each test, as the compiler may
5195 # overwrite some of them when testing with obscure command lines.
5196 # This happens at least with the AIX C compiler.
5197 : > sub/conftest.c
5198 for i in 1 2 3 4 5 6; do
5199 echo '#include "conftst'$i'.h"' >> sub/conftest.c
5200 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
5201 # Solaris 8's {/usr,}/bin/sh.
5202 touch sub/conftst$i.h
5203 done
5204 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
5205
5206 case $depmode in
5207 nosideeffect)
5208 # after this tag, mechanisms are not by side-effect, so they'll
5209 # only be used when explicitly requested
5210 if test "x$enable_dependency_tracking" = xyes; then
5211 continue
5212 else
5213 break
5214 fi
5215 ;;
5216 none) break ;;
5217 esac
5218 # We check with `-c' and `-o' for the sake of the "dashmstdout"
5219 # mode. It turns out that the SunPro C++ compiler does not properly
5220 # handle `-M -o', and we need to detect this.
5221 if depmode=$depmode \
5222 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
5223 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
5224 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
5225 >/dev/null 2>conftest.err &&
5226 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
5227 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
5228 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
5229 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
5230 # icc doesn't choke on unknown options, it will just issue warnings
5231 # or remarks (even with -Werror). So we grep stderr for any message
5232 # that says an option was ignored or not supported.
5233 # When given -MP, icc 7.0 and 7.1 complain thusly:
5234 # icc: Command line warning: ignoring option '-M'; no argument required
5235 # The diagnosis changed in icc 8.0:
5236 # icc: Command line remark: option '-MP' not supported
5237 if (grep 'ignoring option' conftest.err ||
5238 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
5239 am_cv_CXX_dependencies_compiler_type=$depmode
5240 break
5241 fi
5242 fi
5243 done
5244
5245 cd ..
5246 rm -rf conftest.dir
5247 else
5248 am_cv_CXX_dependencies_compiler_type=none
5249 fi
5250
5251 fi
5252 { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
5253 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
5254 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
5255
5256 if
5257 test "x$enable_dependency_tracking" != xno \
5258 && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
5259 am__fastdepCXX_TRUE=
5260 am__fastdepCXX_FALSE='#'
5261 else
5262 am__fastdepCXX_TRUE='#'
5263 am__fastdepCXX_FALSE=
5264 fi
5265
5266
5267
5268 # GCC flags
5269
5270 test_gcc_flag() {
5271 cat >conftest.$ac_ext <<_ACEOF
5272 int main(int argc, char*argv) {}
5273 _ACEOF
5274 $CC -c conftest.c $CFLAGS "$1" -o conftest.o > /dev/null 2> /dev/null
5275 ret=$?
5276 rm -f conftest.o
5277 return $ret
5278 }
5279
5280 # If using GCC specify some additional parameters
5281 if test "x$GCC" = "xyes" ; then
5282
5283 # We use gnu99 instead of c99 because many have interpreted the standard
5284 # in a way that int64_t isn't defined on non-64 bit platforms.
5285 DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math"
5286
5287 for flag in $DESIRED_FLAGS ; do
5288 { $as_echo "$as_me:$LINENO: checking whether $CC accepts $flag" >&5
5289 $as_echo_n "checking whether $CC accepts $flag... " >&6; }
5290 if test_gcc_flag $flag ; then
5291 CFLAGS="$CFLAGS $flag"
5292 CXXFLAGS="$CXXFLAGS $flag"
5293 { $as_echo "$as_me:$LINENO: result: yes" >&5
5294 $as_echo "yes" >&6; }
5295 else
5296 { $as_echo "$as_me:$LINENO: result: no" >&5
5297 $as_echo "no" >&6; }
5298 fi
5299 done
5300 fi
5301
5302 #### libtool stuff ####
5303
5304 case `pwd` in
5305 *\ * | *\ *)
5306 { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
5307 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
5308 esac
5309
5310
5311
5312 macro_version='2.2.6'
5313 macro_revision='1.3012'
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327 ltmain="$ac_aux_dir/ltmain.sh"
5328
5329 { $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
5330 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
5331 if test "${ac_cv_path_SED+set}" = set; then
5332 $as_echo_n "(cached) " >&6
5333 else
5334 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
5335 for ac_i in 1 2 3 4 5 6 7; do
5336 ac_script="$ac_script$as_nl$ac_script"
5337 done
5338 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
5339 $as_unset ac_script || ac_script=
5340 if test -z "$SED"; then
5341 ac_path_SED_found=false
5342 # Loop through the user's path and test for each of PROGNAME-LIST
5343 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5344 for as_dir in $PATH
5345 do
5346 IFS=$as_save_IFS
5347 test -z "$as_dir" && as_dir=.
5348 for ac_prog in sed gsed; do
5349 for ac_exec_ext in '' $ac_executable_extensions; do
5350 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
5351 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
5352 # Check for GNU ac_path_SED and select it if it is found.
5353 # Check for GNU $ac_path_SED
5354 case `"$ac_path_SED" --version 2>&1` in
5355 *GNU*)
5356 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
5357 *)
5358 ac_count=0
5359 $as_echo_n 0123456789 >"conftest.in"
5360 while :
5361 do
5362 cat "conftest.in" "conftest.in" >"conftest.tmp"
5363 mv "conftest.tmp" "conftest.in"
5364 cp "conftest.in" "conftest.nl"
5365 $as_echo '' >> "conftest.nl"
5366 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
5367 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5368 ac_count=`expr $ac_count + 1`
5369 if test $ac_count -gt ${ac_path_SED_max-0}; then
5370 # Best one so far, save it but keep looking for a better one
5371 ac_cv_path_SED="$ac_path_SED"
5372 ac_path_SED_max=$ac_count
5373 fi
5374 # 10*(2^10) chars as input seems more than enough
5375 test $ac_count -gt 10 && break
5376 done
5377 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5378 esac
5379
5380 $ac_path_SED_found && break 3
5381 done
5382 done
5383 done
5384 IFS=$as_save_IFS
5385 if test -z "$ac_cv_path_SED"; then
5386 { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
5387 $as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
5388 { (exit 1); exit 1; }; }
5389 fi
5390 else
5391 ac_cv_path_SED=$SED
5392 fi
5393
5394 fi
5395 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
5396 $as_echo "$ac_cv_path_SED" >&6; }
5397 SED="$ac_cv_path_SED"
5398 rm -f conftest.sed
5399
5400 test -z "$SED" && SED=sed
5401 Xsed="$SED -e 1s/^X//"
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413 { $as_echo "$as_me:$LINENO: checking for fgrep" >&5
5414 $as_echo_n "checking for fgrep... " >&6; }
5415 if test "${ac_cv_path_FGREP+set}" = set; then
5416 $as_echo_n "(cached) " >&6
5417 else
5418 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
5419 then ac_cv_path_FGREP="$GREP -F"
5420 else
5421 if test -z "$FGREP"; then
5422 ac_path_FGREP_found=false
5423 # Loop through the user's path and test for each of PROGNAME-LIST
5424 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5425 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5426 do
5427 IFS=$as_save_IFS
5428 test -z "$as_dir" && as_dir=.
5429 for ac_prog in fgrep; do
5430 for ac_exec_ext in '' $ac_executable_extensions; do
5431 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
5432 { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
5433 # Check for GNU ac_path_FGREP and select it if it is found.
5434 # Check for GNU $ac_path_FGREP
5435 case `"$ac_path_FGREP" --version 2>&1` in
5436 *GNU*)
5437 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
5438 *)
5439 ac_count=0
5440 $as_echo_n 0123456789 >"conftest.in"
5441 while :
5442 do
5443 cat "conftest.in" "conftest.in" >"conftest.tmp"
5444 mv "conftest.tmp" "conftest.in"
5445 cp "conftest.in" "conftest.nl"
5446 $as_echo 'FGREP' >> "conftest.nl"
5447 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
5448 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5449 ac_count=`expr $ac_count + 1`
5450 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
5451 # Best one so far, save it but keep looking for a better one
5452 ac_cv_path_FGREP="$ac_path_FGREP"
5453 ac_path_FGREP_max=$ac_count
5454 fi
5455 # 10*(2^10) chars as input seems more than enough
5456 test $ac_count -gt 10 && break
5457 done
5458 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5459 esac
5460
5461 $ac_path_FGREP_found && break 3
5462 done
5463 done
5464 done
5465 IFS=$as_save_IFS
5466 if test -z "$ac_cv_path_FGREP"; then
5467 { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
5468 $as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
5469 { (exit 1); exit 1; }; }
5470 fi
5471 else
5472 ac_cv_path_FGREP=$FGREP
5473 fi
5474
5475 fi
5476 fi
5477 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
5478 $as_echo "$ac_cv_path_FGREP" >&6; }
5479 FGREP="$ac_cv_path_FGREP"
5480
5481
5482 test -z "$GREP" && GREP=grep
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502 # Check whether --with-gnu-ld was given.
5503 if test "${with_gnu_ld+set}" = set; then
5504 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
5505 else
5506 with_gnu_ld=no
5507 fi
5508
5509 ac_prog=ld
5510 if test "$GCC" = yes; then
5511 # Check if gcc -print-prog-name=ld gives a path.
5512 { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
5513 $as_echo_n "checking for ld used by $CC... " >&6; }
5514 case $host in
5515 *-*-mingw*)
5516 # gcc leaves a trailing carriage return which upsets mingw
5517 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5518 *)
5519 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5520 esac
5521 case $ac_prog in
5522 # Accept absolute paths.
5523 [\\/]* | ?:[\\/]*)
5524 re_direlt='/[^/][^/]*/\.\./'
5525 # Canonicalize the pathname of ld
5526 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
5527 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
5528 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
5529 done
5530 test -z "$LD" && LD="$ac_prog"
5531 ;;
5532 "")
5533 # If it fails, then pretend we aren't using GCC.
5534 ac_prog=ld
5535 ;;
5536 *)
5537 # If it is relative, then search for the first ld in PATH.
5538 with_gnu_ld=unknown
5539 ;;
5540 esac
5541 elif test "$with_gnu_ld" = yes; then
5542 { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
5543 $as_echo_n "checking for GNU ld... " >&6; }
5544 else
5545 { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
5546 $as_echo_n "checking for non-GNU ld... " >&6; }
5547 fi
5548 if test "${lt_cv_path_LD+set}" = set; then
5549 $as_echo_n "(cached) " >&6
5550 else
5551 if test -z "$LD"; then
5552 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5553 for ac_dir in $PATH; do
5554 IFS="$lt_save_ifs"
5555 test -z "$ac_dir" && ac_dir=.
5556 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5557 lt_cv_path_LD="$ac_dir/$ac_prog"
5558 # Check to see if the program is GNU ld. I'd rather use --version,
5559 # but apparently some variants of GNU ld only accept -v.
5560 # Break only if it was the GNU/non-GNU ld that we prefer.
5561 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
5562 *GNU* | *'with BFD'*)
5563 test "$with_gnu_ld" != no && break
5564 ;;
5565 *)
5566 test "$with_gnu_ld" != yes && break
5567 ;;
5568 esac
5569 fi
5570 done
5571 IFS="$lt_save_ifs"
5572 else
5573 lt_cv_path_LD="$LD" # Let the user override the test with a path.
5574 fi
5575 fi
5576
5577 LD="$lt_cv_path_LD"
5578 if test -n "$LD"; then
5579 { $as_echo "$as_me:$LINENO: result: $LD" >&5
5580 $as_echo "$LD" >&6; }
5581 else
5582 { $as_echo "$as_me:$LINENO: result: no" >&5
5583 $as_echo "no" >&6; }
5584 fi
5585 test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
5586 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
5587 { (exit 1); exit 1; }; }
5588 { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
5589 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
5590 if test "${lt_cv_prog_gnu_ld+set}" = set; then
5591 $as_echo_n "(cached) " >&6
5592 else
5593 # I'd rather use --version here, but apparently some GNU lds only accept -v.
5594 case `$LD -v 2>&1 </dev/null` in
5595 *GNU* | *'with BFD'*)
5596 lt_cv_prog_gnu_ld=yes
5597 ;;
5598 *)
5599 lt_cv_prog_gnu_ld=no
5600 ;;
5601 esac
5602 fi
5603 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
5604 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
5605 with_gnu_ld=$lt_cv_prog_gnu_ld
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615 { $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
5616 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
5617 if test "${lt_cv_path_NM+set}" = set; then
5618 $as_echo_n "(cached) " >&6
5619 else
5620 if test -n "$NM"; then
5621 # Let the user override the test.
5622 lt_cv_path_NM="$NM"
5623 else
5624 lt_nm_to_check="${ac_tool_prefix}nm"
5625 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
5626 lt_nm_to_check="$lt_nm_to_check nm"
5627 fi
5628 for lt_tmp_nm in $lt_nm_to_check; do
5629 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5630 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
5631 IFS="$lt_save_ifs"
5632 test -z "$ac_dir" && ac_dir=.
5633 tmp_nm="$ac_dir/$lt_tmp_nm"
5634 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
5635 # Check to see if the nm accepts a BSD-compat flag.
5636 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
5637 # nm: unknown option "B" ignored
5638 # Tru64's nm complains that /dev/null is an invalid object file
5639 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
5640 */dev/null* | *'Invalid file or object type'*)
5641 lt_cv_path_NM="$tmp_nm -B"
5642 break
5643 ;;
5644 *)
5645 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
5646 */dev/null*)
5647 lt_cv_path_NM="$tmp_nm -p"
5648 break
5649 ;;
5650 *)
5651 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
5652 continue # so that we can try to find one that supports BSD flags
5653 ;;
5654 esac
5655 ;;
5656 esac
5657 fi
5658 done
5659 IFS="$lt_save_ifs"
5660 done
5661 : ${lt_cv_path_NM=no}
5662 fi
5663 fi
5664 { $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
5665 $as_echo "$lt_cv_path_NM" >&6; }
5666 if test "$lt_cv_path_NM" != "no"; then
5667 NM="$lt_cv_path_NM"
5668 else
5669 # Didn't find any BSD compatible name lister, look for dumpbin.
5670 if test -n "$ac_tool_prefix"; then
5671 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
5672 do
5673 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5674 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5675 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
5676 $as_echo_n "checking for $ac_word... " >&6; }
5677 if test "${ac_cv_prog_DUMPBIN+set}" = set; then
5678 $as_echo_n "(cached) " >&6
5679 else
5680 if test -n "$DUMPBIN"; then
5681 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
5682 else
5683 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5684 for as_dir in $PATH
5685 do
5686 IFS=$as_save_IFS
5687 test -z "$as_dir" && as_dir=.
5688 for ac_exec_ext in '' $ac_executable_extensions; do
5689 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5690 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
5691 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
5692 break 2
5693 fi
5694 done
5695 done
5696 IFS=$as_save_IFS
5697
5698 fi
5699 fi
5700 DUMPBIN=$ac_cv_prog_DUMPBIN
5701 if test -n "$DUMPBIN"; then
5702 { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
5703 $as_echo "$DUMPBIN" >&6; }
5704 else
5705 { $as_echo "$as_me:$LINENO: result: no" >&5
5706 $as_echo "no" >&6; }
5707 fi
5708
5709
5710 test -n "$DUMPBIN" && break
5711 done
5712 fi
5713 if test -z "$DUMPBIN"; then
5714 ac_ct_DUMPBIN=$DUMPBIN
5715 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
5716 do
5717 # Extract the first word of "$ac_prog", so it can be a program name with args.
5718 set dummy $ac_prog; ac_word=$2
5719 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
5720 $as_echo_n "checking for $ac_word... " >&6; }
5721 if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
5722 $as_echo_n "(cached) " >&6
5723 else
5724 if test -n "$ac_ct_DUMPBIN"; then
5725 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
5726 else
5727 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5728 for as_dir in $PATH
5729 do
5730 IFS=$as_save_IFS
5731 test -z "$as_dir" && as_dir=.
5732 for ac_exec_ext in '' $ac_executable_extensions; do
5733 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5734 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
5735 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
5736 break 2
5737 fi
5738 done
5739 done
5740 IFS=$as_save_IFS
5741
5742 fi
5743 fi
5744 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
5745 if test -n "$ac_ct_DUMPBIN"; then
5746 { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
5747 $as_echo "$ac_ct_DUMPBIN" >&6; }
5748 else
5749 { $as_echo "$as_me:$LINENO: result: no" >&5
5750 $as_echo "no" >&6; }
5751 fi
5752
5753
5754 test -n "$ac_ct_DUMPBIN" && break
5755 done
5756
5757 if test "x$ac_ct_DUMPBIN" = x; then
5758 DUMPBIN=":"
5759 else
5760 case $cross_compiling:$ac_tool_warned in
5761 yes:)
5762 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
5763 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5764 ac_tool_warned=yes ;;
5765 esac
5766 DUMPBIN=$ac_ct_DUMPBIN
5767 fi
5768 fi
5769
5770
5771 if test "$DUMPBIN" != ":"; then
5772 NM="$DUMPBIN"
5773 fi
5774 fi
5775 test -z "$NM" && NM=nm
5776
5777
5778
5779
5780
5781
5782 { $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
5783 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
5784 if test "${lt_cv_nm_interface+set}" = set; then
5785 $as_echo_n "(cached) " >&6
5786 else
5787 lt_cv_nm_interface="BSD nm"
5788 echo "int some_variable = 0;" > conftest.$ac_ext
5789 (eval echo "\"\$as_me:5790: $ac_compile\"" >&5)
5790 (eval "$ac_compile" 2>conftest.err)
5791 cat conftest.err >&5
5792 (eval echo "\"\$as_me:5793: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
5793 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
5794 cat conftest.err >&5
5795 (eval echo "\"\$as_me:5796: output\"" >&5)
5796 cat conftest.out >&5
5797 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
5798 lt_cv_nm_interface="MS dumpbin"
5799 fi
5800 rm -f conftest*
5801 fi
5802 { $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
5803 $as_echo "$lt_cv_nm_interface" >&6; }
5804
5805 { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
5806 $as_echo_n "checking whether ln -s works... " >&6; }
5807 LN_S=$as_ln_s
5808 if test "$LN_S" = "ln -s"; then
5809 { $as_echo "$as_me:$LINENO: result: yes" >&5
5810 $as_echo "yes" >&6; }
5811 else
5812 { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
5813 $as_echo "no, using $LN_S" >&6; }
5814 fi
5815
5816 # find the maximum length of command line arguments
5817 { $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
5818 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
5819 if test "${lt_cv_sys_max_cmd_len+set}" = set; then
5820 $as_echo_n "(cached) " >&6
5821 else
5822 i=0
5823 teststring="ABCD"
5824
5825 case $build_os in
5826 msdosdjgpp*)
5827 # On DJGPP, this test can blow up pretty badly due to problems in libc
5828 # (any single argument exceeding 2000 bytes causes a buffer overrun
5829 # during glob expansion). Even if it were fixed, the result of this
5830 # check would be larger than it should be.
5831 lt_cv_sys_max_cmd_len=12288; # 12K is about right
5832 ;;
5833
5834 gnu*)
5835 # Under GNU Hurd, this test is not required because there is
5836 # no limit to the length of command line arguments.
5837 # Libtool will interpret -1 as no limit whatsoever
5838 lt_cv_sys_max_cmd_len=-1;
5839 ;;
5840
5841 cygwin* | mingw* | cegcc*)
5842 # On Win9x/ME, this test blows up -- it succeeds, but takes
5843 # about 5 minutes as the teststring grows exponentially.
5844 # Worse, since 9x/ME are not pre-emptively multitasking,
5845 # you end up with a "frozen" computer, even though with patience
5846 # the test eventually succeeds (with a max line length of 256k).
5847 # Instead, let's just punt: use the minimum linelength reported by
5848 # all of the supported platforms: 8192 (on NT/2K/XP).
5849 lt_cv_sys_max_cmd_len=8192;
5850 ;;
5851
5852 amigaos*)
5853 # On AmigaOS with pdksh, this test takes hours, literally.
5854 # So we just punt and use a minimum line length of 8192.
5855 lt_cv_sys_max_cmd_len=8192;
5856 ;;
5857
5858 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
5859 # This has been around since 386BSD, at least. Likely further.
5860 if test -x /sbin/sysctl; then
5861 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
5862 elif test -x /usr/sbin/sysctl; then
5863 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
5864 else
5865 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
5866 fi
5867 # And add a safety zone
5868 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5869 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5870 ;;
5871
5872 interix*)
5873 # We know the value 262144 and hardcode it with a safety zone (like BSD)
5874 lt_cv_sys_max_cmd_len=196608
5875 ;;
5876
5877 osf*)
5878 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
5879 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
5880 # nice to cause kernel panics so lets avoid the loop below.
5881 # First set a reasonable default.
5882 lt_cv_sys_max_cmd_len=16384
5883 #
5884 if test -x /sbin/sysconfig; then
5885 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
5886 *1*) lt_cv_sys_max_cmd_len=-1 ;;
5887 esac
5888 fi
5889 ;;
5890 sco3.2v5*)
5891 lt_cv_sys_max_cmd_len=102400
5892 ;;
5893 sysv5* | sco5v6* | sysv4.2uw2*)
5894 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
5895 if test -n "$kargmax"; then
5896 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
5897 else
5898 lt_cv_sys_max_cmd_len=32768
5899 fi
5900 ;;
5901 *)
5902 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5903 if test -n "$lt_cv_sys_max_cmd_len"; then
5904 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5905 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5906 else
5907 # Make teststring a little bigger before we do anything with it.
5908 # a 1K string should be a reasonable start.
5909 for i in 1 2 3 4 5 6 7 8 ; do
5910 teststring=$teststring$teststring
5911 done
5912 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
5913 # If test is not a shell built-in, we'll probably end up computing a
5914 # maximum length that is only half of the actual maximum length, but
5915 # we can't tell.
5916 while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
5917 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
5918 test $i != 17 # 1/2 MB should be enough
5919 do
5920 i=`expr $i + 1`
5921 teststring=$teststring$teststring
5922 done
5923 # Only check the string length outside the loop.
5924 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
5925 teststring=
5926 # Add a significant safety factor because C++ compilers can tack on
5927 # massive amounts of additional arguments before passing them to the
5928 # linker. It appears as though 1/2 is a usable value.
5929 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
5930 fi
5931 ;;
5932 esac
5933
5934 fi
5935
5936 if test -n $lt_cv_sys_max_cmd_len ; then
5937 { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
5938 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
5939 else
5940 { $as_echo "$as_me:$LINENO: result: none" >&5
5941 $as_echo "none" >&6; }
5942 fi
5943 max_cmd_len=$lt_cv_sys_max_cmd_len
5944
5945
5946
5947
5948
5949
5950 : ${CP="cp -f"}
5951 : ${MV="mv -f"}
5952 : ${RM="rm -f"}
5953
5954 { $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
5955 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
5956 # Try some XSI features
5957 xsi_shell=no
5958 ( _lt_dummy="a/b/c"
5959 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
5960 = c,a/b,, \
5961 && eval 'test $(( 1 + 1 )) -eq 2 \
5962 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
5963 && xsi_shell=yes
5964 { $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
5965 $as_echo "$xsi_shell" >&6; }
5966
5967
5968 { $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
5969 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
5970 lt_shell_append=no
5971 ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
5972 >/dev/null 2>&1 \
5973 && lt_shell_append=yes
5974 { $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
5975 $as_echo "$lt_shell_append" >&6; }
5976
5977
5978 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
5979 lt_unset=unset
5980 else
5981 lt_unset=false
5982 fi
5983
5984
5985
5986
5987
5988 # test EBCDIC or ASCII
5989 case `echo X|tr X '\101'` in
5990 A) # ASCII based system
5991 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
5992 lt_SP2NL='tr \040 \012'
5993 lt_NL2SP='tr \015\012 \040\040'
5994 ;;
5995 *) # EBCDIC based system
5996 lt_SP2NL='tr \100 \n'
5997 lt_NL2SP='tr \r\n \100\100'
5998 ;;
5999 esac
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009 { $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
6010 $as_echo_n "checking for $LD option to reload object files... " >&6; }
6011 if test "${lt_cv_ld_reload_flag+set}" = set; then
6012 $as_echo_n "(cached) " >&6
6013 else
6014 lt_cv_ld_reload_flag='-r'
6015 fi
6016 { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
6017 $as_echo "$lt_cv_ld_reload_flag" >&6; }
6018 reload_flag=$lt_cv_ld_reload_flag
6019 case $reload_flag in
6020 "" | " "*) ;;
6021 *) reload_flag=" $reload_flag" ;;
6022 esac
6023 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6024 case $host_os in
6025 darwin*)
6026 if test "$GCC" = yes; then
6027 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
6028 else
6029 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6030 fi
6031 ;;
6032 esac
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042 if test -n "$ac_tool_prefix"; then
6043 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
6044 set dummy ${ac_tool_prefix}objdump; ac_word=$2
6045 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6046 $as_echo_n "checking for $ac_word... " >&6; }
6047 if test "${ac_cv_prog_OBJDUMP+set}" = set; then
6048 $as_echo_n "(cached) " >&6
6049 else
6050 if test -n "$OBJDUMP"; then
6051 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
6052 else
6053 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6054 for as_dir in $PATH
6055 do
6056 IFS=$as_save_IFS
6057 test -z "$as_dir" && as_dir=.
6058 for ac_exec_ext in '' $ac_executable_extensions; do
6059 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6060 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
6061 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6062 break 2
6063 fi
6064 done
6065 done
6066 IFS=$as_save_IFS
6067
6068 fi
6069 fi
6070 OBJDUMP=$ac_cv_prog_OBJDUMP
6071 if test -n "$OBJDUMP"; then
6072 { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
6073 $as_echo "$OBJDUMP" >&6; }
6074 else
6075 { $as_echo "$as_me:$LINENO: result: no" >&5
6076 $as_echo "no" >&6; }
6077 fi
6078
6079
6080 fi
6081 if test -z "$ac_cv_prog_OBJDUMP"; then
6082 ac_ct_OBJDUMP=$OBJDUMP
6083 # Extract the first word of "objdump", so it can be a program name with args.
6084 set dummy objdump; ac_word=$2
6085 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6086 $as_echo_n "checking for $ac_word... " >&6; }
6087 if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
6088 $as_echo_n "(cached) " >&6
6089 else
6090 if test -n "$ac_ct_OBJDUMP"; then
6091 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
6092 else
6093 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6094 for as_dir in $PATH
6095 do
6096 IFS=$as_save_IFS
6097 test -z "$as_dir" && as_dir=.
6098 for ac_exec_ext in '' $ac_executable_extensions; do
6099 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6100 ac_cv_prog_ac_ct_OBJDUMP="objdump"
6101 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6102 break 2
6103 fi
6104 done
6105 done
6106 IFS=$as_save_IFS
6107
6108 fi
6109 fi
6110 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
6111 if test -n "$ac_ct_OBJDUMP"; then
6112 { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
6113 $as_echo "$ac_ct_OBJDUMP" >&6; }
6114 else
6115 { $as_echo "$as_me:$LINENO: result: no" >&5
6116 $as_echo "no" >&6; }
6117 fi
6118
6119 if test "x$ac_ct_OBJDUMP" = x; then
6120 OBJDUMP="false"
6121 else
6122 case $cross_compiling:$ac_tool_warned in
6123 yes:)
6124 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
6125 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6126 ac_tool_warned=yes ;;
6127 esac
6128 OBJDUMP=$ac_ct_OBJDUMP
6129 fi
6130 else
6131 OBJDUMP="$ac_cv_prog_OBJDUMP"
6132 fi
6133
6134 test -z "$OBJDUMP" && OBJDUMP=objdump
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144 { $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
6145 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
6146 if test "${lt_cv_deplibs_check_method+set}" = set; then
6147 $as_echo_n "(cached) " >&6
6148 else
6149 lt_cv_file_magic_cmd='$MAGIC_CMD'
6150 lt_cv_file_magic_test_file=
6151 lt_cv_deplibs_check_method='unknown'
6152 # Need to set the preceding variable on all platforms that support
6153 # interlibrary dependencies.
6154 # 'none' -- dependencies not supported.
6155 # `unknown' -- same as none, but documents that we really don't know.
6156 # 'pass_all' -- all dependencies passed with no checks.
6157 # 'test_compile' -- check by making test program.
6158 # 'file_magic [[regex]]' -- check by looking for files in library path
6159 # which responds to the $file_magic_cmd with a given extended regex.
6160 # If you have `file' or equivalent on your system and you're not sure
6161 # whether `pass_all' will *always* work, you probably want this one.
6162
6163 case $host_os in
6164 aix[4-9]*)
6165 lt_cv_deplibs_check_method=pass_all
6166 ;;
6167
6168 beos*)
6169 lt_cv_deplibs_check_method=pass_all
6170 ;;
6171
6172 bsdi[45]*)
6173 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
6174 lt_cv_file_magic_cmd='/usr/bin/file -L'
6175 lt_cv_file_magic_test_file=/shlib/libc.so
6176 ;;
6177
6178 cygwin*)
6179 # func_win32_libid is a shell function defined in ltmain.sh
6180 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6181 lt_cv_file_magic_cmd='func_win32_libid'
6182 ;;
6183
6184 mingw* | pw32*)
6185 # Base MSYS/MinGW do not provide the 'file' command needed by
6186 # func_win32_libid shell function, so use a weaker test based on 'objdump',
6187 # unless we find 'file', for example because we are cross-compiling.
6188 if ( file / ) >/dev/null 2>&1; then
6189 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6190 lt_cv_file_magic_cmd='func_win32_libid'
6191 else
6192 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
6193 lt_cv_file_magic_cmd='$OBJDUMP -f'
6194 fi
6195 ;;
6196
6197 cegcc)
6198 # use the weaker test based on 'objdump'. See mingw*.
6199 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
6200 lt_cv_file_magic_cmd='$OBJDUMP -f'
6201 ;;
6202
6203 darwin* | rhapsody*)
6204 lt_cv_deplibs_check_method=pass_all
6205 ;;
6206
6207 freebsd* | dragonfly*)
6208 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6209 case $host_cpu in
6210 i*86 )
6211 # Not sure whether the presence of OpenBSD here was a mistake.
6212 # Let's accept both of them until this is cleared up.
6213 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
6214 lt_cv_file_magic_cmd=/usr/bin/file
6215 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
6216 ;;
6217 esac
6218 else
6219 lt_cv_deplibs_check_method=pass_all
6220 fi
6221 ;;
6222
6223 gnu*)
6224 lt_cv_deplibs_check_method=pass_all
6225 ;;
6226
6227 hpux10.20* | hpux11*)
6228 lt_cv_file_magic_cmd=/usr/bin/file
6229 case $host_cpu in
6230 ia64*)
6231 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
6232 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
6233 ;;
6234 hppa*64*)
6235 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
6236 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
6237 ;;
6238 *)
6239 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
6240 lt_cv_file_magic_test_file=/usr/lib/libc.sl
6241 ;;
6242 esac
6243 ;;
6244
6245 interix[3-9]*)
6246 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
6247 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
6248 ;;
6249
6250 irix5* | irix6* | nonstopux*)
6251 case $LD in
6252 *-32|*"-32 ") libmagic=32-bit;;
6253 *-n32|*"-n32 ") libmagic=N32;;
6254 *-64|*"-64 ") libmagic=64-bit;;
6255 *) libmagic=never-match;;
6256 esac
6257 lt_cv_deplibs_check_method=pass_all
6258 ;;
6259
6260 # This must be Linux ELF.
6261 linux* | k*bsd*-gnu)
6262 lt_cv_deplibs_check_method=pass_all
6263 ;;
6264
6265 netbsd*)
6266 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6267 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
6268 else
6269 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
6270 fi
6271 ;;
6272
6273 newos6*)
6274 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
6275 lt_cv_file_magic_cmd=/usr/bin/file
6276 lt_cv_file_magic_test_file=/usr/lib/libnls.so
6277 ;;
6278
6279 *nto* | *qnx*)
6280 lt_cv_deplibs_check_method=pass_all
6281 ;;
6282
6283 openbsd*)
6284 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6285 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
6286 else
6287 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
6288 fi
6289 ;;
6290
6291 osf3* | osf4* | osf5*)
6292 lt_cv_deplibs_check_method=pass_all
6293 ;;
6294
6295 rdos*)
6296 lt_cv_deplibs_check_method=pass_all
6297 ;;
6298
6299 solaris*)
6300 lt_cv_deplibs_check_method=pass_all
6301 ;;
6302
6303 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
6304 lt_cv_deplibs_check_method=pass_all
6305 ;;
6306
6307 sysv4 | sysv4.3*)
6308 case $host_vendor in
6309 motorola)
6310 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]'
6311 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
6312 ;;
6313 ncr)
6314 lt_cv_deplibs_check_method=pass_all
6315 ;;
6316 sequent)
6317 lt_cv_file_magic_cmd='/bin/file'
6318 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
6319 ;;
6320 sni)
6321 lt_cv_file_magic_cmd='/bin/file'
6322 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
6323 lt_cv_file_magic_test_file=/lib/libc.so
6324 ;;
6325 siemens)
6326 lt_cv_deplibs_check_method=pass_all
6327 ;;
6328 pc)
6329 lt_cv_deplibs_check_method=pass_all
6330 ;;
6331 esac
6332 ;;
6333
6334 tpf*)
6335 lt_cv_deplibs_check_method=pass_all
6336 ;;
6337 esac
6338
6339 fi
6340 { $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
6341 $as_echo "$lt_cv_deplibs_check_method" >&6; }
6342 file_magic_cmd=$lt_cv_file_magic_cmd
6343 deplibs_check_method=$lt_cv_deplibs_check_method
6344 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357 if test -n "$ac_tool_prefix"; then
6358 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6359 set dummy ${ac_tool_prefix}ar; ac_word=$2
6360 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6361 $as_echo_n "checking for $ac_word... " >&6; }
6362 if test "${ac_cv_prog_AR+set}" = set; then
6363 $as_echo_n "(cached) " >&6
6364 else
6365 if test -n "$AR"; then
6366 ac_cv_prog_AR="$AR" # Let the user override the test.
6367 else
6368 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6369 for as_dir in $PATH
6370 do
6371 IFS=$as_save_IFS
6372 test -z "$as_dir" && as_dir=.
6373 for ac_exec_ext in '' $ac_executable_extensions; do
6374 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6375 ac_cv_prog_AR="${ac_tool_prefix}ar"
6376 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6377 break 2
6378 fi
6379 done
6380 done
6381 IFS=$as_save_IFS
6382
6383 fi
6384 fi
6385 AR=$ac_cv_prog_AR
6386 if test -n "$AR"; then
6387 { $as_echo "$as_me:$LINENO: result: $AR" >&5
6388 $as_echo "$AR" >&6; }
6389 else
6390 { $as_echo "$as_me:$LINENO: result: no" >&5
6391 $as_echo "no" >&6; }
6392 fi
6393
6394
6395 fi
6396 if test -z "$ac_cv_prog_AR"; then
6397 ac_ct_AR=$AR
6398 # Extract the first word of "ar", so it can be a program name with args.
6399 set dummy ar; ac_word=$2
6400 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6401 $as_echo_n "checking for $ac_word... " >&6; }
6402 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
6403 $as_echo_n "(cached) " >&6
6404 else
6405 if test -n "$ac_ct_AR"; then
6406 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
6407 else
6408 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6409 for as_dir in $PATH
6410 do
6411 IFS=$as_save_IFS
6412 test -z "$as_dir" && as_dir=.
6413 for ac_exec_ext in '' $ac_executable_extensions; do
6414 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6415 ac_cv_prog_ac_ct_AR="ar"
6416 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6417 break 2
6418 fi
6419 done
6420 done
6421 IFS=$as_save_IFS
6422
6423 fi
6424 fi
6425 ac_ct_AR=$ac_cv_prog_ac_ct_AR
6426 if test -n "$ac_ct_AR"; then
6427 { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
6428 $as_echo "$ac_ct_AR" >&6; }
6429 else
6430 { $as_echo "$as_me:$LINENO: result: no" >&5
6431 $as_echo "no" >&6; }
6432 fi
6433
6434 if test "x$ac_ct_AR" = x; then
6435 AR="false"
6436 else
6437 case $cross_compiling:$ac_tool_warned in
6438 yes:)
6439 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
6440 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6441 ac_tool_warned=yes ;;
6442 esac
6443 AR=$ac_ct_AR
6444 fi
6445 else
6446 AR="$ac_cv_prog_AR"
6447 fi
6448
6449 test -z "$AR" && AR=ar
6450 test -z "$AR_FLAGS" && AR_FLAGS=cru
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462 if test -n "$ac_tool_prefix"; then
6463 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
6464 set dummy ${ac_tool_prefix}strip; ac_word=$2
6465 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6466 $as_echo_n "checking for $ac_word... " >&6; }
6467 if test "${ac_cv_prog_STRIP+set}" = set; then
6468 $as_echo_n "(cached) " >&6
6469 else
6470 if test -n "$STRIP"; then
6471 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
6472 else
6473 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6474 for as_dir in $PATH
6475 do
6476 IFS=$as_save_IFS
6477 test -z "$as_dir" && as_dir=.
6478 for ac_exec_ext in '' $ac_executable_extensions; do
6479 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6480 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6481 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6482 break 2
6483 fi
6484 done
6485 done
6486 IFS=$as_save_IFS
6487
6488 fi
6489 fi
6490 STRIP=$ac_cv_prog_STRIP
6491 if test -n "$STRIP"; then
6492 { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
6493 $as_echo "$STRIP" >&6; }
6494 else
6495 { $as_echo "$as_me:$LINENO: result: no" >&5
6496 $as_echo "no" >&6; }
6497 fi
6498
6499
6500 fi
6501 if test -z "$ac_cv_prog_STRIP"; then
6502 ac_ct_STRIP=$STRIP
6503 # Extract the first word of "strip", so it can be a program name with args.
6504 set dummy strip; ac_word=$2
6505 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6506 $as_echo_n "checking for $ac_word... " >&6; }
6507 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
6508 $as_echo_n "(cached) " >&6
6509 else
6510 if test -n "$ac_ct_STRIP"; then
6511 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
6512 else
6513 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6514 for as_dir in $PATH
6515 do
6516 IFS=$as_save_IFS
6517 test -z "$as_dir" && as_dir=.
6518 for ac_exec_ext in '' $ac_executable_extensions; do
6519 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6520 ac_cv_prog_ac_ct_STRIP="strip"
6521 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6522 break 2
6523 fi
6524 done
6525 done
6526 IFS=$as_save_IFS
6527
6528 fi
6529 fi
6530 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
6531 if test -n "$ac_ct_STRIP"; then
6532 { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
6533 $as_echo "$ac_ct_STRIP" >&6; }
6534 else
6535 { $as_echo "$as_me:$LINENO: result: no" >&5
6536 $as_echo "no" >&6; }
6537 fi
6538
6539 if test "x$ac_ct_STRIP" = x; then
6540 STRIP=":"
6541 else
6542 case $cross_compiling:$ac_tool_warned in
6543 yes:)
6544 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
6545 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6546 ac_tool_warned=yes ;;
6547 esac
6548 STRIP=$ac_ct_STRIP
6549 fi
6550 else
6551 STRIP="$ac_cv_prog_STRIP"
6552 fi
6553
6554 test -z "$STRIP" && STRIP=:
6555
6556
6557
6558
6559
6560
6561 if test -n "$ac_tool_prefix"; then
6562 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6563 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6564 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6565 $as_echo_n "checking for $ac_word... " >&6; }
6566 if test "${ac_cv_prog_RANLIB+set}" = set; then
6567 $as_echo_n "(cached) " >&6
6568 else
6569 if test -n "$RANLIB"; then
6570 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6571 else
6572 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6573 for as_dir in $PATH
6574 do
6575 IFS=$as_save_IFS
6576 test -z "$as_dir" && as_dir=.
6577 for ac_exec_ext in '' $ac_executable_extensions; do
6578 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6579 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6580 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6581 break 2
6582 fi
6583 done
6584 done
6585 IFS=$as_save_IFS
6586
6587 fi
6588 fi
6589 RANLIB=$ac_cv_prog_RANLIB
6590 if test -n "$RANLIB"; then
6591 { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
6592 $as_echo "$RANLIB" >&6; }
6593 else
6594 { $as_echo "$as_me:$LINENO: result: no" >&5
6595 $as_echo "no" >&6; }
6596 fi
6597
6598
6599 fi
6600 if test -z "$ac_cv_prog_RANLIB"; then
6601 ac_ct_RANLIB=$RANLIB
6602 # Extract the first word of "ranlib", so it can be a program name with args.
6603 set dummy ranlib; ac_word=$2
6604 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
6605 $as_echo_n "checking for $ac_word... " >&6; }
6606 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
6607 $as_echo_n "(cached) " >&6
6608 else
6609 if test -n "$ac_ct_RANLIB"; then
6610 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6611 else
6612 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6613 for as_dir in $PATH
6614 do
6615 IFS=$as_save_IFS
6616 test -z "$as_dir" && as_dir=.
6617 for ac_exec_ext in '' $ac_executable_extensions; do
6618 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6619 ac_cv_prog_ac_ct_RANLIB="ranlib"
6620 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
6621 break 2
6622 fi
6623 done
6624 done
6625 IFS=$as_save_IFS
6626
6627 fi
6628 fi
6629 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6630 if test -n "$ac_ct_RANLIB"; then
6631 { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
6632 $as_echo "$ac_ct_RANLIB" >&6; }
6633 else
6634 { $as_echo "$as_me:$LINENO: result: no" >&5
6635 $as_echo "no" >&6; }
6636 fi
6637
6638 if test "x$ac_ct_RANLIB" = x; then
6639 RANLIB=":"
6640 else
6641 case $cross_compiling:$ac_tool_warned in
6642 yes:)
6643 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
6644 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6645 ac_tool_warned=yes ;;
6646 esac
6647 RANLIB=$ac_ct_RANLIB
6648 fi
6649 else
6650 RANLIB="$ac_cv_prog_RANLIB"
6651 fi
6652
6653 test -z "$RANLIB" && RANLIB=:
6654
6655
6656
6657
6658
6659
6660 # Determine commands to create old-style static archives.
6661 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
6662 old_postinstall_cmds='chmod 644 $oldlib'
6663 old_postuninstall_cmds=
6664
6665 if test -n "$RANLIB"; then
6666 case $host_os in
6667 openbsd*)
6668 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
6669 ;;
6670 *)
6671 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
6672 ;;
6673 esac
6674 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
6675 fi
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710 # If no C compiler was specified, use CC.
6711 LTCC=${LTCC-"$CC"}
6712
6713 # If no C compiler flags were specified, use CFLAGS.
6714 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
6715
6716 # Allow CC to be a program name with arguments.
6717 compiler=$CC
6718
6719
6720 # Check for command to grab the raw symbol name followed by C symbol from nm.
6721 { $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
6722 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
6723 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
6724 $as_echo_n "(cached) " >&6
6725 else
6726
6727 # These are sane defaults that work on at least a few old systems.
6728 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
6729
6730 # Character class describing NM global symbol codes.
6731 symcode='[BCDEGRST]'
6732
6733 # Regexp to match symbols that can be accessed directly from C.
6734 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
6735
6736 # Define system-specific variables.
6737 case $host_os in
6738 aix*)
6739 symcode='[BCDT]'
6740 ;;
6741 cygwin* | mingw* | pw32* | cegcc*)
6742 symcode='[ABCDGISTW]'
6743 ;;
6744 hpux*)
6745 if test "$host_cpu" = ia64; then
6746 symcode='[ABCDEGRST]'
6747 fi
6748 ;;
6749 irix* | nonstopux*)
6750 symcode='[BCDEGRST]'
6751 ;;
6752 osf*)
6753 symcode='[BCDEGQRST]'
6754 ;;
6755 solaris*)
6756 symcode='[BDRT]'
6757 ;;
6758 sco3.2v5*)
6759 symcode='[DT]'
6760 ;;
6761 sysv4.2uw2*)
6762 symcode='[DT]'
6763 ;;
6764 sysv5* | sco5v6* | unixware* | OpenUNIX*)
6765 symcode='[ABDT]'
6766 ;;
6767 sysv4)
6768 symcode='[DFNSTU]'
6769 ;;
6770 esac
6771
6772 # If we're using GNU nm, then use its standard symbol codes.
6773 case `$NM -V 2>&1` in
6774 *GNU* | *'with BFD'*)
6775 symcode='[ABCDGIRSTW]' ;;
6776 esac
6777
6778 # Transform an extracted symbol line into a proper C declaration.
6779 # Some systems (esp. on ia64) link data and code symbols differently,
6780 # so use this general approach.
6781 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
6782
6783 # Transform an extracted symbol line into symbol name and symbol address
6784 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
6785 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'"
6786
6787 # Handle CRLF in mingw tool chain
6788 opt_cr=
6789 case $build_os in
6790 mingw*)
6791 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
6792 ;;
6793 esac
6794
6795 # Try without a prefix underscore, then with it.
6796 for ac_symprfx in "" "_"; do
6797
6798 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
6799 symxfrm="\\1 $ac_symprfx\\2 \\2"
6800
6801 # Write the raw and C identifiers.
6802 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6803 # Fake it for dumpbin and say T for any non-static function
6804 # and D for any global variable.
6805 # Also find C++ and __fastcall symbols from MSVC++,
6806 # which start with @ or ?.
6807 lt_cv_sys_global_symbol_pipe="$AWK '"\
6808 " {last_section=section; section=\$ 3};"\
6809 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
6810 " \$ 0!~/External *\|/{next};"\
6811 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
6812 " {if(hide[section]) next};"\
6813 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
6814 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
6815 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
6816 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
6817 " ' prfx=^$ac_symprfx"
6818 else
6819 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
6820 fi
6821
6822 # Check to see that the pipe works correctly.
6823 pipe_works=no
6824
6825 rm -f conftest*
6826 cat > conftest.$ac_ext <<_LT_EOF
6827 #ifdef __cplusplus
6828 extern "C" {
6829 #endif
6830 char nm_test_var;
6831 void nm_test_func(void);
6832 void nm_test_func(void){}
6833 #ifdef __cplusplus
6834 }
6835 #endif
6836 int main(){nm_test_var='a';nm_test_func();return(0);}
6837 _LT_EOF
6838
6839 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
6840 (eval $ac_compile) 2>&5
6841 ac_status=$?
6842 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6843 (exit $ac_status); }; then
6844 # Now try to grab the symbols.
6845 nlist=conftest.nm
6846 if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
6847 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
6848 ac_status=$?
6849 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6850 (exit $ac_status); } && test -s "$nlist"; then
6851 # Try sorting and uniquifying the output.
6852 if sort "$nlist" | uniq > "$nlist"T; then
6853 mv -f "$nlist"T "$nlist"
6854 else
6855 rm -f "$nlist"T
6856 fi
6857
6858 # Make sure that we snagged all the symbols we need.
6859 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
6860 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
6861 cat <<_LT_EOF > conftest.$ac_ext
6862 #ifdef __cplusplus
6863 extern "C" {
6864 #endif
6865
6866 _LT_EOF
6867 # Now generate the symbol file.
6868 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
6869
6870 cat <<_LT_EOF >> conftest.$ac_ext
6871
6872 /* The mapping between symbol names and symbols. */
6873 const struct {
6874 const char *name;
6875 void *address;
6876 }
6877 lt__PROGRAM__LTX_preloaded_symbols[] =
6878 {
6879 { "@PROGRAM@", (void *) 0 },
6880 _LT_EOF
6881 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
6882 cat <<\_LT_EOF >> conftest.$ac_ext
6883 {0, (void *) 0}
6884 };
6885
6886 /* This works around a problem in FreeBSD linker */
6887 #ifdef FREEBSD_WORKAROUND
6888 static const void *lt_preloaded_setup() {
6889 return lt__PROGRAM__LTX_preloaded_symbols;
6890 }
6891 #endif
6892
6893 #ifdef __cplusplus
6894 }
6895 #endif
6896 _LT_EOF
6897 # Now try linking the two files.
6898 mv conftest.$ac_objext conftstm.$ac_objext
6899 lt_save_LIBS="$LIBS"
6900 lt_save_CFLAGS="$CFLAGS"
6901 LIBS="conftstm.$ac_objext"
6902 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
6903 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
6904 (eval $ac_link) 2>&5
6905 ac_status=$?
6906 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6907 (exit $ac_status); } && test -s conftest${ac_exeext}; then
6908 pipe_works=yes
6909 fi
6910 LIBS="$lt_save_LIBS"
6911 CFLAGS="$lt_save_CFLAGS"
6912 else
6913 echo "cannot find nm_test_func in $nlist" >&5
6914 fi
6915 else
6916 echo "cannot find nm_test_var in $nlist" >&5
6917 fi
6918 else
6919 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
6920 fi
6921 else
6922 echo "$progname: failed program was:" >&5
6923 cat conftest.$ac_ext >&5
6924 fi
6925 rm -rf conftest* conftst*
6926
6927 # Do not use the global_symbol_pipe unless it works.
6928 if test "$pipe_works" = yes; then
6929 break
6930 else
6931 lt_cv_sys_global_symbol_pipe=
6932 fi
6933 done
6934
6935 fi
6936
6937 if test -z "$lt_cv_sys_global_symbol_pipe"; then
6938 lt_cv_sys_global_symbol_to_cdecl=
6939 fi
6940 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
6941 { $as_echo "$as_me:$LINENO: result: failed" >&5
6942 $as_echo "failed" >&6; }
6943 else
6944 { $as_echo "$as_me:$LINENO: result: ok" >&5
6945 $as_echo "ok" >&6; }
6946 fi
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969 # Check whether --enable-libtool-lock was given.
6970 if test "${enable_libtool_lock+set}" = set; then
6971 enableval=$enable_libtool_lock;
6972 fi
6973
6974 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6975
6976 # Some flags need to be propagated to the compiler or linker for good
6977 # libtool support.
6978 case $host in
6979 ia64-*-hpux*)
6980 # Find out which ABI we are using.
6981 echo 'int i;' > conftest.$ac_ext
6982 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
6983 (eval $ac_compile) 2>&5
6984 ac_status=$?
6985 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6986 (exit $ac_status); }; then
6987 case `/usr/bin/file conftest.$ac_objext` in
6988 *ELF-32*)
6989 HPUX_IA64_MODE="32"
6990 ;;
6991 *ELF-64*)
6992 HPUX_IA64_MODE="64"
6993 ;;
6994 esac
6995 fi
6996 rm -rf conftest*
6997 ;;
6998 *-*-irix6*)
6999 # Find out which ABI we are using.
7000 echo '#line 7001 "configure"' > conftest.$ac_ext
7001 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
7002 (eval $ac_compile) 2>&5
7003 ac_status=$?
7004 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7005 (exit $ac_status); }; then
7006 if test "$lt_cv_prog_gnu_ld" = yes; then
7007 case `/usr/bin/file conftest.$ac_objext` in
7008 *32-bit*)
7009 LD="${LD-ld} -melf32bsmip"
7010 ;;
7011 *N32*)
7012 LD="${LD-ld} -melf32bmipn32"
7013 ;;
7014 *64-bit*)
7015 LD="${LD-ld} -melf64bmip"
7016 ;;
7017 esac
7018 else
7019 case `/usr/bin/file conftest.$ac_objext` in
7020 *32-bit*)
7021 LD="${LD-ld} -32"
7022 ;;
7023 *N32*)
7024 LD="${LD-ld} -n32"
7025 ;;
7026 *64-bit*)
7027 LD="${LD-ld} -64"
7028 ;;
7029 esac
7030 fi
7031 fi
7032 rm -rf conftest*
7033 ;;
7034
7035 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
7036 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
7037 # Find out which ABI we are using.
7038 echo 'int i;' > conftest.$ac_ext
7039 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
7040 (eval $ac_compile) 2>&5
7041 ac_status=$?
7042 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7043 (exit $ac_status); }; then
7044 case `/usr/bin/file conftest.o` in
7045 *32-bit*)
7046 case $host in
7047 x86_64-*kfreebsd*-gnu)
7048 LD="${LD-ld} -m elf_i386_fbsd"
7049 ;;
7050 x86_64-*linux*)
7051 LD="${LD-ld} -m elf_i386"
7052 ;;
7053 ppc64-*linux*|powerpc64-*linux*)
7054 LD="${LD-ld} -m elf32ppclinux"
7055 ;;
7056 s390x-*linux*)
7057 LD="${LD-ld} -m elf_s390"
7058 ;;
7059 sparc64-*linux*)
7060 LD="${LD-ld} -m elf32_sparc"
7061 ;;
7062 esac
7063 ;;
7064 *64-bit*)
7065 case $host in
7066 x86_64-*kfreebsd*-gnu)
7067 LD="${LD-ld} -m elf_x86_64_fbsd"
7068 ;;
7069 x86_64-*linux*)
7070 LD="${LD-ld} -m elf_x86_64"
7071 ;;
7072 ppc*-*linux*|powerpc*-*linux*)
7073 LD="${LD-ld} -m elf64ppc"
7074 ;;
7075 s390*-*linux*|s390*-*tpf*)
7076 LD="${LD-ld} -m elf64_s390"
7077 ;;
7078 sparc*-*linux*)
7079 LD="${LD-ld} -m elf64_sparc"
7080 ;;
7081 esac
7082 ;;
7083 esac
7084 fi
7085 rm -rf conftest*
7086 ;;
7087
7088 *-*-sco3.2v5*)
7089 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
7090 SAVE_CFLAGS="$CFLAGS"
7091 CFLAGS="$CFLAGS -belf"
7092 { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
7093 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
7094 if test "${lt_cv_cc_needs_belf+set}" = set; then
7095 $as_echo_n "(cached) " >&6
7096 else
7097 ac_ext=c
7098 ac_cpp='$CPP $CPPFLAGS'
7099 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7100 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7101 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7102
7103 cat >conftest.$ac_ext <<_ACEOF
7104 /* confdefs.h. */
7105 _ACEOF
7106 cat confdefs.h >>conftest.$ac_ext
7107 cat >>conftest.$ac_ext <<_ACEOF
7108 /* end confdefs.h. */
7109
7110 int
7111 main ()
7112 {
7113
7114 ;
7115 return 0;
7116 }
7117 _ACEOF
7118 rm -f conftest.$ac_objext conftest$ac_exeext
7119 if { (ac_try="$ac_link"
7120 case "(($ac_try" in
7121 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7122 *) ac_try_echo=$ac_try;;
7123 esac
7124 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7125 $as_echo "$ac_try_echo") >&5
7126 (eval "$ac_link") 2>conftest.er1
7127 ac_status=$?
7128 grep -v '^ *+' conftest.er1 >conftest.err
7129 rm -f conftest.er1
7130 cat conftest.err >&5
7131 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7132 (exit $ac_status); } && {
7133 test -z "$ac_c_werror_flag" ||
7134 test ! -s conftest.err
7135 } && test -s conftest$ac_exeext && {
7136 test "$cross_compiling" = yes ||
7137 $as_test_x conftest$ac_exeext
7138 }; then
7139 lt_cv_cc_needs_belf=yes
7140 else
7141 $as_echo "$as_me: failed program was:" >&5
7142 sed 's/^/| /' conftest.$ac_ext >&5
7143
7144 lt_cv_cc_needs_belf=no
7145 fi
7146
7147 rm -rf conftest.dSYM
7148 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7149 conftest$ac_exeext conftest.$ac_ext
7150 ac_ext=c
7151 ac_cpp='$CPP $CPPFLAGS'
7152 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7153 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7154 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7155
7156 fi
7157 { $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
7158 $as_echo "$lt_cv_cc_needs_belf" >&6; }
7159 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
7160 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
7161 CFLAGS="$SAVE_CFLAGS"
7162 fi
7163 ;;
7164 sparc*-*solaris*)
7165 # Find out which ABI we are using.
7166 echo 'int i;' > conftest.$ac_ext
7167 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
7168 (eval $ac_compile) 2>&5
7169 ac_status=$?
7170 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7171 (exit $ac_status); }; then
7172 case `/usr/bin/file conftest.o` in
7173 *64-bit*)
7174 case $lt_cv_prog_gnu_ld in
7175 yes*) LD="${LD-ld} -m elf64_sparc" ;;
7176 *)
7177 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
7178 LD="${LD-ld} -64"
7179 fi
7180 ;;
7181 esac
7182 ;;
7183 esac
7184 fi
7185 rm -rf conftest*
7186 ;;
7187 esac
7188
7189 need_locks="$enable_libtool_lock"
7190
7191
7192 case $host_os in
7193 rhapsody* | darwin*)
7194 if test -n "$ac_tool_prefix"; then
7195 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
7196 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
7197 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7198 $as_echo_n "checking for $ac_word... " >&6; }
7199 if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
7200 $as_echo_n "(cached) " >&6
7201 else
7202 if test -n "$DSYMUTIL"; then
7203 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
7204 else
7205 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7206 for as_dir in $PATH
7207 do
7208 IFS=$as_save_IFS
7209 test -z "$as_dir" && as_dir=.
7210 for ac_exec_ext in '' $ac_executable_extensions; do
7211 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7212 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
7213 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7214 break 2
7215 fi
7216 done
7217 done
7218 IFS=$as_save_IFS
7219
7220 fi
7221 fi
7222 DSYMUTIL=$ac_cv_prog_DSYMUTIL
7223 if test -n "$DSYMUTIL"; then
7224 { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
7225 $as_echo "$DSYMUTIL" >&6; }
7226 else
7227 { $as_echo "$as_me:$LINENO: result: no" >&5
7228 $as_echo "no" >&6; }
7229 fi
7230
7231
7232 fi
7233 if test -z "$ac_cv_prog_DSYMUTIL"; then
7234 ac_ct_DSYMUTIL=$DSYMUTIL
7235 # Extract the first word of "dsymutil", so it can be a program name with args.
7236 set dummy dsymutil; ac_word=$2
7237 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7238 $as_echo_n "checking for $ac_word... " >&6; }
7239 if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
7240 $as_echo_n "(cached) " >&6
7241 else
7242 if test -n "$ac_ct_DSYMUTIL"; then
7243 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
7244 else
7245 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7246 for as_dir in $PATH
7247 do
7248 IFS=$as_save_IFS
7249 test -z "$as_dir" && as_dir=.
7250 for ac_exec_ext in '' $ac_executable_extensions; do
7251 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7252 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
7253 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7254 break 2
7255 fi
7256 done
7257 done
7258 IFS=$as_save_IFS
7259
7260 fi
7261 fi
7262 ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
7263 if test -n "$ac_ct_DSYMUTIL"; then
7264 { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
7265 $as_echo "$ac_ct_DSYMUTIL" >&6; }
7266 else
7267 { $as_echo "$as_me:$LINENO: result: no" >&5
7268 $as_echo "no" >&6; }
7269 fi
7270
7271 if test "x$ac_ct_DSYMUTIL" = x; then
7272 DSYMUTIL=":"
7273 else
7274 case $cross_compiling:$ac_tool_warned in
7275 yes:)
7276 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
7277 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7278 ac_tool_warned=yes ;;
7279 esac
7280 DSYMUTIL=$ac_ct_DSYMUTIL
7281 fi
7282 else
7283 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
7284 fi
7285
7286 if test -n "$ac_tool_prefix"; then
7287 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
7288 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
7289 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7290 $as_echo_n "checking for $ac_word... " >&6; }
7291 if test "${ac_cv_prog_NMEDIT+set}" = set; then
7292 $as_echo_n "(cached) " >&6
7293 else
7294 if test -n "$NMEDIT"; then
7295 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
7296 else
7297 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7298 for as_dir in $PATH
7299 do
7300 IFS=$as_save_IFS
7301 test -z "$as_dir" && as_dir=.
7302 for ac_exec_ext in '' $ac_executable_extensions; do
7303 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7304 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
7305 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7306 break 2
7307 fi
7308 done
7309 done
7310 IFS=$as_save_IFS
7311
7312 fi
7313 fi
7314 NMEDIT=$ac_cv_prog_NMEDIT
7315 if test -n "$NMEDIT"; then
7316 { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
7317 $as_echo "$NMEDIT" >&6; }
7318 else
7319 { $as_echo "$as_me:$LINENO: result: no" >&5
7320 $as_echo "no" >&6; }
7321 fi
7322
7323
7324 fi
7325 if test -z "$ac_cv_prog_NMEDIT"; then
7326 ac_ct_NMEDIT=$NMEDIT
7327 # Extract the first word of "nmedit", so it can be a program name with args.
7328 set dummy nmedit; ac_word=$2
7329 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7330 $as_echo_n "checking for $ac_word... " >&6; }
7331 if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
7332 $as_echo_n "(cached) " >&6
7333 else
7334 if test -n "$ac_ct_NMEDIT"; then
7335 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
7336 else
7337 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7338 for as_dir in $PATH
7339 do
7340 IFS=$as_save_IFS
7341 test -z "$as_dir" && as_dir=.
7342 for ac_exec_ext in '' $ac_executable_extensions; do
7343 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7344 ac_cv_prog_ac_ct_NMEDIT="nmedit"
7345 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7346 break 2
7347 fi
7348 done
7349 done
7350 IFS=$as_save_IFS
7351
7352 fi
7353 fi
7354 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
7355 if test -n "$ac_ct_NMEDIT"; then
7356 { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
7357 $as_echo "$ac_ct_NMEDIT" >&6; }
7358 else
7359 { $as_echo "$as_me:$LINENO: result: no" >&5
7360 $as_echo "no" >&6; }
7361 fi
7362
7363 if test "x$ac_ct_NMEDIT" = x; then
7364 NMEDIT=":"
7365 else
7366 case $cross_compiling:$ac_tool_warned in
7367 yes:)
7368 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
7369 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7370 ac_tool_warned=yes ;;
7371 esac
7372 NMEDIT=$ac_ct_NMEDIT
7373 fi
7374 else
7375 NMEDIT="$ac_cv_prog_NMEDIT"
7376 fi
7377
7378 if test -n "$ac_tool_prefix"; then
7379 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
7380 set dummy ${ac_tool_prefix}lipo; ac_word=$2
7381 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7382 $as_echo_n "checking for $ac_word... " >&6; }
7383 if test "${ac_cv_prog_LIPO+set}" = set; then
7384 $as_echo_n "(cached) " >&6
7385 else
7386 if test -n "$LIPO"; then
7387 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
7388 else
7389 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7390 for as_dir in $PATH
7391 do
7392 IFS=$as_save_IFS
7393 test -z "$as_dir" && as_dir=.
7394 for ac_exec_ext in '' $ac_executable_extensions; do
7395 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7396 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
7397 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7398 break 2
7399 fi
7400 done
7401 done
7402 IFS=$as_save_IFS
7403
7404 fi
7405 fi
7406 LIPO=$ac_cv_prog_LIPO
7407 if test -n "$LIPO"; then
7408 { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
7409 $as_echo "$LIPO" >&6; }
7410 else
7411 { $as_echo "$as_me:$LINENO: result: no" >&5
7412 $as_echo "no" >&6; }
7413 fi
7414
7415
7416 fi
7417 if test -z "$ac_cv_prog_LIPO"; then
7418 ac_ct_LIPO=$LIPO
7419 # Extract the first word of "lipo", so it can be a program name with args.
7420 set dummy lipo; ac_word=$2
7421 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7422 $as_echo_n "checking for $ac_word... " >&6; }
7423 if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
7424 $as_echo_n "(cached) " >&6
7425 else
7426 if test -n "$ac_ct_LIPO"; then
7427 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
7428 else
7429 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7430 for as_dir in $PATH
7431 do
7432 IFS=$as_save_IFS
7433 test -z "$as_dir" && as_dir=.
7434 for ac_exec_ext in '' $ac_executable_extensions; do
7435 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7436 ac_cv_prog_ac_ct_LIPO="lipo"
7437 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7438 break 2
7439 fi
7440 done
7441 done
7442 IFS=$as_save_IFS
7443
7444 fi
7445 fi
7446 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
7447 if test -n "$ac_ct_LIPO"; then
7448 { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
7449 $as_echo "$ac_ct_LIPO" >&6; }
7450 else
7451 { $as_echo "$as_me:$LINENO: result: no" >&5
7452 $as_echo "no" >&6; }
7453 fi
7454
7455 if test "x$ac_ct_LIPO" = x; then
7456 LIPO=":"
7457 else
7458 case $cross_compiling:$ac_tool_warned in
7459 yes:)
7460 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
7461 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7462 ac_tool_warned=yes ;;
7463 esac
7464 LIPO=$ac_ct_LIPO
7465 fi
7466 else
7467 LIPO="$ac_cv_prog_LIPO"
7468 fi
7469
7470 if test -n "$ac_tool_prefix"; then
7471 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
7472 set dummy ${ac_tool_prefix}otool; ac_word=$2
7473 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7474 $as_echo_n "checking for $ac_word... " >&6; }
7475 if test "${ac_cv_prog_OTOOL+set}" = set; then
7476 $as_echo_n "(cached) " >&6
7477 else
7478 if test -n "$OTOOL"; then
7479 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
7480 else
7481 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7482 for as_dir in $PATH
7483 do
7484 IFS=$as_save_IFS
7485 test -z "$as_dir" && as_dir=.
7486 for ac_exec_ext in '' $ac_executable_extensions; do
7487 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7488 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
7489 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7490 break 2
7491 fi
7492 done
7493 done
7494 IFS=$as_save_IFS
7495
7496 fi
7497 fi
7498 OTOOL=$ac_cv_prog_OTOOL
7499 if test -n "$OTOOL"; then
7500 { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
7501 $as_echo "$OTOOL" >&6; }
7502 else
7503 { $as_echo "$as_me:$LINENO: result: no" >&5
7504 $as_echo "no" >&6; }
7505 fi
7506
7507
7508 fi
7509 if test -z "$ac_cv_prog_OTOOL"; then
7510 ac_ct_OTOOL=$OTOOL
7511 # Extract the first word of "otool", so it can be a program name with args.
7512 set dummy otool; ac_word=$2
7513 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7514 $as_echo_n "checking for $ac_word... " >&6; }
7515 if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
7516 $as_echo_n "(cached) " >&6
7517 else
7518 if test -n "$ac_ct_OTOOL"; then
7519 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
7520 else
7521 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7522 for as_dir in $PATH
7523 do
7524 IFS=$as_save_IFS
7525 test -z "$as_dir" && as_dir=.
7526 for ac_exec_ext in '' $ac_executable_extensions; do
7527 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7528 ac_cv_prog_ac_ct_OTOOL="otool"
7529 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7530 break 2
7531 fi
7532 done
7533 done
7534 IFS=$as_save_IFS
7535
7536 fi
7537 fi
7538 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
7539 if test -n "$ac_ct_OTOOL"; then
7540 { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
7541 $as_echo "$ac_ct_OTOOL" >&6; }
7542 else
7543 { $as_echo "$as_me:$LINENO: result: no" >&5
7544 $as_echo "no" >&6; }
7545 fi
7546
7547 if test "x$ac_ct_OTOOL" = x; then
7548 OTOOL=":"
7549 else
7550 case $cross_compiling:$ac_tool_warned in
7551 yes:)
7552 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
7553 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7554 ac_tool_warned=yes ;;
7555 esac
7556 OTOOL=$ac_ct_OTOOL
7557 fi
7558 else
7559 OTOOL="$ac_cv_prog_OTOOL"
7560 fi
7561
7562 if test -n "$ac_tool_prefix"; then
7563 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
7564 set dummy ${ac_tool_prefix}otool64; ac_word=$2
7565 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7566 $as_echo_n "checking for $ac_word... " >&6; }
7567 if test "${ac_cv_prog_OTOOL64+set}" = set; then
7568 $as_echo_n "(cached) " >&6
7569 else
7570 if test -n "$OTOOL64"; then
7571 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
7572 else
7573 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7574 for as_dir in $PATH
7575 do
7576 IFS=$as_save_IFS
7577 test -z "$as_dir" && as_dir=.
7578 for ac_exec_ext in '' $ac_executable_extensions; do
7579 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7580 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
7581 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7582 break 2
7583 fi
7584 done
7585 done
7586 IFS=$as_save_IFS
7587
7588 fi
7589 fi
7590 OTOOL64=$ac_cv_prog_OTOOL64
7591 if test -n "$OTOOL64"; then
7592 { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
7593 $as_echo "$OTOOL64" >&6; }
7594 else
7595 { $as_echo "$as_me:$LINENO: result: no" >&5
7596 $as_echo "no" >&6; }
7597 fi
7598
7599
7600 fi
7601 if test -z "$ac_cv_prog_OTOOL64"; then
7602 ac_ct_OTOOL64=$OTOOL64
7603 # Extract the first word of "otool64", so it can be a program name with args.
7604 set dummy otool64; ac_word=$2
7605 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7606 $as_echo_n "checking for $ac_word... " >&6; }
7607 if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
7608 $as_echo_n "(cached) " >&6
7609 else
7610 if test -n "$ac_ct_OTOOL64"; then
7611 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
7612 else
7613 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7614 for as_dir in $PATH
7615 do
7616 IFS=$as_save_IFS
7617 test -z "$as_dir" && as_dir=.
7618 for ac_exec_ext in '' $ac_executable_extensions; do
7619 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7620 ac_cv_prog_ac_ct_OTOOL64="otool64"
7621 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7622 break 2
7623 fi
7624 done
7625 done
7626 IFS=$as_save_IFS
7627
7628 fi
7629 fi
7630 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
7631 if test -n "$ac_ct_OTOOL64"; then
7632 { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
7633 $as_echo "$ac_ct_OTOOL64" >&6; }
7634 else
7635 { $as_echo "$as_me:$LINENO: result: no" >&5
7636 $as_echo "no" >&6; }
7637 fi
7638
7639 if test "x$ac_ct_OTOOL64" = x; then
7640 OTOOL64=":"
7641 else
7642 case $cross_compiling:$ac_tool_warned in
7643 yes:)
7644 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
7645 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7646 ac_tool_warned=yes ;;
7647 esac
7648 OTOOL64=$ac_ct_OTOOL64
7649 fi
7650 else
7651 OTOOL64="$ac_cv_prog_OTOOL64"
7652 fi
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680 { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
7681 $as_echo_n "checking for -single_module linker flag... " >&6; }
7682 if test "${lt_cv_apple_cc_single_mod+set}" = set; then
7683 $as_echo_n "(cached) " >&6
7684 else
7685 lt_cv_apple_cc_single_mod=no
7686 if test -z "${LT_MULTI_MODULE}"; then
7687 # By default we will add the -single_module flag. You can override
7688 # by either setting the environment variable LT_MULTI_MODULE
7689 # non-empty at configure time, or by adding -multi_module to the
7690 # link flags.
7691 rm -rf libconftest.dylib*
7692 echo "int foo(void){return 1;}" > conftest.c
7693 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7694 -dynamiclib -Wl,-single_module conftest.c" >&5
7695 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7696 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
7697 _lt_result=$?
7698 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
7699 lt_cv_apple_cc_single_mod=yes
7700 else
7701 cat conftest.err >&5
7702 fi
7703 rm -rf libconftest.dylib*
7704 rm -f conftest.*
7705 fi
7706 fi
7707 { $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
7708 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
7709 { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
7710 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
7711 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
7712 $as_echo_n "(cached) " >&6
7713 else
7714 lt_cv_ld_exported_symbols_list=no
7715 save_LDFLAGS=$LDFLAGS
7716 echo "_main" > conftest.sym
7717 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
7718 cat >conftest.$ac_ext <<_ACEOF
7719 /* confdefs.h. */
7720 _ACEOF
7721 cat confdefs.h >>conftest.$ac_ext
7722 cat >>conftest.$ac_ext <<_ACEOF
7723 /* end confdefs.h. */
7724
7725 int
7726 main ()
7727 {
7728
7729 ;
7730 return 0;
7731 }
7732 _ACEOF
7733 rm -f conftest.$ac_objext conftest$ac_exeext
7734 if { (ac_try="$ac_link"
7735 case "(($ac_try" in
7736 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7737 *) ac_try_echo=$ac_try;;
7738 esac
7739 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7740 $as_echo "$ac_try_echo") >&5
7741 (eval "$ac_link") 2>conftest.er1
7742 ac_status=$?
7743 grep -v '^ *+' conftest.er1 >conftest.err
7744 rm -f conftest.er1
7745 cat conftest.err >&5
7746 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7747 (exit $ac_status); } && {
7748 test -z "$ac_c_werror_flag" ||
7749 test ! -s conftest.err
7750 } && test -s conftest$ac_exeext && {
7751 test "$cross_compiling" = yes ||
7752 $as_test_x conftest$ac_exeext
7753 }; then
7754 lt_cv_ld_exported_symbols_list=yes
7755 else
7756 $as_echo "$as_me: failed program was:" >&5
7757 sed 's/^/| /' conftest.$ac_ext >&5
7758
7759 lt_cv_ld_exported_symbols_list=no
7760 fi
7761
7762 rm -rf conftest.dSYM
7763 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
7764 conftest$ac_exeext conftest.$ac_ext
7765 LDFLAGS="$save_LDFLAGS"
7766
7767 fi
7768 { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
7769 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
7770 case $host_os in
7771 rhapsody* | darwin1.[012])
7772 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
7773 darwin1.*)
7774 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7775 darwin*) # darwin 5.x on
7776 # if running on 10.5 or later, the deployment target defaults
7777 # to the OS version, if on x86, and 10.4, the deployment
7778 # target defaults to 10.4. Don't you love it?
7779 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
7780 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
7781 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7782 10.[012]*)
7783 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7784 10.*)
7785 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7786 esac
7787 ;;
7788 esac
7789 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
7790 _lt_dar_single_mod='$single_module'
7791 fi
7792 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
7793 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
7794 else
7795 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
7796 fi
7797 if test "$DSYMUTIL" != ":"; then
7798 _lt_dsymutil='~$DSYMUTIL $lib || :'
7799 else
7800 _lt_dsymutil=
7801 fi
7802 ;;
7803 esac
7804
7805
7806 for ac_header in dlfcn.h
7807 do
7808 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7809 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
7810 $as_echo_n "checking for $ac_header... " >&6; }
7811 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
7812 $as_echo_n "(cached) " >&6
7813 else
7814 cat >conftest.$ac_ext <<_ACEOF
7815 /* confdefs.h. */
7816 _ACEOF
7817 cat confdefs.h >>conftest.$ac_ext
7818 cat >>conftest.$ac_ext <<_ACEOF
7819 /* end confdefs.h. */
7820 $ac_includes_default
7821
7822 #include <$ac_header>
7823 _ACEOF
7824 rm -f conftest.$ac_objext
7825 if { (ac_try="$ac_compile"
7826 case "(($ac_try" in
7827 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7828 *) ac_try_echo=$ac_try;;
7829 esac
7830 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7831 $as_echo "$ac_try_echo") >&5
7832 (eval "$ac_compile") 2>conftest.er1
7833 ac_status=$?
7834 grep -v '^ *+' conftest.er1 >conftest.err
7835 rm -f conftest.er1
7836 cat conftest.err >&5
7837 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7838 (exit $ac_status); } && {
7839 test -z "$ac_c_werror_flag" ||
7840 test ! -s conftest.err
7841 } && test -s conftest.$ac_objext; then
7842 eval "$as_ac_Header=yes"
7843 else
7844 $as_echo "$as_me: failed program was:" >&5
7845 sed 's/^/| /' conftest.$ac_ext >&5
7846
7847 eval "$as_ac_Header=no"
7848 fi
7849
7850 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7851 fi
7852 ac_res=`eval 'as_val=${'$as_ac_Header'}
7853 $as_echo "$as_val"'`
7854 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
7855 $as_echo "$ac_res" >&6; }
7856 as_val=`eval 'as_val=${'$as_ac_Header'}
7857 $as_echo "$as_val"'`
7858 if test "x$as_val" = x""yes; then
7859 cat >>confdefs.h <<_ACEOF
7860 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7861 _ACEOF
7862
7863 fi
7864
7865 done
7866
7867
7868
7869 ac_ext=cpp
7870 ac_cpp='$CXXCPP $CPPFLAGS'
7871 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7872 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7873 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
7874 if test -z "$CXX"; then
7875 if test -n "$CCC"; then
7876 CXX=$CCC
7877 else
7878 if test -n "$ac_tool_prefix"; then
7879 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
7880 do
7881 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7882 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7883 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7884 $as_echo_n "checking for $ac_word... " >&6; }
7885 if test "${ac_cv_prog_CXX+set}" = set; then
7886 $as_echo_n "(cached) " >&6
7887 else
7888 if test -n "$CXX"; then
7889 ac_cv_prog_CXX="$CXX" # Let the user override the test.
7890 else
7891 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7892 for as_dir in $PATH
7893 do
7894 IFS=$as_save_IFS
7895 test -z "$as_dir" && as_dir=.
7896 for ac_exec_ext in '' $ac_executable_extensions; do
7897 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7898 ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
7899 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7900 break 2
7901 fi
7902 done
7903 done
7904 IFS=$as_save_IFS
7905
7906 fi
7907 fi
7908 CXX=$ac_cv_prog_CXX
7909 if test -n "$CXX"; then
7910 { $as_echo "$as_me:$LINENO: result: $CXX" >&5
7911 $as_echo "$CXX" >&6; }
7912 else
7913 { $as_echo "$as_me:$LINENO: result: no" >&5
7914 $as_echo "no" >&6; }
7915 fi
7916
7917
7918 test -n "$CXX" && break
7919 done
7920 fi
7921 if test -z "$CXX"; then
7922 ac_ct_CXX=$CXX
7923 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
7924 do
7925 # Extract the first word of "$ac_prog", so it can be a program name with args.
7926 set dummy $ac_prog; ac_word=$2
7927 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
7928 $as_echo_n "checking for $ac_word... " >&6; }
7929 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
7930 $as_echo_n "(cached) " >&6
7931 else
7932 if test -n "$ac_ct_CXX"; then
7933 ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
7934 else
7935 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7936 for as_dir in $PATH
7937 do
7938 IFS=$as_save_IFS
7939 test -z "$as_dir" && as_dir=.
7940 for ac_exec_ext in '' $ac_executable_extensions; do
7941 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7942 ac_cv_prog_ac_ct_CXX="$ac_prog"
7943 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
7944 break 2
7945 fi
7946 done
7947 done
7948 IFS=$as_save_IFS
7949
7950 fi
7951 fi
7952 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
7953 if test -n "$ac_ct_CXX"; then
7954 { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
7955 $as_echo "$ac_ct_CXX" >&6; }
7956 else
7957 { $as_echo "$as_me:$LINENO: result: no" >&5
7958 $as_echo "no" >&6; }
7959 fi
7960
7961
7962 test -n "$ac_ct_CXX" && break
7963 done
7964
7965 if test "x$ac_ct_CXX" = x; then
7966 CXX="g++"
7967 else
7968 case $cross_compiling:$ac_tool_warned in
7969 yes:)
7970 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
7971 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7972 ac_tool_warned=yes ;;
7973 esac
7974 CXX=$ac_ct_CXX
7975 fi
7976 fi
7977
7978 fi
7979 fi
7980 # Provide some information about the compiler.
7981 $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
7982 set X $ac_compile
7983 ac_compiler=$2
7984 { (ac_try="$ac_compiler --version >&5"
7985 case "(($ac_try" in
7986 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7987 *) ac_try_echo=$ac_try;;
7988 esac
7989 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
7990 $as_echo "$ac_try_echo") >&5
7991 (eval "$ac_compiler --version >&5") 2>&5
7992 ac_status=$?
7993 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
7994 (exit $ac_status); }
7995 { (ac_try="$ac_compiler -v >&5"
7996 case "(($ac_try" in
7997 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
7998 *) ac_try_echo=$ac_try;;
7999 esac
8000 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8001 $as_echo "$ac_try_echo") >&5
8002 (eval "$ac_compiler -v >&5") 2>&5
8003 ac_status=$?
8004 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8005 (exit $ac_status); }
8006 { (ac_try="$ac_compiler -V >&5"
8007 case "(($ac_try" in
8008 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8009 *) ac_try_echo=$ac_try;;
8010 esac
8011 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8012 $as_echo "$ac_try_echo") >&5
8013 (eval "$ac_compiler -V >&5") 2>&5
8014 ac_status=$?
8015 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8016 (exit $ac_status); }
8017
8018 { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
8019 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
8020 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
8021 $as_echo_n "(cached) " >&6
8022 else
8023 cat >conftest.$ac_ext <<_ACEOF
8024 /* confdefs.h. */
8025 _ACEOF
8026 cat confdefs.h >>conftest.$ac_ext
8027 cat >>conftest.$ac_ext <<_ACEOF
8028 /* end confdefs.h. */
8029
8030 int
8031 main ()
8032 {
8033 #ifndef __GNUC__
8034 choke me
8035 #endif
8036
8037 ;
8038 return 0;
8039 }
8040 _ACEOF
8041 rm -f conftest.$ac_objext
8042 if { (ac_try="$ac_compile"
8043 case "(($ac_try" in
8044 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8045 *) ac_try_echo=$ac_try;;
8046 esac
8047 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8048 $as_echo "$ac_try_echo") >&5
8049 (eval "$ac_compile") 2>conftest.er1
8050 ac_status=$?
8051 grep -v '^ *+' conftest.er1 >conftest.err
8052 rm -f conftest.er1
8053 cat conftest.err >&5
8054 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8055 (exit $ac_status); } && {
8056 test -z "$ac_cxx_werror_flag" ||
8057 test ! -s conftest.err
8058 } && test -s conftest.$ac_objext; then
8059 ac_compiler_gnu=yes
8060 else
8061 $as_echo "$as_me: failed program was:" >&5
8062 sed 's/^/| /' conftest.$ac_ext >&5
8063
8064 ac_compiler_gnu=no
8065 fi
8066
8067 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8068 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
8069
8070 fi
8071 { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
8072 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
8073 if test $ac_compiler_gnu = yes; then
8074 GXX=yes
8075 else
8076 GXX=
8077 fi
8078 ac_test_CXXFLAGS=${CXXFLAGS+set}
8079 ac_save_CXXFLAGS=$CXXFLAGS
8080 { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
8081 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
8082 if test "${ac_cv_prog_cxx_g+set}" = set; then
8083 $as_echo_n "(cached) " >&6
8084 else
8085 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
8086 ac_cxx_werror_flag=yes
8087 ac_cv_prog_cxx_g=no
8088 CXXFLAGS="-g"
8089 cat >conftest.$ac_ext <<_ACEOF
8090 /* confdefs.h. */
8091 _ACEOF
8092 cat confdefs.h >>conftest.$ac_ext
8093 cat >>conftest.$ac_ext <<_ACEOF
8094 /* end confdefs.h. */
8095
8096 int
8097 main ()
8098 {
8099
8100 ;
8101 return 0;
8102 }
8103 _ACEOF
8104 rm -f conftest.$ac_objext
8105 if { (ac_try="$ac_compile"
8106 case "(($ac_try" in
8107 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8108 *) ac_try_echo=$ac_try;;
8109 esac
8110 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8111 $as_echo "$ac_try_echo") >&5
8112 (eval "$ac_compile") 2>conftest.er1
8113 ac_status=$?
8114 grep -v '^ *+' conftest.er1 >conftest.err
8115 rm -f conftest.er1
8116 cat conftest.err >&5
8117 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8118 (exit $ac_status); } && {
8119 test -z "$ac_cxx_werror_flag" ||
8120 test ! -s conftest.err
8121 } && test -s conftest.$ac_objext; then
8122 ac_cv_prog_cxx_g=yes
8123 else
8124 $as_echo "$as_me: failed program was:" >&5
8125 sed 's/^/| /' conftest.$ac_ext >&5
8126
8127 CXXFLAGS=""
8128 cat >conftest.$ac_ext <<_ACEOF
8129 /* confdefs.h. */
8130 _ACEOF
8131 cat confdefs.h >>conftest.$ac_ext
8132 cat >>conftest.$ac_ext <<_ACEOF
8133 /* end confdefs.h. */
8134
8135 int
8136 main ()
8137 {
8138
8139 ;
8140 return 0;
8141 }
8142 _ACEOF
8143 rm -f conftest.$ac_objext
8144 if { (ac_try="$ac_compile"
8145 case "(($ac_try" in
8146 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8147 *) ac_try_echo=$ac_try;;
8148 esac
8149 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8150 $as_echo "$ac_try_echo") >&5
8151 (eval "$ac_compile") 2>conftest.er1
8152 ac_status=$?
8153 grep -v '^ *+' conftest.er1 >conftest.err
8154 rm -f conftest.er1
8155 cat conftest.err >&5
8156 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8157 (exit $ac_status); } && {
8158 test -z "$ac_cxx_werror_flag" ||
8159 test ! -s conftest.err
8160 } && test -s conftest.$ac_objext; then
8161 :
8162 else
8163 $as_echo "$as_me: failed program was:" >&5
8164 sed 's/^/| /' conftest.$ac_ext >&5
8165
8166 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
8167 CXXFLAGS="-g"
8168 cat >conftest.$ac_ext <<_ACEOF
8169 /* confdefs.h. */
8170 _ACEOF
8171 cat confdefs.h >>conftest.$ac_ext
8172 cat >>conftest.$ac_ext <<_ACEOF
8173 /* end confdefs.h. */
8174
8175 int
8176 main ()
8177 {
8178
8179 ;
8180 return 0;
8181 }
8182 _ACEOF
8183 rm -f conftest.$ac_objext
8184 if { (ac_try="$ac_compile"
8185 case "(($ac_try" in
8186 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8187 *) ac_try_echo=$ac_try;;
8188 esac
8189 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8190 $as_echo "$ac_try_echo") >&5
8191 (eval "$ac_compile") 2>conftest.er1
8192 ac_status=$?
8193 grep -v '^ *+' conftest.er1 >conftest.err
8194 rm -f conftest.er1
8195 cat conftest.err >&5
8196 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8197 (exit $ac_status); } && {
8198 test -z "$ac_cxx_werror_flag" ||
8199 test ! -s conftest.err
8200 } && test -s conftest.$ac_objext; then
8201 ac_cv_prog_cxx_g=yes
8202 else
8203 $as_echo "$as_me: failed program was:" >&5
8204 sed 's/^/| /' conftest.$ac_ext >&5
8205
8206
8207 fi
8208
8209 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8210 fi
8211
8212 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8213 fi
8214
8215 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8216 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
8217 fi
8218 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
8219 $as_echo "$ac_cv_prog_cxx_g" >&6; }
8220 if test "$ac_test_CXXFLAGS" = set; then
8221 CXXFLAGS=$ac_save_CXXFLAGS
8222 elif test $ac_cv_prog_cxx_g = yes; then
8223 if test "$GXX" = yes; then
8224 CXXFLAGS="-g -O2"
8225 else
8226 CXXFLAGS="-g"
8227 fi
8228 else
8229 if test "$GXX" = yes; then
8230 CXXFLAGS="-O2"
8231 else
8232 CXXFLAGS=
8233 fi
8234 fi
8235 ac_ext=c
8236 ac_cpp='$CPP $CPPFLAGS'
8237 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8238 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8239 ac_compiler_gnu=$ac_cv_c_compiler_gnu
8240
8241 depcc="$CXX" am_compiler_list=
8242
8243 { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
8244 $as_echo_n "checking dependency style of $depcc... " >&6; }
8245 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
8246 $as_echo_n "(cached) " >&6
8247 else
8248 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8249 # We make a subdir and do the tests there. Otherwise we can end up
8250 # making bogus files that we don't know about and never remove. For
8251 # instance it was reported that on HP-UX the gcc test will end up
8252 # making a dummy file named `D' -- because `-MD' means `put the output
8253 # in D'.
8254 mkdir conftest.dir
8255 # Copy depcomp to subdir because otherwise we won't find it if we're
8256 # using a relative directory.
8257 cp "$am_depcomp" conftest.dir
8258 cd conftest.dir
8259 # We will build objects and dependencies in a subdirectory because
8260 # it helps to detect inapplicable dependency modes. For instance
8261 # both Tru64's cc and ICC support -MD to output dependencies as a
8262 # side effect of compilation, but ICC will put the dependencies in
8263 # the current directory while Tru64 will put them in the object
8264 # directory.
8265 mkdir sub
8266
8267 am_cv_CXX_dependencies_compiler_type=none
8268 if test "$am_compiler_list" = ""; then
8269 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
8270 fi
8271 for depmode in $am_compiler_list; do
8272 # Setup a source with many dependencies, because some compilers
8273 # like to wrap large dependency lists on column 80 (with \), and
8274 # we should not choose a depcomp mode which is confused by this.
8275 #
8276 # We need to recreate these files for each test, as the compiler may
8277 # overwrite some of them when testing with obscure command lines.
8278 # This happens at least with the AIX C compiler.
8279 : > sub/conftest.c
8280 for i in 1 2 3 4 5 6; do
8281 echo '#include "conftst'$i'.h"' >> sub/conftest.c
8282 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
8283 # Solaris 8's {/usr,}/bin/sh.
8284 touch sub/conftst$i.h
8285 done
8286 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8287
8288 case $depmode in
8289 nosideeffect)
8290 # after this tag, mechanisms are not by side-effect, so they'll
8291 # only be used when explicitly requested
8292 if test "x$enable_dependency_tracking" = xyes; then
8293 continue
8294 else
8295 break
8296 fi
8297 ;;
8298 none) break ;;
8299 esac
8300 # We check with `-c' and `-o' for the sake of the "dashmstdout"
8301 # mode. It turns out that the SunPro C++ compiler does not properly
8302 # handle `-M -o', and we need to detect this.
8303 if depmode=$depmode \
8304 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
8305 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8306 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
8307 >/dev/null 2>conftest.err &&
8308 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
8309 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8310 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
8311 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
8312 # icc doesn't choke on unknown options, it will just issue warnings
8313 # or remarks (even with -Werror). So we grep stderr for any message
8314 # that says an option was ignored or not supported.
8315 # When given -MP, icc 7.0 and 7.1 complain thusly:
8316 # icc: Command line warning: ignoring option '-M'; no argument required
8317 # The diagnosis changed in icc 8.0:
8318 # icc: Command line remark: option '-MP' not supported
8319 if (grep 'ignoring option' conftest.err ||
8320 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
8321 am_cv_CXX_dependencies_compiler_type=$depmode
8322 break
8323 fi
8324 fi
8325 done
8326
8327 cd ..
8328 rm -rf conftest.dir
8329 else
8330 am_cv_CXX_dependencies_compiler_type=none
8331 fi
8332
8333 fi
8334 { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
8335 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
8336 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
8337
8338 if
8339 test "x$enable_dependency_tracking" != xno \
8340 && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
8341 am__fastdepCXX_TRUE=
8342 am__fastdepCXX_FALSE='#'
8343 else
8344 am__fastdepCXX_TRUE='#'
8345 am__fastdepCXX_FALSE=
8346 fi
8347
8348
8349 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
8350 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
8351 (test "X$CXX" != "Xg++"))) ; then
8352 ac_ext=cpp
8353 ac_cpp='$CXXCPP $CPPFLAGS'
8354 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8355 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8356 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
8357 { $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
8358 $as_echo_n "checking how to run the C++ preprocessor... " >&6; }
8359 if test -z "$CXXCPP"; then
8360 if test "${ac_cv_prog_CXXCPP+set}" = set; then
8361 $as_echo_n "(cached) " >&6
8362 else
8363 # Double quotes because CXXCPP needs to be expanded
8364 for CXXCPP in "$CXX -E" "/lib/cpp"
8365 do
8366 ac_preproc_ok=false
8367 for ac_cxx_preproc_warn_flag in '' yes
8368 do
8369 # Use a header file that comes with gcc, so configuring glibc
8370 # with a fresh cross-compiler works.
8371 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
8372 # <limits.h> exists even on freestanding compilers.
8373 # On the NeXT, cc -E runs the code through the compiler's parser,
8374 # not just through cpp. "Syntax error" is here to catch this case.
8375 cat >conftest.$ac_ext <<_ACEOF
8376 /* confdefs.h. */
8377 _ACEOF
8378 cat confdefs.h >>conftest.$ac_ext
8379 cat >>conftest.$ac_ext <<_ACEOF
8380 /* end confdefs.h. */
8381 #ifdef __STDC__
8382 # include <limits.h>
8383 #else
8384 # include <assert.h>
8385 #endif
8386 Syntax error
8387 _ACEOF
8388 if { (ac_try="$ac_cpp conftest.$ac_ext"
8389 case "(($ac_try" in
8390 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8391 *) ac_try_echo=$ac_try;;
8392 esac
8393 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8394 $as_echo "$ac_try_echo") >&5
8395 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8396 ac_status=$?
8397 grep -v '^ *+' conftest.er1 >conftest.err
8398 rm -f conftest.er1
8399 cat conftest.err >&5
8400 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8401 (exit $ac_status); } >/dev/null && {
8402 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
8403 test ! -s conftest.err
8404 }; then
8405 :
8406 else
8407 $as_echo "$as_me: failed program was:" >&5
8408 sed 's/^/| /' conftest.$ac_ext >&5
8409
8410 # Broken: fails on valid input.
8411 continue
8412 fi
8413
8414 rm -f conftest.err conftest.$ac_ext
8415
8416 # OK, works on sane cases. Now check whether nonexistent headers
8417 # can be detected and how.
8418 cat >conftest.$ac_ext <<_ACEOF
8419 /* confdefs.h. */
8420 _ACEOF
8421 cat confdefs.h >>conftest.$ac_ext
8422 cat >>conftest.$ac_ext <<_ACEOF
8423 /* end confdefs.h. */
8424 #include <ac_nonexistent.h>
8425 _ACEOF
8426 if { (ac_try="$ac_cpp conftest.$ac_ext"
8427 case "(($ac_try" in
8428 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8429 *) ac_try_echo=$ac_try;;
8430 esac
8431 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8432 $as_echo "$ac_try_echo") >&5
8433 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8434 ac_status=$?
8435 grep -v '^ *+' conftest.er1 >conftest.err
8436 rm -f conftest.er1
8437 cat conftest.err >&5
8438 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8439 (exit $ac_status); } >/dev/null && {
8440 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
8441 test ! -s conftest.err
8442 }; then
8443 # Broken: success on invalid input.
8444 continue
8445 else
8446 $as_echo "$as_me: failed program was:" >&5
8447 sed 's/^/| /' conftest.$ac_ext >&5
8448
8449 # Passes both tests.
8450 ac_preproc_ok=:
8451 break
8452 fi
8453
8454 rm -f conftest.err conftest.$ac_ext
8455
8456 done
8457 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
8458 rm -f conftest.err conftest.$ac_ext
8459 if $ac_preproc_ok; then
8460 break
8461 fi
8462
8463 done
8464 ac_cv_prog_CXXCPP=$CXXCPP
8465
8466 fi
8467 CXXCPP=$ac_cv_prog_CXXCPP
8468 else
8469 ac_cv_prog_CXXCPP=$CXXCPP
8470 fi
8471 { $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
8472 $as_echo "$CXXCPP" >&6; }
8473 ac_preproc_ok=false
8474 for ac_cxx_preproc_warn_flag in '' yes
8475 do
8476 # Use a header file that comes with gcc, so configuring glibc
8477 # with a fresh cross-compiler works.
8478 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
8479 # <limits.h> exists even on freestanding compilers.
8480 # On the NeXT, cc -E runs the code through the compiler's parser,
8481 # not just through cpp. "Syntax error" is here to catch this case.
8482 cat >conftest.$ac_ext <<_ACEOF
8483 /* confdefs.h. */
8484 _ACEOF
8485 cat confdefs.h >>conftest.$ac_ext
8486 cat >>conftest.$ac_ext <<_ACEOF
8487 /* end confdefs.h. */
8488 #ifdef __STDC__
8489 # include <limits.h>
8490 #else
8491 # include <assert.h>
8492 #endif
8493 Syntax error
8494 _ACEOF
8495 if { (ac_try="$ac_cpp conftest.$ac_ext"
8496 case "(($ac_try" in
8497 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8498 *) ac_try_echo=$ac_try;;
8499 esac
8500 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8501 $as_echo "$ac_try_echo") >&5
8502 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8503 ac_status=$?
8504 grep -v '^ *+' conftest.er1 >conftest.err
8505 rm -f conftest.er1
8506 cat conftest.err >&5
8507 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8508 (exit $ac_status); } >/dev/null && {
8509 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
8510 test ! -s conftest.err
8511 }; then
8512 :
8513 else
8514 $as_echo "$as_me: failed program was:" >&5
8515 sed 's/^/| /' conftest.$ac_ext >&5
8516
8517 # Broken: fails on valid input.
8518 continue
8519 fi
8520
8521 rm -f conftest.err conftest.$ac_ext
8522
8523 # OK, works on sane cases. Now check whether nonexistent headers
8524 # can be detected and how.
8525 cat >conftest.$ac_ext <<_ACEOF
8526 /* confdefs.h. */
8527 _ACEOF
8528 cat confdefs.h >>conftest.$ac_ext
8529 cat >>conftest.$ac_ext <<_ACEOF
8530 /* end confdefs.h. */
8531 #include <ac_nonexistent.h>
8532 _ACEOF
8533 if { (ac_try="$ac_cpp conftest.$ac_ext"
8534 case "(($ac_try" in
8535 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8536 *) ac_try_echo=$ac_try;;
8537 esac
8538 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
8539 $as_echo "$ac_try_echo") >&5
8540 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
8541 ac_status=$?
8542 grep -v '^ *+' conftest.er1 >conftest.err
8543 rm -f conftest.er1
8544 cat conftest.err >&5
8545 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
8546 (exit $ac_status); } >/dev/null && {
8547 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
8548 test ! -s conftest.err
8549 }; then
8550 # Broken: success on invalid input.
8551 continue
8552 else
8553 $as_echo "$as_me: failed program was:" >&5
8554 sed 's/^/| /' conftest.$ac_ext >&5
8555
8556 # Passes both tests.
8557 ac_preproc_ok=:
8558 break
8559 fi
8560
8561 rm -f conftest.err conftest.$ac_ext
8562
8563 done
8564 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
8565 rm -f conftest.err conftest.$ac_ext
8566 if $ac_preproc_ok; then
8567 :
8568 else
8569 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
8570 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
8571 _lt_caught_CXX_error=yes; }
8572 fi
8573
8574 ac_ext=c
8575 ac_cpp='$CPP $CPPFLAGS'
8576 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8577 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8578 ac_compiler_gnu=$ac_cv_c_compiler_gnu
8579
8580 else
8581 _lt_caught_CXX_error=yes
8582 fi
8583
8584
8585
8586
8587
8588 # Set options
8589
8590
8591
8592 enable_dlopen=no
8593
8594
8595 enable_win32_dll=no
8596
8597
8598 # Check whether --enable-shared was given.
8599 if test "${enable_shared+set}" = set; then
8600 enableval=$enable_shared; p=${PACKAGE-default}
8601 case $enableval in
8602 yes) enable_shared=yes ;;
8603 no) enable_shared=no ;;
8604 *)
8605 enable_shared=no
8606 # Look at the argument we got. We use all the common list separators.
8607 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8608 for pkg in $enableval; do
8609 IFS="$lt_save_ifs"
8610 if test "X$pkg" = "X$p"; then
8611 enable_shared=yes
8612 fi
8613 done
8614 IFS="$lt_save_ifs"
8615 ;;
8616 esac
8617 else
8618 enable_shared=yes
8619 fi
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629 # Check whether --enable-static was given.
8630 if test "${enable_static+set}" = set; then
8631 enableval=$enable_static; p=${PACKAGE-default}
8632 case $enableval in
8633 yes) enable_static=yes ;;
8634 no) enable_static=no ;;
8635 *)
8636 enable_static=no
8637 # Look at the argument we got. We use all the common list separators.
8638 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8639 for pkg in $enableval; do
8640 IFS="$lt_save_ifs"
8641 if test "X$pkg" = "X$p"; then
8642 enable_static=yes
8643 fi
8644 done
8645 IFS="$lt_save_ifs"
8646 ;;
8647 esac
8648 else
8649 enable_static=yes
8650 fi
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661 # Check whether --with-pic was given.
8662 if test "${with_pic+set}" = set; then
8663 withval=$with_pic; pic_mode="$withval"
8664 else
8665 pic_mode=default
8666 fi
8667
8668
8669 test -z "$pic_mode" && pic_mode=default
8670
8671
8672
8673
8674
8675
8676
8677 # Check whether --enable-fast-install was given.
8678 if test "${enable_fast_install+set}" = set; then
8679 enableval=$enable_fast_install; p=${PACKAGE-default}
8680 case $enableval in
8681 yes) enable_fast_install=yes ;;
8682 no) enable_fast_install=no ;;
8683 *)
8684 enable_fast_install=no
8685 # Look at the argument we got. We use all the common list separators.
8686 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8687 for pkg in $enableval; do
8688 IFS="$lt_save_ifs"
8689 if test "X$pkg" = "X$p"; then
8690 enable_fast_install=yes
8691 fi
8692 done
8693 IFS="$lt_save_ifs"
8694 ;;
8695 esac
8696 else
8697 enable_fast_install=yes
8698 fi
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710 # This can be used to rebuild libtool when needed
8711 LIBTOOL_DEPS="$ltmain"
8712
8713 # Always use our own libtool.
8714 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740 test -z "$LN_S" && LN_S="ln -s"
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755 if test -n "${ZSH_VERSION+set}" ; then
8756 setopt NO_GLOB_SUBST
8757 fi
8758
8759 { $as_echo "$as_me:$LINENO: checking for objdir" >&5
8760 $as_echo_n "checking for objdir... " >&6; }
8761 if test "${lt_cv_objdir+set}" = set; then
8762 $as_echo_n "(cached) " >&6
8763 else
8764 rm -f .libs 2>/dev/null
8765 mkdir .libs 2>/dev/null
8766 if test -d .libs; then
8767 lt_cv_objdir=.libs
8768 else
8769 # MS-DOS does not allow filenames that begin with a dot.
8770 lt_cv_objdir=_libs
8771 fi
8772 rmdir .libs 2>/dev/null
8773 fi
8774 { $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
8775 $as_echo "$lt_cv_objdir" >&6; }
8776 objdir=$lt_cv_objdir
8777
8778
8779
8780
8781
8782 cat >>confdefs.h <<_ACEOF
8783 #define LT_OBJDIR "$lt_cv_objdir/"
8784 _ACEOF
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802 case $host_os in
8803 aix3*)
8804 # AIX sometimes has problems with the GCC collect2 program. For some
8805 # reason, if we set the COLLECT_NAMES environment variable, the problems
8806 # vanish in a puff of smoke.
8807 if test "X${COLLECT_NAMES+set}" != Xset; then
8808 COLLECT_NAMES=
8809 export COLLECT_NAMES
8810 fi
8811 ;;
8812 esac
8813
8814 # Sed substitution that helps us do robust quoting. It backslashifies
8815 # metacharacters that are still active within double-quoted strings.
8816 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
8817
8818 # Same as above, but do not quote variable references.
8819 double_quote_subst='s/\(["`\\]\)/\\\1/g'
8820
8821 # Sed substitution to delay expansion of an escaped shell variable in a
8822 # double_quote_subst'ed string.
8823 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
8824
8825 # Sed substitution to delay expansion of an escaped single quote.
8826 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
8827
8828 # Sed substitution to avoid accidental globbing in evaled expressions
8829 no_glob_subst='s/\*/\\\*/g'
8830
8831 # Global variables:
8832 ofile=libtool
8833 can_build_shared=yes
8834
8835 # All known linkers require a `.a' archive for static linking (except MSVC,
8836 # which needs '.lib').
8837 libext=a
8838
8839 with_gnu_ld="$lt_cv_prog_gnu_ld"
8840
8841 old_CC="$CC"
8842 old_CFLAGS="$CFLAGS"
8843
8844 # Set sane defaults for various variables
8845 test -z "$CC" && CC=cc
8846 test -z "$LTCC" && LTCC=$CC
8847 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
8848 test -z "$LD" && LD=ld
8849 test -z "$ac_objext" && ac_objext=o
8850
8851 for cc_temp in $compiler""; do
8852 case $cc_temp in
8853 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
8854 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
8855 \-*) ;;
8856 *) break;;
8857 esac
8858 done
8859 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
8860
8861
8862 # Only perform the check for file, if the check method requires it
8863 test -z "$MAGIC_CMD" && MAGIC_CMD=file
8864 case $deplibs_check_method in
8865 file_magic*)
8866 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
8867 { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
8868 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
8869 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
8870 $as_echo_n "(cached) " >&6
8871 else
8872 case $MAGIC_CMD in
8873 [\\/*] | ?:[\\/]*)
8874 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8875 ;;
8876 *)
8877 lt_save_MAGIC_CMD="$MAGIC_CMD"
8878 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8879 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8880 for ac_dir in $ac_dummy; do
8881 IFS="$lt_save_ifs"
8882 test -z "$ac_dir" && ac_dir=.
8883 if test -f $ac_dir/${ac_tool_prefix}file; then
8884 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
8885 if test -n "$file_magic_test_file"; then
8886 case $deplibs_check_method in
8887 "file_magic "*)
8888 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8889 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8890 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8891 $EGREP "$file_magic_regex" > /dev/null; then
8892 :
8893 else
8894 cat <<_LT_EOF 1>&2
8895
8896 *** Warning: the command libtool uses to detect shared libraries,
8897 *** $file_magic_cmd, produces output that libtool cannot recognize.
8898 *** The result is that libtool may fail to recognize shared libraries
8899 *** as such. This will affect the creation of libtool libraries that
8900 *** depend on shared libraries, but programs linked with such libtool
8901 *** libraries will work regardless of this problem. Nevertheless, you
8902 *** may want to report the problem to your system manager and/or to
8903 *** bug-libtool@gnu.org
8904
8905 _LT_EOF
8906 fi ;;
8907 esac
8908 fi
8909 break
8910 fi
8911 done
8912 IFS="$lt_save_ifs"
8913 MAGIC_CMD="$lt_save_MAGIC_CMD"
8914 ;;
8915 esac
8916 fi
8917
8918 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8919 if test -n "$MAGIC_CMD"; then
8920 { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
8921 $as_echo "$MAGIC_CMD" >&6; }
8922 else
8923 { $as_echo "$as_me:$LINENO: result: no" >&5
8924 $as_echo "no" >&6; }
8925 fi
8926
8927
8928
8929
8930
8931 if test -z "$lt_cv_path_MAGIC_CMD"; then
8932 if test -n "$ac_tool_prefix"; then
8933 { $as_echo "$as_me:$LINENO: checking for file" >&5
8934 $as_echo_n "checking for file... " >&6; }
8935 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
8936 $as_echo_n "(cached) " >&6
8937 else
8938 case $MAGIC_CMD in
8939 [\\/*] | ?:[\\/]*)
8940 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8941 ;;
8942 *)
8943 lt_save_MAGIC_CMD="$MAGIC_CMD"
8944 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8945 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8946 for ac_dir in $ac_dummy; do
8947 IFS="$lt_save_ifs"
8948 test -z "$ac_dir" && ac_dir=.
8949 if test -f $ac_dir/file; then
8950 lt_cv_path_MAGIC_CMD="$ac_dir/file"
8951 if test -n "$file_magic_test_file"; then
8952 case $deplibs_check_method in
8953 "file_magic "*)
8954 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8955 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8956 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8957 $EGREP "$file_magic_regex" > /dev/null; then
8958 :
8959 else
8960 cat <<_LT_EOF 1>&2
8961
8962 *** Warning: the command libtool uses to detect shared libraries,
8963 *** $file_magic_cmd, produces output that libtool cannot recognize.
8964 *** The result is that libtool may fail to recognize shared libraries
8965 *** as such. This will affect the creation of libtool libraries that
8966 *** depend on shared libraries, but programs linked with such libtool
8967 *** libraries will work regardless of this problem. Nevertheless, you
8968 *** may want to report the problem to your system manager and/or to
8969 *** bug-libtool@gnu.org
8970
8971 _LT_EOF
8972 fi ;;
8973 esac
8974 fi
8975 break
8976 fi
8977 done
8978 IFS="$lt_save_ifs"
8979 MAGIC_CMD="$lt_save_MAGIC_CMD"
8980 ;;
8981 esac
8982 fi
8983
8984 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8985 if test -n "$MAGIC_CMD"; then
8986 { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
8987 $as_echo "$MAGIC_CMD" >&6; }
8988 else
8989 { $as_echo "$as_me:$LINENO: result: no" >&5
8990 $as_echo "no" >&6; }
8991 fi
8992
8993
8994 else
8995 MAGIC_CMD=:
8996 fi
8997 fi
8998
8999 fi
9000 ;;
9001 esac
9002
9003 # Use C for the default configuration in the libtool script
9004
9005 lt_save_CC="$CC"
9006 ac_ext=c
9007 ac_cpp='$CPP $CPPFLAGS'
9008 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
9009 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
9010 ac_compiler_gnu=$ac_cv_c_compiler_gnu
9011
9012
9013 # Source file extension for C test sources.
9014 ac_ext=c
9015
9016 # Object file extension for compiled C test sources.
9017 objext=o
9018 objext=$objext
9019
9020 # Code to be used in simple compile tests
9021 lt_simple_compile_test_code="int some_variable = 0;"
9022
9023 # Code to be used in simple link tests
9024 lt_simple_link_test_code='int main(){return(0);}'
9025
9026
9027
9028
9029
9030
9031
9032 # If no C compiler was specified, use CC.
9033 LTCC=${LTCC-"$CC"}
9034
9035 # If no C compiler flags were specified, use CFLAGS.
9036 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
9037
9038 # Allow CC to be a program name with arguments.
9039 compiler=$CC
9040
9041 # Save the default compiler, since it gets overwritten when the other
9042 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
9043 compiler_DEFAULT=$CC
9044
9045 # save warnings/boilerplate of simple test code
9046 ac_outfile=conftest.$ac_objext
9047 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
9048 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9049 _lt_compiler_boilerplate=`cat conftest.err`
9050 $RM conftest*
9051
9052 ac_outfile=conftest.$ac_objext
9053 echo "$lt_simple_link_test_code" >conftest.$ac_ext
9054 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9055 _lt_linker_boilerplate=`cat conftest.err`
9056 $RM -r conftest*
9057
9058
9059 if test -n "$compiler"; then
9060
9061 lt_prog_compiler_no_builtin_flag=
9062
9063 if test "$GCC" = yes; then
9064 lt_prog_compiler_no_builtin_flag=' -fno-builtin'
9065
9066 { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
9067 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
9068 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
9069 $as_echo_n "(cached) " >&6
9070 else
9071 lt_cv_prog_compiler_rtti_exceptions=no
9072 ac_outfile=conftest.$ac_objext
9073 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9074 lt_compiler_flag="-fno-rtti -fno-exceptions"
9075 # Insert the option either (1) after the last *FLAGS variable, or
9076 # (2) before a word containing "conftest.", or (3) at the end.
9077 # Note that $ac_compile itself does not contain backslashes and begins
9078 # with a dollar sign (not a hyphen), so the echo should work correctly.
9079 # The option is referenced via a variable to avoid confusing sed.
9080 lt_compile=`echo "$ac_compile" | $SED \
9081 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9082 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9083 -e 's:$: $lt_compiler_flag:'`
9084 (eval echo "\"\$as_me:9085: $lt_compile\"" >&5)
9085 (eval "$lt_compile" 2>conftest.err)
9086 ac_status=$?
9087 cat conftest.err >&5
9088 echo "$as_me:9089: \$? = $ac_status" >&5
9089 if (exit $ac_status) && test -s "$ac_outfile"; then
9090 # The compiler can only warn and ignore the option if not recognized
9091 # So say no if there are warnings other than the usual output.
9092 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
9093 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
9094 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
9095 lt_cv_prog_compiler_rtti_exceptions=yes
9096 fi
9097 fi
9098 $RM conftest*
9099
9100 fi
9101 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
9102 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
9103
9104 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
9105 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
9106 else
9107 :
9108 fi
9109
9110 fi
9111
9112
9113
9114
9115
9116
9117 lt_prog_compiler_wl=
9118 lt_prog_compiler_pic=
9119 lt_prog_compiler_static=
9120
9121 { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
9122 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
9123
9124 if test "$GCC" = yes; then
9125 lt_prog_compiler_wl='-Wl,'
9126 lt_prog_compiler_static='-static'
9127
9128 case $host_os in
9129 aix*)
9130 # All AIX code is PIC.
9131 if test "$host_cpu" = ia64; then
9132 # AIX 5 now supports IA64 processor
9133 lt_prog_compiler_static='-Bstatic'
9134 fi
9135 ;;
9136
9137 amigaos*)
9138 case $host_cpu in
9139 powerpc)
9140 # see comment about AmigaOS4 .so support
9141 lt_prog_compiler_pic='-fPIC'
9142 ;;
9143 m68k)
9144 # FIXME: we need at least 68020 code to build shared libraries, but
9145 # adding the `-m68020' flag to GCC prevents building anything better,
9146 # like `-m68040'.
9147 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
9148 ;;
9149 esac
9150 ;;
9151
9152 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
9153 # PIC is the default for these OSes.
9154 ;;
9155
9156 mingw* | cygwin* | pw32* | os2* | cegcc*)
9157 # This hack is so that the source file can tell whether it is being
9158 # built for inclusion in a dll (and should export symbols for example).
9159 # Although the cygwin gcc ignores -fPIC, still need this for old-style
9160 # (--disable-auto-import) libraries
9161 lt_prog_compiler_pic='-DDLL_EXPORT'
9162 ;;
9163
9164 darwin* | rhapsody*)
9165 # PIC is the default on this platform
9166 # Common symbols not allowed in MH_DYLIB files
9167 lt_prog_compiler_pic='-fno-common'
9168 ;;
9169
9170 hpux*)
9171 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
9172 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
9173 # sets the default TLS model and affects inlining.
9174 case $host_cpu in
9175 hppa*64*)
9176 # +Z the default
9177 ;;
9178 *)
9179 lt_prog_compiler_pic='-fPIC'
9180 ;;
9181 esac
9182 ;;
9183
9184 interix[3-9]*)
9185 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
9186 # Instead, we relocate shared libraries at runtime.
9187 ;;
9188
9189 msdosdjgpp*)
9190 # Just because we use GCC doesn't mean we suddenly get shared libraries
9191 # on systems that don't support them.
9192 lt_prog_compiler_can_build_shared=no
9193 enable_shared=no
9194 ;;
9195
9196 *nto* | *qnx*)
9197 # QNX uses GNU C++, but need to define -shared option too, otherwise
9198 # it will coredump.
9199 lt_prog_compiler_pic='-fPIC -shared'
9200 ;;
9201
9202 sysv4*MP*)
9203 if test -d /usr/nec; then
9204 lt_prog_compiler_pic=-Kconform_pic
9205 fi
9206 ;;
9207
9208 *)
9209 lt_prog_compiler_pic='-fPIC'
9210 ;;
9211 esac
9212 else
9213 # PORTME Check for flag to pass linker flags through the system compiler.
9214 case $host_os in
9215 aix*)
9216 lt_prog_compiler_wl='-Wl,'
9217 if test "$host_cpu" = ia64; then
9218 # AIX 5 now supports IA64 processor
9219 lt_prog_compiler_static='-Bstatic'
9220 else
9221 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
9222 fi
9223 ;;
9224
9225 mingw* | cygwin* | pw32* | os2* | cegcc*)
9226 # This hack is so that the source file can tell whether it is being
9227 # built for inclusion in a dll (and should export symbols for example).
9228 lt_prog_compiler_pic='-DDLL_EXPORT'
9229 ;;
9230
9231 hpux9* | hpux10* | hpux11*)
9232 lt_prog_compiler_wl='-Wl,'
9233 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
9234 # not for PA HP-UX.
9235 case $host_cpu in
9236 hppa*64*|ia64*)
9237 # +Z the default
9238 ;;
9239 *)
9240 lt_prog_compiler_pic='+Z'
9241 ;;
9242 esac
9243 # Is there a better lt_prog_compiler_static that works with the bundled CC?
9244 lt_prog_compiler_static='${wl}-a ${wl}archive'
9245 ;;
9246
9247 irix5* | irix6* | nonstopux*)
9248 lt_prog_compiler_wl='-Wl,'
9249 # PIC (with -KPIC) is the default.
9250 lt_prog_compiler_static='-non_shared'
9251 ;;
9252
9253 linux* | k*bsd*-gnu)
9254 case $cc_basename in
9255 # old Intel for x86_64 which still supported -KPIC.
9256 ecc*)
9257 lt_prog_compiler_wl='-Wl,'
9258 lt_prog_compiler_pic='-KPIC'
9259 lt_prog_compiler_static='-static'
9260 ;;
9261 # icc used to be incompatible with GCC.
9262 # ICC 10 doesn't accept -KPIC any more.
9263 icc* | ifort*)
9264 lt_prog_compiler_wl='-Wl,'
9265 lt_prog_compiler_pic='-fPIC'
9266 lt_prog_compiler_static='-static'
9267 ;;
9268 # Lahey Fortran 8.1.
9269 lf95*)
9270 lt_prog_compiler_wl='-Wl,'
9271 lt_prog_compiler_pic='--shared'
9272 lt_prog_compiler_static='--static'
9273 ;;
9274 pgcc* | pgf77* | pgf90* | pgf95*)
9275 # Portland Group compilers (*not* the Pentium gcc compiler,
9276 # which looks to be a dead project)
9277 lt_prog_compiler_wl='-Wl,'
9278 lt_prog_compiler_pic='-fpic'
9279 lt_prog_compiler_static='-Bstatic'
9280 ;;
9281 ccc*)
9282 lt_prog_compiler_wl='-Wl,'
9283 # All Alpha code is PIC.
9284 lt_prog_compiler_static='-non_shared'
9285 ;;
9286 xl*)
9287 # IBM XL C 8.0/Fortran 10.1 on PPC
9288 lt_prog_compiler_wl='-Wl,'
9289 lt_prog_compiler_pic='-qpic'
9290 lt_prog_compiler_static='-qstaticlink'
9291 ;;
9292 *)
9293 case `$CC -V 2>&1 | sed 5q` in
9294 *Sun\ C*)
9295 # Sun C 5.9
9296 lt_prog_compiler_pic='-KPIC'
9297 lt_prog_compiler_static='-Bstatic'
9298 lt_prog_compiler_wl='-Wl,'
9299 ;;
9300 *Sun\ F*)
9301 # Sun Fortran 8.3 passes all unrecognized flags to the linker
9302 lt_prog_compiler_pic='-KPIC'
9303 lt_prog_compiler_static='-Bstatic'
9304 lt_prog_compiler_wl=''
9305 ;;
9306 esac
9307 ;;
9308 esac
9309 ;;
9310
9311 newsos6)
9312 lt_prog_compiler_pic='-KPIC'
9313 lt_prog_compiler_static='-Bstatic'
9314 ;;
9315
9316 *nto* | *qnx*)
9317 # QNX uses GNU C++, but need to define -shared option too, otherwise
9318 # it will coredump.
9319 lt_prog_compiler_pic='-fPIC -shared'
9320 ;;
9321
9322 osf3* | osf4* | osf5*)
9323 lt_prog_compiler_wl='-Wl,'
9324 # All OSF/1 code is PIC.
9325 lt_prog_compiler_static='-non_shared'
9326 ;;
9327
9328 rdos*)
9329 lt_prog_compiler_static='-non_shared'
9330 ;;
9331
9332 solaris*)
9333 lt_prog_compiler_pic='-KPIC'
9334 lt_prog_compiler_static='-Bstatic'
9335 case $cc_basename in
9336 f77* | f90* | f95*)
9337 lt_prog_compiler_wl='-Qoption ld ';;
9338 *)
9339 lt_prog_compiler_wl='-Wl,';;
9340 esac
9341 ;;
9342
9343 sunos4*)
9344 lt_prog_compiler_wl='-Qoption ld '
9345 lt_prog_compiler_pic='-PIC'
9346 lt_prog_compiler_static='-Bstatic'
9347 ;;
9348
9349 sysv4 | sysv4.2uw2* | sysv4.3*)
9350 lt_prog_compiler_wl='-Wl,'
9351 lt_prog_compiler_pic='-KPIC'
9352 lt_prog_compiler_static='-Bstatic'
9353 ;;
9354
9355 sysv4*MP*)
9356 if test -d /usr/nec ;then
9357 lt_prog_compiler_pic='-Kconform_pic'
9358 lt_prog_compiler_static='-Bstatic'
9359 fi
9360 ;;
9361
9362 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
9363 lt_prog_compiler_wl='-Wl,'
9364 lt_prog_compiler_pic='-KPIC'
9365 lt_prog_compiler_static='-Bstatic'
9366 ;;
9367
9368 unicos*)
9369 lt_prog_compiler_wl='-Wl,'
9370 lt_prog_compiler_can_build_shared=no
9371 ;;
9372
9373 uts4*)
9374 lt_prog_compiler_pic='-pic'
9375 lt_prog_compiler_static='-Bstatic'
9376 ;;
9377
9378 *)
9379 lt_prog_compiler_can_build_shared=no
9380 ;;
9381 esac
9382 fi
9383
9384 case $host_os in
9385 # For platforms which do not support PIC, -DPIC is meaningless:
9386 *djgpp*)
9387 lt_prog_compiler_pic=
9388 ;;
9389 *)
9390 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
9391 ;;
9392 esac
9393 { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
9394 $as_echo "$lt_prog_compiler_pic" >&6; }
9395
9396
9397
9398
9399
9400
9401 #
9402 # Check to make sure the PIC flag actually works.
9403 #
9404 if test -n "$lt_prog_compiler_pic"; then
9405 { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
9406 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
9407 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
9408 $as_echo_n "(cached) " >&6
9409 else
9410 lt_cv_prog_compiler_pic_works=no
9411 ac_outfile=conftest.$ac_objext
9412 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9413 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
9414 # Insert the option either (1) after the last *FLAGS variable, or
9415 # (2) before a word containing "conftest.", or (3) at the end.
9416 # Note that $ac_compile itself does not contain backslashes and begins
9417 # with a dollar sign (not a hyphen), so the echo should work correctly.
9418 # The option is referenced via a variable to avoid confusing sed.
9419 lt_compile=`echo "$ac_compile" | $SED \
9420 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9421 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9422 -e 's:$: $lt_compiler_flag:'`
9423 (eval echo "\"\$as_me:9424: $lt_compile\"" >&5)
9424 (eval "$lt_compile" 2>conftest.err)
9425 ac_status=$?
9426 cat conftest.err >&5
9427 echo "$as_me:9428: \$? = $ac_status" >&5
9428 if (exit $ac_status) && test -s "$ac_outfile"; then
9429 # The compiler can only warn and ignore the option if not recognized
9430 # So say no if there are warnings other than the usual output.
9431 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
9432 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
9433 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
9434 lt_cv_prog_compiler_pic_works=yes
9435 fi
9436 fi
9437 $RM conftest*
9438
9439 fi
9440 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
9441 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
9442
9443 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
9444 case $lt_prog_compiler_pic in
9445 "" | " "*) ;;
9446 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
9447 esac
9448 else
9449 lt_prog_compiler_pic=
9450 lt_prog_compiler_can_build_shared=no
9451 fi
9452
9453 fi
9454
9455
9456
9457
9458
9459
9460 #
9461 # Check to make sure the static flag actually works.
9462 #
9463 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
9464 { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
9465 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
9466 if test "${lt_cv_prog_compiler_static_works+set}" = set; then
9467 $as_echo_n "(cached) " >&6
9468 else
9469 lt_cv_prog_compiler_static_works=no
9470 save_LDFLAGS="$LDFLAGS"
9471 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
9472 echo "$lt_simple_link_test_code" > conftest.$ac_ext
9473 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
9474 # The linker can only warn and ignore the option if not recognized
9475 # So say no if there are warnings
9476 if test -s conftest.err; then
9477 # Append any errors to the config.log.
9478 cat conftest.err 1>&5
9479 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
9480 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
9481 if diff conftest.exp conftest.er2 >/dev/null; then
9482 lt_cv_prog_compiler_static_works=yes
9483 fi
9484 else
9485 lt_cv_prog_compiler_static_works=yes
9486 fi
9487 fi
9488 $RM -r conftest*
9489 LDFLAGS="$save_LDFLAGS"
9490
9491 fi
9492 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
9493 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
9494
9495 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
9496 :
9497 else
9498 lt_prog_compiler_static=
9499 fi
9500
9501
9502
9503
9504
9505
9506
9507 { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
9508 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
9509 if test "${lt_cv_prog_compiler_c_o+set}" = set; then
9510 $as_echo_n "(cached) " >&6
9511 else
9512 lt_cv_prog_compiler_c_o=no
9513 $RM -r conftest 2>/dev/null
9514 mkdir conftest
9515 cd conftest
9516 mkdir out
9517 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9518
9519 lt_compiler_flag="-o out/conftest2.$ac_objext"
9520 # Insert the option either (1) after the last *FLAGS variable, or
9521 # (2) before a word containing "conftest.", or (3) at the end.
9522 # Note that $ac_compile itself does not contain backslashes and begins
9523 # with a dollar sign (not a hyphen), so the echo should work correctly.
9524 lt_compile=`echo "$ac_compile" | $SED \
9525 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9526 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9527 -e 's:$: $lt_compiler_flag:'`
9528 (eval echo "\"\$as_me:9529: $lt_compile\"" >&5)
9529 (eval "$lt_compile" 2>out/conftest.err)
9530 ac_status=$?
9531 cat out/conftest.err >&5
9532 echo "$as_me:9533: \$? = $ac_status" >&5
9533 if (exit $ac_status) && test -s out/conftest2.$ac_objext
9534 then
9535 # The compiler can only warn and ignore the option if not recognized
9536 # So say no if there are warnings
9537 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
9538 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
9539 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
9540 lt_cv_prog_compiler_c_o=yes
9541 fi
9542 fi
9543 chmod u+w . 2>&5
9544 $RM conftest*
9545 # SGI C++ compiler will create directory out/ii_files/ for
9546 # template instantiation
9547 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
9548 $RM out/* && rmdir out
9549 cd ..
9550 $RM -r conftest
9551 $RM conftest*
9552
9553 fi
9554 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
9555 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
9556
9557
9558
9559
9560
9561
9562 { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
9563 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
9564 if test "${lt_cv_prog_compiler_c_o+set}" = set; then
9565 $as_echo_n "(cached) " >&6
9566 else
9567 lt_cv_prog_compiler_c_o=no
9568 $RM -r conftest 2>/dev/null
9569 mkdir conftest
9570 cd conftest
9571 mkdir out
9572 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9573
9574 lt_compiler_flag="-o out/conftest2.$ac_objext"
9575 # Insert the option either (1) after the last *FLAGS variable, or
9576 # (2) before a word containing "conftest.", or (3) at the end.
9577 # Note that $ac_compile itself does not contain backslashes and begins
9578 # with a dollar sign (not a hyphen), so the echo should work correctly.
9579 lt_compile=`echo "$ac_compile" | $SED \
9580 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9581 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9582 -e 's:$: $lt_compiler_flag:'`
9583 (eval echo "\"\$as_me:9584: $lt_compile\"" >&5)
9584 (eval "$lt_compile" 2>out/conftest.err)
9585 ac_status=$?
9586 cat out/conftest.err >&5
9587 echo "$as_me:9588: \$? = $ac_status" >&5
9588 if (exit $ac_status) && test -s out/conftest2.$ac_objext
9589 then
9590 # The compiler can only warn and ignore the option if not recognized
9591 # So say no if there are warnings
9592 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
9593 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
9594 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
9595 lt_cv_prog_compiler_c_o=yes
9596 fi
9597 fi
9598 chmod u+w . 2>&5
9599 $RM conftest*
9600 # SGI C++ compiler will create directory out/ii_files/ for
9601 # template instantiation
9602 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
9603 $RM out/* && rmdir out
9604 cd ..
9605 $RM -r conftest
9606 $RM conftest*
9607
9608 fi
9609 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
9610 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
9611
9612
9613
9614
9615 hard_links="nottested"
9616 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
9617 # do not overwrite the value of need_locks provided by the user
9618 { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
9619 $as_echo_n "checking if we can lock with hard links... " >&6; }
9620 hard_links=yes
9621 $RM conftest*
9622 ln conftest.a conftest.b 2>/dev/null && hard_links=no
9623 touch conftest.a
9624 ln conftest.a conftest.b 2>&5 || hard_links=no
9625 ln conftest.a conftest.b 2>/dev/null && hard_links=no
9626 { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
9627 $as_echo "$hard_links" >&6; }
9628 if test "$hard_links" = no; then
9629 { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
9630 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
9631 need_locks=warn
9632 fi
9633 else
9634 need_locks=no
9635 fi
9636
9637
9638
9639
9640
9641
9642 { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
9643 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
9644
9645 runpath_var=
9646 allow_undefined_flag=
9647 always_export_symbols=no
9648 archive_cmds=
9649 archive_expsym_cmds=
9650 compiler_needs_object=no
9651 enable_shared_with_static_runtimes=no
9652 export_dynamic_flag_spec=
9653 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
9654 hardcode_automatic=no
9655 hardcode_direct=no
9656 hardcode_direct_absolute=no
9657 hardcode_libdir_flag_spec=
9658 hardcode_libdir_flag_spec_ld=
9659 hardcode_libdir_separator=
9660 hardcode_minus_L=no
9661 hardcode_shlibpath_var=unsupported
9662 inherit_rpath=no
9663 link_all_deplibs=unknown
9664 module_cmds=
9665 module_expsym_cmds=
9666 old_archive_from_new_cmds=
9667 old_archive_from_expsyms_cmds=
9668 thread_safe_flag_spec=
9669 whole_archive_flag_spec=
9670 # include_expsyms should be a list of space-separated symbols to be *always*
9671 # included in the symbol list
9672 include_expsyms=
9673 # exclude_expsyms can be an extended regexp of symbols to exclude
9674 # it will be wrapped by ` (' and `)$', so one must not match beginning or
9675 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
9676 # as well as any symbol that contains `d'.
9677 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
9678 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
9679 # platforms (ab)use it in PIC code, but their linkers get confused if
9680 # the symbol is explicitly referenced. Since portable code cannot
9681 # rely on this symbol name, it's probably fine to never include it in
9682 # preloaded symbol tables.
9683 # Exclude shared library initialization/finalization symbols.
9684 extract_expsyms_cmds=
9685
9686 case $host_os in
9687 cygwin* | mingw* | pw32* | cegcc*)
9688 # FIXME: the MSVC++ port hasn't been tested in a loooong time
9689 # When not using gcc, we currently assume that we are using
9690 # Microsoft Visual C++.
9691 if test "$GCC" != yes; then
9692 with_gnu_ld=no
9693 fi
9694 ;;
9695 interix*)
9696 # we just hope/assume this is gcc and not c89 (= MSVC++)
9697 with_gnu_ld=yes
9698 ;;
9699 openbsd*)
9700 with_gnu_ld=no
9701 ;;
9702 esac
9703
9704 ld_shlibs=yes
9705 if test "$with_gnu_ld" = yes; then
9706 # If archive_cmds runs LD, not CC, wlarc should be empty
9707 wlarc='${wl}'
9708
9709 # Set some defaults for GNU ld with shared library support. These
9710 # are reset later if shared libraries are not supported. Putting them
9711 # here allows them to be overridden if necessary.
9712 runpath_var=LD_RUN_PATH
9713 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9714 export_dynamic_flag_spec='${wl}--export-dynamic'
9715 # ancient GNU ld didn't support --whole-archive et. al.
9716 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
9717 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
9718 else
9719 whole_archive_flag_spec=
9720 fi
9721 supports_anon_versioning=no
9722 case `$LD -v 2>&1` in
9723 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
9724 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
9725 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
9726 *\ 2.11.*) ;; # other 2.11 versions
9727 *) supports_anon_versioning=yes ;;
9728 esac
9729
9730 # See if GNU ld supports shared libraries.
9731 case $host_os in
9732 aix[3-9]*)
9733 # On AIX/PPC, the GNU linker is very broken
9734 if test "$host_cpu" != ia64; then
9735 ld_shlibs=no
9736 cat <<_LT_EOF 1>&2
9737
9738 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
9739 *** to be unable to reliably create shared libraries on AIX.
9740 *** Therefore, libtool is disabling shared libraries support. If you
9741 *** really care for shared libraries, you may want to modify your PATH
9742 *** so that a non-GNU linker is found, and then restart.
9743
9744 _LT_EOF
9745 fi
9746 ;;
9747
9748 amigaos*)
9749 case $host_cpu in
9750 powerpc)
9751 # see comment about AmigaOS4 .so support
9752 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9753 archive_expsym_cmds=''
9754 ;;
9755 m68k)
9756 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)'
9757 hardcode_libdir_flag_spec='-L$libdir'
9758 hardcode_minus_L=yes
9759 ;;
9760 esac
9761 ;;
9762
9763 beos*)
9764 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9765 allow_undefined_flag=unsupported
9766 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9767 # support --undefined. This deserves some investigation. FIXME
9768 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9769 else
9770 ld_shlibs=no
9771 fi
9772 ;;
9773
9774 cygwin* | mingw* | pw32* | cegcc*)
9775 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
9776 # as there is no search path for DLLs.
9777 hardcode_libdir_flag_spec='-L$libdir'
9778 allow_undefined_flag=unsupported
9779 always_export_symbols=no
9780 enable_shared_with_static_runtimes=yes
9781 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
9782
9783 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9784 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9785 # If the export-symbols file already is a .def file (1st line
9786 # is EXPORTS), use it as is; otherwise, prepend...
9787 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9788 cp $export_symbols $output_objdir/$soname.def;
9789 else
9790 echo EXPORTS > $output_objdir/$soname.def;
9791 cat $export_symbols >> $output_objdir/$soname.def;
9792 fi~
9793 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9794 else
9795 ld_shlibs=no
9796 fi
9797 ;;
9798
9799 interix[3-9]*)
9800 hardcode_direct=no
9801 hardcode_shlibpath_var=no
9802 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
9803 export_dynamic_flag_spec='${wl}-E'
9804 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
9805 # Instead, shared libraries are loaded at an image base (0x10000000 by
9806 # default) and relocated if they conflict, which is a slow very memory
9807 # consuming and fragmenting process. To avoid this, we pick a random,
9808 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
9809 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
9810 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9811 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'
9812 ;;
9813
9814 gnu* | linux* | tpf* | k*bsd*-gnu)
9815 tmp_diet=no
9816 if test "$host_os" = linux-dietlibc; then
9817 case $cc_basename in
9818 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
9819 esac
9820 fi
9821 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
9822 && test "$tmp_diet" = no
9823 then
9824 tmp_addflag=
9825 tmp_sharedflag='-shared'
9826 case $cc_basename,$host_cpu in
9827 pgcc*) # Portland Group C compiler
9828 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
9829 tmp_addflag=' $pic_flag'
9830 ;;
9831 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
9832 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
9833 tmp_addflag=' $pic_flag -Mnomain' ;;
9834 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
9835 tmp_addflag=' -i_dynamic' ;;
9836 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
9837 tmp_addflag=' -i_dynamic -nofor_main' ;;
9838 ifc* | ifort*) # Intel Fortran compiler
9839 tmp_addflag=' -nofor_main' ;;
9840 lf95*) # Lahey Fortran 8.1
9841 whole_archive_flag_spec=
9842 tmp_sharedflag='--shared' ;;
9843 xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
9844 tmp_sharedflag='-qmkshrobj'
9845 tmp_addflag= ;;
9846 esac
9847 case `$CC -V 2>&1 | sed 5q` in
9848 *Sun\ C*) # Sun C 5.9
9849 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
9850 compiler_needs_object=yes
9851 tmp_sharedflag='-G' ;;
9852 *Sun\ F*) # Sun Fortran 8.3
9853 tmp_sharedflag='-G' ;;
9854 esac
9855 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9856
9857 if test "x$supports_anon_versioning" = xyes; then
9858 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9859 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9860 echo "local: *; };" >> $output_objdir/$libname.ver~
9861 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
9862 fi
9863
9864 case $cc_basename in
9865 xlf*)
9866 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
9867 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
9868 hardcode_libdir_flag_spec=
9869 hardcode_libdir_flag_spec_ld='-rpath $libdir'
9870 archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
9871 if test "x$supports_anon_versioning" = xyes; then
9872 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9873 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9874 echo "local: *; };" >> $output_objdir/$libname.ver~
9875 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
9876 fi
9877 ;;
9878 esac
9879 else
9880 ld_shlibs=no
9881 fi
9882 ;;
9883
9884 netbsd*)
9885 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9886 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
9887 wlarc=
9888 else
9889 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9890 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9891 fi
9892 ;;
9893
9894 solaris*)
9895 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
9896 ld_shlibs=no
9897 cat <<_LT_EOF 1>&2
9898
9899 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
9900 *** create shared libraries on Solaris systems. Therefore, libtool
9901 *** is disabling shared libraries support. We urge you to upgrade GNU
9902 *** binutils to release 2.9.1 or newer. Another option is to modify
9903 *** your PATH or compiler configuration so that the native linker is
9904 *** used, and then restart.
9905
9906 _LT_EOF
9907 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9908 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9909 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9910 else
9911 ld_shlibs=no
9912 fi
9913 ;;
9914
9915 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
9916 case `$LD -v 2>&1` in
9917 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
9918 ld_shlibs=no
9919 cat <<_LT_EOF 1>&2
9920
9921 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
9922 *** reliably create shared libraries on SCO systems. Therefore, libtool
9923 *** is disabling shared libraries support. We urge you to upgrade GNU
9924 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
9925 *** your PATH or compiler configuration so that the native linker is
9926 *** used, and then restart.
9927
9928 _LT_EOF
9929 ;;
9930 *)
9931 # For security reasons, it is highly recommended that you always
9932 # use absolute paths for naming shared libraries, and exclude the
9933 # DT_RUNPATH tag from executables and libraries. But doing so
9934 # requires that you compile everything twice, which is a pain.
9935 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9936 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9937 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9938 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9939 else
9940 ld_shlibs=no
9941 fi
9942 ;;
9943 esac
9944 ;;
9945
9946 sunos4*)
9947 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9948 wlarc=
9949 hardcode_direct=yes
9950 hardcode_shlibpath_var=no
9951 ;;
9952
9953 *)
9954 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9955 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9956 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9957 else
9958 ld_shlibs=no
9959 fi
9960 ;;
9961 esac
9962
9963 if test "$ld_shlibs" = no; then
9964 runpath_var=
9965 hardcode_libdir_flag_spec=
9966 export_dynamic_flag_spec=
9967 whole_archive_flag_spec=
9968 fi
9969 else
9970 # PORTME fill in a description of your system's linker (not GNU ld)
9971 case $host_os in
9972 aix3*)
9973 allow_undefined_flag=unsupported
9974 always_export_symbols=yes
9975 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'
9976 # Note: this linker hardcodes the directories in LIBPATH if there
9977 # are no directories specified by -L.
9978 hardcode_minus_L=yes
9979 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
9980 # Neither direct hardcoding nor static linking is supported with a
9981 # broken collect2.
9982 hardcode_direct=unsupported
9983 fi
9984 ;;
9985
9986 aix[4-9]*)
9987 if test "$host_cpu" = ia64; then
9988 # On IA64, the linker does run time linking by default, so we don't
9989 # have to do anything special.
9990 aix_use_runtimelinking=no
9991 exp_sym_flag='-Bexport'
9992 no_entry_flag=""
9993 else
9994 # If we're using GNU nm, then we don't want the "-C" option.
9995 # -C means demangle to AIX nm, but means don't demangle with GNU nm
9996 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9997 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
9998 else
9999 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'
10000 fi
10001 aix_use_runtimelinking=no
10002
10003 # Test if we are trying to use run time linking or normal
10004 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
10005 # need to do runtime linking.
10006 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
10007 for ld_flag in $LDFLAGS; do
10008 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
10009 aix_use_runtimelinking=yes
10010 break
10011 fi
10012 done
10013 ;;
10014 esac
10015
10016 exp_sym_flag='-bexport'
10017 no_entry_flag='-bnoentry'
10018 fi
10019
10020 # When large executables or shared objects are built, AIX ld can
10021 # have problems creating the table of contents. If linking a library
10022 # or program results in "error TOC overflow" add -mminimal-toc to
10023 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
10024 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10025
10026 archive_cmds=''
10027 hardcode_direct=yes
10028 hardcode_direct_absolute=yes
10029 hardcode_libdir_separator=':'
10030 link_all_deplibs=yes
10031 file_list_spec='${wl}-f,'
10032
10033 if test "$GCC" = yes; then
10034 case $host_os in aix4.[012]|aix4.[012].*)
10035 # We only want to do this on AIX 4.2 and lower, the check
10036 # below for broken collect2 doesn't work under 4.3+
10037 collect2name=`${CC} -print-prog-name=collect2`
10038 if test -f "$collect2name" &&
10039 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
10040 then
10041 # We have reworked collect2
10042 :
10043 else
10044 # We have old collect2
10045 hardcode_direct=unsupported
10046 # It fails to find uninstalled libraries when the uninstalled
10047 # path is not listed in the libpath. Setting hardcode_minus_L
10048 # to unsupported forces relinking
10049 hardcode_minus_L=yes
10050 hardcode_libdir_flag_spec='-L$libdir'
10051 hardcode_libdir_separator=
10052 fi
10053 ;;
10054 esac
10055 shared_flag='-shared'
10056 if test "$aix_use_runtimelinking" = yes; then
10057 shared_flag="$shared_flag "'${wl}-G'
10058 fi
10059 else
10060 # not using gcc
10061 if test "$host_cpu" = ia64; then
10062 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
10063 # chokes on -Wl,-G. The following line is correct:
10064 shared_flag='-G'
10065 else
10066 if test "$aix_use_runtimelinking" = yes; then
10067 shared_flag='${wl}-G'
10068 else
10069 shared_flag='${wl}-bM:SRE'
10070 fi
10071 fi
10072 fi
10073
10074 export_dynamic_flag_spec='${wl}-bexpall'
10075 # It seems that -bexpall does not export symbols beginning with
10076 # underscore (_), so it is better to generate a list of symbols to export.
10077 always_export_symbols=yes
10078 if test "$aix_use_runtimelinking" = yes; then
10079 # Warning - without using the other runtime loading flags (-brtl),
10080 # -berok will link without error, but may produce a broken library.
10081 allow_undefined_flag='-berok'
10082 # Determine the default libpath from the value encoded in an
10083 # empty executable.
10084 cat >conftest.$ac_ext <<_ACEOF
10085 /* confdefs.h. */
10086 _ACEOF
10087 cat confdefs.h >>conftest.$ac_ext
10088 cat >>conftest.$ac_ext <<_ACEOF
10089 /* end confdefs.h. */
10090
10091 int
10092 main ()
10093 {
10094
10095 ;
10096 return 0;
10097 }
10098 _ACEOF
10099 rm -f conftest.$ac_objext conftest$ac_exeext
10100 if { (ac_try="$ac_link"
10101 case "(($ac_try" in
10102 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10103 *) ac_try_echo=$ac_try;;
10104 esac
10105 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10106 $as_echo "$ac_try_echo") >&5
10107 (eval "$ac_link") 2>conftest.er1
10108 ac_status=$?
10109 grep -v '^ *+' conftest.er1 >conftest.err
10110 rm -f conftest.er1
10111 cat conftest.err >&5
10112 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10113 (exit $ac_status); } && {
10114 test -z "$ac_c_werror_flag" ||
10115 test ! -s conftest.err
10116 } && test -s conftest$ac_exeext && {
10117 test "$cross_compiling" = yes ||
10118 $as_test_x conftest$ac_exeext
10119 }; then
10120
10121 lt_aix_libpath_sed='
10122 /Import File Strings/,/^$/ {
10123 /^0/ {
10124 s/^0 *\(.*\)$/\1/
10125 p
10126 }
10127 }'
10128 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10129 # Check for a 64-bit object if we didn't find anything.
10130 if test -z "$aix_libpath"; then
10131 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10132 fi
10133 else
10134 $as_echo "$as_me: failed program was:" >&5
10135 sed 's/^/| /' conftest.$ac_ext >&5
10136
10137
10138 fi
10139
10140 rm -rf conftest.dSYM
10141 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10142 conftest$ac_exeext conftest.$ac_ext
10143 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
10144
10145 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
10146 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
10147 else
10148 if test "$host_cpu" = ia64; then
10149 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
10150 allow_undefined_flag="-z nodefs"
10151 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"
10152 else
10153 # Determine the default libpath from the value encoded in an
10154 # empty executable.
10155 cat >conftest.$ac_ext <<_ACEOF
10156 /* confdefs.h. */
10157 _ACEOF
10158 cat confdefs.h >>conftest.$ac_ext
10159 cat >>conftest.$ac_ext <<_ACEOF
10160 /* end confdefs.h. */
10161
10162 int
10163 main ()
10164 {
10165
10166 ;
10167 return 0;
10168 }
10169 _ACEOF
10170 rm -f conftest.$ac_objext conftest$ac_exeext
10171 if { (ac_try="$ac_link"
10172 case "(($ac_try" in
10173 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10174 *) ac_try_echo=$ac_try;;
10175 esac
10176 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10177 $as_echo "$ac_try_echo") >&5
10178 (eval "$ac_link") 2>conftest.er1
10179 ac_status=$?
10180 grep -v '^ *+' conftest.er1 >conftest.err
10181 rm -f conftest.er1
10182 cat conftest.err >&5
10183 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10184 (exit $ac_status); } && {
10185 test -z "$ac_c_werror_flag" ||
10186 test ! -s conftest.err
10187 } && test -s conftest$ac_exeext && {
10188 test "$cross_compiling" = yes ||
10189 $as_test_x conftest$ac_exeext
10190 }; then
10191
10192 lt_aix_libpath_sed='
10193 /Import File Strings/,/^$/ {
10194 /^0/ {
10195 s/^0 *\(.*\)$/\1/
10196 p
10197 }
10198 }'
10199 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10200 # Check for a 64-bit object if we didn't find anything.
10201 if test -z "$aix_libpath"; then
10202 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10203 fi
10204 else
10205 $as_echo "$as_me: failed program was:" >&5
10206 sed 's/^/| /' conftest.$ac_ext >&5
10207
10208
10209 fi
10210
10211 rm -rf conftest.dSYM
10212 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10213 conftest$ac_exeext conftest.$ac_ext
10214 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
10215
10216 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
10217 # Warning - without using the other run time loading flags,
10218 # -berok will link without error, but may produce a broken library.
10219 no_undefined_flag=' ${wl}-bernotok'
10220 allow_undefined_flag=' ${wl}-berok'
10221 # Exported symbols can be pulled into shared objects from archives
10222 whole_archive_flag_spec='$convenience'
10223 archive_cmds_need_lc=yes
10224 # This is similar to how AIX traditionally builds its shared libraries.
10225 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'
10226 fi
10227 fi
10228 ;;
10229
10230 amigaos*)
10231 case $host_cpu in
10232 powerpc)
10233 # see comment about AmigaOS4 .so support
10234 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10235 archive_expsym_cmds=''
10236 ;;
10237 m68k)
10238 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)'
10239 hardcode_libdir_flag_spec='-L$libdir'
10240 hardcode_minus_L=yes
10241 ;;
10242 esac
10243 ;;
10244
10245 bsdi[45]*)
10246 export_dynamic_flag_spec=-rdynamic
10247 ;;
10248
10249 cygwin* | mingw* | pw32* | cegcc*)
10250 # When not using gcc, we currently assume that we are using
10251 # Microsoft Visual C++.
10252 # hardcode_libdir_flag_spec is actually meaningless, as there is
10253 # no search path for DLLs.
10254 hardcode_libdir_flag_spec=' '
10255 allow_undefined_flag=unsupported
10256 # Tell ltmain to make .lib files, not .a files.
10257 libext=lib
10258 # Tell ltmain to make .dll files, not .so files.
10259 shrext_cmds=".dll"
10260 # FIXME: Setting linknames here is a bad hack.
10261 archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
10262 # The linker will automatically build a .lib file if we build a DLL.
10263 old_archive_from_new_cmds='true'
10264 # FIXME: Should let the user specify the lib program.
10265 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
10266 fix_srcfile_path='`cygpath -w "$srcfile"`'
10267 enable_shared_with_static_runtimes=yes
10268 ;;
10269
10270 darwin* | rhapsody*)
10271
10272
10273 archive_cmds_need_lc=no
10274 hardcode_direct=no
10275 hardcode_automatic=yes
10276 hardcode_shlibpath_var=unsupported
10277 whole_archive_flag_spec=''
10278 link_all_deplibs=yes
10279 allow_undefined_flag="$_lt_dar_allow_undefined"
10280 case $cc_basename in
10281 ifort*) _lt_dar_can_shared=yes ;;
10282 *) _lt_dar_can_shared=$GCC ;;
10283 esac
10284 if test "$_lt_dar_can_shared" = "yes"; then
10285 output_verbose_link_cmd=echo
10286 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
10287 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
10288 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}"
10289 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}"
10290
10291 else
10292 ld_shlibs=no
10293 fi
10294
10295 ;;
10296
10297 dgux*)
10298 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10299 hardcode_libdir_flag_spec='-L$libdir'
10300 hardcode_shlibpath_var=no
10301 ;;
10302
10303 freebsd1*)
10304 ld_shlibs=no
10305 ;;
10306
10307 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
10308 # support. Future versions do this automatically, but an explicit c++rt0.o
10309 # does not break anything, and helps significantly (at the cost of a little
10310 # extra space).
10311 freebsd2.2*)
10312 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
10313 hardcode_libdir_flag_spec='-R$libdir'
10314 hardcode_direct=yes
10315 hardcode_shlibpath_var=no
10316 ;;
10317
10318 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
10319 freebsd2*)
10320 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10321 hardcode_direct=yes
10322 hardcode_minus_L=yes
10323 hardcode_shlibpath_var=no
10324 ;;
10325
10326 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
10327 freebsd* | dragonfly*)
10328 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
10329 hardcode_libdir_flag_spec='-R$libdir'
10330 hardcode_direct=yes
10331 hardcode_shlibpath_var=no
10332 ;;
10333
10334 hpux9*)
10335 if test "$GCC" = yes; then
10336 archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
10337 else
10338 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'
10339 fi
10340 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
10341 hardcode_libdir_separator=:
10342 hardcode_direct=yes
10343
10344 # hardcode_minus_L: Not really in the search PATH,
10345 # but as the default location of the library.
10346 hardcode_minus_L=yes
10347 export_dynamic_flag_spec='${wl}-E'
10348 ;;
10349
10350 hpux10*)
10351 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
10352 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10353 else
10354 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
10355 fi
10356 if test "$with_gnu_ld" = no; then
10357 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
10358 hardcode_libdir_flag_spec_ld='+b $libdir'
10359 hardcode_libdir_separator=:
10360 hardcode_direct=yes
10361 hardcode_direct_absolute=yes
10362 export_dynamic_flag_spec='${wl}-E'
10363 # hardcode_minus_L: Not really in the search PATH,
10364 # but as the default location of the library.
10365 hardcode_minus_L=yes
10366 fi
10367 ;;
10368
10369 hpux11*)
10370 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
10371 case $host_cpu in
10372 hppa*64*)
10373 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10374 ;;
10375 ia64*)
10376 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
10377 ;;
10378 *)
10379 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10380 ;;
10381 esac
10382 else
10383 case $host_cpu in
10384 hppa*64*)
10385 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10386 ;;
10387 ia64*)
10388 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
10389 ;;
10390 *)
10391 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10392 ;;
10393 esac
10394 fi
10395 if test "$with_gnu_ld" = no; then
10396 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
10397 hardcode_libdir_separator=:
10398
10399 case $host_cpu in
10400 hppa*64*|ia64*)
10401 hardcode_direct=no
10402 hardcode_shlibpath_var=no
10403 ;;
10404 *)
10405 hardcode_direct=yes
10406 hardcode_direct_absolute=yes
10407 export_dynamic_flag_spec='${wl}-E'
10408
10409 # hardcode_minus_L: Not really in the search PATH,
10410 # but as the default location of the library.
10411 hardcode_minus_L=yes
10412 ;;
10413 esac
10414 fi
10415 ;;
10416
10417 irix5* | irix6* | nonstopux*)
10418 if test "$GCC" = yes; then
10419 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10420 # Try to use the -exported_symbol ld option, if it does not
10421 # work, assume that -exports_file does not work either and
10422 # implicitly export all symbols.
10423 save_LDFLAGS="$LDFLAGS"
10424 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
10425 cat >conftest.$ac_ext <<_ACEOF
10426 int foo(void) {}
10427 _ACEOF
10428 rm -f conftest.$ac_objext conftest$ac_exeext
10429 if { (ac_try="$ac_link"
10430 case "(($ac_try" in
10431 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10432 *) ac_try_echo=$ac_try;;
10433 esac
10434 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
10435 $as_echo "$ac_try_echo") >&5
10436 (eval "$ac_link") 2>conftest.er1
10437 ac_status=$?
10438 grep -v '^ *+' conftest.er1 >conftest.err
10439 rm -f conftest.er1
10440 cat conftest.err >&5
10441 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10442 (exit $ac_status); } && {
10443 test -z "$ac_c_werror_flag" ||
10444 test ! -s conftest.err
10445 } && test -s conftest$ac_exeext && {
10446 test "$cross_compiling" = yes ||
10447 $as_test_x conftest$ac_exeext
10448 }; then
10449 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
10450
10451 else
10452 $as_echo "$as_me: failed program was:" >&5
10453 sed 's/^/| /' conftest.$ac_ext >&5
10454
10455
10456 fi
10457
10458 rm -rf conftest.dSYM
10459 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10460 conftest$ac_exeext conftest.$ac_ext
10461 LDFLAGS="$save_LDFLAGS"
10462 else
10463 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
10464 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
10465 fi
10466 archive_cmds_need_lc='no'
10467 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10468 hardcode_libdir_separator=:
10469 inherit_rpath=yes
10470 link_all_deplibs=yes
10471 ;;
10472
10473 netbsd*)
10474 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10475 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
10476 else
10477 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
10478 fi
10479 hardcode_libdir_flag_spec='-R$libdir'
10480 hardcode_direct=yes
10481 hardcode_shlibpath_var=no
10482 ;;
10483
10484 newsos6)
10485 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10486 hardcode_direct=yes
10487 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10488 hardcode_libdir_separator=:
10489 hardcode_shlibpath_var=no
10490 ;;
10491
10492 *nto* | *qnx*)
10493 ;;
10494
10495 openbsd*)
10496 if test -f /usr/libexec/ld.so; then
10497 hardcode_direct=yes
10498 hardcode_shlibpath_var=no
10499 hardcode_direct_absolute=yes
10500 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
10501 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10502 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
10503 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
10504 export_dynamic_flag_spec='${wl}-E'
10505 else
10506 case $host_os in
10507 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
10508 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10509 hardcode_libdir_flag_spec='-R$libdir'
10510 ;;
10511 *)
10512 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10513 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
10514 ;;
10515 esac
10516 fi
10517 else
10518 ld_shlibs=no
10519 fi
10520 ;;
10521
10522 os2*)
10523 hardcode_libdir_flag_spec='-L$libdir'
10524 hardcode_minus_L=yes
10525 allow_undefined_flag=unsupported
10526 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'
10527 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
10528 ;;
10529
10530 osf3*)
10531 if test "$GCC" = yes; then
10532 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
10533 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10534 else
10535 allow_undefined_flag=' -expect_unresolved \*'
10536 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
10537 fi
10538 archive_cmds_need_lc='no'
10539 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10540 hardcode_libdir_separator=:
10541 ;;
10542
10543 osf4* | osf5*) # as osf3* with the addition of -msym flag
10544 if test "$GCC" = yes; then
10545 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
10546 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10547 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10548 else
10549 allow_undefined_flag=' -expect_unresolved \*'
10550 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
10551 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~
10552 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
10553
10554 # Both c and cxx compiler support -rpath directly
10555 hardcode_libdir_flag_spec='-rpath $libdir'
10556 fi
10557 archive_cmds_need_lc='no'
10558 hardcode_libdir_separator=:
10559 ;;
10560
10561 solaris*)
10562 no_undefined_flag=' -z defs'
10563 if test "$GCC" = yes; then
10564 wlarc='${wl}'
10565 archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10566 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10567 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10568 else
10569 case `$CC -V 2>&1` in
10570 *"Compilers 5.0"*)
10571 wlarc=''
10572 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
10573 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10574 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
10575 ;;
10576 *)
10577 wlarc='${wl}'
10578 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
10579 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10580 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10581 ;;
10582 esac
10583 fi
10584 hardcode_libdir_flag_spec='-R$libdir'
10585 hardcode_shlibpath_var=no
10586 case $host_os in
10587 solaris2.[0-5] | solaris2.[0-5].*) ;;
10588 *)
10589 # The compiler driver will combine and reorder linker options,
10590 # but understands `-z linker_flag'. GCC discards it without `$wl',
10591 # but is careful enough not to reorder.
10592 # Supported since Solaris 2.6 (maybe 2.5.1?)
10593 if test "$GCC" = yes; then
10594 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
10595 else
10596 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
10597 fi
10598 ;;
10599 esac
10600 link_all_deplibs=yes
10601 ;;
10602
10603 sunos4*)
10604 if test "x$host_vendor" = xsequent; then
10605 # Use $CC to link under sequent, because it throws in some extra .o
10606 # files that make .init and .fini sections work.
10607 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10608 else
10609 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10610 fi
10611 hardcode_libdir_flag_spec='-L$libdir'
10612 hardcode_direct=yes
10613 hardcode_minus_L=yes
10614 hardcode_shlibpath_var=no
10615 ;;
10616
10617 sysv4)
10618 case $host_vendor in
10619 sni)
10620 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10621 hardcode_direct=yes # is this really true???
10622 ;;
10623 siemens)
10624 ## LD is ld it makes a PLAMLIB
10625 ## CC just makes a GrossModule.
10626 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10627 reload_cmds='$CC -r -o $output$reload_objs'
10628 hardcode_direct=no
10629 ;;
10630 motorola)
10631 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10632 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
10633 ;;
10634 esac
10635 runpath_var='LD_RUN_PATH'
10636 hardcode_shlibpath_var=no
10637 ;;
10638
10639 sysv4.3*)
10640 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10641 hardcode_shlibpath_var=no
10642 export_dynamic_flag_spec='-Bexport'
10643 ;;
10644
10645 sysv4*MP*)
10646 if test -d /usr/nec; then
10647 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10648 hardcode_shlibpath_var=no
10649 runpath_var=LD_RUN_PATH
10650 hardcode_runpath_var=yes
10651 ld_shlibs=yes
10652 fi
10653 ;;
10654
10655 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
10656 no_undefined_flag='${wl}-z,text'
10657 archive_cmds_need_lc=no
10658 hardcode_shlibpath_var=no
10659 runpath_var='LD_RUN_PATH'
10660
10661 if test "$GCC" = yes; then
10662 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10663 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10664 else
10665 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10666 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10667 fi
10668 ;;
10669
10670 sysv5* | sco3.2v5* | sco5v6*)
10671 # Note: We can NOT use -z defs as we might desire, because we do not
10672 # link with -lc, and that would cause any symbols used from libc to
10673 # always be unresolved, which means just about no library would
10674 # ever link correctly. If we're not using GNU ld we use -z text
10675 # though, which does catch some bad symbols but isn't as heavy-handed
10676 # as -z defs.
10677 no_undefined_flag='${wl}-z,text'
10678 allow_undefined_flag='${wl}-z,nodefs'
10679 archive_cmds_need_lc=no
10680 hardcode_shlibpath_var=no
10681 hardcode_libdir_flag_spec='${wl}-R,$libdir'
10682 hardcode_libdir_separator=':'
10683 link_all_deplibs=yes
10684 export_dynamic_flag_spec='${wl}-Bexport'
10685 runpath_var='LD_RUN_PATH'
10686
10687 if test "$GCC" = yes; then
10688 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10689 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10690 else
10691 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10692 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10693 fi
10694 ;;
10695
10696 uts4*)
10697 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10698 hardcode_libdir_flag_spec='-L$libdir'
10699 hardcode_shlibpath_var=no
10700 ;;
10701
10702 *)
10703 ld_shlibs=no
10704 ;;
10705 esac
10706
10707 if test x$host_vendor = xsni; then
10708 case $host in
10709 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10710 export_dynamic_flag_spec='${wl}-Blargedynsym'
10711 ;;
10712 esac
10713 fi
10714 fi
10715
10716 { $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
10717 $as_echo "$ld_shlibs" >&6; }
10718 test "$ld_shlibs" = no && can_build_shared=no
10719
10720 with_gnu_ld=$with_gnu_ld
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736 #
10737 # Do we need to explicitly link libc?
10738 #
10739 case "x$archive_cmds_need_lc" in
10740 x|xyes)
10741 # Assume -lc should be added
10742 archive_cmds_need_lc=yes
10743
10744 if test "$enable_shared" = yes && test "$GCC" = yes; then
10745 case $archive_cmds in
10746 *'~'*)
10747 # FIXME: we may have to deal with multi-command sequences.
10748 ;;
10749 '$CC '*)
10750 # Test whether the compiler implicitly links with -lc since on some
10751 # systems, -lgcc has to come before -lc. If gcc already passes -lc
10752 # to ld, don't add -lc before -lgcc.
10753 { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
10754 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
10755 $RM conftest*
10756 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10757
10758 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10759 (eval $ac_compile) 2>&5
10760 ac_status=$?
10761 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10762 (exit $ac_status); } 2>conftest.err; then
10763 soname=conftest
10764 lib=conftest
10765 libobjs=conftest.$ac_objext
10766 deplibs=
10767 wl=$lt_prog_compiler_wl
10768 pic_flag=$lt_prog_compiler_pic
10769 compiler_flags=-v
10770 linker_flags=-v
10771 verstring=
10772 output_objdir=.
10773 libname=conftest
10774 lt_save_allow_undefined_flag=$allow_undefined_flag
10775 allow_undefined_flag=
10776 if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
10777 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
10778 ac_status=$?
10779 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
10780 (exit $ac_status); }
10781 then
10782 archive_cmds_need_lc=no
10783 else
10784 archive_cmds_need_lc=yes
10785 fi
10786 allow_undefined_flag=$lt_save_allow_undefined_flag
10787 else
10788 cat conftest.err 1>&5
10789 fi
10790 $RM conftest*
10791 { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
10792 $as_echo "$archive_cmds_need_lc" >&6; }
10793 ;;
10794 esac
10795 fi
10796 ;;
10797 esac
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955 { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
10956 $as_echo_n "checking dynamic linker characteristics... " >&6; }
10957
10958 if test "$GCC" = yes; then
10959 case $host_os in
10960 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
10961 *) lt_awk_arg="/^libraries:/" ;;
10962 esac
10963 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
10964 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
10965 # if the path contains ";" then we assume it to be the separator
10966 # otherwise default to the standard path separator (i.e. ":") - it is
10967 # assumed that no part of a normal pathname contains ";" but that should
10968 # okay in the real world where ";" in dirpaths is itself problematic.
10969 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
10970 else
10971 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10972 fi
10973 # Ok, now we have the path, separated by spaces, we can step through it
10974 # and add multilib dir if necessary.
10975 lt_tmp_lt_search_path_spec=
10976 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
10977 for lt_sys_path in $lt_search_path_spec; do
10978 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
10979 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
10980 else
10981 test -d "$lt_sys_path" && \
10982 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
10983 fi
10984 done
10985 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
10986 BEGIN {RS=" "; FS="/|\n";} {
10987 lt_foo="";
10988 lt_count=0;
10989 for (lt_i = NF; lt_i > 0; lt_i--) {
10990 if ($lt_i != "" && $lt_i != ".") {
10991 if ($lt_i == "..") {
10992 lt_count++;
10993 } else {
10994 if (lt_count == 0) {
10995 lt_foo="/" $lt_i lt_foo;
10996 } else {
10997 lt_count--;
10998 }
10999 }
11000 }
11001 }
11002 if (lt_foo != "") { lt_freq[lt_foo]++; }
11003 if (lt_freq[lt_foo] == 1) { print lt_foo; }
11004 }'`
11005 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
11006 else
11007 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
11008 fi
11009 library_names_spec=
11010 libname_spec='lib$name'
11011 soname_spec=
11012 shrext_cmds=".so"
11013 postinstall_cmds=
11014 postuninstall_cmds=
11015 finish_cmds=
11016 finish_eval=
11017 shlibpath_var=
11018 shlibpath_overrides_runpath=unknown
11019 version_type=none
11020 dynamic_linker="$host_os ld.so"
11021 sys_lib_dlsearch_path_spec="/lib /usr/lib"
11022 need_lib_prefix=unknown
11023 hardcode_into_libs=no
11024
11025 # when you set need_version to no, make sure it does not cause -set_version
11026 # flags to be left without arguments
11027 need_version=unknown
11028
11029 case $host_os in
11030 aix3*)
11031 version_type=linux
11032 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
11033 shlibpath_var=LIBPATH
11034
11035 # AIX 3 has no versioning support, so we append a major version to the name.
11036 soname_spec='${libname}${release}${shared_ext}$major'
11037 ;;
11038
11039 aix[4-9]*)
11040 version_type=linux
11041 need_lib_prefix=no
11042 need_version=no
11043 hardcode_into_libs=yes
11044 if test "$host_cpu" = ia64; then
11045 # AIX 5 supports IA64
11046 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
11047 shlibpath_var=LD_LIBRARY_PATH
11048 else
11049 # With GCC up to 2.95.x, collect2 would create an import file
11050 # for dependence libraries. The import file would start with
11051 # the line `#! .'. This would cause the generated library to
11052 # depend on `.', always an invalid library. This was fixed in
11053 # development snapshots of GCC prior to 3.0.
11054 case $host_os in
11055 aix4 | aix4.[01] | aix4.[01].*)
11056 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
11057 echo ' yes '
11058 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
11059 :
11060 else
11061 can_build_shared=no
11062 fi
11063 ;;
11064 esac
11065 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
11066 # soname into executable. Probably we can add versioning support to
11067 # collect2, so additional links can be useful in future.
11068 if test "$aix_use_runtimelinking" = yes; then
11069 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
11070 # instead of lib<name>.a to let people know that these are not
11071 # typical AIX shared libraries.
11072 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11073 else
11074 # We preserve .a as extension for shared libraries through AIX4.2
11075 # and later when we are not doing run time linking.
11076 library_names_spec='${libname}${release}.a $libname.a'
11077 soname_spec='${libname}${release}${shared_ext}$major'
11078 fi
11079 shlibpath_var=LIBPATH
11080 fi
11081 ;;
11082
11083 amigaos*)
11084 case $host_cpu in
11085 powerpc)
11086 # Since July 2007 AmigaOS4 officially supports .so libraries.
11087 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
11088 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11089 ;;
11090 m68k)
11091 library_names_spec='$libname.ixlibrary $libname.a'
11092 # Create ${libname}_ixlibrary.a entries in /sys/libs.
11093 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
11094 ;;
11095 esac
11096 ;;
11097
11098 beos*)
11099 library_names_spec='${libname}${shared_ext}'
11100 dynamic_linker="$host_os ld.so"
11101 shlibpath_var=LIBRARY_PATH
11102 ;;
11103
11104 bsdi[45]*)
11105 version_type=linux
11106 need_version=no
11107 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11108 soname_spec='${libname}${release}${shared_ext}$major'
11109 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
11110 shlibpath_var=LD_LIBRARY_PATH
11111 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
11112 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
11113 # the default ld.so.conf also contains /usr/contrib/lib and
11114 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
11115 # libtool to hard-code these into programs
11116 ;;
11117
11118 cygwin* | mingw* | pw32* | cegcc*)
11119 version_type=windows
11120 shrext_cmds=".dll"
11121 need_version=no
11122 need_lib_prefix=no
11123
11124 case $GCC,$host_os in
11125 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
11126 library_names_spec='$libname.dll.a'
11127 # DLL is installed to $(libdir)/../bin by postinstall_cmds
11128 postinstall_cmds='base_file=`basename \${file}`~
11129 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
11130 dldir=$destdir/`dirname \$dlpath`~
11131 test -d \$dldir || mkdir -p \$dldir~
11132 $install_prog $dir/$dlname \$dldir/$dlname~
11133 chmod a+x \$dldir/$dlname~
11134 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
11135 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
11136 fi'
11137 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
11138 dlpath=$dir/\$dldll~
11139 $RM \$dlpath'
11140 shlibpath_overrides_runpath=yes
11141
11142 case $host_os in
11143 cygwin*)
11144 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
11145 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
11146 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
11147 ;;
11148 mingw* | cegcc*)
11149 # MinGW DLLs use traditional 'lib' prefix
11150 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
11151 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
11152 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
11153 # It is most probably a Windows format PATH printed by
11154 # mingw gcc, but we are running on Cygwin. Gcc prints its search
11155 # path with ; separators, and with drive letters. We can handle the
11156 # drive letters (cygwin fileutils understands them), so leave them,
11157 # especially as we might pass files found there to a mingw objdump,
11158 # which wouldn't understand a cygwinified path. Ahh.
11159 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
11160 else
11161 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
11162 fi
11163 ;;
11164 pw32*)
11165 # pw32 DLLs use 'pw' prefix rather than 'lib'
11166 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
11167 ;;
11168 esac
11169 ;;
11170
11171 *)
11172 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
11173 ;;
11174 esac
11175 dynamic_linker='Win32 ld.exe'
11176 # FIXME: first we should search . and the directory the executable is in
11177 shlibpath_var=PATH
11178 ;;
11179
11180 darwin* | rhapsody*)
11181 dynamic_linker="$host_os dyld"
11182 version_type=darwin
11183 need_lib_prefix=no
11184 need_version=no
11185 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
11186 soname_spec='${libname}${release}${major}$shared_ext'
11187 shlibpath_overrides_runpath=yes
11188 shlibpath_var=DYLD_LIBRARY_PATH
11189 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
11190
11191 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
11192 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
11193 ;;
11194
11195 dgux*)
11196 version_type=linux
11197 need_lib_prefix=no
11198 need_version=no
11199 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
11200 soname_spec='${libname}${release}${shared_ext}$major'
11201 shlibpath_var=LD_LIBRARY_PATH
11202 ;;
11203
11204 freebsd1*)
11205 dynamic_linker=no
11206 ;;
11207
11208 freebsd* | dragonfly*)
11209 # DragonFly does not have aout. When/if they implement a new
11210 # versioning mechanism, adjust this.
11211 if test -x /usr/bin/objformat; then
11212 objformat=`/usr/bin/objformat`
11213 else
11214 case $host_os in
11215 freebsd[123]*) objformat=aout ;;
11216 *) objformat=elf ;;
11217 esac
11218 fi
11219 version_type=freebsd-$objformat
11220 case $version_type in
11221 freebsd-elf*)
11222 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
11223 need_version=no
11224 need_lib_prefix=no
11225 ;;
11226 freebsd-*)
11227 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
11228 need_version=yes
11229 ;;
11230 esac
11231 shlibpath_var=LD_LIBRARY_PATH
11232 case $host_os in
11233 freebsd2*)
11234 shlibpath_overrides_runpath=yes
11235 ;;
11236 freebsd3.[01]* | freebsdelf3.[01]*)
11237 shlibpath_overrides_runpath=yes
11238 hardcode_into_libs=yes
11239 ;;
11240 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
11241 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
11242 shlibpath_overrides_runpath=no
11243 hardcode_into_libs=yes
11244 ;;
11245 *) # from 4.6 on, and DragonFly
11246 shlibpath_overrides_runpath=yes
11247 hardcode_into_libs=yes
11248 ;;
11249 esac
11250 ;;
11251
11252 gnu*)
11253 version_type=linux
11254 need_lib_prefix=no
11255 need_version=no
11256 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
11257 soname_spec='${libname}${release}${shared_ext}$major'
11258 shlibpath_var=LD_LIBRARY_PATH
11259 hardcode_into_libs=yes
11260 ;;
11261
11262 hpux9* | hpux10* | hpux11*)
11263 # Give a soname corresponding to the major version so that dld.sl refuses to
11264 # link against other versions.
11265 version_type=sunos
11266 need_lib_prefix=no
11267 need_version=no
11268 case $host_cpu in
11269 ia64*)
11270 shrext_cmds='.so'
11271 hardcode_into_libs=yes
11272 dynamic_linker="$host_os dld.so"
11273 shlibpath_var=LD_LIBRARY_PATH
11274 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
11275 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11276 soname_spec='${libname}${release}${shared_ext}$major'
11277 if test "X$HPUX_IA64_MODE" = X32; then
11278 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
11279 else
11280 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
11281 fi
11282 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
11283 ;;
11284 hppa*64*)
11285 shrext_cmds='.sl'
11286 hardcode_into_libs=yes
11287 dynamic_linker="$host_os dld.sl"
11288 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
11289 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
11290 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11291 soname_spec='${libname}${release}${shared_ext}$major'
11292 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
11293 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
11294 ;;
11295 *)
11296 shrext_cmds='.sl'
11297 dynamic_linker="$host_os dld.sl"
11298 shlibpath_var=SHLIB_PATH
11299 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
11300 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11301 soname_spec='${libname}${release}${shared_ext}$major'
11302 ;;
11303 esac
11304 # HP-UX runs *really* slowly unless shared libraries are mode 555.
11305 postinstall_cmds='chmod 555 $lib'
11306 ;;
11307
11308 interix[3-9]*)
11309 version_type=linux
11310 need_lib_prefix=no
11311 need_version=no
11312 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
11313 soname_spec='${libname}${release}${shared_ext}$major'
11314 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
11315 shlibpath_var=LD_LIBRARY_PATH
11316 shlibpath_overrides_runpath=no
11317 hardcode_into_libs=yes
11318 ;;
11319
11320 irix5* | irix6* | nonstopux*)
11321 case $host_os in
11322 nonstopux*) version_type=nonstopux ;;
11323 *)
11324 if test "$lt_cv_prog_gnu_ld" = yes; then
11325 version_type=linux
11326 else
11327 version_type=irix
11328 fi ;;
11329 esac
11330 need_lib_prefix=no
11331 need_version=no
11332 soname_spec='${libname}${release}${shared_ext}$major'
11333 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
11334 case $host_os in
11335 irix5* | nonstopux*)
11336 libsuff= shlibsuff=
11337 ;;
11338 *)
11339 case $LD in # libtool.m4 will add one of these switches to LD
11340 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
11341 libsuff= shlibsuff= libmagic=32-bit;;
11342 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
11343 libsuff=32 shlibsuff=N32 libmagic=N32;;
11344 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
11345 libsuff=64 shlibsuff=64 libmagic=64-bit;;
11346 *) libsuff= shlibsuff= libmagic=never-match;;
11347 esac
11348 ;;
11349 esac
11350 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
11351 shlibpath_overrides_runpath=no
11352 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
11353 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
11354 hardcode_into_libs=yes
11355 ;;
11356
11357 # No shared lib support for Linux oldld, aout, or coff.
11358 linux*oldld* | linux*aout* | linux*coff*)
11359 dynamic_linker=no
11360 ;;
11361
11362 # This must be Linux ELF.
11363 linux* | k*bsd*-gnu)
11364 version_type=linux
11365 need_lib_prefix=no
11366 need_version=no
11367 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11368 soname_spec='${libname}${release}${shared_ext}$major'
11369 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
11370 shlibpath_var=LD_LIBRARY_PATH
11371 shlibpath_overrides_runpath=no
11372 # Some binutils ld are patched to set DT_RUNPATH
11373 save_LDFLAGS=$LDFLAGS
11374 save_libdir=$libdir
11375 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
11376 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
11377 cat >conftest.$ac_ext <<_ACEOF
11378 /* confdefs.h. */
11379 _ACEOF
11380 cat confdefs.h >>conftest.$ac_ext
11381 cat >>conftest.$ac_ext <<_ACEOF
11382 /* end confdefs.h. */
11383
11384 int
11385 main ()
11386 {
11387
11388 ;
11389 return 0;
11390 }
11391 _ACEOF
11392 rm -f conftest.$ac_objext conftest$ac_exeext
11393 if { (ac_try="$ac_link"
11394 case "(($ac_try" in
11395 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11396 *) ac_try_echo=$ac_try;;
11397 esac
11398 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11399 $as_echo "$ac_try_echo") >&5
11400 (eval "$ac_link") 2>conftest.er1
11401 ac_status=$?
11402 grep -v '^ *+' conftest.er1 >conftest.err
11403 rm -f conftest.er1
11404 cat conftest.err >&5
11405 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11406 (exit $ac_status); } && {
11407 test -z "$ac_c_werror_flag" ||
11408 test ! -s conftest.err
11409 } && test -s conftest$ac_exeext && {
11410 test "$cross_compiling" = yes ||
11411 $as_test_x conftest$ac_exeext
11412 }; then
11413 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
11414 shlibpath_overrides_runpath=yes
11415 fi
11416
11417 else
11418 $as_echo "$as_me: failed program was:" >&5
11419 sed 's/^/| /' conftest.$ac_ext >&5
11420
11421
11422 fi
11423
11424 rm -rf conftest.dSYM
11425 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11426 conftest$ac_exeext conftest.$ac_ext
11427 LDFLAGS=$save_LDFLAGS
11428 libdir=$save_libdir
11429
11430 # This implies no fast_install, which is unacceptable.
11431 # Some rework will be needed to allow for fast_install
11432 # before this can be enabled.
11433 hardcode_into_libs=yes
11434
11435 # Add ABI-specific directories to the system library path.
11436 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
11437
11438 # Append ld.so.conf contents to the search path
11439 if test -f /etc/ld.so.conf; then
11440 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
11441 sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
11442 fi
11443
11444 # We used to test for /lib/ld.so.1 and disable shared libraries on
11445 # powerpc, because MkLinux only supported shared libraries with the
11446 # GNU dynamic linker. Since this was broken with cross compilers,
11447 # most powerpc-linux boxes support dynamic linking these days and
11448 # people can always --disable-shared, the test was removed, and we
11449 # assume the GNU/Linux dynamic linker is in use.
11450 dynamic_linker='GNU/Linux ld.so'
11451 ;;
11452
11453 netbsd*)
11454 version_type=sunos
11455 need_lib_prefix=no
11456 need_version=no
11457 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
11458 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
11459 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
11460 dynamic_linker='NetBSD (a.out) ld.so'
11461 else
11462 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
11463 soname_spec='${libname}${release}${shared_ext}$major'
11464 dynamic_linker='NetBSD ld.elf_so'
11465 fi
11466 shlibpath_var=LD_LIBRARY_PATH
11467 shlibpath_overrides_runpath=yes
11468 hardcode_into_libs=yes
11469 ;;
11470
11471 newsos6)
11472 version_type=linux
11473 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11474 shlibpath_var=LD_LIBRARY_PATH
11475 shlibpath_overrides_runpath=yes
11476 ;;
11477
11478 *nto* | *qnx*)
11479 version_type=qnx
11480 need_lib_prefix=no
11481 need_version=no
11482 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11483 soname_spec='${libname}${release}${shared_ext}$major'
11484 shlibpath_var=LD_LIBRARY_PATH
11485 shlibpath_overrides_runpath=no
11486 hardcode_into_libs=yes
11487 dynamic_linker='ldqnx.so'
11488 ;;
11489
11490 openbsd*)
11491 version_type=sunos
11492 sys_lib_dlsearch_path_spec="/usr/lib"
11493 need_lib_prefix=no
11494 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
11495 case $host_os in
11496 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
11497 *) need_version=no ;;
11498 esac
11499 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
11500 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
11501 shlibpath_var=LD_LIBRARY_PATH
11502 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11503 case $host_os in
11504 openbsd2.[89] | openbsd2.[89].*)
11505 shlibpath_overrides_runpath=no
11506 ;;
11507 *)
11508 shlibpath_overrides_runpath=yes
11509 ;;
11510 esac
11511 else
11512 shlibpath_overrides_runpath=yes
11513 fi
11514 ;;
11515
11516 os2*)
11517 libname_spec='$name'
11518 shrext_cmds=".dll"
11519 need_lib_prefix=no
11520 library_names_spec='$libname${shared_ext} $libname.a'
11521 dynamic_linker='OS/2 ld.exe'
11522 shlibpath_var=LIBPATH
11523 ;;
11524
11525 osf3* | osf4* | osf5*)
11526 version_type=osf
11527 need_lib_prefix=no
11528 need_version=no
11529 soname_spec='${libname}${release}${shared_ext}$major'
11530 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11531 shlibpath_var=LD_LIBRARY_PATH
11532 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
11533 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
11534 ;;
11535
11536 rdos*)
11537 dynamic_linker=no
11538 ;;
11539
11540 solaris*)
11541 version_type=linux
11542 need_lib_prefix=no
11543 need_version=no
11544 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11545 soname_spec='${libname}${release}${shared_ext}$major'
11546 shlibpath_var=LD_LIBRARY_PATH
11547 shlibpath_overrides_runpath=yes
11548 hardcode_into_libs=yes
11549 # ldd complains unless libraries are executable
11550 postinstall_cmds='chmod +x $lib'
11551 ;;
11552
11553 sunos4*)
11554 version_type=sunos
11555 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
11556 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
11557 shlibpath_var=LD_LIBRARY_PATH
11558 shlibpath_overrides_runpath=yes
11559 if test "$with_gnu_ld" = yes; then
11560 need_lib_prefix=no
11561 fi
11562 need_version=yes
11563 ;;
11564
11565 sysv4 | sysv4.3*)
11566 version_type=linux
11567 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11568 soname_spec='${libname}${release}${shared_ext}$major'
11569 shlibpath_var=LD_LIBRARY_PATH
11570 case $host_vendor in
11571 sni)
11572 shlibpath_overrides_runpath=no
11573 need_lib_prefix=no
11574 runpath_var=LD_RUN_PATH
11575 ;;
11576 siemens)
11577 need_lib_prefix=no
11578 ;;
11579 motorola)
11580 need_lib_prefix=no
11581 need_version=no
11582 shlibpath_overrides_runpath=no
11583 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
11584 ;;
11585 esac
11586 ;;
11587
11588 sysv4*MP*)
11589 if test -d /usr/nec ;then
11590 version_type=linux
11591 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
11592 soname_spec='$libname${shared_ext}.$major'
11593 shlibpath_var=LD_LIBRARY_PATH
11594 fi
11595 ;;
11596
11597 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
11598 version_type=freebsd-elf
11599 need_lib_prefix=no
11600 need_version=no
11601 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
11602 soname_spec='${libname}${release}${shared_ext}$major'
11603 shlibpath_var=LD_LIBRARY_PATH
11604 shlibpath_overrides_runpath=yes
11605 hardcode_into_libs=yes
11606 if test "$with_gnu_ld" = yes; then
11607 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
11608 else
11609 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
11610 case $host_os in
11611 sco3.2v5*)
11612 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
11613 ;;
11614 esac
11615 fi
11616 sys_lib_dlsearch_path_spec='/usr/lib'
11617 ;;
11618
11619 tpf*)
11620 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
11621 version_type=linux
11622 need_lib_prefix=no
11623 need_version=no
11624 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11625 shlibpath_var=LD_LIBRARY_PATH
11626 shlibpath_overrides_runpath=no
11627 hardcode_into_libs=yes
11628 ;;
11629
11630 uts4*)
11631 version_type=linux
11632 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11633 soname_spec='${libname}${release}${shared_ext}$major'
11634 shlibpath_var=LD_LIBRARY_PATH
11635 ;;
11636
11637 *)
11638 dynamic_linker=no
11639 ;;
11640 esac
11641 { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
11642 $as_echo "$dynamic_linker" >&6; }
11643 test "$dynamic_linker" = no && can_build_shared=no
11644
11645 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11646 if test "$GCC" = yes; then
11647 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
11648 fi
11649
11650 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
11651 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
11652 fi
11653 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
11654 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
11655 fi
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743 { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
11744 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
11745 hardcode_action=
11746 if test -n "$hardcode_libdir_flag_spec" ||
11747 test -n "$runpath_var" ||
11748 test "X$hardcode_automatic" = "Xyes" ; then
11749
11750 # We can hardcode non-existent directories.
11751 if test "$hardcode_direct" != no &&
11752 # If the only mechanism to avoid hardcoding is shlibpath_var, we
11753 # have to relink, otherwise we might link with an installed library
11754 # when we should be linking with a yet-to-be-installed one
11755 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
11756 test "$hardcode_minus_L" != no; then
11757 # Linking always hardcodes the temporary library directory.
11758 hardcode_action=relink
11759 else
11760 # We can link without hardcoding, and we can hardcode nonexisting dirs.
11761 hardcode_action=immediate
11762 fi
11763 else
11764 # We cannot hardcode anything, or else we can only hardcode existing
11765 # directories.
11766 hardcode_action=unsupported
11767 fi
11768 { $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
11769 $as_echo "$hardcode_action" >&6; }
11770
11771 if test "$hardcode_action" = relink ||
11772 test "$inherit_rpath" = yes; then
11773 # Fast installation is not supported
11774 enable_fast_install=no
11775 elif test "$shlibpath_overrides_runpath" = yes ||
11776 test "$enable_shared" = no; then
11777 # Fast installation is not necessary
11778 enable_fast_install=needless
11779 fi
11780
11781
11782
11783
11784
11785
11786 if test "x$enable_dlopen" != xyes; then
11787 enable_dlopen=unknown
11788 enable_dlopen_self=unknown
11789 enable_dlopen_self_static=unknown
11790 else
11791 lt_cv_dlopen=no
11792 lt_cv_dlopen_libs=
11793
11794 case $host_os in
11795 beos*)
11796 lt_cv_dlopen="load_add_on"
11797 lt_cv_dlopen_libs=
11798 lt_cv_dlopen_self=yes
11799 ;;
11800
11801 mingw* | pw32* | cegcc*)
11802 lt_cv_dlopen="LoadLibrary"
11803 lt_cv_dlopen_libs=
11804 ;;
11805
11806 cygwin*)
11807 lt_cv_dlopen="dlopen"
11808 lt_cv_dlopen_libs=
11809 ;;
11810
11811 darwin*)
11812 # if libdl is installed we need to link against it
11813 { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
11814 $as_echo_n "checking for dlopen in -ldl... " >&6; }
11815 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
11816 $as_echo_n "(cached) " >&6
11817 else
11818 ac_check_lib_save_LIBS=$LIBS
11819 LIBS="-ldl $LIBS"
11820 cat >conftest.$ac_ext <<_ACEOF
11821 /* confdefs.h. */
11822 _ACEOF
11823 cat confdefs.h >>conftest.$ac_ext
11824 cat >>conftest.$ac_ext <<_ACEOF
11825 /* end confdefs.h. */
11826
11827 /* Override any GCC internal prototype to avoid an error.
11828 Use char because int might match the return type of a GCC
11829 builtin and then its argument prototype would still apply. */
11830 #ifdef __cplusplus
11831 extern "C"
11832 #endif
11833 char dlopen ();
11834 int
11835 main ()
11836 {
11837 return dlopen ();
11838 ;
11839 return 0;
11840 }
11841 _ACEOF
11842 rm -f conftest.$ac_objext conftest$ac_exeext
11843 if { (ac_try="$ac_link"
11844 case "(($ac_try" in
11845 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11846 *) ac_try_echo=$ac_try;;
11847 esac
11848 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11849 $as_echo "$ac_try_echo") >&5
11850 (eval "$ac_link") 2>conftest.er1
11851 ac_status=$?
11852 grep -v '^ *+' conftest.er1 >conftest.err
11853 rm -f conftest.er1
11854 cat conftest.err >&5
11855 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11856 (exit $ac_status); } && {
11857 test -z "$ac_c_werror_flag" ||
11858 test ! -s conftest.err
11859 } && test -s conftest$ac_exeext && {
11860 test "$cross_compiling" = yes ||
11861 $as_test_x conftest$ac_exeext
11862 }; then
11863 ac_cv_lib_dl_dlopen=yes
11864 else
11865 $as_echo "$as_me: failed program was:" >&5
11866 sed 's/^/| /' conftest.$ac_ext >&5
11867
11868 ac_cv_lib_dl_dlopen=no
11869 fi
11870
11871 rm -rf conftest.dSYM
11872 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11873 conftest$ac_exeext conftest.$ac_ext
11874 LIBS=$ac_check_lib_save_LIBS
11875 fi
11876 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
11877 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
11878 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
11879 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
11880 else
11881
11882 lt_cv_dlopen="dyld"
11883 lt_cv_dlopen_libs=
11884 lt_cv_dlopen_self=yes
11885
11886 fi
11887
11888 ;;
11889
11890 *)
11891 { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
11892 $as_echo_n "checking for shl_load... " >&6; }
11893 if test "${ac_cv_func_shl_load+set}" = set; then
11894 $as_echo_n "(cached) " >&6
11895 else
11896 cat >conftest.$ac_ext <<_ACEOF
11897 /* confdefs.h. */
11898 _ACEOF
11899 cat confdefs.h >>conftest.$ac_ext
11900 cat >>conftest.$ac_ext <<_ACEOF
11901 /* end confdefs.h. */
11902 /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
11903 For example, HP-UX 11i <limits.h> declares gettimeofday. */
11904 #define shl_load innocuous_shl_load
11905
11906 /* System header to define __stub macros and hopefully few prototypes,
11907 which can conflict with char shl_load (); below.
11908 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
11909 <limits.h> exists even on freestanding compilers. */
11910
11911 #ifdef __STDC__
11912 # include <limits.h>
11913 #else
11914 # include <assert.h>
11915 #endif
11916
11917 #undef shl_load
11918
11919 /* Override any GCC internal prototype to avoid an error.
11920 Use char because int might match the return type of a GCC
11921 builtin and then its argument prototype would still apply. */
11922 #ifdef __cplusplus
11923 extern "C"
11924 #endif
11925 char shl_load ();
11926 /* The GNU C library defines this for functions which it implements
11927 to always fail with ENOSYS. Some functions are actually named
11928 something starting with __ and the normal name is an alias. */
11929 #if defined __stub_shl_load || defined __stub___shl_load
11930 choke me
11931 #endif
11932
11933 int
11934 main ()
11935 {
11936 return shl_load ();
11937 ;
11938 return 0;
11939 }
11940 _ACEOF
11941 rm -f conftest.$ac_objext conftest$ac_exeext
11942 if { (ac_try="$ac_link"
11943 case "(($ac_try" in
11944 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11945 *) ac_try_echo=$ac_try;;
11946 esac
11947 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
11948 $as_echo "$ac_try_echo") >&5
11949 (eval "$ac_link") 2>conftest.er1
11950 ac_status=$?
11951 grep -v '^ *+' conftest.er1 >conftest.err
11952 rm -f conftest.er1
11953 cat conftest.err >&5
11954 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
11955 (exit $ac_status); } && {
11956 test -z "$ac_c_werror_flag" ||
11957 test ! -s conftest.err
11958 } && test -s conftest$ac_exeext && {
11959 test "$cross_compiling" = yes ||
11960 $as_test_x conftest$ac_exeext
11961 }; then
11962 ac_cv_func_shl_load=yes
11963 else
11964 $as_echo "$as_me: failed program was:" >&5
11965 sed 's/^/| /' conftest.$ac_ext >&5
11966
11967 ac_cv_func_shl_load=no
11968 fi
11969
11970 rm -rf conftest.dSYM
11971 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11972 conftest$ac_exeext conftest.$ac_ext
11973 fi
11974 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
11975 $as_echo "$ac_cv_func_shl_load" >&6; }
11976 if test "x$ac_cv_func_shl_load" = x""yes; then
11977 lt_cv_dlopen="shl_load"
11978 else
11979 { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
11980 $as_echo_n "checking for shl_load in -ldld... " >&6; }
11981 if test "${ac_cv_lib_dld_shl_load+set}" = set; then
11982 $as_echo_n "(cached) " >&6
11983 else
11984 ac_check_lib_save_LIBS=$LIBS
11985 LIBS="-ldld $LIBS"
11986 cat >conftest.$ac_ext <<_ACEOF
11987 /* confdefs.h. */
11988 _ACEOF
11989 cat confdefs.h >>conftest.$ac_ext
11990 cat >>conftest.$ac_ext <<_ACEOF
11991 /* end confdefs.h. */
11992
11993 /* Override any GCC internal prototype to avoid an error.
11994 Use char because int might match the return type of a GCC
11995 builtin and then its argument prototype would still apply. */
11996 #ifdef __cplusplus
11997 extern "C"
11998 #endif
11999 char shl_load ();
12000 int
12001 main ()
12002 {
12003 return shl_load ();
12004 ;
12005 return 0;
12006 }
12007 _ACEOF
12008 rm -f conftest.$ac_objext conftest$ac_exeext
12009 if { (ac_try="$ac_link"
12010 case "(($ac_try" in
12011 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12012 *) ac_try_echo=$ac_try;;
12013 esac
12014 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12015 $as_echo "$ac_try_echo") >&5
12016 (eval "$ac_link") 2>conftest.er1
12017 ac_status=$?
12018 grep -v '^ *+' conftest.er1 >conftest.err
12019 rm -f conftest.er1
12020 cat conftest.err >&5
12021 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12022 (exit $ac_status); } && {
12023 test -z "$ac_c_werror_flag" ||
12024 test ! -s conftest.err
12025 } && test -s conftest$ac_exeext && {
12026 test "$cross_compiling" = yes ||
12027 $as_test_x conftest$ac_exeext
12028 }; then
12029 ac_cv_lib_dld_shl_load=yes
12030 else
12031 $as_echo "$as_me: failed program was:" >&5
12032 sed 's/^/| /' conftest.$ac_ext >&5
12033
12034 ac_cv_lib_dld_shl_load=no
12035 fi
12036
12037 rm -rf conftest.dSYM
12038 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12039 conftest$ac_exeext conftest.$ac_ext
12040 LIBS=$ac_check_lib_save_LIBS
12041 fi
12042 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
12043 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
12044 if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
12045 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
12046 else
12047 { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
12048 $as_echo_n "checking for dlopen... " >&6; }
12049 if test "${ac_cv_func_dlopen+set}" = set; then
12050 $as_echo_n "(cached) " >&6
12051 else
12052 cat >conftest.$ac_ext <<_ACEOF
12053 /* confdefs.h. */
12054 _ACEOF
12055 cat confdefs.h >>conftest.$ac_ext
12056 cat >>conftest.$ac_ext <<_ACEOF
12057 /* end confdefs.h. */
12058 /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
12059 For example, HP-UX 11i <limits.h> declares gettimeofday. */
12060 #define dlopen innocuous_dlopen
12061
12062 /* System header to define __stub macros and hopefully few prototypes,
12063 which can conflict with char dlopen (); below.
12064 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
12065 <limits.h> exists even on freestanding compilers. */
12066
12067 #ifdef __STDC__
12068 # include <limits.h>
12069 #else
12070 # include <assert.h>
12071 #endif
12072
12073 #undef dlopen
12074
12075 /* Override any GCC internal prototype to avoid an error.
12076 Use char because int might match the return type of a GCC
12077 builtin and then its argument prototype would still apply. */
12078 #ifdef __cplusplus
12079 extern "C"
12080 #endif
12081 char dlopen ();
12082 /* The GNU C library defines this for functions which it implements
12083 to always fail with ENOSYS. Some functions are actually named
12084 something starting with __ and the normal name is an alias. */
12085 #if defined __stub_dlopen || defined __stub___dlopen
12086 choke me
12087 #endif
12088
12089 int
12090 main ()
12091 {
12092 return dlopen ();
12093 ;
12094 return 0;
12095 }
12096 _ACEOF
12097 rm -f conftest.$ac_objext conftest$ac_exeext
12098 if { (ac_try="$ac_link"
12099 case "(($ac_try" in
12100 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12101 *) ac_try_echo=$ac_try;;
12102 esac
12103 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12104 $as_echo "$ac_try_echo") >&5
12105 (eval "$ac_link") 2>conftest.er1
12106 ac_status=$?
12107 grep -v '^ *+' conftest.er1 >conftest.err
12108 rm -f conftest.er1
12109 cat conftest.err >&5
12110 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12111 (exit $ac_status); } && {
12112 test -z "$ac_c_werror_flag" ||
12113 test ! -s conftest.err
12114 } && test -s conftest$ac_exeext && {
12115 test "$cross_compiling" = yes ||
12116 $as_test_x conftest$ac_exeext
12117 }; then
12118 ac_cv_func_dlopen=yes
12119 else
12120 $as_echo "$as_me: failed program was:" >&5
12121 sed 's/^/| /' conftest.$ac_ext >&5
12122
12123 ac_cv_func_dlopen=no
12124 fi
12125
12126 rm -rf conftest.dSYM
12127 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12128 conftest$ac_exeext conftest.$ac_ext
12129 fi
12130 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
12131 $as_echo "$ac_cv_func_dlopen" >&6; }
12132 if test "x$ac_cv_func_dlopen" = x""yes; then
12133 lt_cv_dlopen="dlopen"
12134 else
12135 { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
12136 $as_echo_n "checking for dlopen in -ldl... " >&6; }
12137 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
12138 $as_echo_n "(cached) " >&6
12139 else
12140 ac_check_lib_save_LIBS=$LIBS
12141 LIBS="-ldl $LIBS"
12142 cat >conftest.$ac_ext <<_ACEOF
12143 /* confdefs.h. */
12144 _ACEOF
12145 cat confdefs.h >>conftest.$ac_ext
12146 cat >>conftest.$ac_ext <<_ACEOF
12147 /* end confdefs.h. */
12148
12149 /* Override any GCC internal prototype to avoid an error.
12150 Use char because int might match the return type of a GCC
12151 builtin and then its argument prototype would still apply. */
12152 #ifdef __cplusplus
12153 extern "C"
12154 #endif
12155 char dlopen ();
12156 int
12157 main ()
12158 {
12159 return dlopen ();
12160 ;
12161 return 0;
12162 }
12163 _ACEOF
12164 rm -f conftest.$ac_objext conftest$ac_exeext
12165 if { (ac_try="$ac_link"
12166 case "(($ac_try" in
12167 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12168 *) ac_try_echo=$ac_try;;
12169 esac
12170 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12171 $as_echo "$ac_try_echo") >&5
12172 (eval "$ac_link") 2>conftest.er1
12173 ac_status=$?
12174 grep -v '^ *+' conftest.er1 >conftest.err
12175 rm -f conftest.er1
12176 cat conftest.err >&5
12177 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12178 (exit $ac_status); } && {
12179 test -z "$ac_c_werror_flag" ||
12180 test ! -s conftest.err
12181 } && test -s conftest$ac_exeext && {
12182 test "$cross_compiling" = yes ||
12183 $as_test_x conftest$ac_exeext
12184 }; then
12185 ac_cv_lib_dl_dlopen=yes
12186 else
12187 $as_echo "$as_me: failed program was:" >&5
12188 sed 's/^/| /' conftest.$ac_ext >&5
12189
12190 ac_cv_lib_dl_dlopen=no
12191 fi
12192
12193 rm -rf conftest.dSYM
12194 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12195 conftest$ac_exeext conftest.$ac_ext
12196 LIBS=$ac_check_lib_save_LIBS
12197 fi
12198 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
12199 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
12200 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
12201 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
12202 else
12203 { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
12204 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
12205 if test "${ac_cv_lib_svld_dlopen+set}" = set; then
12206 $as_echo_n "(cached) " >&6
12207 else
12208 ac_check_lib_save_LIBS=$LIBS
12209 LIBS="-lsvld $LIBS"
12210 cat >conftest.$ac_ext <<_ACEOF
12211 /* confdefs.h. */
12212 _ACEOF
12213 cat confdefs.h >>conftest.$ac_ext
12214 cat >>conftest.$ac_ext <<_ACEOF
12215 /* end confdefs.h. */
12216
12217 /* Override any GCC internal prototype to avoid an error.
12218 Use char because int might match the return type of a GCC
12219 builtin and then its argument prototype would still apply. */
12220 #ifdef __cplusplus
12221 extern "C"
12222 #endif
12223 char dlopen ();
12224 int
12225 main ()
12226 {
12227 return dlopen ();
12228 ;
12229 return 0;
12230 }
12231 _ACEOF
12232 rm -f conftest.$ac_objext conftest$ac_exeext
12233 if { (ac_try="$ac_link"
12234 case "(($ac_try" in
12235 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12236 *) ac_try_echo=$ac_try;;
12237 esac
12238 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12239 $as_echo "$ac_try_echo") >&5
12240 (eval "$ac_link") 2>conftest.er1
12241 ac_status=$?
12242 grep -v '^ *+' conftest.er1 >conftest.err
12243 rm -f conftest.er1
12244 cat conftest.err >&5
12245 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12246 (exit $ac_status); } && {
12247 test -z "$ac_c_werror_flag" ||
12248 test ! -s conftest.err
12249 } && test -s conftest$ac_exeext && {
12250 test "$cross_compiling" = yes ||
12251 $as_test_x conftest$ac_exeext
12252 }; then
12253 ac_cv_lib_svld_dlopen=yes
12254 else
12255 $as_echo "$as_me: failed program was:" >&5
12256 sed 's/^/| /' conftest.$ac_ext >&5
12257
12258 ac_cv_lib_svld_dlopen=no
12259 fi
12260
12261 rm -rf conftest.dSYM
12262 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12263 conftest$ac_exeext conftest.$ac_ext
12264 LIBS=$ac_check_lib_save_LIBS
12265 fi
12266 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
12267 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
12268 if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
12269 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
12270 else
12271 { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
12272 $as_echo_n "checking for dld_link in -ldld... " >&6; }
12273 if test "${ac_cv_lib_dld_dld_link+set}" = set; then
12274 $as_echo_n "(cached) " >&6
12275 else
12276 ac_check_lib_save_LIBS=$LIBS
12277 LIBS="-ldld $LIBS"
12278 cat >conftest.$ac_ext <<_ACEOF
12279 /* confdefs.h. */
12280 _ACEOF
12281 cat confdefs.h >>conftest.$ac_ext
12282 cat >>conftest.$ac_ext <<_ACEOF
12283 /* end confdefs.h. */
12284
12285 /* Override any GCC internal prototype to avoid an error.
12286 Use char because int might match the return type of a GCC
12287 builtin and then its argument prototype would still apply. */
12288 #ifdef __cplusplus
12289 extern "C"
12290 #endif
12291 char dld_link ();
12292 int
12293 main ()
12294 {
12295 return dld_link ();
12296 ;
12297 return 0;
12298 }
12299 _ACEOF
12300 rm -f conftest.$ac_objext conftest$ac_exeext
12301 if { (ac_try="$ac_link"
12302 case "(($ac_try" in
12303 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12304 *) ac_try_echo=$ac_try;;
12305 esac
12306 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
12307 $as_echo "$ac_try_echo") >&5
12308 (eval "$ac_link") 2>conftest.er1
12309 ac_status=$?
12310 grep -v '^ *+' conftest.er1 >conftest.err
12311 rm -f conftest.er1
12312 cat conftest.err >&5
12313 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12314 (exit $ac_status); } && {
12315 test -z "$ac_c_werror_flag" ||
12316 test ! -s conftest.err
12317 } && test -s conftest$ac_exeext && {
12318 test "$cross_compiling" = yes ||
12319 $as_test_x conftest$ac_exeext
12320 }; then
12321 ac_cv_lib_dld_dld_link=yes
12322 else
12323 $as_echo "$as_me: failed program was:" >&5
12324 sed 's/^/| /' conftest.$ac_ext >&5
12325
12326 ac_cv_lib_dld_dld_link=no
12327 fi
12328
12329 rm -rf conftest.dSYM
12330 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12331 conftest$ac_exeext conftest.$ac_ext
12332 LIBS=$ac_check_lib_save_LIBS
12333 fi
12334 { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
12335 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
12336 if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
12337 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
12338 fi
12339
12340
12341 fi
12342
12343
12344 fi
12345
12346
12347 fi
12348
12349
12350 fi
12351
12352
12353 fi
12354
12355 ;;
12356 esac
12357
12358 if test "x$lt_cv_dlopen" != xno; then
12359 enable_dlopen=yes
12360 else
12361 enable_dlopen=no
12362 fi
12363
12364 case $lt_cv_dlopen in
12365 dlopen)
12366 save_CPPFLAGS="$CPPFLAGS"
12367 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
12368
12369 save_LDFLAGS="$LDFLAGS"
12370 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
12371
12372 save_LIBS="$LIBS"
12373 LIBS="$lt_cv_dlopen_libs $LIBS"
12374
12375 { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
12376 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
12377 if test "${lt_cv_dlopen_self+set}" = set; then
12378 $as_echo_n "(cached) " >&6
12379 else
12380 if test "$cross_compiling" = yes; then :
12381 lt_cv_dlopen_self=cross
12382 else
12383 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
12384 lt_status=$lt_dlunknown
12385 cat > conftest.$ac_ext <<_LT_EOF
12386 #line 12387 "configure"
12387 #include "confdefs.h"
12388
12389 #if HAVE_DLFCN_H
12390 #include <dlfcn.h>
12391 #endif
12392
12393 #include <stdio.h>
12394
12395 #ifdef RTLD_GLOBAL
12396 # define LT_DLGLOBAL RTLD_GLOBAL
12397 #else
12398 # ifdef DL_GLOBAL
12399 # define LT_DLGLOBAL DL_GLOBAL
12400 # else
12401 # define LT_DLGLOBAL 0
12402 # endif
12403 #endif
12404
12405 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
12406 find out it does not work in some platform. */
12407 #ifndef LT_DLLAZY_OR_NOW
12408 # ifdef RTLD_LAZY
12409 # define LT_DLLAZY_OR_NOW RTLD_LAZY
12410 # else
12411 # ifdef DL_LAZY
12412 # define LT_DLLAZY_OR_NOW DL_LAZY
12413 # else
12414 # ifdef RTLD_NOW
12415 # define LT_DLLAZY_OR_NOW RTLD_NOW
12416 # else
12417 # ifdef DL_NOW
12418 # define LT_DLLAZY_OR_NOW DL_NOW
12419 # else
12420 # define LT_DLLAZY_OR_NOW 0
12421 # endif
12422 # endif
12423 # endif
12424 # endif
12425 #endif
12426
12427 void fnord() { int i=42;}
12428 int main ()
12429 {
12430 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
12431 int status = $lt_dlunknown;
12432
12433 if (self)
12434 {
12435 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
12436 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
12437 /* dlclose (self); */
12438 }
12439 else
12440 puts (dlerror ());
12441
12442 return status;
12443 }
12444 _LT_EOF
12445 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12446 (eval $ac_link) 2>&5
12447 ac_status=$?
12448 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12449 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
12450 (./conftest; exit; ) >&5 2>/dev/null
12451 lt_status=$?
12452 case x$lt_status in
12453 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
12454 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
12455 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
12456 esac
12457 else :
12458 # compilation failed
12459 lt_cv_dlopen_self=no
12460 fi
12461 fi
12462 rm -fr conftest*
12463
12464
12465 fi
12466 { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
12467 $as_echo "$lt_cv_dlopen_self" >&6; }
12468
12469 if test "x$lt_cv_dlopen_self" = xyes; then
12470 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
12471 { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
12472 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
12473 if test "${lt_cv_dlopen_self_static+set}" = set; then
12474 $as_echo_n "(cached) " >&6
12475 else
12476 if test "$cross_compiling" = yes; then :
12477 lt_cv_dlopen_self_static=cross
12478 else
12479 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
12480 lt_status=$lt_dlunknown
12481 cat > conftest.$ac_ext <<_LT_EOF
12482 #line 12483 "configure"
12483 #include "confdefs.h"
12484
12485 #if HAVE_DLFCN_H
12486 #include <dlfcn.h>
12487 #endif
12488
12489 #include <stdio.h>
12490
12491 #ifdef RTLD_GLOBAL
12492 # define LT_DLGLOBAL RTLD_GLOBAL
12493 #else
12494 # ifdef DL_GLOBAL
12495 # define LT_DLGLOBAL DL_GLOBAL
12496 # else
12497 # define LT_DLGLOBAL 0
12498 # endif
12499 #endif
12500
12501 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
12502 find out it does not work in some platform. */
12503 #ifndef LT_DLLAZY_OR_NOW
12504 # ifdef RTLD_LAZY
12505 # define LT_DLLAZY_OR_NOW RTLD_LAZY
12506 # else
12507 # ifdef DL_LAZY
12508 # define LT_DLLAZY_OR_NOW DL_LAZY
12509 # else
12510 # ifdef RTLD_NOW
12511 # define LT_DLLAZY_OR_NOW RTLD_NOW
12512 # else
12513 # ifdef DL_NOW
12514 # define LT_DLLAZY_OR_NOW DL_NOW
12515 # else
12516 # define LT_DLLAZY_OR_NOW 0
12517 # endif
12518 # endif
12519 # endif
12520 # endif
12521 #endif
12522
12523 void fnord() { int i=42;}
12524 int main ()
12525 {
12526 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
12527 int status = $lt_dlunknown;
12528
12529 if (self)
12530 {
12531 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
12532 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
12533 /* dlclose (self); */
12534 }
12535 else
12536 puts (dlerror ());
12537
12538 return status;
12539 }
12540 _LT_EOF
12541 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12542 (eval $ac_link) 2>&5
12543 ac_status=$?
12544 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
12545 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
12546 (./conftest; exit; ) >&5 2>/dev/null
12547 lt_status=$?
12548 case x$lt_status in
12549 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
12550 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
12551 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
12552 esac
12553 else :
12554 # compilation failed
12555 lt_cv_dlopen_self_static=no
12556 fi
12557 fi
12558 rm -fr conftest*
12559
12560
12561 fi
12562 { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
12563 $as_echo "$lt_cv_dlopen_self_static" >&6; }
12564 fi
12565
12566 CPPFLAGS="$save_CPPFLAGS"
12567 LDFLAGS="$save_LDFLAGS"
12568 LIBS="$save_LIBS"
12569 ;;
12570 esac
12571
12572 case $lt_cv_dlopen_self in
12573 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
12574 *) enable_dlopen_self=unknown ;;
12575 esac
12576
12577 case $lt_cv_dlopen_self_static in
12578 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
12579 *) enable_dlopen_self_static=unknown ;;
12580 esac
12581 fi
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599 striplib=
12600 old_striplib=
12601 { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
12602 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
12603 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
12604 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
12605 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
12606 { $as_echo "$as_me:$LINENO: result: yes" >&5
12607 $as_echo "yes" >&6; }
12608 else
12609 # FIXME - insert some real tests, host_os isn't really good enough
12610 case $host_os in
12611 darwin*)
12612 if test -n "$STRIP" ; then
12613 striplib="$STRIP -x"
12614 old_striplib="$STRIP -S"
12615 { $as_echo "$as_me:$LINENO: result: yes" >&5
12616 $as_echo "yes" >&6; }
12617 else
12618 { $as_echo "$as_me:$LINENO: result: no" >&5
12619 $as_echo "no" >&6; }
12620 fi
12621 ;;
12622 *)
12623 { $as_echo "$as_me:$LINENO: result: no" >&5
12624 $as_echo "no" >&6; }
12625 ;;
12626 esac
12627 fi
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640 # Report which library types will actually be built
12641 { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
12642 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
12643 { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
12644 $as_echo "$can_build_shared" >&6; }
12645
12646 { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
12647 $as_echo_n "checking whether to build shared libraries... " >&6; }
12648 test "$can_build_shared" = "no" && enable_shared=no
12649
12650 # On AIX, shared libraries and static libraries use the same namespace, and
12651 # are all built from PIC.
12652 case $host_os in
12653 aix3*)
12654 test "$enable_shared" = yes && enable_static=no
12655 if test -n "$RANLIB"; then
12656 archive_cmds="$archive_cmds~\$RANLIB \$lib"
12657 postinstall_cmds='$RANLIB $lib'
12658 fi
12659 ;;
12660
12661 aix[4-9]*)
12662 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
12663 test "$enable_shared" = yes && enable_static=no
12664 fi
12665 ;;
12666 esac
12667 { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
12668 $as_echo "$enable_shared" >&6; }
12669
12670 { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
12671 $as_echo_n "checking whether to build static libraries... " >&6; }
12672 # Make sure either enable_shared or enable_static is yes.
12673 test "$enable_shared" = yes || enable_static=yes
12674 { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
12675 $as_echo "$enable_static" >&6; }
12676
12677
12678
12679
12680 fi
12681 ac_ext=c
12682 ac_cpp='$CPP $CPPFLAGS'
12683 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12684 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12685 ac_compiler_gnu=$ac_cv_c_compiler_gnu
12686
12687 CC="$lt_save_CC"
12688
12689
12690 ac_ext=cpp
12691 ac_cpp='$CXXCPP $CPPFLAGS'
12692 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12693 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12694 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
12695
12696 archive_cmds_need_lc_CXX=no
12697 allow_undefined_flag_CXX=
12698 always_export_symbols_CXX=no
12699 archive_expsym_cmds_CXX=
12700 compiler_needs_object_CXX=no
12701 export_dynamic_flag_spec_CXX=
12702 hardcode_direct_CXX=no
12703 hardcode_direct_absolute_CXX=no
12704 hardcode_libdir_flag_spec_CXX=
12705 hardcode_libdir_flag_spec_ld_CXX=
12706 hardcode_libdir_separator_CXX=
12707 hardcode_minus_L_CXX=no
12708 hardcode_shlibpath_var_CXX=unsupported
12709 hardcode_automatic_CXX=no
12710 inherit_rpath_CXX=no
12711 module_cmds_CXX=
12712 module_expsym_cmds_CXX=
12713 link_all_deplibs_CXX=unknown
12714 old_archive_cmds_CXX=$old_archive_cmds
12715 no_undefined_flag_CXX=
12716 whole_archive_flag_spec_CXX=
12717 enable_shared_with_static_runtimes_CXX=no
12718
12719 # Source file extension for C++ test sources.
12720 ac_ext=cpp
12721
12722 # Object file extension for compiled C++ test sources.
12723 objext=o
12724 objext_CXX=$objext
12725
12726 # No sense in running all these tests if we already determined that
12727 # the CXX compiler isn't working. Some variables (like enable_shared)
12728 # are currently assumed to apply to all compilers on this platform,
12729 # and will be corrupted by setting them based on a non-working compiler.
12730 if test "$_lt_caught_CXX_error" != yes; then
12731 # Code to be used in simple compile tests
12732 lt_simple_compile_test_code="int some_variable = 0;"
12733
12734 # Code to be used in simple link tests
12735 lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
12736
12737 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
12738
12739
12740
12741
12742
12743
12744 # If no C compiler was specified, use CC.
12745 LTCC=${LTCC-"$CC"}
12746
12747 # If no C compiler flags were specified, use CFLAGS.
12748 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
12749
12750 # Allow CC to be a program name with arguments.
12751 compiler=$CC
12752
12753
12754 # save warnings/boilerplate of simple test code
12755 ac_outfile=conftest.$ac_objext
12756 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
12757 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
12758 _lt_compiler_boilerplate=`cat conftest.err`
12759 $RM conftest*
12760
12761 ac_outfile=conftest.$ac_objext
12762 echo "$lt_simple_link_test_code" >conftest.$ac_ext
12763 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
12764 _lt_linker_boilerplate=`cat conftest.err`
12765 $RM -r conftest*
12766
12767
12768 # Allow CC to be a program name with arguments.
12769 lt_save_CC=$CC
12770 lt_save_LD=$LD
12771 lt_save_GCC=$GCC
12772 GCC=$GXX
12773 lt_save_with_gnu_ld=$with_gnu_ld
12774 lt_save_path_LD=$lt_cv_path_LD
12775 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
12776 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
12777 else
12778 $as_unset lt_cv_prog_gnu_ld
12779 fi
12780 if test -n "${lt_cv_path_LDCXX+set}"; then
12781 lt_cv_path_LD=$lt_cv_path_LDCXX
12782 else
12783 $as_unset lt_cv_path_LD
12784 fi
12785 test -z "${LDCXX+set}" || LD=$LDCXX
12786 CC=${CXX-"c++"}
12787 compiler=$CC
12788 compiler_CXX=$CC
12789 for cc_temp in $compiler""; do
12790 case $cc_temp in
12791 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
12792 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
12793 \-*) ;;
12794 *) break;;
12795 esac
12796 done
12797 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
12798
12799
12800 if test -n "$compiler"; then
12801 # We don't want -fno-exception when compiling C++ code, so set the
12802 # no_builtin_flag separately
12803 if test "$GXX" = yes; then
12804 lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
12805 else
12806 lt_prog_compiler_no_builtin_flag_CXX=
12807 fi
12808
12809 if test "$GXX" = yes; then
12810 # Set up default GNU C++ configuration
12811
12812
12813
12814 # Check whether --with-gnu-ld was given.
12815 if test "${with_gnu_ld+set}" = set; then
12816 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
12817 else
12818 with_gnu_ld=no
12819 fi
12820
12821 ac_prog=ld
12822 if test "$GCC" = yes; then
12823 # Check if gcc -print-prog-name=ld gives a path.
12824 { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
12825 $as_echo_n "checking for ld used by $CC... " >&6; }
12826 case $host in
12827 *-*-mingw*)
12828 # gcc leaves a trailing carriage return which upsets mingw
12829 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
12830 *)
12831 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
12832 esac
12833 case $ac_prog in
12834 # Accept absolute paths.
12835 [\\/]* | ?:[\\/]*)
12836 re_direlt='/[^/][^/]*/\.\./'
12837 # Canonicalize the pathname of ld
12838 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
12839 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
12840 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
12841 done
12842 test -z "$LD" && LD="$ac_prog"
12843 ;;
12844 "")
12845 # If it fails, then pretend we aren't using GCC.
12846 ac_prog=ld
12847 ;;
12848 *)
12849 # If it is relative, then search for the first ld in PATH.
12850 with_gnu_ld=unknown
12851 ;;
12852 esac
12853 elif test "$with_gnu_ld" = yes; then
12854 { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
12855 $as_echo_n "checking for GNU ld... " >&6; }
12856 else
12857 { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
12858 $as_echo_n "checking for non-GNU ld... " >&6; }
12859 fi
12860 if test "${lt_cv_path_LD+set}" = set; then
12861 $as_echo_n "(cached) " >&6
12862 else
12863 if test -z "$LD"; then
12864 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
12865 for ac_dir in $PATH; do
12866 IFS="$lt_save_ifs"
12867 test -z "$ac_dir" && ac_dir=.
12868 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
12869 lt_cv_path_LD="$ac_dir/$ac_prog"
12870 # Check to see if the program is GNU ld. I'd rather use --version,
12871 # but apparently some variants of GNU ld only accept -v.
12872 # Break only if it was the GNU/non-GNU ld that we prefer.
12873 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
12874 *GNU* | *'with BFD'*)
12875 test "$with_gnu_ld" != no && break
12876 ;;
12877 *)
12878 test "$with_gnu_ld" != yes && break
12879 ;;
12880 esac
12881 fi
12882 done
12883 IFS="$lt_save_ifs"
12884 else
12885 lt_cv_path_LD="$LD" # Let the user override the test with a path.
12886 fi
12887 fi
12888
12889 LD="$lt_cv_path_LD"
12890 if test -n "$LD"; then
12891 { $as_echo "$as_me:$LINENO: result: $LD" >&5
12892 $as_echo "$LD" >&6; }
12893 else
12894 { $as_echo "$as_me:$LINENO: result: no" >&5
12895 $as_echo "no" >&6; }
12896 fi
12897 test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
12898 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
12899 { (exit 1); exit 1; }; }
12900 { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
12901 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
12902 if test "${lt_cv_prog_gnu_ld+set}" = set; then
12903 $as_echo_n "(cached) " >&6
12904 else
12905 # I'd rather use --version here, but apparently some GNU lds only accept -v.
12906 case `$LD -v 2>&1 </dev/null` in
12907 *GNU* | *'with BFD'*)
12908 lt_cv_prog_gnu_ld=yes
12909 ;;
12910 *)
12911 lt_cv_prog_gnu_ld=no
12912 ;;
12913 esac
12914 fi
12915 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
12916 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
12917 with_gnu_ld=$lt_cv_prog_gnu_ld
12918
12919
12920
12921
12922
12923
12924
12925 # Check if GNU C++ uses GNU ld as the underlying linker, since the
12926 # archiving commands below assume that GNU ld is being used.
12927 if test "$with_gnu_ld" = yes; then
12928 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
12929 archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
12930
12931 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
12932 export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
12933
12934 # If archive_cmds runs LD, not CC, wlarc should be empty
12935 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
12936 # investigate it a little bit more. (MM)
12937 wlarc='${wl}'
12938
12939 # ancient GNU ld didn't support --whole-archive et. al.
12940 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
12941 $GREP 'no-whole-archive' > /dev/null; then
12942 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
12943 else
12944 whole_archive_flag_spec_CXX=
12945 fi
12946 else
12947 with_gnu_ld=no
12948 wlarc=
12949
12950 # A generic and very simple default shared library creation
12951 # command for GNU C++ for the case where it uses the native
12952 # linker, instead of GNU ld. If possible, this setting should
12953 # overridden to take advantage of the native linker features on
12954 # the platform it is being used on.
12955 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
12956 fi
12957
12958 # Commands to make compiler produce verbose output that lists
12959 # what "hidden" libraries, object files and flags are used when
12960 # linking a shared library.
12961 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
12962
12963 else
12964 GXX=no
12965 with_gnu_ld=no
12966 wlarc=
12967 fi
12968
12969 # PORTME: fill in a description of your system's C++ link characteristics
12970 { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
12971 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
12972 ld_shlibs_CXX=yes
12973 case $host_os in
12974 aix3*)
12975 # FIXME: insert proper C++ library support
12976 ld_shlibs_CXX=no
12977 ;;
12978 aix[4-9]*)
12979 if test "$host_cpu" = ia64; then
12980 # On IA64, the linker does run time linking by default, so we don't
12981 # have to do anything special.
12982 aix_use_runtimelinking=no
12983 exp_sym_flag='-Bexport'
12984 no_entry_flag=""
12985 else
12986 aix_use_runtimelinking=no
12987
12988 # Test if we are trying to use run time linking or normal
12989 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
12990 # need to do runtime linking.
12991 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
12992 for ld_flag in $LDFLAGS; do
12993 case $ld_flag in
12994 *-brtl*)
12995 aix_use_runtimelinking=yes
12996 break
12997 ;;
12998 esac
12999 done
13000 ;;
13001 esac
13002
13003 exp_sym_flag='-bexport'
13004 no_entry_flag='-bnoentry'
13005 fi
13006
13007 # When large executables or shared objects are built, AIX ld can
13008 # have problems creating the table of contents. If linking a library
13009 # or program results in "error TOC overflow" add -mminimal-toc to
13010 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
13011 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
13012
13013 archive_cmds_CXX=''
13014 hardcode_direct_CXX=yes
13015 hardcode_direct_absolute_CXX=yes
13016 hardcode_libdir_separator_CXX=':'
13017 link_all_deplibs_CXX=yes
13018 file_list_spec_CXX='${wl}-f,'
13019
13020 if test "$GXX" = yes; then
13021 case $host_os in aix4.[012]|aix4.[012].*)
13022 # We only want to do this on AIX 4.2 and lower, the check
13023 # below for broken collect2 doesn't work under 4.3+
13024 collect2name=`${CC} -print-prog-name=collect2`
13025 if test -f "$collect2name" &&
13026 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
13027 then
13028 # We have reworked collect2
13029 :
13030 else
13031 # We have old collect2
13032 hardcode_direct_CXX=unsupported
13033 # It fails to find uninstalled libraries when the uninstalled
13034 # path is not listed in the libpath. Setting hardcode_minus_L
13035 # to unsupported forces relinking
13036 hardcode_minus_L_CXX=yes
13037 hardcode_libdir_flag_spec_CXX='-L$libdir'
13038 hardcode_libdir_separator_CXX=
13039 fi
13040 esac
13041 shared_flag='-shared'
13042 if test "$aix_use_runtimelinking" = yes; then
13043 shared_flag="$shared_flag "'${wl}-G'
13044 fi
13045 else
13046 # not using gcc
13047 if test "$host_cpu" = ia64; then
13048 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
13049 # chokes on -Wl,-G. The following line is correct:
13050 shared_flag='-G'
13051 else
13052 if test "$aix_use_runtimelinking" = yes; then
13053 shared_flag='${wl}-G'
13054 else
13055 shared_flag='${wl}-bM:SRE'
13056 fi
13057 fi
13058 fi
13059
13060 export_dynamic_flag_spec_CXX='${wl}-bexpall'
13061 # It seems that -bexpall does not export symbols beginning with
13062 # underscore (_), so it is better to generate a list of symbols to
13063 # export.
13064 always_export_symbols_CXX=yes
13065 if test "$aix_use_runtimelinking" = yes; then
13066 # Warning - without using the other runtime loading flags (-brtl),
13067 # -berok will link without error, but may produce a broken library.
13068 allow_undefined_flag_CXX='-berok'
13069 # Determine the default libpath from the value encoded in an empty
13070 # executable.
13071 cat >conftest.$ac_ext <<_ACEOF
13072 /* confdefs.h. */
13073 _ACEOF
13074 cat confdefs.h >>conftest.$ac_ext
13075 cat >>conftest.$ac_ext <<_ACEOF
13076 /* end confdefs.h. */
13077
13078 int
13079 main ()
13080 {
13081
13082 ;
13083 return 0;
13084 }
13085 _ACEOF
13086 rm -f conftest.$ac_objext conftest$ac_exeext
13087 if { (ac_try="$ac_link"
13088 case "(($ac_try" in
13089 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13090 *) ac_try_echo=$ac_try;;
13091 esac
13092 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13093 $as_echo "$ac_try_echo") >&5
13094 (eval "$ac_link") 2>conftest.er1
13095 ac_status=$?
13096 grep -v '^ *+' conftest.er1 >conftest.err
13097 rm -f conftest.er1
13098 cat conftest.err >&5
13099 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13100 (exit $ac_status); } && {
13101 test -z "$ac_cxx_werror_flag" ||
13102 test ! -s conftest.err
13103 } && test -s conftest$ac_exeext && {
13104 test "$cross_compiling" = yes ||
13105 $as_test_x conftest$ac_exeext
13106 }; then
13107
13108 lt_aix_libpath_sed='
13109 /Import File Strings/,/^$/ {
13110 /^0/ {
13111 s/^0 *\(.*\)$/\1/
13112 p
13113 }
13114 }'
13115 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
13116 # Check for a 64-bit object if we didn't find anything.
13117 if test -z "$aix_libpath"; then
13118 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
13119 fi
13120 else
13121 $as_echo "$as_me: failed program was:" >&5
13122 sed 's/^/| /' conftest.$ac_ext >&5
13123
13124
13125 fi
13126
13127 rm -rf conftest.dSYM
13128 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
13129 conftest$ac_exeext conftest.$ac_ext
13130 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
13131
13132 hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
13133
13134 archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
13135 else
13136 if test "$host_cpu" = ia64; then
13137 hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
13138 allow_undefined_flag_CXX="-z nodefs"
13139 archive_expsym_cmds_CXX="\$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"
13140 else
13141 # Determine the default libpath from the value encoded in an
13142 # empty executable.
13143 cat >conftest.$ac_ext <<_ACEOF
13144 /* confdefs.h. */
13145 _ACEOF
13146 cat confdefs.h >>conftest.$ac_ext
13147 cat >>conftest.$ac_ext <<_ACEOF
13148 /* end confdefs.h. */
13149
13150 int
13151 main ()
13152 {
13153
13154 ;
13155 return 0;
13156 }
13157 _ACEOF
13158 rm -f conftest.$ac_objext conftest$ac_exeext
13159 if { (ac_try="$ac_link"
13160 case "(($ac_try" in
13161 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13162 *) ac_try_echo=$ac_try;;
13163 esac
13164 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13165 $as_echo "$ac_try_echo") >&5
13166 (eval "$ac_link") 2>conftest.er1
13167 ac_status=$?
13168 grep -v '^ *+' conftest.er1 >conftest.err
13169 rm -f conftest.er1
13170 cat conftest.err >&5
13171 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13172 (exit $ac_status); } && {
13173 test -z "$ac_cxx_werror_flag" ||
13174 test ! -s conftest.err
13175 } && test -s conftest$ac_exeext && {
13176 test "$cross_compiling" = yes ||
13177 $as_test_x conftest$ac_exeext
13178 }; then
13179
13180 lt_aix_libpath_sed='
13181 /Import File Strings/,/^$/ {
13182 /^0/ {
13183 s/^0 *\(.*\)$/\1/
13184 p
13185 }
13186 }'
13187 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
13188 # Check for a 64-bit object if we didn't find anything.
13189 if test -z "$aix_libpath"; then
13190 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
13191 fi
13192 else
13193 $as_echo "$as_me: failed program was:" >&5
13194 sed 's/^/| /' conftest.$ac_ext >&5
13195
13196
13197 fi
13198
13199 rm -rf conftest.dSYM
13200 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
13201 conftest$ac_exeext conftest.$ac_ext
13202 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
13203
13204 hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
13205 # Warning - without using the other run time loading flags,
13206 # -berok will link without error, but may produce a broken library.
13207 no_undefined_flag_CXX=' ${wl}-bernotok'
13208 allow_undefined_flag_CXX=' ${wl}-berok'
13209 # Exported symbols can be pulled into shared objects from archives
13210 whole_archive_flag_spec_CXX='$convenience'
13211 archive_cmds_need_lc_CXX=yes
13212 # This is similar to how AIX traditionally builds its shared
13213 # libraries.
13214 archive_expsym_cmds_CXX="\$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'
13215 fi
13216 fi
13217 ;;
13218
13219 beos*)
13220 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
13221 allow_undefined_flag_CXX=unsupported
13222 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
13223 # support --undefined. This deserves some investigation. FIXME
13224 archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
13225 else
13226 ld_shlibs_CXX=no
13227 fi
13228 ;;
13229
13230 chorus*)
13231 case $cc_basename in
13232 *)
13233 # FIXME: insert proper C++ library support
13234 ld_shlibs_CXX=no
13235 ;;
13236 esac
13237 ;;
13238
13239 cygwin* | mingw* | pw32* | cegcc*)
13240 # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
13241 # as there is no search path for DLLs.
13242 hardcode_libdir_flag_spec_CXX='-L$libdir'
13243 allow_undefined_flag_CXX=unsupported
13244 always_export_symbols_CXX=no
13245 enable_shared_with_static_runtimes_CXX=yes
13246
13247 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
13248 archive_cmds_CXX='$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'
13249 # If the export-symbols file already is a .def file (1st line
13250 # is EXPORTS), use it as is; otherwise, prepend...
13251 archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
13252 cp $export_symbols $output_objdir/$soname.def;
13253 else
13254 echo EXPORTS > $output_objdir/$soname.def;
13255 cat $export_symbols >> $output_objdir/$soname.def;
13256 fi~
13257 $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'
13258 else
13259 ld_shlibs_CXX=no
13260 fi
13261 ;;
13262 darwin* | rhapsody*)
13263
13264
13265 archive_cmds_need_lc_CXX=no
13266 hardcode_direct_CXX=no
13267 hardcode_automatic_CXX=yes
13268 hardcode_shlibpath_var_CXX=unsupported
13269 whole_archive_flag_spec_CXX=''
13270 link_all_deplibs_CXX=yes
13271 allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
13272 case $cc_basename in
13273 ifort*) _lt_dar_can_shared=yes ;;
13274 *) _lt_dar_can_shared=$GCC ;;
13275 esac
13276 if test "$_lt_dar_can_shared" = "yes"; then
13277 output_verbose_link_cmd=echo
13278 archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
13279 module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
13280 archive_expsym_cmds_CXX="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}"
13281 module_expsym_cmds_CXX="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}"
13282 if test "$lt_cv_apple_cc_single_mod" != "yes"; then
13283 archive_cmds_CXX="\$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}"
13284 archive_expsym_cmds_CXX="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}"
13285 fi
13286
13287 else
13288 ld_shlibs_CXX=no
13289 fi
13290
13291 ;;
13292
13293 dgux*)
13294 case $cc_basename in
13295 ec++*)
13296 # FIXME: insert proper C++ library support
13297 ld_shlibs_CXX=no
13298 ;;
13299 ghcx*)
13300 # Green Hills C++ Compiler
13301 # FIXME: insert proper C++ library support
13302 ld_shlibs_CXX=no
13303 ;;
13304 *)
13305 # FIXME: insert proper C++ library support
13306 ld_shlibs_CXX=no
13307 ;;
13308 esac
13309 ;;
13310
13311 freebsd[12]*)
13312 # C++ shared libraries reported to be fairly broken before
13313 # switch to ELF
13314 ld_shlibs_CXX=no
13315 ;;
13316
13317 freebsd-elf*)
13318 archive_cmds_need_lc_CXX=no
13319 ;;
13320
13321 freebsd* | dragonfly*)
13322 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
13323 # conventions
13324 ld_shlibs_CXX=yes
13325 ;;
13326
13327 gnu*)
13328 ;;
13329
13330 hpux9*)
13331 hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
13332 hardcode_libdir_separator_CXX=:
13333 export_dynamic_flag_spec_CXX='${wl}-E'
13334 hardcode_direct_CXX=yes
13335 hardcode_minus_L_CXX=yes # Not in the search PATH,
13336 # but as the default
13337 # location of the library.
13338
13339 case $cc_basename in
13340 CC*)
13341 # FIXME: insert proper C++ library support
13342 ld_shlibs_CXX=no
13343 ;;
13344 aCC*)
13345 archive_cmds_CXX='$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'
13346 # Commands to make compiler produce verbose output that lists
13347 # what "hidden" libraries, object files and flags are used when
13348 # linking a shared library.
13349 #
13350 # There doesn't appear to be a way to prevent this compiler from
13351 # explicitly linking system object files so we need to strip them
13352 # from the output so that they don't get included in the library
13353 # dependencies.
13354 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; $ECHO "X$list" | $Xsed'
13355 ;;
13356 *)
13357 if test "$GXX" = yes; then
13358 archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
13359 else
13360 # FIXME: insert proper C++ library support
13361 ld_shlibs_CXX=no
13362 fi
13363 ;;
13364 esac
13365 ;;
13366
13367 hpux10*|hpux11*)
13368 if test $with_gnu_ld = no; then
13369 hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
13370 hardcode_libdir_separator_CXX=:
13371
13372 case $host_cpu in
13373 hppa*64*|ia64*)
13374 ;;
13375 *)
13376 export_dynamic_flag_spec_CXX='${wl}-E'
13377 ;;
13378 esac
13379 fi
13380 case $host_cpu in
13381 hppa*64*|ia64*)
13382 hardcode_direct_CXX=no
13383 hardcode_shlibpath_var_CXX=no
13384 ;;
13385 *)
13386 hardcode_direct_CXX=yes
13387 hardcode_direct_absolute_CXX=yes
13388 hardcode_minus_L_CXX=yes # Not in the search PATH,
13389 # but as the default
13390 # location of the library.
13391 ;;
13392 esac
13393
13394 case $cc_basename in
13395 CC*)
13396 # FIXME: insert proper C++ library support
13397 ld_shlibs_CXX=no
13398 ;;
13399 aCC*)
13400 case $host_cpu in
13401 hppa*64*)
13402 archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13403 ;;
13404 ia64*)
13405 archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13406 ;;
13407 *)
13408 archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13409 ;;
13410 esac
13411 # Commands to make compiler produce verbose output that lists
13412 # what "hidden" libraries, object files and flags are used when
13413 # linking a shared library.
13414 #
13415 # There doesn't appear to be a way to prevent this compiler from
13416 # explicitly linking system object files so we need to strip them
13417 # from the output so that they don't get included in the library
13418 # dependencies.
13419 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
13420 ;;
13421 *)
13422 if test "$GXX" = yes; then
13423 if test $with_gnu_ld = no; then
13424 case $host_cpu in
13425 hppa*64*)
13426 archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13427 ;;
13428 ia64*)
13429 archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13430 ;;
13431 *)
13432 archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13433 ;;
13434 esac
13435 fi
13436 else
13437 # FIXME: insert proper C++ library support
13438 ld_shlibs_CXX=no
13439 fi
13440 ;;
13441 esac
13442 ;;
13443
13444 interix[3-9]*)
13445 hardcode_direct_CXX=no
13446 hardcode_shlibpath_var_CXX=no
13447 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
13448 export_dynamic_flag_spec_CXX='${wl}-E'
13449 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
13450 # Instead, shared libraries are loaded at an image base (0x10000000 by
13451 # default) and relocated if they conflict, which is a slow very memory
13452 # consuming and fragmenting process. To avoid this, we pick a random,
13453 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
13454 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
13455 archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
13456 archive_expsym_cmds_CXX='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'
13457 ;;
13458 irix5* | irix6*)
13459 case $cc_basename in
13460 CC*)
13461 # SGI C++
13462 archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
13463
13464 # Archives containing C++ object files must be created using
13465 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
13466 # necessary to make sure instantiated templates are included
13467 # in the archive.
13468 old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
13469 ;;
13470 *)
13471 if test "$GXX" = yes; then
13472 if test "$with_gnu_ld" = no; then
13473 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
13474 else
13475 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
13476 fi
13477 fi
13478 link_all_deplibs_CXX=yes
13479 ;;
13480 esac
13481 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
13482 hardcode_libdir_separator_CXX=:
13483 inherit_rpath_CXX=yes
13484 ;;
13485
13486 linux* | k*bsd*-gnu)
13487 case $cc_basename in
13488 KCC*)
13489 # Kuck and Associates, Inc. (KAI) C++ Compiler
13490
13491 # KCC will only create a shared library if the output file
13492 # ends with ".so" (or ".sl" for HP-UX), so rename the library
13493 # to its proper name (with version) after linking.
13494 archive_cmds_CXX='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'
13495 archive_expsym_cmds_CXX='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'
13496 # Commands to make compiler produce verbose output that lists
13497 # what "hidden" libraries, object files and flags are used when
13498 # linking a shared library.
13499 #
13500 # There doesn't appear to be a way to prevent this compiler from
13501 # explicitly linking system object files so we need to strip them
13502 # from the output so that they don't get included in the library
13503 # dependencies.
13504 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
13505
13506 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
13507 export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
13508
13509 # Archives containing C++ object files must be created using
13510 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
13511 old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
13512 ;;
13513 icpc* | ecpc* )
13514 # Intel C++
13515 with_gnu_ld=yes
13516 # version 8.0 and above of icpc choke on multiply defined symbols
13517 # if we add $predep_objects and $postdep_objects, however 7.1 and
13518 # earlier do not add the objects themselves.
13519 case `$CC -V 2>&1` in
13520 *"Version 7."*)
13521 archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
13522 archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
13523 ;;
13524 *) # Version 8.0 or newer
13525 tmp_idyn=
13526 case $host_cpu in
13527 ia64*) tmp_idyn=' -i_dynamic';;
13528 esac
13529 archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
13530 archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
13531 ;;
13532 esac
13533 archive_cmds_need_lc_CXX=no
13534 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
13535 export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
13536 whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
13537 ;;
13538 pgCC* | pgcpp*)
13539 # Portland Group C++ compiler
13540 case `$CC -V` in
13541 *pgCC\ [1-5]* | *pgcpp\ [1-5]*)
13542 prelink_cmds_CXX='tpldir=Template.dir~
13543 rm -rf $tpldir~
13544 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
13545 compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
13546 old_archive_cmds_CXX='tpldir=Template.dir~
13547 rm -rf $tpldir~
13548 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
13549 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
13550 $RANLIB $oldlib'
13551 archive_cmds_CXX='tpldir=Template.dir~
13552 rm -rf $tpldir~
13553 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
13554 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
13555 archive_expsym_cmds_CXX='tpldir=Template.dir~
13556 rm -rf $tpldir~
13557 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
13558 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
13559 ;;
13560 *) # Version 6 will use weak symbols
13561 archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
13562 archive_expsym_cmds_CXX='$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'
13563 ;;
13564 esac
13565
13566 hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
13567 export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
13568 whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
13569 ;;
13570 cxx*)
13571 # Compaq C++
13572 archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
13573 archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
13574
13575 runpath_var=LD_RUN_PATH
13576 hardcode_libdir_flag_spec_CXX='-rpath $libdir'
13577 hardcode_libdir_separator_CXX=:
13578
13579 # Commands to make compiler produce verbose output that lists
13580 # what "hidden" libraries, object files and flags are used when
13581 # linking a shared library.
13582 #
13583 # There doesn't appear to be a way to prevent this compiler from
13584 # explicitly linking system object files so we need to strip them
13585 # from the output so that they don't get included in the library
13586 # dependencies.
13587 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
13588 ;;
13589 xl*)
13590 # IBM XL 8.0 on PPC, with GNU ld
13591 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
13592 export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
13593 archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
13594 if test "x$supports_anon_versioning" = xyes; then
13595 archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
13596 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
13597 echo "local: *; };" >> $output_objdir/$libname.ver~
13598 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
13599 fi
13600 ;;
13601 *)
13602 case `$CC -V 2>&1 | sed 5q` in
13603 *Sun\ C*)
13604 # Sun C++ 5.9
13605 no_undefined_flag_CXX=' -zdefs'
13606 archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13607 archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
13608 hardcode_libdir_flag_spec_CXX='-R$libdir'
13609 whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
13610 compiler_needs_object_CXX=yes
13611
13612 # Not sure whether something based on
13613 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
13614 # would be better.
13615 output_verbose_link_cmd='echo'
13616
13617 # Archives containing C++ object files must be created using
13618 # "CC -xar", where "CC" is the Sun C++ compiler. This is
13619 # necessary to make sure instantiated templates are included
13620 # in the archive.
13621 old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
13622 ;;
13623 esac
13624 ;;
13625 esac
13626 ;;
13627
13628 lynxos*)
13629 # FIXME: insert proper C++ library support
13630 ld_shlibs_CXX=no
13631 ;;
13632
13633 m88k*)
13634 # FIXME: insert proper C++ library support
13635 ld_shlibs_CXX=no
13636 ;;
13637
13638 mvs*)
13639 case $cc_basename in
13640 cxx*)
13641 # FIXME: insert proper C++ library support
13642 ld_shlibs_CXX=no
13643 ;;
13644 *)
13645 # FIXME: insert proper C++ library support
13646 ld_shlibs_CXX=no
13647 ;;
13648 esac
13649 ;;
13650
13651 netbsd*)
13652 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
13653 archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
13654 wlarc=
13655 hardcode_libdir_flag_spec_CXX='-R$libdir'
13656 hardcode_direct_CXX=yes
13657 hardcode_shlibpath_var_CXX=no
13658 fi
13659 # Workaround some broken pre-1.5 toolchains
13660 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
13661 ;;
13662
13663 *nto* | *qnx*)
13664 ld_shlibs_CXX=yes
13665 ;;
13666
13667 openbsd2*)
13668 # C++ shared libraries are fairly broken
13669 ld_shlibs_CXX=no
13670 ;;
13671
13672 openbsd*)
13673 if test -f /usr/libexec/ld.so; then
13674 hardcode_direct_CXX=yes
13675 hardcode_shlibpath_var_CXX=no
13676 hardcode_direct_absolute_CXX=yes
13677 archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
13678 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
13679 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
13680 archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
13681 export_dynamic_flag_spec_CXX='${wl}-E'
13682 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
13683 fi
13684 output_verbose_link_cmd=echo
13685 else
13686 ld_shlibs_CXX=no
13687 fi
13688 ;;
13689
13690 osf3* | osf4* | osf5*)
13691 case $cc_basename in
13692 KCC*)
13693 # Kuck and Associates, Inc. (KAI) C++ Compiler
13694
13695 # KCC will only create a shared library if the output file
13696 # ends with ".so" (or ".sl" for HP-UX), so rename the library
13697 # to its proper name (with version) after linking.
13698 archive_cmds_CXX='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'
13699
13700 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
13701 hardcode_libdir_separator_CXX=:
13702
13703 # Archives containing C++ object files must be created using
13704 # the KAI C++ compiler.
13705 case $host in
13706 osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
13707 *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
13708 esac
13709 ;;
13710 RCC*)
13711 # Rational C++ 2.4.1
13712 # FIXME: insert proper C++ library support
13713 ld_shlibs_CXX=no
13714 ;;
13715 cxx*)
13716 case $host in
13717 osf3*)
13718 allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
13719 archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
13720 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
13721 ;;
13722 *)
13723 allow_undefined_flag_CXX=' -expect_unresolved \*'
13724 archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
13725 archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
13726 echo "-hidden">> $lib.exp~
13727 $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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
13728 $RM $lib.exp'
13729 hardcode_libdir_flag_spec_CXX='-rpath $libdir'
13730 ;;
13731 esac
13732
13733 hardcode_libdir_separator_CXX=:
13734
13735 # Commands to make compiler produce verbose output that lists
13736 # what "hidden" libraries, object files and flags are used when
13737 # linking a shared library.
13738 #
13739 # There doesn't appear to be a way to prevent this compiler from
13740 # explicitly linking system object files so we need to strip them
13741 # from the output so that they don't get included in the library
13742 # dependencies.
13743 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
13744 ;;
13745 *)
13746 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
13747 allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
13748 case $host in
13749 osf3*)
13750 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
13751 ;;
13752 *)
13753 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
13754 ;;
13755 esac
13756
13757 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
13758 hardcode_libdir_separator_CXX=:
13759
13760 # Commands to make compiler produce verbose output that lists
13761 # what "hidden" libraries, object files and flags are used when
13762 # linking a shared library.
13763 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
13764
13765 else
13766 # FIXME: insert proper C++ library support
13767 ld_shlibs_CXX=no
13768 fi
13769 ;;
13770 esac
13771 ;;
13772
13773 psos*)
13774 # FIXME: insert proper C++ library support
13775 ld_shlibs_CXX=no
13776 ;;
13777
13778 sunos4*)
13779 case $cc_basename in
13780 CC*)
13781 # Sun C++ 4.x
13782 # FIXME: insert proper C++ library support
13783 ld_shlibs_CXX=no
13784 ;;
13785 lcc*)
13786 # Lucid
13787 # FIXME: insert proper C++ library support
13788 ld_shlibs_CXX=no
13789 ;;
13790 *)
13791 # FIXME: insert proper C++ library support
13792 ld_shlibs_CXX=no
13793 ;;
13794 esac
13795 ;;
13796
13797 solaris*)
13798 case $cc_basename in
13799 CC*)
13800 # Sun C++ 4.2, 5.x and Centerline C++
13801 archive_cmds_need_lc_CXX=yes
13802 no_undefined_flag_CXX=' -zdefs'
13803 archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
13804 archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
13805 $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'
13806
13807 hardcode_libdir_flag_spec_CXX='-R$libdir'
13808 hardcode_shlibpath_var_CXX=no
13809 case $host_os in
13810 solaris2.[0-5] | solaris2.[0-5].*) ;;
13811 *)
13812 # The compiler driver will combine and reorder linker options,
13813 # but understands `-z linker_flag'.
13814 # Supported since Solaris 2.6 (maybe 2.5.1?)
13815 whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
13816 ;;
13817 esac
13818 link_all_deplibs_CXX=yes
13819
13820 output_verbose_link_cmd='echo'
13821
13822 # Archives containing C++ object files must be created using
13823 # "CC -xar", where "CC" is the Sun C++ compiler. This is
13824 # necessary to make sure instantiated templates are included
13825 # in the archive.
13826 old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
13827 ;;
13828 gcx*)
13829 # Green Hills C++ Compiler
13830 archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
13831
13832 # The C++ compiler must be used to create the archive.
13833 old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
13834 ;;
13835 *)
13836 # GNU C++ compiler with Solaris linker
13837 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
13838 no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
13839 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
13840 archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
13841 archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
13842 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
13843
13844 # Commands to make compiler produce verbose output that lists
13845 # what "hidden" libraries, object files and flags are used when
13846 # linking a shared library.
13847 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
13848 else
13849 # g++ 2.7 appears to require `-G' NOT `-shared' on this
13850 # platform.
13851 archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
13852 archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
13853 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
13854
13855 # Commands to make compiler produce verbose output that lists
13856 # what "hidden" libraries, object files and flags are used when
13857 # linking a shared library.
13858 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
13859 fi
13860
13861 hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
13862 case $host_os in
13863 solaris2.[0-5] | solaris2.[0-5].*) ;;
13864 *)
13865 whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
13866 ;;
13867 esac
13868 fi
13869 ;;
13870 esac
13871 ;;
13872
13873 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
13874 no_undefined_flag_CXX='${wl}-z,text'
13875 archive_cmds_need_lc_CXX=no
13876 hardcode_shlibpath_var_CXX=no
13877 runpath_var='LD_RUN_PATH'
13878
13879 case $cc_basename in
13880 CC*)
13881 archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13882 archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13883 ;;
13884 *)
13885 archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13886 archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13887 ;;
13888 esac
13889 ;;
13890
13891 sysv5* | sco3.2v5* | sco5v6*)
13892 # Note: We can NOT use -z defs as we might desire, because we do not
13893 # link with -lc, and that would cause any symbols used from libc to
13894 # always be unresolved, which means just about no library would
13895 # ever link correctly. If we're not using GNU ld we use -z text
13896 # though, which does catch some bad symbols but isn't as heavy-handed
13897 # as -z defs.
13898 no_undefined_flag_CXX='${wl}-z,text'
13899 allow_undefined_flag_CXX='${wl}-z,nodefs'
13900 archive_cmds_need_lc_CXX=no
13901 hardcode_shlibpath_var_CXX=no
13902 hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
13903 hardcode_libdir_separator_CXX=':'
13904 link_all_deplibs_CXX=yes
13905 export_dynamic_flag_spec_CXX='${wl}-Bexport'
13906 runpath_var='LD_RUN_PATH'
13907
13908 case $cc_basename in
13909 CC*)
13910 archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13911 archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13912 ;;
13913 *)
13914 archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13915 archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
13916 ;;
13917 esac
13918 ;;
13919
13920 tandem*)
13921 case $cc_basename in
13922 NCC*)
13923 # NonStop-UX NCC 3.20
13924 # FIXME: insert proper C++ library support
13925 ld_shlibs_CXX=no
13926 ;;
13927 *)
13928 # FIXME: insert proper C++ library support
13929 ld_shlibs_CXX=no
13930 ;;
13931 esac
13932 ;;
13933
13934 vxworks*)
13935 # FIXME: insert proper C++ library support
13936 ld_shlibs_CXX=no
13937 ;;
13938
13939 *)
13940 # FIXME: insert proper C++ library support
13941 ld_shlibs_CXX=no
13942 ;;
13943 esac
13944
13945 { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
13946 $as_echo "$ld_shlibs_CXX" >&6; }
13947 test "$ld_shlibs_CXX" = no && can_build_shared=no
13948
13949 GCC_CXX="$GXX"
13950 LD_CXX="$LD"
13951
13952 ## CAVEAT EMPTOR:
13953 ## There is no encapsulation within the following macros, do not change
13954 ## the running order or otherwise move them around unless you know exactly
13955 ## what you are doing...
13956 # Dependencies to place before and after the object being linked:
13957 predep_objects_CXX=
13958 postdep_objects_CXX=
13959 predeps_CXX=
13960 postdeps_CXX=
13961 compiler_lib_search_path_CXX=
13962
13963 cat > conftest.$ac_ext <<_LT_EOF
13964 class Foo
13965 {
13966 public:
13967 Foo (void) { a = 0; }
13968 private:
13969 int a;
13970 };
13971 _LT_EOF
13972
13973 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
13974 (eval $ac_compile) 2>&5
13975 ac_status=$?
13976 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13977 (exit $ac_status); }; then
13978 # Parse the compiler output and extract the necessary
13979 # objects, libraries and library flags.
13980
13981 # Sentinel used to keep track of whether or not we are before
13982 # the conftest object file.
13983 pre_test_object_deps_done=no
13984
13985 for p in `eval "$output_verbose_link_cmd"`; do
13986 case $p in
13987
13988 -L* | -R* | -l*)
13989 # Some compilers place space between "-{L,R}" and the path.
13990 # Remove the space.
13991 if test $p = "-L" ||
13992 test $p = "-R"; then
13993 prev=$p
13994 continue
13995 else
13996 prev=
13997 fi
13998
13999 if test "$pre_test_object_deps_done" = no; then
14000 case $p in
14001 -L* | -R*)
14002 # Internal compiler library paths should come after those
14003 # provided the user. The postdeps already come after the
14004 # user supplied libs so there is no need to process them.
14005 if test -z "$compiler_lib_search_path_CXX"; then
14006 compiler_lib_search_path_CXX="${prev}${p}"
14007 else
14008 compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
14009 fi
14010 ;;
14011 # The "-l" case would never come before the object being
14012 # linked, so don't bother handling this case.
14013 esac
14014 else
14015 if test -z "$postdeps_CXX"; then
14016 postdeps_CXX="${prev}${p}"
14017 else
14018 postdeps_CXX="${postdeps_CXX} ${prev}${p}"
14019 fi
14020 fi
14021 ;;
14022
14023 *.$objext)
14024 # This assumes that the test object file only shows up
14025 # once in the compiler output.
14026 if test "$p" = "conftest.$objext"; then
14027 pre_test_object_deps_done=yes
14028 continue
14029 fi
14030
14031 if test "$pre_test_object_deps_done" = no; then
14032 if test -z "$predep_objects_CXX"; then
14033 predep_objects_CXX="$p"
14034 else
14035 predep_objects_CXX="$predep_objects_CXX $p"
14036 fi
14037 else
14038 if test -z "$postdep_objects_CXX"; then
14039 postdep_objects_CXX="$p"
14040 else
14041 postdep_objects_CXX="$postdep_objects_CXX $p"
14042 fi
14043 fi
14044 ;;
14045
14046 *) ;; # Ignore the rest.
14047
14048 esac
14049 done
14050
14051 # Clean up.
14052 rm -f a.out a.exe
14053 else
14054 echo "libtool.m4: error: problem compiling CXX test program"
14055 fi
14056
14057 $RM -f confest.$objext
14058
14059 # PORTME: override above test on systems where it is broken
14060 case $host_os in
14061 interix[3-9]*)
14062 # Interix 3.5 installs completely hosed .la files for C++, so rather than
14063 # hack all around it, let's just trust "g++" to DTRT.
14064 predep_objects_CXX=
14065 postdep_objects_CXX=
14066 postdeps_CXX=
14067 ;;
14068
14069 linux*)
14070 case `$CC -V 2>&1 | sed 5q` in
14071 *Sun\ C*)
14072 # Sun C++ 5.9
14073
14074 # The more standards-conforming stlport4 library is
14075 # incompatible with the Cstd library. Avoid specifying
14076 # it if it's in CXXFLAGS. Ignore libCrun as
14077 # -library=stlport4 depends on it.
14078 case " $CXX $CXXFLAGS " in
14079 *" -library=stlport4 "*)
14080 solaris_use_stlport4=yes
14081 ;;
14082 esac
14083
14084 if test "$solaris_use_stlport4" != yes; then
14085 postdeps_CXX='-library=Cstd -library=Crun'
14086 fi
14087 ;;
14088 esac
14089 ;;
14090
14091 solaris*)
14092 case $cc_basename in
14093 CC*)
14094 # The more standards-conforming stlport4 library is
14095 # incompatible with the Cstd library. Avoid specifying
14096 # it if it's in CXXFLAGS. Ignore libCrun as
14097 # -library=stlport4 depends on it.
14098 case " $CXX $CXXFLAGS " in
14099 *" -library=stlport4 "*)
14100 solaris_use_stlport4=yes
14101 ;;
14102 esac
14103
14104 # Adding this requires a known-good setup of shared libraries for
14105 # Sun compiler versions before 5.6, else PIC objects from an old
14106 # archive will be linked into the output, leading to subtle bugs.
14107 if test "$solaris_use_stlport4" != yes; then
14108 postdeps_CXX='-library=Cstd -library=Crun'
14109 fi
14110 ;;
14111 esac
14112 ;;
14113 esac
14114
14115
14116 case " $postdeps_CXX " in
14117 *" -lc "*) archive_cmds_need_lc_CXX=no ;;
14118 esac
14119 compiler_lib_search_dirs_CXX=
14120 if test -n "${compiler_lib_search_path_CXX}"; then
14121 compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
14122 fi
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154 lt_prog_compiler_wl_CXX=
14155 lt_prog_compiler_pic_CXX=
14156 lt_prog_compiler_static_CXX=
14157
14158 { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
14159 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
14160
14161 # C++ specific cases for pic, static, wl, etc.
14162 if test "$GXX" = yes; then
14163 lt_prog_compiler_wl_CXX='-Wl,'
14164 lt_prog_compiler_static_CXX='-static'
14165
14166 case $host_os in
14167 aix*)
14168 # All AIX code is PIC.
14169 if test "$host_cpu" = ia64; then
14170 # AIX 5 now supports IA64 processor
14171 lt_prog_compiler_static_CXX='-Bstatic'
14172 fi
14173 ;;
14174
14175 amigaos*)
14176 case $host_cpu in
14177 powerpc)
14178 # see comment about AmigaOS4 .so support
14179 lt_prog_compiler_pic_CXX='-fPIC'
14180 ;;
14181 m68k)
14182 # FIXME: we need at least 68020 code to build shared libraries, but
14183 # adding the `-m68020' flag to GCC prevents building anything better,
14184 # like `-m68040'.
14185 lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
14186 ;;
14187 esac
14188 ;;
14189
14190 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
14191 # PIC is the default for these OSes.
14192 ;;
14193 mingw* | cygwin* | os2* | pw32* | cegcc*)
14194 # This hack is so that the source file can tell whether it is being
14195 # built for inclusion in a dll (and should export symbols for example).
14196 # Although the cygwin gcc ignores -fPIC, still need this for old-style
14197 # (--disable-auto-import) libraries
14198 lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
14199 ;;
14200 darwin* | rhapsody*)
14201 # PIC is the default on this platform
14202 # Common symbols not allowed in MH_DYLIB files
14203 lt_prog_compiler_pic_CXX='-fno-common'
14204 ;;
14205 *djgpp*)
14206 # DJGPP does not support shared libraries at all
14207 lt_prog_compiler_pic_CXX=
14208 ;;
14209 interix[3-9]*)
14210 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
14211 # Instead, we relocate shared libraries at runtime.
14212 ;;
14213 sysv4*MP*)
14214 if test -d /usr/nec; then
14215 lt_prog_compiler_pic_CXX=-Kconform_pic
14216 fi
14217 ;;
14218 hpux*)
14219 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
14220 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
14221 # sets the default TLS model and affects inlining.
14222 case $host_cpu in
14223 hppa*64*)
14224 ;;
14225 *)
14226 lt_prog_compiler_pic_CXX='-fPIC'
14227 ;;
14228 esac
14229 ;;
14230 *qnx* | *nto*)
14231 # QNX uses GNU C++, but need to define -shared option too, otherwise
14232 # it will coredump.
14233 lt_prog_compiler_pic_CXX='-fPIC -shared'
14234 ;;
14235 *)
14236 lt_prog_compiler_pic_CXX='-fPIC'
14237 ;;
14238 esac
14239 else
14240 case $host_os in
14241 aix[4-9]*)
14242 # All AIX code is PIC.
14243 if test "$host_cpu" = ia64; then
14244 # AIX 5 now supports IA64 processor
14245 lt_prog_compiler_static_CXX='-Bstatic'
14246 else
14247 lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
14248 fi
14249 ;;
14250 chorus*)
14251 case $cc_basename in
14252 cxch68*)
14253 # Green Hills C++ Compiler
14254 # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--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"
14255 ;;
14256 esac
14257 ;;
14258 dgux*)
14259 case $cc_basename in
14260 ec++*)
14261 lt_prog_compiler_pic_CXX='-KPIC'
14262 ;;
14263 ghcx*)
14264 # Green Hills C++ Compiler
14265 lt_prog_compiler_pic_CXX='-pic'
14266 ;;
14267 *)
14268 ;;
14269 esac
14270 ;;
14271 freebsd* | dragonfly*)
14272 # FreeBSD uses GNU C++
14273 ;;
14274 hpux9* | hpux10* | hpux11*)
14275 case $cc_basename in
14276 CC*)
14277 lt_prog_compiler_wl_CXX='-Wl,'
14278 lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
14279 if test "$host_cpu" != ia64; then
14280 lt_prog_compiler_pic_CXX='+Z'
14281 fi
14282 ;;
14283 aCC*)
14284 lt_prog_compiler_wl_CXX='-Wl,'
14285 lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
14286 case $host_cpu in
14287 hppa*64*|ia64*)
14288 # +Z the default
14289 ;;
14290 *)
14291 lt_prog_compiler_pic_CXX='+Z'
14292 ;;
14293 esac
14294 ;;
14295 *)
14296 ;;
14297 esac
14298 ;;
14299 interix*)
14300 # This is c89, which is MS Visual C++ (no shared libs)
14301 # Anyone wants to do a port?
14302 ;;
14303 irix5* | irix6* | nonstopux*)
14304 case $cc_basename in
14305 CC*)
14306 lt_prog_compiler_wl_CXX='-Wl,'
14307 lt_prog_compiler_static_CXX='-non_shared'
14308 # CC pic flag -KPIC is the default.
14309 ;;
14310 *)
14311 ;;
14312 esac
14313 ;;
14314 linux* | k*bsd*-gnu)
14315 case $cc_basename in
14316 KCC*)
14317 # KAI C++ Compiler
14318 lt_prog_compiler_wl_CXX='--backend -Wl,'
14319 lt_prog_compiler_pic_CXX='-fPIC'
14320 ;;
14321 ecpc* )
14322 # old Intel C++ for x86_64 which still supported -KPIC.
14323 lt_prog_compiler_wl_CXX='-Wl,'
14324 lt_prog_compiler_pic_CXX='-KPIC'
14325 lt_prog_compiler_static_CXX='-static'
14326 ;;
14327 icpc* )
14328 # Intel C++, used to be incompatible with GCC.
14329 # ICC 10 doesn't accept -KPIC any more.
14330 lt_prog_compiler_wl_CXX='-Wl,'
14331 lt_prog_compiler_pic_CXX='-fPIC'
14332 lt_prog_compiler_static_CXX='-static'
14333 ;;
14334 pgCC* | pgcpp*)
14335 # Portland Group C++ compiler
14336 lt_prog_compiler_wl_CXX='-Wl,'
14337 lt_prog_compiler_pic_CXX='-fpic'
14338 lt_prog_compiler_static_CXX='-Bstatic'
14339 ;;
14340 cxx*)
14341 # Compaq C++
14342 # Make sure the PIC flag is empty. It appears that all Alpha
14343 # Linux and Compaq Tru64 Unix objects are PIC.
14344 lt_prog_compiler_pic_CXX=
14345 lt_prog_compiler_static_CXX='-non_shared'
14346 ;;
14347 xlc* | xlC*)
14348 # IBM XL 8.0 on PPC
14349 lt_prog_compiler_wl_CXX='-Wl,'
14350 lt_prog_compiler_pic_CXX='-qpic'
14351 lt_prog_compiler_static_CXX='-qstaticlink'
14352 ;;
14353 *)
14354 case `$CC -V 2>&1 | sed 5q` in
14355 *Sun\ C*)
14356 # Sun C++ 5.9
14357 lt_prog_compiler_pic_CXX='-KPIC'
14358 lt_prog_compiler_static_CXX='-Bstatic'
14359 lt_prog_compiler_wl_CXX='-Qoption ld '
14360 ;;
14361 esac
14362 ;;
14363 esac
14364 ;;
14365 lynxos*)
14366 ;;
14367 m88k*)
14368 ;;
14369 mvs*)
14370 case $cc_basename in
14371 cxx*)
14372 lt_prog_compiler_pic_CXX='-W c,exportall'
14373 ;;
14374 *)
14375 ;;
14376 esac
14377 ;;
14378 netbsd*)
14379 ;;
14380 *qnx* | *nto*)
14381 # QNX uses GNU C++, but need to define -shared option too, otherwise
14382 # it will coredump.
14383 lt_prog_compiler_pic_CXX='-fPIC -shared'
14384 ;;
14385 osf3* | osf4* | osf5*)
14386 case $cc_basename in
14387 KCC*)
14388 lt_prog_compiler_wl_CXX='--backend -Wl,'
14389 ;;
14390 RCC*)
14391 # Rational C++ 2.4.1
14392 lt_prog_compiler_pic_CXX='-pic'
14393 ;;
14394 cxx*)
14395 # Digital/Compaq C++
14396 lt_prog_compiler_wl_CXX='-Wl,'
14397 # Make sure the PIC flag is empty. It appears that all Alpha
14398 # Linux and Compaq Tru64 Unix objects are PIC.
14399 lt_prog_compiler_pic_CXX=
14400 lt_prog_compiler_static_CXX='-non_shared'
14401 ;;
14402 *)
14403 ;;
14404 esac
14405 ;;
14406 psos*)
14407 ;;
14408 solaris*)
14409 case $cc_basename in
14410 CC*)
14411 # Sun C++ 4.2, 5.x and Centerline C++
14412 lt_prog_compiler_pic_CXX='-KPIC'
14413 lt_prog_compiler_static_CXX='-Bstatic'
14414 lt_prog_compiler_wl_CXX='-Qoption ld '
14415 ;;
14416 gcx*)
14417 # Green Hills C++ Compiler
14418 lt_prog_compiler_pic_CXX='-PIC'
14419 ;;
14420 *)
14421 ;;
14422 esac
14423 ;;
14424 sunos4*)
14425 case $cc_basename in
14426 CC*)
14427 # Sun C++ 4.x
14428 lt_prog_compiler_pic_CXX='-pic'
14429 lt_prog_compiler_static_CXX='-Bstatic'
14430 ;;
14431 lcc*)
14432 # Lucid
14433 lt_prog_compiler_pic_CXX='-pic'
14434 ;;
14435 *)
14436 ;;
14437 esac
14438 ;;
14439 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
14440 case $cc_basename in
14441 CC*)
14442 lt_prog_compiler_wl_CXX='-Wl,'
14443 lt_prog_compiler_pic_CXX='-KPIC'
14444 lt_prog_compiler_static_CXX='-Bstatic'
14445 ;;
14446 esac
14447 ;;
14448 tandem*)
14449 case $cc_basename in
14450 NCC*)
14451 # NonStop-UX NCC 3.20
14452 lt_prog_compiler_pic_CXX='-KPIC'
14453 ;;
14454 *)
14455 ;;
14456 esac
14457 ;;
14458 vxworks*)
14459 ;;
14460 *)
14461 lt_prog_compiler_can_build_shared_CXX=no
14462 ;;
14463 esac
14464 fi
14465
14466 case $host_os in
14467 # For platforms which do not support PIC, -DPIC is meaningless:
14468 *djgpp*)
14469 lt_prog_compiler_pic_CXX=
14470 ;;
14471 *)
14472 lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
14473 ;;
14474 esac
14475 { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
14476 $as_echo "$lt_prog_compiler_pic_CXX" >&6; }
14477
14478
14479
14480 #
14481 # Check to make sure the PIC flag actually works.
14482 #
14483 if test -n "$lt_prog_compiler_pic_CXX"; then
14484 { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
14485 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
14486 if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
14487 $as_echo_n "(cached) " >&6
14488 else
14489 lt_cv_prog_compiler_pic_works_CXX=no
14490 ac_outfile=conftest.$ac_objext
14491 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14492 lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
14493 # Insert the option either (1) after the last *FLAGS variable, or
14494 # (2) before a word containing "conftest.", or (3) at the end.
14495 # Note that $ac_compile itself does not contain backslashes and begins
14496 # with a dollar sign (not a hyphen), so the echo should work correctly.
14497 # The option is referenced via a variable to avoid confusing sed.
14498 lt_compile=`echo "$ac_compile" | $SED \
14499 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14500 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14501 -e 's:$: $lt_compiler_flag:'`
14502 (eval echo "\"\$as_me:14503: $lt_compile\"" >&5)
14503 (eval "$lt_compile" 2>conftest.err)
14504 ac_status=$?
14505 cat conftest.err >&5
14506 echo "$as_me:14507: \$? = $ac_status" >&5
14507 if (exit $ac_status) && test -s "$ac_outfile"; then
14508 # The compiler can only warn and ignore the option if not recognized
14509 # So say no if there are warnings other than the usual output.
14510 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
14511 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
14512 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
14513 lt_cv_prog_compiler_pic_works_CXX=yes
14514 fi
14515 fi
14516 $RM conftest*
14517
14518 fi
14519 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
14520 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
14521
14522 if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
14523 case $lt_prog_compiler_pic_CXX in
14524 "" | " "*) ;;
14525 *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
14526 esac
14527 else
14528 lt_prog_compiler_pic_CXX=
14529 lt_prog_compiler_can_build_shared_CXX=no
14530 fi
14531
14532 fi
14533
14534
14535
14536 #
14537 # Check to make sure the static flag actually works.
14538 #
14539 wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
14540 { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
14541 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
14542 if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
14543 $as_echo_n "(cached) " >&6
14544 else
14545 lt_cv_prog_compiler_static_works_CXX=no
14546 save_LDFLAGS="$LDFLAGS"
14547 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
14548 echo "$lt_simple_link_test_code" > conftest.$ac_ext
14549 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
14550 # The linker can only warn and ignore the option if not recognized
14551 # So say no if there are warnings
14552 if test -s conftest.err; then
14553 # Append any errors to the config.log.
14554 cat conftest.err 1>&5
14555 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
14556 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
14557 if diff conftest.exp conftest.er2 >/dev/null; then
14558 lt_cv_prog_compiler_static_works_CXX=yes
14559 fi
14560 else
14561 lt_cv_prog_compiler_static_works_CXX=yes
14562 fi
14563 fi
14564 $RM -r conftest*
14565 LDFLAGS="$save_LDFLAGS"
14566
14567 fi
14568 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
14569 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
14570
14571 if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
14572 :
14573 else
14574 lt_prog_compiler_static_CXX=
14575 fi
14576
14577
14578
14579
14580 { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
14581 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
14582 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
14583 $as_echo_n "(cached) " >&6
14584 else
14585 lt_cv_prog_compiler_c_o_CXX=no
14586 $RM -r conftest 2>/dev/null
14587 mkdir conftest
14588 cd conftest
14589 mkdir out
14590 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14591
14592 lt_compiler_flag="-o out/conftest2.$ac_objext"
14593 # Insert the option either (1) after the last *FLAGS variable, or
14594 # (2) before a word containing "conftest.", or (3) at the end.
14595 # Note that $ac_compile itself does not contain backslashes and begins
14596 # with a dollar sign (not a hyphen), so the echo should work correctly.
14597 lt_compile=`echo "$ac_compile" | $SED \
14598 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14599 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14600 -e 's:$: $lt_compiler_flag:'`
14601 (eval echo "\"\$as_me:14602: $lt_compile\"" >&5)
14602 (eval "$lt_compile" 2>out/conftest.err)
14603 ac_status=$?
14604 cat out/conftest.err >&5
14605 echo "$as_me:14606: \$? = $ac_status" >&5
14606 if (exit $ac_status) && test -s out/conftest2.$ac_objext
14607 then
14608 # The compiler can only warn and ignore the option if not recognized
14609 # So say no if there are warnings
14610 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
14611 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
14612 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
14613 lt_cv_prog_compiler_c_o_CXX=yes
14614 fi
14615 fi
14616 chmod u+w . 2>&5
14617 $RM conftest*
14618 # SGI C++ compiler will create directory out/ii_files/ for
14619 # template instantiation
14620 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
14621 $RM out/* && rmdir out
14622 cd ..
14623 $RM -r conftest
14624 $RM conftest*
14625
14626 fi
14627 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
14628 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
14629
14630
14631
14632 { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
14633 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
14634 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
14635 $as_echo_n "(cached) " >&6
14636 else
14637 lt_cv_prog_compiler_c_o_CXX=no
14638 $RM -r conftest 2>/dev/null
14639 mkdir conftest
14640 cd conftest
14641 mkdir out
14642 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14643
14644 lt_compiler_flag="-o out/conftest2.$ac_objext"
14645 # Insert the option either (1) after the last *FLAGS variable, or
14646 # (2) before a word containing "conftest.", or (3) at the end.
14647 # Note that $ac_compile itself does not contain backslashes and begins
14648 # with a dollar sign (not a hyphen), so the echo should work correctly.
14649 lt_compile=`echo "$ac_compile" | $SED \
14650 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14651 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14652 -e 's:$: $lt_compiler_flag:'`
14653 (eval echo "\"\$as_me:14654: $lt_compile\"" >&5)
14654 (eval "$lt_compile" 2>out/conftest.err)
14655 ac_status=$?
14656 cat out/conftest.err >&5
14657 echo "$as_me:14658: \$? = $ac_status" >&5
14658 if (exit $ac_status) && test -s out/conftest2.$ac_objext
14659 then
14660 # The compiler can only warn and ignore the option if not recognized
14661 # So say no if there are warnings
14662 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
14663 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
14664 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
14665 lt_cv_prog_compiler_c_o_CXX=yes
14666 fi
14667 fi
14668 chmod u+w . 2>&5
14669 $RM conftest*
14670 # SGI C++ compiler will create directory out/ii_files/ for
14671 # template instantiation
14672 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
14673 $RM out/* && rmdir out
14674 cd ..
14675 $RM -r conftest
14676 $RM conftest*
14677
14678 fi
14679 { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
14680 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
14681
14682
14683
14684
14685 hard_links="nottested"
14686 if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
14687 # do not overwrite the value of need_locks provided by the user
14688 { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
14689 $as_echo_n "checking if we can lock with hard links... " >&6; }
14690 hard_links=yes
14691 $RM conftest*
14692 ln conftest.a conftest.b 2>/dev/null && hard_links=no
14693 touch conftest.a
14694 ln conftest.a conftest.b 2>&5 || hard_links=no
14695 ln conftest.a conftest.b 2>/dev/null && hard_links=no
14696 { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
14697 $as_echo "$hard_links" >&6; }
14698 if test "$hard_links" = no; then
14699 { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
14700 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
14701 need_locks=warn
14702 fi
14703 else
14704 need_locks=no
14705 fi
14706
14707
14708
14709 { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
14710 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
14711
14712 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
14713 case $host_os in
14714 aix[4-9]*)
14715 # If we're using GNU nm, then we don't want the "-C" option.
14716 # -C means demangle to AIX nm, but means don't demangle with GNU nm
14717 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
14718 export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
14719 else
14720 export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
14721 fi
14722 ;;
14723 pw32*)
14724 export_symbols_cmds_CXX="$ltdll_cmds"
14725 ;;
14726 cygwin* | mingw* | cegcc*)
14727 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
14728 ;;
14729 *)
14730 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
14731 ;;
14732 esac
14733 exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
14734
14735 { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
14736 $as_echo "$ld_shlibs_CXX" >&6; }
14737 test "$ld_shlibs_CXX" = no && can_build_shared=no
14738
14739 with_gnu_ld_CXX=$with_gnu_ld
14740
14741
14742
14743
14744
14745
14746 #
14747 # Do we need to explicitly link libc?
14748 #
14749 case "x$archive_cmds_need_lc_CXX" in
14750 x|xyes)
14751 # Assume -lc should be added
14752 archive_cmds_need_lc_CXX=yes
14753
14754 if test "$enable_shared" = yes && test "$GCC" = yes; then
14755 case $archive_cmds_CXX in
14756 *'~'*)
14757 # FIXME: we may have to deal with multi-command sequences.
14758 ;;
14759 '$CC '*)
14760 # Test whether the compiler implicitly links with -lc since on some
14761 # systems, -lgcc has to come before -lc. If gcc already passes -lc
14762 # to ld, don't add -lc before -lgcc.
14763 { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
14764 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
14765 $RM conftest*
14766 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14767
14768 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
14769 (eval $ac_compile) 2>&5
14770 ac_status=$?
14771 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14772 (exit $ac_status); } 2>conftest.err; then
14773 soname=conftest
14774 lib=conftest
14775 libobjs=conftest.$ac_objext
14776 deplibs=
14777 wl=$lt_prog_compiler_wl_CXX
14778 pic_flag=$lt_prog_compiler_pic_CXX
14779 compiler_flags=-v
14780 linker_flags=-v
14781 verstring=
14782 output_objdir=.
14783 libname=conftest
14784 lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
14785 allow_undefined_flag_CXX=
14786 if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
14787 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
14788 ac_status=$?
14789 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14790 (exit $ac_status); }
14791 then
14792 archive_cmds_need_lc_CXX=no
14793 else
14794 archive_cmds_need_lc_CXX=yes
14795 fi
14796 allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
14797 else
14798 cat conftest.err 1>&5
14799 fi
14800 $RM conftest*
14801 { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
14802 $as_echo "$archive_cmds_need_lc_CXX" >&6; }
14803 ;;
14804 esac
14805 fi
14806 ;;
14807 esac
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
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872 { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
14873 $as_echo_n "checking dynamic linker characteristics... " >&6; }
14874
14875 library_names_spec=
14876 libname_spec='lib$name'
14877 soname_spec=
14878 shrext_cmds=".so"
14879 postinstall_cmds=
14880 postuninstall_cmds=
14881 finish_cmds=
14882 finish_eval=
14883 shlibpath_var=
14884 shlibpath_overrides_runpath=unknown
14885 version_type=none
14886 dynamic_linker="$host_os ld.so"
14887 sys_lib_dlsearch_path_spec="/lib /usr/lib"
14888 need_lib_prefix=unknown
14889 hardcode_into_libs=no
14890
14891 # when you set need_version to no, make sure it does not cause -set_version
14892 # flags to be left without arguments
14893 need_version=unknown
14894
14895 case $host_os in
14896 aix3*)
14897 version_type=linux
14898 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
14899 shlibpath_var=LIBPATH
14900
14901 # AIX 3 has no versioning support, so we append a major version to the name.
14902 soname_spec='${libname}${release}${shared_ext}$major'
14903 ;;
14904
14905 aix[4-9]*)
14906 version_type=linux
14907 need_lib_prefix=no
14908 need_version=no
14909 hardcode_into_libs=yes
14910 if test "$host_cpu" = ia64; then
14911 # AIX 5 supports IA64
14912 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
14913 shlibpath_var=LD_LIBRARY_PATH
14914 else
14915 # With GCC up to 2.95.x, collect2 would create an import file
14916 # for dependence libraries. The import file would start with
14917 # the line `#! .'. This would cause the generated library to
14918 # depend on `.', always an invalid library. This was fixed in
14919 # development snapshots of GCC prior to 3.0.
14920 case $host_os in
14921 aix4 | aix4.[01] | aix4.[01].*)
14922 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
14923 echo ' yes '
14924 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
14925 :
14926 else
14927 can_build_shared=no
14928 fi
14929 ;;
14930 esac
14931 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
14932 # soname into executable. Probably we can add versioning support to
14933 # collect2, so additional links can be useful in future.
14934 if test "$aix_use_runtimelinking" = yes; then
14935 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
14936 # instead of lib<name>.a to let people know that these are not
14937 # typical AIX shared libraries.
14938 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14939 else
14940 # We preserve .a as extension for shared libraries through AIX4.2
14941 # and later when we are not doing run time linking.
14942 library_names_spec='${libname}${release}.a $libname.a'
14943 soname_spec='${libname}${release}${shared_ext}$major'
14944 fi
14945 shlibpath_var=LIBPATH
14946 fi
14947 ;;
14948
14949 amigaos*)
14950 case $host_cpu in
14951 powerpc)
14952 # Since July 2007 AmigaOS4 officially supports .so libraries.
14953 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
14954 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14955 ;;
14956 m68k)
14957 library_names_spec='$libname.ixlibrary $libname.a'
14958 # Create ${libname}_ixlibrary.a entries in /sys/libs.
14959 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
14960 ;;
14961 esac
14962 ;;
14963
14964 beos*)
14965 library_names_spec='${libname}${shared_ext}'
14966 dynamic_linker="$host_os ld.so"
14967 shlibpath_var=LIBRARY_PATH
14968 ;;
14969
14970 bsdi[45]*)
14971 version_type=linux
14972 need_version=no
14973 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14974 soname_spec='${libname}${release}${shared_ext}$major'
14975 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
14976 shlibpath_var=LD_LIBRARY_PATH
14977 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
14978 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
14979 # the default ld.so.conf also contains /usr/contrib/lib and
14980 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
14981 # libtool to hard-code these into programs
14982 ;;
14983
14984 cygwin* | mingw* | pw32* | cegcc*)
14985 version_type=windows
14986 shrext_cmds=".dll"
14987 need_version=no
14988 need_lib_prefix=no
14989
14990 case $GCC,$host_os in
14991 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
14992 library_names_spec='$libname.dll.a'
14993 # DLL is installed to $(libdir)/../bin by postinstall_cmds
14994 postinstall_cmds='base_file=`basename \${file}`~
14995 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
14996 dldir=$destdir/`dirname \$dlpath`~
14997 test -d \$dldir || mkdir -p \$dldir~
14998 $install_prog $dir/$dlname \$dldir/$dlname~
14999 chmod a+x \$dldir/$dlname~
15000 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
15001 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
15002 fi'
15003 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
15004 dlpath=$dir/\$dldll~
15005 $RM \$dlpath'
15006 shlibpath_overrides_runpath=yes
15007
15008 case $host_os in
15009 cygwin*)
15010 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
15011 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
15012 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
15013 ;;
15014 mingw* | cegcc*)
15015 # MinGW DLLs use traditional 'lib' prefix
15016 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
15017 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
15018 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
15019 # It is most probably a Windows format PATH printed by
15020 # mingw gcc, but we are running on Cygwin. Gcc prints its search
15021 # path with ; separators, and with drive letters. We can handle the
15022 # drive letters (cygwin fileutils understands them), so leave them,
15023 # especially as we might pass files found there to a mingw objdump,
15024 # which wouldn't understand a cygwinified path. Ahh.
15025 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
15026 else
15027 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
15028 fi
15029 ;;
15030 pw32*)
15031 # pw32 DLLs use 'pw' prefix rather than 'lib'
15032 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
15033 ;;
15034 esac
15035 ;;
15036
15037 *)
15038 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
15039 ;;
15040 esac
15041 dynamic_linker='Win32 ld.exe'
15042 # FIXME: first we should search . and the directory the executable is in
15043 shlibpath_var=PATH
15044 ;;
15045
15046 darwin* | rhapsody*)
15047 dynamic_linker="$host_os dyld"
15048 version_type=darwin
15049 need_lib_prefix=no
15050 need_version=no
15051 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
15052 soname_spec='${libname}${release}${major}$shared_ext'
15053 shlibpath_overrides_runpath=yes
15054 shlibpath_var=DYLD_LIBRARY_PATH
15055 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
15056
15057 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
15058 ;;
15059
15060 dgux*)
15061 version_type=linux
15062 need_lib_prefix=no
15063 need_version=no
15064 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
15065 soname_spec='${libname}${release}${shared_ext}$major'
15066 shlibpath_var=LD_LIBRARY_PATH
15067 ;;
15068
15069 freebsd1*)
15070 dynamic_linker=no
15071 ;;
15072
15073 freebsd* | dragonfly*)
15074 # DragonFly does not have aout. When/if they implement a new
15075 # versioning mechanism, adjust this.
15076 if test -x /usr/bin/objformat; then
15077 objformat=`/usr/bin/objformat`
15078 else
15079 case $host_os in
15080 freebsd[123]*) objformat=aout ;;
15081 *) objformat=elf ;;
15082 esac
15083 fi
15084 version_type=freebsd-$objformat
15085 case $version_type in
15086 freebsd-elf*)
15087 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
15088 need_version=no
15089 need_lib_prefix=no
15090 ;;
15091 freebsd-*)
15092 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
15093 need_version=yes
15094 ;;
15095 esac
15096 shlibpath_var=LD_LIBRARY_PATH
15097 case $host_os in
15098 freebsd2*)
15099 shlibpath_overrides_runpath=yes
15100 ;;
15101 freebsd3.[01]* | freebsdelf3.[01]*)
15102 shlibpath_overrides_runpath=yes
15103 hardcode_into_libs=yes
15104 ;;
15105 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
15106 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
15107 shlibpath_overrides_runpath=no
15108 hardcode_into_libs=yes
15109 ;;
15110 *) # from 4.6 on, and DragonFly
15111 shlibpath_overrides_runpath=yes
15112 hardcode_into_libs=yes
15113 ;;
15114 esac
15115 ;;
15116
15117 gnu*)
15118 version_type=linux
15119 need_lib_prefix=no
15120 need_version=no
15121 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
15122 soname_spec='${libname}${release}${shared_ext}$major'
15123 shlibpath_var=LD_LIBRARY_PATH
15124 hardcode_into_libs=yes
15125 ;;
15126
15127 hpux9* | hpux10* | hpux11*)
15128 # Give a soname corresponding to the major version so that dld.sl refuses to
15129 # link against other versions.
15130 version_type=sunos
15131 need_lib_prefix=no
15132 need_version=no
15133 case $host_cpu in
15134 ia64*)
15135 shrext_cmds='.so'
15136 hardcode_into_libs=yes
15137 dynamic_linker="$host_os dld.so"
15138 shlibpath_var=LD_LIBRARY_PATH
15139 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
15140 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15141 soname_spec='${libname}${release}${shared_ext}$major'
15142 if test "X$HPUX_IA64_MODE" = X32; then
15143 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
15144 else
15145 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
15146 fi
15147 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
15148 ;;
15149 hppa*64*)
15150 shrext_cmds='.sl'
15151 hardcode_into_libs=yes
15152 dynamic_linker="$host_os dld.sl"
15153 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
15154 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
15155 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15156 soname_spec='${libname}${release}${shared_ext}$major'
15157 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
15158 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
15159 ;;
15160 *)
15161 shrext_cmds='.sl'
15162 dynamic_linker="$host_os dld.sl"
15163 shlibpath_var=SHLIB_PATH
15164 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
15165 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15166 soname_spec='${libname}${release}${shared_ext}$major'
15167 ;;
15168 esac
15169 # HP-UX runs *really* slowly unless shared libraries are mode 555.
15170 postinstall_cmds='chmod 555 $lib'
15171 ;;
15172
15173 interix[3-9]*)
15174 version_type=linux
15175 need_lib_prefix=no
15176 need_version=no
15177 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
15178 soname_spec='${libname}${release}${shared_ext}$major'
15179 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
15180 shlibpath_var=LD_LIBRARY_PATH
15181 shlibpath_overrides_runpath=no
15182 hardcode_into_libs=yes
15183 ;;
15184
15185 irix5* | irix6* | nonstopux*)
15186 case $host_os in
15187 nonstopux*) version_type=nonstopux ;;
15188 *)
15189 if test "$lt_cv_prog_gnu_ld" = yes; then
15190 version_type=linux
15191 else
15192 version_type=irix
15193 fi ;;
15194 esac
15195 need_lib_prefix=no
15196 need_version=no
15197 soname_spec='${libname}${release}${shared_ext}$major'
15198 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
15199 case $host_os in
15200 irix5* | nonstopux*)
15201 libsuff= shlibsuff=
15202 ;;
15203 *)
15204 case $LD in # libtool.m4 will add one of these switches to LD
15205 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
15206 libsuff= shlibsuff= libmagic=32-bit;;
15207 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
15208 libsuff=32 shlibsuff=N32 libmagic=N32;;
15209 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
15210 libsuff=64 shlibsuff=64 libmagic=64-bit;;
15211 *) libsuff= shlibsuff= libmagic=never-match;;
15212 esac
15213 ;;
15214 esac
15215 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
15216 shlibpath_overrides_runpath=no
15217 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
15218 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
15219 hardcode_into_libs=yes
15220 ;;
15221
15222 # No shared lib support for Linux oldld, aout, or coff.
15223 linux*oldld* | linux*aout* | linux*coff*)
15224 dynamic_linker=no
15225 ;;
15226
15227 # This must be Linux ELF.
15228 linux* | k*bsd*-gnu)
15229 version_type=linux
15230 need_lib_prefix=no
15231 need_version=no
15232 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15233 soname_spec='${libname}${release}${shared_ext}$major'
15234 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
15235 shlibpath_var=LD_LIBRARY_PATH
15236 shlibpath_overrides_runpath=no
15237 # Some binutils ld are patched to set DT_RUNPATH
15238 save_LDFLAGS=$LDFLAGS
15239 save_libdir=$libdir
15240 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
15241 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
15242 cat >conftest.$ac_ext <<_ACEOF
15243 /* confdefs.h. */
15244 _ACEOF
15245 cat confdefs.h >>conftest.$ac_ext
15246 cat >>conftest.$ac_ext <<_ACEOF
15247 /* end confdefs.h. */
15248
15249 int
15250 main ()
15251 {
15252
15253 ;
15254 return 0;
15255 }
15256 _ACEOF
15257 rm -f conftest.$ac_objext conftest$ac_exeext
15258 if { (ac_try="$ac_link"
15259 case "(($ac_try" in
15260 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15261 *) ac_try_echo=$ac_try;;
15262 esac
15263 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15264 $as_echo "$ac_try_echo") >&5
15265 (eval "$ac_link") 2>conftest.er1
15266 ac_status=$?
15267 grep -v '^ *+' conftest.er1 >conftest.err
15268 rm -f conftest.er1
15269 cat conftest.err >&5
15270 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15271 (exit $ac_status); } && {
15272 test -z "$ac_cxx_werror_flag" ||
15273 test ! -s conftest.err
15274 } && test -s conftest$ac_exeext && {
15275 test "$cross_compiling" = yes ||
15276 $as_test_x conftest$ac_exeext
15277 }; then
15278 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
15279 shlibpath_overrides_runpath=yes
15280 fi
15281
15282 else
15283 $as_echo "$as_me: failed program was:" >&5
15284 sed 's/^/| /' conftest.$ac_ext >&5
15285
15286
15287 fi
15288
15289 rm -rf conftest.dSYM
15290 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
15291 conftest$ac_exeext conftest.$ac_ext
15292 LDFLAGS=$save_LDFLAGS
15293 libdir=$save_libdir
15294
15295 # This implies no fast_install, which is unacceptable.
15296 # Some rework will be needed to allow for fast_install
15297 # before this can be enabled.
15298 hardcode_into_libs=yes
15299
15300 # Add ABI-specific directories to the system library path.
15301 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
15302
15303 # Append ld.so.conf contents to the search path
15304 if test -f /etc/ld.so.conf; then
15305 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
15306 sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
15307 fi
15308
15309 # We used to test for /lib/ld.so.1 and disable shared libraries on
15310 # powerpc, because MkLinux only supported shared libraries with the
15311 # GNU dynamic linker. Since this was broken with cross compilers,
15312 # most powerpc-linux boxes support dynamic linking these days and
15313 # people can always --disable-shared, the test was removed, and we
15314 # assume the GNU/Linux dynamic linker is in use.
15315 dynamic_linker='GNU/Linux ld.so'
15316 ;;
15317
15318 netbsd*)
15319 version_type=sunos
15320 need_lib_prefix=no
15321 need_version=no
15322 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
15323 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
15324 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
15325 dynamic_linker='NetBSD (a.out) ld.so'
15326 else
15327 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
15328 soname_spec='${libname}${release}${shared_ext}$major'
15329 dynamic_linker='NetBSD ld.elf_so'
15330 fi
15331 shlibpath_var=LD_LIBRARY_PATH
15332 shlibpath_overrides_runpath=yes
15333 hardcode_into_libs=yes
15334 ;;
15335
15336 newsos6)
15337 version_type=linux
15338 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15339 shlibpath_var=LD_LIBRARY_PATH
15340 shlibpath_overrides_runpath=yes
15341 ;;
15342
15343 *nto* | *qnx*)
15344 version_type=qnx
15345 need_lib_prefix=no
15346 need_version=no
15347 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15348 soname_spec='${libname}${release}${shared_ext}$major'
15349 shlibpath_var=LD_LIBRARY_PATH
15350 shlibpath_overrides_runpath=no
15351 hardcode_into_libs=yes
15352 dynamic_linker='ldqnx.so'
15353 ;;
15354
15355 openbsd*)
15356 version_type=sunos
15357 sys_lib_dlsearch_path_spec="/usr/lib"
15358 need_lib_prefix=no
15359 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
15360 case $host_os in
15361 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
15362 *) need_version=no ;;
15363 esac
15364 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
15365 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
15366 shlibpath_var=LD_LIBRARY_PATH
15367 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
15368 case $host_os in
15369 openbsd2.[89] | openbsd2.[89].*)
15370 shlibpath_overrides_runpath=no
15371 ;;
15372 *)
15373 shlibpath_overrides_runpath=yes
15374 ;;
15375 esac
15376 else
15377 shlibpath_overrides_runpath=yes
15378 fi
15379 ;;
15380
15381 os2*)
15382 libname_spec='$name'
15383 shrext_cmds=".dll"
15384 need_lib_prefix=no
15385 library_names_spec='$libname${shared_ext} $libname.a'
15386 dynamic_linker='OS/2 ld.exe'
15387 shlibpath_var=LIBPATH
15388 ;;
15389
15390 osf3* | osf4* | osf5*)
15391 version_type=osf
15392 need_lib_prefix=no
15393 need_version=no
15394 soname_spec='${libname}${release}${shared_ext}$major'
15395 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15396 shlibpath_var=LD_LIBRARY_PATH
15397 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
15398 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
15399 ;;
15400
15401 rdos*)
15402 dynamic_linker=no
15403 ;;
15404
15405 solaris*)
15406 version_type=linux
15407 need_lib_prefix=no
15408 need_version=no
15409 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15410 soname_spec='${libname}${release}${shared_ext}$major'
15411 shlibpath_var=LD_LIBRARY_PATH
15412 shlibpath_overrides_runpath=yes
15413 hardcode_into_libs=yes
15414 # ldd complains unless libraries are executable
15415 postinstall_cmds='chmod +x $lib'
15416 ;;
15417
15418 sunos4*)
15419 version_type=sunos
15420 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
15421 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
15422 shlibpath_var=LD_LIBRARY_PATH
15423 shlibpath_overrides_runpath=yes
15424 if test "$with_gnu_ld" = yes; then
15425 need_lib_prefix=no
15426 fi
15427 need_version=yes
15428 ;;
15429
15430 sysv4 | sysv4.3*)
15431 version_type=linux
15432 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15433 soname_spec='${libname}${release}${shared_ext}$major'
15434 shlibpath_var=LD_LIBRARY_PATH
15435 case $host_vendor in
15436 sni)
15437 shlibpath_overrides_runpath=no
15438 need_lib_prefix=no
15439 runpath_var=LD_RUN_PATH
15440 ;;
15441 siemens)
15442 need_lib_prefix=no
15443 ;;
15444 motorola)
15445 need_lib_prefix=no
15446 need_version=no
15447 shlibpath_overrides_runpath=no
15448 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
15449 ;;
15450 esac
15451 ;;
15452
15453 sysv4*MP*)
15454 if test -d /usr/nec ;then
15455 version_type=linux
15456 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
15457 soname_spec='$libname${shared_ext}.$major'
15458 shlibpath_var=LD_LIBRARY_PATH
15459 fi
15460 ;;
15461
15462 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
15463 version_type=freebsd-elf
15464 need_lib_prefix=no
15465 need_version=no
15466 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
15467 soname_spec='${libname}${release}${shared_ext}$major'
15468 shlibpath_var=LD_LIBRARY_PATH
15469 shlibpath_overrides_runpath=yes
15470 hardcode_into_libs=yes
15471 if test "$with_gnu_ld" = yes; then
15472 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
15473 else
15474 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
15475 case $host_os in
15476 sco3.2v5*)
15477 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
15478 ;;
15479 esac
15480 fi
15481 sys_lib_dlsearch_path_spec='/usr/lib'
15482 ;;
15483
15484 tpf*)
15485 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
15486 version_type=linux
15487 need_lib_prefix=no
15488 need_version=no
15489 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15490 shlibpath_var=LD_LIBRARY_PATH
15491 shlibpath_overrides_runpath=no
15492 hardcode_into_libs=yes
15493 ;;
15494
15495 uts4*)
15496 version_type=linux
15497 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15498 soname_spec='${libname}${release}${shared_ext}$major'
15499 shlibpath_var=LD_LIBRARY_PATH
15500 ;;
15501
15502 *)
15503 dynamic_linker=no
15504 ;;
15505 esac
15506 { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
15507 $as_echo "$dynamic_linker" >&6; }
15508 test "$dynamic_linker" = no && can_build_shared=no
15509
15510 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
15511 if test "$GCC" = yes; then
15512 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
15513 fi
15514
15515 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
15516 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
15517 fi
15518 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
15519 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
15520 fi
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557 { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
15558 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
15559 hardcode_action_CXX=
15560 if test -n "$hardcode_libdir_flag_spec_CXX" ||
15561 test -n "$runpath_var_CXX" ||
15562 test "X$hardcode_automatic_CXX" = "Xyes" ; then
15563
15564 # We can hardcode non-existent directories.
15565 if test "$hardcode_direct_CXX" != no &&
15566 # If the only mechanism to avoid hardcoding is shlibpath_var, we
15567 # have to relink, otherwise we might link with an installed library
15568 # when we should be linking with a yet-to-be-installed one
15569 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
15570 test "$hardcode_minus_L_CXX" != no; then
15571 # Linking always hardcodes the temporary library directory.
15572 hardcode_action_CXX=relink
15573 else
15574 # We can link without hardcoding, and we can hardcode nonexisting dirs.
15575 hardcode_action_CXX=immediate
15576 fi
15577 else
15578 # We cannot hardcode anything, or else we can only hardcode existing
15579 # directories.
15580 hardcode_action_CXX=unsupported
15581 fi
15582 { $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
15583 $as_echo "$hardcode_action_CXX" >&6; }
15584
15585 if test "$hardcode_action_CXX" = relink ||
15586 test "$inherit_rpath_CXX" = yes; then
15587 # Fast installation is not supported
15588 enable_fast_install=no
15589 elif test "$shlibpath_overrides_runpath" = yes ||
15590 test "$enable_shared" = no; then
15591 # Fast installation is not necessary
15592 enable_fast_install=needless
15593 fi
15594
15595
15596
15597
15598
15599
15600
15601 fi # test -n "$compiler"
15602
15603 CC=$lt_save_CC
15604 LDCXX=$LD
15605 LD=$lt_save_LD
15606 GCC=$lt_save_GCC
15607 with_gnu_ld=$lt_save_with_gnu_ld
15608 lt_cv_path_LDCXX=$lt_cv_path_LD
15609 lt_cv_path_LD=$lt_save_path_LD
15610 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
15611 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
15612 fi # test "$_lt_caught_CXX_error" != yes
15613
15614 ac_ext=c
15615 ac_cpp='$CPP $CPPFLAGS'
15616 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15617 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15618 ac_compiler_gnu=$ac_cv_c_compiler_gnu
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632 ac_config_commands="$ac_config_commands libtool"
15633
15634
15635
15636
15637 # Only expand once:
15638
15639
15640
15641 #### Checks for header files. ####
15642
15643 # ISO
15644 { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
15645 $as_echo_n "checking for ANSI C header files... " >&6; }
15646 if test "${ac_cv_header_stdc+set}" = set; then
15647 $as_echo_n "(cached) " >&6
15648 else
15649 cat >conftest.$ac_ext <<_ACEOF
15650 /* confdefs.h. */
15651 _ACEOF
15652 cat confdefs.h >>conftest.$ac_ext
15653 cat >>conftest.$ac_ext <<_ACEOF
15654 /* end confdefs.h. */
15655 #include <stdlib.h>
15656 #include <stdarg.h>
15657 #include <string.h>
15658 #include <float.h>
15659
15660 int
15661 main ()
15662 {
15663
15664 ;
15665 return 0;
15666 }
15667 _ACEOF
15668 rm -f conftest.$ac_objext
15669 if { (ac_try="$ac_compile"
15670 case "(($ac_try" in
15671 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15672 *) ac_try_echo=$ac_try;;
15673 esac
15674 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15675 $as_echo "$ac_try_echo") >&5
15676 (eval "$ac_compile") 2>conftest.er1
15677 ac_status=$?
15678 grep -v '^ *+' conftest.er1 >conftest.err
15679 rm -f conftest.er1
15680 cat conftest.err >&5
15681 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15682 (exit $ac_status); } && {
15683 test -z "$ac_c_werror_flag" ||
15684 test ! -s conftest.err
15685 } && test -s conftest.$ac_objext; then
15686 ac_cv_header_stdc=yes
15687 else
15688 $as_echo "$as_me: failed program was:" >&5
15689 sed 's/^/| /' conftest.$ac_ext >&5
15690
15691 ac_cv_header_stdc=no
15692 fi
15693
15694 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15695
15696 if test $ac_cv_header_stdc = yes; then
15697 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15698 cat >conftest.$ac_ext <<_ACEOF
15699 /* confdefs.h. */
15700 _ACEOF
15701 cat confdefs.h >>conftest.$ac_ext
15702 cat >>conftest.$ac_ext <<_ACEOF
15703 /* end confdefs.h. */
15704 #include <string.h>
15705
15706 _ACEOF
15707 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15708 $EGREP "memchr" >/dev/null 2>&1; then
15709 :
15710 else
15711 ac_cv_header_stdc=no
15712 fi
15713 rm -f conftest*
15714
15715 fi
15716
15717 if test $ac_cv_header_stdc = yes; then
15718 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15719 cat >conftest.$ac_ext <<_ACEOF
15720 /* confdefs.h. */
15721 _ACEOF
15722 cat confdefs.h >>conftest.$ac_ext
15723 cat >>conftest.$ac_ext <<_ACEOF
15724 /* end confdefs.h. */
15725 #include <stdlib.h>
15726
15727 _ACEOF
15728 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15729 $EGREP "free" >/dev/null 2>&1; then
15730 :
15731 else
15732 ac_cv_header_stdc=no
15733 fi
15734 rm -f conftest*
15735
15736 fi
15737
15738 if test $ac_cv_header_stdc = yes; then
15739 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15740 if test "$cross_compiling" = yes; then
15741 :
15742 else
15743 cat >conftest.$ac_ext <<_ACEOF
15744 /* confdefs.h. */
15745 _ACEOF
15746 cat confdefs.h >>conftest.$ac_ext
15747 cat >>conftest.$ac_ext <<_ACEOF
15748 /* end confdefs.h. */
15749 #include <ctype.h>
15750 #include <stdlib.h>
15751 #if ((' ' & 0x0FF) == 0x020)
15752 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15753 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15754 #else
15755 # define ISLOWER(c) \
15756 (('a' <= (c) && (c) <= 'i') \
15757 || ('j' <= (c) && (c) <= 'r') \
15758 || ('s' <= (c) && (c) <= 'z'))
15759 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15760 #endif
15761
15762 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15763 int
15764 main ()
15765 {
15766 int i;
15767 for (i = 0; i < 256; i++)
15768 if (XOR (islower (i), ISLOWER (i))
15769 || toupper (i) != TOUPPER (i))
15770 return 2;
15771 return 0;
15772 }
15773 _ACEOF
15774 rm -f conftest$ac_exeext
15775 if { (ac_try="$ac_link"
15776 case "(($ac_try" in
15777 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15778 *) ac_try_echo=$ac_try;;
15779 esac
15780 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15781 $as_echo "$ac_try_echo") >&5
15782 (eval "$ac_link") 2>&5
15783 ac_status=$?
15784 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15785 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15786 { (case "(($ac_try" in
15787 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15788 *) ac_try_echo=$ac_try;;
15789 esac
15790 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15791 $as_echo "$ac_try_echo") >&5
15792 (eval "$ac_try") 2>&5
15793 ac_status=$?
15794 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15795 (exit $ac_status); }; }; then
15796 :
15797 else
15798 $as_echo "$as_me: program exited with status $ac_status" >&5
15799 $as_echo "$as_me: failed program was:" >&5
15800 sed 's/^/| /' conftest.$ac_ext >&5
15801
15802 ( exit $ac_status )
15803 ac_cv_header_stdc=no
15804 fi
15805 rm -rf conftest.dSYM
15806 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15807 fi
15808
15809
15810 fi
15811 fi
15812 { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
15813 $as_echo "$ac_cv_header_stdc" >&6; }
15814 if test $ac_cv_header_stdc = yes; then
15815
15816 cat >>confdefs.h <<\_ACEOF
15817 #define STDC_HEADERS 1
15818 _ACEOF
15819
15820 fi
15821
15822
15823 # XPG4-UNIX
15824
15825 for ac_header in sys/poll.h
15826 do
15827 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
15828 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15829 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
15830 $as_echo_n "checking for $ac_header... " >&6; }
15831 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15832 $as_echo_n "(cached) " >&6
15833 fi
15834 ac_res=`eval 'as_val=${'$as_ac_Header'}
15835 $as_echo "$as_val"'`
15836 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15837 $as_echo "$ac_res" >&6; }
15838 else
15839 # Is the header compilable?
15840 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
15841 $as_echo_n "checking $ac_header usability... " >&6; }
15842 cat >conftest.$ac_ext <<_ACEOF
15843 /* confdefs.h. */
15844 _ACEOF
15845 cat confdefs.h >>conftest.$ac_ext
15846 cat >>conftest.$ac_ext <<_ACEOF
15847 /* end confdefs.h. */
15848 $ac_includes_default
15849 #include <$ac_header>
15850 _ACEOF
15851 rm -f conftest.$ac_objext
15852 if { (ac_try="$ac_compile"
15853 case "(($ac_try" in
15854 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15855 *) ac_try_echo=$ac_try;;
15856 esac
15857 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15858 $as_echo "$ac_try_echo") >&5
15859 (eval "$ac_compile") 2>conftest.er1
15860 ac_status=$?
15861 grep -v '^ *+' conftest.er1 >conftest.err
15862 rm -f conftest.er1
15863 cat conftest.err >&5
15864 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15865 (exit $ac_status); } && {
15866 test -z "$ac_c_werror_flag" ||
15867 test ! -s conftest.err
15868 } && test -s conftest.$ac_objext; then
15869 ac_header_compiler=yes
15870 else
15871 $as_echo "$as_me: failed program was:" >&5
15872 sed 's/^/| /' conftest.$ac_ext >&5
15873
15874 ac_header_compiler=no
15875 fi
15876
15877 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15878 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
15879 $as_echo "$ac_header_compiler" >&6; }
15880
15881 # Is the header present?
15882 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
15883 $as_echo_n "checking $ac_header presence... " >&6; }
15884 cat >conftest.$ac_ext <<_ACEOF
15885 /* confdefs.h. */
15886 _ACEOF
15887 cat confdefs.h >>conftest.$ac_ext
15888 cat >>conftest.$ac_ext <<_ACEOF
15889 /* end confdefs.h. */
15890 #include <$ac_header>
15891 _ACEOF
15892 if { (ac_try="$ac_cpp conftest.$ac_ext"
15893 case "(($ac_try" in
15894 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15895 *) ac_try_echo=$ac_try;;
15896 esac
15897 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15898 $as_echo "$ac_try_echo") >&5
15899 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
15900 ac_status=$?
15901 grep -v '^ *+' conftest.er1 >conftest.err
15902 rm -f conftest.er1
15903 cat conftest.err >&5
15904 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15905 (exit $ac_status); } >/dev/null && {
15906 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
15907 test ! -s conftest.err
15908 }; then
15909 ac_header_preproc=yes
15910 else
15911 $as_echo "$as_me: failed program was:" >&5
15912 sed 's/^/| /' conftest.$ac_ext >&5
15913
15914 ac_header_preproc=no
15915 fi
15916
15917 rm -f conftest.err conftest.$ac_ext
15918 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
15919 $as_echo "$ac_header_preproc" >&6; }
15920
15921 # So? What about this header?
15922 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
15923 yes:no: )
15924 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
15925 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
15926 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
15927 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
15928 ac_header_preproc=yes
15929 ;;
15930 no:yes:* )
15931 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
15932 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
15933 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
15934 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
15935 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
15936 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
15937 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
15938 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
15939 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
15940 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
15941 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
15942 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
15943 ( cat <<\_ASBOX
15944 ## ---------------------------------------------------- ##
15945 ## Report this to mzyvongnfzneg (at) 0pointer (dot) net ##
15946 ## ---------------------------------------------------- ##
15947 _ASBOX
15948 ) | sed "s/^/$as_me: WARNING: /" >&2
15949 ;;
15950 esac
15951 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
15952 $as_echo_n "checking for $ac_header... " >&6; }
15953 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15954 $as_echo_n "(cached) " >&6
15955 else
15956 eval "$as_ac_Header=\$ac_header_preproc"
15957 fi
15958 ac_res=`eval 'as_val=${'$as_ac_Header'}
15959 $as_echo "$as_val"'`
15960 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15961 $as_echo "$ac_res" >&6; }
15962
15963 fi
15964 as_val=`eval 'as_val=${'$as_ac_Header'}
15965 $as_echo "$as_val"'`
15966 if test "x$as_val" = x""yes; then
15967 cat >>confdefs.h <<_ACEOF
15968 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
15969 _ACEOF
15970
15971 fi
15972
15973 done
15974
15975
15976 # Other
15977
15978 for ac_header in sys/ioctl.h
15979 do
15980 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
15981 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15982 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
15983 $as_echo_n "checking for $ac_header... " >&6; }
15984 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15985 $as_echo_n "(cached) " >&6
15986 fi
15987 ac_res=`eval 'as_val=${'$as_ac_Header'}
15988 $as_echo "$as_val"'`
15989 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15990 $as_echo "$ac_res" >&6; }
15991 else
15992 # Is the header compilable?
15993 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
15994 $as_echo_n "checking $ac_header usability... " >&6; }
15995 cat >conftest.$ac_ext <<_ACEOF
15996 /* confdefs.h. */
15997 _ACEOF
15998 cat confdefs.h >>conftest.$ac_ext
15999 cat >>conftest.$ac_ext <<_ACEOF
16000 /* end confdefs.h. */
16001 $ac_includes_default
16002 #include <$ac_header>
16003 _ACEOF
16004 rm -f conftest.$ac_objext
16005 if { (ac_try="$ac_compile"
16006 case "(($ac_try" in
16007 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16008 *) ac_try_echo=$ac_try;;
16009 esac
16010 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16011 $as_echo "$ac_try_echo") >&5
16012 (eval "$ac_compile") 2>conftest.er1
16013 ac_status=$?
16014 grep -v '^ *+' conftest.er1 >conftest.err
16015 rm -f conftest.er1
16016 cat conftest.err >&5
16017 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16018 (exit $ac_status); } && {
16019 test -z "$ac_c_werror_flag" ||
16020 test ! -s conftest.err
16021 } && test -s conftest.$ac_objext; then
16022 ac_header_compiler=yes
16023 else
16024 $as_echo "$as_me: failed program was:" >&5
16025 sed 's/^/| /' conftest.$ac_ext >&5
16026
16027 ac_header_compiler=no
16028 fi
16029
16030 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16031 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
16032 $as_echo "$ac_header_compiler" >&6; }
16033
16034 # Is the header present?
16035 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
16036 $as_echo_n "checking $ac_header presence... " >&6; }
16037 cat >conftest.$ac_ext <<_ACEOF
16038 /* confdefs.h. */
16039 _ACEOF
16040 cat confdefs.h >>conftest.$ac_ext
16041 cat >>conftest.$ac_ext <<_ACEOF
16042 /* end confdefs.h. */
16043 #include <$ac_header>
16044 _ACEOF
16045 if { (ac_try="$ac_cpp conftest.$ac_ext"
16046 case "(($ac_try" in
16047 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16048 *) ac_try_echo=$ac_try;;
16049 esac
16050 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16051 $as_echo "$ac_try_echo") >&5
16052 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
16053 ac_status=$?
16054 grep -v '^ *+' conftest.er1 >conftest.err
16055 rm -f conftest.er1
16056 cat conftest.err >&5
16057 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16058 (exit $ac_status); } >/dev/null && {
16059 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
16060 test ! -s conftest.err
16061 }; then
16062 ac_header_preproc=yes
16063 else
16064 $as_echo "$as_me: failed program was:" >&5
16065 sed 's/^/| /' conftest.$ac_ext >&5
16066
16067 ac_header_preproc=no
16068 fi
16069
16070 rm -f conftest.err conftest.$ac_ext
16071 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
16072 $as_echo "$ac_header_preproc" >&6; }
16073
16074 # So? What about this header?
16075 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
16076 yes:no: )
16077 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
16078 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
16079 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
16080 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
16081 ac_header_preproc=yes
16082 ;;
16083 no:yes:* )
16084 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
16085 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
16086 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
16087 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
16088 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
16089 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
16090 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
16091 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
16092 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
16093 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
16094 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
16095 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
16096 ( cat <<\_ASBOX
16097 ## ---------------------------------------------------- ##
16098 ## Report this to mzyvongnfzneg (at) 0pointer (dot) net ##
16099 ## ---------------------------------------------------- ##
16100 _ASBOX
16101 ) | sed "s/^/$as_me: WARNING: /" >&2
16102 ;;
16103 esac
16104 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
16105 $as_echo_n "checking for $ac_header... " >&6; }
16106 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16107 $as_echo_n "(cached) " >&6
16108 else
16109 eval "$as_ac_Header=\$ac_header_preproc"
16110 fi
16111 ac_res=`eval 'as_val=${'$as_ac_Header'}
16112 $as_echo "$as_val"'`
16113 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16114 $as_echo "$ac_res" >&6; }
16115
16116 fi
16117 as_val=`eval 'as_val=${'$as_ac_Header'}
16118 $as_echo "$as_val"'`
16119 if test "x$as_val" = x""yes; then
16120 cat >>confdefs.h <<_ACEOF
16121 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
16122 _ACEOF
16123
16124 fi
16125
16126 done
16127
16128
16129 for ac_header in byteswap.h
16130 do
16131 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
16132 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16133 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
16134 $as_echo_n "checking for $ac_header... " >&6; }
16135 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16136 $as_echo_n "(cached) " >&6
16137 fi
16138 ac_res=`eval 'as_val=${'$as_ac_Header'}
16139 $as_echo "$as_val"'`
16140 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16141 $as_echo "$ac_res" >&6; }
16142 else
16143 # Is the header compilable?
16144 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
16145 $as_echo_n "checking $ac_header usability... " >&6; }
16146 cat >conftest.$ac_ext <<_ACEOF
16147 /* confdefs.h. */
16148 _ACEOF
16149 cat confdefs.h >>conftest.$ac_ext
16150 cat >>conftest.$ac_ext <<_ACEOF
16151 /* end confdefs.h. */
16152 $ac_includes_default
16153 #include <$ac_header>
16154 _ACEOF
16155 rm -f conftest.$ac_objext
16156 if { (ac_try="$ac_compile"
16157 case "(($ac_try" in
16158 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16159 *) ac_try_echo=$ac_try;;
16160 esac
16161 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16162 $as_echo "$ac_try_echo") >&5
16163 (eval "$ac_compile") 2>conftest.er1
16164 ac_status=$?
16165 grep -v '^ *+' conftest.er1 >conftest.err
16166 rm -f conftest.er1
16167 cat conftest.err >&5
16168 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16169 (exit $ac_status); } && {
16170 test -z "$ac_c_werror_flag" ||
16171 test ! -s conftest.err
16172 } && test -s conftest.$ac_objext; then
16173 ac_header_compiler=yes
16174 else
16175 $as_echo "$as_me: failed program was:" >&5
16176 sed 's/^/| /' conftest.$ac_ext >&5
16177
16178 ac_header_compiler=no
16179 fi
16180
16181 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16182 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
16183 $as_echo "$ac_header_compiler" >&6; }
16184
16185 # Is the header present?
16186 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
16187 $as_echo_n "checking $ac_header presence... " >&6; }
16188 cat >conftest.$ac_ext <<_ACEOF
16189 /* confdefs.h. */
16190 _ACEOF
16191 cat confdefs.h >>conftest.$ac_ext
16192 cat >>conftest.$ac_ext <<_ACEOF
16193 /* end confdefs.h. */
16194 #include <$ac_header>
16195 _ACEOF
16196 if { (ac_try="$ac_cpp conftest.$ac_ext"
16197 case "(($ac_try" in
16198 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16199 *) ac_try_echo=$ac_try;;
16200 esac
16201 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16202 $as_echo "$ac_try_echo") >&5
16203 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
16204 ac_status=$?
16205 grep -v '^ *+' conftest.er1 >conftest.err
16206 rm -f conftest.er1
16207 cat conftest.err >&5
16208 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16209 (exit $ac_status); } >/dev/null && {
16210 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
16211 test ! -s conftest.err
16212 }; then
16213 ac_header_preproc=yes
16214 else
16215 $as_echo "$as_me: failed program was:" >&5
16216 sed 's/^/| /' conftest.$ac_ext >&5
16217
16218 ac_header_preproc=no
16219 fi
16220
16221 rm -f conftest.err conftest.$ac_ext
16222 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
16223 $as_echo "$ac_header_preproc" >&6; }
16224
16225 # So? What about this header?
16226 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
16227 yes:no: )
16228 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
16229 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
16230 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
16231 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
16232 ac_header_preproc=yes
16233 ;;
16234 no:yes:* )
16235 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
16236 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
16237 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
16238 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
16239 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
16240 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
16241 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
16242 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
16243 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
16244 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
16245 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
16246 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
16247 ( cat <<\_ASBOX
16248 ## ---------------------------------------------------- ##
16249 ## Report this to mzyvongnfzneg (at) 0pointer (dot) net ##
16250 ## ---------------------------------------------------- ##
16251 _ASBOX
16252 ) | sed "s/^/$as_me: WARNING: /" >&2
16253 ;;
16254 esac
16255 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
16256 $as_echo_n "checking for $ac_header... " >&6; }
16257 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16258 $as_echo_n "(cached) " >&6
16259 else
16260 eval "$as_ac_Header=\$ac_header_preproc"
16261 fi
16262 ac_res=`eval 'as_val=${'$as_ac_Header'}
16263 $as_echo "$as_val"'`
16264 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16265 $as_echo "$ac_res" >&6; }
16266
16267 fi
16268 as_val=`eval 'as_val=${'$as_ac_Header'}
16269 $as_echo "$as_val"'`
16270 if test "x$as_val" = x""yes; then
16271 cat >>confdefs.h <<_ACEOF
16272 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
16273 _ACEOF
16274
16275 fi
16276
16277 done
16278
16279
16280 #### Typdefs, structures, etc. ####
16281
16282 { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
16283 $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
16284 if test "${ac_cv_c_const+set}" = set; then
16285 $as_echo_n "(cached) " >&6
16286 else
16287 cat >conftest.$ac_ext <<_ACEOF
16288 /* confdefs.h. */
16289 _ACEOF
16290 cat confdefs.h >>conftest.$ac_ext
16291 cat >>conftest.$ac_ext <<_ACEOF
16292 /* end confdefs.h. */
16293
16294 int
16295 main ()
16296 {
16297 /* FIXME: Include the comments suggested by Paul. */
16298 #ifndef __cplusplus
16299 /* Ultrix mips cc rejects this. */
16300 typedef int charset[2];
16301 const charset cs;
16302 /* SunOS 4.1.1 cc rejects this. */
16303 char const *const *pcpcc;
16304 char **ppc;
16305 /* NEC SVR4.0.2 mips cc rejects this. */
16306 struct point {int x, y;};
16307 static struct point const zero = {0,0};
16308 /* AIX XL C 1.02.0.0 rejects this.
16309 It does not let you subtract one const X* pointer from another in
16310 an arm of an if-expression whose if-part is not a constant
16311 expression */
16312 const char *g = "string";
16313 pcpcc = &g + (g ? g-g : 0);
16314 /* HPUX 7.0 cc rejects these. */
16315 ++pcpcc;
16316 ppc = (char**) pcpcc;
16317 pcpcc = (char const *const *) ppc;
16318 { /* SCO 3.2v4 cc rejects this. */
16319 char *t;
16320 char const *s = 0 ? (char *) 0 : (char const *) 0;
16321
16322 *t++ = 0;
16323 if (s) return 0;
16324 }
16325 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
16326 int x[] = {25, 17};
16327 const int *foo = &x[0];
16328 ++foo;
16329 }
16330 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16331 typedef const int *iptr;
16332 iptr p = 0;
16333 ++p;
16334 }
16335 { /* AIX XL C 1.02.0.0 rejects this saying
16336 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16337 struct s { int j; const int *ap[3]; };
16338 struct s *b; b->j = 5;
16339 }
16340 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16341 const int foo = 10;
16342 if (!foo) return 0;
16343 }
16344 return !cs[0] && !zero.x;
16345 #endif
16346
16347 ;
16348 return 0;
16349 }
16350 _ACEOF
16351 rm -f conftest.$ac_objext
16352 if { (ac_try="$ac_compile"
16353 case "(($ac_try" in
16354 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16355 *) ac_try_echo=$ac_try;;
16356 esac
16357 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16358 $as_echo "$ac_try_echo") >&5
16359 (eval "$ac_compile") 2>conftest.er1
16360 ac_status=$?
16361 grep -v '^ *+' conftest.er1 >conftest.err
16362 rm -f conftest.er1
16363 cat conftest.err >&5
16364 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16365 (exit $ac_status); } && {
16366 test -z "$ac_c_werror_flag" ||
16367 test ! -s conftest.err
16368 } && test -s conftest.$ac_objext; then
16369 ac_cv_c_const=yes
16370 else
16371 $as_echo "$as_me: failed program was:" >&5
16372 sed 's/^/| /' conftest.$ac_ext >&5
16373
16374 ac_cv_c_const=no
16375 fi
16376
16377 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16378 fi
16379 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
16380 $as_echo "$ac_cv_c_const" >&6; }
16381 if test $ac_cv_c_const = no; then
16382
16383 cat >>confdefs.h <<\_ACEOF
16384 #define const /**/
16385 _ACEOF
16386
16387 fi
16388
16389
16390 { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
16391 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
16392 if test "${ac_cv_c_bigendian+set}" = set; then
16393 $as_echo_n "(cached) " >&6
16394 else
16395 ac_cv_c_bigendian=unknown
16396 # See if we're dealing with a universal compiler.
16397 cat >conftest.$ac_ext <<_ACEOF
16398 /* confdefs.h. */
16399 _ACEOF
16400 cat confdefs.h >>conftest.$ac_ext
16401 cat >>conftest.$ac_ext <<_ACEOF
16402 /* end confdefs.h. */
16403 #ifndef __APPLE_CC__
16404 not a universal capable compiler
16405 #endif
16406 typedef int dummy;
16407
16408 _ACEOF
16409 rm -f conftest.$ac_objext
16410 if { (ac_try="$ac_compile"
16411 case "(($ac_try" in
16412 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16413 *) ac_try_echo=$ac_try;;
16414 esac
16415 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16416 $as_echo "$ac_try_echo") >&5
16417 (eval "$ac_compile") 2>conftest.er1
16418 ac_status=$?
16419 grep -v '^ *+' conftest.er1 >conftest.err
16420 rm -f conftest.er1
16421 cat conftest.err >&5
16422 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16423 (exit $ac_status); } && {
16424 test -z "$ac_c_werror_flag" ||
16425 test ! -s conftest.err
16426 } && test -s conftest.$ac_objext; then
16427
16428 # Check for potential -arch flags. It is not universal unless
16429 # there are some -arch flags. Note that *ppc* also matches
16430 # ppc64. This check is also rather less than ideal.
16431 case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #(
16432 *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
16433 esac
16434 else
16435 $as_echo "$as_me: failed program was:" >&5
16436 sed 's/^/| /' conftest.$ac_ext >&5
16437
16438
16439 fi
16440
16441 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16442 if test $ac_cv_c_bigendian = unknown; then
16443 # See if sys/param.h defines the BYTE_ORDER macro.
16444 cat >conftest.$ac_ext <<_ACEOF
16445 /* confdefs.h. */
16446 _ACEOF
16447 cat confdefs.h >>conftest.$ac_ext
16448 cat >>conftest.$ac_ext <<_ACEOF
16449 /* end confdefs.h. */
16450 #include <sys/types.h>
16451 #include <sys/param.h>
16452
16453 int
16454 main ()
16455 {
16456 #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
16457 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
16458 && LITTLE_ENDIAN)
16459 bogus endian macros
16460 #endif
16461
16462 ;
16463 return 0;
16464 }
16465 _ACEOF
16466 rm -f conftest.$ac_objext
16467 if { (ac_try="$ac_compile"
16468 case "(($ac_try" in
16469 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16470 *) ac_try_echo=$ac_try;;
16471 esac
16472 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16473 $as_echo "$ac_try_echo") >&5
16474 (eval "$ac_compile") 2>conftest.er1
16475 ac_status=$?
16476 grep -v '^ *+' conftest.er1 >conftest.err
16477 rm -f conftest.er1
16478 cat conftest.err >&5
16479 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16480 (exit $ac_status); } && {
16481 test -z "$ac_c_werror_flag" ||
16482 test ! -s conftest.err
16483 } && test -s conftest.$ac_objext; then
16484 # It does; now see whether it defined to BIG_ENDIAN or not.
16485 cat >conftest.$ac_ext <<_ACEOF
16486 /* confdefs.h. */
16487 _ACEOF
16488 cat confdefs.h >>conftest.$ac_ext
16489 cat >>conftest.$ac_ext <<_ACEOF
16490 /* end confdefs.h. */
16491 #include <sys/types.h>
16492 #include <sys/param.h>
16493
16494 int
16495 main ()
16496 {
16497 #if BYTE_ORDER != BIG_ENDIAN
16498 not big endian
16499 #endif
16500
16501 ;
16502 return 0;
16503 }
16504 _ACEOF
16505 rm -f conftest.$ac_objext
16506 if { (ac_try="$ac_compile"
16507 case "(($ac_try" in
16508 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16509 *) ac_try_echo=$ac_try;;
16510 esac
16511 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16512 $as_echo "$ac_try_echo") >&5
16513 (eval "$ac_compile") 2>conftest.er1
16514 ac_status=$?
16515 grep -v '^ *+' conftest.er1 >conftest.err
16516 rm -f conftest.er1
16517 cat conftest.err >&5
16518 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16519 (exit $ac_status); } && {
16520 test -z "$ac_c_werror_flag" ||
16521 test ! -s conftest.err
16522 } && test -s conftest.$ac_objext; then
16523 ac_cv_c_bigendian=yes
16524 else
16525 $as_echo "$as_me: failed program was:" >&5
16526 sed 's/^/| /' conftest.$ac_ext >&5
16527
16528 ac_cv_c_bigendian=no
16529 fi
16530
16531 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16532 else
16533 $as_echo "$as_me: failed program was:" >&5
16534 sed 's/^/| /' conftest.$ac_ext >&5
16535
16536
16537 fi
16538
16539 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16540 fi
16541 if test $ac_cv_c_bigendian = unknown; then
16542 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
16543 cat >conftest.$ac_ext <<_ACEOF
16544 /* confdefs.h. */
16545 _ACEOF
16546 cat confdefs.h >>conftest.$ac_ext
16547 cat >>conftest.$ac_ext <<_ACEOF
16548 /* end confdefs.h. */
16549 #include <limits.h>
16550
16551 int
16552 main ()
16553 {
16554 #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
16555 bogus endian macros
16556 #endif
16557
16558 ;
16559 return 0;
16560 }
16561 _ACEOF
16562 rm -f conftest.$ac_objext
16563 if { (ac_try="$ac_compile"
16564 case "(($ac_try" in
16565 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16566 *) ac_try_echo=$ac_try;;
16567 esac
16568 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16569 $as_echo "$ac_try_echo") >&5
16570 (eval "$ac_compile") 2>conftest.er1
16571 ac_status=$?
16572 grep -v '^ *+' conftest.er1 >conftest.err
16573 rm -f conftest.er1
16574 cat conftest.err >&5
16575 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16576 (exit $ac_status); } && {
16577 test -z "$ac_c_werror_flag" ||
16578 test ! -s conftest.err
16579 } && test -s conftest.$ac_objext; then
16580 # It does; now see whether it defined to _BIG_ENDIAN or not.
16581 cat >conftest.$ac_ext <<_ACEOF
16582 /* confdefs.h. */
16583 _ACEOF
16584 cat confdefs.h >>conftest.$ac_ext
16585 cat >>conftest.$ac_ext <<_ACEOF
16586 /* end confdefs.h. */
16587 #include <limits.h>
16588
16589 int
16590 main ()
16591 {
16592 #ifndef _BIG_ENDIAN
16593 not big endian
16594 #endif
16595
16596 ;
16597 return 0;
16598 }
16599 _ACEOF
16600 rm -f conftest.$ac_objext
16601 if { (ac_try="$ac_compile"
16602 case "(($ac_try" in
16603 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16604 *) ac_try_echo=$ac_try;;
16605 esac
16606 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16607 $as_echo "$ac_try_echo") >&5
16608 (eval "$ac_compile") 2>conftest.er1
16609 ac_status=$?
16610 grep -v '^ *+' conftest.er1 >conftest.err
16611 rm -f conftest.er1
16612 cat conftest.err >&5
16613 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16614 (exit $ac_status); } && {
16615 test -z "$ac_c_werror_flag" ||
16616 test ! -s conftest.err
16617 } && test -s conftest.$ac_objext; then
16618 ac_cv_c_bigendian=yes
16619 else
16620 $as_echo "$as_me: failed program was:" >&5
16621 sed 's/^/| /' conftest.$ac_ext >&5
16622
16623 ac_cv_c_bigendian=no
16624 fi
16625
16626 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16627 else
16628 $as_echo "$as_me: failed program was:" >&5
16629 sed 's/^/| /' conftest.$ac_ext >&5
16630
16631
16632 fi
16633
16634 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16635 fi
16636 if test $ac_cv_c_bigendian = unknown; then
16637 # Compile a test program.
16638 if test "$cross_compiling" = yes; then
16639 # Try to guess by grepping values from an object file.
16640 cat >conftest.$ac_ext <<_ACEOF
16641 /* confdefs.h. */
16642 _ACEOF
16643 cat confdefs.h >>conftest.$ac_ext
16644 cat >>conftest.$ac_ext <<_ACEOF
16645 /* end confdefs.h. */
16646 short int ascii_mm[] =
16647 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
16648 short int ascii_ii[] =
16649 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
16650 int use_ascii (int i) {
16651 return ascii_mm[i] + ascii_ii[i];
16652 }
16653 short int ebcdic_ii[] =
16654 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
16655 short int ebcdic_mm[] =
16656 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
16657 int use_ebcdic (int i) {
16658 return ebcdic_mm[i] + ebcdic_ii[i];
16659 }
16660 extern int foo;
16661
16662 int
16663 main ()
16664 {
16665 return use_ascii (foo) == use_ebcdic (foo);
16666 ;
16667 return 0;
16668 }
16669 _ACEOF
16670 rm -f conftest.$ac_objext
16671 if { (ac_try="$ac_compile"
16672 case "(($ac_try" in
16673 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16674 *) ac_try_echo=$ac_try;;
16675 esac
16676 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16677 $as_echo "$ac_try_echo") >&5
16678 (eval "$ac_compile") 2>conftest.er1
16679 ac_status=$?
16680 grep -v '^ *+' conftest.er1 >conftest.err
16681 rm -f conftest.er1
16682 cat conftest.err >&5
16683 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16684 (exit $ac_status); } && {
16685 test -z "$ac_c_werror_flag" ||
16686 test ! -s conftest.err
16687 } && test -s conftest.$ac_objext; then
16688 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
16689 ac_cv_c_bigendian=yes
16690 fi
16691 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
16692 if test "$ac_cv_c_bigendian" = unknown; then
16693 ac_cv_c_bigendian=no
16694 else
16695 # finding both strings is unlikely to happen, but who knows?
16696 ac_cv_c_bigendian=unknown
16697 fi
16698 fi
16699 else
16700 $as_echo "$as_me: failed program was:" >&5
16701 sed 's/^/| /' conftest.$ac_ext >&5
16702
16703
16704 fi
16705
16706 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16707 else
16708 cat >conftest.$ac_ext <<_ACEOF
16709 /* confdefs.h. */
16710 _ACEOF
16711 cat confdefs.h >>conftest.$ac_ext
16712 cat >>conftest.$ac_ext <<_ACEOF
16713 /* end confdefs.h. */
16714 $ac_includes_default
16715 int
16716 main ()
16717 {
16718
16719 /* Are we little or big endian? From Harbison&Steele. */
16720 union
16721 {
16722 long int l;
16723 char c[sizeof (long int)];
16724 } u;
16725 u.l = 1;
16726 return u.c[sizeof (long int) - 1] == 1;
16727
16728 ;
16729 return 0;
16730 }
16731 _ACEOF
16732 rm -f conftest$ac_exeext
16733 if { (ac_try="$ac_link"
16734 case "(($ac_try" in
16735 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16736 *) ac_try_echo=$ac_try;;
16737 esac
16738 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16739 $as_echo "$ac_try_echo") >&5
16740 (eval "$ac_link") 2>&5
16741 ac_status=$?
16742 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16743 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16744 { (case "(($ac_try" in
16745 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16746 *) ac_try_echo=$ac_try;;
16747 esac
16748 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16749 $as_echo "$ac_try_echo") >&5
16750 (eval "$ac_try") 2>&5
16751 ac_status=$?
16752 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16753 (exit $ac_status); }; }; then
16754 ac_cv_c_bigendian=no
16755 else
16756 $as_echo "$as_me: program exited with status $ac_status" >&5
16757 $as_echo "$as_me: failed program was:" >&5
16758 sed 's/^/| /' conftest.$ac_ext >&5
16759
16760 ( exit $ac_status )
16761 ac_cv_c_bigendian=yes
16762 fi
16763 rm -rf conftest.dSYM
16764 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16765 fi
16766
16767
16768 fi
16769 fi
16770 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
16771 $as_echo "$ac_cv_c_bigendian" >&6; }
16772 case $ac_cv_c_bigendian in #(
16773 yes)
16774 cat >>confdefs.h <<\_ACEOF
16775 #define WORDS_BIGENDIAN 1
16776 _ACEOF
16777 ;; #(
16778 no)
16779 ;; #(
16780 universal)
16781
16782 cat >>confdefs.h <<\_ACEOF
16783 #define AC_APPLE_UNIVERSAL_BUILD 1
16784 _ACEOF
16785
16786 ;; #(
16787 *)
16788 { { $as_echo "$as_me:$LINENO: error: unknown endianness
16789 presetting ac_cv_c_bigendian=no (or yes) will help" >&5
16790 $as_echo "$as_me: error: unknown endianness
16791 presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
16792 { (exit 1); exit 1; }; } ;;
16793 esac
16794
16795 { $as_echo "$as_me:$LINENO: checking for pid_t" >&5
16796 $as_echo_n "checking for pid_t... " >&6; }
16797 if test "${ac_cv_type_pid_t+set}" = set; then
16798 $as_echo_n "(cached) " >&6
16799 else
16800 ac_cv_type_pid_t=no
16801 cat >conftest.$ac_ext <<_ACEOF
16802 /* confdefs.h. */
16803 _ACEOF
16804 cat confdefs.h >>conftest.$ac_ext
16805 cat >>conftest.$ac_ext <<_ACEOF
16806 /* end confdefs.h. */
16807 $ac_includes_default
16808 int
16809 main ()
16810 {
16811 if (sizeof (pid_t))
16812 return 0;
16813 ;
16814 return 0;
16815 }
16816 _ACEOF
16817 rm -f conftest.$ac_objext
16818 if { (ac_try="$ac_compile"
16819 case "(($ac_try" in
16820 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16821 *) ac_try_echo=$ac_try;;
16822 esac
16823 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16824 $as_echo "$ac_try_echo") >&5
16825 (eval "$ac_compile") 2>conftest.er1
16826 ac_status=$?
16827 grep -v '^ *+' conftest.er1 >conftest.err
16828 rm -f conftest.er1
16829 cat conftest.err >&5
16830 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16831 (exit $ac_status); } && {
16832 test -z "$ac_c_werror_flag" ||
16833 test ! -s conftest.err
16834 } && test -s conftest.$ac_objext; then
16835 cat >conftest.$ac_ext <<_ACEOF
16836 /* confdefs.h. */
16837 _ACEOF
16838 cat confdefs.h >>conftest.$ac_ext
16839 cat >>conftest.$ac_ext <<_ACEOF
16840 /* end confdefs.h. */
16841 $ac_includes_default
16842 int
16843 main ()
16844 {
16845 if (sizeof ((pid_t)))
16846 return 0;
16847 ;
16848 return 0;
16849 }
16850 _ACEOF
16851 rm -f conftest.$ac_objext
16852 if { (ac_try="$ac_compile"
16853 case "(($ac_try" in
16854 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16855 *) ac_try_echo=$ac_try;;
16856 esac
16857 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16858 $as_echo "$ac_try_echo") >&5
16859 (eval "$ac_compile") 2>conftest.er1
16860 ac_status=$?
16861 grep -v '^ *+' conftest.er1 >conftest.err
16862 rm -f conftest.er1
16863 cat conftest.err >&5
16864 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16865 (exit $ac_status); } && {
16866 test -z "$ac_c_werror_flag" ||
16867 test ! -s conftest.err
16868 } && test -s conftest.$ac_objext; then
16869 :
16870 else
16871 $as_echo "$as_me: failed program was:" >&5
16872 sed 's/^/| /' conftest.$ac_ext >&5
16873
16874 ac_cv_type_pid_t=yes
16875 fi
16876
16877 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16878 else
16879 $as_echo "$as_me: failed program was:" >&5
16880 sed 's/^/| /' conftest.$ac_ext >&5
16881
16882
16883 fi
16884
16885 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16886 fi
16887 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
16888 $as_echo "$ac_cv_type_pid_t" >&6; }
16889 if test "x$ac_cv_type_pid_t" = x""yes; then
16890 :
16891 else
16892
16893 cat >>confdefs.h <<_ACEOF
16894 #define pid_t int
16895 _ACEOF
16896
16897 fi
16898
16899 { $as_echo "$as_me:$LINENO: checking for size_t" >&5
16900 $as_echo_n "checking for size_t... " >&6; }
16901 if test "${ac_cv_type_size_t+set}" = set; then
16902 $as_echo_n "(cached) " >&6
16903 else
16904 ac_cv_type_size_t=no
16905 cat >conftest.$ac_ext <<_ACEOF
16906 /* confdefs.h. */
16907 _ACEOF
16908 cat confdefs.h >>conftest.$ac_ext
16909 cat >>conftest.$ac_ext <<_ACEOF
16910 /* end confdefs.h. */
16911 $ac_includes_default
16912 int
16913 main ()
16914 {
16915 if (sizeof (size_t))
16916 return 0;
16917 ;
16918 return 0;
16919 }
16920 _ACEOF
16921 rm -f conftest.$ac_objext
16922 if { (ac_try="$ac_compile"
16923 case "(($ac_try" in
16924 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16925 *) ac_try_echo=$ac_try;;
16926 esac
16927 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16928 $as_echo "$ac_try_echo") >&5
16929 (eval "$ac_compile") 2>conftest.er1
16930 ac_status=$?
16931 grep -v '^ *+' conftest.er1 >conftest.err
16932 rm -f conftest.er1
16933 cat conftest.err >&5
16934 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16935 (exit $ac_status); } && {
16936 test -z "$ac_c_werror_flag" ||
16937 test ! -s conftest.err
16938 } && test -s conftest.$ac_objext; then
16939 cat >conftest.$ac_ext <<_ACEOF
16940 /* confdefs.h. */
16941 _ACEOF
16942 cat confdefs.h >>conftest.$ac_ext
16943 cat >>conftest.$ac_ext <<_ACEOF
16944 /* end confdefs.h. */
16945 $ac_includes_default
16946 int
16947 main ()
16948 {
16949 if (sizeof ((size_t)))
16950 return 0;
16951 ;
16952 return 0;
16953 }
16954 _ACEOF
16955 rm -f conftest.$ac_objext
16956 if { (ac_try="$ac_compile"
16957 case "(($ac_try" in
16958 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16959 *) ac_try_echo=$ac_try;;
16960 esac
16961 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16962 $as_echo "$ac_try_echo") >&5
16963 (eval "$ac_compile") 2>conftest.er1
16964 ac_status=$?
16965 grep -v '^ *+' conftest.er1 >conftest.err
16966 rm -f conftest.er1
16967 cat conftest.err >&5
16968 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16969 (exit $ac_status); } && {
16970 test -z "$ac_c_werror_flag" ||
16971 test ! -s conftest.err
16972 } && test -s conftest.$ac_objext; then
16973 :
16974 else
16975 $as_echo "$as_me: failed program was:" >&5
16976 sed 's/^/| /' conftest.$ac_ext >&5
16977
16978 ac_cv_type_size_t=yes
16979 fi
16980
16981 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16982 else
16983 $as_echo "$as_me: failed program was:" >&5
16984 sed 's/^/| /' conftest.$ac_ext >&5
16985
16986
16987 fi
16988
16989 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16990 fi
16991 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
16992 $as_echo "$ac_cv_type_size_t" >&6; }
16993 if test "x$ac_cv_type_size_t" = x""yes; then
16994 :
16995 else
16996
16997 cat >>confdefs.h <<_ACEOF
16998 #define size_t unsigned int
16999 _ACEOF
17000
17001 fi
17002
17003 { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5
17004 $as_echo_n "checking for ssize_t... " >&6; }
17005 if test "${ac_cv_type_ssize_t+set}" = set; then
17006 $as_echo_n "(cached) " >&6
17007 else
17008 ac_cv_type_ssize_t=no
17009 cat >conftest.$ac_ext <<_ACEOF
17010 /* confdefs.h. */
17011 _ACEOF
17012 cat confdefs.h >>conftest.$ac_ext
17013 cat >>conftest.$ac_ext <<_ACEOF
17014 /* end confdefs.h. */
17015 $ac_includes_default
17016 int
17017 main ()
17018 {
17019 if (sizeof (ssize_t))
17020 return 0;
17021 ;
17022 return 0;
17023 }
17024 _ACEOF
17025 rm -f conftest.$ac_objext
17026 if { (ac_try="$ac_compile"
17027 case "(($ac_try" in
17028 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17029 *) ac_try_echo=$ac_try;;
17030 esac
17031 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17032 $as_echo "$ac_try_echo") >&5
17033 (eval "$ac_compile") 2>conftest.er1
17034 ac_status=$?
17035 grep -v '^ *+' conftest.er1 >conftest.err
17036 rm -f conftest.er1
17037 cat conftest.err >&5
17038 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17039 (exit $ac_status); } && {
17040 test -z "$ac_c_werror_flag" ||
17041 test ! -s conftest.err
17042 } && test -s conftest.$ac_objext; then
17043 cat >conftest.$ac_ext <<_ACEOF
17044 /* confdefs.h. */
17045 _ACEOF
17046 cat confdefs.h >>conftest.$ac_ext
17047 cat >>conftest.$ac_ext <<_ACEOF
17048 /* end confdefs.h. */
17049 $ac_includes_default
17050 int
17051 main ()
17052 {
17053 if (sizeof ((ssize_t)))
17054 return 0;
17055 ;
17056 return 0;
17057 }
17058 _ACEOF
17059 rm -f conftest.$ac_objext
17060 if { (ac_try="$ac_compile"
17061 case "(($ac_try" in
17062 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17063 *) ac_try_echo=$ac_try;;
17064 esac
17065 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17066 $as_echo "$ac_try_echo") >&5
17067 (eval "$ac_compile") 2>conftest.er1
17068 ac_status=$?
17069 grep -v '^ *+' conftest.er1 >conftest.err
17070 rm -f conftest.er1
17071 cat conftest.err >&5
17072 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17073 (exit $ac_status); } && {
17074 test -z "$ac_c_werror_flag" ||
17075 test ! -s conftest.err
17076 } && test -s conftest.$ac_objext; then
17077 :
17078 else
17079 $as_echo "$as_me: failed program was:" >&5
17080 sed 's/^/| /' conftest.$ac_ext >&5
17081
17082 ac_cv_type_ssize_t=yes
17083 fi
17084
17085 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17086 else
17087 $as_echo "$as_me: failed program was:" >&5
17088 sed 's/^/| /' conftest.$ac_ext >&5
17089
17090
17091 fi
17092
17093 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17094 fi
17095 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
17096 $as_echo "$ac_cv_type_ssize_t" >&6; }
17097 if test "x$ac_cv_type_ssize_t" = x""yes; then
17098
17099 cat >>confdefs.h <<_ACEOF
17100 #define HAVE_SSIZE_T 1
17101 _ACEOF
17102
17103
17104 else
17105
17106 cat >>confdefs.h <<\_ACEOF
17107 #define ssize_t signed long
17108 _ACEOF
17109
17110 fi
17111
17112 { $as_echo "$as_me:$LINENO: checking for off_t" >&5
17113 $as_echo_n "checking for off_t... " >&6; }
17114 if test "${ac_cv_type_off_t+set}" = set; then
17115 $as_echo_n "(cached) " >&6
17116 else
17117 ac_cv_type_off_t=no
17118 cat >conftest.$ac_ext <<_ACEOF
17119 /* confdefs.h. */
17120 _ACEOF
17121 cat confdefs.h >>conftest.$ac_ext
17122 cat >>conftest.$ac_ext <<_ACEOF
17123 /* end confdefs.h. */
17124 $ac_includes_default
17125 int
17126 main ()
17127 {
17128 if (sizeof (off_t))
17129 return 0;
17130 ;
17131 return 0;
17132 }
17133 _ACEOF
17134 rm -f conftest.$ac_objext
17135 if { (ac_try="$ac_compile"
17136 case "(($ac_try" in
17137 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17138 *) ac_try_echo=$ac_try;;
17139 esac
17140 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17141 $as_echo "$ac_try_echo") >&5
17142 (eval "$ac_compile") 2>conftest.er1
17143 ac_status=$?
17144 grep -v '^ *+' conftest.er1 >conftest.err
17145 rm -f conftest.er1
17146 cat conftest.err >&5
17147 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17148 (exit $ac_status); } && {
17149 test -z "$ac_c_werror_flag" ||
17150 test ! -s conftest.err
17151 } && test -s conftest.$ac_objext; then
17152 cat >conftest.$ac_ext <<_ACEOF
17153 /* confdefs.h. */
17154 _ACEOF
17155 cat confdefs.h >>conftest.$ac_ext
17156 cat >>conftest.$ac_ext <<_ACEOF
17157 /* end confdefs.h. */
17158 $ac_includes_default
17159 int
17160 main ()
17161 {
17162 if (sizeof ((off_t)))
17163 return 0;
17164 ;
17165 return 0;
17166 }
17167 _ACEOF
17168 rm -f conftest.$ac_objext
17169 if { (ac_try="$ac_compile"
17170 case "(($ac_try" in
17171 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17172 *) ac_try_echo=$ac_try;;
17173 esac
17174 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17175 $as_echo "$ac_try_echo") >&5
17176 (eval "$ac_compile") 2>conftest.er1
17177 ac_status=$?
17178 grep -v '^ *+' conftest.er1 >conftest.err
17179 rm -f conftest.er1
17180 cat conftest.err >&5
17181 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17182 (exit $ac_status); } && {
17183 test -z "$ac_c_werror_flag" ||
17184 test ! -s conftest.err
17185 } && test -s conftest.$ac_objext; then
17186 :
17187 else
17188 $as_echo "$as_me: failed program was:" >&5
17189 sed 's/^/| /' conftest.$ac_ext >&5
17190
17191 ac_cv_type_off_t=yes
17192 fi
17193
17194 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17195 else
17196 $as_echo "$as_me: failed program was:" >&5
17197 sed 's/^/| /' conftest.$ac_ext >&5
17198
17199
17200 fi
17201
17202 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17203 fi
17204 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
17205 $as_echo "$ac_cv_type_off_t" >&6; }
17206 if test "x$ac_cv_type_off_t" = x""yes; then
17207 :
17208 else
17209
17210 cat >>confdefs.h <<_ACEOF
17211 #define off_t long int
17212 _ACEOF
17213
17214 fi
17215
17216 { $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5
17217 $as_echo_n "checking return type of signal handlers... " >&6; }
17218 if test "${ac_cv_type_signal+set}" = set; then
17219 $as_echo_n "(cached) " >&6
17220 else
17221 cat >conftest.$ac_ext <<_ACEOF
17222 /* confdefs.h. */
17223 _ACEOF
17224 cat confdefs.h >>conftest.$ac_ext
17225 cat >>conftest.$ac_ext <<_ACEOF
17226 /* end confdefs.h. */
17227 #include <sys/types.h>
17228 #include <signal.h>
17229
17230 int
17231 main ()
17232 {
17233 return *(signal (0, 0)) (0) == 1;
17234 ;
17235 return 0;
17236 }
17237 _ACEOF
17238 rm -f conftest.$ac_objext
17239 if { (ac_try="$ac_compile"
17240 case "(($ac_try" in
17241 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17242 *) ac_try_echo=$ac_try;;
17243 esac
17244 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17245 $as_echo "$ac_try_echo") >&5
17246 (eval "$ac_compile") 2>conftest.er1
17247 ac_status=$?
17248 grep -v '^ *+' conftest.er1 >conftest.err
17249 rm -f conftest.er1
17250 cat conftest.err >&5
17251 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17252 (exit $ac_status); } && {
17253 test -z "$ac_c_werror_flag" ||
17254 test ! -s conftest.err
17255 } && test -s conftest.$ac_objext; then
17256 ac_cv_type_signal=int
17257 else
17258 $as_echo "$as_me: failed program was:" >&5
17259 sed 's/^/| /' conftest.$ac_ext >&5
17260
17261 ac_cv_type_signal=void
17262 fi
17263
17264 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17265 fi
17266 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
17267 $as_echo "$ac_cv_type_signal" >&6; }
17268
17269 cat >>confdefs.h <<_ACEOF
17270 #define RETSIGTYPE $ac_cv_type_signal
17271 _ACEOF
17272
17273
17274 { $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
17275 $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
17276 if test "${ac_cv_type_uid_t+set}" = set; then
17277 $as_echo_n "(cached) " >&6
17278 else
17279 cat >conftest.$ac_ext <<_ACEOF
17280 /* confdefs.h. */
17281 _ACEOF
17282 cat confdefs.h >>conftest.$ac_ext
17283 cat >>conftest.$ac_ext <<_ACEOF
17284 /* end confdefs.h. */
17285 #include <sys/types.h>
17286
17287 _ACEOF
17288 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17289 $EGREP "uid_t" >/dev/null 2>&1; then
17290 ac_cv_type_uid_t=yes
17291 else
17292 ac_cv_type_uid_t=no
17293 fi
17294 rm -f conftest*
17295
17296 fi
17297 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
17298 $as_echo "$ac_cv_type_uid_t" >&6; }
17299 if test $ac_cv_type_uid_t = no; then
17300
17301 cat >>confdefs.h <<\_ACEOF
17302 #define uid_t int
17303 _ACEOF
17304
17305
17306 cat >>confdefs.h <<\_ACEOF
17307 #define gid_t int
17308 _ACEOF
17309
17310 fi
17311
17312
17313 #### Large File-Support (LFS) ####
17314
17315 # Check whether --enable-largefile was given.
17316 if test "${enable_largefile+set}" = set; then
17317 enableval=$enable_largefile;
17318 fi
17319
17320 if test "$enable_largefile" != no; then
17321
17322 { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
17323 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
17324 if test "${ac_cv_sys_largefile_CC+set}" = set; then
17325 $as_echo_n "(cached) " >&6
17326 else
17327 ac_cv_sys_largefile_CC=no
17328 if test "$GCC" != yes; then
17329 ac_save_CC=$CC
17330 while :; do
17331 # IRIX 6.2 and later do not support large files by default,
17332 # so use the C compiler's -n32 option if that helps.
17333 cat >conftest.$ac_ext <<_ACEOF
17334 /* confdefs.h. */
17335 _ACEOF
17336 cat confdefs.h >>conftest.$ac_ext
17337 cat >>conftest.$ac_ext <<_ACEOF
17338 /* end confdefs.h. */
17339 #include <sys/types.h>
17340 /* Check that off_t can represent 2**63 - 1 correctly.
17341 We can't simply define LARGE_OFF_T to be 9223372036854775807,
17342 since some C++ compilers masquerading as C compilers
17343 incorrectly reject 9223372036854775807. */
17344 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
17345 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
17346 && LARGE_OFF_T % 2147483647 == 1)
17347 ? 1 : -1];
17348 int
17349 main ()
17350 {
17351
17352 ;
17353 return 0;
17354 }
17355 _ACEOF
17356 rm -f conftest.$ac_objext
17357 if { (ac_try="$ac_compile"
17358 case "(($ac_try" in
17359 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17360 *) ac_try_echo=$ac_try;;
17361 esac
17362 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17363 $as_echo "$ac_try_echo") >&5
17364 (eval "$ac_compile") 2>conftest.er1
17365 ac_status=$?
17366 grep -v '^ *+' conftest.er1 >conftest.err
17367 rm -f conftest.er1
17368 cat conftest.err >&5
17369 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17370 (exit $ac_status); } && {
17371 test -z "$ac_c_werror_flag" ||
17372 test ! -s conftest.err
17373 } && test -s conftest.$ac_objext; then
17374 break
17375 else
17376 $as_echo "$as_me: failed program was:" >&5
17377 sed 's/^/| /' conftest.$ac_ext >&5
17378
17379
17380 fi
17381
17382 rm -f core conftest.err conftest.$ac_objext
17383 CC="$CC -n32"
17384 rm -f conftest.$ac_objext
17385 if { (ac_try="$ac_compile"
17386 case "(($ac_try" in
17387 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17388 *) ac_try_echo=$ac_try;;
17389 esac
17390 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17391 $as_echo "$ac_try_echo") >&5
17392 (eval "$ac_compile") 2>conftest.er1
17393 ac_status=$?
17394 grep -v '^ *+' conftest.er1 >conftest.err
17395 rm -f conftest.er1
17396 cat conftest.err >&5
17397 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17398 (exit $ac_status); } && {
17399 test -z "$ac_c_werror_flag" ||
17400 test ! -s conftest.err
17401 } && test -s conftest.$ac_objext; then
17402 ac_cv_sys_largefile_CC=' -n32'; break
17403 else
17404 $as_echo "$as_me: failed program was:" >&5
17405 sed 's/^/| /' conftest.$ac_ext >&5
17406
17407
17408 fi
17409
17410 rm -f core conftest.err conftest.$ac_objext
17411 break
17412 done
17413 CC=$ac_save_CC
17414 rm -f conftest.$ac_ext
17415 fi
17416 fi
17417 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
17418 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
17419 if test "$ac_cv_sys_largefile_CC" != no; then
17420 CC=$CC$ac_cv_sys_largefile_CC
17421 fi
17422
17423 { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
17424 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
17425 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
17426 $as_echo_n "(cached) " >&6
17427 else
17428 while :; do
17429 cat >conftest.$ac_ext <<_ACEOF
17430 /* confdefs.h. */
17431 _ACEOF
17432 cat confdefs.h >>conftest.$ac_ext
17433 cat >>conftest.$ac_ext <<_ACEOF
17434 /* end confdefs.h. */
17435 #include <sys/types.h>
17436 /* Check that off_t can represent 2**63 - 1 correctly.
17437 We can't simply define LARGE_OFF_T to be 9223372036854775807,
17438 since some C++ compilers masquerading as C compilers
17439 incorrectly reject 9223372036854775807. */
17440 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
17441 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
17442 && LARGE_OFF_T % 2147483647 == 1)
17443 ? 1 : -1];
17444 int
17445 main ()
17446 {
17447
17448 ;
17449 return 0;
17450 }
17451 _ACEOF
17452 rm -f conftest.$ac_objext
17453 if { (ac_try="$ac_compile"
17454 case "(($ac_try" in
17455 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17456 *) ac_try_echo=$ac_try;;
17457 esac
17458 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17459 $as_echo "$ac_try_echo") >&5
17460 (eval "$ac_compile") 2>conftest.er1
17461 ac_status=$?
17462 grep -v '^ *+' conftest.er1 >conftest.err
17463 rm -f conftest.er1
17464 cat conftest.err >&5
17465 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17466 (exit $ac_status); } && {
17467 test -z "$ac_c_werror_flag" ||
17468 test ! -s conftest.err
17469 } && test -s conftest.$ac_objext; then
17470 ac_cv_sys_file_offset_bits=no; break
17471 else
17472 $as_echo "$as_me: failed program was:" >&5
17473 sed 's/^/| /' conftest.$ac_ext >&5
17474
17475
17476 fi
17477
17478 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17479 cat >conftest.$ac_ext <<_ACEOF
17480 /* confdefs.h. */
17481 _ACEOF
17482 cat confdefs.h >>conftest.$ac_ext
17483 cat >>conftest.$ac_ext <<_ACEOF
17484 /* end confdefs.h. */
17485 #define _FILE_OFFSET_BITS 64
17486 #include <sys/types.h>
17487 /* Check that off_t can represent 2**63 - 1 correctly.
17488 We can't simply define LARGE_OFF_T to be 9223372036854775807,
17489 since some C++ compilers masquerading as C compilers
17490 incorrectly reject 9223372036854775807. */
17491 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
17492 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
17493 && LARGE_OFF_T % 2147483647 == 1)
17494 ? 1 : -1];
17495 int
17496 main ()
17497 {
17498
17499 ;
17500 return 0;
17501 }
17502 _ACEOF
17503 rm -f conftest.$ac_objext
17504 if { (ac_try="$ac_compile"
17505 case "(($ac_try" in
17506 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17507 *) ac_try_echo=$ac_try;;
17508 esac
17509 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17510 $as_echo "$ac_try_echo") >&5
17511 (eval "$ac_compile") 2>conftest.er1
17512 ac_status=$?
17513 grep -v '^ *+' conftest.er1 >conftest.err
17514 rm -f conftest.er1
17515 cat conftest.err >&5
17516 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17517 (exit $ac_status); } && {
17518 test -z "$ac_c_werror_flag" ||
17519 test ! -s conftest.err
17520 } && test -s conftest.$ac_objext; then
17521 ac_cv_sys_file_offset_bits=64; break
17522 else
17523 $as_echo "$as_me: failed program was:" >&5
17524 sed 's/^/| /' conftest.$ac_ext >&5
17525
17526
17527 fi
17528
17529 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17530 ac_cv_sys_file_offset_bits=unknown
17531 break
17532 done
17533 fi
17534 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
17535 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
17536 case $ac_cv_sys_file_offset_bits in #(
17537 no | unknown) ;;
17538 *)
17539 cat >>confdefs.h <<_ACEOF
17540 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
17541 _ACEOF
17542 ;;
17543 esac
17544 rm -rf conftest*
17545 if test $ac_cv_sys_file_offset_bits = unknown; then
17546 { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
17547 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
17548 if test "${ac_cv_sys_large_files+set}" = set; then
17549 $as_echo_n "(cached) " >&6
17550 else
17551 while :; do
17552 cat >conftest.$ac_ext <<_ACEOF
17553 /* confdefs.h. */
17554 _ACEOF
17555 cat confdefs.h >>conftest.$ac_ext
17556 cat >>conftest.$ac_ext <<_ACEOF
17557 /* end confdefs.h. */
17558 #include <sys/types.h>
17559 /* Check that off_t can represent 2**63 - 1 correctly.
17560 We can't simply define LARGE_OFF_T to be 9223372036854775807,
17561 since some C++ compilers masquerading as C compilers
17562 incorrectly reject 9223372036854775807. */
17563 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
17564 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
17565 && LARGE_OFF_T % 2147483647 == 1)
17566 ? 1 : -1];
17567 int
17568 main ()
17569 {
17570
17571 ;
17572 return 0;
17573 }
17574 _ACEOF
17575 rm -f conftest.$ac_objext
17576 if { (ac_try="$ac_compile"
17577 case "(($ac_try" in
17578 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17579 *) ac_try_echo=$ac_try;;
17580 esac
17581 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17582 $as_echo "$ac_try_echo") >&5
17583 (eval "$ac_compile") 2>conftest.er1
17584 ac_status=$?
17585 grep -v '^ *+' conftest.er1 >conftest.err
17586 rm -f conftest.er1
17587 cat conftest.err >&5
17588 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17589 (exit $ac_status); } && {
17590 test -z "$ac_c_werror_flag" ||
17591 test ! -s conftest.err
17592 } && test -s conftest.$ac_objext; then
17593 ac_cv_sys_large_files=no; break
17594 else
17595 $as_echo "$as_me: failed program was:" >&5
17596 sed 's/^/| /' conftest.$ac_ext >&5
17597
17598
17599 fi
17600
17601 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17602 cat >conftest.$ac_ext <<_ACEOF
17603 /* confdefs.h. */
17604 _ACEOF
17605 cat confdefs.h >>conftest.$ac_ext
17606 cat >>conftest.$ac_ext <<_ACEOF
17607 /* end confdefs.h. */
17608 #define _LARGE_FILES 1
17609 #include <sys/types.h>
17610 /* Check that off_t can represent 2**63 - 1 correctly.
17611 We can't simply define LARGE_OFF_T to be 9223372036854775807,
17612 since some C++ compilers masquerading as C compilers
17613 incorrectly reject 9223372036854775807. */
17614 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
17615 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
17616 && LARGE_OFF_T % 2147483647 == 1)
17617 ? 1 : -1];
17618 int
17619 main ()
17620 {
17621
17622 ;
17623 return 0;
17624 }
17625 _ACEOF
17626 rm -f conftest.$ac_objext
17627 if { (ac_try="$ac_compile"
17628 case "(($ac_try" in
17629 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17630 *) ac_try_echo=$ac_try;;
17631 esac
17632 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17633 $as_echo "$ac_try_echo") >&5
17634 (eval "$ac_compile") 2>conftest.er1
17635 ac_status=$?
17636 grep -v '^ *+' conftest.er1 >conftest.err
17637 rm -f conftest.er1
17638 cat conftest.err >&5
17639 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17640 (exit $ac_status); } && {
17641 test -z "$ac_c_werror_flag" ||
17642 test ! -s conftest.err
17643 } && test -s conftest.$ac_objext; then
17644 ac_cv_sys_large_files=1; break
17645 else
17646 $as_echo "$as_me: failed program was:" >&5
17647 sed 's/^/| /' conftest.$ac_ext >&5
17648
17649
17650 fi
17651
17652 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17653 ac_cv_sys_large_files=unknown
17654 break
17655 done
17656 fi
17657 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
17658 $as_echo "$ac_cv_sys_large_files" >&6; }
17659 case $ac_cv_sys_large_files in #(
17660 no | unknown) ;;
17661 *)
17662 cat >>confdefs.h <<_ACEOF
17663 #define _LARGE_FILES $ac_cv_sys_large_files
17664 _ACEOF
17665 ;;
17666 esac
17667 rm -rf conftest*
17668 fi
17669 fi
17670
17671
17672
17673
17674 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
17675 if test -n "$ac_tool_prefix"; then
17676 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
17677 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
17678 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
17679 $as_echo_n "checking for $ac_word... " >&6; }
17680 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
17681 $as_echo_n "(cached) " >&6
17682 else
17683 case $PKG_CONFIG in
17684 [\\/]* | ?:[\\/]*)
17685 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
17686 ;;
17687 *)
17688 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17689 for as_dir in $PATH
17690 do
17691 IFS=$as_save_IFS
17692 test -z "$as_dir" && as_dir=.
17693 for ac_exec_ext in '' $ac_executable_extensions; do
17694 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
17695 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
17696 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
17697 break 2
17698 fi
17699 done
17700 done
17701 IFS=$as_save_IFS
17702
17703 ;;
17704 esac
17705 fi
17706 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
17707 if test -n "$PKG_CONFIG"; then
17708 { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
17709 $as_echo "$PKG_CONFIG" >&6; }
17710 else
17711 { $as_echo "$as_me:$LINENO: result: no" >&5
17712 $as_echo "no" >&6; }
17713 fi
17714
17715
17716 fi
17717 if test -z "$ac_cv_path_PKG_CONFIG"; then
17718 ac_pt_PKG_CONFIG=$PKG_CONFIG
17719 # Extract the first word of "pkg-config", so it can be a program name with args.
17720 set dummy pkg-config; ac_word=$2
17721 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
17722 $as_echo_n "checking for $ac_word... " >&6; }
17723 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
17724 $as_echo_n "(cached) " >&6
17725 else
17726 case $ac_pt_PKG_CONFIG in
17727 [\\/]* | ?:[\\/]*)
17728 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
17729 ;;
17730 *)
17731 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17732 for as_dir in $PATH
17733 do
17734 IFS=$as_save_IFS
17735 test -z "$as_dir" && as_dir=.
17736 for ac_exec_ext in '' $ac_executable_extensions; do
17737 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
17738 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
17739 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
17740 break 2
17741 fi
17742 done
17743 done
17744 IFS=$as_save_IFS
17745
17746 ;;
17747 esac
17748 fi
17749 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
17750 if test -n "$ac_pt_PKG_CONFIG"; then
17751 { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
17752 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
17753 else
17754 { $as_echo "$as_me:$LINENO: result: no" >&5
17755 $as_echo "no" >&6; }
17756 fi
17757
17758 if test "x$ac_pt_PKG_CONFIG" = x; then
17759 PKG_CONFIG=""
17760 else
17761 case $cross_compiling:$ac_tool_warned in
17762 yes:)
17763 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
17764 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
17765 ac_tool_warned=yes ;;
17766 esac
17767 PKG_CONFIG=$ac_pt_PKG_CONFIG
17768 fi
17769 else
17770 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
17771 fi
17772
17773 fi
17774 if test -n "$PKG_CONFIG"; then
17775 _pkg_min_version=0.9.0
17776 { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
17777 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
17778 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
17779 { $as_echo "$as_me:$LINENO: result: yes" >&5
17780 $as_echo "yes" >&6; }
17781 else
17782 { $as_echo "$as_me:$LINENO: result: no" >&5
17783 $as_echo "no" >&6; }
17784 PKG_CONFIG=""
17785 fi
17786
17787 fi
17788
17789 pkg_failed=no
17790 { $as_echo "$as_me:$LINENO: checking for LIBUDEV" >&5
17791 $as_echo_n "checking for LIBUDEV... " >&6; }
17792
17793 if test -n "$LIBUDEV_CFLAGS"; then
17794 pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS"
17795 elif test -n "$PKG_CONFIG"; then
17796 if test -n "$PKG_CONFIG" && \
17797 { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libudev\"") >&5
17798 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5
17799 ac_status=$?
17800 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17801 (exit $ac_status); }; then
17802 pkg_cv_LIBUDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev" 2>/dev/null`
17803 else
17804 pkg_failed=yes
17805 fi
17806 else
17807 pkg_failed=untried
17808 fi
17809 if test -n "$LIBUDEV_LIBS"; then
17810 pkg_cv_LIBUDEV_LIBS="$LIBUDEV_LIBS"
17811 elif test -n "$PKG_CONFIG"; then
17812 if test -n "$PKG_CONFIG" && \
17813 { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libudev\"") >&5
17814 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5
17815 ac_status=$?
17816 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17817 (exit $ac_status); }; then
17818 pkg_cv_LIBUDEV_LIBS=`$PKG_CONFIG --libs "libudev" 2>/dev/null`
17819 else
17820 pkg_failed=yes
17821 fi
17822 else
17823 pkg_failed=untried
17824 fi
17825
17826
17827
17828 if test $pkg_failed = yes; then
17829
17830 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
17831 _pkg_short_errors_supported=yes
17832 else
17833 _pkg_short_errors_supported=no
17834 fi
17835 if test $_pkg_short_errors_supported = yes; then
17836 LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libudev" 2>&1`
17837 else
17838 LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors "libudev" 2>&1`
17839 fi
17840 # Put the nasty error message in config.log where it belongs
17841 echo "$LIBUDEV_PKG_ERRORS" >&5
17842
17843 { { $as_echo "$as_me:$LINENO: error: Package requirements (libudev) were not met:
17844
17845 $LIBUDEV_PKG_ERRORS
17846
17847 Consider adjusting the PKG_CONFIG_PATH environment variable if you
17848 installed software in a non-standard prefix.
17849
17850 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
17851 and LIBUDEV_LIBS to avoid the need to call pkg-config.
17852 See the pkg-config man page for more details.
17853 " >&5
17854 $as_echo "$as_me: error: Package requirements (libudev) were not met:
17855
17856 $LIBUDEV_PKG_ERRORS
17857
17858 Consider adjusting the PKG_CONFIG_PATH environment variable if you
17859 installed software in a non-standard prefix.
17860
17861 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
17862 and LIBUDEV_LIBS to avoid the need to call pkg-config.
17863 See the pkg-config man page for more details.
17864 " >&2;}
17865 { (exit 1); exit 1; }; }
17866 elif test $pkg_failed = untried; then
17867 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
17868 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17869 { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
17870 is in your PATH or set the PKG_CONFIG environment variable to the full
17871 path to pkg-config.
17872
17873 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
17874 and LIBUDEV_LIBS to avoid the need to call pkg-config.
17875 See the pkg-config man page for more details.
17876
17877 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
17878 See \`config.log' for more details." >&5
17879 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
17880 is in your PATH or set the PKG_CONFIG environment variable to the full
17881 path to pkg-config.
17882
17883 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
17884 and LIBUDEV_LIBS to avoid the need to call pkg-config.
17885 See the pkg-config man page for more details.
17886
17887 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
17888 See \`config.log' for more details." >&2;}
17889 { (exit 1); exit 1; }; }; }
17890 else
17891 LIBUDEV_CFLAGS=$pkg_cv_LIBUDEV_CFLAGS
17892 LIBUDEV_LIBS=$pkg_cv_LIBUDEV_LIBS
17893 { $as_echo "$as_me:$LINENO: result: yes" >&5
17894 $as_echo "yes" >&6; }
17895 :
17896 fi
17897
17898 cat >>confdefs.h <<\_ACEOF
17899 #define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE 1
17900 _ACEOF
17901
17902
17903 ###################################
17904 # Output #
17905 ###################################
17906
17907 ac_config_files="$ac_config_files Makefile libatasmart.pc"
17908
17909 cat >confcache <<\_ACEOF
17910 # This file is a shell script that caches the results of configure
17911 # tests run on this system so they can be shared between configure
17912 # scripts and configure runs, see configure's option --config-cache.
17913 # It is not useful on other systems. If it contains results you don't
17914 # want to keep, you may remove or edit it.
17915 #
17916 # config.status only pays attention to the cache file if you give it
17917 # the --recheck option to rerun configure.
17918 #
17919 # `ac_cv_env_foo' variables (set or unset) will be overridden when
17920 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17921 # following values.
17922
17923 _ACEOF
17924
17925 # The following way of writing the cache mishandles newlines in values,
17926 # but we know of no workaround that is simple, portable, and efficient.
17927 # So, we kill variables containing newlines.
17928 # Ultrix sh set writes to stderr and can't be redirected directly,
17929 # and sets the high bit in the cache file unless we assign to the vars.
17930 (
17931 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
17932 eval ac_val=\$$ac_var
17933 case $ac_val in #(
17934 *${as_nl}*)
17935 case $ac_var in #(
17936 *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
17937 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
17938 esac
17939 case $ac_var in #(
17940 _ | IFS | as_nl) ;; #(
17941 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
17942 *) $as_unset $ac_var ;;
17943 esac ;;
17944 esac
17945 done
17946
17947 (set) 2>&1 |
17948 case $as_nl`(ac_space=' '; set) 2>&1` in #(
17949 *${as_nl}ac_space=\ *)
17950 # `set' does not quote correctly, so add quotes (double-quote
17951 # substitution turns \\\\ into \\, and sed turns \\ into \).
17952 sed -n \
17953 "s/'/'\\\\''/g;
17954 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17955 ;; #(
17956 *)
17957 # `set' quotes correctly as required by POSIX, so do not add quotes.
17958 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
17959 ;;
17960 esac |
17961 sort
17962 ) |
17963 sed '
17964 /^ac_cv_env_/b end
17965 t clear
17966 :clear
17967 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17968 t end
17969 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17970 :end' >>confcache
17971 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
17972 if test -w "$cache_file"; then
17973 test "x$cache_file" != "x/dev/null" &&
17974 { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
17975 $as_echo "$as_me: updating cache $cache_file" >&6;}
17976 cat confcache >$cache_file
17977 else
17978 { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
17979 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
17980 fi
17981 fi
17982 rm -f confcache
17983
17984 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17985 # Let make expand exec_prefix.
17986 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17987
17988 DEFS=-DHAVE_CONFIG_H
17989
17990 ac_libobjs=
17991 ac_ltlibobjs=
17992 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
17993 # 1. Remove the extension, and $U if already installed.
17994 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
17995 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
17996 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
17997 # will be set to the directory where LIBOBJS objects are built.
17998 ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
17999 ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
18000 done
18001 LIBOBJS=$ac_libobjs
18002
18003 LTLIBOBJS=$ac_ltlibobjs
18004
18005
18006 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
18007 { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
18008 Usually this means the macro was only invoked conditionally." >&5
18009 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
18010 Usually this means the macro was only invoked conditionally." >&2;}
18011 { (exit 1); exit 1; }; }
18012 fi
18013 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
18014 { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
18015 Usually this means the macro was only invoked conditionally." >&5
18016 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
18017 Usually this means the macro was only invoked conditionally." >&2;}
18018 { (exit 1); exit 1; }; }
18019 fi
18020 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
18021 { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
18022 Usually this means the macro was only invoked conditionally." >&5
18023 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
18024 Usually this means the macro was only invoked conditionally." >&2;}
18025 { (exit 1); exit 1; }; }
18026 fi
18027 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
18028 { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
18029 Usually this means the macro was only invoked conditionally." >&5
18030 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
18031 Usually this means the macro was only invoked conditionally." >&2;}
18032 { (exit 1); exit 1; }; }
18033 fi
18034
18035
18036 : ${CONFIG_STATUS=./config.status}
18037 ac_write_fail=0
18038 ac_clean_files_save=$ac_clean_files
18039 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18040 { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
18041 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
18042 cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18043 #! $SHELL
18044 # Generated by $as_me.
18045 # Run this file to recreate the current configuration.
18046 # Compiler output produced by configure, useful for debugging
18047 # configure, is in config.log if it exists.
18048
18049 debug=false
18050 ac_cs_recheck=false
18051 ac_cs_silent=false
18052 SHELL=\${CONFIG_SHELL-$SHELL}
18053 _ACEOF
18054
18055 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18056 ## --------------------- ##
18057 ## M4sh Initialization. ##
18058 ## --------------------- ##
18059
18060 # Be more Bourne compatible
18061 DUALCASE=1; export DUALCASE # for MKS sh
18062 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18063 emulate sh
18064 NULLCMD=:
18065 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
18066 # is contrary to our usage. Disable this feature.
18067 alias -g '${1+"$@"}'='"$@"'
18068 setopt NO_GLOB_SUBST
18069 else
18070 case `(set -o) 2>/dev/null` in
18071 *posix*) set -o posix ;;
18072 esac
18073
18074 fi
18075
18076
18077
18078
18079 # PATH needs CR
18080 # Avoid depending upon Character Ranges.
18081 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
18082 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
18083 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
18084 as_cr_digits='0123456789'
18085 as_cr_alnum=$as_cr_Letters$as_cr_digits
18086
18087 as_nl='
18088 '
18089 export as_nl
18090 # Printing a long string crashes Solaris 7 /usr/bin/printf.
18091 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
18092 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
18093 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
18094 if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
18095 as_echo='printf %s\n'
18096 as_echo_n='printf %s'
18097 else
18098 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
18099 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
18100 as_echo_n='/usr/ucb/echo -n'
18101 else
18102 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
18103 as_echo_n_body='eval
18104 arg=$1;
18105 case $arg in
18106 *"$as_nl"*)
18107 expr "X$arg" : "X\\(.*\\)$as_nl";
18108 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
18109 esac;
18110 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
18111 '
18112 export as_echo_n_body
18113 as_echo_n='sh -c $as_echo_n_body as_echo'
18114 fi
18115 export as_echo_body
18116 as_echo='sh -c $as_echo_body as_echo'
18117 fi
18118
18119 # The user is always right.
18120 if test "${PATH_SEPARATOR+set}" != set; then
18121 PATH_SEPARATOR=:
18122 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
18123 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
18124 PATH_SEPARATOR=';'
18125 }
18126 fi
18127
18128 # Support unset when possible.
18129 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
18130 as_unset=unset
18131 else
18132 as_unset=false
18133 fi
18134
18135
18136 # IFS
18137 # We need space, tab and new line, in precisely that order. Quoting is
18138 # there to prevent editors from complaining about space-tab.
18139 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
18140 # splitting by setting IFS to empty value.)
18141 IFS=" "" $as_nl"
18142
18143 # Find who we are. Look in the path if we contain no directory separator.
18144 case $0 in
18145 *[\\/]* ) as_myself=$0 ;;
18146 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18147 for as_dir in $PATH
18148 do
18149 IFS=$as_save_IFS
18150 test -z "$as_dir" && as_dir=.
18151 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
18152 done
18153 IFS=$as_save_IFS
18154
18155 ;;
18156 esac
18157 # We did not find ourselves, most probably we were run as `sh COMMAND'
18158 # in which case we are not to be found in the path.
18159 if test "x$as_myself" = x; then
18160 as_myself=$0
18161 fi
18162 if test ! -f "$as_myself"; then
18163 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
18164 { (exit 1); exit 1; }
18165 fi
18166
18167 # Work around bugs in pre-3.0 UWIN ksh.
18168 for as_var in ENV MAIL MAILPATH
18169 do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
18170 done
18171 PS1='$ '
18172 PS2='> '
18173 PS4='+ '
18174
18175 # NLS nuisances.
18176 LC_ALL=C
18177 export LC_ALL
18178 LANGUAGE=C
18179 export LANGUAGE
18180
18181 # Required to use basename.
18182 if expr a : '\(a\)' >/dev/null 2>&1 &&
18183 test "X`expr 00001 : '.*\(...\)'`" = X001; then
18184 as_expr=expr
18185 else
18186 as_expr=false
18187 fi
18188
18189 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
18190 as_basename=basename
18191 else
18192 as_basename=false
18193 fi
18194
18195
18196 # Name of the executable.
18197 as_me=`$as_basename -- "$0" ||
18198 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
18199 X"$0" : 'X\(//\)$' \| \
18200 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
18201 $as_echo X/"$0" |
18202 sed '/^.*\/\([^/][^/]*\)\/*$/{
18203 s//\1/
18204 q
18205 }
18206 /^X\/\(\/\/\)$/{
18207 s//\1/
18208 q
18209 }
18210 /^X\/\(\/\).*/{
18211 s//\1/
18212 q
18213 }
18214 s/.*/./; q'`
18215
18216 # CDPATH.
18217 $as_unset CDPATH
18218
18219
18220
18221 as_lineno_1=$LINENO
18222 as_lineno_2=$LINENO
18223 test "x$as_lineno_1" != "x$as_lineno_2" &&
18224 test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
18225
18226 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
18227 # uniformly replaced by the line number. The first 'sed' inserts a
18228 # line-number line after each line using $LINENO; the second 'sed'
18229 # does the real work. The second script uses 'N' to pair each
18230 # line-number line with the line containing $LINENO, and appends
18231 # trailing '-' during substitution so that $LINENO is not a special
18232 # case at line end.
18233 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
18234 # scripts with optimization help from Paolo Bonzini. Blame Lee
18235 # E. McMahon (1931-1989) for sed's syntax. :-)
18236 sed -n '
18237 p
18238 /[$]LINENO/=
18239 ' <$as_myself |
18240 sed '
18241 s/[$]LINENO.*/&-/
18242 t lineno
18243 b
18244 :lineno
18245 N
18246 :loop
18247 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
18248 t loop
18249 s/-\n.*//
18250 ' >$as_me.lineno &&
18251 chmod +x "$as_me.lineno" ||
18252 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
18253 { (exit 1); exit 1; }; }
18254
18255 # Don't try to exec as it changes $[0], causing all sort of problems
18256 # (the dirname of $[0] is not the place where we might find the
18257 # original and so on. Autoconf is especially sensitive to this).
18258 . "./$as_me.lineno"
18259 # Exit status is that of the last command.
18260 exit
18261 }
18262
18263
18264 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
18265 as_dirname=dirname
18266 else
18267 as_dirname=false
18268 fi
18269
18270 ECHO_C= ECHO_N= ECHO_T=
18271 case `echo -n x` in
18272 -n*)
18273 case `echo 'x\c'` in
18274 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
18275 *) ECHO_C='\c';;
18276 esac;;
18277 *)
18278 ECHO_N='-n';;
18279 esac
18280 if expr a : '\(a\)' >/dev/null 2>&1 &&
18281 test "X`expr 00001 : '.*\(...\)'`" = X001; then
18282 as_expr=expr
18283 else
18284 as_expr=false
18285 fi
18286
18287 rm -f conf$$ conf$$.exe conf$$.file
18288 if test -d conf$$.dir; then
18289 rm -f conf$$.dir/conf$$.file
18290 else
18291 rm -f conf$$.dir
18292 mkdir conf$$.dir 2>/dev/null
18293 fi
18294 if (echo >conf$$.file) 2>/dev/null; then
18295 if ln -s conf$$.file conf$$ 2>/dev/null; then
18296 as_ln_s='ln -s'
18297 # ... but there are two gotchas:
18298 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
18299 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
18300 # In both cases, we have to default to `cp -p'.
18301 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
18302 as_ln_s='cp -p'
18303 elif ln conf$$.file conf$$ 2>/dev/null; then
18304 as_ln_s=ln
18305 else
18306 as_ln_s='cp -p'
18307 fi
18308 else
18309 as_ln_s='cp -p'
18310 fi
18311 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
18312 rmdir conf$$.dir 2>/dev/null
18313
18314 if mkdir -p . 2>/dev/null; then
18315 as_mkdir_p=:
18316 else
18317 test -d ./-p && rmdir ./-p
18318 as_mkdir_p=false
18319 fi
18320
18321 if test -x / >/dev/null 2>&1; then
18322 as_test_x='test -x'
18323 else
18324 if ls -dL / >/dev/null 2>&1; then
18325 as_ls_L_option=L
18326 else
18327 as_ls_L_option=
18328 fi
18329 as_test_x='
18330 eval sh -c '\''
18331 if test -d "$1"; then
18332 test -d "$1/.";
18333 else
18334 case $1 in
18335 -*)set "./$1";;
18336 esac;
18337 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
18338 ???[sx]*):;;*)false;;esac;fi
18339 '\'' sh
18340 '
18341 fi
18342 as_executable_p=$as_test_x
18343
18344 # Sed expression to map a string onto a valid CPP name.
18345 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
18346
18347 # Sed expression to map a string onto a valid variable name.
18348 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
18349
18350
18351 exec 6>&1
18352
18353 # Save the log message, to keep $[0] and so on meaningful, and to
18354 # report actual input values of CONFIG_FILES etc. instead of their
18355 # values after options handling.
18356 ac_log="
18357 This file was extended by libatasmart $as_me 0.13, which was
18358 generated by GNU Autoconf 2.63. Invocation command line was
18359
18360 CONFIG_FILES = $CONFIG_FILES
18361 CONFIG_HEADERS = $CONFIG_HEADERS
18362 CONFIG_LINKS = $CONFIG_LINKS
18363 CONFIG_COMMANDS = $CONFIG_COMMANDS
18364 $ $0 $@
18365
18366 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18367 "
18368
18369 _ACEOF
18370
18371 case $ac_config_files in *"
18372 "*) set x $ac_config_files; shift; ac_config_files=$*;;
18373 esac
18374
18375 case $ac_config_headers in *"
18376 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
18377 esac
18378
18379
18380 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18381 # Files that config.status was made for.
18382 config_files="$ac_config_files"
18383 config_headers="$ac_config_headers"
18384 config_commands="$ac_config_commands"
18385
18386 _ACEOF
18387
18388 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18389 ac_cs_usage="\
18390 \`$as_me' instantiates files from templates according to the
18391 current configuration.
18392
18393 Usage: $0 [OPTION]... [FILE]...
18394
18395 -h, --help print this help, then exit
18396 -V, --version print version number and configuration settings, then exit
18397 -q, --quiet, --silent
18398 do not print progress messages
18399 -d, --debug don't remove temporary files
18400 --recheck update $as_me by reconfiguring in the same conditions
18401 --file=FILE[:TEMPLATE]
18402 instantiate the configuration file FILE
18403 --header=FILE[:TEMPLATE]
18404 instantiate the configuration header FILE
18405
18406 Configuration files:
18407 $config_files
18408
18409 Configuration headers:
18410 $config_headers
18411
18412 Configuration commands:
18413 $config_commands
18414
18415 Report bugs to <bug-autoconf@gnu.org>."
18416
18417 _ACEOF
18418 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18419 ac_cs_version="\\
18420 libatasmart config.status 0.13
18421 configured by $0, generated by GNU Autoconf 2.63,
18422 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
18423
18424 Copyright (C) 2008 Free Software Foundation, Inc.
18425 This config.status script is free software; the Free Software Foundation
18426 gives unlimited permission to copy, distribute and modify it."
18427
18428 ac_pwd='$ac_pwd'
18429 srcdir='$srcdir'
18430 INSTALL='$INSTALL'
18431 MKDIR_P='$MKDIR_P'
18432 AWK='$AWK'
18433 test -n "\$AWK" || AWK=awk
18434 _ACEOF
18435
18436 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18437 # The default lists apply if the user does not specify any file.
18438 ac_need_defaults=:
18439 while test $# != 0
18440 do
18441 case $1 in
18442 --*=*)
18443 ac_option=`expr "X$1" : 'X\([^=]*\)='`
18444 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
18445 ac_shift=:
18446 ;;
18447 *)
18448 ac_option=$1
18449 ac_optarg=$2
18450 ac_shift=shift
18451 ;;
18452 esac
18453
18454 case $ac_option in
18455 # Handling of the options.
18456 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18457 ac_cs_recheck=: ;;
18458 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
18459 $as_echo "$ac_cs_version"; exit ;;
18460 --debug | --debu | --deb | --de | --d | -d )
18461 debug=: ;;
18462 --file | --fil | --fi | --f )
18463 $ac_shift
18464 case $ac_optarg in
18465 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
18466 esac
18467 CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
18468 ac_need_defaults=false;;
18469 --header | --heade | --head | --hea )
18470 $ac_shift
18471 case $ac_optarg in
18472 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
18473 esac
18474 CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
18475 ac_need_defaults=false;;
18476 --he | --h)
18477 # Conflict between --help and --header
18478 { $as_echo "$as_me: error: ambiguous option: $1
18479 Try \`$0 --help' for more information." >&2
18480 { (exit 1); exit 1; }; };;
18481 --help | --hel | -h )
18482 $as_echo "$ac_cs_usage"; exit ;;
18483 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
18484 | -silent | --silent | --silen | --sile | --sil | --si | --s)
18485 ac_cs_silent=: ;;
18486
18487 # This is an error.
18488 -*) { $as_echo "$as_me: error: unrecognized option: $1
18489 Try \`$0 --help' for more information." >&2
18490 { (exit 1); exit 1; }; } ;;
18491
18492 *) ac_config_targets="$ac_config_targets $1"
18493 ac_need_defaults=false ;;
18494
18495 esac
18496 shift
18497 done
18498
18499 ac_configure_extra_args=
18500
18501 if $ac_cs_silent; then
18502 exec 6>/dev/null
18503 ac_configure_extra_args="$ac_configure_extra_args --silent"
18504 fi
18505
18506 _ACEOF
18507 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18508 if \$ac_cs_recheck; then
18509 set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
18510 shift
18511 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
18512 CONFIG_SHELL='$SHELL'
18513 export CONFIG_SHELL
18514 exec "\$@"
18515 fi
18516
18517 _ACEOF
18518 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18519 exec 5>>config.log
18520 {
18521 echo
18522 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
18523 ## Running $as_me. ##
18524 _ASBOX
18525 $as_echo "$ac_log"
18526 } >&5
18527
18528 _ACEOF
18529 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18530 #
18531 # INIT-COMMANDS
18532 #
18533 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
18534
18535
18536 # The HP-UX ksh and POSIX shell print the target directory to stdout
18537 # if CDPATH is set.
18538 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
18539
18540 sed_quote_subst='$sed_quote_subst'
18541 double_quote_subst='$double_quote_subst'
18542 delay_variable_subst='$delay_variable_subst'
18543 macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
18544 macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
18545 enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
18546 enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
18547 pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
18548 enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
18549 host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
18550 host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
18551 host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
18552 build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
18553 build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
18554 build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
18555 SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
18556 Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
18557 GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
18558 EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
18559 FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
18560 LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
18561 NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
18562 LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
18563 max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
18564 ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
18565 exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
18566 lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
18567 lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
18568 lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
18569 reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
18570 reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18571 OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
18572 deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
18573 file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
18574 AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
18575 AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
18576 STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
18577 RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
18578 old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18579 old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18580 old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18581 CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
18582 CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
18583 compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
18584 GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
18585 lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
18586 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
18587 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
18588 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
18589 objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
18590 SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
18591 ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
18592 MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
18593 lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
18594 lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
18595 lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
18596 lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
18597 lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
18598 need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
18599 DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
18600 NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
18601 LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
18602 OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
18603 OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
18604 libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
18605 shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18606 extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18607 archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
18608 enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
18609 export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
18610 whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
18611 compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
18612 old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18613 old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18614 archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18615 archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18616 module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18617 module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18618 with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
18619 allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
18620 no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
18621 hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
18622 hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
18623 hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
18624 hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
18625 hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
18626 hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
18627 hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
18628 hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
18629 inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
18630 link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
18631 fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
18632 always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
18633 export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18634 exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
18635 include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
18636 prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18637 file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
18638 variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
18639 need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
18640 need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
18641 version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
18642 runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
18643 shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
18644 shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
18645 libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
18646 library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
18647 soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
18648 postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18649 postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18650 finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
18651 finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
18652 hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
18653 sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
18654 sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
18655 hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
18656 enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
18657 enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
18658 enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
18659 old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
18660 striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
18661 compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`'
18662 predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`'
18663 postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`'
18664 predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`'
18665 postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`'
18666 compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`'
18667 LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18668 old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18669 compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18670 GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18671 lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18672 lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18673 lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18674 lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18675 lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18676 archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18677 enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18678 export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18679 whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18680 compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18681 old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18682 old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18683 archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18684 archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18685 module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18686 module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18687 with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18688 allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18689 no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18690 hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18691 hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18692 hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18693 hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18694 hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18695 hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18696 hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18697 hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18698 inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18699 link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18700 fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18701 always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18702 export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18703 exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18704 include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18705 prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18706 file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18707 hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18708 compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18709 predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18710 postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18711 predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18712 postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18713 compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
18714
18715 LTCC='$LTCC'
18716 LTCFLAGS='$LTCFLAGS'
18717 compiler='$compiler_DEFAULT'
18718
18719 # Quote evaled strings.
18720 for var in SED \
18721 GREP \
18722 EGREP \
18723 FGREP \
18724 LD \
18725 NM \
18726 LN_S \
18727 lt_SP2NL \
18728 lt_NL2SP \
18729 reload_flag \
18730 OBJDUMP \
18731 deplibs_check_method \
18732 file_magic_cmd \
18733 AR \
18734 AR_FLAGS \
18735 STRIP \
18736 RANLIB \
18737 CC \
18738 CFLAGS \
18739 compiler \
18740 lt_cv_sys_global_symbol_pipe \
18741 lt_cv_sys_global_symbol_to_cdecl \
18742 lt_cv_sys_global_symbol_to_c_name_address \
18743 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
18744 SHELL \
18745 ECHO \
18746 lt_prog_compiler_no_builtin_flag \
18747 lt_prog_compiler_wl \
18748 lt_prog_compiler_pic \
18749 lt_prog_compiler_static \
18750 lt_cv_prog_compiler_c_o \
18751 need_locks \
18752 DSYMUTIL \
18753 NMEDIT \
18754 LIPO \
18755 OTOOL \
18756 OTOOL64 \
18757 shrext_cmds \
18758 export_dynamic_flag_spec \
18759 whole_archive_flag_spec \
18760 compiler_needs_object \
18761 with_gnu_ld \
18762 allow_undefined_flag \
18763 no_undefined_flag \
18764 hardcode_libdir_flag_spec \
18765 hardcode_libdir_flag_spec_ld \
18766 hardcode_libdir_separator \
18767 fix_srcfile_path \
18768 exclude_expsyms \
18769 include_expsyms \
18770 file_list_spec \
18771 variables_saved_for_relink \
18772 libname_spec \
18773 library_names_spec \
18774 soname_spec \
18775 finish_eval \
18776 old_striplib \
18777 striplib \
18778 compiler_lib_search_dirs \
18779 predep_objects \
18780 postdep_objects \
18781 predeps \
18782 postdeps \
18783 compiler_lib_search_path \
18784 LD_CXX \
18785 compiler_CXX \
18786 lt_prog_compiler_no_builtin_flag_CXX \
18787 lt_prog_compiler_wl_CXX \
18788 lt_prog_compiler_pic_CXX \
18789 lt_prog_compiler_static_CXX \
18790 lt_cv_prog_compiler_c_o_CXX \
18791 export_dynamic_flag_spec_CXX \
18792 whole_archive_flag_spec_CXX \
18793 compiler_needs_object_CXX \
18794 with_gnu_ld_CXX \
18795 allow_undefined_flag_CXX \
18796 no_undefined_flag_CXX \
18797 hardcode_libdir_flag_spec_CXX \
18798 hardcode_libdir_flag_spec_ld_CXX \
18799 hardcode_libdir_separator_CXX \
18800 fix_srcfile_path_CXX \
18801 exclude_expsyms_CXX \
18802 include_expsyms_CXX \
18803 file_list_spec_CXX \
18804 compiler_lib_search_dirs_CXX \
18805 predep_objects_CXX \
18806 postdep_objects_CXX \
18807 predeps_CXX \
18808 postdeps_CXX \
18809 compiler_lib_search_path_CXX; do
18810 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
18811 *[\\\\\\\`\\"\\\$]*)
18812 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
18813 ;;
18814 *)
18815 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
18816 ;;
18817 esac
18818 done
18819
18820 # Double-quote double-evaled strings.
18821 for var in reload_cmds \
18822 old_postinstall_cmds \
18823 old_postuninstall_cmds \
18824 old_archive_cmds \
18825 extract_expsyms_cmds \
18826 old_archive_from_new_cmds \
18827 old_archive_from_expsyms_cmds \
18828 archive_cmds \
18829 archive_expsym_cmds \
18830 module_cmds \
18831 module_expsym_cmds \
18832 export_symbols_cmds \
18833 prelink_cmds \
18834 postinstall_cmds \
18835 postuninstall_cmds \
18836 finish_cmds \
18837 sys_lib_search_path_spec \
18838 sys_lib_dlsearch_path_spec \
18839 old_archive_cmds_CXX \
18840 old_archive_from_new_cmds_CXX \
18841 old_archive_from_expsyms_cmds_CXX \
18842 archive_cmds_CXX \
18843 archive_expsym_cmds_CXX \
18844 module_cmds_CXX \
18845 module_expsym_cmds_CXX \
18846 export_symbols_cmds_CXX \
18847 prelink_cmds_CXX; do
18848 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
18849 *[\\\\\\\`\\"\\\$]*)
18850 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
18851 ;;
18852 *)
18853 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
18854 ;;
18855 esac
18856 done
18857
18858 # Fix-up fallback echo if it was mangled by the above quoting rules.
18859 case \$lt_ECHO in
18860 *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
18861 ;;
18862 esac
18863
18864 ac_aux_dir='$ac_aux_dir'
18865 xsi_shell='$xsi_shell'
18866 lt_shell_append='$lt_shell_append'
18867
18868 # See if we are running on zsh, and set the options which allow our
18869 # commands through without removal of \ escapes INIT.
18870 if test -n "\${ZSH_VERSION+set}" ; then
18871 setopt NO_GLOB_SUBST
18872 fi
18873
18874
18875 PACKAGE='$PACKAGE'
18876 VERSION='$VERSION'
18877 TIMESTAMP='$TIMESTAMP'
18878 RM='$RM'
18879 ofile='$ofile'
18880
18881
18882
18883
18884
18885
18886 _ACEOF
18887
18888 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
18889
18890 # Handling of arguments.
18891 for ac_config_target in $ac_config_targets
18892 do
18893 case $ac_config_target in
18894 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
18895 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
18896 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
18897 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18898 "libatasmart.pc") CONFIG_FILES="$CONFIG_FILES libatasmart.pc" ;;
18899
18900 *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
18901 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18902 { (exit 1); exit 1; }; };;
18903 esac
18904 done
18905
18906
18907 # If the user did not use the arguments to specify the items to instantiate,
18908 # then the envvar interface is used. Set only those that are not.
18909 # We use the long form for the default assignment because of an extremely
18910 # bizarre bug on SunOS 4.1.3.
18911 if $ac_need_defaults; then
18912 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18913 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18914 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18915 fi
18916
18917 # Have a temporary directory for convenience. Make it in the build tree
18918 # simply because there is no reason against having it here, and in addition,
18919 # creating and moving files from /tmp can sometimes cause problems.
18920 # Hook for its removal unless debugging.
18921 # Note that there is a small window in which the directory will not be cleaned:
18922 # after its creation but before its name has been assigned to `$tmp'.
18923 $debug ||
18924 {
18925 tmp=
18926 trap 'exit_status=$?
18927 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
18928 ' 0
18929 trap '{ (exit 1); exit 1; }' 1 2 13 15
18930 }
18931 # Create a (secure) tmp directory for tmp files.
18932
18933 {
18934 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
18935 test -n "$tmp" && test -d "$tmp"
18936 } ||
18937 {
18938 tmp=./conf$$-$RANDOM
18939 (umask 077 && mkdir "$tmp")
18940 } ||
18941 {
18942 $as_echo "$as_me: cannot create a temporary directory in ." >&2
18943 { (exit 1); exit 1; }
18944 }
18945
18946 # Set up the scripts for CONFIG_FILES section.
18947 # No need to generate them if there are no CONFIG_FILES.
18948 # This happens for instance with `./config.status config.h'.
18949 if test -n "$CONFIG_FILES"; then
18950
18951
18952 ac_cr='
18953 '
18954 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
18955 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
18956 ac_cs_awk_cr='\\r'
18957 else
18958 ac_cs_awk_cr=$ac_cr
18959 fi
18960
18961 echo 'BEGIN {' >"$tmp/subs1.awk" &&
18962 _ACEOF
18963
18964
18965 {
18966 echo "cat >conf$$subs.awk <<_ACEOF" &&
18967 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
18968 echo "_ACEOF"
18969 } >conf$$subs.sh ||
18970 { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
18971 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
18972 { (exit 1); exit 1; }; }
18973 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
18974 ac_delim='%!_!# '
18975 for ac_last_try in false false false false false :; do
18976 . ./conf$$subs.sh ||
18977 { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
18978 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
18979 { (exit 1); exit 1; }; }
18980
18981 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
18982 if test $ac_delim_n = $ac_delim_num; then
18983 break
18984 elif $ac_last_try; then
18985 { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
18986 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
18987 { (exit 1); exit 1; }; }
18988 else
18989 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
18990 fi
18991 done
18992 rm -f conf$$subs.sh
18993
18994 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
18995 cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
18996 _ACEOF
18997 sed -n '
18998 h
18999 s/^/S["/; s/!.*/"]=/
19000 p
19001 g
19002 s/^[^!]*!//
19003 :repl
19004 t repl
19005 s/'"$ac_delim"'$//
19006 t delim
19007 :nl
19008 h
19009 s/\(.\{148\}\).*/\1/
19010 t more1
19011 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
19012 p
19013 n
19014 b repl
19015 :more1
19016 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
19017 p
19018 g
19019 s/.\{148\}//
19020 t nl
19021 :delim
19022 h
19023 s/\(.\{148\}\).*/\1/
19024 t more2
19025 s/["\\]/\\&/g; s/^/"/; s/$/"/
19026 p
19027 b
19028 :more2
19029 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
19030 p
19031 g
19032 s/.\{148\}//
19033 t delim
19034 ' <conf$$subs.awk | sed '
19035 /^[^""]/{
19036 N
19037 s/\n//
19038 }
19039 ' >>$CONFIG_STATUS || ac_write_fail=1
19040 rm -f conf$$subs.awk
19041 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19042 _ACAWK
19043 cat >>"\$tmp/subs1.awk" <<_ACAWK &&
19044 for (key in S) S_is_set[key] = 1
19045 FS = ""
19046
19047 }
19048 {
19049 line = $ 0
19050 nfields = split(line, field, "@")
19051 substed = 0
19052 len = length(field[1])
19053 for (i = 2; i < nfields; i++) {
19054 key = field[i]
19055 keylen = length(key)
19056 if (S_is_set[key]) {
19057 value = S[key]
19058 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
19059 len += length(value) + length(field[++i])
19060 substed = 1
19061 } else
19062 len += 1 + keylen
19063 }
19064
19065 print line
19066 }
19067
19068 _ACAWK
19069 _ACEOF
19070 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19071 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
19072 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
19073 else
19074 cat
19075 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
19076 || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
19077 $as_echo "$as_me: error: could not setup config files machinery" >&2;}
19078 { (exit 1); exit 1; }; }
19079 _ACEOF
19080
19081 # VPATH may cause trouble with some makes, so we remove $(srcdir),
19082 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19083 # trailing colons and then remove the whole line if VPATH becomes empty
19084 # (actually we leave an empty line to preserve line numbers).
19085 if test "x$srcdir" = x.; then
19086 ac_vpsub='/^[ ]*VPATH[ ]*=/{
19087 s/:*\$(srcdir):*/:/
19088 s/:*\${srcdir}:*/:/
19089 s/:*@srcdir@:*/:/
19090 s/^\([^=]*=[ ]*\):*/\1/
19091 s/:*$//
19092 s/^[^=]*=[ ]*$//
19093 }'
19094 fi
19095
19096 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19097 fi # test -n "$CONFIG_FILES"
19098
19099 # Set up the scripts for CONFIG_HEADERS section.
19100 # No need to generate them if there are no CONFIG_HEADERS.
19101 # This happens for instance with `./config.status Makefile'.
19102 if test -n "$CONFIG_HEADERS"; then
19103 cat >"$tmp/defines.awk" <<\_ACAWK ||
19104 BEGIN {
19105 _ACEOF
19106
19107 # Transform confdefs.h into an awk script `defines.awk', embedded as
19108 # here-document in config.status, that substitutes the proper values into
19109 # config.h.in to produce config.h.
19110
19111 # Create a delimiter string that does not exist in confdefs.h, to ease
19112 # handling of long lines.
19113 ac_delim='%!_!# '
19114 for ac_last_try in false false :; do
19115 ac_t=`sed -n "/$ac_delim/p" confdefs.h`
19116 if test -z "$ac_t"; then
19117 break
19118 elif $ac_last_try; then
19119 { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
19120 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
19121 { (exit 1); exit 1; }; }
19122 else
19123 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
19124 fi
19125 done
19126
19127 # For the awk script, D is an array of macro values keyed by name,
19128 # likewise P contains macro parameters if any. Preserve backslash
19129 # newline sequences.
19130
19131 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
19132 sed -n '
19133 s/.\{148\}/&'"$ac_delim"'/g
19134 t rset
19135 :rset
19136 s/^[ ]*#[ ]*define[ ][ ]*/ /
19137 t def
19138 d
19139 :def
19140 s/\\$//
19141 t bsnl
19142 s/["\\]/\\&/g
19143 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
19144 D["\1"]=" \3"/p
19145 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
19146 d
19147 :bsnl
19148 s/["\\]/\\&/g
19149 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
19150 D["\1"]=" \3\\\\\\n"\\/p
19151 t cont
19152 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
19153 t cont
19154 d
19155 :cont
19156 n
19157 s/.\{148\}/&'"$ac_delim"'/g
19158 t clear
19159 :clear
19160 s/\\$//
19161 t bsnlc
19162 s/["\\]/\\&/g; s/^/"/; s/$/"/p
19163 d
19164 :bsnlc
19165 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
19166 b cont
19167 ' <confdefs.h | sed '
19168 s/'"$ac_delim"'/"\\\
19169 "/g' >>$CONFIG_STATUS || ac_write_fail=1
19170
19171 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19172 for (key in D) D_is_set[key] = 1
19173 FS = ""
19174 }
19175 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
19176 line = \$ 0
19177 split(line, arg, " ")
19178 if (arg[1] == "#") {
19179 defundef = arg[2]
19180 mac1 = arg[3]
19181 } else {
19182 defundef = substr(arg[1], 2)
19183 mac1 = arg[2]
19184 }
19185 split(mac1, mac2, "(") #)
19186 macro = mac2[1]
19187 prefix = substr(line, 1, index(line, defundef) - 1)
19188 if (D_is_set[macro]) {
19189 # Preserve the white space surrounding the "#".
19190 print prefix "define", macro P[macro] D[macro]
19191 next
19192 } else {
19193 # Replace #undef with comments. This is necessary, for example,
19194 # in the case of _POSIX_SOURCE, which is predefined and required
19195 # on some systems where configure will not decide to define it.
19196 if (defundef == "undef") {
19197 print "/*", prefix defundef, macro, "*/"
19198 next
19199 }
19200 }
19201 }
19202 { print }
19203 _ACAWK
19204 _ACEOF
19205 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19206 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
19207 $as_echo "$as_me: error: could not setup config headers machinery" >&2;}
19208 { (exit 1); exit 1; }; }
19209 fi # test -n "$CONFIG_HEADERS"
19210
19211
19212 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
19213 shift
19214 for ac_tag
19215 do
19216 case $ac_tag in
19217 :[FHLC]) ac_mode=$ac_tag; continue;;
19218 esac
19219 case $ac_mode$ac_tag in
19220 :[FHL]*:*);;
19221 :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
19222 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
19223 { (exit 1); exit 1; }; };;
19224 :[FH]-) ac_tag=-:-;;
19225 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
19226 esac
19227 ac_save_IFS=$IFS
19228 IFS=:
19229 set x $ac_tag
19230 IFS=$ac_save_IFS
19231 shift
19232 ac_file=$1
19233 shift
19234
19235 case $ac_mode in
19236 :L) ac_source=$1;;
19237 :[FH])
19238 ac_file_inputs=
19239 for ac_f
19240 do
19241 case $ac_f in
19242 -) ac_f="$tmp/stdin";;
19243 *) # Look for the file first in the build tree, then in the source tree
19244 # (if the path is not absolute). The absolute path cannot be DOS-style,
19245 # because $ac_f cannot contain `:'.
19246 test -f "$ac_f" ||
19247 case $ac_f in
19248 [\\/$]*) false;;
19249 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
19250 esac ||
19251 { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
19252 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
19253 { (exit 1); exit 1; }; };;
19254 esac
19255 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
19256 ac_file_inputs="$ac_file_inputs '$ac_f'"
19257 done
19258
19259 # Let's still pretend it is `configure' which instantiates (i.e., don't
19260 # use $as_me), people would be surprised to read:
19261 # /* config.h. Generated by config.status. */
19262 configure_input='Generated from '`
19263 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
19264 `' by configure.'
19265 if test x"$ac_file" != x-; then
19266 configure_input="$ac_file. $configure_input"
19267 { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
19268 $as_echo "$as_me: creating $ac_file" >&6;}
19269 fi
19270 # Neutralize special characters interpreted by sed in replacement strings.
19271 case $configure_input in #(
19272 *\&* | *\|* | *\\* )
19273 ac_sed_conf_input=`$as_echo "$configure_input" |
19274 sed 's/[\\\\&|]/\\\\&/g'`;; #(
19275 *) ac_sed_conf_input=$configure_input;;
19276 esac
19277
19278 case $ac_tag in
19279 *:-:* | *:-) cat >"$tmp/stdin" \
19280 || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
19281 $as_echo "$as_me: error: could not create $ac_file" >&2;}
19282 { (exit 1); exit 1; }; } ;;
19283 esac
19284 ;;
19285 esac
19286
19287 ac_dir=`$as_dirname -- "$ac_file" ||
19288 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19289 X"$ac_file" : 'X\(//\)[^/]' \| \
19290 X"$ac_file" : 'X\(//\)$' \| \
19291 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
19292 $as_echo X"$ac_file" |
19293 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19294 s//\1/
19295 q
19296 }
19297 /^X\(\/\/\)[^/].*/{
19298 s//\1/
19299 q
19300 }
19301 /^X\(\/\/\)$/{
19302 s//\1/
19303 q
19304 }
19305 /^X\(\/\).*/{
19306 s//\1/
19307 q
19308 }
19309 s/.*/./; q'`
19310 { as_dir="$ac_dir"
19311 case $as_dir in #(
19312 -*) as_dir=./$as_dir;;
19313 esac
19314 test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
19315 as_dirs=
19316 while :; do
19317 case $as_dir in #(
19318 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
19319 *) as_qdir=$as_dir;;
19320 esac
19321 as_dirs="'$as_qdir' $as_dirs"
19322 as_dir=`$as_dirname -- "$as_dir" ||
19323 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19324 X"$as_dir" : 'X\(//\)[^/]' \| \
19325 X"$as_dir" : 'X\(//\)$' \| \
19326 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
19327 $as_echo X"$as_dir" |
19328 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19329 s//\1/
19330 q
19331 }
19332 /^X\(\/\/\)[^/].*/{
19333 s//\1/
19334 q
19335 }
19336 /^X\(\/\/\)$/{
19337 s//\1/
19338 q
19339 }
19340 /^X\(\/\).*/{
19341 s//\1/
19342 q
19343 }
19344 s/.*/./; q'`
19345 test -d "$as_dir" && break
19346 done
19347 test -z "$as_dirs" || eval "mkdir $as_dirs"
19348 } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
19349 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
19350 { (exit 1); exit 1; }; }; }
19351 ac_builddir=.
19352
19353 case "$ac_dir" in
19354 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
19355 *)
19356 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
19357 # A ".." for each directory in $ac_dir_suffix.
19358 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
19359 case $ac_top_builddir_sub in
19360 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
19361 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
19362 esac ;;
19363 esac
19364 ac_abs_top_builddir=$ac_pwd
19365 ac_abs_builddir=$ac_pwd$ac_dir_suffix
19366 # for backward compatibility:
19367 ac_top_builddir=$ac_top_build_prefix
19368
19369 case $srcdir in
19370 .) # We are building in place.
19371 ac_srcdir=.
19372 ac_top_srcdir=$ac_top_builddir_sub
19373 ac_abs_top_srcdir=$ac_pwd ;;
19374 [\\/]* | ?:[\\/]* ) # Absolute name.
19375 ac_srcdir=$srcdir$ac_dir_suffix;
19376 ac_top_srcdir=$srcdir
19377 ac_abs_top_srcdir=$srcdir ;;
19378 *) # Relative name.
19379 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
19380 ac_top_srcdir=$ac_top_build_prefix$srcdir
19381 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
19382 esac
19383 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
19384
19385
19386 case $ac_mode in
19387 :F)
19388 #
19389 # CONFIG_FILE
19390 #
19391
19392 case $INSTALL in
19393 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19394 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
19395 esac
19396 ac_MKDIR_P=$MKDIR_P
19397 case $MKDIR_P in
19398 [\\/$]* | ?:[\\/]* ) ;;
19399 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
19400 esac
19401 _ACEOF
19402
19403 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19404 # If the template does not know about datarootdir, expand it.
19405 # FIXME: This hack should be removed a few years after 2.60.
19406 ac_datarootdir_hack=; ac_datarootdir_seen=
19407
19408 ac_sed_dataroot='
19409 /datarootdir/ {
19410 p
19411 q
19412 }
19413 /@datadir@/p
19414 /@docdir@/p
19415 /@infodir@/p
19416 /@localedir@/p
19417 /@mandir@/p
19418 '
19419 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
19420 *datarootdir*) ac_datarootdir_seen=yes;;
19421 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
19422 { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
19423 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
19424 _ACEOF
19425 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19426 ac_datarootdir_hack='
19427 s&@datadir@&$datadir&g
19428 s&@docdir@&$docdir&g
19429 s&@infodir@&$infodir&g
19430 s&@localedir@&$localedir&g
19431 s&@mandir@&$mandir&g
19432 s&\\\${datarootdir}&$datarootdir&g' ;;
19433 esac
19434 _ACEOF
19435
19436 # Neutralize VPATH when `$srcdir' = `.'.
19437 # Shell code in configure.ac might set extrasub.
19438 # FIXME: do we really want to maintain this feature?
19439 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19440 ac_sed_extra="$ac_vpsub
19441 $extrasub
19442 _ACEOF
19443 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19444 :t
19445 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19446 s|@configure_input@|$ac_sed_conf_input|;t t
19447 s&@top_builddir@&$ac_top_builddir_sub&;t t
19448 s&@top_build_prefix@&$ac_top_build_prefix&;t t
19449 s&@srcdir@&$ac_srcdir&;t t
19450 s&@abs_srcdir@&$ac_abs_srcdir&;t t
19451 s&@top_srcdir@&$ac_top_srcdir&;t t
19452 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
19453 s&@builddir@&$ac_builddir&;t t
19454 s&@abs_builddir@&$ac_abs_builddir&;t t
19455 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
19456 s&@INSTALL@&$ac_INSTALL&;t t
19457 s&@MKDIR_P@&$ac_MKDIR_P&;t t
19458 $ac_datarootdir_hack
19459 "
19460 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
19461 || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
19462 $as_echo "$as_me: error: could not create $ac_file" >&2;}
19463 { (exit 1); exit 1; }; }
19464
19465 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
19466 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
19467 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
19468 { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19469 which seems to be undefined. Please make sure it is defined." >&5
19470 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19471 which seems to be undefined. Please make sure it is defined." >&2;}
19472
19473 rm -f "$tmp/stdin"
19474 case $ac_file in
19475 -) cat "$tmp/out" && rm -f "$tmp/out";;
19476 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
19477 esac \
19478 || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
19479 $as_echo "$as_me: error: could not create $ac_file" >&2;}
19480 { (exit 1); exit 1; }; }
19481 ;;
19482 :H)
19483 #
19484 # CONFIG_HEADER
19485 #
19486 if test x"$ac_file" != x-; then
19487 {
19488 $as_echo "/* $configure_input */" \
19489 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
19490 } >"$tmp/config.h" \
19491 || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
19492 $as_echo "$as_me: error: could not create $ac_file" >&2;}
19493 { (exit 1); exit 1; }; }
19494 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
19495 { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
19496 $as_echo "$as_me: $ac_file is unchanged" >&6;}
19497 else
19498 rm -f "$ac_file"
19499 mv "$tmp/config.h" "$ac_file" \
19500 || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
19501 $as_echo "$as_me: error: could not create $ac_file" >&2;}
19502 { (exit 1); exit 1; }; }
19503 fi
19504 else
19505 $as_echo "/* $configure_input */" \
19506 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
19507 || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
19508 $as_echo "$as_me: error: could not create -" >&2;}
19509 { (exit 1); exit 1; }; }
19510 fi
19511 # Compute "$ac_file"'s index in $config_headers.
19512 _am_arg="$ac_file"
19513 _am_stamp_count=1
19514 for _am_header in $config_headers :; do
19515 case $_am_header in
19516 $_am_arg | $_am_arg:* )
19517 break ;;
19518 * )
19519 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
19520 esac
19521 done
19522 echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
19523 $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19524 X"$_am_arg" : 'X\(//\)[^/]' \| \
19525 X"$_am_arg" : 'X\(//\)$' \| \
19526 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
19527 $as_echo X"$_am_arg" |
19528 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19529 s//\1/
19530 q
19531 }
19532 /^X\(\/\/\)[^/].*/{
19533 s//\1/
19534 q
19535 }
19536 /^X\(\/\/\)$/{
19537 s//\1/
19538 q
19539 }
19540 /^X\(\/\).*/{
19541 s//\1/
19542 q
19543 }
19544 s/.*/./; q'`/stamp-h$_am_stamp_count
19545 ;;
19546
19547 :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
19548 $as_echo "$as_me: executing $ac_file commands" >&6;}
19549 ;;
19550 esac
19551
19552
19553 case $ac_file$ac_mode in
19554 "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
19555 # are listed without --file. Let's play safe and only enable the eval
19556 # if we detect the quoting.
19557 case $CONFIG_FILES in
19558 *\'*) eval set x "$CONFIG_FILES" ;;
19559 *) set x $CONFIG_FILES ;;
19560 esac
19561 shift
19562 for mf
19563 do
19564 # Strip MF so we end up with the name of the file.
19565 mf=`echo "$mf" | sed -e 's/:.*$//'`
19566 # Check whether this is an Automake generated Makefile or not.
19567 # We used to match only the files named `Makefile.in', but
19568 # some people rename them; so instead we look at the file content.
19569 # Grep'ing the first line is not enough: some people post-process
19570 # each Makefile.in and add a new line on top of each file to say so.
19571 # Grep'ing the whole file is not good either: AIX grep has a line
19572 # limit of 2048, but all sed's we know have understand at least 4000.
19573 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
19574 dirpart=`$as_dirname -- "$mf" ||
19575 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19576 X"$mf" : 'X\(//\)[^/]' \| \
19577 X"$mf" : 'X\(//\)$' \| \
19578 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
19579 $as_echo X"$mf" |
19580 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19581 s//\1/
19582 q
19583 }
19584 /^X\(\/\/\)[^/].*/{
19585 s//\1/
19586 q
19587 }
19588 /^X\(\/\/\)$/{
19589 s//\1/
19590 q
19591 }
19592 /^X\(\/\).*/{
19593 s//\1/
19594 q
19595 }
19596 s/.*/./; q'`
19597 else
19598 continue
19599 fi
19600 # Extract the definition of DEPDIR, am__include, and am__quote
19601 # from the Makefile without running `make'.
19602 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
19603 test -z "$DEPDIR" && continue
19604 am__include=`sed -n 's/^am__include = //p' < "$mf"`
19605 test -z "am__include" && continue
19606 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
19607 # When using ansi2knr, U may be empty or an underscore; expand it
19608 U=`sed -n 's/^U = //p' < "$mf"`
19609 # Find all dependency output files, they are included files with
19610 # $(DEPDIR) in their names. We invoke sed twice because it is the
19611 # simplest approach to changing $(DEPDIR) to its actual value in the
19612 # expansion.
19613 for file in `sed -n "
19614 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
19615 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
19616 # Make sure the directory exists.
19617 test -f "$dirpart/$file" && continue
19618 fdir=`$as_dirname -- "$file" ||
19619 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19620 X"$file" : 'X\(//\)[^/]' \| \
19621 X"$file" : 'X\(//\)$' \| \
19622 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
19623 $as_echo X"$file" |
19624 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19625 s//\1/
19626 q
19627 }
19628 /^X\(\/\/\)[^/].*/{
19629 s//\1/
19630 q
19631 }
19632 /^X\(\/\/\)$/{
19633 s//\1/
19634 q
19635 }
19636 /^X\(\/\).*/{
19637 s//\1/
19638 q
19639 }
19640 s/.*/./; q'`
19641 { as_dir=$dirpart/$fdir
19642 case $as_dir in #(
19643 -*) as_dir=./$as_dir;;
19644 esac
19645 test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
19646 as_dirs=
19647 while :; do
19648 case $as_dir in #(
19649 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
19650 *) as_qdir=$as_dir;;
19651 esac
19652 as_dirs="'$as_qdir' $as_dirs"
19653 as_dir=`$as_dirname -- "$as_dir" ||
19654 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19655 X"$as_dir" : 'X\(//\)[^/]' \| \
19656 X"$as_dir" : 'X\(//\)$' \| \
19657 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
19658 $as_echo X"$as_dir" |
19659 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19660 s//\1/
19661 q
19662 }
19663 /^X\(\/\/\)[^/].*/{
19664 s//\1/
19665 q
19666 }
19667 /^X\(\/\/\)$/{
19668 s//\1/
19669 q
19670 }
19671 /^X\(\/\).*/{
19672 s//\1/
19673 q
19674 }
19675 s/.*/./; q'`
19676 test -d "$as_dir" && break
19677 done
19678 test -z "$as_dirs" || eval "mkdir $as_dirs"
19679 } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
19680 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
19681 { (exit 1); exit 1; }; }; }
19682 # echo "creating $dirpart/$file"
19683 echo '# dummy' > "$dirpart/$file"
19684 done
19685 done
19686 ;;
19687 "libtool":C)
19688
19689 # See if we are running on zsh, and set the options which allow our
19690 # commands through without removal of \ escapes.
19691 if test -n "${ZSH_VERSION+set}" ; then
19692 setopt NO_GLOB_SUBST
19693 fi
19694
19695 cfgfile="${ofile}T"
19696 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
19697 $RM "$cfgfile"
19698
19699 cat <<_LT_EOF >> "$cfgfile"
19700 #! $SHELL
19701
19702 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
19703 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
19704 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
19705 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
19706 #
19707 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
19708 # 2006, 2007, 2008 Free Software Foundation, Inc.
19709 # Written by Gordon Matzigkeit, 1996
19710 #
19711 # This file is part of GNU Libtool.
19712 #
19713 # GNU Libtool is free software; you can redistribute it and/or
19714 # modify it under the terms of the GNU General Public License as
19715 # published by the Free Software Foundation; either version 2 of
19716 # the License, or (at your option) any later version.
19717 #
19718 # As a special exception to the GNU General Public License,
19719 # if you distribute this file as part of a program or library that
19720 # is built using GNU Libtool, you may include this file under the
19721 # same distribution terms that you use for the rest of that program.
19722 #
19723 # GNU Libtool is distributed in the hope that it will be useful,
19724 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19725 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19726 # GNU General Public License for more details.
19727 #
19728 # You should have received a copy of the GNU General Public License
19729 # along with GNU Libtool; see the file COPYING. If not, a copy
19730 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
19731 # obtained by writing to the Free Software Foundation, Inc.,
19732 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19733
19734
19735 # The names of the tagged configurations supported by this script.
19736 available_tags="CXX "
19737
19738 # ### BEGIN LIBTOOL CONFIG
19739
19740 # Which release of libtool.m4 was used?
19741 macro_version=$macro_version
19742 macro_revision=$macro_revision
19743
19744 # Whether or not to build shared libraries.
19745 build_libtool_libs=$enable_shared
19746
19747 # Whether or not to build static libraries.
19748 build_old_libs=$enable_static
19749
19750 # What type of objects to build.
19751 pic_mode=$pic_mode
19752
19753 # Whether or not to optimize for fast installation.
19754 fast_install=$enable_fast_install
19755
19756 # The host system.
19757 host_alias=$host_alias
19758 host=$host
19759 host_os=$host_os
19760
19761 # The build system.
19762 build_alias=$build_alias
19763 build=$build
19764 build_os=$build_os
19765
19766 # A sed program that does not truncate output.
19767 SED=$lt_SED
19768
19769 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
19770 Xsed="\$SED -e 1s/^X//"
19771
19772 # A grep program that handles long lines.
19773 GREP=$lt_GREP
19774
19775 # An ERE matcher.
19776 EGREP=$lt_EGREP
19777
19778 # A literal string matcher.
19779 FGREP=$lt_FGREP
19780
19781 # A BSD- or MS-compatible name lister.
19782 NM=$lt_NM
19783
19784 # Whether we need soft or hard links.
19785 LN_S=$lt_LN_S
19786
19787 # What is the maximum length of a command?
19788 max_cmd_len=$max_cmd_len
19789
19790 # Object file suffix (normally "o").
19791 objext=$ac_objext
19792
19793 # Executable file suffix (normally "").
19794 exeext=$exeext
19795
19796 # whether the shell understands "unset".
19797 lt_unset=$lt_unset
19798
19799 # turn spaces into newlines.
19800 SP2NL=$lt_lt_SP2NL
19801
19802 # turn newlines into spaces.
19803 NL2SP=$lt_lt_NL2SP
19804
19805 # How to create reloadable object files.
19806 reload_flag=$lt_reload_flag
19807 reload_cmds=$lt_reload_cmds
19808
19809 # An object symbol dumper.
19810 OBJDUMP=$lt_OBJDUMP
19811
19812 # Method to check whether dependent libraries are shared objects.
19813 deplibs_check_method=$lt_deplibs_check_method
19814
19815 # Command to use when deplibs_check_method == "file_magic".
19816 file_magic_cmd=$lt_file_magic_cmd
19817
19818 # The archiver.
19819 AR=$lt_AR
19820 AR_FLAGS=$lt_AR_FLAGS
19821
19822 # A symbol stripping program.
19823 STRIP=$lt_STRIP
19824
19825 # Commands used to install an old-style archive.
19826 RANLIB=$lt_RANLIB
19827 old_postinstall_cmds=$lt_old_postinstall_cmds
19828 old_postuninstall_cmds=$lt_old_postuninstall_cmds
19829
19830 # A C compiler.
19831 LTCC=$lt_CC
19832
19833 # LTCC compiler flags.
19834 LTCFLAGS=$lt_CFLAGS
19835
19836 # Take the output of nm and produce a listing of raw symbols and C names.
19837 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
19838
19839 # Transform the output of nm in a proper C declaration.
19840 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
19841
19842 # Transform the output of nm in a C name address pair.
19843 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
19844
19845 # Transform the output of nm in a C name address pair when lib prefix is needed.
19846 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
19847
19848 # The name of the directory that contains temporary libtool files.
19849 objdir=$objdir
19850
19851 # Shell to use when invoking shell scripts.
19852 SHELL=$lt_SHELL
19853
19854 # An echo program that does not interpret backslashes.
19855 ECHO=$lt_ECHO
19856
19857 # Used to examine libraries when file_magic_cmd begins with "file".
19858 MAGIC_CMD=$MAGIC_CMD
19859
19860 # Must we lock files when doing compilation?
19861 need_locks=$lt_need_locks
19862
19863 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
19864 DSYMUTIL=$lt_DSYMUTIL
19865
19866 # Tool to change global to local symbols on Mac OS X.
19867 NMEDIT=$lt_NMEDIT
19868
19869 # Tool to manipulate fat objects and archives on Mac OS X.
19870 LIPO=$lt_LIPO
19871
19872 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
19873 OTOOL=$lt_OTOOL
19874
19875 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
19876 OTOOL64=$lt_OTOOL64
19877
19878 # Old archive suffix (normally "a").
19879 libext=$libext
19880
19881 # Shared library suffix (normally ".so").
19882 shrext_cmds=$lt_shrext_cmds
19883
19884 # The commands to extract the exported symbol list from a shared archive.
19885 extract_expsyms_cmds=$lt_extract_expsyms_cmds
19886
19887 # Variables whose values should be saved in libtool wrapper scripts and
19888 # restored at link time.
19889 variables_saved_for_relink=$lt_variables_saved_for_relink
19890
19891 # Do we need the "lib" prefix for modules?
19892 need_lib_prefix=$need_lib_prefix
19893
19894 # Do we need a version for libraries?
19895 need_version=$need_version
19896
19897 # Library versioning type.
19898 version_type=$version_type
19899
19900 # Shared library runtime path variable.
19901 runpath_var=$runpath_var
19902
19903 # Shared library path variable.
19904 shlibpath_var=$shlibpath_var
19905
19906 # Is shlibpath searched before the hard-coded library search path?
19907 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
19908
19909 # Format of library name prefix.
19910 libname_spec=$lt_libname_spec
19911
19912 # List of archive names. First name is the real one, the rest are links.
19913 # The last name is the one that the linker finds with -lNAME
19914 library_names_spec=$lt_library_names_spec
19915
19916 # The coded name of the library, if different from the real name.
19917 soname_spec=$lt_soname_spec
19918
19919 # Command to use after installation of a shared archive.
19920 postinstall_cmds=$lt_postinstall_cmds
19921
19922 # Command to use after uninstallation of a shared archive.
19923 postuninstall_cmds=$lt_postuninstall_cmds
19924
19925 # Commands used to finish a libtool library installation in a directory.
19926 finish_cmds=$lt_finish_cmds
19927
19928 # As "finish_cmds", except a single script fragment to be evaled but
19929 # not shown.
19930 finish_eval=$lt_finish_eval
19931
19932 # Whether we should hardcode library paths into libraries.
19933 hardcode_into_libs=$hardcode_into_libs
19934
19935 # Compile-time system search path for libraries.
19936 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
19937
19938 # Run-time system search path for libraries.
19939 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
19940
19941 # Whether dlopen is supported.
19942 dlopen_support=$enable_dlopen
19943
19944 # Whether dlopen of programs is supported.
19945 dlopen_self=$enable_dlopen_self
19946
19947 # Whether dlopen of statically linked programs is supported.
19948 dlopen_self_static=$enable_dlopen_self_static
19949
19950 # Commands to strip libraries.
19951 old_striplib=$lt_old_striplib
19952 striplib=$lt_striplib
19953
19954
19955 # The linker used to build libraries.
19956 LD=$lt_LD
19957
19958 # Commands used to build an old-style archive.
19959 old_archive_cmds=$lt_old_archive_cmds
19960
19961 # A language specific compiler.
19962 CC=$lt_compiler
19963
19964 # Is the compiler the GNU compiler?
19965 with_gcc=$GCC
19966
19967 # Compiler flag to turn off builtin functions.
19968 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
19969
19970 # How to pass a linker flag through the compiler.
19971 wl=$lt_lt_prog_compiler_wl
19972
19973 # Additional compiler flags for building library objects.
19974 pic_flag=$lt_lt_prog_compiler_pic
19975
19976 # Compiler flag to prevent dynamic linking.
19977 link_static_flag=$lt_lt_prog_compiler_static
19978
19979 # Does compiler simultaneously support -c and -o options?
19980 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
19981
19982 # Whether or not to add -lc for building shared libraries.
19983 build_libtool_need_lc=$archive_cmds_need_lc
19984
19985 # Whether or not to disallow shared libs when runtime libs are static.
19986 allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
19987
19988 # Compiler flag to allow reflexive dlopens.
19989 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
19990
19991 # Compiler flag to generate shared objects directly from archives.
19992 whole_archive_flag_spec=$lt_whole_archive_flag_spec
19993
19994 # Whether the compiler copes with passing no objects directly.
19995 compiler_needs_object=$lt_compiler_needs_object
19996
19997 # Create an old-style archive from a shared archive.
19998 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
19999
20000 # Create a temporary old-style archive to link instead of a shared archive.
20001 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
20002
20003 # Commands used to build a shared archive.
20004 archive_cmds=$lt_archive_cmds
20005 archive_expsym_cmds=$lt_archive_expsym_cmds
20006
20007 # Commands used to build a loadable module if different from building
20008 # a shared archive.
20009 module_cmds=$lt_module_cmds
20010 module_expsym_cmds=$lt_module_expsym_cmds
20011
20012 # Whether we are building with GNU ld or not.
20013 with_gnu_ld=$lt_with_gnu_ld
20014
20015 # Flag that allows shared libraries with undefined symbols to be built.
20016 allow_undefined_flag=$lt_allow_undefined_flag
20017
20018 # Flag that enforces no undefined symbols.
20019 no_undefined_flag=$lt_no_undefined_flag
20020
20021 # Flag to hardcode \$libdir into a binary during linking.
20022 # This must work even if \$libdir does not exist
20023 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
20024
20025 # If ld is used when linking, flag to hardcode \$libdir into a binary
20026 # during linking. This must work even if \$libdir does not exist.
20027 hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
20028
20029 # Whether we need a single "-rpath" flag with a separated argument.
20030 hardcode_libdir_separator=$lt_hardcode_libdir_separator
20031
20032 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
20033 # DIR into the resulting binary.
20034 hardcode_direct=$hardcode_direct
20035
20036 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
20037 # DIR into the resulting binary and the resulting library dependency is
20038 # "absolute",i.e impossible to change by setting \${shlibpath_var} if the
20039 # library is relocated.
20040 hardcode_direct_absolute=$hardcode_direct_absolute
20041
20042 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
20043 # into the resulting binary.
20044 hardcode_minus_L=$hardcode_minus_L
20045
20046 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
20047 # into the resulting binary.
20048 hardcode_shlibpath_var=$hardcode_shlibpath_var
20049
20050 # Set to "yes" if building a shared library automatically hardcodes DIR
20051 # into the library and all subsequent libraries and executables linked
20052 # against it.
20053 hardcode_automatic=$hardcode_automatic
20054
20055 # Set to yes if linker adds runtime paths of dependent libraries
20056 # to runtime path list.
20057 inherit_rpath=$inherit_rpath
20058
20059 # Whether libtool must link a program against all its dependency libraries.
20060 link_all_deplibs=$link_all_deplibs
20061
20062 # Fix the shell variable \$srcfile for the compiler.
20063 fix_srcfile_path=$lt_fix_srcfile_path
20064
20065 # Set to "yes" if exported symbols are required.
20066 always_export_symbols=$always_export_symbols
20067
20068 # The commands to list exported symbols.
20069 export_symbols_cmds=$lt_export_symbols_cmds
20070
20071 # Symbols that should not be listed in the preloaded symbols.
20072 exclude_expsyms=$lt_exclude_expsyms
20073
20074 # Symbols that must always be exported.
20075 include_expsyms=$lt_include_expsyms
20076
20077 # Commands necessary for linking programs (against libraries) with templates.
20078 prelink_cmds=$lt_prelink_cmds
20079
20080 # Specify filename containing input files.
20081 file_list_spec=$lt_file_list_spec
20082
20083 # How to hardcode a shared library path into an executable.
20084 hardcode_action=$hardcode_action
20085
20086 # The directories searched by this compiler when creating a shared library.
20087 compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
20088
20089 # Dependencies to place before and after the objects being linked to
20090 # create a shared library.
20091 predep_objects=$lt_predep_objects
20092 postdep_objects=$lt_postdep_objects
20093 predeps=$lt_predeps
20094 postdeps=$lt_postdeps
20095
20096 # The library search path used internally by the compiler when linking
20097 # a shared library.
20098 compiler_lib_search_path=$lt_compiler_lib_search_path
20099
20100 # ### END LIBTOOL CONFIG
20101
20102 _LT_EOF
20103
20104 case $host_os in
20105 aix3*)
20106 cat <<\_LT_EOF >> "$cfgfile"
20107 # AIX sometimes has problems with the GCC collect2 program. For some
20108 # reason, if we set the COLLECT_NAMES environment variable, the problems
20109 # vanish in a puff of smoke.
20110 if test "X${COLLECT_NAMES+set}" != Xset; then
20111 COLLECT_NAMES=
20112 export COLLECT_NAMES
20113 fi
20114 _LT_EOF
20115 ;;
20116 esac
20117
20118
20119 ltmain="$ac_aux_dir/ltmain.sh"
20120
20121
20122 # We use sed instead of cat because bash on DJGPP gets confused if
20123 # if finds mixed CR/LF and LF-only lines. Since sed operates in
20124 # text mode, it properly converts lines to CR/LF. This bash problem
20125 # is reportedly fixed, but why not run on old versions too?
20126 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
20127 || (rm -f "$cfgfile"; exit 1)
20128
20129 case $xsi_shell in
20130 yes)
20131 cat << \_LT_EOF >> "$cfgfile"
20132
20133 # func_dirname file append nondir_replacement
20134 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
20135 # otherwise set result to NONDIR_REPLACEMENT.
20136 func_dirname ()
20137 {
20138 case ${1} in
20139 */*) func_dirname_result="${1%/*}${2}" ;;
20140 * ) func_dirname_result="${3}" ;;
20141 esac
20142 }
20143
20144 # func_basename file
20145 func_basename ()
20146 {
20147 func_basename_result="${1##*/}"
20148 }
20149
20150 # func_dirname_and_basename file append nondir_replacement
20151 # perform func_basename and func_dirname in a single function
20152 # call:
20153 # dirname: Compute the dirname of FILE. If nonempty,
20154 # add APPEND to the result, otherwise set result
20155 # to NONDIR_REPLACEMENT.
20156 # value returned in "$func_dirname_result"
20157 # basename: Compute filename of FILE.
20158 # value retuned in "$func_basename_result"
20159 # Implementation must be kept synchronized with func_dirname
20160 # and func_basename. For efficiency, we do not delegate to
20161 # those functions but instead duplicate the functionality here.
20162 func_dirname_and_basename ()
20163 {
20164 case ${1} in
20165 */*) func_dirname_result="${1%/*}${2}" ;;
20166 * ) func_dirname_result="${3}" ;;
20167 esac
20168 func_basename_result="${1##*/}"
20169 }
20170
20171 # func_stripname prefix suffix name
20172 # strip PREFIX and SUFFIX off of NAME.
20173 # PREFIX and SUFFIX must not contain globbing or regex special
20174 # characters, hashes, percent signs, but SUFFIX may contain a leading
20175 # dot (in which case that matches only a dot).
20176 func_stripname ()
20177 {
20178 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
20179 # positional parameters, so assign one to ordinary parameter first.
20180 func_stripname_result=${3}
20181 func_stripname_result=${func_stripname_result#"${1}"}
20182 func_stripname_result=${func_stripname_result%"${2}"}
20183 }
20184
20185 # func_opt_split
20186 func_opt_split ()
20187 {
20188 func_opt_split_opt=${1%%=*}
20189 func_opt_split_arg=${1#*=}
20190 }
20191
20192 # func_lo2o object
20193 func_lo2o ()
20194 {
20195 case ${1} in
20196 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
20197 *) func_lo2o_result=${1} ;;
20198 esac
20199 }
20200
20201 # func_xform libobj-or-source
20202 func_xform ()
20203 {
20204 func_xform_result=${1%.*}.lo
20205 }
20206
20207 # func_arith arithmetic-term...
20208 func_arith ()
20209 {
20210 func_arith_result=$(( $* ))
20211 }
20212
20213 # func_len string
20214 # STRING may not start with a hyphen.
20215 func_len ()
20216 {
20217 func_len_result=${#1}
20218 }
20219
20220 _LT_EOF
20221 ;;
20222 *) # Bourne compatible functions.
20223 cat << \_LT_EOF >> "$cfgfile"
20224
20225 # func_dirname file append nondir_replacement
20226 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
20227 # otherwise set result to NONDIR_REPLACEMENT.
20228 func_dirname ()
20229 {
20230 # Extract subdirectory from the argument.
20231 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
20232 if test "X$func_dirname_result" = "X${1}"; then
20233 func_dirname_result="${3}"
20234 else
20235 func_dirname_result="$func_dirname_result${2}"
20236 fi
20237 }
20238
20239 # func_basename file
20240 func_basename ()
20241 {
20242 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
20243 }
20244
20245
20246 # func_stripname prefix suffix name
20247 # strip PREFIX and SUFFIX off of NAME.
20248 # PREFIX and SUFFIX must not contain globbing or regex special
20249 # characters, hashes, percent signs, but SUFFIX may contain a leading
20250 # dot (in which case that matches only a dot).
20251 # func_strip_suffix prefix name
20252 func_stripname ()
20253 {
20254 case ${2} in
20255 .*) func_stripname_result=`$ECHO "X${3}" \
20256 | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
20257 *) func_stripname_result=`$ECHO "X${3}" \
20258 | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
20259 esac
20260 }
20261
20262 # sed scripts:
20263 my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
20264 my_sed_long_arg='1s/^-[^=]*=//'
20265
20266 # func_opt_split
20267 func_opt_split ()
20268 {
20269 func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
20270 func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
20271 }
20272
20273 # func_lo2o object
20274 func_lo2o ()
20275 {
20276 func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
20277 }
20278
20279 # func_xform libobj-or-source
20280 func_xform ()
20281 {
20282 func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
20283 }
20284
20285 # func_arith arithmetic-term...
20286 func_arith ()
20287 {
20288 func_arith_result=`expr "$@"`
20289 }
20290
20291 # func_len string
20292 # STRING may not start with a hyphen.
20293 func_len ()
20294 {
20295 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
20296 }
20297
20298 _LT_EOF
20299 esac
20300
20301 case $lt_shell_append in
20302 yes)
20303 cat << \_LT_EOF >> "$cfgfile"
20304
20305 # func_append var value
20306 # Append VALUE to the end of shell variable VAR.
20307 func_append ()
20308 {
20309 eval "$1+=\$2"
20310 }
20311 _LT_EOF
20312 ;;
20313 *)
20314 cat << \_LT_EOF >> "$cfgfile"
20315
20316 # func_append var value
20317 # Append VALUE to the end of shell variable VAR.
20318 func_append ()
20319 {
20320 eval "$1=\$$1\$2"
20321 }
20322
20323 _LT_EOF
20324 ;;
20325 esac
20326
20327
20328 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
20329 || (rm -f "$cfgfile"; exit 1)
20330
20331 mv -f "$cfgfile" "$ofile" ||
20332 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
20333 chmod +x "$ofile"
20334
20335
20336 cat <<_LT_EOF >> "$ofile"
20337
20338 # ### BEGIN LIBTOOL TAG CONFIG: CXX
20339
20340 # The linker used to build libraries.
20341 LD=$lt_LD_CXX
20342
20343 # Commands used to build an old-style archive.
20344 old_archive_cmds=$lt_old_archive_cmds_CXX
20345
20346 # A language specific compiler.
20347 CC=$lt_compiler_CXX
20348
20349 # Is the compiler the GNU compiler?
20350 with_gcc=$GCC_CXX
20351
20352 # Compiler flag to turn off builtin functions.
20353 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
20354
20355 # How to pass a linker flag through the compiler.
20356 wl=$lt_lt_prog_compiler_wl_CXX
20357
20358 # Additional compiler flags for building library objects.
20359 pic_flag=$lt_lt_prog_compiler_pic_CXX
20360
20361 # Compiler flag to prevent dynamic linking.
20362 link_static_flag=$lt_lt_prog_compiler_static_CXX
20363
20364 # Does compiler simultaneously support -c and -o options?
20365 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
20366
20367 # Whether or not to add -lc for building shared libraries.
20368 build_libtool_need_lc=$archive_cmds_need_lc_CXX
20369
20370 # Whether or not to disallow shared libs when runtime libs are static.
20371 allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
20372
20373 # Compiler flag to allow reflexive dlopens.
20374 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
20375
20376 # Compiler flag to generate shared objects directly from archives.
20377 whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
20378
20379 # Whether the compiler copes with passing no objects directly.
20380 compiler_needs_object=$lt_compiler_needs_object_CXX
20381
20382 # Create an old-style archive from a shared archive.
20383 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
20384
20385 # Create a temporary old-style archive to link instead of a shared archive.
20386 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
20387
20388 # Commands used to build a shared archive.
20389 archive_cmds=$lt_archive_cmds_CXX
20390 archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
20391
20392 # Commands used to build a loadable module if different from building
20393 # a shared archive.
20394 module_cmds=$lt_module_cmds_CXX
20395 module_expsym_cmds=$lt_module_expsym_cmds_CXX
20396
20397 # Whether we are building with GNU ld or not.
20398 with_gnu_ld=$lt_with_gnu_ld_CXX
20399
20400 # Flag that allows shared libraries with undefined symbols to be built.
20401 allow_undefined_flag=$lt_allow_undefined_flag_CXX
20402
20403 # Flag that enforces no undefined symbols.
20404 no_undefined_flag=$lt_no_undefined_flag_CXX
20405
20406 # Flag to hardcode \$libdir into a binary during linking.
20407 # This must work even if \$libdir does not exist
20408 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
20409
20410 # If ld is used when linking, flag to hardcode \$libdir into a binary
20411 # during linking. This must work even if \$libdir does not exist.
20412 hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
20413
20414 # Whether we need a single "-rpath" flag with a separated argument.
20415 hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
20416
20417 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
20418 # DIR into the resulting binary.
20419 hardcode_direct=$hardcode_direct_CXX
20420
20421 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
20422 # DIR into the resulting binary and the resulting library dependency is
20423 # "absolute",i.e impossible to change by setting \${shlibpath_var} if the
20424 # library is relocated.
20425 hardcode_direct_absolute=$hardcode_direct_absolute_CXX
20426
20427 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
20428 # into the resulting binary.
20429 hardcode_minus_L=$hardcode_minus_L_CXX
20430
20431 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
20432 # into the resulting binary.
20433 hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
20434
20435 # Set to "yes" if building a shared library automatically hardcodes DIR
20436 # into the library and all subsequent libraries and executables linked
20437 # against it.
20438 hardcode_automatic=$hardcode_automatic_CXX
20439
20440 # Set to yes if linker adds runtime paths of dependent libraries
20441 # to runtime path list.
20442 inherit_rpath=$inherit_rpath_CXX
20443
20444 # Whether libtool must link a program against all its dependency libraries.
20445 link_all_deplibs=$link_all_deplibs_CXX
20446
20447 # Fix the shell variable \$srcfile for the compiler.
20448 fix_srcfile_path=$lt_fix_srcfile_path_CXX
20449
20450 # Set to "yes" if exported symbols are required.
20451 always_export_symbols=$always_export_symbols_CXX
20452
20453 # The commands to list exported symbols.
20454 export_symbols_cmds=$lt_export_symbols_cmds_CXX
20455
20456 # Symbols that should not be listed in the preloaded symbols.
20457 exclude_expsyms=$lt_exclude_expsyms_CXX
20458
20459 # Symbols that must always be exported.
20460 include_expsyms=$lt_include_expsyms_CXX
20461
20462 # Commands necessary for linking programs (against libraries) with templates.
20463 prelink_cmds=$lt_prelink_cmds_CXX
20464
20465 # Specify filename containing input files.
20466 file_list_spec=$lt_file_list_spec_CXX
20467
20468 # How to hardcode a shared library path into an executable.
20469 hardcode_action=$hardcode_action_CXX
20470
20471 # The directories searched by this compiler when creating a shared library.
20472 compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
20473
20474 # Dependencies to place before and after the objects being linked to
20475 # create a shared library.
20476 predep_objects=$lt_predep_objects_CXX
20477 postdep_objects=$lt_postdep_objects_CXX
20478 predeps=$lt_predeps_CXX
20479 postdeps=$lt_postdeps_CXX
20480
20481 # The library search path used internally by the compiler when linking
20482 # a shared library.
20483 compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
20484
20485 # ### END LIBTOOL TAG CONFIG: CXX
20486 _LT_EOF
20487
20488 ;;
20489
20490 esac
20491 done # for ac_tag
20492
20493
20494 { (exit 0); exit 0; }
20495 _ACEOF
20496 chmod +x $CONFIG_STATUS
20497 ac_clean_files=$ac_clean_files_save
20498
20499 test $ac_write_fail = 0 ||
20500 { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
20501 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
20502 { (exit 1); exit 1; }; }
20503
20504
20505 # configure is writing to config.log, and then calls config.status.
20506 # config.status does its own redirection, appending to config.log.
20507 # Unfortunately, on DOS this fails, as config.log is still kept open
20508 # by configure, so config.status won't be able to write to it; its
20509 # output is simply discarded. So we exec the FD to /dev/null,
20510 # effectively closing config.log, so it can be properly (re)opened and
20511 # appended to by config.status. When coming back to configure, we
20512 # need to make the FD available again.
20513 if test "$no_create" != yes; then
20514 ac_cs_success=:
20515 ac_config_status_args=
20516 test "$silent" = yes &&
20517 ac_config_status_args="$ac_config_status_args --quiet"
20518 exec 5>/dev/null
20519 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
20520 exec 5>>config.log
20521 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20522 # would make configure fail if this is the last instruction.
20523 $ac_cs_success || { (exit 1); exit 1; }
20524 fi
20525 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
20526 { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
20527 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
20528 fi
20529
20530
20531 echo "
20532 ---{ $PACKAGE_NAME $VERSION }---
20533
20534 prefix: ${prefix}
20535 sysconfdir: ${sysconfdir}
20536 localstatedir: ${localstatedir}
20537 Compiler: ${CC}
20538 CFLAGS: ${CFLAGS}
20539 "
0 # -*- Autoconf -*-
1 # Process this file with autoconf to produce a configure script.
2
3 # This file is part of libatasmart.
4 #
5 # Copyright 2008 Lennart Poettering
6 #
7 # libatasmart is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation, either version 2.1 of the
10 # License, or (at your option) any later version.
11 #
12 # libatasmart is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with libatasmart. If not, If not, see
19 # <http://www.gnu.org/licenses/>.
20
21 AC_PREREQ(2.57)
22
23 AC_INIT([libatasmart], 0.13, [mzyvongnfzneg (at) 0pointer (dot) net])
24 AC_CONFIG_SRCDIR([atasmart.c])
25 AC_CONFIG_HEADERS([config.h])
26 AC_CONFIG_MACRO_DIR(m4)
27
28 AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
29
30 AC_SUBST(PACKAGE_URL, [https://http://git.0pointer.de/?p=libatasmart.git])
31
32 AC_SUBST(LIBATASMART_VERSION_INFO, [3:3:3])
33
34 AC_CANONICAL_HOST
35
36 if type -p stow > /dev/null && test -d /usr/local/stow ; then
37 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
38 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
39 fi
40
41 #### Checks for programs. ####
42
43 # CC
44
45 AC_PROG_CC
46 AM_PROG_CC_C_O
47 AC_PROG_GCC_TRADITIONAL
48 AC_GNU_SOURCE
49
50 # C++
51
52 AC_PROG_CXX
53
54 # GCC flags
55
56 test_gcc_flag() {
57 AC_LANG_CONFTEST([int main(int argc, char*argv[]) {}])
58 $CC -c conftest.c $CFLAGS "$1" -o conftest.o > /dev/null 2> /dev/null
59 ret=$?
60 rm -f conftest.o
61 return $ret
62 }
63
64 # If using GCC specify some additional parameters
65 if test "x$GCC" = "xyes" ; then
66
67 # We use gnu99 instead of c99 because many have interpreted the standard
68 # in a way that int64_t isn't defined on non-64 bit platforms.
69 DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math"
70
71 for flag in $DESIRED_FLAGS ; do
72 AC_MSG_CHECKING([whether $CC accepts $flag])
73 if test_gcc_flag $flag ; then
74 CFLAGS="$CFLAGS $flag"
75 CXXFLAGS="$CXXFLAGS $flag"
76 AC_MSG_RESULT([yes])
77 else
78 AC_MSG_RESULT([no])
79 fi
80 done
81 fi
82
83 #### libtool stuff ####
84
85 AC_PROG_LIBTOOL
86
87 #### Checks for header files. ####
88
89 # ISO
90 AC_HEADER_STDC
91
92 # XPG4-UNIX
93 AC_CHECK_HEADERS([sys/poll.h])
94
95 # Other
96 AC_CHECK_HEADERS([sys/ioctl.h])
97 AC_CHECK_HEADERS([byteswap.h])
98
99 #### Typdefs, structures, etc. ####
100
101 AC_C_CONST
102 AC_C_BIGENDIAN
103 AC_TYPE_PID_T
104 AC_TYPE_SIZE_T
105 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
106 [Define ssize_t if it is not done by the standard libs.])])
107 AC_TYPE_OFF_T
108 AC_TYPE_SIGNAL
109 AC_TYPE_UID_T
110
111 #### Large File-Support (LFS) ####
112
113 AC_SYS_LARGEFILE
114
115 PKG_CHECK_MODULES([LIBUDEV], [libudev])
116 AC_DEFINE([LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE], 1, [I know the API is subject to change.])
117
118 ###################################
119 # Output #
120 ###################################
121
122 AC_CONFIG_FILES([
123 Makefile
124 libatasmart.pc
125 ])
126 AC_OUTPUT
127
128 echo "
129 ---{ $PACKAGE_NAME $VERSION }---
130
131 prefix: ${prefix}
132 sysconfdir: ${sysconfdir}
133 localstatedir: ${localstatedir}
134 Compiler: ${CC}
135 CFLAGS: ${CFLAGS}
136 "
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2007-03-29.01
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
6 # Foundation, Inc.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
29
30 case $1 in
31 '')
32 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
33 exit 1;
34 ;;
35 -h | --h*)
36 cat <<\EOF
37 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
38
39 Run PROGRAMS ARGS to compile a file, generating dependencies
40 as side-effects.
41
42 Environment variables:
43 depmode Dependency tracking mode.
44 source Source file read by `PROGRAMS ARGS'.
45 object Object file output by `PROGRAMS ARGS'.
46 DEPDIR directory where to store dependencies.
47 depfile Dependency file to output.
48 tmpdepfile Temporary file to use when outputing dependencies.
49 libtool Whether libtool is used (yes/no).
50
51 Report bugs to <bug-automake@gnu.org>.
52 EOF
53 exit $?
54 ;;
55 -v | --v*)
56 echo "depcomp $scriptversion"
57 exit $?
58 ;;
59 esac
60
61 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
62 echo "depcomp: Variables source, object and depmode must be set" 1>&2
63 exit 1
64 fi
65
66 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
67 depfile=${depfile-`echo "$object" |
68 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
69 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
70
71 rm -f "$tmpdepfile"
72
73 # Some modes work just like other modes, but use different flags. We
74 # parameterize here, but still list the modes in the big case below,
75 # to make depend.m4 easier to write. Note that we *cannot* use a case
76 # here, because this file can only contain one case statement.
77 if test "$depmode" = hp; then
78 # HP compiler uses -M and no extra arg.
79 gccflag=-M
80 depmode=gcc
81 fi
82
83 if test "$depmode" = dashXmstdout; then
84 # This is just like dashmstdout with a different argument.
85 dashmflag=-xM
86 depmode=dashmstdout
87 fi
88
89 case "$depmode" in
90 gcc3)
91 ## gcc 3 implements dependency tracking that does exactly what
92 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
93 ## it if -MD -MP comes after the -MF stuff. Hmm.
94 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
95 ## the command line argument order; so add the flags where they
96 ## appear in depend2.am. Note that the slowdown incurred here
97 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
98 for arg
99 do
100 case $arg in
101 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
102 *) set fnord "$@" "$arg" ;;
103 esac
104 shift # fnord
105 shift # $arg
106 done
107 "$@"
108 stat=$?
109 if test $stat -eq 0; then :
110 else
111 rm -f "$tmpdepfile"
112 exit $stat
113 fi
114 mv "$tmpdepfile" "$depfile"
115 ;;
116
117 gcc)
118 ## There are various ways to get dependency output from gcc. Here's
119 ## why we pick this rather obscure method:
120 ## - Don't want to use -MD because we'd like the dependencies to end
121 ## up in a subdir. Having to rename by hand is ugly.
122 ## (We might end up doing this anyway to support other compilers.)
123 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
124 ## -MM, not -M (despite what the docs say).
125 ## - Using -M directly means running the compiler twice (even worse
126 ## than renaming).
127 if test -z "$gccflag"; then
128 gccflag=-MD,
129 fi
130 "$@" -Wp,"$gccflag$tmpdepfile"
131 stat=$?
132 if test $stat -eq 0; then :
133 else
134 rm -f "$tmpdepfile"
135 exit $stat
136 fi
137 rm -f "$depfile"
138 echo "$object : \\" > "$depfile"
139 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
140 ## The second -e expression handles DOS-style file names with drive letters.
141 sed -e 's/^[^:]*: / /' \
142 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
143 ## This next piece of magic avoids the `deleted header file' problem.
144 ## The problem is that when a header file which appears in a .P file
145 ## is deleted, the dependency causes make to die (because there is
146 ## typically no way to rebuild the header). We avoid this by adding
147 ## dummy dependencies for each header file. Too bad gcc doesn't do
148 ## this for us directly.
149 tr ' ' '
150 ' < "$tmpdepfile" |
151 ## Some versions of gcc put a space before the `:'. On the theory
152 ## that the space means something, we add a space to the output as
153 ## well.
154 ## Some versions of the HPUX 10.20 sed can't process this invocation
155 ## correctly. Breaking it into two sed invocations is a workaround.
156 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
157 rm -f "$tmpdepfile"
158 ;;
159
160 hp)
161 # This case exists only to let depend.m4 do its work. It works by
162 # looking at the text of this script. This case will never be run,
163 # since it is checked for above.
164 exit 1
165 ;;
166
167 sgi)
168 if test "$libtool" = yes; then
169 "$@" "-Wp,-MDupdate,$tmpdepfile"
170 else
171 "$@" -MDupdate "$tmpdepfile"
172 fi
173 stat=$?
174 if test $stat -eq 0; then :
175 else
176 rm -f "$tmpdepfile"
177 exit $stat
178 fi
179 rm -f "$depfile"
180
181 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
182 echo "$object : \\" > "$depfile"
183
184 # Clip off the initial element (the dependent). Don't try to be
185 # clever and replace this with sed code, as IRIX sed won't handle
186 # lines with more than a fixed number of characters (4096 in
187 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
188 # the IRIX cc adds comments like `#:fec' to the end of the
189 # dependency line.
190 tr ' ' '
191 ' < "$tmpdepfile" \
192 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
193 tr '
194 ' ' ' >> $depfile
195 echo >> $depfile
196
197 # The second pass generates a dummy entry for each header file.
198 tr ' ' '
199 ' < "$tmpdepfile" \
200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
201 >> $depfile
202 else
203 # The sourcefile does not contain any dependencies, so just
204 # store a dummy comment line, to avoid errors with the Makefile
205 # "include basename.Plo" scheme.
206 echo "#dummy" > "$depfile"
207 fi
208 rm -f "$tmpdepfile"
209 ;;
210
211 aix)
212 # The C for AIX Compiler uses -M and outputs the dependencies
213 # in a .u file. In older versions, this file always lives in the
214 # current directory. Also, the AIX compiler puts `$object:' at the
215 # start of each line; $object doesn't have directory information.
216 # Version 6 uses the directory in both cases.
217 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
218 test "x$dir" = "x$object" && dir=
219 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
220 if test "$libtool" = yes; then
221 tmpdepfile1=$dir$base.u
222 tmpdepfile2=$base.u
223 tmpdepfile3=$dir.libs/$base.u
224 "$@" -Wc,-M
225 else
226 tmpdepfile1=$dir$base.u
227 tmpdepfile2=$dir$base.u
228 tmpdepfile3=$dir$base.u
229 "$@" -M
230 fi
231 stat=$?
232
233 if test $stat -eq 0; then :
234 else
235 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
236 exit $stat
237 fi
238
239 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
240 do
241 test -f "$tmpdepfile" && break
242 done
243 if test -f "$tmpdepfile"; then
244 # Each line is of the form `foo.o: dependent.h'.
245 # Do two passes, one to just change these to
246 # `$object: dependent.h' and one to simply `dependent.h:'.
247 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
248 # That's a tab and a space in the [].
249 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
250 else
251 # The sourcefile does not contain any dependencies, so just
252 # store a dummy comment line, to avoid errors with the Makefile
253 # "include basename.Plo" scheme.
254 echo "#dummy" > "$depfile"
255 fi
256 rm -f "$tmpdepfile"
257 ;;
258
259 icc)
260 # Intel's C compiler understands `-MD -MF file'. However on
261 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
262 # ICC 7.0 will fill foo.d with something like
263 # foo.o: sub/foo.c
264 # foo.o: sub/foo.h
265 # which is wrong. We want:
266 # sub/foo.o: sub/foo.c
267 # sub/foo.o: sub/foo.h
268 # sub/foo.c:
269 # sub/foo.h:
270 # ICC 7.1 will output
271 # foo.o: sub/foo.c sub/foo.h
272 # and will wrap long lines using \ :
273 # foo.o: sub/foo.c ... \
274 # sub/foo.h ... \
275 # ...
276
277 "$@" -MD -MF "$tmpdepfile"
278 stat=$?
279 if test $stat -eq 0; then :
280 else
281 rm -f "$tmpdepfile"
282 exit $stat
283 fi
284 rm -f "$depfile"
285 # Each line is of the form `foo.o: dependent.h',
286 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
287 # Do two passes, one to just change these to
288 # `$object: dependent.h' and one to simply `dependent.h:'.
289 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
290 # Some versions of the HPUX 10.20 sed can't process this invocation
291 # correctly. Breaking it into two sed invocations is a workaround.
292 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
293 sed -e 's/$/ :/' >> "$depfile"
294 rm -f "$tmpdepfile"
295 ;;
296
297 hp2)
298 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
299 # compilers, which have integrated preprocessors. The correct option
300 # to use with these is +Maked; it writes dependencies to a file named
301 # 'foo.d', which lands next to the object file, wherever that
302 # happens to be.
303 # Much of this is similar to the tru64 case; see comments there.
304 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
305 test "x$dir" = "x$object" && dir=
306 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
307 if test "$libtool" = yes; then
308 tmpdepfile1=$dir$base.d
309 tmpdepfile2=$dir.libs/$base.d
310 "$@" -Wc,+Maked
311 else
312 tmpdepfile1=$dir$base.d
313 tmpdepfile2=$dir$base.d
314 "$@" +Maked
315 fi
316 stat=$?
317 if test $stat -eq 0; then :
318 else
319 rm -f "$tmpdepfile1" "$tmpdepfile2"
320 exit $stat
321 fi
322
323 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
324 do
325 test -f "$tmpdepfile" && break
326 done
327 if test -f "$tmpdepfile"; then
328 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
329 # Add `dependent.h:' lines.
330 sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
331 else
332 echo "#dummy" > "$depfile"
333 fi
334 rm -f "$tmpdepfile" "$tmpdepfile2"
335 ;;
336
337 tru64)
338 # The Tru64 compiler uses -MD to generate dependencies as a side
339 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
340 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
341 # dependencies in `foo.d' instead, so we check for that too.
342 # Subdirectories are respected.
343 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
344 test "x$dir" = "x$object" && dir=
345 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
346
347 if test "$libtool" = yes; then
348 # With Tru64 cc, shared objects can also be used to make a
349 # static library. This mechanism is used in libtool 1.4 series to
350 # handle both shared and static libraries in a single compilation.
351 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
352 #
353 # With libtool 1.5 this exception was removed, and libtool now
354 # generates 2 separate objects for the 2 libraries. These two
355 # compilations output dependencies in $dir.libs/$base.o.d and
356 # in $dir$base.o.d. We have to check for both files, because
357 # one of the two compilations can be disabled. We should prefer
358 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
359 # automatically cleaned when .libs/ is deleted, while ignoring
360 # the former would cause a distcleancheck panic.
361 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
362 tmpdepfile2=$dir$base.o.d # libtool 1.5
363 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
364 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
365 "$@" -Wc,-MD
366 else
367 tmpdepfile1=$dir$base.o.d
368 tmpdepfile2=$dir$base.d
369 tmpdepfile3=$dir$base.d
370 tmpdepfile4=$dir$base.d
371 "$@" -MD
372 fi
373
374 stat=$?
375 if test $stat -eq 0; then :
376 else
377 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
378 exit $stat
379 fi
380
381 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
382 do
383 test -f "$tmpdepfile" && break
384 done
385 if test -f "$tmpdepfile"; then
386 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
387 # That's a tab and a space in the [].
388 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
389 else
390 echo "#dummy" > "$depfile"
391 fi
392 rm -f "$tmpdepfile"
393 ;;
394
395 #nosideeffect)
396 # This comment above is used by automake to tell side-effect
397 # dependency tracking mechanisms from slower ones.
398
399 dashmstdout)
400 # Important note: in order to support this mode, a compiler *must*
401 # always write the preprocessed file to stdout, regardless of -o.
402 "$@" || exit $?
403
404 # Remove the call to Libtool.
405 if test "$libtool" = yes; then
406 while test $1 != '--mode=compile'; do
407 shift
408 done
409 shift
410 fi
411
412 # Remove `-o $object'.
413 IFS=" "
414 for arg
415 do
416 case $arg in
417 -o)
418 shift
419 ;;
420 $object)
421 shift
422 ;;
423 *)
424 set fnord "$@" "$arg"
425 shift # fnord
426 shift # $arg
427 ;;
428 esac
429 done
430
431 test -z "$dashmflag" && dashmflag=-M
432 # Require at least two characters before searching for `:'
433 # in the target name. This is to cope with DOS-style filenames:
434 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
435 "$@" $dashmflag |
436 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
437 rm -f "$depfile"
438 cat < "$tmpdepfile" > "$depfile"
439 tr ' ' '
440 ' < "$tmpdepfile" | \
441 ## Some versions of the HPUX 10.20 sed can't process this invocation
442 ## correctly. Breaking it into two sed invocations is a workaround.
443 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
444 rm -f "$tmpdepfile"
445 ;;
446
447 dashXmstdout)
448 # This case only exists to satisfy depend.m4. It is never actually
449 # run, as this mode is specially recognized in the preamble.
450 exit 1
451 ;;
452
453 makedepend)
454 "$@" || exit $?
455 # Remove any Libtool call
456 if test "$libtool" = yes; then
457 while test $1 != '--mode=compile'; do
458 shift
459 done
460 shift
461 fi
462 # X makedepend
463 shift
464 cleared=no
465 for arg in "$@"; do
466 case $cleared in
467 no)
468 set ""; shift
469 cleared=yes ;;
470 esac
471 case "$arg" in
472 -D*|-I*)
473 set fnord "$@" "$arg"; shift ;;
474 # Strip any option that makedepend may not understand. Remove
475 # the object too, otherwise makedepend will parse it as a source file.
476 -*|$object)
477 ;;
478 *)
479 set fnord "$@" "$arg"; shift ;;
480 esac
481 done
482 obj_suffix="`echo $object | sed 's/^.*\././'`"
483 touch "$tmpdepfile"
484 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
485 rm -f "$depfile"
486 cat < "$tmpdepfile" > "$depfile"
487 sed '1,2d' "$tmpdepfile" | tr ' ' '
488 ' | \
489 ## Some versions of the HPUX 10.20 sed can't process this invocation
490 ## correctly. Breaking it into two sed invocations is a workaround.
491 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
492 rm -f "$tmpdepfile" "$tmpdepfile".bak
493 ;;
494
495 cpp)
496 # Important note: in order to support this mode, a compiler *must*
497 # always write the preprocessed file to stdout.
498 "$@" || exit $?
499
500 # Remove the call to Libtool.
501 if test "$libtool" = yes; then
502 while test $1 != '--mode=compile'; do
503 shift
504 done
505 shift
506 fi
507
508 # Remove `-o $object'.
509 IFS=" "
510 for arg
511 do
512 case $arg in
513 -o)
514 shift
515 ;;
516 $object)
517 shift
518 ;;
519 *)
520 set fnord "$@" "$arg"
521 shift # fnord
522 shift # $arg
523 ;;
524 esac
525 done
526
527 "$@" -E |
528 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
529 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
530 sed '$ s: \\$::' > "$tmpdepfile"
531 rm -f "$depfile"
532 echo "$object : \\" > "$depfile"
533 cat < "$tmpdepfile" >> "$depfile"
534 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
535 rm -f "$tmpdepfile"
536 ;;
537
538 msvisualcpp)
539 # Important note: in order to support this mode, a compiler *must*
540 # always write the preprocessed file to stdout, regardless of -o,
541 # because we must use -o when running libtool.
542 "$@" || exit $?
543 IFS=" "
544 for arg
545 do
546 case "$arg" in
547 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
548 set fnord "$@"
549 shift
550 shift
551 ;;
552 *)
553 set fnord "$@" "$arg"
554 shift
555 shift
556 ;;
557 esac
558 done
559 "$@" -E |
560 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
561 rm -f "$depfile"
562 echo "$object : \\" > "$depfile"
563 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
564 echo " " >> "$depfile"
565 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
566 rm -f "$tmpdepfile"
567 ;;
568
569 none)
570 exec "$@"
571 ;;
572
573 *)
574 echo "Unknown depmode $depmode" 1>&2
575 exit 1
576 ;;
577 esac
578
579 exit 0
580
581 # Local Variables:
582 # mode: shell-script
583 # sh-indentation: 2
584 # eval: (add-hook 'write-file-hooks 'time-stamp)
585 # time-stamp-start: "scriptversion="
586 # time-stamp-format: "%:y-%02m-%02d.%02H"
587 # time-stamp-end: "$"
588 # End:
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2006-12-25.00
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # `make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
157 -t) dst_arg=$2
158 shift;;
159
160 -T) no_target_directory=true;;
161
162 --version) echo "$0 $scriptversion"; exit $?;;
163
164 --) shift
165 break;;
166
167 -*) echo "$0: invalid option: $1" >&2
168 exit 1;;
169
170 *) break;;
171 esac
172 shift
173 done
174
175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
176 # When -d is used, all remaining arguments are directories to create.
177 # When -t is used, the destination is already specified.
178 # Otherwise, the last argument is the destination. Remove it from $@.
179 for arg
180 do
181 if test -n "$dst_arg"; then
182 # $@ is not empty: it contains at least $arg.
183 set fnord "$@" "$dst_arg"
184 shift # fnord
185 fi
186 shift # arg
187 dst_arg=$arg
188 done
189 fi
190
191 if test $# -eq 0; then
192 if test -z "$dir_arg"; then
193 echo "$0: no input file specified." >&2
194 exit 1
195 fi
196 # It's OK to call `install-sh -d' without argument.
197 # This can happen when creating conditional directories.
198 exit 0
199 fi
200
201 if test -z "$dir_arg"; then
202 trap '(exit $?); exit' 1 2 13 15
203
204 # Set umask so as not to create temps with too-generous modes.
205 # However, 'strip' requires both read and write access to temps.
206 case $mode in
207 # Optimize common cases.
208 *644) cp_umask=133;;
209 *755) cp_umask=22;;
210
211 *[0-7])
212 if test -z "$stripcmd"; then
213 u_plus_rw=
214 else
215 u_plus_rw='% 200'
216 fi
217 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
218 *)
219 if test -z "$stripcmd"; then
220 u_plus_rw=
221 else
222 u_plus_rw=,u+rw
223 fi
224 cp_umask=$mode$u_plus_rw;;
225 esac
226 fi
227
228 for src
229 do
230 # Protect names starting with `-'.
231 case $src in
232 -*) src=./$src;;
233 esac
234
235 if test -n "$dir_arg"; then
236 dst=$src
237 dstdir=$dst
238 test -d "$dstdir"
239 dstdir_status=$?
240 else
241
242 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
243 # might cause directories to be created, which would be especially bad
244 # if $src (and thus $dsttmp) contains '*'.
245 if test ! -f "$src" && test ! -d "$src"; then
246 echo "$0: $src does not exist." >&2
247 exit 1
248 fi
249
250 if test -z "$dst_arg"; then
251 echo "$0: no destination specified." >&2
252 exit 1
253 fi
254
255 dst=$dst_arg
256 # Protect names starting with `-'.
257 case $dst in
258 -*) dst=./$dst;;
259 esac
260
261 # If destination is a directory, append the input filename; won't work
262 # if double slashes aren't ignored.
263 if test -d "$dst"; then
264 if test -n "$no_target_directory"; then
265 echo "$0: $dst_arg: Is a directory" >&2
266 exit 1
267 fi
268 dstdir=$dst
269 dst=$dstdir/`basename "$src"`
270 dstdir_status=0
271 else
272 # Prefer dirname, but fall back on a substitute if dirname fails.
273 dstdir=`
274 (dirname "$dst") 2>/dev/null ||
275 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
276 X"$dst" : 'X\(//\)[^/]' \| \
277 X"$dst" : 'X\(//\)$' \| \
278 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
279 echo X"$dst" |
280 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
281 s//\1/
282 q
283 }
284 /^X\(\/\/\)[^/].*/{
285 s//\1/
286 q
287 }
288 /^X\(\/\/\)$/{
289 s//\1/
290 q
291 }
292 /^X\(\/\).*/{
293 s//\1/
294 q
295 }
296 s/.*/./; q'
297 `
298
299 test -d "$dstdir"
300 dstdir_status=$?
301 fi
302 fi
303
304 obsolete_mkdir_used=false
305
306 if test $dstdir_status != 0; then
307 case $posix_mkdir in
308 '')
309 # Create intermediate dirs using mode 755 as modified by the umask.
310 # This is like FreeBSD 'install' as of 1997-10-28.
311 umask=`umask`
312 case $stripcmd.$umask in
313 # Optimize common cases.
314 *[2367][2367]) mkdir_umask=$umask;;
315 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
316
317 *[0-7])
318 mkdir_umask=`expr $umask + 22 \
319 - $umask % 100 % 40 + $umask % 20 \
320 - $umask % 10 % 4 + $umask % 2
321 `;;
322 *) mkdir_umask=$umask,go-w;;
323 esac
324
325 # With -d, create the new directory with the user-specified mode.
326 # Otherwise, rely on $mkdir_umask.
327 if test -n "$dir_arg"; then
328 mkdir_mode=-m$mode
329 else
330 mkdir_mode=
331 fi
332
333 posix_mkdir=false
334 case $umask in
335 *[123567][0-7][0-7])
336 # POSIX mkdir -p sets u+wx bits regardless of umask, which
337 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
338 ;;
339 *)
340 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
341 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
342
343 if (umask $mkdir_umask &&
344 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
345 then
346 if test -z "$dir_arg" || {
347 # Check for POSIX incompatibilities with -m.
348 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
349 # other-writeable bit of parent directory when it shouldn't.
350 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
351 ls_ld_tmpdir=`ls -ld "$tmpdir"`
352 case $ls_ld_tmpdir in
353 d????-?r-*) different_mode=700;;
354 d????-?--*) different_mode=755;;
355 *) false;;
356 esac &&
357 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
358 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
359 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
360 }
361 }
362 then posix_mkdir=:
363 fi
364 rmdir "$tmpdir/d" "$tmpdir"
365 else
366 # Remove any dirs left behind by ancient mkdir implementations.
367 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
368 fi
369 trap '' 0;;
370 esac;;
371 esac
372
373 if
374 $posix_mkdir && (
375 umask $mkdir_umask &&
376 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
377 )
378 then :
379 else
380
381 # The umask is ridiculous, or mkdir does not conform to POSIX,
382 # or it failed possibly due to a race condition. Create the
383 # directory the slow way, step by step, checking for races as we go.
384
385 case $dstdir in
386 /*) prefix='/';;
387 -*) prefix='./';;
388 *) prefix='';;
389 esac
390
391 eval "$initialize_posix_glob"
392
393 oIFS=$IFS
394 IFS=/
395 $posix_glob set -f
396 set fnord $dstdir
397 shift
398 $posix_glob set +f
399 IFS=$oIFS
400
401 prefixes=
402
403 for d
404 do
405 test -z "$d" && continue
406
407 prefix=$prefix$d
408 if test -d "$prefix"; then
409 prefixes=
410 else
411 if $posix_mkdir; then
412 (umask=$mkdir_umask &&
413 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
414 # Don't fail if two instances are running concurrently.
415 test -d "$prefix" || exit 1
416 else
417 case $prefix in
418 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
419 *) qprefix=$prefix;;
420 esac
421 prefixes="$prefixes '$qprefix'"
422 fi
423 fi
424 prefix=$prefix/
425 done
426
427 if test -n "$prefixes"; then
428 # Don't fail if two instances are running concurrently.
429 (umask $mkdir_umask &&
430 eval "\$doit_exec \$mkdirprog $prefixes") ||
431 test -d "$dstdir" || exit 1
432 obsolete_mkdir_used=true
433 fi
434 fi
435 fi
436
437 if test -n "$dir_arg"; then
438 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
439 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
440 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
441 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
442 else
443
444 # Make a couple of temp file names in the proper directory.
445 dsttmp=$dstdir/_inst.$$_
446 rmtmp=$dstdir/_rm.$$_
447
448 # Trap to clean up those temp files at exit.
449 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
450
451 # Copy the file name to the temp name.
452 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
453
454 # and set any options; do chmod last to preserve setuid bits.
455 #
456 # If any of these fail, we abort the whole thing. If we want to
457 # ignore errors from any of these, just make sure not to ignore
458 # errors from the above "$doit $cpprog $src $dsttmp" command.
459 #
460 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
461 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
462 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
463 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
464
465 # If -C, don't bother to copy if it wouldn't change the file.
466 if $copy_on_change &&
467 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
468 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
469
470 eval "$initialize_posix_glob" &&
471 $posix_glob set -f &&
472 set X $old && old=:$2:$4:$5:$6 &&
473 set X $new && new=:$2:$4:$5:$6 &&
474 $posix_glob set +f &&
475
476 test "$old" = "$new" &&
477 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
478 then
479 rm -f "$dsttmp"
480 else
481 # Rename the file to the real destination.
482 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
483
484 # The rename failed, perhaps because mv can't rename something else
485 # to itself, or perhaps because mv is so ancient that it does not
486 # support -f.
487 {
488 # Now remove or move aside any old file at destination location.
489 # We try this two ways since rm can't unlink itself on some
490 # systems and the destination file might be busy for other
491 # reasons. In this case, the final cleanup might fail but the new
492 # file should still install successfully.
493 {
494 test ! -f "$dst" ||
495 $doit $rmcmd -f "$dst" 2>/dev/null ||
496 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
497 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
498 } ||
499 { echo "$0: cannot unlink or rename $dst" >&2
500 (exit 1); exit 1
501 }
502 } &&
503
504 # Now rename the file to the real destination.
505 $doit $mvcmd "$dsttmp" "$dst"
506 }
507 fi || exit 1
508
509 trap '' 0
510 fi
511 done
512
513 # Local variables:
514 # eval: (add-hook 'write-file-hooks 'time-stamp)
515 # time-stamp-start: "scriptversion="
516 # time-stamp-format: "%:y-%02m-%02d.%02H"
517 # time-stamp-end: "$"
518 # End:
0 prefix=@prefix@
1 exec_prefix=${prefix}
2 libdir=@libdir@
3 includedir=${prefix}/include
4
5 Name: libatasmart
6 Description: ATA S.M.A.R.T. Reading and Parsing Library
7 Version: @PACKAGE_VERSION@
8 Libs: -L${libdir} -latasmart
9 Cflags: -I${includedir}
10 Requires:
0 # Generated from ltmain.m4sh.
1
2 # ltmain.sh (GNU libtool) 2.2.6
3 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
5 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
6 # This is free software; see the source for copying conditions. There is NO
7 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8
9 # GNU Libtool is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # As a special exception to the GNU General Public License,
15 # if you distribute this file as part of a program or library that
16 # is built using GNU Libtool, you may include this file under the
17 # same distribution terms that you use for the rest of that program.
18 #
19 # GNU Libtool is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Libtool; see the file COPYING. If not, a copy
26 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
27 # or obtained by writing to the Free Software Foundation, Inc.,
28 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
30 # Usage: $progname [OPTION]... [MODE-ARG]...
31 #
32 # Provide generalized library-building support services.
33 #
34 # --config show all configuration variables
35 # --debug enable verbose shell tracing
36 # -n, --dry-run display commands without modifying any files
37 # --features display basic configuration information and exit
38 # --mode=MODE use operation mode MODE
39 # --preserve-dup-deps don't remove duplicate dependency libraries
40 # --quiet, --silent don't print informational messages
41 # --tag=TAG use configuration variables from tag TAG
42 # -v, --verbose print informational messages (default)
43 # --version print version information
44 # -h, --help print short or long help message
45 #
46 # MODE must be one of the following:
47 #
48 # clean remove files from the build directory
49 # compile compile a source file into a libtool object
50 # execute automatically set library path, then run a program
51 # finish complete the installation of libtool libraries
52 # install install libraries or executables
53 # link create a library or an executable
54 # uninstall remove libraries from an installed directory
55 #
56 # MODE-ARGS vary depending on the MODE.
57 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
58 #
59 # When reporting a bug, please describe a test case to reproduce it and
60 # include the following information:
61 #
62 # host-triplet: $host
63 # shell: $SHELL
64 # compiler: $LTCC
65 # compiler flags: $LTCFLAGS
66 # linker: $LD (gnu? $with_gnu_ld)
67 # $progname: (GNU libtool) 2.2.6
68 # automake: $automake_version
69 # autoconf: $autoconf_version
70 #
71 # Report bugs to <bug-libtool@gnu.org>.
72
73 PROGRAM=ltmain.sh
74 PACKAGE=libtool
75 VERSION=2.2.6
76 TIMESTAMP=""
77 package_revision=1.3012
78
79 # Be Bourne compatible
80 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
81 emulate sh
82 NULLCMD=:
83 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
84 # is contrary to our usage. Disable this feature.
85 alias -g '${1+"$@"}'='"$@"'
86 setopt NO_GLOB_SUBST
87 else
88 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
89 fi
90 BIN_SH=xpg4; export BIN_SH # for Tru64
91 DUALCASE=1; export DUALCASE # for MKS sh
92
93 # NLS nuisances: We save the old values to restore during execute mode.
94 # Only set LANG and LC_ALL to C if already set.
95 # These must not be set unconditionally because not all systems understand
96 # e.g. LANG=C (notably SCO).
97 lt_user_locale=
98 lt_safe_locale=
99 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
100 do
101 eval "if test \"\${$lt_var+set}\" = set; then
102 save_$lt_var=\$$lt_var
103 $lt_var=C
104 export $lt_var
105 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
106 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
107 fi"
108 done
109
110 $lt_unset CDPATH
111
112
113
114
115
116 : ${CP="cp -f"}
117 : ${ECHO="echo"}
118 : ${EGREP="/bin/grep -E"}
119 : ${FGREP="/bin/grep -F"}
120 : ${GREP="/bin/grep"}
121 : ${LN_S="ln -s"}
122 : ${MAKE="make"}
123 : ${MKDIR="mkdir"}
124 : ${MV="mv -f"}
125 : ${RM="rm -f"}
126 : ${SED="/bin/sed"}
127 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
128 : ${Xsed="$SED -e 1s/^X//"}
129
130 # Global variables:
131 EXIT_SUCCESS=0
132 EXIT_FAILURE=1
133 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
134 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
135
136 exit_status=$EXIT_SUCCESS
137
138 # Make sure IFS has a sensible default
139 lt_nl='
140 '
141 IFS=" $lt_nl"
142
143 dirname="s,/[^/]*$,,"
144 basename="s,^.*/,,"
145
146 # func_dirname_and_basename file append nondir_replacement
147 # perform func_basename and func_dirname in a single function
148 # call:
149 # dirname: Compute the dirname of FILE. If nonempty,
150 # add APPEND to the result, otherwise set result
151 # to NONDIR_REPLACEMENT.
152 # value returned in "$func_dirname_result"
153 # basename: Compute filename of FILE.
154 # value retuned in "$func_basename_result"
155 # Implementation must be kept synchronized with func_dirname
156 # and func_basename. For efficiency, we do not delegate to
157 # those functions but instead duplicate the functionality here.
158 func_dirname_and_basename ()
159 {
160 # Extract subdirectory from the argument.
161 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
162 if test "X$func_dirname_result" = "X${1}"; then
163 func_dirname_result="${3}"
164 else
165 func_dirname_result="$func_dirname_result${2}"
166 fi
167 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
168 }
169
170 # Generated shell functions inserted here.
171
172 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
173 # is ksh but when the shell is invoked as "sh" and the current value of
174 # the _XPG environment variable is not equal to 1 (one), the special
175 # positional parameter $0, within a function call, is the name of the
176 # function.
177 progpath="$0"
178
179 # The name of this program:
180 # In the unlikely event $progname began with a '-', it would play havoc with
181 # func_echo (imagine progname=-n), so we prepend ./ in that case:
182 func_dirname_and_basename "$progpath"
183 progname=$func_basename_result
184 case $progname in
185 -*) progname=./$progname ;;
186 esac
187
188 # Make sure we have an absolute path for reexecution:
189 case $progpath in
190 [\\/]*|[A-Za-z]:\\*) ;;
191 *[\\/]*)
192 progdir=$func_dirname_result
193 progdir=`cd "$progdir" && pwd`
194 progpath="$progdir/$progname"
195 ;;
196 *)
197 save_IFS="$IFS"
198 IFS=:
199 for progdir in $PATH; do
200 IFS="$save_IFS"
201 test -x "$progdir/$progname" && break
202 done
203 IFS="$save_IFS"
204 test -n "$progdir" || progdir=`pwd`
205 progpath="$progdir/$progname"
206 ;;
207 esac
208
209 # Sed substitution that helps us do robust quoting. It backslashifies
210 # metacharacters that are still active within double-quoted strings.
211 Xsed="${SED}"' -e 1s/^X//'
212 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
213
214 # Same as above, but do not quote variable references.
215 double_quote_subst='s/\(["`\\]\)/\\\1/g'
216
217 # Re-`\' parameter expansions in output of double_quote_subst that were
218 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
219 # in input to double_quote_subst, that '$' was protected from expansion.
220 # Since each input `\' is now two `\'s, look for any number of runs of
221 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
222 bs='\\'
223 bs2='\\\\'
224 bs4='\\\\\\\\'
225 dollar='\$'
226 sed_double_backslash="\
227 s/$bs4/&\\
228 /g
229 s/^$bs2$dollar/$bs&/
230 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
231 s/\n//g"
232
233 # Standard options:
234 opt_dry_run=false
235 opt_help=false
236 opt_quiet=false
237 opt_verbose=false
238 opt_warning=:
239
240 # func_echo arg...
241 # Echo program name prefixed message, along with the current mode
242 # name if it has been set yet.
243 func_echo ()
244 {
245 $ECHO "$progname${mode+: }$mode: $*"
246 }
247
248 # func_verbose arg...
249 # Echo program name prefixed message in verbose mode only.
250 func_verbose ()
251 {
252 $opt_verbose && func_echo ${1+"$@"}
253
254 # A bug in bash halts the script if the last line of a function
255 # fails when set -e is in force, so we need another command to
256 # work around that:
257 :
258 }
259
260 # func_error arg...
261 # Echo program name prefixed message to standard error.
262 func_error ()
263 {
264 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
265 }
266
267 # func_warning arg...
268 # Echo program name prefixed warning message to standard error.
269 func_warning ()
270 {
271 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
272
273 # bash bug again:
274 :
275 }
276
277 # func_fatal_error arg...
278 # Echo program name prefixed message to standard error, and exit.
279 func_fatal_error ()
280 {
281 func_error ${1+"$@"}
282 exit $EXIT_FAILURE
283 }
284
285 # func_fatal_help arg...
286 # Echo program name prefixed message to standard error, followed by
287 # a help hint, and exit.
288 func_fatal_help ()
289 {
290 func_error ${1+"$@"}
291 func_fatal_error "$help"
292 }
293 help="Try \`$progname --help' for more information." ## default
294
295
296 # func_grep expression filename
297 # Check whether EXPRESSION matches any line of FILENAME, without output.
298 func_grep ()
299 {
300 $GREP "$1" "$2" >/dev/null 2>&1
301 }
302
303
304 # func_mkdir_p directory-path
305 # Make sure the entire path to DIRECTORY-PATH is available.
306 func_mkdir_p ()
307 {
308 my_directory_path="$1"
309 my_dir_list=
310
311 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
312
313 # Protect directory names starting with `-'
314 case $my_directory_path in
315 -*) my_directory_path="./$my_directory_path" ;;
316 esac
317
318 # While some portion of DIR does not yet exist...
319 while test ! -d "$my_directory_path"; do
320 # ...make a list in topmost first order. Use a colon delimited
321 # list incase some portion of path contains whitespace.
322 my_dir_list="$my_directory_path:$my_dir_list"
323
324 # If the last portion added has no slash in it, the list is done
325 case $my_directory_path in */*) ;; *) break ;; esac
326
327 # ...otherwise throw away the child directory and loop
328 my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
329 done
330 my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
331
332 save_mkdir_p_IFS="$IFS"; IFS=':'
333 for my_dir in $my_dir_list; do
334 IFS="$save_mkdir_p_IFS"
335 # mkdir can fail with a `File exist' error if two processes
336 # try to create one of the directories concurrently. Don't
337 # stop in that case!
338 $MKDIR "$my_dir" 2>/dev/null || :
339 done
340 IFS="$save_mkdir_p_IFS"
341
342 # Bail out if we (or some other process) failed to create a directory.
343 test -d "$my_directory_path" || \
344 func_fatal_error "Failed to create \`$1'"
345 fi
346 }
347
348
349 # func_mktempdir [string]
350 # Make a temporary directory that won't clash with other running
351 # libtool processes, and avoids race conditions if possible. If
352 # given, STRING is the basename for that directory.
353 func_mktempdir ()
354 {
355 my_template="${TMPDIR-/tmp}/${1-$progname}"
356
357 if test "$opt_dry_run" = ":"; then
358 # Return a directory name, but don't create it in dry-run mode
359 my_tmpdir="${my_template}-$$"
360 else
361
362 # If mktemp works, use that first and foremost
363 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
364
365 if test ! -d "$my_tmpdir"; then
366 # Failing that, at least try and use $RANDOM to avoid a race
367 my_tmpdir="${my_template}-${RANDOM-0}$$"
368
369 save_mktempdir_umask=`umask`
370 umask 0077
371 $MKDIR "$my_tmpdir"
372 umask $save_mktempdir_umask
373 fi
374
375 # If we're not in dry-run mode, bomb out on failure
376 test -d "$my_tmpdir" || \
377 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
378 fi
379
380 $ECHO "X$my_tmpdir" | $Xsed
381 }
382
383
384 # func_quote_for_eval arg
385 # Aesthetically quote ARG to be evaled later.
386 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
387 # is double-quoted, suitable for a subsequent eval, whereas
388 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
389 # which are still active within double quotes backslashified.
390 func_quote_for_eval ()
391 {
392 case $1 in
393 *[\\\`\"\$]*)
394 func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
395 *)
396 func_quote_for_eval_unquoted_result="$1" ;;
397 esac
398
399 case $func_quote_for_eval_unquoted_result in
400 # Double-quote args containing shell metacharacters to delay
401 # word splitting, command substitution and and variable
402 # expansion for a subsequent eval.
403 # Many Bourne shells cannot handle close brackets correctly
404 # in scan sets, so we specify it separately.
405 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
406 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
407 ;;
408 *)
409 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
410 esac
411 }
412
413
414 # func_quote_for_expand arg
415 # Aesthetically quote ARG to be evaled later; same as above,
416 # but do not quote variable references.
417 func_quote_for_expand ()
418 {
419 case $1 in
420 *[\\\`\"]*)
421 my_arg=`$ECHO "X$1" | $Xsed \
422 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
423 *)
424 my_arg="$1" ;;
425 esac
426
427 case $my_arg in
428 # Double-quote args containing shell metacharacters to delay
429 # word splitting and command substitution for a subsequent eval.
430 # Many Bourne shells cannot handle close brackets correctly
431 # in scan sets, so we specify it separately.
432 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
433 my_arg="\"$my_arg\""
434 ;;
435 esac
436
437 func_quote_for_expand_result="$my_arg"
438 }
439
440
441 # func_show_eval cmd [fail_exp]
442 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
443 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
444 # is given, then evaluate it.
445 func_show_eval ()
446 {
447 my_cmd="$1"
448 my_fail_exp="${2-:}"
449
450 ${opt_silent-false} || {
451 func_quote_for_expand "$my_cmd"
452 eval "func_echo $func_quote_for_expand_result"
453 }
454
455 if ${opt_dry_run-false}; then :; else
456 eval "$my_cmd"
457 my_status=$?
458 if test "$my_status" -eq 0; then :; else
459 eval "(exit $my_status); $my_fail_exp"
460 fi
461 fi
462 }
463
464
465 # func_show_eval_locale cmd [fail_exp]
466 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
467 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
468 # is given, then evaluate it. Use the saved locale for evaluation.
469 func_show_eval_locale ()
470 {
471 my_cmd="$1"
472 my_fail_exp="${2-:}"
473
474 ${opt_silent-false} || {
475 func_quote_for_expand "$my_cmd"
476 eval "func_echo $func_quote_for_expand_result"
477 }
478
479 if ${opt_dry_run-false}; then :; else
480 eval "$lt_user_locale
481 $my_cmd"
482 my_status=$?
483 eval "$lt_safe_locale"
484 if test "$my_status" -eq 0; then :; else
485 eval "(exit $my_status); $my_fail_exp"
486 fi
487 fi
488 }
489
490
491
492
493
494 # func_version
495 # Echo version message to standard output and exit.
496 func_version ()
497 {
498 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
499 s/^# //
500 s/^# *$//
501 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
502 p
503 }' < "$progpath"
504 exit $?
505 }
506
507 # func_usage
508 # Echo short help message to standard output and exit.
509 func_usage ()
510 {
511 $SED -n '/^# Usage:/,/# -h/ {
512 s/^# //
513 s/^# *$//
514 s/\$progname/'$progname'/
515 p
516 }' < "$progpath"
517 $ECHO
518 $ECHO "run \`$progname --help | more' for full usage"
519 exit $?
520 }
521
522 # func_help
523 # Echo long help message to standard output and exit.
524 func_help ()
525 {
526 $SED -n '/^# Usage:/,/# Report bugs to/ {
527 s/^# //
528 s/^# *$//
529 s*\$progname*'$progname'*
530 s*\$host*'"$host"'*
531 s*\$SHELL*'"$SHELL"'*
532 s*\$LTCC*'"$LTCC"'*
533 s*\$LTCFLAGS*'"$LTCFLAGS"'*
534 s*\$LD*'"$LD"'*
535 s/\$with_gnu_ld/'"$with_gnu_ld"'/
536 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
537 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
538 p
539 }' < "$progpath"
540 exit $?
541 }
542
543 # func_missing_arg argname
544 # Echo program name prefixed message to standard error and set global
545 # exit_cmd.
546 func_missing_arg ()
547 {
548 func_error "missing argument for $1"
549 exit_cmd=exit
550 }
551
552 exit_cmd=:
553
554
555
556
557
558 # Check that we have a working $ECHO.
559 if test "X$1" = X--no-reexec; then
560 # Discard the --no-reexec flag, and continue.
561 shift
562 elif test "X$1" = X--fallback-echo; then
563 # Avoid inline document here, it may be left over
564 :
565 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
566 # Yippee, $ECHO works!
567 :
568 else
569 # Restart under the correct shell, and then maybe $ECHO will work.
570 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
571 fi
572
573 if test "X$1" = X--fallback-echo; then
574 # used as fallback echo
575 shift
576 cat <<EOF
577 $*
578 EOF
579 exit $EXIT_SUCCESS
580 fi
581
582 magic="%%%MAGIC variable%%%"
583 magic_exe="%%%MAGIC EXE variable%%%"
584
585 # Global variables.
586 # $mode is unset
587 nonopt=
588 execute_dlfiles=
589 preserve_args=
590 lo2o="s/\\.lo\$/.${objext}/"
591 o2lo="s/\\.${objext}\$/.lo/"
592 extracted_archives=
593 extracted_serial=0
594
595 opt_dry_run=false
596 opt_duplicate_deps=false
597 opt_silent=false
598 opt_debug=:
599
600 # If this variable is set in any of the actions, the command in it
601 # will be execed at the end. This prevents here-documents from being
602 # left over by shells.
603 exec_cmd=
604
605 # func_fatal_configuration arg...
606 # Echo program name prefixed message to standard error, followed by
607 # a configuration failure hint, and exit.
608 func_fatal_configuration ()
609 {
610 func_error ${1+"$@"}
611 func_error "See the $PACKAGE documentation for more information."
612 func_fatal_error "Fatal configuration error."
613 }
614
615
616 # func_config
617 # Display the configuration for all the tags in this script.
618 func_config ()
619 {
620 re_begincf='^# ### BEGIN LIBTOOL'
621 re_endcf='^# ### END LIBTOOL'
622
623 # Default configuration.
624 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
625
626 # Now print the configurations for the tags.
627 for tagname in $taglist; do
628 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
629 done
630
631 exit $?
632 }
633
634 # func_features
635 # Display the features supported by this script.
636 func_features ()
637 {
638 $ECHO "host: $host"
639 if test "$build_libtool_libs" = yes; then
640 $ECHO "enable shared libraries"
641 else
642 $ECHO "disable shared libraries"
643 fi
644 if test "$build_old_libs" = yes; then
645 $ECHO "enable static libraries"
646 else
647 $ECHO "disable static libraries"
648 fi
649
650 exit $?
651 }
652
653 # func_enable_tag tagname
654 # Verify that TAGNAME is valid, and either flag an error and exit, or
655 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
656 # variable here.
657 func_enable_tag ()
658 {
659 # Global variable:
660 tagname="$1"
661
662 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
663 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
664 sed_extractcf="/$re_begincf/,/$re_endcf/p"
665
666 # Validate tagname.
667 case $tagname in
668 *[!-_A-Za-z0-9,/]*)
669 func_fatal_error "invalid tag name: $tagname"
670 ;;
671 esac
672
673 # Don't test for the "default" C tag, as we know it's
674 # there but not specially marked.
675 case $tagname in
676 CC) ;;
677 *)
678 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
679 taglist="$taglist $tagname"
680
681 # Evaluate the configuration. Be careful to quote the path
682 # and the sed script, to avoid splitting on whitespace, but
683 # also don't use non-portable quotes within backquotes within
684 # quotes we have to do it in 2 steps:
685 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
686 eval "$extractedcf"
687 else
688 func_error "ignoring unknown tag $tagname"
689 fi
690 ;;
691 esac
692 }
693
694 # Parse options once, thoroughly. This comes as soon as possible in
695 # the script to make things like `libtool --version' happen quickly.
696 {
697
698 # Shorthand for --mode=foo, only valid as the first argument
699 case $1 in
700 clean|clea|cle|cl)
701 shift; set dummy --mode clean ${1+"$@"}; shift
702 ;;
703 compile|compil|compi|comp|com|co|c)
704 shift; set dummy --mode compile ${1+"$@"}; shift
705 ;;
706 execute|execut|execu|exec|exe|ex|e)
707 shift; set dummy --mode execute ${1+"$@"}; shift
708 ;;
709 finish|finis|fini|fin|fi|f)
710 shift; set dummy --mode finish ${1+"$@"}; shift
711 ;;
712 install|instal|insta|inst|ins|in|i)
713 shift; set dummy --mode install ${1+"$@"}; shift
714 ;;
715 link|lin|li|l)
716 shift; set dummy --mode link ${1+"$@"}; shift
717 ;;
718 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
719 shift; set dummy --mode uninstall ${1+"$@"}; shift
720 ;;
721 esac
722
723 # Parse non-mode specific arguments:
724 while test "$#" -gt 0; do
725 opt="$1"
726 shift
727
728 case $opt in
729 --config) func_config ;;
730
731 --debug) preserve_args="$preserve_args $opt"
732 func_echo "enabling shell trace mode"
733 opt_debug='set -x'
734 $opt_debug
735 ;;
736
737 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
738 execute_dlfiles="$execute_dlfiles $1"
739 shift
740 ;;
741
742 --dry-run | -n) opt_dry_run=: ;;
743 --features) func_features ;;
744 --finish) mode="finish" ;;
745
746 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
747 case $1 in
748 # Valid mode arguments:
749 clean) ;;
750 compile) ;;
751 execute) ;;
752 finish) ;;
753 install) ;;
754 link) ;;
755 relink) ;;
756 uninstall) ;;
757
758 # Catch anything else as an error
759 *) func_error "invalid argument for $opt"
760 exit_cmd=exit
761 break
762 ;;
763 esac
764
765 mode="$1"
766 shift
767 ;;
768
769 --preserve-dup-deps)
770 opt_duplicate_deps=: ;;
771
772 --quiet|--silent) preserve_args="$preserve_args $opt"
773 opt_silent=:
774 ;;
775
776 --verbose| -v) preserve_args="$preserve_args $opt"
777 opt_silent=false
778 ;;
779
780 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
781 preserve_args="$preserve_args $opt $1"
782 func_enable_tag "$1" # tagname is set here
783 shift
784 ;;
785
786 # Separate optargs to long options:
787 -dlopen=*|--mode=*|--tag=*)
788 func_opt_split "$opt"
789 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
790 shift
791 ;;
792
793 -\?|-h) func_usage ;;
794 --help) opt_help=: ;;
795 --version) func_version ;;
796
797 -*) func_fatal_help "unrecognized option \`$opt'" ;;
798
799 *) nonopt="$opt"
800 break
801 ;;
802 esac
803 done
804
805
806 case $host in
807 *cygwin* | *mingw* | *pw32* | *cegcc*)
808 # don't eliminate duplications in $postdeps and $predeps
809 opt_duplicate_compiler_generated_deps=:
810 ;;
811 *)
812 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
813 ;;
814 esac
815
816 # Having warned about all mis-specified options, bail out if
817 # anything was wrong.
818 $exit_cmd $EXIT_FAILURE
819 }
820
821 # func_check_version_match
822 # Ensure that we are using m4 macros, and libtool script from the same
823 # release of libtool.
824 func_check_version_match ()
825 {
826 if test "$package_revision" != "$macro_revision"; then
827 if test "$VERSION" != "$macro_version"; then
828 if test -z "$macro_version"; then
829 cat >&2 <<_LT_EOF
830 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
831 $progname: definition of this LT_INIT comes from an older release.
832 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
833 $progname: and run autoconf again.
834 _LT_EOF
835 else
836 cat >&2 <<_LT_EOF
837 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
838 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
839 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
840 $progname: and run autoconf again.
841 _LT_EOF
842 fi
843 else
844 cat >&2 <<_LT_EOF
845 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
846 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
847 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
848 $progname: of $PACKAGE $VERSION and run autoconf again.
849 _LT_EOF
850 fi
851
852 exit $EXIT_MISMATCH
853 fi
854 }
855
856
857 ## ----------- ##
858 ## Main. ##
859 ## ----------- ##
860
861 $opt_help || {
862 # Sanity checks first:
863 func_check_version_match
864
865 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
866 func_fatal_configuration "not configured to build any kind of library"
867 fi
868
869 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
870
871
872 # Darwin sucks
873 eval std_shrext=\"$shrext_cmds\"
874
875
876 # Only execute mode is allowed to have -dlopen flags.
877 if test -n "$execute_dlfiles" && test "$mode" != execute; then
878 func_error "unrecognized option \`-dlopen'"
879 $ECHO "$help" 1>&2
880 exit $EXIT_FAILURE
881 fi
882
883 # Change the help message to a mode-specific one.
884 generic_help="$help"
885 help="Try \`$progname --help --mode=$mode' for more information."
886 }
887
888
889 # func_lalib_p file
890 # True iff FILE is a libtool `.la' library or `.lo' object file.
891 # This function is only a basic sanity check; it will hardly flush out
892 # determined imposters.
893 func_lalib_p ()
894 {
895 test -f "$1" &&
896 $SED -e 4q "$1" 2>/dev/null \
897 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
898 }
899
900 # func_lalib_unsafe_p file
901 # True iff FILE is a libtool `.la' library or `.lo' object file.
902 # This function implements the same check as func_lalib_p without
903 # resorting to external programs. To this end, it redirects stdin and
904 # closes it afterwards, without saving the original file descriptor.
905 # As a safety measure, use it only where a negative result would be
906 # fatal anyway. Works if `file' does not exist.
907 func_lalib_unsafe_p ()
908 {
909 lalib_p=no
910 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
911 for lalib_p_l in 1 2 3 4
912 do
913 read lalib_p_line
914 case "$lalib_p_line" in
915 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
916 esac
917 done
918 exec 0<&5 5<&-
919 fi
920 test "$lalib_p" = yes
921 }
922
923 # func_ltwrapper_script_p file
924 # True iff FILE is a libtool wrapper script
925 # This function is only a basic sanity check; it will hardly flush out
926 # determined imposters.
927 func_ltwrapper_script_p ()
928 {
929 func_lalib_p "$1"
930 }
931
932 # func_ltwrapper_executable_p file
933 # True iff FILE is a libtool wrapper executable
934 # This function is only a basic sanity check; it will hardly flush out
935 # determined imposters.
936 func_ltwrapper_executable_p ()
937 {
938 func_ltwrapper_exec_suffix=
939 case $1 in
940 *.exe) ;;
941 *) func_ltwrapper_exec_suffix=.exe ;;
942 esac
943 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
944 }
945
946 # func_ltwrapper_scriptname file
947 # Assumes file is an ltwrapper_executable
948 # uses $file to determine the appropriate filename for a
949 # temporary ltwrapper_script.
950 func_ltwrapper_scriptname ()
951 {
952 func_ltwrapper_scriptname_result=""
953 if func_ltwrapper_executable_p "$1"; then
954 func_dirname_and_basename "$1" "" "."
955 func_stripname '' '.exe' "$func_basename_result"
956 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
957 fi
958 }
959
960 # func_ltwrapper_p file
961 # True iff FILE is a libtool wrapper script or wrapper executable
962 # This function is only a basic sanity check; it will hardly flush out
963 # determined imposters.
964 func_ltwrapper_p ()
965 {
966 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
967 }
968
969
970 # func_execute_cmds commands fail_cmd
971 # Execute tilde-delimited COMMANDS.
972 # If FAIL_CMD is given, eval that upon failure.
973 # FAIL_CMD may read-access the current command in variable CMD!
974 func_execute_cmds ()
975 {
976 $opt_debug
977 save_ifs=$IFS; IFS='~'
978 for cmd in $1; do
979 IFS=$save_ifs
980 eval cmd=\"$cmd\"
981 func_show_eval "$cmd" "${2-:}"
982 done
983 IFS=$save_ifs
984 }
985
986
987 # func_source file
988 # Source FILE, adding directory component if necessary.
989 # Note that it is not necessary on cygwin/mingw to append a dot to
990 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
991 # behavior happens only for exec(3), not for open(2)! Also, sourcing
992 # `FILE.' does not work on cygwin managed mounts.
993 func_source ()
994 {
995 $opt_debug
996 case $1 in
997 */* | *\\*) . "$1" ;;
998 *) . "./$1" ;;
999 esac
1000 }
1001
1002
1003 # func_infer_tag arg
1004 # Infer tagged configuration to use if any are available and
1005 # if one wasn't chosen via the "--tag" command line option.
1006 # Only attempt this if the compiler in the base compile
1007 # command doesn't match the default compiler.
1008 # arg is usually of the form 'gcc ...'
1009 func_infer_tag ()
1010 {
1011 $opt_debug
1012 if test -n "$available_tags" && test -z "$tagname"; then
1013 CC_quoted=
1014 for arg in $CC; do
1015 func_quote_for_eval "$arg"
1016 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1017 done
1018 case $@ in
1019 # Blanks in the command may have been stripped by the calling shell,
1020 # but not from the CC environment variable when configure was run.
1021 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1022 # Blanks at the start of $base_compile will cause this to fail
1023 # if we don't check for them as well.
1024 *)
1025 for z in $available_tags; do
1026 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1027 # Evaluate the configuration.
1028 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1029 CC_quoted=
1030 for arg in $CC; do
1031 # Double-quote args containing other shell metacharacters.
1032 func_quote_for_eval "$arg"
1033 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1034 done
1035 case "$@ " in
1036 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1037 # The compiler in the base compile command matches
1038 # the one in the tagged configuration.
1039 # Assume this is the tagged configuration we want.
1040 tagname=$z
1041 break
1042 ;;
1043 esac
1044 fi
1045 done
1046 # If $tagname still isn't set, then no tagged configuration
1047 # was found and let the user know that the "--tag" command
1048 # line option must be used.
1049 if test -z "$tagname"; then
1050 func_echo "unable to infer tagged configuration"
1051 func_fatal_error "specify a tag with \`--tag'"
1052 # else
1053 # func_verbose "using $tagname tagged configuration"
1054 fi
1055 ;;
1056 esac
1057 fi
1058 }
1059
1060
1061
1062 # func_write_libtool_object output_name pic_name nonpic_name
1063 # Create a libtool object file (analogous to a ".la" file),
1064 # but don't create it if we're doing a dry run.
1065 func_write_libtool_object ()
1066 {
1067 write_libobj=${1}
1068 if test "$build_libtool_libs" = yes; then
1069 write_lobj=\'${2}\'
1070 else
1071 write_lobj=none
1072 fi
1073
1074 if test "$build_old_libs" = yes; then
1075 write_oldobj=\'${3}\'
1076 else
1077 write_oldobj=none
1078 fi
1079
1080 $opt_dry_run || {
1081 cat >${write_libobj}T <<EOF
1082 # $write_libobj - a libtool object file
1083 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1084 #
1085 # Please DO NOT delete this file!
1086 # It is necessary for linking the library.
1087
1088 # Name of the PIC object.
1089 pic_object=$write_lobj
1090
1091 # Name of the non-PIC object
1092 non_pic_object=$write_oldobj
1093
1094 EOF
1095 $MV "${write_libobj}T" "${write_libobj}"
1096 }
1097 }
1098
1099 # func_mode_compile arg...
1100 func_mode_compile ()
1101 {
1102 $opt_debug
1103 # Get the compilation command and the source file.
1104 base_compile=
1105 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1106 suppress_opt=yes
1107 suppress_output=
1108 arg_mode=normal
1109 libobj=
1110 later=
1111 pie_flag=
1112
1113 for arg
1114 do
1115 case $arg_mode in
1116 arg )
1117 # do not "continue". Instead, add this to base_compile
1118 lastarg="$arg"
1119 arg_mode=normal
1120 ;;
1121
1122 target )
1123 libobj="$arg"
1124 arg_mode=normal
1125 continue
1126 ;;
1127
1128 normal )
1129 # Accept any command-line options.
1130 case $arg in
1131 -o)
1132 test -n "$libobj" && \
1133 func_fatal_error "you cannot specify \`-o' more than once"
1134 arg_mode=target
1135 continue
1136 ;;
1137
1138 -pie | -fpie | -fPIE)
1139 pie_flag="$pie_flag $arg"
1140 continue
1141 ;;
1142
1143 -shared | -static | -prefer-pic | -prefer-non-pic)
1144 later="$later $arg"
1145 continue
1146 ;;
1147
1148 -no-suppress)
1149 suppress_opt=no
1150 continue
1151 ;;
1152
1153 -Xcompiler)
1154 arg_mode=arg # the next one goes into the "base_compile" arg list
1155 continue # The current "srcfile" will either be retained or
1156 ;; # replaced later. I would guess that would be a bug.
1157
1158 -Wc,*)
1159 func_stripname '-Wc,' '' "$arg"
1160 args=$func_stripname_result
1161 lastarg=
1162 save_ifs="$IFS"; IFS=','
1163 for arg in $args; do
1164 IFS="$save_ifs"
1165 func_quote_for_eval "$arg"
1166 lastarg="$lastarg $func_quote_for_eval_result"
1167 done
1168 IFS="$save_ifs"
1169 func_stripname ' ' '' "$lastarg"
1170 lastarg=$func_stripname_result
1171
1172 # Add the arguments to base_compile.
1173 base_compile="$base_compile $lastarg"
1174 continue
1175 ;;
1176
1177 *)
1178 # Accept the current argument as the source file.
1179 # The previous "srcfile" becomes the current argument.
1180 #
1181 lastarg="$srcfile"
1182 srcfile="$arg"
1183 ;;
1184 esac # case $arg
1185 ;;
1186 esac # case $arg_mode
1187
1188 # Aesthetically quote the previous argument.
1189 func_quote_for_eval "$lastarg"
1190 base_compile="$base_compile $func_quote_for_eval_result"
1191 done # for arg
1192
1193 case $arg_mode in
1194 arg)
1195 func_fatal_error "you must specify an argument for -Xcompile"
1196 ;;
1197 target)
1198 func_fatal_error "you must specify a target with \`-o'"
1199 ;;
1200 *)
1201 # Get the name of the library object.
1202 test -z "$libobj" && {
1203 func_basename "$srcfile"
1204 libobj="$func_basename_result"
1205 }
1206 ;;
1207 esac
1208
1209 # Recognize several different file suffixes.
1210 # If the user specifies -o file.o, it is replaced with file.lo
1211 case $libobj in
1212 *.[cCFSifmso] | \
1213 *.ada | *.adb | *.ads | *.asm | \
1214 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1215 *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1216 func_xform "$libobj"
1217 libobj=$func_xform_result
1218 ;;
1219 esac
1220
1221 case $libobj in
1222 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1223 *)
1224 func_fatal_error "cannot determine name of library object from \`$libobj'"
1225 ;;
1226 esac
1227
1228 func_infer_tag $base_compile
1229
1230 for arg in $later; do
1231 case $arg in
1232 -shared)
1233 test "$build_libtool_libs" != yes && \
1234 func_fatal_configuration "can not build a shared library"
1235 build_old_libs=no
1236 continue
1237 ;;
1238
1239 -static)
1240 build_libtool_libs=no
1241 build_old_libs=yes
1242 continue
1243 ;;
1244
1245 -prefer-pic)
1246 pic_mode=yes
1247 continue
1248 ;;
1249
1250 -prefer-non-pic)
1251 pic_mode=no
1252 continue
1253 ;;
1254 esac
1255 done
1256
1257 func_quote_for_eval "$libobj"
1258 test "X$libobj" != "X$func_quote_for_eval_result" \
1259 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1260 && func_warning "libobj name \`$libobj' may not contain shell special characters."
1261 func_dirname_and_basename "$obj" "/" ""
1262 objname="$func_basename_result"
1263 xdir="$func_dirname_result"
1264 lobj=${xdir}$objdir/$objname
1265
1266 test -z "$base_compile" && \
1267 func_fatal_help "you must specify a compilation command"
1268
1269 # Delete any leftover library objects.
1270 if test "$build_old_libs" = yes; then
1271 removelist="$obj $lobj $libobj ${libobj}T"
1272 else
1273 removelist="$lobj $libobj ${libobj}T"
1274 fi
1275
1276 # On Cygwin there's no "real" PIC flag so we must build both object types
1277 case $host_os in
1278 cygwin* | mingw* | pw32* | os2* | cegcc*)
1279 pic_mode=default
1280 ;;
1281 esac
1282 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1283 # non-PIC code in shared libraries is not supported
1284 pic_mode=default
1285 fi
1286
1287 # Calculate the filename of the output object if compiler does
1288 # not support -o with -c
1289 if test "$compiler_c_o" = no; then
1290 output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1291 lockfile="$output_obj.lock"
1292 else
1293 output_obj=
1294 need_locks=no
1295 lockfile=
1296 fi
1297
1298 # Lock this critical section if it is needed
1299 # We use this script file to make the link, it avoids creating a new file
1300 if test "$need_locks" = yes; then
1301 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1302 func_echo "Waiting for $lockfile to be removed"
1303 sleep 2
1304 done
1305 elif test "$need_locks" = warn; then
1306 if test -f "$lockfile"; then
1307 $ECHO "\
1308 *** ERROR, $lockfile exists and contains:
1309 `cat $lockfile 2>/dev/null`
1310
1311 This indicates that another process is trying to use the same
1312 temporary object file, and libtool could not work around it because
1313 your compiler does not support \`-c' and \`-o' together. If you
1314 repeat this compilation, it may succeed, by chance, but you had better
1315 avoid parallel builds (make -j) in this platform, or get a better
1316 compiler."
1317
1318 $opt_dry_run || $RM $removelist
1319 exit $EXIT_FAILURE
1320 fi
1321 removelist="$removelist $output_obj"
1322 $ECHO "$srcfile" > "$lockfile"
1323 fi
1324
1325 $opt_dry_run || $RM $removelist
1326 removelist="$removelist $lockfile"
1327 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1328
1329 if test -n "$fix_srcfile_path"; then
1330 eval srcfile=\"$fix_srcfile_path\"
1331 fi
1332 func_quote_for_eval "$srcfile"
1333 qsrcfile=$func_quote_for_eval_result
1334
1335 # Only build a PIC object if we are building libtool libraries.
1336 if test "$build_libtool_libs" = yes; then
1337 # Without this assignment, base_compile gets emptied.
1338 fbsd_hideous_sh_bug=$base_compile
1339
1340 if test "$pic_mode" != no; then
1341 command="$base_compile $qsrcfile $pic_flag"
1342 else
1343 # Don't build PIC code
1344 command="$base_compile $qsrcfile"
1345 fi
1346
1347 func_mkdir_p "$xdir$objdir"
1348
1349 if test -z "$output_obj"; then
1350 # Place PIC objects in $objdir
1351 command="$command -o $lobj"
1352 fi
1353
1354 func_show_eval_locale "$command" \
1355 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1356
1357 if test "$need_locks" = warn &&
1358 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1359 $ECHO "\
1360 *** ERROR, $lockfile contains:
1361 `cat $lockfile 2>/dev/null`
1362
1363 but it should contain:
1364 $srcfile
1365
1366 This indicates that another process is trying to use the same
1367 temporary object file, and libtool could not work around it because
1368 your compiler does not support \`-c' and \`-o' together. If you
1369 repeat this compilation, it may succeed, by chance, but you had better
1370 avoid parallel builds (make -j) in this platform, or get a better
1371 compiler."
1372
1373 $opt_dry_run || $RM $removelist
1374 exit $EXIT_FAILURE
1375 fi
1376
1377 # Just move the object if needed, then go on to compile the next one
1378 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1379 func_show_eval '$MV "$output_obj" "$lobj"' \
1380 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1381 fi
1382
1383 # Allow error messages only from the first compilation.
1384 if test "$suppress_opt" = yes; then
1385 suppress_output=' >/dev/null 2>&1'
1386 fi
1387 fi
1388
1389 # Only build a position-dependent object if we build old libraries.
1390 if test "$build_old_libs" = yes; then
1391 if test "$pic_mode" != yes; then
1392 # Don't build PIC code
1393 command="$base_compile $qsrcfile$pie_flag"
1394 else
1395 command="$base_compile $qsrcfile $pic_flag"
1396 fi
1397 if test "$compiler_c_o" = yes; then
1398 command="$command -o $obj"
1399 fi
1400
1401 # Suppress compiler output if we already did a PIC compilation.
1402 command="$command$suppress_output"
1403 func_show_eval_locale "$command" \
1404 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1405
1406 if test "$need_locks" = warn &&
1407 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1408 $ECHO "\
1409 *** ERROR, $lockfile contains:
1410 `cat $lockfile 2>/dev/null`
1411
1412 but it should contain:
1413 $srcfile
1414
1415 This indicates that another process is trying to use the same
1416 temporary object file, and libtool could not work around it because
1417 your compiler does not support \`-c' and \`-o' together. If you
1418 repeat this compilation, it may succeed, by chance, but you had better
1419 avoid parallel builds (make -j) in this platform, or get a better
1420 compiler."
1421
1422 $opt_dry_run || $RM $removelist
1423 exit $EXIT_FAILURE
1424 fi
1425
1426 # Just move the object if needed
1427 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1428 func_show_eval '$MV "$output_obj" "$obj"' \
1429 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1430 fi
1431 fi
1432
1433 $opt_dry_run || {
1434 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1435
1436 # Unlock the critical section if it was locked
1437 if test "$need_locks" != no; then
1438 removelist=$lockfile
1439 $RM "$lockfile"
1440 fi
1441 }
1442
1443 exit $EXIT_SUCCESS
1444 }
1445
1446 $opt_help || {
1447 test "$mode" = compile && func_mode_compile ${1+"$@"}
1448 }
1449
1450 func_mode_help ()
1451 {
1452 # We need to display help for each of the modes.
1453 case $mode in
1454 "")
1455 # Generic help is extracted from the usage comments
1456 # at the start of this file.
1457 func_help
1458 ;;
1459
1460 clean)
1461 $ECHO \
1462 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1463
1464 Remove files from the build directory.
1465
1466 RM is the name of the program to use to delete files associated with each FILE
1467 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1468 to RM.
1469
1470 If FILE is a libtool library, object or program, all the files associated
1471 with it are deleted. Otherwise, only FILE itself is deleted using RM."
1472 ;;
1473
1474 compile)
1475 $ECHO \
1476 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1477
1478 Compile a source file into a libtool library object.
1479
1480 This mode accepts the following additional options:
1481
1482 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1483 -no-suppress do not suppress compiler output for multiple passes
1484 -prefer-pic try to building PIC objects only
1485 -prefer-non-pic try to building non-PIC objects only
1486 -shared do not build a \`.o' file suitable for static linking
1487 -static only build a \`.o' file suitable for static linking
1488
1489 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1490 from the given SOURCEFILE.
1491
1492 The output file name is determined by removing the directory component from
1493 SOURCEFILE, then substituting the C source code suffix \`.c' with the
1494 library object suffix, \`.lo'."
1495 ;;
1496
1497 execute)
1498 $ECHO \
1499 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1500
1501 Automatically set library path, then run a program.
1502
1503 This mode accepts the following additional options:
1504
1505 -dlopen FILE add the directory containing FILE to the library path
1506
1507 This mode sets the library path environment variable according to \`-dlopen'
1508 flags.
1509
1510 If any of the ARGS are libtool executable wrappers, then they are translated
1511 into their corresponding uninstalled binary, and any of their required library
1512 directories are added to the library path.
1513
1514 Then, COMMAND is executed, with ARGS as arguments."
1515 ;;
1516
1517 finish)
1518 $ECHO \
1519 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
1520
1521 Complete the installation of libtool libraries.
1522
1523 Each LIBDIR is a directory that contains libtool libraries.
1524
1525 The commands that this mode executes may require superuser privileges. Use
1526 the \`--dry-run' option if you just want to see what would be executed."
1527 ;;
1528
1529 install)
1530 $ECHO \
1531 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1532
1533 Install executables or libraries.
1534
1535 INSTALL-COMMAND is the installation command. The first component should be
1536 either the \`install' or \`cp' program.
1537
1538 The following components of INSTALL-COMMAND are treated specially:
1539
1540 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
1541
1542 The rest of the components are interpreted as arguments to that command (only
1543 BSD-compatible install options are recognized)."
1544 ;;
1545
1546 link)
1547 $ECHO \
1548 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
1549
1550 Link object files or libraries together to form another library, or to
1551 create an executable program.
1552
1553 LINK-COMMAND is a command using the C compiler that you would use to create
1554 a program from several object files.
1555
1556 The following components of LINK-COMMAND are treated specially:
1557
1558 -all-static do not do any dynamic linking at all
1559 -avoid-version do not add a version suffix if possible
1560 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
1561 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
1562 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1563 -export-symbols SYMFILE
1564 try to export only the symbols listed in SYMFILE
1565 -export-symbols-regex REGEX
1566 try to export only the symbols matching REGEX
1567 -LLIBDIR search LIBDIR for required installed libraries
1568 -lNAME OUTPUT-FILE requires the installed library libNAME
1569 -module build a library that can dlopened
1570 -no-fast-install disable the fast-install mode
1571 -no-install link a not-installable executable
1572 -no-undefined declare that a library does not refer to external symbols
1573 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
1574 -objectlist FILE Use a list of object files found in FILE to specify objects
1575 -precious-files-regex REGEX
1576 don't remove output files matching REGEX
1577 -release RELEASE specify package release information
1578 -rpath LIBDIR the created library will eventually be installed in LIBDIR
1579 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
1580 -shared only do dynamic linking of libtool libraries
1581 -shrext SUFFIX override the standard shared library file extension
1582 -static do not do any dynamic linking of uninstalled libtool libraries
1583 -static-libtool-libs
1584 do not do any dynamic linking of libtool libraries
1585 -version-info CURRENT[:REVISION[:AGE]]
1586 specify library version info [each variable defaults to 0]
1587 -weak LIBNAME declare that the target provides the LIBNAME interface
1588
1589 All other options (arguments beginning with \`-') are ignored.
1590
1591 Every other argument is treated as a filename. Files ending in \`.la' are
1592 treated as uninstalled libtool libraries, other files are standard or library
1593 object files.
1594
1595 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
1596 only library objects (\`.lo' files) may be specified, and \`-rpath' is
1597 required, except when creating a convenience library.
1598
1599 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
1600 using \`ar' and \`ranlib', or on Windows using \`lib'.
1601
1602 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
1603 is created, otherwise an executable program is created."
1604 ;;
1605
1606 uninstall)
1607 $ECHO \
1608 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1609
1610 Remove libraries from an installation directory.
1611
1612 RM is the name of the program to use to delete files associated with each FILE
1613 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1614 to RM.
1615
1616 If FILE is a libtool library, all the files associated with it are deleted.
1617 Otherwise, only FILE itself is deleted using RM."
1618 ;;
1619
1620 *)
1621 func_fatal_help "invalid operation mode \`$mode'"
1622 ;;
1623 esac
1624
1625 $ECHO
1626 $ECHO "Try \`$progname --help' for more information about other modes."
1627
1628 exit $?
1629 }
1630
1631 # Now that we've collected a possible --mode arg, show help if necessary
1632 $opt_help && func_mode_help
1633
1634
1635 # func_mode_execute arg...
1636 func_mode_execute ()
1637 {
1638 $opt_debug
1639 # The first argument is the command name.
1640 cmd="$nonopt"
1641 test -z "$cmd" && \
1642 func_fatal_help "you must specify a COMMAND"
1643
1644 # Handle -dlopen flags immediately.
1645 for file in $execute_dlfiles; do
1646 test -f "$file" \
1647 || func_fatal_help "\`$file' is not a file"
1648
1649 dir=
1650 case $file in
1651 *.la)
1652 # Check to see that this really is a libtool archive.
1653 func_lalib_unsafe_p "$file" \
1654 || func_fatal_help "\`$lib' is not a valid libtool archive"
1655
1656 # Read the libtool library.
1657 dlname=
1658 library_names=
1659 func_source "$file"
1660
1661 # Skip this library if it cannot be dlopened.
1662 if test -z "$dlname"; then
1663 # Warn if it was a shared library.
1664 test -n "$library_names" && \
1665 func_warning "\`$file' was not linked with \`-export-dynamic'"
1666 continue
1667 fi
1668
1669 func_dirname "$file" "" "."
1670 dir="$func_dirname_result"
1671
1672 if test -f "$dir/$objdir/$dlname"; then
1673 dir="$dir/$objdir"
1674 else
1675 if test ! -f "$dir/$dlname"; then
1676 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1677 fi
1678 fi
1679 ;;
1680
1681 *.lo)
1682 # Just add the directory containing the .lo file.
1683 func_dirname "$file" "" "."
1684 dir="$func_dirname_result"
1685 ;;
1686
1687 *)
1688 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
1689 continue
1690 ;;
1691 esac
1692
1693 # Get the absolute pathname.
1694 absdir=`cd "$dir" && pwd`
1695 test -n "$absdir" && dir="$absdir"
1696
1697 # Now add the directory to shlibpath_var.
1698 if eval "test -z \"\$$shlibpath_var\""; then
1699 eval "$shlibpath_var=\"\$dir\""
1700 else
1701 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1702 fi
1703 done
1704
1705 # This variable tells wrapper scripts just to set shlibpath_var
1706 # rather than running their programs.
1707 libtool_execute_magic="$magic"
1708
1709 # Check if any of the arguments is a wrapper script.
1710 args=
1711 for file
1712 do
1713 case $file in
1714 -*) ;;
1715 *)
1716 # Do a test to see if this is really a libtool program.
1717 if func_ltwrapper_script_p "$file"; then
1718 func_source "$file"
1719 # Transform arg to wrapped name.
1720 file="$progdir/$program"
1721 elif func_ltwrapper_executable_p "$file"; then
1722 func_ltwrapper_scriptname "$file"
1723 func_source "$func_ltwrapper_scriptname_result"
1724 # Transform arg to wrapped name.
1725 file="$progdir/$program"
1726 fi
1727 ;;
1728 esac
1729 # Quote arguments (to preserve shell metacharacters).
1730 func_quote_for_eval "$file"
1731 args="$args $func_quote_for_eval_result"
1732 done
1733
1734 if test "X$opt_dry_run" = Xfalse; then
1735 if test -n "$shlibpath_var"; then
1736 # Export the shlibpath_var.
1737 eval "export $shlibpath_var"
1738 fi
1739
1740 # Restore saved environment variables
1741 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
1742 do
1743 eval "if test \"\${save_$lt_var+set}\" = set; then
1744 $lt_var=\$save_$lt_var; export $lt_var
1745 else
1746 $lt_unset $lt_var
1747 fi"
1748 done
1749
1750 # Now prepare to actually exec the command.
1751 exec_cmd="\$cmd$args"
1752 else
1753 # Display what would be done.
1754 if test -n "$shlibpath_var"; then
1755 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1756 $ECHO "export $shlibpath_var"
1757 fi
1758 $ECHO "$cmd$args"
1759 exit $EXIT_SUCCESS
1760 fi
1761 }
1762
1763 test "$mode" = execute && func_mode_execute ${1+"$@"}
1764
1765
1766 # func_mode_finish arg...
1767 func_mode_finish ()
1768 {
1769 $opt_debug
1770 libdirs="$nonopt"
1771 admincmds=
1772
1773 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1774 for dir
1775 do
1776 libdirs="$libdirs $dir"
1777 done
1778
1779 for libdir in $libdirs; do
1780 if test -n "$finish_cmds"; then
1781 # Do each command in the finish commands.
1782 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
1783 '"$cmd"'"'
1784 fi
1785 if test -n "$finish_eval"; then
1786 # Do the single finish_eval.
1787 eval cmds=\"$finish_eval\"
1788 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
1789 $cmds"
1790 fi
1791 done
1792 fi
1793
1794 # Exit here if they wanted silent mode.
1795 $opt_silent && exit $EXIT_SUCCESS
1796
1797 $ECHO "X----------------------------------------------------------------------" | $Xsed
1798 $ECHO "Libraries have been installed in:"
1799 for libdir in $libdirs; do
1800 $ECHO " $libdir"
1801 done
1802 $ECHO
1803 $ECHO "If you ever happen to want to link against installed libraries"
1804 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1805 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1806 $ECHO "flag during linking and do at least one of the following:"
1807 if test -n "$shlibpath_var"; then
1808 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
1809 $ECHO " during execution"
1810 fi
1811 if test -n "$runpath_var"; then
1812 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
1813 $ECHO " during linking"
1814 fi
1815 if test -n "$hardcode_libdir_flag_spec"; then
1816 libdir=LIBDIR
1817 eval flag=\"$hardcode_libdir_flag_spec\"
1818
1819 $ECHO " - use the \`$flag' linker flag"
1820 fi
1821 if test -n "$admincmds"; then
1822 $ECHO " - have your system administrator run these commands:$admincmds"
1823 fi
1824 if test -f /etc/ld.so.conf; then
1825 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1826 fi
1827 $ECHO
1828
1829 $ECHO "See any operating system documentation about shared libraries for"
1830 case $host in
1831 solaris2.[6789]|solaris2.1[0-9])
1832 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1833 $ECHO "pages."
1834 ;;
1835 *)
1836 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
1837 ;;
1838 esac
1839 $ECHO "X----------------------------------------------------------------------" | $Xsed
1840 exit $EXIT_SUCCESS
1841 }
1842
1843 test "$mode" = finish && func_mode_finish ${1+"$@"}
1844
1845
1846 # func_mode_install arg...
1847 func_mode_install ()
1848 {
1849 $opt_debug
1850 # There may be an optional sh(1) argument at the beginning of
1851 # install_prog (especially on Windows NT).
1852 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1853 # Allow the use of GNU shtool's install command.
1854 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
1855 # Aesthetically quote it.
1856 func_quote_for_eval "$nonopt"
1857 install_prog="$func_quote_for_eval_result "
1858 arg=$1
1859 shift
1860 else
1861 install_prog=
1862 arg=$nonopt
1863 fi
1864
1865 # The real first argument should be the name of the installation program.
1866 # Aesthetically quote it.
1867 func_quote_for_eval "$arg"
1868 install_prog="$install_prog$func_quote_for_eval_result"
1869
1870 # We need to accept at least all the BSD install flags.
1871 dest=
1872 files=
1873 opts=
1874 prev=
1875 install_type=
1876 isdir=no
1877 stripme=
1878 for arg
1879 do
1880 if test -n "$dest"; then
1881 files="$files $dest"
1882 dest=$arg
1883 continue
1884 fi
1885
1886 case $arg in
1887 -d) isdir=yes ;;
1888 -f)
1889 case " $install_prog " in
1890 *[\\\ /]cp\ *) ;;
1891 *) prev=$arg ;;
1892 esac
1893 ;;
1894 -g | -m | -o)
1895 prev=$arg
1896 ;;
1897 -s)
1898 stripme=" -s"
1899 continue
1900 ;;
1901 -*)
1902 ;;
1903 *)
1904 # If the previous option needed an argument, then skip it.
1905 if test -n "$prev"; then
1906 prev=
1907 else
1908 dest=$arg
1909 continue
1910 fi
1911 ;;
1912 esac
1913
1914 # Aesthetically quote the argument.
1915 func_quote_for_eval "$arg"
1916 install_prog="$install_prog $func_quote_for_eval_result"
1917 done
1918
1919 test -z "$install_prog" && \
1920 func_fatal_help "you must specify an install program"
1921
1922 test -n "$prev" && \
1923 func_fatal_help "the \`$prev' option requires an argument"
1924
1925 if test -z "$files"; then
1926 if test -z "$dest"; then
1927 func_fatal_help "no file or destination specified"
1928 else
1929 func_fatal_help "you must specify a destination"
1930 fi
1931 fi
1932
1933 # Strip any trailing slash from the destination.
1934 func_stripname '' '/' "$dest"
1935 dest=$func_stripname_result
1936
1937 # Check to see that the destination is a directory.
1938 test -d "$dest" && isdir=yes
1939 if test "$isdir" = yes; then
1940 destdir="$dest"
1941 destname=
1942 else
1943 func_dirname_and_basename "$dest" "" "."
1944 destdir="$func_dirname_result"
1945 destname="$func_basename_result"
1946
1947 # Not a directory, so check to see that there is only one file specified.
1948 set dummy $files; shift
1949 test "$#" -gt 1 && \
1950 func_fatal_help "\`$dest' is not a directory"
1951 fi
1952 case $destdir in
1953 [\\/]* | [A-Za-z]:[\\/]*) ;;
1954 *)
1955 for file in $files; do
1956 case $file in
1957 *.lo) ;;
1958 *)
1959 func_fatal_help "\`$destdir' must be an absolute directory name"
1960 ;;
1961 esac
1962 done
1963 ;;
1964 esac
1965
1966 # This variable tells wrapper scripts just to set variables rather
1967 # than running their programs.
1968 libtool_install_magic="$magic"
1969
1970 staticlibs=
1971 future_libdirs=
1972 current_libdirs=
1973 for file in $files; do
1974
1975 # Do each installation.
1976 case $file in
1977 *.$libext)
1978 # Do the static libraries later.
1979 staticlibs="$staticlibs $file"
1980 ;;
1981
1982 *.la)
1983 # Check to see that this really is a libtool archive.
1984 func_lalib_unsafe_p "$file" \
1985 || func_fatal_help "\`$file' is not a valid libtool archive"
1986
1987 library_names=
1988 old_library=
1989 relink_command=
1990 func_source "$file"
1991
1992 # Add the libdir to current_libdirs if it is the destination.
1993 if test "X$destdir" = "X$libdir"; then
1994 case "$current_libdirs " in
1995 *" $libdir "*) ;;
1996 *) current_libdirs="$current_libdirs $libdir" ;;
1997 esac
1998 else
1999 # Note the libdir as a future libdir.
2000 case "$future_libdirs " in
2001 *" $libdir "*) ;;
2002 *) future_libdirs="$future_libdirs $libdir" ;;
2003 esac
2004 fi
2005
2006 func_dirname "$file" "/" ""
2007 dir="$func_dirname_result"
2008 dir="$dir$objdir"
2009
2010 if test -n "$relink_command"; then
2011 # Determine the prefix the user has applied to our future dir.
2012 inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2013
2014 # Don't allow the user to place us outside of our expected
2015 # location b/c this prevents finding dependent libraries that
2016 # are installed to the same prefix.
2017 # At present, this check doesn't affect windows .dll's that
2018 # are installed into $libdir/../bin (currently, that works fine)
2019 # but it's something to keep an eye on.
2020 test "$inst_prefix_dir" = "$destdir" && \
2021 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2022
2023 if test -n "$inst_prefix_dir"; then
2024 # Stick the inst_prefix_dir data into the link command.
2025 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2026 else
2027 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2028 fi
2029
2030 func_warning "relinking \`$file'"
2031 func_show_eval "$relink_command" \
2032 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2033 fi
2034
2035 # See the names of the shared library.
2036 set dummy $library_names; shift
2037 if test -n "$1"; then
2038 realname="$1"
2039 shift
2040
2041 srcname="$realname"
2042 test -n "$relink_command" && srcname="$realname"T
2043
2044 # Install the shared library and build the symlinks.
2045 func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2046 'exit $?'
2047 tstripme="$stripme"
2048 case $host_os in
2049 cygwin* | mingw* | pw32* | cegcc*)
2050 case $realname in
2051 *.dll.a)
2052 tstripme=""
2053 ;;
2054 esac
2055 ;;
2056 esac
2057 if test -n "$tstripme" && test -n "$striplib"; then
2058 func_show_eval "$striplib $destdir/$realname" 'exit $?'
2059 fi
2060
2061 if test "$#" -gt 0; then
2062 # Delete the old symlinks, and create new ones.
2063 # Try `ln -sf' first, because the `ln' binary might depend on
2064 # the symlink we replace! Solaris /bin/ln does not understand -f,
2065 # so we also need to try rm && ln -s.
2066 for linkname
2067 do
2068 test "$linkname" != "$realname" \
2069 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2070 done
2071 fi
2072
2073 # Do each command in the postinstall commands.
2074 lib="$destdir/$realname"
2075 func_execute_cmds "$postinstall_cmds" 'exit $?'
2076 fi
2077
2078 # Install the pseudo-library for information purposes.
2079 func_basename "$file"
2080 name="$func_basename_result"
2081 instname="$dir/$name"i
2082 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2083
2084 # Maybe install the static library, too.
2085 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2086 ;;
2087
2088 *.lo)
2089 # Install (i.e. copy) a libtool object.
2090
2091 # Figure out destination file name, if it wasn't already specified.
2092 if test -n "$destname"; then
2093 destfile="$destdir/$destname"
2094 else
2095 func_basename "$file"
2096 destfile="$func_basename_result"
2097 destfile="$destdir/$destfile"
2098 fi
2099
2100 # Deduce the name of the destination old-style object file.
2101 case $destfile in
2102 *.lo)
2103 func_lo2o "$destfile"
2104 staticdest=$func_lo2o_result
2105 ;;
2106 *.$objext)
2107 staticdest="$destfile"
2108 destfile=
2109 ;;
2110 *)
2111 func_fatal_help "cannot copy a libtool object to \`$destfile'"
2112 ;;
2113 esac
2114
2115 # Install the libtool object if requested.
2116 test -n "$destfile" && \
2117 func_show_eval "$install_prog $file $destfile" 'exit $?'
2118
2119 # Install the old object if enabled.
2120 if test "$build_old_libs" = yes; then
2121 # Deduce the name of the old-style object file.
2122 func_lo2o "$file"
2123 staticobj=$func_lo2o_result
2124 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2125 fi
2126 exit $EXIT_SUCCESS
2127 ;;
2128
2129 *)
2130 # Figure out destination file name, if it wasn't already specified.
2131 if test -n "$destname"; then
2132 destfile="$destdir/$destname"
2133 else
2134 func_basename "$file"
2135 destfile="$func_basename_result"
2136 destfile="$destdir/$destfile"
2137 fi
2138
2139 # If the file is missing, and there is a .exe on the end, strip it
2140 # because it is most likely a libtool script we actually want to
2141 # install
2142 stripped_ext=""
2143 case $file in
2144 *.exe)
2145 if test ! -f "$file"; then
2146 func_stripname '' '.exe' "$file"
2147 file=$func_stripname_result
2148 stripped_ext=".exe"
2149 fi
2150 ;;
2151 esac
2152
2153 # Do a test to see if this is really a libtool program.
2154 case $host in
2155 *cygwin* | *mingw*)
2156 if func_ltwrapper_executable_p "$file"; then
2157 func_ltwrapper_scriptname "$file"
2158 wrapper=$func_ltwrapper_scriptname_result
2159 else
2160 func_stripname '' '.exe' "$file"
2161 wrapper=$func_stripname_result
2162 fi
2163 ;;
2164 *)
2165 wrapper=$file
2166 ;;
2167 esac
2168 if func_ltwrapper_script_p "$wrapper"; then
2169 notinst_deplibs=
2170 relink_command=
2171
2172 func_source "$wrapper"
2173
2174 # Check the variables that should have been set.
2175 test -z "$generated_by_libtool_version" && \
2176 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2177
2178 finalize=yes
2179 for lib in $notinst_deplibs; do
2180 # Check to see that each library is installed.
2181 libdir=
2182 if test -f "$lib"; then
2183 func_source "$lib"
2184 fi
2185 libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2186 if test -n "$libdir" && test ! -f "$libfile"; then
2187 func_warning "\`$lib' has not been installed in \`$libdir'"
2188 finalize=no
2189 fi
2190 done
2191
2192 relink_command=
2193 func_source "$wrapper"
2194
2195 outputname=
2196 if test "$fast_install" = no && test -n "$relink_command"; then
2197 $opt_dry_run || {
2198 if test "$finalize" = yes; then
2199 tmpdir=`func_mktempdir`
2200 func_basename "$file$stripped_ext"
2201 file="$func_basename_result"
2202 outputname="$tmpdir/$file"
2203 # Replace the output file specification.
2204 relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2205
2206 $opt_silent || {
2207 func_quote_for_expand "$relink_command"
2208 eval "func_echo $func_quote_for_expand_result"
2209 }
2210 if eval "$relink_command"; then :
2211 else
2212 func_error "error: relink \`$file' with the above command before installing it"
2213 $opt_dry_run || ${RM}r "$tmpdir"
2214 continue
2215 fi
2216 file="$outputname"
2217 else
2218 func_warning "cannot relink \`$file'"
2219 fi
2220 }
2221 else
2222 # Install the binary that we compiled earlier.
2223 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2224 fi
2225 fi
2226
2227 # remove .exe since cygwin /usr/bin/install will append another
2228 # one anyway
2229 case $install_prog,$host in
2230 */usr/bin/install*,*cygwin*)
2231 case $file:$destfile in
2232 *.exe:*.exe)
2233 # this is ok
2234 ;;
2235 *.exe:*)
2236 destfile=$destfile.exe
2237 ;;
2238 *:*.exe)
2239 func_stripname '' '.exe' "$destfile"
2240 destfile=$func_stripname_result
2241 ;;
2242 esac
2243 ;;
2244 esac
2245 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2246 $opt_dry_run || if test -n "$outputname"; then
2247 ${RM}r "$tmpdir"
2248 fi
2249 ;;
2250 esac
2251 done
2252
2253 for file in $staticlibs; do
2254 func_basename "$file"
2255 name="$func_basename_result"
2256
2257 # Set up the ranlib parameters.
2258 oldlib="$destdir/$name"
2259
2260 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2261
2262 if test -n "$stripme" && test -n "$old_striplib"; then
2263 func_show_eval "$old_striplib $oldlib" 'exit $?'
2264 fi
2265
2266 # Do each command in the postinstall commands.
2267 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2268 done
2269
2270 test -n "$future_libdirs" && \
2271 func_warning "remember to run \`$progname --finish$future_libdirs'"
2272
2273 if test -n "$current_libdirs"; then
2274 # Maybe just do a dry run.
2275 $opt_dry_run && current_libdirs=" -n$current_libdirs"
2276 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2277 else
2278 exit $EXIT_SUCCESS
2279 fi
2280 }
2281
2282 test "$mode" = install && func_mode_install ${1+"$@"}
2283
2284
2285 # func_generate_dlsyms outputname originator pic_p
2286 # Extract symbols from dlprefiles and create ${outputname}S.o with
2287 # a dlpreopen symbol table.
2288 func_generate_dlsyms ()
2289 {
2290 $opt_debug
2291 my_outputname="$1"
2292 my_originator="$2"
2293 my_pic_p="${3-no}"
2294 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2295 my_dlsyms=
2296
2297 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2298 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2299 my_dlsyms="${my_outputname}S.c"
2300 else
2301 func_error "not configured to extract global symbols from dlpreopened files"
2302 fi
2303 fi
2304
2305 if test -n "$my_dlsyms"; then
2306 case $my_dlsyms in
2307 "") ;;
2308 *.c)
2309 # Discover the nlist of each of the dlfiles.
2310 nlist="$output_objdir/${my_outputname}.nm"
2311
2312 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2313
2314 # Parse the name list into a source file.
2315 func_verbose "creating $output_objdir/$my_dlsyms"
2316
2317 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2318 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2319 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2320
2321 #ifdef __cplusplus
2322 extern \"C\" {
2323 #endif
2324
2325 /* External symbol declarations for the compiler. */\
2326 "
2327
2328 if test "$dlself" = yes; then
2329 func_verbose "generating symbol list for \`$output'"
2330
2331 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2332
2333 # Add our own program objects to the symbol list.
2334 progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2335 for progfile in $progfiles; do
2336 func_verbose "extracting global C symbols from \`$progfile'"
2337 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2338 done
2339
2340 if test -n "$exclude_expsyms"; then
2341 $opt_dry_run || {
2342 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2343 eval '$MV "$nlist"T "$nlist"'
2344 }
2345 fi
2346
2347 if test -n "$export_symbols_regex"; then
2348 $opt_dry_run || {
2349 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2350 eval '$MV "$nlist"T "$nlist"'
2351 }
2352 fi
2353
2354 # Prepare the list of exported symbols
2355 if test -z "$export_symbols"; then
2356 export_symbols="$output_objdir/$outputname.exp"
2357 $opt_dry_run || {
2358 $RM $export_symbols
2359 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2360 case $host in
2361 *cygwin* | *mingw* | *cegcc* )
2362 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2363 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2364 ;;
2365 esac
2366 }
2367 else
2368 $opt_dry_run || {
2369 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2370 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2371 eval '$MV "$nlist"T "$nlist"'
2372 case $host in
2373 *cygwin | *mingw* | *cegcc* )
2374 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2375 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2376 ;;
2377 esac
2378 }
2379 fi
2380 fi
2381
2382 for dlprefile in $dlprefiles; do
2383 func_verbose "extracting global C symbols from \`$dlprefile'"
2384 func_basename "$dlprefile"
2385 name="$func_basename_result"
2386 $opt_dry_run || {
2387 eval '$ECHO ": $name " >> "$nlist"'
2388 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2389 }
2390 done
2391
2392 $opt_dry_run || {
2393 # Make sure we have at least an empty file.
2394 test -f "$nlist" || : > "$nlist"
2395
2396 if test -n "$exclude_expsyms"; then
2397 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2398 $MV "$nlist"T "$nlist"
2399 fi
2400
2401 # Try sorting and uniquifying the output.
2402 if $GREP -v "^: " < "$nlist" |
2403 if sort -k 3 </dev/null >/dev/null 2>&1; then
2404 sort -k 3
2405 else
2406 sort +2
2407 fi |
2408 uniq > "$nlist"S; then
2409 :
2410 else
2411 $GREP -v "^: " < "$nlist" > "$nlist"S
2412 fi
2413
2414 if test -f "$nlist"S; then
2415 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2416 else
2417 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2418 fi
2419
2420 $ECHO >> "$output_objdir/$my_dlsyms" "\
2421
2422 /* The mapping between symbol names and symbols. */
2423 typedef struct {
2424 const char *name;
2425 void *address;
2426 } lt_dlsymlist;
2427 "
2428 case $host in
2429 *cygwin* | *mingw* | *cegcc* )
2430 $ECHO >> "$output_objdir/$my_dlsyms" "\
2431 /* DATA imports from DLLs on WIN32 con't be const, because
2432 runtime relocations are performed -- see ld's documentation
2433 on pseudo-relocs. */"
2434 lt_dlsym_const= ;;
2435 *osf5*)
2436 echo >> "$output_objdir/$my_dlsyms" "\
2437 /* This system does not cope well with relocations in const data */"
2438 lt_dlsym_const= ;;
2439 *)
2440 lt_dlsym_const=const ;;
2441 esac
2442
2443 $ECHO >> "$output_objdir/$my_dlsyms" "\
2444 extern $lt_dlsym_const lt_dlsymlist
2445 lt_${my_prefix}_LTX_preloaded_symbols[];
2446 $lt_dlsym_const lt_dlsymlist
2447 lt_${my_prefix}_LTX_preloaded_symbols[] =
2448 {\
2449 { \"$my_originator\", (void *) 0 },"
2450
2451 case $need_lib_prefix in
2452 no)
2453 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2454 ;;
2455 *)
2456 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2457 ;;
2458 esac
2459 $ECHO >> "$output_objdir/$my_dlsyms" "\
2460 {0, (void *) 0}
2461 };
2462
2463 /* This works around a problem in FreeBSD linker */
2464 #ifdef FREEBSD_WORKAROUND
2465 static const void *lt_preloaded_setup() {
2466 return lt_${my_prefix}_LTX_preloaded_symbols;
2467 }
2468 #endif
2469
2470 #ifdef __cplusplus
2471 }
2472 #endif\
2473 "
2474 } # !$opt_dry_run
2475
2476 pic_flag_for_symtable=
2477 case "$compile_command " in
2478 *" -static "*) ;;
2479 *)
2480 case $host in
2481 # compiling the symbol table file with pic_flag works around
2482 # a FreeBSD bug that causes programs to crash when -lm is
2483 # linked before any other PIC object. But we must not use
2484 # pic_flag when linking with -static. The problem exists in
2485 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2486 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2487 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2488 *-*-hpux*)
2489 pic_flag_for_symtable=" $pic_flag" ;;
2490 *)
2491 if test "X$my_pic_p" != Xno; then
2492 pic_flag_for_symtable=" $pic_flag"
2493 fi
2494 ;;
2495 esac
2496 ;;
2497 esac
2498 symtab_cflags=
2499 for arg in $LTCFLAGS; do
2500 case $arg in
2501 -pie | -fpie | -fPIE) ;;
2502 *) symtab_cflags="$symtab_cflags $arg" ;;
2503 esac
2504 done
2505
2506 # Now compile the dynamic symbol file.
2507 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2508
2509 # Clean up the generated files.
2510 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
2511
2512 # Transform the symbol file into the correct name.
2513 symfileobj="$output_objdir/${my_outputname}S.$objext"
2514 case $host in
2515 *cygwin* | *mingw* | *cegcc* )
2516 if test -f "$output_objdir/$my_outputname.def"; then
2517 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2518 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2519 else
2520 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2521 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2522 fi
2523 ;;
2524 *)
2525 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2526 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2527 ;;
2528 esac
2529 ;;
2530 *)
2531 func_fatal_error "unknown suffix for \`$my_dlsyms'"
2532 ;;
2533 esac
2534 else
2535 # We keep going just in case the user didn't refer to
2536 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2537 # really was required.
2538
2539 # Nullify the symbol file.
2540 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2541 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2542 fi
2543 }
2544
2545 # func_win32_libid arg
2546 # return the library type of file 'arg'
2547 #
2548 # Need a lot of goo to handle *both* DLLs and import libs
2549 # Has to be a shell function in order to 'eat' the argument
2550 # that is supplied when $file_magic_command is called.
2551 func_win32_libid ()
2552 {
2553 $opt_debug
2554 win32_libid_type="unknown"
2555 win32_fileres=`file -L $1 2>/dev/null`
2556 case $win32_fileres in
2557 *ar\ archive\ import\ library*) # definitely import
2558 win32_libid_type="x86 archive import"
2559 ;;
2560 *ar\ archive*) # could be an import, or static
2561 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2562 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2563 win32_nmres=`eval $NM -f posix -A $1 |
2564 $SED -n -e '
2565 1,100{
2566 / I /{
2567 s,.*,import,
2568 p
2569 q
2570 }
2571 }'`
2572 case $win32_nmres in
2573 import*) win32_libid_type="x86 archive import";;
2574 *) win32_libid_type="x86 archive static";;
2575 esac
2576 fi
2577 ;;
2578 *DLL*)
2579 win32_libid_type="x86 DLL"
2580 ;;
2581 *executable*) # but shell scripts are "executable" too...
2582 case $win32_fileres in
2583 *MS\ Windows\ PE\ Intel*)
2584 win32_libid_type="x86 DLL"
2585 ;;
2586 esac
2587 ;;
2588 esac
2589 $ECHO "$win32_libid_type"
2590 }
2591
2592
2593
2594 # func_extract_an_archive dir oldlib
2595 func_extract_an_archive ()
2596 {
2597 $opt_debug
2598 f_ex_an_ar_dir="$1"; shift
2599 f_ex_an_ar_oldlib="$1"
2600 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
2601 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2602 :
2603 else
2604 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2605 fi
2606 }
2607
2608
2609 # func_extract_archives gentop oldlib ...
2610 func_extract_archives ()
2611 {
2612 $opt_debug
2613 my_gentop="$1"; shift
2614 my_oldlibs=${1+"$@"}
2615 my_oldobjs=""
2616 my_xlib=""
2617 my_xabs=""
2618 my_xdir=""
2619
2620 for my_xlib in $my_oldlibs; do
2621 # Extract the objects.
2622 case $my_xlib in
2623 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
2624 *) my_xabs=`pwd`"/$my_xlib" ;;
2625 esac
2626 func_basename "$my_xlib"
2627 my_xlib="$func_basename_result"
2628 my_xlib_u=$my_xlib
2629 while :; do
2630 case " $extracted_archives " in
2631 *" $my_xlib_u "*)
2632 func_arith $extracted_serial + 1
2633 extracted_serial=$func_arith_result
2634 my_xlib_u=lt$extracted_serial-$my_xlib ;;
2635 *) break ;;
2636 esac
2637 done
2638 extracted_archives="$extracted_archives $my_xlib_u"
2639 my_xdir="$my_gentop/$my_xlib_u"
2640
2641 func_mkdir_p "$my_xdir"
2642
2643 case $host in
2644 *-darwin*)
2645 func_verbose "Extracting $my_xabs"
2646 # Do not bother doing anything if just a dry run
2647 $opt_dry_run || {
2648 darwin_orig_dir=`pwd`
2649 cd $my_xdir || exit $?
2650 darwin_archive=$my_xabs
2651 darwin_curdir=`pwd`
2652 darwin_base_archive=`basename "$darwin_archive"`
2653 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
2654 if test -n "$darwin_arches"; then
2655 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
2656 darwin_arch=
2657 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
2658 for darwin_arch in $darwin_arches ; do
2659 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2660 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
2661 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2662 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
2663 cd "$darwin_curdir"
2664 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
2665 done # $darwin_arches
2666 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
2667 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
2668 darwin_file=
2669 darwin_files=
2670 for darwin_file in $darwin_filelist; do
2671 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
2672 $LIPO -create -output "$darwin_file" $darwin_files
2673 done # $darwin_filelist
2674 $RM -rf unfat-$$
2675 cd "$darwin_orig_dir"
2676 else
2677 cd $darwin_orig_dir
2678 func_extract_an_archive "$my_xdir" "$my_xabs"
2679 fi # $darwin_arches
2680 } # !$opt_dry_run
2681 ;;
2682 *)
2683 func_extract_an_archive "$my_xdir" "$my_xabs"
2684 ;;
2685 esac
2686 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2687 done
2688
2689 func_extract_archives_result="$my_oldobjs"
2690 }
2691
2692
2693
2694 # func_emit_wrapper_part1 [arg=no]
2695 #
2696 # Emit the first part of a libtool wrapper script on stdout.
2697 # For more information, see the description associated with
2698 # func_emit_wrapper(), below.
2699 func_emit_wrapper_part1 ()
2700 {
2701 func_emit_wrapper_part1_arg1=no
2702 if test -n "$1" ; then
2703 func_emit_wrapper_part1_arg1=$1
2704 fi
2705
2706 $ECHO "\
2707 #! $SHELL
2708
2709 # $output - temporary wrapper script for $objdir/$outputname
2710 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2711 #
2712 # The $output program cannot be directly executed until all the libtool
2713 # libraries that it depends on are installed.
2714 #
2715 # This wrapper script should never be moved out of the build directory.
2716 # If it is, it will not operate correctly.
2717
2718 # Sed substitution that helps us do robust quoting. It backslashifies
2719 # metacharacters that are still active within double-quoted strings.
2720 Xsed='${SED} -e 1s/^X//'
2721 sed_quote_subst='$sed_quote_subst'
2722
2723 # Be Bourne compatible
2724 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2725 emulate sh
2726 NULLCMD=:
2727 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
2728 # is contrary to our usage. Disable this feature.
2729 alias -g '\${1+\"\$@\"}'='\"\$@\"'
2730 setopt NO_GLOB_SUBST
2731 else
2732 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
2733 fi
2734 BIN_SH=xpg4; export BIN_SH # for Tru64
2735 DUALCASE=1; export DUALCASE # for MKS sh
2736
2737 # The HP-UX ksh and POSIX shell print the target directory to stdout
2738 # if CDPATH is set.
2739 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2740
2741 relink_command=\"$relink_command\"
2742
2743 # This environment variable determines our operation mode.
2744 if test \"\$libtool_install_magic\" = \"$magic\"; then
2745 # install mode needs the following variables:
2746 generated_by_libtool_version='$macro_version'
2747 notinst_deplibs='$notinst_deplibs'
2748 else
2749 # When we are sourced in execute mode, \$file and \$ECHO are already set.
2750 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2751 ECHO=\"$qecho\"
2752 file=\"\$0\"
2753 # Make sure echo works.
2754 if test \"X\$1\" = X--no-reexec; then
2755 # Discard the --no-reexec flag, and continue.
2756 shift
2757 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2758 # Yippee, \$ECHO works!
2759 :
2760 else
2761 # Restart under the correct shell, and then maybe \$ECHO will work.
2762 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2763 fi
2764 fi\
2765 "
2766 $ECHO "\
2767
2768 # Find the directory that this script lives in.
2769 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2770 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2771
2772 # Follow symbolic links until we get to the real thisdir.
2773 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
2774 while test -n \"\$file\"; do
2775 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2776
2777 # If there was a directory component, then change thisdir.
2778 if test \"x\$destdir\" != \"x\$file\"; then
2779 case \"\$destdir\" in
2780 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
2781 *) thisdir=\"\$thisdir/\$destdir\" ;;
2782 esac
2783 fi
2784
2785 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2786 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2787 done
2788 "
2789 }
2790 # end: func_emit_wrapper_part1
2791
2792 # func_emit_wrapper_part2 [arg=no]
2793 #
2794 # Emit the second part of a libtool wrapper script on stdout.
2795 # For more information, see the description associated with
2796 # func_emit_wrapper(), below.
2797 func_emit_wrapper_part2 ()
2798 {
2799 func_emit_wrapper_part2_arg1=no
2800 if test -n "$1" ; then
2801 func_emit_wrapper_part2_arg1=$1
2802 fi
2803
2804 $ECHO "\
2805
2806 # Usually 'no', except on cygwin/mingw when embedded into
2807 # the cwrapper.
2808 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
2809 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2810 # special case for '.'
2811 if test \"\$thisdir\" = \".\"; then
2812 thisdir=\`pwd\`
2813 fi
2814 # remove .libs from thisdir
2815 case \"\$thisdir\" in
2816 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
2817 $objdir ) thisdir=. ;;
2818 esac
2819 fi
2820
2821 # Try to get the absolute directory name.
2822 absdir=\`cd \"\$thisdir\" && pwd\`
2823 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2824 "
2825
2826 if test "$fast_install" = yes; then
2827 $ECHO "\
2828 program=lt-'$outputname'$exeext
2829 progdir=\"\$thisdir/$objdir\"
2830
2831 if test ! -f \"\$progdir/\$program\" ||
2832 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
2833 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2834
2835 file=\"\$\$-\$program\"
2836
2837 if test ! -d \"\$progdir\"; then
2838 $MKDIR \"\$progdir\"
2839 else
2840 $RM \"\$progdir/\$file\"
2841 fi"
2842
2843 $ECHO "\
2844
2845 # relink executable if necessary
2846 if test -n \"\$relink_command\"; then
2847 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
2848 else
2849 $ECHO \"\$relink_command_output\" >&2
2850 $RM \"\$progdir/\$file\"
2851 exit 1
2852 fi
2853 fi
2854
2855 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2856 { $RM \"\$progdir/\$program\";
2857 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2858 $RM \"\$progdir/\$file\"
2859 fi"
2860 else
2861 $ECHO "\
2862 program='$outputname'
2863 progdir=\"\$thisdir/$objdir\"
2864 "
2865 fi
2866
2867 $ECHO "\
2868
2869 if test -f \"\$progdir/\$program\"; then"
2870
2871 # Export our shlibpath_var if we have one.
2872 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2873 $ECHO "\
2874 # Add our own library path to $shlibpath_var
2875 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2876
2877 # Some systems cannot cope with colon-terminated $shlibpath_var
2878 # The second colon is a workaround for a bug in BeOS R4 sed
2879 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2880
2881 export $shlibpath_var
2882 "
2883 fi
2884
2885 # fixup the dll searchpath if we need to.
2886 if test -n "$dllsearchpath"; then
2887 $ECHO "\
2888 # Add the dll search path components to the executable PATH
2889 PATH=$dllsearchpath:\$PATH
2890 "
2891 fi
2892
2893 $ECHO "\
2894 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2895 # Run the actual program with our arguments.
2896 "
2897 case $host in
2898 # Backslashes separate directories on plain windows
2899 *-*-mingw | *-*-os2* | *-cegcc*)
2900 $ECHO "\
2901 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2902 "
2903 ;;
2904
2905 *)
2906 $ECHO "\
2907 exec \"\$progdir/\$program\" \${1+\"\$@\"}
2908 "
2909 ;;
2910 esac
2911 $ECHO "\
2912 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2913 exit 1
2914 fi
2915 else
2916 # The program doesn't exist.
2917 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2918 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2919 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2920 exit 1
2921 fi
2922 fi\
2923 "
2924 }
2925 # end: func_emit_wrapper_part2
2926
2927
2928 # func_emit_wrapper [arg=no]
2929 #
2930 # Emit a libtool wrapper script on stdout.
2931 # Don't directly open a file because we may want to
2932 # incorporate the script contents within a cygwin/mingw
2933 # wrapper executable. Must ONLY be called from within
2934 # func_mode_link because it depends on a number of variables
2935 # set therein.
2936 #
2937 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2938 # variable will take. If 'yes', then the emitted script
2939 # will assume that the directory in which it is stored is
2940 # the $objdir directory. This is a cygwin/mingw-specific
2941 # behavior.
2942 func_emit_wrapper ()
2943 {
2944 func_emit_wrapper_arg1=no
2945 if test -n "$1" ; then
2946 func_emit_wrapper_arg1=$1
2947 fi
2948
2949 # split this up so that func_emit_cwrapperexe_src
2950 # can call each part independently.
2951 func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
2952 func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
2953 }
2954
2955
2956 # func_to_host_path arg
2957 #
2958 # Convert paths to host format when used with build tools.
2959 # Intended for use with "native" mingw (where libtool itself
2960 # is running under the msys shell), or in the following cross-
2961 # build environments:
2962 # $build $host
2963 # mingw (msys) mingw [e.g. native]
2964 # cygwin mingw
2965 # *nix + wine mingw
2966 # where wine is equipped with the `winepath' executable.
2967 # In the native mingw case, the (msys) shell automatically
2968 # converts paths for any non-msys applications it launches,
2969 # but that facility isn't available from inside the cwrapper.
2970 # Similar accommodations are necessary for $host mingw and
2971 # $build cygwin. Calling this function does no harm for other
2972 # $host/$build combinations not listed above.
2973 #
2974 # ARG is the path (on $build) that should be converted to
2975 # the proper representation for $host. The result is stored
2976 # in $func_to_host_path_result.
2977 func_to_host_path ()
2978 {
2979 func_to_host_path_result="$1"
2980 if test -n "$1" ; then
2981 case $host in
2982 *mingw* )
2983 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
2984 case $build in
2985 *mingw* ) # actually, msys
2986 # awkward: cmd appends spaces to result
2987 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
2988 func_to_host_path_tmp1=`( cmd //c echo "$1" |\
2989 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
2990 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2991 $SED -e "$lt_sed_naive_backslashify"`
2992 ;;
2993 *cygwin* )
2994 func_to_host_path_tmp1=`cygpath -w "$1"`
2995 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2996 $SED -e "$lt_sed_naive_backslashify"`
2997 ;;
2998 * )
2999 # Unfortunately, winepath does not exit with a non-zero
3000 # error code, so we are forced to check the contents of
3001 # stdout. On the other hand, if the command is not
3002 # found, the shell will set an exit code of 127 and print
3003 # *an error message* to stdout. So we must check for both
3004 # error code of zero AND non-empty stdout, which explains
3005 # the odd construction:
3006 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3007 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3008 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3009 $SED -e "$lt_sed_naive_backslashify"`
3010 else
3011 # Allow warning below.
3012 func_to_host_path_result=""
3013 fi
3014 ;;
3015 esac
3016 if test -z "$func_to_host_path_result" ; then
3017 func_error "Could not determine host path corresponding to"
3018 func_error " '$1'"
3019 func_error "Continuing, but uninstalled executables may not work."
3020 # Fallback:
3021 func_to_host_path_result="$1"
3022 fi
3023 ;;
3024 esac
3025 fi
3026 }
3027 # end: func_to_host_path
3028
3029 # func_to_host_pathlist arg
3030 #
3031 # Convert pathlists to host format when used with build tools.
3032 # See func_to_host_path(), above. This function supports the
3033 # following $build/$host combinations (but does no harm for
3034 # combinations not listed here):
3035 # $build $host
3036 # mingw (msys) mingw [e.g. native]
3037 # cygwin mingw
3038 # *nix + wine mingw
3039 #
3040 # Path separators are also converted from $build format to
3041 # $host format. If ARG begins or ends with a path separator
3042 # character, it is preserved (but converted to $host format)
3043 # on output.
3044 #
3045 # ARG is a pathlist (on $build) that should be converted to
3046 # the proper representation on $host. The result is stored
3047 # in $func_to_host_pathlist_result.
3048 func_to_host_pathlist ()
3049 {
3050 func_to_host_pathlist_result="$1"
3051 if test -n "$1" ; then
3052 case $host in
3053 *mingw* )
3054 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3055 # Remove leading and trailing path separator characters from
3056 # ARG. msys behavior is inconsistent here, cygpath turns them
3057 # into '.;' and ';.', and winepath ignores them completely.
3058 func_to_host_pathlist_tmp2="$1"
3059 # Once set for this call, this variable should not be
3060 # reassigned. It is used in tha fallback case.
3061 func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3062 $SED -e 's|^:*||' -e 's|:*$||'`
3063 case $build in
3064 *mingw* ) # Actually, msys.
3065 # Awkward: cmd appends spaces to result.
3066 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3067 func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3068 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3069 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3070 $SED -e "$lt_sed_naive_backslashify"`
3071 ;;
3072 *cygwin* )
3073 func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3074 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3075 $SED -e "$lt_sed_naive_backslashify"`
3076 ;;
3077 * )
3078 # unfortunately, winepath doesn't convert pathlists
3079 func_to_host_pathlist_result=""
3080 func_to_host_pathlist_oldIFS=$IFS
3081 IFS=:
3082 for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3083 IFS=$func_to_host_pathlist_oldIFS
3084 if test -n "$func_to_host_pathlist_f" ; then
3085 func_to_host_path "$func_to_host_pathlist_f"
3086 if test -n "$func_to_host_path_result" ; then
3087 if test -z "$func_to_host_pathlist_result" ; then
3088 func_to_host_pathlist_result="$func_to_host_path_result"
3089 else
3090 func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3091 fi
3092 fi
3093 fi
3094 IFS=:
3095 done
3096 IFS=$func_to_host_pathlist_oldIFS
3097 ;;
3098 esac
3099 if test -z "$func_to_host_pathlist_result" ; then
3100 func_error "Could not determine the host path(s) corresponding to"
3101 func_error " '$1'"
3102 func_error "Continuing, but uninstalled executables may not work."
3103 # Fallback. This may break if $1 contains DOS-style drive
3104 # specifications. The fix is not to complicate the expression
3105 # below, but for the user to provide a working wine installation
3106 # with winepath so that path translation in the cross-to-mingw
3107 # case works properly.
3108 lt_replace_pathsep_nix_to_dos="s|:|;|g"
3109 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3110 $SED -e "$lt_replace_pathsep_nix_to_dos"`
3111 fi
3112 # Now, add the leading and trailing path separators back
3113 case "$1" in
3114 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3115 ;;
3116 esac
3117 case "$1" in
3118 *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3119 ;;
3120 esac
3121 ;;
3122 esac
3123 fi
3124 }
3125 # end: func_to_host_pathlist
3126
3127 # func_emit_cwrapperexe_src
3128 # emit the source code for a wrapper executable on stdout
3129 # Must ONLY be called from within func_mode_link because
3130 # it depends on a number of variable set therein.
3131 func_emit_cwrapperexe_src ()
3132 {
3133 cat <<EOF
3134
3135 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3136 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3137
3138 The $output program cannot be directly executed until all the libtool
3139 libraries that it depends on are installed.
3140
3141 This wrapper executable should never be moved out of the build directory.
3142 If it is, it will not operate correctly.
3143
3144 Currently, it simply execs the wrapper *script* "$SHELL $output",
3145 but could eventually absorb all of the scripts functionality and
3146 exec $objdir/$outputname directly.
3147 */
3148 EOF
3149 cat <<"EOF"
3150 #include <stdio.h>
3151 #include <stdlib.h>
3152 #ifdef _MSC_VER
3153 # include <direct.h>
3154 # include <process.h>
3155 # include <io.h>
3156 # define setmode _setmode
3157 #else
3158 # include <unistd.h>
3159 # include <stdint.h>
3160 # ifdef __CYGWIN__
3161 # include <io.h>
3162 # define HAVE_SETENV
3163 # ifdef __STRICT_ANSI__
3164 char *realpath (const char *, char *);
3165 int putenv (char *);
3166 int setenv (const char *, const char *, int);
3167 # endif
3168 # endif
3169 #endif
3170 #include <malloc.h>
3171 #include <stdarg.h>
3172 #include <assert.h>
3173 #include <string.h>
3174 #include <ctype.h>
3175 #include <errno.h>
3176 #include <fcntl.h>
3177 #include <sys/stat.h>
3178
3179 #if defined(PATH_MAX)
3180 # define LT_PATHMAX PATH_MAX
3181 #elif defined(MAXPATHLEN)
3182 # define LT_PATHMAX MAXPATHLEN
3183 #else
3184 # define LT_PATHMAX 1024
3185 #endif
3186
3187 #ifndef S_IXOTH
3188 # define S_IXOTH 0
3189 #endif
3190 #ifndef S_IXGRP
3191 # define S_IXGRP 0
3192 #endif
3193
3194 #ifdef _MSC_VER
3195 # define S_IXUSR _S_IEXEC
3196 # define stat _stat
3197 # ifndef _INTPTR_T_DEFINED
3198 # define intptr_t int
3199 # endif
3200 #endif
3201
3202 #ifndef DIR_SEPARATOR
3203 # define DIR_SEPARATOR '/'
3204 # define PATH_SEPARATOR ':'
3205 #endif
3206
3207 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3208 defined (__OS2__)
3209 # define HAVE_DOS_BASED_FILE_SYSTEM
3210 # define FOPEN_WB "wb"
3211 # ifndef DIR_SEPARATOR_2
3212 # define DIR_SEPARATOR_2 '\\'
3213 # endif
3214 # ifndef PATH_SEPARATOR_2
3215 # define PATH_SEPARATOR_2 ';'
3216 # endif
3217 #endif
3218
3219 #ifndef DIR_SEPARATOR_2
3220 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3221 #else /* DIR_SEPARATOR_2 */
3222 # define IS_DIR_SEPARATOR(ch) \
3223 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3224 #endif /* DIR_SEPARATOR_2 */
3225
3226 #ifndef PATH_SEPARATOR_2
3227 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3228 #else /* PATH_SEPARATOR_2 */
3229 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3230 #endif /* PATH_SEPARATOR_2 */
3231
3232 #ifdef __CYGWIN__
3233 # define FOPEN_WB "wb"
3234 #endif
3235
3236 #ifndef FOPEN_WB
3237 # define FOPEN_WB "w"
3238 #endif
3239 #ifndef _O_BINARY
3240 # define _O_BINARY 0
3241 #endif
3242
3243 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3244 #define XFREE(stale) do { \
3245 if (stale) { free ((void *) stale); stale = 0; } \
3246 } while (0)
3247
3248 #undef LTWRAPPER_DEBUGPRINTF
3249 #if defined DEBUGWRAPPER
3250 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3251 static void
3252 ltwrapper_debugprintf (const char *fmt, ...)
3253 {
3254 va_list args;
3255 va_start (args, fmt);
3256 (void) vfprintf (stderr, fmt, args);
3257 va_end (args);
3258 }
3259 #else
3260 # define LTWRAPPER_DEBUGPRINTF(args)
3261 #endif
3262
3263 const char *program_name = NULL;
3264
3265 void *xmalloc (size_t num);
3266 char *xstrdup (const char *string);
3267 const char *base_name (const char *name);
3268 char *find_executable (const char *wrapper);
3269 char *chase_symlinks (const char *pathspec);
3270 int make_executable (const char *path);
3271 int check_executable (const char *path);
3272 char *strendzap (char *str, const char *pat);
3273 void lt_fatal (const char *message, ...);
3274 void lt_setenv (const char *name, const char *value);
3275 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3276 void lt_opt_process_env_set (const char *arg);
3277 void lt_opt_process_env_prepend (const char *arg);
3278 void lt_opt_process_env_append (const char *arg);
3279 int lt_split_name_value (const char *arg, char** name, char** value);
3280 void lt_update_exe_path (const char *name, const char *value);
3281 void lt_update_lib_path (const char *name, const char *value);
3282
3283 static const char *script_text_part1 =
3284 EOF
3285
3286 func_emit_wrapper_part1 yes |
3287 $SED -e 's/\([\\"]\)/\\\1/g' \
3288 -e 's/^/ "/' -e 's/$/\\n"/'
3289 echo ";"
3290 cat <<EOF
3291
3292 static const char *script_text_part2 =
3293 EOF
3294 func_emit_wrapper_part2 yes |
3295 $SED -e 's/\([\\"]\)/\\\1/g' \
3296 -e 's/^/ "/' -e 's/$/\\n"/'
3297 echo ";"
3298
3299 cat <<EOF
3300 const char * MAGIC_EXE = "$magic_exe";
3301 const char * LIB_PATH_VARNAME = "$shlibpath_var";
3302 EOF
3303
3304 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3305 func_to_host_pathlist "$temp_rpath"
3306 cat <<EOF
3307 const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
3308 EOF
3309 else
3310 cat <<"EOF"
3311 const char * LIB_PATH_VALUE = "";
3312 EOF
3313 fi
3314
3315 if test -n "$dllsearchpath"; then
3316 func_to_host_pathlist "$dllsearchpath:"
3317 cat <<EOF
3318 const char * EXE_PATH_VARNAME = "PATH";
3319 const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
3320 EOF
3321 else
3322 cat <<"EOF"
3323 const char * EXE_PATH_VARNAME = "";
3324 const char * EXE_PATH_VALUE = "";
3325 EOF
3326 fi
3327
3328 if test "$fast_install" = yes; then
3329 cat <<EOF
3330 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3331 EOF
3332 else
3333 cat <<EOF
3334 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
3335 EOF
3336 fi
3337
3338
3339 cat <<"EOF"
3340
3341 #define LTWRAPPER_OPTION_PREFIX "--lt-"
3342 #define LTWRAPPER_OPTION_PREFIX_LENGTH 5
3343
3344 static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
3345 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3346
3347 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
3348
3349 static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3350 static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
3351 /* argument is putenv-style "foo=bar", value of foo is set to bar */
3352
3353 static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3354 static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
3355 /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3356
3357 static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3358 static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
3359 /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3360
3361 int
3362 main (int argc, char *argv[])
3363 {
3364 char **newargz;
3365 int newargc;
3366 char *tmp_pathspec;
3367 char *actual_cwrapper_path;
3368 char *actual_cwrapper_name;
3369 char *target_name;
3370 char *lt_argv_zero;
3371 intptr_t rval = 127;
3372
3373 int i;
3374
3375 program_name = (char *) xstrdup (base_name (argv[0]));
3376 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3377 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3378
3379 /* very simple arg parsing; don't want to rely on getopt */
3380 for (i = 1; i < argc; i++)
3381 {
3382 if (strcmp (argv[i], dumpscript_opt) == 0)
3383 {
3384 EOF
3385 case "$host" in
3386 *mingw* | *cygwin* )
3387 # make stdout use "unix" line endings
3388 echo " setmode(1,_O_BINARY);"
3389 ;;
3390 esac
3391
3392 cat <<"EOF"
3393 printf ("%s", script_text_part1);
3394 printf ("%s", script_text_part2);
3395 return 0;
3396 }
3397 }
3398
3399 newargz = XMALLOC (char *, argc + 1);
3400 tmp_pathspec = find_executable (argv[0]);
3401 if (tmp_pathspec == NULL)
3402 lt_fatal ("Couldn't find %s", argv[0]);
3403 LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3404 tmp_pathspec));
3405
3406 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3407 LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3408 actual_cwrapper_path));
3409 XFREE (tmp_pathspec);
3410
3411 actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3412 strendzap (actual_cwrapper_path, actual_cwrapper_name);
3413
3414 /* wrapper name transforms */
3415 strendzap (actual_cwrapper_name, ".exe");
3416 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3417 XFREE (actual_cwrapper_name);
3418 actual_cwrapper_name = tmp_pathspec;
3419 tmp_pathspec = 0;
3420
3421 /* target_name transforms -- use actual target program name; might have lt- prefix */
3422 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
3423 strendzap (target_name, ".exe");
3424 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3425 XFREE (target_name);
3426 target_name = tmp_pathspec;
3427 tmp_pathspec = 0;
3428
3429 LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3430 target_name));
3431 EOF
3432
3433 cat <<EOF
3434 newargz[0] =
3435 XMALLOC (char, (strlen (actual_cwrapper_path) +
3436 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3437 strcpy (newargz[0], actual_cwrapper_path);
3438 strcat (newargz[0], "$objdir");
3439 strcat (newargz[0], "/");
3440 EOF
3441
3442 cat <<"EOF"
3443 /* stop here, and copy so we don't have to do this twice */
3444 tmp_pathspec = xstrdup (newargz[0]);
3445
3446 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
3447 strcat (newargz[0], actual_cwrapper_name);
3448
3449 /* DO want the lt- prefix here if it exists, so use target_name */
3450 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
3451 XFREE (tmp_pathspec);
3452 tmp_pathspec = NULL;
3453 EOF
3454
3455 case $host_os in
3456 mingw*)
3457 cat <<"EOF"
3458 {
3459 char* p;
3460 while ((p = strchr (newargz[0], '\\')) != NULL)
3461 {
3462 *p = '/';
3463 }
3464 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
3465 {
3466 *p = '/';
3467 }
3468 }
3469 EOF
3470 ;;
3471 esac
3472
3473 cat <<"EOF"
3474 XFREE (target_name);
3475 XFREE (actual_cwrapper_path);
3476 XFREE (actual_cwrapper_name);
3477
3478 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3479 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
3480 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3481 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3482
3483 newargc=0;
3484 for (i = 1; i < argc; i++)
3485 {
3486 if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3487 {
3488 if (argv[i][env_set_opt_len] == '=')
3489 {
3490 const char *p = argv[i] + env_set_opt_len + 1;
3491 lt_opt_process_env_set (p);
3492 }
3493 else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3494 {
3495 lt_opt_process_env_set (argv[++i]); /* don't copy */
3496 }
3497 else
3498 lt_fatal ("%s missing required argument", env_set_opt);
3499 continue;
3500 }
3501 if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3502 {
3503 if (argv[i][env_prepend_opt_len] == '=')
3504 {
3505 const char *p = argv[i] + env_prepend_opt_len + 1;
3506 lt_opt_process_env_prepend (p);
3507 }
3508 else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3509 {
3510 lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3511 }
3512 else
3513 lt_fatal ("%s missing required argument", env_prepend_opt);
3514 continue;
3515 }
3516 if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3517 {
3518 if (argv[i][env_append_opt_len] == '=')
3519 {
3520 const char *p = argv[i] + env_append_opt_len + 1;
3521 lt_opt_process_env_append (p);
3522 }
3523 else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3524 {
3525 lt_opt_process_env_append (argv[++i]); /* don't copy */
3526 }
3527 else
3528 lt_fatal ("%s missing required argument", env_append_opt);
3529 continue;
3530 }
3531 if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3532 {
3533 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3534 namespace, but it is not one of the ones we know about and
3535 have already dealt with, above (inluding dump-script), then
3536 report an error. Otherwise, targets might begin to believe
3537 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3538 namespace. The first time any user complains about this, we'll
3539 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3540 or a configure.ac-settable value.
3541 */
3542 lt_fatal ("Unrecognized option in %s namespace: '%s'",
3543 ltwrapper_option_prefix, argv[i]);
3544 }
3545 /* otherwise ... */
3546 newargz[++newargc] = xstrdup (argv[i]);
3547 }
3548 newargz[++newargc] = NULL;
3549
3550 LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
3551 for (i = 0; i < newargc; i++)
3552 {
3553 LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
3554 }
3555
3556 EOF
3557
3558 case $host_os in
3559 mingw*)
3560 cat <<"EOF"
3561 /* execv doesn't actually work on mingw as expected on unix */
3562 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3563 if (rval == -1)
3564 {
3565 /* failed to start process */
3566 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
3567 return 127;
3568 }
3569 return rval;
3570 EOF
3571 ;;
3572 *)
3573 cat <<"EOF"
3574 execv (lt_argv_zero, newargz);
3575 return rval; /* =127, but avoids unused variable warning */
3576 EOF
3577 ;;
3578 esac
3579
3580 cat <<"EOF"
3581 }
3582
3583 void *
3584 xmalloc (size_t num)
3585 {
3586 void *p = (void *) malloc (num);
3587 if (!p)
3588 lt_fatal ("Memory exhausted");
3589
3590 return p;
3591 }
3592
3593 char *
3594 xstrdup (const char *string)
3595 {
3596 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
3597 string) : NULL;
3598 }
3599
3600 const char *
3601 base_name (const char *name)
3602 {
3603 const char *base;
3604
3605 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3606 /* Skip over the disk name in MSDOS pathnames. */
3607 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3608 name += 2;
3609 #endif
3610
3611 for (base = name; *name; name++)
3612 if (IS_DIR_SEPARATOR (*name))
3613 base = name + 1;
3614 return base;
3615 }
3616
3617 int
3618 check_executable (const char *path)
3619 {
3620 struct stat st;
3621
3622 LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
3623 path ? (*path ? path : "EMPTY!") : "NULL!"));
3624 if ((!path) || (!*path))
3625 return 0;
3626
3627 if ((stat (path, &st) >= 0)
3628 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
3629 return 1;
3630 else
3631 return 0;
3632 }
3633
3634 int
3635 make_executable (const char *path)
3636 {
3637 int rval = 0;
3638 struct stat st;
3639
3640 LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
3641 path ? (*path ? path : "EMPTY!") : "NULL!"));
3642 if ((!path) || (!*path))
3643 return 0;
3644
3645 if (stat (path, &st) >= 0)
3646 {
3647 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
3648 }
3649 return rval;
3650 }
3651
3652 /* Searches for the full path of the wrapper. Returns
3653 newly allocated full path name if found, NULL otherwise
3654 Does not chase symlinks, even on platforms that support them.
3655 */
3656 char *
3657 find_executable (const char *wrapper)
3658 {
3659 int has_slash = 0;
3660 const char *p;
3661 const char *p_next;
3662 /* static buffer for getcwd */
3663 char tmp[LT_PATHMAX + 1];
3664 int tmp_len;
3665 char *concat_name;
3666
3667 LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
3668 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3669
3670 if ((wrapper == NULL) || (*wrapper == '\0'))
3671 return NULL;
3672
3673 /* Absolute path? */
3674 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3675 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3676 {
3677 concat_name = xstrdup (wrapper);
3678 if (check_executable (concat_name))
3679 return concat_name;
3680 XFREE (concat_name);
3681 }
3682 else
3683 {
3684 #endif
3685 if (IS_DIR_SEPARATOR (wrapper[0]))
3686 {
3687 concat_name = xstrdup (wrapper);
3688 if (check_executable (concat_name))
3689 return concat_name;
3690 XFREE (concat_name);
3691 }
3692 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3693 }
3694 #endif
3695
3696 for (p = wrapper; *p; p++)
3697 if (*p == '/')
3698 {
3699 has_slash = 1;
3700 break;
3701 }
3702 if (!has_slash)
3703 {
3704 /* no slashes; search PATH */
3705 const char *path = getenv ("PATH");
3706 if (path != NULL)
3707 {
3708 for (p = path; *p; p = p_next)
3709 {
3710 const char *q;
3711 size_t p_len;
3712 for (q = p; *q; q++)
3713 if (IS_PATH_SEPARATOR (*q))
3714 break;
3715 p_len = q - p;
3716 p_next = (*q == '\0' ? q : q + 1);
3717 if (p_len == 0)
3718 {
3719 /* empty path: current directory */
3720 if (getcwd (tmp, LT_PATHMAX) == NULL)
3721 lt_fatal ("getcwd failed");
3722 tmp_len = strlen (tmp);
3723 concat_name =
3724 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3725 memcpy (concat_name, tmp, tmp_len);
3726 concat_name[tmp_len] = '/';
3727 strcpy (concat_name + tmp_len + 1, wrapper);
3728 }
3729 else
3730 {
3731 concat_name =
3732 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
3733 memcpy (concat_name, p, p_len);
3734 concat_name[p_len] = '/';
3735 strcpy (concat_name + p_len + 1, wrapper);
3736 }
3737 if (check_executable (concat_name))
3738 return concat_name;
3739 XFREE (concat_name);
3740 }
3741 }
3742 /* not found in PATH; assume curdir */
3743 }
3744 /* Relative path | not found in path: prepend cwd */
3745 if (getcwd (tmp, LT_PATHMAX) == NULL)
3746 lt_fatal ("getcwd failed");
3747 tmp_len = strlen (tmp);
3748 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3749 memcpy (concat_name, tmp, tmp_len);
3750 concat_name[tmp_len] = '/';
3751 strcpy (concat_name + tmp_len + 1, wrapper);
3752
3753 if (check_executable (concat_name))
3754 return concat_name;
3755 XFREE (concat_name);
3756 return NULL;
3757 }
3758
3759 char *
3760 chase_symlinks (const char *pathspec)
3761 {
3762 #ifndef S_ISLNK
3763 return xstrdup (pathspec);
3764 #else
3765 char buf[LT_PATHMAX];
3766 struct stat s;
3767 char *tmp_pathspec = xstrdup (pathspec);
3768 char *p;
3769 int has_symlinks = 0;
3770 while (strlen (tmp_pathspec) && !has_symlinks)
3771 {
3772 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3773 tmp_pathspec));
3774 if (lstat (tmp_pathspec, &s) == 0)
3775 {
3776 if (S_ISLNK (s.st_mode) != 0)
3777 {
3778 has_symlinks = 1;
3779 break;
3780 }
3781
3782 /* search backwards for last DIR_SEPARATOR */
3783 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
3784 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3785 p--;
3786 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3787 {
3788 /* no more DIR_SEPARATORS left */
3789 break;
3790 }
3791 *p = '\0';
3792 }
3793 else
3794 {
3795 char *errstr = strerror (errno);
3796 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
3797 }
3798 }
3799 XFREE (tmp_pathspec);
3800
3801 if (!has_symlinks)
3802 {
3803 return xstrdup (pathspec);
3804 }
3805
3806 tmp_pathspec = realpath (pathspec, buf);
3807 if (tmp_pathspec == 0)
3808 {
3809 lt_fatal ("Could not follow symlinks for %s", pathspec);
3810 }
3811 return xstrdup (tmp_pathspec);
3812 #endif
3813 }
3814
3815 char *
3816 strendzap (char *str, const char *pat)
3817 {
3818 size_t len, patlen;
3819
3820 assert (str != NULL);
3821 assert (pat != NULL);
3822
3823 len = strlen (str);
3824 patlen = strlen (pat);
3825
3826 if (patlen <= len)
3827 {
3828 str += len - patlen;
3829 if (strcmp (str, pat) == 0)
3830 *str = '\0';
3831 }
3832 return str;
3833 }
3834
3835 static void
3836 lt_error_core (int exit_status, const char *mode,
3837 const char *message, va_list ap)
3838 {
3839 fprintf (stderr, "%s: %s: ", program_name, mode);
3840 vfprintf (stderr, message, ap);
3841 fprintf (stderr, ".\n");
3842
3843 if (exit_status >= 0)
3844 exit (exit_status);
3845 }
3846
3847 void
3848 lt_fatal (const char *message, ...)
3849 {
3850 va_list ap;
3851 va_start (ap, message);
3852 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3853 va_end (ap);
3854 }
3855
3856 void
3857 lt_setenv (const char *name, const char *value)
3858 {
3859 LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
3860 (name ? name : "<NULL>"),
3861 (value ? value : "<NULL>")));
3862 {
3863 #ifdef HAVE_SETENV
3864 /* always make a copy, for consistency with !HAVE_SETENV */
3865 char *str = xstrdup (value);
3866 setenv (name, str, 1);
3867 #else
3868 int len = strlen (name) + 1 + strlen (value) + 1;
3869 char *str = XMALLOC (char, len);
3870 sprintf (str, "%s=%s", name, value);
3871 if (putenv (str) != EXIT_SUCCESS)
3872 {
3873 XFREE (str);
3874 }
3875 #endif
3876 }
3877 }
3878
3879 char *
3880 lt_extend_str (const char *orig_value, const char *add, int to_end)
3881 {
3882 char *new_value;
3883 if (orig_value && *orig_value)
3884 {
3885 int orig_value_len = strlen (orig_value);
3886 int add_len = strlen (add);
3887 new_value = XMALLOC (char, add_len + orig_value_len + 1);
3888 if (to_end)
3889 {
3890 strcpy (new_value, orig_value);
3891 strcpy (new_value + orig_value_len, add);
3892 }
3893 else
3894 {
3895 strcpy (new_value, add);
3896 strcpy (new_value + add_len, orig_value);
3897 }
3898 }
3899 else
3900 {
3901 new_value = xstrdup (add);
3902 }
3903 return new_value;
3904 }
3905
3906 int
3907 lt_split_name_value (const char *arg, char** name, char** value)
3908 {
3909 const char *p;
3910 int len;
3911 if (!arg || !*arg)
3912 return 1;
3913
3914 p = strchr (arg, (int)'=');
3915
3916 if (!p)
3917 return 1;
3918
3919 *value = xstrdup (++p);
3920
3921 len = strlen (arg) - strlen (*value);
3922 *name = XMALLOC (char, len);
3923 strncpy (*name, arg, len-1);
3924 (*name)[len - 1] = '\0';
3925
3926 return 0;
3927 }
3928
3929 void
3930 lt_opt_process_env_set (const char *arg)
3931 {
3932 char *name = NULL;
3933 char *value = NULL;
3934
3935 if (lt_split_name_value (arg, &name, &value) != 0)
3936 {
3937 XFREE (name);
3938 XFREE (value);
3939 lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
3940 }
3941
3942 lt_setenv (name, value);
3943 XFREE (name);
3944 XFREE (value);
3945 }
3946
3947 void
3948 lt_opt_process_env_prepend (const char *arg)
3949 {
3950 char *name = NULL;
3951 char *value = NULL;
3952 char *new_value = NULL;
3953
3954 if (lt_split_name_value (arg, &name, &value) != 0)
3955 {
3956 XFREE (name);
3957 XFREE (value);
3958 lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3959 }
3960
3961 new_value = lt_extend_str (getenv (name), value, 0);
3962 lt_setenv (name, new_value);
3963 XFREE (new_value);
3964 XFREE (name);
3965 XFREE (value);
3966 }
3967
3968 void
3969 lt_opt_process_env_append (const char *arg)
3970 {
3971 char *name = NULL;
3972 char *value = NULL;
3973 char *new_value = NULL;
3974
3975 if (lt_split_name_value (arg, &name, &value) != 0)
3976 {
3977 XFREE (name);
3978 XFREE (value);
3979 lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
3980 }
3981
3982 new_value = lt_extend_str (getenv (name), value, 1);
3983 lt_setenv (name, new_value);
3984 XFREE (new_value);
3985 XFREE (name);
3986 XFREE (value);
3987 }
3988
3989 void
3990 lt_update_exe_path (const char *name, const char *value)
3991 {
3992 LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
3993 (name ? name : "<NULL>"),
3994 (value ? value : "<NULL>")));
3995
3996 if (name && *name && value && *value)
3997 {
3998 char *new_value = lt_extend_str (getenv (name), value, 0);
3999 /* some systems can't cope with a ':'-terminated path #' */
4000 int len = strlen (new_value);
4001 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4002 {
4003 new_value[len-1] = '\0';
4004 }
4005 lt_setenv (name, new_value);
4006 XFREE (new_value);
4007 }
4008 }
4009
4010 void
4011 lt_update_lib_path (const char *name, const char *value)
4012 {
4013 LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4014 (name ? name : "<NULL>"),
4015 (value ? value : "<NULL>")));
4016
4017 if (name && *name && value && *value)
4018 {
4019 char *new_value = lt_extend_str (getenv (name), value, 0);
4020 lt_setenv (name, new_value);
4021 XFREE (new_value);
4022 }
4023 }
4024
4025
4026 EOF
4027 }
4028 # end: func_emit_cwrapperexe_src
4029
4030 # func_mode_link arg...
4031 func_mode_link ()
4032 {
4033 $opt_debug
4034 case $host in
4035 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4036 # It is impossible to link a dll without this setting, and
4037 # we shouldn't force the makefile maintainer to figure out
4038 # which system we are compiling for in order to pass an extra
4039 # flag for every libtool invocation.
4040 # allow_undefined=no
4041
4042 # FIXME: Unfortunately, there are problems with the above when trying
4043 # to make a dll which has undefined symbols, in which case not
4044 # even a static library is built. For now, we need to specify
4045 # -no-undefined on the libtool link line when we can be certain
4046 # that all symbols are satisfied, otherwise we get a static library.
4047 allow_undefined=yes
4048 ;;
4049 *)
4050 allow_undefined=yes
4051 ;;
4052 esac
4053 libtool_args=$nonopt
4054 base_compile="$nonopt $@"
4055 compile_command=$nonopt
4056 finalize_command=$nonopt
4057
4058 compile_rpath=
4059 finalize_rpath=
4060 compile_shlibpath=
4061 finalize_shlibpath=
4062 convenience=
4063 old_convenience=
4064 deplibs=
4065 old_deplibs=
4066 compiler_flags=
4067 linker_flags=
4068 dllsearchpath=
4069 lib_search_path=`pwd`
4070 inst_prefix_dir=
4071 new_inherited_linker_flags=
4072
4073 avoid_version=no
4074 dlfiles=
4075 dlprefiles=
4076 dlself=no
4077 export_dynamic=no
4078 export_symbols=
4079 export_symbols_regex=
4080 generated=
4081 libobjs=
4082 ltlibs=
4083 module=no
4084 no_install=no
4085 objs=
4086 non_pic_objects=
4087 precious_files_regex=
4088 prefer_static_libs=no
4089 preload=no
4090 prev=
4091 prevarg=
4092 release=
4093 rpath=
4094 xrpath=
4095 perm_rpath=
4096 temp_rpath=
4097 thread_safe=no
4098 vinfo=
4099 vinfo_number=no
4100 weak_libs=
4101 single_module="${wl}-single_module"
4102 func_infer_tag $base_compile
4103
4104 # We need to know -static, to get the right output filenames.
4105 for arg
4106 do
4107 case $arg in
4108 -shared)
4109 test "$build_libtool_libs" != yes && \
4110 func_fatal_configuration "can not build a shared library"
4111 build_old_libs=no
4112 break
4113 ;;
4114 -all-static | -static | -static-libtool-libs)
4115 case $arg in
4116 -all-static)
4117 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4118 func_warning "complete static linking is impossible in this configuration"
4119 fi
4120 if test -n "$link_static_flag"; then
4121 dlopen_self=$dlopen_self_static
4122 fi
4123 prefer_static_libs=yes
4124 ;;
4125 -static)
4126 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4127 dlopen_self=$dlopen_self_static
4128 fi
4129 prefer_static_libs=built
4130 ;;
4131 -static-libtool-libs)
4132 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4133 dlopen_self=$dlopen_self_static
4134 fi
4135 prefer_static_libs=yes
4136 ;;
4137 esac
4138 build_libtool_libs=no
4139 build_old_libs=yes
4140 break
4141 ;;
4142 esac
4143 done
4144
4145 # See if our shared archives depend on static archives.
4146 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4147
4148 # Go through the arguments, transforming them on the way.
4149 while test "$#" -gt 0; do
4150 arg="$1"
4151 shift
4152 func_quote_for_eval "$arg"
4153 qarg=$func_quote_for_eval_unquoted_result
4154 func_append libtool_args " $func_quote_for_eval_result"
4155
4156 # If the previous option needs an argument, assign it.
4157 if test -n "$prev"; then
4158 case $prev in
4159 output)
4160 func_append compile_command " @OUTPUT@"
4161 func_append finalize_command " @OUTPUT@"
4162 ;;
4163 esac
4164
4165 case $prev in
4166 dlfiles|dlprefiles)
4167 if test "$preload" = no; then
4168 # Add the symbol object into the linking commands.
4169 func_append compile_command " @SYMFILE@"
4170 func_append finalize_command " @SYMFILE@"
4171 preload=yes
4172 fi
4173 case $arg in
4174 *.la | *.lo) ;; # We handle these cases below.
4175 force)
4176 if test "$dlself" = no; then
4177 dlself=needless
4178 export_dynamic=yes
4179 fi
4180 prev=
4181 continue
4182 ;;
4183 self)
4184 if test "$prev" = dlprefiles; then
4185 dlself=yes
4186 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4187 dlself=yes
4188 else
4189 dlself=needless
4190 export_dynamic=yes
4191 fi
4192 prev=
4193 continue
4194 ;;
4195 *)
4196 if test "$prev" = dlfiles; then
4197 dlfiles="$dlfiles $arg"
4198 else
4199 dlprefiles="$dlprefiles $arg"
4200 fi
4201 prev=
4202 continue
4203 ;;
4204 esac
4205 ;;
4206 expsyms)
4207 export_symbols="$arg"
4208 test -f "$arg" \
4209 || func_fatal_error "symbol file \`$arg' does not exist"
4210 prev=
4211 continue
4212 ;;
4213 expsyms_regex)
4214 export_symbols_regex="$arg"
4215 prev=
4216 continue
4217 ;;
4218 framework)
4219 case $host in
4220 *-*-darwin*)
4221 case "$deplibs " in
4222 *" $qarg.ltframework "*) ;;
4223 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4224 ;;
4225 esac
4226 ;;
4227 esac
4228 prev=
4229 continue
4230 ;;
4231 inst_prefix)
4232 inst_prefix_dir="$arg"
4233 prev=
4234 continue
4235 ;;
4236 objectlist)
4237 if test -f "$arg"; then
4238 save_arg=$arg
4239 moreargs=
4240 for fil in `cat "$save_arg"`
4241 do
4242 # moreargs="$moreargs $fil"
4243 arg=$fil
4244 # A libtool-controlled object.
4245
4246 # Check to see that this really is a libtool object.
4247 if func_lalib_unsafe_p "$arg"; then
4248 pic_object=
4249 non_pic_object=
4250
4251 # Read the .lo file
4252 func_source "$arg"
4253
4254 if test -z "$pic_object" ||
4255 test -z "$non_pic_object" ||
4256 test "$pic_object" = none &&
4257 test "$non_pic_object" = none; then
4258 func_fatal_error "cannot find name of object for \`$arg'"
4259 fi
4260
4261 # Extract subdirectory from the argument.
4262 func_dirname "$arg" "/" ""
4263 xdir="$func_dirname_result"
4264
4265 if test "$pic_object" != none; then
4266 # Prepend the subdirectory the object is found in.
4267 pic_object="$xdir$pic_object"
4268
4269 if test "$prev" = dlfiles; then
4270 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4271 dlfiles="$dlfiles $pic_object"
4272 prev=
4273 continue
4274 else
4275 # If libtool objects are unsupported, then we need to preload.
4276 prev=dlprefiles
4277 fi
4278 fi
4279
4280 # CHECK ME: I think I busted this. -Ossama
4281 if test "$prev" = dlprefiles; then
4282 # Preload the old-style object.
4283 dlprefiles="$dlprefiles $pic_object"
4284 prev=
4285 fi
4286
4287 # A PIC object.
4288 func_append libobjs " $pic_object"
4289 arg="$pic_object"
4290 fi
4291
4292 # Non-PIC object.
4293 if test "$non_pic_object" != none; then
4294 # Prepend the subdirectory the object is found in.
4295 non_pic_object="$xdir$non_pic_object"
4296
4297 # A standard non-PIC object
4298 func_append non_pic_objects " $non_pic_object"
4299 if test -z "$pic_object" || test "$pic_object" = none ; then
4300 arg="$non_pic_object"
4301 fi
4302 else
4303 # If the PIC object exists, use it instead.
4304 # $xdir was prepended to $pic_object above.
4305 non_pic_object="$pic_object"
4306 func_append non_pic_objects " $non_pic_object"
4307 fi
4308 else
4309 # Only an error if not doing a dry-run.
4310 if $opt_dry_run; then
4311 # Extract subdirectory from the argument.
4312 func_dirname "$arg" "/" ""
4313 xdir="$func_dirname_result"
4314
4315 func_lo2o "$arg"
4316 pic_object=$xdir$objdir/$func_lo2o_result
4317 non_pic_object=$xdir$func_lo2o_result
4318 func_append libobjs " $pic_object"
4319 func_append non_pic_objects " $non_pic_object"
4320 else
4321 func_fatal_error "\`$arg' is not a valid libtool object"
4322 fi
4323 fi
4324 done
4325 else
4326 func_fatal_error "link input file \`$arg' does not exist"
4327 fi
4328 arg=$save_arg
4329 prev=
4330 continue
4331 ;;
4332 precious_regex)
4333 precious_files_regex="$arg"
4334 prev=
4335 continue
4336 ;;
4337 release)
4338 release="-$arg"
4339 prev=
4340 continue
4341 ;;
4342 rpath | xrpath)
4343 # We need an absolute path.
4344 case $arg in
4345 [\\/]* | [A-Za-z]:[\\/]*) ;;
4346 *)
4347 func_fatal_error "only absolute run-paths are allowed"
4348 ;;
4349 esac
4350 if test "$prev" = rpath; then
4351 case "$rpath " in
4352 *" $arg "*) ;;
4353 *) rpath="$rpath $arg" ;;
4354 esac
4355 else
4356 case "$xrpath " in
4357 *" $arg "*) ;;
4358 *) xrpath="$xrpath $arg" ;;
4359 esac
4360 fi
4361 prev=
4362 continue
4363 ;;
4364 shrext)
4365 shrext_cmds="$arg"
4366 prev=
4367 continue
4368 ;;
4369 weak)
4370 weak_libs="$weak_libs $arg"
4371 prev=
4372 continue
4373 ;;
4374 xcclinker)
4375 linker_flags="$linker_flags $qarg"
4376 compiler_flags="$compiler_flags $qarg"
4377 prev=
4378 func_append compile_command " $qarg"
4379 func_append finalize_command " $qarg"
4380 continue
4381 ;;
4382 xcompiler)
4383 compiler_flags="$compiler_flags $qarg"
4384 prev=
4385 func_append compile_command " $qarg"
4386 func_append finalize_command " $qarg"
4387 continue
4388 ;;
4389 xlinker)
4390 linker_flags="$linker_flags $qarg"
4391 compiler_flags="$compiler_flags $wl$qarg"
4392 prev=
4393 func_append compile_command " $wl$qarg"
4394 func_append finalize_command " $wl$qarg"
4395 continue
4396 ;;
4397 *)
4398 eval "$prev=\"\$arg\""
4399 prev=
4400 continue
4401 ;;
4402 esac
4403 fi # test -n "$prev"
4404
4405 prevarg="$arg"
4406
4407 case $arg in
4408 -all-static)
4409 if test -n "$link_static_flag"; then
4410 # See comment for -static flag below, for more details.
4411 func_append compile_command " $link_static_flag"
4412 func_append finalize_command " $link_static_flag"
4413 fi
4414 continue
4415 ;;
4416
4417 -allow-undefined)
4418 # FIXME: remove this flag sometime in the future.
4419 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4420 ;;
4421
4422 -avoid-version)
4423 avoid_version=yes
4424 continue
4425 ;;
4426
4427 -dlopen)
4428 prev=dlfiles
4429 continue
4430 ;;
4431
4432 -dlpreopen)
4433 prev=dlprefiles
4434 continue
4435 ;;
4436
4437 -export-dynamic)
4438 export_dynamic=yes
4439 continue
4440 ;;
4441
4442 -export-symbols | -export-symbols-regex)
4443 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4444 func_fatal_error "more than one -exported-symbols argument is not allowed"
4445 fi
4446 if test "X$arg" = "X-export-symbols"; then
4447 prev=expsyms
4448 else
4449 prev=expsyms_regex
4450 fi
4451 continue
4452 ;;
4453
4454 -framework)
4455 prev=framework
4456 continue
4457 ;;
4458
4459 -inst-prefix-dir)
4460 prev=inst_prefix
4461 continue
4462 ;;
4463
4464 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4465 # so, if we see these flags be careful not to treat them like -L
4466 -L[A-Z][A-Z]*:*)
4467 case $with_gcc/$host in
4468 no/*-*-irix* | /*-*-irix*)
4469 func_append compile_command " $arg"
4470 func_append finalize_command " $arg"
4471 ;;
4472 esac
4473 continue
4474 ;;
4475
4476 -L*)
4477 func_stripname '-L' '' "$arg"
4478 dir=$func_stripname_result
4479 if test -z "$dir"; then
4480 if test "$#" -gt 0; then
4481 func_fatal_error "require no space between \`-L' and \`$1'"
4482 else
4483 func_fatal_error "need path for \`-L' option"
4484 fi
4485 fi
4486 # We need an absolute path.
4487 case $dir in
4488 [\\/]* | [A-Za-z]:[\\/]*) ;;
4489 *)
4490 absdir=`cd "$dir" && pwd`
4491 test -z "$absdir" && \
4492 func_fatal_error "cannot determine absolute directory name of \`$dir'"
4493 dir="$absdir"
4494 ;;
4495 esac
4496 case "$deplibs " in
4497 *" -L$dir "*) ;;
4498 *)
4499 deplibs="$deplibs -L$dir"
4500 lib_search_path="$lib_search_path $dir"
4501 ;;
4502 esac
4503 case $host in
4504 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4505 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4506 case :$dllsearchpath: in
4507 *":$dir:"*) ;;
4508 ::) dllsearchpath=$dir;;
4509 *) dllsearchpath="$dllsearchpath:$dir";;
4510 esac
4511 case :$dllsearchpath: in
4512 *":$testbindir:"*) ;;
4513 ::) dllsearchpath=$testbindir;;
4514 *) dllsearchpath="$dllsearchpath:$testbindir";;
4515 esac
4516 ;;
4517 esac
4518 continue
4519 ;;
4520
4521 -l*)
4522 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4523 case $host in
4524 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
4525 # These systems don't actually have a C or math library (as such)
4526 continue
4527 ;;
4528 *-*-os2*)
4529 # These systems don't actually have a C library (as such)
4530 test "X$arg" = "X-lc" && continue
4531 ;;
4532 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4533 # Do not include libc due to us having libc/libc_r.
4534 test "X$arg" = "X-lc" && continue
4535 ;;
4536 *-*-rhapsody* | *-*-darwin1.[012])
4537 # Rhapsody C and math libraries are in the System framework
4538 deplibs="$deplibs System.ltframework"
4539 continue
4540 ;;
4541 *-*-sco3.2v5* | *-*-sco5v6*)
4542 # Causes problems with __ctype
4543 test "X$arg" = "X-lc" && continue
4544 ;;
4545 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4546 # Compiler inserts libc in the correct place for threads to work
4547 test "X$arg" = "X-lc" && continue
4548 ;;
4549 esac
4550 elif test "X$arg" = "X-lc_r"; then
4551 case $host in
4552 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4553 # Do not include libc_r directly, use -pthread flag.
4554 continue
4555 ;;
4556 esac
4557 fi
4558 deplibs="$deplibs $arg"
4559 continue
4560 ;;
4561
4562 -module)
4563 module=yes
4564 continue
4565 ;;
4566
4567 # Tru64 UNIX uses -model [arg] to determine the layout of C++
4568 # classes, name mangling, and exception handling.
4569 # Darwin uses the -arch flag to determine output architecture.
4570 -model|-arch|-isysroot)
4571 compiler_flags="$compiler_flags $arg"
4572 func_append compile_command " $arg"
4573 func_append finalize_command " $arg"
4574 prev=xcompiler
4575 continue
4576 ;;
4577
4578 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4579 compiler_flags="$compiler_flags $arg"
4580 func_append compile_command " $arg"
4581 func_append finalize_command " $arg"
4582 case "$new_inherited_linker_flags " in
4583 *" $arg "*) ;;
4584 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4585 esac
4586 continue
4587 ;;
4588
4589 -multi_module)
4590 single_module="${wl}-multi_module"
4591 continue
4592 ;;
4593
4594 -no-fast-install)
4595 fast_install=no
4596 continue
4597 ;;
4598
4599 -no-install)
4600 case $host in
4601 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
4602 # The PATH hackery in wrapper scripts is required on Windows
4603 # and Darwin in order for the loader to find any dlls it needs.
4604 func_warning "\`-no-install' is ignored for $host"
4605 func_warning "assuming \`-no-fast-install' instead"
4606 fast_install=no
4607 ;;
4608 *) no_install=yes ;;
4609 esac
4610 continue
4611 ;;
4612
4613 -no-undefined)
4614 allow_undefined=no
4615 continue
4616 ;;
4617
4618 -objectlist)
4619 prev=objectlist
4620 continue
4621 ;;
4622
4623 -o) prev=output ;;
4624
4625 -precious-files-regex)
4626 prev=precious_regex
4627 continue
4628 ;;
4629
4630 -release)
4631 prev=release
4632 continue
4633 ;;
4634
4635 -rpath)
4636 prev=rpath
4637 continue
4638 ;;
4639
4640 -R)
4641 prev=xrpath
4642 continue
4643 ;;
4644
4645 -R*)
4646 func_stripname '-R' '' "$arg"
4647 dir=$func_stripname_result
4648 # We need an absolute path.
4649 case $dir in
4650 [\\/]* | [A-Za-z]:[\\/]*) ;;
4651 *)
4652 func_fatal_error "only absolute run-paths are allowed"
4653 ;;
4654 esac
4655 case "$xrpath " in
4656 *" $dir "*) ;;
4657 *) xrpath="$xrpath $dir" ;;
4658 esac
4659 continue
4660 ;;
4661
4662 -shared)
4663 # The effects of -shared are defined in a previous loop.
4664 continue
4665 ;;
4666
4667 -shrext)
4668 prev=shrext
4669 continue
4670 ;;
4671
4672 -static | -static-libtool-libs)
4673 # The effects of -static are defined in a previous loop.
4674 # We used to do the same as -all-static on platforms that
4675 # didn't have a PIC flag, but the assumption that the effects
4676 # would be equivalent was wrong. It would break on at least
4677 # Digital Unix and AIX.
4678 continue
4679 ;;
4680
4681 -thread-safe)
4682 thread_safe=yes
4683 continue
4684 ;;
4685
4686 -version-info)
4687 prev=vinfo
4688 continue
4689 ;;
4690
4691 -version-number)
4692 prev=vinfo
4693 vinfo_number=yes
4694 continue
4695 ;;
4696
4697 -weak)
4698 prev=weak
4699 continue
4700 ;;
4701
4702 -Wc,*)
4703 func_stripname '-Wc,' '' "$arg"
4704 args=$func_stripname_result
4705 arg=
4706 save_ifs="$IFS"; IFS=','
4707 for flag in $args; do
4708 IFS="$save_ifs"
4709 func_quote_for_eval "$flag"
4710 arg="$arg $wl$func_quote_for_eval_result"
4711 compiler_flags="$compiler_flags $func_quote_for_eval_result"
4712 done
4713 IFS="$save_ifs"
4714 func_stripname ' ' '' "$arg"
4715 arg=$func_stripname_result
4716 ;;
4717
4718 -Wl,*)
4719 func_stripname '-Wl,' '' "$arg"
4720 args=$func_stripname_result
4721 arg=
4722 save_ifs="$IFS"; IFS=','
4723 for flag in $args; do
4724 IFS="$save_ifs"
4725 func_quote_for_eval "$flag"
4726 arg="$arg $wl$func_quote_for_eval_result"
4727 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4728 linker_flags="$linker_flags $func_quote_for_eval_result"
4729 done
4730 IFS="$save_ifs"
4731 func_stripname ' ' '' "$arg"
4732 arg=$func_stripname_result
4733 ;;
4734
4735 -Xcompiler)
4736 prev=xcompiler
4737 continue
4738 ;;
4739
4740 -Xlinker)
4741 prev=xlinker
4742 continue
4743 ;;
4744
4745 -XCClinker)
4746 prev=xcclinker
4747 continue
4748 ;;
4749
4750 # -msg_* for osf cc
4751 -msg_*)
4752 func_quote_for_eval "$arg"
4753 arg="$func_quote_for_eval_result"
4754 ;;
4755
4756 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4757 # -r[0-9][0-9]* specifies the processor on the SGI compiler
4758 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4759 # +DA*, +DD* enable 64-bit mode on the HP compiler
4760 # -q* pass through compiler args for the IBM compiler
4761 # -m*, -t[45]*, -txscale* pass through architecture-specific
4762 # compiler args for GCC
4763 # -F/path gives path to uninstalled frameworks, gcc on darwin
4764 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4765 # @file GCC response files
4766 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4767 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
4768 func_quote_for_eval "$arg"
4769 arg="$func_quote_for_eval_result"
4770 func_append compile_command " $arg"
4771 func_append finalize_command " $arg"
4772 compiler_flags="$compiler_flags $arg"
4773 continue
4774 ;;
4775
4776 # Some other compiler flag.
4777 -* | +*)
4778 func_quote_for_eval "$arg"
4779 arg="$func_quote_for_eval_result"
4780 ;;
4781
4782 *.$objext)
4783 # A standard object.
4784 objs="$objs $arg"
4785 ;;
4786
4787 *.lo)
4788 # A libtool-controlled object.
4789
4790 # Check to see that this really is a libtool object.
4791 if func_lalib_unsafe_p "$arg"; then
4792 pic_object=
4793 non_pic_object=
4794
4795 # Read the .lo file
4796 func_source "$arg"
4797
4798 if test -z "$pic_object" ||
4799 test -z "$non_pic_object" ||
4800 test "$pic_object" = none &&
4801 test "$non_pic_object" = none; then
4802 func_fatal_error "cannot find name of object for \`$arg'"
4803 fi
4804
4805 # Extract subdirectory from the argument.
4806 func_dirname "$arg" "/" ""
4807 xdir="$func_dirname_result"
4808
4809 if test "$pic_object" != none; then
4810 # Prepend the subdirectory the object is found in.
4811 pic_object="$xdir$pic_object"
4812
4813 if test "$prev" = dlfiles; then
4814 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4815 dlfiles="$dlfiles $pic_object"
4816 prev=
4817 continue
4818 else
4819 # If libtool objects are unsupported, then we need to preload.
4820 prev=dlprefiles
4821 fi
4822 fi
4823
4824 # CHECK ME: I think I busted this. -Ossama
4825 if test "$prev" = dlprefiles; then
4826 # Preload the old-style object.
4827 dlprefiles="$dlprefiles $pic_object"
4828 prev=
4829 fi
4830
4831 # A PIC object.
4832 func_append libobjs " $pic_object"
4833 arg="$pic_object"
4834 fi
4835
4836 # Non-PIC object.
4837 if test "$non_pic_object" != none; then
4838 # Prepend the subdirectory the object is found in.
4839 non_pic_object="$xdir$non_pic_object"
4840
4841 # A standard non-PIC object
4842 func_append non_pic_objects " $non_pic_object"
4843 if test -z "$pic_object" || test "$pic_object" = none ; then
4844 arg="$non_pic_object"
4845 fi
4846 else
4847 # If the PIC object exists, use it instead.
4848 # $xdir was prepended to $pic_object above.
4849 non_pic_object="$pic_object"
4850 func_append non_pic_objects " $non_pic_object"
4851 fi
4852 else
4853 # Only an error if not doing a dry-run.
4854 if $opt_dry_run; then
4855 # Extract subdirectory from the argument.
4856 func_dirname "$arg" "/" ""
4857 xdir="$func_dirname_result"
4858
4859 func_lo2o "$arg"
4860 pic_object=$xdir$objdir/$func_lo2o_result
4861 non_pic_object=$xdir$func_lo2o_result
4862 func_append libobjs " $pic_object"
4863 func_append non_pic_objects " $non_pic_object"
4864 else
4865 func_fatal_error "\`$arg' is not a valid libtool object"
4866 fi
4867 fi
4868 ;;
4869
4870 *.$libext)
4871 # An archive.
4872 deplibs="$deplibs $arg"
4873 old_deplibs="$old_deplibs $arg"
4874 continue
4875 ;;
4876
4877 *.la)
4878 # A libtool-controlled library.
4879
4880 if test "$prev" = dlfiles; then
4881 # This library was specified with -dlopen.
4882 dlfiles="$dlfiles $arg"
4883 prev=
4884 elif test "$prev" = dlprefiles; then
4885 # The library was specified with -dlpreopen.
4886 dlprefiles="$dlprefiles $arg"
4887 prev=
4888 else
4889 deplibs="$deplibs $arg"
4890 fi
4891 continue
4892 ;;
4893
4894 # Some other compiler argument.
4895 *)
4896 # Unknown arguments in both finalize_command and compile_command need
4897 # to be aesthetically quoted because they are evaled later.
4898 func_quote_for_eval "$arg"
4899 arg="$func_quote_for_eval_result"
4900 ;;
4901 esac # arg
4902
4903 # Now actually substitute the argument into the commands.
4904 if test -n "$arg"; then
4905 func_append compile_command " $arg"
4906 func_append finalize_command " $arg"
4907 fi
4908 done # argument parsing loop
4909
4910 test -n "$prev" && \
4911 func_fatal_help "the \`$prevarg' option requires an argument"
4912
4913 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4914 eval arg=\"$export_dynamic_flag_spec\"
4915 func_append compile_command " $arg"
4916 func_append finalize_command " $arg"
4917 fi
4918
4919 oldlibs=
4920 # calculate the name of the file, without its directory
4921 func_basename "$output"
4922 outputname="$func_basename_result"
4923 libobjs_save="$libobjs"
4924
4925 if test -n "$shlibpath_var"; then
4926 # get the directories listed in $shlibpath_var
4927 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4928 else
4929 shlib_search_path=
4930 fi
4931 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4932 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4933
4934 func_dirname "$output" "/" ""
4935 output_objdir="$func_dirname_result$objdir"
4936 # Create the object directory.
4937 func_mkdir_p "$output_objdir"
4938
4939 # Determine the type of output
4940 case $output in
4941 "")
4942 func_fatal_help "you must specify an output file"
4943 ;;
4944 *.$libext) linkmode=oldlib ;;
4945 *.lo | *.$objext) linkmode=obj ;;
4946 *.la) linkmode=lib ;;
4947 *) linkmode=prog ;; # Anything else should be a program.
4948 esac
4949
4950 specialdeplibs=
4951
4952 libs=
4953 # Find all interdependent deplibs by searching for libraries
4954 # that are linked more than once (e.g. -la -lb -la)
4955 for deplib in $deplibs; do
4956 if $opt_duplicate_deps ; then
4957 case "$libs " in
4958 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4959 esac
4960 fi
4961 libs="$libs $deplib"
4962 done
4963
4964 if test "$linkmode" = lib; then
4965 libs="$predeps $libs $compiler_lib_search_path $postdeps"
4966
4967 # Compute libraries that are listed more than once in $predeps
4968 # $postdeps and mark them as special (i.e., whose duplicates are
4969 # not to be eliminated).
4970 pre_post_deps=
4971 if $opt_duplicate_compiler_generated_deps; then
4972 for pre_post_dep in $predeps $postdeps; do
4973 case "$pre_post_deps " in
4974 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
4975 esac
4976 pre_post_deps="$pre_post_deps $pre_post_dep"
4977 done
4978 fi
4979 pre_post_deps=
4980 fi
4981
4982 deplibs=
4983 newdependency_libs=
4984 newlib_search_path=
4985 need_relink=no # whether we're linking any uninstalled libtool libraries
4986 notinst_deplibs= # not-installed libtool libraries
4987 notinst_path= # paths that contain not-installed libtool libraries
4988
4989 case $linkmode in
4990 lib)
4991 passes="conv dlpreopen link"
4992 for file in $dlfiles $dlprefiles; do
4993 case $file in
4994 *.la) ;;
4995 *)
4996 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
4997 ;;
4998 esac
4999 done
5000 ;;
5001 prog)
5002 compile_deplibs=
5003 finalize_deplibs=
5004 alldeplibs=no
5005 newdlfiles=
5006 newdlprefiles=
5007 passes="conv scan dlopen dlpreopen link"
5008 ;;
5009 *) passes="conv"
5010 ;;
5011 esac
5012
5013 for pass in $passes; do
5014 # The preopen pass in lib mode reverses $deplibs; put it back here
5015 # so that -L comes before libs that need it for instance...
5016 if test "$linkmode,$pass" = "lib,link"; then
5017 ## FIXME: Find the place where the list is rebuilt in the wrong
5018 ## order, and fix it there properly
5019 tmp_deplibs=
5020 for deplib in $deplibs; do
5021 tmp_deplibs="$deplib $tmp_deplibs"
5022 done
5023 deplibs="$tmp_deplibs"
5024 fi
5025
5026 if test "$linkmode,$pass" = "lib,link" ||
5027 test "$linkmode,$pass" = "prog,scan"; then
5028 libs="$deplibs"
5029 deplibs=
5030 fi
5031 if test "$linkmode" = prog; then
5032 case $pass in
5033 dlopen) libs="$dlfiles" ;;
5034 dlpreopen) libs="$dlprefiles" ;;
5035 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
5036 esac
5037 fi
5038 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5039 # Collect and forward deplibs of preopened libtool libs
5040 for lib in $dlprefiles; do
5041 # Ignore non-libtool-libs
5042 dependency_libs=
5043 case $lib in
5044 *.la) func_source "$lib" ;;
5045 esac
5046
5047 # Collect preopened libtool deplibs, except any this library
5048 # has declared as weak libs
5049 for deplib in $dependency_libs; do
5050 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
5051 case " $weak_libs " in
5052 *" $deplib_base "*) ;;
5053 *) deplibs="$deplibs $deplib" ;;
5054 esac
5055 done
5056 done
5057 libs="$dlprefiles"
5058 fi
5059 if test "$pass" = dlopen; then
5060 # Collect dlpreopened libraries
5061 save_deplibs="$deplibs"
5062 deplibs=
5063 fi
5064
5065 for deplib in $libs; do
5066 lib=
5067 found=no
5068 case $deplib in
5069 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5070 if test "$linkmode,$pass" = "prog,link"; then
5071 compile_deplibs="$deplib $compile_deplibs"
5072 finalize_deplibs="$deplib $finalize_deplibs"
5073 else
5074 compiler_flags="$compiler_flags $deplib"
5075 if test "$linkmode" = lib ; then
5076 case "$new_inherited_linker_flags " in
5077 *" $deplib "*) ;;
5078 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5079 esac
5080 fi
5081 fi
5082 continue
5083 ;;
5084 -l*)
5085 if test "$linkmode" != lib && test "$linkmode" != prog; then
5086 func_warning "\`-l' is ignored for archives/objects"
5087 continue
5088 fi
5089 func_stripname '-l' '' "$deplib"
5090 name=$func_stripname_result
5091 if test "$linkmode" = lib; then
5092 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5093 else
5094 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5095 fi
5096 for searchdir in $searchdirs; do
5097 for search_ext in .la $std_shrext .so .a; do
5098 # Search the libtool library
5099 lib="$searchdir/lib${name}${search_ext}"
5100 if test -f "$lib"; then
5101 if test "$search_ext" = ".la"; then
5102 found=yes
5103 else
5104 found=no
5105 fi
5106 break 2
5107 fi
5108 done
5109 done
5110 if test "$found" != yes; then
5111 # deplib doesn't seem to be a libtool library
5112 if test "$linkmode,$pass" = "prog,link"; then
5113 compile_deplibs="$deplib $compile_deplibs"
5114 finalize_deplibs="$deplib $finalize_deplibs"
5115 else
5116 deplibs="$deplib $deplibs"
5117 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5118 fi
5119 continue
5120 else # deplib is a libtool library
5121 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5122 # We need to do some special things here, and not later.
5123 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5124 case " $predeps $postdeps " in
5125 *" $deplib "*)
5126 if func_lalib_p "$lib"; then
5127 library_names=
5128 old_library=
5129 func_source "$lib"
5130 for l in $old_library $library_names; do
5131 ll="$l"
5132 done
5133 if test "X$ll" = "X$old_library" ; then # only static version available
5134 found=no
5135 func_dirname "$lib" "" "."
5136 ladir="$func_dirname_result"
5137 lib=$ladir/$old_library
5138 if test "$linkmode,$pass" = "prog,link"; then
5139 compile_deplibs="$deplib $compile_deplibs"
5140 finalize_deplibs="$deplib $finalize_deplibs"
5141 else
5142 deplibs="$deplib $deplibs"
5143 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5144 fi
5145 continue
5146 fi
5147 fi
5148 ;;
5149 *) ;;
5150 esac
5151 fi
5152 fi
5153 ;; # -l
5154 *.ltframework)
5155 if test "$linkmode,$pass" = "prog,link"; then
5156 compile_deplibs="$deplib $compile_deplibs"
5157 finalize_deplibs="$deplib $finalize_deplibs"
5158 else
5159 deplibs="$deplib $deplibs"
5160 if test "$linkmode" = lib ; then
5161 case "$new_inherited_linker_flags " in
5162 *" $deplib "*) ;;
5163 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5164 esac
5165 fi
5166 fi
5167 continue
5168 ;;
5169 -L*)
5170 case $linkmode in
5171 lib)
5172 deplibs="$deplib $deplibs"
5173 test "$pass" = conv && continue
5174 newdependency_libs="$deplib $newdependency_libs"
5175 func_stripname '-L' '' "$deplib"
5176 newlib_search_path="$newlib_search_path $func_stripname_result"
5177 ;;
5178 prog)
5179 if test "$pass" = conv; then
5180 deplibs="$deplib $deplibs"
5181 continue
5182 fi
5183 if test "$pass" = scan; then
5184 deplibs="$deplib $deplibs"
5185 else
5186 compile_deplibs="$deplib $compile_deplibs"
5187 finalize_deplibs="$deplib $finalize_deplibs"
5188 fi
5189 func_stripname '-L' '' "$deplib"
5190 newlib_search_path="$newlib_search_path $func_stripname_result"
5191 ;;
5192 *)
5193 func_warning "\`-L' is ignored for archives/objects"
5194 ;;
5195 esac # linkmode
5196 continue
5197 ;; # -L
5198 -R*)
5199 if test "$pass" = link; then
5200 func_stripname '-R' '' "$deplib"
5201 dir=$func_stripname_result
5202 # Make sure the xrpath contains only unique directories.
5203 case "$xrpath " in
5204 *" $dir "*) ;;
5205 *) xrpath="$xrpath $dir" ;;
5206 esac
5207 fi
5208 deplibs="$deplib $deplibs"
5209 continue
5210 ;;
5211 *.la) lib="$deplib" ;;
5212 *.$libext)
5213 if test "$pass" = conv; then
5214 deplibs="$deplib $deplibs"
5215 continue
5216 fi
5217 case $linkmode in
5218 lib)
5219 # Linking convenience modules into shared libraries is allowed,
5220 # but linking other static libraries is non-portable.
5221 case " $dlpreconveniencelibs " in
5222 *" $deplib "*) ;;
5223 *)
5224 valid_a_lib=no
5225 case $deplibs_check_method in
5226 match_pattern*)
5227 set dummy $deplibs_check_method; shift
5228 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5229 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
5230 | $EGREP "$match_pattern_regex" > /dev/null; then
5231 valid_a_lib=yes
5232 fi
5233 ;;
5234 pass_all)
5235 valid_a_lib=yes
5236 ;;
5237 esac
5238 if test "$valid_a_lib" != yes; then
5239 $ECHO
5240 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5241 $ECHO "*** I have the capability to make that library automatically link in when"
5242 $ECHO "*** you link to this library. But I can only do this if you have a"
5243 $ECHO "*** shared version of the library, which you do not appear to have"
5244 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5245 $ECHO "*** that it is just a static archive that I should not use here."
5246 else
5247 $ECHO
5248 $ECHO "*** Warning: Linking the shared library $output against the"
5249 $ECHO "*** static library $deplib is not portable!"
5250 deplibs="$deplib $deplibs"
5251 fi
5252 ;;
5253 esac
5254 continue
5255 ;;
5256 prog)
5257 if test "$pass" != link; then
5258 deplibs="$deplib $deplibs"
5259 else
5260 compile_deplibs="$deplib $compile_deplibs"
5261 finalize_deplibs="$deplib $finalize_deplibs"
5262 fi
5263 continue
5264 ;;
5265 esac # linkmode
5266 ;; # *.$libext
5267 *.lo | *.$objext)
5268 if test "$pass" = conv; then
5269 deplibs="$deplib $deplibs"
5270 elif test "$linkmode" = prog; then
5271 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5272 # If there is no dlopen support or we're linking statically,
5273 # we need to preload.
5274 newdlprefiles="$newdlprefiles $deplib"
5275 compile_deplibs="$deplib $compile_deplibs"
5276 finalize_deplibs="$deplib $finalize_deplibs"
5277 else
5278 newdlfiles="$newdlfiles $deplib"
5279 fi
5280 fi
5281 continue
5282 ;;
5283 %DEPLIBS%)
5284 alldeplibs=yes
5285 continue
5286 ;;
5287 esac # case $deplib
5288
5289 if test "$found" = yes || test -f "$lib"; then :
5290 else
5291 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
5292 fi
5293
5294 # Check to see that this really is a libtool archive.
5295 func_lalib_unsafe_p "$lib" \
5296 || func_fatal_error "\`$lib' is not a valid libtool archive"
5297
5298 func_dirname "$lib" "" "."
5299 ladir="$func_dirname_result"
5300
5301 dlname=
5302 dlopen=
5303 dlpreopen=
5304 libdir=
5305 library_names=
5306 old_library=
5307 inherited_linker_flags=
5308 # If the library was installed with an old release of libtool,
5309 # it will not redefine variables installed, or shouldnotlink
5310 installed=yes
5311 shouldnotlink=no
5312 avoidtemprpath=
5313
5314
5315 # Read the .la file
5316 func_source "$lib"
5317
5318 # Convert "-framework foo" to "foo.ltframework"
5319 if test -n "$inherited_linker_flags"; then
5320 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
5321 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5322 case " $new_inherited_linker_flags " in
5323 *" $tmp_inherited_linker_flag "*) ;;
5324 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5325 esac
5326 done
5327 fi
5328 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5329 if test "$linkmode,$pass" = "lib,link" ||
5330 test "$linkmode,$pass" = "prog,scan" ||
5331 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5332 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5333 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5334 fi
5335
5336 if test "$pass" = conv; then
5337 # Only check for convenience libraries
5338 deplibs="$lib $deplibs"
5339 if test -z "$libdir"; then
5340 if test -z "$old_library"; then
5341 func_fatal_error "cannot find name of link library for \`$lib'"
5342 fi
5343 # It is a libtool convenience library, so add in its objects.
5344 convenience="$convenience $ladir/$objdir/$old_library"
5345 old_convenience="$old_convenience $ladir/$objdir/$old_library"
5346 elif test "$linkmode" != prog && test "$linkmode" != lib; then
5347 func_fatal_error "\`$lib' is not a convenience library"
5348 fi
5349 tmp_libs=
5350 for deplib in $dependency_libs; do
5351 deplibs="$deplib $deplibs"
5352 if $opt_duplicate_deps ; then
5353 case "$tmp_libs " in
5354 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5355 esac
5356 fi
5357 tmp_libs="$tmp_libs $deplib"
5358 done
5359 continue
5360 fi # $pass = conv
5361
5362
5363 # Get the name of the library we link against.
5364 linklib=
5365 for l in $old_library $library_names; do
5366 linklib="$l"
5367 done
5368 if test -z "$linklib"; then
5369 func_fatal_error "cannot find name of link library for \`$lib'"
5370 fi
5371
5372 # This library was specified with -dlopen.
5373 if test "$pass" = dlopen; then
5374 if test -z "$libdir"; then
5375 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
5376 fi
5377 if test -z "$dlname" ||
5378 test "$dlopen_support" != yes ||
5379 test "$build_libtool_libs" = no; then
5380 # If there is no dlname, no dlopen support or we're linking
5381 # statically, we need to preload. We also need to preload any
5382 # dependent libraries so libltdl's deplib preloader doesn't
5383 # bomb out in the load deplibs phase.
5384 dlprefiles="$dlprefiles $lib $dependency_libs"
5385 else
5386 newdlfiles="$newdlfiles $lib"
5387 fi
5388 continue
5389 fi # $pass = dlopen
5390
5391 # We need an absolute path.
5392 case $ladir in
5393 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5394 *)
5395 abs_ladir=`cd "$ladir" && pwd`
5396 if test -z "$abs_ladir"; then
5397 func_warning "cannot determine absolute directory name of \`$ladir'"
5398 func_warning "passing it literally to the linker, although it might fail"
5399 abs_ladir="$ladir"
5400 fi
5401 ;;
5402 esac
5403 func_basename "$lib"
5404 laname="$func_basename_result"
5405
5406 # Find the relevant object directory and library name.
5407 if test "X$installed" = Xyes; then
5408 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5409 func_warning "library \`$lib' was moved."
5410 dir="$ladir"
5411 absdir="$abs_ladir"
5412 libdir="$abs_ladir"
5413 else
5414 dir="$libdir"
5415 absdir="$libdir"
5416 fi
5417 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5418 else
5419 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5420 dir="$ladir"
5421 absdir="$abs_ladir"
5422 # Remove this search path later
5423 notinst_path="$notinst_path $abs_ladir"
5424 else
5425 dir="$ladir/$objdir"
5426 absdir="$abs_ladir/$objdir"
5427 # Remove this search path later
5428 notinst_path="$notinst_path $abs_ladir"
5429 fi
5430 fi # $installed = yes
5431 func_stripname 'lib' '.la' "$laname"
5432 name=$func_stripname_result
5433
5434 # This library was specified with -dlpreopen.
5435 if test "$pass" = dlpreopen; then
5436 if test -z "$libdir" && test "$linkmode" = prog; then
5437 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5438 fi
5439 # Prefer using a static library (so that no silly _DYNAMIC symbols
5440 # are required to link).
5441 if test -n "$old_library"; then
5442 newdlprefiles="$newdlprefiles $dir/$old_library"
5443 # Keep a list of preopened convenience libraries to check
5444 # that they are being used correctly in the link pass.
5445 test -z "$libdir" && \
5446 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5447 # Otherwise, use the dlname, so that lt_dlopen finds it.
5448 elif test -n "$dlname"; then
5449 newdlprefiles="$newdlprefiles $dir/$dlname"
5450 else
5451 newdlprefiles="$newdlprefiles $dir/$linklib"
5452 fi
5453 fi # $pass = dlpreopen
5454
5455 if test -z "$libdir"; then
5456 # Link the convenience library
5457 if test "$linkmode" = lib; then
5458 deplibs="$dir/$old_library $deplibs"
5459 elif test "$linkmode,$pass" = "prog,link"; then
5460 compile_deplibs="$dir/$old_library $compile_deplibs"
5461 finalize_deplibs="$dir/$old_library $finalize_deplibs"
5462 else
5463 deplibs="$lib $deplibs" # used for prog,scan pass
5464 fi
5465 continue
5466 fi
5467
5468
5469 if test "$linkmode" = prog && test "$pass" != link; then
5470 newlib_search_path="$newlib_search_path $ladir"
5471 deplibs="$lib $deplibs"
5472
5473 linkalldeplibs=no
5474 if test "$link_all_deplibs" != no || test -z "$library_names" ||
5475 test "$build_libtool_libs" = no; then
5476 linkalldeplibs=yes
5477 fi
5478
5479 tmp_libs=
5480 for deplib in $dependency_libs; do
5481 case $deplib in
5482 -L*) func_stripname '-L' '' "$deplib"
5483 newlib_search_path="$newlib_search_path $func_stripname_result"
5484 ;;
5485 esac
5486 # Need to link against all dependency_libs?
5487 if test "$linkalldeplibs" = yes; then
5488 deplibs="$deplib $deplibs"
5489 else
5490 # Need to hardcode shared library paths
5491 # or/and link against static libraries
5492 newdependency_libs="$deplib $newdependency_libs"
5493 fi
5494 if $opt_duplicate_deps ; then
5495 case "$tmp_libs " in
5496 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5497 esac
5498 fi
5499 tmp_libs="$tmp_libs $deplib"
5500 done # for deplib
5501 continue
5502 fi # $linkmode = prog...
5503
5504 if test "$linkmode,$pass" = "prog,link"; then
5505 if test -n "$library_names" &&
5506 { { test "$prefer_static_libs" = no ||
5507 test "$prefer_static_libs,$installed" = "built,yes"; } ||
5508 test -z "$old_library"; }; then
5509 # We need to hardcode the library path
5510 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
5511 # Make sure the rpath contains only unique directories.
5512 case "$temp_rpath:" in
5513 *"$absdir:"*) ;;
5514 *) temp_rpath="$temp_rpath$absdir:" ;;
5515 esac
5516 fi
5517
5518 # Hardcode the library path.
5519 # Skip directories that are in the system default run-time
5520 # search path.
5521 case " $sys_lib_dlsearch_path " in
5522 *" $absdir "*) ;;
5523 *)
5524 case "$compile_rpath " in
5525 *" $absdir "*) ;;
5526 *) compile_rpath="$compile_rpath $absdir"
5527 esac
5528 ;;
5529 esac
5530 case " $sys_lib_dlsearch_path " in
5531 *" $libdir "*) ;;
5532 *)
5533 case "$finalize_rpath " in
5534 *" $libdir "*) ;;
5535 *) finalize_rpath="$finalize_rpath $libdir"
5536 esac
5537 ;;
5538 esac
5539 fi # $linkmode,$pass = prog,link...
5540
5541 if test "$alldeplibs" = yes &&
5542 { test "$deplibs_check_method" = pass_all ||
5543 { test "$build_libtool_libs" = yes &&
5544 test -n "$library_names"; }; }; then
5545 # We only need to search for static libraries
5546 continue
5547 fi
5548 fi
5549
5550 link_static=no # Whether the deplib will be linked statically
5551 use_static_libs=$prefer_static_libs
5552 if test "$use_static_libs" = built && test "$installed" = yes; then
5553 use_static_libs=no
5554 fi
5555 if test -n "$library_names" &&
5556 { test "$use_static_libs" = no || test -z "$old_library"; }; then
5557 case $host in
5558 *cygwin* | *mingw* | *cegcc*)
5559 # No point in relinking DLLs because paths are not encoded
5560 notinst_deplibs="$notinst_deplibs $lib"
5561 need_relink=no
5562 ;;
5563 *)
5564 if test "$installed" = no; then
5565 notinst_deplibs="$notinst_deplibs $lib"
5566 need_relink=yes
5567 fi
5568 ;;
5569 esac
5570 # This is a shared library
5571
5572 # Warn about portability, can't link against -module's on some
5573 # systems (darwin). Don't bleat about dlopened modules though!
5574 dlopenmodule=""
5575 for dlpremoduletest in $dlprefiles; do
5576 if test "X$dlpremoduletest" = "X$lib"; then
5577 dlopenmodule="$dlpremoduletest"
5578 break
5579 fi
5580 done
5581 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5582 $ECHO
5583 if test "$linkmode" = prog; then
5584 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5585 else
5586 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5587 fi
5588 $ECHO "*** $linklib is not portable!"
5589 fi
5590 if test "$linkmode" = lib &&
5591 test "$hardcode_into_libs" = yes; then
5592 # Hardcode the library path.
5593 # Skip directories that are in the system default run-time
5594 # search path.
5595 case " $sys_lib_dlsearch_path " in
5596 *" $absdir "*) ;;
5597 *)
5598 case "$compile_rpath " in
5599 *" $absdir "*) ;;
5600 *) compile_rpath="$compile_rpath $absdir"
5601 esac
5602 ;;
5603 esac
5604 case " $sys_lib_dlsearch_path " in
5605 *" $libdir "*) ;;
5606 *)
5607 case "$finalize_rpath " in
5608 *" $libdir "*) ;;
5609 *) finalize_rpath="$finalize_rpath $libdir"
5610 esac
5611 ;;
5612 esac
5613 fi
5614
5615 if test -n "$old_archive_from_expsyms_cmds"; then
5616 # figure out the soname
5617 set dummy $library_names
5618 shift
5619 realname="$1"
5620 shift
5621 libname=`eval "\\$ECHO \"$libname_spec\""`
5622 # use dlname if we got it. it's perfectly good, no?
5623 if test -n "$dlname"; then
5624 soname="$dlname"
5625 elif test -n "$soname_spec"; then
5626 # bleh windows
5627 case $host in
5628 *cygwin* | mingw* | *cegcc*)
5629 func_arith $current - $age
5630 major=$func_arith_result
5631 versuffix="-$major"
5632 ;;
5633 esac
5634 eval soname=\"$soname_spec\"
5635 else
5636 soname="$realname"
5637 fi
5638
5639 # Make a new name for the extract_expsyms_cmds to use
5640 soroot="$soname"
5641 func_basename "$soroot"
5642 soname="$func_basename_result"
5643 func_stripname 'lib' '.dll' "$soname"
5644 newlib=libimp-$func_stripname_result.a
5645
5646 # If the library has no export list, then create one now
5647 if test -f "$output_objdir/$soname-def"; then :
5648 else
5649 func_verbose "extracting exported symbol list from \`$soname'"
5650 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
5651 fi
5652
5653 # Create $newlib
5654 if test -f "$output_objdir/$newlib"; then :; else
5655 func_verbose "generating import library for \`$soname'"
5656 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
5657 fi
5658 # make sure the library variables are pointing to the new library
5659 dir=$output_objdir
5660 linklib=$newlib
5661 fi # test -n "$old_archive_from_expsyms_cmds"
5662
5663 if test "$linkmode" = prog || test "$mode" != relink; then
5664 add_shlibpath=
5665 add_dir=
5666 add=
5667 lib_linked=yes
5668 case $hardcode_action in
5669 immediate | unsupported)
5670 if test "$hardcode_direct" = no; then
5671 add="$dir/$linklib"
5672 case $host in
5673 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
5674 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
5675 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
5676 *-*-unixware7*) add_dir="-L$dir" ;;
5677 *-*-darwin* )
5678 # if the lib is a (non-dlopened) module then we can not
5679 # link against it, someone is ignoring the earlier warnings
5680 if /usr/bin/file -L $add 2> /dev/null |
5681 $GREP ": [^:]* bundle" >/dev/null ; then
5682 if test "X$dlopenmodule" != "X$lib"; then
5683 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5684 if test -z "$old_library" ; then
5685 $ECHO
5686 $ECHO "*** And there doesn't seem to be a static archive available"
5687 $ECHO "*** The link will probably fail, sorry"
5688 else
5689 add="$dir/$old_library"
5690 fi
5691 elif test -n "$old_library"; then
5692 add="$dir/$old_library"
5693 fi
5694 fi
5695 esac
5696 elif test "$hardcode_minus_L" = no; then
5697 case $host in
5698 *-*-sunos*) add_shlibpath="$dir" ;;
5699 esac
5700 add_dir="-L$dir"
5701 add="-l$name"
5702 elif test "$hardcode_shlibpath_var" = no; then
5703 add_shlibpath="$dir"
5704 add="-l$name"
5705 else
5706 lib_linked=no
5707 fi
5708 ;;
5709 relink)
5710 if test "$hardcode_direct" = yes &&
5711 test "$hardcode_direct_absolute" = no; then
5712 add="$dir/$linklib"
5713 elif test "$hardcode_minus_L" = yes; then
5714 add_dir="-L$dir"
5715 # Try looking first in the location we're being installed to.
5716 if test -n "$inst_prefix_dir"; then
5717 case $libdir in
5718 [\\/]*)
5719 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5720 ;;
5721 esac
5722 fi
5723 add="-l$name"
5724 elif test "$hardcode_shlibpath_var" = yes; then
5725 add_shlibpath="$dir"
5726 add="-l$name"
5727 else
5728 lib_linked=no
5729 fi
5730 ;;
5731 *) lib_linked=no ;;
5732 esac
5733
5734 if test "$lib_linked" != yes; then
5735 func_fatal_configuration "unsupported hardcode properties"
5736 fi
5737
5738 if test -n "$add_shlibpath"; then
5739 case :$compile_shlibpath: in
5740 *":$add_shlibpath:"*) ;;
5741 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
5742 esac
5743 fi
5744 if test "$linkmode" = prog; then
5745 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
5746 test -n "$add" && compile_deplibs="$add $compile_deplibs"
5747 else
5748 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5749 test -n "$add" && deplibs="$add $deplibs"
5750 if test "$hardcode_direct" != yes &&
5751 test "$hardcode_minus_L" != yes &&
5752 test "$hardcode_shlibpath_var" = yes; then
5753 case :$finalize_shlibpath: in
5754 *":$libdir:"*) ;;
5755 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5756 esac
5757 fi
5758 fi
5759 fi
5760
5761 if test "$linkmode" = prog || test "$mode" = relink; then
5762 add_shlibpath=
5763 add_dir=
5764 add=
5765 # Finalize command for both is simple: just hardcode it.
5766 if test "$hardcode_direct" = yes &&
5767 test "$hardcode_direct_absolute" = no; then
5768 add="$libdir/$linklib"
5769 elif test "$hardcode_minus_L" = yes; then
5770 add_dir="-L$libdir"
5771 add="-l$name"
5772 elif test "$hardcode_shlibpath_var" = yes; then
5773 case :$finalize_shlibpath: in
5774 *":$libdir:"*) ;;
5775 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5776 esac
5777 add="-l$name"
5778 elif test "$hardcode_automatic" = yes; then
5779 if test -n "$inst_prefix_dir" &&
5780 test -f "$inst_prefix_dir$libdir/$linklib" ; then
5781 add="$inst_prefix_dir$libdir/$linklib"
5782 else
5783 add="$libdir/$linklib"
5784 fi
5785 else
5786 # We cannot seem to hardcode it, guess we'll fake it.
5787 add_dir="-L$libdir"
5788 # Try looking first in the location we're being installed to.
5789 if test -n "$inst_prefix_dir"; then
5790 case $libdir in
5791 [\\/]*)
5792 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5793 ;;
5794 esac
5795 fi
5796 add="-l$name"
5797 fi
5798
5799 if test "$linkmode" = prog; then
5800 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
5801 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
5802 else
5803 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5804 test -n "$add" && deplibs="$add $deplibs"
5805 fi
5806 fi
5807 elif test "$linkmode" = prog; then
5808 # Here we assume that one of hardcode_direct or hardcode_minus_L
5809 # is not unsupported. This is valid on all known static and
5810 # shared platforms.
5811 if test "$hardcode_direct" != unsupported; then
5812 test -n "$old_library" && linklib="$old_library"
5813 compile_deplibs="$dir/$linklib $compile_deplibs"
5814 finalize_deplibs="$dir/$linklib $finalize_deplibs"
5815 else
5816 compile_deplibs="-l$name -L$dir $compile_deplibs"
5817 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
5818 fi
5819 elif test "$build_libtool_libs" = yes; then
5820 # Not a shared library
5821 if test "$deplibs_check_method" != pass_all; then
5822 # We're trying link a shared library against a static one
5823 # but the system doesn't support it.
5824
5825 # Just print a warning and add the library to dependency_libs so
5826 # that the program can be linked against the static library.
5827 $ECHO
5828 $ECHO "*** Warning: This system can not link to static lib archive $lib."
5829 $ECHO "*** I have the capability to make that library automatically link in when"
5830 $ECHO "*** you link to this library. But I can only do this if you have a"
5831 $ECHO "*** shared version of the library, which you do not appear to have."
5832 if test "$module" = yes; then
5833 $ECHO "*** But as you try to build a module library, libtool will still create "
5834 $ECHO "*** a static module, that should work as long as the dlopening application"
5835 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
5836 if test -z "$global_symbol_pipe"; then
5837 $ECHO
5838 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5839 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5840 $ECHO "*** not find such a program. So, this module is probably useless."
5841 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5842 fi
5843 if test "$build_old_libs" = no; then
5844 build_libtool_libs=module
5845 build_old_libs=yes
5846 else
5847 build_libtool_libs=no
5848 fi
5849 fi
5850 else
5851 deplibs="$dir/$old_library $deplibs"
5852 link_static=yes
5853 fi
5854 fi # link shared/static library?
5855
5856 if test "$linkmode" = lib; then
5857 if test -n "$dependency_libs" &&
5858 { test "$hardcode_into_libs" != yes ||
5859 test "$build_old_libs" = yes ||
5860 test "$link_static" = yes; }; then
5861 # Extract -R from dependency_libs
5862 temp_deplibs=
5863 for libdir in $dependency_libs; do
5864 case $libdir in
5865 -R*) func_stripname '-R' '' "$libdir"
5866 temp_xrpath=$func_stripname_result
5867 case " $xrpath " in
5868 *" $temp_xrpath "*) ;;
5869 *) xrpath="$xrpath $temp_xrpath";;
5870 esac;;
5871 *) temp_deplibs="$temp_deplibs $libdir";;
5872 esac
5873 done
5874 dependency_libs="$temp_deplibs"
5875 fi
5876
5877 newlib_search_path="$newlib_search_path $absdir"
5878 # Link against this library
5879 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5880 # ... and its dependency_libs
5881 tmp_libs=
5882 for deplib in $dependency_libs; do
5883 newdependency_libs="$deplib $newdependency_libs"
5884 if $opt_duplicate_deps ; then
5885 case "$tmp_libs " in
5886 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5887 esac
5888 fi
5889 tmp_libs="$tmp_libs $deplib"
5890 done
5891
5892 if test "$link_all_deplibs" != no; then
5893 # Add the search paths of all dependency libraries
5894 for deplib in $dependency_libs; do
5895 case $deplib in
5896 -L*) path="$deplib" ;;
5897 *.la)
5898 func_dirname "$deplib" "" "."
5899 dir="$func_dirname_result"
5900 # We need an absolute path.
5901 case $dir in
5902 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
5903 *)
5904 absdir=`cd "$dir" && pwd`
5905 if test -z "$absdir"; then
5906 func_warning "cannot determine absolute directory name of \`$dir'"
5907 absdir="$dir"
5908 fi
5909 ;;
5910 esac
5911 if $GREP "^installed=no" $deplib > /dev/null; then
5912 case $host in
5913 *-*-darwin*)
5914 depdepl=
5915 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5916 if test -n "$deplibrary_names" ; then
5917 for tmp in $deplibrary_names ; do
5918 depdepl=$tmp
5919 done
5920 if test -f "$absdir/$objdir/$depdepl" ; then
5921 depdepl="$absdir/$objdir/$depdepl"
5922 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5923 if test -z "$darwin_install_name"; then
5924 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5925 fi
5926 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5927 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5928 path=
5929 fi
5930 fi
5931 ;;
5932 *)
5933 path="-L$absdir/$objdir"
5934 ;;
5935 esac
5936 else
5937 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5938 test -z "$libdir" && \
5939 func_fatal_error "\`$deplib' is not a valid libtool archive"
5940 test "$absdir" != "$libdir" && \
5941 func_warning "\`$deplib' seems to be moved"
5942
5943 path="-L$absdir"
5944 fi
5945 ;;
5946 esac
5947 case " $deplibs " in
5948 *" $path "*) ;;
5949 *) deplibs="$path $deplibs" ;;
5950 esac
5951 done
5952 fi # link_all_deplibs != no
5953 fi # linkmode = lib
5954 done # for deplib in $libs
5955 if test "$pass" = link; then
5956 if test "$linkmode" = "prog"; then
5957 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5958 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5959 else
5960 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5961 fi
5962 fi
5963 dependency_libs="$newdependency_libs"
5964 if test "$pass" = dlpreopen; then
5965 # Link the dlpreopened libraries before other libraries
5966 for deplib in $save_deplibs; do
5967 deplibs="$deplib $deplibs"
5968 done
5969 fi
5970 if test "$pass" != dlopen; then
5971 if test "$pass" != conv; then
5972 # Make sure lib_search_path contains only unique directories.
5973 lib_search_path=
5974 for dir in $newlib_search_path; do
5975 case "$lib_search_path " in
5976 *" $dir "*) ;;
5977 *) lib_search_path="$lib_search_path $dir" ;;
5978 esac
5979 done
5980 newlib_search_path=
5981 fi
5982
5983 if test "$linkmode,$pass" != "prog,link"; then
5984 vars="deplibs"
5985 else
5986 vars="compile_deplibs finalize_deplibs"
5987 fi
5988 for var in $vars dependency_libs; do
5989 # Add libraries to $var in reverse order
5990 eval tmp_libs=\"\$$var\"
5991 new_libs=
5992 for deplib in $tmp_libs; do
5993 # FIXME: Pedantically, this is the right thing to do, so
5994 # that some nasty dependency loop isn't accidentally
5995 # broken:
5996 #new_libs="$deplib $new_libs"
5997 # Pragmatically, this seems to cause very few problems in
5998 # practice:
5999 case $deplib in
6000 -L*) new_libs="$deplib $new_libs" ;;
6001 -R*) ;;
6002 *)
6003 # And here is the reason: when a library appears more
6004 # than once as an explicit dependence of a library, or
6005 # is implicitly linked in more than once by the
6006 # compiler, it is considered special, and multiple
6007 # occurrences thereof are not removed. Compare this
6008 # with having the same library being listed as a
6009 # dependency of multiple other libraries: in this case,
6010 # we know (pedantically, we assume) the library does not
6011 # need to be listed more than once, so we keep only the
6012 # last copy. This is not always right, but it is rare
6013 # enough that we require users that really mean to play
6014 # such unportable linking tricks to link the library
6015 # using -Wl,-lname, so that libtool does not consider it
6016 # for duplicate removal.
6017 case " $specialdeplibs " in
6018 *" $deplib "*) new_libs="$deplib $new_libs" ;;
6019 *)
6020 case " $new_libs " in
6021 *" $deplib "*) ;;
6022 *) new_libs="$deplib $new_libs" ;;
6023 esac
6024 ;;
6025 esac
6026 ;;
6027 esac
6028 done
6029 tmp_libs=
6030 for deplib in $new_libs; do
6031 case $deplib in
6032 -L*)
6033 case " $tmp_libs " in
6034 *" $deplib "*) ;;
6035 *) tmp_libs="$tmp_libs $deplib" ;;
6036 esac
6037 ;;
6038 *) tmp_libs="$tmp_libs $deplib" ;;
6039 esac
6040 done
6041 eval $var=\"$tmp_libs\"
6042 done # for var
6043 fi
6044 # Last step: remove runtime libs from dependency_libs
6045 # (they stay in deplibs)
6046 tmp_libs=
6047 for i in $dependency_libs ; do
6048 case " $predeps $postdeps $compiler_lib_search_path " in
6049 *" $i "*)
6050 i=""
6051 ;;
6052 esac
6053 if test -n "$i" ; then
6054 tmp_libs="$tmp_libs $i"
6055 fi
6056 done
6057 dependency_libs=$tmp_libs
6058 done # for pass
6059 if test "$linkmode" = prog; then
6060 dlfiles="$newdlfiles"
6061 fi
6062 if test "$linkmode" = prog || test "$linkmode" = lib; then
6063 dlprefiles="$newdlprefiles"
6064 fi
6065
6066 case $linkmode in
6067 oldlib)
6068 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6069 func_warning "\`-dlopen' is ignored for archives"
6070 fi
6071
6072 case " $deplibs" in
6073 *\ -l* | *\ -L*)
6074 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6075 esac
6076
6077 test -n "$rpath" && \
6078 func_warning "\`-rpath' is ignored for archives"
6079
6080 test -n "$xrpath" && \
6081 func_warning "\`-R' is ignored for archives"
6082
6083 test -n "$vinfo" && \
6084 func_warning "\`-version-info/-version-number' is ignored for archives"
6085
6086 test -n "$release" && \
6087 func_warning "\`-release' is ignored for archives"
6088
6089 test -n "$export_symbols$export_symbols_regex" && \
6090 func_warning "\`-export-symbols' is ignored for archives"
6091
6092 # Now set the variables for building old libraries.
6093 build_libtool_libs=no
6094 oldlibs="$output"
6095 objs="$objs$old_deplibs"
6096 ;;
6097
6098 lib)
6099 # Make sure we only generate libraries of the form `libNAME.la'.
6100 case $outputname in
6101 lib*)
6102 func_stripname 'lib' '.la' "$outputname"
6103 name=$func_stripname_result
6104 eval shared_ext=\"$shrext_cmds\"
6105 eval libname=\"$libname_spec\"
6106 ;;
6107 *)
6108 test "$module" = no && \
6109 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6110
6111 if test "$need_lib_prefix" != no; then
6112 # Add the "lib" prefix for modules if required
6113 func_stripname '' '.la' "$outputname"
6114 name=$func_stripname_result
6115 eval shared_ext=\"$shrext_cmds\"
6116 eval libname=\"$libname_spec\"
6117 else
6118 func_stripname '' '.la' "$outputname"
6119 libname=$func_stripname_result
6120 fi
6121 ;;
6122 esac
6123
6124 if test -n "$objs"; then
6125 if test "$deplibs_check_method" != pass_all; then
6126 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6127 else
6128 $ECHO
6129 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6130 $ECHO "*** objects $objs is not portable!"
6131 libobjs="$libobjs $objs"
6132 fi
6133 fi
6134
6135 test "$dlself" != no && \
6136 func_warning "\`-dlopen self' is ignored for libtool libraries"
6137
6138 set dummy $rpath
6139 shift
6140 test "$#" -gt 1 && \
6141 func_warning "ignoring multiple \`-rpath's for a libtool library"
6142
6143 install_libdir="$1"
6144
6145 oldlibs=
6146 if test -z "$rpath"; then
6147 if test "$build_libtool_libs" = yes; then
6148 # Building a libtool convenience library.
6149 # Some compilers have problems with a `.al' extension so
6150 # convenience libraries should have the same extension an
6151 # archive normally would.
6152 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6153 build_libtool_libs=convenience
6154 build_old_libs=yes
6155 fi
6156
6157 test -n "$vinfo" && \
6158 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6159
6160 test -n "$release" && \
6161 func_warning "\`-release' is ignored for convenience libraries"
6162 else
6163
6164 # Parse the version information argument.
6165 save_ifs="$IFS"; IFS=':'
6166 set dummy $vinfo 0 0 0
6167 shift
6168 IFS="$save_ifs"
6169
6170 test -n "$7" && \
6171 func_fatal_help "too many parameters to \`-version-info'"
6172
6173 # convert absolute version numbers to libtool ages
6174 # this retains compatibility with .la files and attempts
6175 # to make the code below a bit more comprehensible
6176
6177 case $vinfo_number in
6178 yes)
6179 number_major="$1"
6180 number_minor="$2"
6181 number_revision="$3"
6182 #
6183 # There are really only two kinds -- those that
6184 # use the current revision as the major version
6185 # and those that subtract age and use age as
6186 # a minor version. But, then there is irix
6187 # which has an extra 1 added just for fun
6188 #
6189 case $version_type in
6190 darwin|linux|osf|windows|none)
6191 func_arith $number_major + $number_minor
6192 current=$func_arith_result
6193 age="$number_minor"
6194 revision="$number_revision"
6195 ;;
6196 freebsd-aout|freebsd-elf|sunos)
6197 current="$number_major"
6198 revision="$number_minor"
6199 age="0"
6200 ;;
6201 irix|nonstopux)
6202 func_arith $number_major + $number_minor
6203 current=$func_arith_result
6204 age="$number_minor"
6205 revision="$number_minor"
6206 lt_irix_increment=no
6207 ;;
6208 esac
6209 ;;
6210 no)
6211 current="$1"
6212 revision="$2"
6213 age="$3"
6214 ;;
6215 esac
6216
6217 # Check that each of the things are valid numbers.
6218 case $current in
6219 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]) ;;
6220 *)
6221 func_error "CURRENT \`$current' must be a nonnegative integer"
6222 func_fatal_error "\`$vinfo' is not valid version information"
6223 ;;
6224 esac
6225
6226 case $revision in
6227 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]) ;;
6228 *)
6229 func_error "REVISION \`$revision' must be a nonnegative integer"
6230 func_fatal_error "\`$vinfo' is not valid version information"
6231 ;;
6232 esac
6233
6234 case $age in
6235 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]) ;;
6236 *)
6237 func_error "AGE \`$age' must be a nonnegative integer"
6238 func_fatal_error "\`$vinfo' is not valid version information"
6239 ;;
6240 esac
6241
6242 if test "$age" -gt "$current"; then
6243 func_error "AGE \`$age' is greater than the current interface number \`$current'"
6244 func_fatal_error "\`$vinfo' is not valid version information"
6245 fi
6246
6247 # Calculate the version variables.
6248 major=
6249 versuffix=
6250 verstring=
6251 case $version_type in
6252 none) ;;
6253
6254 darwin)
6255 # Like Linux, but with the current version available in
6256 # verstring for coding it into the library header
6257 func_arith $current - $age
6258 major=.$func_arith_result
6259 versuffix="$major.$age.$revision"
6260 # Darwin ld doesn't like 0 for these options...
6261 func_arith $current + 1
6262 minor_current=$func_arith_result
6263 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6264 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6265 ;;
6266
6267 freebsd-aout)
6268 major=".$current"
6269 versuffix=".$current.$revision";
6270 ;;
6271
6272 freebsd-elf)
6273 major=".$current"
6274 versuffix=".$current"
6275 ;;
6276
6277 irix | nonstopux)
6278 if test "X$lt_irix_increment" = "Xno"; then
6279 func_arith $current - $age
6280 else
6281 func_arith $current - $age + 1
6282 fi
6283 major=$func_arith_result
6284
6285 case $version_type in
6286 nonstopux) verstring_prefix=nonstopux ;;
6287 *) verstring_prefix=sgi ;;
6288 esac
6289 verstring="$verstring_prefix$major.$revision"
6290
6291 # Add in all the interfaces that we are compatible with.
6292 loop=$revision
6293 while test "$loop" -ne 0; do
6294 func_arith $revision - $loop
6295 iface=$func_arith_result
6296 func_arith $loop - 1
6297 loop=$func_arith_result
6298 verstring="$verstring_prefix$major.$iface:$verstring"
6299 done
6300
6301 # Before this point, $major must not contain `.'.
6302 major=.$major
6303 versuffix="$major.$revision"
6304 ;;
6305
6306 linux)
6307 func_arith $current - $age
6308 major=.$func_arith_result
6309 versuffix="$major.$age.$revision"
6310 ;;
6311
6312 osf)
6313 func_arith $current - $age
6314 major=.$func_arith_result
6315 versuffix=".$current.$age.$revision"
6316 verstring="$current.$age.$revision"
6317
6318 # Add in all the interfaces that we are compatible with.
6319 loop=$age
6320 while test "$loop" -ne 0; do
6321 func_arith $current - $loop
6322 iface=$func_arith_result
6323 func_arith $loop - 1
6324 loop=$func_arith_result
6325 verstring="$verstring:${iface}.0"
6326 done
6327
6328 # Make executables depend on our current version.
6329 verstring="$verstring:${current}.0"
6330 ;;
6331
6332 qnx)
6333 major=".$current"
6334 versuffix=".$current"
6335 ;;
6336
6337 sunos)
6338 major=".$current"
6339 versuffix=".$current.$revision"
6340 ;;
6341
6342 windows)
6343 # Use '-' rather than '.', since we only want one
6344 # extension on DOS 8.3 filesystems.
6345 func_arith $current - $age
6346 major=$func_arith_result
6347 versuffix="-$major"
6348 ;;
6349
6350 *)
6351 func_fatal_configuration "unknown library version type \`$version_type'"
6352 ;;
6353 esac
6354
6355 # Clear the version info if we defaulted, and they specified a release.
6356 if test -z "$vinfo" && test -n "$release"; then
6357 major=
6358 case $version_type in
6359 darwin)
6360 # we can't check for "0.0" in archive_cmds due to quoting
6361 # problems, so we reset it completely
6362 verstring=
6363 ;;
6364 *)
6365 verstring="0.0"
6366 ;;
6367 esac
6368 if test "$need_version" = no; then
6369 versuffix=
6370 else
6371 versuffix=".0.0"
6372 fi
6373 fi
6374
6375 # Remove version info from name if versioning should be avoided
6376 if test "$avoid_version" = yes && test "$need_version" = no; then
6377 major=
6378 versuffix=
6379 verstring=""
6380 fi
6381
6382 # Check to see if the archive will have undefined symbols.
6383 if test "$allow_undefined" = yes; then
6384 if test "$allow_undefined_flag" = unsupported; then
6385 func_warning "undefined symbols not allowed in $host shared libraries"
6386 build_libtool_libs=no
6387 build_old_libs=yes
6388 fi
6389 else
6390 # Don't allow undefined symbols.
6391 allow_undefined_flag="$no_undefined_flag"
6392 fi
6393
6394 fi
6395
6396 func_generate_dlsyms "$libname" "$libname" "yes"
6397 libobjs="$libobjs $symfileobj"
6398 test "X$libobjs" = "X " && libobjs=
6399
6400 if test "$mode" != relink; then
6401 # Remove our outputs, but don't remove object files since they
6402 # may have been created when compiling PIC objects.
6403 removelist=
6404 tempremovelist=`$ECHO "$output_objdir/*"`
6405 for p in $tempremovelist; do
6406 case $p in
6407 *.$objext | *.gcno)
6408 ;;
6409 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6410 if test "X$precious_files_regex" != "X"; then
6411 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6412 then
6413 continue
6414 fi
6415 fi
6416 removelist="$removelist $p"
6417 ;;
6418 *) ;;
6419 esac
6420 done
6421 test -n "$removelist" && \
6422 func_show_eval "${RM}r \$removelist"
6423 fi
6424
6425 # Now set the variables for building old libraries.
6426 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6427 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6428
6429 # Transform .lo files to .o files.
6430 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
6431 fi
6432
6433 # Eliminate all temporary directories.
6434 #for path in $notinst_path; do
6435 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6436 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6437 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
6438 #done
6439
6440 if test -n "$xrpath"; then
6441 # If the user specified any rpath flags, then add them.
6442 temp_xrpath=
6443 for libdir in $xrpath; do
6444 temp_xrpath="$temp_xrpath -R$libdir"
6445 case "$finalize_rpath " in
6446 *" $libdir "*) ;;
6447 *) finalize_rpath="$finalize_rpath $libdir" ;;
6448 esac
6449 done
6450 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6451 dependency_libs="$temp_xrpath $dependency_libs"
6452 fi
6453 fi
6454
6455 # Make sure dlfiles contains only unique files that won't be dlpreopened
6456 old_dlfiles="$dlfiles"
6457 dlfiles=
6458 for lib in $old_dlfiles; do
6459 case " $dlprefiles $dlfiles " in
6460 *" $lib "*) ;;
6461 *) dlfiles="$dlfiles $lib" ;;
6462 esac
6463 done
6464
6465 # Make sure dlprefiles contains only unique files
6466 old_dlprefiles="$dlprefiles"
6467 dlprefiles=
6468 for lib in $old_dlprefiles; do
6469 case "$dlprefiles " in
6470 *" $lib "*) ;;
6471 *) dlprefiles="$dlprefiles $lib" ;;
6472 esac
6473 done
6474
6475 if test "$build_libtool_libs" = yes; then
6476 if test -n "$rpath"; then
6477 case $host in
6478 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
6479 # these systems don't actually have a c library (as such)!
6480 ;;
6481 *-*-rhapsody* | *-*-darwin1.[012])
6482 # Rhapsody C library is in the System framework
6483 deplibs="$deplibs System.ltframework"
6484 ;;
6485 *-*-netbsd*)
6486 # Don't link with libc until the a.out ld.so is fixed.
6487 ;;
6488 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6489 # Do not include libc due to us having libc/libc_r.
6490 ;;
6491 *-*-sco3.2v5* | *-*-sco5v6*)
6492 # Causes problems with __ctype
6493 ;;
6494 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6495 # Compiler inserts libc in the correct place for threads to work
6496 ;;
6497 *)
6498 # Add libc to deplibs on all other systems if necessary.
6499 if test "$build_libtool_need_lc" = "yes"; then
6500 deplibs="$deplibs -lc"
6501 fi
6502 ;;
6503 esac
6504 fi
6505
6506 # Transform deplibs into only deplibs that can be linked in shared.
6507 name_save=$name
6508 libname_save=$libname
6509 release_save=$release
6510 versuffix_save=$versuffix
6511 major_save=$major
6512 # I'm not sure if I'm treating the release correctly. I think
6513 # release should show up in the -l (ie -lgmp5) so we don't want to
6514 # add it in twice. Is that correct?
6515 release=""
6516 versuffix=""
6517 major=""
6518 newdeplibs=
6519 droppeddeps=no
6520 case $deplibs_check_method in
6521 pass_all)
6522 # Don't check for shared/static. Everything works.
6523 # This might be a little naive. We might want to check
6524 # whether the library exists or not. But this is on
6525 # osf3 & osf4 and I'm not really sure... Just
6526 # implementing what was already the behavior.
6527 newdeplibs=$deplibs
6528 ;;
6529 test_compile)
6530 # This code stresses the "libraries are programs" paradigm to its
6531 # limits. Maybe even breaks it. We compile a program, linking it
6532 # against the deplibs as a proxy for the library. Then we can check
6533 # whether they linked in statically or dynamically with ldd.
6534 $opt_dry_run || $RM conftest.c
6535 cat > conftest.c <<EOF
6536 int main() { return 0; }
6537 EOF
6538 $opt_dry_run || $RM conftest
6539 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6540 ldd_output=`ldd conftest`
6541 for i in $deplibs; do
6542 case $i in
6543 -l*)
6544 func_stripname -l '' "$i"
6545 name=$func_stripname_result
6546 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6547 case " $predeps $postdeps " in
6548 *" $i "*)
6549 newdeplibs="$newdeplibs $i"
6550 i=""
6551 ;;
6552 esac
6553 fi
6554 if test -n "$i" ; then
6555 libname=`eval "\\$ECHO \"$libname_spec\""`
6556 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6557 set dummy $deplib_matches; shift
6558 deplib_match=$1
6559 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6560 newdeplibs="$newdeplibs $i"
6561 else
6562 droppeddeps=yes
6563 $ECHO
6564 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6565 $ECHO "*** I have the capability to make that library automatically link in when"
6566 $ECHO "*** you link to this library. But I can only do this if you have a"
6567 $ECHO "*** shared version of the library, which I believe you do not have"
6568 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6569 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6570 fi
6571 fi
6572 ;;
6573 *)
6574 newdeplibs="$newdeplibs $i"
6575 ;;
6576 esac
6577 done
6578 else
6579 # Error occurred in the first compile. Let's try to salvage
6580 # the situation: Compile a separate program for each library.
6581 for i in $deplibs; do
6582 case $i in
6583 -l*)
6584 func_stripname -l '' "$i"
6585 name=$func_stripname_result
6586 $opt_dry_run || $RM conftest
6587 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6588 ldd_output=`ldd conftest`
6589 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6590 case " $predeps $postdeps " in
6591 *" $i "*)
6592 newdeplibs="$newdeplibs $i"
6593 i=""
6594 ;;
6595 esac
6596 fi
6597 if test -n "$i" ; then
6598 libname=`eval "\\$ECHO \"$libname_spec\""`
6599 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6600 set dummy $deplib_matches; shift
6601 deplib_match=$1
6602 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6603 newdeplibs="$newdeplibs $i"
6604 else
6605 droppeddeps=yes
6606 $ECHO
6607 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6608 $ECHO "*** I have the capability to make that library automatically link in when"
6609 $ECHO "*** you link to this library. But I can only do this if you have a"
6610 $ECHO "*** shared version of the library, which you do not appear to have"
6611 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6612 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6613 fi
6614 fi
6615 else
6616 droppeddeps=yes
6617 $ECHO
6618 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6619 $ECHO "*** make it link in! You will probably need to install it or some"
6620 $ECHO "*** library that it depends on before this library will be fully"
6621 $ECHO "*** functional. Installing it before continuing would be even better."
6622 fi
6623 ;;
6624 *)
6625 newdeplibs="$newdeplibs $i"
6626 ;;
6627 esac
6628 done
6629 fi
6630 ;;
6631 file_magic*)
6632 set dummy $deplibs_check_method; shift
6633 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6634 for a_deplib in $deplibs; do
6635 case $a_deplib in
6636 -l*)
6637 func_stripname -l '' "$a_deplib"
6638 name=$func_stripname_result
6639 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6640 case " $predeps $postdeps " in
6641 *" $a_deplib "*)
6642 newdeplibs="$newdeplibs $a_deplib"
6643 a_deplib=""
6644 ;;
6645 esac
6646 fi
6647 if test -n "$a_deplib" ; then
6648 libname=`eval "\\$ECHO \"$libname_spec\""`
6649 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6650 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6651 for potent_lib in $potential_libs; do
6652 # Follow soft links.
6653 if ls -lLd "$potent_lib" 2>/dev/null |
6654 $GREP " -> " >/dev/null; then
6655 continue
6656 fi
6657 # The statement above tries to avoid entering an
6658 # endless loop below, in case of cyclic links.
6659 # We might still enter an endless loop, since a link
6660 # loop can be closed while we follow links,
6661 # but so what?
6662 potlib="$potent_lib"
6663 while test -h "$potlib" 2>/dev/null; do
6664 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6665 case $potliblink in
6666 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6667 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
6668 esac
6669 done
6670 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6671 $SED -e 10q |
6672 $EGREP "$file_magic_regex" > /dev/null; then
6673 newdeplibs="$newdeplibs $a_deplib"
6674 a_deplib=""
6675 break 2
6676 fi
6677 done
6678 done
6679 fi
6680 if test -n "$a_deplib" ; then
6681 droppeddeps=yes
6682 $ECHO
6683 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6684 $ECHO "*** I have the capability to make that library automatically link in when"
6685 $ECHO "*** you link to this library. But I can only do this if you have a"
6686 $ECHO "*** shared version of the library, which you do not appear to have"
6687 $ECHO "*** because I did check the linker path looking for a file starting"
6688 if test -z "$potlib" ; then
6689 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6690 else
6691 $ECHO "*** with $libname and none of the candidates passed a file format test"
6692 $ECHO "*** using a file magic. Last file checked: $potlib"
6693 fi
6694 fi
6695 ;;
6696 *)
6697 # Add a -L argument.
6698 newdeplibs="$newdeplibs $a_deplib"
6699 ;;
6700 esac
6701 done # Gone through all deplibs.
6702 ;;
6703 match_pattern*)
6704 set dummy $deplibs_check_method; shift
6705 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6706 for a_deplib in $deplibs; do
6707 case $a_deplib in
6708 -l*)
6709 func_stripname -l '' "$a_deplib"
6710 name=$func_stripname_result
6711 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6712 case " $predeps $postdeps " in
6713 *" $a_deplib "*)
6714 newdeplibs="$newdeplibs $a_deplib"
6715 a_deplib=""
6716 ;;
6717 esac
6718 fi
6719 if test -n "$a_deplib" ; then
6720 libname=`eval "\\$ECHO \"$libname_spec\""`
6721 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6722 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6723 for potent_lib in $potential_libs; do
6724 potlib="$potent_lib" # see symlink-check above in file_magic test
6725 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
6726 $EGREP "$match_pattern_regex" > /dev/null; then
6727 newdeplibs="$newdeplibs $a_deplib"
6728 a_deplib=""
6729 break 2
6730 fi
6731 done
6732 done
6733 fi
6734 if test -n "$a_deplib" ; then
6735 droppeddeps=yes
6736 $ECHO
6737 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6738 $ECHO "*** I have the capability to make that library automatically link in when"
6739 $ECHO "*** you link to this library. But I can only do this if you have a"
6740 $ECHO "*** shared version of the library, which you do not appear to have"
6741 $ECHO "*** because I did check the linker path looking for a file starting"
6742 if test -z "$potlib" ; then
6743 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6744 else
6745 $ECHO "*** with $libname and none of the candidates passed a file format test"
6746 $ECHO "*** using a regex pattern. Last file checked: $potlib"
6747 fi
6748 fi
6749 ;;
6750 *)
6751 # Add a -L argument.
6752 newdeplibs="$newdeplibs $a_deplib"
6753 ;;
6754 esac
6755 done # Gone through all deplibs.
6756 ;;
6757 none | unknown | *)
6758 newdeplibs=""
6759 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6760 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
6761 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6762 for i in $predeps $postdeps ; do
6763 # can't use Xsed below, because $i might contain '/'
6764 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
6765 done
6766 fi
6767 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
6768 $GREP . >/dev/null; then
6769 $ECHO
6770 if test "X$deplibs_check_method" = "Xnone"; then
6771 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
6772 else
6773 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
6774 fi
6775 $ECHO "*** All declared inter-library dependencies are being dropped."
6776 droppeddeps=yes
6777 fi
6778 ;;
6779 esac
6780 versuffix=$versuffix_save
6781 major=$major_save
6782 release=$release_save
6783 libname=$libname_save
6784 name=$name_save
6785
6786 case $host in
6787 *-*-rhapsody* | *-*-darwin1.[012])
6788 # On Rhapsody replace the C library with the System framework
6789 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6790 ;;
6791 esac
6792
6793 if test "$droppeddeps" = yes; then
6794 if test "$module" = yes; then
6795 $ECHO
6796 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
6797 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6798 $ECHO "*** a static module, that should work as long as the dlopening"
6799 $ECHO "*** application is linked with the -dlopen flag."
6800 if test -z "$global_symbol_pipe"; then
6801 $ECHO
6802 $ECHO "*** However, this would only work if libtool was able to extract symbol"
6803 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6804 $ECHO "*** not find such a program. So, this module is probably useless."
6805 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6806 fi
6807 if test "$build_old_libs" = no; then
6808 oldlibs="$output_objdir/$libname.$libext"
6809 build_libtool_libs=module
6810 build_old_libs=yes
6811 else
6812 build_libtool_libs=no
6813 fi
6814 else
6815 $ECHO "*** The inter-library dependencies that have been dropped here will be"
6816 $ECHO "*** automatically added whenever a program is linked with this library"
6817 $ECHO "*** or is declared to -dlopen it."
6818
6819 if test "$allow_undefined" = no; then
6820 $ECHO
6821 $ECHO "*** Since this library must not contain undefined symbols,"
6822 $ECHO "*** because either the platform does not support them or"
6823 $ECHO "*** it was explicitly requested with -no-undefined,"
6824 $ECHO "*** libtool will only create a static version of it."
6825 if test "$build_old_libs" = no; then
6826 oldlibs="$output_objdir/$libname.$libext"
6827 build_libtool_libs=module
6828 build_old_libs=yes
6829 else
6830 build_libtool_libs=no
6831 fi
6832 fi
6833 fi
6834 fi
6835 # Done checking deplibs!
6836 deplibs=$newdeplibs
6837 fi
6838 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6839 case $host in
6840 *-*-darwin*)
6841 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6842 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6843 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6844 ;;
6845 esac
6846
6847 # move library search paths that coincide with paths to not yet
6848 # installed libraries to the beginning of the library search list
6849 new_libs=
6850 for path in $notinst_path; do
6851 case " $new_libs " in
6852 *" -L$path/$objdir "*) ;;
6853 *)
6854 case " $deplibs " in
6855 *" -L$path/$objdir "*)
6856 new_libs="$new_libs -L$path/$objdir" ;;
6857 esac
6858 ;;
6859 esac
6860 done
6861 for deplib in $deplibs; do
6862 case $deplib in
6863 -L*)
6864 case " $new_libs " in
6865 *" $deplib "*) ;;
6866 *) new_libs="$new_libs $deplib" ;;
6867 esac
6868 ;;
6869 *) new_libs="$new_libs $deplib" ;;
6870 esac
6871 done
6872 deplibs="$new_libs"
6873
6874 # All the library-specific variables (install_libdir is set above).
6875 library_names=
6876 old_library=
6877 dlname=
6878
6879 # Test again, we may have decided not to build it any more
6880 if test "$build_libtool_libs" = yes; then
6881 if test "$hardcode_into_libs" = yes; then
6882 # Hardcode the library paths
6883 hardcode_libdirs=
6884 dep_rpath=
6885 rpath="$finalize_rpath"
6886 test "$mode" != relink && rpath="$compile_rpath$rpath"
6887 for libdir in $rpath; do
6888 if test -n "$hardcode_libdir_flag_spec"; then
6889 if test -n "$hardcode_libdir_separator"; then
6890 if test -z "$hardcode_libdirs"; then
6891 hardcode_libdirs="$libdir"
6892 else
6893 # Just accumulate the unique libdirs.
6894 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6895 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6896 ;;
6897 *)
6898 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6899 ;;
6900 esac
6901 fi
6902 else
6903 eval flag=\"$hardcode_libdir_flag_spec\"
6904 dep_rpath="$dep_rpath $flag"
6905 fi
6906 elif test -n "$runpath_var"; then
6907 case "$perm_rpath " in
6908 *" $libdir "*) ;;
6909 *) perm_rpath="$perm_rpath $libdir" ;;
6910 esac
6911 fi
6912 done
6913 # Substitute the hardcoded libdirs into the rpath.
6914 if test -n "$hardcode_libdir_separator" &&
6915 test -n "$hardcode_libdirs"; then
6916 libdir="$hardcode_libdirs"
6917 if test -n "$hardcode_libdir_flag_spec_ld"; then
6918 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
6919 else
6920 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
6921 fi
6922 fi
6923 if test -n "$runpath_var" && test -n "$perm_rpath"; then
6924 # We should set the runpath_var.
6925 rpath=
6926 for dir in $perm_rpath; do
6927 rpath="$rpath$dir:"
6928 done
6929 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6930 fi
6931 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6932 fi
6933
6934 shlibpath="$finalize_shlibpath"
6935 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6936 if test -n "$shlibpath"; then
6937 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6938 fi
6939
6940 # Get the real and link names of the library.
6941 eval shared_ext=\"$shrext_cmds\"
6942 eval library_names=\"$library_names_spec\"
6943 set dummy $library_names
6944 shift
6945 realname="$1"
6946 shift
6947
6948 if test -n "$soname_spec"; then
6949 eval soname=\"$soname_spec\"
6950 else
6951 soname="$realname"
6952 fi
6953 if test -z "$dlname"; then
6954 dlname=$soname
6955 fi
6956
6957 lib="$output_objdir/$realname"
6958 linknames=
6959 for link
6960 do
6961 linknames="$linknames $link"
6962 done
6963
6964 # Use standard objects if they are pic
6965 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6966 test "X$libobjs" = "X " && libobjs=
6967
6968 delfiles=
6969 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6970 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6971 export_symbols="$output_objdir/$libname.uexp"
6972 delfiles="$delfiles $export_symbols"
6973 fi
6974
6975 orig_export_symbols=
6976 case $host_os in
6977 cygwin* | mingw* | cegcc*)
6978 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6979 # exporting using user supplied symfile
6980 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6981 # and it's NOT already a .def file. Must figure out
6982 # which of the given symbols are data symbols and tag
6983 # them as such. So, trigger use of export_symbols_cmds.
6984 # export_symbols gets reassigned inside the "prepare
6985 # the list of exported symbols" if statement, so the
6986 # include_expsyms logic still works.
6987 orig_export_symbols="$export_symbols"
6988 export_symbols=
6989 always_export_symbols=yes
6990 fi
6991 fi
6992 ;;
6993 esac
6994
6995 # Prepare the list of exported symbols
6996 if test -z "$export_symbols"; then
6997 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
6998 func_verbose "generating symbol list for \`$libname.la'"
6999 export_symbols="$output_objdir/$libname.exp"
7000 $opt_dry_run || $RM $export_symbols
7001 cmds=$export_symbols_cmds
7002 save_ifs="$IFS"; IFS='~'
7003 for cmd in $cmds; do
7004 IFS="$save_ifs"
7005 eval cmd=\"$cmd\"
7006 func_len " $cmd"
7007 len=$func_len_result
7008 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7009 func_show_eval "$cmd" 'exit $?'
7010 skipped_export=false
7011 else
7012 # The command line is too long to execute in one step.
7013 func_verbose "using reloadable object file for export list..."
7014 skipped_export=:
7015 # Break out early, otherwise skipped_export may be
7016 # set to false by a later but shorter cmd.
7017 break
7018 fi
7019 done
7020 IFS="$save_ifs"
7021 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
7022 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7023 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7024 fi
7025 fi
7026 fi
7027
7028 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7029 tmp_export_symbols="$export_symbols"
7030 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7031 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7032 fi
7033
7034 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7035 # The given exports_symbols file has to be filtered, so filter it.
7036 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7037 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7038 # 's' commands which not all seds can handle. GNU sed should be fine
7039 # though. Also, the filter scales superlinearly with the number of
7040 # global variables. join(1) would be nice here, but unfortunately
7041 # isn't a blessed tool.
7042 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7043 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7044 export_symbols=$output_objdir/$libname.def
7045 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7046 fi
7047
7048 tmp_deplibs=
7049 for test_deplib in $deplibs; do
7050 case " $convenience " in
7051 *" $test_deplib "*) ;;
7052 *)
7053 tmp_deplibs="$tmp_deplibs $test_deplib"
7054 ;;
7055 esac
7056 done
7057 deplibs="$tmp_deplibs"
7058
7059 if test -n "$convenience"; then
7060 if test -n "$whole_archive_flag_spec" &&
7061 test "$compiler_needs_object" = yes &&
7062 test -z "$libobjs"; then
7063 # extract the archives, so we have objects to list.
7064 # TODO: could optimize this to just extract one archive.
7065 whole_archive_flag_spec=
7066 fi
7067 if test -n "$whole_archive_flag_spec"; then
7068 save_libobjs=$libobjs
7069 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7070 test "X$libobjs" = "X " && libobjs=
7071 else
7072 gentop="$output_objdir/${outputname}x"
7073 generated="$generated $gentop"
7074
7075 func_extract_archives $gentop $convenience
7076 libobjs="$libobjs $func_extract_archives_result"
7077 test "X$libobjs" = "X " && libobjs=
7078 fi
7079 fi
7080
7081 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7082 eval flag=\"$thread_safe_flag_spec\"
7083 linker_flags="$linker_flags $flag"
7084 fi
7085
7086 # Make a backup of the uninstalled library when relinking
7087 if test "$mode" = relink; then
7088 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7089 fi
7090
7091 # Do each of the archive commands.
7092 if test "$module" = yes && test -n "$module_cmds" ; then
7093 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7094 eval test_cmds=\"$module_expsym_cmds\"
7095 cmds=$module_expsym_cmds
7096 else
7097 eval test_cmds=\"$module_cmds\"
7098 cmds=$module_cmds
7099 fi
7100 else
7101 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7102 eval test_cmds=\"$archive_expsym_cmds\"
7103 cmds=$archive_expsym_cmds
7104 else
7105 eval test_cmds=\"$archive_cmds\"
7106 cmds=$archive_cmds
7107 fi
7108 fi
7109
7110 if test "X$skipped_export" != "X:" &&
7111 func_len " $test_cmds" &&
7112 len=$func_len_result &&
7113 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7114 :
7115 else
7116 # The command line is too long to link in one step, link piecewise
7117 # or, if using GNU ld and skipped_export is not :, use a linker
7118 # script.
7119
7120 # Save the value of $output and $libobjs because we want to
7121 # use them later. If we have whole_archive_flag_spec, we
7122 # want to use save_libobjs as it was before
7123 # whole_archive_flag_spec was expanded, because we can't
7124 # assume the linker understands whole_archive_flag_spec.
7125 # This may have to be revisited, in case too many
7126 # convenience libraries get linked in and end up exceeding
7127 # the spec.
7128 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7129 save_libobjs=$libobjs
7130 fi
7131 save_output=$output
7132 output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
7133
7134 # Clear the reloadable object creation command queue and
7135 # initialize k to one.
7136 test_cmds=
7137 concat_cmds=
7138 objlist=
7139 last_robj=
7140 k=1
7141
7142 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7143 output=${output_objdir}/${output_la}.lnkscript
7144 func_verbose "creating GNU ld script: $output"
7145 $ECHO 'INPUT (' > $output
7146 for obj in $save_libobjs
7147 do
7148 $ECHO "$obj" >> $output
7149 done
7150 $ECHO ')' >> $output
7151 delfiles="$delfiles $output"
7152 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7153 output=${output_objdir}/${output_la}.lnk
7154 func_verbose "creating linker input file list: $output"
7155 : > $output
7156 set x $save_libobjs
7157 shift
7158 firstobj=
7159 if test "$compiler_needs_object" = yes; then
7160 firstobj="$1 "
7161 shift
7162 fi
7163 for obj
7164 do
7165 $ECHO "$obj" >> $output
7166 done
7167 delfiles="$delfiles $output"
7168 output=$firstobj\"$file_list_spec$output\"
7169 else
7170 if test -n "$save_libobjs"; then
7171 func_verbose "creating reloadable object files..."
7172 output=$output_objdir/$output_la-${k}.$objext
7173 eval test_cmds=\"$reload_cmds\"
7174 func_len " $test_cmds"
7175 len0=$func_len_result
7176 len=$len0
7177
7178 # Loop over the list of objects to be linked.
7179 for obj in $save_libobjs
7180 do
7181 func_len " $obj"
7182 func_arith $len + $func_len_result
7183 len=$func_arith_result
7184 if test "X$objlist" = X ||
7185 test "$len" -lt "$max_cmd_len"; then
7186 func_append objlist " $obj"
7187 else
7188 # The command $test_cmds is almost too long, add a
7189 # command to the queue.
7190 if test "$k" -eq 1 ; then
7191 # The first file doesn't have a previous command to add.
7192 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7193 else
7194 # All subsequent reloadable object files will link in
7195 # the last one created.
7196 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7197 fi
7198 last_robj=$output_objdir/$output_la-${k}.$objext
7199 func_arith $k + 1
7200 k=$func_arith_result
7201 output=$output_objdir/$output_la-${k}.$objext
7202 objlist=$obj
7203 func_len " $last_robj"
7204 func_arith $len0 + $func_len_result
7205 len=$func_arith_result
7206 fi
7207 done
7208 # Handle the remaining objects by creating one last
7209 # reloadable object file. All subsequent reloadable object
7210 # files will link in the last one created.
7211 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7212 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7213 if test -n "$last_robj"; then
7214 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7215 fi
7216 delfiles="$delfiles $output"
7217
7218 else
7219 output=
7220 fi
7221
7222 if ${skipped_export-false}; then
7223 func_verbose "generating symbol list for \`$libname.la'"
7224 export_symbols="$output_objdir/$libname.exp"
7225 $opt_dry_run || $RM $export_symbols
7226 libobjs=$output
7227 # Append the command to create the export file.
7228 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7229 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7230 if test -n "$last_robj"; then
7231 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7232 fi
7233 fi
7234
7235 test -n "$save_libobjs" &&
7236 func_verbose "creating a temporary reloadable object file: $output"
7237
7238 # Loop through the commands generated above and execute them.
7239 save_ifs="$IFS"; IFS='~'
7240 for cmd in $concat_cmds; do
7241 IFS="$save_ifs"
7242 $opt_silent || {
7243 func_quote_for_expand "$cmd"
7244 eval "func_echo $func_quote_for_expand_result"
7245 }
7246 $opt_dry_run || eval "$cmd" || {
7247 lt_exit=$?
7248
7249 # Restore the uninstalled library and exit
7250 if test "$mode" = relink; then
7251 ( cd "$output_objdir" && \
7252 $RM "${realname}T" && \
7253 $MV "${realname}U" "$realname" )
7254 fi
7255
7256 exit $lt_exit
7257 }
7258 done
7259 IFS="$save_ifs"
7260
7261 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7262 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7263 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7264 fi
7265 fi
7266
7267 if ${skipped_export-false}; then
7268 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7269 tmp_export_symbols="$export_symbols"
7270 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7271 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7272 fi
7273
7274 if test -n "$orig_export_symbols"; then
7275 # The given exports_symbols file has to be filtered, so filter it.
7276 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7277 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7278 # 's' commands which not all seds can handle. GNU sed should be fine
7279 # though. Also, the filter scales superlinearly with the number of
7280 # global variables. join(1) would be nice here, but unfortunately
7281 # isn't a blessed tool.
7282 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7283 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7284 export_symbols=$output_objdir/$libname.def
7285 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7286 fi
7287 fi
7288
7289 libobjs=$output
7290 # Restore the value of output.
7291 output=$save_output
7292
7293 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7294 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7295 test "X$libobjs" = "X " && libobjs=
7296 fi
7297 # Expand the library linking commands again to reset the
7298 # value of $libobjs for piecewise linking.
7299
7300 # Do each of the archive commands.
7301 if test "$module" = yes && test -n "$module_cmds" ; then
7302 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7303 cmds=$module_expsym_cmds
7304 else
7305 cmds=$module_cmds
7306 fi
7307 else
7308 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7309 cmds=$archive_expsym_cmds
7310 else
7311 cmds=$archive_cmds
7312 fi
7313 fi
7314 fi
7315
7316 if test -n "$delfiles"; then
7317 # Append the command to remove temporary files to $cmds.
7318 eval cmds=\"\$cmds~\$RM $delfiles\"
7319 fi
7320
7321 # Add any objects from preloaded convenience libraries
7322 if test -n "$dlprefiles"; then
7323 gentop="$output_objdir/${outputname}x"
7324 generated="$generated $gentop"
7325
7326 func_extract_archives $gentop $dlprefiles
7327 libobjs="$libobjs $func_extract_archives_result"
7328 test "X$libobjs" = "X " && libobjs=
7329 fi
7330
7331 save_ifs="$IFS"; IFS='~'
7332 for cmd in $cmds; do
7333 IFS="$save_ifs"
7334 eval cmd=\"$cmd\"
7335 $opt_silent || {
7336 func_quote_for_expand "$cmd"
7337 eval "func_echo $func_quote_for_expand_result"
7338 }
7339 $opt_dry_run || eval "$cmd" || {
7340 lt_exit=$?
7341
7342 # Restore the uninstalled library and exit
7343 if test "$mode" = relink; then
7344 ( cd "$output_objdir" && \
7345 $RM "${realname}T" && \
7346 $MV "${realname}U" "$realname" )
7347 fi
7348
7349 exit $lt_exit
7350 }
7351 done
7352 IFS="$save_ifs"
7353
7354 # Restore the uninstalled library and exit
7355 if test "$mode" = relink; then
7356 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7357
7358 if test -n "$convenience"; then
7359 if test -z "$whole_archive_flag_spec"; then
7360 func_show_eval '${RM}r "$gentop"'
7361 fi
7362 fi
7363
7364 exit $EXIT_SUCCESS
7365 fi
7366
7367 # Create links to the real library.
7368 for linkname in $linknames; do
7369 if test "$realname" != "$linkname"; then
7370 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7371 fi
7372 done
7373
7374 # If -module or -export-dynamic was specified, set the dlname.
7375 if test "$module" = yes || test "$export_dynamic" = yes; then
7376 # On all known operating systems, these are identical.
7377 dlname="$soname"
7378 fi
7379 fi
7380 ;;
7381
7382 obj)
7383 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7384 func_warning "\`-dlopen' is ignored for objects"
7385 fi
7386
7387 case " $deplibs" in
7388 *\ -l* | *\ -L*)
7389 func_warning "\`-l' and \`-L' are ignored for objects" ;;
7390 esac
7391
7392 test -n "$rpath" && \
7393 func_warning "\`-rpath' is ignored for objects"
7394
7395 test -n "$xrpath" && \
7396 func_warning "\`-R' is ignored for objects"
7397
7398 test -n "$vinfo" && \
7399 func_warning "\`-version-info' is ignored for objects"
7400
7401 test -n "$release" && \
7402 func_warning "\`-release' is ignored for objects"
7403
7404 case $output in
7405 *.lo)
7406 test -n "$objs$old_deplibs" && \
7407 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
7408
7409 libobj=$output
7410 func_lo2o "$libobj"
7411 obj=$func_lo2o_result
7412 ;;
7413 *)
7414 libobj=
7415 obj="$output"
7416 ;;
7417 esac
7418
7419 # Delete the old objects.
7420 $opt_dry_run || $RM $obj $libobj
7421
7422 # Objects from convenience libraries. This assumes
7423 # single-version convenience libraries. Whenever we create
7424 # different ones for PIC/non-PIC, this we'll have to duplicate
7425 # the extraction.
7426 reload_conv_objs=
7427 gentop=
7428 # reload_cmds runs $LD directly, so let us get rid of
7429 # -Wl from whole_archive_flag_spec and hope we can get by with
7430 # turning comma into space..
7431 wl=
7432
7433 if test -n "$convenience"; then
7434 if test -n "$whole_archive_flag_spec"; then
7435 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7436 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
7437 else
7438 gentop="$output_objdir/${obj}x"
7439 generated="$generated $gentop"
7440
7441 func_extract_archives $gentop $convenience
7442 reload_conv_objs="$reload_objs $func_extract_archives_result"
7443 fi
7444 fi
7445
7446 # Create the old-style object.
7447 reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7448
7449 output="$obj"
7450 func_execute_cmds "$reload_cmds" 'exit $?'
7451
7452 # Exit if we aren't doing a library object file.
7453 if test -z "$libobj"; then
7454 if test -n "$gentop"; then
7455 func_show_eval '${RM}r "$gentop"'
7456 fi
7457
7458 exit $EXIT_SUCCESS
7459 fi
7460
7461 if test "$build_libtool_libs" != yes; then
7462 if test -n "$gentop"; then
7463 func_show_eval '${RM}r "$gentop"'
7464 fi
7465
7466 # Create an invalid libtool object if no PIC, so that we don't
7467 # accidentally link it into a program.
7468 # $show "echo timestamp > $libobj"
7469 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7470 exit $EXIT_SUCCESS
7471 fi
7472
7473 if test -n "$pic_flag" || test "$pic_mode" != default; then
7474 # Only do commands if we really have different PIC objects.
7475 reload_objs="$libobjs $reload_conv_objs"
7476 output="$libobj"
7477 func_execute_cmds "$reload_cmds" 'exit $?'
7478 fi
7479
7480 if test -n "$gentop"; then
7481 func_show_eval '${RM}r "$gentop"'
7482 fi
7483
7484 exit $EXIT_SUCCESS
7485 ;;
7486
7487 prog)
7488 case $host in
7489 *cygwin*) func_stripname '' '.exe' "$output"
7490 output=$func_stripname_result.exe;;
7491 esac
7492 test -n "$vinfo" && \
7493 func_warning "\`-version-info' is ignored for programs"
7494
7495 test -n "$release" && \
7496 func_warning "\`-release' is ignored for programs"
7497
7498 test "$preload" = yes \
7499 && test "$dlopen_support" = unknown \
7500 && test "$dlopen_self" = unknown \
7501 && test "$dlopen_self_static" = unknown && \
7502 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
7503
7504 case $host in
7505 *-*-rhapsody* | *-*-darwin1.[012])
7506 # On Rhapsody replace the C library is the System framework
7507 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7508 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7509 ;;
7510 esac
7511
7512 case $host in
7513 *-*-darwin*)
7514 # Don't allow lazy linking, it breaks C++ global constructors
7515 # But is supposedly fixed on 10.4 or later (yay!).
7516 if test "$tagname" = CXX ; then
7517 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7518 10.[0123])
7519 compile_command="$compile_command ${wl}-bind_at_load"
7520 finalize_command="$finalize_command ${wl}-bind_at_load"
7521 ;;
7522 esac
7523 fi
7524 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7525 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7526 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7527 ;;
7528 esac
7529
7530
7531 # move library search paths that coincide with paths to not yet
7532 # installed libraries to the beginning of the library search list
7533 new_libs=
7534 for path in $notinst_path; do
7535 case " $new_libs " in
7536 *" -L$path/$objdir "*) ;;
7537 *)
7538 case " $compile_deplibs " in
7539 *" -L$path/$objdir "*)
7540 new_libs="$new_libs -L$path/$objdir" ;;
7541 esac
7542 ;;
7543 esac
7544 done
7545 for deplib in $compile_deplibs; do
7546 case $deplib in
7547 -L*)
7548 case " $new_libs " in
7549 *" $deplib "*) ;;
7550 *) new_libs="$new_libs $deplib" ;;
7551 esac
7552 ;;
7553 *) new_libs="$new_libs $deplib" ;;
7554 esac
7555 done
7556 compile_deplibs="$new_libs"
7557
7558
7559 compile_command="$compile_command $compile_deplibs"
7560 finalize_command="$finalize_command $finalize_deplibs"
7561
7562 if test -n "$rpath$xrpath"; then
7563 # If the user specified any rpath flags, then add them.
7564 for libdir in $rpath $xrpath; do
7565 # This is the magic to use -rpath.
7566 case "$finalize_rpath " in
7567 *" $libdir "*) ;;
7568 *) finalize_rpath="$finalize_rpath $libdir" ;;
7569 esac
7570 done
7571 fi
7572
7573 # Now hardcode the library paths
7574 rpath=
7575 hardcode_libdirs=
7576 for libdir in $compile_rpath $finalize_rpath; do
7577 if test -n "$hardcode_libdir_flag_spec"; then
7578 if test -n "$hardcode_libdir_separator"; then
7579 if test -z "$hardcode_libdirs"; then
7580 hardcode_libdirs="$libdir"
7581 else
7582 # Just accumulate the unique libdirs.
7583 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7584 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7585 ;;
7586 *)
7587 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7588 ;;
7589 esac
7590 fi
7591 else
7592 eval flag=\"$hardcode_libdir_flag_spec\"
7593 rpath="$rpath $flag"
7594 fi
7595 elif test -n "$runpath_var"; then
7596 case "$perm_rpath " in
7597 *" $libdir "*) ;;
7598 *) perm_rpath="$perm_rpath $libdir" ;;
7599 esac
7600 fi
7601 case $host in
7602 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7603 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7604 case :$dllsearchpath: in
7605 *":$libdir:"*) ;;
7606 ::) dllsearchpath=$libdir;;
7607 *) dllsearchpath="$dllsearchpath:$libdir";;
7608 esac
7609 case :$dllsearchpath: in
7610 *":$testbindir:"*) ;;
7611 ::) dllsearchpath=$testbindir;;
7612 *) dllsearchpath="$dllsearchpath:$testbindir";;
7613 esac
7614 ;;
7615 esac
7616 done
7617 # Substitute the hardcoded libdirs into the rpath.
7618 if test -n "$hardcode_libdir_separator" &&
7619 test -n "$hardcode_libdirs"; then
7620 libdir="$hardcode_libdirs"
7621 eval rpath=\" $hardcode_libdir_flag_spec\"
7622 fi
7623 compile_rpath="$rpath"
7624
7625 rpath=
7626 hardcode_libdirs=
7627 for libdir in $finalize_rpath; do
7628 if test -n "$hardcode_libdir_flag_spec"; then
7629 if test -n "$hardcode_libdir_separator"; then
7630 if test -z "$hardcode_libdirs"; then
7631 hardcode_libdirs="$libdir"
7632 else
7633 # Just accumulate the unique libdirs.
7634 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7635 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7636 ;;
7637 *)
7638 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7639 ;;
7640 esac
7641 fi
7642 else
7643 eval flag=\"$hardcode_libdir_flag_spec\"
7644 rpath="$rpath $flag"
7645 fi
7646 elif test -n "$runpath_var"; then
7647 case "$finalize_perm_rpath " in
7648 *" $libdir "*) ;;
7649 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
7650 esac
7651 fi
7652 done
7653 # Substitute the hardcoded libdirs into the rpath.
7654 if test -n "$hardcode_libdir_separator" &&
7655 test -n "$hardcode_libdirs"; then
7656 libdir="$hardcode_libdirs"
7657 eval rpath=\" $hardcode_libdir_flag_spec\"
7658 fi
7659 finalize_rpath="$rpath"
7660
7661 if test -n "$libobjs" && test "$build_old_libs" = yes; then
7662 # Transform all the library objects into standard objects.
7663 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7664 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7665 fi
7666
7667 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7668
7669 # template prelinking step
7670 if test -n "$prelink_cmds"; then
7671 func_execute_cmds "$prelink_cmds" 'exit $?'
7672 fi
7673
7674 wrappers_required=yes
7675 case $host in
7676 *cygwin* | *mingw* )
7677 if test "$build_libtool_libs" != yes; then
7678 wrappers_required=no
7679 fi
7680 ;;
7681 *cegcc)
7682 # Disable wrappers for cegcc, we are cross compiling anyway.
7683 wrappers_required=no
7684 ;;
7685 *)
7686 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7687 wrappers_required=no
7688 fi
7689 ;;
7690 esac
7691 if test "$wrappers_required" = no; then
7692 # Replace the output file specification.
7693 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7694 link_command="$compile_command$compile_rpath"
7695
7696 # We have no uninstalled library dependencies, so finalize right now.
7697 exit_status=0
7698 func_show_eval "$link_command" 'exit_status=$?'
7699
7700 # Delete the generated files.
7701 if test -f "$output_objdir/${outputname}S.${objext}"; then
7702 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
7703 fi
7704
7705 exit $exit_status
7706 fi
7707
7708 if test -n "$compile_shlibpath$finalize_shlibpath"; then
7709 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
7710 fi
7711 if test -n "$finalize_shlibpath"; then
7712 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
7713 fi
7714
7715 compile_var=
7716 finalize_var=
7717 if test -n "$runpath_var"; then
7718 if test -n "$perm_rpath"; then
7719 # We should set the runpath_var.
7720 rpath=
7721 for dir in $perm_rpath; do
7722 rpath="$rpath$dir:"
7723 done
7724 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7725 fi
7726 if test -n "$finalize_perm_rpath"; then
7727 # We should set the runpath_var.
7728 rpath=
7729 for dir in $finalize_perm_rpath; do
7730 rpath="$rpath$dir:"
7731 done
7732 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7733 fi
7734 fi
7735
7736 if test "$no_install" = yes; then
7737 # We don't need to create a wrapper script.
7738 link_command="$compile_var$compile_command$compile_rpath"
7739 # Replace the output file specification.
7740 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7741 # Delete the old output file.
7742 $opt_dry_run || $RM $output
7743 # Link the executable and exit
7744 func_show_eval "$link_command" 'exit $?'
7745 exit $EXIT_SUCCESS
7746 fi
7747
7748 if test "$hardcode_action" = relink; then
7749 # Fast installation is not supported
7750 link_command="$compile_var$compile_command$compile_rpath"
7751 relink_command="$finalize_var$finalize_command$finalize_rpath"
7752
7753 func_warning "this platform does not like uninstalled shared libraries"
7754 func_warning "\`$output' will be relinked during installation"
7755 else
7756 if test "$fast_install" != no; then
7757 link_command="$finalize_var$compile_command$finalize_rpath"
7758 if test "$fast_install" = yes; then
7759 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
7760 else
7761 # fast_install is set to needless
7762 relink_command=
7763 fi
7764 else
7765 link_command="$compile_var$compile_command$compile_rpath"
7766 relink_command="$finalize_var$finalize_command$finalize_rpath"
7767 fi
7768 fi
7769
7770 # Replace the output file specification.
7771 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7772
7773 # Delete the old output files.
7774 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7775
7776 func_show_eval "$link_command" 'exit $?'
7777
7778 # Now create the wrapper script.
7779 func_verbose "creating $output"
7780
7781 # Quote the relink command for shipping.
7782 if test -n "$relink_command"; then
7783 # Preserve any variables that may affect compiler behavior
7784 for var in $variables_saved_for_relink; do
7785 if eval test -z \"\${$var+set}\"; then
7786 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7787 elif eval var_value=\$$var; test -z "$var_value"; then
7788 relink_command="$var=; export $var; $relink_command"
7789 else
7790 func_quote_for_eval "$var_value"
7791 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7792 fi
7793 done
7794 relink_command="(cd `pwd`; $relink_command)"
7795 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7796 fi
7797
7798 # Quote $ECHO for shipping.
7799 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7800 case $progpath in
7801 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7802 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7803 esac
7804 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7805 else
7806 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
7807 fi
7808
7809 # Only actually do things if not in dry run mode.
7810 $opt_dry_run || {
7811 # win32 will think the script is a binary if it has
7812 # a .exe suffix, so we strip it off here.
7813 case $output in
7814 *.exe) func_stripname '' '.exe' "$output"
7815 output=$func_stripname_result ;;
7816 esac
7817 # test for cygwin because mv fails w/o .exe extensions
7818 case $host in
7819 *cygwin*)
7820 exeext=.exe
7821 func_stripname '' '.exe' "$outputname"
7822 outputname=$func_stripname_result ;;
7823 *) exeext= ;;
7824 esac
7825 case $host in
7826 *cygwin* | *mingw* )
7827 func_dirname_and_basename "$output" "" "."
7828 output_name=$func_basename_result
7829 output_path=$func_dirname_result
7830 cwrappersource="$output_path/$objdir/lt-$output_name.c"
7831 cwrapper="$output_path/$output_name.exe"
7832 $RM $cwrappersource $cwrapper
7833 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7834
7835 func_emit_cwrapperexe_src > $cwrappersource
7836
7837 # The wrapper executable is built using the $host compiler,
7838 # because it contains $host paths and files. If cross-
7839 # compiling, it, like the target executable, must be
7840 # executed on the $host or under an emulation environment.
7841 $opt_dry_run || {
7842 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7843 $STRIP $cwrapper
7844 }
7845
7846 # Now, create the wrapper script for func_source use:
7847 func_ltwrapper_scriptname $cwrapper
7848 $RM $func_ltwrapper_scriptname_result
7849 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7850 $opt_dry_run || {
7851 # note: this script will not be executed, so do not chmod.
7852 if test "x$build" = "x$host" ; then
7853 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7854 else
7855 func_emit_wrapper no > $func_ltwrapper_scriptname_result
7856 fi
7857 }
7858 ;;
7859 * )
7860 $RM $output
7861 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
7862
7863 func_emit_wrapper no > $output
7864 chmod +x $output
7865 ;;
7866 esac
7867 }
7868 exit $EXIT_SUCCESS
7869 ;;
7870 esac
7871
7872 # See if we need to build an old-fashioned archive.
7873 for oldlib in $oldlibs; do
7874
7875 if test "$build_libtool_libs" = convenience; then
7876 oldobjs="$libobjs_save $symfileobj"
7877 addlibs="$convenience"
7878 build_libtool_libs=no
7879 else
7880 if test "$build_libtool_libs" = module; then
7881 oldobjs="$libobjs_save"
7882 build_libtool_libs=no
7883 else
7884 oldobjs="$old_deplibs $non_pic_objects"
7885 if test "$preload" = yes && test -f "$symfileobj"; then
7886 oldobjs="$oldobjs $symfileobj"
7887 fi
7888 fi
7889 addlibs="$old_convenience"
7890 fi
7891
7892 if test -n "$addlibs"; then
7893 gentop="$output_objdir/${outputname}x"
7894 generated="$generated $gentop"
7895
7896 func_extract_archives $gentop $addlibs
7897 oldobjs="$oldobjs $func_extract_archives_result"
7898 fi
7899
7900 # Do each command in the archive commands.
7901 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
7902 cmds=$old_archive_from_new_cmds
7903 else
7904
7905 # Add any objects from preloaded convenience libraries
7906 if test -n "$dlprefiles"; then
7907 gentop="$output_objdir/${outputname}x"
7908 generated="$generated $gentop"
7909
7910 func_extract_archives $gentop $dlprefiles
7911 oldobjs="$oldobjs $func_extract_archives_result"
7912 fi
7913
7914 # POSIX demands no paths to be encoded in archives. We have
7915 # to avoid creating archives with duplicate basenames if we
7916 # might have to extract them afterwards, e.g., when creating a
7917 # static archive out of a convenience library, or when linking
7918 # the entirety of a libtool archive into another (currently
7919 # not supported by libtool).
7920 if (for obj in $oldobjs
7921 do
7922 func_basename "$obj"
7923 $ECHO "$func_basename_result"
7924 done | sort | sort -uc >/dev/null 2>&1); then
7925 :
7926 else
7927 $ECHO "copying selected object files to avoid basename conflicts..."
7928 gentop="$output_objdir/${outputname}x"
7929 generated="$generated $gentop"
7930 func_mkdir_p "$gentop"
7931 save_oldobjs=$oldobjs
7932 oldobjs=
7933 counter=1
7934 for obj in $save_oldobjs
7935 do
7936 func_basename "$obj"
7937 objbase="$func_basename_result"
7938 case " $oldobjs " in
7939 " ") oldobjs=$obj ;;
7940 *[\ /]"$objbase "*)
7941 while :; do
7942 # Make sure we don't pick an alternate name that also
7943 # overlaps.
7944 newobj=lt$counter-$objbase
7945 func_arith $counter + 1
7946 counter=$func_arith_result
7947 case " $oldobjs " in
7948 *[\ /]"$newobj "*) ;;
7949 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
7950 esac
7951 done
7952 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7953 oldobjs="$oldobjs $gentop/$newobj"
7954 ;;
7955 *) oldobjs="$oldobjs $obj" ;;
7956 esac
7957 done
7958 fi
7959 eval cmds=\"$old_archive_cmds\"
7960
7961 func_len " $cmds"
7962 len=$func_len_result
7963 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7964 cmds=$old_archive_cmds
7965 else
7966 # the command line is too long to link in one step, link in parts
7967 func_verbose "using piecewise archive linking..."
7968 save_RANLIB=$RANLIB
7969 RANLIB=:
7970 objlist=
7971 concat_cmds=
7972 save_oldobjs=$oldobjs
7973 oldobjs=
7974 # Is there a better way of finding the last object in the list?
7975 for obj in $save_oldobjs
7976 do
7977 last_oldobj=$obj
7978 done
7979 eval test_cmds=\"$old_archive_cmds\"
7980 func_len " $test_cmds"
7981 len0=$func_len_result
7982 len=$len0
7983 for obj in $save_oldobjs
7984 do
7985 func_len " $obj"
7986 func_arith $len + $func_len_result
7987 len=$func_arith_result
7988 func_append objlist " $obj"
7989 if test "$len" -lt "$max_cmd_len"; then
7990 :
7991 else
7992 # the above command should be used before it gets too long
7993 oldobjs=$objlist
7994 if test "$obj" = "$last_oldobj" ; then
7995 RANLIB=$save_RANLIB
7996 fi
7997 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7998 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
7999 objlist=
8000 len=$len0
8001 fi
8002 done
8003 RANLIB=$save_RANLIB
8004 oldobjs=$objlist
8005 if test "X$oldobjs" = "X" ; then
8006 eval cmds=\"\$concat_cmds\"
8007 else
8008 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
8009 fi
8010 fi
8011 fi
8012 func_execute_cmds "$cmds" 'exit $?'
8013 done
8014
8015 test -n "$generated" && \
8016 func_show_eval "${RM}r$generated"
8017
8018 # Now create the libtool archive.
8019 case $output in
8020 *.la)
8021 old_library=
8022 test "$build_old_libs" = yes && old_library="$libname.$libext"
8023 func_verbose "creating $output"
8024
8025 # Preserve any variables that may affect compiler behavior
8026 for var in $variables_saved_for_relink; do
8027 if eval test -z \"\${$var+set}\"; then
8028 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8029 elif eval var_value=\$$var; test -z "$var_value"; then
8030 relink_command="$var=; export $var; $relink_command"
8031 else
8032 func_quote_for_eval "$var_value"
8033 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8034 fi
8035 done
8036 # Quote the link command for shipping.
8037 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8038 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8039 if test "$hardcode_automatic" = yes ; then
8040 relink_command=
8041 fi
8042
8043 # Only create the output if not a dry run.
8044 $opt_dry_run || {
8045 for installed in no yes; do
8046 if test "$installed" = yes; then
8047 if test -z "$install_libdir"; then
8048 break
8049 fi
8050 output="$output_objdir/$outputname"i
8051 # Replace all uninstalled libtool libraries with the installed ones
8052 newdependency_libs=
8053 for deplib in $dependency_libs; do
8054 case $deplib in
8055 *.la)
8056 func_basename "$deplib"
8057 name="$func_basename_result"
8058 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8059 test -z "$libdir" && \
8060 func_fatal_error "\`$deplib' is not a valid libtool archive"
8061 newdependency_libs="$newdependency_libs $libdir/$name"
8062 ;;
8063 *) newdependency_libs="$newdependency_libs $deplib" ;;
8064 esac
8065 done
8066 dependency_libs="$newdependency_libs"
8067 newdlfiles=
8068
8069 for lib in $dlfiles; do
8070 case $lib in
8071 *.la)
8072 func_basename "$lib"
8073 name="$func_basename_result"
8074 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8075 test -z "$libdir" && \
8076 func_fatal_error "\`$lib' is not a valid libtool archive"
8077 newdlfiles="$newdlfiles $libdir/$name"
8078 ;;
8079 *) newdlfiles="$newdlfiles $lib" ;;
8080 esac
8081 done
8082 dlfiles="$newdlfiles"
8083 newdlprefiles=
8084 for lib in $dlprefiles; do
8085 case $lib in
8086 *.la)
8087 # Only pass preopened files to the pseudo-archive (for
8088 # eventual linking with the app. that links it) if we
8089 # didn't already link the preopened objects directly into
8090 # the library:
8091 func_basename "$lib"
8092 name="$func_basename_result"
8093 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8094 test -z "$libdir" && \
8095 func_fatal_error "\`$lib' is not a valid libtool archive"
8096 newdlprefiles="$newdlprefiles $libdir/$name"
8097 ;;
8098 esac
8099 done
8100 dlprefiles="$newdlprefiles"
8101 else
8102 newdlfiles=
8103 for lib in $dlfiles; do
8104 case $lib in
8105 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8106 *) abs=`pwd`"/$lib" ;;
8107 esac
8108 newdlfiles="$newdlfiles $abs"
8109 done
8110 dlfiles="$newdlfiles"
8111 newdlprefiles=
8112 for lib in $dlprefiles; do
8113 case $lib in
8114 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8115 *) abs=`pwd`"/$lib" ;;
8116 esac
8117 newdlprefiles="$newdlprefiles $abs"
8118 done
8119 dlprefiles="$newdlprefiles"
8120 fi
8121 $RM $output
8122 # place dlname in correct position for cygwin
8123 tdlname=$dlname
8124 case $host,$output,$installed,$module,$dlname in
8125 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8126 esac
8127 $ECHO > $output "\
8128 # $outputname - a libtool library file
8129 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8130 #
8131 # Please DO NOT delete this file!
8132 # It is necessary for linking the library.
8133
8134 # The name that we can dlopen(3).
8135 dlname='$tdlname'
8136
8137 # Names of this library.
8138 library_names='$library_names'
8139
8140 # The name of the static archive.
8141 old_library='$old_library'
8142
8143 # Linker flags that can not go in dependency_libs.
8144 inherited_linker_flags='$new_inherited_linker_flags'
8145
8146 # Libraries that this one depends upon.
8147 dependency_libs='$dependency_libs'
8148
8149 # Names of additional weak libraries provided by this library
8150 weak_library_names='$weak_libs'
8151
8152 # Version information for $libname.
8153 current=$current
8154 age=$age
8155 revision=$revision
8156
8157 # Is this an already installed library?
8158 installed=$installed
8159
8160 # Should we warn about portability when linking against -modules?
8161 shouldnotlink=$module
8162
8163 # Files to dlopen/dlpreopen
8164 dlopen='$dlfiles'
8165 dlpreopen='$dlprefiles'
8166
8167 # Directory that this library needs to be installed in:
8168 libdir='$install_libdir'"
8169 if test "$installed" = no && test "$need_relink" = yes; then
8170 $ECHO >> $output "\
8171 relink_command=\"$relink_command\""
8172 fi
8173 done
8174 }
8175
8176 # Do a symbolic link so that the libtool archive can be found in
8177 # LD_LIBRARY_PATH before the program is installed.
8178 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
8179 ;;
8180 esac
8181 exit $EXIT_SUCCESS
8182 }
8183
8184 { test "$mode" = link || test "$mode" = relink; } &&
8185 func_mode_link ${1+"$@"}
8186
8187
8188 # func_mode_uninstall arg...
8189 func_mode_uninstall ()
8190 {
8191 $opt_debug
8192 RM="$nonopt"
8193 files=
8194 rmforce=
8195 exit_status=0
8196
8197 # This variable tells wrapper scripts just to set variables rather
8198 # than running their programs.
8199 libtool_install_magic="$magic"
8200
8201 for arg
8202 do
8203 case $arg in
8204 -f) RM="$RM $arg"; rmforce=yes ;;
8205 -*) RM="$RM $arg" ;;
8206 *) files="$files $arg" ;;
8207 esac
8208 done
8209
8210 test -z "$RM" && \
8211 func_fatal_help "you must specify an RM program"
8212
8213 rmdirs=
8214
8215 origobjdir="$objdir"
8216 for file in $files; do
8217 func_dirname "$file" "" "."
8218 dir="$func_dirname_result"
8219 if test "X$dir" = X.; then
8220 objdir="$origobjdir"
8221 else
8222 objdir="$dir/$origobjdir"
8223 fi
8224 func_basename "$file"
8225 name="$func_basename_result"
8226 test "$mode" = uninstall && objdir="$dir"
8227
8228 # Remember objdir for removal later, being careful to avoid duplicates
8229 if test "$mode" = clean; then
8230 case " $rmdirs " in
8231 *" $objdir "*) ;;
8232 *) rmdirs="$rmdirs $objdir" ;;
8233 esac
8234 fi
8235
8236 # Don't error if the file doesn't exist and rm -f was used.
8237 if { test -L "$file"; } >/dev/null 2>&1 ||
8238 { test -h "$file"; } >/dev/null 2>&1 ||
8239 test -f "$file"; then
8240 :
8241 elif test -d "$file"; then
8242 exit_status=1
8243 continue
8244 elif test "$rmforce" = yes; then
8245 continue
8246 fi
8247
8248 rmfiles="$file"
8249
8250 case $name in
8251 *.la)
8252 # Possibly a libtool archive, so verify it.
8253 if func_lalib_p "$file"; then
8254 func_source $dir/$name
8255
8256 # Delete the libtool libraries and symlinks.
8257 for n in $library_names; do
8258 rmfiles="$rmfiles $objdir/$n"
8259 done
8260 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8261
8262 case "$mode" in
8263 clean)
8264 case " $library_names " in
8265 # " " in the beginning catches empty $dlname
8266 *" $dlname "*) ;;
8267 *) rmfiles="$rmfiles $objdir/$dlname" ;;
8268 esac
8269 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
8270 ;;
8271 uninstall)
8272 if test -n "$library_names"; then
8273 # Do each command in the postuninstall commands.
8274 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8275 fi
8276
8277 if test -n "$old_library"; then
8278 # Do each command in the old_postuninstall commands.
8279 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8280 fi
8281 # FIXME: should reinstall the best remaining shared library.
8282 ;;
8283 esac
8284 fi
8285 ;;
8286
8287 *.lo)
8288 # Possibly a libtool object, so verify it.
8289 if func_lalib_p "$file"; then
8290
8291 # Read the .lo file
8292 func_source $dir/$name
8293
8294 # Add PIC object to the list of files to remove.
8295 if test -n "$pic_object" &&
8296 test "$pic_object" != none; then
8297 rmfiles="$rmfiles $dir/$pic_object"
8298 fi
8299
8300 # Add non-PIC object to the list of files to remove.
8301 if test -n "$non_pic_object" &&
8302 test "$non_pic_object" != none; then
8303 rmfiles="$rmfiles $dir/$non_pic_object"
8304 fi
8305 fi
8306 ;;
8307
8308 *)
8309 if test "$mode" = clean ; then
8310 noexename=$name
8311 case $file in
8312 *.exe)
8313 func_stripname '' '.exe' "$file"
8314 file=$func_stripname_result
8315 func_stripname '' '.exe' "$name"
8316 noexename=$func_stripname_result
8317 # $file with .exe has already been added to rmfiles,
8318 # add $file without .exe
8319 rmfiles="$rmfiles $file"
8320 ;;
8321 esac
8322 # Do a test to see if this is a libtool program.
8323 if func_ltwrapper_p "$file"; then
8324 if func_ltwrapper_executable_p "$file"; then
8325 func_ltwrapper_scriptname "$file"
8326 relink_command=
8327 func_source $func_ltwrapper_scriptname_result
8328 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
8329 else
8330 relink_command=
8331 func_source $dir/$noexename
8332 fi
8333
8334 # note $name still contains .exe if it was in $file originally
8335 # as does the version of $file that was added into $rmfiles
8336 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
8337 if test "$fast_install" = yes && test -n "$relink_command"; then
8338 rmfiles="$rmfiles $objdir/lt-$name"
8339 fi
8340 if test "X$noexename" != "X$name" ; then
8341 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
8342 fi
8343 fi
8344 fi
8345 ;;
8346 esac
8347 func_show_eval "$RM $rmfiles" 'exit_status=1'
8348 done
8349 objdir="$origobjdir"
8350
8351 # Try to remove the ${objdir}s in the directories where we deleted files
8352 for dir in $rmdirs; do
8353 if test -d "$dir"; then
8354 func_show_eval "rmdir $dir >/dev/null 2>&1"
8355 fi
8356 done
8357
8358 exit $exit_status
8359 }
8360
8361 { test "$mode" = uninstall || test "$mode" = clean; } &&
8362 func_mode_uninstall ${1+"$@"}
8363
8364 test -z "$mode" && {
8365 help="$generic_help"
8366 func_fatal_help "you must specify a MODE"
8367 }
8368
8369 test -z "$exec_cmd" && \
8370 func_fatal_help "invalid operation mode \`$mode'"
8371
8372 if test -n "$exec_cmd"; then
8373 eval exec "$exec_cmd"
8374 exit $EXIT_FAILURE
8375 fi
8376
8377 exit $exit_status
8378
8379
8380 # The TAGs below are defined such that we never get into a situation
8381 # in which we disable both kinds of libraries. Given conflicting
8382 # choices, we go for a static library, that is the most portable,
8383 # since we can't tell whether shared libraries were disabled because
8384 # the user asked for that or because the platform doesn't support
8385 # them. This is particularly important on AIX, because we don't
8386 # support having both static and shared libraries enabled at the same
8387 # time on that platform, so we default to a shared-only configuration.
8388 # If a disable-shared tag is given, we'll fallback to a static-only
8389 # configuration. But we'll never go from static-only to shared-only.
8390
8391 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
8392 build_libtool_libs=no
8393 build_old_libs=yes
8394 # ### END LIBTOOL TAG CONFIG: disable-shared
8395
8396 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
8397 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
8398 # ### END LIBTOOL TAG CONFIG: disable-static
8399
8400 # Local Variables:
8401 # mode:shell-script
8402 # sh-indentation:2
8403 # End:
8404 # vi:sw=2
8405
0 #! /bin/sh
1 # Common stub for a few missing GNU programs while installing.
2
3 scriptversion=2006-05-10.23
4
5 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
6 # Free Software Foundation, Inc.
7 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # 02110-1301, USA.
23
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
28
29 if test $# -eq 0; then
30 echo 1>&2 "Try \`$0 --help' for more information"
31 exit 1
32 fi
33
34 run=:
35 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
36 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
37
38 # In the cases where this matters, `missing' is being run in the
39 # srcdir already.
40 if test -f configure.ac; then
41 configure_ac=configure.ac
42 else
43 configure_ac=configure.in
44 fi
45
46 msg="missing on your system"
47
48 case $1 in
49 --run)
50 # Try to run requested program, and just exit if it succeeds.
51 run=
52 shift
53 "$@" && exit 0
54 # Exit code 63 means version mismatch. This often happens
55 # when the user try to use an ancient version of a tool on
56 # a file that requires a minimum version. In this case we
57 # we should proceed has if the program had been absent, or
58 # if --run hadn't been passed.
59 if test $? = 63; then
60 run=:
61 msg="probably too old"
62 fi
63 ;;
64
65 -h|--h|--he|--hel|--help)
66 echo "\
67 $0 [OPTION]... PROGRAM [ARGUMENT]...
68
69 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
70 error status if there is no known handling for PROGRAM.
71
72 Options:
73 -h, --help display this help and exit
74 -v, --version output version information and exit
75 --run try to run the given command, and emulate it if it fails
76
77 Supported PROGRAM values:
78 aclocal touch file \`aclocal.m4'
79 autoconf touch file \`configure'
80 autoheader touch file \`config.h.in'
81 autom4te touch the output file, or create a stub one
82 automake touch all \`Makefile.in' files
83 bison create \`y.tab.[ch]', if possible, from existing .[ch]
84 flex create \`lex.yy.c', if possible, from existing .c
85 help2man touch the output file
86 lex create \`lex.yy.c', if possible, from existing .c
87 makeinfo touch the output file
88 tar try tar, gnutar, gtar, then tar without non-portable flags
89 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
90
91 Send bug reports to <bug-automake@gnu.org>."
92 exit $?
93 ;;
94
95 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
96 echo "missing $scriptversion (GNU Automake)"
97 exit $?
98 ;;
99
100 -*)
101 echo 1>&2 "$0: Unknown \`$1' option"
102 echo 1>&2 "Try \`$0 --help' for more information"
103 exit 1
104 ;;
105
106 esac
107
108 # Now exit if we have it, but it failed. Also exit now if we
109 # don't have it and --version was passed (most likely to detect
110 # the program).
111 case $1 in
112 lex|yacc)
113 # Not GNU programs, they don't have --version.
114 ;;
115
116 tar)
117 if test -n "$run"; then
118 echo 1>&2 "ERROR: \`tar' requires --run"
119 exit 1
120 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
121 exit 1
122 fi
123 ;;
124
125 *)
126 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
127 # We have it, but it failed.
128 exit 1
129 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
130 # Could not run --version or --help. This is probably someone
131 # running `$TOOL --version' or `$TOOL --help' to check whether
132 # $TOOL exists and not knowing $TOOL uses missing.
133 exit 1
134 fi
135 ;;
136 esac
137
138 # If it does not exist, or fails to run (possibly an outdated version),
139 # try to emulate it.
140 case $1 in
141 aclocal*)
142 echo 1>&2 "\
143 WARNING: \`$1' is $msg. You should only need it if
144 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
145 to install the \`Automake' and \`Perl' packages. Grab them from
146 any GNU archive site."
147 touch aclocal.m4
148 ;;
149
150 autoconf)
151 echo 1>&2 "\
152 WARNING: \`$1' is $msg. You should only need it if
153 you modified \`${configure_ac}'. You might want to install the
154 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
155 archive site."
156 touch configure
157 ;;
158
159 autoheader)
160 echo 1>&2 "\
161 WARNING: \`$1' is $msg. You should only need it if
162 you modified \`acconfig.h' or \`${configure_ac}'. You might want
163 to install the \`Autoconf' and \`GNU m4' packages. Grab them
164 from any GNU archive site."
165 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
166 test -z "$files" && files="config.h"
167 touch_files=
168 for f in $files; do
169 case $f in
170 *:*) touch_files="$touch_files "`echo "$f" |
171 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
172 *) touch_files="$touch_files $f.in";;
173 esac
174 done
175 touch $touch_files
176 ;;
177
178 automake*)
179 echo 1>&2 "\
180 WARNING: \`$1' is $msg. You should only need it if
181 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
182 You might want to install the \`Automake' and \`Perl' packages.
183 Grab them from any GNU archive site."
184 find . -type f -name Makefile.am -print |
185 sed 's/\.am$/.in/' |
186 while read f; do touch "$f"; done
187 ;;
188
189 autom4te)
190 echo 1>&2 "\
191 WARNING: \`$1' is needed, but is $msg.
192 You might have modified some files without having the
193 proper tools for further handling them.
194 You can get \`$1' as part of \`Autoconf' from any GNU
195 archive site."
196
197 file=`echo "$*" | sed -n "$sed_output"`
198 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
199 if test -f "$file"; then
200 touch $file
201 else
202 test -z "$file" || exec >$file
203 echo "#! /bin/sh"
204 echo "# Created by GNU Automake missing as a replacement of"
205 echo "# $ $@"
206 echo "exit 0"
207 chmod +x $file
208 exit 1
209 fi
210 ;;
211
212 bison|yacc)
213 echo 1>&2 "\
214 WARNING: \`$1' $msg. You should only need it if
215 you modified a \`.y' file. You may need the \`Bison' package
216 in order for those modifications to take effect. You can get
217 \`Bison' from any GNU archive site."
218 rm -f y.tab.c y.tab.h
219 if test $# -ne 1; then
220 eval LASTARG="\${$#}"
221 case $LASTARG in
222 *.y)
223 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
224 if test -f "$SRCFILE"; then
225 cp "$SRCFILE" y.tab.c
226 fi
227 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
228 if test -f "$SRCFILE"; then
229 cp "$SRCFILE" y.tab.h
230 fi
231 ;;
232 esac
233 fi
234 if test ! -f y.tab.h; then
235 echo >y.tab.h
236 fi
237 if test ! -f y.tab.c; then
238 echo 'main() { return 0; }' >y.tab.c
239 fi
240 ;;
241
242 lex|flex)
243 echo 1>&2 "\
244 WARNING: \`$1' is $msg. You should only need it if
245 you modified a \`.l' file. You may need the \`Flex' package
246 in order for those modifications to take effect. You can get
247 \`Flex' from any GNU archive site."
248 rm -f lex.yy.c
249 if test $# -ne 1; then
250 eval LASTARG="\${$#}"
251 case $LASTARG in
252 *.l)
253 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
254 if test -f "$SRCFILE"; then
255 cp "$SRCFILE" lex.yy.c
256 fi
257 ;;
258 esac
259 fi
260 if test ! -f lex.yy.c; then
261 echo 'main() { return 0; }' >lex.yy.c
262 fi
263 ;;
264
265 help2man)
266 echo 1>&2 "\
267 WARNING: \`$1' is $msg. You should only need it if
268 you modified a dependency of a manual page. You may need the
269 \`Help2man' package in order for those modifications to take
270 effect. You can get \`Help2man' from any GNU archive site."
271
272 file=`echo "$*" | sed -n "$sed_output"`
273 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
274 if test -f "$file"; then
275 touch $file
276 else
277 test -z "$file" || exec >$file
278 echo ".ab help2man is required to generate this page"
279 exit 1
280 fi
281 ;;
282
283 makeinfo)
284 echo 1>&2 "\
285 WARNING: \`$1' is $msg. You should only need it if
286 you modified a \`.texi' or \`.texinfo' file, or any other file
287 indirectly affecting the aspect of the manual. The spurious
288 call might also be the consequence of using a buggy \`make' (AIX,
289 DU, IRIX). You might want to install the \`Texinfo' package or
290 the \`GNU make' package. Grab either from any GNU archive site."
291 # The file to touch is that specified with -o ...
292 file=`echo "$*" | sed -n "$sed_output"`
293 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
294 if test -z "$file"; then
295 # ... or it is the one specified with @setfilename ...
296 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
297 file=`sed -n '
298 /^@setfilename/{
299 s/.* \([^ ]*\) *$/\1/
300 p
301 q
302 }' $infile`
303 # ... or it is derived from the source name (dir/f.texi becomes f.info)
304 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
305 fi
306 # If the file does not exist, the user really needs makeinfo;
307 # let's fail without touching anything.
308 test -f $file || exit 1
309 touch $file
310 ;;
311
312 tar)
313 shift
314
315 # We have already tried tar in the generic part.
316 # Look for gnutar/gtar before invocation to avoid ugly error
317 # messages.
318 if (gnutar --version > /dev/null 2>&1); then
319 gnutar "$@" && exit 0
320 fi
321 if (gtar --version > /dev/null 2>&1); then
322 gtar "$@" && exit 0
323 fi
324 firstarg="$1"
325 if shift; then
326 case $firstarg in
327 *o*)
328 firstarg=`echo "$firstarg" | sed s/o//`
329 tar "$firstarg" "$@" && exit 0
330 ;;
331 esac
332 case $firstarg in
333 *h*)
334 firstarg=`echo "$firstarg" | sed s/h//`
335 tar "$firstarg" "$@" && exit 0
336 ;;
337 esac
338 fi
339
340 echo 1>&2 "\
341 WARNING: I can't seem to be able to run \`tar' with the given arguments.
342 You may want to install GNU tar or Free paxutils, or check the
343 command line arguments."
344 exit 1
345 ;;
346
347 *)
348 echo 1>&2 "\
349 WARNING: \`$1' is needed, and is $msg.
350 You might have modified some files without having the
351 proper tools for further handling them. Check the \`README' file,
352 it often tells you about the needed prerequisites for installing
353 this package. You may also peek at any GNU archive site, in case
354 some other package would contain this missing \`$1' program."
355 exit 1
356 ;;
357 esac
358
359 exit 0
360
361 # Local variables:
362 # eval: (add-hook 'write-file-hooks 'time-stamp)
363 # time-stamp-start: "scriptversion="
364 # time-stamp-format: "%:y-%02m-%02d.%02H"
365 # time-stamp-end: "$"
366 # End:
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libatasmart.
4
5 Copyright 2008 Lennart Poettering
6
7 libatasmart is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libatasmart is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libatasmart. If not, If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <stdio.h>
27 #include <string.h>
28 #include <errno.h>
29 #include <getopt.h>
30
31 #include "atasmart.h"
32
33 enum {
34 MODE_DUMP = 10,
35 MODE_OVERALL,
36 MODE_POWER_ON,
37 MODE_POWER_CYCLE,
38 MODE_BAD,
39 MODE_TEMPERATURE,
40 MODE_STATUS,
41 MODE_CAN_SMART,
42 MODE_SAVE
43 };
44
45 int mode = MODE_DUMP;
46
47 enum {
48 ARG_SAVE = 256,
49 ARG_LOAD
50 };
51
52 int main(int argc, char *argv[]) {
53 int ret;
54 const char *device = NULL, *argv0, *p, *file = NULL;
55 SkDisk *d;
56 int q = 1;
57 SkBool from_blob = FALSE;
58
59 static const struct option long_options[] = {
60 {"overall", no_argument, &mode, MODE_OVERALL},
61 {"power-on", no_argument, &mode, MODE_POWER_ON},
62 {"power-cycle", no_argument, &mode, MODE_POWER_CYCLE},
63 {"bad", no_argument, &mode, MODE_BAD},
64 {"temperature", no_argument, &mode, MODE_TEMPERATURE},
65 {"can-smart", no_argument, &mode, MODE_CAN_SMART},
66 {"status", no_argument, &mode, MODE_STATUS},
67 {"save", optional_argument, NULL, ARG_SAVE},
68 {"load", optional_argument, NULL, ARG_LOAD},
69 {"help", no_argument, NULL, 'h' },
70 {0, 0, 0, 0}
71 };
72
73 argv0 = argv[0];
74 if ((p = strrchr(argv0, '/')))
75 argv0 = p+1;
76
77 for (;;) {
78 int opt;
79
80 if ((opt = getopt_long(argc, argv, "h", long_options, NULL)) < 0)
81 break;
82
83 switch (opt) {
84 case 0:
85 break;
86
87 case 'h':
88 fprintf(stderr,
89 "Usage: %s [PARAMETERS] DEVICE\n"
90 "Reads ATA SMART data from a device and parses it.\n"
91 "\n"
92 "\t--overall \tShow overall status\n"
93 "\t--status \tShow SMART status\n"
94 "\t--can-smart \tShow whether SMART is supported\n"
95 "\t--power-on \tPrint power on time in ms\n"
96 "\t--power-cycle \tPrint number of power cycles\n"
97 "\t--bad \tPrint bad sector count\n"
98 "\t--temperature \tPrint drive temperature in mKelvin\n"
99 "\t--save[=FILENAME]\tSave raw data to file/STDOUT\n"
100 "\t--load[=FILENAME]\tRead data from a file/STDIN instead of device\n"
101 "\t-h | --help \tShow this help\n", argv0);
102
103 return 0;
104
105 case ARG_SAVE:
106 file = optarg;
107 mode = MODE_SAVE;
108 break;
109
110 case ARG_LOAD:
111 device = optarg ? optarg : "-";
112 from_blob = TRUE;
113 break;
114
115 case '?':
116 return 1;
117
118 default:
119 fprintf(stderr, "Invalid arguments.\n");
120 return 1;
121 }
122 }
123
124 if (!device) {
125 if (optind != argc-1) {
126 fprintf(stderr, "No or more than one device specified.\n");
127 return 1;
128 }
129
130 device = argv[optind];
131 } else {
132 if (optind != argc) {
133 fprintf(stderr, "Too many arguments.\n");
134 return 1;
135 }
136 }
137
138 if (from_blob) {
139 uint8_t blob[4096];
140 size_t size;
141 FILE *f = stdin;
142
143 if ((ret = sk_disk_open(NULL, &d)) < 0) {
144 fprintf(stderr, "Failed to open disk: %s\n", strerror(errno));
145 return 1;
146 }
147
148 if (strcmp(device, "-")) {
149 if (!(f = fopen(device, "r"))) {
150 fprintf(stderr, "Failed to open file: %s\n", strerror(errno));
151 goto finish;
152 }
153 }
154
155 size = fread(blob, 1, sizeof(blob), f);
156
157 if (f != stdin)
158 fclose(f);
159
160 if (size >= sizeof(blob)) {
161 fprintf(stderr, "File too large for buffer.\n");
162 goto finish;
163 }
164
165 if ((ret = sk_disk_set_blob(d, blob, size)) < 0) {
166 fprintf(stderr, "Failed to set blob: %s\n", strerror(errno));
167 goto finish;
168 }
169
170 } else {
171 if ((ret = sk_disk_open(device, &d)) < 0) {
172 fprintf(stderr, "Failed to open disk %s: %s\n", device, strerror(errno));
173 return 1;
174 }
175 }
176
177 switch (mode) {
178 case MODE_DUMP:
179 if ((ret = sk_disk_dump(d)) < 0) {
180 fprintf(stderr, "Failed to dump disk data: %s\n", strerror(errno));
181 goto finish;
182 }
183
184 break;
185
186 case MODE_CAN_SMART: {
187 SkBool available;
188
189 if ((ret = sk_disk_smart_is_available(d, &available)) < 0) {
190 fprintf(stderr, "Failed to query whether SMART is available: %s\n", strerror(errno));
191 goto finish;
192 }
193
194 printf("%s\n", available ? "YES" : "NO");
195 q = available ? 0 : 1;
196 break;
197 }
198
199 case MODE_OVERALL: {
200 SkSmartOverall overall;
201
202 if ((ret = sk_disk_smart_read_data(d)) < 0) {
203 fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno));
204 goto finish;
205 }
206
207 if ((ret = sk_disk_smart_get_overall(d, &overall)) < 0) {
208 fprintf(stderr, "Failed to get overall status: %s\n", strerror(errno));
209 goto finish;
210 }
211
212 printf("%s\n", sk_smart_overall_to_string(overall));
213 q = overall == SK_SMART_OVERALL_GOOD ? 0 : 1;
214 goto finish;
215 }
216
217 case MODE_STATUS: {
218 SkBool good;
219
220 if ((ret = sk_disk_smart_status(d, &good)) < 0) {
221 fprintf(stderr, "Failed to get SMART status: %s\n", strerror(errno));
222 goto finish;
223 }
224
225 printf("%s\n", good ? "GOOD" : "BAD");
226 q = good ? 0 : 1;
227 goto finish;
228 }
229
230 case MODE_POWER_ON: {
231 uint64_t ms;
232
233 if ((ret = sk_disk_smart_read_data(d)) < 0) {
234 fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno));
235 goto finish;
236 }
237
238 if ((ret = sk_disk_smart_get_power_on(d, &ms)) < 0) {
239 fprintf(stderr, "Failed to get power on time: %s\n", strerror(errno));
240 goto finish;
241 }
242
243 printf("%llu\n", (unsigned long long) ms);
244 break;
245 }
246
247 case MODE_POWER_CYCLE: {
248 uint64_t count;
249
250 if ((ret = sk_disk_smart_read_data(d)) < 0) {
251 fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno));
252 goto finish;
253 }
254
255 if ((ret = sk_disk_smart_get_power_cycle(d, &count)) < 0) {
256 fprintf(stderr, "Failed to get power cycles: %s\n", strerror(errno));
257 goto finish;
258 }
259
260 printf("%llu\n", (unsigned long long) count);
261 break;
262 }
263
264 case MODE_BAD: {
265 uint64_t bad;
266
267 if ((ret = sk_disk_smart_read_data(d)) < 0) {
268 fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno));
269 goto finish;
270 }
271
272 if ((ret = sk_disk_smart_get_bad(d, &bad)) < 0) {
273 fprintf(stderr, "Failed to get bad sectors: %s\n", strerror(errno));
274 goto finish;
275 }
276
277 printf("%llu\n", (unsigned long long) bad);
278 q = !!bad;
279 goto finish;
280 }
281
282 case MODE_TEMPERATURE: {
283 uint64_t mkelvin;
284
285 if ((ret = sk_disk_smart_read_data(d)) < 0) {
286 fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno));
287 goto finish;
288 }
289
290 if ((ret = sk_disk_smart_get_temperature(d, &mkelvin)) < 0) {
291 fprintf(stderr, "Failed to get temperature: %s\n", strerror(errno));
292 goto finish;
293 }
294
295 printf("%llu\n", (unsigned long long) mkelvin);
296 break;
297 }
298
299 case MODE_SAVE: {
300 const void *blob;
301 size_t size;
302 FILE *f = stdout;
303 size_t n;
304
305 if ((ret = sk_disk_smart_read_data(d)) < 0) {
306 fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno));
307 goto finish;
308 }
309
310 if ((ret = sk_disk_get_blob(d, &blob, &size)) < 0) {
311 fprintf(stderr, "Failed to get blob: %s\n", strerror(errno));
312 goto finish;
313 }
314
315 if (file && strcmp(file, "-")) {
316 if (!(f = fopen(file, "w"))) {
317 fprintf(stderr, "Failed to open '%s': %s\n", file, strerror(errno));
318 goto finish;
319 }
320 }
321
322 n = fwrite(blob, 1, size, f);
323
324 if (f != stdout)
325 fclose(f);
326
327 if (n != size) {
328 fprintf(stderr, "Failed to write to disk: %s\n", strerror(errno));
329 goto finish;
330 }
331
332 break;
333 }
334
335 }
336
337
338 q = 0;
339
340 finish:
341
342 if (d)
343 sk_disk_free(d);
344
345 return q;
346 }
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libatasmart.
4
5 Copyright 2008 Lennart Poettering
6
7 libatasmart is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libatasmart is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libatasmart. If not, If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include <string.h>
23 #include <errno.h>
24 #include <stdio.h>
25
26 #include "atasmart.h"
27
28 int main(int argc, char *argv[]) {
29 int ret;
30 const char *device;
31 SkDisk *d;
32 SkSmartSelfTest test;
33
34 if (argc < 3) {
35 fprintf(stderr, "%s [DEVICE] [short|extended|conveyance|abort]\n", argv[0]);
36 return 1;
37 }
38
39 device = argv[1];
40
41 if (!strcasecmp(argv[2], sk_smart_self_test_to_string(SK_SMART_SELF_TEST_SHORT)))
42 test = SK_SMART_SELF_TEST_SHORT;
43 else if (!strcasecmp(argv[2], sk_smart_self_test_to_string(SK_SMART_SELF_TEST_EXTENDED)))
44 test = SK_SMART_SELF_TEST_EXTENDED;
45 else if (!(strcasecmp(argv[2], sk_smart_self_test_to_string(SK_SMART_SELF_TEST_CONVEYANCE))))
46 test = SK_SMART_SELF_TEST_CONVEYANCE;
47 else if (!(strcasecmp(argv[2], sk_smart_self_test_to_string(SK_SMART_SELF_TEST_ABORT))))
48 test = SK_SMART_SELF_TEST_ABORT;
49 else {
50 fprintf(stderr, "Unknown test '%s'.\n", argv[2]);
51 return 1;
52 }
53
54 if ((ret = sk_disk_open(device, &d)) < 0) {
55 fprintf(stderr, "Failed to open disk %s: %s\n", device, strerror(errno));
56 return 1;
57 }
58
59 if ((ret = sk_disk_smart_self_test(d, test)) < 0) {
60 fprintf(stderr, "Failed to start sel-test: %s\n", strerror(errno));
61 return 1;
62
63 }
64
65 sk_disk_free(d);
66
67 return 0;
68 }
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libatasmart.
4
5 Copyright 2008 Lennart Poettering
6
7 libatasmart is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libatasmart is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libatasmart. If not, If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <string.h>
29 #include <sys/types.h>
30 #include <assert.h>
31 #include <errno.h>
32
33 typedef struct item {
34 char *cnt;
35 size_t cntl;
36 char *text;
37 size_t size;
38 unsigned idx;
39 struct item *suffix_of;
40 struct item *next;
41 } item;
42
43 static void free_items(struct item *first) {
44
45 while (first) {
46 struct item *n = first->next;
47
48 free(first->cnt);
49 free(first->text);
50 free(first);
51
52 first = n;
53 }
54 }
55
56 static void find_suffixes(struct item *first) {
57 struct item *i, *j;
58
59 for (i = first; i; i = i->next) {
60 int right = 0;
61
62 for (j = first; j; j = j->next) {
63
64 if (i == j) {
65 right = 1;
66 continue;
67 }
68
69 if (i->size > j->size)
70 continue;
71
72 if (i->size == j->size && !right)
73 continue;
74
75 if (memcmp(i->text, j->text+j->size-i->size, i->size) != 0)
76 continue;
77
78 i->suffix_of = j;
79 break;
80 }
81 }
82 }
83
84 static void fill_idx(struct item *first) {
85 struct item *i;
86 unsigned k = 0;
87
88 for (i = first; i; i = i->next) {
89 if (i->suffix_of)
90 continue;
91
92 i->idx = k;
93 k += i->size+1;
94 }
95
96 for (i = first; i; i = i->next) {
97 struct item *p;
98
99 if (!i->suffix_of)
100 continue;
101
102 for (p = i->suffix_of; p->suffix_of; p = p->suffix_of)
103 ;
104
105 assert(i->size <= p->size);
106 assert(memcmp(i->text, p->text + p->size - i->size, i->size) == 0);
107
108 i->idx = p->idx + p->size - i->size;
109 }
110 }
111
112 static void dump_string(FILE *out, struct item *i) {
113 const char *t;
114
115 fputs("\n\t\"", out);
116
117 for (t = i->text; t < i->text+i->size; t++) {
118 switch (*t) {
119 case '\\':
120 fputs("\\\\", out);
121 break;
122 case '\"':
123 fputs("\\\"", out);
124 break;
125 case '\'':
126 fputs("\\'", out);
127 break;
128 case '\n':
129 fputs("\\n\"\n\t\"", out);
130 break;
131 case '\r':
132 fputs("\\r", out);
133 break;
134 case '\b':
135 fputs("\\b", out);
136 break;
137 case '\t':
138 fputs("\\t", out);
139 break;
140 case '\f':
141 fputs("\\f", out);
142 break;
143 case '\a':
144 fputs("\\f", out);
145 break;
146 case '\v':
147 fputs("\\v", out);
148 break;
149 default:
150 if (*t >= 32 && *t < 127)
151 putc(*t, out);
152 else
153 fprintf(out, "\\x%02x", *t);
154 break;
155 }
156 }
157
158 fputs("\\0\"", out);
159 }
160
161 static void dump_text(FILE *out, struct item *first) {
162 struct item *i;
163
164 for (i = first; i; i = i->next) {
165
166 if (i->cnt)
167 fwrite(i->cnt, 1, i->cntl, out);
168
169 /* We offset all indexes by one, to avoid clashes
170 * between index 0 and NULL */
171 fprintf(out, "((const char*) %u)", i->idx+1);
172 }
173 }
174
175 static void dump_pool(FILE *out, struct item *first) {
176 struct item *i;
177 int saved_rel=-1, saved_bytes=0, saved_strings=0;
178
179 for (i = first; i; i = i->next) {
180 saved_rel++;
181
182 if (i->suffix_of) {
183 saved_strings ++;
184 saved_bytes += i->size;
185 }
186 }
187
188 fprintf(out, "/* Saved %i relocations, saved %i strings (%i b) due to suffix compression. */\n", saved_rel, saved_strings, saved_bytes);
189
190 fputs("static const char _strpool_[] =", out);
191
192 for (i = first; i; i = i->next) {
193
194 if (i->suffix_of)
195 fputs("\n\t/*** Suppressed due to suffix: ", out);
196
197 dump_string(out, i);
198
199 if (i->suffix_of)
200 fputs(" ***/", out);
201
202 }
203
204 fputs(";\n", out);
205 }
206
207 static char *append(char *r, size_t *rl, char **c, size_t n) {
208
209 r = realloc(r, *rl + n);
210
211 if (!r)
212 abort();
213
214 memcpy(r + *rl, *c, n);
215
216 *rl += n;
217 *c += n;
218
219 return r;
220 }
221
222 static int parse_hex_digit(char c) {
223
224 if (c >= '0' && c <= '9')
225 return c - '0' + 0x0;
226
227 if (c >= 'a' && c <= 'f')
228 return c - 'a' + 0xA;
229
230 if (c >= 'A' && c <= 'F')
231 return c - 'A' + 0xA;
232
233 return -1;
234 }
235
236 static int parse_hex(const char *t, char *r) {
237 int a, b = 0;
238 int k = 1;
239
240 if ((a = parse_hex_digit(t[0])) < 0)
241 return -1;
242
243 if (t[1]) {
244 if ((b = parse_hex_digit(t[1])) < 0)
245 b = 0;
246 else
247 k = 2;
248 }
249
250 *r = (a << 4) | b;
251 return k;
252 }
253
254 static int parse_oct_digit(char c) {
255
256 if (c >= '0' && c <= '7')
257 return c - '0';
258
259 return -1;
260 }
261
262 static int parse_oct(const char *t, char *r) {
263 int a, b = 0, c = 0, m;
264 int k = 1;
265
266 if ((a = parse_oct_digit(t[0])) < 0)
267 return -1;
268
269 if (t[1]) {
270
271 if ((b = parse_oct_digit(t[1])) < 0)
272 b = 0;
273 else {
274 k = 2;
275
276 if (t[2]) {
277
278 if ((c = parse_oct_digit(t[2])) < 0)
279 c = 0;
280 else
281 k = 3;
282 }
283 }
284 }
285
286 m = (a << 6) | (b << 3) | c;
287
288 if (m > 0xFF)
289 return -1;
290
291 *r = (char) m;
292
293 return k;
294 }
295
296 static int parse(FILE *in, const char *fname, struct item **rfirst, char **remain, size_t *remain_size) {
297
298 int enabled = 0;
299 enum {
300 STATE_TEXT,
301 STATE_COMMENT_C,
302 STATE_COMMENT_CPP,
303 STATE_STRING,
304 STATE_CHAR,
305 } state = STATE_TEXT;
306
307 char *r = NULL;
308 size_t rl = 0;
309 char *cnt = NULL;
310 size_t cntl = 0;
311 struct item *first = NULL, *last = NULL;
312 unsigned nline = 0;
313 unsigned pool_started_line = 0;
314 *rfirst = NULL;
315
316 if (!fname)
317 fname = "<stdin>";
318
319 for (;;) {
320 char t[1024], *c;
321 int done = 0;
322
323 if (!(fgets(t, sizeof(t), in))) {
324
325 if (feof(in))
326 break;
327
328 fprintf(stderr, "Failed to read: %s\n", strerror(errno));
329 goto fail;
330 }
331
332 nline++;
333
334 c = t;
335
336 do {
337
338 /* fprintf(stderr, "enabled %i, state %i, cnt %i, remaining string is: %s", enabled, state, !!cnt, c); */
339
340 switch (state) {
341
342 case STATE_TEXT:
343
344 if (!strncmp(c, "/*", 2)) {
345 state = STATE_COMMENT_C;
346 r = append(r, &rl, &c, 2);
347 } else if (!strncmp(c, "//", 2)) {
348 state = STATE_COMMENT_CPP;
349 r = append(r, &rl, &c, 2);
350 } else if (*c == '"') {
351 state = STATE_STRING;
352
353 if (enabled) {
354 cnt = r;
355 cntl = rl;
356
357 r = NULL;
358 rl = 0;
359
360 c ++;
361 } else
362 r = append(r, &rl, &c, 1);
363 } else if (*c == '\'') {
364 state = STATE_CHAR;
365 r = append(r, &rl, &c, 1);
366 } else if (*c == 0)
367 done = 1;
368 else
369 r = append(r, &rl, &c, 1);
370
371 break;
372
373 case STATE_COMMENT_C:
374
375 if (!strncmp(c, "*/", 2)) {
376 state = STATE_TEXT;
377 r = append(r, &rl, &c, 2);
378 } else if (!strncmp(c, "%STRINGPOOLSTART%", 17)) {
379 enabled = 1;
380 pool_started_line = nline;
381 r = append(r, &rl, &c, 17);
382 } else if (!strncmp(c, "%STRINGPOOLSTOP%", 16)) {
383 enabled = 0;
384 r = append(r, &rl, &c, 16);
385 } else if (*c == 0)
386 done = 1;
387 else
388 r = append(r, &rl, &c, 1);
389
390 break;
391
392 case STATE_COMMENT_CPP:
393
394 if (*c == '\n' || *c == '\r') {
395 state = STATE_TEXT;
396 r = append(r, &rl, &c, 1);
397 } else if (!strncmp(c, "%STRINGPOOLSTART%", 17)) {
398 enabled = 1;
399 pool_started_line = nline;
400 r = append(r, &rl, &c, 17);
401 } else if (!strncmp(c, "%STRINGPOOLSTOP%", 16)) {
402 enabled = 0;
403 r = append(r, &rl, &c, 16);
404 } else if (*c == 0) {
405 state = STATE_TEXT;
406 done = 1;
407 } else
408 r = append(r, &rl, &c, 1);
409
410 break;
411
412 case STATE_STRING:
413 case STATE_CHAR:
414
415 if ((*c == '\'' && state == STATE_CHAR) || (*c == '"' && state == STATE_STRING)) {
416
417 if (state == STATE_STRING && enabled) {
418 struct item *i;
419 i = malloc(sizeof(struct item));
420
421 if (!i)
422 abort();
423
424 i->cnt = cnt;
425 i->cntl = cntl;
426
427 cnt = NULL;
428 cntl = 0;
429
430 i->text = r;
431 i->size = rl;
432
433 r = NULL;
434 rl = 0;
435
436 i->next = NULL;
437
438 if (last)
439 last->next = i;
440 else
441 first = i;
442
443 last = i;
444
445 c++;
446
447 } else
448 r = append(r, &rl, &c, 1);
449
450 state = STATE_TEXT;
451
452 } else if (*c == '\\') {
453
454 char d;
455 char l = 2;
456
457 switch (c[1]) {
458
459 case '\\':
460 case '"':
461 case '\'':
462 case '?':
463 d = c[1];
464 break;
465 case 'n':
466 d = '\n';
467 break;
468 case 'r':
469 d = '\r';
470 break;
471 case 'b':
472 d = '\b';
473 break;
474 case 't':
475 d = '\t';
476 break;
477 case 'f':
478 d = '\f';
479 break;
480 case 'a':
481 d = '\a';
482 break;
483 case 'v':
484 d = '\v';
485 break;
486 case 'x': {
487 int k;
488 if ((k = parse_hex(c+2, &d)) < 0) {
489 fprintf(stderr, "%s:%u: Parse failure: invalid hexadecimal escape sequence.\n", fname, nline);
490 goto fail;
491 }
492 l = 2 + k;
493 break;
494 }
495 case '0':
496 case '1':
497 case '2':
498 case '3':
499 case '4':
500 case '5':
501 case '6':
502 case '7': {
503 int k;
504 if ((k = parse_oct(c+1, &d)) < 0) {
505 fprintf(stderr, "%s:%u: Parse failure: invalid octal escape sequence.\n", fname, nline);
506 goto fail;
507 }
508 l = 1 + k;
509 break;
510 }
511 default:
512 fprintf(stderr, "%s:%u: Parse failure: invalid escape sequence.\n", fname, nline);
513 goto fail;
514 }
515
516 if (state == STATE_STRING && enabled) {
517 char *x = &d;
518 r = append(r, &rl, &x, 1);
519 c += l;
520 } else
521 r = append(r, &rl, &c, l);
522 } else if (*c == 0) {
523 fprintf(stderr, "%s:%u: Parse failure: multiline strings suck.\n", fname, nline);
524 goto fail;
525 } else
526 r = append(r, &rl, &c, 1);
527
528 break;
529 }
530 } while (!done);
531 }
532
533 if (enabled) {
534 fprintf(stderr, "%s:%u: Parse failure: missing %%STRINGPOOLSTOP%%\n", fname, pool_started_line);
535 goto fail;
536 }
537
538 if (state != STATE_TEXT) {
539 fprintf(stderr, "%s:%u: Parse failure: unexpected EOF.\n", fname, nline);
540 goto fail;
541 }
542
543 assert(!cnt);
544
545 *rfirst = first;
546
547 *remain = r;
548 *remain_size = rl;
549
550 return 0;
551
552 fail:
553
554 free(cnt);
555 free(r);
556 free_items(first);
557
558 return -1;
559 }
560
561 static int process(FILE *in, FILE *out, const char*ifname) {
562
563 struct item *first = NULL;
564 char *remain = NULL;
565 size_t remain_size = 0;
566
567 if (parse(in, ifname, &first, &remain, &remain_size) < 0)
568 return -1;
569
570 if (!first)
571 fwrite(remain, 1, remain_size, out);
572 else {
573 find_suffixes(first);
574 fill_idx(first);
575
576 dump_pool(out, first);
577
578 fprintf(out,
579 "#ifndef STRPOOL\n"
580 "#define STRPOOL\n"
581 "#endif\n"
582 "#ifndef _P\n"
583 "#define _P(x) (_strpool_ + ((x) - (const char*) 1))\n"
584 "#endif\n\n");
585
586
587 if (ifname)
588 fprintf(out, "#line 1 \"%s\"\n", ifname);
589
590 dump_text(out, first);
591 fwrite(remain, 1, remain_size, out);
592
593 free_items(first);
594 }
595
596 free(remain);
597
598 return 0;
599 }
600
601 int main(int argc, char *argv[]) {
602 int ret;
603 FILE *in = NULL, *out = NULL;
604
605 if (argc > 1) {
606 if (!(in = fopen(argv[1], "r"))) {
607 fprintf(stderr, "Failed to open '%s': %s\n", argv[1], strerror(errno));
608 return 1;
609 }
610 } else
611 in = stdin;
612
613 if (argc > 2) {
614 if (!(out = fopen(argv[2], "w"))) {
615 fprintf(stderr, "Failed to open '%s': %s\n", argv[2], strerror(errno));
616 return 1;
617 }
618 } else
619 out = stdout;
620
621 if (process(in, out, argc > 1 ? argv[1] : NULL) < 0)
622 goto finish;
623
624 ret = 0;
625
626 finish:
627
628 if (in != stdin)
629 fclose(in);
630
631 if (out != stdout)
632 fclose(out);
633
634 return ret;
635 }