##// END OF EJS Templates
Use Autotools and libtools now /!\ unstable, Win port not ready
jeandet -
r3:c463c7242078 alexis
parent child
Show More
@@ -0,0 +1,3
1 Developers:
2 Yannic Simon <yannic.simon@lpp.polytechnique.fr>
3 Alexis Jeandet <alexis.jeandet@lpp.polytechnique.fr> No newline at end of file
This diff has been collapsed as it changes many lines, (674 lines changed) Show them Hide them
@@ -0,0 +1,674
1 GNU GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The GNU General Public License is a free, copyleft license for
11 software and other kinds of works.
12
13 The licenses for most software and other practical works are designed
14 to take away your freedom to share and change the works. By contrast,
15 the GNU General Public License is intended to guarantee your freedom to
16 share and change all versions of a program--to make sure it remains free
17 software for all its users. We, the Free Software Foundation, use the
18 GNU General Public License for most of our software; it applies also to
19 any other work released this way by its authors. You can apply it to
20 your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23 price. Our General Public Licenses are designed to make sure that you
24 have the freedom to distribute copies of free software (and charge for
25 them if you wish), that you receive source code or can get it if you
26 want it, that you can change the software or use pieces of it in new
27 free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30 these rights or asking you to surrender the rights. Therefore, you have
31 certain responsibilities if you distribute copies of the software, or if
32 you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35 gratis or for a fee, you must pass on to the recipients the same
36 freedoms that you received. You must make sure that they, too, receive
37 or can get the source code. And you must show them these terms so they
38 know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41 (1) assert copyright on the software, and (2) offer you this License
42 giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45 that there is no warranty for this free software. For both users' and
46 authors' sake, the GPL requires that modified versions be marked as
47 changed, so that their problems will not be attributed erroneously to
48 authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51 modified versions of the software inside them, although the manufacturer
52 can do so. This is fundamentally incompatible with the aim of
53 protecting users' freedom to change the software. The systematic
54 pattern of such abuse occurs in the area of products for individuals to
55 use, which is precisely where it is most unacceptable. Therefore, we
56 have designed this version of the GPL to prohibit the practice for those
57 products. If such problems arise substantially in other domains, we
58 stand ready to extend this provision to those domains in future versions
59 of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62 States should not allow patents to restrict development and use of
63 software on general-purpose computers, but in those that do, we wish to
64 avoid the special danger that patents applied to a free program could
65 make it effectively proprietary. To prevent this, the GPL assures that
66 patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69 modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78 works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81 License. Each licensee is addressed as "you". "Licensees" and
82 "recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85 in a fashion requiring copyright permission, other than the making of an
86 exact copy. The resulting work is called a "modified version" of the
87 earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90 on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93 permission, would make you directly or secondarily liable for
94 infringement under applicable copyright law, except executing it on a
95 computer or modifying a private copy. Propagation includes copying,
96 distribution (with or without modification), making available to the
97 public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100 parties to make or receive copies. Mere interaction with a user through
101 a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104 to the extent that it includes a convenient and prominently visible
105 feature that (1) displays an appropriate copyright notice, and (2)
106 tells the user that there is no warranty for the work (except to the
107 extent that warranties are provided), that licensees may convey the
108 work under this License, and how to view a copy of this License. If
109 the interface presents a list of user commands or options, such as a
110 menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115 for making modifications to it. "Object code" means any non-source
116 form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119 standard defined by a recognized standards body, or, in the case of
120 interfaces specified for a particular programming language, one that
121 is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124 than the work as a whole, that (a) is included in the normal form of
125 packaging a Major Component, but which is not part of that Major
126 Component, and (b) serves only to enable use of the work with that
127 Major Component, or to implement a Standard Interface for which an
128 implementation is available to the public in source code form. A
129 "Major Component", in this context, means a major essential component
130 (kernel, window system, and so on) of the specific operating system
131 (if any) on which the executable work runs, or a compiler used to
132 produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135 the source code needed to generate, install, and (for an executable
136 work) run the object code and to modify the work, including scripts to
137 control those activities. However, it does not include the work's
138 System Libraries, or general-purpose tools or generally available free
139 programs which are used unmodified in performing those activities but
140 which are not part of the work. For example, Corresponding Source
141 includes interface definition files associated with source files for
142 the work, and the source code for shared libraries and dynamically
143 linked subprograms that the work is specifically designed to require,
144 such as by intimate data communication or control flow between those
145 subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148 can regenerate automatically from other parts of the Corresponding
149 Source.
150
151 The Corresponding Source for a work in source code form is that
152 same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157 copyright on the Program, and are irrevocable provided the stated
158 conditions are met. This License explicitly affirms your unlimited
159 permission to run the unmodified Program. The output from running a
160 covered work is covered by this License only if the output, given its
161 content, constitutes a covered work. This License acknowledges your
162 rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165 convey, without conditions so long as your license otherwise remains
166 in force. You may convey covered works to others for the sole purpose
167 of having them make modifications exclusively for you, or provide you
168 with facilities for running those works, provided that you comply with
169 the terms of this License in conveying all material for which you do
170 not control copyright. Those thus making or running the covered works
171 for you must do so exclusively on your behalf, under your direction
172 and control, on terms that prohibit them from making any copies of
173 your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176 the conditions stated below. Sublicensing is not allowed; section 10
177 makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182 measure under any applicable law fulfilling obligations under article
183 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 similar laws prohibiting or restricting circumvention of such
185 measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188 circumvention of technological measures to the extent such circumvention
189 is effected by exercising rights under this License with respect to
190 the covered work, and you disclaim any intention to limit operation or
191 modification of the work as a means of enforcing, against the work's
192 users, your or third parties' legal rights to forbid circumvention of
193 technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198 receive it, in any medium, provided that you conspicuously and
199 appropriately publish on each copy an appropriate copyright notice;
200 keep intact all notices stating that this License and any
201 non-permissive terms added in accord with section 7 apply to the code;
202 keep intact all notices of the absence of any warranty; and give all
203 recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206 and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211 produce it from the Program, in the form of source code under the
212 terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236 works, which are not by their nature extensions of the covered work,
237 and which are not combined with it such as to form a larger program,
238 in or on a volume of a storage or distribution medium, is called an
239 "aggregate" if the compilation and its resulting copyright are not
240 used to limit the access or legal rights of the compilation's users
241 beyond what the individual works permit. Inclusion of a covered work
242 in an aggregate does not cause this License to apply to the other
243 parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248 of sections 4 and 5, provided that you also convey the
249 machine-readable Corresponding Source under the terms of this License,
250 in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294 from the Corresponding Source as a System Library, need not be
295 included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298 tangible personal property which is normally used for personal, family,
299 or household purposes, or (2) anything designed or sold for incorporation
300 into a dwelling. In determining whether a product is a consumer product,
301 doubtful cases shall be resolved in favor of coverage. For a particular
302 product received by a particular user, "normally used" refers to a
303 typical or common use of that class of product, regardless of the status
304 of the particular user or of the way in which the particular user
305 actually uses, or expects or is expected to use, the product. A product
306 is a consumer product regardless of whether the product has substantial
307 commercial, industrial or non-consumer uses, unless such uses represent
308 the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311 procedures, authorization keys, or other information required to install
312 and execute modified versions of a covered work in that User Product from
313 a modified version of its Corresponding Source. The information must
314 suffice to ensure that the continued functioning of the modified object
315 code is in no case prevented or interfered with solely because
316 modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319 specifically for use in, a User Product, and the conveying occurs as
320 part of a transaction in which the right of possession and use of the
321 User Product is transferred to the recipient in perpetuity or for a
322 fixed term (regardless of how the transaction is characterized), the
323 Corresponding Source conveyed under this section must be accompanied
324 by the Installation Information. But this requirement does not apply
325 if neither you nor any third party retains the ability to install
326 modified object code on the User Product (for example, the work has
327 been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330 requirement to continue to provide support service, warranty, or updates
331 for a work that has been modified or installed by the recipient, or for
332 the User Product in which it has been modified or installed. Access to a
333 network may be denied when the modification itself materially and
334 adversely affects the operation of the network or violates the rules and
335 protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338 in accord with this section must be in a format that is publicly
339 documented (and with an implementation available to the public in
340 source code form), and must require no special password or key for
341 unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346 License by making exceptions from one or more of its conditions.
347 Additional permissions that are applicable to the entire Program shall
348 be treated as though they were included in this License, to the extent
349 that they are valid under applicable law. If additional permissions
350 apply only to part of the Program, that part may be used separately
351 under those permissions, but the entire Program remains governed by
352 this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355 remove any additional permissions from that copy, or from any part of
356 it. (Additional permissions may be written to require their own
357 removal in certain cases when you modify the work.) You may place
358 additional permissions on material, added by you to a covered work,
359 for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362 add to a covered work, you may (if authorized by the copyright holders of
363 that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389 restrictions" within the meaning of section 10. If the Program as you
390 received it, or any part of it, contains a notice stating that it is
391 governed by this License along with a term that is a further
392 restriction, you may remove that term. If a license document contains
393 a further restriction but permits relicensing or conveying under this
394 License, you may add to a covered work material governed by the terms
395 of that license document, provided that the further restriction does
396 not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399 must place, in the relevant source files, a statement of the
400 additional terms that apply to those files, or a notice indicating
401 where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404 form of a separately written license, or stated as exceptions;
405 the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410 provided under this License. Any attempt otherwise to propagate or
411 modify it is void, and will automatically terminate your rights under
412 this License (including any patent licenses granted under the third
413 paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416 license from a particular copyright holder is reinstated (a)
417 provisionally, unless and until the copyright holder explicitly and
418 finally terminates your license, and (b) permanently, if the copyright
419 holder fails to notify you of the violation by some reasonable means
420 prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423 reinstated permanently if the copyright holder notifies you of the
424 violation by some reasonable means, this is the first time you have
425 received notice of violation of this License (for any work) from that
426 copyright holder, and you cure the violation prior to 30 days after
427 your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430 licenses of parties who have received copies or rights from you under
431 this License. If your rights have been terminated and not permanently
432 reinstated, you do not qualify to receive new licenses for the same
433 material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438 run a copy of the Program. Ancillary propagation of a covered work
439 occurring solely as a consequence of using peer-to-peer transmission
440 to receive a copy likewise does not require acceptance. However,
441 nothing other than this License grants you permission to propagate or
442 modify any covered work. These actions infringe copyright if you do
443 not accept this License. Therefore, by modifying or propagating a
444 covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449 receives a license from the original licensors, to run, modify and
450 propagate that work, subject to this License. You are not responsible
451 for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454 organization, or substantially all assets of one, or subdividing an
455 organization, or merging organizations. If propagation of a covered
456 work results from an entity transaction, each party to that
457 transaction who receives a copy of the work also receives whatever
458 licenses to the work the party's predecessor in interest had or could
459 give under the previous paragraph, plus a right to possession of the
460 Corresponding Source of the work from the predecessor in interest, if
461 the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464 rights granted or affirmed under this License. For example, you may
465 not impose a license fee, royalty, or other charge for exercise of
466 rights granted under this License, and you may not initiate litigation
467 (including a cross-claim or counterclaim in a lawsuit) alleging that
468 any patent claim is infringed by making, using, selling, offering for
469 sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474 License of the Program or a work on which the Program is based. The
475 work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478 owned or controlled by the contributor, whether already acquired or
479 hereafter acquired, that would be infringed by some manner, permitted
480 by this License, of making, using, or selling its contributor version,
481 but do not include claims that would be infringed only as a
482 consequence of further modification of the contributor version. For
483 purposes of this definition, "control" includes the right to grant
484 patent sublicenses in a manner consistent with the requirements of
485 this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488 patent license under the contributor's essential patent claims, to
489 make, use, sell, offer for sale, import and otherwise run, modify and
490 propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493 agreement or commitment, however denominated, not to enforce a patent
494 (such as an express permission to practice a patent or covenant not to
495 sue for patent infringement). To "grant" such a patent license to a
496 party means to make such an agreement or commitment not to enforce a
497 patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500 and the Corresponding Source of the work is not available for anyone
501 to copy, free of charge and under the terms of this License, through a
502 publicly available network server or other readily accessible means,
503 then you must either (1) cause the Corresponding Source to be so
504 available, or (2) arrange to deprive yourself of the benefit of the
505 patent license for this particular work, or (3) arrange, in a manner
506 consistent with the requirements of this License, to extend the patent
507 license to downstream recipients. "Knowingly relying" means you have
508 actual knowledge that, but for the patent license, your conveying the
509 covered work in a country, or your recipient's use of the covered work
510 in a country, would infringe one or more identifiable patents in that
511 country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514 arrangement, you convey, or propagate by procuring conveyance of, a
515 covered work, and grant a patent license to some of the parties
516 receiving the covered work authorizing them to use, propagate, modify
517 or convey a specific copy of the covered work, then the patent license
518 you grant is automatically extended to all recipients of the covered
519 work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522 the scope of its coverage, prohibits the exercise of, or is
523 conditioned on the non-exercise of one or more of the rights that are
524 specifically granted under this License. You may not convey a covered
525 work if you are a party to an arrangement with a third party that is
526 in the business of distributing software, under which you make payment
527 to the third party based on the extent of your activity of conveying
528 the work, and under which the third party grants, to any of the
529 parties who would receive the covered work from you, a discriminatory
530 patent license (a) in connection with copies of the covered work
531 conveyed by you (or copies made from those copies), or (b) primarily
532 for and in connection with specific products or compilations that
533 contain the covered work, unless you entered into that arrangement,
534 or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537 any implied license or other defenses to infringement that may
538 otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543 otherwise) that contradict the conditions of this License, they do not
544 excuse you from the conditions of this License. If you cannot convey a
545 covered work so as to satisfy simultaneously your obligations under this
546 License and any other pertinent obligations, then as a consequence you may
547 not convey it at all. For example, if you agree to terms that obligate you
548 to collect a royalty for further conveying from those to whom you convey
549 the Program, the only way you could satisfy both those terms and this
550 License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555 permission to link or combine any covered work with a work licensed
556 under version 3 of the GNU Affero General Public License into a single
557 combined work, and to convey the resulting work. The terms of this
558 License will continue to apply to the part which is the covered work,
559 but the special requirements of the GNU Affero General Public License,
560 section 13, concerning interaction through a network will apply to the
561 combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566 the GNU General Public License from time to time. Such new versions will
567 be similar in spirit to the present version, but may differ in detail to
568 address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571 Program specifies that a certain numbered version of the GNU General
572 Public License "or any later version" applies to it, you have the
573 option of following the terms and conditions either of that numbered
574 version or of any later version published by the Free Software
575 Foundation. If the Program does not specify a version number of the
576 GNU General Public License, you may choose any version ever published
577 by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580 versions of the GNU General Public License can be used, that proxy's
581 public statement of acceptance of a version permanently authorizes you
582 to choose that version for the Program.
583
584 Later license versions may give you additional or different
585 permissions. However, no additional obligations are imposed on any
586 author or copyright holder as a result of your choosing to follow a
587 later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615 above cannot be given local legal effect according to their terms,
616 reviewing courts shall apply local law that most closely approximates
617 an absolute waiver of all civil liability in connection with the
618 Program, unless a warranty or assumption of liability accompanies a
619 copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626 possible use to the public, the best way to achieve this is to make it
627 free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630 to attach them to the start of each source file to most effectively
631 state the exclusion of warranty; and each file should have at least
632 the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650 Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653 notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660 The hypothetical commands `show w' and `show c' should show the appropriate
661 parts of the General Public License. Of course, your program's commands
662 might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665 if any, to sign a "copyright disclaimer" for the program, if necessary.
666 For more information on this, and how to apply and follow the GNU GPL, see
667 <http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670 into proprietary programs. If your program is a subroutine library, you
671 may consider it more useful to permit linking proprietary applications with
672 the library. If this is what you want to do, use the GNU Lesser General
673 Public License instead of this License. But first, please read
674 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
@@ -0,0 +1,76
1 2010-05-28 Daniel Elstner <danielk@openismus.com>
2
3 Move central header file to top-level directory
4
5 * example.h: Rename from example/example.h, so that the location in
6 in the source directory hierarchy matches the relative installation
7 location. Also, moving the file allows for example.h to be included
8 from code within the source tree.
9 * Makefile.am (nobase_example_include_HEADERS): Adjust list of header
10 files accordingly.
11
12 2010-05-28 Daniel Elstner <danielk@openismus.com>
13
14 Update and clean configure.ac
15
16 * configure.ac (AC_INIT): Also provide the home page argument.
17 (AC_PREREQ): Add minimum Autoconf version requirement, as a generally
18 good habit.
19 (AM_INIT_AUTOMAKE): Add minimum version and the no-define option to
20 the argument list, also because it's generally a good habit to do so.
21 Remove the subdir-objects option, as it is now defined directly in the
22 Makefile.am file.
23 (AC_CONFIG_HEADERS): Generate two configuration headers; one for the
24 build itself with an autogenerated template, and a second one which
25 will be installed alongside the library.
26 (AC_PROG_CXX_C_O): Remove call. Checking for -c -o support is only
27 required for the C compiler, and then the Automake-specific macro
28 AM_PROG_CC_C_O must be used.
29 (AC_PROG_INSTALL): Remove check, as Automake should take care of that
30 by itself if needed.
31 (EXAMPLE_FULL_NAME): Remove redundant substitution.
32 (AC_CONFIG_FILES): Substitute the API version into the filename of the
33 generated .pc file from a variable, and override the template filename
34 to not include the version number.
35 * example.pc.in: Rename from example-1.0.pc.in. Adjust substitutions
36 to changes in configure.ac.
37 * exampleconfig.h.in: New header file template. Empty for now; a good
38 usage example still needs to be provided.
39
40 2010-05-28 Daniel Elstner <danielk@openismus.com>
41
42 Update and heavily comment Makefile.am
43
44 * Makefile.am (AUTOMAKE_OPTIONS): Set the subdir-objects option here,
45 in order to make the file self-contained. It is also one of the few
46 options which can reasonably be used on a per-directory basis.
47 (ACLOCAL_AMFLAGS): Set variable to ${ACLOCAL_FLAGS}, similar to what
48 we do in the build files of the GNOME C++ binding modules. I want it
49 to become a widely used pattern.
50 (nobase_example_include_HEADERS): Combine all header files into one
51 list and use the nobase_ prefix.
52 (nodist_example_libinclude_HEADERS): The installed configuration
53 header file should never be the fully auto-generated config.h file!
54 That one is for the build itself only, and installing it causes
55 serious breakage if anyone ever tries to actually use it. Installing
56 it with the name config.h makes it even worse. Use a separate file
57 with a manually edited template instead.
58
59 2010-05-28 Daniel Elstner <danielk@openismus.com>
60
61 Simplify autogen.sh
62
63 * autogen.sh: Remove the sub-shell and pass the source directory to
64 autoreconf as command line argument. Also enable verbose output.
65
66 0.4:
67
68 2010-04-30 David King <davidk@openismus.com>
69
70 Major rewrite
71
72 0.3:
73
74 2002-01-21 Murray Cumming <murrayc@usa.net>
75
76 * Now uses pkg-config.
@@ -0,0 +1,5
1 AUTOMAKE_OPTIONS = subdir-objects
2 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
3 SUBDIRS = src
4
5 dist_noinst_SCRIPTS = autogen.sh
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
@@ -0,0 +1,6
1 #!/bin/sh -e
2 test -n "$srcdir" || srcdir=`dirname "$0"`
3 test -n "$srcdir" || srcdir=.
4
5 autoreconf --force --install --verbose "$srcdir"
6 test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
@@ -0,0 +1,52
1 /* config.h.in. Generated from configure.ac by autoheader. */
2
3 /* Define to 1 if you have the <dlfcn.h> header file. */
4 #undef HAVE_DLFCN_H
5
6 /* Define to 1 if you have the <inttypes.h> header file. */
7 #undef HAVE_INTTYPES_H
8
9 /* Define to 1 if you have the <memory.h> header file. */
10 #undef HAVE_MEMORY_H
11
12 /* Define to 1 if you have the <stdint.h> header file. */
13 #undef HAVE_STDINT_H
14
15 /* Define to 1 if you have the <stdlib.h> header file. */
16 #undef HAVE_STDLIB_H
17
18 /* Define to 1 if you have the <strings.h> header file. */
19 #undef HAVE_STRINGS_H
20
21 /* Define to 1 if you have the <string.h> header file. */
22 #undef HAVE_STRING_H
23
24 /* Define to 1 if you have the <sys/stat.h> header file. */
25 #undef HAVE_SYS_STAT_H
26
27 /* Define to 1 if you have the <sys/types.h> header file. */
28 #undef HAVE_SYS_TYPES_H
29
30 /* Define to 1 if you have the <termios.h> header file. */
31 #undef HAVE_TERMIOS_H
32
33 /* Define to 1 if you have the <unistd.h> header file. */
34 #undef HAVE_UNISTD_H
35
36 /* Define to the address where bug reports for this package should be sent. */
37 #undef PACKAGE_BUGREPORT
38
39 /* Define to the full name of this package. */
40 #undef PACKAGE_NAME
41
42 /* Define to the full name and version of this package. */
43 #undef PACKAGE_STRING
44
45 /* Define to the one symbol short name of this package. */
46 #undef PACKAGE_TARNAME
47
48 /* Define to the version of this package. */
49 #undef PACKAGE_VERSION
50
51 /* Define to 1 if you have the ANSI C header files. */
52 #undef STDC_HEADERS
@@ -0,0 +1,27
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.63])
4 AC_INIT([librs232], [0.1.0], [alexis.jeandet@lpp.polytechnique.fr],[rs232],[http://www.lpp.fr])
5 AM_INIT_AUTOMAKE([1.10 -Wall no-define])
6
7 # Checks for programs.
8 AC_CONFIG_HEADERS([config.h])
9 AC_PROG_CC
10
11 AC_PROG_LIBTOOL
12 LT_INIT
13 #AC_PROG_MAKE_SET
14
15 # Checks for libraries.
16
17 # Checks for header files.
18 AC_CHECK_HEADERS([string.h termios.h unistd.h])
19
20 AC_SUBST([RS232_SO_VERSION], [1:2:0])
21 AC_SUBST([RS232_API_VERSION], [1.0])
22 # Checks for typedefs, structures, and compiler characteristics.
23
24 # Checks for library functions.
25 AC_CONFIG_FILES([Makefile src/Makefile rs232-${RS232_API_VERSION}.pc:rs232.pc.in])
26
27 AC_OUTPUT
This diff has been collapsed as it changes many lines, (5794 lines changed) Show them Hide them
@@ -0,0 +1,5794
1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
3 #
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
30 shift
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
33 :
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
36 :
37 else
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
40 fi
41
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
44 shift
45 cat <<EOF
46 $*
47 EOF
48 exit 0
49 fi
50
51 # The name of this program.
52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
53 modename="$progname"
54
55 # Constants.
56 PROGRAM=ltmain.sh
57 PACKAGE=libtool
58 VERSION=1.4e
59 TIMESTAMP=" (1.1162 2002/11/22 22:36:25)"
60
61 default_mode=
62 help="Try \`$progname --help' for more information."
63 magic="%%%MAGIC variable%%%"
64 mkdir="mkdir"
65 mv="mv -f"
66 rm="rm -f"
67
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
70 Xsed="${SED}"' -e 1s/^X//'
71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 # test EBCDIC or ASCII
73 case `echo A|od -x` in
74 *[Cc]1*) # EBCDIC based system
75 SP2NL="tr '\100' '\n'"
76 NL2SP="tr '\r\n' '\100\100'"
77 ;;
78 *) # Assume ASCII based system
79 SP2NL="tr '\040' '\012'"
80 NL2SP="tr '\015\012' '\040\040'"
81 ;;
82 esac
83
84 # NLS nuisances.
85 # Only set LANG and LC_ALL to C if already set.
86 # These must not be set unconditionally because not all systems understand
87 # e.g. LANG=C (notably SCO).
88 # We save the old values to restore during execute mode.
89 if test "${LC_ALL+set}" = set; then
90 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
91 fi
92 if test "${LANG+set}" = set; then
93 save_LANG="$LANG"; LANG=C; export LANG
94 fi
95
96 # Make sure IFS has a sensible default
97 : ${IFS=" "}
98
99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
100 echo "$modename: not configured to build any kind of library" 1>&2
101 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
102 exit 1
103 fi
104
105 # Global variables.
106 mode=$default_mode
107 nonopt=
108 prev=
109 prevopt=
110 run=
111 show="$echo"
112 show_help=
113 execute_dlfiles=
114 lo2o="s/\\.lo\$/.${objext}/"
115 o2lo="s/\\.${objext}\$/.lo/"
116
117 #####################################
118 # Shell function definitions:
119 # This seems to be the best place for them
120
121 # Need a lot of goo to handle *both* DLLs and import libs
122 # Has to be a shell function in order to 'eat' the argument
123 # that is supplied when $file_magic_command is called.
124 win32_libid () {
125 win32_libid_type="unknown"
126 if eval $OBJDUMP -f $1 2>/dev/null | \
127 grep -E 'file format pei+-i386(.*architecture: i386)?' >/dev/null ; then
128 win32_libid_type="x86 DLL"
129 else
130 if eval $OBJDUMP -f $1 2>/dev/null | \
131 grep -E 'file format pei*-i386(.*architecture: i386)?' >/dev/null ; then
132 win32_libid_type="x86"
133 if eval file $1 2>/dev/null | \
134 grep -E 'ar archive' >/dev/null; then
135 win32_libid_type="$win32_libid_type archive"
136 if eval $NM -f posix -A $1 | awk '{print $3}' | grep "I" >/dev/null ; then
137 win32_libid_type="$win32_libid_type import"
138 else
139 win32_libid_type="$win32_libid_type static"
140 fi
141 fi
142 fi
143 fi
144 echo $win32_libid_type
145 }
146
147 # End of Shell function definitions
148 #####################################
149
150
151 # Parse our command line options once, thoroughly.
152 while test "$#" -gt 0
153 do
154 arg="$1"
155 shift
156
157 case $arg in
158 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
159 *) optarg= ;;
160 esac
161
162 # If the previous option needs an argument, assign it.
163 if test -n "$prev"; then
164 case $prev in
165 execute_dlfiles)
166 execute_dlfiles="$execute_dlfiles $arg"
167 ;;
168 tag)
169 tagname="$arg"
170
171 # Check whether tagname contains only valid characters
172 case $tagname in
173 *[!-_A-Za-z0-9,/]*)
174 echo "$progname: invalid tag name: $tagname" 1>&2
175 exit 1
176 ;;
177 esac
178
179 case $tagname in
180 CC)
181 # Don't test for the "default" C tag, as we know, it's there, but
182 # not specially marked.
183 ;;
184 *)
185 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
186 taglist="$taglist $tagname"
187 # Evaluate the configuration.
188 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
189 else
190 echo "$progname: ignoring unknown tag $tagname" 1>&2
191 fi
192 ;;
193 esac
194 ;;
195 *)
196 eval "$prev=\$arg"
197 ;;
198 esac
199
200 prev=
201 prevopt=
202 continue
203 fi
204
205 # Have we seen a non-optional argument yet?
206 case $arg in
207 --help)
208 show_help=yes
209 ;;
210
211 --version)
212 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
213 echo
214 echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
215 echo "Free Software Foundation, Inc."
216 echo "This is free software; see the source for copying conditions. There is NO"
217 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
218 exit 0
219 ;;
220
221 --config)
222 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
223 # Now print the configurations for the tags.
224 for tagname in $taglist; do
225 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
226 done
227 exit 0
228 ;;
229
230 --debug)
231 echo "$progname: enabling shell trace mode"
232 set -x
233 ;;
234
235 --dry-run | -n)
236 run=:
237 ;;
238
239 --features)
240 echo "host: $host"
241 if test "$build_libtool_libs" = yes; then
242 echo "enable shared libraries"
243 else
244 echo "disable shared libraries"
245 fi
246 if test "$build_old_libs" = yes; then
247 echo "enable static libraries"
248 else
249 echo "disable static libraries"
250 fi
251 exit 0
252 ;;
253
254 --finish) mode="finish" ;;
255
256 --mode) prevopt="--mode" prev=mode ;;
257 --mode=*) mode="$optarg" ;;
258
259 --preserve-dup-deps) duplicate_deps="yes" ;;
260
261 --quiet | --silent)
262 show=:
263 ;;
264
265 --tag) prevopt="--tag" prev=tag ;;
266 --tag=*)
267 set tag "$optarg" ${1+"$@"}
268 shift
269 prev=tag
270 ;;
271
272 -dlopen)
273 prevopt="-dlopen"
274 prev=execute_dlfiles
275 ;;
276
277 -*)
278 $echo "$modename: unrecognized option \`$arg'" 1>&2
279 $echo "$help" 1>&2
280 exit 1
281 ;;
282
283 *)
284 nonopt="$arg"
285 break
286 ;;
287 esac
288 done
289
290 if test -n "$prevopt"; then
291 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
292 $echo "$help" 1>&2
293 exit 1
294 fi
295
296 # If this variable is set in any of the actions, the command in it
297 # will be execed at the end. This prevents here-documents from being
298 # left over by shells.
299 exec_cmd=
300
301 if test -z "$show_help"; then
302
303 # Infer the operation mode.
304 if test -z "$mode"; then
305 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
306 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
307 case $nonopt in
308 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
309 mode=link
310 for arg
311 do
312 case $arg in
313 -c)
314 mode=compile
315 break
316 ;;
317 esac
318 done
319 ;;
320 *db | *dbx | *strace | *truss)
321 mode=execute
322 ;;
323 *install*|cp|mv)
324 mode=install
325 ;;
326 *rm)
327 mode=uninstall
328 ;;
329 *)
330 # If we have no mode, but dlfiles were specified, then do execute mode.
331 test -n "$execute_dlfiles" && mode=execute
332
333 # Just use the default operation mode.
334 if test -z "$mode"; then
335 if test -n "$nonopt"; then
336 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
337 else
338 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
339 fi
340 fi
341 ;;
342 esac
343 fi
344
345 # Only execute mode is allowed to have -dlopen flags.
346 if test -n "$execute_dlfiles" && test "$mode" != execute; then
347 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
348 $echo "$help" 1>&2
349 exit 1
350 fi
351
352 # Change the help message to a mode-specific one.
353 generic_help="$help"
354 help="Try \`$modename --help --mode=$mode' for more information."
355
356 # These modes are in order of execution frequency so that they run quickly.
357 case $mode in
358 # libtool compile mode
359 compile)
360 modename="$modename: compile"
361 # Get the compilation command and the source file.
362 base_compile=
363 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
364 suppress_output=
365 arg_mode=normal
366 libobj=
367
368 for arg
369 do
370 case "$arg_mode" in
371 arg )
372 # do not "continue". Instead, add this to base_compile
373 lastarg="$arg"
374 arg_mode=normal
375 ;;
376
377 target )
378 libobj="$arg"
379 arg_mode=normal
380 continue
381 ;;
382
383 normal )
384 # Accept any command-line options.
385 case $arg in
386 -o)
387 if test -n "$libobj" ; then
388 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
389 exit 1
390 fi
391 arg_mode=target
392 continue
393 ;;
394
395 -static)
396 build_old_libs=yes
397 continue
398 ;;
399
400 -prefer-pic)
401 pic_mode=yes
402 continue
403 ;;
404
405 -prefer-non-pic)
406 pic_mode=no
407 continue
408 ;;
409
410 -Xcompiler)
411 arg_mode=arg # the next one goes into the "base_compile" arg list
412 continue # The current "srcfile" will either be retained or
413 ;; # replaced later. I would guess that would be a bug.
414
415 -Wc,*)
416 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
417 lastarg=
418 save_ifs="$IFS"; IFS=','
419 for arg in $args; do
420 IFS="$save_ifs"
421
422 # Double-quote args containing other shell metacharacters.
423 # Many Bourne shells cannot handle close brackets correctly
424 # in scan sets, so we specify it separately.
425 case $arg in
426 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
427 arg="\"$arg\""
428 ;;
429 esac
430 lastarg="$lastarg $arg"
431 done
432 IFS="$save_ifs"
433 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
434
435 # Add the arguments to base_compile.
436 base_compile="$base_compile $lastarg"
437 continue
438 ;;
439
440 * )
441 # Accept the current argument as the source file.
442 # The previous "srcfile" becomes the current argument.
443 #
444 lastarg="$srcfile"
445 srcfile="$arg"
446 ;;
447 esac # case $arg
448 ;;
449 esac # case $arg_mode
450
451 # Aesthetically quote the previous argument.
452 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
453
454 case $lastarg in
455 # Double-quote args containing other shell metacharacters.
456 # Many Bourne shells cannot handle close brackets correctly
457 # in scan sets, so we specify it separately.
458 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
459 lastarg="\"$lastarg\""
460 ;;
461 esac
462
463 base_compile="$base_compile $lastarg"
464 done # for arg
465
466 case $arg_mode in
467 arg)
468 $echo "$modename: you must specify an argument for -Xcompile"
469 exit 1
470 ;;
471 target)
472 $echo "$modename: you must specify a target with \`-o'" 1>&2
473 exit 1
474 ;;
475 *)
476 # Get the name of the library object.
477 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
478 ;;
479 esac
480
481 # Recognize several different file suffixes.
482 # If the user specifies -o file.o, it is replaced with file.lo
483 xform='[cCFSifmso]'
484 case $libobj in
485 *.ada) xform=ada ;;
486 *.adb) xform=adb ;;
487 *.ads) xform=ads ;;
488 *.asm) xform=asm ;;
489 *.c++) xform=c++ ;;
490 *.cc) xform=cc ;;
491 *.ii) xform=ii ;;
492 *.class) xform=class ;;
493 *.cpp) xform=cpp ;;
494 *.cxx) xform=cxx ;;
495 *.f90) xform=f90 ;;
496 *.for) xform=for ;;
497 *.java) xform=java ;;
498 esac
499
500 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
501
502 case $libobj in
503 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
504 *)
505 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
506 exit 1
507 ;;
508 esac
509
510 # Infer tagged configuration to use if any are available and
511 # if one wasn't chosen via the "--tag" command line option.
512 # Only attempt this if the compiler in the base compile
513 # command doesn't match the default compiler.
514 if test -n "$available_tags" && test -z "$tagname"; then
515 case $base_compile in
516 # Blanks in the command may have been stripped by the calling shell,
517 # but not from the CC environment variable when configure was run.
518 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
519 # Blanks at the start of $base_compile will cause this to fail
520 # if we don't check for them as well.
521 *)
522 for z in $available_tags; do
523 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
524 # Evaluate the configuration.
525 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
526 case "$base_compile " in
527 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
528 # The compiler in the base compile command matches
529 # the one in the tagged configuration.
530 # Assume this is the tagged configuration we want.
531 tagname=$z
532 break
533 ;;
534 esac
535 fi
536 done
537 # If $tagname still isn't set, then no tagged configuration
538 # was found and let the user know that the "--tag" command
539 # line option must be used.
540 if test -z "$tagname"; then
541 echo "$modename: unable to infer tagged configuration"
542 echo "$modename: specify a tag with \`--tag'" 1>&2
543 exit 1
544 # else
545 # echo "$modename: using $tagname tagged configuration"
546 fi
547 ;;
548 esac
549 fi
550
551 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
552 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
553 if test "X$xdir" = "X$obj"; then
554 xdir=
555 else
556 xdir=$xdir/
557 fi
558 lobj=${xdir}$objdir/$objname
559
560 if test -z "$base_compile"; then
561 $echo "$modename: you must specify a compilation command" 1>&2
562 $echo "$help" 1>&2
563 exit 1
564 fi
565
566 # Delete any leftover library objects.
567 if test "$build_old_libs" = yes; then
568 removelist="$obj $lobj $libobj ${libobj}T"
569 else
570 removelist="$lobj $libobj ${libobj}T"
571 fi
572
573 $run $rm $removelist
574 trap "$run $rm $removelist; exit 1" 1 2 15
575
576 # On Cygwin there's no "real" PIC flag so we must build both object types
577 case $host_os in
578 cygwin* | mingw* | pw32* | os2*)
579 pic_mode=default
580 ;;
581 esac
582 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
583 # non-PIC code in shared libraries is not supported
584 pic_mode=default
585 fi
586
587 # Calculate the filename of the output object if compiler does
588 # not support -o with -c
589 if test "$compiler_c_o" = no; then
590 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
591 lockfile="$output_obj.lock"
592 removelist="$removelist $output_obj $lockfile"
593 trap "$run $rm $removelist; exit 1" 1 2 15
594 else
595 output_obj=
596 need_locks=no
597 lockfile=
598 fi
599
600 # Lock this critical section if it is needed
601 # We use this script file to make the link, it avoids creating a new file
602 if test "$need_locks" = yes; then
603 until $run ln "$0" "$lockfile" 2>/dev/null; do
604 $show "Waiting for $lockfile to be removed"
605 sleep 2
606 done
607 elif test "$need_locks" = warn; then
608 if test -f "$lockfile"; then
609 echo "\
610 *** ERROR, $lockfile exists and contains:
611 `cat $lockfile 2>/dev/null`
612
613 This indicates that another process is trying to use the same
614 temporary object file, and libtool could not work around it because
615 your compiler does not support \`-c' and \`-o' together. If you
616 repeat this compilation, it may succeed, by chance, but you had better
617 avoid parallel builds (make -j) in this platform, or get a better
618 compiler."
619
620 $run $rm $removelist
621 exit 1
622 fi
623 echo $srcfile > "$lockfile"
624 fi
625
626 if test -n "$fix_srcfile_path"; then
627 eval srcfile=\"$fix_srcfile_path\"
628 fi
629
630 $run $rm "$libobj" "${libobj}T"
631
632 # Create a libtool object file (analogous to a ".la" file),
633 # but don't create it if we're doing a dry run.
634 test -z "$run" && cat > ${libobj}T <<EOF
635 # $libobj - a libtool object file
636 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
637 #
638 # Please DO NOT delete this file!
639 # It is necessary for linking the library.
640
641 # Name of the PIC object.
642 EOF
643
644 # Only build a PIC object if we are building libtool libraries.
645 if test "$build_libtool_libs" = yes; then
646 # Without this assignment, base_compile gets emptied.
647 fbsd_hideous_sh_bug=$base_compile
648
649 if test "$pic_mode" != no; then
650 command="$base_compile $srcfile $pic_flag"
651 else
652 # Don't build PIC code
653 command="$base_compile $srcfile"
654 fi
655
656 if test ! -d "${xdir}$objdir"; then
657 $show "$mkdir ${xdir}$objdir"
658 $run $mkdir ${xdir}$objdir
659 status=$?
660 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
661 exit $status
662 fi
663 fi
664
665 if test -z "$output_obj"; then
666 # Place PIC objects in $objdir
667 command="$command -o $lobj"
668 fi
669
670 $run $rm "$lobj" "$output_obj"
671
672 $show "$command"
673 if $run eval "$command"; then :
674 else
675 test -n "$output_obj" && $run $rm $removelist
676 exit 1
677 fi
678
679 if test "$need_locks" = warn &&
680 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
681 echo "\
682 *** ERROR, $lockfile contains:
683 `cat $lockfile 2>/dev/null`
684
685 but it should contain:
686 $srcfile
687
688 This indicates that another process is trying to use the same
689 temporary object file, and libtool could not work around it because
690 your compiler does not support \`-c' and \`-o' together. If you
691 repeat this compilation, it may succeed, by chance, but you had better
692 avoid parallel builds (make -j) in this platform, or get a better
693 compiler."
694
695 $run $rm $removelist
696 exit 1
697 fi
698
699 # Just move the object if needed, then go on to compile the next one
700 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
701 $show "$mv $output_obj $lobj"
702 if $run $mv $output_obj $lobj; then :
703 else
704 error=$?
705 $run $rm $removelist
706 exit $error
707 fi
708 fi
709
710 # Append the name of the PIC object to the libtool object file.
711 test -z "$run" && cat >> ${libobj}T <<EOF
712 pic_object='$objdir/$objname'
713
714 EOF
715
716 # Allow error messages only from the first compilation.
717 suppress_output=' >/dev/null 2>&1'
718 else
719 # No PIC object so indicate it doesn't exist in the libtool
720 # object file.
721 test -z "$run" && cat >> ${libobj}T <<EOF
722 pic_object=none
723
724 EOF
725 fi
726
727 # Only build a position-dependent object if we build old libraries.
728 if test "$build_old_libs" = yes; then
729 if test "$pic_mode" != yes; then
730 # Don't build PIC code
731 command="$base_compile $srcfile"
732 else
733 command="$base_compile $srcfile $pic_flag"
734 fi
735 if test "$compiler_c_o" = yes; then
736 command="$command -o $obj"
737 fi
738
739 # Suppress compiler output if we already did a PIC compilation.
740 command="$command$suppress_output"
741 $run $rm "$obj" "$output_obj"
742 $show "$command"
743 if $run eval "$command"; then :
744 else
745 $run $rm $removelist
746 exit 1
747 fi
748
749 if test "$need_locks" = warn &&
750 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
751 echo "\
752 *** ERROR, $lockfile contains:
753 `cat $lockfile 2>/dev/null`
754
755 but it should contain:
756 $srcfile
757
758 This indicates that another process is trying to use the same
759 temporary object file, and libtool could not work around it because
760 your compiler does not support \`-c' and \`-o' together. If you
761 repeat this compilation, it may succeed, by chance, but you had better
762 avoid parallel builds (make -j) in this platform, or get a better
763 compiler."
764
765 $run $rm $removelist
766 exit 1
767 fi
768
769 # Just move the object if needed
770 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
771 $show "$mv $output_obj $obj"
772 if $run $mv $output_obj $obj; then :
773 else
774 error=$?
775 $run $rm $removelist
776 exit $error
777 fi
778 fi
779
780 # Append the name of the non-PIC object the libtool object file.
781 # Only append if the libtool object file exists.
782 test -z "$run" && cat >> ${libobj}T <<EOF
783 # Name of the non-PIC object.
784 non_pic_object='$objname'
785
786 EOF
787 else
788 # Append the name of the non-PIC object the libtool object file.
789 # Only append if the libtool object file exists.
790 test -z "$run" && cat >> ${libobj}T <<EOF
791 # Name of the non-PIC object.
792 non_pic_object=none
793
794 EOF
795 fi
796
797 $run $mv "${libobj}T" "${libobj}"
798
799 # Unlock the critical section if it was locked
800 if test "$need_locks" != no; then
801 $run $rm "$lockfile"
802 fi
803
804 exit 0
805 ;;
806
807 # libtool link mode
808 link | relink)
809 modename="$modename: link"
810 case $host in
811 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
812 # It is impossible to link a dll without this setting, and
813 # we shouldn't force the makefile maintainer to figure out
814 # which system we are compiling for in order to pass an extra
815 # flag for every libtool invocation.
816 # allow_undefined=no
817
818 # FIXME: Unfortunately, there are problems with the above when trying
819 # to make a dll which has undefined symbols, in which case not
820 # even a static library is built. For now, we need to specify
821 # -no-undefined on the libtool link line when we can be certain
822 # that all symbols are satisfied, otherwise we get a static library.
823 allow_undefined=yes
824 ;;
825 *)
826 allow_undefined=yes
827 ;;
828 esac
829 libtool_args="$nonopt"
830 base_compile="$nonopt"
831 compile_command="$nonopt"
832 finalize_command="$nonopt"
833
834 compile_rpath=
835 finalize_rpath=
836 compile_shlibpath=
837 finalize_shlibpath=
838 convenience=
839 old_convenience=
840 deplibs=
841 old_deplibs=
842 compiler_flags=
843 linker_flags=
844 dllsearchpath=
845 lib_search_path=`pwd`
846 inst_prefix_dir=
847
848 avoid_version=no
849 dlfiles=
850 dlprefiles=
851 dlself=no
852 export_dynamic=no
853 export_symbols=
854 export_symbols_regex=
855 generated=
856 libobjs=
857 ltlibs=
858 module=no
859 no_install=no
860 objs=
861 non_pic_objects=
862 prefer_static_libs=no
863 preload=no
864 prev=
865 prevarg=
866 release=
867 rpath=
868 xrpath=
869 perm_rpath=
870 temp_rpath=
871 thread_safe=no
872 vinfo=
873
874 # We need to know -static, to get the right output filenames.
875 for arg
876 do
877 case $arg in
878 -all-static | -static)
879 if test "X$arg" = "X-all-static"; then
880 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
881 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
882 fi
883 if test -n "$link_static_flag"; then
884 dlopen_self=$dlopen_self_static
885 fi
886 else
887 if test -z "$pic_flag" && test -n "$link_static_flag"; then
888 dlopen_self=$dlopen_self_static
889 fi
890 fi
891 build_libtool_libs=no
892 build_old_libs=yes
893 prefer_static_libs=yes
894 break
895 ;;
896 esac
897 done
898
899 # See if our shared archives depend on static archives.
900 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
901
902 # Go through the arguments, transforming them on the way.
903 while test "$#" -gt 0; do
904 arg="$1"
905 base_compile="$base_compile $arg"
906 shift
907 case $arg in
908 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
909 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
910 ;;
911 *) qarg=$arg ;;
912 esac
913 libtool_args="$libtool_args $qarg"
914
915 # If the previous option needs an argument, assign it.
916 if test -n "$prev"; then
917 case $prev in
918 output)
919 compile_command="$compile_command @OUTPUT@"
920 finalize_command="$finalize_command @OUTPUT@"
921 ;;
922 esac
923
924 case $prev in
925 dlfiles|dlprefiles)
926 if test "$preload" = no; then
927 # Add the symbol object into the linking commands.
928 compile_command="$compile_command @SYMFILE@"
929 finalize_command="$finalize_command @SYMFILE@"
930 preload=yes
931 fi
932 case $arg in
933 *.la | *.lo) ;; # We handle these cases below.
934 force)
935 if test "$dlself" = no; then
936 dlself=needless
937 export_dynamic=yes
938 fi
939 prev=
940 continue
941 ;;
942 self)
943 if test "$prev" = dlprefiles; then
944 dlself=yes
945 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
946 dlself=yes
947 else
948 dlself=needless
949 export_dynamic=yes
950 fi
951 prev=
952 continue
953 ;;
954 *)
955 if test "$prev" = dlfiles; then
956 dlfiles="$dlfiles $arg"
957 else
958 dlprefiles="$dlprefiles $arg"
959 fi
960 prev=
961 continue
962 ;;
963 esac
964 ;;
965 expsyms)
966 export_symbols="$arg"
967 if test ! -f "$arg"; then
968 $echo "$modename: symbol file \`$arg' does not exist"
969 exit 1
970 fi
971 prev=
972 continue
973 ;;
974 expsyms_regex)
975 export_symbols_regex="$arg"
976 prev=
977 continue
978 ;;
979 inst_prefix)
980 inst_prefix_dir="$arg"
981 prev=
982 continue
983 ;;
984 release)
985 release="-$arg"
986 prev=
987 continue
988 ;;
989 objectlist)
990 if test -f "$arg"; then
991 save_arg=$arg
992 moreargs=
993 for fil in `cat $save_arg`
994 do
995 # moreargs="$moreargs $fil"
996 arg=$fil
997 # A libtool-controlled object.
998
999 # Check to see that this really is a libtool object.
1000 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1001 pic_object=
1002 non_pic_object=
1003
1004 # Read the .lo file
1005 # If there is no directory component, then add one.
1006 case $arg in
1007 */* | *\\*) . $arg ;;
1008 *) . ./$arg ;;
1009 esac
1010
1011 if test -z "$pic_object" || \
1012 test -z "$non_pic_object" ||
1013 test "$pic_object" = none && \
1014 test "$non_pic_object" = none; then
1015 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1016 exit 1
1017 fi
1018
1019 # Extract subdirectory from the argument.
1020 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1021 if test "X$xdir" = "X$arg"; then
1022 xdir=
1023 else
1024 xdir="$xdir/"
1025 fi
1026
1027 if test "$pic_object" != none; then
1028 # Prepend the subdirectory the object is found in.
1029 pic_object="$xdir$pic_object"
1030
1031 if test "$prev" = dlfiles; then
1032 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1033 dlfiles="$dlfiles $pic_object"
1034 prev=
1035 continue
1036 else
1037 # If libtool objects are unsupported, then we need to preload.
1038 prev=dlprefiles
1039 fi
1040 fi
1041
1042 # CHECK ME: I think I busted this. -Ossama
1043 if test "$prev" = dlprefiles; then
1044 # Preload the old-style object.
1045 dlprefiles="$dlprefiles $pic_object"
1046 prev=
1047 fi
1048
1049 # A PIC object.
1050 libobjs="$libobjs $pic_object"
1051 arg="$pic_object"
1052 fi
1053
1054 # Non-PIC object.
1055 if test "$non_pic_object" != none; then
1056 # Prepend the subdirectory the object is found in.
1057 non_pic_object="$xdir$non_pic_object"
1058
1059 # A standard non-PIC object
1060 non_pic_objects="$non_pic_objects $non_pic_object"
1061 if test -z "$pic_object" || test "$pic_object" = none ; then
1062 arg="$non_pic_object"
1063 fi
1064 fi
1065 else
1066 # Only an error if not doing a dry-run.
1067 if test -z "$run"; then
1068 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1069 exit 1
1070 else
1071 # Dry-run case.
1072
1073 # Extract subdirectory from the argument.
1074 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1075 if test "X$xdir" = "X$arg"; then
1076 xdir=
1077 else
1078 xdir="$xdir/"
1079 fi
1080
1081 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1082 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1083 libobjs="$libobjs $pic_object"
1084 non_pic_objects="$non_pic_objects $non_pic_object"
1085 fi
1086 fi
1087 done
1088 else
1089 $echo "$modename: link input file \`$save_arg' does not exist"
1090 exit 1
1091 fi
1092 arg=$save_arg
1093 prev=
1094 continue
1095 ;;
1096 rpath | xrpath)
1097 # We need an absolute path.
1098 case $arg in
1099 [\\/]* | [A-Za-z]:[\\/]*) ;;
1100 *)
1101 $echo "$modename: only absolute run-paths are allowed" 1>&2
1102 exit 1
1103 ;;
1104 esac
1105 if test "$prev" = rpath; then
1106 case "$rpath " in
1107 *" $arg "*) ;;
1108 *) rpath="$rpath $arg" ;;
1109 esac
1110 else
1111 case "$xrpath " in
1112 *" $arg "*) ;;
1113 *) xrpath="$xrpath $arg" ;;
1114 esac
1115 fi
1116 prev=
1117 continue
1118 ;;
1119 xcompiler)
1120 compiler_flags="$compiler_flags $qarg"
1121 prev=
1122 compile_command="$compile_command $qarg"
1123 finalize_command="$finalize_command $qarg"
1124 continue
1125 ;;
1126 xlinker)
1127 linker_flags="$linker_flags $qarg"
1128 compiler_flags="$compiler_flags $wl$qarg"
1129 prev=
1130 compile_command="$compile_command $wl$qarg"
1131 finalize_command="$finalize_command $wl$qarg"
1132 continue
1133 ;;
1134 xcclinker)
1135 linker_flags="$linker_flags $qarg"
1136 compiler_flags="$compiler_flags $qarg"
1137 prev=
1138 compile_command="$compile_command $qarg"
1139 finalize_command="$finalize_command $qarg"
1140 continue
1141 ;;
1142 *)
1143 eval "$prev=\"\$arg\""
1144 prev=
1145 continue
1146 ;;
1147 esac
1148 fi # test -n "$prev"
1149
1150 prevarg="$arg"
1151
1152 case $arg in
1153 -all-static)
1154 if test -n "$link_static_flag"; then
1155 compile_command="$compile_command $link_static_flag"
1156 finalize_command="$finalize_command $link_static_flag"
1157 fi
1158 continue
1159 ;;
1160
1161 -allow-undefined)
1162 # FIXME: remove this flag sometime in the future.
1163 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1164 continue
1165 ;;
1166
1167 -avoid-version)
1168 avoid_version=yes
1169 continue
1170 ;;
1171
1172 -dlopen)
1173 prev=dlfiles
1174 continue
1175 ;;
1176
1177 -dlpreopen)
1178 prev=dlprefiles
1179 continue
1180 ;;
1181
1182 -export-dynamic)
1183 export_dynamic=yes
1184 continue
1185 ;;
1186
1187 -export-symbols | -export-symbols-regex)
1188 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1189 $echo "$modename: more than one -exported-symbols argument is not allowed"
1190 exit 1
1191 fi
1192 if test "X$arg" = "X-export-symbols"; then
1193 prev=expsyms
1194 else
1195 prev=expsyms_regex
1196 fi
1197 continue
1198 ;;
1199
1200 -inst-prefix-dir)
1201 prev=inst_prefix
1202 continue
1203 ;;
1204
1205 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1206 # so, if we see these flags be careful not to treat them like -L
1207 -L[A-Z][A-Z]*:*)
1208 case $with_gcc/$host in
1209 no/*-*-irix* | /*-*-irix*)
1210 compile_command="$compile_command $arg"
1211 finalize_command="$finalize_command $arg"
1212 ;;
1213 esac
1214 continue
1215 ;;
1216
1217 -L*)
1218 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1219 # We need an absolute path.
1220 case $dir in
1221 [\\/]* | [A-Za-z]:[\\/]*) ;;
1222 *)
1223 absdir=`cd "$dir" && pwd`
1224 if test -z "$absdir"; then
1225 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1226 exit 1
1227 fi
1228 dir="$absdir"
1229 ;;
1230 esac
1231 case "$deplibs " in
1232 *" -L$dir "*) ;;
1233 *)
1234 deplibs="$deplibs -L$dir"
1235 lib_search_path="$lib_search_path $dir"
1236 ;;
1237 esac
1238 case $host in
1239 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1240 case :$dllsearchpath: in
1241 *":$dir:"*) ;;
1242 *) dllsearchpath="$dllsearchpath:$dir";;
1243 esac
1244 ;;
1245 esac
1246 continue
1247 ;;
1248
1249 -l*)
1250 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1251 case $host in
1252 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1253 # These systems don't actually have a C or math library (as such)
1254 continue
1255 ;;
1256 *-*-mingw* | *-*-os2*)
1257 # These systems don't actually have a C library (as such)
1258 test "X$arg" = "X-lc" && continue
1259 ;;
1260 *-*-openbsd* | *-*-freebsd*)
1261 # Do not include libc due to us having libc/libc_r.
1262 test "X$arg" = "X-lc" && continue
1263 ;;
1264 *-*-rhapsody* | *-*-darwin1.[012])
1265 # Rhapsody C and math libraries are in the System framework
1266 deplibs="$deplibs -framework System"
1267 continue
1268 esac
1269 elif test "X$arg" = "X-lc_r"; then
1270 case $host in
1271 *-*-openbsd* | *-*-freebsd*)
1272 # Do not include libc_r directly, use -pthread flag.
1273 continue
1274 ;;
1275 esac
1276 fi
1277 deplibs="$deplibs $arg"
1278 continue
1279 ;;
1280
1281 -module)
1282 module=yes
1283 continue
1284 ;;
1285
1286 # gcc -m* arguments should be passed to the linker via $compiler_flags
1287 # in order to pass architecture information to the linker
1288 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1289 # but this is not reliable with gcc because gcc may use -mfoo to
1290 # select a different linker, different libraries, etc, while
1291 # -Wl,-mfoo simply passes -mfoo to the linker.
1292 -m*)
1293 # Unknown arguments in both finalize_command and compile_command need
1294 # to be aesthetically quoted because they are evaled later.
1295 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1296 case $arg in
1297 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1298 arg="\"$arg\""
1299 ;;
1300 esac
1301 compile_command="$compile_command $arg"
1302 finalize_command="$finalize_command $arg"
1303 if test "$with_gcc" = "yes" ; then
1304 compiler_flags="$compiler_flags $arg"
1305 fi
1306 continue
1307 ;;
1308
1309 -no-fast-install)
1310 fast_install=no
1311 continue
1312 ;;
1313
1314 -no-install)
1315 case $host in
1316 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1317 # The PATH hackery in wrapper scripts is required on Windows
1318 # in order for the loader to find any dlls it needs.
1319 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1320 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1321 fast_install=no
1322 ;;
1323 *) no_install=yes ;;
1324 esac
1325 continue
1326 ;;
1327
1328 -no-undefined)
1329 allow_undefined=no
1330 continue
1331 ;;
1332
1333 -objectlist)
1334 prev=objectlist
1335 continue
1336 ;;
1337
1338 -o) prev=output ;;
1339
1340 -release)
1341 prev=release
1342 continue
1343 ;;
1344
1345 -rpath)
1346 prev=rpath
1347 continue
1348 ;;
1349
1350 -R)
1351 prev=xrpath
1352 continue
1353 ;;
1354
1355 -R*)
1356 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1357 # We need an absolute path.
1358 case $dir in
1359 [\\/]* | [A-Za-z]:[\\/]*) ;;
1360 *)
1361 $echo "$modename: only absolute run-paths are allowed" 1>&2
1362 exit 1
1363 ;;
1364 esac
1365 case "$xrpath " in
1366 *" $dir "*) ;;
1367 *) xrpath="$xrpath $dir" ;;
1368 esac
1369 continue
1370 ;;
1371
1372 -static)
1373 # The effects of -static are defined in a previous loop.
1374 # We used to do the same as -all-static on platforms that
1375 # didn't have a PIC flag, but the assumption that the effects
1376 # would be equivalent was wrong. It would break on at least
1377 # Digital Unix and AIX.
1378 continue
1379 ;;
1380
1381 -thread-safe)
1382 thread_safe=yes
1383 continue
1384 ;;
1385
1386 -version-info)
1387 prev=vinfo
1388 continue
1389 ;;
1390
1391 -Wc,*)
1392 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1393 arg=
1394 save_ifs="$IFS"; IFS=','
1395 for flag in $args; do
1396 IFS="$save_ifs"
1397 case $flag in
1398 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1399 flag="\"$flag\""
1400 ;;
1401 esac
1402 arg="$arg $wl$flag"
1403 compiler_flags="$compiler_flags $flag"
1404 done
1405 IFS="$save_ifs"
1406 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1407 ;;
1408
1409 -Wl,*)
1410 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1411 arg=
1412 save_ifs="$IFS"; IFS=','
1413 for flag in $args; do
1414 IFS="$save_ifs"
1415 case $flag in
1416 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1417 flag="\"$flag\""
1418 ;;
1419 esac
1420 arg="$arg $wl$flag"
1421 compiler_flags="$compiler_flags $wl$flag"
1422 linker_flags="$linker_flags $flag"
1423 done
1424 IFS="$save_ifs"
1425 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1426 ;;
1427
1428 -Xcompiler)
1429 prev=xcompiler
1430 continue
1431 ;;
1432
1433 -Xlinker)
1434 prev=xlinker
1435 continue
1436 ;;
1437
1438 -XCClinker)
1439 prev=xcclinker
1440 continue
1441 ;;
1442
1443 # Some other compiler flag.
1444 -* | +*)
1445 # Unknown arguments in both finalize_command and compile_command need
1446 # to be aesthetically quoted because they are evaled later.
1447 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1448 case $arg in
1449 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1450 arg="\"$arg\""
1451 ;;
1452 esac
1453 ;;
1454
1455 *.$objext)
1456 # A standard object.
1457 objs="$objs $arg"
1458 ;;
1459
1460 *.lo)
1461 # A libtool-controlled object.
1462
1463 # Check to see that this really is a libtool object.
1464 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1465 pic_object=
1466 non_pic_object=
1467
1468 # Read the .lo file
1469 # If there is no directory component, then add one.
1470 case $arg in
1471 */* | *\\*) . $arg ;;
1472 *) . ./$arg ;;
1473 esac
1474
1475 if test -z "$pic_object" || \
1476 test -z "$non_pic_object" ||
1477 test "$pic_object" = none && \
1478 test "$non_pic_object" = none; then
1479 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1480 exit 1
1481 fi
1482
1483 # Extract subdirectory from the argument.
1484 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1485 if test "X$xdir" = "X$arg"; then
1486 xdir=
1487 else
1488 xdir="$xdir/"
1489 fi
1490
1491 if test "$pic_object" != none; then
1492 # Prepend the subdirectory the object is found in.
1493 pic_object="$xdir$pic_object"
1494
1495 if test "$prev" = dlfiles; then
1496 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1497 dlfiles="$dlfiles $pic_object"
1498 prev=
1499 continue
1500 else
1501 # If libtool objects are unsupported, then we need to preload.
1502 prev=dlprefiles
1503 fi
1504 fi
1505
1506 # CHECK ME: I think I busted this. -Ossama
1507 if test "$prev" = dlprefiles; then
1508 # Preload the old-style object.
1509 dlprefiles="$dlprefiles $pic_object"
1510 prev=
1511 fi
1512
1513 # A PIC object.
1514 libobjs="$libobjs $pic_object"
1515 arg="$pic_object"
1516 fi
1517
1518 # Non-PIC object.
1519 if test "$non_pic_object" != none; then
1520 # Prepend the subdirectory the object is found in.
1521 non_pic_object="$xdir$non_pic_object"
1522
1523 # A standard non-PIC object
1524 non_pic_objects="$non_pic_objects $non_pic_object"
1525 if test -z "$pic_object" || test "$pic_object" = none ; then
1526 arg="$non_pic_object"
1527 fi
1528 fi
1529 else
1530 # Only an error if not doing a dry-run.
1531 if test -z "$run"; then
1532 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1533 exit 1
1534 else
1535 # Dry-run case.
1536
1537 # Extract subdirectory from the argument.
1538 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1539 if test "X$xdir" = "X$arg"; then
1540 xdir=
1541 else
1542 xdir="$xdir/"
1543 fi
1544
1545 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1546 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1547 libobjs="$libobjs $pic_object"
1548 non_pic_objects="$non_pic_objects $non_pic_object"
1549 fi
1550 fi
1551 ;;
1552
1553 *.$libext)
1554 # An archive.
1555 deplibs="$deplibs $arg"
1556 old_deplibs="$old_deplibs $arg"
1557 continue
1558 ;;
1559
1560 *.la)
1561 # A libtool-controlled library.
1562
1563 if test "$prev" = dlfiles; then
1564 # This library was specified with -dlopen.
1565 dlfiles="$dlfiles $arg"
1566 prev=
1567 elif test "$prev" = dlprefiles; then
1568 # The library was specified with -dlpreopen.
1569 dlprefiles="$dlprefiles $arg"
1570 prev=
1571 else
1572 deplibs="$deplibs $arg"
1573 fi
1574 continue
1575 ;;
1576
1577 # Some other compiler argument.
1578 *)
1579 # Unknown arguments in both finalize_command and compile_command need
1580 # to be aesthetically quoted because they are evaled later.
1581 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1582 case $arg in
1583 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1584 arg="\"$arg\""
1585 ;;
1586 esac
1587 ;;
1588 esac # arg
1589
1590 # Now actually substitute the argument into the commands.
1591 if test -n "$arg"; then
1592 compile_command="$compile_command $arg"
1593 finalize_command="$finalize_command $arg"
1594 fi
1595 done # argument parsing loop
1596
1597 if test -n "$prev"; then
1598 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1599 $echo "$help" 1>&2
1600 exit 1
1601 fi
1602
1603 # Infer tagged configuration to use if any are available and
1604 # if one wasn't chosen via the "--tag" command line option.
1605 # Only attempt this if the compiler in the base link
1606 # command doesn't match the default compiler.
1607 if test -n "$available_tags" && test -z "$tagname"; then
1608 case $base_compile in
1609 # Blanks in the command may have been stripped by the calling shell,
1610 # but not from the CC environment variable when configure was run.
1611 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1612 # Blanks at the start of $base_compile will cause this to fail
1613 # if we don't check for them as well.
1614 *)
1615 for z in $available_tags; do
1616 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1617 # Evaluate the configuration.
1618 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1619 case $base_compile in
1620 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1621 # The compiler in $compile_command matches
1622 # the one in the tagged configuration.
1623 # Assume this is the tagged configuration we want.
1624 tagname=$z
1625 break
1626 ;;
1627 esac
1628 fi
1629 done
1630 # If $tagname still isn't set, then no tagged configuration
1631 # was found and let the user know that the "--tag" command
1632 # line option must be used.
1633 if test -z "$tagname"; then
1634 echo "$modename: unable to infer tagged configuration"
1635 echo "$modename: specify a tag with \`--tag'" 1>&2
1636 exit 1
1637 # else
1638 # echo "$modename: using $tagname tagged configuration"
1639 fi
1640 ;;
1641 esac
1642 fi
1643
1644 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1645 eval arg=\"$export_dynamic_flag_spec\"
1646 compile_command="$compile_command $arg"
1647 finalize_command="$finalize_command $arg"
1648 fi
1649
1650 oldlibs=
1651 # calculate the name of the file, without its directory
1652 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1653 libobjs_save="$libobjs"
1654
1655 if test -n "$shlibpath_var"; then
1656 # get the directories listed in $shlibpath_var
1657 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1658 else
1659 shlib_search_path=
1660 fi
1661 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1662 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1663
1664 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1665 if test "X$output_objdir" = "X$output"; then
1666 output_objdir="$objdir"
1667 else
1668 output_objdir="$output_objdir/$objdir"
1669 fi
1670 # Create the object directory.
1671 if test ! -d "$output_objdir"; then
1672 $show "$mkdir $output_objdir"
1673 $run $mkdir $output_objdir
1674 status=$?
1675 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1676 exit $status
1677 fi
1678 fi
1679
1680 # Determine the type of output
1681 case $output in
1682 "")
1683 $echo "$modename: you must specify an output file" 1>&2
1684 $echo "$help" 1>&2
1685 exit 1
1686 ;;
1687 *.$libext) linkmode=oldlib ;;
1688 *.lo | *.$objext) linkmode=obj ;;
1689 *.la) linkmode=lib ;;
1690 *) linkmode=prog ;; # Anything else should be a program.
1691 esac
1692
1693 case $host in
1694 *cygwin* | *mingw* | *pw32*)
1695 # don't eliminate duplcations in $postdeps and $predeps
1696 duplicate_compiler_generated_deps=yes
1697 ;;
1698 *)
1699 duplicate_compiler_generated_deps=$duplicate_deps
1700 ;;
1701 esac
1702 specialdeplibs=
1703
1704 libs=
1705 # Find all interdependent deplibs by searching for libraries
1706 # that are linked more than once (e.g. -la -lb -la)
1707 for deplib in $deplibs; do
1708 if test "X$duplicate_deps" = "Xyes" ; then
1709 case "$libs " in
1710 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1711 esac
1712 fi
1713 libs="$libs $deplib"
1714 done
1715
1716 if test "$linkmode" = lib; then
1717 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1718
1719 # Compute libraries that are listed more than once in $predeps
1720 # $postdeps and mark them as special (i.e., whose duplicates are
1721 # not to be eliminated).
1722 pre_post_deps=
1723 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1724 for pre_post_dep in $predeps $postdeps; do
1725 case "$pre_post_deps " in
1726 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1727 esac
1728 pre_post_deps="$pre_post_deps $pre_post_dep"
1729 done
1730 fi
1731 pre_post_deps=
1732 fi
1733
1734 deplibs=
1735 newdependency_libs=
1736 newlib_search_path=
1737 need_relink=no # whether we're linking any uninstalled libtool libraries
1738 notinst_deplibs= # not-installed libtool libraries
1739 notinst_path= # paths that contain not-installed libtool libraries
1740 case $linkmode in
1741 lib)
1742 passes="conv link"
1743 for file in $dlfiles $dlprefiles; do
1744 case $file in
1745 *.la) ;;
1746 *)
1747 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1748 exit 1
1749 ;;
1750 esac
1751 done
1752 ;;
1753 prog)
1754 compile_deplibs=
1755 finalize_deplibs=
1756 alldeplibs=no
1757 newdlfiles=
1758 newdlprefiles=
1759 passes="conv scan dlopen dlpreopen link"
1760 ;;
1761 *) passes="conv"
1762 ;;
1763 esac
1764 for pass in $passes; do
1765 if test "$linkmode,$pass" = "lib,link" ||
1766 test "$linkmode,$pass" = "prog,scan"; then
1767 libs="$deplibs"
1768 deplibs=
1769 fi
1770 if test "$linkmode" = prog; then
1771 case $pass in
1772 dlopen) libs="$dlfiles" ;;
1773 dlpreopen) libs="$dlprefiles" ;;
1774 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1775 esac
1776 fi
1777 if test "$pass" = dlopen; then
1778 # Collect dlpreopened libraries
1779 save_deplibs="$deplibs"
1780 deplibs=
1781 fi
1782 for deplib in $libs; do
1783 lib=
1784 found=no
1785 case $deplib in
1786 -l*)
1787 if test "$linkmode" != lib && test "$linkmode" != prog; then
1788 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1789 continue
1790 fi
1791 if test "$pass" = conv; then
1792 deplibs="$deplib $deplibs"
1793 continue
1794 fi
1795 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1796 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1797 # Search the libtool library
1798 lib="$searchdir/lib${name}.la"
1799 if test -f "$lib"; then
1800 found=yes
1801 break
1802 fi
1803 done
1804 if test "$found" != yes; then
1805 # deplib doesn't seem to be a libtool library
1806 if test "$linkmode,$pass" = "prog,link"; then
1807 compile_deplibs="$deplib $compile_deplibs"
1808 finalize_deplibs="$deplib $finalize_deplibs"
1809 else
1810 deplibs="$deplib $deplibs"
1811 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1812 fi
1813 continue
1814 else # deplib is a libtool library
1815 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1816 # We need to do some special things here, and not later.
1817 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1818 case " $predeps $postdeps " in
1819 *" $deplib "*)
1820 if (${SED} -e '2q' $lib |
1821 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1822 library_names=
1823 old_library=
1824 case $lib in
1825 */* | *\\*) . $lib ;;
1826 *) . ./$lib ;;
1827 esac
1828 for l in $old_library $library_names; do
1829 ll="$l"
1830 done
1831 if test "X$ll" = "X$old_library" ; then # only static version available
1832 found=no
1833 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1834 test "X$ladir" = "X$lib" && ladir="."
1835 lib=$ladir/$old_library
1836 if test "$linkmode,$pass" = "prog,link"; then
1837 compile_deplibs="$deplib $compile_deplibs"
1838 finalize_deplibs="$deplib $finalize_deplibs"
1839 else
1840 deplibs="$deplib $deplibs"
1841 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1842 fi
1843 continue
1844 fi
1845 fi
1846 ;;
1847 *) ;;
1848 esac
1849 fi
1850 fi
1851 ;; # -l
1852 -L*)
1853 case $linkmode in
1854 lib)
1855 deplibs="$deplib $deplibs"
1856 test "$pass" = conv && continue
1857 newdependency_libs="$deplib $newdependency_libs"
1858 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1859 ;;
1860 prog)
1861 if test "$pass" = conv; then
1862 deplibs="$deplib $deplibs"
1863 continue
1864 fi
1865 if test "$pass" = scan; then
1866 deplibs="$deplib $deplibs"
1867 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1868 else
1869 compile_deplibs="$deplib $compile_deplibs"
1870 finalize_deplibs="$deplib $finalize_deplibs"
1871 fi
1872 ;;
1873 *)
1874 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1875 ;;
1876 esac # linkmode
1877 continue
1878 ;; # -L
1879 -R*)
1880 if test "$pass" = link; then
1881 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1882 # Make sure the xrpath contains only unique directories.
1883 case "$xrpath " in
1884 *" $dir "*) ;;
1885 *) xrpath="$xrpath $dir" ;;
1886 esac
1887 fi
1888 deplibs="$deplib $deplibs"
1889 continue
1890 ;;
1891 *.la) lib="$deplib" ;;
1892 *.$libext)
1893 if test "$pass" = conv; then
1894 deplibs="$deplib $deplibs"
1895 continue
1896 fi
1897 case $linkmode in
1898 lib)
1899 if test "$deplibs_check_method" != pass_all; then
1900 echo
1901 echo "*** Warning: Trying to link with static lib archive $deplib."
1902 echo "*** I have the capability to make that library automatically link in when"
1903 echo "*** you link to this library. But I can only do this if you have a"
1904 echo "*** shared version of the library, which you do not appear to have"
1905 echo "*** because the file extensions .$libext of this argument makes me believe"
1906 echo "*** that it is just a static archive that I should not used here."
1907 else
1908 echo
1909 echo "*** Warning: Linking the shared library $output against the"
1910 echo "*** static library $deplib is not portable!"
1911 deplibs="$deplib $deplibs"
1912 fi
1913 continue
1914 ;;
1915 prog)
1916 if test "$pass" != link; then
1917 deplibs="$deplib $deplibs"
1918 else
1919 compile_deplibs="$deplib $compile_deplibs"
1920 finalize_deplibs="$deplib $finalize_deplibs"
1921 fi
1922 continue
1923 ;;
1924 esac # linkmode
1925 ;; # *.$libext
1926 *.lo | *.$objext)
1927 if test "$pass" = conv; then
1928 deplibs="$deplib $deplibs"
1929 elif test "$linkmode" = prog; then
1930 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1931 # If there is no dlopen support or we're linking statically,
1932 # we need to preload.
1933 newdlprefiles="$newdlprefiles $deplib"
1934 compile_deplibs="$deplib $compile_deplibs"
1935 finalize_deplibs="$deplib $finalize_deplibs"
1936 else
1937 newdlfiles="$newdlfiles $deplib"
1938 fi
1939 fi
1940 continue
1941 ;;
1942 %DEPLIBS%)
1943 alldeplibs=yes
1944 continue
1945 ;;
1946 esac # case $deplib
1947 if test "$found" = yes || test -f "$lib"; then :
1948 else
1949 $echo "$modename: cannot find the library \`$lib'" 1>&2
1950 exit 1
1951 fi
1952
1953 # Check to see that this really is a libtool archive.
1954 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1955 else
1956 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1957 exit 1
1958 fi
1959
1960 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1961 test "X$ladir" = "X$lib" && ladir="."
1962
1963 dlname=
1964 dlopen=
1965 dlpreopen=
1966 libdir=
1967 library_names=
1968 old_library=
1969 # If the library was installed with an old release of libtool,
1970 # it will not redefine variable installed.
1971 installed=yes
1972
1973 # Read the .la file
1974 case $lib in
1975 */* | *\\*) . $lib ;;
1976 *) . ./$lib ;;
1977 esac
1978
1979 if test "$linkmode,$pass" = "lib,link" ||
1980 test "$linkmode,$pass" = "prog,scan" ||
1981 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
1982 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1983 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1984 fi
1985
1986 if test "$pass" = conv; then
1987 # Only check for convenience libraries
1988 deplibs="$lib $deplibs"
1989 if test -z "$libdir"; then
1990 if test -z "$old_library"; then
1991 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1992 exit 1
1993 fi
1994 # It is a libtool convenience library, so add in its objects.
1995 convenience="$convenience $ladir/$objdir/$old_library"
1996 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1997 tmp_libs=
1998 for deplib in $dependency_libs; do
1999 deplibs="$deplib $deplibs"
2000 if test "X$duplicate_deps" = "Xyes" ; then
2001 case "$tmp_libs " in
2002 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2003 esac
2004 fi
2005 tmp_libs="$tmp_libs $deplib"
2006 done
2007 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2008 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2009 exit 1
2010 fi
2011 continue
2012 fi # $pass = conv
2013
2014 # Get the name of the library we link against.
2015 linklib=
2016 for l in $old_library $library_names; do
2017 linklib="$l"
2018 done
2019 if test -z "$linklib"; then
2020 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2021 exit 1
2022 fi
2023
2024 # This library was specified with -dlopen.
2025 if test "$pass" = dlopen; then
2026 if test -z "$libdir"; then
2027 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2028 exit 1
2029 fi
2030 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2031 # If there is no dlname, no dlopen support or we're linking
2032 # statically, we need to preload. We also need to preload any
2033 # dependent libraries so libltdl's deplib preloader doesn't
2034 # bomb out in the load deplibs phase.
2035 dlprefiles="$dlprefiles $lib $dependency_libs"
2036 else
2037 newdlfiles="$newdlfiles $lib"
2038 fi
2039 continue
2040 fi # $pass = dlopen
2041
2042 # We need an absolute path.
2043 case $ladir in
2044 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2045 *)
2046 abs_ladir=`cd "$ladir" && pwd`
2047 if test -z "$abs_ladir"; then
2048 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2049 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2050 abs_ladir="$ladir"
2051 fi
2052 ;;
2053 esac
2054 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2055
2056 # Find the relevant object directory and library name.
2057 if test "X$installed" = Xyes; then
2058 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2059 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2060 dir="$ladir"
2061 absdir="$abs_ladir"
2062 libdir="$abs_ladir"
2063 else
2064 dir="$libdir"
2065 absdir="$libdir"
2066 fi
2067 else
2068 dir="$ladir/$objdir"
2069 absdir="$abs_ladir/$objdir"
2070 # Remove this search path later
2071 notinst_path="$notinst_path $abs_ladir"
2072 fi # $installed = yes
2073 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2074
2075 # This library was specified with -dlpreopen.
2076 if test "$pass" = dlpreopen; then
2077 if test -z "$libdir"; then
2078 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2079 exit 1
2080 fi
2081 # Prefer using a static library (so that no silly _DYNAMIC symbols
2082 # are required to link).
2083 if test -n "$old_library"; then
2084 newdlprefiles="$newdlprefiles $dir/$old_library"
2085 # Otherwise, use the dlname, so that lt_dlopen finds it.
2086 elif test -n "$dlname"; then
2087 newdlprefiles="$newdlprefiles $dir/$dlname"
2088 else
2089 newdlprefiles="$newdlprefiles $dir/$linklib"
2090 fi
2091 fi # $pass = dlpreopen
2092
2093 if test -z "$libdir"; then
2094 # Link the convenience library
2095 if test "$linkmode" = lib; then
2096 deplibs="$dir/$old_library $deplibs"
2097 elif test "$linkmode,$pass" = "prog,link"; then
2098 compile_deplibs="$dir/$old_library $compile_deplibs"
2099 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2100 else
2101 deplibs="$lib $deplibs" # used for prog,scan pass
2102 fi
2103 continue
2104 fi
2105
2106 if test "$linkmode" = prog && test "$pass" != link; then
2107 newlib_search_path="$newlib_search_path $ladir"
2108 deplibs="$lib $deplibs"
2109
2110 linkalldeplibs=no
2111 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2112 test "$build_libtool_libs" = no; then
2113 linkalldeplibs=yes
2114 fi
2115
2116 tmp_libs=
2117 for deplib in $dependency_libs; do
2118 case $deplib in
2119 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2120 esac
2121 # Need to link against all dependency_libs?
2122 if test "$linkalldeplibs" = yes; then
2123 deplibs="$deplib $deplibs"
2124 else
2125 # Need to hardcode shared library paths
2126 # or/and link against static libraries
2127 newdependency_libs="$deplib $newdependency_libs"
2128 fi
2129 if test "X$duplicate_deps" = "Xyes" ; then
2130 case "$tmp_libs " in
2131 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2132 esac
2133 fi
2134 tmp_libs="$tmp_libs $deplib"
2135 done # for deplib
2136 continue
2137 fi # $linkmode = prog...
2138
2139 if test "$linkmode,$pass" = "prog,link"; then
2140 if test -n "$library_names" &&
2141 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2142 # We need to hardcode the library path
2143 if test -n "$shlibpath_var"; then
2144 # Make sure the rpath contains only unique directories.
2145 case "$temp_rpath " in
2146 *" $dir "*) ;;
2147 *" $absdir "*) ;;
2148 *) temp_rpath="$temp_rpath $dir" ;;
2149 esac
2150 fi
2151
2152 # Hardcode the library path.
2153 # Skip directories that are in the system default run-time
2154 # search path.
2155 case " $sys_lib_dlsearch_path " in
2156 *" $absdir "*) ;;
2157 *)
2158 case "$compile_rpath " in
2159 *" $absdir "*) ;;
2160 *) compile_rpath="$compile_rpath $absdir"
2161 esac
2162 ;;
2163 esac
2164 case " $sys_lib_dlsearch_path " in
2165 *" $libdir "*) ;;
2166 *)
2167 case "$finalize_rpath " in
2168 *" $libdir "*) ;;
2169 *) finalize_rpath="$finalize_rpath $libdir"
2170 esac
2171 ;;
2172 esac
2173 fi # $linkmode,$pass = prog,link...
2174
2175 if test "$alldeplibs" = yes &&
2176 { test "$deplibs_check_method" = pass_all ||
2177 { test "$build_libtool_libs" = yes &&
2178 test -n "$library_names"; }; }; then
2179 # We only need to search for static libraries
2180 continue
2181 fi
2182 fi
2183
2184 link_static=no # Whether the deplib will be linked statically
2185 if test -n "$library_names" &&
2186 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2187 if test "$installed" = no; then
2188 notinst_deplibs="$notinst_deplibs $lib"
2189 need_relink=yes
2190 fi
2191 # This is a shared library
2192 if test "$linkmode" = lib &&
2193 test "$hardcode_into_libs" = yes; then
2194 # Hardcode the library path.
2195 # Skip directories that are in the system default run-time
2196 # search path.
2197 case " $sys_lib_dlsearch_path " in
2198 *" $absdir "*) ;;
2199 *)
2200 case "$compile_rpath " in
2201 *" $absdir "*) ;;
2202 *) compile_rpath="$compile_rpath $absdir"
2203 esac
2204 ;;
2205 esac
2206 case " $sys_lib_dlsearch_path " in
2207 *" $libdir "*) ;;
2208 *)
2209 case "$finalize_rpath " in
2210 *" $libdir "*) ;;
2211 *) finalize_rpath="$finalize_rpath $libdir"
2212 esac
2213 ;;
2214 esac
2215 fi
2216
2217 if test -n "$old_archive_from_expsyms_cmds"; then
2218 # figure out the soname
2219 set dummy $library_names
2220 realname="$2"
2221 shift; shift
2222 libname=`eval \\$echo \"$libname_spec\"`
2223 # use dlname if we got it. it's perfectly good, no?
2224 if test -n "$dlname"; then
2225 soname="$dlname"
2226 elif test -n "$soname_spec"; then
2227 # bleh windows
2228 case $host in
2229 *cygwin* | mingw*)
2230 major=`expr $current - $age`
2231 versuffix="-$major"
2232 ;;
2233 esac
2234 eval soname=\"$soname_spec\"
2235 else
2236 soname="$realname"
2237 fi
2238
2239 # Make a new name for the extract_expsyms_cmds to use
2240 soroot="$soname"
2241 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
2242 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2243
2244 # If the library has no export list, then create one now
2245 if test -f "$output_objdir/$soname-def"; then :
2246 else
2247 $show "extracting exported symbol list from \`$soname'"
2248 save_ifs="$IFS"; IFS='~'
2249 eval cmds=\"$extract_expsyms_cmds\"
2250 for cmd in $cmds; do
2251 IFS="$save_ifs"
2252 $show "$cmd"
2253 $run eval "$cmd" || exit $?
2254 done
2255 IFS="$save_ifs"
2256 fi
2257
2258 # Create $newlib
2259 if test -f "$output_objdir/$newlib"; then :; else
2260 $show "generating import library for \`$soname'"
2261 save_ifs="$IFS"; IFS='~'
2262 eval cmds=\"$old_archive_from_expsyms_cmds\"
2263 for cmd in $cmds; do
2264 IFS="$save_ifs"
2265 $show "$cmd"
2266 $run eval "$cmd" || exit $?
2267 done
2268 IFS="$save_ifs"
2269 fi
2270 # make sure the library variables are pointing to the new library
2271 dir=$output_objdir
2272 linklib=$newlib
2273 fi # test -n "$old_archive_from_expsyms_cmds"
2274
2275 if test "$linkmode" = prog || test "$mode" != relink; then
2276 add_shlibpath=
2277 add_dir=
2278 add=
2279 lib_linked=yes
2280 case $hardcode_action in
2281 immediate | unsupported)
2282 if test "$hardcode_direct" = no; then
2283 case $host in
2284 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2285 esac
2286 add="$dir/$linklib"
2287 elif test "$hardcode_minus_L" = no; then
2288 case $host in
2289 *-*-sunos*) add_shlibpath="$dir" ;;
2290 esac
2291 add_dir="-L$dir"
2292 add="-l$name"
2293 elif test "$hardcode_shlibpath_var" = no; then
2294 add_shlibpath="$dir"
2295 add="-l$name"
2296 else
2297 lib_linked=no
2298 fi
2299 ;;
2300 relink)
2301 if test "$hardcode_direct" = yes; then
2302 add="$dir/$linklib"
2303 elif test "$hardcode_minus_L" = yes; then
2304 add_dir="-L$dir"
2305 # Try looking first in the location we're being installed to.
2306 if test -n "$inst_prefix_dir"; then
2307 case "$libdir" in
2308 [\\/]*)
2309 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2310 ;;
2311 esac
2312 fi
2313 add="-l$name"
2314 elif test "$hardcode_shlibpath_var" = yes; then
2315 add_shlibpath="$dir"
2316 add="-l$name"
2317 else
2318 lib_linked=no
2319 fi
2320 ;;
2321 *) lib_linked=no ;;
2322 esac
2323
2324 if test "$lib_linked" != yes; then
2325 $echo "$modename: configuration error: unsupported hardcode properties"
2326 exit 1
2327 fi
2328
2329 if test -n "$add_shlibpath"; then
2330 case :$compile_shlibpath: in
2331 *":$add_shlibpath:"*) ;;
2332 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2333 esac
2334 fi
2335 if test "$linkmode" = prog; then
2336 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2337 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2338 else
2339 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2340 test -n "$add" && deplibs="$add $deplibs"
2341 if test "$hardcode_direct" != yes && \
2342 test "$hardcode_minus_L" != yes && \
2343 test "$hardcode_shlibpath_var" = yes; then
2344 case :$finalize_shlibpath: in
2345 *":$libdir:"*) ;;
2346 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2347 esac
2348 fi
2349 fi
2350 fi
2351
2352 if test "$linkmode" = prog || test "$mode" = relink; then
2353 add_shlibpath=
2354 add_dir=
2355 add=
2356 # Finalize command for both is simple: just hardcode it.
2357 if test "$hardcode_direct" = yes; then
2358 add="$libdir/$linklib"
2359 elif test "$hardcode_minus_L" = yes; then
2360 add_dir="-L$libdir"
2361 add="-l$name"
2362 elif test "$hardcode_shlibpath_var" = yes; then
2363 case :$finalize_shlibpath: in
2364 *":$libdir:"*) ;;
2365 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2366 esac
2367 add="-l$name"
2368 else
2369 # We cannot seem to hardcode it, guess we'll fake it.
2370 add_dir="-L$libdir"
2371 # Try looking first in the location we're being installed to.
2372 if test -n "$inst_prefix_dir"; then
2373 case "$libdir" in
2374 [\\/]*)
2375 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2376 ;;
2377 esac
2378 fi
2379 add="-l$name"
2380 fi
2381
2382 if test "$linkmode" = prog; then
2383 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2384 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2385 else
2386 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2387 test -n "$add" && deplibs="$add $deplibs"
2388 fi
2389 fi
2390 elif test "$linkmode" = prog; then
2391 # Here we assume that one of hardcode_direct or hardcode_minus_L
2392 # is not unsupported. This is valid on all known static and
2393 # shared platforms.
2394 if test "$hardcode_direct" != unsupported; then
2395 test -n "$old_library" && linklib="$old_library"
2396 compile_deplibs="$dir/$linklib $compile_deplibs"
2397 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2398 else
2399 compile_deplibs="-l$name -L$dir $compile_deplibs"
2400 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2401 fi
2402 elif test "$build_libtool_libs" = yes; then
2403 # Not a shared library
2404 if test "$deplibs_check_method" != pass_all; then
2405 # We're trying link a shared library against a static one
2406 # but the system doesn't support it.
2407
2408 # Just print a warning and add the library to dependency_libs so
2409 # that the program can be linked against the static library.
2410 echo
2411 echo "*** Warning: This system can not link to static lib archive $lib."
2412 echo "*** I have the capability to make that library automatically link in when"
2413 echo "*** you link to this library. But I can only do this if you have a"
2414 echo "*** shared version of the library, which you do not appear to have."
2415 if test "$module" = yes; then
2416 echo "*** But as you try to build a module library, libtool will still create "
2417 echo "*** a static module, that should work as long as the dlopening application"
2418 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2419 if test -z "$global_symbol_pipe"; then
2420 echo
2421 echo "*** However, this would only work if libtool was able to extract symbol"
2422 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2423 echo "*** not find such a program. So, this module is probably useless."
2424 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2425 fi
2426 if test "$build_old_libs" = no; then
2427 build_libtool_libs=module
2428 build_old_libs=yes
2429 else
2430 build_libtool_libs=no
2431 fi
2432 fi
2433 else
2434 convenience="$convenience $dir/$old_library"
2435 old_convenience="$old_convenience $dir/$old_library"
2436 deplibs="$dir/$old_library $deplibs"
2437 link_static=yes
2438 fi
2439 fi # link shared/static library?
2440
2441 if test "$linkmode" = lib; then
2442 if test -n "$dependency_libs" &&
2443 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2444 test "$link_static" = yes; }; then
2445 # Extract -R from dependency_libs
2446 temp_deplibs=
2447 for libdir in $dependency_libs; do
2448 case $libdir in
2449 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2450 case " $xrpath " in
2451 *" $temp_xrpath "*) ;;
2452 *) xrpath="$xrpath $temp_xrpath";;
2453 esac;;
2454 *) temp_deplibs="$temp_deplibs $libdir";;
2455 esac
2456 done
2457 dependency_libs="$temp_deplibs"
2458 fi
2459
2460 newlib_search_path="$newlib_search_path $absdir"
2461 # Link against this library
2462 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2463 # ... and its dependency_libs
2464 tmp_libs=
2465 for deplib in $dependency_libs; do
2466 newdependency_libs="$deplib $newdependency_libs"
2467 if test "X$duplicate_deps" = "Xyes" ; then
2468 case "$tmp_libs " in
2469 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2470 esac
2471 fi
2472 tmp_libs="$tmp_libs $deplib"
2473 done
2474
2475 if test "$link_all_deplibs" != no; then
2476 # Add the search paths of all dependency libraries
2477 for deplib in $dependency_libs; do
2478 case $deplib in
2479 -L*) path="$deplib" ;;
2480 *.la)
2481 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2482 test "X$dir" = "X$deplib" && dir="."
2483 # We need an absolute path.
2484 case $dir in
2485 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2486 *)
2487 absdir=`cd "$dir" && pwd`
2488 if test -z "$absdir"; then
2489 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2490 absdir="$dir"
2491 fi
2492 ;;
2493 esac
2494 if grep "^installed=no" $deplib > /dev/null; then
2495 path="-L$absdir/$objdir"
2496 else
2497 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2498 if test -z "$libdir"; then
2499 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2500 exit 1
2501 fi
2502 if test "$absdir" != "$libdir"; then
2503 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2504 fi
2505 path="-L$absdir"
2506 fi
2507 ;;
2508 *) continue ;;
2509 esac
2510 case " $deplibs " in
2511 *" $path "*) ;;
2512 *) deplibs="$deplibs $path" ;;
2513 esac
2514 done
2515 fi # link_all_deplibs != no
2516 fi # linkmode = lib
2517 done # for deplib in $libs
2518 dependency_libs="$newdependency_libs"
2519 if test "$pass" = dlpreopen; then
2520 # Link the dlpreopened libraries before other libraries
2521 for deplib in $save_deplibs; do
2522 deplibs="$deplib $deplibs"
2523 done
2524 fi
2525 if test "$pass" != dlopen; then
2526 if test "$pass" != conv; then
2527 # Make sure lib_search_path contains only unique directories.
2528 lib_search_path=
2529 for dir in $newlib_search_path; do
2530 case "$lib_search_path " in
2531 *" $dir "*) ;;
2532 *) lib_search_path="$lib_search_path $dir" ;;
2533 esac
2534 done
2535 newlib_search_path=
2536 fi
2537
2538 if test "$linkmode,$pass" != "prog,link"; then
2539 vars="deplibs"
2540 else
2541 vars="compile_deplibs finalize_deplibs"
2542 fi
2543 for var in $vars dependency_libs; do
2544 # Add libraries to $var in reverse order
2545 eval tmp_libs=\"\$$var\"
2546 new_libs=
2547 for deplib in $tmp_libs; do
2548 # FIXME: Pedantically, this is the right thing to do, so
2549 # that some nasty dependency loop isn't accidentally
2550 # broken:
2551 #new_libs="$deplib $new_libs"
2552 # Pragmatically, this seems to cause very few problems in
2553 # practice:
2554 case $deplib in
2555 -L*) new_libs="$deplib $new_libs" ;;
2556 *)
2557 # And here is the reason: when a library appears more
2558 # than once as an explicit dependence of a library, or
2559 # is implicitly linked in more than once by the
2560 # compiler, it is considered special, and multiple
2561 # occurrences thereof are not removed. Compare this
2562 # with having the same library being listed as a
2563 # dependency of multiple other libraries: in this case,
2564 # we know (pedantically, we assume) the library does not
2565 # need to be listed more than once, so we keep only the
2566 # last copy. This is not always right, but it is rare
2567 # enough that we require users that really mean to play
2568 # such unportable linking tricks to link the library
2569 # using -Wl,-lname, so that libtool does not consider it
2570 # for duplicate removal.
2571 case " $specialdeplibs " in
2572 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2573 *)
2574 case " $new_libs " in
2575 *" $deplib "*) ;;
2576 *) new_libs="$deplib $new_libs" ;;
2577 esac
2578 ;;
2579 esac
2580 ;;
2581 esac
2582 done
2583 tmp_libs=
2584 for deplib in $new_libs; do
2585 case $deplib in
2586 -L*)
2587 case " $tmp_libs " in
2588 *" $deplib "*) ;;
2589 *) tmp_libs="$tmp_libs $deplib" ;;
2590 esac
2591 ;;
2592 *) tmp_libs="$tmp_libs $deplib" ;;
2593 esac
2594 done
2595 eval $var=\"$tmp_libs\"
2596 done # for var
2597 fi
2598 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2599 tmp_libs=
2600 for i in $dependency_libs ; do
2601 case " $predeps $postdeps $compiler_lib_search_path " in
2602 *" $i "*)
2603 i=""
2604 ;;
2605 esac
2606 if test -n "$i" ; then
2607 tmp_libs="$tmp_libs $i"
2608 fi
2609 done
2610 dependency_libs=$tmp_libs
2611 done # for pass
2612 if test "$linkmode" = prog; then
2613 dlfiles="$newdlfiles"
2614 dlprefiles="$newdlprefiles"
2615 fi
2616
2617 case $linkmode in
2618 oldlib)
2619 if test -n "$deplibs"; then
2620 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2621 fi
2622
2623 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2624 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2625 fi
2626
2627 if test -n "$rpath"; then
2628 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2629 fi
2630
2631 if test -n "$xrpath"; then
2632 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2633 fi
2634
2635 if test -n "$vinfo"; then
2636 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2637 fi
2638
2639 if test -n "$release"; then
2640 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2641 fi
2642
2643 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2644 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2645 fi
2646
2647 # Now set the variables for building old libraries.
2648 build_libtool_libs=no
2649 oldlibs="$output"
2650 objs="$objs$old_deplibs"
2651 ;;
2652
2653 lib)
2654 # Make sure we only generate libraries of the form `libNAME.la'.
2655 case $outputname in
2656 lib*)
2657 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2658 eval libname=\"$libname_spec\"
2659 ;;
2660 *)
2661 if test "$module" = no; then
2662 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2663 $echo "$help" 1>&2
2664 exit 1
2665 fi
2666 if test "$need_lib_prefix" != no; then
2667 # Add the "lib" prefix for modules if required
2668 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2669 eval libname=\"$libname_spec\"
2670 else
2671 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2672 fi
2673 ;;
2674 esac
2675
2676 if test -n "$objs"; then
2677 if test "$deplibs_check_method" != pass_all; then
2678 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2679 exit 1
2680 else
2681 echo
2682 echo "*** Warning: Linking the shared library $output against the non-libtool"
2683 echo "*** objects $objs is not portable!"
2684 libobjs="$libobjs $objs"
2685 fi
2686 fi
2687
2688 if test "$dlself" != no; then
2689 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2690 fi
2691
2692 set dummy $rpath
2693 if test "$#" -gt 2; then
2694 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2695 fi
2696 install_libdir="$2"
2697
2698 oldlibs=
2699 if test -z "$rpath"; then
2700 if test "$build_libtool_libs" = yes; then
2701 # Building a libtool convenience library.
2702 # Some compilers have problems with a `.al' extension so
2703 # convenience libraries should have the same extension an
2704 # archive normally would.
2705 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2706 build_libtool_libs=convenience
2707 build_old_libs=yes
2708 fi
2709
2710 if test -n "$vinfo"; then
2711 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2712 fi
2713
2714 if test -n "$release"; then
2715 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2716 fi
2717 else
2718
2719 # Parse the version information argument.
2720 save_ifs="$IFS"; IFS=':'
2721 set dummy $vinfo 0 0 0
2722 IFS="$save_ifs"
2723
2724 if test -n "$8"; then
2725 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2726 $echo "$help" 1>&2
2727 exit 1
2728 fi
2729
2730 current="$2"
2731 revision="$3"
2732 age="$4"
2733
2734 # Check that each of the things are valid numbers.
2735 case $current in
2736 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2737 *)
2738 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2739 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2740 exit 1
2741 ;;
2742 esac
2743
2744 case $revision in
2745 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2746 *)
2747 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2748 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2749 exit 1
2750 ;;
2751 esac
2752
2753 case $age in
2754 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2755 *)
2756 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2757 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2758 exit 1
2759 ;;
2760 esac
2761
2762 if test "$age" -gt "$current"; then
2763 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2764 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2765 exit 1
2766 fi
2767
2768 # Calculate the version variables.
2769 major=
2770 versuffix=
2771 verstring=
2772 case $version_type in
2773 none) ;;
2774
2775 darwin)
2776 # Like Linux, but with the current version available in
2777 # verstring for coding it into the library header
2778 major=.`expr $current - $age`
2779 versuffix="$major.$age.$revision"
2780 # Darwin ld doesn't like 0 for these options...
2781 minor_current=`expr $current + 1`
2782 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2783 ;;
2784
2785 freebsd-aout)
2786 major=".$current"
2787 versuffix=".$current.$revision";
2788 ;;
2789
2790 freebsd-elf)
2791 major=".$current"
2792 versuffix=".$current";
2793 ;;
2794
2795 irix | nonstopux)
2796 major=`expr $current - $age`
2797
2798 case $version_type in
2799 nonstopux) verstring_prefix=nonstopux ;;
2800 *) verstring_prefix=sgi ;;
2801 esac
2802 verstring="$verstring_prefix$major.$revision"
2803
2804 # Add in all the interfaces that we are compatible with.
2805 loop=$revision
2806 while test "$loop" -ne 0; do
2807 iface=`expr $revision - $loop`
2808 loop=`expr $loop - 1`
2809 verstring="$verstring_prefix$major.$iface:$verstring"
2810 done
2811
2812 # Before this point, $major must not contain `.'.
2813 major=.$major
2814 versuffix="$major.$revision"
2815 ;;
2816
2817 linux)
2818 major=.`expr $current - $age`
2819 versuffix="$major.$age.$revision"
2820 ;;
2821
2822 osf)
2823 major=.`expr $current - $age`
2824 versuffix=".$current.$age.$revision"
2825 verstring="$current.$age.$revision"
2826
2827 # Add in all the interfaces that we are compatible with.
2828 loop=$age
2829 while test "$loop" -ne 0; do
2830 iface=`expr $current - $loop`
2831 loop=`expr $loop - 1`
2832 verstring="$verstring:${iface}.0"
2833 done
2834
2835 # Make executables depend on our current version.
2836 verstring="$verstring:${current}.0"
2837 ;;
2838
2839 sunos)
2840 major=".$current"
2841 versuffix=".$current.$revision"
2842 ;;
2843
2844 windows)
2845 # Use '-' rather than '.', since we only want one
2846 # extension on DOS 8.3 filesystems.
2847 major=`expr $current - $age`
2848 versuffix="-$major"
2849 ;;
2850
2851 *)
2852 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2853 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2854 exit 1
2855 ;;
2856 esac
2857
2858 # Clear the version info if we defaulted, and they specified a release.
2859 if test -z "$vinfo" && test -n "$release"; then
2860 major=
2861 case $version_type in
2862 darwin)
2863 # we can't check for "0.0" in archive_cmds due to quoting
2864 # problems, so we reset it completely
2865 verstring=
2866 ;;
2867 *)
2868 verstring="0.0"
2869 ;;
2870 esac
2871 if test "$need_version" = no; then
2872 versuffix=
2873 else
2874 versuffix=".0.0"
2875 fi
2876 fi
2877
2878 # Remove version info from name if versioning should be avoided
2879 if test "$avoid_version" = yes && test "$need_version" = no; then
2880 major=
2881 versuffix=
2882 verstring=""
2883 fi
2884
2885 # Check to see if the archive will have undefined symbols.
2886 if test "$allow_undefined" = yes; then
2887 if test "$allow_undefined_flag" = unsupported; then
2888 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2889 build_libtool_libs=no
2890 build_old_libs=yes
2891 fi
2892 else
2893 # Don't allow undefined symbols.
2894 allow_undefined_flag="$no_undefined_flag"
2895 fi
2896 fi
2897
2898 if test "$mode" != relink; then
2899 # Remove our outputs, but don't remove object files since they
2900 # may have been created when compiling PIC objects.
2901 removelist=
2902 tempremovelist=`echo "$output_objdir/*"`
2903 for p in $tempremovelist; do
2904 case $p in
2905 *.$objext)
2906 ;;
2907 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
2908 removelist="$removelist $p"
2909 ;;
2910 *) ;;
2911 esac
2912 done
2913 if test -n "$removelist"; then
2914 $show "${rm}r $removelist"
2915 $run ${rm}r $removelist
2916 fi
2917 fi
2918
2919 # Now set the variables for building old libraries.
2920 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2921 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2922
2923 # Transform .lo files to .o files.
2924 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2925 fi
2926
2927 # Eliminate all temporary directories.
2928 for path in $notinst_path; do
2929 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2930 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2931 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2932 done
2933
2934 if test -n "$xrpath"; then
2935 # If the user specified any rpath flags, then add them.
2936 temp_xrpath=
2937 for libdir in $xrpath; do
2938 temp_xrpath="$temp_xrpath -R$libdir"
2939 case "$finalize_rpath " in
2940 *" $libdir "*) ;;
2941 *) finalize_rpath="$finalize_rpath $libdir" ;;
2942 esac
2943 done
2944 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2945 dependency_libs="$temp_xrpath $dependency_libs"
2946 fi
2947 fi
2948
2949 # Make sure dlfiles contains only unique files that won't be dlpreopened
2950 old_dlfiles="$dlfiles"
2951 dlfiles=
2952 for lib in $old_dlfiles; do
2953 case " $dlprefiles $dlfiles " in
2954 *" $lib "*) ;;
2955 *) dlfiles="$dlfiles $lib" ;;
2956 esac
2957 done
2958
2959 # Make sure dlprefiles contains only unique files
2960 old_dlprefiles="$dlprefiles"
2961 dlprefiles=
2962 for lib in $old_dlprefiles; do
2963 case "$dlprefiles " in
2964 *" $lib "*) ;;
2965 *) dlprefiles="$dlprefiles $lib" ;;
2966 esac
2967 done
2968
2969 if test "$build_libtool_libs" = yes; then
2970 if test -n "$rpath"; then
2971 case $host in
2972 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2973 # these systems don't actually have a c library (as such)!
2974 ;;
2975 *-*-rhapsody* | *-*-darwin1.[012])
2976 # Rhapsody C library is in the System framework
2977 deplibs="$deplibs -framework System"
2978 ;;
2979 *-*-netbsd*)
2980 # Don't link with libc until the a.out ld.so is fixed.
2981 ;;
2982 *-*-openbsd* | *-*-freebsd*)
2983 # Do not include libc due to us having libc/libc_r.
2984 test "X$arg" = "X-lc" && continue
2985 ;;
2986 *)
2987 # Add libc to deplibs on all other systems if necessary.
2988 if test "$build_libtool_need_lc" = "yes"; then
2989 deplibs="$deplibs -lc"
2990 fi
2991 ;;
2992 esac
2993 fi
2994
2995 # Transform deplibs into only deplibs that can be linked in shared.
2996 name_save=$name
2997 libname_save=$libname
2998 release_save=$release
2999 versuffix_save=$versuffix
3000 major_save=$major
3001 # I'm not sure if I'm treating the release correctly. I think
3002 # release should show up in the -l (ie -lgmp5) so we don't want to
3003 # add it in twice. Is that correct?
3004 release=""
3005 versuffix=""
3006 major=""
3007 newdeplibs=
3008 droppeddeps=no
3009 case $deplibs_check_method in
3010 pass_all)
3011 # Don't check for shared/static. Everything works.
3012 # This might be a little naive. We might want to check
3013 # whether the library exists or not. But this is on
3014 # osf3 & osf4 and I'm not really sure... Just
3015 # implementing what was already the behavior.
3016 newdeplibs=$deplibs
3017 ;;
3018 test_compile)
3019 # This code stresses the "libraries are programs" paradigm to its
3020 # limits. Maybe even breaks it. We compile a program, linking it
3021 # against the deplibs as a proxy for the library. Then we can check
3022 # whether they linked in statically or dynamically with ldd.
3023 $rm conftest.c
3024 cat > conftest.c <<EOF
3025 int main() { return 0; }
3026 EOF
3027 $rm conftest
3028 $LTCC -o conftest conftest.c $deplibs
3029 if test "$?" -eq 0 ; then
3030 ldd_output=`ldd conftest`
3031 for i in $deplibs; do
3032 name="`expr $i : '-l\(.*\)'`"
3033 # If $name is empty we are operating on a -L argument.
3034 if test "$name" != "" && test "$name" -ne "0"; then
3035 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3036 case " $predeps $postdeps " in
3037 *" $i "*)
3038 newdeplibs="$newdeplibs $i"
3039 i=""
3040 ;;
3041 esac
3042 fi
3043 if test -n "$i" ; then
3044 libname=`eval \\$echo \"$libname_spec\"`
3045 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3046 set dummy $deplib_matches
3047 deplib_match=$2
3048 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3049 newdeplibs="$newdeplibs $i"
3050 else
3051 droppeddeps=yes
3052 echo
3053 echo "*** Warning: dynamic linker does not accept needed library $i."
3054 echo "*** I have the capability to make that library automatically link in when"
3055 echo "*** you link to this library. But I can only do this if you have a"
3056 echo "*** shared version of the library, which I believe you do not have"
3057 echo "*** because a test_compile did reveal that the linker did not use it for"
3058 echo "*** its dynamic dependency list that programs get resolved with at runtime."
3059 fi
3060 fi
3061 else
3062 newdeplibs="$newdeplibs $i"
3063 fi
3064 done
3065 else
3066 # Error occurred in the first compile. Let's try to salvage
3067 # the situation: Compile a separate program for each library.
3068 for i in $deplibs; do
3069 name="`expr $i : '-l\(.*\)'`"
3070 # If $name is empty we are operating on a -L argument.
3071 if test "$name" != "" && test "$name" != "0"; then
3072 $rm conftest
3073 $LTCC -o conftest conftest.c $i
3074 # Did it work?
3075 if test "$?" -eq 0 ; then
3076 ldd_output=`ldd conftest`
3077 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3078 case " $predeps $postdeps " in
3079 *" $i "*)
3080 newdeplibs="$newdeplibs $i"
3081 i=""
3082 ;;
3083 esac
3084 fi
3085 if test -n "$i" ; then
3086 libname=`eval \\$echo \"$libname_spec\"`
3087 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3088 set dummy $deplib_matches
3089 deplib_match=$2
3090 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3091 newdeplibs="$newdeplibs $i"
3092 else
3093 droppeddeps=yes
3094 echo
3095 echo "*** Warning: dynamic linker does not accept needed library $i."
3096 echo "*** I have the capability to make that library automatically link in when"
3097 echo "*** you link to this library. But I can only do this if you have a"
3098 echo "*** shared version of the library, which you do not appear to have"
3099 echo "*** because a test_compile did reveal that the linker did not use this one"
3100 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3101 fi
3102 fi
3103 else
3104 droppeddeps=yes
3105 echo
3106 echo "*** Warning! Library $i is needed by this library but I was not able to"
3107 echo "*** make it link in! You will probably need to install it or some"
3108 echo "*** library that it depends on before this library will be fully"
3109 echo "*** functional. Installing it before continuing would be even better."
3110 fi
3111 else
3112 newdeplibs="$newdeplibs $i"
3113 fi
3114 done
3115 fi
3116 ;;
3117 file_magic*)
3118 set dummy $deplibs_check_method
3119 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3120 for a_deplib in $deplibs; do
3121 name="`expr $a_deplib : '-l\(.*\)'`"
3122 # If $name is empty we are operating on a -L argument.
3123 if test "$name" != "" && test "$name" != "0"; then
3124 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3125 case " $predeps $postdeps " in
3126 *" $a_deplib "*)
3127 newdeplibs="$newdeplibs $a_deplib"
3128 a_deplib=""
3129 ;;
3130 esac
3131 fi
3132 if test -n "$a_deplib" ; then
3133 libname=`eval \\$echo \"$libname_spec\"`
3134 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3135 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3136 for potent_lib in $potential_libs; do
3137 # Follow soft links.
3138 if ls -lLd "$potent_lib" 2>/dev/null \
3139 | grep " -> " >/dev/null; then
3140 continue
3141 fi
3142 # The statement above tries to avoid entering an
3143 # endless loop below, in case of cyclic links.
3144 # We might still enter an endless loop, since a link
3145 # loop can be closed while we follow links,
3146 # but so what?
3147 potlib="$potent_lib"
3148 while test -h "$potlib" 2>/dev/null; do
3149 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3150 case $potliblink in
3151 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3152 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3153 esac
3154 done
3155 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3156 | ${SED} 10q \
3157 | $EGREP "$file_magic_regex" > /dev/null; then
3158 newdeplibs="$newdeplibs $a_deplib"
3159 a_deplib=""
3160 break 2
3161 fi
3162 done
3163 done
3164 fi
3165 if test -n "$a_deplib" ; then
3166 droppeddeps=yes
3167 echo
3168 echo "*** Warning: linker path does not have real file for library $a_deplib."
3169 echo "*** I have the capability to make that library automatically link in when"
3170 echo "*** you link to this library. But I can only do this if you have a"
3171 echo "*** shared version of the library, which you do not appear to have"
3172 echo "*** because I did check the linker path looking for a file starting"
3173 if test -z "$potlib" ; then
3174 echo "*** with $libname but no candidates were found. (...for file magic test)"
3175 else
3176 echo "*** with $libname and none of the candidates passed a file format test"
3177 echo "*** using a file magic. Last file checked: $potlib"
3178 fi
3179 fi
3180 else
3181 # Add a -L argument.
3182 newdeplibs="$newdeplibs $a_deplib"
3183 fi
3184 done # Gone through all deplibs.
3185 ;;
3186 match_pattern*)
3187 set dummy $deplibs_check_method
3188 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3189 for a_deplib in $deplibs; do
3190 name="`expr $a_deplib : '-l\(.*\)'`"
3191 # If $name is empty we are operating on a -L argument.
3192 if test -n "$name" && test "$name" != "0"; then
3193 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3194 case " $predeps $postdeps " in
3195 *" $a_deplib "*)
3196 newdeplibs="$newdeplibs $a_deplib"
3197 a_deplib=""
3198 ;;
3199 esac
3200 fi
3201 if test -n "$a_deplib" ; then
3202 libname=`eval \\$echo \"$libname_spec\"`
3203 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3204 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3205 for potent_lib in $potential_libs; do
3206 potlib="$potent_lib" # see symlink-check above in file_magic test
3207 if eval echo \"$potent_lib\" 2>/dev/null \
3208 | ${SED} 10q \
3209 | $EGREP "$match_pattern_regex" > /dev/null; then
3210 newdeplibs="$newdeplibs $a_deplib"
3211 a_deplib=""
3212 break 2
3213 fi
3214 done
3215 done
3216 fi
3217 if test -n "$a_deplib" ; then
3218 droppeddeps=yes
3219 echo
3220 echo "*** Warning: linker path does not have real file for library $a_deplib."
3221 echo "*** I have the capability to make that library automatically link in when"
3222 echo "*** you link to this library. But I can only do this if you have a"
3223 echo "*** shared version of the library, which you do not appear to have"
3224 echo "*** because I did check the linker path looking for a file starting"
3225 if test -z "$potlib" ; then
3226 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3227 else
3228 echo "*** with $libname and none of the candidates passed a file format test"
3229 echo "*** using a regex pattern. Last file checked: $potlib"
3230 fi
3231 fi
3232 else
3233 # Add a -L argument.
3234 newdeplibs="$newdeplibs $a_deplib"
3235 fi
3236 done # Gone through all deplibs.
3237 ;;
3238 none | unknown | *)
3239 newdeplibs=""
3240 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3241 -e 's/ -[LR][^ ]*//g'`
3242 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3243 for i in $predeps $postdeps ; do
3244 # can't use Xsed below, because $i might contain '/'
3245 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3246 done
3247 fi
3248 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3249 | grep . >/dev/null; then
3250 echo
3251 if test "X$deplibs_check_method" = "Xnone"; then
3252 echo "*** Warning: inter-library dependencies are not supported in this platform."
3253 else
3254 echo "*** Warning: inter-library dependencies are not known to be supported."
3255 fi
3256 echo "*** All declared inter-library dependencies are being dropped."
3257 droppeddeps=yes
3258 fi
3259 ;;
3260 esac
3261 versuffix=$versuffix_save
3262 major=$major_save
3263 release=$release_save
3264 libname=$libname_save
3265 name=$name_save
3266
3267 case $host in
3268 *-*-rhapsody* | *-*-darwin1.[012])
3269 # On Rhapsody replace the C library is the System framework
3270 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3271 ;;
3272 esac
3273
3274 if test "$droppeddeps" = yes; then
3275 if test "$module" = yes; then
3276 echo
3277 echo "*** Warning: libtool could not satisfy all declared inter-library"
3278 echo "*** dependencies of module $libname. Therefore, libtool will create"
3279 echo "*** a static module, that should work as long as the dlopening"
3280 echo "*** application is linked with the -dlopen flag."
3281 if test -z "$global_symbol_pipe"; then
3282 echo
3283 echo "*** However, this would only work if libtool was able to extract symbol"
3284 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3285 echo "*** not find such a program. So, this module is probably useless."
3286 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3287 fi
3288 if test "$build_old_libs" = no; then
3289 oldlibs="$output_objdir/$libname.$libext"
3290 build_libtool_libs=module
3291 build_old_libs=yes
3292 else
3293 build_libtool_libs=no
3294 fi
3295 else
3296 echo "*** The inter-library dependencies that have been dropped here will be"
3297 echo "*** automatically added whenever a program is linked with this library"
3298 echo "*** or is declared to -dlopen it."
3299
3300 if test "$allow_undefined" = no; then
3301 echo
3302 echo "*** Since this library must not contain undefined symbols,"
3303 echo "*** because either the platform does not support them or"
3304 echo "*** it was explicitly requested with -no-undefined,"
3305 echo "*** libtool will only create a static version of it."
3306 if test "$build_old_libs" = no; then
3307 oldlibs="$output_objdir/$libname.$libext"
3308 build_libtool_libs=module
3309 build_old_libs=yes
3310 else
3311 build_libtool_libs=no
3312 fi
3313 fi
3314 fi
3315 fi
3316 # Done checking deplibs!
3317 deplibs=$newdeplibs
3318 fi
3319
3320 # All the library-specific variables (install_libdir is set above).
3321 library_names=
3322 old_library=
3323 dlname=
3324
3325 # Test again, we may have decided not to build it any more
3326 if test "$build_libtool_libs" = yes; then
3327 if test "$hardcode_into_libs" = yes; then
3328 # Hardcode the library paths
3329 hardcode_libdirs=
3330 dep_rpath=
3331 rpath="$finalize_rpath"
3332 test "$mode" != relink && rpath="$compile_rpath$rpath"
3333 for libdir in $rpath; do
3334 if test -n "$hardcode_libdir_flag_spec"; then
3335 if test -n "$hardcode_libdir_separator"; then
3336 if test -z "$hardcode_libdirs"; then
3337 hardcode_libdirs="$libdir"
3338 else
3339 # Just accumulate the unique libdirs.
3340 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3341 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3342 ;;
3343 *)
3344 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3345 ;;
3346 esac
3347 fi
3348 else
3349 eval flag=\"$hardcode_libdir_flag_spec\"
3350 dep_rpath="$dep_rpath $flag"
3351 fi
3352 elif test -n "$runpath_var"; then
3353 case "$perm_rpath " in
3354 *" $libdir "*) ;;
3355 *) perm_rpath="$perm_rpath $libdir" ;;
3356 esac
3357 fi
3358 done
3359 # Substitute the hardcoded libdirs into the rpath.
3360 if test -n "$hardcode_libdir_separator" &&
3361 test -n "$hardcode_libdirs"; then
3362 libdir="$hardcode_libdirs"
3363 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3364 fi
3365 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3366 # We should set the runpath_var.
3367 rpath=
3368 for dir in $perm_rpath; do
3369 rpath="$rpath$dir:"
3370 done
3371 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3372 fi
3373 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3374 fi
3375
3376 shlibpath="$finalize_shlibpath"
3377 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3378 if test -n "$shlibpath"; then
3379 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3380 fi
3381
3382 # Get the real and link names of the library.
3383 eval library_names=\"$library_names_spec\"
3384 set dummy $library_names
3385 realname="$2"
3386 shift; shift
3387
3388 if test -n "$soname_spec"; then
3389 eval soname=\"$soname_spec\"
3390 else
3391 soname="$realname"
3392 fi
3393 if test -z "$dlname"; then
3394 dlname=$soname
3395 fi
3396
3397 lib="$output_objdir/$realname"
3398 for link
3399 do
3400 linknames="$linknames $link"
3401 done
3402
3403 # Use standard objects if they are pic
3404 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3405
3406 # Prepare the list of exported symbols
3407 if test -z "$export_symbols"; then
3408 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3409 $show "generating symbol list for \`$libname.la'"
3410 export_symbols="$output_objdir/$libname.exp"
3411 $run $rm $export_symbols
3412 eval cmds=\"$export_symbols_cmds\"
3413 save_ifs="$IFS"; IFS='~'
3414 for cmd in $cmds; do
3415 IFS="$save_ifs"
3416 if len=`expr "X$cmd" : ".*"` &&
3417 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3418 $show "$cmd"
3419 $run eval "$cmd" || exit $?
3420 skipped_export=false
3421 else
3422 # The command line is too long to execute in one step.
3423 $show "using reloadable object file for export list..."
3424 skipped_export=:
3425 fi
3426 done
3427 IFS="$save_ifs"
3428 if test -n "$export_symbols_regex"; then
3429 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3430 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3431 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3432 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3433 fi
3434 fi
3435 fi
3436
3437 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3438 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3439 fi
3440
3441 if test -n "$convenience"; then
3442 if test -n "$whole_archive_flag_spec"; then
3443 save_libobjs=$libobjs
3444 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3445 else
3446 gentop="$output_objdir/${outputname}x"
3447 $show "${rm}r $gentop"
3448 $run ${rm}r "$gentop"
3449 $show "$mkdir $gentop"
3450 $run $mkdir "$gentop"
3451 status=$?
3452 if test "$status" -ne 0 && test ! -d "$gentop"; then
3453 exit $status
3454 fi
3455 generated="$generated $gentop"
3456
3457 for xlib in $convenience; do
3458 # Extract the objects.
3459 case $xlib in
3460 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3461 *) xabs=`pwd`"/$xlib" ;;
3462 esac
3463 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3464 xdir="$gentop/$xlib"
3465
3466 $show "${rm}r $xdir"
3467 $run ${rm}r "$xdir"
3468 $show "$mkdir $xdir"
3469 $run $mkdir "$xdir"
3470 status=$?
3471 if test "$status" -ne 0 && test ! -d "$xdir"; then
3472 exit $status
3473 fi
3474 $show "(cd $xdir && $AR x $xabs)"
3475 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3476
3477 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3478 done
3479 fi
3480 fi
3481
3482 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3483 eval flag=\"$thread_safe_flag_spec\"
3484 linker_flags="$linker_flags $flag"
3485 fi
3486
3487 # Make a backup of the uninstalled library when relinking
3488 if test "$mode" = relink; then
3489 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3490 fi
3491
3492 # Do each of the archive commands.
3493 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3494 eval cmds=\"$archive_expsym_cmds\"
3495 else
3496 save_deplibs="$deplibs"
3497 for conv in $convenience; do
3498 tmp_deplibs=
3499 for test_deplib in $deplibs; do
3500 if test "$test_deplib" != "$conv"; then
3501 tmp_deplibs="$tmp_deplibs $test_deplib"
3502 fi
3503 done
3504 deplibs="$tmp_deplibs"
3505 done
3506 eval cmds=\"$archive_cmds\"
3507 deplibs="$save_deplibs"
3508 fi
3509
3510 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3511 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3512 :
3513 else
3514 # The command line is too long to link in one step, link piecewise.
3515 $echo "creating reloadable object files..."
3516
3517 # Save the value of $output and $libobjs because we want to
3518 # use them later. If we have whole_archive_flag_spec, we
3519 # want to use save_libobjs as it was before
3520 # whole_archive_flag_spec was expanded, because we can't
3521 # assume the linker understands whole_archive_flag_spec.
3522 # This may have to be revisited, in case too many
3523 # convenience libraries get linked in and end up exceeding
3524 # the spec.
3525 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3526 save_libobjs=$libobjs
3527 fi
3528 save_output=$output
3529
3530 # Clear the reloadable object creation command queue and
3531 # initialize k to one.
3532 test_cmds=
3533 concat_cmds=
3534 objlist=
3535 delfiles=
3536 last_robj=
3537 k=1
3538 output=$output_objdir/$save_output-${k}.$objext
3539 # Loop over the list of objects to be linked.
3540 for obj in $save_libobjs
3541 do
3542 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3543 if test "X$objlist" = X ||
3544 { len=`expr "X$test_cmds" : ".*"` &&
3545 test "$len" -le "$max_cmd_len"; }; then
3546 objlist="$objlist $obj"
3547 else
3548 # The command $test_cmds is almost too long, add a
3549 # command to the queue.
3550 if test "$k" -eq 1 ; then
3551 # The first file doesn't have a previous command to add.
3552 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3553 else
3554 # All subsequent reloadable object files will link in
3555 # the last one created.
3556 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3557 fi
3558 last_robj=$output_objdir/$save_output-${k}.$objext
3559 k=`expr $k + 1`
3560 output=$output_objdir/$save_output-${k}.$objext
3561 objlist=$obj
3562 len=1
3563 fi
3564 done
3565 # Handle the remaining objects by creating one last
3566 # reloadable object file. All subsequent reloadable object
3567 # files will link in the last one created.
3568 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3569 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3570
3571 if ${skipped_export-false}; then
3572 $show "generating symbol list for \`$libname.la'"
3573 export_symbols="$output_objdir/$libname.exp"
3574 $run $rm $export_symbols
3575 libobjs=$output
3576 # Append the command to create the export file.
3577 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3578 fi
3579
3580 # Set up a command to remove the reloadale object files
3581 # after they are used.
3582 i=0
3583 while test "$i" -lt "$k"
3584 do
3585 i=`expr $i + 1`
3586 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3587 done
3588
3589 $echo "creating a temporary reloadable object file: $output"
3590
3591 # Loop through the commands generated above and execute them.
3592 save_ifs="$IFS"; IFS='~'
3593 for cmd in $concat_cmds; do
3594 IFS="$save_ifs"
3595 $show "$cmd"
3596 $run eval "$cmd" || exit $?
3597 done
3598 IFS="$save_ifs"
3599
3600 libobjs=$output
3601 # Restore the value of output.
3602 output=$save_output
3603
3604 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3605 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3606 fi
3607 # Expand the library linking commands again to reset the
3608 # value of $libobjs for piecewise linking.
3609
3610 # Do each of the archive commands.
3611 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3612 eval cmds=\"$archive_expsym_cmds\"
3613 else
3614 eval cmds=\"$archive_cmds\"
3615 fi
3616
3617 # Append the command to remove the reloadable object files
3618 # to the just-reset $cmds.
3619 eval cmds=\"\$cmds~$rm $delfiles\"
3620 fi
3621 save_ifs="$IFS"; IFS='~'
3622 for cmd in $cmds; do
3623 IFS="$save_ifs"
3624 $show "$cmd"
3625 $run eval "$cmd" || exit $?
3626 done
3627 IFS="$save_ifs"
3628
3629 # Restore the uninstalled library and exit
3630 if test "$mode" = relink; then
3631 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3632 exit 0
3633 fi
3634
3635 # Create links to the real library.
3636 for linkname in $linknames; do
3637 if test "$realname" != "$linkname"; then
3638 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3639 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3640 fi
3641 done
3642
3643 # If -module or -export-dynamic was specified, set the dlname.
3644 if test "$module" = yes || test "$export_dynamic" = yes; then
3645 # On all known operating systems, these are identical.
3646 dlname="$soname"
3647 fi
3648 fi
3649 ;;
3650
3651 obj)
3652 if test -n "$deplibs"; then
3653 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3654 fi
3655
3656 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3657 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3658 fi
3659
3660 if test -n "$rpath"; then
3661 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3662 fi
3663
3664 if test -n "$xrpath"; then
3665 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3666 fi
3667
3668 if test -n "$vinfo"; then
3669 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3670 fi
3671
3672 if test -n "$release"; then
3673 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3674 fi
3675
3676 case $output in
3677 *.lo)
3678 if test -n "$objs$old_deplibs"; then
3679 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3680 exit 1
3681 fi
3682 libobj="$output"
3683 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3684 ;;
3685 *)
3686 libobj=
3687 obj="$output"
3688 ;;
3689 esac
3690
3691 # Delete the old objects.
3692 $run $rm $obj $libobj
3693
3694 # Objects from convenience libraries. This assumes
3695 # single-version convenience libraries. Whenever we create
3696 # different ones for PIC/non-PIC, this we'll have to duplicate
3697 # the extraction.
3698 reload_conv_objs=
3699 gentop=
3700 # reload_cmds runs $LD directly, so let us get rid of
3701 # -Wl from whole_archive_flag_spec
3702 wl=
3703
3704 if test -n "$convenience"; then
3705 if test -n "$whole_archive_flag_spec"; then
3706 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3707 else
3708 gentop="$output_objdir/${obj}x"
3709 $show "${rm}r $gentop"
3710 $run ${rm}r "$gentop"
3711 $show "$mkdir $gentop"
3712 $run $mkdir "$gentop"
3713 status=$?
3714 if test "$status" -ne 0 && test ! -d "$gentop"; then
3715 exit $status
3716 fi
3717 generated="$generated $gentop"
3718
3719 for xlib in $convenience; do
3720 # Extract the objects.
3721 case $xlib in
3722 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3723 *) xabs=`pwd`"/$xlib" ;;
3724 esac
3725 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3726 xdir="$gentop/$xlib"
3727
3728 $show "${rm}r $xdir"
3729 $run ${rm}r "$xdir"
3730 $show "$mkdir $xdir"
3731 $run $mkdir "$xdir"
3732 status=$?
3733 if test "$status" -ne 0 && test ! -d "$xdir"; then
3734 exit $status
3735 fi
3736 $show "(cd $xdir && $AR x $xabs)"
3737 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3738
3739 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3740 done
3741 fi
3742 fi
3743
3744 # Create the old-style object.
3745 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
3746
3747 output="$obj"
3748 eval cmds=\"$reload_cmds\"
3749 save_ifs="$IFS"; IFS='~'
3750 for cmd in $cmds; do
3751 IFS="$save_ifs"
3752 $show "$cmd"
3753 $run eval "$cmd" || exit $?
3754 done
3755 IFS="$save_ifs"
3756
3757 # Exit if we aren't doing a library object file.
3758 if test -z "$libobj"; then
3759 if test -n "$gentop"; then
3760 $show "${rm}r $gentop"
3761 $run ${rm}r $gentop
3762 fi
3763
3764 exit 0
3765 fi
3766
3767 if test "$build_libtool_libs" != yes; then
3768 if test -n "$gentop"; then
3769 $show "${rm}r $gentop"
3770 $run ${rm}r $gentop
3771 fi
3772
3773 # Create an invalid libtool object if no PIC, so that we don't
3774 # accidentally link it into a program.
3775 # $show "echo timestamp > $libobj"
3776 # $run eval "echo timestamp > $libobj" || exit $?
3777 exit 0
3778 fi
3779
3780 if test -n "$pic_flag" || test "$pic_mode" != default; then
3781 # Only do commands if we really have different PIC objects.
3782 reload_objs="$libobjs $reload_conv_objs"
3783 output="$libobj"
3784 eval cmds=\"$reload_cmds\"
3785 save_ifs="$IFS"; IFS='~'
3786 for cmd in $cmds; do
3787 IFS="$save_ifs"
3788 $show "$cmd"
3789 $run eval "$cmd" || exit $?
3790 done
3791 IFS="$save_ifs"
3792 fi
3793
3794 if test -n "$gentop"; then
3795 $show "${rm}r $gentop"
3796 $run ${rm}r $gentop
3797 fi
3798
3799 exit 0
3800 ;;
3801
3802 prog)
3803 case $host in
3804 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3805 esac
3806 if test -n "$vinfo"; then
3807 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3808 fi
3809
3810 if test -n "$release"; then
3811 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3812 fi
3813
3814 if test "$preload" = yes; then
3815 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3816 test "$dlopen_self_static" = unknown; then
3817 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3818 fi
3819 fi
3820
3821 case $host in
3822 *-*-rhapsody* | *-*-darwin1.[012])
3823 # On Rhapsody replace the C library is the System framework
3824 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3825 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3826 ;;
3827 esac
3828
3829 compile_command="$compile_command $compile_deplibs"
3830 finalize_command="$finalize_command $finalize_deplibs"
3831
3832 if test -n "$rpath$xrpath"; then
3833 # If the user specified any rpath flags, then add them.
3834 for libdir in $rpath $xrpath; do
3835 # This is the magic to use -rpath.
3836 case "$finalize_rpath " in
3837 *" $libdir "*) ;;
3838 *) finalize_rpath="$finalize_rpath $libdir" ;;
3839 esac
3840 done
3841 fi
3842
3843 # Now hardcode the library paths
3844 rpath=
3845 hardcode_libdirs=
3846 for libdir in $compile_rpath $finalize_rpath; do
3847 if test -n "$hardcode_libdir_flag_spec"; then
3848 if test -n "$hardcode_libdir_separator"; then
3849 if test -z "$hardcode_libdirs"; then
3850 hardcode_libdirs="$libdir"
3851 else
3852 # Just accumulate the unique libdirs.
3853 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3854 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3855 ;;
3856 *)
3857 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3858 ;;
3859 esac
3860 fi
3861 else
3862 eval flag=\"$hardcode_libdir_flag_spec\"
3863 rpath="$rpath $flag"
3864 fi
3865 elif test -n "$runpath_var"; then
3866 case "$perm_rpath " in
3867 *" $libdir "*) ;;
3868 *) perm_rpath="$perm_rpath $libdir" ;;
3869 esac
3870 fi
3871 case $host in
3872 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3873 case :$dllsearchpath: in
3874 *":$libdir:"*) ;;
3875 *) dllsearchpath="$dllsearchpath:$libdir";;
3876 esac
3877 ;;
3878 esac
3879 done
3880 # Substitute the hardcoded libdirs into the rpath.
3881 if test -n "$hardcode_libdir_separator" &&
3882 test -n "$hardcode_libdirs"; then
3883 libdir="$hardcode_libdirs"
3884 eval rpath=\" $hardcode_libdir_flag_spec\"
3885 fi
3886 compile_rpath="$rpath"
3887
3888 rpath=
3889 hardcode_libdirs=
3890 for libdir in $finalize_rpath; do
3891 if test -n "$hardcode_libdir_flag_spec"; then
3892 if test -n "$hardcode_libdir_separator"; then
3893 if test -z "$hardcode_libdirs"; then
3894 hardcode_libdirs="$libdir"
3895 else
3896 # Just accumulate the unique libdirs.
3897 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3898 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3899 ;;
3900 *)
3901 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3902 ;;
3903 esac
3904 fi
3905 else
3906 eval flag=\"$hardcode_libdir_flag_spec\"
3907 rpath="$rpath $flag"
3908 fi
3909 elif test -n "$runpath_var"; then
3910 case "$finalize_perm_rpath " in
3911 *" $libdir "*) ;;
3912 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3913 esac
3914 fi
3915 done
3916 # Substitute the hardcoded libdirs into the rpath.
3917 if test -n "$hardcode_libdir_separator" &&
3918 test -n "$hardcode_libdirs"; then
3919 libdir="$hardcode_libdirs"
3920 eval rpath=\" $hardcode_libdir_flag_spec\"
3921 fi
3922 finalize_rpath="$rpath"
3923
3924 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3925 # Transform all the library objects into standard objects.
3926 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3927 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3928 fi
3929
3930 dlsyms=
3931 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3932 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3933 dlsyms="${outputname}S.c"
3934 else
3935 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3936 fi
3937 fi
3938
3939 if test -n "$dlsyms"; then
3940 case $dlsyms in
3941 "") ;;
3942 *.c)
3943 # Discover the nlist of each of the dlfiles.
3944 nlist="$output_objdir/${outputname}.nm"
3945
3946 $show "$rm $nlist ${nlist}S ${nlist}T"
3947 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3948
3949 # Parse the name list into a source file.
3950 $show "creating $output_objdir/$dlsyms"
3951
3952 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3953 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3954 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3955
3956 #ifdef __cplusplus
3957 extern \"C\" {
3958 #endif
3959
3960 /* Prevent the only kind of declaration conflicts we can make. */
3961 #define lt_preloaded_symbols some_other_symbol
3962
3963 /* External symbol declarations for the compiler. */\
3964 "
3965
3966 if test "$dlself" = yes; then
3967 $show "generating symbol list for \`$output'"
3968
3969 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3970
3971 # Add our own program objects to the symbol list.
3972 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3973 for arg in $progfiles; do
3974 $show "extracting global C symbols from \`$arg'"
3975 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3976 done
3977
3978 if test -n "$exclude_expsyms"; then
3979 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3980 $run eval '$mv "$nlist"T "$nlist"'
3981 fi
3982
3983 if test -n "$export_symbols_regex"; then
3984 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3985 $run eval '$mv "$nlist"T "$nlist"'
3986 fi
3987
3988 # Prepare the list of exported symbols
3989 if test -z "$export_symbols"; then
3990 export_symbols="$output_objdir/$output.exp"
3991 $run $rm $export_symbols
3992 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3993 else
3994 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3995 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3996 $run eval 'mv "$nlist"T "$nlist"'
3997 fi
3998 fi
3999
4000 for arg in $dlprefiles; do
4001 $show "extracting global C symbols from \`$arg'"
4002 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
4003 $run eval 'echo ": $name " >> "$nlist"'
4004 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4005 done
4006
4007 if test -z "$run"; then
4008 # Make sure we have at least an empty file.
4009 test -f "$nlist" || : > "$nlist"
4010
4011 if test -n "$exclude_expsyms"; then
4012 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4013 $mv "$nlist"T "$nlist"
4014 fi
4015
4016 # Try sorting and uniquifying the output.
4017 if grep -v "^: " < "$nlist" |
4018 if sort -k 3 </dev/null >/dev/null 2>&1; then
4019 sort -k 3
4020 else
4021 sort +2
4022 fi |
4023 uniq > "$nlist"S; then
4024 :
4025 else
4026 grep -v "^: " < "$nlist" > "$nlist"S
4027 fi
4028
4029 if test -f "$nlist"S; then
4030 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4031 else
4032 echo '/* NONE */' >> "$output_objdir/$dlsyms"
4033 fi
4034
4035 $echo >> "$output_objdir/$dlsyms" "\
4036
4037 #undef lt_preloaded_symbols
4038
4039 #if defined (__STDC__) && __STDC__
4040 # define lt_ptr void *
4041 #else
4042 # define lt_ptr char *
4043 # define const
4044 #endif
4045
4046 /* The mapping between symbol names and symbols. */
4047 const struct {
4048 const char *name;
4049 lt_ptr address;
4050 }
4051 lt_preloaded_symbols[] =
4052 {\
4053 "
4054
4055 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4056
4057 $echo >> "$output_objdir/$dlsyms" "\
4058 {0, (lt_ptr) 0}
4059 };
4060
4061 /* This works around a problem in FreeBSD linker */
4062 #ifdef FREEBSD_WORKAROUND
4063 static const void *lt_preloaded_setup() {
4064 return lt_preloaded_symbols;
4065 }
4066 #endif
4067
4068 #ifdef __cplusplus
4069 }
4070 #endif\
4071 "
4072 fi
4073
4074 pic_flag_for_symtable=
4075 case $host in
4076 # compiling the symbol table file with pic_flag works around
4077 # a FreeBSD bug that causes programs to crash when -lm is
4078 # linked before any other PIC object. But we must not use
4079 # pic_flag when linking with -static. The problem exists in
4080 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4081 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4082 case "$compile_command " in
4083 *" -static "*) ;;
4084 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4085 esac;;
4086 *-*-hpux*)
4087 case "$compile_command " in
4088 *" -static "*) ;;
4089 *) pic_flag_for_symtable=" $pic_flag";;
4090 esac
4091 esac
4092
4093 # Now compile the dynamic symbol file.
4094 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4095 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4096
4097 # Clean up the generated files.
4098 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4099 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4100
4101 # Transform the symbol file into the correct name.
4102 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4103 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4104 ;;
4105 *)
4106 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4107 exit 1
4108 ;;
4109 esac
4110 else
4111 # We keep going just in case the user didn't refer to
4112 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4113 # really was required.
4114
4115 # Nullify the symbol file.
4116 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4117 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4118 fi
4119
4120 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4121 # Replace the output file specification.
4122 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4123 link_command="$compile_command$compile_rpath"
4124
4125 # We have no uninstalled library dependencies, so finalize right now.
4126 $show "$link_command"
4127 $run eval "$link_command"
4128 status=$?
4129
4130 # Delete the generated files.
4131 if test -n "$dlsyms"; then
4132 $show "$rm $output_objdir/${outputname}S.${objext}"
4133 $run $rm "$output_objdir/${outputname}S.${objext}"
4134 fi
4135
4136 exit $status
4137 fi
4138
4139 if test -n "$shlibpath_var"; then
4140 # We should set the shlibpath_var
4141 rpath=
4142 for dir in $temp_rpath; do
4143 case $dir in
4144 [\\/]* | [A-Za-z]:[\\/]*)
4145 # Absolute path.
4146 rpath="$rpath$dir:"
4147 ;;
4148 *)
4149 # Relative path: add a thisdir entry.
4150 rpath="$rpath\$thisdir/$dir:"
4151 ;;
4152 esac
4153 done
4154 temp_rpath="$rpath"
4155 fi
4156
4157 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4158 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4159 fi
4160 if test -n "$finalize_shlibpath"; then
4161 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4162 fi
4163
4164 compile_var=
4165 finalize_var=
4166 if test -n "$runpath_var"; then
4167 if test -n "$perm_rpath"; then
4168 # We should set the runpath_var.
4169 rpath=
4170 for dir in $perm_rpath; do
4171 rpath="$rpath$dir:"
4172 done
4173 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4174 fi
4175 if test -n "$finalize_perm_rpath"; then
4176 # We should set the runpath_var.
4177 rpath=
4178 for dir in $finalize_perm_rpath; do
4179 rpath="$rpath$dir:"
4180 done
4181 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4182 fi
4183 fi
4184
4185 if test "$no_install" = yes; then
4186 # We don't need to create a wrapper script.
4187 link_command="$compile_var$compile_command$compile_rpath"
4188 # Replace the output file specification.
4189 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4190 # Delete the old output file.
4191 $run $rm $output
4192 # Link the executable and exit
4193 $show "$link_command"
4194 $run eval "$link_command" || exit $?
4195 exit 0
4196 fi
4197
4198 if test "$hardcode_action" = relink; then
4199 # Fast installation is not supported
4200 link_command="$compile_var$compile_command$compile_rpath"
4201 relink_command="$finalize_var$finalize_command$finalize_rpath"
4202
4203 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4204 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4205 else
4206 if test "$fast_install" != no; then
4207 link_command="$finalize_var$compile_command$finalize_rpath"
4208 if test "$fast_install" = yes; then
4209 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4210 else
4211 # fast_install is set to needless
4212 relink_command=
4213 fi
4214 else
4215 link_command="$compile_var$compile_command$compile_rpath"
4216 relink_command="$finalize_var$finalize_command$finalize_rpath"
4217 fi
4218 fi
4219
4220 # Replace the output file specification.
4221 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4222
4223 # Delete the old output files.
4224 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4225
4226 $show "$link_command"
4227 $run eval "$link_command" || exit $?
4228
4229 # Now create the wrapper script.
4230 $show "creating $output"
4231
4232 # Quote the relink command for shipping.
4233 if test -n "$relink_command"; then
4234 # Preserve any variables that may affect compiler behavior
4235 for var in $variables_saved_for_relink; do
4236 if eval test -z \"\${$var+set}\"; then
4237 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4238 elif eval var_value=\$$var; test -z "$var_value"; then
4239 relink_command="$var=; export $var; $relink_command"
4240 else
4241 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4242 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4243 fi
4244 done
4245 relink_command="(cd `pwd`; $relink_command)"
4246 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4247 fi
4248
4249 # Quote $echo for shipping.
4250 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4251 case $0 in
4252 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4253 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4254 esac
4255 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4256 else
4257 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4258 fi
4259
4260 # Only actually do things if our run command is non-null.
4261 if test -z "$run"; then
4262 # win32 will think the script is a binary if it has
4263 # a .exe suffix, so we strip it off here.
4264 case $output in
4265 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4266 esac
4267 # test for cygwin because mv fails w/o .exe extensions
4268 case $host in
4269 *cygwin*)
4270 exeext=.exe
4271 outputname=`echo $outputname|${SED} 's,.exe$,,'` ;;
4272 *) exeext= ;;
4273 esac
4274 $rm $output
4275 trap "$rm $output; exit 1" 1 2 15
4276
4277 $echo > $output "\
4278 #! $SHELL
4279
4280 # $output - temporary wrapper script for $objdir/$outputname
4281 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4282 #
4283 # The $output program cannot be directly executed until all the libtool
4284 # libraries that it depends on are installed.
4285 #
4286 # This wrapper script should never be moved out of the build directory.
4287 # If it is, it will not operate correctly.
4288
4289 # Sed substitution that helps us do robust quoting. It backslashifies
4290 # metacharacters that are still active within double-quoted strings.
4291 Xsed='${SED} -e 1s/^X//'
4292 sed_quote_subst='$sed_quote_subst'
4293
4294 # The HP-UX ksh and POSIX shell print the target directory to stdout
4295 # if CDPATH is set.
4296 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4297
4298 relink_command=\"$relink_command\"
4299
4300 # This environment variable determines our operation mode.
4301 if test \"\$libtool_install_magic\" = \"$magic\"; then
4302 # install mode needs the following variable:
4303 notinst_deplibs='$notinst_deplibs'
4304 else
4305 # When we are sourced in execute mode, \$file and \$echo are already set.
4306 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4307 echo=\"$qecho\"
4308 file=\"\$0\"
4309 # Make sure echo works.
4310 if test \"X\$1\" = X--no-reexec; then
4311 # Discard the --no-reexec flag, and continue.
4312 shift
4313 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4314 # Yippee, \$echo works!
4315 :
4316 else
4317 # Restart under the correct shell, and then maybe \$echo will work.
4318 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4319 fi
4320 fi\
4321 "
4322 $echo >> $output "\
4323
4324 # Find the directory that this script lives in.
4325 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4326 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4327
4328 # Follow symbolic links until we get to the real thisdir.
4329 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4330 while test -n \"\$file\"; do
4331 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4332
4333 # If there was a directory component, then change thisdir.
4334 if test \"x\$destdir\" != \"x\$file\"; then
4335 case \"\$destdir\" in
4336 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4337 *) thisdir=\"\$thisdir/\$destdir\" ;;
4338 esac
4339 fi
4340
4341 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4342 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4343 done
4344
4345 # Try to get the absolute directory name.
4346 absdir=\`cd \"\$thisdir\" && pwd\`
4347 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4348 "
4349
4350 if test "$fast_install" = yes; then
4351 echo >> $output "\
4352 program=lt-'$outputname'$exeext
4353 progdir=\"\$thisdir/$objdir\"
4354
4355 if test ! -f \"\$progdir/\$program\" || \\
4356 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4357 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4358
4359 file=\"\$\$-\$program\"
4360
4361 if test ! -d \"\$progdir\"; then
4362 $mkdir \"\$progdir\"
4363 else
4364 $rm \"\$progdir/\$file\"
4365 fi"
4366
4367 echo >> $output "\
4368
4369 # relink executable if necessary
4370 if test -n \"\$relink_command\"; then
4371 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4372 else
4373 $echo \"\$relink_command_output\" >&2
4374 $rm \"\$progdir/\$file\"
4375 exit 1
4376 fi
4377 fi
4378
4379 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4380 { $rm \"\$progdir/\$program\";
4381 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4382 $rm \"\$progdir/\$file\"
4383 fi"
4384 else
4385 echo >> $output "\
4386 program='$outputname'
4387 progdir=\"\$thisdir/$objdir\"
4388 "
4389 fi
4390
4391 echo >> $output "\
4392
4393 if test -f \"\$progdir/\$program\"; then"
4394
4395 # Export our shlibpath_var if we have one.
4396 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4397 $echo >> $output "\
4398 # Add our own library path to $shlibpath_var
4399 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4400
4401 # Some systems cannot cope with colon-terminated $shlibpath_var
4402 # The second colon is a workaround for a bug in BeOS R4 sed
4403 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4404
4405 export $shlibpath_var
4406 "
4407 fi
4408
4409 # fixup the dll searchpath if we need to.
4410 if test -n "$dllsearchpath"; then
4411 $echo >> $output "\
4412 # Add the dll search path components to the executable PATH
4413 PATH=$dllsearchpath:\$PATH
4414 "
4415 fi
4416
4417 $echo >> $output "\
4418 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4419 # Run the actual program with our arguments.
4420 "
4421 case $host in
4422 # Backslashes separate directories on plain windows
4423 *-*-mingw | *-*-os2*)
4424 $echo >> $output "\
4425 exec \$progdir\\\\\$program \${1+\"\$@\"}
4426 "
4427 ;;
4428
4429 *)
4430 $echo >> $output "\
4431 exec \$progdir/\$program \${1+\"\$@\"}
4432 "
4433 ;;
4434 esac
4435 $echo >> $output "\
4436 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4437 exit 1
4438 fi
4439 else
4440 # The program doesn't exist.
4441 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4442 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4443 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4444 exit 1
4445 fi
4446 fi\
4447 "
4448 chmod +x $output
4449 fi
4450 exit 0
4451 ;;
4452 esac
4453
4454 # See if we need to build an old-fashioned archive.
4455 for oldlib in $oldlibs; do
4456
4457 if test "$build_libtool_libs" = convenience; then
4458 oldobjs="$libobjs_save"
4459 addlibs="$convenience"
4460 build_libtool_libs=no
4461 else
4462 if test "$build_libtool_libs" = module; then
4463 oldobjs="$libobjs_save"
4464 build_libtool_libs=no
4465 else
4466 oldobjs="$old_deplibs $non_pic_objects"
4467 fi
4468 addlibs="$old_convenience"
4469 fi
4470
4471 if test -n "$addlibs"; then
4472 gentop="$output_objdir/${outputname}x"
4473 $show "${rm}r $gentop"
4474 $run ${rm}r "$gentop"
4475 $show "$mkdir $gentop"
4476 $run $mkdir "$gentop"
4477 status=$?
4478 if test "$status" -ne 0 && test ! -d "$gentop"; then
4479 exit $status
4480 fi
4481 generated="$generated $gentop"
4482
4483 # Add in members from convenience archives.
4484 for xlib in $addlibs; do
4485 # Extract the objects.
4486 case $xlib in
4487 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4488 *) xabs=`pwd`"/$xlib" ;;
4489 esac
4490 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4491 xdir="$gentop/$xlib"
4492
4493 $show "${rm}r $xdir"
4494 $run ${rm}r "$xdir"
4495 $show "$mkdir $xdir"
4496 $run $mkdir "$xdir"
4497 status=$?
4498 if test "$status" -ne 0 && test ! -d "$xdir"; then
4499 exit $status
4500 fi
4501 $show "(cd $xdir && $AR x $xabs)"
4502 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4503
4504 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4505 done
4506 fi
4507
4508 # Do each command in the archive commands.
4509 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4510 eval cmds=\"$old_archive_from_new_cmds\"
4511 else
4512 eval cmds=\"$old_archive_cmds\"
4513
4514 if len=`expr "X$cmds" : ".*"` &&
4515 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4516 :
4517 else
4518 # the command line is too long to link in one step, link in parts
4519 $echo "using piecewise archive linking..."
4520 save_RANLIB=$RANLIB
4521 RANLIB=:
4522 objlist=
4523 concat_cmds=
4524 save_oldobjs=$oldobjs
4525 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4526 # encoded into archives. This makes 'ar r' malfunction in
4527 # this piecewise linking case whenever conflicting object
4528 # names appear in distinct ar calls; check, warn and compensate.
4529 if (for obj in $save_oldobjs
4530 do
4531 $echo "X$obj" | $Xsed -e 's%^.*/%%'
4532 done | sort | sort -uc >/dev/null 2>&1); then
4533 :
4534 else
4535 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4536 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4537 AR_FLAGS=cq
4538 fi
4539 for obj in $save_oldobjs
4540 do
4541 oldobjs="$objlist $obj"
4542 objlist="$objlist $obj"
4543 eval test_cmds=\"$old_archive_cmds\"
4544 if len=`expr "X$test_cmds" : ".*"` &&
4545 test "$len" -le "$max_cmd_len"; then
4546 :
4547 else
4548 # the above command should be used before it gets too long
4549 oldobjs=$objlist
4550 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4551 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4552 objlist=
4553 fi
4554 done
4555 RANLIB=$save_RANLIB
4556 oldobjs=$objlist
4557 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4558 fi
4559 fi
4560 save_ifs="$IFS"; IFS='~'
4561 for cmd in $cmds; do
4562 IFS="$save_ifs"
4563 $show "$cmd"
4564 $run eval "$cmd" || exit $?
4565 done
4566 IFS="$save_ifs"
4567 done
4568
4569 if test -n "$generated"; then
4570 $show "${rm}r$generated"
4571 $run ${rm}r$generated
4572 fi
4573
4574 # Now create the libtool archive.
4575 case $output in
4576 *.la)
4577 old_library=
4578 test "$build_old_libs" = yes && old_library="$libname.$libext"
4579 $show "creating $output"
4580
4581 # Preserve any variables that may affect compiler behavior
4582 for var in $variables_saved_for_relink; do
4583 if eval test -z \"\${$var+set}\"; then
4584 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4585 elif eval var_value=\$$var; test -z "$var_value"; then
4586 relink_command="$var=; export $var; $relink_command"
4587 else
4588 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4589 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4590 fi
4591 done
4592 # Quote the link command for shipping.
4593 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
4594 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4595
4596 # Only create the output if not a dry run.
4597 if test -z "$run"; then
4598 for installed in no yes; do
4599 if test "$installed" = yes; then
4600 if test -z "$install_libdir"; then
4601 break
4602 fi
4603 output="$output_objdir/$outputname"i
4604 # Replace all uninstalled libtool libraries with the installed ones
4605 newdependency_libs=
4606 for deplib in $dependency_libs; do
4607 case $deplib in
4608 *.la)
4609 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4610 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4611 if test -z "$libdir"; then
4612 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4613 exit 1
4614 fi
4615 newdependency_libs="$newdependency_libs $libdir/$name"
4616 ;;
4617 *) newdependency_libs="$newdependency_libs $deplib" ;;
4618 esac
4619 done
4620 dependency_libs="$newdependency_libs"
4621 newdlfiles=
4622 for lib in $dlfiles; do
4623 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4624 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4625 if test -z "$libdir"; then
4626 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4627 exit 1
4628 fi
4629 newdlfiles="$newdlfiles $libdir/$name"
4630 done
4631 dlfiles="$newdlfiles"
4632 newdlprefiles=
4633 for lib in $dlprefiles; do
4634 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4635 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4636 if test -z "$libdir"; then
4637 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4638 exit 1
4639 fi
4640 newdlprefiles="$newdlprefiles $libdir/$name"
4641 done
4642 dlprefiles="$newdlprefiles"
4643 fi
4644 $rm $output
4645 # place dlname in correct position for cygwin
4646 tdlname=$dlname
4647 case $host,$output,$installed,$module,$dlname in
4648 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4649 esac
4650 $echo > $output "\
4651 # $outputname - a libtool library file
4652 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4653 #
4654 # Please DO NOT delete this file!
4655 # It is necessary for linking the library.
4656
4657 # The name that we can dlopen(3).
4658 dlname='$tdlname'
4659
4660 # Names of this library.
4661 library_names='$library_names'
4662
4663 # The name of the static archive.
4664 old_library='$old_library'
4665
4666 # Libraries that this one depends upon.
4667 dependency_libs='$dependency_libs'
4668
4669 # Version information for $libname.
4670 current=$current
4671 age=$age
4672 revision=$revision
4673
4674 # Is this an already installed library?
4675 installed=$installed
4676
4677 # Files to dlopen/dlpreopen
4678 dlopen='$dlfiles'
4679 dlpreopen='$dlprefiles'
4680
4681 # Directory that this library needs to be installed in:
4682 libdir='$install_libdir'"
4683 if test "$installed" = no && test "$need_relink" = yes; then
4684 $echo >> $output "\
4685 relink_command=\"$relink_command\""
4686 fi
4687 done
4688 fi
4689
4690 # Do a symbolic link so that the libtool archive can be found in
4691 # LD_LIBRARY_PATH before the program is installed.
4692 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4693 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4694 ;;
4695 esac
4696 exit 0
4697 ;;
4698
4699 # libtool install mode
4700 install)
4701 modename="$modename: install"
4702
4703 # There may be an optional sh(1) argument at the beginning of
4704 # install_prog (especially on Windows NT).
4705 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4706 # Allow the use of GNU shtool's install command.
4707 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4708 # Aesthetically quote it.
4709 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4710 case $arg in
4711 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4712 arg="\"$arg\""
4713 ;;
4714 esac
4715 install_prog="$arg "
4716 arg="$1"
4717 shift
4718 else
4719 install_prog=
4720 arg="$nonopt"
4721 fi
4722
4723 # The real first argument should be the name of the installation program.
4724 # Aesthetically quote it.
4725 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4726 case $arg in
4727 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4728 arg="\"$arg\""
4729 ;;
4730 esac
4731 install_prog="$install_prog$arg"
4732
4733 # We need to accept at least all the BSD install flags.
4734 dest=
4735 files=
4736 opts=
4737 prev=
4738 install_type=
4739 isdir=no
4740 stripme=
4741 for arg
4742 do
4743 if test -n "$dest"; then
4744 files="$files $dest"
4745 dest="$arg"
4746 continue
4747 fi
4748
4749 case $arg in
4750 -d) isdir=yes ;;
4751 -f) prev="-f" ;;
4752 -g) prev="-g" ;;
4753 -m) prev="-m" ;;
4754 -o) prev="-o" ;;
4755 -s)
4756 stripme=" -s"
4757 continue
4758 ;;
4759 -*) ;;
4760
4761 *)
4762 # If the previous option needed an argument, then skip it.
4763 if test -n "$prev"; then
4764 prev=
4765 else
4766 dest="$arg"
4767 continue
4768 fi
4769 ;;
4770 esac
4771
4772 # Aesthetically quote the argument.
4773 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4774 case $arg in
4775 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4776 arg="\"$arg\""
4777 ;;
4778 esac
4779 install_prog="$install_prog $arg"
4780 done
4781
4782 if test -z "$install_prog"; then
4783 $echo "$modename: you must specify an install program" 1>&2
4784 $echo "$help" 1>&2
4785 exit 1
4786 fi
4787
4788 if test -n "$prev"; then
4789 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4790 $echo "$help" 1>&2
4791 exit 1
4792 fi
4793
4794 if test -z "$files"; then
4795 if test -z "$dest"; then
4796 $echo "$modename: no file or destination specified" 1>&2
4797 else
4798 $echo "$modename: you must specify a destination" 1>&2
4799 fi
4800 $echo "$help" 1>&2
4801 exit 1
4802 fi
4803
4804 # Strip any trailing slash from the destination.
4805 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4806
4807 # Check to see that the destination is a directory.
4808 test -d "$dest" && isdir=yes
4809 if test "$isdir" = yes; then
4810 destdir="$dest"
4811 destname=
4812 else
4813 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4814 test "X$destdir" = "X$dest" && destdir=.
4815 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4816
4817 # Not a directory, so check to see that there is only one file specified.
4818 set dummy $files
4819 if test "$#" -gt 2; then
4820 $echo "$modename: \`$dest' is not a directory" 1>&2
4821 $echo "$help" 1>&2
4822 exit 1
4823 fi
4824 fi
4825 case $destdir in
4826 [\\/]* | [A-Za-z]:[\\/]*) ;;
4827 *)
4828 for file in $files; do
4829 case $file in
4830 *.lo) ;;
4831 *)
4832 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4833 $echo "$help" 1>&2
4834 exit 1
4835 ;;
4836 esac
4837 done
4838 ;;
4839 esac
4840
4841 # This variable tells wrapper scripts just to set variables rather
4842 # than running their programs.
4843 libtool_install_magic="$magic"
4844
4845 staticlibs=
4846 future_libdirs=
4847 current_libdirs=
4848 for file in $files; do
4849
4850 # Do each installation.
4851 case $file in
4852 *.$libext)
4853 # Do the static libraries later.
4854 staticlibs="$staticlibs $file"
4855 ;;
4856
4857 *.la)
4858 # Check to see that this really is a libtool archive.
4859 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4860 else
4861 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4862 $echo "$help" 1>&2
4863 exit 1
4864 fi
4865
4866 library_names=
4867 old_library=
4868 relink_command=
4869 # If there is no directory component, then add one.
4870 case $file in
4871 */* | *\\*) . $file ;;
4872 *) . ./$file ;;
4873 esac
4874
4875 # Add the libdir to current_libdirs if it is the destination.
4876 if test "X$destdir" = "X$libdir"; then
4877 case "$current_libdirs " in
4878 *" $libdir "*) ;;
4879 *) current_libdirs="$current_libdirs $libdir" ;;
4880 esac
4881 else
4882 # Note the libdir as a future libdir.
4883 case "$future_libdirs " in
4884 *" $libdir "*) ;;
4885 *) future_libdirs="$future_libdirs $libdir" ;;
4886 esac
4887 fi
4888
4889 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4890 test "X$dir" = "X$file/" && dir=
4891 dir="$dir$objdir"
4892
4893 if test -n "$relink_command"; then
4894 # Determine the prefix the user has applied to our future dir.
4895 inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
4896
4897 # Don't allow the user to place us outside of our expected
4898 # location b/c this prevents finding dependent libraries that
4899 # are installed to the same prefix.
4900 # At present, this check doesn't affect windows .dll's that
4901 # are installed into $libdir/../bin (currently, that works fine)
4902 # but it's something to keep an eye on.
4903 if test "$inst_prefix_dir" = "$destdir"; then
4904 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4905 exit 1
4906 fi
4907
4908 if test -n "$inst_prefix_dir"; then
4909 # Stick the inst_prefix_dir data into the link command.
4910 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4911 else
4912 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4913 fi
4914
4915 $echo "$modename: warning: relinking \`$file'" 1>&2
4916 $show "$relink_command"
4917 if $run eval "$relink_command"; then :
4918 else
4919 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4920 exit 1
4921 fi
4922 fi
4923
4924 # See the names of the shared library.
4925 set dummy $library_names
4926 if test -n "$2"; then
4927 realname="$2"
4928 shift
4929 shift
4930
4931 srcname="$realname"
4932 test -n "$relink_command" && srcname="$realname"T
4933
4934 # Install the shared library and build the symlinks.
4935 $show "$install_prog $dir/$srcname $destdir/$realname"
4936 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4937 if test -n "$stripme" && test -n "$striplib"; then
4938 $show "$striplib $destdir/$realname"
4939 $run eval "$striplib $destdir/$realname" || exit $?
4940 fi
4941
4942 if test "$#" -gt 0; then
4943 # Delete the old symlinks, and create new ones.
4944 for linkname
4945 do
4946 if test "$linkname" != "$realname"; then
4947 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4948 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4949 fi
4950 done
4951 fi
4952
4953 # Do each command in the postinstall commands.
4954 lib="$destdir/$realname"
4955 eval cmds=\"$postinstall_cmds\"
4956 save_ifs="$IFS"; IFS='~'
4957 for cmd in $cmds; do
4958 IFS="$save_ifs"
4959 $show "$cmd"
4960 $run eval "$cmd" || exit $?
4961 done
4962 IFS="$save_ifs"
4963 fi
4964
4965 # Install the pseudo-library for information purposes.
4966 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4967 instname="$dir/$name"i
4968 $show "$install_prog $instname $destdir/$name"
4969 $run eval "$install_prog $instname $destdir/$name" || exit $?
4970
4971 # Maybe install the static library, too.
4972 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4973 ;;
4974
4975 *.lo)
4976 # Install (i.e. copy) a libtool object.
4977
4978 # Figure out destination file name, if it wasn't already specified.
4979 if test -n "$destname"; then
4980 destfile="$destdir/$destname"
4981 else
4982 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4983 destfile="$destdir/$destfile"
4984 fi
4985
4986 # Deduce the name of the destination old-style object file.
4987 case $destfile in
4988 *.lo)
4989 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4990 ;;
4991 *.$objext)
4992 staticdest="$destfile"
4993 destfile=
4994 ;;
4995 *)
4996 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4997 $echo "$help" 1>&2
4998 exit 1
4999 ;;
5000 esac
5001
5002 # Install the libtool object if requested.
5003 if test -n "$destfile"; then
5004 $show "$install_prog $file $destfile"
5005 $run eval "$install_prog $file $destfile" || exit $?
5006 fi
5007
5008 # Install the old object if enabled.
5009 if test "$build_old_libs" = yes; then
5010 # Deduce the name of the old-style object file.
5011 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5012
5013 $show "$install_prog $staticobj $staticdest"
5014 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5015 fi
5016 exit 0
5017 ;;
5018
5019 *)
5020 # Figure out destination file name, if it wasn't already specified.
5021 if test -n "$destname"; then
5022 destfile="$destdir/$destname"
5023 else
5024 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5025 destfile="$destdir/$destfile"
5026 fi
5027
5028 # If the file is missing, and there is a .exe on the end, strip it
5029 # because it is most likely a libtool script we actually want to
5030 # install
5031 stripped_ext=""
5032 case $file in
5033 *.exe)
5034 if test ! -f "$file"; then
5035 file=`echo $file|${SED} 's,.exe$,,'`
5036 stripped_ext=".exe"
5037 fi
5038 ;;
5039 esac
5040
5041 # Do a test to see if this is really a libtool program.
5042 case $host in
5043 *cygwin*|*mingw*)
5044 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
5045 ;;
5046 *)
5047 wrapper=$file
5048 ;;
5049 esac
5050 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5051 notinst_deplibs=
5052 relink_command=
5053
5054 # If there is no directory component, then add one.
5055 case $file in
5056 */* | *\\*) . $wrapper ;;
5057 *) . ./$wrapper ;;
5058 esac
5059
5060 # Check the variables that should have been set.
5061 if test -z "$notinst_deplibs"; then
5062 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5063 exit 1
5064 fi
5065
5066 finalize=yes
5067 for lib in $notinst_deplibs; do
5068 # Check to see that each library is installed.
5069 libdir=
5070 if test -f "$lib"; then
5071 # If there is no directory component, then add one.
5072 case $lib in
5073 */* | *\\*) . $lib ;;
5074 *) . ./$lib ;;
5075 esac
5076 fi
5077 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5078 if test -n "$libdir" && test ! -f "$libfile"; then
5079 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5080 finalize=no
5081 fi
5082 done
5083
5084 relink_command=
5085 # If there is no directory component, then add one.
5086 case $file in
5087 */* | *\\*) . $file ;;
5088 *) . ./$file ;;
5089 esac
5090
5091 outputname=
5092 if test "$fast_install" = no && test -n "$relink_command"; then
5093 if test "$finalize" = yes && test -z "$run"; then
5094 tmpdir="/tmp"
5095 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5096 tmpdir="$tmpdir/libtool-$$"
5097 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5098 else
5099 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5100 continue
5101 fi
5102 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5103 outputname="$tmpdir/$file"
5104 # Replace the output file specification.
5105 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5106
5107 $show "$relink_command"
5108 if $run eval "$relink_command"; then :
5109 else
5110 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5111 ${rm}r "$tmpdir"
5112 continue
5113 fi
5114 file="$outputname"
5115 else
5116 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5117 fi
5118 else
5119 # Install the binary that we compiled earlier.
5120 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5121 fi
5122 fi
5123
5124 # remove .exe since cygwin /usr/bin/install will append another
5125 # one anyways
5126 case $install_prog,$host in
5127 */usr/bin/install*,*cygwin*)
5128 case $file:$destfile in
5129 *.exe:*.exe)
5130 # this is ok
5131 ;;
5132 *.exe:*)
5133 destfile=$destfile.exe
5134 ;;
5135 *:*.exe)
5136 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
5137 ;;
5138 esac
5139 ;;
5140 esac
5141 $show "$install_prog$stripme $file $destfile"
5142 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5143 test -n "$outputname" && ${rm}r "$tmpdir"
5144 ;;
5145 esac
5146 done
5147
5148 for file in $staticlibs; do
5149 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5150
5151 # Set up the ranlib parameters.
5152 oldlib="$destdir/$name"
5153
5154 $show "$install_prog $file $oldlib"
5155 $run eval "$install_prog \$file \$oldlib" || exit $?
5156
5157 if test -n "$stripme" && test -n "$striplib"; then
5158 $show "$old_striplib $oldlib"
5159 $run eval "$old_striplib $oldlib" || exit $?
5160 fi
5161
5162 # Do each command in the postinstall commands.
5163 eval cmds=\"$old_postinstall_cmds\"
5164 save_ifs="$IFS"; IFS='~'
5165 for cmd in $cmds; do
5166 IFS="$save_ifs"
5167 $show "$cmd"
5168 $run eval "$cmd" || exit $?
5169 done
5170 IFS="$save_ifs"
5171 done
5172
5173 if test -n "$future_libdirs"; then
5174 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5175 fi
5176
5177 if test -n "$current_libdirs"; then
5178 # Maybe just do a dry run.
5179 test -n "$run" && current_libdirs=" -n$current_libdirs"
5180 exec_cmd='$SHELL $0 --finish$current_libdirs'
5181 else
5182 exit 0
5183 fi
5184 ;;
5185
5186 # libtool finish mode
5187 finish)
5188 modename="$modename: finish"
5189 libdirs="$nonopt"
5190 admincmds=
5191
5192 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5193 for dir
5194 do
5195 libdirs="$libdirs $dir"
5196 done
5197
5198 for libdir in $libdirs; do
5199 if test -n "$finish_cmds"; then
5200 # Do each command in the finish commands.
5201 eval cmds=\"$finish_cmds\"
5202 save_ifs="$IFS"; IFS='~'
5203 for cmd in $cmds; do
5204 IFS="$save_ifs"
5205 $show "$cmd"
5206 $run eval "$cmd" || admincmds="$admincmds
5207 $cmd"
5208 done
5209 IFS="$save_ifs"
5210 fi
5211 if test -n "$finish_eval"; then
5212 # Do the single finish_eval.
5213 eval cmds=\"$finish_eval\"
5214 $run eval "$cmds" || admincmds="$admincmds
5215 $cmds"
5216 fi
5217 done
5218 fi
5219
5220 # Exit here if they wanted silent mode.
5221 test "$show" = : && exit 0
5222
5223 echo "----------------------------------------------------------------------"
5224 echo "Libraries have been installed in:"
5225 for libdir in $libdirs; do
5226 echo " $libdir"
5227 done
5228 echo
5229 echo "If you ever happen to want to link against installed libraries"
5230 echo "in a given directory, LIBDIR, you must either use libtool, and"
5231 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5232 echo "flag during linking and do at least one of the following:"
5233 if test -n "$shlibpath_var"; then
5234 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5235 echo " during execution"
5236 fi
5237 if test -n "$runpath_var"; then
5238 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5239 echo " during linking"
5240 fi
5241 if test -n "$hardcode_libdir_flag_spec"; then
5242 libdir=LIBDIR
5243 eval flag=\"$hardcode_libdir_flag_spec\"
5244
5245 echo " - use the \`$flag' linker flag"
5246 fi
5247 if test -n "$admincmds"; then
5248 echo " - have your system administrator run these commands:$admincmds"
5249 fi
5250 if test -f /etc/ld.so.conf; then
5251 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5252 fi
5253 echo
5254 echo "See any operating system documentation about shared libraries for"
5255 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5256 echo "----------------------------------------------------------------------"
5257 exit 0
5258 ;;
5259
5260 # libtool execute mode
5261 execute)
5262 modename="$modename: execute"
5263
5264 # The first argument is the command name.
5265 cmd="$nonopt"
5266 if test -z "$cmd"; then
5267 $echo "$modename: you must specify a COMMAND" 1>&2
5268 $echo "$help"
5269 exit 1
5270 fi
5271
5272 # Handle -dlopen flags immediately.
5273 for file in $execute_dlfiles; do
5274 if test ! -f "$file"; then
5275 $echo "$modename: \`$file' is not a file" 1>&2
5276 $echo "$help" 1>&2
5277 exit 1
5278 fi
5279
5280 dir=
5281 case $file in
5282 *.la)
5283 # Check to see that this really is a libtool archive.
5284 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5285 else
5286 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5287 $echo "$help" 1>&2
5288 exit 1
5289 fi
5290
5291 # Read the libtool library.
5292 dlname=
5293 library_names=
5294
5295 # If there is no directory component, then add one.
5296 case $file in
5297 */* | *\\*) . $file ;;
5298 *) . ./$file ;;
5299 esac
5300
5301 # Skip this library if it cannot be dlopened.
5302 if test -z "$dlname"; then
5303 # Warn if it was a shared library.
5304 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5305 continue
5306 fi
5307
5308 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5309 test "X$dir" = "X$file" && dir=.
5310
5311 if test -f "$dir/$objdir/$dlname"; then
5312 dir="$dir/$objdir"
5313 else
5314 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5315 exit 1
5316 fi
5317 ;;
5318
5319 *.lo)
5320 # Just add the directory containing the .lo file.
5321 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5322 test "X$dir" = "X$file" && dir=.
5323 ;;
5324
5325 *)
5326 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5327 continue
5328 ;;
5329 esac
5330
5331 # Get the absolute pathname.
5332 absdir=`cd "$dir" && pwd`
5333 test -n "$absdir" && dir="$absdir"
5334
5335 # Now add the directory to shlibpath_var.
5336 if eval "test -z \"\$$shlibpath_var\""; then
5337 eval "$shlibpath_var=\"\$dir\""
5338 else
5339 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5340 fi
5341 done
5342
5343 # This variable tells wrapper scripts just to set shlibpath_var
5344 # rather than running their programs.
5345 libtool_execute_magic="$magic"
5346
5347 # Check if any of the arguments is a wrapper script.
5348 args=
5349 for file
5350 do
5351 case $file in
5352 -*) ;;
5353 *)
5354 # Do a test to see if this is really a libtool program.
5355 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5356 # If there is no directory component, then add one.
5357 case $file in
5358 */* | *\\*) . $file ;;
5359 *) . ./$file ;;
5360 esac
5361
5362 # Transform arg to wrapped name.
5363 file="$progdir/$program"
5364 fi
5365 ;;
5366 esac
5367 # Quote arguments (to preserve shell metacharacters).
5368 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5369 args="$args \"$file\""
5370 done
5371
5372 if test -z "$run"; then
5373 if test -n "$shlibpath_var"; then
5374 # Export the shlibpath_var.
5375 eval "export $shlibpath_var"
5376 fi
5377
5378 # Restore saved environment variables
5379 if test "${save_LC_ALL+set}" = set; then
5380 LC_ALL="$save_LC_ALL"; export LC_ALL
5381 fi
5382 if test "${save_LANG+set}" = set; then
5383 LANG="$save_LANG"; export LANG
5384 fi
5385
5386 # Now prepare to actually exec the command.
5387 exec_cmd="\$cmd$args"
5388 else
5389 # Display what would be done.
5390 if test -n "$shlibpath_var"; then
5391 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5392 $echo "export $shlibpath_var"
5393 fi
5394 $echo "$cmd$args"
5395 exit 0
5396 fi
5397 ;;
5398
5399 # libtool clean and uninstall mode
5400 clean | uninstall)
5401 modename="$modename: $mode"
5402 rm="$nonopt"
5403 files=
5404 rmforce=
5405 exit_status=0
5406
5407 # This variable tells wrapper scripts just to set variables rather
5408 # than running their programs.
5409 libtool_install_magic="$magic"
5410
5411 for arg
5412 do
5413 case $arg in
5414 -f) rm="$rm $arg"; rmforce=yes ;;
5415 -*) rm="$rm $arg" ;;
5416 *) files="$files $arg" ;;
5417 esac
5418 done
5419
5420 if test -z "$rm"; then
5421 $echo "$modename: you must specify an RM program" 1>&2
5422 $echo "$help" 1>&2
5423 exit 1
5424 fi
5425
5426 rmdirs=
5427
5428 for file in $files; do
5429 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5430 if test "X$dir" = "X$file"; then
5431 dir=.
5432 objdir="$objdir"
5433 else
5434 objdir="$dir/$objdir"
5435 fi
5436 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5437 test "$mode" = uninstall && objdir="$dir"
5438
5439 # Remember objdir for removal later, being careful to avoid duplicates
5440 if test "$mode" = clean; then
5441 case " $rmdirs " in
5442 *" $objdir "*) ;;
5443 *) rmdirs="$rmdirs $objdir" ;;
5444 esac
5445 fi
5446
5447 # Don't error if the file doesn't exist and rm -f was used.
5448 if (test -L "$file") >/dev/null 2>&1 \
5449 || (test -h "$file") >/dev/null 2>&1 \
5450 || test -f "$file"; then
5451 :
5452 elif test -d "$file"; then
5453 exit_status=1
5454 continue
5455 elif test "$rmforce" = yes; then
5456 continue
5457 fi
5458
5459 rmfiles="$file"
5460
5461 case $name in
5462 *.la)
5463 # Possibly a libtool archive, so verify it.
5464 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5465 . $dir/$name
5466
5467 # Delete the libtool libraries and symlinks.
5468 for n in $library_names; do
5469 rmfiles="$rmfiles $objdir/$n"
5470 done
5471 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5472 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5473
5474 if test "$mode" = uninstall; then
5475 if test -n "$library_names"; then
5476 # Do each command in the postuninstall commands.
5477 eval cmds=\"$postuninstall_cmds\"
5478 save_ifs="$IFS"; IFS='~'
5479 for cmd in $cmds; do
5480 IFS="$save_ifs"
5481 $show "$cmd"
5482 $run eval "$cmd"
5483 if test "$?" -ne 0 && test "$rmforce" != yes; then
5484 exit_status=1
5485 fi
5486 done
5487 IFS="$save_ifs"
5488 fi
5489
5490 if test -n "$old_library"; then
5491 # Do each command in the old_postuninstall commands.
5492 eval cmds=\"$old_postuninstall_cmds\"
5493 save_ifs="$IFS"; IFS='~'
5494 for cmd in $cmds; do
5495 IFS="$save_ifs"
5496 $show "$cmd"
5497 $run eval "$cmd"
5498 if test "$?" -ne 0 && test "$rmforce" != yes; then
5499 exit_status=1
5500 fi
5501 done
5502 IFS="$save_ifs"
5503 fi
5504 # FIXME: should reinstall the best remaining shared library.
5505 fi
5506 fi
5507 ;;
5508
5509 *.lo)
5510 # Possibly a libtool object, so verify it.
5511 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5512
5513 # Read the .lo file
5514 . $dir/$name
5515
5516 # Add PIC object to the list of files to remove.
5517 if test -n "$pic_object" \
5518 && test "$pic_object" != none; then
5519 rmfiles="$rmfiles $dir/$pic_object"
5520 fi
5521
5522 # Add non-PIC object to the list of files to remove.
5523 if test -n "$non_pic_object" \
5524 && test "$non_pic_object" != none; then
5525 rmfiles="$rmfiles $dir/$non_pic_object"
5526 fi
5527 fi
5528 ;;
5529
5530 *)
5531 # Do a test to see if this is a libtool program.
5532 if test "$mode" = clean &&
5533 (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5534 relink_command=
5535 . $dir/$file
5536
5537 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5538 if test "$fast_install" = yes && test -n "$relink_command"; then
5539 rmfiles="$rmfiles $objdir/lt-$name"
5540 fi
5541 fi
5542 ;;
5543 esac
5544 $show "$rm $rmfiles"
5545 $run $rm $rmfiles || exit_status=1
5546 done
5547
5548 # Try to remove the ${objdir}s in the directories where we deleted files
5549 for dir in $rmdirs; do
5550 if test -d "$dir"; then
5551 $show "rmdir $dir"
5552 $run rmdir $dir >/dev/null 2>&1
5553 fi
5554 done
5555
5556 exit $exit_status
5557 ;;
5558
5559 "")
5560 $echo "$modename: you must specify a MODE" 1>&2
5561 $echo "$generic_help" 1>&2
5562 exit 1
5563 ;;
5564 esac
5565
5566 if test -z "$exec_cmd"; then
5567 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5568 $echo "$generic_help" 1>&2
5569 exit 1
5570 fi
5571 fi # test -z "$show_help"
5572
5573 if test -n "$exec_cmd"; then
5574 eval exec $exec_cmd
5575 exit 1
5576 fi
5577
5578 # We need to display help for each of the modes.
5579 case $mode in
5580 "") $echo \
5581 "Usage: $modename [OPTION]... [MODE-ARG]...
5582
5583 Provide generalized library-building support services.
5584
5585 --config show all configuration variables
5586 --debug enable verbose shell tracing
5587 -n, --dry-run display commands without modifying any files
5588 --features display basic configuration information and exit
5589 --finish same as \`--mode=finish'
5590 --help display this help message and exit
5591 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5592 --quiet same as \`--silent'
5593 --silent don't print informational messages
5594 --tag=TAG use configuration variables from tag TAG
5595 --version print version information
5596
5597 MODE must be one of the following:
5598
5599 clean remove files from the build directory
5600 compile compile a source file into a libtool object
5601 execute automatically set library path, then run a program
5602 finish complete the installation of libtool libraries
5603 install install libraries or executables
5604 link create a library or an executable
5605 uninstall remove libraries from an installed directory
5606
5607 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5608 a more detailed description of MODE."
5609 exit 0
5610 ;;
5611
5612 clean)
5613 $echo \
5614 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5615
5616 Remove files from the build directory.
5617
5618 RM is the name of the program to use to delete files associated with each FILE
5619 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5620 to RM.
5621
5622 If FILE is a libtool library, object or program, all the files associated
5623 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5624 ;;
5625
5626 compile)
5627 $echo \
5628 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5629
5630 Compile a source file into a libtool library object.
5631
5632 This mode accepts the following additional options:
5633
5634 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5635 -prefer-pic try to building PIC objects only
5636 -prefer-non-pic try to building non-PIC objects only
5637 -static always build a \`.o' file suitable for static linking
5638
5639 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5640 from the given SOURCEFILE.
5641
5642 The output file name is determined by removing the directory component from
5643 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5644 library object suffix, \`.lo'."
5645 ;;
5646
5647 execute)
5648 $echo \
5649 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5650
5651 Automatically set library path, then run a program.
5652
5653 This mode accepts the following additional options:
5654
5655 -dlopen FILE add the directory containing FILE to the library path
5656
5657 This mode sets the library path environment variable according to \`-dlopen'
5658 flags.
5659
5660 If any of the ARGS are libtool executable wrappers, then they are translated
5661 into their corresponding uninstalled binary, and any of their required library
5662 directories are added to the library path.
5663
5664 Then, COMMAND is executed, with ARGS as arguments."
5665 ;;
5666
5667 finish)
5668 $echo \
5669 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5670
5671 Complete the installation of libtool libraries.
5672
5673 Each LIBDIR is a directory that contains libtool libraries.
5674
5675 The commands that this mode executes may require superuser privileges. Use
5676 the \`--dry-run' option if you just want to see what would be executed."
5677 ;;
5678
5679 install)
5680 $echo \
5681 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5682
5683 Install executables or libraries.
5684
5685 INSTALL-COMMAND is the installation command. The first component should be
5686 either the \`install' or \`cp' program.
5687
5688 The rest of the components are interpreted as arguments to that command (only
5689 BSD-compatible install options are recognized)."
5690 ;;
5691
5692 link)
5693 $echo \
5694 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5695
5696 Link object files or libraries together to form another library, or to
5697 create an executable program.
5698
5699 LINK-COMMAND is a command using the C compiler that you would use to create
5700 a program from several object files.
5701
5702 The following components of LINK-COMMAND are treated specially:
5703
5704 -all-static do not do any dynamic linking at all
5705 -avoid-version do not add a version suffix if possible
5706 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5707 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5708 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5709 -export-symbols SYMFILE
5710 try to export only the symbols listed in SYMFILE
5711 -export-symbols-regex REGEX
5712 try to export only the symbols matching REGEX
5713 -LLIBDIR search LIBDIR for required installed libraries
5714 -lNAME OUTPUT-FILE requires the installed library libNAME
5715 -module build a library that can dlopened
5716 -no-fast-install disable the fast-install mode
5717 -no-install link a not-installable executable
5718 -no-undefined declare that a library does not refer to external symbols
5719 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5720 -objectlist FILE Use a list of object files found in FILE to specify objects
5721 -release RELEASE specify package release information
5722 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5723 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5724 -static do not do any dynamic linking of libtool libraries
5725 -version-info CURRENT[:REVISION[:AGE]]
5726 specify library version info [each variable defaults to 0]
5727
5728 All other options (arguments beginning with \`-') are ignored.
5729
5730 Every other argument is treated as a filename. Files ending in \`.la' are
5731 treated as uninstalled libtool libraries, other files are standard or library
5732 object files.
5733
5734 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5735 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5736 required, except when creating a convenience library.
5737
5738 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5739 using \`ar' and \`ranlib', or on Windows using \`lib'.
5740
5741 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5742 is created, otherwise an executable program is created."
5743 ;;
5744
5745 uninstall)
5746 $echo \
5747 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5748
5749 Remove libraries from an installation directory.
5750
5751 RM is the name of the program to use to delete files associated with each FILE
5752 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5753 to RM.
5754
5755 If FILE is a libtool library, all the files associated with it are deleted.
5756 Otherwise, only FILE itself is deleted using RM."
5757 ;;
5758
5759 *)
5760 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5761 $echo "$help" 1>&2
5762 exit 1
5763 ;;
5764 esac
5765
5766 echo
5767 $echo "Try \`$modename --help' for more information about other modes."
5768
5769 exit 0
5770
5771 # The TAGs below are defined such that we never get into a situation
5772 # in which we disable both kinds of libraries. Given conflicting
5773 # choices, we go for a static library, that is the most portable,
5774 # since we can't tell whether shared libraries were disabled because
5775 # the user asked for that or because the platform doesn't support
5776 # them. This is particularly important on AIX, because we don't
5777 # support having both static and shared libraries enabled at the same
5778 # time on that platform, so we default to a shared-only configuration.
5779 # If a disable-shared tag is given, we'll fallback to a static-only
5780 # configuration. But we'll never go from static-only to shared-only.
5781
5782 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5783 build_libtool_libs=no
5784 build_old_libs=yes
5785 # ### END LIBTOOL TAG CONFIG: disable-shared
5786
5787 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
5788 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5789 # ### END LIBTOOL TAG CONFIG: disable-static
5790
5791 # Local Variables:
5792 # mode:shell-script
5793 # sh-indentation:2
5794 # End:
@@ -0,0 +1,11
1 prefix=@prefix@
2 exec_prefix=@exec_prefix@
3 libdir=@libdir@
4 includedir=@includedir@
5
6 Name: @PACKAGE_NAME@
7 Description: Example C++ library.
8 Version: @PACKAGE_VERSION@
9 URL: @PACKAGE_URL@
10 Libs: -L${libdir} -lrs232-@RS232_API_VERSION@
11 Cflags: -I${includedir}/rs232-@RS232_API_VERSION@ -I${libdir}/rs232-@RS232_API_VERSION@/include
@@ -0,0 +1,15
1 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
2
3
4 librs232_@RS232_API_VERSION@_la_LDFLAGS = -version-info $(RS232_SO_VERSION)
5
6 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
7
8
9 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
10
11 librs232_@RS232_API_VERSION@_la_SOURCES = \
12 RS232.c
13
14 pkgconfigdir = $(libdir)/pkgconfig
15 pkgconfig_DATA = ../rs232-@RS232_API_VERSION@.pc
@@ -0,0 +1,220
1 // SOPSUYSI_RS232.c - Function to communicate on Serial Port
2
3 #include <stdio.h>
4 #include <unistd.h>
5 #include <fcntl.h>
6 #include <termios.h>
7 #include <string.h>
8 #include <errno.h>
9 #include "RS232.h"
10
11
12 speed_t rs232cfspeed(unsigned int BaudeRate)
13 {
14 if(BaudeRate<25)
15 return B0;
16
17 if(BaudeRate<67)
18 return B50;
19
20 if(BaudeRate<93)
21 return B75;
22
23 if(BaudeRate<123)
24 return B110;
25
26 if(BaudeRate<142)
27 return B134;
28
29 if(BaudeRate<175)
30 return B150;
31
32 if(BaudeRate<250)
33 return B200;
34
35 if(BaudeRate<450)
36 return B300;
37
38 if(BaudeRate<900)
39 return B600;
40
41 if(BaudeRate<1500)
42 return B1200;
43
44 if(BaudeRate<2100)
45 return B1800;
46
47 if(BaudeRate<3600)
48 return B2400;
49
50 if(BaudeRate<7200)
51 return B4800;
52
53 if(BaudeRate<1400)
54 return B9600;
55
56 if(BaudeRate<28800)
57 return B19200;
58
59 if(BaudeRate<48000)
60 return B38400;
61
62 if(BaudeRate<86400)
63 return B57600;
64
65 if(BaudeRate<172800)
66 return B115200;
67 else
68 // if(172799<BaudeRate)
69 return B230400;
70 }
71
72
73 int rs232cfparity(int fd, struct termios *terminos, int Parity)
74 {
75 if (fd == -1)
76 {
77 return fd;
78 }
79 else
80 {
81 switch(Parity)
82 {
83 case 1:
84 terminos->c_cflag |= PARENB;
85 break;
86 default:
87 terminos->c_cflag &= ~PARENB;
88 break;
89 }
90 return 0;
91 }
92 }
93
94
95 int rs232cfnbstop(int fd, struct termios *terminos, int NbStop)
96 {
97 if (fd == -1)
98 {
99 return fd;
100 }
101 else
102 {
103 switch(NbStop)
104 {
105 case 2:
106 terminos->c_cflag |= CSTOPB;
107 break;
108 default:
109 terminos->c_cflag &= ~CSTOPB;
110 break;
111 }
112 return 0;
113 }
114 }
115
116
117 int rs232cfcsize(int fd, struct termios *terminos, int ChSize)
118 {
119 if (fd == -1)
120 {
121 return fd;
122 }
123 else
124 {
125 switch(ChSize)
126 {
127 case 5:
128 terminos->c_cflag |= CS5;
129 break;
130 case 6:
131 terminos->c_cflag |= CS6;
132 break;
133 case 7:
134 terminos->c_cflag |= CS7;
135 break;
136 default:
137 terminos->c_cflag |= CS8;
138 break;
139 }
140 return 0;
141 }
142 }
143
144
145 int rs232open(char* psPortName)
146 {
147
148 int fd = open(psPortName, O_RDWR | O_NOCTTY | O_NDELAY);
149
150 return fd;
151 }
152
153
154 int rs232setup(int fd, int ChSize, int BaudeRate, int Parity, int NbStop)
155 {
156 if (fd == -1)
157 {
158 return fd;
159 }
160 else
161 {
162 struct termios terminos;
163 tcgetattr(fd, &terminos);
164
165 cfsetispeed(&terminos, rs232cfspeed(BaudeRate));
166 cfsetospeed(&terminos, rs232cfspeed(BaudeRate));
167
168 terminos.c_cflag |= (CLOCAL | CREAD);
169 rs232cfparity(fd, &terminos, Parity);
170 rs232cfnbstop(fd, &terminos, NbStop);
171 rs232cfcsize(fd, &terminos, ChSize);
172
173
174 tcsetattr(fd, TCSANOW, &terminos);
175 tcgetattr(fd, &terminos);
176 return 0;
177 }
178 }
179
180
181 int rs232write(int fd,char *psWrite)
182 {
183 int Len_psWrite = (int)strlen(psWrite);
184
185 if (fd == -1)
186 {
187 return fd;
188 }
189 else
190 {
191 return write(fd, psWrite, Len_psWrite);
192 }
193 }
194
195
196 int rs232read(int fd,char *psReadHex, int ReadBufferSize)
197 {
198 if (fd == -1)
199 {
200 return fd;
201 }
202 else
203 {
204 return read(fd, psReadHex, ReadBufferSize);
205 }
206 }
207
208
209 int rs232close(int fd)
210 {
211 if (fd == -1)
212 {
213 return fd;
214 }
215 else
216 {
217 close(fd);
218 return 0;
219 }
220 }
@@ -0,0 +1,9
1 // SOPSUYSI_RS232.h
2
3
4
5 int rs232open(char* psPortName);
6 int rs232close(int fd);
7 int rs232setup(int fd, int ChSize, int BaudeRate, int Parity, int NbStop);
8 int rs232write(int fd,char *psWrite);
9 int rs232read(int fd,char *psReadHex, int ReadBufferSize);
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now