Codebase list libdiscid / upstream/0.6.2
New upstream version 0.6.2 Sebastian Ramacher 7 years ago
42 changed file(s) with 21896 addition(s) and 17698 deletion(s). Raw diff Collapse all Expand all
0 1 Notes on the Free Translation Project
1 ***************************************
2
3 Free software is going international! The Free Translation Project is
4 a way to get maintainers of free software, translators, and users all
5 together, so that free software will gradually become able to speak many
6 languages. A few packages already provide translations for their
7 messages.
8
9 If you found this `ABOUT-NLS' file inside a distribution, you may
10 assume that the distributed package does use GNU `gettext' internally,
11 itself available at your nearest GNU archive site. But you do _not_
12 need to install GNU `gettext' prior to configuring, installing or using
13 this package with messages translated.
14
15 Installers will find here some useful hints. These notes also
16 explain how users should proceed for getting the programs to use the
17 available translations. They tell how people wanting to contribute and
18 work on translations can contact the appropriate team.
19
20 1.1 INSTALL Matters
21 ===================
22
23 Some packages are "localizable" when properly installed; the programs
24 they contain can be made to speak your own native language. Most such
25 packages use GNU `gettext'. Other packages have their own ways to
26 internationalization, predating GNU `gettext'.
27
28 By default, this package will be installed to allow translation of
29 messages. It will automatically detect whether the system already
30 provides the GNU `gettext' functions. Installers may use special
31 options at configuration time for changing the default behaviour. The
32 command:
33
34 ./configure --disable-nls
35
36 will _totally_ disable translation of messages.
37
38 When you already have GNU `gettext' installed on your system and run
39 configure without an option for your new package, `configure' will
40 probably detect the previously built and installed `libintl' library
41 and will decide to use it. If not, you may have to to use the
42 `--with-libintl-prefix' option to tell `configure' where to look for it.
43
44 Internationalized packages usually have many `po/LL.po' files, where
45 LL gives an ISO 639 two-letter code identifying the language. Unless
46 translations have been forbidden at `configure' time by using the
47 `--disable-nls' switch, all available translations are installed
48 together with the package. However, the environment variable `LINGUAS'
49 may be set, prior to configuration, to limit the installed set.
50 `LINGUAS' should then contain a space separated list of two-letter
51 codes, stating which languages are allowed.
52
53 1.2 Using This Package
54 ======================
55
56 As a user, if your language has been installed for this package, you
57 only have to set the `LANG' environment variable to the appropriate
58 `LL_CC' combination. If you happen to have the `LC_ALL' or some other
59 `LC_xxx' environment variables set, you should unset them before
60 setting `LANG', otherwise the setting of `LANG' will not have the
61 desired effect. Here `LL' is an ISO 639 two-letter language code, and
62 `CC' is an ISO 3166 two-letter country code. For example, let's
63 suppose that you speak German and live in Germany. At the shell
64 prompt, merely execute `setenv LANG de_DE' (in `csh'),
65 `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
66 This can be done from your `.login' or `.profile' file, once and for
67 all.
68
69 You might think that the country code specification is redundant.
70 But in fact, some languages have dialects in different countries. For
71 example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
72 country code serves to distinguish the dialects.
73
74 The locale naming convention of `LL_CC', with `LL' denoting the
75 language and `CC' denoting the country, is the one use on systems based
76 on GNU libc. On other systems, some variations of this scheme are
77 used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
78 locales supported by your system for your language by running the
79 command `locale -a | grep '^LL''.
80
81 Not all programs have translations for all languages. By default, an
82 English message is shown in place of a nonexistent translation. If you
83 understand other languages, you can set up a priority list of languages.
84 This is done through a different environment variable, called
85 `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
86 for the purpose of message handling, but you still need to have `LANG'
87 set to the primary language; this is required by other parts of the
88 system libraries. For example, some Swedish users who would rather
89 read translations in German than English for when Swedish is not
90 available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
91
92 Special advice for Norwegian users: The language code for Norwegian
93 bokma*l changed from `no' to `nb' recently (in 2003). During the
94 transition period, while some message catalogs for this language are
95 installed under `nb' and some older ones under `no', it's recommended
96 for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
97 older translations are used.
98
99 In the `LANGUAGE' environment variable, but not in the `LANG'
100 environment variable, `LL_CC' combinations can be abbreviated as `LL'
101 to denote the language's main dialect. For example, `de' is equivalent
102 to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
103 (Portuguese as spoken in Portugal) in this context.
104
105 1.3 Translating Teams
106 =====================
107
108 For the Free Translation Project to be a success, we need interested
109 people who like their own language and write it well, and who are also
110 able to synergize with other translators speaking the same language.
111 Each translation team has its own mailing list. The up-to-date list of
112 teams can be found at the Free Translation Project's homepage,
113 `http://translationproject.org/', in the "Teams" area.
114
115 If you'd like to volunteer to _work_ at translating messages, you
116 should become a member of the translating team for your own language.
117 The subscribing address is _not_ the same as the list itself, it has
118 `-request' appended. For example, speakers of Swedish can send a
119 message to `sv-request@li.org', having this message body:
120
121 subscribe
122
123 Keep in mind that team members are expected to participate
124 _actively_ in translations, or at solving translational difficulties,
125 rather than merely lurking around. If your team does not exist yet and
126 you want to start one, or if you are unsure about what to do or how to
127 get started, please write to `coordinator@translationproject.org' to
128 reach the coordinator for all translator teams.
129
130 The English team is special. It works at improving and uniformizing
131 the terminology in use. Proven linguistic skills are praised more than
132 programming skills, here.
133
134 1.4 Available Packages
135 ======================
136
137 Languages are not equally supported in all packages. The following
138 matrix shows the current state of internationalization, as of June
139 2010. The matrix shows, in regard of each package, for which languages
140 PO files have been submitted to translation coordination, with a
141 translation percentage of at least 50%.
142
143 Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca
144 +--------------------------------------------------+
145 a2ps | [] [] |
146 aegis | |
147 ant-phone | |
148 anubis | |
149 aspell | [] [] |
150 bash | |
151 bfd | |
152 bibshelf | [] |
153 binutils | |
154 bison | |
155 bison-runtime | [] |
156 bluez-pin | [] [] |
157 bombono-dvd | |
158 buzztard | |
159 cflow | |
160 clisp | |
161 coreutils | [] [] |
162 cpio | |
163 cppi | |
164 cpplib | [] |
165 cryptsetup | |
166 dfarc | |
167 dialog | [] [] |
168 dico | |
169 diffutils | [] |
170 dink | |
171 doodle | |
172 e2fsprogs | [] |
173 enscript | [] |
174 exif | |
175 fetchmail | [] |
176 findutils | [] |
177 flex | [] |
178 freedink | |
179 gas | |
180 gawk | [] [] |
181 gcal | [] |
182 gcc | |
183 gettext-examples | [] [] [] [] |
184 gettext-runtime | [] [] |
185 gettext-tools | [] [] |
186 gip | [] |
187 gjay | |
188 gliv | [] |
189 glunarclock | [] [] |
190 gnubiff | |
191 gnucash | [] |
192 gnuedu | |
193 gnulib | |
194 gnunet | |
195 gnunet-gtk | |
196 gnutls | |
197 gold | |
198 gpe-aerial | |
199 gpe-beam | |
200 gpe-bluetooth | |
201 gpe-calendar | |
202 gpe-clock | [] |
203 gpe-conf | |
204 gpe-contacts | |
205 gpe-edit | |
206 gpe-filemanager | |
207 gpe-go | |
208 gpe-login | |
209 gpe-ownerinfo | [] |
210 gpe-package | |
211 gpe-sketchbook | |
212 gpe-su | [] |
213 gpe-taskmanager | [] |
214 gpe-timesheet | [] |
215 gpe-today | [] |
216 gpe-todo | |
217 gphoto2 | |
218 gprof | [] |
219 gpsdrive | |
220 gramadoir | |
221 grep | |
222 grub | [] [] |
223 gsasl | |
224 gss | |
225 gst-plugins-bad | [] |
226 gst-plugins-base | [] |
227 gst-plugins-good | [] |
228 gst-plugins-ugly | [] |
229 gstreamer | [] [] [] |
230 gtick | |
231 gtkam | [] |
232 gtkorphan | [] |
233 gtkspell | [] [] [] |
234 gutenprint | |
235 hello | [] |
236 help2man | |
237 hylafax | |
238 idutils | |
239 indent | [] [] |
240 iso_15924 | |
241 iso_3166 | [] [] [] [] [] [] [] |
242 iso_3166_2 | |
243 iso_4217 | |
244 iso_639 | [] [] [] [] |
245 iso_639_3 | |
246 jwhois | |
247 kbd | |
248 keytouch | [] |
249 keytouch-editor | |
250 keytouch-keyboa... | [] |
251 klavaro | [] |
252 latrine | |
253 ld | [] |
254 leafpad | [] [] |
255 libc | [] [] |
256 libexif | () |
257 libextractor | |
258 libgnutls | |
259 libgpewidget | |
260 libgpg-error | |
261 libgphoto2 | |
262 libgphoto2_port | |
263 libgsasl | |
264 libiconv | [] |
265 libidn | |
266 lifelines | |
267 liferea | [] [] |
268 lilypond | |
269 linkdr | [] |
270 lordsawar | |
271 lprng | |
272 lynx | [] |
273 m4 | |
274 mailfromd | |
275 mailutils | |
276 make | |
277 man-db | |
278 man-db-manpages | |
279 minicom | |
280 mkisofs | |
281 myserver | |
282 nano | [] [] |
283 opcodes | |
284 parted | |
285 pies | |
286 popt | |
287 psmisc | |
288 pspp | [] |
289 pwdutils | |
290 radius | [] |
291 recode | [] [] |
292 rosegarden | |
293 rpm | |
294 rush | |
295 sarg | |
296 screem | |
297 scrollkeeper | [] [] [] |
298 sed | [] [] |
299 sharutils | [] [] |
300 shishi | |
301 skencil | |
302 solfege | |
303 solfege-manual | |
304 soundtracker | |
305 sp | |
306 sysstat | |
307 tar | [] |
308 texinfo | |
309 tin | |
310 unicode-han-tra... | |
311 unicode-transla... | |
312 util-linux-ng | [] |
313 vice | |
314 vmm | |
315 vorbis-tools | |
316 wastesedge | |
317 wdiff | |
318 wget | [] [] |
319 wyslij-po | |
320 xchat | [] [] [] [] |
321 xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
322 xkeyboard-config | [] [] |
323 +--------------------------------------------------+
324 af am an ar as ast az be be@latin bg bn_IN bs ca
325 6 0 1 2 3 19 1 10 3 28 3 1 38
326
327 crh cs da de el en en_GB en_ZA eo es et eu fa
328 +-------------------------------------------------+
329 a2ps | [] [] [] [] [] [] [] |
330 aegis | [] [] [] |
331 ant-phone | [] () |
332 anubis | [] [] |
333 aspell | [] [] [] [] [] |
334 bash | [] [] [] |
335 bfd | [] |
336 bibshelf | [] [] [] |
337 binutils | [] |
338 bison | [] [] |
339 bison-runtime | [] [] [] [] |
340 bluez-pin | [] [] [] [] [] [] |
341 bombono-dvd | [] |
342 buzztard | [] [] [] |
343 cflow | [] [] |
344 clisp | [] [] [] [] |
345 coreutils | [] [] [] [] |
346 cpio | |
347 cppi | |
348 cpplib | [] [] [] |
349 cryptsetup | [] |
350 dfarc | [] [] [] |
351 dialog | [] [] [] [] [] |
352 dico | |
353 diffutils | [] [] [] [] [] [] |
354 dink | [] [] [] |
355 doodle | [] |
356 e2fsprogs | [] [] [] |
357 enscript | [] [] [] |
358 exif | () [] [] |
359 fetchmail | [] [] () [] [] [] |
360 findutils | [] [] [] |
361 flex | [] [] |
362 freedink | [] [] [] |
363 gas | [] |
364 gawk | [] [] [] |
365 gcal | [] |
366 gcc | [] [] |
367 gettext-examples | [] [] [] [] |
368 gettext-runtime | [] [] [] [] |
369 gettext-tools | [] [] [] |
370 gip | [] [] [] [] |
371 gjay | [] |
372 gliv | [] [] [] |
373 glunarclock | [] [] |
374 gnubiff | () |
375 gnucash | [] () () () () |
376 gnuedu | [] [] |
377 gnulib | [] [] |
378 gnunet | |
379 gnunet-gtk | [] |
380 gnutls | [] [] |
381 gold | [] |
382 gpe-aerial | [] [] [] [] |
383 gpe-beam | [] [] [] [] |
384 gpe-bluetooth | [] [] |
385 gpe-calendar | [] |
386 gpe-clock | [] [] [] [] |
387 gpe-conf | [] [] [] |
388 gpe-contacts | [] [] [] |
389 gpe-edit | [] [] |
390 gpe-filemanager | [] [] [] |
391 gpe-go | [] [] [] [] |
392 gpe-login | [] [] |
393 gpe-ownerinfo | [] [] [] [] |
394 gpe-package | [] [] [] |
395 gpe-sketchbook | [] [] [] [] |
396 gpe-su | [] [] [] [] |
397 gpe-taskmanager | [] [] [] [] |
398 gpe-timesheet | [] [] [] [] |
399 gpe-today | [] [] [] [] |
400 gpe-todo | [] [] [] |
401 gphoto2 | [] [] () [] [] [] |
402 gprof | [] [] [] |
403 gpsdrive | [] [] [] |
404 gramadoir | [] [] [] |
405 grep | [] |
406 grub | [] [] |
407 gsasl | [] |
408 gss | |
409 gst-plugins-bad | [] [] [] [] [] |
410 gst-plugins-base | [] [] [] [] [] |
411 gst-plugins-good | [] [] [] [] [] [] |
412 gst-plugins-ugly | [] [] [] [] [] [] |
413 gstreamer | [] [] [] [] [] |
414 gtick | [] () [] |
415 gtkam | [] [] () [] [] |
416 gtkorphan | [] [] [] [] |
417 gtkspell | [] [] [] [] [] [] [] |
418 gutenprint | [] [] [] |
419 hello | [] [] [] [] |
420 help2man | [] |
421 hylafax | [] [] |
422 idutils | [] [] |
423 indent | [] [] [] [] [] [] [] |
424 iso_15924 | [] () [] [] |
425 iso_3166 | [] [] [] [] () [] [] [] () |
426 iso_3166_2 | () |
427 iso_4217 | [] [] [] () [] [] |
428 iso_639 | [] [] [] [] () [] [] |
429 iso_639_3 | [] |
430 jwhois | [] |
431 kbd | [] [] [] [] [] |
432 keytouch | [] [] |
433 keytouch-editor | [] [] |
434 keytouch-keyboa... | [] |
435 klavaro | [] [] [] [] |
436 latrine | [] () |
437 ld | [] [] |
438 leafpad | [] [] [] [] [] [] |
439 libc | [] [] [] [] |
440 libexif | [] [] () |
441 libextractor | |
442 libgnutls | [] |
443 libgpewidget | [] [] |
444 libgpg-error | [] [] |
445 libgphoto2 | [] () |
446 libgphoto2_port | [] () [] |
447 libgsasl | |
448 libiconv | [] [] [] [] [] |
449 libidn | [] [] [] |
450 lifelines | [] () |
451 liferea | [] [] [] [] [] |
452 lilypond | [] [] [] |
453 linkdr | [] [] [] |
454 lordsawar | [] |
455 lprng | |
456 lynx | [] [] [] [] |
457 m4 | [] [] [] [] |
458 mailfromd | |
459 mailutils | [] |
460 make | [] [] [] |
461 man-db | |
462 man-db-manpages | |
463 minicom | [] [] [] [] |
464 mkisofs | |
465 myserver | |
466 nano | [] [] [] |
467 opcodes | [] [] |
468 parted | [] [] |
469 pies | |
470 popt | [] [] [] [] [] |
471 psmisc | [] [] [] |
472 pspp | [] |
473 pwdutils | [] |
474 radius | [] |
475 recode | [] [] [] [] [] [] |
476 rosegarden | () () () |
477 rpm | [] [] [] |
478 rush | |
479 sarg | |
480 screem | |
481 scrollkeeper | [] [] [] [] [] |
482 sed | [] [] [] [] [] [] |
483 sharutils | [] [] [] [] |
484 shishi | |
485 skencil | [] () [] |
486 solfege | [] [] [] |
487 solfege-manual | [] [] |
488 soundtracker | [] [] [] |
489 sp | [] |
490 sysstat | [] [] [] |
491 tar | [] [] [] [] |
492 texinfo | [] [] [] |
493 tin | [] [] |
494 unicode-han-tra... | |
495 unicode-transla... | |
496 util-linux-ng | [] [] [] [] |
497 vice | () () |
498 vmm | [] |
499 vorbis-tools | [] [] |
500 wastesedge | [] |
501 wdiff | [] [] |
502 wget | [] [] [] |
503 wyslij-po | |
504 xchat | [] [] [] [] [] |
505 xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
506 xkeyboard-config | [] [] [] [] [] [] |
507 +-------------------------------------------------+
508 crh cs da de el en en_GB en_ZA eo es et eu fa
509 5 64 105 117 18 1 8 0 28 89 18 19 0
510
511 fi fr ga gl gu he hi hr hu hy id is it ja ka kn
512 +----------------------------------------------------+
513 a2ps | [] [] [] [] |
514 aegis | [] [] |
515 ant-phone | [] [] |
516 anubis | [] [] [] [] |
517 aspell | [] [] [] [] |
518 bash | [] [] [] [] |
519 bfd | [] [] [] |
520 bibshelf | [] [] [] [] [] |
521 binutils | [] [] [] |
522 bison | [] [] [] [] |
523 bison-runtime | [] [] [] [] [] [] |
524 bluez-pin | [] [] [] [] [] [] [] [] |
525 bombono-dvd | [] |
526 buzztard | [] |
527 cflow | [] [] [] |
528 clisp | [] |
529 coreutils | [] [] [] [] [] |
530 cpio | [] [] [] [] |
531 cppi | [] [] |
532 cpplib | [] [] [] |
533 cryptsetup | [] [] [] |
534 dfarc | [] [] [] |
535 dialog | [] [] [] [] [] [] [] |
536 dico | |
537 diffutils | [] [] [] [] [] [] [] [] [] |
538 dink | [] |
539 doodle | [] [] |
540 e2fsprogs | [] [] |
541 enscript | [] [] [] [] |
542 exif | [] [] [] [] [] [] |
543 fetchmail | [] [] [] [] |
544 findutils | [] [] [] [] [] [] |
545 flex | [] [] [] |
546 freedink | [] [] [] |
547 gas | [] [] |
548 gawk | [] [] [] [] () [] |
549 gcal | [] |
550 gcc | [] |
551 gettext-examples | [] [] [] [] [] [] [] |
552 gettext-runtime | [] [] [] [] [] [] |
553 gettext-tools | [] [] [] [] |
554 gip | [] [] [] [] [] [] |
555 gjay | [] |
556 gliv | [] () |
557 glunarclock | [] [] [] [] |
558 gnubiff | () [] () |
559 gnucash | () () () () () [] |
560 gnuedu | [] [] |
561 gnulib | [] [] [] [] [] [] |
562 gnunet | |
563 gnunet-gtk | [] |
564 gnutls | [] [] |
565 gold | [] [] |
566 gpe-aerial | [] [] [] |
567 gpe-beam | [] [] [] [] |
568 gpe-bluetooth | [] [] [] [] |
569 gpe-calendar | [] [] |
570 gpe-clock | [] [] [] [] [] |
571 gpe-conf | [] [] [] [] |
572 gpe-contacts | [] [] [] [] |
573 gpe-edit | [] [] [] |
574 gpe-filemanager | [] [] [] [] |
575 gpe-go | [] [] [] [] [] |
576 gpe-login | [] [] [] |
577 gpe-ownerinfo | [] [] [] [] [] |
578 gpe-package | [] [] [] |
579 gpe-sketchbook | [] [] [] [] |
580 gpe-su | [] [] [] [] [] [] |
581 gpe-taskmanager | [] [] [] [] [] |
582 gpe-timesheet | [] [] [] [] [] |
583 gpe-today | [] [] [] [] [] [] [] |
584 gpe-todo | [] [] [] |
585 gphoto2 | [] [] [] [] [] [] |
586 gprof | [] [] [] [] |
587 gpsdrive | [] [] [] |
588 gramadoir | [] [] [] |
589 grep | [] [] |
590 grub | [] [] [] [] |
591 gsasl | [] [] [] [] [] |
592 gss | [] [] [] [] [] |
593 gst-plugins-bad | [] [] [] [] [] [] |
594 gst-plugins-base | [] [] [] [] [] [] |
595 gst-plugins-good | [] [] [] [] [] [] |
596 gst-plugins-ugly | [] [] [] [] [] [] |
597 gstreamer | [] [] [] [] [] |
598 gtick | [] [] [] [] [] |
599 gtkam | [] [] [] [] [] |
600 gtkorphan | [] [] [] |
601 gtkspell | [] [] [] [] [] [] [] [] [] |
602 gutenprint | [] [] [] [] |
603 hello | [] [] [] |
604 help2man | [] [] |
605 hylafax | [] |
606 idutils | [] [] [] [] [] [] |
607 indent | [] [] [] [] [] [] [] [] |
608 iso_15924 | [] () [] [] |
609 iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] |
610 iso_3166_2 | () [] [] [] |
611 iso_4217 | [] () [] [] [] [] |
612 iso_639 | [] () [] [] [] [] [] [] [] |
613 iso_639_3 | () [] [] |
614 jwhois | [] [] [] [] [] |
615 kbd | [] [] |
616 keytouch | [] [] [] [] [] [] |
617 keytouch-editor | [] [] [] [] [] |
618 keytouch-keyboa... | [] [] [] [] [] |
619 klavaro | [] [] |
620 latrine | [] [] [] |
621 ld | [] [] [] [] |
622 leafpad | [] [] [] [] [] [] [] () |
623 libc | [] [] [] [] [] |
624 libexif | [] |
625 libextractor | |
626 libgnutls | [] [] |
627 libgpewidget | [] [] [] [] |
628 libgpg-error | [] [] |
629 libgphoto2 | [] [] [] |
630 libgphoto2_port | [] [] [] |
631 libgsasl | [] [] [] [] [] |
632 libiconv | [] [] [] [] [] [] |
633 libidn | [] [] [] [] |
634 lifelines | () |
635 liferea | [] [] [] [] |
636 lilypond | [] [] |
637 linkdr | [] [] [] [] [] |
638 lordsawar | |
639 lprng | [] |
640 lynx | [] [] [] [] [] |
641 m4 | [] [] [] [] [] [] |
642 mailfromd | |
643 mailutils | [] [] |
644 make | [] [] [] [] [] [] [] [] [] |
645 man-db | [] [] |
646 man-db-manpages | [] |
647 minicom | [] [] [] [] [] |
648 mkisofs | [] [] [] [] |
649 myserver | |
650 nano | [] [] [] [] [] [] |
651 opcodes | [] [] [] [] |
652 parted | [] [] [] [] |
653 pies | |
654 popt | [] [] [] [] [] [] [] [] [] |
655 psmisc | [] [] [] |
656 pspp | |
657 pwdutils | [] [] |
658 radius | [] [] |
659 recode | [] [] [] [] [] [] [] [] |
660 rosegarden | () () () () () |
661 rpm | [] [] |
662 rush | |
663 sarg | [] |
664 screem | [] [] |
665 scrollkeeper | [] [] [] [] |
666 sed | [] [] [] [] [] [] [] [] |
667 sharutils | [] [] [] [] [] [] [] |
668 shishi | [] |
669 skencil | [] |
670 solfege | [] [] [] [] |
671 solfege-manual | [] [] |
672 soundtracker | [] [] |
673 sp | [] () |
674 sysstat | [] [] [] [] [] |
675 tar | [] [] [] [] [] [] [] |
676 texinfo | [] [] [] [] |
677 tin | [] |
678 unicode-han-tra... | |
679 unicode-transla... | [] [] |
680 util-linux-ng | [] [] [] [] [] [] |
681 vice | () () () |
682 vmm | [] |
683 vorbis-tools | [] |
684 wastesedge | () () |
685 wdiff | [] |
686 wget | [] [] [] [] [] [] [] [] |
687 wyslij-po | [] [] [] |
688 xchat | [] [] [] [] [] [] [] [] [] |
689 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
690 xkeyboard-config | [] [] [] [] [] |
691 +----------------------------------------------------+
692 fi fr ga gl gu he hi hr hu hy id is it ja ka kn
693 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4
694
695 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
696 +-----------------------------------------------+
697 a2ps | [] |
698 aegis | |
699 ant-phone | |
700 anubis | [] [] |
701 aspell | [] |
702 bash | |
703 bfd | |
704 bibshelf | [] [] |
705 binutils | |
706 bison | [] |
707 bison-runtime | [] [] [] [] [] |
708 bluez-pin | [] [] [] [] [] |
709 bombono-dvd | |
710 buzztard | |
711 cflow | |
712 clisp | |
713 coreutils | [] |
714 cpio | |
715 cppi | |
716 cpplib | |
717 cryptsetup | |
718 dfarc | [] |
719 dialog | [] [] [] [] [] |
720 dico | |
721 diffutils | [] [] |
722 dink | |
723 doodle | |
724 e2fsprogs | |
725 enscript | |
726 exif | [] |
727 fetchmail | |
728 findutils | |
729 flex | |
730 freedink | [] |
731 gas | |
732 gawk | |
733 gcal | |
734 gcc | |
735 gettext-examples | [] [] [] [] |
736 gettext-runtime | [] |
737 gettext-tools | [] |
738 gip | [] [] |
739 gjay | |
740 gliv | |
741 glunarclock | [] |
742 gnubiff | |
743 gnucash | () () () () |
744 gnuedu | |
745 gnulib | |
746 gnunet | |
747 gnunet-gtk | |
748 gnutls | [] |
749 gold | |
750 gpe-aerial | [] |
751 gpe-beam | [] |
752 gpe-bluetooth | [] [] |
753 gpe-calendar | [] |
754 gpe-clock | [] [] [] [] [] |
755 gpe-conf | [] [] |
756 gpe-contacts | [] [] |
757 gpe-edit | [] |
758 gpe-filemanager | [] [] |
759 gpe-go | [] [] [] |
760 gpe-login | [] |
761 gpe-ownerinfo | [] [] |
762 gpe-package | [] [] |
763 gpe-sketchbook | [] [] |
764 gpe-su | [] [] [] [] [] [] |
765 gpe-taskmanager | [] [] [] [] [] [] |
766 gpe-timesheet | [] [] |
767 gpe-today | [] [] [] [] |
768 gpe-todo | [] [] |
769 gphoto2 | |
770 gprof | [] |
771 gpsdrive | |
772 gramadoir | |
773 grep | |
774 grub | |
775 gsasl | |
776 gss | |
777 gst-plugins-bad | [] [] [] [] |
778 gst-plugins-base | [] [] |
779 gst-plugins-good | [] [] |
780 gst-plugins-ugly | [] [] [] [] [] |
781 gstreamer | |
782 gtick | |
783 gtkam | [] |
784 gtkorphan | [] [] |
785 gtkspell | [] [] [] [] [] [] [] |
786 gutenprint | |
787 hello | [] [] [] |
788 help2man | |
789 hylafax | |
790 idutils | |
791 indent | |
792 iso_15924 | [] [] |
793 iso_3166 | [] [] () [] [] [] [] [] |
794 iso_3166_2 | |
795 iso_4217 | [] [] |
796 iso_639 | [] [] |
797 iso_639_3 | [] |
798 jwhois | [] |
799 kbd | |
800 keytouch | [] |
801 keytouch-editor | [] |
802 keytouch-keyboa... | [] |
803 klavaro | [] |
804 latrine | [] |
805 ld | |
806 leafpad | [] [] [] |
807 libc | [] |
808 libexif | |
809 libextractor | |
810 libgnutls | [] |
811 libgpewidget | [] [] |
812 libgpg-error | |
813 libgphoto2 | |
814 libgphoto2_port | |
815 libgsasl | |
816 libiconv | |
817 libidn | |
818 lifelines | |
819 liferea | |
820 lilypond | |
821 linkdr | |
822 lordsawar | |
823 lprng | |
824 lynx | |
825 m4 | |
826 mailfromd | |
827 mailutils | |
828 make | [] |
829 man-db | |
830 man-db-manpages | |
831 minicom | [] |
832 mkisofs | |
833 myserver | |
834 nano | [] [] |
835 opcodes | |
836 parted | |
837 pies | |
838 popt | [] [] [] |
839 psmisc | |
840 pspp | |
841 pwdutils | |
842 radius | |
843 recode | |
844 rosegarden | |
845 rpm | |
846 rush | |
847 sarg | |
848 screem | |
849 scrollkeeper | [] [] |
850 sed | |
851 sharutils | |
852 shishi | |
853 skencil | |
854 solfege | [] |
855 solfege-manual | |
856 soundtracker | |
857 sp | |
858 sysstat | [] |
859 tar | [] |
860 texinfo | [] |
861 tin | |
862 unicode-han-tra... | |
863 unicode-transla... | |
864 util-linux-ng | |
865 vice | |
866 vmm | |
867 vorbis-tools | |
868 wastesedge | |
869 wdiff | |
870 wget | [] |
871 wyslij-po | |
872 xchat | [] [] [] |
873 xdg-user-dirs | [] [] [] [] [] [] [] [] |
874 xkeyboard-config | [] [] [] |
875 +-----------------------------------------------+
876 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
877 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1
878
879 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
880 +---------------------------------------------------+
881 a2ps | [] [] [] [] [] [] [] [] |
882 aegis | [] [] [] |
883 ant-phone | [] [] |
884 anubis | [] [] [] |
885 aspell | [] [] [] [] [] |
886 bash | [] [] |
887 bfd | [] |
888 bibshelf | [] [] |
889 binutils | [] [] |
890 bison | [] [] [] |
891 bison-runtime | [] [] [] [] [] [] [] |
892 bluez-pin | [] [] [] [] [] [] [] [] |
893 bombono-dvd | [] () |
894 buzztard | [] [] |
895 cflow | [] |
896 clisp | [] [] |
897 coreutils | [] [] [] [] [] [] |
898 cpio | [] [] [] |
899 cppi | [] |
900 cpplib | [] |
901 cryptsetup | [] |
902 dfarc | [] |
903 dialog | [] [] [] [] |
904 dico | [] |
905 diffutils | [] [] [] [] [] [] |
906 dink | () |
907 doodle | [] [] |
908 e2fsprogs | [] [] |
909 enscript | [] [] [] [] [] |
910 exif | [] [] [] () [] |
911 fetchmail | [] [] [] [] |
912 findutils | [] [] [] [] [] |
913 flex | [] [] [] [] [] |
914 freedink | [] [] |
915 gas | |
916 gawk | [] [] [] [] |
917 gcal | |
918 gcc | [] |
919 gettext-examples | [] [] [] [] [] [] [] [] |
920 gettext-runtime | [] [] [] [] [] [] [] [] [] |
921 gettext-tools | [] [] [] [] [] [] |
922 gip | [] [] [] [] [] |
923 gjay | |
924 gliv | [] [] [] [] [] [] |
925 glunarclock | [] [] [] [] [] |
926 gnubiff | [] () |
927 gnucash | [] () () () |
928 gnuedu | [] |
929 gnulib | [] [] [] [] |
930 gnunet | |
931 gnunet-gtk | |
932 gnutls | [] [] |
933 gold | |
934 gpe-aerial | [] [] [] [] [] [] [] |
935 gpe-beam | [] [] [] [] [] [] [] |
936 gpe-bluetooth | [] [] |
937 gpe-calendar | [] [] [] [] |
938 gpe-clock | [] [] [] [] [] [] [] [] |
939 gpe-conf | [] [] [] [] [] [] [] |
940 gpe-contacts | [] [] [] [] [] |
941 gpe-edit | [] [] [] |
942 gpe-filemanager | [] [] [] |
943 gpe-go | [] [] [] [] [] [] [] [] |
944 gpe-login | [] [] |
945 gpe-ownerinfo | [] [] [] [] [] [] [] [] |
946 gpe-package | [] [] |
947 gpe-sketchbook | [] [] [] [] [] [] [] |
948 gpe-su | [] [] [] [] [] [] [] [] |
949 gpe-taskmanager | [] [] [] [] [] [] [] [] |
950 gpe-timesheet | [] [] [] [] [] [] [] [] |
951 gpe-today | [] [] [] [] [] [] [] [] |
952 gpe-todo | [] [] [] [] [] |
953 gphoto2 | [] [] [] [] [] [] [] [] |
954 gprof | [] [] [] |
955 gpsdrive | [] [] |
956 gramadoir | [] [] |
957 grep | [] [] [] [] |
958 grub | [] [] [] |
959 gsasl | [] [] [] [] |
960 gss | [] [] [] |
961 gst-plugins-bad | [] [] [] [] [] [] |
962 gst-plugins-base | [] [] [] [] [] |
963 gst-plugins-good | [] [] [] [] [] |
964 gst-plugins-ugly | [] [] [] [] [] [] |
965 gstreamer | [] [] [] [] [] |
966 gtick | [] [] [] |
967 gtkam | [] [] [] [] [] [] |
968 gtkorphan | [] |
969 gtkspell | [] [] [] [] [] [] [] [] [] [] |
970 gutenprint | [] [] |
971 hello | [] [] [] [] |
972 help2man | [] [] |
973 hylafax | [] |
974 idutils | [] [] [] [] [] |
975 indent | [] [] [] [] [] [] [] |
976 iso_15924 | [] [] [] [] |
977 iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] |
978 iso_3166_2 | [] [] [] |
979 iso_4217 | [] [] [] [] [] [] [] [] |
980 iso_639 | [] [] [] [] [] [] [] [] [] |
981 iso_639_3 | [] [] |
982 jwhois | [] [] [] [] |
983 kbd | [] [] [] |
984 keytouch | [] [] [] |
985 keytouch-editor | [] [] [] |
986 keytouch-keyboa... | [] [] [] |
987 klavaro | [] [] |
988 latrine | [] [] |
989 ld | |
990 leafpad | [] [] [] [] [] [] [] [] [] |
991 libc | [] [] [] [] |
992 libexif | [] [] () [] |
993 libextractor | |
994 libgnutls | [] [] |
995 libgpewidget | [] [] [] |
996 libgpg-error | [] [] |
997 libgphoto2 | [] [] |
998 libgphoto2_port | [] [] [] [] [] |
999 libgsasl | [] [] [] [] [] |
1000 libiconv | [] [] [] [] [] |
1001 libidn | [] [] |
1002 lifelines | [] [] |
1003 liferea | [] [] [] [] [] () () [] |
1004 lilypond | [] |
1005 linkdr | [] [] [] |
1006 lordsawar | |
1007 lprng | [] |
1008 lynx | [] [] [] |
1009 m4 | [] [] [] [] [] |
1010 mailfromd | [] |
1011 mailutils | [] |
1012 make | [] [] [] [] |
1013 man-db | [] [] [] |
1014 man-db-manpages | [] [] [] |
1015 minicom | [] [] [] [] |
1016 mkisofs | [] [] [] |
1017 myserver | |
1018 nano | [] [] [] [] |
1019 opcodes | [] [] |
1020 parted | [] [] [] [] |
1021 pies | [] |
1022 popt | [] [] [] [] |
1023 psmisc | [] [] [] |
1024 pspp | [] [] |
1025 pwdutils | [] |
1026 radius | [] [] [] |
1027 recode | [] [] [] [] [] [] [] [] |
1028 rosegarden | () () |
1029 rpm | [] [] [] |
1030 rush | [] [] |
1031 sarg | |
1032 screem | |
1033 scrollkeeper | [] [] [] [] [] [] [] [] |
1034 sed | [] [] [] [] [] [] [] [] [] |
1035 sharutils | [] [] [] [] |
1036 shishi | [] |
1037 skencil | [] [] |
1038 solfege | [] [] [] [] |
1039 solfege-manual | [] [] [] |
1040 soundtracker | [] |
1041 sp | |
1042 sysstat | [] [] [] [] |
1043 tar | [] [] [] [] |
1044 texinfo | [] [] [] [] |
1045 tin | [] |
1046 unicode-han-tra... | |
1047 unicode-transla... | |
1048 util-linux-ng | [] [] [] [] [] |
1049 vice | [] |
1050 vmm | [] |
1051 vorbis-tools | [] [] |
1052 wastesedge | [] |
1053 wdiff | [] [] |
1054 wget | [] [] [] [] [] [] [] |
1055 wyslij-po | [] [] [] |
1056 xchat | [] [] [] [] [] [] [] [] [] |
1057 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
1058 xkeyboard-config | [] [] [] |
1059 +---------------------------------------------------+
1060 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
1061 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37
1062
1063 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
1064 +---------------------------------------------------+
1065 a2ps | [] [] [] [] [] | 27
1066 aegis | [] | 9
1067 ant-phone | [] [] [] [] | 9
1068 anubis | [] [] [] [] | 15
1069 aspell | [] [] [] | 20
1070 bash | [] [] [] | 12
1071 bfd | [] | 6
1072 bibshelf | [] [] [] | 16
1073 binutils | [] [] | 8
1074 bison | [] [] | 12
1075 bison-runtime | [] [] [] [] [] [] | 29
1076 bluez-pin | [] [] [] [] [] [] [] [] | 37
1077 bombono-dvd | [] | 4
1078 buzztard | [] | 7
1079 cflow | [] [] [] | 9
1080 clisp | | 10
1081 coreutils | [] [] [] [] | 22
1082 cpio | [] [] [] [] [] [] | 13
1083 cppi | [] [] | 5
1084 cpplib | [] [] [] [] [] [] | 14
1085 cryptsetup | [] [] | 7
1086 dfarc | [] | 9
1087 dialog | [] [] [] [] [] [] [] | 30
1088 dico | [] | 2
1089 diffutils | [] [] [] [] [] [] | 30
1090 dink | | 4
1091 doodle | [] [] | 7
1092 e2fsprogs | [] [] [] | 11
1093 enscript | [] [] [] [] | 17
1094 exif | [] [] [] | 16
1095 fetchmail | [] [] [] | 17
1096 findutils | [] [] [] [] [] | 20
1097 flex | [] [] [] [] | 15
1098 freedink | [] | 10
1099 gas | [] | 4
1100 gawk | [] [] [] [] | 18
1101 gcal | [] [] | 5
1102 gcc | [] [] [] | 7
1103 gettext-examples | [] [] [] [] [] [] [] | 34
1104 gettext-runtime | [] [] [] [] [] [] [] | 29
1105 gettext-tools | [] [] [] [] [] [] | 22
1106 gip | [] [] [] [] | 22
1107 gjay | [] | 3
1108 gliv | [] [] [] | 14
1109 glunarclock | [] [] [] [] [] | 19
1110 gnubiff | [] [] | 4
1111 gnucash | () [] () [] () | 10
1112 gnuedu | [] [] | 7
1113 gnulib | [] [] [] [] | 16
1114 gnunet | [] | 1
1115 gnunet-gtk | [] [] [] | 5
1116 gnutls | [] [] [] | 10
1117 gold | [] | 4
1118 gpe-aerial | [] [] [] | 18
1119 gpe-beam | [] [] [] | 19
1120 gpe-bluetooth | [] [] [] | 13
1121 gpe-calendar | [] [] [] [] | 12
1122 gpe-clock | [] [] [] [] [] | 28
1123 gpe-conf | [] [] [] [] | 20
1124 gpe-contacts | [] [] [] | 17
1125 gpe-edit | [] [] [] | 12
1126 gpe-filemanager | [] [] [] [] | 16
1127 gpe-go | [] [] [] [] [] | 25
1128 gpe-login | [] [] [] | 11
1129 gpe-ownerinfo | [] [] [] [] [] | 25
1130 gpe-package | [] [] [] | 13
1131 gpe-sketchbook | [] [] [] | 20
1132 gpe-su | [] [] [] [] [] | 30
1133 gpe-taskmanager | [] [] [] [] [] | 29
1134 gpe-timesheet | [] [] [] [] [] | 25
1135 gpe-today | [] [] [] [] [] [] | 30
1136 gpe-todo | [] [] [] [] | 17
1137 gphoto2 | [] [] [] [] [] | 24
1138 gprof | [] [] [] | 15
1139 gpsdrive | [] [] [] | 11
1140 gramadoir | [] [] [] | 11
1141 grep | [] [] [] | 10
1142 grub | [] [] [] | 14
1143 gsasl | [] [] [] [] | 14
1144 gss | [] [] [] | 11
1145 gst-plugins-bad | [] [] [] [] | 26
1146 gst-plugins-base | [] [] [] [] [] | 24
1147 gst-plugins-good | [] [] [] [] | 24
1148 gst-plugins-ugly | [] [] [] [] [] | 29
1149 gstreamer | [] [] [] [] | 22
1150 gtick | [] [] [] | 13
1151 gtkam | [] [] [] | 20
1152 gtkorphan | [] [] [] | 14
1153 gtkspell | [] [] [] [] [] [] [] [] [] | 45
1154 gutenprint | [] | 10
1155 hello | [] [] [] [] [] [] | 21
1156 help2man | [] [] | 7
1157 hylafax | [] | 5
1158 idutils | [] [] [] [] | 17
1159 indent | [] [] [] [] [] [] | 30
1160 iso_15924 | () [] () [] [] | 16
1161 iso_3166 | [] [] () [] [] () [] [] [] () | 53
1162 iso_3166_2 | () [] () [] | 9
1163 iso_4217 | [] () [] [] () [] [] | 26
1164 iso_639 | [] [] [] () [] () [] [] [] [] | 38
1165 iso_639_3 | [] () | 8
1166 jwhois | [] [] [] [] [] | 16
1167 kbd | [] [] [] [] [] | 15
1168 keytouch | [] [] [] | 16
1169 keytouch-editor | [] [] [] | 14
1170 keytouch-keyboa... | [] [] [] | 14
1171 klavaro | [] | 11
1172 latrine | [] [] [] | 10
1173 ld | [] [] [] [] | 11
1174 leafpad | [] [] [] [] [] [] | 33
1175 libc | [] [] [] [] [] | 21
1176 libexif | [] () | 7
1177 libextractor | [] | 1
1178 libgnutls | [] [] [] | 9
1179 libgpewidget | [] [] [] | 14
1180 libgpg-error | [] [] [] | 9
1181 libgphoto2 | [] [] | 8
1182 libgphoto2_port | [] [] [] [] | 14
1183 libgsasl | [] [] [] | 13
1184 libiconv | [] [] [] [] | 21
1185 libidn | () [] [] | 11
1186 lifelines | [] | 4
1187 liferea | [] [] [] | 21
1188 lilypond | [] | 7
1189 linkdr | [] [] [] [] [] | 17
1190 lordsawar | | 1
1191 lprng | [] | 3
1192 lynx | [] [] [] [] | 17
1193 m4 | [] [] [] [] | 19
1194 mailfromd | [] [] | 3
1195 mailutils | [] | 5
1196 make | [] [] [] [] | 21
1197 man-db | [] [] [] | 8
1198 man-db-manpages | | 4
1199 minicom | [] [] | 16
1200 mkisofs | [] [] | 9
1201 myserver | | 0
1202 nano | [] [] [] [] | 21
1203 opcodes | [] [] [] | 11
1204 parted | [] [] [] [] [] | 15
1205 pies | [] [] | 3
1206 popt | [] [] [] [] [] [] | 27
1207 psmisc | [] [] | 11
1208 pspp | | 4
1209 pwdutils | [] [] | 6
1210 radius | [] [] | 9
1211 recode | [] [] [] [] | 28
1212 rosegarden | () | 0
1213 rpm | [] [] [] | 11
1214 rush | [] [] | 4
1215 sarg | | 1
1216 screem | [] | 3
1217 scrollkeeper | [] [] [] [] [] | 27
1218 sed | [] [] [] [] [] | 30
1219 sharutils | [] [] [] [] [] | 22
1220 shishi | [] | 3
1221 skencil | [] [] | 7
1222 solfege | [] [] [] [] | 16
1223 solfege-manual | [] | 8
1224 soundtracker | [] [] [] | 9
1225 sp | [] | 3
1226 sysstat | [] [] | 15
1227 tar | [] [] [] [] [] [] | 23
1228 texinfo | [] [] [] [] [] | 17
1229 tin | | 4
1230 unicode-han-tra... | | 0
1231 unicode-transla... | | 2
1232 util-linux-ng | [] [] [] [] | 20
1233 vice | () () | 1
1234 vmm | [] | 4
1235 vorbis-tools | [] | 6
1236 wastesedge | | 2
1237 wdiff | [] [] | 7
1238 wget | [] [] [] [] [] | 26
1239 wyslij-po | [] [] | 8
1240 xchat | [] [] [] [] [] [] | 36
1241 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63
1242 xkeyboard-config | [] [] [] | 22
1243 +---------------------------------------------------+
1244 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
1245 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618
1246
1247 Some counters in the preceding matrix are higher than the number of
1248 visible blocks let us expect. This is because a few extra PO files are
1249 used for implementing regional variants of languages, or language
1250 dialects.
1251
1252 For a PO file in the matrix above to be effective, the package to
1253 which it applies should also have been internationalized and
1254 distributed as such by its maintainer. There might be an observable
1255 lag between the mere existence a PO file and its wide availability in a
1256 distribution.
1257
1258 If June 2010 seems to be old, you may fetch a more recent copy of
1259 this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
1260 matrix with full percentage details can be found at
1261 `http://translationproject.org/extra/matrix.html'.
1262
1263 1.5 Using `gettext' in new packages
1264 ===================================
1265
1266 If you are writing a freely available program and want to
1267 internationalize it you are welcome to use GNU `gettext' in your
1268 package. Of course you have to respect the GNU Library General Public
1269 License which covers the use of the GNU `gettext' library. This means
1270 in particular that even non-free programs can use `libintl' as a shared
1271 library, whereas only free software can use `libintl' as a static
1272 library or use modified versions of `libintl'.
1273
1274 Once the sources are changed appropriately and the setup can handle
1275 the use of `gettext' the only thing missing are the translations. The
1276 Free Translation Project is also available for packages which are not
1277 developed inside the GNU project. Therefore the information given above
1278 applies also for every other Free Software Project. Contact
1279 `coordinator@translationproject.org' to make the `.pot' files available
1280 to the translation teams.
1281
5454 Laurent Monin <zas@norz.org>
5555 - Implemented TOC string API
5656 - Times for discid example
57
58 Tim Van Holder <tim.vanholder at gmail dot com>
59 - ISRC and MCN support for BSD
60 - fixes for get_device on Linux
1010 # PATCH is increase for all other releases
1111 SET(libdiscid_MAJOR 0)
1212 SET(libdiscid_MINOR 6)
13 SET(libdiscid_PATCH 1)
13 SET(libdiscid_PATCH 2)
1414
1515
1616 SET(libdiscid_VERSION ${libdiscid_MAJOR}.${libdiscid_MINOR}.${libdiscid_PATCH})
5454 ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
5555 SET(libdiscid_OS "darwin")
5656 ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
57 SET(libdiscid_OS "freebsd")
57 SET(libdiscid_OS "bsd")
5858 ELSEIF(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
59 SET(libdiscid_OS "netbsd")
59 SET(libdiscid_OS "bsd")
60 SET(libdiscid_OSDEP_LIBS util) # for getrawpartition
6061 ELSEIF(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
61 SET(libdiscid_OS "netbsd")
62 SET(libdiscid_OS "bsd")
63 SET(libdiscid_OSDEP_LIBS util) # for getrawpartition
6264 ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
6365 SET(libdiscid_OS "solaris")
6466 ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows")
7173 ENDIF()
7274
7375 # choose platform dependent source files
74 IF(libdiscid_OS MATCHES "win32")
76 IF(libdiscid_OS EQUAL "win32")
7577 SET(libdiscid_OSDEP_SRCS src/toc.c src/disc_win32.c)
7678 SET(libdiscid_RCS ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc)
77 ELSEIF(libdiscid_OS MATCHES "darwin")
78 SET(libdiscid_OSDEP_SRCS src/toc.c src/unix.c src/disc_darwin.c)
79 FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
80 SET(libdiscid_OSDEP_LIBS ${COREFOUNDATION_LIBRARY} IOKit)
81 ELSEIF(libdiscid_OS MATCHES "generic")
79 ELSEIF(libdiscid_OS EQUAL "generic")
8280 SET(libdiscid_OSDEP_SRCS src/disc_${libdiscid_OS}.c)
8381 ELSE()
8482 # unix platforms are the standard/default case
8583 SET(libdiscid_OSDEP_SRCS src/toc.c src/unix.c src/disc_${libdiscid_OS}.c)
84 IF(libdiscid_OS EQUAL "darwin") # Extra libraries needed
85 FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
86 SET(libdiscid_OSDEP_LIBS ${COREFOUNDATION_LIBRARY} IOKit)
87 ENDIF()
8688 ENDIF()
8789
8890 STRING(REPLACE ";" " " libdiscid_OSDEP_STR "${libdiscid_OSDEP_SRCS}")
00 libdiscid ChangeLog:
11 --------------------
2
3 libdiscid-0.6.2:
4
5 - ISRC and MCN support on BSD
6 - LIB-60: fix make check for default device on generic/unknown platform
7 - make Doxygen output reproducible (no timestamps)
8 - remove newline for Linux device "1" from proc
29
310 libdiscid-0.6.1:
411
1313 FULL_PATH_NAMES = NO
1414 MACRO_EXPANSION = YES
1515 EXPAND_ONLY_PREDEF = YES
16 HTML_TIMESTAMP = NO
8383 libdiscid_la_LDFLAGS += -framework CoreFoundation -framework IOKit
8484 libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_darwin.c
8585 endif
86 if OS_NETBSD
87 libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_bsd.c
88 libdiscid_la_LIBADD += -lutil
89 endif
8690 if OS_FREEBSD
87 libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_freebsd.c
91 libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_bsd.c
8892 endif
8993 if OS_GENERIC
9094 libdiscid_la_SOURCES += src/disc_generic.c
9195 endif
9296 if OS_LINUX
9397 libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_linux.c
94 endif
95 if OS_NETBSD
96 libdiscid_la_SOURCES += src/toc.c src/unix.c src/disc_netbsd.c
9798 endif
9899 #if OS_QNX
99100 #libdiscid_la_LIBADD += -lsocket
119120
120121 docs:
121122 doxygen
123
124 git-clean: maintainer-clean
125 rm -rf configure config.h.in Makefile.in
126 rm -rf aclocal.m4 build-aux/
0 # Makefile.in generated by automake 1.14 from Makefile.am.
0 # Makefile.in generated by automake 1.15 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3838
3939
4040 VPATH = @srcdir@
41 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
41 am__is_gnu_make = { \
42 if test -z '$(MAKELEVEL)'; then \
43 false; \
44 elif test -n '$(MAKE_HOST)'; then \
45 true; \
46 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
47 true; \
48 else \
49 false; \
50 fi; \
51 }
4252 am__make_running_with_option = \
4353 case $${target_option-} in \
4454 ?) ;; \
113123 #endif
114124 @OS_DARWIN_TRUE@am__append_2 = -framework CoreFoundation -framework IOKit
115125 @OS_DARWIN_TRUE@am__append_3 = src/toc.c src/unix.c src/disc_darwin.c
116 @OS_FREEBSD_TRUE@am__append_4 = src/toc.c src/unix.c src/disc_freebsd.c
117 @OS_GENERIC_TRUE@am__append_5 = src/disc_generic.c
118 @OS_LINUX_TRUE@am__append_6 = src/toc.c src/unix.c src/disc_linux.c
119 @OS_NETBSD_TRUE@am__append_7 = src/toc.c src/unix.c src/disc_netbsd.c
126 @OS_NETBSD_TRUE@am__append_4 = src/toc.c src/unix.c src/disc_bsd.c
127 @OS_NETBSD_TRUE@am__append_5 = -lutil
128 @OS_FREEBSD_TRUE@am__append_6 = src/toc.c src/unix.c src/disc_bsd.c
129 @OS_GENERIC_TRUE@am__append_7 = src/disc_generic.c
130 @OS_LINUX_TRUE@am__append_8 = src/toc.c src/unix.c src/disc_linux.c
120131 #if OS_QNX
121132 #libdiscid_la_LIBADD += -lsocket
122133 #endif
123 @OS_SOLARIS_TRUE@am__append_8 = src/toc.c src/unix.c src/disc_solaris.c
124 @OS_WIN32_TRUE@am__append_9 = src/toc.c src/disc_win32.c versioninfo.rc
134 @OS_SOLARIS_TRUE@am__append_9 = src/toc.c src/unix.c src/disc_solaris.c
135 @OS_WIN32_TRUE@am__append_10 = src/toc.c src/disc_win32.c versioninfo.rc
125136 subdir = .
126 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
127 $(top_srcdir)/configure $(am__configure_deps) \
128 $(srcdir)/config.h.in $(srcdir)/libdiscid.pc.in \
129 $(srcdir)/versioninfo.rc.in $(srcdir)/Doxyfile.in \
130 $(top_srcdir)/include/discid/discid.h.in depcomp \
131 $(discid_inc_HEADERS) $(noinst_HEADERS) test-driver AUTHORS \
132 COPYING ChangeLog INSTALL README ar-lib compile config.guess \
133 config.sub install-sh missing ltmain.sh
134137 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
135138 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
136139 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
137140 $(ACLOCAL_M4)
141 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
142 $(am__configure_deps) $(discid_inc_HEADERS) $(noinst_HEADERS) \
143 $(am__DIST_COMMON)
138144 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
139145 configure.lineno config.status.lineno
140146 mkinstalldirs = $(install_sh) -d
172178 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pcdir)" \
173179 "$(DESTDIR)$(discid_incdir)"
174180 LTLIBRARIES = $(lib_LTLIBRARIES)
175 libdiscid_la_DEPENDENCIES =
181 am__DEPENDENCIES_1 =
182 libdiscid_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
176183 am__libdiscid_la_SOURCES_DIST = src/base64.c src/sha1.c src/disc.c \
177 src/toc.c src/unix.c src/disc_darwin.c src/disc_freebsd.c \
178 src/disc_generic.c src/disc_linux.c src/disc_netbsd.c \
179 src/disc_solaris.c src/disc_win32.c versioninfo.rc
184 src/toc.c src/unix.c src/disc_darwin.c src/disc_bsd.c \
185 src/disc_generic.c src/disc_linux.c src/disc_solaris.c \
186 src/disc_win32.c versioninfo.rc
180187 am__dirstamp = $(am__leading_dot)dirstamp
181188 @OS_DARWIN_TRUE@am__objects_1 = src/toc.lo src/unix.lo \
182189 @OS_DARWIN_TRUE@ src/disc_darwin.lo
183 @OS_FREEBSD_TRUE@am__objects_2 = src/toc.lo src/unix.lo \
184 @OS_FREEBSD_TRUE@ src/disc_freebsd.lo
185 @OS_GENERIC_TRUE@am__objects_3 = src/disc_generic.lo
186 @OS_LINUX_TRUE@am__objects_4 = src/toc.lo src/unix.lo \
190 @OS_NETBSD_TRUE@am__objects_2 = src/toc.lo src/unix.lo src/disc_bsd.lo
191 @OS_FREEBSD_TRUE@am__objects_3 = src/toc.lo src/unix.lo \
192 @OS_FREEBSD_TRUE@ src/disc_bsd.lo
193 @OS_GENERIC_TRUE@am__objects_4 = src/disc_generic.lo
194 @OS_LINUX_TRUE@am__objects_5 = src/toc.lo src/unix.lo \
187195 @OS_LINUX_TRUE@ src/disc_linux.lo
188 @OS_NETBSD_TRUE@am__objects_5 = src/toc.lo src/unix.lo \
189 @OS_NETBSD_TRUE@ src/disc_netbsd.lo
190196 @OS_SOLARIS_TRUE@am__objects_6 = src/toc.lo src/unix.lo \
191197 @OS_SOLARIS_TRUE@ src/disc_solaris.lo
192198 @OS_WIN32_TRUE@am__objects_7 = src/toc.lo src/disc_win32.lo \
243249 am__v_at_0 = @
244250 am__v_at_1 =
245251 DEFAULT_INCLUDES = -I.@am__isrc@
246 depcomp = $(SHELL) $(top_srcdir)/depcomp
252 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
247253 am__depfiles_maybe = depfiles
248254 am__mv = mv -f
249255 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
459465 RECHECK_LOGS = $(TEST_LOGS)
460466 TEST_SUITE_LOG = test-suite.log
461467 TEST_EXTENSIONS = @EXEEXT@ .test
462 LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
468 LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
463469 LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
464470 am__set_b = \
465471 case '$@' in \
474480 am__test_logs1 = $(TESTS:=.log)
475481 am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
476482 TEST_LOGS = $(am__test_logs2:.test.log=.log)
477 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
483 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
478484 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
479485 $(TEST_LOG_FLAGS)
486 am__DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.in \
487 $(srcdir)/config.h.in $(srcdir)/libdiscid.pc.in \
488 $(srcdir)/versioninfo.rc.in $(top_srcdir)/build-aux/ar-lib \
489 $(top_srcdir)/build-aux/compile \
490 $(top_srcdir)/build-aux/config.guess \
491 $(top_srcdir)/build-aux/config.sub \
492 $(top_srcdir)/build-aux/depcomp \
493 $(top_srcdir)/build-aux/install-sh \
494 $(top_srcdir)/build-aux/ltmain.sh \
495 $(top_srcdir)/build-aux/missing \
496 $(top_srcdir)/build-aux/test-driver \
497 $(top_srcdir)/include/discid/discid.h.in ABOUT-NLS AUTHORS \
498 COPYING ChangeLog INSTALL README build-aux/ar-lib \
499 build-aux/compile build-aux/config.guess build-aux/config.sub \
500 build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \
501 build-aux/missing config.rpath
480502 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
481503 distdir = $(PACKAGE)-$(VERSION)
482504 top_distdir = $(distdir)
534556 LIPO = @LIPO@
535557 LN_S = @LN_S@
536558 LTLIBOBJS = @LTLIBOBJS@
559 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
537560 MAKEINFO = @MAKEINFO@
538561 MANIFEST_TOOL = @MANIFEST_TOOL@
539562 MKDIR_P = @MKDIR_P@
651674 @HAVE_MUSICBRAINZ5_TRUE@disc_metadata_LDADD = $(top_builddir)/libdiscid.la -lmusicbrainz5
652675 lib_LTLIBRARIES = libdiscid.la
653676 libdiscid_la_SOURCES = src/base64.c src/sha1.c src/disc.c \
654 $(am__append_3) $(am__append_4) $(am__append_5) \
655 $(am__append_6) $(am__append_7) $(am__append_8) \
656 $(am__append_9)
677 $(am__append_3) $(am__append_4) $(am__append_6) \
678 $(am__append_7) $(am__append_8) $(am__append_9) \
679 $(am__append_10)
657680
658681 # use a (well defined) version number, rather than version-info calculations
659682 libdiscid_la_LDFLAGS = -version-number @libdiscid_VERSION_LT@ \
660683 -no-undefined $(am__append_2)
661 libdiscid_la_LIBADD =
684 libdiscid_la_LIBADD = $(am__append_5)
662685
663686 # for Windows Resource Files
664687 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
683706 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
684707 $(am__cd) $(top_srcdir) && \
685708 $(AUTOMAKE) --foreign Makefile
686 .PRECIOUS: Makefile
687709 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
688710 @case '$?' in \
689711 *config.status*) \
772794 src/toc.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
773795 src/unix.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
774796 src/disc_darwin.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
775 src/disc_freebsd.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
797 src/disc_bsd.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
776798 src/disc_generic.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
777799 src/disc_linux.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
778 src/disc_netbsd.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
779800 src/disc_solaris.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
780801 src/disc_win32.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
781802
871892 @AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/discisrc.Po@am__quote@
872893 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/base64.Plo@am__quote@
873894 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc.Plo@am__quote@
895 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_bsd.Plo@am__quote@
874896 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_darwin.Plo@am__quote@
875 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_freebsd.Plo@am__quote@
876897 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_generic.Plo@am__quote@
877898 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_linux.Plo@am__quote@
878 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_netbsd.Plo@am__quote@
879899 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_solaris.Plo@am__quote@
880900 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/disc_win32.Plo@am__quote@
881901 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sha1.Plo@am__quote@
10521072 if test -n "$$am__remaking_logs"; then \
10531073 echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
10541074 "recursion detected" >&2; \
1055 else \
1075 elif test -n "$$redo_logs"; then \
10561076 am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
10571077 fi; \
10581078 if $(am__make_dryrun); then :; else \
12461266 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
12471267 || chmod -R a+r "$(distdir)"
12481268 dist-gzip: distdir
1249 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
1269 tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
12501270 $(am__post_remove_distdir)
12511271
12521272 dist-bzip2: distdir
12621282 $(am__post_remove_distdir)
12631283
12641284 dist-tarZ: distdir
1285 @echo WARNING: "Support for distribution archives compressed with" \
1286 "legacy program 'compress' is deprecated." >&2
1287 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
1288 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
1289 $(am__post_remove_distdir)
1290
1291 dist-shar: distdir
12651292 @echo WARNING: "Support for shar distribution archives is" \
12661293 "deprecated." >&2
12671294 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
1268 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
1269 $(am__post_remove_distdir)
1270
1271 dist-shar: distdir
1272 @echo WARNING: "Support for distribution archives compressed with" \
1273 "legacy program 'compress' is deprecated." >&2
1274 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
1275 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
1295 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
12761296 $(am__post_remove_distdir)
12771297
12781298 dist-zip: distdir
12901310 distcheck: dist
12911311 case '$(DIST_ARCHIVES)' in \
12921312 *.tar.gz*) \
1293 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
1313 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
12941314 *.tar.bz2*) \
12951315 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
12961316 *.tar.lz*) \
13001320 *.tar.Z*) \
13011321 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
13021322 *.shar.gz*) \
1303 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
1323 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
13041324 *.zip*) \
13051325 unzip $(distdir).zip ;;\
13061326 esac
13071327 chmod -R a-w $(distdir)
13081328 chmod u+w $(distdir)
1309 mkdir $(distdir)/_build $(distdir)/_inst
1329 mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
13101330 chmod a-w $(distdir)
13111331 test -d $(distdir)/_build || exit 0; \
13121332 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
13131333 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
13141334 && am__cwd=`pwd` \
1315 && $(am__cd) $(distdir)/_build \
1316 && ../configure --srcdir=.. --prefix="$$dc_install_base" \
1335 && $(am__cd) $(distdir)/_build/sub \
1336 && ../../configure \
13171337 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
13181338 $(DISTCHECK_CONFIGURE_FLAGS) \
1339 --srcdir=../.. --prefix="$$dc_install_base" \
13191340 && $(MAKE) $(AM_MAKEFLAGS) \
13201341 && $(MAKE) $(AM_MAKEFLAGS) dvi \
13211342 && $(MAKE) $(AM_MAKEFLAGS) check \
15161537 uninstall-discid_incHEADERS uninstall-libLTLIBRARIES \
15171538 uninstall-pcDATA
15181539
1540 .PRECIOUS: Makefile
1541
15191542
15201543 .rc.o:
15211544 $(AM_V_GEN)$(RCCOMPILE) -i "$<" -o "$@"
15251548
15261549 docs:
15271550 doxygen
1551
1552 git-clean: maintainer-clean
1553 rm -rf configure config.h.in Makefile.in
1554 rm -rf aclocal.m4 build-aux/
15281555
15291556 # Tell versions [3.59,3.63) of GNU make to not export all variables.
15301557 # Otherwise a system limit (for SysV at least) may be exceeded.
+1624
-1179
aclocal.m4 less more
0 # generated automatically by aclocal 1.14 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
0 # generated automatically by aclocal 1.15 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
33
44 # This file is free software; the Free Software Foundation
55 # gives unlimited permission to copy and/or distribute it,
2121
2222 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2323 #
24 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
25 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
26 # Foundation, Inc.
24 # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
2725 # Written by Gordon Matzigkeit, 1996
2826 #
2927 # This file is free software; the Free Software Foundation gives
3129 # modifications, as long as this notice is preserved.
3230
3331 m4_define([_LT_COPYING], [dnl
34 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
35 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
36 # Foundation, Inc.
37 # Written by Gordon Matzigkeit, 1996
32 # Copyright (C) 2014 Free Software Foundation, Inc.
33 # This is free software; see the source for copying conditions. There is NO
34 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35
36 # GNU Libtool is free software; you can redistribute it and/or modify
37 # it under the terms of the GNU General Public License as published by
38 # the Free Software Foundation; either version 2 of of the License, or
39 # (at your option) any later version.
3840 #
39 # This file is part of GNU Libtool.
41 # As a special exception to the GNU General Public License, if you
42 # distribute this file as part of a program or library that is built
43 # using GNU Libtool, you may include this file under the same
44 # distribution terms that you use for the rest of that program.
4045 #
41 # GNU Libtool is free software; you can redistribute it and/or
42 # modify it under the terms of the GNU General Public License as
43 # published by the Free Software Foundation; either version 2 of
44 # the License, or (at your option) any later version.
45 #
46 # As a special exception to the GNU General Public License,
47 # if you distribute this file as part of a program or library that
48 # is built using GNU Libtool, you may include this file under the
49 # same distribution terms that you use for the rest of that program.
50 #
51 # GNU Libtool is distributed in the hope that it will be useful,
52 # but WITHOUT ANY WARRANTY; without even the implied warranty of
46 # GNU Libtool is distributed in the hope that it will be useful, but
47 # WITHOUT ANY WARRANTY; without even the implied warranty of
5348 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5449 # GNU General Public License for more details.
5550 #
5651 # You should have received a copy of the GNU General Public License
57 # along with GNU Libtool; see the file COPYING. If not, a copy
58 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
59 # obtained by writing to the Free Software Foundation, Inc.,
60 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
52 # along with this program. If not, see <http://www.gnu.org/licenses/>.
6153 ])
6254
63 # serial 57 LT_INIT
55 # serial 58 LT_INIT
6456
6557
6658 # LT_PREREQ(VERSION)
8880 # LT_INIT([OPTIONS])
8981 # ------------------
9082 AC_DEFUN([LT_INIT],
91 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
83 [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
9284 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9385 AC_BEFORE([$0], [LT_LANG])dnl
9486 AC_BEFORE([$0], [LT_OUTPUT])dnl
112104 _LT_SET_OPTIONS([$0], [$1])
113105
114106 # This can be used to rebuild libtool when needed
115 LIBTOOL_DEPS="$ltmain"
107 LIBTOOL_DEPS=$ltmain
116108
117109 # Always use our own libtool.
118110 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
132124 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
133125
134126
127 # _LT_PREPARE_CC_BASENAME
128 # -----------------------
129 m4_defun([_LT_PREPARE_CC_BASENAME], [
130 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
131 func_cc_basename ()
132 {
133 for cc_temp in @S|@*""; do
134 case $cc_temp in
135 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
136 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
137 \-*) ;;
138 *) break;;
139 esac
140 done
141 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
142 }
143 ])# _LT_PREPARE_CC_BASENAME
144
145
135146 # _LT_CC_BASENAME(CC)
136147 # -------------------
137 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
148 # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
149 # but that macro is also expanded into generated libtool script, which
150 # arranges for $SED and $ECHO to be set by different means.
138151 m4_defun([_LT_CC_BASENAME],
139 [for cc_temp in $1""; do
140 case $cc_temp in
141 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
142 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
143 \-*) ;;
144 *) break;;
145 esac
146 done
147 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
152 [m4_require([_LT_PREPARE_CC_BASENAME])dnl
153 AC_REQUIRE([_LT_DECL_SED])dnl
154 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
155 func_cc_basename $1
156 cc_basename=$func_cc_basename_result
148157 ])
149158
150159
151160 # _LT_FILEUTILS_DEFAULTS
152161 # ----------------------
153162 # It is okay to use these file commands and assume they have been set
154 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
163 # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
155164 m4_defun([_LT_FILEUTILS_DEFAULTS],
156165 [: ${CP="cp -f"}
157166 : ${MV="mv -f"}
198207 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
199208 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
200209 m4_require([_LT_WITH_SYSROOT])dnl
210 m4_require([_LT_CMD_TRUNCATE])dnl
201211
202212 _LT_CONFIG_LIBTOOL_INIT([
203 # See if we are running on zsh, and set the options which allow our
213 # See if we are running on zsh, and set the options that allow our
204214 # commands through without removal of \ escapes INIT.
205 if test -n "\${ZSH_VERSION+set}" ; then
215 if test -n "\${ZSH_VERSION+set}"; then
206216 setopt NO_GLOB_SUBST
207217 fi
208218 ])
209 if test -n "${ZSH_VERSION+set}" ; then
219 if test -n "${ZSH_VERSION+set}"; then
210220 setopt NO_GLOB_SUBST
211221 fi
212222
219229 # AIX sometimes has problems with the GCC collect2 program. For some
220230 # reason, if we set the COLLECT_NAMES environment variable, the problems
221231 # vanish in a puff of smoke.
222 if test "X${COLLECT_NAMES+set}" != Xset; then
232 if test set != "${COLLECT_NAMES+set}"; then
223233 COLLECT_NAMES=
224234 export COLLECT_NAMES
225235 fi
230240 ofile=libtool
231241 can_build_shared=yes
232242
233 # All known linkers require a `.a' archive for static linking (except MSVC,
243 # All known linkers require a '.a' archive for static linking (except MSVC,
234244 # which needs '.lib').
235245 libext=a
236246
237 with_gnu_ld="$lt_cv_prog_gnu_ld"
238
239 old_CC="$CC"
240 old_CFLAGS="$CFLAGS"
247 with_gnu_ld=$lt_cv_prog_gnu_ld
248
249 old_CC=$CC
250 old_CFLAGS=$CFLAGS
241251
242252 # Set sane defaults for various variables
243253 test -z "$CC" && CC=cc
290300
291301 # _LT_PROG_LTMAIN
292302 # ---------------
293 # Note that this code is called both from `configure', and `config.status'
303 # Note that this code is called both from 'configure', and 'config.status'
294304 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
295 # `config.status' has no value for ac_aux_dir unless we are using Automake,
305 # 'config.status' has no value for ac_aux_dir unless we are using Automake,
296306 # so we pass a copy along to make sure it has a sensible value anyway.
297307 m4_defun([_LT_PROG_LTMAIN],
298308 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
299309 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
300 ltmain="$ac_aux_dir/ltmain.sh"
310 ltmain=$ac_aux_dir/ltmain.sh
301311 ])# _LT_PROG_LTMAIN
302312
303313
304314
305315 # So that we can recreate a full libtool script including additional
306316 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
307 # in macros and then make a single call at the end using the `libtool'
317 # in macros and then make a single call at the end using the 'libtool'
308318 # label.
309319
310320
436446
437447 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
438448 # ------------------------------------
439 # Quote a variable value, and forward it to `config.status' so that its
440 # declaration there will have the same value as in `configure'. VARNAME
449 # Quote a variable value, and forward it to 'config.status' so that its
450 # declaration there will have the same value as in 'configure'. VARNAME
441451 # must have a single quote delimited value for this to work.
442452 m4_define([_LT_CONFIG_STATUS_DECLARE],
443453 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
461471 # Output comment and list of tags supported by the script
462472 m4_defun([_LT_LIBTOOL_TAGS],
463473 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
464 available_tags="_LT_TAGS"dnl
474 available_tags='_LT_TAGS'dnl
465475 ])
466476
467477
489499 # _LT_LIBTOOL_CONFIG_VARS
490500 # -----------------------
491501 # Produce commented declarations of non-tagged libtool config variables
492 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
502 # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
493503 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
494504 # section) are produced by _LT_LIBTOOL_TAG_VARS.
495505 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
515525 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
516526 # variables for single and double quote escaping we saved from calls
517527 # to _LT_DECL, we can put quote escaped variables declarations
518 # into `config.status', and then the shell code to quote escape them in
519 # for loops in `config.status'. Finally, any additional code accumulated
528 # into 'config.status', and then the shell code to quote escape them in
529 # for loops in 'config.status'. Finally, any additional code accumulated
520530 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
521531 m4_defun([_LT_CONFIG_COMMANDS],
522532 [AC_PROVIDE_IFELSE([LT_OUTPUT],
562572 ]], lt_decl_quote_varnames); do
563573 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
564574 *[[\\\\\\\`\\"\\\$]]*)
565 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
575 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
566576 ;;
567577 *)
568578 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
575585 ]], lt_decl_dquote_varnames); do
576586 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
577587 *[[\\\\\\\`\\"\\\$]]*)
578 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
588 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
579589 ;;
580590 *)
581591 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
591601 # Generate a child script FILE with all initialization necessary to
592602 # reuse the environment learned by the parent script, and make the
593603 # file executable. If COMMENT is supplied, it is inserted after the
594 # `#!' sequence but before initialization text begins. After this
604 # '#!' sequence but before initialization text begins. After this
595605 # macro, additional text can be appended to FILE to form the body of
596606 # the child script. The macro ends with non-zero status if the
597607 # file could not be fully written (such as if the disk is full).
613623 _AS_PREPARE
614624 exec AS_MESSAGE_FD>&1
615625 _ASEOF
616 test $lt_write_fail = 0 && chmod +x $1[]dnl
626 test 0 = "$lt_write_fail" && chmod +x $1[]dnl
617627 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
618628
619629 # LT_OUTPUT
636646 } >&AS_MESSAGE_LOG_FD
637647
638648 lt_cl_help="\
639 \`$as_me' creates a local libtool stub from the current configuration,
649 '$as_me' creates a local libtool stub from the current configuration,
640650 for use in further configure time tests before the real libtool is
641651 generated.
642652
658668 This config.lt script is free software; the Free Software Foundation
659669 gives unlimited permision to copy, distribute and modify it."
660670
661 while test $[#] != 0
671 while test 0 != $[#]
662672 do
663673 case $[1] in
664674 --version | --v* | -V )
671681 lt_cl_silent=: ;;
672682
673683 -*) AC_MSG_ERROR([unrecognized option: $[1]
674 Try \`$[0] --help' for more information.]) ;;
684 Try '$[0] --help' for more information.]) ;;
675685
676686 *) AC_MSG_ERROR([unrecognized argument: $[1]
677 Try \`$[0] --help' for more information.]) ;;
687 Try '$[0] --help' for more information.]) ;;
678688 esac
679689 shift
680690 done
700710 # open by configure. Here we exec the FD to /dev/null, effectively closing
701711 # config.log, so it can be properly (re)opened and appended to by config.lt.
702712 lt_cl_success=:
703 test "$silent" = yes &&
713 test yes = "$silent" &&
704714 lt_config_lt_args="$lt_config_lt_args --quiet"
705715 exec AS_MESSAGE_LOG_FD>/dev/null
706716 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
720730 _LT_CONFIG_SAVE_COMMANDS([
721731 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
722732 m4_if(_LT_TAG, [C], [
723 # See if we are running on zsh, and set the options which allow our
733 # See if we are running on zsh, and set the options that allow our
724734 # commands through without removal of \ escapes.
725 if test -n "${ZSH_VERSION+set}" ; then
735 if test -n "${ZSH_VERSION+set}"; then
726736 setopt NO_GLOB_SUBST
727737 fi
728738
729 cfgfile="${ofile}T"
739 cfgfile=${ofile}T
730740 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
731741 $RM "$cfgfile"
732742
733743 cat <<_LT_EOF >> "$cfgfile"
734744 #! $SHELL
735
736 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
737 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
745 # Generated automatically by $as_me ($PACKAGE) $VERSION
738746 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
739747 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
740 #
748
749 # Provide generalized library-building support services.
750 # Written by Gordon Matzigkeit, 1996
751
741752 _LT_COPYING
742753 _LT_LIBTOOL_TAGS
754
755 # Configured defaults for sys_lib_dlsearch_path munging.
756 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
743757
744758 # ### BEGIN LIBTOOL CONFIG
745759 _LT_LIBTOOL_CONFIG_VARS
746760 _LT_LIBTOOL_TAG_VARS
747761 # ### END LIBTOOL CONFIG
762
763 _LT_EOF
764
765 cat <<'_LT_EOF' >> "$cfgfile"
766
767 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
768
769 _LT_PREPARE_MUNGE_PATH_LIST
770 _LT_PREPARE_CC_BASENAME
771
772 # ### END FUNCTIONS SHARED WITH CONFIGURE
748773
749774 _LT_EOF
750775
754779 # AIX sometimes has problems with the GCC collect2 program. For some
755780 # reason, if we set the COLLECT_NAMES environment variable, the problems
756781 # vanish in a puff of smoke.
757 if test "X${COLLECT_NAMES+set}" != Xset; then
782 if test set != "${COLLECT_NAMES+set}"; then
758783 COLLECT_NAMES=
759784 export COLLECT_NAMES
760785 fi
770795 # is reportedly fixed, but why not run on old versions too?
771796 sed '$q' "$ltmain" >> "$cfgfile" \
772797 || (rm -f "$cfgfile"; exit 1)
773
774 _LT_PROG_REPLACE_SHELLFNS
775798
776799 mv -f "$cfgfile" "$ofile" ||
777800 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
790813 [m4_if([$1], [], [
791814 PACKAGE='$PACKAGE'
792815 VERSION='$VERSION'
793 TIMESTAMP='$TIMESTAMP'
794816 RM='$RM'
795817 ofile='$ofile'], [])
796818 ])dnl /_LT_CONFIG_SAVE_COMMANDS
9871009
9881010 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
9891011 [lt_cv_apple_cc_single_mod=no
990 if test -z "${LT_MULTI_MODULE}"; then
1012 if test -z "$LT_MULTI_MODULE"; then
9911013 # By default we will add the -single_module flag. You can override
9921014 # by either setting the environment variable LT_MULTI_MODULE
9931015 # non-empty at configure time, or by adding -multi_module to the
10051027 cat conftest.err >&AS_MESSAGE_LOG_FD
10061028 # Otherwise, if the output was created with a 0 exit code from
10071029 # the compiler, it worked.
1008 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1030 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
10091031 lt_cv_apple_cc_single_mod=yes
10101032 else
10111033 cat conftest.err >&AS_MESSAGE_LOG_FD
10231045 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
10241046 [lt_cv_ld_exported_symbols_list=yes],
10251047 [lt_cv_ld_exported_symbols_list=no])
1026 LDFLAGS="$save_LDFLAGS"
1048 LDFLAGS=$save_LDFLAGS
10271049 ])
10281050
10291051 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10451067 _lt_result=$?
10461068 if test -s conftest.err && $GREP force_load conftest.err; then
10471069 cat conftest.err >&AS_MESSAGE_LOG_FD
1048 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1070 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
10491071 lt_cv_ld_force_load=yes
10501072 else
10511073 cat conftest.err >&AS_MESSAGE_LOG_FD
10551077 ])
10561078 case $host_os in
10571079 rhapsody* | darwin1.[[012]])
1058 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1080 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
10591081 darwin1.*)
1060 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1082 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10611083 darwin*) # darwin 5.x on
10621084 # if running on 10.5 or later, the deployment target defaults
10631085 # to the OS version, if on x86, and 10.4, the deployment
10641086 # target defaults to 10.4. Don't you love it?
10651087 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10661088 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1067 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1068 10.[[012]]*)
1069 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1089 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1090 10.[[012]][[,.]]*)
1091 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10701092 10.*)
1071 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1093 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10721094 esac
10731095 ;;
10741096 esac
1075 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1097 if test yes = "$lt_cv_apple_cc_single_mod"; then
10761098 _lt_dar_single_mod='$single_module'
10771099 fi
1078 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1079 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1100 if test yes = "$lt_cv_ld_exported_symbols_list"; then
1101 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
10801102 else
1081 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1103 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
10821104 fi
1083 if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1105 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
10841106 _lt_dsymutil='~$DSYMUTIL $lib || :'
10851107 else
10861108 _lt_dsymutil=
11001122 _LT_TAGVAR(hardcode_direct, $1)=no
11011123 _LT_TAGVAR(hardcode_automatic, $1)=yes
11021124 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1103 if test "$lt_cv_ld_force_load" = "yes"; then
1104 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1125 if test yes = "$lt_cv_ld_force_load"; then
1126 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
11051127 m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
11061128 [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11071129 else
11081130 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11091131 fi
11101132 _LT_TAGVAR(link_all_deplibs, $1)=yes
1111 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1133 _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
11121134 case $cc_basename in
1113 ifort*) _lt_dar_can_shared=yes ;;
1135 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
11141136 *) _lt_dar_can_shared=$GCC ;;
11151137 esac
1116 if test "$_lt_dar_can_shared" = "yes"; then
1138 if test yes = "$_lt_dar_can_shared"; then
11171139 output_verbose_link_cmd=func_echo_all
1118 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1119 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1120 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1121 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1140 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
1141 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1142 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
1143 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
11221144 m4_if([$1], [CXX],
1123 [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1124 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1125 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1145 [ if test yes != "$lt_cv_apple_cc_single_mod"; then
1146 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
1147 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
11261148 fi
11271149 ],[])
11281150 else
11421164 # Allow to override them for all tags through lt_cv_aix_libpath.
11431165 m4_defun([_LT_SYS_MODULE_PATH_AIX],
11441166 [m4_require([_LT_DECL_SED])dnl
1145 if test "${lt_cv_aix_libpath+set}" = set; then
1167 if test set = "${lt_cv_aix_libpath+set}"; then
11461168 aix_libpath=$lt_cv_aix_libpath
11471169 else
11481170 AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11601182 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11611183 fi],[])
11621184 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1163 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1185 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
11641186 fi
11651187 ])
11661188 aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
11801202 # -----------------------
11811203 # Find how we can fake an echo command that does not interpret backslash.
11821204 # In particular, with Autoconf 2.60 or later we add some code to the start
1183 # of the generated configure script which will find a shell with a builtin
1184 # printf (which we can use as an echo command).
1205 # of the generated configure script that will find a shell with a builtin
1206 # printf (that we can use as an echo command).
11851207 m4_defun([_LT_PROG_ECHO_BACKSLASH],
11861208 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
11871209 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12091231 # Invoke $ECHO with all args, space-separated.
12101232 func_echo_all ()
12111233 {
1212 $ECHO "$*"
1234 $ECHO "$*"
12131235 }
12141236
1215 case "$ECHO" in
1237 case $ECHO in
12161238 printf*) AC_MSG_RESULT([printf]) ;;
12171239 print*) AC_MSG_RESULT([print -r]) ;;
12181240 *) AC_MSG_RESULT([cat]) ;;
12381260 AC_DEFUN([_LT_WITH_SYSROOT],
12391261 [AC_MSG_CHECKING([for sysroot])
12401262 AC_ARG_WITH([sysroot],
1241 [ --with-sysroot[=DIR] Search for dependent libraries within DIR
1242 (or the compiler's sysroot if not specified).],
1263 [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1264 [Search for dependent libraries within DIR (or the compiler's sysroot
1265 if not specified).])],
12431266 [], [with_sysroot=no])
12441267
12451268 dnl lt_sysroot will always be passed unquoted. We quote it here
12461269 dnl in case the user passed a directory name.
12471270 lt_sysroot=
1248 case ${with_sysroot} in #(
1271 case $with_sysroot in #(
12491272 yes)
1250 if test "$GCC" = yes; then
1273 if test yes = "$GCC"; then
12511274 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12521275 fi
12531276 ;; #(
12571280 no|'')
12581281 ;; #(
12591282 *)
1260 AC_MSG_RESULT([${with_sysroot}])
1283 AC_MSG_RESULT([$with_sysroot])
12611284 AC_MSG_ERROR([The sysroot must be an absolute path.])
12621285 ;;
12631286 esac
12641287
12651288 AC_MSG_RESULT([${lt_sysroot:-no}])
12661289 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1267 [dependent libraries, and in which our libraries should be installed.])])
1290 [dependent libraries, and where our libraries should be installed.])])
12681291
12691292 # _LT_ENABLE_LOCK
12701293 # ---------------
12721295 [AC_ARG_ENABLE([libtool-lock],
12731296 [AS_HELP_STRING([--disable-libtool-lock],
12741297 [avoid locking (might break parallel builds)])])
1275 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1298 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
12761299
12771300 # Some flags need to be propagated to the compiler or linker for good
12781301 # libtool support.
12791302 case $host in
12801303 ia64-*-hpux*)
1281 # Find out which ABI we are using.
1304 # Find out what ABI is being produced by ac_compile, and set mode
1305 # options accordingly.
12821306 echo 'int i;' > conftest.$ac_ext
12831307 if AC_TRY_EVAL(ac_compile); then
12841308 case `/usr/bin/file conftest.$ac_objext` in
12851309 *ELF-32*)
1286 HPUX_IA64_MODE="32"
1310 HPUX_IA64_MODE=32
12871311 ;;
12881312 *ELF-64*)
1289 HPUX_IA64_MODE="64"
1313 HPUX_IA64_MODE=64
12901314 ;;
12911315 esac
12921316 fi
12931317 rm -rf conftest*
12941318 ;;
12951319 *-*-irix6*)
1296 # Find out which ABI we are using.
1320 # Find out what ABI is being produced by ac_compile, and set linker
1321 # options accordingly.
12971322 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
12981323 if AC_TRY_EVAL(ac_compile); then
1299 if test "$lt_cv_prog_gnu_ld" = yes; then
1324 if test yes = "$lt_cv_prog_gnu_ld"; then
13001325 case `/usr/bin/file conftest.$ac_objext` in
13011326 *32-bit*)
13021327 LD="${LD-ld} -melf32bsmip"
13251350 rm -rf conftest*
13261351 ;;
13271352
1328 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1353 mips64*-*linux*)
1354 # Find out what ABI is being produced by ac_compile, and set linker
1355 # options accordingly.
1356 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1357 if AC_TRY_EVAL(ac_compile); then
1358 emul=elf
1359 case `/usr/bin/file conftest.$ac_objext` in
1360 *32-bit*)
1361 emul="${emul}32"
1362 ;;
1363 *64-bit*)
1364 emul="${emul}64"
1365 ;;
1366 esac
1367 case `/usr/bin/file conftest.$ac_objext` in
1368 *MSB*)
1369 emul="${emul}btsmip"
1370 ;;
1371 *LSB*)
1372 emul="${emul}ltsmip"
1373 ;;
1374 esac
1375 case `/usr/bin/file conftest.$ac_objext` in
1376 *N32*)
1377 emul="${emul}n32"
1378 ;;
1379 esac
1380 LD="${LD-ld} -m $emul"
1381 fi
1382 rm -rf conftest*
1383 ;;
1384
1385 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
13291386 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1330 # Find out which ABI we are using.
1387 # Find out what ABI is being produced by ac_compile, and set linker
1388 # options accordingly. Note that the listed cases only cover the
1389 # situations where additional linker options are needed (such as when
1390 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1391 # vice versa); the common cases where no linker options are needed do
1392 # not appear in the list.
13311393 echo 'int i;' > conftest.$ac_ext
13321394 if AC_TRY_EVAL(ac_compile); then
13331395 case `/usr/bin/file conftest.o` in
13371399 LD="${LD-ld} -m elf_i386_fbsd"
13381400 ;;
13391401 x86_64-*linux*)
1340 LD="${LD-ld} -m elf_i386"
1402 case `/usr/bin/file conftest.o` in
1403 *x86-64*)
1404 LD="${LD-ld} -m elf32_x86_64"
1405 ;;
1406 *)
1407 LD="${LD-ld} -m elf_i386"
1408 ;;
1409 esac
13411410 ;;
1342 ppc64-*linux*|powerpc64-*linux*)
1411 powerpc64le-*linux*)
1412 LD="${LD-ld} -m elf32lppclinux"
1413 ;;
1414 powerpc64-*linux*)
13431415 LD="${LD-ld} -m elf32ppclinux"
13441416 ;;
13451417 s390x-*linux*)
13581430 x86_64-*linux*)
13591431 LD="${LD-ld} -m elf_x86_64"
13601432 ;;
1361 ppc*-*linux*|powerpc*-*linux*)
1433 powerpcle-*linux*)
1434 LD="${LD-ld} -m elf64lppc"
1435 ;;
1436 powerpc-*linux*)
13621437 LD="${LD-ld} -m elf64ppc"
13631438 ;;
13641439 s390*-*linux*|s390*-*tpf*)
13761451
13771452 *-*-sco3.2v5*)
13781453 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1379 SAVE_CFLAGS="$CFLAGS"
1454 SAVE_CFLAGS=$CFLAGS
13801455 CFLAGS="$CFLAGS -belf"
13811456 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13821457 [AC_LANG_PUSH(C)
13831458 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13841459 AC_LANG_POP])
1385 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1460 if test yes != "$lt_cv_cc_needs_belf"; then
13861461 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1387 CFLAGS="$SAVE_CFLAGS"
1462 CFLAGS=$SAVE_CFLAGS
13881463 fi
13891464 ;;
13901465 *-*solaris*)
1391 # Find out which ABI we are using.
1466 # Find out what ABI is being produced by ac_compile, and set linker
1467 # options accordingly.
13921468 echo 'int i;' > conftest.$ac_ext
13931469 if AC_TRY_EVAL(ac_compile); then
13941470 case `/usr/bin/file conftest.o` in
13961472 case $lt_cv_prog_gnu_ld in
13971473 yes*)
13981474 case $host in
1399 i?86-*-solaris*)
1475 i?86-*-solaris*|x86_64-*-solaris*)
14001476 LD="${LD-ld} -m elf_x86_64"
14011477 ;;
14021478 sparc*-*-solaris*)
14051481 esac
14061482 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
14071483 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1408 LD="${LD-ld}_sol2"
1484 LD=${LD-ld}_sol2
14091485 fi
14101486 ;;
14111487 *)
14211497 ;;
14221498 esac
14231499
1424 need_locks="$enable_libtool_lock"
1500 need_locks=$enable_libtool_lock
14251501 ])# _LT_ENABLE_LOCK
14261502
14271503
14401516 [echo conftest.$ac_objext > conftest.lst
14411517 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
14421518 AC_TRY_EVAL([lt_ar_try])
1443 if test "$ac_status" -eq 0; then
1519 if test 0 -eq "$ac_status"; then
14441520 # Ensure the archiver fails upon bogus file names.
14451521 rm -f conftest.$ac_objext libconftest.a
14461522 AC_TRY_EVAL([lt_ar_try])
1447 if test "$ac_status" -ne 0; then
1523 if test 0 -ne "$ac_status"; then
14481524 lt_cv_ar_at_file=@
14491525 fi
14501526 fi
14521528 ])
14531529 ])
14541530
1455 if test "x$lt_cv_ar_at_file" = xno; then
1531 if test no = "$lt_cv_ar_at_file"; then
14561532 archiver_list_spec=
14571533 else
14581534 archiver_list_spec=$lt_cv_ar_at_file
14831559
14841560 if test -n "$RANLIB"; then
14851561 case $host_os in
1486 openbsd*)
1562 bitrig* | openbsd*)
14871563 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
14881564 ;;
14891565 *)
15191595 [$2=no
15201596 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15211597 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1522 lt_compiler_flag="$3"
1598 lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
15231599 # Insert the option either (1) after the last *FLAGS variable, or
15241600 # (2) before a word containing "conftest.", or (3) at the end.
15251601 # Note that $ac_compile itself does not contain backslashes and begins
15461622 $RM conftest*
15471623 ])
15481624
1549 if test x"[$]$2" = xyes; then
1625 if test yes = "[$]$2"; then
15501626 m4_if([$5], , :, [$5])
15511627 else
15521628 m4_if([$6], , :, [$6])
15681644 m4_require([_LT_DECL_SED])dnl
15691645 AC_CACHE_CHECK([$1], [$2],
15701646 [$2=no
1571 save_LDFLAGS="$LDFLAGS"
1647 save_LDFLAGS=$LDFLAGS
15721648 LDFLAGS="$LDFLAGS $3"
15731649 echo "$lt_simple_link_test_code" > conftest.$ac_ext
15741650 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
15871663 fi
15881664 fi
15891665 $RM -r conftest*
1590 LDFLAGS="$save_LDFLAGS"
1666 LDFLAGS=$save_LDFLAGS
15911667 ])
15921668
1593 if test x"[$]$2" = xyes; then
1669 if test yes = "[$]$2"; then
15941670 m4_if([$4], , :, [$4])
15951671 else
15961672 m4_if([$5], , :, [$5])
16111687 AC_MSG_CHECKING([the maximum length of command line arguments])
16121688 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16131689 i=0
1614 teststring="ABCD"
1690 teststring=ABCD
16151691
16161692 case $build_os in
16171693 msdosdjgpp*)
16511727 lt_cv_sys_max_cmd_len=8192;
16521728 ;;
16531729
1654 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1730 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
16551731 # This has been around since 386BSD, at least. Likely further.
16561732 if test -x /sbin/sysctl; then
16571733 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
17011777 ;;
17021778 *)
17031779 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1704 if test -n "$lt_cv_sys_max_cmd_len"; then
1780 if test -n "$lt_cv_sys_max_cmd_len" && \
1781 test undefined != "$lt_cv_sys_max_cmd_len"; then
17051782 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17061783 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17071784 else
17081785 # Make teststring a little bigger before we do anything with it.
17091786 # a 1K string should be a reasonable start.
1710 for i in 1 2 3 4 5 6 7 8 ; do
1787 for i in 1 2 3 4 5 6 7 8; do
17111788 teststring=$teststring$teststring
17121789 done
17131790 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17141791 # If test is not a shell built-in, we'll probably end up computing a
17151792 # maximum length that is only half of the actual maximum length, but
17161793 # we can't tell.
1717 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1794 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
17181795 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1719 test $i != 17 # 1/2 MB should be enough
1796 test 17 != "$i" # 1/2 MB should be enough
17201797 do
17211798 i=`expr $i + 1`
17221799 teststring=$teststring$teststring
17321809 ;;
17331810 esac
17341811 ])
1735 if test -n $lt_cv_sys_max_cmd_len ; then
1812 if test -n "$lt_cv_sys_max_cmd_len"; then
17361813 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
17371814 else
17381815 AC_MSG_RESULT(none)
17601837 # ----------------------------------------------------------------
17611838 m4_defun([_LT_TRY_DLOPEN_SELF],
17621839 [m4_require([_LT_HEADER_DLFCN])dnl
1763 if test "$cross_compiling" = yes; then :
1840 if test yes = "$cross_compiling"; then :
17641841 [$4]
17651842 else
17661843 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
18071884 # endif
18081885 #endif
18091886
1810 /* When -fvisbility=hidden is used, assume the code has been annotated
1887 /* When -fvisibility=hidden is used, assume the code has been annotated
18111888 correspondingly for the symbols needed. */
1812 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1889 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18131890 int fnord () __attribute__((visibility("default")));
18141891 #endif
18151892
18351912 return status;
18361913 }]
18371914 _LT_EOF
1838 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1915 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
18391916 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
18401917 lt_status=$?
18411918 case x$lt_status in
18561933 # ------------------
18571934 AC_DEFUN([LT_SYS_DLOPEN_SELF],
18581935 [m4_require([_LT_HEADER_DLFCN])dnl
1859 if test "x$enable_dlopen" != xyes; then
1936 if test yes != "$enable_dlopen"; then
18601937 enable_dlopen=unknown
18611938 enable_dlopen_self=unknown
18621939 enable_dlopen_self_static=unknown
18661943
18671944 case $host_os in
18681945 beos*)
1869 lt_cv_dlopen="load_add_on"
1946 lt_cv_dlopen=load_add_on
18701947 lt_cv_dlopen_libs=
18711948 lt_cv_dlopen_self=yes
18721949 ;;
18731950
18741951 mingw* | pw32* | cegcc*)
1875 lt_cv_dlopen="LoadLibrary"
1952 lt_cv_dlopen=LoadLibrary
18761953 lt_cv_dlopen_libs=
18771954 ;;
18781955
18791956 cygwin*)
1880 lt_cv_dlopen="dlopen"
1957 lt_cv_dlopen=dlopen
18811958 lt_cv_dlopen_libs=
18821959 ;;
18831960
18841961 darwin*)
1885 # if libdl is installed we need to link against it
1962 # if libdl is installed we need to link against it
18861963 AC_CHECK_LIB([dl], [dlopen],
1887 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1888 lt_cv_dlopen="dyld"
1964 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1965 lt_cv_dlopen=dyld
18891966 lt_cv_dlopen_libs=
18901967 lt_cv_dlopen_self=yes
18911968 ])
18921969 ;;
18931970
1971 tpf*)
1972 # Don't try to run any link tests for TPF. We know it's impossible
1973 # because TPF is a cross-compiler, and we know how we open DSOs.
1974 lt_cv_dlopen=dlopen
1975 lt_cv_dlopen_libs=
1976 lt_cv_dlopen_self=no
1977 ;;
1978
18941979 *)
18951980 AC_CHECK_FUNC([shl_load],
1896 [lt_cv_dlopen="shl_load"],
1981 [lt_cv_dlopen=shl_load],
18971982 [AC_CHECK_LIB([dld], [shl_load],
1898 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1983 [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
18991984 [AC_CHECK_FUNC([dlopen],
1900 [lt_cv_dlopen="dlopen"],
1985 [lt_cv_dlopen=dlopen],
19011986 [AC_CHECK_LIB([dl], [dlopen],
1902 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1987 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
19031988 [AC_CHECK_LIB([svld], [dlopen],
1904 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1989 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
19051990 [AC_CHECK_LIB([dld], [dld_link],
1906 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1991 [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
19071992 ])
19081993 ])
19091994 ])
19121997 ;;
19131998 esac
19141999
1915 if test "x$lt_cv_dlopen" != xno; then
2000 if test no = "$lt_cv_dlopen"; then
2001 enable_dlopen=no
2002 else
19162003 enable_dlopen=yes
1917 else
1918 enable_dlopen=no
19192004 fi
19202005
19212006 case $lt_cv_dlopen in
19222007 dlopen)
1923 save_CPPFLAGS="$CPPFLAGS"
1924 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1925
1926 save_LDFLAGS="$LDFLAGS"
2008 save_CPPFLAGS=$CPPFLAGS
2009 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2010
2011 save_LDFLAGS=$LDFLAGS
19272012 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
19282013
1929 save_LIBS="$LIBS"
2014 save_LIBS=$LIBS
19302015 LIBS="$lt_cv_dlopen_libs $LIBS"
19312016
19322017 AC_CACHE_CHECK([whether a program can dlopen itself],
19362021 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
19372022 ])
19382023
1939 if test "x$lt_cv_dlopen_self" = xyes; then
2024 if test yes = "$lt_cv_dlopen_self"; then
19402025 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
19412026 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
19422027 lt_cv_dlopen_self_static, [dnl
19462031 ])
19472032 fi
19482033
1949 CPPFLAGS="$save_CPPFLAGS"
1950 LDFLAGS="$save_LDFLAGS"
1951 LIBS="$save_LIBS"
2034 CPPFLAGS=$save_CPPFLAGS
2035 LDFLAGS=$save_LDFLAGS
2036 LIBS=$save_LIBS
19522037 ;;
19532038 esac
19542039
20402125 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
20412126 _LT_COMPILER_C_O([$1])
20422127
2043 hard_links="nottested"
2044 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2128 hard_links=nottested
2129 if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
20452130 # do not overwrite the value of need_locks provided by the user
20462131 AC_MSG_CHECKING([if we can lock with hard links])
20472132 hard_links=yes
20512136 ln conftest.a conftest.b 2>&5 || hard_links=no
20522137 ln conftest.a conftest.b 2>/dev/null && hard_links=no
20532138 AC_MSG_RESULT([$hard_links])
2054 if test "$hard_links" = no; then
2055 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2139 if test no = "$hard_links"; then
2140 AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
20562141 need_locks=warn
20572142 fi
20582143 else
20792164 _LT_DECL([], [objdir], [0],
20802165 [The name of the directory that contains temporary libtool files])dnl
20812166 m4_pattern_allow([LT_OBJDIR])dnl
2082 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2083 [Define to the sub-directory in which libtool stores uninstalled libraries.])
2167 AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2168 [Define to the sub-directory where libtool stores uninstalled libraries.])
20842169 ])# _LT_CHECK_OBJDIR
20852170
20862171
20922177 _LT_TAGVAR(hardcode_action, $1)=
20932178 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
20942179 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2095 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2180 test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
20962181
20972182 # We can hardcode non-existent directories.
2098 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2183 if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
20992184 # If the only mechanism to avoid hardcoding is shlibpath_var, we
21002185 # have to relink, otherwise we might link with an installed library
21012186 # when we should be linking with a yet-to-be-installed one
2102 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2103 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2187 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2188 test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
21042189 # Linking always hardcodes the temporary library directory.
21052190 _LT_TAGVAR(hardcode_action, $1)=relink
21062191 else
21142199 fi
21152200 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
21162201
2117 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2118 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2202 if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2203 test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
21192204 # Fast installation is not supported
21202205 enable_fast_install=no
2121 elif test "$shlibpath_overrides_runpath" = yes ||
2122 test "$enable_shared" = no; then
2206 elif test yes = "$shlibpath_overrides_runpath" ||
2207 test no = "$enable_shared"; then
21232208 # Fast installation is not necessary
21242209 enable_fast_install=needless
21252210 fi
21432228 # FIXME - insert some real tests, host_os isn't really good enough
21442229 case $host_os in
21452230 darwin*)
2146 if test -n "$STRIP" ; then
2231 if test -n "$STRIP"; then
21472232 striplib="$STRIP -x"
21482233 old_striplib="$STRIP -S"
21492234 AC_MSG_RESULT([yes])
21612246 ])# _LT_CMD_STRIPLIB
21622247
21632248
2249 # _LT_PREPARE_MUNGE_PATH_LIST
2250 # ---------------------------
2251 # Make sure func_munge_path_list() is defined correctly.
2252 m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2253 [[# func_munge_path_list VARIABLE PATH
2254 # -----------------------------------
2255 # VARIABLE is name of variable containing _space_ separated list of
2256 # directories to be munged by the contents of PATH, which is string
2257 # having a format:
2258 # "DIR[:DIR]:"
2259 # string "DIR[ DIR]" will be prepended to VARIABLE
2260 # ":DIR[:DIR]"
2261 # string "DIR[ DIR]" will be appended to VARIABLE
2262 # "DIRP[:DIRP]::[DIRA:]DIRA"
2263 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2264 # "DIRA[ DIRA]" will be appended to VARIABLE
2265 # "DIR[:DIR]"
2266 # VARIABLE will be replaced by "DIR[ DIR]"
2267 func_munge_path_list ()
2268 {
2269 case x@S|@2 in
2270 x)
2271 ;;
2272 *:)
2273 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2274 ;;
2275 x:*)
2276 eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2277 ;;
2278 *::*)
2279 eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2280 eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2281 ;;
2282 *)
2283 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2284 ;;
2285 esac
2286 }
2287 ]])# _LT_PREPARE_PATH_LIST
2288
2289
21642290 # _LT_SYS_DYNAMIC_LINKER([TAG])
21652291 # -----------------------------
21662292 # PORTME Fill in your ld.so characteristics
21712297 m4_require([_LT_DECL_OBJDUMP])dnl
21722298 m4_require([_LT_DECL_SED])dnl
21732299 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2300 m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
21742301 AC_MSG_CHECKING([dynamic linker characteristics])
21752302 m4_if([$1],
21762303 [], [
2177 if test "$GCC" = yes; then
2304 if test yes = "$GCC"; then
21782305 case $host_os in
2179 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2180 *) lt_awk_arg="/^libraries:/" ;;
2306 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2307 *) lt_awk_arg='/^libraries:/' ;;
21812308 esac
21822309 case $host_os in
2183 mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2184 *) lt_sed_strip_eq="s,=/,/,g" ;;
2310 mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2311 *) lt_sed_strip_eq='s|=/|/|g' ;;
21852312 esac
21862313 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
21872314 case $lt_search_path_spec in
21972324 ;;
21982325 esac
21992326 # Ok, now we have the path, separated by spaces, we can step through it
2200 # and add multilib dir if necessary.
2327 # and add multilib dir if necessary...
22012328 lt_tmp_lt_search_path_spec=
2202 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2329 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2330 # ...but if some path component already ends with the multilib dir we assume
2331 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2332 case "$lt_multi_os_dir; $lt_search_path_spec " in
2333 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2334 lt_multi_os_dir=
2335 ;;
2336 esac
22032337 for lt_sys_path in $lt_search_path_spec; do
2204 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2205 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2206 else
2338 if test -d "$lt_sys_path$lt_multi_os_dir"; then
2339 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2340 elif test -n "$lt_multi_os_dir"; then
22072341 test -d "$lt_sys_path" && \
22082342 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
22092343 fi
22102344 done
22112345 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2212 BEGIN {RS=" "; FS="/|\n";} {
2213 lt_foo="";
2214 lt_count=0;
2346 BEGIN {RS = " "; FS = "/|\n";} {
2347 lt_foo = "";
2348 lt_count = 0;
22152349 for (lt_i = NF; lt_i > 0; lt_i--) {
22162350 if ($lt_i != "" && $lt_i != ".") {
22172351 if ($lt_i == "..") {
22182352 lt_count++;
22192353 } else {
22202354 if (lt_count == 0) {
2221 lt_foo="/" $lt_i lt_foo;
2355 lt_foo = "/" $lt_i lt_foo;
22222356 } else {
22232357 lt_count--;
22242358 }
22322366 # for these hosts.
22332367 case $host_os in
22342368 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2235 $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2369 $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
22362370 esac
22372371 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
22382372 else
22412375 library_names_spec=
22422376 libname_spec='lib$name'
22432377 soname_spec=
2244 shrext_cmds=".so"
2378 shrext_cmds=.so
22452379 postinstall_cmds=
22462380 postuninstall_cmds=
22472381 finish_cmds=
22582392 # flags to be left without arguments
22592393 need_version=unknown
22602394
2395 AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2396 [User-defined run-time library search path.])
2397
22612398 case $host_os in
22622399 aix3*)
22632400 version_type=linux # correct to gnu/linux during the next big refactor
2264 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2401 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
22652402 shlibpath_var=LIBPATH
22662403
22672404 # AIX 3 has no versioning support, so we append a major version to the name.
2268 soname_spec='${libname}${release}${shared_ext}$major'
2405 soname_spec='$libname$release$shared_ext$major'
22692406 ;;
22702407
22712408 aix[[4-9]]*)
22732410 need_lib_prefix=no
22742411 need_version=no
22752412 hardcode_into_libs=yes
2276 if test "$host_cpu" = ia64; then
2413 if test ia64 = "$host_cpu"; then
22772414 # AIX 5 supports IA64
2278 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2415 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
22792416 shlibpath_var=LD_LIBRARY_PATH
22802417 else
22812418 # With GCC up to 2.95.x, collect2 would create an import file
22822419 # for dependence libraries. The import file would start with
2283 # the line `#! .'. This would cause the generated library to
2284 # depend on `.', always an invalid library. This was fixed in
2420 # the line '#! .'. This would cause the generated library to
2421 # depend on '.', always an invalid library. This was fixed in
22852422 # development snapshots of GCC prior to 3.0.
22862423 case $host_os in
22872424 aix4 | aix4.[[01]] | aix4.[[01]].*)
22882425 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
22892426 echo ' yes '
2290 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2427 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
22912428 :
22922429 else
22932430 can_build_shared=no
22942431 fi
22952432 ;;
22962433 esac
2297 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2434 # Using Import Files as archive members, it is possible to support
2435 # filename-based versioning of shared library archives on AIX. While
2436 # this would work for both with and without runtime linking, it will
2437 # prevent static linking of such archives. So we do filename-based
2438 # shared library versioning with .so extension only, which is used
2439 # when both runtime linking and shared linking is enabled.
2440 # Unfortunately, runtime linking may impact performance, so we do
2441 # not want this to be the default eventually. Also, we use the
2442 # versioned .so libs for executables only if there is the -brtl
2443 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2444 # To allow for filename-based versioning support, we need to create
2445 # libNAME.so.V as an archive file, containing:
2446 # *) an Import File, referring to the versioned filename of the
2447 # archive as well as the shared archive member, telling the
2448 # bitwidth (32 or 64) of that shared object, and providing the
2449 # list of exported symbols of that shared object, eventually
2450 # decorated with the 'weak' keyword
2451 # *) the shared object with the F_LOADONLY flag set, to really avoid
2452 # it being seen by the linker.
2453 # At run time we better use the real file rather than another symlink,
2454 # but for link time we create the symlink libNAME.so -> libNAME.so.V
2455
2456 case $with_aix_soname,$aix_use_runtimelinking in
2457 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
22982458 # soname into executable. Probably we can add versioning support to
22992459 # collect2, so additional links can be useful in future.
2300 if test "$aix_use_runtimelinking" = yes; then
2460 aix,yes) # traditional libtool
2461 dynamic_linker='AIX unversionable lib.so'
23012462 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
23022463 # instead of lib<name>.a to let people know that these are not
23032464 # typical AIX shared libraries.
2304 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2305 else
2465 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2466 ;;
2467 aix,no) # traditional AIX only
2468 dynamic_linker='AIX lib.a[(]lib.so.V[)]'
23062469 # We preserve .a as extension for shared libraries through AIX4.2
23072470 # and later when we are not doing run time linking.
2308 library_names_spec='${libname}${release}.a $libname.a'
2309 soname_spec='${libname}${release}${shared_ext}$major'
2310 fi
2471 library_names_spec='$libname$release.a $libname.a'
2472 soname_spec='$libname$release$shared_ext$major'
2473 ;;
2474 svr4,*) # full svr4 only
2475 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2476 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2477 # We do not specify a path in Import Files, so LIBPATH fires.
2478 shlibpath_overrides_runpath=yes
2479 ;;
2480 *,yes) # both, prefer svr4
2481 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2482 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2483 # unpreferred sharedlib libNAME.a needs extra handling
2484 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2485 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2486 # We do not specify a path in Import Files, so LIBPATH fires.
2487 shlibpath_overrides_runpath=yes
2488 ;;
2489 *,no) # both, prefer aix
2490 dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2491 library_names_spec='$libname$release.a $libname.a'
2492 soname_spec='$libname$release$shared_ext$major'
2493 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2494 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2495 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2496 ;;
2497 esac
23112498 shlibpath_var=LIBPATH
23122499 fi
23132500 ;;
23172504 powerpc)
23182505 # Since July 2007 AmigaOS4 officially supports .so libraries.
23192506 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2320 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2507 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
23212508 ;;
23222509 m68k)
23232510 library_names_spec='$libname.ixlibrary $libname.a'
23242511 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2325 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2512 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
23262513 ;;
23272514 esac
23282515 ;;
23292516
23302517 beos*)
2331 library_names_spec='${libname}${shared_ext}'
2518 library_names_spec='$libname$shared_ext'
23322519 dynamic_linker="$host_os ld.so"
23332520 shlibpath_var=LIBRARY_PATH
23342521 ;;
23362523 bsdi[[45]]*)
23372524 version_type=linux # correct to gnu/linux during the next big refactor
23382525 need_version=no
2339 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2340 soname_spec='${libname}${release}${shared_ext}$major'
2526 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2527 soname_spec='$libname$release$shared_ext$major'
23412528 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
23422529 shlibpath_var=LD_LIBRARY_PATH
23432530 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
23492536
23502537 cygwin* | mingw* | pw32* | cegcc*)
23512538 version_type=windows
2352 shrext_cmds=".dll"
2539 shrext_cmds=.dll
23532540 need_version=no
23542541 need_lib_prefix=no
23552542
23582545 # gcc
23592546 library_names_spec='$libname.dll.a'
23602547 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2361 postinstall_cmds='base_file=`basename \${file}`~
2362 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2548 postinstall_cmds='base_file=`basename \$file`~
2549 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
23632550 dldir=$destdir/`dirname \$dlpath`~
23642551 test -d \$dldir || mkdir -p \$dldir~
23652552 $install_prog $dir/$dlname \$dldir/$dlname~
23752562 case $host_os in
23762563 cygwin*)
23772564 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2378 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2565 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
23792566 m4_if([$1], [],[
23802567 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
23812568 ;;
23822569 mingw* | cegcc*)
23832570 # MinGW DLLs use traditional 'lib' prefix
2384 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2571 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
23852572 ;;
23862573 pw32*)
23872574 # pw32 DLLs use 'pw' prefix rather than 'lib'
2388 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2575 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
23892576 ;;
23902577 esac
23912578 dynamic_linker='Win32 ld.exe'
23942581 *,cl*)
23952582 # Native MSVC
23962583 libname_spec='$name'
2397 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2398 library_names_spec='${libname}.dll.lib'
2584 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2585 library_names_spec='$libname.dll.lib'
23992586
24002587 case $build_os in
24012588 mingw*)
24222609 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24232610 ;;
24242611 *)
2425 sys_lib_search_path_spec="$LIB"
2612 sys_lib_search_path_spec=$LIB
24262613 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
24272614 # It is most probably a Windows format PATH.
24282615 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
24352622 esac
24362623
24372624 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2438 postinstall_cmds='base_file=`basename \${file}`~
2439 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2625 postinstall_cmds='base_file=`basename \$file`~
2626 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
24402627 dldir=$destdir/`dirname \$dlpath`~
24412628 test -d \$dldir || mkdir -p \$dldir~
24422629 $install_prog $dir/$dlname \$dldir/$dlname'
24492636
24502637 *)
24512638 # Assume MSVC wrapper
2452 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2639 library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
24532640 dynamic_linker='Win32 ld.exe'
24542641 ;;
24552642 esac
24622649 version_type=darwin
24632650 need_lib_prefix=no
24642651 need_version=no
2465 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2466 soname_spec='${libname}${release}${major}$shared_ext'
2652 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2653 soname_spec='$libname$release$major$shared_ext'
24672654 shlibpath_overrides_runpath=yes
24682655 shlibpath_var=DYLD_LIBRARY_PATH
24692656 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
24762663 version_type=linux # correct to gnu/linux during the next big refactor
24772664 need_lib_prefix=no
24782665 need_version=no
2479 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2480 soname_spec='${libname}${release}${shared_ext}$major'
2666 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2667 soname_spec='$libname$release$shared_ext$major'
24812668 shlibpath_var=LD_LIBRARY_PATH
24822669 ;;
24832670
24952682 version_type=freebsd-$objformat
24962683 case $version_type in
24972684 freebsd-elf*)
2498 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2685 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2686 soname_spec='$libname$release$shared_ext$major'
24992687 need_version=no
25002688 need_lib_prefix=no
25012689 ;;
25022690 freebsd-*)
2503 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2691 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
25042692 need_version=yes
25052693 ;;
25062694 esac
25252713 esac
25262714 ;;
25272715
2528 gnu*)
2529 version_type=linux # correct to gnu/linux during the next big refactor
2530 need_lib_prefix=no
2531 need_version=no
2532 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2533 soname_spec='${libname}${release}${shared_ext}$major'
2534 shlibpath_var=LD_LIBRARY_PATH
2535 shlibpath_overrides_runpath=no
2536 hardcode_into_libs=yes
2537 ;;
2538
25392716 haiku*)
25402717 version_type=linux # correct to gnu/linux during the next big refactor
25412718 need_lib_prefix=no
25422719 need_version=no
25432720 dynamic_linker="$host_os runtime_loader"
2544 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2545 soname_spec='${libname}${release}${shared_ext}$major'
2721 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2722 soname_spec='$libname$release$shared_ext$major'
25462723 shlibpath_var=LIBRARY_PATH
2547 shlibpath_overrides_runpath=yes
2724 shlibpath_overrides_runpath=no
25482725 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
25492726 hardcode_into_libs=yes
25502727 ;;
25622739 dynamic_linker="$host_os dld.so"
25632740 shlibpath_var=LD_LIBRARY_PATH
25642741 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2565 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2566 soname_spec='${libname}${release}${shared_ext}$major'
2567 if test "X$HPUX_IA64_MODE" = X32; then
2742 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2743 soname_spec='$libname$release$shared_ext$major'
2744 if test 32 = "$HPUX_IA64_MODE"; then
25682745 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2746 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
25692747 else
25702748 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2749 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
25712750 fi
2572 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25732751 ;;
25742752 hppa*64*)
25752753 shrext_cmds='.sl'
25772755 dynamic_linker="$host_os dld.sl"
25782756 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
25792757 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2580 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2581 soname_spec='${libname}${release}${shared_ext}$major'
2758 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2759 soname_spec='$libname$release$shared_ext$major'
25822760 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
25832761 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25842762 ;;
25872765 dynamic_linker="$host_os dld.sl"
25882766 shlibpath_var=SHLIB_PATH
25892767 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2590 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2591 soname_spec='${libname}${release}${shared_ext}$major'
2768 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2769 soname_spec='$libname$release$shared_ext$major'
25922770 ;;
25932771 esac
25942772 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
26012779 version_type=linux # correct to gnu/linux during the next big refactor
26022780 need_lib_prefix=no
26032781 need_version=no
2604 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2605 soname_spec='${libname}${release}${shared_ext}$major'
2782 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2783 soname_spec='$libname$release$shared_ext$major'
26062784 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
26072785 shlibpath_var=LD_LIBRARY_PATH
26082786 shlibpath_overrides_runpath=no
26132791 case $host_os in
26142792 nonstopux*) version_type=nonstopux ;;
26152793 *)
2616 if test "$lt_cv_prog_gnu_ld" = yes; then
2794 if test yes = "$lt_cv_prog_gnu_ld"; then
26172795 version_type=linux # correct to gnu/linux during the next big refactor
26182796 else
26192797 version_type=irix
26212799 esac
26222800 need_lib_prefix=no
26232801 need_version=no
2624 soname_spec='${libname}${release}${shared_ext}$major'
2625 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2802 soname_spec='$libname$release$shared_ext$major'
2803 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
26262804 case $host_os in
26272805 irix5* | nonstopux*)
26282806 libsuff= shlibsuff=
26412819 esac
26422820 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
26432821 shlibpath_overrides_runpath=no
2644 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2645 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2822 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2823 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
26462824 hardcode_into_libs=yes
26472825 ;;
26482826
26512829 dynamic_linker=no
26522830 ;;
26532831
2832 linux*android*)
2833 version_type=none # Android doesn't support versioned libraries.
2834 need_lib_prefix=no
2835 need_version=no
2836 library_names_spec='$libname$release$shared_ext'
2837 soname_spec='$libname$release$shared_ext'
2838 finish_cmds=
2839 shlibpath_var=LD_LIBRARY_PATH
2840 shlibpath_overrides_runpath=yes
2841
2842 # This implies no fast_install, which is unacceptable.
2843 # Some rework will be needed to allow for fast_install
2844 # before this can be enabled.
2845 hardcode_into_libs=yes
2846
2847 dynamic_linker='Android linker'
2848 # Don't embed -rpath directories since the linker doesn't support them.
2849 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2850 ;;
2851
26542852 # This must be glibc/ELF.
2655 linux* | k*bsd*-gnu | kopensolaris*-gnu)
2853 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
26562854 version_type=linux # correct to gnu/linux during the next big refactor
26572855 need_lib_prefix=no
26582856 need_version=no
2659 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2660 soname_spec='${libname}${release}${shared_ext}$major'
2857 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2858 soname_spec='$libname$release$shared_ext$major'
26612859 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
26622860 shlibpath_var=LD_LIBRARY_PATH
26632861 shlibpath_overrides_runpath=no
26822880 # before this can be enabled.
26832881 hardcode_into_libs=yes
26842882
2685 # Append ld.so.conf contents to the search path
2883 # Ideally, we could use ldconfig to report *all* directores which are
2884 # searched for libraries, however this is still not possible. Aside from not
2885 # being certain /sbin/ldconfig is available, command
2886 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2887 # even though it is searched at run-time. Try to do the best guess by
2888 # appending ld.so.conf contents (and includes) to the search path.
26862889 if test -f /etc/ld.so.conf; then
26872890 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
26882891 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
27022905 need_lib_prefix=no
27032906 need_version=no
27042907 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2705 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2908 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
27062909 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27072910 dynamic_linker='NetBSD (a.out) ld.so'
27082911 else
2709 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2710 soname_spec='${libname}${release}${shared_ext}$major'
2912 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2913 soname_spec='$libname$release$shared_ext$major'
27112914 dynamic_linker='NetBSD ld.elf_so'
27122915 fi
27132916 shlibpath_var=LD_LIBRARY_PATH
27172920
27182921 newsos6)
27192922 version_type=linux # correct to gnu/linux during the next big refactor
2720 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2923 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27212924 shlibpath_var=LD_LIBRARY_PATH
27222925 shlibpath_overrides_runpath=yes
27232926 ;;
27262929 version_type=qnx
27272930 need_lib_prefix=no
27282931 need_version=no
2729 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2730 soname_spec='${libname}${release}${shared_ext}$major'
2932 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2933 soname_spec='$libname$release$shared_ext$major'
27312934 shlibpath_var=LD_LIBRARY_PATH
27322935 shlibpath_overrides_runpath=no
27332936 hardcode_into_libs=yes
27342937 dynamic_linker='ldqnx.so'
27352938 ;;
27362939
2737 openbsd*)
2940 openbsd* | bitrig*)
27382941 version_type=sunos
2739 sys_lib_dlsearch_path_spec="/usr/lib"
2942 sys_lib_dlsearch_path_spec=/usr/lib
27402943 need_lib_prefix=no
2741 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2742 case $host_os in
2743 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2744 *) need_version=no ;;
2745 esac
2746 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2944 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2945 need_version=no
2946 else
2947 need_version=yes
2948 fi
2949 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
27472950 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27482951 shlibpath_var=LD_LIBRARY_PATH
2749 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2750 case $host_os in
2751 openbsd2.[[89]] | openbsd2.[[89]].*)
2752 shlibpath_overrides_runpath=no
2753 ;;
2754 *)
2755 shlibpath_overrides_runpath=yes
2756 ;;
2757 esac
2758 else
2759 shlibpath_overrides_runpath=yes
2760 fi
2952 shlibpath_overrides_runpath=yes
27612953 ;;
27622954
27632955 os2*)
27642956 libname_spec='$name'
2765 shrext_cmds=".dll"
2957 version_type=windows
2958 shrext_cmds=.dll
2959 need_version=no
27662960 need_lib_prefix=no
2767 library_names_spec='$libname${shared_ext} $libname.a'
2961 # OS/2 can only load a DLL with a base name of 8 characters or less.
2962 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2963 v=$($ECHO $release$versuffix | tr -d .-);
2964 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2965 $ECHO $n$v`$shared_ext'
2966 library_names_spec='${libname}_dll.$libext'
27682967 dynamic_linker='OS/2 ld.exe'
2769 shlibpath_var=LIBPATH
2968 shlibpath_var=BEGINLIBPATH
2969 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2970 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2971 postinstall_cmds='base_file=`basename \$file`~
2972 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2973 dldir=$destdir/`dirname \$dlpath`~
2974 test -d \$dldir || mkdir -p \$dldir~
2975 $install_prog $dir/$dlname \$dldir/$dlname~
2976 chmod a+x \$dldir/$dlname~
2977 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2978 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2979 fi'
2980 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2981 dlpath=$dir/\$dldll~
2982 $RM \$dlpath'
27702983 ;;
27712984
27722985 osf3* | osf4* | osf5*)
27732986 version_type=osf
27742987 need_lib_prefix=no
27752988 need_version=no
2776 soname_spec='${libname}${release}${shared_ext}$major'
2777 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2989 soname_spec='$libname$release$shared_ext$major'
2990 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27782991 shlibpath_var=LD_LIBRARY_PATH
27792992 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2780 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2993 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
27812994 ;;
27822995
27832996 rdos*)
27883001 version_type=linux # correct to gnu/linux during the next big refactor
27893002 need_lib_prefix=no
27903003 need_version=no
2791 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2792 soname_spec='${libname}${release}${shared_ext}$major'
3004 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3005 soname_spec='$libname$release$shared_ext$major'
27933006 shlibpath_var=LD_LIBRARY_PATH
27943007 shlibpath_overrides_runpath=yes
27953008 hardcode_into_libs=yes
27993012
28003013 sunos4*)
28013014 version_type=sunos
2802 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3015 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
28033016 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
28043017 shlibpath_var=LD_LIBRARY_PATH
28053018 shlibpath_overrides_runpath=yes
2806 if test "$with_gnu_ld" = yes; then
3019 if test yes = "$with_gnu_ld"; then
28073020 need_lib_prefix=no
28083021 fi
28093022 need_version=yes
28113024
28123025 sysv4 | sysv4.3*)
28133026 version_type=linux # correct to gnu/linux during the next big refactor
2814 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2815 soname_spec='${libname}${release}${shared_ext}$major'
3027 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3028 soname_spec='$libname$release$shared_ext$major'
28163029 shlibpath_var=LD_LIBRARY_PATH
28173030 case $host_vendor in
28183031 sni)
28333046 ;;
28343047
28353048 sysv4*MP*)
2836 if test -d /usr/nec ;then
3049 if test -d /usr/nec; then
28373050 version_type=linux # correct to gnu/linux during the next big refactor
2838 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2839 soname_spec='$libname${shared_ext}.$major'
3051 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3052 soname_spec='$libname$shared_ext.$major'
28403053 shlibpath_var=LD_LIBRARY_PATH
28413054 fi
28423055 ;;
28433056
28443057 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2845 version_type=freebsd-elf
3058 version_type=sco
28463059 need_lib_prefix=no
28473060 need_version=no
2848 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2849 soname_spec='${libname}${release}${shared_ext}$major'
3061 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3062 soname_spec='$libname$release$shared_ext$major'
28503063 shlibpath_var=LD_LIBRARY_PATH
28513064 shlibpath_overrides_runpath=yes
28523065 hardcode_into_libs=yes
2853 if test "$with_gnu_ld" = yes; then
3066 if test yes = "$with_gnu_ld"; then
28543067 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
28553068 else
28563069 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
28683081 version_type=linux # correct to gnu/linux during the next big refactor
28693082 need_lib_prefix=no
28703083 need_version=no
2871 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3084 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
28723085 shlibpath_var=LD_LIBRARY_PATH
28733086 shlibpath_overrides_runpath=no
28743087 hardcode_into_libs=yes
28763089
28773090 uts4*)
28783091 version_type=linux # correct to gnu/linux during the next big refactor
2879 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2880 soname_spec='${libname}${release}${shared_ext}$major'
3092 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3093 soname_spec='$libname$release$shared_ext$major'
28813094 shlibpath_var=LD_LIBRARY_PATH
28823095 ;;
28833096
28863099 ;;
28873100 esac
28883101 AC_MSG_RESULT([$dynamic_linker])
2889 test "$dynamic_linker" = no && can_build_shared=no
3102 test no = "$dynamic_linker" && can_build_shared=no
28903103
28913104 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2892 if test "$GCC" = yes; then
3105 if test yes = "$GCC"; then
28933106 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
28943107 fi
28953108
2896 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2897 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3109 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3110 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
28983111 fi
2899 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2900 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3112
3113 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3114 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
29013115 fi
3116
3117 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3118 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3119
3120 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3121 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3122
3123 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3124 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
29023125
29033126 _LT_DECL([], [variables_saved_for_relink], [1],
29043127 [Variables whose values should be saved in libtool wrapper scripts and
29323155 [Whether we should hardcode library paths into libraries])
29333156 _LT_DECL([], [sys_lib_search_path_spec], [2],
29343157 [Compile-time system search path for libraries])
2935 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2936 [Run-time system search path for libraries])
3158 _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3159 [Detected run-time system search path for libraries])
3160 _LT_DECL([], [configure_time_lt_sys_library_path], [2],
3161 [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
29373162 ])# _LT_SYS_DYNAMIC_LINKER
29383163
29393164
29403165 # _LT_PATH_TOOL_PREFIX(TOOL)
29413166 # --------------------------
2942 # find a file program which can recognize shared library
3167 # find a file program that can recognize shared library
29433168 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
29443169 [m4_require([_LT_DECL_EGREP])dnl
29453170 AC_MSG_CHECKING([for $1])
29463171 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
29473172 [case $MAGIC_CMD in
29483173 [[\\/*] | ?:[\\/]*])
2949 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3174 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
29503175 ;;
29513176 *)
2952 lt_save_MAGIC_CMD="$MAGIC_CMD"
2953 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3177 lt_save_MAGIC_CMD=$MAGIC_CMD
3178 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
29543179 dnl $ac_dummy forces splitting on constant user-supplied paths.
29553180 dnl POSIX.2 word splitting is done only on the output of word expansions,
29563181 dnl not every word. This closes a longstanding sh security hole.
29573182 ac_dummy="m4_if([$2], , $PATH, [$2])"
29583183 for ac_dir in $ac_dummy; do
2959 IFS="$lt_save_ifs"
3184 IFS=$lt_save_ifs
29603185 test -z "$ac_dir" && ac_dir=.
2961 if test -f $ac_dir/$1; then
2962 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3186 if test -f "$ac_dir/$1"; then
3187 lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
29633188 if test -n "$file_magic_test_file"; then
29643189 case $deplibs_check_method in
29653190 "file_magic "*)
29663191 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2967 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3192 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
29683193 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
29693194 $EGREP "$file_magic_regex" > /dev/null; then
29703195 :
29873212 break
29883213 fi
29893214 done
2990 IFS="$lt_save_ifs"
2991 MAGIC_CMD="$lt_save_MAGIC_CMD"
3215 IFS=$lt_save_ifs
3216 MAGIC_CMD=$lt_save_MAGIC_CMD
29923217 ;;
29933218 esac])
2994 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3219 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
29953220 if test -n "$MAGIC_CMD"; then
29963221 AC_MSG_RESULT($MAGIC_CMD)
29973222 else
30093234
30103235 # _LT_PATH_MAGIC
30113236 # --------------
3012 # find a file program which can recognize a shared library
3237 # find a file program that can recognize a shared library
30133238 m4_defun([_LT_PATH_MAGIC],
30143239 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
30153240 if test -z "$lt_cv_path_MAGIC_CMD"; then
30363261 AC_ARG_WITH([gnu-ld],
30373262 [AS_HELP_STRING([--with-gnu-ld],
30383263 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
3039 [test "$withval" = no || with_gnu_ld=yes],
3264 [test no = "$withval" || with_gnu_ld=yes],
30403265 [with_gnu_ld=no])dnl
30413266
30423267 ac_prog=ld
3043 if test "$GCC" = yes; then
3268 if test yes = "$GCC"; then
30443269 # Check if gcc -print-prog-name=ld gives a path.
30453270 AC_MSG_CHECKING([for ld used by $CC])
30463271 case $host in
30473272 *-*-mingw*)
3048 # gcc leaves a trailing carriage return which upsets mingw
3273 # gcc leaves a trailing carriage return, which upsets mingw
30493274 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
30503275 *)
30513276 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
30593284 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
30603285 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
30613286 done
3062 test -z "$LD" && LD="$ac_prog"
3287 test -z "$LD" && LD=$ac_prog
30633288 ;;
30643289 "")
30653290 # If it fails, then pretend we aren't using GCC.
30703295 with_gnu_ld=unknown
30713296 ;;
30723297 esac
3073 elif test "$with_gnu_ld" = yes; then
3298 elif test yes = "$with_gnu_ld"; then
30743299 AC_MSG_CHECKING([for GNU ld])
30753300 else
30763301 AC_MSG_CHECKING([for non-GNU ld])
30773302 fi
30783303 AC_CACHE_VAL(lt_cv_path_LD,
30793304 [if test -z "$LD"; then
3080 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3305 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
30813306 for ac_dir in $PATH; do
3082 IFS="$lt_save_ifs"
3307 IFS=$lt_save_ifs
30833308 test -z "$ac_dir" && ac_dir=.
30843309 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3085 lt_cv_path_LD="$ac_dir/$ac_prog"
3310 lt_cv_path_LD=$ac_dir/$ac_prog
30863311 # Check to see if the program is GNU ld. I'd rather use --version,
30873312 # but apparently some variants of GNU ld only accept -v.
30883313 # Break only if it was the GNU/non-GNU ld that we prefer.
30893314 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
30903315 *GNU* | *'with BFD'*)
3091 test "$with_gnu_ld" != no && break
3316 test no != "$with_gnu_ld" && break
30923317 ;;
30933318 *)
3094 test "$with_gnu_ld" != yes && break
3319 test yes != "$with_gnu_ld" && break
30953320 ;;
30963321 esac
30973322 fi
30983323 done
3099 IFS="$lt_save_ifs"
3324 IFS=$lt_save_ifs
31003325 else
3101 lt_cv_path_LD="$LD" # Let the user override the test with a path.
3326 lt_cv_path_LD=$LD # Let the user override the test with a path.
31023327 fi])
3103 LD="$lt_cv_path_LD"
3328 LD=$lt_cv_path_LD
31043329 if test -n "$LD"; then
31053330 AC_MSG_RESULT($LD)
31063331 else
31543379 reload_cmds='$LD$reload_flag -o $output$reload_objs'
31553380 case $host_os in
31563381 cygwin* | mingw* | pw32* | cegcc*)
3157 if test "$GCC" != yes; then
3382 if test yes != "$GCC"; then
31583383 reload_cmds=false
31593384 fi
31603385 ;;
31613386 darwin*)
3162 if test "$GCC" = yes; then
3163 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3387 if test yes = "$GCC"; then
3388 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
31643389 else
31653390 reload_cmds='$LD$reload_flag -o $output$reload_objs'
31663391 fi
31693394 _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
31703395 _LT_TAGDECL([], [reload_cmds], [2])dnl
31713396 ])# _LT_CMD_RELOAD
3397
3398
3399 # _LT_PATH_DD
3400 # -----------
3401 # find a working dd
3402 m4_defun([_LT_PATH_DD],
3403 [AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3404 [printf 0123456789abcdef0123456789abcdef >conftest.i
3405 cat conftest.i conftest.i >conftest2.i
3406 : ${lt_DD:=$DD}
3407 AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3408 [if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3409 cmp -s conftest.i conftest.out \
3410 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3411 fi])
3412 rm -f conftest.i conftest2.i conftest.out])
3413 ])# _LT_PATH_DD
3414
3415
3416 # _LT_CMD_TRUNCATE
3417 # ----------------
3418 # find command to truncate a binary pipe
3419 m4_defun([_LT_CMD_TRUNCATE],
3420 [m4_require([_LT_PATH_DD])
3421 AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3422 [printf 0123456789abcdef0123456789abcdef >conftest.i
3423 cat conftest.i conftest.i >conftest2.i
3424 lt_cv_truncate_bin=
3425 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3426 cmp -s conftest.i conftest.out \
3427 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3428 fi
3429 rm -f conftest.i conftest2.i conftest.out
3430 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3431 _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3432 [Command to truncate a binary pipe])
3433 ])# _LT_CMD_TRUNCATE
31723434
31733435
31743436 # _LT_CHECK_MAGIC_METHOD
31863448 # Need to set the preceding variable on all platforms that support
31873449 # interlibrary dependencies.
31883450 # 'none' -- dependencies not supported.
3189 # `unknown' -- same as none, but documents that we really don't know.
3451 # 'unknown' -- same as none, but documents that we really don't know.
31903452 # 'pass_all' -- all dependencies passed with no checks.
31913453 # 'test_compile' -- check by making test program.
31923454 # 'file_magic [[regex]]' -- check by looking for files in library path
3193 # which responds to the $file_magic_cmd with a given extended regex.
3194 # If you have `file' or equivalent on your system and you're not sure
3195 # whether `pass_all' will *always* work, you probably want this one.
3455 # that responds to the $file_magic_cmd with a given extended regex.
3456 # If you have 'file' or equivalent on your system and you're not sure
3457 # whether 'pass_all' will *always* work, you probably want this one.
31963458
31973459 case $host_os in
31983460 aix[[4-9]]*)
32193481 # Base MSYS/MinGW do not provide the 'file' command needed by
32203482 # func_win32_libid shell function, so use a weaker test based on 'objdump',
32213483 # unless we find 'file', for example because we are cross-compiling.
3222 # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3223 if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3484 if ( file / ) >/dev/null 2>&1; then
32243485 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32253486 lt_cv_file_magic_cmd='func_win32_libid'
32263487 else
32543515 else
32553516 lt_cv_deplibs_check_method=pass_all
32563517 fi
3257 ;;
3258
3259 gnu*)
3260 lt_cv_deplibs_check_method=pass_all
32613518 ;;
32623519
32633520 haiku*)
32983555 ;;
32993556
33003557 # This must be glibc/ELF.
3301 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3558 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
33023559 lt_cv_deplibs_check_method=pass_all
33033560 ;;
33043561
33203577 lt_cv_deplibs_check_method=pass_all
33213578 ;;
33223579
3323 openbsd*)
3324 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3580 openbsd* | bitrig*)
3581 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
33253582 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
33263583 else
33273584 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33743631 tpf*)
33753632 lt_cv_deplibs_check_method=pass_all
33763633 ;;
3634 os2*)
3635 lt_cv_deplibs_check_method=pass_all
3636 ;;
33773637 esac
33783638 ])
33793639
34143674 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
34153675 [if test -n "$NM"; then
34163676 # Let the user override the test.
3417 lt_cv_path_NM="$NM"
3677 lt_cv_path_NM=$NM
34183678 else
3419 lt_nm_to_check="${ac_tool_prefix}nm"
3679 lt_nm_to_check=${ac_tool_prefix}nm
34203680 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
34213681 lt_nm_to_check="$lt_nm_to_check nm"
34223682 fi
34233683 for lt_tmp_nm in $lt_nm_to_check; do
3424 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3684 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
34253685 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3426 IFS="$lt_save_ifs"
3686 IFS=$lt_save_ifs
34273687 test -z "$ac_dir" && ac_dir=.
3428 tmp_nm="$ac_dir/$lt_tmp_nm"
3429 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3688 tmp_nm=$ac_dir/$lt_tmp_nm
3689 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
34303690 # Check to see if the nm accepts a BSD-compat flag.
3431 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3691 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
34323692 # nm: unknown option "B" ignored
34333693 # Tru64's nm complains that /dev/null is an invalid object file
3434 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3435 */dev/null* | *'Invalid file or object type'*)
3694 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3695 case $build_os in
3696 mingw*) lt_bad_file=conftest.nm/nofile ;;
3697 *) lt_bad_file=/dev/null ;;
3698 esac
3699 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3700 *$lt_bad_file* | *'Invalid file or object type'*)
34363701 lt_cv_path_NM="$tmp_nm -B"
3437 break
3702 break 2
34383703 ;;
34393704 *)
34403705 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
34413706 */dev/null*)
34423707 lt_cv_path_NM="$tmp_nm -p"
3443 break
3708 break 2
34443709 ;;
34453710 *)
34463711 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
34513716 esac
34523717 fi
34533718 done
3454 IFS="$lt_save_ifs"
3719 IFS=$lt_save_ifs
34553720 done
34563721 : ${lt_cv_path_NM=no}
34573722 fi])
3458 if test "$lt_cv_path_NM" != "no"; then
3459 NM="$lt_cv_path_NM"
3723 if test no != "$lt_cv_path_NM"; then
3724 NM=$lt_cv_path_NM
34603725 else
34613726 # Didn't find any BSD compatible name lister, look for dumpbin.
34623727 if test -n "$DUMPBIN"; then :
34633728 # Let the user override the test.
34643729 else
34653730 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3466 case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3731 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
34673732 *COFF*)
3468 DUMPBIN="$DUMPBIN -symbols"
3733 DUMPBIN="$DUMPBIN -symbols -headers"
34693734 ;;
34703735 *)
34713736 DUMPBIN=:
34733738 esac
34743739 fi
34753740 AC_SUBST([DUMPBIN])
3476 if test "$DUMPBIN" != ":"; then
3477 NM="$DUMPBIN"
3741 if test : != "$DUMPBIN"; then
3742 NM=$DUMPBIN
34783743 fi
34793744 fi
34803745 test -z "$NM" && NM=nm
35203785
35213786 case $host_os in
35223787 cygwin* | mingw* | pw32* | cegcc*)
3523 # two different shell functions defined in ltmain.sh
3524 # decide which to use based on capabilities of $DLLTOOL
3788 # two different shell functions defined in ltmain.sh;
3789 # decide which one to use based on capabilities of $DLLTOOL
35253790 case `$DLLTOOL --help 2>&1` in
35263791 *--identify-strict*)
35273792 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
35333798 ;;
35343799 *)
35353800 # fallback: assume linklib IS sharedlib
3536 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3801 lt_cv_sharedlib_from_linklib_cmd=$ECHO
35373802 ;;
35383803 esac
35393804 ])
35603825 lt_cv_path_mainfest_tool=yes
35613826 fi
35623827 rm -f conftest*])
3563 if test "x$lt_cv_path_mainfest_tool" != xyes; then
3828 if test yes != "$lt_cv_path_mainfest_tool"; then
35643829 MANIFEST_TOOL=:
35653830 fi
35663831 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
35673832 ])# _LT_PATH_MANIFEST_TOOL
3833
3834
3835 # _LT_DLL_DEF_P([FILE])
3836 # ---------------------
3837 # True iff FILE is a Windows DLL '.def' file.
3838 # Keep in sync with func_dll_def_p in the libtool script
3839 AC_DEFUN([_LT_DLL_DEF_P],
3840 [dnl
3841 test DEF = "`$SED -n dnl
3842 -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
3843 -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
3844 -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
3845 -e q dnl Only consider the first "real" line
3846 $1`" dnl
3847 ])# _LT_DLL_DEF_P
35683848
35693849
35703850 # LT_LIB_M
35783858 # These system don't have libm, or don't need it
35793859 ;;
35803860 *-ncr-sysv4.3*)
3581 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3861 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
35823862 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
35833863 ;;
35843864 *)
3585 AC_CHECK_LIB(m, cos, LIBM="-lm")
3865 AC_CHECK_LIB(m, cos, LIBM=-lm)
35863866 ;;
35873867 esac
35883868 AC_SUBST([LIBM])
36013881
36023882 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
36033883
3604 if test "$GCC" = yes; then
3884 if test yes = "$GCC"; then
36053885 case $cc_basename in
36063886 nvcc*)
36073887 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36533933 symcode='[[ABCDGISTW]]'
36543934 ;;
36553935 hpux*)
3656 if test "$host_cpu" = ia64; then
3936 if test ia64 = "$host_cpu"; then
36573937 symcode='[[ABCDEGRST]]'
36583938 fi
36593939 ;;
36863966 symcode='[[ABCDGIRSTW]]' ;;
36873967 esac
36883968
3969 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3970 # Gets list of data symbols to import.
3971 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3972 # Adjust the below global symbol transforms to fixup imported variables.
3973 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3974 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
3975 lt_c_name_lib_hook="\
3976 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
3977 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
3978 else
3979 # Disable hooks by default.
3980 lt_cv_sys_global_symbol_to_import=
3981 lt_cdecl_hook=
3982 lt_c_name_hook=
3983 lt_c_name_lib_hook=
3984 fi
3985
36893986 # Transform an extracted symbol line into a proper C declaration.
36903987 # Some systems (esp. on ia64) link data and code symbols differently,
36913988 # so use this general approach.
3692 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3989 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
3990 $lt_cdecl_hook\
3991 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3992 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
36933993
36943994 # Transform an extracted symbol line into symbol name and symbol address
3695 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3696 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
3995 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
3996 $lt_c_name_hook\
3997 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
3998 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
3999
4000 # Transform an extracted symbol line into symbol name with lib prefix and
4001 # symbol address.
4002 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4003 $lt_c_name_lib_hook\
4004 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
4005 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
4006 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
36974007
36984008 # Handle CRLF in mingw tool chain
36994009 opt_cr=
37114021
37124022 # Write the raw and C identifiers.
37134023 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3714 # Fake it for dumpbin and say T for any non-static function
3715 # and D for any global variable.
4024 # Fake it for dumpbin and say T for any non-static function,
4025 # D for any global variable and I for any imported variable.
37164026 # Also find C++ and __fastcall symbols from MSVC++,
37174027 # which start with @ or ?.
37184028 lt_cv_sys_global_symbol_pipe="$AWK ['"\
37194029 " {last_section=section; section=\$ 3};"\
37204030 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
37214031 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4032 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4033 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4034 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
37224035 " \$ 0!~/External *\|/{next};"\
37234036 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
37244037 " {if(hide[section]) next};"\
3725 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3726 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3727 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
3728 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4038 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4039 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4040 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4041 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
37294042 " ' prfx=^$ac_symprfx]"
37304043 else
37314044 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
37654078 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
37664079 cat <<_LT_EOF > conftest.$ac_ext
37674080 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3768 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3769 /* DATA imports from DLLs on WIN32 con't be const, because runtime
4081 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4082 /* DATA imports from DLLs on WIN32 can't be const, because runtime
37704083 relocations are performed -- see ld's documentation on pseudo-relocs. */
37714084 # define LT@&t@_DLSYM_CONST
3772 #elif defined(__osf__)
4085 #elif defined __osf__
37734086 /* This system does not cope well with relocations in const data. */
37744087 # define LT@&t@_DLSYM_CONST
37754088 #else
37954108 {
37964109 { "@PROGRAM@", (void *) 0 },
37974110 _LT_EOF
3798 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4111 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
37994112 cat <<\_LT_EOF >> conftest.$ac_ext
38004113 {0, (void *) 0}
38014114 };
38154128 mv conftest.$ac_objext conftstm.$ac_objext
38164129 lt_globsym_save_LIBS=$LIBS
38174130 lt_globsym_save_CFLAGS=$CFLAGS
3818 LIBS="conftstm.$ac_objext"
4131 LIBS=conftstm.$ac_objext
38194132 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3820 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4133 if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
38214134 pipe_works=yes
38224135 fi
38234136 LIBS=$lt_globsym_save_LIBS
38384151 rm -rf conftest* conftst*
38394152
38404153 # Do not use the global_symbol_pipe unless it works.
3841 if test "$pipe_works" = yes; then
4154 if test yes = "$pipe_works"; then
38424155 break
38434156 else
38444157 lt_cv_sys_global_symbol_pipe=
38654178 [Take the output of nm and produce a listing of raw symbols and C names])
38664179 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
38674180 [Transform the output of nm in a proper C declaration])
4181 _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4182 [Transform the output of nm into a list of symbols to manually relocate])
38684183 _LT_DECL([global_symbol_to_c_name_address],
38694184 [lt_cv_sys_global_symbol_to_c_name_address], [1],
38704185 [Transform the output of nm in a C name address pair])
38714186 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
38724187 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
38734188 [Transform the output of nm in a C name address pair when lib prefix is needed])
4189 _LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4190 [The name lister interface])
38744191 _LT_DECL([], [nm_file_list_spec], [1],
38754192 [Specify filename containing input files for $NM])
38764193 ]) # _LT_CMD_GLOBAL_SYMBOLS
38864203
38874204 m4_if([$1], [CXX], [
38884205 # C++ specific cases for pic, static, wl, etc.
3889 if test "$GXX" = yes; then
4206 if test yes = "$GXX"; then
38904207 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38914208 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
38924209
38934210 case $host_os in
38944211 aix*)
38954212 # All AIX code is PIC.
3896 if test "$host_cpu" = ia64; then
4213 if test ia64 = "$host_cpu"; then
38974214 # AIX 5 now supports IA64 processor
38984215 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
38994216 fi
4217 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39004218 ;;
39014219
39024220 amigaos*)
39074225 ;;
39084226 m68k)
39094227 # FIXME: we need at least 68020 code to build shared libraries, but
3910 # adding the `-m68020' flag to GCC prevents building anything better,
3911 # like `-m68040'.
4228 # adding the '-m68020' flag to GCC prevents building anything better,
4229 # like '-m68040'.
39124230 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
39134231 ;;
39144232 esac
39244242 # (--disable-auto-import) libraries
39254243 m4_if([$1], [GCJ], [],
39264244 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4245 case $host_os in
4246 os2*)
4247 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4248 ;;
4249 esac
39274250 ;;
39284251 darwin* | rhapsody*)
39294252 # PIC is the default on this platform
39734296 case $host_os in
39744297 aix[[4-9]]*)
39754298 # All AIX code is PIC.
3976 if test "$host_cpu" = ia64; then
4299 if test ia64 = "$host_cpu"; then
39774300 # AIX 5 now supports IA64 processor
39784301 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39794302 else
40144337 case $cc_basename in
40154338 CC*)
40164339 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4017 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4018 if test "$host_cpu" != ia64; then
4340 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4341 if test ia64 != "$host_cpu"; then
40194342 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40204343 fi
40214344 ;;
40224345 aCC*)
40234346 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4024 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4347 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
40254348 case $host_cpu in
40264349 hppa*64*|ia64*)
40274350 # +Z the default
40504373 ;;
40514374 esac
40524375 ;;
4053 linux* | k*bsd*-gnu | kopensolaris*-gnu)
4376 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
40544377 case $cc_basename in
40554378 KCC*)
40564379 # KAI C++ Compiler
40584381 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40594382 ;;
40604383 ecpc* )
4061 # old Intel C++ for x86_64 which still supported -KPIC.
4384 # old Intel C++ for x86_64, which still supported -KPIC.
40624385 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40634386 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40644387 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42034526 fi
42044527 ],
42054528 [
4206 if test "$GCC" = yes; then
4529 if test yes = "$GCC"; then
42074530 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42084531 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42094532
42104533 case $host_os in
42114534 aix*)
42124535 # All AIX code is PIC.
4213 if test "$host_cpu" = ia64; then
4536 if test ia64 = "$host_cpu"; then
42144537 # AIX 5 now supports IA64 processor
42154538 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42164539 fi
4540 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42174541 ;;
42184542
42194543 amigaos*)
42244548 ;;
42254549 m68k)
42264550 # FIXME: we need at least 68020 code to build shared libraries, but
4227 # adding the `-m68020' flag to GCC prevents building anything better,
4228 # like `-m68040'.
4551 # adding the '-m68020' flag to GCC prevents building anything better,
4552 # like '-m68040'.
42294553 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42304554 ;;
42314555 esac
42424566 # (--disable-auto-import) libraries
42434567 m4_if([$1], [GCJ], [],
42444568 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4569 case $host_os in
4570 os2*)
4571 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4572 ;;
4573 esac
42454574 ;;
42464575
42474576 darwin* | rhapsody*)
43124641 case $host_os in
43134642 aix*)
43144643 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4315 if test "$host_cpu" = ia64; then
4644 if test ia64 = "$host_cpu"; then
43164645 # AIX 5 now supports IA64 processor
43174646 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43184647 else
43204649 fi
43214650 ;;
43224651
4652 darwin* | rhapsody*)
4653 # PIC is the default on this platform
4654 # Common symbols not allowed in MH_DYLIB files
4655 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4656 case $cc_basename in
4657 nagfor*)
4658 # NAG Fortran compiler
4659 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4660 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4661 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4662 ;;
4663 esac
4664 ;;
4665
43234666 mingw* | cygwin* | pw32* | os2* | cegcc*)
43244667 # This hack is so that the source file can tell whether it is being
43254668 # built for inclusion in a dll (and should export symbols for example).
43264669 m4_if([$1], [GCJ], [],
43274670 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4671 case $host_os in
4672 os2*)
4673 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4674 ;;
4675 esac
43284676 ;;
43294677
43304678 hpux9* | hpux10* | hpux11*)
43404688 ;;
43414689 esac
43424690 # Is there a better lt_prog_compiler_static that works with the bundled CC?
4343 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4691 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43444692 ;;
43454693
43464694 irix5* | irix6* | nonstopux*)
43494697 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43504698 ;;
43514699
4352 linux* | k*bsd*-gnu | kopensolaris*-gnu)
4700 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
43534701 case $cc_basename in
4354 # old Intel for x86_64 which still supported -KPIC.
4702 # old Intel for x86_64, which still supported -KPIC.
43554703 ecc*)
43564704 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43574705 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43754723 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
43764724 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
43774725 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4726 ;;
4727 tcc*)
4728 # Fabrice Bellard et al's Tiny C Compiler
4729 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4730 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4731 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43784732 ;;
43794733 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
43804734 # Portland Group compilers (*not* the Pentium gcc compiler,
44734827 ;;
44744828
44754829 sysv4*MP*)
4476 if test -d /usr/nec ;then
4830 if test -d /usr/nec; then
44774831 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
44784832 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44794833 fi
45024856 fi
45034857 ])
45044858 case $host_os in
4505 # For platforms which do not support PIC, -DPIC is meaningless:
4859 # For platforms that do not support PIC, -DPIC is meaningless:
45064860 *djgpp*)
45074861 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
45084862 ;;
45684922 case $host_os in
45694923 aix[[4-9]]*)
45704924 # If we're using GNU nm, then we don't want the "-C" option.
4571 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4572 # Also, AIX nm treats weak defined symbols like other global defined
4573 # symbols, whereas GNU nm marks them as "W".
4925 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4926 # Without the "-l" option, or with the "-B" option, AIX nm treats
4927 # weak defined symbols like other global defined symbols, whereas
4928 # GNU nm marks them as "W".
4929 # While the 'weak' keyword is ignored in the Export File, we need
4930 # it in the Import File for the 'aix-soname' feature, so we have
4931 # to replace the "-B" option with "-P" for AIX nm.
45744932 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4575 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4933 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
45764934 else
4577 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4935 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
45784936 fi
45794937 ;;
45804938 pw32*)
4581 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4939 _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
45824940 ;;
45834941 cygwin* | mingw* | cegcc*)
45844942 case $cc_basename in
46244982 # included in the symbol list
46254983 _LT_TAGVAR(include_expsyms, $1)=
46264984 # exclude_expsyms can be an extended regexp of symbols to exclude
4627 # it will be wrapped by ` (' and `)$', so one must not match beginning or
4628 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4629 # as well as any symbol that contains `d'.
4985 # it will be wrapped by ' (' and ')$', so one must not match beginning or
4986 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4987 # as well as any symbol that contains 'd'.
46304988 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
46314989 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
46324990 # platforms (ab)use it in PIC code, but their linkers get confused if
46425000 # FIXME: the MSVC++ port hasn't been tested in a loooong time
46435001 # When not using gcc, we currently assume that we are using
46445002 # Microsoft Visual C++.
4645 if test "$GCC" != yes; then
5003 if test yes != "$GCC"; then
46465004 with_gnu_ld=no
46475005 fi
46485006 ;;
46505008 # we just hope/assume this is gcc and not c89 (= MSVC++)
46515009 with_gnu_ld=yes
46525010 ;;
4653 openbsd*)
5011 openbsd* | bitrig*)
46545012 with_gnu_ld=no
46555013 ;;
46565014 esac
46605018 # On some targets, GNU ld is compatible enough with the native linker
46615019 # that we're better off using the native interface for both.
46625020 lt_use_gnu_ld_interface=no
4663 if test "$with_gnu_ld" = yes; then
5021 if test yes = "$with_gnu_ld"; then
46645022 case $host_os in
46655023 aix*)
46665024 # The AIX port of GNU ld has always aspired to compatibility
46825040 esac
46835041 fi
46845042
4685 if test "$lt_use_gnu_ld_interface" = yes; then
5043 if test yes = "$lt_use_gnu_ld_interface"; then
46865044 # If archive_cmds runs LD, not CC, wlarc should be empty
4687 wlarc='${wl}'
5045 wlarc='$wl'
46885046
46895047 # Set some defaults for GNU ld with shared library support. These
46905048 # are reset later if shared libraries are not supported. Putting them
46915049 # here allows them to be overridden if necessary.
46925050 runpath_var=LD_RUN_PATH
4693 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4694 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5051 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5052 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
46955053 # ancient GNU ld didn't support --whole-archive et. al.
46965054 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4697 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5055 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
46985056 else
46995057 _LT_TAGVAR(whole_archive_flag_spec, $1)=
47005058 fi
47015059 supports_anon_versioning=no
4702 case `$LD -v 2>&1` in
5060 case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
47035061 *GNU\ gold*) supports_anon_versioning=yes ;;
47045062 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
47055063 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
47125070 case $host_os in
47135071 aix[[3-9]]*)
47145072 # On AIX/PPC, the GNU linker is very broken
4715 if test "$host_cpu" != ia64; then
5073 if test ia64 != "$host_cpu"; then
47165074 _LT_TAGVAR(ld_shlibs, $1)=no
47175075 cat <<_LT_EOF 1>&2
47185076
47315089 case $host_cpu in
47325090 powerpc)
47335091 # see comment about AmigaOS4 .so support
4734 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5092 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
47355093 _LT_TAGVAR(archive_expsym_cmds, $1)=''
47365094 ;;
47375095 m68k)
47475105 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47485106 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
47495107 # support --undefined. This deserves some investigation. FIXME
4750 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5108 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
47515109 else
47525110 _LT_TAGVAR(ld_shlibs, $1)=no
47535111 fi
47575115 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
47585116 # as there is no search path for DLLs.
47595117 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4760 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5118 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
47615119 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47625120 _LT_TAGVAR(always_export_symbols, $1)=no
47635121 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47655123 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
47665124
47675125 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4768 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4769 # If the export-symbols file already is a .def file (1st line
4770 # is EXPORTS), use it as is; otherwise, prepend...
4771 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4772 cp $export_symbols $output_objdir/$soname.def;
4773 else
4774 echo EXPORTS > $output_objdir/$soname.def;
4775 cat $export_symbols >> $output_objdir/$soname.def;
4776 fi~
4777 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5126 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5127 # If the export-symbols file already is a .def file, use it as
5128 # is; otherwise, prepend EXPORTS...
5129 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5130 cp $export_symbols $output_objdir/$soname.def;
5131 else
5132 echo EXPORTS > $output_objdir/$soname.def;
5133 cat $export_symbols >> $output_objdir/$soname.def;
5134 fi~
5135 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
47785136 else
47795137 _LT_TAGVAR(ld_shlibs, $1)=no
47805138 fi
47815139 ;;
47825140
47835141 haiku*)
4784 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5142 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
47855143 _LT_TAGVAR(link_all_deplibs, $1)=yes
5144 ;;
5145
5146 os2*)
5147 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5148 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5149 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5150 shrext_cmds=.dll
5151 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5152 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5153 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5154 $ECHO EXPORTS >> $output_objdir/$libname.def~
5155 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5156 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5157 emximp -o $lib $output_objdir/$libname.def'
5158 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5159 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5160 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5161 $ECHO EXPORTS >> $output_objdir/$libname.def~
5162 prefix_cmds="$SED"~
5163 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5164 prefix_cmds="$prefix_cmds -e 1d";
5165 fi~
5166 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5167 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5168 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5169 emximp -o $lib $output_objdir/$libname.def'
5170 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5171 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47865172 ;;
47875173
47885174 interix[[3-9]]*)
47895175 _LT_TAGVAR(hardcode_direct, $1)=no
47905176 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4791 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4792 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5177 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5178 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
47935179 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
47945180 # Instead, shared libraries are loaded at an image base (0x10000000 by
47955181 # default) and relocated if they conflict, which is a slow very memory
47965182 # consuming and fragmenting process. To avoid this, we pick a random,
47975183 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
47985184 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
4799 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4800 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5185 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5186 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
48015187 ;;
48025188
48035189 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
48045190 tmp_diet=no
4805 if test "$host_os" = linux-dietlibc; then
5191 if test linux-dietlibc = "$host_os"; then
48065192 case $cc_basename in
48075193 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
48085194 esac
48095195 fi
48105196 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4811 && test "$tmp_diet" = no
5197 && test no = "$tmp_diet"
48125198 then
48135199 tmp_addflag=' $pic_flag'
48145200 tmp_sharedflag='-shared'
48155201 case $cc_basename,$host_cpu in
48165202 pgcc*) # Portland Group C compiler
4817 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5203 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
48185204 tmp_addflag=' $pic_flag'
48195205 ;;
48205206 pgf77* | pgf90* | pgf95* | pgfortran*)
48215207 # Portland Group f77 and f90 compilers
4822 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5208 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
48235209 tmp_addflag=' $pic_flag -Mnomain' ;;
48245210 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
48255211 tmp_addflag=' -i_dynamic' ;;
48305216 lf95*) # Lahey Fortran 8.1
48315217 _LT_TAGVAR(whole_archive_flag_spec, $1)=
48325218 tmp_sharedflag='--shared' ;;
5219 nagfor*) # NAGFOR 5.3
5220 tmp_sharedflag='-Wl,-shared' ;;
48335221 xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
48345222 tmp_sharedflag='-qmkshrobj'
48355223 tmp_addflag= ;;
48365224 nvcc*) # Cuda Compiler Driver 2.2
4837 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5225 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
48385226 _LT_TAGVAR(compiler_needs_object, $1)=yes
48395227 ;;
48405228 esac
48415229 case `$CC -V 2>&1 | sed 5q` in
48425230 *Sun\ C*) # Sun C 5.9
4843 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
5231 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
48445232 _LT_TAGVAR(compiler_needs_object, $1)=yes
48455233 tmp_sharedflag='-G' ;;
48465234 *Sun\ F*) # Sun Fortran 8.3
48475235 tmp_sharedflag='-G' ;;
48485236 esac
4849 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4850
4851 if test "x$supports_anon_versioning" = xyes; then
5237 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5238
5239 if test yes = "$supports_anon_versioning"; then
48525240 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4853 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4854 echo "local: *; };" >> $output_objdir/$libname.ver~
4855 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5241 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5242 echo "local: *; };" >> $output_objdir/$libname.ver~
5243 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
48565244 fi
48575245
48585246 case $cc_basename in
5247 tcc*)
5248 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5249 ;;
48595250 xlf* | bgf* | bgxlf* | mpixlf*)
48605251 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
48615252 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4862 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5253 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
48635254 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4864 if test "x$supports_anon_versioning" = xyes; then
5255 if test yes = "$supports_anon_versioning"; then
48655256 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4866 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4867 echo "local: *; };" >> $output_objdir/$libname.ver~
4868 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5257 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5258 echo "local: *; };" >> $output_objdir/$libname.ver~
5259 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
48695260 fi
48705261 ;;
48715262 esac
48795270 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
48805271 wlarc=
48815272 else
4882 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4883 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5273 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5274 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
48845275 fi
48855276 ;;
48865277
48985289
48995290 _LT_EOF
49005291 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4901 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4902 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5292 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5293 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
49035294 else
49045295 _LT_TAGVAR(ld_shlibs, $1)=no
49055296 fi
49115302 _LT_TAGVAR(ld_shlibs, $1)=no
49125303 cat <<_LT_EOF 1>&2
49135304
4914 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5305 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
49155306 *** reliably create shared libraries on SCO systems. Therefore, libtool
49165307 *** is disabling shared libraries support. We urge you to upgrade GNU
49175308 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
49265317 # DT_RUNPATH tag from executables and libraries. But doing so
49275318 # requires that you compile everything twice, which is a pain.
49285319 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4929 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4930 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4931 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5320 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5321 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5322 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
49325323 else
49335324 _LT_TAGVAR(ld_shlibs, $1)=no
49345325 fi
49455336
49465337 *)
49475338 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4948 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4949 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5339 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5340 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
49505341 else
49515342 _LT_TAGVAR(ld_shlibs, $1)=no
49525343 fi
49535344 ;;
49545345 esac
49555346
4956 if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
5347 if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
49575348 runpath_var=
49585349 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49595350 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49695360 # Note: this linker hardcodes the directories in LIBPATH if there
49705361 # are no directories specified by -L.
49715362 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4972 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5363 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
49735364 # Neither direct hardcoding nor static linking is supported with a
49745365 # broken collect2.
49755366 _LT_TAGVAR(hardcode_direct, $1)=unsupported
49775368 ;;
49785369
49795370 aix[[4-9]]*)
4980 if test "$host_cpu" = ia64; then
5371 if test ia64 = "$host_cpu"; then
49815372 # On IA64, the linker does run time linking by default, so we don't
49825373 # have to do anything special.
49835374 aix_use_runtimelinking=no
49845375 exp_sym_flag='-Bexport'
4985 no_entry_flag=""
5376 no_entry_flag=
49865377 else
49875378 # If we're using GNU nm, then we don't want the "-C" option.
4988 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4989 # Also, AIX nm treats weak defined symbols like other global
4990 # defined symbols, whereas GNU nm marks them as "W".
5379 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
5380 # Without the "-l" option, or with the "-B" option, AIX nm treats
5381 # weak defined symbols like other global defined symbols, whereas
5382 # GNU nm marks them as "W".
5383 # While the 'weak' keyword is ignored in the Export File, we need
5384 # it in the Import File for the 'aix-soname' feature, so we have
5385 # to replace the "-B" option with "-P" for AIX nm.
49915386 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4992 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5387 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
49935388 else
4994 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5389 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
49955390 fi
49965391 aix_use_runtimelinking=no
49975392
49985393 # Test if we are trying to use run time linking or normal
49995394 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5000 # need to do runtime linking.
5395 # have runtime linking enabled, and use it for executables.
5396 # For shared libraries, we enable/disable runtime linking
5397 # depending on the kind of the shared library created -
5398 # when "with_aix_soname,aix_use_runtimelinking" is:
5399 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
5400 # "aix,yes" lib.so shared, rtl:yes, for executables
5401 # lib.a static archive
5402 # "both,no" lib.so.V(shr.o) shared, rtl:yes
5403 # lib.a(lib.so.V) shared, rtl:no, for executables
5404 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5405 # lib.a(lib.so.V) shared, rtl:no
5406 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
5407 # lib.a static archive
50015408 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
50025409 for ld_flag in $LDFLAGS; do
5003 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5410 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
50045411 aix_use_runtimelinking=yes
50055412 break
50065413 fi
50075414 done
5415 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5416 # With aix-soname=svr4, we create the lib.so.V shared archives only,
5417 # so we don't have lib.a shared libs to link our executables.
5418 # We have to force runtime linking in this case.
5419 aix_use_runtimelinking=yes
5420 LDFLAGS="$LDFLAGS -Wl,-brtl"
5421 fi
50085422 ;;
50095423 esac
50105424
50235437 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
50245438 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50255439 _LT_TAGVAR(link_all_deplibs, $1)=yes
5026 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5027
5028 if test "$GCC" = yes; then
5440 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5441 case $with_aix_soname,$aix_use_runtimelinking in
5442 aix,*) ;; # traditional, no import file
5443 svr4,* | *,yes) # use import file
5444 # The Import File defines what to hardcode.
5445 _LT_TAGVAR(hardcode_direct, $1)=no
5446 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5447 ;;
5448 esac
5449
5450 if test yes = "$GCC"; then
50295451 case $host_os in aix4.[[012]]|aix4.[[012]].*)
50305452 # We only want to do this on AIX 4.2 and lower, the check
50315453 # below for broken collect2 doesn't work under 4.3+
5032 collect2name=`${CC} -print-prog-name=collect2`
5454 collect2name=`$CC -print-prog-name=collect2`
50335455 if test -f "$collect2name" &&
50345456 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
50355457 then
50485470 ;;
50495471 esac
50505472 shared_flag='-shared'
5051 if test "$aix_use_runtimelinking" = yes; then
5052 shared_flag="$shared_flag "'${wl}-G'
5473 if test yes = "$aix_use_runtimelinking"; then
5474 shared_flag="$shared_flag "'$wl-G'
50535475 fi
5476 # Need to ensure runtime linking is disabled for the traditional
5477 # shared library, or the linker may eventually find shared libraries
5478 # /with/ Import File - we do not want to mix them.
5479 shared_flag_aix='-shared'
5480 shared_flag_svr4='-shared $wl-G'
50545481 else
50555482 # not using gcc
5056 if test "$host_cpu" = ia64; then
5483 if test ia64 = "$host_cpu"; then
50575484 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
50585485 # chokes on -Wl,-G. The following line is correct:
50595486 shared_flag='-G'
50605487 else
5061 if test "$aix_use_runtimelinking" = yes; then
5062 shared_flag='${wl}-G'
5488 if test yes = "$aix_use_runtimelinking"; then
5489 shared_flag='$wl-G'
50635490 else
5064 shared_flag='${wl}-bM:SRE'
5491 shared_flag='$wl-bM:SRE'
50655492 fi
5493 shared_flag_aix='$wl-bM:SRE'
5494 shared_flag_svr4='$wl-G'
50665495 fi
50675496 fi
50685497
5069 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5498 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
50705499 # It seems that -bexpall does not export symbols beginning with
50715500 # underscore (_), so it is better to generate a list of symbols to export.
50725501 _LT_TAGVAR(always_export_symbols, $1)=yes
5073 if test "$aix_use_runtimelinking" = yes; then
5502 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
50745503 # Warning - without using the other runtime loading flags (-brtl),
50755504 # -berok will link without error, but may produce a broken library.
50765505 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
50775506 # Determine the default libpath from the value encoded in an
50785507 # empty executable.
50795508 _LT_SYS_MODULE_PATH_AIX([$1])
5080 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5081 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5509 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5510 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
50825511 else
5083 if test "$host_cpu" = ia64; then
5084 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5512 if test ia64 = "$host_cpu"; then
5513 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
50855514 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5086 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
5515 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
50875516 else
50885517 # Determine the default libpath from the value encoded in an
50895518 # empty executable.
50905519 _LT_SYS_MODULE_PATH_AIX([$1])
5091 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5520 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
50925521 # Warning - without using the other run time loading flags,
50935522 # -berok will link without error, but may produce a broken library.
5094 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5095 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5096 if test "$with_gnu_ld" = yes; then
5523 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5524 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5525 if test yes = "$with_gnu_ld"; then
50975526 # We only use this code for GNU lds that support --whole-archive.
5098 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5527 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
50995528 else
51005529 # Exported symbols can be pulled into shared objects from archives
51015530 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
51025531 fi
51035532 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5104 # This is similar to how AIX traditionally builds its shared libraries.
5105 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5533 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5534 # -brtl affects multiple linker settings, -berok does not and is overridden later
5535 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5536 if test svr4 != "$with_aix_soname"; then
5537 # This is similar to how AIX traditionally builds its shared libraries.
5538 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5539 fi
5540 if test aix != "$with_aix_soname"; then
5541 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5542 else
5543 # used by -dlpreopen to get the symbols
5544 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
5545 fi
5546 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
51065547 fi
51075548 fi
51085549 ;;
51115552 case $host_cpu in
51125553 powerpc)
51135554 # see comment about AmigaOS4 .so support
5114 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5555 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51155556 _LT_TAGVAR(archive_expsym_cmds, $1)=''
51165557 ;;
51175558 m68k)
51415582 # Tell ltmain to make .lib files, not .a files.
51425583 libext=lib
51435584 # Tell ltmain to make .dll files, not .so files.
5144 shrext_cmds=".dll"
5585 shrext_cmds=.dll
51455586 # FIXME: Setting linknames here is a bad hack.
5146 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5147 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5148 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5149 else
5150 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5151 fi~
5152 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5153 linknames='
5587 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5588 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5589 cp "$export_symbols" "$output_objdir/$soname.def";
5590 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5591 else
5592 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5593 fi~
5594 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5595 linknames='
51545596 # The linker will not automatically build a static lib if we build a DLL.
51555597 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51565598 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51595601 # Don't use ranlib
51605602 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
51615603 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5162 lt_tool_outputfile="@TOOL_OUTPUT@"~
5163 case $lt_outputfile in
5164 *.exe|*.EXE) ;;
5165 *)
5166 lt_outputfile="$lt_outputfile.exe"
5167 lt_tool_outputfile="$lt_tool_outputfile.exe"
5168 ;;
5169 esac~
5170 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5171 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5172 $RM "$lt_outputfile.manifest";
5173 fi'
5604 lt_tool_outputfile="@TOOL_OUTPUT@"~
5605 case $lt_outputfile in
5606 *.exe|*.EXE) ;;
5607 *)
5608 lt_outputfile=$lt_outputfile.exe
5609 lt_tool_outputfile=$lt_tool_outputfile.exe
5610 ;;
5611 esac~
5612 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5613 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5614 $RM "$lt_outputfile.manifest";
5615 fi'
51745616 ;;
51755617 *)
51765618 # Assume MSVC wrapper
51795621 # Tell ltmain to make .lib files, not .a files.
51805622 libext=lib
51815623 # Tell ltmain to make .dll files, not .so files.
5182 shrext_cmds=".dll"
5624 shrext_cmds=.dll
51835625 # FIXME: Setting linknames here is a bad hack.
51845626 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
51855627 # The linker will automatically build a .lib file if we build a DLL.
52295671 ;;
52305672
52315673 hpux9*)
5232 if test "$GCC" = yes; then
5233 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5674 if test yes = "$GCC"; then
5675 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
52345676 else
5235 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5677 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
52365678 fi
5237 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5679 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
52385680 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
52395681 _LT_TAGVAR(hardcode_direct, $1)=yes
52405682
52415683 # hardcode_minus_L: Not really in the search PATH,
52425684 # but as the default location of the library.
52435685 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5244 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5686 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
52455687 ;;
52465688
52475689 hpux10*)
5248 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5249 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5690 if test yes,no = "$GCC,$with_gnu_ld"; then
5691 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52505692 else
52515693 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
52525694 fi
5253 if test "$with_gnu_ld" = no; then
5254 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5695 if test no = "$with_gnu_ld"; then
5696 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
52555697 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
52565698 _LT_TAGVAR(hardcode_direct, $1)=yes
52575699 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5258 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5700 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
52595701 # hardcode_minus_L: Not really in the search PATH,
52605702 # but as the default location of the library.
52615703 _LT_TAGVAR(hardcode_minus_L, $1)=yes
52635705 ;;
52645706
52655707 hpux11*)
5266 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5708 if test yes,no = "$GCC,$with_gnu_ld"; then
52675709 case $host_cpu in
52685710 hppa*64*)
5269 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5711 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
52705712 ;;
52715713 ia64*)
5272 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5714 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52735715 ;;
52745716 *)
5275 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5717 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52765718 ;;
52775719 esac
52785720 else
52795721 case $host_cpu in
52805722 hppa*64*)
5281 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5723 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
52825724 ;;
52835725 ia64*)
5284 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5726 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52855727 ;;
52865728 *)
52875729 m4_if($1, [], [
52895731 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
52905732 _LT_LINKER_OPTION([if $CC understands -b],
52915733 _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5292 [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5734 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
52935735 [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5294 [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5736 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
52955737 ;;
52965738 esac
52975739 fi
5298 if test "$with_gnu_ld" = no; then
5299 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5740 if test no = "$with_gnu_ld"; then
5741 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
53005742 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53015743
53025744 case $host_cpu in
53075749 *)
53085750 _LT_TAGVAR(hardcode_direct, $1)=yes
53095751 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5310 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5752 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
53115753
53125754 # hardcode_minus_L: Not really in the search PATH,
53135755 # but as the default location of the library.
53185760 ;;
53195761
53205762 irix5* | irix6* | nonstopux*)
5321 if test "$GCC" = yes; then
5322 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5763 if test yes = "$GCC"; then
5764 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
53235765 # Try to use the -exported_symbol ld option, if it does not
53245766 # work, assume that -exports_file does not work either and
53255767 # implicitly export all symbols.
53265768 # This should be the same for all languages, so no per-tag cache variable.
53275769 AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
53285770 [lt_cv_irix_exported_symbol],
5329 [save_LDFLAGS="$LDFLAGS"
5330 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5771 [save_LDFLAGS=$LDFLAGS
5772 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
53315773 AC_LINK_IFELSE(
53325774 [AC_LANG_SOURCE(
53335775 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
53405782 end]])])],
53415783 [lt_cv_irix_exported_symbol=yes],
53425784 [lt_cv_irix_exported_symbol=no])
5343 LDFLAGS="$save_LDFLAGS"])
5344 if test "$lt_cv_irix_exported_symbol" = yes; then
5345 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
5785 LDFLAGS=$save_LDFLAGS])
5786 if test yes = "$lt_cv_irix_exported_symbol"; then
5787 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
53465788 fi
53475789 else
5348 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5349 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
5790 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5791 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
53505792 fi
53515793 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5352 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5794 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
53535795 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53545796 _LT_TAGVAR(inherit_rpath, $1)=yes
53555797 _LT_TAGVAR(link_all_deplibs, $1)=yes
5798 ;;
5799
5800 linux*)
5801 case $cc_basename in
5802 tcc*)
5803 # Fabrice Bellard et al's Tiny C Compiler
5804 _LT_TAGVAR(ld_shlibs, $1)=yes
5805 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5806 ;;
5807 esac
53565808 ;;
53575809
53585810 netbsd*)
53695821 newsos6)
53705822 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
53715823 _LT_TAGVAR(hardcode_direct, $1)=yes
5372 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5824 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
53735825 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53745826 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53755827 ;;
53775829 *nto* | *qnx*)
53785830 ;;
53795831
5380 openbsd*)
5832 openbsd* | bitrig*)
53815833 if test -f /usr/libexec/ld.so; then
53825834 _LT_TAGVAR(hardcode_direct, $1)=yes
53835835 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53845836 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5385 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5837 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
53865838 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5387 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5388 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5389 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5839 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5840 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5841 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
53905842 else
5391 case $host_os in
5392 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5393 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5394 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5395 ;;
5396 *)
5397 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5398 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5399 ;;
5400 esac
5843 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5844 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
54015845 fi
54025846 else
54035847 _LT_TAGVAR(ld_shlibs, $1)=no
54085852 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54095853 _LT_TAGVAR(hardcode_minus_L, $1)=yes
54105854 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5411 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5412 _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5855 shrext_cmds=.dll
5856 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5857 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5858 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5859 $ECHO EXPORTS >> $output_objdir/$libname.def~
5860 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5861 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5862 emximp -o $lib $output_objdir/$libname.def'
5863 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5864 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5865 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5866 $ECHO EXPORTS >> $output_objdir/$libname.def~
5867 prefix_cmds="$SED"~
5868 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5869 prefix_cmds="$prefix_cmds -e 1d";
5870 fi~
5871 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5872 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5873 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5874 emximp -o $lib $output_objdir/$libname.def'
5875 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5876 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
54135877 ;;
54145878
54155879 osf3*)
5416 if test "$GCC" = yes; then
5417 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5418 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5880 if test yes = "$GCC"; then
5881 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5882 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
54195883 else
54205884 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5421 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5885 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
54225886 fi
54235887 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5424 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5888 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
54255889 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54265890 ;;
54275891
54285892 osf4* | osf5*) # as osf3* with the addition of -msym flag
5429 if test "$GCC" = yes; then
5430 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5431 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5432 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5893 if test yes = "$GCC"; then
5894 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5895 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5896 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
54335897 else
54345898 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5435 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5899 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
54365900 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
5437 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
5901 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
54385902
54395903 # Both c and cxx compiler support -rpath directly
54405904 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
54455909
54465910 solaris*)
54475911 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5448 if test "$GCC" = yes; then
5449 wlarc='${wl}'
5450 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5912 if test yes = "$GCC"; then
5913 wlarc='$wl'
5914 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
54515915 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5452 $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5916 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54535917 else
54545918 case `$CC -V 2>&1` in
54555919 *"Compilers 5.0"*)
54565920 wlarc=''
5457 _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5921 _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
54585922 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5459 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5923 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
54605924 ;;
54615925 *)
5462 wlarc='${wl}'
5463 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5926 wlarc='$wl'
5927 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
54645928 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5465 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5929 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54665930 ;;
54675931 esac
54685932 fi
54725936 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
54735937 *)
54745938 # The compiler driver will combine and reorder linker options,
5475 # but understands `-z linker_flag'. GCC discards it without `$wl',
5939 # but understands '-z linker_flag'. GCC discards it without '$wl',
54765940 # but is careful enough not to reorder.
54775941 # Supported since Solaris 2.6 (maybe 2.5.1?)
5478 if test "$GCC" = yes; then
5479 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5942 if test yes = "$GCC"; then
5943 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
54805944 else
54815945 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
54825946 fi
54865950 ;;
54875951
54885952 sunos4*)
5489 if test "x$host_vendor" = xsequent; then
5953 if test sequent = "$host_vendor"; then
54905954 # Use $CC to link under sequent, because it throws in some extra .o
54915955 # files that make .init and .fini sections work.
5492 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5956 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
54935957 else
54945958 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
54955959 fi
55386002 ;;
55396003
55406004 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5541 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6005 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
55426006 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55436007 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55446008 runpath_var='LD_RUN_PATH'
55456009
5546 if test "$GCC" = yes; then
5547 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5548 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6010 if test yes = "$GCC"; then
6011 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6012 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55496013 else
5550 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5551 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6014 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6015 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55526016 fi
55536017 ;;
55546018
55556019 sysv5* | sco3.2v5* | sco5v6*)
5556 # Note: We can NOT use -z defs as we might desire, because we do not
6020 # Note: We CANNOT use -z defs as we might desire, because we do not
55576021 # link with -lc, and that would cause any symbols used from libc to
55586022 # always be unresolved, which means just about no library would
55596023 # ever link correctly. If we're not using GNU ld we use -z text
55606024 # though, which does catch some bad symbols but isn't as heavy-handed
55616025 # as -z defs.
5562 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5563 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6026 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6027 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
55646028 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55656029 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5566 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6030 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
55676031 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55686032 _LT_TAGVAR(link_all_deplibs, $1)=yes
5569 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6033 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
55706034 runpath_var='LD_RUN_PATH'
55716035
5572 if test "$GCC" = yes; then
5573 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5574 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6036 if test yes = "$GCC"; then
6037 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6038 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55756039 else
5576 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5577 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6040 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6041 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55786042 fi
55796043 ;;
55806044
55896053 ;;
55906054 esac
55916055
5592 if test x$host_vendor = xsni; then
6056 if test sni = "$host_vendor"; then
55936057 case $host in
55946058 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5595 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6059 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
55966060 ;;
55976061 esac
55986062 fi
55996063 fi
56006064 ])
56016065 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5602 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6066 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
56036067
56046068 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
56056069
56166080 # Assume -lc should be added
56176081 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56186082
5619 if test "$enable_shared" = yes && test "$GCC" = yes; then
6083 if test yes,yes = "$GCC,$enable_shared"; then
56206084 case $_LT_TAGVAR(archive_cmds, $1) in
56216085 *'~'*)
56226086 # FIXME: we may have to deal with multi-command sequences.
56966160 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
56976161 [Whether we need a single "-rpath" flag with a separated argument])
56986162 _LT_TAGDECL([], [hardcode_direct], [0],
5699 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6163 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
57006164 DIR into the resulting binary])
57016165 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
5702 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6166 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
57036167 DIR into the resulting binary and the resulting library dependency is
5704 "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6168 "absolute", i.e impossible to change by setting $shlibpath_var if the
57056169 library is relocated])
57066170 _LT_TAGDECL([], [hardcode_minus_L], [0],
57076171 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
57426206 # ------------------------
57436207 # Ensure that the configuration variables for a C compiler are suitably
57446208 # defined. These variables are subsequently used by _LT_CONFIG to write
5745 # the compiler configuration to `libtool'.
6209 # the compiler configuration to 'libtool'.
57466210 m4_defun([_LT_LANG_C_CONFIG],
57476211 [m4_require([_LT_DECL_EGREP])dnl
5748 lt_save_CC="$CC"
6212 lt_save_CC=$CC
57496213 AC_LANG_PUSH(C)
57506214
57516215 # Source file extension for C test sources.
57816245 LT_SYS_DLOPEN_SELF
57826246 _LT_CMD_STRIPLIB
57836247
5784 # Report which library types will actually be built
6248 # Report what library types will actually be built
57856249 AC_MSG_CHECKING([if libtool supports shared libraries])
57866250 AC_MSG_RESULT([$can_build_shared])
57876251
57886252 AC_MSG_CHECKING([whether to build shared libraries])
5789 test "$can_build_shared" = "no" && enable_shared=no
6253 test no = "$can_build_shared" && enable_shared=no
57906254
57916255 # On AIX, shared libraries and static libraries use the same namespace, and
57926256 # are all built from PIC.
57936257 case $host_os in
57946258 aix3*)
5795 test "$enable_shared" = yes && enable_static=no
6259 test yes = "$enable_shared" && enable_static=no
57966260 if test -n "$RANLIB"; then
57976261 archive_cmds="$archive_cmds~\$RANLIB \$lib"
57986262 postinstall_cmds='$RANLIB $lib'
58006264 ;;
58016265
58026266 aix[[4-9]]*)
5803 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5804 test "$enable_shared" = yes && enable_static=no
6267 if test ia64 != "$host_cpu"; then
6268 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6269 yes,aix,yes) ;; # shared object as lib.so file only
6270 yes,svr4,*) ;; # shared object as lib.so archive member only
6271 yes,*) enable_static=no ;; # shared object in lib.a archive as well
6272 esac
58056273 fi
58066274 ;;
58076275 esac
58096277
58106278 AC_MSG_CHECKING([whether to build static libraries])
58116279 # Make sure either enable_shared or enable_static is yes.
5812 test "$enable_shared" = yes || enable_static=yes
6280 test yes = "$enable_shared" || enable_static=yes
58136281 AC_MSG_RESULT([$enable_static])
58146282
58156283 _LT_CONFIG($1)
58166284 fi
58176285 AC_LANG_POP
5818 CC="$lt_save_CC"
6286 CC=$lt_save_CC
58196287 ])# _LT_LANG_C_CONFIG
58206288
58216289
58236291 # --------------------------
58246292 # Ensure that the configuration variables for a C++ compiler are suitably
58256293 # defined. These variables are subsequently used by _LT_CONFIG to write
5826 # the compiler configuration to `libtool'.
6294 # the compiler configuration to 'libtool'.
58276295 m4_defun([_LT_LANG_CXX_CONFIG],
58286296 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
58296297 m4_require([_LT_DECL_EGREP])dnl
58306298 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5831 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5832 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5833 (test "X$CXX" != "Xg++"))) ; then
6299 if test -n "$CXX" && ( test no != "$CXX" &&
6300 ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6301 (test g++ != "$CXX"))); then
58346302 AC_PROG_CXXCPP
58356303 else
58366304 _lt_caught_CXX_error=yes
58726340 # the CXX compiler isn't working. Some variables (like enable_shared)
58736341 # are currently assumed to apply to all compilers on this platform,
58746342 # and will be corrupted by setting them based on a non-working compiler.
5875 if test "$_lt_caught_CXX_error" != yes; then
6343 if test yes != "$_lt_caught_CXX_error"; then
58766344 # Code to be used in simple compile tests
58776345 lt_simple_compile_test_code="int some_variable = 0;"
58786346
59146382 if test -n "$compiler"; then
59156383 # We don't want -fno-exception when compiling C++ code, so set the
59166384 # no_builtin_flag separately
5917 if test "$GXX" = yes; then
6385 if test yes = "$GXX"; then
59186386 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
59196387 else
59206388 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
59216389 fi
59226390
5923 if test "$GXX" = yes; then
6391 if test yes = "$GXX"; then
59246392 # Set up default GNU C++ configuration
59256393
59266394 LT_PATH_LD
59276395
59286396 # Check if GNU C++ uses GNU ld as the underlying linker, since the
59296397 # archiving commands below assume that GNU ld is being used.
5930 if test "$with_gnu_ld" = yes; then
5931 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5932 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5933
5934 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5935 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6398 if test yes = "$with_gnu_ld"; then
6399 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6400 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6401
6402 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6403 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
59366404
59376405 # If archive_cmds runs LD, not CC, wlarc should be empty
59386406 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
59396407 # investigate it a little bit more. (MM)
5940 wlarc='${wl}'
6408 wlarc='$wl'
59416409
59426410 # ancient GNU ld didn't support --whole-archive et. al.
59436411 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
59446412 $GREP 'no-whole-archive' > /dev/null; then
5945 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6413 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
59466414 else
59476415 _LT_TAGVAR(whole_archive_flag_spec, $1)=
59486416 fi
59786446 _LT_TAGVAR(ld_shlibs, $1)=no
59796447 ;;
59806448 aix[[4-9]]*)
5981 if test "$host_cpu" = ia64; then
6449 if test ia64 = "$host_cpu"; then
59826450 # On IA64, the linker does run time linking by default, so we don't
59836451 # have to do anything special.
59846452 aix_use_runtimelinking=no
59856453 exp_sym_flag='-Bexport'
5986 no_entry_flag=""
6454 no_entry_flag=
59876455 else
59886456 aix_use_runtimelinking=no
59896457
59906458 # Test if we are trying to use run time linking or normal
59916459 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5992 # need to do runtime linking.
6460 # have runtime linking enabled, and use it for executables.
6461 # For shared libraries, we enable/disable runtime linking
6462 # depending on the kind of the shared library created -
6463 # when "with_aix_soname,aix_use_runtimelinking" is:
6464 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
6465 # "aix,yes" lib.so shared, rtl:yes, for executables
6466 # lib.a static archive
6467 # "both,no" lib.so.V(shr.o) shared, rtl:yes
6468 # lib.a(lib.so.V) shared, rtl:no, for executables
6469 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6470 # lib.a(lib.so.V) shared, rtl:no
6471 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
6472 # lib.a static archive
59936473 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
59946474 for ld_flag in $LDFLAGS; do
59956475 case $ld_flag in
59996479 ;;
60006480 esac
60016481 done
6482 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6483 # With aix-soname=svr4, we create the lib.so.V shared archives only,
6484 # so we don't have lib.a shared libs to link our executables.
6485 # We have to force runtime linking in this case.
6486 aix_use_runtimelinking=yes
6487 LDFLAGS="$LDFLAGS -Wl,-brtl"
6488 fi
60026489 ;;
60036490 esac
60046491
60176504 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60186505 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60196506 _LT_TAGVAR(link_all_deplibs, $1)=yes
6020 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6021
6022 if test "$GXX" = yes; then
6507 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6508 case $with_aix_soname,$aix_use_runtimelinking in
6509 aix,*) ;; # no import file
6510 svr4,* | *,yes) # use import file
6511 # The Import File defines what to hardcode.
6512 _LT_TAGVAR(hardcode_direct, $1)=no
6513 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6514 ;;
6515 esac
6516
6517 if test yes = "$GXX"; then
60236518 case $host_os in aix4.[[012]]|aix4.[[012]].*)
60246519 # We only want to do this on AIX 4.2 and lower, the check
60256520 # below for broken collect2 doesn't work under 4.3+
6026 collect2name=`${CC} -print-prog-name=collect2`
6521 collect2name=`$CC -print-prog-name=collect2`
60276522 if test -f "$collect2name" &&
60286523 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60296524 then
60416536 fi
60426537 esac
60436538 shared_flag='-shared'
6044 if test "$aix_use_runtimelinking" = yes; then
6045 shared_flag="$shared_flag "'${wl}-G'
6539 if test yes = "$aix_use_runtimelinking"; then
6540 shared_flag=$shared_flag' $wl-G'
60466541 fi
6542 # Need to ensure runtime linking is disabled for the traditional
6543 # shared library, or the linker may eventually find shared libraries
6544 # /with/ Import File - we do not want to mix them.
6545 shared_flag_aix='-shared'
6546 shared_flag_svr4='-shared $wl-G'
60476547 else
60486548 # not using gcc
6049 if test "$host_cpu" = ia64; then
6549 if test ia64 = "$host_cpu"; then
60506550 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60516551 # chokes on -Wl,-G. The following line is correct:
60526552 shared_flag='-G'
60536553 else
6054 if test "$aix_use_runtimelinking" = yes; then
6055 shared_flag='${wl}-G'
6554 if test yes = "$aix_use_runtimelinking"; then
6555 shared_flag='$wl-G'
60566556 else
6057 shared_flag='${wl}-bM:SRE'
6557 shared_flag='$wl-bM:SRE'
60586558 fi
6559 shared_flag_aix='$wl-bM:SRE'
6560 shared_flag_svr4='$wl-G'
60596561 fi
60606562 fi
60616563
6062 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6564 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
60636565 # It seems that -bexpall does not export symbols beginning with
60646566 # underscore (_), so it is better to generate a list of symbols to
60656567 # export.
60666568 _LT_TAGVAR(always_export_symbols, $1)=yes
6067 if test "$aix_use_runtimelinking" = yes; then
6569 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
60686570 # Warning - without using the other runtime loading flags (-brtl),
60696571 # -berok will link without error, but may produce a broken library.
6070 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6572 # The "-G" linker flag allows undefined symbols.
6573 _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
60716574 # Determine the default libpath from the value encoded in an empty
60726575 # executable.
60736576 _LT_SYS_MODULE_PATH_AIX([$1])
6074 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6075
6076 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6577 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6578
6579 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
60776580 else
6078 if test "$host_cpu" = ia64; then
6079 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6581 if test ia64 = "$host_cpu"; then
6582 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
60806583 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6081 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
6584 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
60826585 else
60836586 # Determine the default libpath from the value encoded in an
60846587 # empty executable.
60856588 _LT_SYS_MODULE_PATH_AIX([$1])
6086 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6589 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
60876590 # Warning - without using the other run time loading flags,
60886591 # -berok will link without error, but may produce a broken library.
6089 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6090 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6091 if test "$with_gnu_ld" = yes; then
6592 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6593 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6594 if test yes = "$with_gnu_ld"; then
60926595 # We only use this code for GNU lds that support --whole-archive.
6093 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6596 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
60946597 else
60956598 # Exported symbols can be pulled into shared objects from archives
60966599 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
60976600 fi
60986601 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6099 # This is similar to how AIX traditionally builds its shared
6100 # libraries.
6101 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6602 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6603 # -brtl affects multiple linker settings, -berok does not and is overridden later
6604 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6605 if test svr4 != "$with_aix_soname"; then
6606 # This is similar to how AIX traditionally builds its shared
6607 # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6608 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6609 fi
6610 if test aix != "$with_aix_soname"; then
6611 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6612 else
6613 # used by -dlpreopen to get the symbols
6614 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
6615 fi
6616 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
61026617 fi
61036618 fi
61046619 ;;
61086623 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61096624 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
61106625 # support --undefined. This deserves some investigation. FIXME
6111 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6626 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
61126627 else
61136628 _LT_TAGVAR(ld_shlibs, $1)=no
61146629 fi
61366651 # Tell ltmain to make .lib files, not .a files.
61376652 libext=lib
61386653 # Tell ltmain to make .dll files, not .so files.
6139 shrext_cmds=".dll"
6654 shrext_cmds=.dll
61406655 # FIXME: Setting linknames here is a bad hack.
6141 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6142 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6143 $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6144 else
6145 $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6146 fi~
6147 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6148 linknames='
6656 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6657 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6658 cp "$export_symbols" "$output_objdir/$soname.def";
6659 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6660 else
6661 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6662 fi~
6663 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6664 linknames='
61496665 # The linker will not automatically build a static lib if we build a DLL.
61506666 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
61516667 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61526668 # Don't use ranlib
61536669 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
61546670 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6155 lt_tool_outputfile="@TOOL_OUTPUT@"~
6156 case $lt_outputfile in
6157 *.exe|*.EXE) ;;
6158 *)
6159 lt_outputfile="$lt_outputfile.exe"
6160 lt_tool_outputfile="$lt_tool_outputfile.exe"
6161 ;;
6162 esac~
6163 func_to_tool_file "$lt_outputfile"~
6164 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6165 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6166 $RM "$lt_outputfile.manifest";
6167 fi'
6671 lt_tool_outputfile="@TOOL_OUTPUT@"~
6672 case $lt_outputfile in
6673 *.exe|*.EXE) ;;
6674 *)
6675 lt_outputfile=$lt_outputfile.exe
6676 lt_tool_outputfile=$lt_tool_outputfile.exe
6677 ;;
6678 esac~
6679 func_to_tool_file "$lt_outputfile"~
6680 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6681 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6682 $RM "$lt_outputfile.manifest";
6683 fi'
61686684 ;;
61696685 *)
61706686 # g++
61716687 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
61726688 # as there is no search path for DLLs.
61736689 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6174 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6690 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
61756691 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61766692 _LT_TAGVAR(always_export_symbols, $1)=no
61776693 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61786694
61796695 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6180 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6181 # If the export-symbols file already is a .def file (1st line
6182 # is EXPORTS), use it as is; otherwise, prepend...
6183 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6184 cp $export_symbols $output_objdir/$soname.def;
6185 else
6186 echo EXPORTS > $output_objdir/$soname.def;
6187 cat $export_symbols >> $output_objdir/$soname.def;
6188 fi~
6189 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6696 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6697 # If the export-symbols file already is a .def file, use it as
6698 # is; otherwise, prepend EXPORTS...
6699 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6700 cp $export_symbols $output_objdir/$soname.def;
6701 else
6702 echo EXPORTS > $output_objdir/$soname.def;
6703 cat $export_symbols >> $output_objdir/$soname.def;
6704 fi~
6705 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
61906706 else
61916707 _LT_TAGVAR(ld_shlibs, $1)=no
61926708 fi
61956711 ;;
61966712 darwin* | rhapsody*)
61976713 _LT_DARWIN_LINKER_FEATURES($1)
6714 ;;
6715
6716 os2*)
6717 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6718 _LT_TAGVAR(hardcode_minus_L, $1)=yes
6719 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6720 shrext_cmds=.dll
6721 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6722 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6723 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6724 $ECHO EXPORTS >> $output_objdir/$libname.def~
6725 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6726 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6727 emximp -o $lib $output_objdir/$libname.def'
6728 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6729 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6730 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6731 $ECHO EXPORTS >> $output_objdir/$libname.def~
6732 prefix_cmds="$SED"~
6733 if test EXPORTS = "`$SED 1q $export_symbols`"; then
6734 prefix_cmds="$prefix_cmds -e 1d";
6735 fi~
6736 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6737 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6738 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6739 emximp -o $lib $output_objdir/$libname.def'
6740 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6741 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61986742 ;;
61996743
62006744 dgux*)
62316775 _LT_TAGVAR(ld_shlibs, $1)=yes
62326776 ;;
62336777
6234 gnu*)
6235 ;;
6236
62376778 haiku*)
6238 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6779 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
62396780 _LT_TAGVAR(link_all_deplibs, $1)=yes
62406781 ;;
62416782
62426783 hpux9*)
6243 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6784 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
62446785 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6245 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6786 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
62466787 _LT_TAGVAR(hardcode_direct, $1)=yes
62476788 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
62486789 # but as the default
62546795 _LT_TAGVAR(ld_shlibs, $1)=no
62556796 ;;
62566797 aCC*)
6257 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6798 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
62586799 # Commands to make compiler produce verbose output that lists
62596800 # what "hidden" libraries, object files and flags are used when
62606801 # linking a shared library.
62636804 # explicitly linking system object files so we need to strip them
62646805 # from the output so that they don't get included in the library
62656806 # dependencies.
6266 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6807 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
62676808 ;;
62686809 *)
6269 if test "$GXX" = yes; then
6270 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6810 if test yes = "$GXX"; then
6811 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
62716812 else
62726813 # FIXME: insert proper C++ library support
62736814 _LT_TAGVAR(ld_shlibs, $1)=no
62776818 ;;
62786819
62796820 hpux10*|hpux11*)
6280 if test $with_gnu_ld = no; then
6281 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6821 if test no = "$with_gnu_ld"; then
6822 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
62826823 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62836824
62846825 case $host_cpu in
62856826 hppa*64*|ia64*)
62866827 ;;
62876828 *)
6288 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6829 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
62896830 ;;
62906831 esac
62916832 fi
63116852 aCC*)
63126853 case $host_cpu in
63136854 hppa*64*)
6314 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6855 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63156856 ;;
63166857 ia64*)
6317 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6858 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63186859 ;;
63196860 *)
6320 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6861 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63216862 ;;
63226863 esac
63236864 # Commands to make compiler produce verbose output that lists
63286869 # explicitly linking system object files so we need to strip them
63296870 # from the output so that they don't get included in the library
63306871 # dependencies.
6331 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6872 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
63326873 ;;
63336874 *)
6334 if test "$GXX" = yes; then
6335 if test $with_gnu_ld = no; then
6875 if test yes = "$GXX"; then
6876 if test no = "$with_gnu_ld"; then
63366877 case $host_cpu in
63376878 hppa*64*)
6338 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6879 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63396880 ;;
63406881 ia64*)
6341 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6882 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63426883 ;;
63436884 *)
6344 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6885 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63456886 ;;
63466887 esac
63476888 fi
63566897 interix[[3-9]]*)
63576898 _LT_TAGVAR(hardcode_direct, $1)=no
63586899 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6359 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6360 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6900 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6901 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
63616902 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
63626903 # Instead, shared libraries are loaded at an image base (0x10000000 by
63636904 # default) and relocated if they conflict, which is a slow very memory
63646905 # consuming and fragmenting process. To avoid this, we pick a random,
63656906 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
63666907 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
6367 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6368 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6908 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6909 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
63696910 ;;
63706911 irix5* | irix6*)
63716912 case $cc_basename in
63726913 CC*)
63736914 # SGI C++
6374 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6915 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
63756916
63766917 # Archives containing C++ object files must be created using
63776918 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
63806921 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
63816922 ;;
63826923 *)
6383 if test "$GXX" = yes; then
6384 if test "$with_gnu_ld" = no; then
6385 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6924 if test yes = "$GXX"; then
6925 if test no = "$with_gnu_ld"; then
6926 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
63866927 else
6387 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
6928 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
63886929 fi
63896930 fi
63906931 _LT_TAGVAR(link_all_deplibs, $1)=yes
63916932 ;;
63926933 esac
6393 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6934 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
63946935 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63956936 _LT_TAGVAR(inherit_rpath, $1)=yes
63966937 ;;
63976938
6398 linux* | k*bsd*-gnu | kopensolaris*-gnu)
6939 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
63996940 case $cc_basename in
64006941 KCC*)
64016942 # Kuck and Associates, Inc. (KAI) C++ Compiler
64036944 # KCC will only create a shared library if the output file
64046945 # ends with ".so" (or ".sl" for HP-UX), so rename the library
64056946 # to its proper name (with version) after linking.
6406 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6407 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
6947 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6948 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
64086949 # Commands to make compiler produce verbose output that lists
64096950 # what "hidden" libraries, object files and flags are used when
64106951 # linking a shared library.
64136954 # explicitly linking system object files so we need to strip them
64146955 # from the output so that they don't get included in the library
64156956 # dependencies.
6416 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6417
6418 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6419 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6957 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6958
6959 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6960 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
64206961
64216962 # Archives containing C++ object files must be created using
64226963 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
64306971 # earlier do not add the objects themselves.
64316972 case `$CC -V 2>&1` in
64326973 *"Version 7."*)
6433 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6434 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6974 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6975 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
64356976 ;;
64366977 *) # Version 8.0 or newer
64376978 tmp_idyn=
64386979 case $host_cpu in
64396980 ia64*) tmp_idyn=' -i_dynamic';;
64406981 esac
6441 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6442 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6982 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6983 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
64436984 ;;
64446985 esac
64456986 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6446 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6447 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6448 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6987 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6988 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6989 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
64496990 ;;
64506991 pgCC* | pgcpp*)
64516992 # Portland Group C++ compiler
64526993 case `$CC -V` in
64536994 *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
64546995 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6455 rm -rf $tpldir~
6456 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6457 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6996 rm -rf $tpldir~
6997 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6998 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
64586999 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6459 rm -rf $tpldir~
6460 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6461 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6462 $RANLIB $oldlib'
7000 rm -rf $tpldir~
7001 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7002 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7003 $RANLIB $oldlib'
64637004 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6464 rm -rf $tpldir~
6465 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6466 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7005 rm -rf $tpldir~
7006 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7007 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
64677008 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6468 rm -rf $tpldir~
6469 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6470 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
7009 rm -rf $tpldir~
7010 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7011 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
64717012 ;;
64727013 *) # Version 6 and above use weak symbols
6473 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6474 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
7014 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7015 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
64757016 ;;
64767017 esac
64777018
6478 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6479 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6480 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
7019 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7020 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7021 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
64817022 ;;
64827023 cxx*)
64837024 # Compaq C++
6484 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6485 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
7025 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7026 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
64867027
64877028 runpath_var=LD_RUN_PATH
64887029 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
64967037 # explicitly linking system object files so we need to strip them
64977038 # from the output so that they don't get included in the library
64987039 # dependencies.
6499 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
7040 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
65007041 ;;
65017042 xl* | mpixl* | bgxl*)
65027043 # IBM XL 8.0 on PPC, with GNU ld
6503 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6504 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6505 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6506 if test "x$supports_anon_versioning" = xyes; then
7044 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7045 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7046 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7047 if test yes = "$supports_anon_versioning"; then
65077048 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6508 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6509 echo "local: *; };" >> $output_objdir/$libname.ver~
6510 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7049 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7050 echo "local: *; };" >> $output_objdir/$libname.ver~
7051 $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
65117052 fi
65127053 ;;
65137054 *)
65157056 *Sun\ C*)
65167057 # Sun C++ 5.9
65177058 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6518 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6519 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
7059 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7060 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
65207061 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6521 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
7062 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
65227063 _LT_TAGVAR(compiler_needs_object, $1)=yes
65237064
65247065 # Not sure whether something based on
65767117 _LT_TAGVAR(ld_shlibs, $1)=yes
65777118 ;;
65787119
6579 openbsd2*)
6580 # C++ shared libraries are fairly broken
6581 _LT_TAGVAR(ld_shlibs, $1)=no
6582 ;;
6583
6584 openbsd*)
7120 openbsd* | bitrig*)
65857121 if test -f /usr/libexec/ld.so; then
65867122 _LT_TAGVAR(hardcode_direct, $1)=yes
65877123 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65887124 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65897125 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6590 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6591 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6592 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6593 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6594 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7126 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7127 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7128 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
7129 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7130 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
65957131 fi
65967132 output_verbose_link_cmd=func_echo_all
65977133 else
66077143 # KCC will only create a shared library if the output file
66087144 # ends with ".so" (or ".sl" for HP-UX), so rename the library
66097145 # to its proper name (with version) after linking.
6610 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6611
6612 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7146 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7147
7148 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
66137149 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66147150
66157151 # Archives containing C++ object files must be created using
66277163 cxx*)
66287164 case $host in
66297165 osf3*)
6630 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6631 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6632 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7166 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7167 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7168 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
66337169 ;;
66347170 *)
66357171 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6636 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7172 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
66377173 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6638 echo "-hidden">> $lib.exp~
6639 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
6640 $RM $lib.exp'
7174 echo "-hidden">> $lib.exp~
7175 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
7176 $RM $lib.exp'
66417177 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
66427178 ;;
66437179 esac
66527188 # explicitly linking system object files so we need to strip them
66537189 # from the output so that they don't get included in the library
66547190 # dependencies.
6655 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7191 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
66567192 ;;
66577193 *)
6658 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6659 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7194 if test yes,no = "$GXX,$with_gnu_ld"; then
7195 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
66607196 case $host in
66617197 osf3*)
6662 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7198 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
66637199 ;;
66647200 *)
6665 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7201 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
66667202 ;;
66677203 esac
66687204
6669 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7205 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
66707206 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66717207
66727208 # Commands to make compiler produce verbose output that lists
67127248 # Sun C++ 4.2, 5.x and Centerline C++
67137249 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
67147250 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6715 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7251 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
67167252 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6717 $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7253 $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
67187254
67197255 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
67207256 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67227258 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67237259 *)
67247260 # The compiler driver will combine and reorder linker options,
6725 # but understands `-z linker_flag'.
7261 # but understands '-z linker_flag'.
67267262 # Supported since Solaris 2.6 (maybe 2.5.1?)
67277263 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
67287264 ;;
67397275 ;;
67407276 gcx*)
67417277 # Green Hills C++ Compiler
6742 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7278 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
67437279
67447280 # The C++ compiler must be used to create the archive.
67457281 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67467282 ;;
67477283 *)
67487284 # GNU C++ compiler with Solaris linker
6749 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6750 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7285 if test yes,no = "$GXX,$with_gnu_ld"; then
7286 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
67517287 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6752 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7288 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
67537289 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6754 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7290 $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
67557291
67567292 # Commands to make compiler produce verbose output that lists
67577293 # what "hidden" libraries, object files and flags are used when
67587294 # linking a shared library.
67597295 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67607296 else
6761 # g++ 2.7 appears to require `-G' NOT `-shared' on this
7297 # g++ 2.7 appears to require '-G' NOT '-shared' on this
67627298 # platform.
6763 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7299 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
67647300 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6765 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7301 $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
67667302
67677303 # Commands to make compiler produce verbose output that lists
67687304 # what "hidden" libraries, object files and flags are used when
67707306 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67717307 fi
67727308
6773 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7309 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
67747310 case $host_os in
67757311 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67767312 *)
6777 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7313 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
67787314 ;;
67797315 esac
67807316 fi
67837319 ;;
67847320
67857321 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6786 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7322 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
67877323 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67887324 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67897325 runpath_var='LD_RUN_PATH'
67907326
67917327 case $cc_basename in
67927328 CC*)
6793 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6794 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7329 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7330 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67957331 ;;
67967332 *)
6797 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6798 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7333 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7334 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67997335 ;;
68007336 esac
68017337 ;;
68027338
68037339 sysv5* | sco3.2v5* | sco5v6*)
6804 # Note: We can NOT use -z defs as we might desire, because we do not
7340 # Note: We CANNOT use -z defs as we might desire, because we do not
68057341 # link with -lc, and that would cause any symbols used from libc to
68067342 # always be unresolved, which means just about no library would
68077343 # ever link correctly. If we're not using GNU ld we use -z text
68087344 # though, which does catch some bad symbols but isn't as heavy-handed
68097345 # as -z defs.
6810 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6811 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7346 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7347 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
68127348 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
68137349 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6814 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7350 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
68157351 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
68167352 _LT_TAGVAR(link_all_deplibs, $1)=yes
6817 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7353 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
68187354 runpath_var='LD_RUN_PATH'
68197355
68207356 case $cc_basename in
68217357 CC*)
6822 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6823 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7358 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7359 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68247360 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6825 '"$_LT_TAGVAR(old_archive_cmds, $1)"
7361 '"$_LT_TAGVAR(old_archive_cmds, $1)"
68267362 _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6827 '"$_LT_TAGVAR(reload_cmds, $1)"
7363 '"$_LT_TAGVAR(reload_cmds, $1)"
68287364 ;;
68297365 *)
6830 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6831 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7366 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7367 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68327368 ;;
68337369 esac
68347370 ;;
68597395 esac
68607396
68617397 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6862 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6863
6864 _LT_TAGVAR(GCC, $1)="$GXX"
6865 _LT_TAGVAR(LD, $1)="$LD"
7398 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7399
7400 _LT_TAGVAR(GCC, $1)=$GXX
7401 _LT_TAGVAR(LD, $1)=$LD
68667402
68677403 ## CAVEAT EMPTOR:
68687404 ## There is no encapsulation within the following macros, do not change
68897425 lt_cv_path_LD=$lt_save_path_LD
68907426 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
68917427 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6892 fi # test "$_lt_caught_CXX_error" != yes
7428 fi # test yes != "$_lt_caught_CXX_error"
68937429
68947430 AC_LANG_POP
68957431 ])# _LT_LANG_CXX_CONFIG
69117447 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
69127448 func_stripname_cnf ()
69137449 {
6914 case ${2} in
6915 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6916 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7450 case @S|@2 in
7451 .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7452 *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
69177453 esac
69187454 } # func_stripname_cnf
69197455 ])# _LT_FUNC_STRIPNAME_CNF
7456
69207457
69217458 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
69227459 # ---------------------------------
70017538 pre_test_object_deps_done=no
70027539
70037540 for p in `eval "$output_verbose_link_cmd"`; do
7004 case ${prev}${p} in
7541 case $prev$p in
70057542
70067543 -L* | -R* | -l*)
70077544 # Some compilers place space between "-{L,R}" and the path.
70087545 # Remove the space.
7009 if test $p = "-L" ||
7010 test $p = "-R"; then
7546 if test x-L = "$p" ||
7547 test x-R = "$p"; then
70117548 prev=$p
70127549 continue
70137550 fi
70237560 case $p in
70247561 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
70257562 esac
7026 if test "$pre_test_object_deps_done" = no; then
7027 case ${prev} in
7563 if test no = "$pre_test_object_deps_done"; then
7564 case $prev in
70287565 -L | -R)
70297566 # Internal compiler library paths should come after those
70307567 # provided the user. The postdeps already come after the
70317568 # user supplied libs so there is no need to process them.
70327569 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7033 _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7570 _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
70347571 else
7035 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7572 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
70367573 fi
70377574 ;;
70387575 # The "-l" case would never come before the object being
70407577 esac
70417578 else
70427579 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7043 _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7580 _LT_TAGVAR(postdeps, $1)=$prev$p
70447581 else
7045 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7582 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
70467583 fi
70477584 fi
70487585 prev=
70577594 continue
70587595 fi
70597596
7060 if test "$pre_test_object_deps_done" = no; then
7597 if test no = "$pre_test_object_deps_done"; then
70617598 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7062 _LT_TAGVAR(predep_objects, $1)="$p"
7599 _LT_TAGVAR(predep_objects, $1)=$p
70637600 else
70647601 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
70657602 fi
70667603 else
70677604 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7068 _LT_TAGVAR(postdep_objects, $1)="$p"
7605 _LT_TAGVAR(postdep_objects, $1)=$p
70697606 else
70707607 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
70717608 fi
70967633 _LT_TAGVAR(postdep_objects,$1)=
70977634 _LT_TAGVAR(postdeps,$1)=
70987635 ;;
7099
7100 linux*)
7101 case `$CC -V 2>&1 | sed 5q` in
7102 *Sun\ C*)
7103 # Sun C++ 5.9
7104
7105 # The more standards-conforming stlport4 library is
7106 # incompatible with the Cstd library. Avoid specifying
7107 # it if it's in CXXFLAGS. Ignore libCrun as
7108 # -library=stlport4 depends on it.
7109 case " $CXX $CXXFLAGS " in
7110 *" -library=stlport4 "*)
7111 solaris_use_stlport4=yes
7112 ;;
7113 esac
7114
7115 if test "$solaris_use_stlport4" != yes; then
7116 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7117 fi
7118 ;;
7119 esac
7120 ;;
7121
7122 solaris*)
7123 case $cc_basename in
7124 CC* | sunCC*)
7125 # The more standards-conforming stlport4 library is
7126 # incompatible with the Cstd library. Avoid specifying
7127 # it if it's in CXXFLAGS. Ignore libCrun as
7128 # -library=stlport4 depends on it.
7129 case " $CXX $CXXFLAGS " in
7130 *" -library=stlport4 "*)
7131 solaris_use_stlport4=yes
7132 ;;
7133 esac
7134
7135 # Adding this requires a known-good setup of shared libraries for
7136 # Sun compiler versions before 5.6, else PIC objects from an old
7137 # archive will be linked into the output, leading to subtle bugs.
7138 if test "$solaris_use_stlport4" != yes; then
7139 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7140 fi
7141 ;;
7142 esac
7143 ;;
71447636 esac
71457637 ])
71467638
71497641 esac
71507642 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
71517643 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7152 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7644 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
71537645 fi
71547646 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
71557647 [The directories searched by this compiler when creating a shared library])
71697661 # --------------------------
71707662 # Ensure that the configuration variables for a Fortran 77 compiler are
71717663 # suitably defined. These variables are subsequently used by _LT_CONFIG
7172 # to write the compiler configuration to `libtool'.
7664 # to write the compiler configuration to 'libtool'.
71737665 m4_defun([_LT_LANG_F77_CONFIG],
71747666 [AC_LANG_PUSH(Fortran 77)
7175 if test -z "$F77" || test "X$F77" = "Xno"; then
7667 if test -z "$F77" || test no = "$F77"; then
71767668 _lt_disable_F77=yes
71777669 fi
71787670
72097701 # the F77 compiler isn't working. Some variables (like enable_shared)
72107702 # are currently assumed to apply to all compilers on this platform,
72117703 # and will be corrupted by setting them based on a non-working compiler.
7212 if test "$_lt_disable_F77" != yes; then
7704 if test yes != "$_lt_disable_F77"; then
72137705 # Code to be used in simple compile tests
72147706 lt_simple_compile_test_code="\
72157707 subroutine t
72317723 _LT_LINKER_BOILERPLATE
72327724
72337725 # Allow CC to be a program name with arguments.
7234 lt_save_CC="$CC"
7726 lt_save_CC=$CC
72357727 lt_save_GCC=$GCC
72367728 lt_save_CFLAGS=$CFLAGS
72377729 CC=${F77-"f77"}
72457737 AC_MSG_RESULT([$can_build_shared])
72467738
72477739 AC_MSG_CHECKING([whether to build shared libraries])
7248 test "$can_build_shared" = "no" && enable_shared=no
7740 test no = "$can_build_shared" && enable_shared=no
72497741
72507742 # On AIX, shared libraries and static libraries use the same namespace, and
72517743 # are all built from PIC.
72527744 case $host_os in
72537745 aix3*)
7254 test "$enable_shared" = yes && enable_static=no
7746 test yes = "$enable_shared" && enable_static=no
72557747 if test -n "$RANLIB"; then
72567748 archive_cmds="$archive_cmds~\$RANLIB \$lib"
72577749 postinstall_cmds='$RANLIB $lib'
72587750 fi
72597751 ;;
72607752 aix[[4-9]]*)
7261 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7262 test "$enable_shared" = yes && enable_static=no
7753 if test ia64 != "$host_cpu"; then
7754 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7755 yes,aix,yes) ;; # shared object as lib.so file only
7756 yes,svr4,*) ;; # shared object as lib.so archive member only
7757 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7758 esac
72637759 fi
72647760 ;;
72657761 esac
72677763
72687764 AC_MSG_CHECKING([whether to build static libraries])
72697765 # Make sure either enable_shared or enable_static is yes.
7270 test "$enable_shared" = yes || enable_static=yes
7766 test yes = "$enable_shared" || enable_static=yes
72717767 AC_MSG_RESULT([$enable_static])
72727768
7273 _LT_TAGVAR(GCC, $1)="$G77"
7274 _LT_TAGVAR(LD, $1)="$LD"
7769 _LT_TAGVAR(GCC, $1)=$G77
7770 _LT_TAGVAR(LD, $1)=$LD
72757771
72767772 ## CAVEAT EMPTOR:
72777773 ## There is no encapsulation within the following macros, do not change
72887784 fi # test -n "$compiler"
72897785
72907786 GCC=$lt_save_GCC
7291 CC="$lt_save_CC"
7292 CFLAGS="$lt_save_CFLAGS"
7293 fi # test "$_lt_disable_F77" != yes
7787 CC=$lt_save_CC
7788 CFLAGS=$lt_save_CFLAGS
7789 fi # test yes != "$_lt_disable_F77"
72947790
72957791 AC_LANG_POP
72967792 ])# _LT_LANG_F77_CONFIG
73007796 # -------------------------
73017797 # Ensure that the configuration variables for a Fortran compiler are
73027798 # suitably defined. These variables are subsequently used by _LT_CONFIG
7303 # to write the compiler configuration to `libtool'.
7799 # to write the compiler configuration to 'libtool'.
73047800 m4_defun([_LT_LANG_FC_CONFIG],
73057801 [AC_LANG_PUSH(Fortran)
73067802
7307 if test -z "$FC" || test "X$FC" = "Xno"; then
7803 if test -z "$FC" || test no = "$FC"; then
73087804 _lt_disable_FC=yes
73097805 fi
73107806
73417837 # the FC compiler isn't working. Some variables (like enable_shared)
73427838 # are currently assumed to apply to all compilers on this platform,
73437839 # and will be corrupted by setting them based on a non-working compiler.
7344 if test "$_lt_disable_FC" != yes; then
7840 if test yes != "$_lt_disable_FC"; then
73457841 # Code to be used in simple compile tests
73467842 lt_simple_compile_test_code="\
73477843 subroutine t
73637859 _LT_LINKER_BOILERPLATE
73647860
73657861 # Allow CC to be a program name with arguments.
7366 lt_save_CC="$CC"
7862 lt_save_CC=$CC
73677863 lt_save_GCC=$GCC
73687864 lt_save_CFLAGS=$CFLAGS
73697865 CC=${FC-"f95"}
73797875 AC_MSG_RESULT([$can_build_shared])
73807876
73817877 AC_MSG_CHECKING([whether to build shared libraries])
7382 test "$can_build_shared" = "no" && enable_shared=no
7878 test no = "$can_build_shared" && enable_shared=no
73837879
73847880 # On AIX, shared libraries and static libraries use the same namespace, and
73857881 # are all built from PIC.
73867882 case $host_os in
73877883 aix3*)
7388 test "$enable_shared" = yes && enable_static=no
7884 test yes = "$enable_shared" && enable_static=no
73897885 if test -n "$RANLIB"; then
73907886 archive_cmds="$archive_cmds~\$RANLIB \$lib"
73917887 postinstall_cmds='$RANLIB $lib'
73927888 fi
73937889 ;;
73947890 aix[[4-9]]*)
7395 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7396 test "$enable_shared" = yes && enable_static=no
7891 if test ia64 != "$host_cpu"; then
7892 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7893 yes,aix,yes) ;; # shared object as lib.so file only
7894 yes,svr4,*) ;; # shared object as lib.so archive member only
7895 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7896 esac
73977897 fi
73987898 ;;
73997899 esac
74017901
74027902 AC_MSG_CHECKING([whether to build static libraries])
74037903 # Make sure either enable_shared or enable_static is yes.
7404 test "$enable_shared" = yes || enable_static=yes
7904 test yes = "$enable_shared" || enable_static=yes
74057905 AC_MSG_RESULT([$enable_static])
74067906
7407 _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7408 _LT_TAGVAR(LD, $1)="$LD"
7907 _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7908 _LT_TAGVAR(LD, $1)=$LD
74097909
74107910 ## CAVEAT EMPTOR:
74117911 ## There is no encapsulation within the following macros, do not change
74257925 GCC=$lt_save_GCC
74267926 CC=$lt_save_CC
74277927 CFLAGS=$lt_save_CFLAGS
7428 fi # test "$_lt_disable_FC" != yes
7928 fi # test yes != "$_lt_disable_FC"
74297929
74307930 AC_LANG_POP
74317931 ])# _LT_LANG_FC_CONFIG
74357935 # --------------------------
74367936 # Ensure that the configuration variables for the GNU Java Compiler compiler
74377937 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7438 # to write the compiler configuration to `libtool'.
7938 # to write the compiler configuration to 'libtool'.
74397939 m4_defun([_LT_LANG_GCJ_CONFIG],
74407940 [AC_REQUIRE([LT_PROG_GCJ])dnl
74417941 AC_LANG_SAVE
74697969 CFLAGS=$GCJFLAGS
74707970 compiler=$CC
74717971 _LT_TAGVAR(compiler, $1)=$CC
7472 _LT_TAGVAR(LD, $1)="$LD"
7972 _LT_TAGVAR(LD, $1)=$LD
74737973 _LT_CC_BASENAME([$compiler])
74747974
74757975 # GCJ did not exist at the time GCC didn't implicitly link libc in.
75028002 # --------------------------
75038003 # Ensure that the configuration variables for the GNU Go compiler
75048004 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7505 # to write the compiler configuration to `libtool'.
8005 # to write the compiler configuration to 'libtool'.
75068006 m4_defun([_LT_LANG_GO_CONFIG],
75078007 [AC_REQUIRE([LT_PROG_GO])dnl
75088008 AC_LANG_SAVE
75368036 CFLAGS=$GOFLAGS
75378037 compiler=$CC
75388038 _LT_TAGVAR(compiler, $1)=$CC
7539 _LT_TAGVAR(LD, $1)="$LD"
8039 _LT_TAGVAR(LD, $1)=$LD
75408040 _LT_CC_BASENAME([$compiler])
75418041
75428042 # Go did not exist at the time GCC didn't implicitly link libc in.
75698069 # -------------------------
75708070 # Ensure that the configuration variables for the Windows resource compiler
75718071 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7572 # to write the compiler configuration to `libtool'.
8072 # to write the compiler configuration to 'libtool'.
75738073 m4_defun([_LT_LANG_RC_CONFIG],
75748074 [AC_REQUIRE([LT_PROG_RC])dnl
75758075 AC_LANG_SAVE
75858085 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
75868086
75878087 # Code to be used in simple link tests
7588 lt_simple_link_test_code="$lt_simple_compile_test_code"
8088 lt_simple_link_test_code=$lt_simple_compile_test_code
75898089
75908090 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
75918091 _LT_TAG_COMPILER
75958095 _LT_LINKER_BOILERPLATE
75968096
75978097 # Allow CC to be a program name with arguments.
7598 lt_save_CC="$CC"
8098 lt_save_CC=$CC
75998099 lt_save_CFLAGS=$CFLAGS
76008100 lt_save_GCC=$GCC
76018101 GCC=
76248124 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
76258125 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
76268126 [AC_CHECK_TOOL(GCJ, gcj,)
7627 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8127 test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
76288128 AC_SUBST(GCJFLAGS)])])[]dnl
76298129 ])
76308130
77338233 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
77348234 # along with /bin/sed that truncates output.
77358235 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7736 test ! -f $lt_ac_sed && continue
8236 test ! -f "$lt_ac_sed" && continue
77378237 cat /dev/null > conftest.in
77388238 lt_ac_count=0
77398239 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
77508250 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
77518251 cmp -s conftest.out conftest.nl || break
77528252 # 10000 chars as input seems more than enough
7753 test $lt_ac_count -gt 10 && break
8253 test 10 -lt "$lt_ac_count" && break
77548254 lt_ac_count=`expr $lt_ac_count + 1`
7755 if test $lt_ac_count -gt $lt_ac_max; then
8255 if test "$lt_ac_count" -gt "$lt_ac_max"; then
77568256 lt_ac_max=$lt_ac_count
77578257 lt_cv_path_SED=$lt_ac_sed
77588258 fi
77768276 # Find out whether the shell is Bourne or XSI compatible,
77778277 # or has some other useful features.
77788278 m4_defun([_LT_CHECK_SHELL_FEATURES],
7779 [AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7780 # Try some XSI features
7781 xsi_shell=no
7782 ( _lt_dummy="a/b/c"
7783 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7784 = c,a/b,b/c, \
7785 && eval 'test $(( 1 + 1 )) -eq 2 \
7786 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7787 && xsi_shell=yes
7788 AC_MSG_RESULT([$xsi_shell])
7789 _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7790
7791 AC_MSG_CHECKING([whether the shell understands "+="])
7792 lt_shell_append=no
7793 ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7794 >/dev/null 2>&1 \
7795 && lt_shell_append=yes
7796 AC_MSG_RESULT([$lt_shell_append])
7797 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7798
7799 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8279 [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
78008280 lt_unset=unset
78018281 else
78028282 lt_unset=false
78208300 ])# _LT_CHECK_SHELL_FEATURES
78218301
78228302
7823 # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7824 # ------------------------------------------------------
7825 # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7826 # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7827 m4_defun([_LT_PROG_FUNCTION_REPLACE],
7828 [dnl {
7829 sed -e '/^$1 ()$/,/^} # $1 /c\
7830 $1 ()\
7831 {\
7832 m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
7833 } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7834 && mv -f "$cfgfile.tmp" "$cfgfile" \
7835 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7836 test 0 -eq $? || _lt_function_replace_fail=:
7837 ])
7838
7839
7840 # _LT_PROG_REPLACE_SHELLFNS
7841 # -------------------------
7842 # Replace existing portable implementations of several shell functions with
7843 # equivalent extended shell implementations where those features are available..
7844 m4_defun([_LT_PROG_REPLACE_SHELLFNS],
7845 [if test x"$xsi_shell" = xyes; then
7846 _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7847 case ${1} in
7848 */*) func_dirname_result="${1%/*}${2}" ;;
7849 * ) func_dirname_result="${3}" ;;
7850 esac])
7851
7852 _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7853 func_basename_result="${1##*/}"])
7854
7855 _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7856 case ${1} in
7857 */*) func_dirname_result="${1%/*}${2}" ;;
7858 * ) func_dirname_result="${3}" ;;
7859 esac
7860 func_basename_result="${1##*/}"])
7861
7862 _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7863 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7864 # positional parameters, so assign one to ordinary parameter first.
7865 func_stripname_result=${3}
7866 func_stripname_result=${func_stripname_result#"${1}"}
7867 func_stripname_result=${func_stripname_result%"${2}"}])
7868
7869 _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7870 func_split_long_opt_name=${1%%=*}
7871 func_split_long_opt_arg=${1#*=}])
7872
7873 _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7874 func_split_short_opt_arg=${1#??}
7875 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7876
7877 _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7878 case ${1} in
7879 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7880 *) func_lo2o_result=${1} ;;
7881 esac])
7882
7883 _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
7884
7885 _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
7886
7887 _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
7888 fi
7889
7890 if test x"$lt_shell_append" = xyes; then
7891 _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
7892
7893 _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7894 func_quote_for_eval "${2}"
7895 dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7896 eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7897
7898 # Save a `func_append' function call where possible by direct use of '+='
7899 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7900 && mv -f "$cfgfile.tmp" "$cfgfile" \
7901 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7902 test 0 -eq $? || _lt_function_replace_fail=:
7903 else
7904 # Save a `func_append' function call even when '+=' is not available
7905 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7906 && mv -f "$cfgfile.tmp" "$cfgfile" \
7907 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7908 test 0 -eq $? || _lt_function_replace_fail=:
7909 fi
7910
7911 if test x"$_lt_function_replace_fail" = x":"; then
7912 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7913 fi
7914 ])
7915
79168303 # _LT_PATH_CONVERSION_FUNCTIONS
79178304 # -----------------------------
7918 # Determine which file name conversion functions should be used by
8305 # Determine what file name conversion functions should be used by
79198306 # func_to_host_file (and, implicitly, by func_to_host_path). These are needed
79208307 # for certain cross-compile configurations and native mingw.
79218308 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
79828369
79838370 # Helper functions for option handling. -*- Autoconf -*-
79848371 #
7985 # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
7986 # Inc.
8372 # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
8373 # Foundation, Inc.
79878374 # Written by Gary V. Vaughan, 2004
79888375 #
79898376 # This file is free software; the Free Software Foundation gives
79908377 # unlimited permission to copy and/or distribute it, with or without
79918378 # modifications, as long as this notice is preserved.
79928379
7993 # serial 7 ltoptions.m4
8380 # serial 8 ltoptions.m4
79948381
79958382 # This is to help aclocal find these macros, as it can't see m4_define.
79968383 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
80118398 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
80128399 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
80138400 _LT_MANGLE_DEFUN([$1], [$2]),
8014 [m4_warning([Unknown $1 option `$2'])])[]dnl
8401 [m4_warning([Unknown $1 option '$2'])])[]dnl
80158402 ])
80168403
80178404
80578444 dnl
80588445 dnl If no reference was made to various pairs of opposing options, then
80598446 dnl we run the default mode handler for the pair. For example, if neither
8060 dnl `shared' nor `disable-shared' was passed, we enable building of shared
8447 dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
80618448 dnl archives by default:
80628449 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80638450 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
80648451 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
80658452 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8066 [_LT_ENABLE_FAST_INSTALL])
8453 [_LT_ENABLE_FAST_INSTALL])
8454 _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8455 [_LT_WITH_AIX_SONAME([aix])])
80678456 ])
80688457 ])# _LT_SET_OPTIONS
80698458
80918480 [_LT_SET_OPTION([LT_INIT], [dlopen])
80928481 AC_DIAGNOSE([obsolete],
80938482 [$0: Remove this warning and the call to _LT_SET_OPTION when you
8094 put the `dlopen' option into LT_INIT's first parameter.])
8483 put the 'dlopen' option into LT_INIT's first parameter.])
80958484 ])
80968485
80978486 dnl aclocal-1.4 backwards compatibility:
81278516 _LT_SET_OPTION([LT_INIT], [win32-dll])
81288517 AC_DIAGNOSE([obsolete],
81298518 [$0: Remove this warning and the call to _LT_SET_OPTION when you
8130 put the `win32-dll' option into LT_INIT's first parameter.])
8519 put the 'win32-dll' option into LT_INIT's first parameter.])
81318520 ])
81328521
81338522 dnl aclocal-1.4 backwards compatibility:
81368525
81378526 # _LT_ENABLE_SHARED([DEFAULT])
81388527 # ----------------------------
8139 # implement the --enable-shared flag, and supports the `shared' and
8140 # `disable-shared' LT_INIT options.
8141 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8528 # implement the --enable-shared flag, and supports the 'shared' and
8529 # 'disable-shared' LT_INIT options.
8530 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
81428531 m4_define([_LT_ENABLE_SHARED],
81438532 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
81448533 AC_ARG_ENABLE([shared],
81518540 *)
81528541 enable_shared=no
81538542 # Look at the argument we got. We use all the common list separators.
8154 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8543 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
81558544 for pkg in $enableval; do
8156 IFS="$lt_save_ifs"
8545 IFS=$lt_save_ifs
81578546 if test "X$pkg" = "X$p"; then
81588547 enable_shared=yes
81598548 fi
81608549 done
8161 IFS="$lt_save_ifs"
8550 IFS=$lt_save_ifs
81628551 ;;
81638552 esac],
81648553 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
81908579
81918580 # _LT_ENABLE_STATIC([DEFAULT])
81928581 # ----------------------------
8193 # implement the --enable-static flag, and support the `static' and
8194 # `disable-static' LT_INIT options.
8195 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8582 # implement the --enable-static flag, and support the 'static' and
8583 # 'disable-static' LT_INIT options.
8584 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
81968585 m4_define([_LT_ENABLE_STATIC],
81978586 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
81988587 AC_ARG_ENABLE([static],
82058594 *)
82068595 enable_static=no
82078596 # Look at the argument we got. We use all the common list separators.
8208 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8597 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
82098598 for pkg in $enableval; do
8210 IFS="$lt_save_ifs"
8599 IFS=$lt_save_ifs
82118600 if test "X$pkg" = "X$p"; then
82128601 enable_static=yes
82138602 fi
82148603 done
8215 IFS="$lt_save_ifs"
8604 IFS=$lt_save_ifs
82168605 ;;
82178606 esac],
82188607 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
82448633
82458634 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
82468635 # ----------------------------------
8247 # implement the --enable-fast-install flag, and support the `fast-install'
8248 # and `disable-fast-install' LT_INIT options.
8249 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8636 # implement the --enable-fast-install flag, and support the 'fast-install'
8637 # and 'disable-fast-install' LT_INIT options.
8638 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
82508639 m4_define([_LT_ENABLE_FAST_INSTALL],
82518640 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
82528641 AC_ARG_ENABLE([fast-install],
82598648 *)
82608649 enable_fast_install=no
82618650 # Look at the argument we got. We use all the common list separators.
8262 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8651 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
82638652 for pkg in $enableval; do
8264 IFS="$lt_save_ifs"
8653 IFS=$lt_save_ifs
82658654 if test "X$pkg" = "X$p"; then
82668655 enable_fast_install=yes
82678656 fi
82688657 done
8269 IFS="$lt_save_ifs"
8658 IFS=$lt_save_ifs
82708659 ;;
82718660 esac],
82728661 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
82838672 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
82848673 AC_DIAGNOSE([obsolete],
82858674 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
8286 the `fast-install' option into LT_INIT's first parameter.])
8675 the 'fast-install' option into LT_INIT's first parameter.])
82878676 ])
82888677
82898678 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
82908679 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
82918680 AC_DIAGNOSE([obsolete],
82928681 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
8293 the `disable-fast-install' option into LT_INIT's first parameter.])
8682 the 'disable-fast-install' option into LT_INIT's first parameter.])
82948683 ])
82958684
82968685 dnl aclocal-1.4 backwards compatibility:
82988687 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
82998688
83008689
8690 # _LT_WITH_AIX_SONAME([DEFAULT])
8691 # ----------------------------------
8692 # implement the --with-aix-soname flag, and support the `aix-soname=aix'
8693 # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8694 # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
8695 m4_define([_LT_WITH_AIX_SONAME],
8696 [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8697 shared_archive_member_spec=
8698 case $host,$enable_shared in
8699 power*-*-aix[[5-9]]*,yes)
8700 AC_MSG_CHECKING([which variant of shared library versioning to provide])
8701 AC_ARG_WITH([aix-soname],
8702 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8703 [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8704 [case $withval in
8705 aix|svr4|both)
8706 ;;
8707 *)
8708 AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8709 ;;
8710 esac
8711 lt_cv_with_aix_soname=$with_aix_soname],
8712 [AC_CACHE_VAL([lt_cv_with_aix_soname],
8713 [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8714 with_aix_soname=$lt_cv_with_aix_soname])
8715 AC_MSG_RESULT([$with_aix_soname])
8716 if test aix != "$with_aix_soname"; then
8717 # For the AIX way of multilib, we name the shared archive member
8718 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8719 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8720 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8721 # the AIX toolchain works better with OBJECT_MODE set (default 32).
8722 if test 64 = "${OBJECT_MODE-32}"; then
8723 shared_archive_member_spec=shr_64
8724 else
8725 shared_archive_member_spec=shr
8726 fi
8727 fi
8728 ;;
8729 *)
8730 with_aix_soname=aix
8731 ;;
8732 esac
8733
8734 _LT_DECL([], [shared_archive_member_spec], [0],
8735 [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8736 ])# _LT_WITH_AIX_SONAME
8737
8738 LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8739 LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8740 LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8741
8742
83018743 # _LT_WITH_PIC([MODE])
83028744 # --------------------
8303 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
8745 # implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
83048746 # LT_INIT options.
8305 # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
8747 # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
83068748 m4_define([_LT_WITH_PIC],
83078749 [AC_ARG_WITH([pic],
83088750 [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
83138755 *)
83148756 pic_mode=default
83158757 # Look at the argument we got. We use all the common list separators.
8316 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8758 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
83178759 for lt_pkg in $withval; do
8318 IFS="$lt_save_ifs"
8760 IFS=$lt_save_ifs
83198761 if test "X$lt_pkg" = "X$lt_p"; then
83208762 pic_mode=yes
83218763 fi
83228764 done
8323 IFS="$lt_save_ifs"
8765 IFS=$lt_save_ifs
83248766 ;;
83258767 esac],
8326 [pic_mode=default])
8327
8328 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8768 [pic_mode=m4_default([$1], [default])])
83298769
83308770 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
83318771 ])# _LT_WITH_PIC
83388778 [_LT_SET_OPTION([LT_INIT], [pic-only])
83398779 AC_DIAGNOSE([obsolete],
83408780 [$0: Remove this warning and the call to _LT_SET_OPTION when you
8341 put the `pic-only' option into LT_INIT's first parameter.])
8781 put the 'pic-only' option into LT_INIT's first parameter.])
83428782 ])
83438783
83448784 dnl aclocal-1.4 backwards compatibility:
83618801
83628802 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
83638803 #
8364 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8804 # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
8805 # Foundation, Inc.
83658806 # Written by Gary V. Vaughan, 2004
83668807 #
83678808 # This file is free software; the Free Software Foundation gives
83948835 # ------------
83958836 # Manipulate m4 lists.
83968837 # These macros are necessary as long as will still need to support
8397 # Autoconf-2.59 which quotes differently.
8838 # Autoconf-2.59, which quotes differently.
83988839 m4_define([lt_car], [[$1]])
83998840 m4_define([lt_cdr],
84008841 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
84058846
84068847 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
84078848 # ------------------------------------------
8408 # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8849 # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
84098850 # Note that neither SEPARATOR nor STRING are expanded; they are appended
84108851 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
84118852 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
84858926
84868927 # ltversion.m4 -- version numbers -*- Autoconf -*-
84878928 #
8488 # Copyright (C) 2004 Free Software Foundation, Inc.
8929 # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
84898930 # Written by Scott James Remnant, 2004
84908931 #
84918932 # This file is free software; the Free Software Foundation gives
84948935
84958936 # @configure_input@
84968937
8497 # serial 3337 ltversion.m4
8938 # serial 4179 ltversion.m4
84988939 # This file is part of GNU Libtool
84998940
8500 m4_define([LT_PACKAGE_VERSION], [2.4.2])
8501 m4_define([LT_PACKAGE_REVISION], [1.3337])
8941 m4_define([LT_PACKAGE_VERSION], [2.4.6])
8942 m4_define([LT_PACKAGE_REVISION], [2.4.6])
85028943
85038944 AC_DEFUN([LTVERSION_VERSION],
8504 [macro_version='2.4.2'
8505 macro_revision='1.3337'
8945 [macro_version='2.4.6'
8946 macro_revision='2.4.6'
85068947 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
85078948 _LT_DECL(, macro_revision, 0)
85088949 ])
85098950
85108951 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
85118952 #
8512 # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8953 # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
8954 # Foundation, Inc.
85138955 # Written by Scott James Remnant, 2004.
85148956 #
85158957 # This file is free software; the Free Software Foundation gives
85208962
85218963 # These exist entirely to fool aclocal when bootstrapping libtool.
85228964 #
8523 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8965 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
85248966 # which have later been changed to m4_define as they aren't part of the
85258967 # exported API, or moved to Autoconf or Automake where they belong.
85268968 #
85348976 # included after everything else. This provides aclocal with the
85358977 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
85368978 # because those macros already exist, or will be overwritten later.
8537 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8979 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
85388980 #
85398981 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
85408982 # Yes, that means every name once taken will need to remain here until
86069048 m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
86079049 m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
86089050
8609 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
9051 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
86109052 #
86119053 # This file is free software; the Free Software Foundation
86129054 # gives unlimited permission to copy and/or distribute it,
86189060 # generated from the m4 files accompanying Automake X.Y.
86199061 # (This private macro should not be called outside this file.)
86209062 AC_DEFUN([AM_AUTOMAKE_VERSION],
8621 [am__api_version='1.14'
9063 [am__api_version='1.15'
86229064 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
86239065 dnl require some minimum version. Point them to the right macro.
8624 m4_if([$1], [1.14], [],
9066 m4_if([$1], [1.15], [],
86259067 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
86269068 ])
86279069
86379079 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
86389080 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
86399081 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8640 [AM_AUTOMAKE_VERSION([1.14])dnl
9082 [AM_AUTOMAKE_VERSION([1.15])dnl
86419083 m4_ifndef([AC_AUTOCONF_VERSION],
86429084 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
86439085 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
86449086
8645 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
9087 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
86469088 #
86479089 # This file is free software; the Free Software Foundation
86489090 # gives unlimited permission to copy and/or distribute it,
87049146
87059147 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
87069148
8707 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
9149 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
87089150 #
87099151 # This file is free software; the Free Software Foundation
87109152 # gives unlimited permission to copy and/or distribute it,
87499191 # configured tree to be moved without reconfiguration.
87509192
87519193 AC_DEFUN([AM_AUX_DIR_EXPAND],
8752 [dnl Rely on autoconf to set up CDPATH properly.
8753 AC_PREREQ([2.50])dnl
8754 # expand $ac_aux_dir to an absolute path
8755 am_aux_dir=`cd $ac_aux_dir && pwd`
9194 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9195 # Expand $ac_aux_dir to an absolute path.
9196 am_aux_dir=`cd "$ac_aux_dir" && pwd`
87569197 ])
87579198
87589199 # AM_CONDITIONAL -*- Autoconf -*-
87599200
8760 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
9201 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
87619202 #
87629203 # This file is free software; the Free Software Foundation
87639204 # gives unlimited permission to copy and/or distribute it,
87889229 Usually this means the macro was only invoked conditionally.]])
87899230 fi])])
87909231
8791 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
9232 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
87929233 #
87939234 # This file is free software; the Free Software Foundation
87949235 # gives unlimited permission to copy and/or distribute it,
89799420
89809421 # Generate code to set up dependency tracking. -*- Autoconf -*-
89819422
8982 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
9423 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
89839424 #
89849425 # This file is free software; the Free Software Foundation
89859426 # gives unlimited permission to copy and/or distribute it,
90559496
90569497 # Do all the work for Automake. -*- Autoconf -*-
90579498
9058 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
9499 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
90599500 #
90609501 # This file is free software; the Free Software Foundation
90619502 # gives unlimited permission to copy and/or distribute it,
91459586 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
91469587 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
91479588 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
9148 # We need awk for the "check" target. The system "awk" is bad on
9149 # some platforms.
9589 # We need awk for the "check" target (and possibly the TAP driver). The
9590 # system "awk" is bad on some platforms.
91509591 AC_REQUIRE([AC_PROG_AWK])dnl
91519592 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
91529593 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
92199660 END
92209661 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
92219662 fi
9222 fi])
9663 fi
9664 dnl The trailing newline in this macro's definition is deliberate, for
9665 dnl backward compatibility and to allow trailing 'dnl'-style comments
9666 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
9667 ])
92239668
92249669 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
92259670 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
92489693 done
92499694 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
92509695
9251 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
9696 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
92529697 #
92539698 # This file is free software; the Free Software Foundation
92549699 # gives unlimited permission to copy and/or distribute it,
92599704 # Define $install_sh.
92609705 AC_DEFUN([AM_PROG_INSTALL_SH],
92619706 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9262 if test x"${install_sh}" != xset; then
9707 if test x"${install_sh+set}" != xset; then
92639708 case $am_aux_dir in
92649709 *\ * | *\ *)
92659710 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
92699714 fi
92709715 AC_SUBST([install_sh])])
92719716
9272 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
9717 # Copyright (C) 2003-2014 Free Software Foundation, Inc.
92739718 #
92749719 # This file is free software; the Free Software Foundation
92759720 # gives unlimited permission to copy and/or distribute it,
92909735
92919736 # Check to see how 'make' treats includes. -*- Autoconf -*-
92929737
9293 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
9738 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
92949739 #
92959740 # This file is free software; the Free Software Foundation
92969741 # gives unlimited permission to copy and/or distribute it,
93409785
93419786 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
93429787
9343 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
9788 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
93449789 #
93459790 # This file is free software; the Free Software Foundation
93469791 # gives unlimited permission to copy and/or distribute it,
93799824
93809825 # Helper functions for option handling. -*- Autoconf -*-
93819826
9382 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
9827 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
93839828 #
93849829 # This file is free software; the Free Software Foundation
93859830 # gives unlimited permission to copy and/or distribute it,
94089853 AC_DEFUN([_AM_IF_OPTION],
94099854 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
94109855
9411 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
9856 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
94129857 #
94139858 # This file is free software; the Free Software Foundation
94149859 # gives unlimited permission to copy and/or distribute it,
94559900 # For backward compatibility.
94569901 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
94579902
9458 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
9903 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
94599904 #
94609905 # This file is free software; the Free Software Foundation
94619906 # gives unlimited permission to copy and/or distribute it,
94749919
94759920 # Check to make sure that the build environment is sane. -*- Autoconf -*-
94769921
9477 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
9922 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
94789923 #
94799924 # This file is free software; the Free Software Foundation
94809925 # gives unlimited permission to copy and/or distribute it,
955510000 rm -f conftest.file
955610001 ])
955710002
9558 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
10003 # Copyright (C) 2009-2014 Free Software Foundation, Inc.
955910004 #
956010005 # This file is free software; the Free Software Foundation
956110006 # gives unlimited permission to copy and/or distribute it,
961510060 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
961610061 ])
961710062
9618 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
10063 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
961910064 #
962010065 # This file is free software; the Free Software Foundation
962110066 # gives unlimited permission to copy and/or distribute it,
964310088 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
964410089 AC_SUBST([INSTALL_STRIP_PROGRAM])])
964510090
9646 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
10091 # Copyright (C) 2006-2014 Free Software Foundation, Inc.
964710092 #
964810093 # This file is free software; the Free Software Foundation
964910094 # gives unlimited permission to copy and/or distribute it,
966210107
966310108 # Check how to create a tarball. -*- Autoconf -*-
966410109
9665 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
10110 # Copyright (C) 2004-2014 Free Software Foundation, Inc.
966610111 #
966710112 # This file is free software; the Free Software Foundation
966810113 # gives unlimited permission to copy and/or distribute it,
+0
-270
ar-lib less more
0 #! /bin/sh
1 # Wrapper for Microsoft lib.exe
2
3 me=ar-lib
4 scriptversion=2012-03-01.08; # UTC
5
6 # Copyright (C) 2010-2013 Free Software Foundation, Inc.
7 # Written by Peter Rosin <peda@lysator.liu.se>.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # This file is maintained in Automake, please report
28 # bugs to <bug-automake@gnu.org> or send patches to
29 # <automake-patches@gnu.org>.
30
31
32 # func_error message
33 func_error ()
34 {
35 echo "$me: $1" 1>&2
36 exit 1
37 }
38
39 file_conv=
40
41 # func_file_conv build_file
42 # Convert a $build file to $host form and store it in $file
43 # Currently only supports Windows hosts.
44 func_file_conv ()
45 {
46 file=$1
47 case $file in
48 / | /[!/]*) # absolute file, and not a UNC file
49 if test -z "$file_conv"; then
50 # lazily determine how to convert abs files
51 case `uname -s` in
52 MINGW*)
53 file_conv=mingw
54 ;;
55 CYGWIN*)
56 file_conv=cygwin
57 ;;
58 *)
59 file_conv=wine
60 ;;
61 esac
62 fi
63 case $file_conv in
64 mingw)
65 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
66 ;;
67 cygwin)
68 file=`cygpath -m "$file" || echo "$file"`
69 ;;
70 wine)
71 file=`winepath -w "$file" || echo "$file"`
72 ;;
73 esac
74 ;;
75 esac
76 }
77
78 # func_at_file at_file operation archive
79 # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
80 # for each of them.
81 # When interpreting the content of the @FILE, do NOT use func_file_conv,
82 # since the user would need to supply preconverted file names to
83 # binutils ar, at least for MinGW.
84 func_at_file ()
85 {
86 operation=$2
87 archive=$3
88 at_file_contents=`cat "$1"`
89 eval set x "$at_file_contents"
90 shift
91
92 for member
93 do
94 $AR -NOLOGO $operation:"$member" "$archive" || exit $?
95 done
96 }
97
98 case $1 in
99 '')
100 func_error "no command. Try '$0 --help' for more information."
101 ;;
102 -h | --h*)
103 cat <<EOF
104 Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
105
106 Members may be specified in a file named with @FILE.
107 EOF
108 exit $?
109 ;;
110 -v | --v*)
111 echo "$me, version $scriptversion"
112 exit $?
113 ;;
114 esac
115
116 if test $# -lt 3; then
117 func_error "you must specify a program, an action and an archive"
118 fi
119
120 AR=$1
121 shift
122 while :
123 do
124 if test $# -lt 2; then
125 func_error "you must specify a program, an action and an archive"
126 fi
127 case $1 in
128 -lib | -LIB \
129 | -ltcg | -LTCG \
130 | -machine* | -MACHINE* \
131 | -subsystem* | -SUBSYSTEM* \
132 | -verbose | -VERBOSE \
133 | -wx* | -WX* )
134 AR="$AR $1"
135 shift
136 ;;
137 *)
138 action=$1
139 shift
140 break
141 ;;
142 esac
143 done
144 orig_archive=$1
145 shift
146 func_file_conv "$orig_archive"
147 archive=$file
148
149 # strip leading dash in $action
150 action=${action#-}
151
152 delete=
153 extract=
154 list=
155 quick=
156 replace=
157 index=
158 create=
159
160 while test -n "$action"
161 do
162 case $action in
163 d*) delete=yes ;;
164 x*) extract=yes ;;
165 t*) list=yes ;;
166 q*) quick=yes ;;
167 r*) replace=yes ;;
168 s*) index=yes ;;
169 S*) ;; # the index is always updated implicitly
170 c*) create=yes ;;
171 u*) ;; # TODO: don't ignore the update modifier
172 v*) ;; # TODO: don't ignore the verbose modifier
173 *)
174 func_error "unknown action specified"
175 ;;
176 esac
177 action=${action#?}
178 done
179
180 case $delete$extract$list$quick$replace,$index in
181 yes,* | ,yes)
182 ;;
183 yesyes*)
184 func_error "more than one action specified"
185 ;;
186 *)
187 func_error "no action specified"
188 ;;
189 esac
190
191 if test -n "$delete"; then
192 if test ! -f "$orig_archive"; then
193 func_error "archive not found"
194 fi
195 for member
196 do
197 case $1 in
198 @*)
199 func_at_file "${1#@}" -REMOVE "$archive"
200 ;;
201 *)
202 func_file_conv "$1"
203 $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
204 ;;
205 esac
206 done
207
208 elif test -n "$extract"; then
209 if test ! -f "$orig_archive"; then
210 func_error "archive not found"
211 fi
212 if test $# -gt 0; then
213 for member
214 do
215 case $1 in
216 @*)
217 func_at_file "${1#@}" -EXTRACT "$archive"
218 ;;
219 *)
220 func_file_conv "$1"
221 $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
222 ;;
223 esac
224 done
225 else
226 $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
227 do
228 $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
229 done
230 fi
231
232 elif test -n "$quick$replace"; then
233 if test ! -f "$orig_archive"; then
234 if test -z "$create"; then
235 echo "$me: creating $orig_archive"
236 fi
237 orig_archive=
238 else
239 orig_archive=$archive
240 fi
241
242 for member
243 do
244 case $1 in
245 @*)
246 func_file_conv "${1#@}"
247 set x "$@" "@$file"
248 ;;
249 *)
250 func_file_conv "$1"
251 set x "$@" "$file"
252 ;;
253 esac
254 shift
255 shift
256 done
257
258 if test -n "$orig_archive"; then
259 $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
260 else
261 $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
262 fi
263
264 elif test -n "$list"; then
265 if test ! -f "$orig_archive"; then
266 func_error "archive not found"
267 fi
268 $AR -NOLOGO -LIST "$archive" || exit $?
269 fi
0 #! /bin/sh
1 # Wrapper for Microsoft lib.exe
2
3 me=ar-lib
4 scriptversion=2012-03-01.08; # UTC
5
6 # Copyright (C) 2010-2014 Free Software Foundation, Inc.
7 # Written by Peter Rosin <peda@lysator.liu.se>.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # This file is maintained in Automake, please report
28 # bugs to <bug-automake@gnu.org> or send patches to
29 # <automake-patches@gnu.org>.
30
31
32 # func_error message
33 func_error ()
34 {
35 echo "$me: $1" 1>&2
36 exit 1
37 }
38
39 file_conv=
40
41 # func_file_conv build_file
42 # Convert a $build file to $host form and store it in $file
43 # Currently only supports Windows hosts.
44 func_file_conv ()
45 {
46 file=$1
47 case $file in
48 / | /[!/]*) # absolute file, and not a UNC file
49 if test -z "$file_conv"; then
50 # lazily determine how to convert abs files
51 case `uname -s` in
52 MINGW*)
53 file_conv=mingw
54 ;;
55 CYGWIN*)
56 file_conv=cygwin
57 ;;
58 *)
59 file_conv=wine
60 ;;
61 esac
62 fi
63 case $file_conv in
64 mingw)
65 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
66 ;;
67 cygwin)
68 file=`cygpath -m "$file" || echo "$file"`
69 ;;
70 wine)
71 file=`winepath -w "$file" || echo "$file"`
72 ;;
73 esac
74 ;;
75 esac
76 }
77
78 # func_at_file at_file operation archive
79 # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
80 # for each of them.
81 # When interpreting the content of the @FILE, do NOT use func_file_conv,
82 # since the user would need to supply preconverted file names to
83 # binutils ar, at least for MinGW.
84 func_at_file ()
85 {
86 operation=$2
87 archive=$3
88 at_file_contents=`cat "$1"`
89 eval set x "$at_file_contents"
90 shift
91
92 for member
93 do
94 $AR -NOLOGO $operation:"$member" "$archive" || exit $?
95 done
96 }
97
98 case $1 in
99 '')
100 func_error "no command. Try '$0 --help' for more information."
101 ;;
102 -h | --h*)
103 cat <<EOF
104 Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
105
106 Members may be specified in a file named with @FILE.
107 EOF
108 exit $?
109 ;;
110 -v | --v*)
111 echo "$me, version $scriptversion"
112 exit $?
113 ;;
114 esac
115
116 if test $# -lt 3; then
117 func_error "you must specify a program, an action and an archive"
118 fi
119
120 AR=$1
121 shift
122 while :
123 do
124 if test $# -lt 2; then
125 func_error "you must specify a program, an action and an archive"
126 fi
127 case $1 in
128 -lib | -LIB \
129 | -ltcg | -LTCG \
130 | -machine* | -MACHINE* \
131 | -subsystem* | -SUBSYSTEM* \
132 | -verbose | -VERBOSE \
133 | -wx* | -WX* )
134 AR="$AR $1"
135 shift
136 ;;
137 *)
138 action=$1
139 shift
140 break
141 ;;
142 esac
143 done
144 orig_archive=$1
145 shift
146 func_file_conv "$orig_archive"
147 archive=$file
148
149 # strip leading dash in $action
150 action=${action#-}
151
152 delete=
153 extract=
154 list=
155 quick=
156 replace=
157 index=
158 create=
159
160 while test -n "$action"
161 do
162 case $action in
163 d*) delete=yes ;;
164 x*) extract=yes ;;
165 t*) list=yes ;;
166 q*) quick=yes ;;
167 r*) replace=yes ;;
168 s*) index=yes ;;
169 S*) ;; # the index is always updated implicitly
170 c*) create=yes ;;
171 u*) ;; # TODO: don't ignore the update modifier
172 v*) ;; # TODO: don't ignore the verbose modifier
173 *)
174 func_error "unknown action specified"
175 ;;
176 esac
177 action=${action#?}
178 done
179
180 case $delete$extract$list$quick$replace,$index in
181 yes,* | ,yes)
182 ;;
183 yesyes*)
184 func_error "more than one action specified"
185 ;;
186 *)
187 func_error "no action specified"
188 ;;
189 esac
190
191 if test -n "$delete"; then
192 if test ! -f "$orig_archive"; then
193 func_error "archive not found"
194 fi
195 for member
196 do
197 case $1 in
198 @*)
199 func_at_file "${1#@}" -REMOVE "$archive"
200 ;;
201 *)
202 func_file_conv "$1"
203 $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
204 ;;
205 esac
206 done
207
208 elif test -n "$extract"; then
209 if test ! -f "$orig_archive"; then
210 func_error "archive not found"
211 fi
212 if test $# -gt 0; then
213 for member
214 do
215 case $1 in
216 @*)
217 func_at_file "${1#@}" -EXTRACT "$archive"
218 ;;
219 *)
220 func_file_conv "$1"
221 $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
222 ;;
223 esac
224 done
225 else
226 $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
227 do
228 $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
229 done
230 fi
231
232 elif test -n "$quick$replace"; then
233 if test ! -f "$orig_archive"; then
234 if test -z "$create"; then
235 echo "$me: creating $orig_archive"
236 fi
237 orig_archive=
238 else
239 orig_archive=$archive
240 fi
241
242 for member
243 do
244 case $1 in
245 @*)
246 func_file_conv "${1#@}"
247 set x "$@" "@$file"
248 ;;
249 *)
250 func_file_conv "$1"
251 set x "$@" "$file"
252 ;;
253 esac
254 shift
255 shift
256 done
257
258 if test -n "$orig_archive"; then
259 $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
260 else
261 $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
262 fi
263
264 elif test -n "$list"; then
265 if test ! -f "$orig_archive"; then
266 func_error "archive not found"
267 fi
268 $AR -NOLOGO -LIST "$archive" || exit $?
269 fi
0 #! /bin/sh
1 # Wrapper for compilers which do not understand '-c -o'.
2
3 scriptversion=2012-10-14.11; # UTC
4
5 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
6 # Written by Tom Tromey <tromey@cygnus.com>.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 # This file is maintained in Automake, please report
27 # bugs to <bug-automake@gnu.org> or send patches to
28 # <automake-patches@gnu.org>.
29
30 nl='
31 '
32
33 # We need space, tab and new line, in precisely that order. Quoting is
34 # there to prevent tools from complaining about whitespace usage.
35 IFS=" "" $nl"
36
37 file_conv=
38
39 # func_file_conv build_file lazy
40 # Convert a $build file to $host form and store it in $file
41 # Currently only supports Windows hosts. If the determined conversion
42 # type is listed in (the comma separated) LAZY, no conversion will
43 # take place.
44 func_file_conv ()
45 {
46 file=$1
47 case $file in
48 / | /[!/]*) # absolute file, and not a UNC file
49 if test -z "$file_conv"; then
50 # lazily determine how to convert abs files
51 case `uname -s` in
52 MINGW*)
53 file_conv=mingw
54 ;;
55 CYGWIN*)
56 file_conv=cygwin
57 ;;
58 *)
59 file_conv=wine
60 ;;
61 esac
62 fi
63 case $file_conv/,$2, in
64 *,$file_conv,*)
65 ;;
66 mingw/*)
67 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
68 ;;
69 cygwin/*)
70 file=`cygpath -m "$file" || echo "$file"`
71 ;;
72 wine/*)
73 file=`winepath -w "$file" || echo "$file"`
74 ;;
75 esac
76 ;;
77 esac
78 }
79
80 # func_cl_dashL linkdir
81 # Make cl look for libraries in LINKDIR
82 func_cl_dashL ()
83 {
84 func_file_conv "$1"
85 if test -z "$lib_path"; then
86 lib_path=$file
87 else
88 lib_path="$lib_path;$file"
89 fi
90 linker_opts="$linker_opts -LIBPATH:$file"
91 }
92
93 # func_cl_dashl library
94 # Do a library search-path lookup for cl
95 func_cl_dashl ()
96 {
97 lib=$1
98 found=no
99 save_IFS=$IFS
100 IFS=';'
101 for dir in $lib_path $LIB
102 do
103 IFS=$save_IFS
104 if $shared && test -f "$dir/$lib.dll.lib"; then
105 found=yes
106 lib=$dir/$lib.dll.lib
107 break
108 fi
109 if test -f "$dir/$lib.lib"; then
110 found=yes
111 lib=$dir/$lib.lib
112 break
113 fi
114 if test -f "$dir/lib$lib.a"; then
115 found=yes
116 lib=$dir/lib$lib.a
117 break
118 fi
119 done
120 IFS=$save_IFS
121
122 if test "$found" != yes; then
123 lib=$lib.lib
124 fi
125 }
126
127 # func_cl_wrapper cl arg...
128 # Adjust compile command to suit cl
129 func_cl_wrapper ()
130 {
131 # Assume a capable shell
132 lib_path=
133 shared=:
134 linker_opts=
135 for arg
136 do
137 if test -n "$eat"; then
138 eat=
139 else
140 case $1 in
141 -o)
142 # configure might choose to run compile as 'compile cc -o foo foo.c'.
143 eat=1
144 case $2 in
145 *.o | *.[oO][bB][jJ])
146 func_file_conv "$2"
147 set x "$@" -Fo"$file"
148 shift
149 ;;
150 *)
151 func_file_conv "$2"
152 set x "$@" -Fe"$file"
153 shift
154 ;;
155 esac
156 ;;
157 -I)
158 eat=1
159 func_file_conv "$2" mingw
160 set x "$@" -I"$file"
161 shift
162 ;;
163 -I*)
164 func_file_conv "${1#-I}" mingw
165 set x "$@" -I"$file"
166 shift
167 ;;
168 -l)
169 eat=1
170 func_cl_dashl "$2"
171 set x "$@" "$lib"
172 shift
173 ;;
174 -l*)
175 func_cl_dashl "${1#-l}"
176 set x "$@" "$lib"
177 shift
178 ;;
179 -L)
180 eat=1
181 func_cl_dashL "$2"
182 ;;
183 -L*)
184 func_cl_dashL "${1#-L}"
185 ;;
186 -static)
187 shared=false
188 ;;
189 -Wl,*)
190 arg=${1#-Wl,}
191 save_ifs="$IFS"; IFS=','
192 for flag in $arg; do
193 IFS="$save_ifs"
194 linker_opts="$linker_opts $flag"
195 done
196 IFS="$save_ifs"
197 ;;
198 -Xlinker)
199 eat=1
200 linker_opts="$linker_opts $2"
201 ;;
202 -*)
203 set x "$@" "$1"
204 shift
205 ;;
206 *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
207 func_file_conv "$1"
208 set x "$@" -Tp"$file"
209 shift
210 ;;
211 *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
212 func_file_conv "$1" mingw
213 set x "$@" "$file"
214 shift
215 ;;
216 *)
217 set x "$@" "$1"
218 shift
219 ;;
220 esac
221 fi
222 shift
223 done
224 if test -n "$linker_opts"; then
225 linker_opts="-link$linker_opts"
226 fi
227 exec "$@" $linker_opts
228 exit 1
229 }
230
231 eat=
232
233 case $1 in
234 '')
235 echo "$0: No command. Try '$0 --help' for more information." 1>&2
236 exit 1;
237 ;;
238 -h | --h*)
239 cat <<\EOF
240 Usage: compile [--help] [--version] PROGRAM [ARGS]
241
242 Wrapper for compilers which do not understand '-c -o'.
243 Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
244 arguments, and rename the output as expected.
245
246 If you are trying to build a whole package this is not the
247 right script to run: please start by reading the file 'INSTALL'.
248
249 Report bugs to <bug-automake@gnu.org>.
250 EOF
251 exit $?
252 ;;
253 -v | --v*)
254 echo "compile $scriptversion"
255 exit $?
256 ;;
257 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
258 func_cl_wrapper "$@" # Doesn't return...
259 ;;
260 esac
261
262 ofile=
263 cfile=
264
265 for arg
266 do
267 if test -n "$eat"; then
268 eat=
269 else
270 case $1 in
271 -o)
272 # configure might choose to run compile as 'compile cc -o foo foo.c'.
273 # So we strip '-o arg' only if arg is an object.
274 eat=1
275 case $2 in
276 *.o | *.obj)
277 ofile=$2
278 ;;
279 *)
280 set x "$@" -o "$2"
281 shift
282 ;;
283 esac
284 ;;
285 *.c)
286 cfile=$1
287 set x "$@" "$1"
288 shift
289 ;;
290 *)
291 set x "$@" "$1"
292 shift
293 ;;
294 esac
295 fi
296 shift
297 done
298
299 if test -z "$ofile" || test -z "$cfile"; then
300 # If no '-o' option was seen then we might have been invoked from a
301 # pattern rule where we don't need one. That is ok -- this is a
302 # normal compilation that the losing compiler can handle. If no
303 # '.c' file was seen then we are probably linking. That is also
304 # ok.
305 exec "$@"
306 fi
307
308 # Name of file we expect compiler to create.
309 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
310
311 # Create the lock directory.
312 # Note: use '[/\\:.-]' here to ensure that we don't use the same name
313 # that we are using for the .o file. Also, base the name on the expected
314 # object file name, since that is what matters with a parallel build.
315 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
316 while true; do
317 if mkdir "$lockdir" >/dev/null 2>&1; then
318 break
319 fi
320 sleep 1
321 done
322 # FIXME: race condition here if user kills between mkdir and trap.
323 trap "rmdir '$lockdir'; exit 1" 1 2 15
324
325 # Run the compile.
326 "$@"
327 ret=$?
328
329 if test -f "$cofile"; then
330 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
331 elif test -f "${cofile}bj"; then
332 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
333 fi
334
335 rmdir "$lockdir"
336 exit $ret
337
338 # Local Variables:
339 # mode: shell-script
340 # sh-indentation: 2
341 # eval: (add-hook 'write-file-hooks 'time-stamp)
342 # time-stamp-start: "scriptversion="
343 # time-stamp-format: "%:y-%02m-%02d.%02H"
344 # time-stamp-time-zone: "UTC"
345 # time-stamp-end: "; # UTC"
346 # End:
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-11-04'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25 #
26 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
27 #
28 # You can get the latest version of this script from:
29 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
30 #
31 # Please send patches to <config-patches@gnu.org>.
32
33
34 me=`echo "$0" | sed -e 's,.*/,,'`
35
36 usage="\
37 Usage: $0 [OPTION]
38
39 Output the configuration name of the system \`$me' is run on.
40
41 Operation modes:
42 -h, --help print this help, then exit
43 -t, --time-stamp print date of last modification, then exit
44 -v, --version print version number, then exit
45
46 Report bugs and patches to <config-patches@gnu.org>."
47
48 version="\
49 GNU config.guess ($timestamp)
50
51 Originally written by Per Bothner.
52 Copyright 1992-2014 Free Software Foundation, Inc.
53
54 This is free software; see the source for copying conditions. There is NO
55 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
56
57 help="
58 Try \`$me --help' for more information."
59
60 # Parse command line
61 while test $# -gt 0 ; do
62 case $1 in
63 --time-stamp | --time* | -t )
64 echo "$timestamp" ; exit ;;
65 --version | -v )
66 echo "$version" ; exit ;;
67 --help | --h* | -h )
68 echo "$usage"; exit ;;
69 -- ) # Stop option processing
70 shift; break ;;
71 - ) # Use stdin as input.
72 break ;;
73 -* )
74 echo "$me: invalid option $1$help" >&2
75 exit 1 ;;
76 * )
77 break ;;
78 esac
79 done
80
81 if test $# != 0; then
82 echo "$me: too many arguments$help" >&2
83 exit 1
84 fi
85
86 trap 'exit 1' 1 2 15
87
88 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
89 # compiler to aid in system detection is discouraged as it requires
90 # temporary files to be created and, as you can see below, it is a
91 # headache to deal with in a portable fashion.
92
93 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
94 # use `HOST_CC' if defined, but it is deprecated.
95
96 # Portable tmp directory creation inspired by the Autoconf team.
97
98 set_cc_for_build='
99 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
100 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
101 : ${TMPDIR=/tmp} ;
102 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
103 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
104 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
105 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
106 dummy=$tmp/dummy ;
107 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
108 case $CC_FOR_BUILD,$HOST_CC,$CC in
109 ,,) echo "int x;" > $dummy.c ;
110 for c in cc gcc c89 c99 ; do
111 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
112 CC_FOR_BUILD="$c"; break ;
113 fi ;
114 done ;
115 if test x"$CC_FOR_BUILD" = x ; then
116 CC_FOR_BUILD=no_compiler_found ;
117 fi
118 ;;
119 ,,*) CC_FOR_BUILD=$CC ;;
120 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
121 esac ; set_cc_for_build= ;'
122
123 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
124 # (ghazi@noc.rutgers.edu 1994-08-24)
125 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
126 PATH=$PATH:/.attbin ; export PATH
127 fi
128
129 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
130 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
134 case "${UNAME_SYSTEM}" in
135 Linux|GNU|GNU/*)
136 # If the system lacks a compiler, then just pick glibc.
137 # We could probably try harder.
138 LIBC=gnu
139
140 eval $set_cc_for_build
141 cat <<-EOF > $dummy.c
142 #include <features.h>
143 #if defined(__UCLIBC__)
144 LIBC=uclibc
145 #elif defined(__dietlibc__)
146 LIBC=dietlibc
147 #else
148 LIBC=gnu
149 #endif
150 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
152 ;;
153 esac
154
155 # Note: order is significant - the case branches are not exclusive.
156
157 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
158 *:NetBSD:*:*)
159 # NetBSD (nbsd) targets should (where applicable) match one or
160 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
161 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
162 # switched to ELF, *-*-netbsd* would select the old
163 # object file format. This provides both forward
164 # compatibility and a consistent mechanism for selecting the
165 # object file format.
166 #
167 # Note: NetBSD doesn't particularly care about the vendor
168 # portion of the name. We always set it to "unknown".
169 sysctl="sysctl -n hw.machine_arch"
170 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
171 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
172 case "${UNAME_MACHINE_ARCH}" in
173 armeb) machine=armeb-unknown ;;
174 arm*) machine=arm-unknown ;;
175 sh3el) machine=shl-unknown ;;
176 sh3eb) machine=sh-unknown ;;
177 sh5el) machine=sh5le-unknown ;;
178 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
179 esac
180 # The Operating System including object format, if it has switched
181 # to ELF recently, or will in the future.
182 case "${UNAME_MACHINE_ARCH}" in
183 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
184 eval $set_cc_for_build
185 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
186 | grep -q __ELF__
187 then
188 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
189 # Return netbsd for either. FIX?
190 os=netbsd
191 else
192 os=netbsdelf
193 fi
194 ;;
195 *)
196 os=netbsd
197 ;;
198 esac
199 # The OS release
200 # Debian GNU/NetBSD machines have a different userland, and
201 # thus, need a distinct triplet. However, they do not need
202 # kernel version information, so it can be replaced with a
203 # suitable tag, in the style of linux-gnu.
204 case "${UNAME_VERSION}" in
205 Debian*)
206 release='-gnu'
207 ;;
208 *)
209 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
210 ;;
211 esac
212 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
213 # contains redundant information, the shorter form:
214 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
215 echo "${machine}-${os}${release}"
216 exit ;;
217 *:Bitrig:*:*)
218 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
219 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
220 exit ;;
221 *:OpenBSD:*:*)
222 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
223 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
224 exit ;;
225 *:ekkoBSD:*:*)
226 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
227 exit ;;
228 *:SolidBSD:*:*)
229 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
230 exit ;;
231 macppc:MirBSD:*:*)
232 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
233 exit ;;
234 *:MirBSD:*:*)
235 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
236 exit ;;
237 alpha:OSF1:*:*)
238 case $UNAME_RELEASE in
239 *4.0)
240 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
241 ;;
242 *5.*)
243 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
244 ;;
245 esac
246 # According to Compaq, /usr/sbin/psrinfo has been available on
247 # OSF/1 and Tru64 systems produced since 1995. I hope that
248 # covers most systems running today. This code pipes the CPU
249 # types through head -n 1, so we only detect the type of CPU 0.
250 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
251 case "$ALPHA_CPU_TYPE" in
252 "EV4 (21064)")
253 UNAME_MACHINE="alpha" ;;
254 "EV4.5 (21064)")
255 UNAME_MACHINE="alpha" ;;
256 "LCA4 (21066/21068)")
257 UNAME_MACHINE="alpha" ;;
258 "EV5 (21164)")
259 UNAME_MACHINE="alphaev5" ;;
260 "EV5.6 (21164A)")
261 UNAME_MACHINE="alphaev56" ;;
262 "EV5.6 (21164PC)")
263 UNAME_MACHINE="alphapca56" ;;
264 "EV5.7 (21164PC)")
265 UNAME_MACHINE="alphapca57" ;;
266 "EV6 (21264)")
267 UNAME_MACHINE="alphaev6" ;;
268 "EV6.7 (21264A)")
269 UNAME_MACHINE="alphaev67" ;;
270 "EV6.8CB (21264C)")
271 UNAME_MACHINE="alphaev68" ;;
272 "EV6.8AL (21264B)")
273 UNAME_MACHINE="alphaev68" ;;
274 "EV6.8CX (21264D)")
275 UNAME_MACHINE="alphaev68" ;;
276 "EV6.9A (21264/EV69A)")
277 UNAME_MACHINE="alphaev69" ;;
278 "EV7 (21364)")
279 UNAME_MACHINE="alphaev7" ;;
280 "EV7.9 (21364A)")
281 UNAME_MACHINE="alphaev79" ;;
282 esac
283 # A Pn.n version is a patched version.
284 # A Vn.n version is a released version.
285 # A Tn.n version is a released field test version.
286 # A Xn.n version is an unreleased experimental baselevel.
287 # 1.2 uses "1.2" for uname -r.
288 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
289 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
290 exitcode=$?
291 trap '' 0
292 exit $exitcode ;;
293 Alpha\ *:Windows_NT*:*)
294 # How do we know it's Interix rather than the generic POSIX subsystem?
295 # Should we change UNAME_MACHINE based on the output of uname instead
296 # of the specific Alpha model?
297 echo alpha-pc-interix
298 exit ;;
299 21064:Windows_NT:50:3)
300 echo alpha-dec-winnt3.5
301 exit ;;
302 Amiga*:UNIX_System_V:4.0:*)
303 echo m68k-unknown-sysv4
304 exit ;;
305 *:[Aa]miga[Oo][Ss]:*:*)
306 echo ${UNAME_MACHINE}-unknown-amigaos
307 exit ;;
308 *:[Mm]orph[Oo][Ss]:*:*)
309 echo ${UNAME_MACHINE}-unknown-morphos
310 exit ;;
311 *:OS/390:*:*)
312 echo i370-ibm-openedition
313 exit ;;
314 *:z/VM:*:*)
315 echo s390-ibm-zvmoe
316 exit ;;
317 *:OS400:*:*)
318 echo powerpc-ibm-os400
319 exit ;;
320 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
321 echo arm-acorn-riscix${UNAME_RELEASE}
322 exit ;;
323 arm*:riscos:*:*|arm*:RISCOS:*:*)
324 echo arm-unknown-riscos
325 exit ;;
326 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
327 echo hppa1.1-hitachi-hiuxmpp
328 exit ;;
329 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
330 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
331 if test "`(/bin/universe) 2>/dev/null`" = att ; then
332 echo pyramid-pyramid-sysv3
333 else
334 echo pyramid-pyramid-bsd
335 fi
336 exit ;;
337 NILE*:*:*:dcosx)
338 echo pyramid-pyramid-svr4
339 exit ;;
340 DRS?6000:unix:4.0:6*)
341 echo sparc-icl-nx6
342 exit ;;
343 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
344 case `/usr/bin/uname -p` in
345 sparc) echo sparc-icl-nx7; exit ;;
346 esac ;;
347 s390x:SunOS:*:*)
348 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
349 exit ;;
350 sun4H:SunOS:5.*:*)
351 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
352 exit ;;
353 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
354 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
355 exit ;;
356 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
357 echo i386-pc-auroraux${UNAME_RELEASE}
358 exit ;;
359 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
360 eval $set_cc_for_build
361 SUN_ARCH="i386"
362 # If there is a compiler, see if it is configured for 64-bit objects.
363 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
364 # This test works for both compilers.
365 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
366 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
367 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
368 grep IS_64BIT_ARCH >/dev/null
369 then
370 SUN_ARCH="x86_64"
371 fi
372 fi
373 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
374 exit ;;
375 sun4*:SunOS:6*:*)
376 # According to config.sub, this is the proper way to canonicalize
377 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
378 # it's likely to be more like Solaris than SunOS4.
379 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
380 exit ;;
381 sun4*:SunOS:*:*)
382 case "`/usr/bin/arch -k`" in
383 Series*|S4*)
384 UNAME_RELEASE=`uname -v`
385 ;;
386 esac
387 # Japanese Language versions have a version number like `4.1.3-JL'.
388 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
389 exit ;;
390 sun3*:SunOS:*:*)
391 echo m68k-sun-sunos${UNAME_RELEASE}
392 exit ;;
393 sun*:*:4.2BSD:*)
394 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
395 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
396 case "`/bin/arch`" in
397 sun3)
398 echo m68k-sun-sunos${UNAME_RELEASE}
399 ;;
400 sun4)
401 echo sparc-sun-sunos${UNAME_RELEASE}
402 ;;
403 esac
404 exit ;;
405 aushp:SunOS:*:*)
406 echo sparc-auspex-sunos${UNAME_RELEASE}
407 exit ;;
408 # The situation for MiNT is a little confusing. The machine name
409 # can be virtually everything (everything which is not
410 # "atarist" or "atariste" at least should have a processor
411 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
412 # to the lowercase version "mint" (or "freemint"). Finally
413 # the system name "TOS" denotes a system which is actually not
414 # MiNT. But MiNT is downward compatible to TOS, so this should
415 # be no problem.
416 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
417 echo m68k-atari-mint${UNAME_RELEASE}
418 exit ;;
419 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
420 echo m68k-atari-mint${UNAME_RELEASE}
421 exit ;;
422 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
423 echo m68k-atari-mint${UNAME_RELEASE}
424 exit ;;
425 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
426 echo m68k-milan-mint${UNAME_RELEASE}
427 exit ;;
428 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
429 echo m68k-hades-mint${UNAME_RELEASE}
430 exit ;;
431 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
432 echo m68k-unknown-mint${UNAME_RELEASE}
433 exit ;;
434 m68k:machten:*:*)
435 echo m68k-apple-machten${UNAME_RELEASE}
436 exit ;;
437 powerpc:machten:*:*)
438 echo powerpc-apple-machten${UNAME_RELEASE}
439 exit ;;
440 RISC*:Mach:*:*)
441 echo mips-dec-mach_bsd4.3
442 exit ;;
443 RISC*:ULTRIX:*:*)
444 echo mips-dec-ultrix${UNAME_RELEASE}
445 exit ;;
446 VAX*:ULTRIX*:*:*)
447 echo vax-dec-ultrix${UNAME_RELEASE}
448 exit ;;
449 2020:CLIX:*:* | 2430:CLIX:*:*)
450 echo clipper-intergraph-clix${UNAME_RELEASE}
451 exit ;;
452 mips:*:*:UMIPS | mips:*:*:RISCos)
453 eval $set_cc_for_build
454 sed 's/^ //' << EOF >$dummy.c
455 #ifdef __cplusplus
456 #include <stdio.h> /* for printf() prototype */
457 int main (int argc, char *argv[]) {
458 #else
459 int main (argc, argv) int argc; char *argv[]; {
460 #endif
461 #if defined (host_mips) && defined (MIPSEB)
462 #if defined (SYSTYPE_SYSV)
463 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
464 #endif
465 #if defined (SYSTYPE_SVR4)
466 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
467 #endif
468 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
469 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
470 #endif
471 #endif
472 exit (-1);
473 }
474 EOF
475 $CC_FOR_BUILD -o $dummy $dummy.c &&
476 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
477 SYSTEM_NAME=`$dummy $dummyarg` &&
478 { echo "$SYSTEM_NAME"; exit; }
479 echo mips-mips-riscos${UNAME_RELEASE}
480 exit ;;
481 Motorola:PowerMAX_OS:*:*)
482 echo powerpc-motorola-powermax
483 exit ;;
484 Motorola:*:4.3:PL8-*)
485 echo powerpc-harris-powermax
486 exit ;;
487 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
488 echo powerpc-harris-powermax
489 exit ;;
490 Night_Hawk:Power_UNIX:*:*)
491 echo powerpc-harris-powerunix
492 exit ;;
493 m88k:CX/UX:7*:*)
494 echo m88k-harris-cxux7
495 exit ;;
496 m88k:*:4*:R4*)
497 echo m88k-motorola-sysv4
498 exit ;;
499 m88k:*:3*:R3*)
500 echo m88k-motorola-sysv3
501 exit ;;
502 AViiON:dgux:*:*)
503 # DG/UX returns AViiON for all architectures
504 UNAME_PROCESSOR=`/usr/bin/uname -p`
505 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
506 then
507 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
508 [ ${TARGET_BINARY_INTERFACE}x = x ]
509 then
510 echo m88k-dg-dgux${UNAME_RELEASE}
511 else
512 echo m88k-dg-dguxbcs${UNAME_RELEASE}
513 fi
514 else
515 echo i586-dg-dgux${UNAME_RELEASE}
516 fi
517 exit ;;
518 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
519 echo m88k-dolphin-sysv3
520 exit ;;
521 M88*:*:R3*:*)
522 # Delta 88k system running SVR3
523 echo m88k-motorola-sysv3
524 exit ;;
525 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
526 echo m88k-tektronix-sysv3
527 exit ;;
528 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
529 echo m68k-tektronix-bsd
530 exit ;;
531 *:IRIX*:*:*)
532 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
533 exit ;;
534 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
535 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
536 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
537 i*86:AIX:*:*)
538 echo i386-ibm-aix
539 exit ;;
540 ia64:AIX:*:*)
541 if [ -x /usr/bin/oslevel ] ; then
542 IBM_REV=`/usr/bin/oslevel`
543 else
544 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
545 fi
546 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
547 exit ;;
548 *:AIX:2:3)
549 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
550 eval $set_cc_for_build
551 sed 's/^ //' << EOF >$dummy.c
552 #include <sys/systemcfg.h>
553
554 main()
555 {
556 if (!__power_pc())
557 exit(1);
558 puts("powerpc-ibm-aix3.2.5");
559 exit(0);
560 }
561 EOF
562 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
563 then
564 echo "$SYSTEM_NAME"
565 else
566 echo rs6000-ibm-aix3.2.5
567 fi
568 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
569 echo rs6000-ibm-aix3.2.4
570 else
571 echo rs6000-ibm-aix3.2
572 fi
573 exit ;;
574 *:AIX:*:[4567])
575 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
576 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
577 IBM_ARCH=rs6000
578 else
579 IBM_ARCH=powerpc
580 fi
581 if [ -x /usr/bin/lslpp ] ; then
582 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
583 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
584 else
585 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
586 fi
587 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
588 exit ;;
589 *:AIX:*:*)
590 echo rs6000-ibm-aix
591 exit ;;
592 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
593 echo romp-ibm-bsd4.4
594 exit ;;
595 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
596 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
597 exit ;; # report: romp-ibm BSD 4.3
598 *:BOSX:*:*)
599 echo rs6000-bull-bosx
600 exit ;;
601 DPX/2?00:B.O.S.:*:*)
602 echo m68k-bull-sysv3
603 exit ;;
604 9000/[34]??:4.3bsd:1.*:*)
605 echo m68k-hp-bsd
606 exit ;;
607 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
608 echo m68k-hp-bsd4.4
609 exit ;;
610 9000/[34678]??:HP-UX:*:*)
611 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
612 case "${UNAME_MACHINE}" in
613 9000/31? ) HP_ARCH=m68000 ;;
614 9000/[34]?? ) HP_ARCH=m68k ;;
615 9000/[678][0-9][0-9])
616 if [ -x /usr/bin/getconf ]; then
617 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
618 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619 case "${sc_cpu_version}" in
620 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
622 532) # CPU_PA_RISC2_0
623 case "${sc_kernel_bits}" in
624 32) HP_ARCH="hppa2.0n" ;;
625 64) HP_ARCH="hppa2.0w" ;;
626 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
627 esac ;;
628 esac
629 fi
630 if [ "${HP_ARCH}" = "" ]; then
631 eval $set_cc_for_build
632 sed 's/^ //' << EOF >$dummy.c
633
634 #define _HPUX_SOURCE
635 #include <stdlib.h>
636 #include <unistd.h>
637
638 int main ()
639 {
640 #if defined(_SC_KERNEL_BITS)
641 long bits = sysconf(_SC_KERNEL_BITS);
642 #endif
643 long cpu = sysconf (_SC_CPU_VERSION);
644
645 switch (cpu)
646 {
647 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
648 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
649 case CPU_PA_RISC2_0:
650 #if defined(_SC_KERNEL_BITS)
651 switch (bits)
652 {
653 case 64: puts ("hppa2.0w"); break;
654 case 32: puts ("hppa2.0n"); break;
655 default: puts ("hppa2.0"); break;
656 } break;
657 #else /* !defined(_SC_KERNEL_BITS) */
658 puts ("hppa2.0"); break;
659 #endif
660 default: puts ("hppa1.0"); break;
661 }
662 exit (0);
663 }
664 EOF
665 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
666 test -z "$HP_ARCH" && HP_ARCH=hppa
667 fi ;;
668 esac
669 if [ ${HP_ARCH} = "hppa2.0w" ]
670 then
671 eval $set_cc_for_build
672
673 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
674 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
675 # generating 64-bit code. GNU and HP use different nomenclature:
676 #
677 # $ CC_FOR_BUILD=cc ./config.guess
678 # => hppa2.0w-hp-hpux11.23
679 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
680 # => hppa64-hp-hpux11.23
681
682 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
683 grep -q __LP64__
684 then
685 HP_ARCH="hppa2.0w"
686 else
687 HP_ARCH="hppa64"
688 fi
689 fi
690 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
691 exit ;;
692 ia64:HP-UX:*:*)
693 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
694 echo ia64-hp-hpux${HPUX_REV}
695 exit ;;
696 3050*:HI-UX:*:*)
697 eval $set_cc_for_build
698 sed 's/^ //' << EOF >$dummy.c
699 #include <unistd.h>
700 int
701 main ()
702 {
703 long cpu = sysconf (_SC_CPU_VERSION);
704 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
705 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
706 results, however. */
707 if (CPU_IS_PA_RISC (cpu))
708 {
709 switch (cpu)
710 {
711 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
712 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
713 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
714 default: puts ("hppa-hitachi-hiuxwe2"); break;
715 }
716 }
717 else if (CPU_IS_HP_MC68K (cpu))
718 puts ("m68k-hitachi-hiuxwe2");
719 else puts ("unknown-hitachi-hiuxwe2");
720 exit (0);
721 }
722 EOF
723 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
724 { echo "$SYSTEM_NAME"; exit; }
725 echo unknown-hitachi-hiuxwe2
726 exit ;;
727 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
728 echo hppa1.1-hp-bsd
729 exit ;;
730 9000/8??:4.3bsd:*:*)
731 echo hppa1.0-hp-bsd
732 exit ;;
733 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
734 echo hppa1.0-hp-mpeix
735 exit ;;
736 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
737 echo hppa1.1-hp-osf
738 exit ;;
739 hp8??:OSF1:*:*)
740 echo hppa1.0-hp-osf
741 exit ;;
742 i*86:OSF1:*:*)
743 if [ -x /usr/sbin/sysversion ] ; then
744 echo ${UNAME_MACHINE}-unknown-osf1mk
745 else
746 echo ${UNAME_MACHINE}-unknown-osf1
747 fi
748 exit ;;
749 parisc*:Lites*:*:*)
750 echo hppa1.1-hp-lites
751 exit ;;
752 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
753 echo c1-convex-bsd
754 exit ;;
755 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
756 if getsysinfo -f scalar_acc
757 then echo c32-convex-bsd
758 else echo c2-convex-bsd
759 fi
760 exit ;;
761 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
762 echo c34-convex-bsd
763 exit ;;
764 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
765 echo c38-convex-bsd
766 exit ;;
767 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
768 echo c4-convex-bsd
769 exit ;;
770 CRAY*Y-MP:*:*:*)
771 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
772 exit ;;
773 CRAY*[A-Z]90:*:*:*)
774 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
775 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
776 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
777 -e 's/\.[^.]*$/.X/'
778 exit ;;
779 CRAY*TS:*:*:*)
780 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
781 exit ;;
782 CRAY*T3E:*:*:*)
783 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
784 exit ;;
785 CRAY*SV1:*:*:*)
786 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
787 exit ;;
788 *:UNICOS/mp:*:*)
789 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
790 exit ;;
791 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
792 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
793 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
795 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796 exit ;;
797 5000:UNIX_System_V:4.*:*)
798 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
800 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
801 exit ;;
802 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
803 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
804 exit ;;
805 sparc*:BSD/OS:*:*)
806 echo sparc-unknown-bsdi${UNAME_RELEASE}
807 exit ;;
808 *:BSD/OS:*:*)
809 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
810 exit ;;
811 *:FreeBSD:*:*)
812 UNAME_PROCESSOR=`/usr/bin/uname -p`
813 case ${UNAME_PROCESSOR} in
814 amd64)
815 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
816 *)
817 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
818 esac
819 exit ;;
820 i*:CYGWIN*:*)
821 echo ${UNAME_MACHINE}-pc-cygwin
822 exit ;;
823 *:MINGW64*:*)
824 echo ${UNAME_MACHINE}-pc-mingw64
825 exit ;;
826 *:MINGW*:*)
827 echo ${UNAME_MACHINE}-pc-mingw32
828 exit ;;
829 *:MSYS*:*)
830 echo ${UNAME_MACHINE}-pc-msys
831 exit ;;
832 i*:windows32*:*)
833 # uname -m includes "-pc" on this system.
834 echo ${UNAME_MACHINE}-mingw32
835 exit ;;
836 i*:PW*:*)
837 echo ${UNAME_MACHINE}-pc-pw32
838 exit ;;
839 *:Interix*:*)
840 case ${UNAME_MACHINE} in
841 x86)
842 echo i586-pc-interix${UNAME_RELEASE}
843 exit ;;
844 authenticamd | genuineintel | EM64T)
845 echo x86_64-unknown-interix${UNAME_RELEASE}
846 exit ;;
847 IA64)
848 echo ia64-unknown-interix${UNAME_RELEASE}
849 exit ;;
850 esac ;;
851 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
852 echo i${UNAME_MACHINE}-pc-mks
853 exit ;;
854 8664:Windows_NT:*)
855 echo x86_64-pc-mks
856 exit ;;
857 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
858 # How do we know it's Interix rather than the generic POSIX subsystem?
859 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
860 # UNAME_MACHINE based on the output of uname instead of i386?
861 echo i586-pc-interix
862 exit ;;
863 i*:UWIN*:*)
864 echo ${UNAME_MACHINE}-pc-uwin
865 exit ;;
866 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
867 echo x86_64-unknown-cygwin
868 exit ;;
869 p*:CYGWIN*:*)
870 echo powerpcle-unknown-cygwin
871 exit ;;
872 prep*:SunOS:5.*:*)
873 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
874 exit ;;
875 *:GNU:*:*)
876 # the GNU system
877 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
878 exit ;;
879 *:GNU/*:*:*)
880 # other systems with GNU libc and userland
881 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
882 exit ;;
883 i*86:Minix:*:*)
884 echo ${UNAME_MACHINE}-pc-minix
885 exit ;;
886 aarch64:Linux:*:*)
887 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
888 exit ;;
889 aarch64_be:Linux:*:*)
890 UNAME_MACHINE=aarch64_be
891 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
892 exit ;;
893 alpha:Linux:*:*)
894 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
895 EV5) UNAME_MACHINE=alphaev5 ;;
896 EV56) UNAME_MACHINE=alphaev56 ;;
897 PCA56) UNAME_MACHINE=alphapca56 ;;
898 PCA57) UNAME_MACHINE=alphapca56 ;;
899 EV6) UNAME_MACHINE=alphaev6 ;;
900 EV67) UNAME_MACHINE=alphaev67 ;;
901 EV68*) UNAME_MACHINE=alphaev68 ;;
902 esac
903 objdump --private-headers /bin/sh | grep -q ld.so.1
904 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
905 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
906 exit ;;
907 arc:Linux:*:* | arceb:Linux:*:*)
908 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
909 exit ;;
910 arm*:Linux:*:*)
911 eval $set_cc_for_build
912 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
913 | grep -q __ARM_EABI__
914 then
915 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
916 else
917 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918 | grep -q __ARM_PCS_VFP
919 then
920 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
921 else
922 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
923 fi
924 fi
925 exit ;;
926 avr32*:Linux:*:*)
927 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
928 exit ;;
929 cris:Linux:*:*)
930 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
931 exit ;;
932 crisv32:Linux:*:*)
933 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
934 exit ;;
935 frv:Linux:*:*)
936 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
937 exit ;;
938 hexagon:Linux:*:*)
939 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
940 exit ;;
941 i*86:Linux:*:*)
942 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
943 exit ;;
944 ia64:Linux:*:*)
945 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
946 exit ;;
947 m32r*:Linux:*:*)
948 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
949 exit ;;
950 m68*:Linux:*:*)
951 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
952 exit ;;
953 mips:Linux:*:* | mips64:Linux:*:*)
954 eval $set_cc_for_build
955 sed 's/^ //' << EOF >$dummy.c
956 #undef CPU
957 #undef ${UNAME_MACHINE}
958 #undef ${UNAME_MACHINE}el
959 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
960 CPU=${UNAME_MACHINE}el
961 #else
962 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
963 CPU=${UNAME_MACHINE}
964 #else
965 CPU=
966 #endif
967 #endif
968 EOF
969 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
970 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
971 ;;
972 openrisc*:Linux:*:*)
973 echo or1k-unknown-linux-${LIBC}
974 exit ;;
975 or32:Linux:*:* | or1k*:Linux:*:*)
976 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
977 exit ;;
978 padre:Linux:*:*)
979 echo sparc-unknown-linux-${LIBC}
980 exit ;;
981 parisc64:Linux:*:* | hppa64:Linux:*:*)
982 echo hppa64-unknown-linux-${LIBC}
983 exit ;;
984 parisc:Linux:*:* | hppa:Linux:*:*)
985 # Look for CPU level
986 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
987 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989 *) echo hppa-unknown-linux-${LIBC} ;;
990 esac
991 exit ;;
992 ppc64:Linux:*:*)
993 echo powerpc64-unknown-linux-${LIBC}
994 exit ;;
995 ppc:Linux:*:*)
996 echo powerpc-unknown-linux-${LIBC}
997 exit ;;
998 ppc64le:Linux:*:*)
999 echo powerpc64le-unknown-linux-${LIBC}
1000 exit ;;
1001 ppcle:Linux:*:*)
1002 echo powerpcle-unknown-linux-${LIBC}
1003 exit ;;
1004 s390:Linux:*:* | s390x:Linux:*:*)
1005 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1006 exit ;;
1007 sh64*:Linux:*:*)
1008 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1009 exit ;;
1010 sh*:Linux:*:*)
1011 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1012 exit ;;
1013 sparc:Linux:*:* | sparc64:Linux:*:*)
1014 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1015 exit ;;
1016 tile*:Linux:*:*)
1017 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1018 exit ;;
1019 vax:Linux:*:*)
1020 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1021 exit ;;
1022 x86_64:Linux:*:*)
1023 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1024 exit ;;
1025 xtensa*:Linux:*:*)
1026 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1027 exit ;;
1028 i*86:DYNIX/ptx:4*:*)
1029 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1030 # earlier versions are messed up and put the nodename in both
1031 # sysname and nodename.
1032 echo i386-sequent-sysv4
1033 exit ;;
1034 i*86:UNIX_SV:4.2MP:2.*)
1035 # Unixware is an offshoot of SVR4, but it has its own version
1036 # number series starting with 2...
1037 # I am not positive that other SVR4 systems won't match this,
1038 # I just have to hope. -- rms.
1039 # Use sysv4.2uw... so that sysv4* matches it.
1040 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1041 exit ;;
1042 i*86:OS/2:*:*)
1043 # If we were able to find `uname', then EMX Unix compatibility
1044 # is probably installed.
1045 echo ${UNAME_MACHINE}-pc-os2-emx
1046 exit ;;
1047 i*86:XTS-300:*:STOP)
1048 echo ${UNAME_MACHINE}-unknown-stop
1049 exit ;;
1050 i*86:atheos:*:*)
1051 echo ${UNAME_MACHINE}-unknown-atheos
1052 exit ;;
1053 i*86:syllable:*:*)
1054 echo ${UNAME_MACHINE}-pc-syllable
1055 exit ;;
1056 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1057 echo i386-unknown-lynxos${UNAME_RELEASE}
1058 exit ;;
1059 i*86:*DOS:*:*)
1060 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1061 exit ;;
1062 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1063 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1064 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1065 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1066 else
1067 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1068 fi
1069 exit ;;
1070 i*86:*:5:[678]*)
1071 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1072 case `/bin/uname -X | grep "^Machine"` in
1073 *486*) UNAME_MACHINE=i486 ;;
1074 *Pentium) UNAME_MACHINE=i586 ;;
1075 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1076 esac
1077 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1078 exit ;;
1079 i*86:*:3.2:*)
1080 if test -f /usr/options/cb.name; then
1081 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1082 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1083 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1084 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1085 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1086 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1087 && UNAME_MACHINE=i586
1088 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1089 && UNAME_MACHINE=i686
1090 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1091 && UNAME_MACHINE=i686
1092 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1093 else
1094 echo ${UNAME_MACHINE}-pc-sysv32
1095 fi
1096 exit ;;
1097 pc:*:*:*)
1098 # Left here for compatibility:
1099 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1100 # the processor, so we play safe by assuming i586.
1101 # Note: whatever this is, it MUST be the same as what config.sub
1102 # prints for the "djgpp" host, or else GDB configury will decide that
1103 # this is a cross-build.
1104 echo i586-pc-msdosdjgpp
1105 exit ;;
1106 Intel:Mach:3*:*)
1107 echo i386-pc-mach3
1108 exit ;;
1109 paragon:*:*:*)
1110 echo i860-intel-osf1
1111 exit ;;
1112 i860:*:4.*:*) # i860-SVR4
1113 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1114 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1115 else # Add other i860-SVR4 vendors below as they are discovered.
1116 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1117 fi
1118 exit ;;
1119 mini*:CTIX:SYS*5:*)
1120 # "miniframe"
1121 echo m68010-convergent-sysv
1122 exit ;;
1123 mc68k:UNIX:SYSTEM5:3.51m)
1124 echo m68k-convergent-sysv
1125 exit ;;
1126 M680?0:D-NIX:5.3:*)
1127 echo m68k-diab-dnix
1128 exit ;;
1129 M68*:*:R3V[5678]*:*)
1130 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1131 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1132 OS_REL=''
1133 test -r /etc/.relid \
1134 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1135 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1136 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1137 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1138 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1139 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1140 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1141 && { echo i486-ncr-sysv4; exit; } ;;
1142 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1143 OS_REL='.3'
1144 test -r /etc/.relid \
1145 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1146 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1147 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1148 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1149 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1150 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1151 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1152 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1153 echo m68k-unknown-lynxos${UNAME_RELEASE}
1154 exit ;;
1155 mc68030:UNIX_System_V:4.*:*)
1156 echo m68k-atari-sysv4
1157 exit ;;
1158 TSUNAMI:LynxOS:2.*:*)
1159 echo sparc-unknown-lynxos${UNAME_RELEASE}
1160 exit ;;
1161 rs6000:LynxOS:2.*:*)
1162 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1163 exit ;;
1164 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1165 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1166 exit ;;
1167 SM[BE]S:UNIX_SV:*:*)
1168 echo mips-dde-sysv${UNAME_RELEASE}
1169 exit ;;
1170 RM*:ReliantUNIX-*:*:*)
1171 echo mips-sni-sysv4
1172 exit ;;
1173 RM*:SINIX-*:*:*)
1174 echo mips-sni-sysv4
1175 exit ;;
1176 *:SINIX-*:*:*)
1177 if uname -p 2>/dev/null >/dev/null ; then
1178 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1179 echo ${UNAME_MACHINE}-sni-sysv4
1180 else
1181 echo ns32k-sni-sysv
1182 fi
1183 exit ;;
1184 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1185 # says <Richard.M.Bartel@ccMail.Census.GOV>
1186 echo i586-unisys-sysv4
1187 exit ;;
1188 *:UNIX_System_V:4*:FTX*)
1189 # From Gerald Hewes <hewes@openmarket.com>.
1190 # How about differentiating between stratus architectures? -djm
1191 echo hppa1.1-stratus-sysv4
1192 exit ;;
1193 *:*:*:FTX*)
1194 # From seanf@swdc.stratus.com.
1195 echo i860-stratus-sysv4
1196 exit ;;
1197 i*86:VOS:*:*)
1198 # From Paul.Green@stratus.com.
1199 echo ${UNAME_MACHINE}-stratus-vos
1200 exit ;;
1201 *:VOS:*:*)
1202 # From Paul.Green@stratus.com.
1203 echo hppa1.1-stratus-vos
1204 exit ;;
1205 mc68*:A/UX:*:*)
1206 echo m68k-apple-aux${UNAME_RELEASE}
1207 exit ;;
1208 news*:NEWS-OS:6*:*)
1209 echo mips-sony-newsos6
1210 exit ;;
1211 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1212 if [ -d /usr/nec ]; then
1213 echo mips-nec-sysv${UNAME_RELEASE}
1214 else
1215 echo mips-unknown-sysv${UNAME_RELEASE}
1216 fi
1217 exit ;;
1218 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1219 echo powerpc-be-beos
1220 exit ;;
1221 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1222 echo powerpc-apple-beos
1223 exit ;;
1224 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1225 echo i586-pc-beos
1226 exit ;;
1227 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1228 echo i586-pc-haiku
1229 exit ;;
1230 x86_64:Haiku:*:*)
1231 echo x86_64-unknown-haiku
1232 exit ;;
1233 SX-4:SUPER-UX:*:*)
1234 echo sx4-nec-superux${UNAME_RELEASE}
1235 exit ;;
1236 SX-5:SUPER-UX:*:*)
1237 echo sx5-nec-superux${UNAME_RELEASE}
1238 exit ;;
1239 SX-6:SUPER-UX:*:*)
1240 echo sx6-nec-superux${UNAME_RELEASE}
1241 exit ;;
1242 SX-7:SUPER-UX:*:*)
1243 echo sx7-nec-superux${UNAME_RELEASE}
1244 exit ;;
1245 SX-8:SUPER-UX:*:*)
1246 echo sx8-nec-superux${UNAME_RELEASE}
1247 exit ;;
1248 SX-8R:SUPER-UX:*:*)
1249 echo sx8r-nec-superux${UNAME_RELEASE}
1250 exit ;;
1251 Power*:Rhapsody:*:*)
1252 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1253 exit ;;
1254 *:Rhapsody:*:*)
1255 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1256 exit ;;
1257 *:Darwin:*:*)
1258 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1259 eval $set_cc_for_build
1260 if test "$UNAME_PROCESSOR" = unknown ; then
1261 UNAME_PROCESSOR=powerpc
1262 fi
1263 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1264 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1265 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1266 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1267 grep IS_64BIT_ARCH >/dev/null
1268 then
1269 case $UNAME_PROCESSOR in
1270 i386) UNAME_PROCESSOR=x86_64 ;;
1271 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1272 esac
1273 fi
1274 fi
1275 elif test "$UNAME_PROCESSOR" = i386 ; then
1276 # Avoid executing cc on OS X 10.9, as it ships with a stub
1277 # that puts up a graphical alert prompting to install
1278 # developer tools. Any system running Mac OS X 10.7 or
1279 # later (Darwin 11 and later) is required to have a 64-bit
1280 # processor. This is not true of the ARM version of Darwin
1281 # that Apple uses in portable devices.
1282 UNAME_PROCESSOR=x86_64
1283 fi
1284 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1285 exit ;;
1286 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1287 UNAME_PROCESSOR=`uname -p`
1288 if test "$UNAME_PROCESSOR" = "x86"; then
1289 UNAME_PROCESSOR=i386
1290 UNAME_MACHINE=pc
1291 fi
1292 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1293 exit ;;
1294 *:QNX:*:4*)
1295 echo i386-pc-qnx
1296 exit ;;
1297 NEO-?:NONSTOP_KERNEL:*:*)
1298 echo neo-tandem-nsk${UNAME_RELEASE}
1299 exit ;;
1300 NSE-*:NONSTOP_KERNEL:*:*)
1301 echo nse-tandem-nsk${UNAME_RELEASE}
1302 exit ;;
1303 NSR-?:NONSTOP_KERNEL:*:*)
1304 echo nsr-tandem-nsk${UNAME_RELEASE}
1305 exit ;;
1306 *:NonStop-UX:*:*)
1307 echo mips-compaq-nonstopux
1308 exit ;;
1309 BS2000:POSIX*:*:*)
1310 echo bs2000-siemens-sysv
1311 exit ;;
1312 DS/*:UNIX_System_V:*:*)
1313 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1314 exit ;;
1315 *:Plan9:*:*)
1316 # "uname -m" is not consistent, so use $cputype instead. 386
1317 # is converted to i386 for consistency with other x86
1318 # operating systems.
1319 if test "$cputype" = "386"; then
1320 UNAME_MACHINE=i386
1321 else
1322 UNAME_MACHINE="$cputype"
1323 fi
1324 echo ${UNAME_MACHINE}-unknown-plan9
1325 exit ;;
1326 *:TOPS-10:*:*)
1327 echo pdp10-unknown-tops10
1328 exit ;;
1329 *:TENEX:*:*)
1330 echo pdp10-unknown-tenex
1331 exit ;;
1332 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1333 echo pdp10-dec-tops20
1334 exit ;;
1335 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1336 echo pdp10-xkl-tops20
1337 exit ;;
1338 *:TOPS-20:*:*)
1339 echo pdp10-unknown-tops20
1340 exit ;;
1341 *:ITS:*:*)
1342 echo pdp10-unknown-its
1343 exit ;;
1344 SEI:*:*:SEIUX)
1345 echo mips-sei-seiux${UNAME_RELEASE}
1346 exit ;;
1347 *:DragonFly:*:*)
1348 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1349 exit ;;
1350 *:*VMS:*:*)
1351 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1352 case "${UNAME_MACHINE}" in
1353 A*) echo alpha-dec-vms ; exit ;;
1354 I*) echo ia64-dec-vms ; exit ;;
1355 V*) echo vax-dec-vms ; exit ;;
1356 esac ;;
1357 *:XENIX:*:SysV)
1358 echo i386-pc-xenix
1359 exit ;;
1360 i*86:skyos:*:*)
1361 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1362 exit ;;
1363 i*86:rdos:*:*)
1364 echo ${UNAME_MACHINE}-pc-rdos
1365 exit ;;
1366 i*86:AROS:*:*)
1367 echo ${UNAME_MACHINE}-pc-aros
1368 exit ;;
1369 x86_64:VMkernel:*:*)
1370 echo ${UNAME_MACHINE}-unknown-esx
1371 exit ;;
1372 esac
1373
1374 cat >&2 <<EOF
1375 $0: unable to guess system type
1376
1377 This script, last modified $timestamp, has failed to recognize
1378 the operating system you are using. It is advised that you
1379 download the most up to date version of the config scripts from
1380
1381 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1382 and
1383 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1384
1385 If the version you run ($0) is already up to date, please
1386 send the following data and any information you think might be
1387 pertinent to <config-patches@gnu.org> in order to provide the needed
1388 information to handle your system.
1389
1390 config.guess timestamp = $timestamp
1391
1392 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1393 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1394 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1395 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1396
1397 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1398 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1399
1400 hostinfo = `(hostinfo) 2>/dev/null`
1401 /bin/universe = `(/bin/universe) 2>/dev/null`
1402 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1403 /bin/arch = `(/bin/arch) 2>/dev/null`
1404 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1405 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1406
1407 UNAME_MACHINE = ${UNAME_MACHINE}
1408 UNAME_RELEASE = ${UNAME_RELEASE}
1409 UNAME_SYSTEM = ${UNAME_SYSTEM}
1410 UNAME_VERSION = ${UNAME_VERSION}
1411 EOF
1412
1413 exit 1
1414
1415 # Local variables:
1416 # eval: (add-hook 'write-file-hooks 'time-stamp)
1417 # time-stamp-start: "timestamp='"
1418 # time-stamp-format: "%:y-%02m-%02d"
1419 # time-stamp-end: "'"
1420 # End:
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-12-03'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches to <config-patches@gnu.org>.
28 #
29 # Configuration subroutine to validate and canonicalize a configuration type.
30 # Supply the specified configuration type as an argument.
31 # If it is invalid, we print an error message on stderr and exit with code 1.
32 # Otherwise, we print the canonical config type on stdout and succeed.
33
34 # You can get the latest version of this script from:
35 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
36
37 # This file is supposed to be the same for all GNU packages
38 # and recognize all the CPU types, system types and aliases
39 # that are meaningful with *any* GNU software.
40 # Each package is responsible for reporting which valid configurations
41 # it does not support. The user should be able to distinguish
42 # a failure to support a valid configuration from a meaningless
43 # configuration.
44
45 # The goal of this file is to map all the various variations of a given
46 # machine specification into a single specification in the form:
47 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
48 # or in some cases, the newer four-part form:
49 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
50 # It is wrong to echo any other type of specification.
51
52 me=`echo "$0" | sed -e 's,.*/,,'`
53
54 usage="\
55 Usage: $0 [OPTION] CPU-MFR-OPSYS
56 $0 [OPTION] ALIAS
57
58 Canonicalize a configuration name.
59
60 Operation modes:
61 -h, --help print this help, then exit
62 -t, --time-stamp print date of last modification, then exit
63 -v, --version print version number, then exit
64
65 Report bugs and patches to <config-patches@gnu.org>."
66
67 version="\
68 GNU config.sub ($timestamp)
69
70 Copyright 1992-2014 Free Software Foundation, Inc.
71
72 This is free software; see the source for copying conditions. There is NO
73 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
74
75 help="
76 Try \`$me --help' for more information."
77
78 # Parse command line
79 while test $# -gt 0 ; do
80 case $1 in
81 --time-stamp | --time* | -t )
82 echo "$timestamp" ; exit ;;
83 --version | -v )
84 echo "$version" ; exit ;;
85 --help | --h* | -h )
86 echo "$usage"; exit ;;
87 -- ) # Stop option processing
88 shift; break ;;
89 - ) # Use stdin as input.
90 break ;;
91 -* )
92 echo "$me: invalid option $1$help"
93 exit 1 ;;
94
95 *local*)
96 # First pass through any local machine types.
97 echo $1
98 exit ;;
99
100 * )
101 break ;;
102 esac
103 done
104
105 case $# in
106 0) echo "$me: missing argument$help" >&2
107 exit 1;;
108 1) ;;
109 *) echo "$me: too many arguments$help" >&2
110 exit 1;;
111 esac
112
113 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
114 # Here we must recognize all the valid KERNEL-OS combinations.
115 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116 case $maybe_os in
117 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119 knetbsd*-gnu* | netbsd*-gnu* | \
120 kopensolaris*-gnu* | \
121 storm-chaos* | os2-emx* | rtmk-nova*)
122 os=-$maybe_os
123 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124 ;;
125 android-linux)
126 os=-linux-android
127 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128 ;;
129 *)
130 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131 if [ $basic_machine != $1 ]
132 then os=`echo $1 | sed 's/.*-/-/'`
133 else os=; fi
134 ;;
135 esac
136
137 ### Let's recognize common machines as not being operating systems so
138 ### that things like config.sub decstation-3100 work. We also
139 ### recognize some manufacturers as not being operating systems, so we
140 ### can provide default operating systems below.
141 case $os in
142 -sun*os*)
143 # Prevent following clause from handling this invalid input.
144 ;;
145 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151 -apple | -axis | -knuth | -cray | -microblaze*)
152 os=
153 basic_machine=$1
154 ;;
155 -bluegene*)
156 os=-cnk
157 ;;
158 -sim | -cisco | -oki | -wec | -winbond)
159 os=
160 basic_machine=$1
161 ;;
162 -scout)
163 ;;
164 -wrs)
165 os=-vxworks
166 basic_machine=$1
167 ;;
168 -chorusos*)
169 os=-chorusos
170 basic_machine=$1
171 ;;
172 -chorusrdb)
173 os=-chorusrdb
174 basic_machine=$1
175 ;;
176 -hiux*)
177 os=-hiuxwe2
178 ;;
179 -sco6)
180 os=-sco5v6
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco5)
184 os=-sco3.2v5
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco4)
188 os=-sco3.2v4
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2.[4-9]*)
192 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco3.2v[4-9]*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco5v6*)
200 # Don't forget version if it is 3.2v4 or newer.
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -sco*)
204 os=-sco3.2v2
205 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206 ;;
207 -udk*)
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -isc)
211 os=-isc2.2
212 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
213 ;;
214 -clix*)
215 basic_machine=clipper-intergraph
216 ;;
217 -isc*)
218 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219 ;;
220 -lynx*178)
221 os=-lynxos178
222 ;;
223 -lynx*5)
224 os=-lynxos5
225 ;;
226 -lynx*)
227 os=-lynxos
228 ;;
229 -ptx*)
230 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231 ;;
232 -windowsnt*)
233 os=`echo $os | sed -e 's/windowsnt/winnt/'`
234 ;;
235 -psos*)
236 os=-psos
237 ;;
238 -mint | -mint[0-9]*)
239 basic_machine=m68k-atari
240 os=-mint
241 ;;
242 esac
243
244 # Decode aliases for certain CPU-COMPANY combinations.
245 case $basic_machine in
246 # Recognize the basic CPU types without company name.
247 # Some are omitted here because they have special meanings below.
248 1750a | 580 \
249 | a29k \
250 | aarch64 | aarch64_be \
251 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
252 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
253 | am33_2.0 \
254 | arc | arceb \
255 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256 | avr | avr32 \
257 | be32 | be64 \
258 | bfin \
259 | c4x | c8051 | clipper \
260 | d10v | d30v | dlx | dsp16xx \
261 | epiphany \
262 | fido | fr30 | frv \
263 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
264 | hexagon \
265 | i370 | i860 | i960 | ia64 \
266 | ip2k | iq2000 \
267 | k1om \
268 | le32 | le64 \
269 | lm32 \
270 | m32c | m32r | m32rle | m68000 | m68k | m88k \
271 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
272 | mips | mipsbe | mipseb | mipsel | mipsle \
273 | mips16 \
274 | mips64 | mips64el \
275 | mips64octeon | mips64octeonel \
276 | mips64orion | mips64orionel \
277 | mips64r5900 | mips64r5900el \
278 | mips64vr | mips64vrel \
279 | mips64vr4100 | mips64vr4100el \
280 | mips64vr4300 | mips64vr4300el \
281 | mips64vr5000 | mips64vr5000el \
282 | mips64vr5900 | mips64vr5900el \
283 | mipsisa32 | mipsisa32el \
284 | mipsisa32r2 | mipsisa32r2el \
285 | mipsisa32r6 | mipsisa32r6el \
286 | mipsisa64 | mipsisa64el \
287 | mipsisa64r2 | mipsisa64r2el \
288 | mipsisa64r6 | mipsisa64r6el \
289 | mipsisa64sb1 | mipsisa64sb1el \
290 | mipsisa64sr71k | mipsisa64sr71kel \
291 | mipsr5900 | mipsr5900el \
292 | mipstx39 | mipstx39el \
293 | mn10200 | mn10300 \
294 | moxie \
295 | mt \
296 | msp430 \
297 | nds32 | nds32le | nds32be \
298 | nios | nios2 | nios2eb | nios2el \
299 | ns16k | ns32k \
300 | open8 | or1k | or1knd | or32 \
301 | pdp10 | pdp11 | pj | pjl \
302 | powerpc | powerpc64 | powerpc64le | powerpcle \
303 | pyramid \
304 | riscv32 | riscv64 \
305 | rl78 | rx \
306 | score \
307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
308 | sh64 | sh64le \
309 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
310 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
311 | spu \
312 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
313 | ubicom32 \
314 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
315 | visium \
316 | we32k \
317 | x86 | xc16x | xstormy16 | xtensa \
318 | z8k | z80)
319 basic_machine=$basic_machine-unknown
320 ;;
321 c54x)
322 basic_machine=tic54x-unknown
323 ;;
324 c55x)
325 basic_machine=tic55x-unknown
326 ;;
327 c6x)
328 basic_machine=tic6x-unknown
329 ;;
330 leon|leon[3-9])
331 basic_machine=sparc-$basic_machine
332 ;;
333 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
334 basic_machine=$basic_machine-unknown
335 os=-none
336 ;;
337 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
338 ;;
339 ms1)
340 basic_machine=mt-unknown
341 ;;
342
343 strongarm | thumb | xscale)
344 basic_machine=arm-unknown
345 ;;
346 xgate)
347 basic_machine=$basic_machine-unknown
348 os=-none
349 ;;
350 xscaleeb)
351 basic_machine=armeb-unknown
352 ;;
353
354 xscaleel)
355 basic_machine=armel-unknown
356 ;;
357
358 # We use `pc' rather than `unknown'
359 # because (1) that's what they normally are, and
360 # (2) the word "unknown" tends to confuse beginning users.
361 i*86 | x86_64)
362 basic_machine=$basic_machine-pc
363 ;;
364 # Object if more than one company name word.
365 *-*-*)
366 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
367 exit 1
368 ;;
369 # Recognize the basic CPU types with company name.
370 580-* \
371 | a29k-* \
372 | aarch64-* | aarch64_be-* \
373 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
374 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
375 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
376 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
377 | avr-* | avr32-* \
378 | be32-* | be64-* \
379 | bfin-* | bs2000-* \
380 | c[123]* | c30-* | [cjt]90-* | c4x-* \
381 | c8051-* | clipper-* | craynv-* | cydra-* \
382 | d10v-* | d30v-* | dlx-* \
383 | elxsi-* \
384 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
385 | h8300-* | h8500-* \
386 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
387 | hexagon-* \
388 | i*86-* | i860-* | i960-* | ia64-* \
389 | ip2k-* | iq2000-* \
390 | k1om-* \
391 | le32-* | le64-* \
392 | lm32-* \
393 | m32c-* | m32r-* | m32rle-* \
394 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
395 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
396 | microblaze-* | microblazeel-* \
397 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
398 | mips16-* \
399 | mips64-* | mips64el-* \
400 | mips64octeon-* | mips64octeonel-* \
401 | mips64orion-* | mips64orionel-* \
402 | mips64r5900-* | mips64r5900el-* \
403 | mips64vr-* | mips64vrel-* \
404 | mips64vr4100-* | mips64vr4100el-* \
405 | mips64vr4300-* | mips64vr4300el-* \
406 | mips64vr5000-* | mips64vr5000el-* \
407 | mips64vr5900-* | mips64vr5900el-* \
408 | mipsisa32-* | mipsisa32el-* \
409 | mipsisa32r2-* | mipsisa32r2el-* \
410 | mipsisa32r6-* | mipsisa32r6el-* \
411 | mipsisa64-* | mipsisa64el-* \
412 | mipsisa64r2-* | mipsisa64r2el-* \
413 | mipsisa64r6-* | mipsisa64r6el-* \
414 | mipsisa64sb1-* | mipsisa64sb1el-* \
415 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
416 | mipsr5900-* | mipsr5900el-* \
417 | mipstx39-* | mipstx39el-* \
418 | mmix-* \
419 | mt-* \
420 | msp430-* \
421 | nds32-* | nds32le-* | nds32be-* \
422 | nios-* | nios2-* | nios2eb-* | nios2el-* \
423 | none-* | np1-* | ns16k-* | ns32k-* \
424 | open8-* \
425 | or1k*-* \
426 | orion-* \
427 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
428 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
429 | pyramid-* \
430 | rl78-* | romp-* | rs6000-* | rx-* \
431 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
432 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
433 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
434 | sparclite-* \
435 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
436 | tahoe-* \
437 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
438 | tile*-* \
439 | tron-* \
440 | ubicom32-* \
441 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
442 | vax-* \
443 | visium-* \
444 | we32k-* \
445 | x86-* | x86_64-* | xc16x-* | xps100-* \
446 | xstormy16-* | xtensa*-* \
447 | ymp-* \
448 | z8k-* | z80-*)
449 ;;
450 # Recognize the basic CPU types without company name, with glob match.
451 xtensa*)
452 basic_machine=$basic_machine-unknown
453 ;;
454 # Recognize the various machine names and aliases which stand
455 # for a CPU type and a company and sometimes even an OS.
456 386bsd)
457 basic_machine=i386-unknown
458 os=-bsd
459 ;;
460 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
461 basic_machine=m68000-att
462 ;;
463 3b*)
464 basic_machine=we32k-att
465 ;;
466 a29khif)
467 basic_machine=a29k-amd
468 os=-udi
469 ;;
470 abacus)
471 basic_machine=abacus-unknown
472 ;;
473 adobe68k)
474 basic_machine=m68010-adobe
475 os=-scout
476 ;;
477 alliant | fx80)
478 basic_machine=fx80-alliant
479 ;;
480 altos | altos3068)
481 basic_machine=m68k-altos
482 ;;
483 am29k)
484 basic_machine=a29k-none
485 os=-bsd
486 ;;
487 amd64)
488 basic_machine=x86_64-pc
489 ;;
490 amd64-*)
491 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
492 ;;
493 amdahl)
494 basic_machine=580-amdahl
495 os=-sysv
496 ;;
497 amiga | amiga-*)
498 basic_machine=m68k-unknown
499 ;;
500 amigaos | amigados)
501 basic_machine=m68k-unknown
502 os=-amigaos
503 ;;
504 amigaunix | amix)
505 basic_machine=m68k-unknown
506 os=-sysv4
507 ;;
508 apollo68)
509 basic_machine=m68k-apollo
510 os=-sysv
511 ;;
512 apollo68bsd)
513 basic_machine=m68k-apollo
514 os=-bsd
515 ;;
516 aros)
517 basic_machine=i386-pc
518 os=-aros
519 ;;
520 aux)
521 basic_machine=m68k-apple
522 os=-aux
523 ;;
524 balance)
525 basic_machine=ns32k-sequent
526 os=-dynix
527 ;;
528 blackfin)
529 basic_machine=bfin-unknown
530 os=-linux
531 ;;
532 blackfin-*)
533 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
534 os=-linux
535 ;;
536 bluegene*)
537 basic_machine=powerpc-ibm
538 os=-cnk
539 ;;
540 c54x-*)
541 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
542 ;;
543 c55x-*)
544 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
545 ;;
546 c6x-*)
547 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
548 ;;
549 c90)
550 basic_machine=c90-cray
551 os=-unicos
552 ;;
553 cegcc)
554 basic_machine=arm-unknown
555 os=-cegcc
556 ;;
557 convex-c1)
558 basic_machine=c1-convex
559 os=-bsd
560 ;;
561 convex-c2)
562 basic_machine=c2-convex
563 os=-bsd
564 ;;
565 convex-c32)
566 basic_machine=c32-convex
567 os=-bsd
568 ;;
569 convex-c34)
570 basic_machine=c34-convex
571 os=-bsd
572 ;;
573 convex-c38)
574 basic_machine=c38-convex
575 os=-bsd
576 ;;
577 cray | j90)
578 basic_machine=j90-cray
579 os=-unicos
580 ;;
581 craynv)
582 basic_machine=craynv-cray
583 os=-unicosmp
584 ;;
585 cr16 | cr16-*)
586 basic_machine=cr16-unknown
587 os=-elf
588 ;;
589 crds | unos)
590 basic_machine=m68k-crds
591 ;;
592 crisv32 | crisv32-* | etraxfs*)
593 basic_machine=crisv32-axis
594 ;;
595 cris | cris-* | etrax*)
596 basic_machine=cris-axis
597 ;;
598 crx)
599 basic_machine=crx-unknown
600 os=-elf
601 ;;
602 da30 | da30-*)
603 basic_machine=m68k-da30
604 ;;
605 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
606 basic_machine=mips-dec
607 ;;
608 decsystem10* | dec10*)
609 basic_machine=pdp10-dec
610 os=-tops10
611 ;;
612 decsystem20* | dec20*)
613 basic_machine=pdp10-dec
614 os=-tops20
615 ;;
616 delta | 3300 | motorola-3300 | motorola-delta \
617 | 3300-motorola | delta-motorola)
618 basic_machine=m68k-motorola
619 ;;
620 delta88)
621 basic_machine=m88k-motorola
622 os=-sysv3
623 ;;
624 dicos)
625 basic_machine=i686-pc
626 os=-dicos
627 ;;
628 djgpp)
629 basic_machine=i586-pc
630 os=-msdosdjgpp
631 ;;
632 dpx20 | dpx20-*)
633 basic_machine=rs6000-bull
634 os=-bosx
635 ;;
636 dpx2* | dpx2*-bull)
637 basic_machine=m68k-bull
638 os=-sysv3
639 ;;
640 ebmon29k)
641 basic_machine=a29k-amd
642 os=-ebmon
643 ;;
644 elxsi)
645 basic_machine=elxsi-elxsi
646 os=-bsd
647 ;;
648 encore | umax | mmax)
649 basic_machine=ns32k-encore
650 ;;
651 es1800 | OSE68k | ose68k | ose | OSE)
652 basic_machine=m68k-ericsson
653 os=-ose
654 ;;
655 fx2800)
656 basic_machine=i860-alliant
657 ;;
658 genix)
659 basic_machine=ns32k-ns
660 ;;
661 gmicro)
662 basic_machine=tron-gmicro
663 os=-sysv
664 ;;
665 go32)
666 basic_machine=i386-pc
667 os=-go32
668 ;;
669 h3050r* | hiux*)
670 basic_machine=hppa1.1-hitachi
671 os=-hiuxwe2
672 ;;
673 h8300hms)
674 basic_machine=h8300-hitachi
675 os=-hms
676 ;;
677 h8300xray)
678 basic_machine=h8300-hitachi
679 os=-xray
680 ;;
681 h8500hms)
682 basic_machine=h8500-hitachi
683 os=-hms
684 ;;
685 harris)
686 basic_machine=m88k-harris
687 os=-sysv3
688 ;;
689 hp300-*)
690 basic_machine=m68k-hp
691 ;;
692 hp300bsd)
693 basic_machine=m68k-hp
694 os=-bsd
695 ;;
696 hp300hpux)
697 basic_machine=m68k-hp
698 os=-hpux
699 ;;
700 hp3k9[0-9][0-9] | hp9[0-9][0-9])
701 basic_machine=hppa1.0-hp
702 ;;
703 hp9k2[0-9][0-9] | hp9k31[0-9])
704 basic_machine=m68000-hp
705 ;;
706 hp9k3[2-9][0-9])
707 basic_machine=m68k-hp
708 ;;
709 hp9k6[0-9][0-9] | hp6[0-9][0-9])
710 basic_machine=hppa1.0-hp
711 ;;
712 hp9k7[0-79][0-9] | hp7[0-79][0-9])
713 basic_machine=hppa1.1-hp
714 ;;
715 hp9k78[0-9] | hp78[0-9])
716 # FIXME: really hppa2.0-hp
717 basic_machine=hppa1.1-hp
718 ;;
719 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
720 # FIXME: really hppa2.0-hp
721 basic_machine=hppa1.1-hp
722 ;;
723 hp9k8[0-9][13679] | hp8[0-9][13679])
724 basic_machine=hppa1.1-hp
725 ;;
726 hp9k8[0-9][0-9] | hp8[0-9][0-9])
727 basic_machine=hppa1.0-hp
728 ;;
729 hppa-next)
730 os=-nextstep3
731 ;;
732 hppaosf)
733 basic_machine=hppa1.1-hp
734 os=-osf
735 ;;
736 hppro)
737 basic_machine=hppa1.1-hp
738 os=-proelf
739 ;;
740 i370-ibm* | ibm*)
741 basic_machine=i370-ibm
742 ;;
743 i*86v32)
744 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
745 os=-sysv32
746 ;;
747 i*86v4*)
748 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
749 os=-sysv4
750 ;;
751 i*86v)
752 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
753 os=-sysv
754 ;;
755 i*86sol2)
756 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
757 os=-solaris2
758 ;;
759 i386mach)
760 basic_machine=i386-mach
761 os=-mach
762 ;;
763 i386-vsta | vsta)
764 basic_machine=i386-unknown
765 os=-vsta
766 ;;
767 iris | iris4d)
768 basic_machine=mips-sgi
769 case $os in
770 -irix*)
771 ;;
772 *)
773 os=-irix4
774 ;;
775 esac
776 ;;
777 isi68 | isi)
778 basic_machine=m68k-isi
779 os=-sysv
780 ;;
781 leon-*|leon[3-9]-*)
782 basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
783 ;;
784 m68knommu)
785 basic_machine=m68k-unknown
786 os=-linux
787 ;;
788 m68knommu-*)
789 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
790 os=-linux
791 ;;
792 m88k-omron*)
793 basic_machine=m88k-omron
794 ;;
795 magnum | m3230)
796 basic_machine=mips-mips
797 os=-sysv
798 ;;
799 merlin)
800 basic_machine=ns32k-utek
801 os=-sysv
802 ;;
803 microblaze*)
804 basic_machine=microblaze-xilinx
805 ;;
806 mingw64)
807 basic_machine=x86_64-pc
808 os=-mingw64
809 ;;
810 mingw32)
811 basic_machine=i686-pc
812 os=-mingw32
813 ;;
814 mingw32ce)
815 basic_machine=arm-unknown
816 os=-mingw32ce
817 ;;
818 miniframe)
819 basic_machine=m68000-convergent
820 ;;
821 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
822 basic_machine=m68k-atari
823 os=-mint
824 ;;
825 mips3*-*)
826 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
827 ;;
828 mips3*)
829 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
830 ;;
831 monitor)
832 basic_machine=m68k-rom68k
833 os=-coff
834 ;;
835 morphos)
836 basic_machine=powerpc-unknown
837 os=-morphos
838 ;;
839 moxiebox)
840 basic_machine=moxie-unknown
841 os=-moxiebox
842 ;;
843 msdos)
844 basic_machine=i386-pc
845 os=-msdos
846 ;;
847 ms1-*)
848 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
849 ;;
850 msys)
851 basic_machine=i686-pc
852 os=-msys
853 ;;
854 mvs)
855 basic_machine=i370-ibm
856 os=-mvs
857 ;;
858 nacl)
859 basic_machine=le32-unknown
860 os=-nacl
861 ;;
862 ncr3000)
863 basic_machine=i486-ncr
864 os=-sysv4
865 ;;
866 netbsd386)
867 basic_machine=i386-unknown
868 os=-netbsd
869 ;;
870 netwinder)
871 basic_machine=armv4l-rebel
872 os=-linux
873 ;;
874 news | news700 | news800 | news900)
875 basic_machine=m68k-sony
876 os=-newsos
877 ;;
878 news1000)
879 basic_machine=m68030-sony
880 os=-newsos
881 ;;
882 news-3600 | risc-news)
883 basic_machine=mips-sony
884 os=-newsos
885 ;;
886 necv70)
887 basic_machine=v70-nec
888 os=-sysv
889 ;;
890 next | m*-next )
891 basic_machine=m68k-next
892 case $os in
893 -nextstep* )
894 ;;
895 -ns2*)
896 os=-nextstep2
897 ;;
898 *)
899 os=-nextstep3
900 ;;
901 esac
902 ;;
903 nh3000)
904 basic_machine=m68k-harris
905 os=-cxux
906 ;;
907 nh[45]000)
908 basic_machine=m88k-harris
909 os=-cxux
910 ;;
911 nindy960)
912 basic_machine=i960-intel
913 os=-nindy
914 ;;
915 mon960)
916 basic_machine=i960-intel
917 os=-mon960
918 ;;
919 nonstopux)
920 basic_machine=mips-compaq
921 os=-nonstopux
922 ;;
923 np1)
924 basic_machine=np1-gould
925 ;;
926 neo-tandem)
927 basic_machine=neo-tandem
928 ;;
929 nse-tandem)
930 basic_machine=nse-tandem
931 ;;
932 nsr-tandem)
933 basic_machine=nsr-tandem
934 ;;
935 op50n-* | op60c-*)
936 basic_machine=hppa1.1-oki
937 os=-proelf
938 ;;
939 openrisc | openrisc-*)
940 basic_machine=or32-unknown
941 ;;
942 os400)
943 basic_machine=powerpc-ibm
944 os=-os400
945 ;;
946 OSE68000 | ose68000)
947 basic_machine=m68000-ericsson
948 os=-ose
949 ;;
950 os68k)
951 basic_machine=m68k-none
952 os=-os68k
953 ;;
954 pa-hitachi)
955 basic_machine=hppa1.1-hitachi
956 os=-hiuxwe2
957 ;;
958 paragon)
959 basic_machine=i860-intel
960 os=-osf
961 ;;
962 parisc)
963 basic_machine=hppa-unknown
964 os=-linux
965 ;;
966 parisc-*)
967 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
968 os=-linux
969 ;;
970 pbd)
971 basic_machine=sparc-tti
972 ;;
973 pbb)
974 basic_machine=m68k-tti
975 ;;
976 pc532 | pc532-*)
977 basic_machine=ns32k-pc532
978 ;;
979 pc98)
980 basic_machine=i386-pc
981 ;;
982 pc98-*)
983 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
984 ;;
985 pentium | p5 | k5 | k6 | nexgen | viac3)
986 basic_machine=i586-pc
987 ;;
988 pentiumpro | p6 | 6x86 | athlon | athlon_*)
989 basic_machine=i686-pc
990 ;;
991 pentiumii | pentium2 | pentiumiii | pentium3)
992 basic_machine=i686-pc
993 ;;
994 pentium4)
995 basic_machine=i786-pc
996 ;;
997 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
998 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
999 ;;
1000 pentiumpro-* | p6-* | 6x86-* | athlon-*)
1001 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1002 ;;
1003 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1004 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1005 ;;
1006 pentium4-*)
1007 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
1008 ;;
1009 pn)
1010 basic_machine=pn-gould
1011 ;;
1012 power) basic_machine=power-ibm
1013 ;;
1014 ppc | ppcbe) basic_machine=powerpc-unknown
1015 ;;
1016 ppc-* | ppcbe-*)
1017 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1018 ;;
1019 ppcle | powerpclittle | ppc-le | powerpc-little)
1020 basic_machine=powerpcle-unknown
1021 ;;
1022 ppcle-* | powerpclittle-*)
1023 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1024 ;;
1025 ppc64) basic_machine=powerpc64-unknown
1026 ;;
1027 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1028 ;;
1029 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1030 basic_machine=powerpc64le-unknown
1031 ;;
1032 ppc64le-* | powerpc64little-*)
1033 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1034 ;;
1035 ps2)
1036 basic_machine=i386-ibm
1037 ;;
1038 pw32)
1039 basic_machine=i586-unknown
1040 os=-pw32
1041 ;;
1042 rdos | rdos64)
1043 basic_machine=x86_64-pc
1044 os=-rdos
1045 ;;
1046 rdos32)
1047 basic_machine=i386-pc
1048 os=-rdos
1049 ;;
1050 rom68k)
1051 basic_machine=m68k-rom68k
1052 os=-coff
1053 ;;
1054 rm[46]00)
1055 basic_machine=mips-siemens
1056 ;;
1057 rtpc | rtpc-*)
1058 basic_machine=romp-ibm
1059 ;;
1060 s390 | s390-*)
1061 basic_machine=s390-ibm
1062 ;;
1063 s390x | s390x-*)
1064 basic_machine=s390x-ibm
1065 ;;
1066 sa29200)
1067 basic_machine=a29k-amd
1068 os=-udi
1069 ;;
1070 sb1)
1071 basic_machine=mipsisa64sb1-unknown
1072 ;;
1073 sb1el)
1074 basic_machine=mipsisa64sb1el-unknown
1075 ;;
1076 sde)
1077 basic_machine=mipsisa32-sde
1078 os=-elf
1079 ;;
1080 sei)
1081 basic_machine=mips-sei
1082 os=-seiux
1083 ;;
1084 sequent)
1085 basic_machine=i386-sequent
1086 ;;
1087 sh)
1088 basic_machine=sh-hitachi
1089 os=-hms
1090 ;;
1091 sh5el)
1092 basic_machine=sh5le-unknown
1093 ;;
1094 sh64)
1095 basic_machine=sh64-unknown
1096 ;;
1097 sparclite-wrs | simso-wrs)
1098 basic_machine=sparclite-wrs
1099 os=-vxworks
1100 ;;
1101 sps7)
1102 basic_machine=m68k-bull
1103 os=-sysv2
1104 ;;
1105 spur)
1106 basic_machine=spur-unknown
1107 ;;
1108 st2000)
1109 basic_machine=m68k-tandem
1110 ;;
1111 stratus)
1112 basic_machine=i860-stratus
1113 os=-sysv4
1114 ;;
1115 strongarm-* | thumb-*)
1116 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1117 ;;
1118 sun2)
1119 basic_machine=m68000-sun
1120 ;;
1121 sun2os3)
1122 basic_machine=m68000-sun
1123 os=-sunos3
1124 ;;
1125 sun2os4)
1126 basic_machine=m68000-sun
1127 os=-sunos4
1128 ;;
1129 sun3os3)
1130 basic_machine=m68k-sun
1131 os=-sunos3
1132 ;;
1133 sun3os4)
1134 basic_machine=m68k-sun
1135 os=-sunos4
1136 ;;
1137 sun4os3)
1138 basic_machine=sparc-sun
1139 os=-sunos3
1140 ;;
1141 sun4os4)
1142 basic_machine=sparc-sun
1143 os=-sunos4
1144 ;;
1145 sun4sol2)
1146 basic_machine=sparc-sun
1147 os=-solaris2
1148 ;;
1149 sun3 | sun3-*)
1150 basic_machine=m68k-sun
1151 ;;
1152 sun4)
1153 basic_machine=sparc-sun
1154 ;;
1155 sun386 | sun386i | roadrunner)
1156 basic_machine=i386-sun
1157 ;;
1158 sv1)
1159 basic_machine=sv1-cray
1160 os=-unicos
1161 ;;
1162 symmetry)
1163 basic_machine=i386-sequent
1164 os=-dynix
1165 ;;
1166 t3e)
1167 basic_machine=alphaev5-cray
1168 os=-unicos
1169 ;;
1170 t90)
1171 basic_machine=t90-cray
1172 os=-unicos
1173 ;;
1174 tile*)
1175 basic_machine=$basic_machine-unknown
1176 os=-linux-gnu
1177 ;;
1178 tx39)
1179 basic_machine=mipstx39-unknown
1180 ;;
1181 tx39el)
1182 basic_machine=mipstx39el-unknown
1183 ;;
1184 toad1)
1185 basic_machine=pdp10-xkl
1186 os=-tops20
1187 ;;
1188 tower | tower-32)
1189 basic_machine=m68k-ncr
1190 ;;
1191 tpf)
1192 basic_machine=s390x-ibm
1193 os=-tpf
1194 ;;
1195 udi29k)
1196 basic_machine=a29k-amd
1197 os=-udi
1198 ;;
1199 ultra3)
1200 basic_machine=a29k-nyu
1201 os=-sym1
1202 ;;
1203 v810 | necv810)
1204 basic_machine=v810-nec
1205 os=-none
1206 ;;
1207 vaxv)
1208 basic_machine=vax-dec
1209 os=-sysv
1210 ;;
1211 vms)
1212 basic_machine=vax-dec
1213 os=-vms
1214 ;;
1215 vpp*|vx|vx-*)
1216 basic_machine=f301-fujitsu
1217 ;;
1218 vxworks960)
1219 basic_machine=i960-wrs
1220 os=-vxworks
1221 ;;
1222 vxworks68)
1223 basic_machine=m68k-wrs
1224 os=-vxworks
1225 ;;
1226 vxworks29k)
1227 basic_machine=a29k-wrs
1228 os=-vxworks
1229 ;;
1230 w65*)
1231 basic_machine=w65-wdc
1232 os=-none
1233 ;;
1234 w89k-*)
1235 basic_machine=hppa1.1-winbond
1236 os=-proelf
1237 ;;
1238 xbox)
1239 basic_machine=i686-pc
1240 os=-mingw32
1241 ;;
1242 xps | xps100)
1243 basic_machine=xps100-honeywell
1244 ;;
1245 xscale-* | xscalee[bl]-*)
1246 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1247 ;;
1248 ymp)
1249 basic_machine=ymp-cray
1250 os=-unicos
1251 ;;
1252 z8k-*-coff)
1253 basic_machine=z8k-unknown
1254 os=-sim
1255 ;;
1256 z80-*-coff)
1257 basic_machine=z80-unknown
1258 os=-sim
1259 ;;
1260 none)
1261 basic_machine=none-none
1262 os=-none
1263 ;;
1264
1265 # Here we handle the default manufacturer of certain CPU types. It is in
1266 # some cases the only manufacturer, in others, it is the most popular.
1267 w89k)
1268 basic_machine=hppa1.1-winbond
1269 ;;
1270 op50n)
1271 basic_machine=hppa1.1-oki
1272 ;;
1273 op60c)
1274 basic_machine=hppa1.1-oki
1275 ;;
1276 romp)
1277 basic_machine=romp-ibm
1278 ;;
1279 mmix)
1280 basic_machine=mmix-knuth
1281 ;;
1282 rs6000)
1283 basic_machine=rs6000-ibm
1284 ;;
1285 vax)
1286 basic_machine=vax-dec
1287 ;;
1288 pdp10)
1289 # there are many clones, so DEC is not a safe bet
1290 basic_machine=pdp10-unknown
1291 ;;
1292 pdp11)
1293 basic_machine=pdp11-dec
1294 ;;
1295 we32k)
1296 basic_machine=we32k-att
1297 ;;
1298 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1299 basic_machine=sh-unknown
1300 ;;
1301 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1302 basic_machine=sparc-sun
1303 ;;
1304 cydra)
1305 basic_machine=cydra-cydrome
1306 ;;
1307 orion)
1308 basic_machine=orion-highlevel
1309 ;;
1310 orion105)
1311 basic_machine=clipper-highlevel
1312 ;;
1313 mac | mpw | mac-mpw)
1314 basic_machine=m68k-apple
1315 ;;
1316 pmac | pmac-mpw)
1317 basic_machine=powerpc-apple
1318 ;;
1319 *-unknown)
1320 # Make sure to match an already-canonicalized machine name.
1321 ;;
1322 *)
1323 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1324 exit 1
1325 ;;
1326 esac
1327
1328 # Here we canonicalize certain aliases for manufacturers.
1329 case $basic_machine in
1330 *-digital*)
1331 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1332 ;;
1333 *-commodore*)
1334 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1335 ;;
1336 *)
1337 ;;
1338 esac
1339
1340 # Decode manufacturer-specific aliases for certain operating systems.
1341
1342 if [ x"$os" != x"" ]
1343 then
1344 case $os in
1345 # First match some system type aliases
1346 # that might get confused with valid system types.
1347 # -solaris* is a basic system type, with this one exception.
1348 -auroraux)
1349 os=-auroraux
1350 ;;
1351 -solaris1 | -solaris1.*)
1352 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1353 ;;
1354 -solaris)
1355 os=-solaris2
1356 ;;
1357 -svr4*)
1358 os=-sysv4
1359 ;;
1360 -unixware*)
1361 os=-sysv4.2uw
1362 ;;
1363 -gnu/linux*)
1364 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1365 ;;
1366 # First accept the basic system types.
1367 # The portable systems comes first.
1368 # Each alternative MUST END IN A *, to match a version number.
1369 # -sysv* is not here because it comes later, after sysvr4.
1370 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1371 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1372 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1373 | -sym* | -kopensolaris* | -plan9* \
1374 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1375 | -aos* | -aros* \
1376 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1377 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1378 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1379 | -bitrig* | -openbsd* | -solidbsd* \
1380 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1381 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1382 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1383 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1384 | -chorusos* | -chorusrdb* | -cegcc* \
1385 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1386 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1387 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1388 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1389 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1390 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1391 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1392 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1393 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1394 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1395 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
1396 # Remember, each alternative MUST END IN *, to match a version number.
1397 ;;
1398 -qnx*)
1399 case $basic_machine in
1400 x86-* | i*86-*)
1401 ;;
1402 *)
1403 os=-nto$os
1404 ;;
1405 esac
1406 ;;
1407 -nto-qnx*)
1408 ;;
1409 -nto*)
1410 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1411 ;;
1412 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1413 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1414 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1415 ;;
1416 -mac*)
1417 os=`echo $os | sed -e 's|mac|macos|'`
1418 ;;
1419 -linux-dietlibc)
1420 os=-linux-dietlibc
1421 ;;
1422 -linux*)
1423 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1424 ;;
1425 -sunos5*)
1426 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1427 ;;
1428 -sunos6*)
1429 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1430 ;;
1431 -opened*)
1432 os=-openedition
1433 ;;
1434 -os400*)
1435 os=-os400
1436 ;;
1437 -wince*)
1438 os=-wince
1439 ;;
1440 -osfrose*)
1441 os=-osfrose
1442 ;;
1443 -osf*)
1444 os=-osf
1445 ;;
1446 -utek*)
1447 os=-bsd
1448 ;;
1449 -dynix*)
1450 os=-bsd
1451 ;;
1452 -acis*)
1453 os=-aos
1454 ;;
1455 -atheos*)
1456 os=-atheos
1457 ;;
1458 -syllable*)
1459 os=-syllable
1460 ;;
1461 -386bsd)
1462 os=-bsd
1463 ;;
1464 -ctix* | -uts*)
1465 os=-sysv
1466 ;;
1467 -nova*)
1468 os=-rtmk-nova
1469 ;;
1470 -ns2 )
1471 os=-nextstep2
1472 ;;
1473 -nsk*)
1474 os=-nsk
1475 ;;
1476 # Preserve the version number of sinix5.
1477 -sinix5.*)
1478 os=`echo $os | sed -e 's|sinix|sysv|'`
1479 ;;
1480 -sinix*)
1481 os=-sysv4
1482 ;;
1483 -tpf*)
1484 os=-tpf
1485 ;;
1486 -triton*)
1487 os=-sysv3
1488 ;;
1489 -oss*)
1490 os=-sysv3
1491 ;;
1492 -svr4)
1493 os=-sysv4
1494 ;;
1495 -svr3)
1496 os=-sysv3
1497 ;;
1498 -sysvr4)
1499 os=-sysv4
1500 ;;
1501 # This must come after -sysvr4.
1502 -sysv*)
1503 ;;
1504 -ose*)
1505 os=-ose
1506 ;;
1507 -es1800*)
1508 os=-ose
1509 ;;
1510 -xenix)
1511 os=-xenix
1512 ;;
1513 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1514 os=-mint
1515 ;;
1516 -aros*)
1517 os=-aros
1518 ;;
1519 -zvmoe)
1520 os=-zvmoe
1521 ;;
1522 -dicos*)
1523 os=-dicos
1524 ;;
1525 -nacl*)
1526 ;;
1527 -none)
1528 ;;
1529 *)
1530 # Get rid of the `-' at the beginning of $os.
1531 os=`echo $os | sed 's/[^-]*-//'`
1532 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1533 exit 1
1534 ;;
1535 esac
1536 else
1537
1538 # Here we handle the default operating systems that come with various machines.
1539 # The value should be what the vendor currently ships out the door with their
1540 # machine or put another way, the most popular os provided with the machine.
1541
1542 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1543 # "-sun"), then you have to tell the case statement up towards the top
1544 # that MANUFACTURER isn't an operating system. Otherwise, code above
1545 # will signal an error saying that MANUFACTURER isn't an operating
1546 # system, and we'll never get to this point.
1547
1548 case $basic_machine in
1549 score-*)
1550 os=-elf
1551 ;;
1552 spu-*)
1553 os=-elf
1554 ;;
1555 *-acorn)
1556 os=-riscix1.2
1557 ;;
1558 arm*-rebel)
1559 os=-linux
1560 ;;
1561 arm*-semi)
1562 os=-aout
1563 ;;
1564 c4x-* | tic4x-*)
1565 os=-coff
1566 ;;
1567 c8051-*)
1568 os=-elf
1569 ;;
1570 hexagon-*)
1571 os=-elf
1572 ;;
1573 tic54x-*)
1574 os=-coff
1575 ;;
1576 tic55x-*)
1577 os=-coff
1578 ;;
1579 tic6x-*)
1580 os=-coff
1581 ;;
1582 # This must come before the *-dec entry.
1583 pdp10-*)
1584 os=-tops20
1585 ;;
1586 pdp11-*)
1587 os=-none
1588 ;;
1589 *-dec | vax-*)
1590 os=-ultrix4.2
1591 ;;
1592 m68*-apollo)
1593 os=-domain
1594 ;;
1595 i386-sun)
1596 os=-sunos4.0.2
1597 ;;
1598 m68000-sun)
1599 os=-sunos3
1600 ;;
1601 m68*-cisco)
1602 os=-aout
1603 ;;
1604 mep-*)
1605 os=-elf
1606 ;;
1607 mips*-cisco)
1608 os=-elf
1609 ;;
1610 mips*-*)
1611 os=-elf
1612 ;;
1613 or32-*)
1614 os=-coff
1615 ;;
1616 *-tti) # must be before sparc entry or we get the wrong os.
1617 os=-sysv3
1618 ;;
1619 sparc-* | *-sun)
1620 os=-sunos4.1.1
1621 ;;
1622 *-be)
1623 os=-beos
1624 ;;
1625 *-haiku)
1626 os=-haiku
1627 ;;
1628 *-ibm)
1629 os=-aix
1630 ;;
1631 *-knuth)
1632 os=-mmixware
1633 ;;
1634 *-wec)
1635 os=-proelf
1636 ;;
1637 *-winbond)
1638 os=-proelf
1639 ;;
1640 *-oki)
1641 os=-proelf
1642 ;;
1643 *-hp)
1644 os=-hpux
1645 ;;
1646 *-hitachi)
1647 os=-hiux
1648 ;;
1649 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1650 os=-sysv
1651 ;;
1652 *-cbm)
1653 os=-amigaos
1654 ;;
1655 *-dg)
1656 os=-dgux
1657 ;;
1658 *-dolphin)
1659 os=-sysv3
1660 ;;
1661 m68k-ccur)
1662 os=-rtu
1663 ;;
1664 m88k-omron*)
1665 os=-luna
1666 ;;
1667 *-next )
1668 os=-nextstep
1669 ;;
1670 *-sequent)
1671 os=-ptx
1672 ;;
1673 *-crds)
1674 os=-unos
1675 ;;
1676 *-ns)
1677 os=-genix
1678 ;;
1679 i370-*)
1680 os=-mvs
1681 ;;
1682 *-next)
1683 os=-nextstep3
1684 ;;
1685 *-gould)
1686 os=-sysv
1687 ;;
1688 *-highlevel)
1689 os=-bsd
1690 ;;
1691 *-encore)
1692 os=-bsd
1693 ;;
1694 *-sgi)
1695 os=-irix
1696 ;;
1697 *-siemens)
1698 os=-sysv4
1699 ;;
1700 *-masscomp)
1701 os=-rtu
1702 ;;
1703 f30[01]-fujitsu | f700-fujitsu)
1704 os=-uxpv
1705 ;;
1706 *-rom68k)
1707 os=-coff
1708 ;;
1709 *-*bug)
1710 os=-coff
1711 ;;
1712 *-apple)
1713 os=-macos
1714 ;;
1715 *-atari*)
1716 os=-mint
1717 ;;
1718 *)
1719 os=-none
1720 ;;
1721 esac
1722 fi
1723
1724 # Here we handle the case where we know the os, and the CPU type, but not the
1725 # manufacturer. We pick the logical manufacturer.
1726 vendor=unknown
1727 case $basic_machine in
1728 *-unknown)
1729 case $os in
1730 -riscix*)
1731 vendor=acorn
1732 ;;
1733 -sunos*)
1734 vendor=sun
1735 ;;
1736 -cnk*|-aix*)
1737 vendor=ibm
1738 ;;
1739 -beos*)
1740 vendor=be
1741 ;;
1742 -hpux*)
1743 vendor=hp
1744 ;;
1745 -mpeix*)
1746 vendor=hp
1747 ;;
1748 -hiux*)
1749 vendor=hitachi
1750 ;;
1751 -unos*)
1752 vendor=crds
1753 ;;
1754 -dgux*)
1755 vendor=dg
1756 ;;
1757 -luna*)
1758 vendor=omron
1759 ;;
1760 -genix*)
1761 vendor=ns
1762 ;;
1763 -mvs* | -opened*)
1764 vendor=ibm
1765 ;;
1766 -os400*)
1767 vendor=ibm
1768 ;;
1769 -ptx*)
1770 vendor=sequent
1771 ;;
1772 -tpf*)
1773 vendor=ibm
1774 ;;
1775 -vxsim* | -vxworks* | -windiss*)
1776 vendor=wrs
1777 ;;
1778 -aux*)
1779 vendor=apple
1780 ;;
1781 -hms*)
1782 vendor=hitachi
1783 ;;
1784 -mpw* | -macos*)
1785 vendor=apple
1786 ;;
1787 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1788 vendor=atari
1789 ;;
1790 -vos*)
1791 vendor=stratus
1792 ;;
1793 esac
1794 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1795 ;;
1796 esac
1797
1798 echo $basic_machine$os
1799 exit
1800
1801 # Local variables:
1802 # eval: (add-hook 'write-file-hooks 'time-stamp)
1803 # time-stamp-start: "timestamp='"
1804 # time-stamp-format: "%:y-%02m-%02d"
1805 # time-stamp-end: "'"
1806 # End:
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2013-05-30.07; # UTC
4
5 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
26
27 case $1 in
28 '')
29 echo "$0: No command. Try '$0 --help' for more information." 1>&2
30 exit 1;
31 ;;
32 -h | --h*)
33 cat <<\EOF
34 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
35
36 Run PROGRAMS ARGS to compile a file, generating dependencies
37 as side-effects.
38
39 Environment variables:
40 depmode Dependency tracking mode.
41 source Source file read by 'PROGRAMS ARGS'.
42 object Object file output by 'PROGRAMS ARGS'.
43 DEPDIR directory where to store dependencies.
44 depfile Dependency file to output.
45 tmpdepfile Temporary file to use when outputting dependencies.
46 libtool Whether libtool is used (yes/no).
47
48 Report bugs to <bug-automake@gnu.org>.
49 EOF
50 exit $?
51 ;;
52 -v | --v*)
53 echo "depcomp $scriptversion"
54 exit $?
55 ;;
56 esac
57
58 # Get the directory component of the given path, and save it in the
59 # global variables '$dir'. Note that this directory component will
60 # be either empty or ending with a '/' character. This is deliberate.
61 set_dir_from ()
62 {
63 case $1 in
64 */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
65 *) dir=;;
66 esac
67 }
68
69 # Get the suffix-stripped basename of the given path, and save it the
70 # global variable '$base'.
71 set_base_from ()
72 {
73 base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
74 }
75
76 # If no dependency file was actually created by the compiler invocation,
77 # we still have to create a dummy depfile, to avoid errors with the
78 # Makefile "include basename.Plo" scheme.
79 make_dummy_depfile ()
80 {
81 echo "#dummy" > "$depfile"
82 }
83
84 # Factor out some common post-processing of the generated depfile.
85 # Requires the auxiliary global variable '$tmpdepfile' to be set.
86 aix_post_process_depfile ()
87 {
88 # If the compiler actually managed to produce a dependency file,
89 # post-process it.
90 if test -f "$tmpdepfile"; then
91 # Each line is of the form 'foo.o: dependency.h'.
92 # Do two passes, one to just change these to
93 # $object: dependency.h
94 # and one to simply output
95 # dependency.h:
96 # which is needed to avoid the deleted-header problem.
97 { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
98 sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
99 } > "$depfile"
100 rm -f "$tmpdepfile"
101 else
102 make_dummy_depfile
103 fi
104 }
105
106 # A tabulation character.
107 tab=' '
108 # A newline character.
109 nl='
110 '
111 # Character ranges might be problematic outside the C locale.
112 # These definitions help.
113 upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
114 lower=abcdefghijklmnopqrstuvwxyz
115 digits=0123456789
116 alpha=${upper}${lower}
117
118 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
119 echo "depcomp: Variables source, object and depmode must be set" 1>&2
120 exit 1
121 fi
122
123 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
124 depfile=${depfile-`echo "$object" |
125 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
126 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
127
128 rm -f "$tmpdepfile"
129
130 # Avoid interferences from the environment.
131 gccflag= dashmflag=
132
133 # Some modes work just like other modes, but use different flags. We
134 # parameterize here, but still list the modes in the big case below,
135 # to make depend.m4 easier to write. Note that we *cannot* use a case
136 # here, because this file can only contain one case statement.
137 if test "$depmode" = hp; then
138 # HP compiler uses -M and no extra arg.
139 gccflag=-M
140 depmode=gcc
141 fi
142
143 if test "$depmode" = dashXmstdout; then
144 # This is just like dashmstdout with a different argument.
145 dashmflag=-xM
146 depmode=dashmstdout
147 fi
148
149 cygpath_u="cygpath -u -f -"
150 if test "$depmode" = msvcmsys; then
151 # This is just like msvisualcpp but w/o cygpath translation.
152 # Just convert the backslash-escaped backslashes to single forward
153 # slashes to satisfy depend.m4
154 cygpath_u='sed s,\\\\,/,g'
155 depmode=msvisualcpp
156 fi
157
158 if test "$depmode" = msvc7msys; then
159 # This is just like msvc7 but w/o cygpath translation.
160 # Just convert the backslash-escaped backslashes to single forward
161 # slashes to satisfy depend.m4
162 cygpath_u='sed s,\\\\,/,g'
163 depmode=msvc7
164 fi
165
166 if test "$depmode" = xlc; then
167 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
168 gccflag=-qmakedep=gcc,-MF
169 depmode=gcc
170 fi
171
172 case "$depmode" in
173 gcc3)
174 ## gcc 3 implements dependency tracking that does exactly what
175 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
176 ## it if -MD -MP comes after the -MF stuff. Hmm.
177 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
178 ## the command line argument order; so add the flags where they
179 ## appear in depend2.am. Note that the slowdown incurred here
180 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
181 for arg
182 do
183 case $arg in
184 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
185 *) set fnord "$@" "$arg" ;;
186 esac
187 shift # fnord
188 shift # $arg
189 done
190 "$@"
191 stat=$?
192 if test $stat -ne 0; then
193 rm -f "$tmpdepfile"
194 exit $stat
195 fi
196 mv "$tmpdepfile" "$depfile"
197 ;;
198
199 gcc)
200 ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
201 ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
202 ## (see the conditional assignment to $gccflag above).
203 ## There are various ways to get dependency output from gcc. Here's
204 ## why we pick this rather obscure method:
205 ## - Don't want to use -MD because we'd like the dependencies to end
206 ## up in a subdir. Having to rename by hand is ugly.
207 ## (We might end up doing this anyway to support other compilers.)
208 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
209 ## -MM, not -M (despite what the docs say). Also, it might not be
210 ## supported by the other compilers which use the 'gcc' depmode.
211 ## - Using -M directly means running the compiler twice (even worse
212 ## than renaming).
213 if test -z "$gccflag"; then
214 gccflag=-MD,
215 fi
216 "$@" -Wp,"$gccflag$tmpdepfile"
217 stat=$?
218 if test $stat -ne 0; then
219 rm -f "$tmpdepfile"
220 exit $stat
221 fi
222 rm -f "$depfile"
223 echo "$object : \\" > "$depfile"
224 # The second -e expression handles DOS-style file names with drive
225 # letters.
226 sed -e 's/^[^:]*: / /' \
227 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
228 ## This next piece of magic avoids the "deleted header file" problem.
229 ## The problem is that when a header file which appears in a .P file
230 ## is deleted, the dependency causes make to die (because there is
231 ## typically no way to rebuild the header). We avoid this by adding
232 ## dummy dependencies for each header file. Too bad gcc doesn't do
233 ## this for us directly.
234 ## Some versions of gcc put a space before the ':'. On the theory
235 ## that the space means something, we add a space to the output as
236 ## well. hp depmode also adds that space, but also prefixes the VPATH
237 ## to the object. Take care to not repeat it in the output.
238 ## Some versions of the HPUX 10.20 sed can't process this invocation
239 ## correctly. Breaking it into two sed invocations is a workaround.
240 tr ' ' "$nl" < "$tmpdepfile" \
241 | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
242 | sed -e 's/$/ :/' >> "$depfile"
243 rm -f "$tmpdepfile"
244 ;;
245
246 hp)
247 # This case exists only to let depend.m4 do its work. It works by
248 # looking at the text of this script. This case will never be run,
249 # since it is checked for above.
250 exit 1
251 ;;
252
253 sgi)
254 if test "$libtool" = yes; then
255 "$@" "-Wp,-MDupdate,$tmpdepfile"
256 else
257 "$@" -MDupdate "$tmpdepfile"
258 fi
259 stat=$?
260 if test $stat -ne 0; then
261 rm -f "$tmpdepfile"
262 exit $stat
263 fi
264 rm -f "$depfile"
265
266 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
267 echo "$object : \\" > "$depfile"
268 # Clip off the initial element (the dependent). Don't try to be
269 # clever and replace this with sed code, as IRIX sed won't handle
270 # lines with more than a fixed number of characters (4096 in
271 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
272 # the IRIX cc adds comments like '#:fec' to the end of the
273 # dependency line.
274 tr ' ' "$nl" < "$tmpdepfile" \
275 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
276 | tr "$nl" ' ' >> "$depfile"
277 echo >> "$depfile"
278 # The second pass generates a dummy entry for each header file.
279 tr ' ' "$nl" < "$tmpdepfile" \
280 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
281 >> "$depfile"
282 else
283 make_dummy_depfile
284 fi
285 rm -f "$tmpdepfile"
286 ;;
287
288 xlc)
289 # This case exists only to let depend.m4 do its work. It works by
290 # looking at the text of this script. This case will never be run,
291 # since it is checked for above.
292 exit 1
293 ;;
294
295 aix)
296 # The C for AIX Compiler uses -M and outputs the dependencies
297 # in a .u file. In older versions, this file always lives in the
298 # current directory. Also, the AIX compiler puts '$object:' at the
299 # start of each line; $object doesn't have directory information.
300 # Version 6 uses the directory in both cases.
301 set_dir_from "$object"
302 set_base_from "$object"
303 if test "$libtool" = yes; then
304 tmpdepfile1=$dir$base.u
305 tmpdepfile2=$base.u
306 tmpdepfile3=$dir.libs/$base.u
307 "$@" -Wc,-M
308 else
309 tmpdepfile1=$dir$base.u
310 tmpdepfile2=$dir$base.u
311 tmpdepfile3=$dir$base.u
312 "$@" -M
313 fi
314 stat=$?
315 if test $stat -ne 0; then
316 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
317 exit $stat
318 fi
319
320 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
321 do
322 test -f "$tmpdepfile" && break
323 done
324 aix_post_process_depfile
325 ;;
326
327 tcc)
328 # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
329 # FIXME: That version still under development at the moment of writing.
330 # Make that this statement remains true also for stable, released
331 # versions.
332 # It will wrap lines (doesn't matter whether long or short) with a
333 # trailing '\', as in:
334 #
335 # foo.o : \
336 # foo.c \
337 # foo.h \
338 #
339 # It will put a trailing '\' even on the last line, and will use leading
340 # spaces rather than leading tabs (at least since its commit 0394caf7
341 # "Emit spaces for -MD").
342 "$@" -MD -MF "$tmpdepfile"
343 stat=$?
344 if test $stat -ne 0; then
345 rm -f "$tmpdepfile"
346 exit $stat
347 fi
348 rm -f "$depfile"
349 # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
350 # We have to change lines of the first kind to '$object: \'.
351 sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
352 # And for each line of the second kind, we have to emit a 'dep.h:'
353 # dummy dependency, to avoid the deleted-header problem.
354 sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
355 rm -f "$tmpdepfile"
356 ;;
357
358 ## The order of this option in the case statement is important, since the
359 ## shell code in configure will try each of these formats in the order
360 ## listed in this file. A plain '-MD' option would be understood by many
361 ## compilers, so we must ensure this comes after the gcc and icc options.
362 pgcc)
363 # Portland's C compiler understands '-MD'.
364 # Will always output deps to 'file.d' where file is the root name of the
365 # source file under compilation, even if file resides in a subdirectory.
366 # The object file name does not affect the name of the '.d' file.
367 # pgcc 10.2 will output
368 # foo.o: sub/foo.c sub/foo.h
369 # and will wrap long lines using '\' :
370 # foo.o: sub/foo.c ... \
371 # sub/foo.h ... \
372 # ...
373 set_dir_from "$object"
374 # Use the source, not the object, to determine the base name, since
375 # that's sadly what pgcc will do too.
376 set_base_from "$source"
377 tmpdepfile=$base.d
378
379 # For projects that build the same source file twice into different object
380 # files, the pgcc approach of using the *source* file root name can cause
381 # problems in parallel builds. Use a locking strategy to avoid stomping on
382 # the same $tmpdepfile.
383 lockdir=$base.d-lock
384 trap "
385 echo '$0: caught signal, cleaning up...' >&2
386 rmdir '$lockdir'
387 exit 1
388 " 1 2 13 15
389 numtries=100
390 i=$numtries
391 while test $i -gt 0; do
392 # mkdir is a portable test-and-set.
393 if mkdir "$lockdir" 2>/dev/null; then
394 # This process acquired the lock.
395 "$@" -MD
396 stat=$?
397 # Release the lock.
398 rmdir "$lockdir"
399 break
400 else
401 # If the lock is being held by a different process, wait
402 # until the winning process is done or we timeout.
403 while test -d "$lockdir" && test $i -gt 0; do
404 sleep 1
405 i=`expr $i - 1`
406 done
407 fi
408 i=`expr $i - 1`
409 done
410 trap - 1 2 13 15
411 if test $i -le 0; then
412 echo "$0: failed to acquire lock after $numtries attempts" >&2
413 echo "$0: check lockdir '$lockdir'" >&2
414 exit 1
415 fi
416
417 if test $stat -ne 0; then
418 rm -f "$tmpdepfile"
419 exit $stat
420 fi
421 rm -f "$depfile"
422 # Each line is of the form `foo.o: dependent.h',
423 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
424 # Do two passes, one to just change these to
425 # `$object: dependent.h' and one to simply `dependent.h:'.
426 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
427 # Some versions of the HPUX 10.20 sed can't process this invocation
428 # correctly. Breaking it into two sed invocations is a workaround.
429 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
430 | sed -e 's/$/ :/' >> "$depfile"
431 rm -f "$tmpdepfile"
432 ;;
433
434 hp2)
435 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
436 # compilers, which have integrated preprocessors. The correct option
437 # to use with these is +Maked; it writes dependencies to a file named
438 # 'foo.d', which lands next to the object file, wherever that
439 # happens to be.
440 # Much of this is similar to the tru64 case; see comments there.
441 set_dir_from "$object"
442 set_base_from "$object"
443 if test "$libtool" = yes; then
444 tmpdepfile1=$dir$base.d
445 tmpdepfile2=$dir.libs/$base.d
446 "$@" -Wc,+Maked
447 else
448 tmpdepfile1=$dir$base.d
449 tmpdepfile2=$dir$base.d
450 "$@" +Maked
451 fi
452 stat=$?
453 if test $stat -ne 0; then
454 rm -f "$tmpdepfile1" "$tmpdepfile2"
455 exit $stat
456 fi
457
458 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
459 do
460 test -f "$tmpdepfile" && break
461 done
462 if test -f "$tmpdepfile"; then
463 sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
464 # Add 'dependent.h:' lines.
465 sed -ne '2,${
466 s/^ *//
467 s/ \\*$//
468 s/$/:/
469 p
470 }' "$tmpdepfile" >> "$depfile"
471 else
472 make_dummy_depfile
473 fi
474 rm -f "$tmpdepfile" "$tmpdepfile2"
475 ;;
476
477 tru64)
478 # The Tru64 compiler uses -MD to generate dependencies as a side
479 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
480 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
481 # dependencies in 'foo.d' instead, so we check for that too.
482 # Subdirectories are respected.
483 set_dir_from "$object"
484 set_base_from "$object"
485
486 if test "$libtool" = yes; then
487 # Libtool generates 2 separate objects for the 2 libraries. These
488 # two compilations output dependencies in $dir.libs/$base.o.d and
489 # in $dir$base.o.d. We have to check for both files, because
490 # one of the two compilations can be disabled. We should prefer
491 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
492 # automatically cleaned when .libs/ is deleted, while ignoring
493 # the former would cause a distcleancheck panic.
494 tmpdepfile1=$dir$base.o.d # libtool 1.5
495 tmpdepfile2=$dir.libs/$base.o.d # Likewise.
496 tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
497 "$@" -Wc,-MD
498 else
499 tmpdepfile1=$dir$base.d
500 tmpdepfile2=$dir$base.d
501 tmpdepfile3=$dir$base.d
502 "$@" -MD
503 fi
504
505 stat=$?
506 if test $stat -ne 0; then
507 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
508 exit $stat
509 fi
510
511 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
512 do
513 test -f "$tmpdepfile" && break
514 done
515 # Same post-processing that is required for AIX mode.
516 aix_post_process_depfile
517 ;;
518
519 msvc7)
520 if test "$libtool" = yes; then
521 showIncludes=-Wc,-showIncludes
522 else
523 showIncludes=-showIncludes
524 fi
525 "$@" $showIncludes > "$tmpdepfile"
526 stat=$?
527 grep -v '^Note: including file: ' "$tmpdepfile"
528 if test $stat -ne 0; then
529 rm -f "$tmpdepfile"
530 exit $stat
531 fi
532 rm -f "$depfile"
533 echo "$object : \\" > "$depfile"
534 # The first sed program below extracts the file names and escapes
535 # backslashes for cygpath. The second sed program outputs the file
536 # name when reading, but also accumulates all include files in the
537 # hold buffer in order to output them again at the end. This only
538 # works with sed implementations that can handle large buffers.
539 sed < "$tmpdepfile" -n '
540 /^Note: including file: *\(.*\)/ {
541 s//\1/
542 s/\\/\\\\/g
543 p
544 }' | $cygpath_u | sort -u | sed -n '
545 s/ /\\ /g
546 s/\(.*\)/'"$tab"'\1 \\/p
547 s/.\(.*\) \\/\1:/
548 H
549 $ {
550 s/.*/'"$tab"'/
551 G
552 p
553 }' >> "$depfile"
554 echo >> "$depfile" # make sure the fragment doesn't end with a backslash
555 rm -f "$tmpdepfile"
556 ;;
557
558 msvc7msys)
559 # This case exists only to let depend.m4 do its work. It works by
560 # looking at the text of this script. This case will never be run,
561 # since it is checked for above.
562 exit 1
563 ;;
564
565 #nosideeffect)
566 # This comment above is used by automake to tell side-effect
567 # dependency tracking mechanisms from slower ones.
568
569 dashmstdout)
570 # Important note: in order to support this mode, a compiler *must*
571 # always write the preprocessed file to stdout, regardless of -o.
572 "$@" || exit $?
573
574 # Remove the call to Libtool.
575 if test "$libtool" = yes; then
576 while test "X$1" != 'X--mode=compile'; do
577 shift
578 done
579 shift
580 fi
581
582 # Remove '-o $object'.
583 IFS=" "
584 for arg
585 do
586 case $arg in
587 -o)
588 shift
589 ;;
590 $object)
591 shift
592 ;;
593 *)
594 set fnord "$@" "$arg"
595 shift # fnord
596 shift # $arg
597 ;;
598 esac
599 done
600
601 test -z "$dashmflag" && dashmflag=-M
602 # Require at least two characters before searching for ':'
603 # in the target name. This is to cope with DOS-style filenames:
604 # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
605 "$@" $dashmflag |
606 sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
607 rm -f "$depfile"
608 cat < "$tmpdepfile" > "$depfile"
609 # Some versions of the HPUX 10.20 sed can't process this sed invocation
610 # correctly. Breaking it into two sed invocations is a workaround.
611 tr ' ' "$nl" < "$tmpdepfile" \
612 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
613 | sed -e 's/$/ :/' >> "$depfile"
614 rm -f "$tmpdepfile"
615 ;;
616
617 dashXmstdout)
618 # This case only exists to satisfy depend.m4. It is never actually
619 # run, as this mode is specially recognized in the preamble.
620 exit 1
621 ;;
622
623 makedepend)
624 "$@" || exit $?
625 # Remove any Libtool call
626 if test "$libtool" = yes; then
627 while test "X$1" != 'X--mode=compile'; do
628 shift
629 done
630 shift
631 fi
632 # X makedepend
633 shift
634 cleared=no eat=no
635 for arg
636 do
637 case $cleared in
638 no)
639 set ""; shift
640 cleared=yes ;;
641 esac
642 if test $eat = yes; then
643 eat=no
644 continue
645 fi
646 case "$arg" in
647 -D*|-I*)
648 set fnord "$@" "$arg"; shift ;;
649 # Strip any option that makedepend may not understand. Remove
650 # the object too, otherwise makedepend will parse it as a source file.
651 -arch)
652 eat=yes ;;
653 -*|$object)
654 ;;
655 *)
656 set fnord "$@" "$arg"; shift ;;
657 esac
658 done
659 obj_suffix=`echo "$object" | sed 's/^.*\././'`
660 touch "$tmpdepfile"
661 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
662 rm -f "$depfile"
663 # makedepend may prepend the VPATH from the source file name to the object.
664 # No need to regex-escape $object, excess matching of '.' is harmless.
665 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
666 # Some versions of the HPUX 10.20 sed can't process the last invocation
667 # correctly. Breaking it into two sed invocations is a workaround.
668 sed '1,2d' "$tmpdepfile" \
669 | tr ' ' "$nl" \
670 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
671 | sed -e 's/$/ :/' >> "$depfile"
672 rm -f "$tmpdepfile" "$tmpdepfile".bak
673 ;;
674
675 cpp)
676 # Important note: in order to support this mode, a compiler *must*
677 # always write the preprocessed file to stdout.
678 "$@" || exit $?
679
680 # Remove the call to Libtool.
681 if test "$libtool" = yes; then
682 while test "X$1" != 'X--mode=compile'; do
683 shift
684 done
685 shift
686 fi
687
688 # Remove '-o $object'.
689 IFS=" "
690 for arg
691 do
692 case $arg in
693 -o)
694 shift
695 ;;
696 $object)
697 shift
698 ;;
699 *)
700 set fnord "$@" "$arg"
701 shift # fnord
702 shift # $arg
703 ;;
704 esac
705 done
706
707 "$@" -E \
708 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
709 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
710 | sed '$ s: \\$::' > "$tmpdepfile"
711 rm -f "$depfile"
712 echo "$object : \\" > "$depfile"
713 cat < "$tmpdepfile" >> "$depfile"
714 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
715 rm -f "$tmpdepfile"
716 ;;
717
718 msvisualcpp)
719 # Important note: in order to support this mode, a compiler *must*
720 # always write the preprocessed file to stdout.
721 "$@" || exit $?
722
723 # Remove the call to Libtool.
724 if test "$libtool" = yes; then
725 while test "X$1" != 'X--mode=compile'; do
726 shift
727 done
728 shift
729 fi
730
731 IFS=" "
732 for arg
733 do
734 case "$arg" in
735 -o)
736 shift
737 ;;
738 $object)
739 shift
740 ;;
741 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
742 set fnord "$@"
743 shift
744 shift
745 ;;
746 *)
747 set fnord "$@" "$arg"
748 shift
749 shift
750 ;;
751 esac
752 done
753 "$@" -E 2>/dev/null |
754 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
755 rm -f "$depfile"
756 echo "$object : \\" > "$depfile"
757 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
758 echo "$tab" >> "$depfile"
759 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
760 rm -f "$tmpdepfile"
761 ;;
762
763 msvcmsys)
764 # This case exists only to let depend.m4 do its work. It works by
765 # looking at the text of this script. This case will never be run,
766 # since it is checked for above.
767 exit 1
768 ;;
769
770 none)
771 exec "$@"
772 ;;
773
774 *)
775 echo "Unknown depmode $depmode" 1>&2
776 exit 1
777 ;;
778 esac
779
780 exit 0
781
782 # Local Variables:
783 # mode: shell-script
784 # sh-indentation: 2
785 # eval: (add-hook 'write-file-hooks 'time-stamp)
786 # time-stamp-start: "scriptversion="
787 # time-stamp-format: "%:y-%02m-%02d.%02H"
788 # time-stamp-time-zone: "UTC"
789 # time-stamp-end: "; # UTC"
790 # End:
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2013-12-25.23; # UTC
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # 'make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 tab=' '
44 nl='
45 '
46 IFS=" $tab$nl"
47
48 # Set DOITPROG to "echo" to test this script.
49
50 doit=${DOITPROG-}
51 doit_exec=${doit:-exec}
52
53 # Put in absolute file names if you don't have them in your path;
54 # or use environment vars.
55
56 chgrpprog=${CHGRPPROG-chgrp}
57 chmodprog=${CHMODPROG-chmod}
58 chownprog=${CHOWNPROG-chown}
59 cmpprog=${CMPPROG-cmp}
60 cpprog=${CPPROG-cp}
61 mkdirprog=${MKDIRPROG-mkdir}
62 mvprog=${MVPROG-mv}
63 rmprog=${RMPROG-rm}
64 stripprog=${STRIPPROG-strip}
65
66 posix_mkdir=
67
68 # Desired mode of installed file.
69 mode=0755
70
71 chgrpcmd=
72 chmodcmd=$chmodprog
73 chowncmd=
74 mvcmd=$mvprog
75 rmcmd="$rmprog -f"
76 stripcmd=
77
78 src=
79 dst=
80 dir_arg=
81 dst_arg=
82
83 copy_on_change=false
84 is_target_a_directory=possibly
85
86 usage="\
87 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
88 or: $0 [OPTION]... SRCFILES... DIRECTORY
89 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
90 or: $0 [OPTION]... -d DIRECTORIES...
91
92 In the 1st form, copy SRCFILE to DSTFILE.
93 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
94 In the 4th, create DIRECTORIES.
95
96 Options:
97 --help display this help and exit.
98 --version display version info and exit.
99
100 -c (ignored)
101 -C install only if different (preserve the last data modification time)
102 -d create directories instead of installing files.
103 -g GROUP $chgrpprog installed files to GROUP.
104 -m MODE $chmodprog installed files to MODE.
105 -o USER $chownprog installed files to USER.
106 -s $stripprog installed files.
107 -t DIRECTORY install into DIRECTORY.
108 -T report an error if DSTFILE is a directory.
109
110 Environment variables override the default commands:
111 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
112 RMPROG STRIPPROG
113 "
114
115 while test $# -ne 0; do
116 case $1 in
117 -c) ;;
118
119 -C) copy_on_change=true;;
120
121 -d) dir_arg=true;;
122
123 -g) chgrpcmd="$chgrpprog $2"
124 shift;;
125
126 --help) echo "$usage"; exit $?;;
127
128 -m) mode=$2
129 case $mode in
130 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
131 echo "$0: invalid mode: $mode" >&2
132 exit 1;;
133 esac
134 shift;;
135
136 -o) chowncmd="$chownprog $2"
137 shift;;
138
139 -s) stripcmd=$stripprog;;
140
141 -t)
142 is_target_a_directory=always
143 dst_arg=$2
144 # Protect names problematic for 'test' and other utilities.
145 case $dst_arg in
146 -* | [=\(\)!]) dst_arg=./$dst_arg;;
147 esac
148 shift;;
149
150 -T) is_target_a_directory=never;;
151
152 --version) echo "$0 $scriptversion"; exit $?;;
153
154 --) shift
155 break;;
156
157 -*) echo "$0: invalid option: $1" >&2
158 exit 1;;
159
160 *) break;;
161 esac
162 shift
163 done
164
165 # We allow the use of options -d and -T together, by making -d
166 # take the precedence; this is for compatibility with GNU install.
167
168 if test -n "$dir_arg"; then
169 if test -n "$dst_arg"; then
170 echo "$0: target directory not allowed when installing a directory." >&2
171 exit 1
172 fi
173 fi
174
175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
176 # When -d is used, all remaining arguments are directories to create.
177 # When -t is used, the destination is already specified.
178 # Otherwise, the last argument is the destination. Remove it from $@.
179 for arg
180 do
181 if test -n "$dst_arg"; then
182 # $@ is not empty: it contains at least $arg.
183 set fnord "$@" "$dst_arg"
184 shift # fnord
185 fi
186 shift # arg
187 dst_arg=$arg
188 # Protect names problematic for 'test' and other utilities.
189 case $dst_arg in
190 -* | [=\(\)!]) dst_arg=./$dst_arg;;
191 esac
192 done
193 fi
194
195 if test $# -eq 0; then
196 if test -z "$dir_arg"; then
197 echo "$0: no input file specified." >&2
198 exit 1
199 fi
200 # It's OK to call 'install-sh -d' without argument.
201 # This can happen when creating conditional directories.
202 exit 0
203 fi
204
205 if test -z "$dir_arg"; then
206 if test $# -gt 1 || test "$is_target_a_directory" = always; then
207 if test ! -d "$dst_arg"; then
208 echo "$0: $dst_arg: Is not a directory." >&2
209 exit 1
210 fi
211 fi
212 fi
213
214 if test -z "$dir_arg"; then
215 do_exit='(exit $ret); exit $ret'
216 trap "ret=129; $do_exit" 1
217 trap "ret=130; $do_exit" 2
218 trap "ret=141; $do_exit" 13
219 trap "ret=143; $do_exit" 15
220
221 # Set umask so as not to create temps with too-generous modes.
222 # However, 'strip' requires both read and write access to temps.
223 case $mode in
224 # Optimize common cases.
225 *644) cp_umask=133;;
226 *755) cp_umask=22;;
227
228 *[0-7])
229 if test -z "$stripcmd"; then
230 u_plus_rw=
231 else
232 u_plus_rw='% 200'
233 fi
234 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
235 *)
236 if test -z "$stripcmd"; then
237 u_plus_rw=
238 else
239 u_plus_rw=,u+rw
240 fi
241 cp_umask=$mode$u_plus_rw;;
242 esac
243 fi
244
245 for src
246 do
247 # Protect names problematic for 'test' and other utilities.
248 case $src in
249 -* | [=\(\)!]) src=./$src;;
250 esac
251
252 if test -n "$dir_arg"; then
253 dst=$src
254 dstdir=$dst
255 test -d "$dstdir"
256 dstdir_status=$?
257 else
258
259 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
260 # might cause directories to be created, which would be especially bad
261 # if $src (and thus $dsttmp) contains '*'.
262 if test ! -f "$src" && test ! -d "$src"; then
263 echo "$0: $src does not exist." >&2
264 exit 1
265 fi
266
267 if test -z "$dst_arg"; then
268 echo "$0: no destination specified." >&2
269 exit 1
270 fi
271 dst=$dst_arg
272
273 # If destination is a directory, append the input filename; won't work
274 # if double slashes aren't ignored.
275 if test -d "$dst"; then
276 if test "$is_target_a_directory" = never; then
277 echo "$0: $dst_arg: Is a directory" >&2
278 exit 1
279 fi
280 dstdir=$dst
281 dst=$dstdir/`basename "$src"`
282 dstdir_status=0
283 else
284 dstdir=`dirname "$dst"`
285 test -d "$dstdir"
286 dstdir_status=$?
287 fi
288 fi
289
290 obsolete_mkdir_used=false
291
292 if test $dstdir_status != 0; then
293 case $posix_mkdir in
294 '')
295 # Create intermediate dirs using mode 755 as modified by the umask.
296 # This is like FreeBSD 'install' as of 1997-10-28.
297 umask=`umask`
298 case $stripcmd.$umask in
299 # Optimize common cases.
300 *[2367][2367]) mkdir_umask=$umask;;
301 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
302
303 *[0-7])
304 mkdir_umask=`expr $umask + 22 \
305 - $umask % 100 % 40 + $umask % 20 \
306 - $umask % 10 % 4 + $umask % 2
307 `;;
308 *) mkdir_umask=$umask,go-w;;
309 esac
310
311 # With -d, create the new directory with the user-specified mode.
312 # Otherwise, rely on $mkdir_umask.
313 if test -n "$dir_arg"; then
314 mkdir_mode=-m$mode
315 else
316 mkdir_mode=
317 fi
318
319 posix_mkdir=false
320 case $umask in
321 *[123567][0-7][0-7])
322 # POSIX mkdir -p sets u+wx bits regardless of umask, which
323 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
324 ;;
325 *)
326 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
327 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
328
329 if (umask $mkdir_umask &&
330 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
331 then
332 if test -z "$dir_arg" || {
333 # Check for POSIX incompatibilities with -m.
334 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
335 # other-writable bit of parent directory when it shouldn't.
336 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
337 ls_ld_tmpdir=`ls -ld "$tmpdir"`
338 case $ls_ld_tmpdir in
339 d????-?r-*) different_mode=700;;
340 d????-?--*) different_mode=755;;
341 *) false;;
342 esac &&
343 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
344 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
345 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
346 }
347 }
348 then posix_mkdir=:
349 fi
350 rmdir "$tmpdir/d" "$tmpdir"
351 else
352 # Remove any dirs left behind by ancient mkdir implementations.
353 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
354 fi
355 trap '' 0;;
356 esac;;
357 esac
358
359 if
360 $posix_mkdir && (
361 umask $mkdir_umask &&
362 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
363 )
364 then :
365 else
366
367 # The umask is ridiculous, or mkdir does not conform to POSIX,
368 # or it failed possibly due to a race condition. Create the
369 # directory the slow way, step by step, checking for races as we go.
370
371 case $dstdir in
372 /*) prefix='/';;
373 [-=\(\)!]*) prefix='./';;
374 *) prefix='';;
375 esac
376
377 oIFS=$IFS
378 IFS=/
379 set -f
380 set fnord $dstdir
381 shift
382 set +f
383 IFS=$oIFS
384
385 prefixes=
386
387 for d
388 do
389 test X"$d" = X && continue
390
391 prefix=$prefix$d
392 if test -d "$prefix"; then
393 prefixes=
394 else
395 if $posix_mkdir; then
396 (umask=$mkdir_umask &&
397 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
398 # Don't fail if two instances are running concurrently.
399 test -d "$prefix" || exit 1
400 else
401 case $prefix in
402 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
403 *) qprefix=$prefix;;
404 esac
405 prefixes="$prefixes '$qprefix'"
406 fi
407 fi
408 prefix=$prefix/
409 done
410
411 if test -n "$prefixes"; then
412 # Don't fail if two instances are running concurrently.
413 (umask $mkdir_umask &&
414 eval "\$doit_exec \$mkdirprog $prefixes") ||
415 test -d "$dstdir" || exit 1
416 obsolete_mkdir_used=true
417 fi
418 fi
419 fi
420
421 if test -n "$dir_arg"; then
422 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
423 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
424 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
425 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
426 else
427
428 # Make a couple of temp file names in the proper directory.
429 dsttmp=$dstdir/_inst.$$_
430 rmtmp=$dstdir/_rm.$$_
431
432 # Trap to clean up those temp files at exit.
433 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
434
435 # Copy the file name to the temp name.
436 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
437
438 # and set any options; do chmod last to preserve setuid bits.
439 #
440 # If any of these fail, we abort the whole thing. If we want to
441 # ignore errors from any of these, just make sure not to ignore
442 # errors from the above "$doit $cpprog $src $dsttmp" command.
443 #
444 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
445 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
446 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
447 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
448
449 # If -C, don't bother to copy if it wouldn't change the file.
450 if $copy_on_change &&
451 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
452 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
453 set -f &&
454 set X $old && old=:$2:$4:$5:$6 &&
455 set X $new && new=:$2:$4:$5:$6 &&
456 set +f &&
457 test "$old" = "$new" &&
458 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
459 then
460 rm -f "$dsttmp"
461 else
462 # Rename the file to the real destination.
463 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
464
465 # The rename failed, perhaps because mv can't rename something else
466 # to itself, or perhaps because mv is so ancient that it does not
467 # support -f.
468 {
469 # Now remove or move aside any old file at destination location.
470 # We try this two ways since rm can't unlink itself on some
471 # systems and the destination file might be busy for other
472 # reasons. In this case, the final cleanup might fail but the new
473 # file should still install successfully.
474 {
475 test ! -f "$dst" ||
476 $doit $rmcmd -f "$dst" 2>/dev/null ||
477 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
478 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
479 } ||
480 { echo "$0: cannot unlink or rename $dst" >&2
481 (exit 1); exit 1
482 }
483 } &&
484
485 # Now rename the file to the real destination.
486 $doit $mvcmd "$dsttmp" "$dst"
487 }
488 fi || exit 1
489
490 trap '' 0
491 fi
492 done
493
494 # Local variables:
495 # eval: (add-hook 'write-file-hooks 'time-stamp)
496 # time-stamp-start: "scriptversion="
497 # time-stamp-format: "%:y-%02m-%02d.%02H"
498 # time-stamp-time-zone: "UTC"
499 # time-stamp-end: "; # UTC"
500 # End:
0 #! /bin/sh
1 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
2 ## by inline-source v2014-01-03.01
3
4 # libtool (GNU libtool) 2.4.6
5 # Provide generalized library-building support services.
6 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
8 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
9 # This is free software; see the source for copying conditions. There is NO
10 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12 # GNU Libtool is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # As a special exception to the GNU General Public License,
18 # if you distribute this file as part of a program or library that
19 # is built using GNU Libtool, you may include this file under the
20 # same distribution terms that you use for the rest of that program.
21 #
22 # GNU Libtool is distributed in the hope that it will be useful, but
23 # WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 # General Public License for more details.
26 #
27 # You should have received a copy of the GNU General Public License
28 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29
30
31 PROGRAM=libtool
32 PACKAGE=libtool
33 VERSION=2.4.6
34 package_revision=2.4.6
35
36
37 ## ------ ##
38 ## Usage. ##
39 ## ------ ##
40
41 # Run './libtool --help' for help with using this script from the
42 # command line.
43
44
45 ## ------------------------------- ##
46 ## User overridable command paths. ##
47 ## ------------------------------- ##
48
49 # After configure completes, it has a better idea of some of the
50 # shell tools we need than the defaults used by the functions shared
51 # with bootstrap, so set those here where they can still be over-
52 # ridden by the user, but otherwise take precedence.
53
54 : ${AUTOCONF="autoconf"}
55 : ${AUTOMAKE="automake"}
56
57
58 ## -------------------------- ##
59 ## Source external libraries. ##
60 ## -------------------------- ##
61
62 # Much of our low-level functionality needs to be sourced from external
63 # libraries, which are installed to $pkgauxdir.
64
65 # Set a version string for this script.
66 scriptversion=2015-01-20.17; # UTC
67
68 # General shell script boiler plate, and helper functions.
69 # Written by Gary V. Vaughan, 2004
70
71 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
72 # This is free software; see the source for copying conditions. There is NO
73 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
74
75 # This program is free software; you can redistribute it and/or modify
76 # it under the terms of the GNU General Public License as published by
77 # the Free Software Foundation; either version 3 of the License, or
78 # (at your option) any later version.
79
80 # As a special exception to the GNU General Public License, if you distribute
81 # this file as part of a program or library that is built using GNU Libtool,
82 # you may include this file under the same distribution terms that you use
83 # for the rest of that program.
84
85 # This program is distributed in the hope that it will be useful,
86 # but WITHOUT ANY WARRANTY; without even the implied warranty of
87 # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
88 # General Public License for more details.
89
90 # You should have received a copy of the GNU General Public License
91 # along with this program. If not, see <http://www.gnu.org/licenses/>.
92
93 # Please report bugs or propose patches to gary@gnu.org.
94
95
96 ## ------ ##
97 ## Usage. ##
98 ## ------ ##
99
100 # Evaluate this file near the top of your script to gain access to
101 # the functions and variables defined here:
102 #
103 # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
104 #
105 # If you need to override any of the default environment variable
106 # settings, do that before evaluating this file.
107
108
109 ## -------------------- ##
110 ## Shell normalisation. ##
111 ## -------------------- ##
112
113 # Some shells need a little help to be as Bourne compatible as possible.
114 # Before doing anything else, make sure all that help has been provided!
115
116 DUALCASE=1; export DUALCASE # for MKS sh
117 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
118 emulate sh
119 NULLCMD=:
120 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
121 # is contrary to our usage. Disable this feature.
122 alias -g '${1+"$@"}'='"$@"'
123 setopt NO_GLOB_SUBST
124 else
125 case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
126 fi
127
128 # NLS nuisances: We save the old values in case they are required later.
129 _G_user_locale=
130 _G_safe_locale=
131 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
132 do
133 eval "if test set = \"\${$_G_var+set}\"; then
134 save_$_G_var=\$$_G_var
135 $_G_var=C
136 export $_G_var
137 _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
138 _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
139 fi"
140 done
141
142 # CDPATH.
143 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
144
145 # Make sure IFS has a sensible default
146 sp=' '
147 nl='
148 '
149 IFS="$sp $nl"
150
151 # There are apparently some retarded systems that use ';' as a PATH separator!
152 if test "${PATH_SEPARATOR+set}" != set; then
153 PATH_SEPARATOR=:
154 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
155 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
156 PATH_SEPARATOR=';'
157 }
158 fi
159
160
161
162 ## ------------------------- ##
163 ## Locate command utilities. ##
164 ## ------------------------- ##
165
166
167 # func_executable_p FILE
168 # ----------------------
169 # Check that FILE is an executable regular file.
170 func_executable_p ()
171 {
172 test -f "$1" && test -x "$1"
173 }
174
175
176 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
177 # --------------------------------------------
178 # Search for either a program that responds to --version with output
179 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
180 # trying all the directories in PATH with each of the elements of
181 # PROGS_LIST.
182 #
183 # CHECK_FUNC should accept the path to a candidate program, and
184 # set $func_check_prog_result if it truncates its output less than
185 # $_G_path_prog_max characters.
186 func_path_progs ()
187 {
188 _G_progs_list=$1
189 _G_check_func=$2
190 _G_PATH=${3-"$PATH"}
191
192 _G_path_prog_max=0
193 _G_path_prog_found=false
194 _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
195 for _G_dir in $_G_PATH; do
196 IFS=$_G_save_IFS
197 test -z "$_G_dir" && _G_dir=.
198 for _G_prog_name in $_G_progs_list; do
199 for _exeext in '' .EXE; do
200 _G_path_prog=$_G_dir/$_G_prog_name$_exeext
201 func_executable_p "$_G_path_prog" || continue
202 case `"$_G_path_prog" --version 2>&1` in
203 *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
204 *) $_G_check_func $_G_path_prog
205 func_path_progs_result=$func_check_prog_result
206 ;;
207 esac
208 $_G_path_prog_found && break 3
209 done
210 done
211 done
212 IFS=$_G_save_IFS
213 test -z "$func_path_progs_result" && {
214 echo "no acceptable sed could be found in \$PATH" >&2
215 exit 1
216 }
217 }
218
219
220 # We want to be able to use the functions in this file before configure
221 # has figured out where the best binaries are kept, which means we have
222 # to search for them ourselves - except when the results are already set
223 # where we skip the searches.
224
225 # Unless the user overrides by setting SED, search the path for either GNU
226 # sed, or the sed that truncates its output the least.
227 test -z "$SED" && {
228 _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
229 for _G_i in 1 2 3 4 5 6 7; do
230 _G_sed_script=$_G_sed_script$nl$_G_sed_script
231 done
232 echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
233 _G_sed_script=
234
235 func_check_prog_sed ()
236 {
237 _G_path_prog=$1
238
239 _G_count=0
240 printf 0123456789 >conftest.in
241 while :
242 do
243 cat conftest.in conftest.in >conftest.tmp
244 mv conftest.tmp conftest.in
245 cp conftest.in conftest.nl
246 echo '' >> conftest.nl
247 "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
248 diff conftest.out conftest.nl >/dev/null 2>&1 || break
249 _G_count=`expr $_G_count + 1`
250 if test "$_G_count" -gt "$_G_path_prog_max"; then
251 # Best one so far, save it but keep looking for a better one
252 func_check_prog_result=$_G_path_prog
253 _G_path_prog_max=$_G_count
254 fi
255 # 10*(2^10) chars as input seems more than enough
256 test 10 -lt "$_G_count" && break
257 done
258 rm -f conftest.in conftest.tmp conftest.nl conftest.out
259 }
260
261 func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
262 rm -f conftest.sed
263 SED=$func_path_progs_result
264 }
265
266
267 # Unless the user overrides by setting GREP, search the path for either GNU
268 # grep, or the grep that truncates its output the least.
269 test -z "$GREP" && {
270 func_check_prog_grep ()
271 {
272 _G_path_prog=$1
273
274 _G_count=0
275 _G_path_prog_max=0
276 printf 0123456789 >conftest.in
277 while :
278 do
279 cat conftest.in conftest.in >conftest.tmp
280 mv conftest.tmp conftest.in
281 cp conftest.in conftest.nl
282 echo 'GREP' >> conftest.nl
283 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
284 diff conftest.out conftest.nl >/dev/null 2>&1 || break
285 _G_count=`expr $_G_count + 1`
286 if test "$_G_count" -gt "$_G_path_prog_max"; then
287 # Best one so far, save it but keep looking for a better one
288 func_check_prog_result=$_G_path_prog
289 _G_path_prog_max=$_G_count
290 fi
291 # 10*(2^10) chars as input seems more than enough
292 test 10 -lt "$_G_count" && break
293 done
294 rm -f conftest.in conftest.tmp conftest.nl conftest.out
295 }
296
297 func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
298 GREP=$func_path_progs_result
299 }
300
301
302 ## ------------------------------- ##
303 ## User overridable command paths. ##
304 ## ------------------------------- ##
305
306 # All uppercase variable names are used for environment variables. These
307 # variables can be overridden by the user before calling a script that
308 # uses them if a suitable command of that name is not already available
309 # in the command search PATH.
310
311 : ${CP="cp -f"}
312 : ${ECHO="printf %s\n"}
313 : ${EGREP="$GREP -E"}
314 : ${FGREP="$GREP -F"}
315 : ${LN_S="ln -s"}
316 : ${MAKE="make"}
317 : ${MKDIR="mkdir"}
318 : ${MV="mv -f"}
319 : ${RM="rm -f"}
320 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
321
322
323 ## -------------------- ##
324 ## Useful sed snippets. ##
325 ## -------------------- ##
326
327 sed_dirname='s|/[^/]*$||'
328 sed_basename='s|^.*/||'
329
330 # Sed substitution that helps us do robust quoting. It backslashifies
331 # metacharacters that are still active within double-quoted strings.
332 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
333
334 # Same as above, but do not quote variable references.
335 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
336
337 # Sed substitution that turns a string into a regex matching for the
338 # string literally.
339 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
340
341 # Sed substitution that converts a w32 file name or path
342 # that contains forward slashes, into one that contains
343 # (escaped) backslashes. A very naive implementation.
344 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
345
346 # Re-'\' parameter expansions in output of sed_double_quote_subst that
347 # were '\'-ed in input to the same. If an odd number of '\' preceded a
348 # '$' in input to sed_double_quote_subst, that '$' was protected from
349 # expansion. Since each input '\' is now two '\'s, look for any number
350 # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
351 _G_bs='\\'
352 _G_bs2='\\\\'
353 _G_bs4='\\\\\\\\'
354 _G_dollar='\$'
355 sed_double_backslash="\
356 s/$_G_bs4/&\\
357 /g
358 s/^$_G_bs2$_G_dollar/$_G_bs&/
359 s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
360 s/\n//g"
361
362
363 ## ----------------- ##
364 ## Global variables. ##
365 ## ----------------- ##
366
367 # Except for the global variables explicitly listed below, the following
368 # functions in the '^func_' namespace, and the '^require_' namespace
369 # variables initialised in the 'Resource management' section, sourcing
370 # this file will not pollute your global namespace with anything
371 # else. There's no portable way to scope variables in Bourne shell
372 # though, so actually running these functions will sometimes place
373 # results into a variable named after the function, and often use
374 # temporary variables in the '^_G_' namespace. If you are careful to
375 # avoid using those namespaces casually in your sourcing script, things
376 # should continue to work as you expect. And, of course, you can freely
377 # overwrite any of the functions or variables defined here before
378 # calling anything to customize them.
379
380 EXIT_SUCCESS=0
381 EXIT_FAILURE=1
382 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
383 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
384
385 # Allow overriding, eg assuming that you follow the convention of
386 # putting '$debug_cmd' at the start of all your functions, you can get
387 # bash to show function call trace with:
388 #
389 # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
390 debug_cmd=${debug_cmd-":"}
391 exit_cmd=:
392
393 # By convention, finish your script with:
394 #
395 # exit $exit_status
396 #
397 # so that you can set exit_status to non-zero if you want to indicate
398 # something went wrong during execution without actually bailing out at
399 # the point of failure.
400 exit_status=$EXIT_SUCCESS
401
402 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
403 # is ksh but when the shell is invoked as "sh" and the current value of
404 # the _XPG environment variable is not equal to 1 (one), the special
405 # positional parameter $0, within a function call, is the name of the
406 # function.
407 progpath=$0
408
409 # The name of this program.
410 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
411
412 # Make sure we have an absolute progpath for reexecution:
413 case $progpath in
414 [\\/]*|[A-Za-z]:\\*) ;;
415 *[\\/]*)
416 progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
417 progdir=`cd "$progdir" && pwd`
418 progpath=$progdir/$progname
419 ;;
420 *)
421 _G_IFS=$IFS
422 IFS=${PATH_SEPARATOR-:}
423 for progdir in $PATH; do
424 IFS=$_G_IFS
425 test -x "$progdir/$progname" && break
426 done
427 IFS=$_G_IFS
428 test -n "$progdir" || progdir=`pwd`
429 progpath=$progdir/$progname
430 ;;
431 esac
432
433
434 ## ----------------- ##
435 ## Standard options. ##
436 ## ----------------- ##
437
438 # The following options affect the operation of the functions defined
439 # below, and should be set appropriately depending on run-time para-
440 # meters passed on the command line.
441
442 opt_dry_run=false
443 opt_quiet=false
444 opt_verbose=false
445
446 # Categories 'all' and 'none' are always available. Append any others
447 # you will pass as the first argument to func_warning from your own
448 # code.
449 warning_categories=
450
451 # By default, display warnings according to 'opt_warning_types'. Set
452 # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
453 # treat the next displayed warning as a fatal error.
454 warning_func=func_warn_and_continue
455
456 # Set to 'all' to display all warnings, 'none' to suppress all
457 # warnings, or a space delimited list of some subset of
458 # 'warning_categories' to display only the listed warnings.
459 opt_warning_types=all
460
461
462 ## -------------------- ##
463 ## Resource management. ##
464 ## -------------------- ##
465
466 # This section contains definitions for functions that each ensure a
467 # particular resource (a file, or a non-empty configuration variable for
468 # example) is available, and if appropriate to extract default values
469 # from pertinent package files. Call them using their associated
470 # 'require_*' variable to ensure that they are executed, at most, once.
471 #
472 # It's entirely deliberate that calling these functions can set
473 # variables that don't obey the namespace limitations obeyed by the rest
474 # of this file, in order that that they be as useful as possible to
475 # callers.
476
477
478 # require_term_colors
479 # -------------------
480 # Allow display of bold text on terminals that support it.
481 require_term_colors=func_require_term_colors
482 func_require_term_colors ()
483 {
484 $debug_cmd
485
486 test -t 1 && {
487 # COLORTERM and USE_ANSI_COLORS environment variables take
488 # precedence, because most terminfo databases neglect to describe
489 # whether color sequences are supported.
490 test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
491
492 if test 1 = "$USE_ANSI_COLORS"; then
493 # Standard ANSI escape sequences
494 tc_reset=''
495 tc_bold=''; tc_standout=''
496 tc_red=''; tc_green=''
497 tc_blue=''; tc_cyan=''
498 else
499 # Otherwise trust the terminfo database after all.
500 test -n "`tput sgr0 2>/dev/null`" && {
501 tc_reset=`tput sgr0`
502 test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
503 tc_standout=$tc_bold
504 test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
505 test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
506 test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
507 test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
508 test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
509 }
510 fi
511 }
512
513 require_term_colors=:
514 }
515
516
517 ## ----------------- ##
518 ## Function library. ##
519 ## ----------------- ##
520
521 # This section contains a variety of useful functions to call in your
522 # scripts. Take note of the portable wrappers for features provided by
523 # some modern shells, which will fall back to slower equivalents on
524 # less featureful shells.
525
526
527 # func_append VAR VALUE
528 # ---------------------
529 # Append VALUE onto the existing contents of VAR.
530
531 # We should try to minimise forks, especially on Windows where they are
532 # unreasonably slow, so skip the feature probes when bash or zsh are
533 # being used:
534 if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
535 : ${_G_HAVE_ARITH_OP="yes"}
536 : ${_G_HAVE_XSI_OPS="yes"}
537 # The += operator was introduced in bash 3.1
538 case $BASH_VERSION in
539 [12].* | 3.0 | 3.0*) ;;
540 *)
541 : ${_G_HAVE_PLUSEQ_OP="yes"}
542 ;;
543 esac
544 fi
545
546 # _G_HAVE_PLUSEQ_OP
547 # Can be empty, in which case the shell is probed, "yes" if += is
548 # useable or anything else if it does not work.
549 test -z "$_G_HAVE_PLUSEQ_OP" \
550 && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
551 && _G_HAVE_PLUSEQ_OP=yes
552
553 if test yes = "$_G_HAVE_PLUSEQ_OP"
554 then
555 # This is an XSI compatible shell, allowing a faster implementation...
556 eval 'func_append ()
557 {
558 $debug_cmd
559
560 eval "$1+=\$2"
561 }'
562 else
563 # ...otherwise fall back to using expr, which is often a shell builtin.
564 func_append ()
565 {
566 $debug_cmd
567
568 eval "$1=\$$1\$2"
569 }
570 fi
571
572
573 # func_append_quoted VAR VALUE
574 # ----------------------------
575 # Quote VALUE and append to the end of shell variable VAR, separated
576 # by a space.
577 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
578 eval 'func_append_quoted ()
579 {
580 $debug_cmd
581
582 func_quote_for_eval "$2"
583 eval "$1+=\\ \$func_quote_for_eval_result"
584 }'
585 else
586 func_append_quoted ()
587 {
588 $debug_cmd
589
590 func_quote_for_eval "$2"
591 eval "$1=\$$1\\ \$func_quote_for_eval_result"
592 }
593 fi
594
595
596 # func_append_uniq VAR VALUE
597 # --------------------------
598 # Append unique VALUE onto the existing contents of VAR, assuming
599 # entries are delimited by the first character of VALUE. For example:
600 #
601 # func_append_uniq options " --another-option option-argument"
602 #
603 # will only append to $options if " --another-option option-argument "
604 # is not already present somewhere in $options already (note spaces at
605 # each end implied by leading space in second argument).
606 func_append_uniq ()
607 {
608 $debug_cmd
609
610 eval _G_current_value='`$ECHO $'$1'`'
611 _G_delim=`expr "$2" : '\(.\)'`
612
613 case $_G_delim$_G_current_value$_G_delim in
614 *"$2$_G_delim"*) ;;
615 *) func_append "$@" ;;
616 esac
617 }
618
619
620 # func_arith TERM...
621 # ------------------
622 # Set func_arith_result to the result of evaluating TERMs.
623 test -z "$_G_HAVE_ARITH_OP" \
624 && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
625 && _G_HAVE_ARITH_OP=yes
626
627 if test yes = "$_G_HAVE_ARITH_OP"; then
628 eval 'func_arith ()
629 {
630 $debug_cmd
631
632 func_arith_result=$(( $* ))
633 }'
634 else
635 func_arith ()
636 {
637 $debug_cmd
638
639 func_arith_result=`expr "$@"`
640 }
641 fi
642
643
644 # func_basename FILE
645 # ------------------
646 # Set func_basename_result to FILE with everything up to and including
647 # the last / stripped.
648 if test yes = "$_G_HAVE_XSI_OPS"; then
649 # If this shell supports suffix pattern removal, then use it to avoid
650 # forking. Hide the definitions single quotes in case the shell chokes
651 # on unsupported syntax...
652 _b='func_basename_result=${1##*/}'
653 _d='case $1 in
654 */*) func_dirname_result=${1%/*}$2 ;;
655 * ) func_dirname_result=$3 ;;
656 esac'
657
658 else
659 # ...otherwise fall back to using sed.
660 _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
661 _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
662 if test "X$func_dirname_result" = "X$1"; then
663 func_dirname_result=$3
664 else
665 func_append func_dirname_result "$2"
666 fi'
667 fi
668
669 eval 'func_basename ()
670 {
671 $debug_cmd
672
673 '"$_b"'
674 }'
675
676
677 # func_dirname FILE APPEND NONDIR_REPLACEMENT
678 # -------------------------------------------
679 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
680 # otherwise set result to NONDIR_REPLACEMENT.
681 eval 'func_dirname ()
682 {
683 $debug_cmd
684
685 '"$_d"'
686 }'
687
688
689 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
690 # --------------------------------------------------------
691 # Perform func_basename and func_dirname in a single function
692 # call:
693 # dirname: Compute the dirname of FILE. If nonempty,
694 # add APPEND to the result, otherwise set result
695 # to NONDIR_REPLACEMENT.
696 # value returned in "$func_dirname_result"
697 # basename: Compute filename of FILE.
698 # value retuned in "$func_basename_result"
699 # For efficiency, we do not delegate to the functions above but instead
700 # duplicate the functionality here.
701 eval 'func_dirname_and_basename ()
702 {
703 $debug_cmd
704
705 '"$_b"'
706 '"$_d"'
707 }'
708
709
710 # func_echo ARG...
711 # ----------------
712 # Echo program name prefixed message.
713 func_echo ()
714 {
715 $debug_cmd
716
717 _G_message=$*
718
719 func_echo_IFS=$IFS
720 IFS=$nl
721 for _G_line in $_G_message; do
722 IFS=$func_echo_IFS
723 $ECHO "$progname: $_G_line"
724 done
725 IFS=$func_echo_IFS
726 }
727
728
729 # func_echo_all ARG...
730 # --------------------
731 # Invoke $ECHO with all args, space-separated.
732 func_echo_all ()
733 {
734 $ECHO "$*"
735 }
736
737
738 # func_echo_infix_1 INFIX ARG...
739 # ------------------------------
740 # Echo program name, followed by INFIX on the first line, with any
741 # additional lines not showing INFIX.
742 func_echo_infix_1 ()
743 {
744 $debug_cmd
745
746 $require_term_colors
747
748 _G_infix=$1; shift
749 _G_indent=$_G_infix
750 _G_prefix="$progname: $_G_infix: "
751 _G_message=$*
752
753 # Strip color escape sequences before counting printable length
754 for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
755 do
756 test -n "$_G_tc" && {
757 _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
758 _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
759 }
760 done
761 _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
762
763 func_echo_infix_1_IFS=$IFS
764 IFS=$nl
765 for _G_line in $_G_message; do
766 IFS=$func_echo_infix_1_IFS
767 $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
768 _G_prefix=$_G_indent
769 done
770 IFS=$func_echo_infix_1_IFS
771 }
772
773
774 # func_error ARG...
775 # -----------------
776 # Echo program name prefixed message to standard error.
777 func_error ()
778 {
779 $debug_cmd
780
781 $require_term_colors
782
783 func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
784 }
785
786
787 # func_fatal_error ARG...
788 # -----------------------
789 # Echo program name prefixed message to standard error, and exit.
790 func_fatal_error ()
791 {
792 $debug_cmd
793
794 func_error "$*"
795 exit $EXIT_FAILURE
796 }
797
798
799 # func_grep EXPRESSION FILENAME
800 # -----------------------------
801 # Check whether EXPRESSION matches any line of FILENAME, without output.
802 func_grep ()
803 {
804 $debug_cmd
805
806 $GREP "$1" "$2" >/dev/null 2>&1
807 }
808
809
810 # func_len STRING
811 # ---------------
812 # Set func_len_result to the length of STRING. STRING may not
813 # start with a hyphen.
814 test -z "$_G_HAVE_XSI_OPS" \
815 && (eval 'x=a/b/c;
816 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
817 && _G_HAVE_XSI_OPS=yes
818
819 if test yes = "$_G_HAVE_XSI_OPS"; then
820 eval 'func_len ()
821 {
822 $debug_cmd
823
824 func_len_result=${#1}
825 }'
826 else
827 func_len ()
828 {
829 $debug_cmd
830
831 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
832 }
833 fi
834
835
836 # func_mkdir_p DIRECTORY-PATH
837 # ---------------------------
838 # Make sure the entire path to DIRECTORY-PATH is available.
839 func_mkdir_p ()
840 {
841 $debug_cmd
842
843 _G_directory_path=$1
844 _G_dir_list=
845
846 if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
847
848 # Protect directory names starting with '-'
849 case $_G_directory_path in
850 -*) _G_directory_path=./$_G_directory_path ;;
851 esac
852
853 # While some portion of DIR does not yet exist...
854 while test ! -d "$_G_directory_path"; do
855 # ...make a list in topmost first order. Use a colon delimited
856 # list incase some portion of path contains whitespace.
857 _G_dir_list=$_G_directory_path:$_G_dir_list
858
859 # If the last portion added has no slash in it, the list is done
860 case $_G_directory_path in */*) ;; *) break ;; esac
861
862 # ...otherwise throw away the child directory and loop
863 _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
864 done
865 _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
866
867 func_mkdir_p_IFS=$IFS; IFS=:
868 for _G_dir in $_G_dir_list; do
869 IFS=$func_mkdir_p_IFS
870 # mkdir can fail with a 'File exist' error if two processes
871 # try to create one of the directories concurrently. Don't
872 # stop in that case!
873 $MKDIR "$_G_dir" 2>/dev/null || :
874 done
875 IFS=$func_mkdir_p_IFS
876
877 # Bail out if we (or some other process) failed to create a directory.
878 test -d "$_G_directory_path" || \
879 func_fatal_error "Failed to create '$1'"
880 fi
881 }
882
883
884 # func_mktempdir [BASENAME]
885 # -------------------------
886 # Make a temporary directory that won't clash with other running
887 # libtool processes, and avoids race conditions if possible. If
888 # given, BASENAME is the basename for that directory.
889 func_mktempdir ()
890 {
891 $debug_cmd
892
893 _G_template=${TMPDIR-/tmp}/${1-$progname}
894
895 if test : = "$opt_dry_run"; then
896 # Return a directory name, but don't create it in dry-run mode
897 _G_tmpdir=$_G_template-$$
898 else
899
900 # If mktemp works, use that first and foremost
901 _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
902
903 if test ! -d "$_G_tmpdir"; then
904 # Failing that, at least try and use $RANDOM to avoid a race
905 _G_tmpdir=$_G_template-${RANDOM-0}$$
906
907 func_mktempdir_umask=`umask`
908 umask 0077
909 $MKDIR "$_G_tmpdir"
910 umask $func_mktempdir_umask
911 fi
912
913 # If we're not in dry-run mode, bomb out on failure
914 test -d "$_G_tmpdir" || \
915 func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
916 fi
917
918 $ECHO "$_G_tmpdir"
919 }
920
921
922 # func_normal_abspath PATH
923 # ------------------------
924 # Remove doubled-up and trailing slashes, "." path components,
925 # and cancel out any ".." path components in PATH after making
926 # it an absolute path.
927 func_normal_abspath ()
928 {
929 $debug_cmd
930
931 # These SED scripts presuppose an absolute path with a trailing slash.
932 _G_pathcar='s|^/\([^/]*\).*$|\1|'
933 _G_pathcdr='s|^/[^/]*||'
934 _G_removedotparts=':dotsl
935 s|/\./|/|g
936 t dotsl
937 s|/\.$|/|'
938 _G_collapseslashes='s|/\{1,\}|/|g'
939 _G_finalslash='s|/*$|/|'
940
941 # Start from root dir and reassemble the path.
942 func_normal_abspath_result=
943 func_normal_abspath_tpath=$1
944 func_normal_abspath_altnamespace=
945 case $func_normal_abspath_tpath in
946 "")
947 # Empty path, that just means $cwd.
948 func_stripname '' '/' "`pwd`"
949 func_normal_abspath_result=$func_stripname_result
950 return
951 ;;
952 # The next three entries are used to spot a run of precisely
953 # two leading slashes without using negated character classes;
954 # we take advantage of case's first-match behaviour.
955 ///*)
956 # Unusual form of absolute path, do nothing.
957 ;;
958 //*)
959 # Not necessarily an ordinary path; POSIX reserves leading '//'
960 # and for example Cygwin uses it to access remote file shares
961 # over CIFS/SMB, so we conserve a leading double slash if found.
962 func_normal_abspath_altnamespace=/
963 ;;
964 /*)
965 # Absolute path, do nothing.
966 ;;
967 *)
968 # Relative path, prepend $cwd.
969 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
970 ;;
971 esac
972
973 # Cancel out all the simple stuff to save iterations. We also want
974 # the path to end with a slash for ease of parsing, so make sure
975 # there is one (and only one) here.
976 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
977 -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
978 while :; do
979 # Processed it all yet?
980 if test / = "$func_normal_abspath_tpath"; then
981 # If we ascended to the root using ".." the result may be empty now.
982 if test -z "$func_normal_abspath_result"; then
983 func_normal_abspath_result=/
984 fi
985 break
986 fi
987 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
988 -e "$_G_pathcar"`
989 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
990 -e "$_G_pathcdr"`
991 # Figure out what to do with it
992 case $func_normal_abspath_tcomponent in
993 "")
994 # Trailing empty path component, ignore it.
995 ;;
996 ..)
997 # Parent dir; strip last assembled component from result.
998 func_dirname "$func_normal_abspath_result"
999 func_normal_abspath_result=$func_dirname_result
1000 ;;
1001 *)
1002 # Actual path component, append it.
1003 func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1004 ;;
1005 esac
1006 done
1007 # Restore leading double-slash if one was found on entry.
1008 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1009 }
1010
1011
1012 # func_notquiet ARG...
1013 # --------------------
1014 # Echo program name prefixed message only when not in quiet mode.
1015 func_notquiet ()
1016 {
1017 $debug_cmd
1018
1019 $opt_quiet || func_echo ${1+"$@"}
1020
1021 # A bug in bash halts the script if the last line of a function
1022 # fails when set -e is in force, so we need another command to
1023 # work around that:
1024 :
1025 }
1026
1027
1028 # func_relative_path SRCDIR DSTDIR
1029 # --------------------------------
1030 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1031 func_relative_path ()
1032 {
1033 $debug_cmd
1034
1035 func_relative_path_result=
1036 func_normal_abspath "$1"
1037 func_relative_path_tlibdir=$func_normal_abspath_result
1038 func_normal_abspath "$2"
1039 func_relative_path_tbindir=$func_normal_abspath_result
1040
1041 # Ascend the tree starting from libdir
1042 while :; do
1043 # check if we have found a prefix of bindir
1044 case $func_relative_path_tbindir in
1045 $func_relative_path_tlibdir)
1046 # found an exact match
1047 func_relative_path_tcancelled=
1048 break
1049 ;;
1050 $func_relative_path_tlibdir*)
1051 # found a matching prefix
1052 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1053 func_relative_path_tcancelled=$func_stripname_result
1054 if test -z "$func_relative_path_result"; then
1055 func_relative_path_result=.
1056 fi
1057 break
1058 ;;
1059 *)
1060 func_dirname $func_relative_path_tlibdir
1061 func_relative_path_tlibdir=$func_dirname_result
1062 if test -z "$func_relative_path_tlibdir"; then
1063 # Have to descend all the way to the root!
1064 func_relative_path_result=../$func_relative_path_result
1065 func_relative_path_tcancelled=$func_relative_path_tbindir
1066 break
1067 fi
1068 func_relative_path_result=../$func_relative_path_result
1069 ;;
1070 esac
1071 done
1072
1073 # Now calculate path; take care to avoid doubling-up slashes.
1074 func_stripname '' '/' "$func_relative_path_result"
1075 func_relative_path_result=$func_stripname_result
1076 func_stripname '/' '/' "$func_relative_path_tcancelled"
1077 if test -n "$func_stripname_result"; then
1078 func_append func_relative_path_result "/$func_stripname_result"
1079 fi
1080
1081 # Normalisation. If bindir is libdir, return '.' else relative path.
1082 if test -n "$func_relative_path_result"; then
1083 func_stripname './' '' "$func_relative_path_result"
1084 func_relative_path_result=$func_stripname_result
1085 fi
1086
1087 test -n "$func_relative_path_result" || func_relative_path_result=.
1088
1089 :
1090 }
1091
1092
1093 # func_quote_for_eval ARG...
1094 # --------------------------
1095 # Aesthetically quote ARGs to be evaled later.
1096 # This function returns two values:
1097 # i) func_quote_for_eval_result
1098 # double-quoted, suitable for a subsequent eval
1099 # ii) func_quote_for_eval_unquoted_result
1100 # has all characters that are still active within double
1101 # quotes backslashified.
1102 func_quote_for_eval ()
1103 {
1104 $debug_cmd
1105
1106 func_quote_for_eval_unquoted_result=
1107 func_quote_for_eval_result=
1108 while test 0 -lt $#; do
1109 case $1 in
1110 *[\\\`\"\$]*)
1111 _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
1112 *)
1113 _G_unquoted_arg=$1 ;;
1114 esac
1115 if test -n "$func_quote_for_eval_unquoted_result"; then
1116 func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
1117 else
1118 func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
1119 fi
1120
1121 case $_G_unquoted_arg in
1122 # Double-quote args containing shell metacharacters to delay
1123 # word splitting, command substitution and variable expansion
1124 # for a subsequent eval.
1125 # Many Bourne shells cannot handle close brackets correctly
1126 # in scan sets, so we specify it separately.
1127 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1128 _G_quoted_arg=\"$_G_unquoted_arg\"
1129 ;;
1130 *)
1131 _G_quoted_arg=$_G_unquoted_arg
1132 ;;
1133 esac
1134
1135 if test -n "$func_quote_for_eval_result"; then
1136 func_append func_quote_for_eval_result " $_G_quoted_arg"
1137 else
1138 func_append func_quote_for_eval_result "$_G_quoted_arg"
1139 fi
1140 shift
1141 done
1142 }
1143
1144
1145 # func_quote_for_expand ARG
1146 # -------------------------
1147 # Aesthetically quote ARG to be evaled later; same as above,
1148 # but do not quote variable references.
1149 func_quote_for_expand ()
1150 {
1151 $debug_cmd
1152
1153 case $1 in
1154 *[\\\`\"]*)
1155 _G_arg=`$ECHO "$1" | $SED \
1156 -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1157 *)
1158 _G_arg=$1 ;;
1159 esac
1160
1161 case $_G_arg in
1162 # Double-quote args containing shell metacharacters to delay
1163 # word splitting and command substitution for a subsequent eval.
1164 # Many Bourne shells cannot handle close brackets correctly
1165 # in scan sets, so we specify it separately.
1166 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1167 _G_arg=\"$_G_arg\"
1168 ;;
1169 esac
1170
1171 func_quote_for_expand_result=$_G_arg
1172 }
1173
1174
1175 # func_stripname PREFIX SUFFIX NAME
1176 # ---------------------------------
1177 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1178 # PREFIX and SUFFIX must not contain globbing or regex special
1179 # characters, hashes, percent signs, but SUFFIX may contain a leading
1180 # dot (in which case that matches only a dot).
1181 if test yes = "$_G_HAVE_XSI_OPS"; then
1182 eval 'func_stripname ()
1183 {
1184 $debug_cmd
1185
1186 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1187 # positional parameters, so assign one to ordinary variable first.
1188 func_stripname_result=$3
1189 func_stripname_result=${func_stripname_result#"$1"}
1190 func_stripname_result=${func_stripname_result%"$2"}
1191 }'
1192 else
1193 func_stripname ()
1194 {
1195 $debug_cmd
1196
1197 case $2 in
1198 .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1199 *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1200 esac
1201 }
1202 fi
1203
1204
1205 # func_show_eval CMD [FAIL_EXP]
1206 # -----------------------------
1207 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1208 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1209 # is given, then evaluate it.
1210 func_show_eval ()
1211 {
1212 $debug_cmd
1213
1214 _G_cmd=$1
1215 _G_fail_exp=${2-':'}
1216
1217 func_quote_for_expand "$_G_cmd"
1218 eval "func_notquiet $func_quote_for_expand_result"
1219
1220 $opt_dry_run || {
1221 eval "$_G_cmd"
1222 _G_status=$?
1223 if test 0 -ne "$_G_status"; then
1224 eval "(exit $_G_status); $_G_fail_exp"
1225 fi
1226 }
1227 }
1228
1229
1230 # func_show_eval_locale CMD [FAIL_EXP]
1231 # ------------------------------------
1232 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1233 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1234 # is given, then evaluate it. Use the saved locale for evaluation.
1235 func_show_eval_locale ()
1236 {
1237 $debug_cmd
1238
1239 _G_cmd=$1
1240 _G_fail_exp=${2-':'}
1241
1242 $opt_quiet || {
1243 func_quote_for_expand "$_G_cmd"
1244 eval "func_echo $func_quote_for_expand_result"
1245 }
1246
1247 $opt_dry_run || {
1248 eval "$_G_user_locale
1249 $_G_cmd"
1250 _G_status=$?
1251 eval "$_G_safe_locale"
1252 if test 0 -ne "$_G_status"; then
1253 eval "(exit $_G_status); $_G_fail_exp"
1254 fi
1255 }
1256 }
1257
1258
1259 # func_tr_sh
1260 # ----------
1261 # Turn $1 into a string suitable for a shell variable name.
1262 # Result is stored in $func_tr_sh_result. All characters
1263 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1264 # if $1 begins with a digit, a '_' is prepended as well.
1265 func_tr_sh ()
1266 {
1267 $debug_cmd
1268
1269 case $1 in
1270 [0-9]* | *[!a-zA-Z0-9_]*)
1271 func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1272 ;;
1273 * )
1274 func_tr_sh_result=$1
1275 ;;
1276 esac
1277 }
1278
1279
1280 # func_verbose ARG...
1281 # -------------------
1282 # Echo program name prefixed message in verbose mode only.
1283 func_verbose ()
1284 {
1285 $debug_cmd
1286
1287 $opt_verbose && func_echo "$*"
1288
1289 :
1290 }
1291
1292
1293 # func_warn_and_continue ARG...
1294 # -----------------------------
1295 # Echo program name prefixed warning message to standard error.
1296 func_warn_and_continue ()
1297 {
1298 $debug_cmd
1299
1300 $require_term_colors
1301
1302 func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1303 }
1304
1305
1306 # func_warning CATEGORY ARG...
1307 # ----------------------------
1308 # Echo program name prefixed warning message to standard error. Warning
1309 # messages can be filtered according to CATEGORY, where this function
1310 # elides messages where CATEGORY is not listed in the global variable
1311 # 'opt_warning_types'.
1312 func_warning ()
1313 {
1314 $debug_cmd
1315
1316 # CATEGORY must be in the warning_categories list!
1317 case " $warning_categories " in
1318 *" $1 "*) ;;
1319 *) func_internal_error "invalid warning category '$1'" ;;
1320 esac
1321
1322 _G_category=$1
1323 shift
1324
1325 case " $opt_warning_types " in
1326 *" $_G_category "*) $warning_func ${1+"$@"} ;;
1327 esac
1328 }
1329
1330
1331 # func_sort_ver VER1 VER2
1332 # -----------------------
1333 # 'sort -V' is not generally available.
1334 # Note this deviates from the version comparison in automake
1335 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1336 # but this should suffice as we won't be specifying old
1337 # version formats or redundant trailing .0 in bootstrap.conf.
1338 # If we did want full compatibility then we should probably
1339 # use m4_version_compare from autoconf.
1340 func_sort_ver ()
1341 {
1342 $debug_cmd
1343
1344 printf '%s\n%s\n' "$1" "$2" \
1345 | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1346 }
1347
1348 # func_lt_ver PREV CURR
1349 # ---------------------
1350 # Return true if PREV and CURR are in the correct order according to
1351 # func_sort_ver, otherwise false. Use it like this:
1352 #
1353 # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1354 func_lt_ver ()
1355 {
1356 $debug_cmd
1357
1358 test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1359 }
1360
1361
1362 # Local variables:
1363 # mode: shell-script
1364 # sh-indentation: 2
1365 # eval: (add-hook 'before-save-hook 'time-stamp)
1366 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1367 # time-stamp-time-zone: "UTC"
1368 # End:
1369 #! /bin/sh
1370
1371 # Set a version string for this script.
1372 scriptversion=2014-01-07.03; # UTC
1373
1374 # A portable, pluggable option parser for Bourne shell.
1375 # Written by Gary V. Vaughan, 2010
1376
1377 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
1378 # This is free software; see the source for copying conditions. There is NO
1379 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1380
1381 # This program is free software: you can redistribute it and/or modify
1382 # it under the terms of the GNU General Public License as published by
1383 # the Free Software Foundation, either version 3 of the License, or
1384 # (at your option) any later version.
1385
1386 # This program is distributed in the hope that it will be useful,
1387 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1388 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1389 # GNU General Public License for more details.
1390
1391 # You should have received a copy of the GNU General Public License
1392 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1393
1394 # Please report bugs or propose patches to gary@gnu.org.
1395
1396
1397 ## ------ ##
1398 ## Usage. ##
1399 ## ------ ##
1400
1401 # This file is a library for parsing options in your shell scripts along
1402 # with assorted other useful supporting features that you can make use
1403 # of too.
1404 #
1405 # For the simplest scripts you might need only:
1406 #
1407 # #!/bin/sh
1408 # . relative/path/to/funclib.sh
1409 # . relative/path/to/options-parser
1410 # scriptversion=1.0
1411 # func_options ${1+"$@"}
1412 # eval set dummy "$func_options_result"; shift
1413 # ...rest of your script...
1414 #
1415 # In order for the '--version' option to work, you will need to have a
1416 # suitably formatted comment like the one at the top of this file
1417 # starting with '# Written by ' and ending with '# warranty; '.
1418 #
1419 # For '-h' and '--help' to work, you will also need a one line
1420 # description of your script's purpose in a comment directly above the
1421 # '# Written by ' line, like the one at the top of this file.
1422 #
1423 # The default options also support '--debug', which will turn on shell
1424 # execution tracing (see the comment above debug_cmd below for another
1425 # use), and '--verbose' and the func_verbose function to allow your script
1426 # to display verbose messages only when your user has specified
1427 # '--verbose'.
1428 #
1429 # After sourcing this file, you can plug processing for additional
1430 # options by amending the variables from the 'Configuration' section
1431 # below, and following the instructions in the 'Option parsing'
1432 # section further down.
1433
1434 ## -------------- ##
1435 ## Configuration. ##
1436 ## -------------- ##
1437
1438 # You should override these variables in your script after sourcing this
1439 # file so that they reflect the customisations you have added to the
1440 # option parser.
1441
1442 # The usage line for option parsing errors and the start of '-h' and
1443 # '--help' output messages. You can embed shell variables for delayed
1444 # expansion at the time the message is displayed, but you will need to
1445 # quote other shell meta-characters carefully to prevent them being
1446 # expanded when the contents are evaled.
1447 usage='$progpath [OPTION]...'
1448
1449 # Short help message in response to '-h' and '--help'. Add to this or
1450 # override it after sourcing this library to reflect the full set of
1451 # options your script accepts.
1452 usage_message="\
1453 --debug enable verbose shell tracing
1454 -W, --warnings=CATEGORY
1455 report the warnings falling in CATEGORY [all]
1456 -v, --verbose verbosely report processing
1457 --version print version information and exit
1458 -h, --help print short or long help message and exit
1459 "
1460
1461 # Additional text appended to 'usage_message' in response to '--help'.
1462 long_help_message="
1463 Warning categories include:
1464 'all' show all warnings
1465 'none' turn off all the warnings
1466 'error' warnings are treated as fatal errors"
1467
1468 # Help message printed before fatal option parsing errors.
1469 fatal_help="Try '\$progname --help' for more information."
1470
1471
1472
1473 ## ------------------------- ##
1474 ## Hook function management. ##
1475 ## ------------------------- ##
1476
1477 # This section contains functions for adding, removing, and running hooks
1478 # to the main code. A hook is just a named list of of function, that can
1479 # be run in order later on.
1480
1481 # func_hookable FUNC_NAME
1482 # -----------------------
1483 # Declare that FUNC_NAME will run hooks added with
1484 # 'func_add_hook FUNC_NAME ...'.
1485 func_hookable ()
1486 {
1487 $debug_cmd
1488
1489 func_append hookable_fns " $1"
1490 }
1491
1492
1493 # func_add_hook FUNC_NAME HOOK_FUNC
1494 # ---------------------------------
1495 # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1496 # first have been declared "hookable" by a call to 'func_hookable'.
1497 func_add_hook ()
1498 {
1499 $debug_cmd
1500
1501 case " $hookable_fns " in
1502 *" $1 "*) ;;
1503 *) func_fatal_error "'$1' does not accept hook functions." ;;
1504 esac
1505
1506 eval func_append ${1}_hooks '" $2"'
1507 }
1508
1509
1510 # func_remove_hook FUNC_NAME HOOK_FUNC
1511 # ------------------------------------
1512 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
1513 func_remove_hook ()
1514 {
1515 $debug_cmd
1516
1517 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1518 }
1519
1520
1521 # func_run_hooks FUNC_NAME [ARG]...
1522 # ---------------------------------
1523 # Run all hook functions registered to FUNC_NAME.
1524 # It is assumed that the list of hook functions contains nothing more
1525 # than a whitespace-delimited list of legal shell function names, and
1526 # no effort is wasted trying to catch shell meta-characters or preserve
1527 # whitespace.
1528 func_run_hooks ()
1529 {
1530 $debug_cmd
1531
1532 case " $hookable_fns " in
1533 *" $1 "*) ;;
1534 *) func_fatal_error "'$1' does not support hook funcions.n" ;;
1535 esac
1536
1537 eval _G_hook_fns=\$$1_hooks; shift
1538
1539 for _G_hook in $_G_hook_fns; do
1540 eval $_G_hook '"$@"'
1541
1542 # store returned options list back into positional
1543 # parameters for next 'cmd' execution.
1544 eval _G_hook_result=\$${_G_hook}_result
1545 eval set dummy "$_G_hook_result"; shift
1546 done
1547
1548 func_quote_for_eval ${1+"$@"}
1549 func_run_hooks_result=$func_quote_for_eval_result
1550 }
1551
1552
1553
1554 ## --------------- ##
1555 ## Option parsing. ##
1556 ## --------------- ##
1557
1558 # In order to add your own option parsing hooks, you must accept the
1559 # full positional parameter list in your hook function, remove any
1560 # options that you action, and then pass back the remaining unprocessed
1561 # options in '<hooked_function_name>_result', escaped suitably for
1562 # 'eval'. Like this:
1563 #
1564 # my_options_prep ()
1565 # {
1566 # $debug_cmd
1567 #
1568 # # Extend the existing usage message.
1569 # usage_message=$usage_message'
1570 # -s, --silent don'\''t print informational messages
1571 # '
1572 #
1573 # func_quote_for_eval ${1+"$@"}
1574 # my_options_prep_result=$func_quote_for_eval_result
1575 # }
1576 # func_add_hook func_options_prep my_options_prep
1577 #
1578 #
1579 # my_silent_option ()
1580 # {
1581 # $debug_cmd
1582 #
1583 # # Note that for efficiency, we parse as many options as we can
1584 # # recognise in a loop before passing the remainder back to the
1585 # # caller on the first unrecognised argument we encounter.
1586 # while test $# -gt 0; do
1587 # opt=$1; shift
1588 # case $opt in
1589 # --silent|-s) opt_silent=: ;;
1590 # # Separate non-argument short options:
1591 # -s*) func_split_short_opt "$_G_opt"
1592 # set dummy "$func_split_short_opt_name" \
1593 # "-$func_split_short_opt_arg" ${1+"$@"}
1594 # shift
1595 # ;;
1596 # *) set dummy "$_G_opt" "$*"; shift; break ;;
1597 # esac
1598 # done
1599 #
1600 # func_quote_for_eval ${1+"$@"}
1601 # my_silent_option_result=$func_quote_for_eval_result
1602 # }
1603 # func_add_hook func_parse_options my_silent_option
1604 #
1605 #
1606 # my_option_validation ()
1607 # {
1608 # $debug_cmd
1609 #
1610 # $opt_silent && $opt_verbose && func_fatal_help "\
1611 # '--silent' and '--verbose' options are mutually exclusive."
1612 #
1613 # func_quote_for_eval ${1+"$@"}
1614 # my_option_validation_result=$func_quote_for_eval_result
1615 # }
1616 # func_add_hook func_validate_options my_option_validation
1617 #
1618 # You'll alse need to manually amend $usage_message to reflect the extra
1619 # options you parse. It's preferable to append if you can, so that
1620 # multiple option parsing hooks can be added safely.
1621
1622
1623 # func_options [ARG]...
1624 # ---------------------
1625 # All the functions called inside func_options are hookable. See the
1626 # individual implementations for details.
1627 func_hookable func_options
1628 func_options ()
1629 {
1630 $debug_cmd
1631
1632 func_options_prep ${1+"$@"}
1633 eval func_parse_options \
1634 ${func_options_prep_result+"$func_options_prep_result"}
1635 eval func_validate_options \
1636 ${func_parse_options_result+"$func_parse_options_result"}
1637
1638 eval func_run_hooks func_options \
1639 ${func_validate_options_result+"$func_validate_options_result"}
1640
1641 # save modified positional parameters for caller
1642 func_options_result=$func_run_hooks_result
1643 }
1644
1645
1646 # func_options_prep [ARG]...
1647 # --------------------------
1648 # All initialisations required before starting the option parse loop.
1649 # Note that when calling hook functions, we pass through the list of
1650 # positional parameters. If a hook function modifies that list, and
1651 # needs to propogate that back to rest of this script, then the complete
1652 # modified list must be put in 'func_run_hooks_result' before
1653 # returning.
1654 func_hookable func_options_prep
1655 func_options_prep ()
1656 {
1657 $debug_cmd
1658
1659 # Option defaults:
1660 opt_verbose=false
1661 opt_warning_types=
1662
1663 func_run_hooks func_options_prep ${1+"$@"}
1664
1665 # save modified positional parameters for caller
1666 func_options_prep_result=$func_run_hooks_result
1667 }
1668
1669
1670 # func_parse_options [ARG]...
1671 # ---------------------------
1672 # The main option parsing loop.
1673 func_hookable func_parse_options
1674 func_parse_options ()
1675 {
1676 $debug_cmd
1677
1678 func_parse_options_result=
1679
1680 # this just eases exit handling
1681 while test $# -gt 0; do
1682 # Defer to hook functions for initial option parsing, so they
1683 # get priority in the event of reusing an option name.
1684 func_run_hooks func_parse_options ${1+"$@"}
1685
1686 # Adjust func_parse_options positional parameters to match
1687 eval set dummy "$func_run_hooks_result"; shift
1688
1689 # Break out of the loop if we already parsed every option.
1690 test $# -gt 0 || break
1691
1692 _G_opt=$1
1693 shift
1694 case $_G_opt in
1695 --debug|-x) debug_cmd='set -x'
1696 func_echo "enabling shell trace mode"
1697 $debug_cmd
1698 ;;
1699
1700 --no-warnings|--no-warning|--no-warn)
1701 set dummy --warnings none ${1+"$@"}
1702 shift
1703 ;;
1704
1705 --warnings|--warning|-W)
1706 test $# = 0 && func_missing_arg $_G_opt && break
1707 case " $warning_categories $1" in
1708 *" $1 "*)
1709 # trailing space prevents matching last $1 above
1710 func_append_uniq opt_warning_types " $1"
1711 ;;
1712 *all)
1713 opt_warning_types=$warning_categories
1714 ;;
1715 *none)
1716 opt_warning_types=none
1717 warning_func=:
1718 ;;
1719 *error)
1720 opt_warning_types=$warning_categories
1721 warning_func=func_fatal_error
1722 ;;
1723 *)
1724 func_fatal_error \
1725 "unsupported warning category: '$1'"
1726 ;;
1727 esac
1728 shift
1729 ;;
1730
1731 --verbose|-v) opt_verbose=: ;;
1732 --version) func_version ;;
1733 -\?|-h) func_usage ;;
1734 --help) func_help ;;
1735
1736 # Separate optargs to long options (plugins may need this):
1737 --*=*) func_split_equals "$_G_opt"
1738 set dummy "$func_split_equals_lhs" \
1739 "$func_split_equals_rhs" ${1+"$@"}
1740 shift
1741 ;;
1742
1743 # Separate optargs to short options:
1744 -W*)
1745 func_split_short_opt "$_G_opt"
1746 set dummy "$func_split_short_opt_name" \
1747 "$func_split_short_opt_arg" ${1+"$@"}
1748 shift
1749 ;;
1750
1751 # Separate non-argument short options:
1752 -\?*|-h*|-v*|-x*)
1753 func_split_short_opt "$_G_opt"
1754 set dummy "$func_split_short_opt_name" \
1755 "-$func_split_short_opt_arg" ${1+"$@"}
1756 shift
1757 ;;
1758
1759 --) break ;;
1760 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1761 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1762 esac
1763 done
1764
1765 # save modified positional parameters for caller
1766 func_quote_for_eval ${1+"$@"}
1767 func_parse_options_result=$func_quote_for_eval_result
1768 }
1769
1770
1771 # func_validate_options [ARG]...
1772 # ------------------------------
1773 # Perform any sanity checks on option settings and/or unconsumed
1774 # arguments.
1775 func_hookable func_validate_options
1776 func_validate_options ()
1777 {
1778 $debug_cmd
1779
1780 # Display all warnings if -W was not given.
1781 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
1782
1783 func_run_hooks func_validate_options ${1+"$@"}
1784
1785 # Bail if the options were screwed!
1786 $exit_cmd $EXIT_FAILURE
1787
1788 # save modified positional parameters for caller
1789 func_validate_options_result=$func_run_hooks_result
1790 }
1791
1792
1793
1794 ## ----------------- ##
1795 ## Helper functions. ##
1796 ## ----------------- ##
1797
1798 # This section contains the helper functions used by the rest of the
1799 # hookable option parser framework in ascii-betical order.
1800
1801
1802 # func_fatal_help ARG...
1803 # ----------------------
1804 # Echo program name prefixed message to standard error, followed by
1805 # a help hint, and exit.
1806 func_fatal_help ()
1807 {
1808 $debug_cmd
1809
1810 eval \$ECHO \""Usage: $usage"\"
1811 eval \$ECHO \""$fatal_help"\"
1812 func_error ${1+"$@"}
1813 exit $EXIT_FAILURE
1814 }
1815
1816
1817 # func_help
1818 # ---------
1819 # Echo long help message to standard output and exit.
1820 func_help ()
1821 {
1822 $debug_cmd
1823
1824 func_usage_message
1825 $ECHO "$long_help_message"
1826 exit 0
1827 }
1828
1829
1830 # func_missing_arg ARGNAME
1831 # ------------------------
1832 # Echo program name prefixed message to standard error and set global
1833 # exit_cmd.
1834 func_missing_arg ()
1835 {
1836 $debug_cmd
1837
1838 func_error "Missing argument for '$1'."
1839 exit_cmd=exit
1840 }
1841
1842
1843 # func_split_equals STRING
1844 # ------------------------
1845 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
1846 # splitting STRING at the '=' sign.
1847 test -z "$_G_HAVE_XSI_OPS" \
1848 && (eval 'x=a/b/c;
1849 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1850 && _G_HAVE_XSI_OPS=yes
1851
1852 if test yes = "$_G_HAVE_XSI_OPS"
1853 then
1854 # This is an XSI compatible shell, allowing a faster implementation...
1855 eval 'func_split_equals ()
1856 {
1857 $debug_cmd
1858
1859 func_split_equals_lhs=${1%%=*}
1860 func_split_equals_rhs=${1#*=}
1861 test "x$func_split_equals_lhs" = "x$1" \
1862 && func_split_equals_rhs=
1863 }'
1864 else
1865 # ...otherwise fall back to using expr, which is often a shell builtin.
1866 func_split_equals ()
1867 {
1868 $debug_cmd
1869
1870 func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
1871 func_split_equals_rhs=
1872 test "x$func_split_equals_lhs" = "x$1" \
1873 || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
1874 }
1875 fi #func_split_equals
1876
1877
1878 # func_split_short_opt SHORTOPT
1879 # -----------------------------
1880 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1881 # variables after splitting SHORTOPT after the 2nd character.
1882 if test yes = "$_G_HAVE_XSI_OPS"
1883 then
1884 # This is an XSI compatible shell, allowing a faster implementation...
1885 eval 'func_split_short_opt ()
1886 {
1887 $debug_cmd
1888
1889 func_split_short_opt_arg=${1#??}
1890 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1891 }'
1892 else
1893 # ...otherwise fall back to using expr, which is often a shell builtin.
1894 func_split_short_opt ()
1895 {
1896 $debug_cmd
1897
1898 func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
1899 func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
1900 }
1901 fi #func_split_short_opt
1902
1903
1904 # func_usage
1905 # ----------
1906 # Echo short help message to standard output and exit.
1907 func_usage ()
1908 {
1909 $debug_cmd
1910
1911 func_usage_message
1912 $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
1913 exit 0
1914 }
1915
1916
1917 # func_usage_message
1918 # ------------------
1919 # Echo short help message to standard output.
1920 func_usage_message ()
1921 {
1922 $debug_cmd
1923
1924 eval \$ECHO \""Usage: $usage"\"
1925 echo
1926 $SED -n 's|^# ||
1927 /^Written by/{
1928 x;p;x
1929 }
1930 h
1931 /^Written by/q' < "$progpath"
1932 echo
1933 eval \$ECHO \""$usage_message"\"
1934 }
1935
1936
1937 # func_version
1938 # ------------
1939 # Echo version message to standard output and exit.
1940 func_version ()
1941 {
1942 $debug_cmd
1943
1944 printf '%s\n' "$progname $scriptversion"
1945 $SED -n '
1946 /(C)/!b go
1947 :more
1948 /\./!{
1949 N
1950 s|\n# | |
1951 b more
1952 }
1953 :go
1954 /^# Written by /,/# warranty; / {
1955 s|^# ||
1956 s|^# *$||
1957 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
1958 p
1959 }
1960 /^# Written by / {
1961 s|^# ||
1962 p
1963 }
1964 /^warranty; /q' < "$progpath"
1965
1966 exit $?
1967 }
1968
1969
1970 # Local variables:
1971 # mode: shell-script
1972 # sh-indentation: 2
1973 # eval: (add-hook 'before-save-hook 'time-stamp)
1974 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1975 # time-stamp-time-zone: "UTC"
1976 # End:
1977
1978 # Set a version string.
1979 scriptversion='(GNU libtool) 2.4.6'
1980
1981
1982 # func_echo ARG...
1983 # ----------------
1984 # Libtool also displays the current mode in messages, so override
1985 # funclib.sh func_echo with this custom definition.
1986 func_echo ()
1987 {
1988 $debug_cmd
1989
1990 _G_message=$*
1991
1992 func_echo_IFS=$IFS
1993 IFS=$nl
1994 for _G_line in $_G_message; do
1995 IFS=$func_echo_IFS
1996 $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
1997 done
1998 IFS=$func_echo_IFS
1999 }
2000
2001
2002 # func_warning ARG...
2003 # -------------------
2004 # Libtool warnings are not categorized, so override funclib.sh
2005 # func_warning with this simpler definition.
2006 func_warning ()
2007 {
2008 $debug_cmd
2009
2010 $warning_func ${1+"$@"}
2011 }
2012
2013
2014 ## ---------------- ##
2015 ## Options parsing. ##
2016 ## ---------------- ##
2017
2018 # Hook in the functions to make sure our own options are parsed during
2019 # the option parsing loop.
2020
2021 usage='$progpath [OPTION]... [MODE-ARG]...'
2022
2023 # Short help message in response to '-h'.
2024 usage_message="Options:
2025 --config show all configuration variables
2026 --debug enable verbose shell tracing
2027 -n, --dry-run display commands without modifying any files
2028 --features display basic configuration information and exit
2029 --mode=MODE use operation mode MODE
2030 --no-warnings equivalent to '-Wnone'
2031 --preserve-dup-deps don't remove duplicate dependency libraries
2032 --quiet, --silent don't print informational messages
2033 --tag=TAG use configuration variables from tag TAG
2034 -v, --verbose print more informational messages than default
2035 --version print version information
2036 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2037 -h, --help, --help-all print short, long, or detailed help message
2038 "
2039
2040 # Additional text appended to 'usage_message' in response to '--help'.
2041 func_help ()
2042 {
2043 $debug_cmd
2044
2045 func_usage_message
2046 $ECHO "$long_help_message
2047
2048 MODE must be one of the following:
2049
2050 clean remove files from the build directory
2051 compile compile a source file into a libtool object
2052 execute automatically set library path, then run a program
2053 finish complete the installation of libtool libraries
2054 install install libraries or executables
2055 link create a library or an executable
2056 uninstall remove libraries from an installed directory
2057
2058 MODE-ARGS vary depending on the MODE. When passed as first option,
2059 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2060 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2061
2062 When reporting a bug, please describe a test case to reproduce it and
2063 include the following information:
2064
2065 host-triplet: $host
2066 shell: $SHELL
2067 compiler: $LTCC
2068 compiler flags: $LTCFLAGS
2069 linker: $LD (gnu? $with_gnu_ld)
2070 version: $progname (GNU libtool) 2.4.6
2071 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2072 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2073
2074 Report bugs to <bug-libtool@gnu.org>.
2075 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2076 General help using GNU software: <http://www.gnu.org/gethelp/>."
2077 exit 0
2078 }
2079
2080
2081 # func_lo2o OBJECT-NAME
2082 # ---------------------
2083 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2084 # object suffix.
2085
2086 lo2o=s/\\.lo\$/.$objext/
2087 o2lo=s/\\.$objext\$/.lo/
2088
2089 if test yes = "$_G_HAVE_XSI_OPS"; then
2090 eval 'func_lo2o ()
2091 {
2092 case $1 in
2093 *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2094 * ) func_lo2o_result=$1 ;;
2095 esac
2096 }'
2097
2098 # func_xform LIBOBJ-OR-SOURCE
2099 # ---------------------------
2100 # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2101 # suffix to a '.lo' libtool-object suffix.
2102 eval 'func_xform ()
2103 {
2104 func_xform_result=${1%.*}.lo
2105 }'
2106 else
2107 # ...otherwise fall back to using sed.
2108 func_lo2o ()
2109 {
2110 func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2111 }
2112
2113 func_xform ()
2114 {
2115 func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2116 }
2117 fi
2118
2119
2120 # func_fatal_configuration ARG...
2121 # -------------------------------
2122 # Echo program name prefixed message to standard error, followed by
2123 # a configuration failure hint, and exit.
2124 func_fatal_configuration ()
2125 {
2126 func__fatal_error ${1+"$@"} \
2127 "See the $PACKAGE documentation for more information." \
2128 "Fatal configuration error."
2129 }
2130
2131
2132 # func_config
2133 # -----------
2134 # Display the configuration for all the tags in this script.
2135 func_config ()
2136 {
2137 re_begincf='^# ### BEGIN LIBTOOL'
2138 re_endcf='^# ### END LIBTOOL'
2139
2140 # Default configuration.
2141 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
2142
2143 # Now print the configurations for the tags.
2144 for tagname in $taglist; do
2145 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
2146 done
2147
2148 exit $?
2149 }
2150
2151
2152 # func_features
2153 # -------------
2154 # Display the features supported by this script.
2155 func_features ()
2156 {
2157 echo "host: $host"
2158 if test yes = "$build_libtool_libs"; then
2159 echo "enable shared libraries"
2160 else
2161 echo "disable shared libraries"
2162 fi
2163 if test yes = "$build_old_libs"; then
2164 echo "enable static libraries"
2165 else
2166 echo "disable static libraries"
2167 fi
2168
2169 exit $?
2170 }
2171
2172
2173 # func_enable_tag TAGNAME
2174 # -----------------------
2175 # Verify that TAGNAME is valid, and either flag an error and exit, or
2176 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
2177 # variable here.
2178 func_enable_tag ()
2179 {
2180 # Global variable:
2181 tagname=$1
2182
2183 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2184 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2185 sed_extractcf=/$re_begincf/,/$re_endcf/p
2186
2187 # Validate tagname.
2188 case $tagname in
2189 *[!-_A-Za-z0-9,/]*)
2190 func_fatal_error "invalid tag name: $tagname"
2191 ;;
2192 esac
2193
2194 # Don't test for the "default" C tag, as we know it's
2195 # there but not specially marked.
2196 case $tagname in
2197 CC) ;;
2198 *)
2199 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2200 taglist="$taglist $tagname"
2201
2202 # Evaluate the configuration. Be careful to quote the path
2203 # and the sed script, to avoid splitting on whitespace, but
2204 # also don't use non-portable quotes within backquotes within
2205 # quotes we have to do it in 2 steps:
2206 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2207 eval "$extractedcf"
2208 else
2209 func_error "ignoring unknown tag $tagname"
2210 fi
2211 ;;
2212 esac
2213 }
2214
2215
2216 # func_check_version_match
2217 # ------------------------
2218 # Ensure that we are using m4 macros, and libtool script from the same
2219 # release of libtool.
2220 func_check_version_match ()
2221 {
2222 if test "$package_revision" != "$macro_revision"; then
2223 if test "$VERSION" != "$macro_version"; then
2224 if test -z "$macro_version"; then
2225 cat >&2 <<_LT_EOF
2226 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2227 $progname: definition of this LT_INIT comes from an older release.
2228 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2229 $progname: and run autoconf again.
2230 _LT_EOF
2231 else
2232 cat >&2 <<_LT_EOF
2233 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2234 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2235 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2236 $progname: and run autoconf again.
2237 _LT_EOF
2238 fi
2239 else
2240 cat >&2 <<_LT_EOF
2241 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
2242 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
2243 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
2244 $progname: of $PACKAGE $VERSION and run autoconf again.
2245 _LT_EOF
2246 fi
2247
2248 exit $EXIT_MISMATCH
2249 fi
2250 }
2251
2252
2253 # libtool_options_prep [ARG]...
2254 # -----------------------------
2255 # Preparation for options parsed by libtool.
2256 libtool_options_prep ()
2257 {
2258 $debug_mode
2259
2260 # Option defaults:
2261 opt_config=false
2262 opt_dlopen=
2263 opt_dry_run=false
2264 opt_help=false
2265 opt_mode=
2266 opt_preserve_dup_deps=false
2267 opt_quiet=false
2268
2269 nonopt=
2270 preserve_args=
2271
2272 # Shorthand for --mode=foo, only valid as the first argument
2273 case $1 in
2274 clean|clea|cle|cl)
2275 shift; set dummy --mode clean ${1+"$@"}; shift
2276 ;;
2277 compile|compil|compi|comp|com|co|c)
2278 shift; set dummy --mode compile ${1+"$@"}; shift
2279 ;;
2280 execute|execut|execu|exec|exe|ex|e)
2281 shift; set dummy --mode execute ${1+"$@"}; shift
2282 ;;
2283 finish|finis|fini|fin|fi|f)
2284 shift; set dummy --mode finish ${1+"$@"}; shift
2285 ;;
2286 install|instal|insta|inst|ins|in|i)
2287 shift; set dummy --mode install ${1+"$@"}; shift
2288 ;;
2289 link|lin|li|l)
2290 shift; set dummy --mode link ${1+"$@"}; shift
2291 ;;
2292 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2293 shift; set dummy --mode uninstall ${1+"$@"}; shift
2294 ;;
2295 esac
2296
2297 # Pass back the list of options.
2298 func_quote_for_eval ${1+"$@"}
2299 libtool_options_prep_result=$func_quote_for_eval_result
2300 }
2301 func_add_hook func_options_prep libtool_options_prep
2302
2303
2304 # libtool_parse_options [ARG]...
2305 # ---------------------------------
2306 # Provide handling for libtool specific options.
2307 libtool_parse_options ()
2308 {
2309 $debug_cmd
2310
2311 # Perform our own loop to consume as many options as possible in
2312 # each iteration.
2313 while test $# -gt 0; do
2314 _G_opt=$1
2315 shift
2316 case $_G_opt in
2317 --dry-run|--dryrun|-n)
2318 opt_dry_run=:
2319 ;;
2320
2321 --config) func_config ;;
2322
2323 --dlopen|-dlopen)
2324 opt_dlopen="${opt_dlopen+$opt_dlopen
2325 }$1"
2326 shift
2327 ;;
2328
2329 --preserve-dup-deps)
2330 opt_preserve_dup_deps=: ;;
2331
2332 --features) func_features ;;
2333
2334 --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2335
2336 --help) opt_help=: ;;
2337
2338 --help-all) opt_help=': help-all' ;;
2339
2340 --mode) test $# = 0 && func_missing_arg $_G_opt && break
2341 opt_mode=$1
2342 case $1 in
2343 # Valid mode arguments:
2344 clean|compile|execute|finish|install|link|relink|uninstall) ;;
2345
2346 # Catch anything else as an error
2347 *) func_error "invalid argument for $_G_opt"
2348 exit_cmd=exit
2349 break
2350 ;;
2351 esac
2352 shift
2353 ;;
2354
2355 --no-silent|--no-quiet)
2356 opt_quiet=false
2357 func_append preserve_args " $_G_opt"
2358 ;;
2359
2360 --no-warnings|--no-warning|--no-warn)
2361 opt_warning=false
2362 func_append preserve_args " $_G_opt"
2363 ;;
2364
2365 --no-verbose)
2366 opt_verbose=false
2367 func_append preserve_args " $_G_opt"
2368 ;;
2369
2370 --silent|--quiet)
2371 opt_quiet=:
2372 opt_verbose=false
2373 func_append preserve_args " $_G_opt"
2374 ;;
2375
2376 --tag) test $# = 0 && func_missing_arg $_G_opt && break
2377 opt_tag=$1
2378 func_append preserve_args " $_G_opt $1"
2379 func_enable_tag "$1"
2380 shift
2381 ;;
2382
2383 --verbose|-v) opt_quiet=false
2384 opt_verbose=:
2385 func_append preserve_args " $_G_opt"
2386 ;;
2387
2388 # An option not handled by this hook function:
2389 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2390 esac
2391 done
2392
2393
2394 # save modified positional parameters for caller
2395 func_quote_for_eval ${1+"$@"}
2396 libtool_parse_options_result=$func_quote_for_eval_result
2397 }
2398 func_add_hook func_parse_options libtool_parse_options
2399
2400
2401
2402 # libtool_validate_options [ARG]...
2403 # ---------------------------------
2404 # Perform any sanity checks on option settings and/or unconsumed
2405 # arguments.
2406 libtool_validate_options ()
2407 {
2408 # save first non-option argument
2409 if test 0 -lt $#; then
2410 nonopt=$1
2411 shift
2412 fi
2413
2414 # preserve --debug
2415 test : = "$debug_cmd" || func_append preserve_args " --debug"
2416
2417 case $host in
2418 # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2419 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2420 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
2421 # don't eliminate duplications in $postdeps and $predeps
2422 opt_duplicate_compiler_generated_deps=:
2423 ;;
2424 *)
2425 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2426 ;;
2427 esac
2428
2429 $opt_help || {
2430 # Sanity checks first:
2431 func_check_version_match
2432
2433 test yes != "$build_libtool_libs" \
2434 && test yes != "$build_old_libs" \
2435 && func_fatal_configuration "not configured to build any kind of library"
2436
2437 # Darwin sucks
2438 eval std_shrext=\"$shrext_cmds\"
2439
2440 # Only execute mode is allowed to have -dlopen flags.
2441 if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2442 func_error "unrecognized option '-dlopen'"
2443 $ECHO "$help" 1>&2
2444 exit $EXIT_FAILURE
2445 fi
2446
2447 # Change the help message to a mode-specific one.
2448 generic_help=$help
2449 help="Try '$progname --help --mode=$opt_mode' for more information."
2450 }
2451
2452 # Pass back the unparsed argument list
2453 func_quote_for_eval ${1+"$@"}
2454 libtool_validate_options_result=$func_quote_for_eval_result
2455 }
2456 func_add_hook func_validate_options libtool_validate_options
2457
2458
2459 # Process options as early as possible so that --help and --version
2460 # can return quickly.
2461 func_options ${1+"$@"}
2462 eval set dummy "$func_options_result"; shift
2463
2464
2465
2466 ## ----------- ##
2467 ## Main. ##
2468 ## ----------- ##
2469
2470 magic='%%%MAGIC variable%%%'
2471 magic_exe='%%%MAGIC EXE variable%%%'
2472
2473 # Global variables.
2474 extracted_archives=
2475 extracted_serial=0
2476
2477 # If this variable is set in any of the actions, the command in it
2478 # will be execed at the end. This prevents here-documents from being
2479 # left over by shells.
2480 exec_cmd=
2481
2482
2483 # A function that is used when there is no print builtin or printf.
2484 func_fallback_echo ()
2485 {
2486 eval 'cat <<_LTECHO_EOF
2487 $1
2488 _LTECHO_EOF'
2489 }
2490
2491 # func_generated_by_libtool
2492 # True iff stdin has been generated by Libtool. This function is only
2493 # a basic sanity check; it will hardly flush out determined imposters.
2494 func_generated_by_libtool_p ()
2495 {
2496 $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2497 }
2498
2499 # func_lalib_p file
2500 # True iff FILE is a libtool '.la' library or '.lo' object file.
2501 # This function is only a basic sanity check; it will hardly flush out
2502 # determined imposters.
2503 func_lalib_p ()
2504 {
2505 test -f "$1" &&
2506 $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
2507 }
2508
2509 # func_lalib_unsafe_p file
2510 # True iff FILE is a libtool '.la' library or '.lo' object file.
2511 # This function implements the same check as func_lalib_p without
2512 # resorting to external programs. To this end, it redirects stdin and
2513 # closes it afterwards, without saving the original file descriptor.
2514 # As a safety measure, use it only where a negative result would be
2515 # fatal anyway. Works if 'file' does not exist.
2516 func_lalib_unsafe_p ()
2517 {
2518 lalib_p=no
2519 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
2520 for lalib_p_l in 1 2 3 4
2521 do
2522 read lalib_p_line
2523 case $lalib_p_line in
2524 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
2525 esac
2526 done
2527 exec 0<&5 5<&-
2528 fi
2529 test yes = "$lalib_p"
2530 }
2531
2532 # func_ltwrapper_script_p file
2533 # True iff FILE is a libtool wrapper script
2534 # This function is only a basic sanity check; it will hardly flush out
2535 # determined imposters.
2536 func_ltwrapper_script_p ()
2537 {
2538 test -f "$1" &&
2539 $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
2540 }
2541
2542 # func_ltwrapper_executable_p file
2543 # True iff FILE is a libtool wrapper executable
2544 # This function is only a basic sanity check; it will hardly flush out
2545 # determined imposters.
2546 func_ltwrapper_executable_p ()
2547 {
2548 func_ltwrapper_exec_suffix=
2549 case $1 in
2550 *.exe) ;;
2551 *) func_ltwrapper_exec_suffix=.exe ;;
2552 esac
2553 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
2554 }
2555
2556 # func_ltwrapper_scriptname file
2557 # Assumes file is an ltwrapper_executable
2558 # uses $file to determine the appropriate filename for a
2559 # temporary ltwrapper_script.
2560 func_ltwrapper_scriptname ()
2561 {
2562 func_dirname_and_basename "$1" "" "."
2563 func_stripname '' '.exe' "$func_basename_result"
2564 func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
2565 }
2566
2567 # func_ltwrapper_p file
2568 # True iff FILE is a libtool wrapper script or wrapper executable
2569 # This function is only a basic sanity check; it will hardly flush out
2570 # determined imposters.
2571 func_ltwrapper_p ()
2572 {
2573 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
2574 }
2575
2576
2577 # func_execute_cmds commands fail_cmd
2578 # Execute tilde-delimited COMMANDS.
2579 # If FAIL_CMD is given, eval that upon failure.
2580 # FAIL_CMD may read-access the current command in variable CMD!
2581 func_execute_cmds ()
2582 {
2583 $debug_cmd
2584
2585 save_ifs=$IFS; IFS='~'
2586 for cmd in $1; do
2587 IFS=$sp$nl
2588 eval cmd=\"$cmd\"
2589 IFS=$save_ifs
2590 func_show_eval "$cmd" "${2-:}"
2591 done
2592 IFS=$save_ifs
2593 }
2594
2595
2596 # func_source file
2597 # Source FILE, adding directory component if necessary.
2598 # Note that it is not necessary on cygwin/mingw to append a dot to
2599 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
2600 # behavior happens only for exec(3), not for open(2)! Also, sourcing
2601 # 'FILE.' does not work on cygwin managed mounts.
2602 func_source ()
2603 {
2604 $debug_cmd
2605
2606 case $1 in
2607 */* | *\\*) . "$1" ;;
2608 *) . "./$1" ;;
2609 esac
2610 }
2611
2612
2613 # func_resolve_sysroot PATH
2614 # Replace a leading = in PATH with a sysroot. Store the result into
2615 # func_resolve_sysroot_result
2616 func_resolve_sysroot ()
2617 {
2618 func_resolve_sysroot_result=$1
2619 case $func_resolve_sysroot_result in
2620 =*)
2621 func_stripname '=' '' "$func_resolve_sysroot_result"
2622 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
2623 ;;
2624 esac
2625 }
2626
2627 # func_replace_sysroot PATH
2628 # If PATH begins with the sysroot, replace it with = and
2629 # store the result into func_replace_sysroot_result.
2630 func_replace_sysroot ()
2631 {
2632 case $lt_sysroot:$1 in
2633 ?*:"$lt_sysroot"*)
2634 func_stripname "$lt_sysroot" '' "$1"
2635 func_replace_sysroot_result='='$func_stripname_result
2636 ;;
2637 *)
2638 # Including no sysroot.
2639 func_replace_sysroot_result=$1
2640 ;;
2641 esac
2642 }
2643
2644 # func_infer_tag arg
2645 # Infer tagged configuration to use if any are available and
2646 # if one wasn't chosen via the "--tag" command line option.
2647 # Only attempt this if the compiler in the base compile
2648 # command doesn't match the default compiler.
2649 # arg is usually of the form 'gcc ...'
2650 func_infer_tag ()
2651 {
2652 $debug_cmd
2653
2654 if test -n "$available_tags" && test -z "$tagname"; then
2655 CC_quoted=
2656 for arg in $CC; do
2657 func_append_quoted CC_quoted "$arg"
2658 done
2659 CC_expanded=`func_echo_all $CC`
2660 CC_quoted_expanded=`func_echo_all $CC_quoted`
2661 case $@ in
2662 # Blanks in the command may have been stripped by the calling shell,
2663 # but not from the CC environment variable when configure was run.
2664 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2665 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
2666 # Blanks at the start of $base_compile will cause this to fail
2667 # if we don't check for them as well.
2668 *)
2669 for z in $available_tags; do
2670 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
2671 # Evaluate the configuration.
2672 eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
2673 CC_quoted=
2674 for arg in $CC; do
2675 # Double-quote args containing other shell metacharacters.
2676 func_append_quoted CC_quoted "$arg"
2677 done
2678 CC_expanded=`func_echo_all $CC`
2679 CC_quoted_expanded=`func_echo_all $CC_quoted`
2680 case "$@ " in
2681 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2682 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
2683 # The compiler in the base compile command matches
2684 # the one in the tagged configuration.
2685 # Assume this is the tagged configuration we want.
2686 tagname=$z
2687 break
2688 ;;
2689 esac
2690 fi
2691 done
2692 # If $tagname still isn't set, then no tagged configuration
2693 # was found and let the user know that the "--tag" command
2694 # line option must be used.
2695 if test -z "$tagname"; then
2696 func_echo "unable to infer tagged configuration"
2697 func_fatal_error "specify a tag with '--tag'"
2698 # else
2699 # func_verbose "using $tagname tagged configuration"
2700 fi
2701 ;;
2702 esac
2703 fi
2704 }
2705
2706
2707
2708 # func_write_libtool_object output_name pic_name nonpic_name
2709 # Create a libtool object file (analogous to a ".la" file),
2710 # but don't create it if we're doing a dry run.
2711 func_write_libtool_object ()
2712 {
2713 write_libobj=$1
2714 if test yes = "$build_libtool_libs"; then
2715 write_lobj=\'$2\'
2716 else
2717 write_lobj=none
2718 fi
2719
2720 if test yes = "$build_old_libs"; then
2721 write_oldobj=\'$3\'
2722 else
2723 write_oldobj=none
2724 fi
2725
2726 $opt_dry_run || {
2727 cat >${write_libobj}T <<EOF
2728 # $write_libobj - a libtool object file
2729 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
2730 #
2731 # Please DO NOT delete this file!
2732 # It is necessary for linking the library.
2733
2734 # Name of the PIC object.
2735 pic_object=$write_lobj
2736
2737 # Name of the non-PIC object
2738 non_pic_object=$write_oldobj
2739
2740 EOF
2741 $MV "${write_libobj}T" "$write_libobj"
2742 }
2743 }
2744
2745
2746 ##################################################
2747 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
2748 ##################################################
2749
2750 # func_convert_core_file_wine_to_w32 ARG
2751 # Helper function used by file name conversion functions when $build is *nix,
2752 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
2753 # correctly configured wine environment available, with the winepath program
2754 # in $build's $PATH.
2755 #
2756 # ARG is the $build file name to be converted to w32 format.
2757 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
2758 # be empty on error (or when ARG is empty)
2759 func_convert_core_file_wine_to_w32 ()
2760 {
2761 $debug_cmd
2762
2763 func_convert_core_file_wine_to_w32_result=$1
2764 if test -n "$1"; then
2765 # Unfortunately, winepath does not exit with a non-zero error code, so we
2766 # are forced to check the contents of stdout. On the other hand, if the
2767 # command is not found, the shell will set an exit code of 127 and print
2768 # *an error message* to stdout. So we must check for both error code of
2769 # zero AND non-empty stdout, which explains the odd construction:
2770 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
2771 if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
2772 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
2773 $SED -e "$sed_naive_backslashify"`
2774 else
2775 func_convert_core_file_wine_to_w32_result=
2776 fi
2777 fi
2778 }
2779 # end: func_convert_core_file_wine_to_w32
2780
2781
2782 # func_convert_core_path_wine_to_w32 ARG
2783 # Helper function used by path conversion functions when $build is *nix, and
2784 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
2785 # configured wine environment available, with the winepath program in $build's
2786 # $PATH. Assumes ARG has no leading or trailing path separator characters.
2787 #
2788 # ARG is path to be converted from $build format to win32.
2789 # Result is available in $func_convert_core_path_wine_to_w32_result.
2790 # Unconvertible file (directory) names in ARG are skipped; if no directory names
2791 # are convertible, then the result may be empty.
2792 func_convert_core_path_wine_to_w32 ()
2793 {
2794 $debug_cmd
2795
2796 # unfortunately, winepath doesn't convert paths, only file names
2797 func_convert_core_path_wine_to_w32_result=
2798 if test -n "$1"; then
2799 oldIFS=$IFS
2800 IFS=:
2801 for func_convert_core_path_wine_to_w32_f in $1; do
2802 IFS=$oldIFS
2803 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
2804 if test -n "$func_convert_core_file_wine_to_w32_result"; then
2805 if test -z "$func_convert_core_path_wine_to_w32_result"; then
2806 func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
2807 else
2808 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
2809 fi
2810 fi
2811 done
2812 IFS=$oldIFS
2813 fi
2814 }
2815 # end: func_convert_core_path_wine_to_w32
2816
2817
2818 # func_cygpath ARGS...
2819 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
2820 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
2821 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
2822 # (2), returns the Cygwin file name or path in func_cygpath_result (input
2823 # file name or path is assumed to be in w32 format, as previously converted
2824 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
2825 # or path in func_cygpath_result (input file name or path is assumed to be in
2826 # Cygwin format). Returns an empty string on error.
2827 #
2828 # ARGS are passed to cygpath, with the last one being the file name or path to
2829 # be converted.
2830 #
2831 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
2832 # environment variable; do not put it in $PATH.
2833 func_cygpath ()
2834 {
2835 $debug_cmd
2836
2837 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
2838 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
2839 if test "$?" -ne 0; then
2840 # on failure, ensure result is empty
2841 func_cygpath_result=
2842 fi
2843 else
2844 func_cygpath_result=
2845 func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
2846 fi
2847 }
2848 #end: func_cygpath
2849
2850
2851 # func_convert_core_msys_to_w32 ARG
2852 # Convert file name or path ARG from MSYS format to w32 format. Return
2853 # result in func_convert_core_msys_to_w32_result.
2854 func_convert_core_msys_to_w32 ()
2855 {
2856 $debug_cmd
2857
2858 # awkward: cmd appends spaces to result
2859 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2860 $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
2861 }
2862 #end: func_convert_core_msys_to_w32
2863
2864
2865 # func_convert_file_check ARG1 ARG2
2866 # Verify that ARG1 (a file name in $build format) was converted to $host
2867 # format in ARG2. Otherwise, emit an error message, but continue (resetting
2868 # func_to_host_file_result to ARG1).
2869 func_convert_file_check ()
2870 {
2871 $debug_cmd
2872
2873 if test -z "$2" && test -n "$1"; then
2874 func_error "Could not determine host file name corresponding to"
2875 func_error " '$1'"
2876 func_error "Continuing, but uninstalled executables may not work."
2877 # Fallback:
2878 func_to_host_file_result=$1
2879 fi
2880 }
2881 # end func_convert_file_check
2882
2883
2884 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
2885 # Verify that FROM_PATH (a path in $build format) was converted to $host
2886 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
2887 # func_to_host_file_result to a simplistic fallback value (see below).
2888 func_convert_path_check ()
2889 {
2890 $debug_cmd
2891
2892 if test -z "$4" && test -n "$3"; then
2893 func_error "Could not determine the host path corresponding to"
2894 func_error " '$3'"
2895 func_error "Continuing, but uninstalled executables may not work."
2896 # Fallback. This is a deliberately simplistic "conversion" and
2897 # should not be "improved". See libtool.info.
2898 if test "x$1" != "x$2"; then
2899 lt_replace_pathsep_chars="s|$1|$2|g"
2900 func_to_host_path_result=`echo "$3" |
2901 $SED -e "$lt_replace_pathsep_chars"`
2902 else
2903 func_to_host_path_result=$3
2904 fi
2905 fi
2906 }
2907 # end func_convert_path_check
2908
2909
2910 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
2911 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
2912 # and appending REPL if ORIG matches BACKPAT.
2913 func_convert_path_front_back_pathsep ()
2914 {
2915 $debug_cmd
2916
2917 case $4 in
2918 $1 ) func_to_host_path_result=$3$func_to_host_path_result
2919 ;;
2920 esac
2921 case $4 in
2922 $2 ) func_append func_to_host_path_result "$3"
2923 ;;
2924 esac
2925 }
2926 # end func_convert_path_front_back_pathsep
2927
2928
2929 ##################################################
2930 # $build to $host FILE NAME CONVERSION FUNCTIONS #
2931 ##################################################
2932 # invoked via '$to_host_file_cmd ARG'
2933 #
2934 # In each case, ARG is the path to be converted from $build to $host format.
2935 # Result will be available in $func_to_host_file_result.
2936
2937
2938 # func_to_host_file ARG
2939 # Converts the file name ARG from $build format to $host format. Return result
2940 # in func_to_host_file_result.
2941 func_to_host_file ()
2942 {
2943 $debug_cmd
2944
2945 $to_host_file_cmd "$1"
2946 }
2947 # end func_to_host_file
2948
2949
2950 # func_to_tool_file ARG LAZY
2951 # converts the file name ARG from $build format to toolchain format. Return
2952 # result in func_to_tool_file_result. If the conversion in use is listed
2953 # in (the comma separated) LAZY, no conversion takes place.
2954 func_to_tool_file ()
2955 {
2956 $debug_cmd
2957
2958 case ,$2, in
2959 *,"$to_tool_file_cmd",*)
2960 func_to_tool_file_result=$1
2961 ;;
2962 *)
2963 $to_tool_file_cmd "$1"
2964 func_to_tool_file_result=$func_to_host_file_result
2965 ;;
2966 esac
2967 }
2968 # end func_to_tool_file
2969
2970
2971 # func_convert_file_noop ARG
2972 # Copy ARG to func_to_host_file_result.
2973 func_convert_file_noop ()
2974 {
2975 func_to_host_file_result=$1
2976 }
2977 # end func_convert_file_noop
2978
2979
2980 # func_convert_file_msys_to_w32 ARG
2981 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2982 # conversion to w32 is not available inside the cwrapper. Returns result in
2983 # func_to_host_file_result.
2984 func_convert_file_msys_to_w32 ()
2985 {
2986 $debug_cmd
2987
2988 func_to_host_file_result=$1
2989 if test -n "$1"; then
2990 func_convert_core_msys_to_w32 "$1"
2991 func_to_host_file_result=$func_convert_core_msys_to_w32_result
2992 fi
2993 func_convert_file_check "$1" "$func_to_host_file_result"
2994 }
2995 # end func_convert_file_msys_to_w32
2996
2997
2998 # func_convert_file_cygwin_to_w32 ARG
2999 # Convert file name ARG from Cygwin to w32 format. Returns result in
3000 # func_to_host_file_result.
3001 func_convert_file_cygwin_to_w32 ()
3002 {
3003 $debug_cmd
3004
3005 func_to_host_file_result=$1
3006 if test -n "$1"; then
3007 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
3008 # LT_CYGPATH in this case.
3009 func_to_host_file_result=`cygpath -m "$1"`
3010 fi
3011 func_convert_file_check "$1" "$func_to_host_file_result"
3012 }
3013 # end func_convert_file_cygwin_to_w32
3014
3015
3016 # func_convert_file_nix_to_w32 ARG
3017 # Convert file name ARG from *nix to w32 format. Requires a wine environment
3018 # and a working winepath. Returns result in func_to_host_file_result.
3019 func_convert_file_nix_to_w32 ()
3020 {
3021 $debug_cmd
3022
3023 func_to_host_file_result=$1
3024 if test -n "$1"; then
3025 func_convert_core_file_wine_to_w32 "$1"
3026 func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
3027 fi
3028 func_convert_file_check "$1" "$func_to_host_file_result"
3029 }
3030 # end func_convert_file_nix_to_w32
3031
3032
3033 # func_convert_file_msys_to_cygwin ARG
3034 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3035 # Returns result in func_to_host_file_result.
3036 func_convert_file_msys_to_cygwin ()
3037 {
3038 $debug_cmd
3039
3040 func_to_host_file_result=$1
3041 if test -n "$1"; then
3042 func_convert_core_msys_to_w32 "$1"
3043 func_cygpath -u "$func_convert_core_msys_to_w32_result"
3044 func_to_host_file_result=$func_cygpath_result
3045 fi
3046 func_convert_file_check "$1" "$func_to_host_file_result"
3047 }
3048 # end func_convert_file_msys_to_cygwin
3049
3050
3051 # func_convert_file_nix_to_cygwin ARG
3052 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
3053 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
3054 # in func_to_host_file_result.
3055 func_convert_file_nix_to_cygwin ()
3056 {
3057 $debug_cmd
3058
3059 func_to_host_file_result=$1
3060 if test -n "$1"; then
3061 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
3062 func_convert_core_file_wine_to_w32 "$1"
3063 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3064 func_to_host_file_result=$func_cygpath_result
3065 fi
3066 func_convert_file_check "$1" "$func_to_host_file_result"
3067 }
3068 # end func_convert_file_nix_to_cygwin
3069
3070
3071 #############################################
3072 # $build to $host PATH CONVERSION FUNCTIONS #
3073 #############################################
3074 # invoked via '$to_host_path_cmd ARG'
3075 #
3076 # In each case, ARG is the path to be converted from $build to $host format.
3077 # The result will be available in $func_to_host_path_result.
3078 #
3079 # Path separators are also converted from $build format to $host format. If
3080 # ARG begins or ends with a path separator character, it is preserved (but
3081 # converted to $host format) on output.
3082 #
3083 # All path conversion functions are named using the following convention:
3084 # file name conversion function : func_convert_file_X_to_Y ()
3085 # path conversion function : func_convert_path_X_to_Y ()
3086 # where, for any given $build/$host combination the 'X_to_Y' value is the
3087 # same. If conversion functions are added for new $build/$host combinations,
3088 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
3089 # will break.
3090
3091
3092 # func_init_to_host_path_cmd
3093 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
3094 # appropriate value, based on the value of $to_host_file_cmd.
3095 to_host_path_cmd=
3096 func_init_to_host_path_cmd ()
3097 {
3098 $debug_cmd
3099
3100 if test -z "$to_host_path_cmd"; then
3101 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3102 to_host_path_cmd=func_convert_path_$func_stripname_result
3103 fi
3104 }
3105
3106
3107 # func_to_host_path ARG
3108 # Converts the path ARG from $build format to $host format. Return result
3109 # in func_to_host_path_result.
3110 func_to_host_path ()
3111 {
3112 $debug_cmd
3113
3114 func_init_to_host_path_cmd
3115 $to_host_path_cmd "$1"
3116 }
3117 # end func_to_host_path
3118
3119
3120 # func_convert_path_noop ARG
3121 # Copy ARG to func_to_host_path_result.
3122 func_convert_path_noop ()
3123 {
3124 func_to_host_path_result=$1
3125 }
3126 # end func_convert_path_noop
3127
3128
3129 # func_convert_path_msys_to_w32 ARG
3130 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
3131 # conversion to w32 is not available inside the cwrapper. Returns result in
3132 # func_to_host_path_result.
3133 func_convert_path_msys_to_w32 ()
3134 {
3135 $debug_cmd
3136
3137 func_to_host_path_result=$1
3138 if test -n "$1"; then
3139 # Remove leading and trailing path separator characters from ARG. MSYS
3140 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
3141 # and winepath ignores them completely.
3142 func_stripname : : "$1"
3143 func_to_host_path_tmp1=$func_stripname_result
3144 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3145 func_to_host_path_result=$func_convert_core_msys_to_w32_result
3146 func_convert_path_check : ";" \
3147 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3148 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3149 fi
3150 }
3151 # end func_convert_path_msys_to_w32
3152
3153
3154 # func_convert_path_cygwin_to_w32 ARG
3155 # Convert path ARG from Cygwin to w32 format. Returns result in
3156 # func_to_host_file_result.
3157 func_convert_path_cygwin_to_w32 ()
3158 {
3159 $debug_cmd
3160
3161 func_to_host_path_result=$1
3162 if test -n "$1"; then
3163 # See func_convert_path_msys_to_w32:
3164 func_stripname : : "$1"
3165 func_to_host_path_tmp1=$func_stripname_result
3166 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
3167 func_convert_path_check : ";" \
3168 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3169 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3170 fi
3171 }
3172 # end func_convert_path_cygwin_to_w32
3173
3174
3175 # func_convert_path_nix_to_w32 ARG
3176 # Convert path ARG from *nix to w32 format. Requires a wine environment and
3177 # a working winepath. Returns result in func_to_host_file_result.
3178 func_convert_path_nix_to_w32 ()
3179 {
3180 $debug_cmd
3181
3182 func_to_host_path_result=$1
3183 if test -n "$1"; then
3184 # See func_convert_path_msys_to_w32:
3185 func_stripname : : "$1"
3186 func_to_host_path_tmp1=$func_stripname_result
3187 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3188 func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
3189 func_convert_path_check : ";" \
3190 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3191 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3192 fi
3193 }
3194 # end func_convert_path_nix_to_w32
3195
3196
3197 # func_convert_path_msys_to_cygwin ARG
3198 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3199 # Returns result in func_to_host_file_result.
3200 func_convert_path_msys_to_cygwin ()
3201 {
3202 $debug_cmd
3203
3204 func_to_host_path_result=$1
3205 if test -n "$1"; then
3206 # See func_convert_path_msys_to_w32:
3207 func_stripname : : "$1"
3208 func_to_host_path_tmp1=$func_stripname_result
3209 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3210 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3211 func_to_host_path_result=$func_cygpath_result
3212 func_convert_path_check : : \
3213 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3214 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3215 fi
3216 }
3217 # end func_convert_path_msys_to_cygwin
3218
3219
3220 # func_convert_path_nix_to_cygwin ARG
3221 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
3222 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
3223 # func_to_host_file_result.
3224 func_convert_path_nix_to_cygwin ()
3225 {
3226 $debug_cmd
3227
3228 func_to_host_path_result=$1
3229 if test -n "$1"; then
3230 # Remove leading and trailing path separator characters from
3231 # ARG. msys behavior is inconsistent here, cygpath turns them
3232 # into '.;' and ';.', and winepath ignores them completely.
3233 func_stripname : : "$1"
3234 func_to_host_path_tmp1=$func_stripname_result
3235 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3236 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3237 func_to_host_path_result=$func_cygpath_result
3238 func_convert_path_check : : \
3239 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3240 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3241 fi
3242 }
3243 # end func_convert_path_nix_to_cygwin
3244
3245
3246 # func_dll_def_p FILE
3247 # True iff FILE is a Windows DLL '.def' file.
3248 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3249 func_dll_def_p ()
3250 {
3251 $debug_cmd
3252
3253 func_dll_def_p_tmp=`$SED -n \
3254 -e 's/^[ ]*//' \
3255 -e '/^\(;.*\)*$/d' \
3256 -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3257 -e q \
3258 "$1"`
3259 test DEF = "$func_dll_def_p_tmp"
3260 }
3261
3262
3263 # func_mode_compile arg...
3264 func_mode_compile ()
3265 {
3266 $debug_cmd
3267
3268 # Get the compilation command and the source file.
3269 base_compile=
3270 srcfile=$nonopt # always keep a non-empty value in "srcfile"
3271 suppress_opt=yes
3272 suppress_output=
3273 arg_mode=normal
3274 libobj=
3275 later=
3276 pie_flag=
3277
3278 for arg
3279 do
3280 case $arg_mode in
3281 arg )
3282 # do not "continue". Instead, add this to base_compile
3283 lastarg=$arg
3284 arg_mode=normal
3285 ;;
3286
3287 target )
3288 libobj=$arg
3289 arg_mode=normal
3290 continue
3291 ;;
3292
3293 normal )
3294 # Accept any command-line options.
3295 case $arg in
3296 -o)
3297 test -n "$libobj" && \
3298 func_fatal_error "you cannot specify '-o' more than once"
3299 arg_mode=target
3300 continue
3301 ;;
3302
3303 -pie | -fpie | -fPIE)
3304 func_append pie_flag " $arg"
3305 continue
3306 ;;
3307
3308 -shared | -static | -prefer-pic | -prefer-non-pic)
3309 func_append later " $arg"
3310 continue
3311 ;;
3312
3313 -no-suppress)
3314 suppress_opt=no
3315 continue
3316 ;;
3317
3318 -Xcompiler)
3319 arg_mode=arg # the next one goes into the "base_compile" arg list
3320 continue # The current "srcfile" will either be retained or
3321 ;; # replaced later. I would guess that would be a bug.
3322
3323 -Wc,*)
3324 func_stripname '-Wc,' '' "$arg"
3325 args=$func_stripname_result
3326 lastarg=
3327 save_ifs=$IFS; IFS=,
3328 for arg in $args; do
3329 IFS=$save_ifs
3330 func_append_quoted lastarg "$arg"
3331 done
3332 IFS=$save_ifs
3333 func_stripname ' ' '' "$lastarg"
3334 lastarg=$func_stripname_result
3335
3336 # Add the arguments to base_compile.
3337 func_append base_compile " $lastarg"
3338 continue
3339 ;;
3340
3341 *)
3342 # Accept the current argument as the source file.
3343 # The previous "srcfile" becomes the current argument.
3344 #
3345 lastarg=$srcfile
3346 srcfile=$arg
3347 ;;
3348 esac # case $arg
3349 ;;
3350 esac # case $arg_mode
3351
3352 # Aesthetically quote the previous argument.
3353 func_append_quoted base_compile "$lastarg"
3354 done # for arg
3355
3356 case $arg_mode in
3357 arg)
3358 func_fatal_error "you must specify an argument for -Xcompile"
3359 ;;
3360 target)
3361 func_fatal_error "you must specify a target with '-o'"
3362 ;;
3363 *)
3364 # Get the name of the library object.
3365 test -z "$libobj" && {
3366 func_basename "$srcfile"
3367 libobj=$func_basename_result
3368 }
3369 ;;
3370 esac
3371
3372 # Recognize several different file suffixes.
3373 # If the user specifies -o file.o, it is replaced with file.lo
3374 case $libobj in
3375 *.[cCFSifmso] | \
3376 *.ada | *.adb | *.ads | *.asm | \
3377 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
3378 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
3379 func_xform "$libobj"
3380 libobj=$func_xform_result
3381 ;;
3382 esac
3383
3384 case $libobj in
3385 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
3386 *)
3387 func_fatal_error "cannot determine name of library object from '$libobj'"
3388 ;;
3389 esac
3390
3391 func_infer_tag $base_compile
3392
3393 for arg in $later; do
3394 case $arg in
3395 -shared)
3396 test yes = "$build_libtool_libs" \
3397 || func_fatal_configuration "cannot build a shared library"
3398 build_old_libs=no
3399 continue
3400 ;;
3401
3402 -static)
3403 build_libtool_libs=no
3404 build_old_libs=yes
3405 continue
3406 ;;
3407
3408 -prefer-pic)
3409 pic_mode=yes
3410 continue
3411 ;;
3412
3413 -prefer-non-pic)
3414 pic_mode=no
3415 continue
3416 ;;
3417 esac
3418 done
3419
3420 func_quote_for_eval "$libobj"
3421 test "X$libobj" != "X$func_quote_for_eval_result" \
3422 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
3423 && func_warning "libobj name '$libobj' may not contain shell special characters."
3424 func_dirname_and_basename "$obj" "/" ""
3425 objname=$func_basename_result
3426 xdir=$func_dirname_result
3427 lobj=$xdir$objdir/$objname
3428
3429 test -z "$base_compile" && \
3430 func_fatal_help "you must specify a compilation command"
3431
3432 # Delete any leftover library objects.
3433 if test yes = "$build_old_libs"; then
3434 removelist="$obj $lobj $libobj ${libobj}T"
3435 else
3436 removelist="$lobj $libobj ${libobj}T"
3437 fi
3438
3439 # On Cygwin there's no "real" PIC flag so we must build both object types
3440 case $host_os in
3441 cygwin* | mingw* | pw32* | os2* | cegcc*)
3442 pic_mode=default
3443 ;;
3444 esac
3445 if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
3446 # non-PIC code in shared libraries is not supported
3447 pic_mode=default
3448 fi
3449
3450 # Calculate the filename of the output object if compiler does
3451 # not support -o with -c
3452 if test no = "$compiler_c_o"; then
3453 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3454 lockfile=$output_obj.lock
3455 else
3456 output_obj=
3457 need_locks=no
3458 lockfile=
3459 fi
3460
3461 # Lock this critical section if it is needed
3462 # We use this script file to make the link, it avoids creating a new file
3463 if test yes = "$need_locks"; then
3464 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3465 func_echo "Waiting for $lockfile to be removed"
3466 sleep 2
3467 done
3468 elif test warn = "$need_locks"; then
3469 if test -f "$lockfile"; then
3470 $ECHO "\
3471 *** ERROR, $lockfile exists and contains:
3472 `cat $lockfile 2>/dev/null`
3473
3474 This indicates that another process is trying to use the same
3475 temporary object file, and libtool could not work around it because
3476 your compiler does not support '-c' and '-o' together. If you
3477 repeat this compilation, it may succeed, by chance, but you had better
3478 avoid parallel builds (make -j) in this platform, or get a better
3479 compiler."
3480
3481 $opt_dry_run || $RM $removelist
3482 exit $EXIT_FAILURE
3483 fi
3484 func_append removelist " $output_obj"
3485 $ECHO "$srcfile" > "$lockfile"
3486 fi
3487
3488 $opt_dry_run || $RM $removelist
3489 func_append removelist " $lockfile"
3490 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
3491
3492 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
3493 srcfile=$func_to_tool_file_result
3494 func_quote_for_eval "$srcfile"
3495 qsrcfile=$func_quote_for_eval_result
3496
3497 # Only build a PIC object if we are building libtool libraries.
3498 if test yes = "$build_libtool_libs"; then
3499 # Without this assignment, base_compile gets emptied.
3500 fbsd_hideous_sh_bug=$base_compile
3501
3502 if test no != "$pic_mode"; then
3503 command="$base_compile $qsrcfile $pic_flag"
3504 else
3505 # Don't build PIC code
3506 command="$base_compile $qsrcfile"
3507 fi
3508
3509 func_mkdir_p "$xdir$objdir"
3510
3511 if test -z "$output_obj"; then
3512 # Place PIC objects in $objdir
3513 func_append command " -o $lobj"
3514 fi
3515
3516 func_show_eval_locale "$command" \
3517 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
3518
3519 if test warn = "$need_locks" &&
3520 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3521 $ECHO "\
3522 *** ERROR, $lockfile contains:
3523 `cat $lockfile 2>/dev/null`
3524
3525 but it should contain:
3526 $srcfile
3527
3528 This indicates that another process is trying to use the same
3529 temporary object file, and libtool could not work around it because
3530 your compiler does not support '-c' and '-o' together. If you
3531 repeat this compilation, it may succeed, by chance, but you had better
3532 avoid parallel builds (make -j) in this platform, or get a better
3533 compiler."
3534
3535 $opt_dry_run || $RM $removelist
3536 exit $EXIT_FAILURE
3537 fi
3538
3539 # Just move the object if needed, then go on to compile the next one
3540 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
3541 func_show_eval '$MV "$output_obj" "$lobj"' \
3542 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3543 fi
3544
3545 # Allow error messages only from the first compilation.
3546 if test yes = "$suppress_opt"; then
3547 suppress_output=' >/dev/null 2>&1'
3548 fi
3549 fi
3550
3551 # Only build a position-dependent object if we build old libraries.
3552 if test yes = "$build_old_libs"; then
3553 if test yes != "$pic_mode"; then
3554 # Don't build PIC code
3555 command="$base_compile $qsrcfile$pie_flag"
3556 else
3557 command="$base_compile $qsrcfile $pic_flag"
3558 fi
3559 if test yes = "$compiler_c_o"; then
3560 func_append command " -o $obj"
3561 fi
3562
3563 # Suppress compiler output if we already did a PIC compilation.
3564 func_append command "$suppress_output"
3565 func_show_eval_locale "$command" \
3566 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
3567
3568 if test warn = "$need_locks" &&
3569 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3570 $ECHO "\
3571 *** ERROR, $lockfile contains:
3572 `cat $lockfile 2>/dev/null`
3573
3574 but it should contain:
3575 $srcfile
3576
3577 This indicates that another process is trying to use the same
3578 temporary object file, and libtool could not work around it because
3579 your compiler does not support '-c' and '-o' together. If you
3580 repeat this compilation, it may succeed, by chance, but you had better
3581 avoid parallel builds (make -j) in this platform, or get a better
3582 compiler."
3583
3584 $opt_dry_run || $RM $removelist
3585 exit $EXIT_FAILURE
3586 fi
3587
3588 # Just move the object if needed
3589 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
3590 func_show_eval '$MV "$output_obj" "$obj"' \
3591 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3592 fi
3593 fi
3594
3595 $opt_dry_run || {
3596 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
3597
3598 # Unlock the critical section if it was locked
3599 if test no != "$need_locks"; then
3600 removelist=$lockfile
3601 $RM "$lockfile"
3602 fi
3603 }
3604
3605 exit $EXIT_SUCCESS
3606 }
3607
3608 $opt_help || {
3609 test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
3610 }
3611
3612 func_mode_help ()
3613 {
3614 # We need to display help for each of the modes.
3615 case $opt_mode in
3616 "")
3617 # Generic help is extracted from the usage comments
3618 # at the start of this file.
3619 func_help
3620 ;;
3621
3622 clean)
3623 $ECHO \
3624 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
3625
3626 Remove files from the build directory.
3627
3628 RM is the name of the program to use to delete files associated with each FILE
3629 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
3630 to RM.
3631
3632 If FILE is a libtool library, object or program, all the files associated
3633 with it are deleted. Otherwise, only FILE itself is deleted using RM."
3634 ;;
3635
3636 compile)
3637 $ECHO \
3638 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3639
3640 Compile a source file into a libtool library object.
3641
3642 This mode accepts the following additional options:
3643
3644 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3645 -no-suppress do not suppress compiler output for multiple passes
3646 -prefer-pic try to build PIC objects only
3647 -prefer-non-pic try to build non-PIC objects only
3648 -shared do not build a '.o' file suitable for static linking
3649 -static only build a '.o' file suitable for static linking
3650 -Wc,FLAG pass FLAG directly to the compiler
3651
3652 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
3653 from the given SOURCEFILE.
3654
3655 The output file name is determined by removing the directory component from
3656 SOURCEFILE, then substituting the C source code suffix '.c' with the
3657 library object suffix, '.lo'."
3658 ;;
3659
3660 execute)
3661 $ECHO \
3662 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
3663
3664 Automatically set library path, then run a program.
3665
3666 This mode accepts the following additional options:
3667
3668 -dlopen FILE add the directory containing FILE to the library path
3669
3670 This mode sets the library path environment variable according to '-dlopen'
3671 flags.
3672
3673 If any of the ARGS are libtool executable wrappers, then they are translated
3674 into their corresponding uninstalled binary, and any of their required library
3675 directories are added to the library path.
3676
3677 Then, COMMAND is executed, with ARGS as arguments."
3678 ;;
3679
3680 finish)
3681 $ECHO \
3682 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
3683
3684 Complete the installation of libtool libraries.
3685
3686 Each LIBDIR is a directory that contains libtool libraries.
3687
3688 The commands that this mode executes may require superuser privileges. Use
3689 the '--dry-run' option if you just want to see what would be executed."
3690 ;;
3691
3692 install)
3693 $ECHO \
3694 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
3695
3696 Install executables or libraries.
3697
3698 INSTALL-COMMAND is the installation command. The first component should be
3699 either the 'install' or 'cp' program.
3700
3701 The following components of INSTALL-COMMAND are treated specially:
3702
3703 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
3704
3705 The rest of the components are interpreted as arguments to that command (only
3706 BSD-compatible install options are recognized)."
3707 ;;
3708
3709 link)
3710 $ECHO \
3711 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
3712
3713 Link object files or libraries together to form another library, or to
3714 create an executable program.
3715
3716 LINK-COMMAND is a command using the C compiler that you would use to create
3717 a program from several object files.
3718
3719 The following components of LINK-COMMAND are treated specially:
3720
3721 -all-static do not do any dynamic linking at all
3722 -avoid-version do not add a version suffix if possible
3723 -bindir BINDIR specify path to binaries directory (for systems where
3724 libraries must be found in the PATH setting at runtime)
3725 -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
3726 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3727 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3728 -export-symbols SYMFILE
3729 try to export only the symbols listed in SYMFILE
3730 -export-symbols-regex REGEX
3731 try to export only the symbols matching REGEX
3732 -LLIBDIR search LIBDIR for required installed libraries
3733 -lNAME OUTPUT-FILE requires the installed library libNAME
3734 -module build a library that can dlopened
3735 -no-fast-install disable the fast-install mode
3736 -no-install link a not-installable executable
3737 -no-undefined declare that a library does not refer to external symbols
3738 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3739 -objectlist FILE use a list of object files found in FILE to specify objects
3740 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
3741 -precious-files-regex REGEX
3742 don't remove output files matching REGEX
3743 -release RELEASE specify package release information
3744 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3745 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3746 -shared only do dynamic linking of libtool libraries
3747 -shrext SUFFIX override the standard shared library file extension
3748 -static do not do any dynamic linking of uninstalled libtool libraries
3749 -static-libtool-libs
3750 do not do any dynamic linking of libtool libraries
3751 -version-info CURRENT[:REVISION[:AGE]]
3752 specify library version info [each variable defaults to 0]
3753 -weak LIBNAME declare that the target provides the LIBNAME interface
3754 -Wc,FLAG
3755 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
3756 -Wl,FLAG
3757 -Xlinker FLAG pass linker-specific FLAG directly to the linker
3758 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
3759
3760 All other options (arguments beginning with '-') are ignored.
3761
3762 Every other argument is treated as a filename. Files ending in '.la' are
3763 treated as uninstalled libtool libraries, other files are standard or library
3764 object files.
3765
3766 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
3767 only library objects ('.lo' files) may be specified, and '-rpath' is
3768 required, except when creating a convenience library.
3769
3770 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
3771 using 'ar' and 'ranlib', or on Windows using 'lib'.
3772
3773 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
3774 is created, otherwise an executable program is created."
3775 ;;
3776
3777 uninstall)
3778 $ECHO \
3779 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
3780
3781 Remove libraries from an installation directory.
3782
3783 RM is the name of the program to use to delete files associated with each FILE
3784 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
3785 to RM.
3786
3787 If FILE is a libtool library, all the files associated with it are deleted.
3788 Otherwise, only FILE itself is deleted using RM."
3789 ;;
3790
3791 *)
3792 func_fatal_help "invalid operation mode '$opt_mode'"
3793 ;;
3794 esac
3795
3796 echo
3797 $ECHO "Try '$progname --help' for more information about other modes."
3798 }
3799
3800 # Now that we've collected a possible --mode arg, show help if necessary
3801 if $opt_help; then
3802 if test : = "$opt_help"; then
3803 func_mode_help
3804 else
3805 {
3806 func_help noexit
3807 for opt_mode in compile link execute install finish uninstall clean; do
3808 func_mode_help
3809 done
3810 } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
3811 {
3812 func_help noexit
3813 for opt_mode in compile link execute install finish uninstall clean; do
3814 echo
3815 func_mode_help
3816 done
3817 } |
3818 $SED '1d
3819 /^When reporting/,/^Report/{
3820 H
3821 d
3822 }
3823 $x
3824 /information about other modes/d
3825 /more detailed .*MODE/d
3826 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
3827 fi
3828 exit $?
3829 fi
3830
3831
3832 # func_mode_execute arg...
3833 func_mode_execute ()
3834 {
3835 $debug_cmd
3836
3837 # The first argument is the command name.
3838 cmd=$nonopt
3839 test -z "$cmd" && \
3840 func_fatal_help "you must specify a COMMAND"
3841
3842 # Handle -dlopen flags immediately.
3843 for file in $opt_dlopen; do
3844 test -f "$file" \
3845 || func_fatal_help "'$file' is not a file"
3846
3847 dir=
3848 case $file in
3849 *.la)
3850 func_resolve_sysroot "$file"
3851 file=$func_resolve_sysroot_result
3852
3853 # Check to see that this really is a libtool archive.
3854 func_lalib_unsafe_p "$file" \
3855 || func_fatal_help "'$lib' is not a valid libtool archive"
3856
3857 # Read the libtool library.
3858 dlname=
3859 library_names=
3860 func_source "$file"
3861
3862 # Skip this library if it cannot be dlopened.
3863 if test -z "$dlname"; then
3864 # Warn if it was a shared library.
3865 test -n "$library_names" && \
3866 func_warning "'$file' was not linked with '-export-dynamic'"
3867 continue
3868 fi
3869
3870 func_dirname "$file" "" "."
3871 dir=$func_dirname_result
3872
3873 if test -f "$dir/$objdir/$dlname"; then
3874 func_append dir "/$objdir"
3875 else
3876 if test ! -f "$dir/$dlname"; then
3877 func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
3878 fi
3879 fi
3880 ;;
3881
3882 *.lo)
3883 # Just add the directory containing the .lo file.
3884 func_dirname "$file" "" "."
3885 dir=$func_dirname_result
3886 ;;
3887
3888 *)
3889 func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
3890 continue
3891 ;;
3892 esac
3893
3894 # Get the absolute pathname.
3895 absdir=`cd "$dir" && pwd`
3896 test -n "$absdir" && dir=$absdir
3897
3898 # Now add the directory to shlibpath_var.
3899 if eval "test -z \"\$$shlibpath_var\""; then
3900 eval "$shlibpath_var=\"\$dir\""
3901 else
3902 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3903 fi
3904 done
3905
3906 # This variable tells wrapper scripts just to set shlibpath_var
3907 # rather than running their programs.
3908 libtool_execute_magic=$magic
3909
3910 # Check if any of the arguments is a wrapper script.
3911 args=
3912 for file
3913 do
3914 case $file in
3915 -* | *.la | *.lo ) ;;
3916 *)
3917 # Do a test to see if this is really a libtool program.
3918 if func_ltwrapper_script_p "$file"; then
3919 func_source "$file"
3920 # Transform arg to wrapped name.
3921 file=$progdir/$program
3922 elif func_ltwrapper_executable_p "$file"; then
3923 func_ltwrapper_scriptname "$file"
3924 func_source "$func_ltwrapper_scriptname_result"
3925 # Transform arg to wrapped name.
3926 file=$progdir/$program
3927 fi
3928 ;;
3929 esac
3930 # Quote arguments (to preserve shell metacharacters).
3931 func_append_quoted args "$file"
3932 done
3933
3934 if $opt_dry_run; then
3935 # Display what would be done.
3936 if test -n "$shlibpath_var"; then
3937 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3938 echo "export $shlibpath_var"
3939 fi
3940 $ECHO "$cmd$args"
3941 exit $EXIT_SUCCESS
3942 else
3943 if test -n "$shlibpath_var"; then
3944 # Export the shlibpath_var.
3945 eval "export $shlibpath_var"
3946 fi
3947
3948 # Restore saved environment variables
3949 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3950 do
3951 eval "if test \"\${save_$lt_var+set}\" = set; then
3952 $lt_var=\$save_$lt_var; export $lt_var
3953 else
3954 $lt_unset $lt_var
3955 fi"
3956 done
3957
3958 # Now prepare to actually exec the command.
3959 exec_cmd=\$cmd$args
3960 fi
3961 }
3962
3963 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
3964
3965
3966 # func_mode_finish arg...
3967 func_mode_finish ()
3968 {
3969 $debug_cmd
3970
3971 libs=
3972 libdirs=
3973 admincmds=
3974
3975 for opt in "$nonopt" ${1+"$@"}
3976 do
3977 if test -d "$opt"; then
3978 func_append libdirs " $opt"
3979
3980 elif test -f "$opt"; then
3981 if func_lalib_unsafe_p "$opt"; then
3982 func_append libs " $opt"
3983 else
3984 func_warning "'$opt' is not a valid libtool archive"
3985 fi
3986
3987 else
3988 func_fatal_error "invalid argument '$opt'"
3989 fi
3990 done
3991
3992 if test -n "$libs"; then
3993 if test -n "$lt_sysroot"; then
3994 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3995 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3996 else
3997 sysroot_cmd=
3998 fi
3999
4000 # Remove sysroot references
4001 if $opt_dry_run; then
4002 for lib in $libs; do
4003 echo "removing references to $lt_sysroot and '=' prefixes from $lib"
4004 done
4005 else
4006 tmpdir=`func_mktempdir`
4007 for lib in $libs; do
4008 $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
4009 > $tmpdir/tmp-la
4010 mv -f $tmpdir/tmp-la $lib
4011 done
4012 ${RM}r "$tmpdir"
4013 fi
4014 fi
4015
4016 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4017 for libdir in $libdirs; do
4018 if test -n "$finish_cmds"; then
4019 # Do each command in the finish commands.
4020 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
4021 '"$cmd"'"'
4022 fi
4023 if test -n "$finish_eval"; then
4024 # Do the single finish_eval.
4025 eval cmds=\"$finish_eval\"
4026 $opt_dry_run || eval "$cmds" || func_append admincmds "
4027 $cmds"
4028 fi
4029 done
4030 fi
4031
4032 # Exit here if they wanted silent mode.
4033 $opt_quiet && exit $EXIT_SUCCESS
4034
4035 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4036 echo "----------------------------------------------------------------------"
4037 echo "Libraries have been installed in:"
4038 for libdir in $libdirs; do
4039 $ECHO " $libdir"
4040 done
4041 echo
4042 echo "If you ever happen to want to link against installed libraries"
4043 echo "in a given directory, LIBDIR, you must either use libtool, and"
4044 echo "specify the full pathname of the library, or use the '-LLIBDIR'"
4045 echo "flag during linking and do at least one of the following:"
4046 if test -n "$shlibpath_var"; then
4047 echo " - add LIBDIR to the '$shlibpath_var' environment variable"
4048 echo " during execution"
4049 fi
4050 if test -n "$runpath_var"; then
4051 echo " - add LIBDIR to the '$runpath_var' environment variable"
4052 echo " during linking"
4053 fi
4054 if test -n "$hardcode_libdir_flag_spec"; then
4055 libdir=LIBDIR
4056 eval flag=\"$hardcode_libdir_flag_spec\"
4057
4058 $ECHO " - use the '$flag' linker flag"
4059 fi
4060 if test -n "$admincmds"; then
4061 $ECHO " - have your system administrator run these commands:$admincmds"
4062 fi
4063 if test -f /etc/ld.so.conf; then
4064 echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
4065 fi
4066 echo
4067
4068 echo "See any operating system documentation about shared libraries for"
4069 case $host in
4070 solaris2.[6789]|solaris2.1[0-9])
4071 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
4072 echo "pages."
4073 ;;
4074 *)
4075 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4076 ;;
4077 esac
4078 echo "----------------------------------------------------------------------"
4079 fi
4080 exit $EXIT_SUCCESS
4081 }
4082
4083 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
4084
4085
4086 # func_mode_install arg...
4087 func_mode_install ()
4088 {
4089 $debug_cmd
4090
4091 # There may be an optional sh(1) argument at the beginning of
4092 # install_prog (especially on Windows NT).
4093 if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
4094 # Allow the use of GNU shtool's install command.
4095 case $nonopt in *shtool*) :;; *) false;; esac
4096 then
4097 # Aesthetically quote it.
4098 func_quote_for_eval "$nonopt"
4099 install_prog="$func_quote_for_eval_result "
4100 arg=$1
4101 shift
4102 else
4103 install_prog=
4104 arg=$nonopt
4105 fi
4106
4107 # The real first argument should be the name of the installation program.
4108 # Aesthetically quote it.
4109 func_quote_for_eval "$arg"
4110 func_append install_prog "$func_quote_for_eval_result"
4111 install_shared_prog=$install_prog
4112 case " $install_prog " in
4113 *[\\\ /]cp\ *) install_cp=: ;;
4114 *) install_cp=false ;;
4115 esac
4116
4117 # We need to accept at least all the BSD install flags.
4118 dest=
4119 files=
4120 opts=
4121 prev=
4122 install_type=
4123 isdir=false
4124 stripme=
4125 no_mode=:
4126 for arg
4127 do
4128 arg2=
4129 if test -n "$dest"; then
4130 func_append files " $dest"
4131 dest=$arg
4132 continue
4133 fi
4134
4135 case $arg in
4136 -d) isdir=: ;;
4137 -f)
4138 if $install_cp; then :; else
4139 prev=$arg
4140 fi
4141 ;;
4142 -g | -m | -o)
4143 prev=$arg
4144 ;;
4145 -s)
4146 stripme=" -s"
4147 continue
4148 ;;
4149 -*)
4150 ;;
4151 *)
4152 # If the previous option needed an argument, then skip it.
4153 if test -n "$prev"; then
4154 if test X-m = "X$prev" && test -n "$install_override_mode"; then
4155 arg2=$install_override_mode
4156 no_mode=false
4157 fi
4158 prev=
4159 else
4160 dest=$arg
4161 continue
4162 fi
4163 ;;
4164 esac
4165
4166 # Aesthetically quote the argument.
4167 func_quote_for_eval "$arg"
4168 func_append install_prog " $func_quote_for_eval_result"
4169 if test -n "$arg2"; then
4170 func_quote_for_eval "$arg2"
4171 fi
4172 func_append install_shared_prog " $func_quote_for_eval_result"
4173 done
4174
4175 test -z "$install_prog" && \
4176 func_fatal_help "you must specify an install program"
4177
4178 test -n "$prev" && \
4179 func_fatal_help "the '$prev' option requires an argument"
4180
4181 if test -n "$install_override_mode" && $no_mode; then
4182 if $install_cp; then :; else
4183 func_quote_for_eval "$install_override_mode"
4184 func_append install_shared_prog " -m $func_quote_for_eval_result"
4185 fi
4186 fi
4187
4188 if test -z "$files"; then
4189 if test -z "$dest"; then
4190 func_fatal_help "no file or destination specified"
4191 else
4192 func_fatal_help "you must specify a destination"
4193 fi
4194 fi
4195
4196 # Strip any trailing slash from the destination.
4197 func_stripname '' '/' "$dest"
4198 dest=$func_stripname_result
4199
4200 # Check to see that the destination is a directory.
4201 test -d "$dest" && isdir=:
4202 if $isdir; then
4203 destdir=$dest
4204 destname=
4205 else
4206 func_dirname_and_basename "$dest" "" "."
4207 destdir=$func_dirname_result
4208 destname=$func_basename_result
4209
4210 # Not a directory, so check to see that there is only one file specified.
4211 set dummy $files; shift
4212 test "$#" -gt 1 && \
4213 func_fatal_help "'$dest' is not a directory"
4214 fi
4215 case $destdir in
4216 [\\/]* | [A-Za-z]:[\\/]*) ;;
4217 *)
4218 for file in $files; do
4219 case $file in
4220 *.lo) ;;
4221 *)
4222 func_fatal_help "'$destdir' must be an absolute directory name"
4223 ;;
4224 esac
4225 done
4226 ;;
4227 esac
4228
4229 # This variable tells wrapper scripts just to set variables rather
4230 # than running their programs.
4231 libtool_install_magic=$magic
4232
4233 staticlibs=
4234 future_libdirs=
4235 current_libdirs=
4236 for file in $files; do
4237
4238 # Do each installation.
4239 case $file in
4240 *.$libext)
4241 # Do the static libraries later.
4242 func_append staticlibs " $file"
4243 ;;
4244
4245 *.la)
4246 func_resolve_sysroot "$file"
4247 file=$func_resolve_sysroot_result
4248
4249 # Check to see that this really is a libtool archive.
4250 func_lalib_unsafe_p "$file" \
4251 || func_fatal_help "'$file' is not a valid libtool archive"
4252
4253 library_names=
4254 old_library=
4255 relink_command=
4256 func_source "$file"
4257
4258 # Add the libdir to current_libdirs if it is the destination.
4259 if test "X$destdir" = "X$libdir"; then
4260 case "$current_libdirs " in
4261 *" $libdir "*) ;;
4262 *) func_append current_libdirs " $libdir" ;;
4263 esac
4264 else
4265 # Note the libdir as a future libdir.
4266 case "$future_libdirs " in
4267 *" $libdir "*) ;;
4268 *) func_append future_libdirs " $libdir" ;;
4269 esac
4270 fi
4271
4272 func_dirname "$file" "/" ""
4273 dir=$func_dirname_result
4274 func_append dir "$objdir"
4275
4276 if test -n "$relink_command"; then
4277 # Determine the prefix the user has applied to our future dir.
4278 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
4279
4280 # Don't allow the user to place us outside of our expected
4281 # location b/c this prevents finding dependent libraries that
4282 # are installed to the same prefix.
4283 # At present, this check doesn't affect windows .dll's that
4284 # are installed into $libdir/../bin (currently, that works fine)
4285 # but it's something to keep an eye on.
4286 test "$inst_prefix_dir" = "$destdir" && \
4287 func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
4288
4289 if test -n "$inst_prefix_dir"; then
4290 # Stick the inst_prefix_dir data into the link command.
4291 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4292 else
4293 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4294 fi
4295
4296 func_warning "relinking '$file'"
4297 func_show_eval "$relink_command" \
4298 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
4299 fi
4300
4301 # See the names of the shared library.
4302 set dummy $library_names; shift
4303 if test -n "$1"; then
4304 realname=$1
4305 shift
4306
4307 srcname=$realname
4308 test -n "$relink_command" && srcname=${realname}T
4309
4310 # Install the shared library and build the symlinks.
4311 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
4312 'exit $?'
4313 tstripme=$stripme
4314 case $host_os in
4315 cygwin* | mingw* | pw32* | cegcc*)
4316 case $realname in
4317 *.dll.a)
4318 tstripme=
4319 ;;
4320 esac
4321 ;;
4322 os2*)
4323 case $realname in
4324 *_dll.a)
4325 tstripme=
4326 ;;
4327 esac
4328 ;;
4329 esac
4330 if test -n "$tstripme" && test -n "$striplib"; then
4331 func_show_eval "$striplib $destdir/$realname" 'exit $?'
4332 fi
4333
4334 if test "$#" -gt 0; then
4335 # Delete the old symlinks, and create new ones.
4336 # Try 'ln -sf' first, because the 'ln' binary might depend on
4337 # the symlink we replace! Solaris /bin/ln does not understand -f,
4338 # so we also need to try rm && ln -s.
4339 for linkname
4340 do
4341 test "$linkname" != "$realname" \
4342 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
4343 done
4344 fi
4345
4346 # Do each command in the postinstall commands.
4347 lib=$destdir/$realname
4348 func_execute_cmds "$postinstall_cmds" 'exit $?'
4349 fi
4350
4351 # Install the pseudo-library for information purposes.
4352 func_basename "$file"
4353 name=$func_basename_result
4354 instname=$dir/${name}i
4355 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
4356
4357 # Maybe install the static library, too.
4358 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
4359 ;;
4360
4361 *.lo)
4362 # Install (i.e. copy) a libtool object.
4363
4364 # Figure out destination file name, if it wasn't already specified.
4365 if test -n "$destname"; then
4366 destfile=$destdir/$destname
4367 else
4368 func_basename "$file"
4369 destfile=$func_basename_result
4370 destfile=$destdir/$destfile
4371 fi
4372
4373 # Deduce the name of the destination old-style object file.
4374 case $destfile in
4375 *.lo)
4376 func_lo2o "$destfile"
4377 staticdest=$func_lo2o_result
4378 ;;
4379 *.$objext)
4380 staticdest=$destfile
4381 destfile=
4382 ;;
4383 *)
4384 func_fatal_help "cannot copy a libtool object to '$destfile'"
4385 ;;
4386 esac
4387
4388 # Install the libtool object if requested.
4389 test -n "$destfile" && \
4390 func_show_eval "$install_prog $file $destfile" 'exit $?'
4391
4392 # Install the old object if enabled.
4393 if test yes = "$build_old_libs"; then
4394 # Deduce the name of the old-style object file.
4395 func_lo2o "$file"
4396 staticobj=$func_lo2o_result
4397 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
4398 fi
4399 exit $EXIT_SUCCESS
4400 ;;
4401
4402 *)
4403 # Figure out destination file name, if it wasn't already specified.
4404 if test -n "$destname"; then
4405 destfile=$destdir/$destname
4406 else
4407 func_basename "$file"
4408 destfile=$func_basename_result
4409 destfile=$destdir/$destfile
4410 fi
4411
4412 # If the file is missing, and there is a .exe on the end, strip it
4413 # because it is most likely a libtool script we actually want to
4414 # install
4415 stripped_ext=
4416 case $file in
4417 *.exe)
4418 if test ! -f "$file"; then
4419 func_stripname '' '.exe' "$file"
4420 file=$func_stripname_result
4421 stripped_ext=.exe
4422 fi
4423 ;;
4424 esac
4425
4426 # Do a test to see if this is really a libtool program.
4427 case $host in
4428 *cygwin* | *mingw*)
4429 if func_ltwrapper_executable_p "$file"; then
4430 func_ltwrapper_scriptname "$file"
4431 wrapper=$func_ltwrapper_scriptname_result
4432 else
4433 func_stripname '' '.exe' "$file"
4434 wrapper=$func_stripname_result
4435 fi
4436 ;;
4437 *)
4438 wrapper=$file
4439 ;;
4440 esac
4441 if func_ltwrapper_script_p "$wrapper"; then
4442 notinst_deplibs=
4443 relink_command=
4444
4445 func_source "$wrapper"
4446
4447 # Check the variables that should have been set.
4448 test -z "$generated_by_libtool_version" && \
4449 func_fatal_error "invalid libtool wrapper script '$wrapper'"
4450
4451 finalize=:
4452 for lib in $notinst_deplibs; do
4453 # Check to see that each library is installed.
4454 libdir=
4455 if test -f "$lib"; then
4456 func_source "$lib"
4457 fi
4458 libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
4459 if test -n "$libdir" && test ! -f "$libfile"; then
4460 func_warning "'$lib' has not been installed in '$libdir'"
4461 finalize=false
4462 fi
4463 done
4464
4465 relink_command=
4466 func_source "$wrapper"
4467
4468 outputname=
4469 if test no = "$fast_install" && test -n "$relink_command"; then
4470 $opt_dry_run || {
4471 if $finalize; then
4472 tmpdir=`func_mktempdir`
4473 func_basename "$file$stripped_ext"
4474 file=$func_basename_result
4475 outputname=$tmpdir/$file
4476 # Replace the output file specification.
4477 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
4478
4479 $opt_quiet || {
4480 func_quote_for_expand "$relink_command"
4481 eval "func_echo $func_quote_for_expand_result"
4482 }
4483 if eval "$relink_command"; then :
4484 else
4485 func_error "error: relink '$file' with the above command before installing it"
4486 $opt_dry_run || ${RM}r "$tmpdir"
4487 continue
4488 fi
4489 file=$outputname
4490 else
4491 func_warning "cannot relink '$file'"
4492 fi
4493 }
4494 else
4495 # Install the binary that we compiled earlier.
4496 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
4497 fi
4498 fi
4499
4500 # remove .exe since cygwin /usr/bin/install will append another
4501 # one anyway
4502 case $install_prog,$host in
4503 */usr/bin/install*,*cygwin*)
4504 case $file:$destfile in
4505 *.exe:*.exe)
4506 # this is ok
4507 ;;
4508 *.exe:*)
4509 destfile=$destfile.exe
4510 ;;
4511 *:*.exe)
4512 func_stripname '' '.exe' "$destfile"
4513 destfile=$func_stripname_result
4514 ;;
4515 esac
4516 ;;
4517 esac
4518 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
4519 $opt_dry_run || if test -n "$outputname"; then
4520 ${RM}r "$tmpdir"
4521 fi
4522 ;;
4523 esac
4524 done
4525
4526 for file in $staticlibs; do
4527 func_basename "$file"
4528 name=$func_basename_result
4529
4530 # Set up the ranlib parameters.
4531 oldlib=$destdir/$name
4532 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
4533 tool_oldlib=$func_to_tool_file_result
4534
4535 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
4536
4537 if test -n "$stripme" && test -n "$old_striplib"; then
4538 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
4539 fi
4540
4541 # Do each command in the postinstall commands.
4542 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
4543 done
4544
4545 test -n "$future_libdirs" && \
4546 func_warning "remember to run '$progname --finish$future_libdirs'"
4547
4548 if test -n "$current_libdirs"; then
4549 # Maybe just do a dry run.
4550 $opt_dry_run && current_libdirs=" -n$current_libdirs"
4551 exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
4552 else
4553 exit $EXIT_SUCCESS
4554 fi
4555 }
4556
4557 test install = "$opt_mode" && func_mode_install ${1+"$@"}
4558
4559
4560 # func_generate_dlsyms outputname originator pic_p
4561 # Extract symbols from dlprefiles and create ${outputname}S.o with
4562 # a dlpreopen symbol table.
4563 func_generate_dlsyms ()
4564 {
4565 $debug_cmd
4566
4567 my_outputname=$1
4568 my_originator=$2
4569 my_pic_p=${3-false}
4570 my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
4571 my_dlsyms=
4572
4573 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
4574 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4575 my_dlsyms=${my_outputname}S.c
4576 else
4577 func_error "not configured to extract global symbols from dlpreopened files"
4578 fi
4579 fi
4580
4581 if test -n "$my_dlsyms"; then
4582 case $my_dlsyms in
4583 "") ;;
4584 *.c)
4585 # Discover the nlist of each of the dlfiles.
4586 nlist=$output_objdir/$my_outputname.nm
4587
4588 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
4589
4590 # Parse the name list into a source file.
4591 func_verbose "creating $output_objdir/$my_dlsyms"
4592
4593 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
4594 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
4595 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
4596
4597 #ifdef __cplusplus
4598 extern \"C\" {
4599 #endif
4600
4601 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
4602 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
4603 #endif
4604
4605 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4606 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4607 /* DATA imports from DLLs on WIN32 can't be const, because runtime
4608 relocations are performed -- see ld's documentation on pseudo-relocs. */
4609 # define LT_DLSYM_CONST
4610 #elif defined __osf__
4611 /* This system does not cope well with relocations in const data. */
4612 # define LT_DLSYM_CONST
4613 #else
4614 # define LT_DLSYM_CONST const
4615 #endif
4616
4617 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4618
4619 /* External symbol declarations for the compiler. */\
4620 "
4621
4622 if test yes = "$dlself"; then
4623 func_verbose "generating symbol list for '$output'"
4624
4625 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
4626
4627 # Add our own program objects to the symbol list.
4628 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
4629 for progfile in $progfiles; do
4630 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
4631 func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
4632 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
4633 done
4634
4635 if test -n "$exclude_expsyms"; then
4636 $opt_dry_run || {
4637 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4638 eval '$MV "$nlist"T "$nlist"'
4639 }
4640 fi
4641
4642 if test -n "$export_symbols_regex"; then
4643 $opt_dry_run || {
4644 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4645 eval '$MV "$nlist"T "$nlist"'
4646 }
4647 fi
4648
4649 # Prepare the list of exported symbols
4650 if test -z "$export_symbols"; then
4651 export_symbols=$output_objdir/$outputname.exp
4652 $opt_dry_run || {
4653 $RM $export_symbols
4654 eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4655 case $host in
4656 *cygwin* | *mingw* | *cegcc* )
4657 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4658 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4659 ;;
4660 esac
4661 }
4662 else
4663 $opt_dry_run || {
4664 eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4665 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4666 eval '$MV "$nlist"T "$nlist"'
4667 case $host in
4668 *cygwin* | *mingw* | *cegcc* )
4669 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4670 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4671 ;;
4672 esac
4673 }
4674 fi
4675 fi
4676
4677 for dlprefile in $dlprefiles; do
4678 func_verbose "extracting global C symbols from '$dlprefile'"
4679 func_basename "$dlprefile"
4680 name=$func_basename_result
4681 case $host in
4682 *cygwin* | *mingw* | *cegcc* )
4683 # if an import library, we need to obtain dlname
4684 if func_win32_import_lib_p "$dlprefile"; then
4685 func_tr_sh "$dlprefile"
4686 eval "curr_lafile=\$libfile_$func_tr_sh_result"
4687 dlprefile_dlbasename=
4688 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
4689 # Use subshell, to avoid clobbering current variable values
4690 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
4691 if test -n "$dlprefile_dlname"; then
4692 func_basename "$dlprefile_dlname"
4693 dlprefile_dlbasename=$func_basename_result
4694 else
4695 # no lafile. user explicitly requested -dlpreopen <import library>.
4696 $sharedlib_from_linklib_cmd "$dlprefile"
4697 dlprefile_dlbasename=$sharedlib_from_linklib_result
4698 fi
4699 fi
4700 $opt_dry_run || {
4701 if test -n "$dlprefile_dlbasename"; then
4702 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
4703 else
4704 func_warning "Could not compute DLL name from $name"
4705 eval '$ECHO ": $name " >> "$nlist"'
4706 fi
4707 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4708 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
4709 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
4710 }
4711 else # not an import lib
4712 $opt_dry_run || {
4713 eval '$ECHO ": $name " >> "$nlist"'
4714 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4715 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4716 }
4717 fi
4718 ;;
4719 *)
4720 $opt_dry_run || {
4721 eval '$ECHO ": $name " >> "$nlist"'
4722 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4723 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4724 }
4725 ;;
4726 esac
4727 done
4728
4729 $opt_dry_run || {
4730 # Make sure we have at least an empty file.
4731 test -f "$nlist" || : > "$nlist"
4732
4733 if test -n "$exclude_expsyms"; then
4734 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4735 $MV "$nlist"T "$nlist"
4736 fi
4737
4738 # Try sorting and uniquifying the output.
4739 if $GREP -v "^: " < "$nlist" |
4740 if sort -k 3 </dev/null >/dev/null 2>&1; then
4741 sort -k 3
4742 else
4743 sort +2
4744 fi |
4745 uniq > "$nlist"S; then
4746 :
4747 else
4748 $GREP -v "^: " < "$nlist" > "$nlist"S
4749 fi
4750
4751 if test -f "$nlist"S; then
4752 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
4753 else
4754 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
4755 fi
4756
4757 func_show_eval '$RM "${nlist}I"'
4758 if test -n "$global_symbol_to_import"; then
4759 eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
4760 fi
4761
4762 echo >> "$output_objdir/$my_dlsyms" "\
4763
4764 /* The mapping between symbol names and symbols. */
4765 typedef struct {
4766 const char *name;
4767 void *address;
4768 } lt_dlsymlist;
4769 extern LT_DLSYM_CONST lt_dlsymlist
4770 lt_${my_prefix}_LTX_preloaded_symbols[];\
4771 "
4772
4773 if test -s "$nlist"I; then
4774 echo >> "$output_objdir/$my_dlsyms" "\
4775 static void lt_syminit(void)
4776 {
4777 LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
4778 for (; symbol->name; ++symbol)
4779 {"
4780 $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
4781 echo >> "$output_objdir/$my_dlsyms" "\
4782 }
4783 }"
4784 fi
4785 echo >> "$output_objdir/$my_dlsyms" "\
4786 LT_DLSYM_CONST lt_dlsymlist
4787 lt_${my_prefix}_LTX_preloaded_symbols[] =
4788 { {\"$my_originator\", (void *) 0},"
4789
4790 if test -s "$nlist"I; then
4791 echo >> "$output_objdir/$my_dlsyms" "\
4792 {\"@INIT@\", (void *) &lt_syminit},"
4793 fi
4794
4795 case $need_lib_prefix in
4796 no)
4797 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
4798 ;;
4799 *)
4800 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
4801 ;;
4802 esac
4803 echo >> "$output_objdir/$my_dlsyms" "\
4804 {0, (void *) 0}
4805 };
4806
4807 /* This works around a problem in FreeBSD linker */
4808 #ifdef FREEBSD_WORKAROUND
4809 static const void *lt_preloaded_setup() {
4810 return lt_${my_prefix}_LTX_preloaded_symbols;
4811 }
4812 #endif
4813
4814 #ifdef __cplusplus
4815 }
4816 #endif\
4817 "
4818 } # !$opt_dry_run
4819
4820 pic_flag_for_symtable=
4821 case "$compile_command " in
4822 *" -static "*) ;;
4823 *)
4824 case $host in
4825 # compiling the symbol table file with pic_flag works around
4826 # a FreeBSD bug that causes programs to crash when -lm is
4827 # linked before any other PIC object. But we must not use
4828 # pic_flag when linking with -static. The problem exists in
4829 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4830 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4831 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
4832 *-*-hpux*)
4833 pic_flag_for_symtable=" $pic_flag" ;;
4834 *)
4835 $my_pic_p && pic_flag_for_symtable=" $pic_flag"
4836 ;;
4837 esac
4838 ;;
4839 esac
4840 symtab_cflags=
4841 for arg in $LTCFLAGS; do
4842 case $arg in
4843 -pie | -fpie | -fPIE) ;;
4844 *) func_append symtab_cflags " $arg" ;;
4845 esac
4846 done
4847
4848 # Now compile the dynamic symbol file.
4849 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
4850
4851 # Clean up the generated files.
4852 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
4853
4854 # Transform the symbol file into the correct name.
4855 symfileobj=$output_objdir/${my_outputname}S.$objext
4856 case $host in
4857 *cygwin* | *mingw* | *cegcc* )
4858 if test -f "$output_objdir/$my_outputname.def"; then
4859 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
4860 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
4861 else
4862 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4863 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4864 fi
4865 ;;
4866 *)
4867 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4868 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4869 ;;
4870 esac
4871 ;;
4872 *)
4873 func_fatal_error "unknown suffix for '$my_dlsyms'"
4874 ;;
4875 esac
4876 else
4877 # We keep going just in case the user didn't refer to
4878 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4879 # really was required.
4880
4881 # Nullify the symbol file.
4882 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
4883 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
4884 fi
4885 }
4886
4887 # func_cygming_gnu_implib_p ARG
4888 # This predicate returns with zero status (TRUE) if
4889 # ARG is a GNU/binutils-style import library. Returns
4890 # with nonzero status (FALSE) otherwise.
4891 func_cygming_gnu_implib_p ()
4892 {
4893 $debug_cmd
4894
4895 func_to_tool_file "$1" func_convert_file_msys_to_w32
4896 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
4897 test -n "$func_cygming_gnu_implib_tmp"
4898 }
4899
4900 # func_cygming_ms_implib_p ARG
4901 # This predicate returns with zero status (TRUE) if
4902 # ARG is an MS-style import library. Returns
4903 # with nonzero status (FALSE) otherwise.
4904 func_cygming_ms_implib_p ()
4905 {
4906 $debug_cmd
4907
4908 func_to_tool_file "$1" func_convert_file_msys_to_w32
4909 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4910 test -n "$func_cygming_ms_implib_tmp"
4911 }
4912
4913 # func_win32_libid arg
4914 # return the library type of file 'arg'
4915 #
4916 # Need a lot of goo to handle *both* DLLs and import libs
4917 # Has to be a shell function in order to 'eat' the argument
4918 # that is supplied when $file_magic_command is called.
4919 # Despite the name, also deal with 64 bit binaries.
4920 func_win32_libid ()
4921 {
4922 $debug_cmd
4923
4924 win32_libid_type=unknown
4925 win32_fileres=`file -L $1 2>/dev/null`
4926 case $win32_fileres in
4927 *ar\ archive\ import\ library*) # definitely import
4928 win32_libid_type="x86 archive import"
4929 ;;
4930 *ar\ archive*) # could be an import, or static
4931 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
4932 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
4933 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
4934 case $nm_interface in
4935 "MS dumpbin")
4936 if func_cygming_ms_implib_p "$1" ||
4937 func_cygming_gnu_implib_p "$1"
4938 then
4939 win32_nmres=import
4940 else
4941 win32_nmres=
4942 fi
4943 ;;
4944 *)
4945 func_to_tool_file "$1" func_convert_file_msys_to_w32
4946 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4947 $SED -n -e '
4948 1,100{
4949 / I /{
4950 s|.*|import|
4951 p
4952 q
4953 }
4954 }'`
4955 ;;
4956 esac
4957 case $win32_nmres in
4958 import*) win32_libid_type="x86 archive import";;
4959 *) win32_libid_type="x86 archive static";;
4960 esac
4961 fi
4962 ;;
4963 *DLL*)
4964 win32_libid_type="x86 DLL"
4965 ;;
4966 *executable*) # but shell scripts are "executable" too...
4967 case $win32_fileres in
4968 *MS\ Windows\ PE\ Intel*)
4969 win32_libid_type="x86 DLL"
4970 ;;
4971 esac
4972 ;;
4973 esac
4974 $ECHO "$win32_libid_type"
4975 }
4976
4977 # func_cygming_dll_for_implib ARG
4978 #
4979 # Platform-specific function to extract the
4980 # name of the DLL associated with the specified
4981 # import library ARG.
4982 # Invoked by eval'ing the libtool variable
4983 # $sharedlib_from_linklib_cmd
4984 # Result is available in the variable
4985 # $sharedlib_from_linklib_result
4986 func_cygming_dll_for_implib ()
4987 {
4988 $debug_cmd
4989
4990 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
4991 }
4992
4993 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
4994 #
4995 # The is the core of a fallback implementation of a
4996 # platform-specific function to extract the name of the
4997 # DLL associated with the specified import library LIBNAME.
4998 #
4999 # SECTION_NAME is either .idata$6 or .idata$7, depending
5000 # on the platform and compiler that created the implib.
5001 #
5002 # Echos the name of the DLL associated with the
5003 # specified import library.
5004 func_cygming_dll_for_implib_fallback_core ()
5005 {
5006 $debug_cmd
5007
5008 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
5009 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
5010 $SED '/^Contents of section '"$match_literal"':/{
5011 # Place marker at beginning of archive member dllname section
5012 s/.*/====MARK====/
5013 p
5014 d
5015 }
5016 # These lines can sometimes be longer than 43 characters, but
5017 # are always uninteresting
5018 /:[ ]*file format pe[i]\{,1\}-/d
5019 /^In archive [^:]*:/d
5020 # Ensure marker is printed
5021 /^====MARK====/p
5022 # Remove all lines with less than 43 characters
5023 /^.\{43\}/!d
5024 # From remaining lines, remove first 43 characters
5025 s/^.\{43\}//' |
5026 $SED -n '
5027 # Join marker and all lines until next marker into a single line
5028 /^====MARK====/ b para
5029 H
5030 $ b para
5031 b
5032 :para
5033 x
5034 s/\n//g
5035 # Remove the marker
5036 s/^====MARK====//
5037 # Remove trailing dots and whitespace
5038 s/[\. \t]*$//
5039 # Print
5040 /./p' |
5041 # we now have a list, one entry per line, of the stringified
5042 # contents of the appropriate section of all members of the
5043 # archive that possess that section. Heuristic: eliminate
5044 # all those that have a first or second character that is
5045 # a '.' (that is, objdump's representation of an unprintable
5046 # character.) This should work for all archives with less than
5047 # 0x302f exports -- but will fail for DLLs whose name actually
5048 # begins with a literal '.' or a single character followed by
5049 # a '.'.
5050 #
5051 # Of those that remain, print the first one.
5052 $SED -e '/^\./d;/^.\./d;q'
5053 }
5054
5055 # func_cygming_dll_for_implib_fallback ARG
5056 # Platform-specific function to extract the
5057 # name of the DLL associated with the specified
5058 # import library ARG.
5059 #
5060 # This fallback implementation is for use when $DLLTOOL
5061 # does not support the --identify-strict option.
5062 # Invoked by eval'ing the libtool variable
5063 # $sharedlib_from_linklib_cmd
5064 # Result is available in the variable
5065 # $sharedlib_from_linklib_result
5066 func_cygming_dll_for_implib_fallback ()
5067 {
5068 $debug_cmd
5069
5070 if func_cygming_gnu_implib_p "$1"; then
5071 # binutils import library
5072 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5073 elif func_cygming_ms_implib_p "$1"; then
5074 # ms-generated import library
5075 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
5076 else
5077 # unknown
5078 sharedlib_from_linklib_result=
5079 fi
5080 }
5081
5082
5083 # func_extract_an_archive dir oldlib
5084 func_extract_an_archive ()
5085 {
5086 $debug_cmd
5087
5088 f_ex_an_ar_dir=$1; shift
5089 f_ex_an_ar_oldlib=$1
5090 if test yes = "$lock_old_archive_extraction"; then
5091 lockfile=$f_ex_an_ar_oldlib.lock
5092 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
5093 func_echo "Waiting for $lockfile to be removed"
5094 sleep 2
5095 done
5096 fi
5097 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
5098 'stat=$?; rm -f "$lockfile"; exit $stat'
5099 if test yes = "$lock_old_archive_extraction"; then
5100 $opt_dry_run || rm -f "$lockfile"
5101 fi
5102 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
5103 :
5104 else
5105 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
5106 fi
5107 }
5108
5109
5110 # func_extract_archives gentop oldlib ...
5111 func_extract_archives ()
5112 {
5113 $debug_cmd
5114
5115 my_gentop=$1; shift
5116 my_oldlibs=${1+"$@"}
5117 my_oldobjs=
5118 my_xlib=
5119 my_xabs=
5120 my_xdir=
5121
5122 for my_xlib in $my_oldlibs; do
5123 # Extract the objects.
5124 case $my_xlib in
5125 [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
5126 *) my_xabs=`pwd`"/$my_xlib" ;;
5127 esac
5128 func_basename "$my_xlib"
5129 my_xlib=$func_basename_result
5130 my_xlib_u=$my_xlib
5131 while :; do
5132 case " $extracted_archives " in
5133 *" $my_xlib_u "*)
5134 func_arith $extracted_serial + 1
5135 extracted_serial=$func_arith_result
5136 my_xlib_u=lt$extracted_serial-$my_xlib ;;
5137 *) break ;;
5138 esac
5139 done
5140 extracted_archives="$extracted_archives $my_xlib_u"
5141 my_xdir=$my_gentop/$my_xlib_u
5142
5143 func_mkdir_p "$my_xdir"
5144
5145 case $host in
5146 *-darwin*)
5147 func_verbose "Extracting $my_xabs"
5148 # Do not bother doing anything if just a dry run
5149 $opt_dry_run || {
5150 darwin_orig_dir=`pwd`
5151 cd $my_xdir || exit $?
5152 darwin_archive=$my_xabs
5153 darwin_curdir=`pwd`
5154 func_basename "$darwin_archive"
5155 darwin_base_archive=$func_basename_result
5156 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
5157 if test -n "$darwin_arches"; then
5158 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
5159 darwin_arch=
5160 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5161 for darwin_arch in $darwin_arches; do
5162 func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5163 $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5164 cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5165 func_extract_an_archive "`pwd`" "$darwin_base_archive"
5166 cd "$darwin_curdir"
5167 $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
5168 done # $darwin_arches
5169 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5170 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
5171 darwin_file=
5172 darwin_files=
5173 for darwin_file in $darwin_filelist; do
5174 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
5175 $LIPO -create -output "$darwin_file" $darwin_files
5176 done # $darwin_filelist
5177 $RM -rf unfat-$$
5178 cd "$darwin_orig_dir"
5179 else
5180 cd $darwin_orig_dir
5181 func_extract_an_archive "$my_xdir" "$my_xabs"
5182 fi # $darwin_arches
5183 } # !$opt_dry_run
5184 ;;
5185 *)
5186 func_extract_an_archive "$my_xdir" "$my_xabs"
5187 ;;
5188 esac
5189 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
5190 done
5191
5192 func_extract_archives_result=$my_oldobjs
5193 }
5194
5195
5196 # func_emit_wrapper [arg=no]
5197 #
5198 # Emit a libtool wrapper script on stdout.
5199 # Don't directly open a file because we may want to
5200 # incorporate the script contents within a cygwin/mingw
5201 # wrapper executable. Must ONLY be called from within
5202 # func_mode_link because it depends on a number of variables
5203 # set therein.
5204 #
5205 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
5206 # variable will take. If 'yes', then the emitted script
5207 # will assume that the directory where it is stored is
5208 # the $objdir directory. This is a cygwin/mingw-specific
5209 # behavior.
5210 func_emit_wrapper ()
5211 {
5212 func_emit_wrapper_arg1=${1-no}
5213
5214 $ECHO "\
5215 #! $SHELL
5216
5217 # $output - temporary wrapper script for $objdir/$outputname
5218 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5219 #
5220 # The $output program cannot be directly executed until all the libtool
5221 # libraries that it depends on are installed.
5222 #
5223 # This wrapper script should never be moved out of the build directory.
5224 # If it is, it will not operate correctly.
5225
5226 # Sed substitution that helps us do robust quoting. It backslashifies
5227 # metacharacters that are still active within double-quoted strings.
5228 sed_quote_subst='$sed_quote_subst'
5229
5230 # Be Bourne compatible
5231 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5232 emulate sh
5233 NULLCMD=:
5234 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5235 # is contrary to our usage. Disable this feature.
5236 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5237 setopt NO_GLOB_SUBST
5238 else
5239 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5240 fi
5241 BIN_SH=xpg4; export BIN_SH # for Tru64
5242 DUALCASE=1; export DUALCASE # for MKS sh
5243
5244 # The HP-UX ksh and POSIX shell print the target directory to stdout
5245 # if CDPATH is set.
5246 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5247
5248 relink_command=\"$relink_command\"
5249
5250 # This environment variable determines our operation mode.
5251 if test \"\$libtool_install_magic\" = \"$magic\"; then
5252 # install mode needs the following variables:
5253 generated_by_libtool_version='$macro_version'
5254 notinst_deplibs='$notinst_deplibs'
5255 else
5256 # When we are sourced in execute mode, \$file and \$ECHO are already set.
5257 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5258 file=\"\$0\""
5259
5260 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
5261 $ECHO "\
5262
5263 # A function that is used when there is no print builtin or printf.
5264 func_fallback_echo ()
5265 {
5266 eval 'cat <<_LTECHO_EOF
5267 \$1
5268 _LTECHO_EOF'
5269 }
5270 ECHO=\"$qECHO\"
5271 fi
5272
5273 # Very basic option parsing. These options are (a) specific to
5274 # the libtool wrapper, (b) are identical between the wrapper
5275 # /script/ and the wrapper /executable/ that is used only on
5276 # windows platforms, and (c) all begin with the string "--lt-"
5277 # (application programs are unlikely to have options that match
5278 # this pattern).
5279 #
5280 # There are only two supported options: --lt-debug and
5281 # --lt-dump-script. There is, deliberately, no --lt-help.
5282 #
5283 # The first argument to this parsing function should be the
5284 # script's $0 value, followed by "$@".
5285 lt_option_debug=
5286 func_parse_lt_options ()
5287 {
5288 lt_script_arg0=\$0
5289 shift
5290 for lt_opt
5291 do
5292 case \"\$lt_opt\" in
5293 --lt-debug) lt_option_debug=1 ;;
5294 --lt-dump-script)
5295 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
5296 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
5297 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
5298 cat \"\$lt_dump_D/\$lt_dump_F\"
5299 exit 0
5300 ;;
5301 --lt-*)
5302 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
5303 exit 1
5304 ;;
5305 esac
5306 done
5307
5308 # Print the debug banner immediately:
5309 if test -n \"\$lt_option_debug\"; then
5310 echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
5311 fi
5312 }
5313
5314 # Used when --lt-debug. Prints its arguments to stdout
5315 # (redirection is the responsibility of the caller)
5316 func_lt_dump_args ()
5317 {
5318 lt_dump_args_N=1;
5319 for lt_arg
5320 do
5321 \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
5322 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
5323 done
5324 }
5325
5326 # Core function for launching the target application
5327 func_exec_program_core ()
5328 {
5329 "
5330 case $host in
5331 # Backslashes separate directories on plain windows
5332 *-*-mingw | *-*-os2* | *-cegcc*)
5333 $ECHO "\
5334 if test -n \"\$lt_option_debug\"; then
5335 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
5336 func_lt_dump_args \${1+\"\$@\"} 1>&2
5337 fi
5338 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5339 "
5340 ;;
5341
5342 *)
5343 $ECHO "\
5344 if test -n \"\$lt_option_debug\"; then
5345 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
5346 func_lt_dump_args \${1+\"\$@\"} 1>&2
5347 fi
5348 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5349 "
5350 ;;
5351 esac
5352 $ECHO "\
5353 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
5354 exit 1
5355 }
5356
5357 # A function to encapsulate launching the target application
5358 # Strips options in the --lt-* namespace from \$@ and
5359 # launches target application with the remaining arguments.
5360 func_exec_program ()
5361 {
5362 case \" \$* \" in
5363 *\\ --lt-*)
5364 for lt_wr_arg
5365 do
5366 case \$lt_wr_arg in
5367 --lt-*) ;;
5368 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
5369 esac
5370 shift
5371 done ;;
5372 esac
5373 func_exec_program_core \${1+\"\$@\"}
5374 }
5375
5376 # Parse options
5377 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
5378
5379 # Find the directory that this script lives in.
5380 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
5381 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5382
5383 # Follow symbolic links until we get to the real thisdir.
5384 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
5385 while test -n \"\$file\"; do
5386 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
5387
5388 # If there was a directory component, then change thisdir.
5389 if test \"x\$destdir\" != \"x\$file\"; then
5390 case \"\$destdir\" in
5391 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5392 *) thisdir=\"\$thisdir/\$destdir\" ;;
5393 esac
5394 fi
5395
5396 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
5397 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
5398 done
5399
5400 # Usually 'no', except on cygwin/mingw when embedded into
5401 # the cwrapper.
5402 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
5403 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
5404 # special case for '.'
5405 if test \"\$thisdir\" = \".\"; then
5406 thisdir=\`pwd\`
5407 fi
5408 # remove .libs from thisdir
5409 case \"\$thisdir\" in
5410 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
5411 $objdir ) thisdir=. ;;
5412 esac
5413 fi
5414
5415 # Try to get the absolute directory name.
5416 absdir=\`cd \"\$thisdir\" && pwd\`
5417 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5418 "
5419
5420 if test yes = "$fast_install"; then
5421 $ECHO "\
5422 program=lt-'$outputname'$exeext
5423 progdir=\"\$thisdir/$objdir\"
5424
5425 if test ! -f \"\$progdir/\$program\" ||
5426 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
5427 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5428
5429 file=\"\$\$-\$program\"
5430
5431 if test ! -d \"\$progdir\"; then
5432 $MKDIR \"\$progdir\"
5433 else
5434 $RM \"\$progdir/\$file\"
5435 fi"
5436
5437 $ECHO "\
5438
5439 # relink executable if necessary
5440 if test -n \"\$relink_command\"; then
5441 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5442 else
5443 \$ECHO \"\$relink_command_output\" >&2
5444 $RM \"\$progdir/\$file\"
5445 exit 1
5446 fi
5447 fi
5448
5449 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5450 { $RM \"\$progdir/\$program\";
5451 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5452 $RM \"\$progdir/\$file\"
5453 fi"
5454 else
5455 $ECHO "\
5456 program='$outputname'
5457 progdir=\"\$thisdir/$objdir\"
5458 "
5459 fi
5460
5461 $ECHO "\
5462
5463 if test -f \"\$progdir/\$program\"; then"
5464
5465 # fixup the dll searchpath if we need to.
5466 #
5467 # Fix the DLL searchpath if we need to. Do this before prepending
5468 # to shlibpath, because on Windows, both are PATH and uninstalled
5469 # libraries must come first.
5470 if test -n "$dllsearchpath"; then
5471 $ECHO "\
5472 # Add the dll search path components to the executable PATH
5473 PATH=$dllsearchpath:\$PATH
5474 "
5475 fi
5476
5477 # Export our shlibpath_var if we have one.
5478 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5479 $ECHO "\
5480 # Add our own library path to $shlibpath_var
5481 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5482
5483 # Some systems cannot cope with colon-terminated $shlibpath_var
5484 # The second colon is a workaround for a bug in BeOS R4 sed
5485 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
5486
5487 export $shlibpath_var
5488 "
5489 fi
5490
5491 $ECHO "\
5492 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5493 # Run the actual program with our arguments.
5494 func_exec_program \${1+\"\$@\"}
5495 fi
5496 else
5497 # The program doesn't exist.
5498 \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
5499 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
5500 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
5501 exit 1
5502 fi
5503 fi\
5504 "
5505 }
5506
5507
5508 # func_emit_cwrapperexe_src
5509 # emit the source code for a wrapper executable on stdout
5510 # Must ONLY be called from within func_mode_link because
5511 # it depends on a number of variable set therein.
5512 func_emit_cwrapperexe_src ()
5513 {
5514 cat <<EOF
5515
5516 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5517 Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5518
5519 The $output program cannot be directly executed until all the libtool
5520 libraries that it depends on are installed.
5521
5522 This wrapper executable should never be moved out of the build directory.
5523 If it is, it will not operate correctly.
5524 */
5525 EOF
5526 cat <<"EOF"
5527 #ifdef _MSC_VER
5528 # define _CRT_SECURE_NO_DEPRECATE 1
5529 #endif
5530 #include <stdio.h>
5531 #include <stdlib.h>
5532 #ifdef _MSC_VER
5533 # include <direct.h>
5534 # include <process.h>
5535 # include <io.h>
5536 #else
5537 # include <unistd.h>
5538 # include <stdint.h>
5539 # ifdef __CYGWIN__
5540 # include <io.h>
5541 # endif
5542 #endif
5543 #include <malloc.h>
5544 #include <stdarg.h>
5545 #include <assert.h>
5546 #include <string.h>
5547 #include <ctype.h>
5548 #include <errno.h>
5549 #include <fcntl.h>
5550 #include <sys/stat.h>
5551
5552 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5553
5554 /* declarations of non-ANSI functions */
5555 #if defined __MINGW32__
5556 # ifdef __STRICT_ANSI__
5557 int _putenv (const char *);
5558 # endif
5559 #elif defined __CYGWIN__
5560 # ifdef __STRICT_ANSI__
5561 char *realpath (const char *, char *);
5562 int putenv (char *);
5563 int setenv (const char *, const char *, int);
5564 # endif
5565 /* #elif defined other_platform || defined ... */
5566 #endif
5567
5568 /* portability defines, excluding path handling macros */
5569 #if defined _MSC_VER
5570 # define setmode _setmode
5571 # define stat _stat
5572 # define chmod _chmod
5573 # define getcwd _getcwd
5574 # define putenv _putenv
5575 # define S_IXUSR _S_IEXEC
5576 #elif defined __MINGW32__
5577 # define setmode _setmode
5578 # define stat _stat
5579 # define chmod _chmod
5580 # define getcwd _getcwd
5581 # define putenv _putenv
5582 #elif defined __CYGWIN__
5583 # define HAVE_SETENV
5584 # define FOPEN_WB "wb"
5585 /* #elif defined other platforms ... */
5586 #endif
5587
5588 #if defined PATH_MAX
5589 # define LT_PATHMAX PATH_MAX
5590 #elif defined MAXPATHLEN
5591 # define LT_PATHMAX MAXPATHLEN
5592 #else
5593 # define LT_PATHMAX 1024
5594 #endif
5595
5596 #ifndef S_IXOTH
5597 # define S_IXOTH 0
5598 #endif
5599 #ifndef S_IXGRP
5600 # define S_IXGRP 0
5601 #endif
5602
5603 /* path handling portability macros */
5604 #ifndef DIR_SEPARATOR
5605 # define DIR_SEPARATOR '/'
5606 # define PATH_SEPARATOR ':'
5607 #endif
5608
5609 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
5610 defined __OS2__
5611 # define HAVE_DOS_BASED_FILE_SYSTEM
5612 # define FOPEN_WB "wb"
5613 # ifndef DIR_SEPARATOR_2
5614 # define DIR_SEPARATOR_2 '\\'
5615 # endif
5616 # ifndef PATH_SEPARATOR_2
5617 # define PATH_SEPARATOR_2 ';'
5618 # endif
5619 #endif
5620
5621 #ifndef DIR_SEPARATOR_2
5622 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5623 #else /* DIR_SEPARATOR_2 */
5624 # define IS_DIR_SEPARATOR(ch) \
5625 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5626 #endif /* DIR_SEPARATOR_2 */
5627
5628 #ifndef PATH_SEPARATOR_2
5629 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5630 #else /* PATH_SEPARATOR_2 */
5631 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5632 #endif /* PATH_SEPARATOR_2 */
5633
5634 #ifndef FOPEN_WB
5635 # define FOPEN_WB "w"
5636 #endif
5637 #ifndef _O_BINARY
5638 # define _O_BINARY 0
5639 #endif
5640
5641 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5642 #define XFREE(stale) do { \
5643 if (stale) { free (stale); stale = 0; } \
5644 } while (0)
5645
5646 #if defined LT_DEBUGWRAPPER
5647 static int lt_debug = 1;
5648 #else
5649 static int lt_debug = 0;
5650 #endif
5651
5652 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
5653
5654 void *xmalloc (size_t num);
5655 char *xstrdup (const char *string);
5656 const char *base_name (const char *name);
5657 char *find_executable (const char *wrapper);
5658 char *chase_symlinks (const char *pathspec);
5659 int make_executable (const char *path);
5660 int check_executable (const char *path);
5661 char *strendzap (char *str, const char *pat);
5662 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
5663 void lt_fatal (const char *file, int line, const char *message, ...);
5664 static const char *nonnull (const char *s);
5665 static const char *nonempty (const char *s);
5666 void lt_setenv (const char *name, const char *value);
5667 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
5668 void lt_update_exe_path (const char *name, const char *value);
5669 void lt_update_lib_path (const char *name, const char *value);
5670 char **prepare_spawn (char **argv);
5671 void lt_dump_script (FILE *f);
5672 EOF
5673
5674 cat <<EOF
5675 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5676 # define externally_visible volatile
5677 #else
5678 # define externally_visible __attribute__((externally_visible)) volatile
5679 #endif
5680 externally_visible const char * MAGIC_EXE = "$magic_exe";
5681 const char * LIB_PATH_VARNAME = "$shlibpath_var";
5682 EOF
5683
5684 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5685 func_to_host_path "$temp_rpath"
5686 cat <<EOF
5687 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
5688 EOF
5689 else
5690 cat <<"EOF"
5691 const char * LIB_PATH_VALUE = "";
5692 EOF
5693 fi
5694
5695 if test -n "$dllsearchpath"; then
5696 func_to_host_path "$dllsearchpath:"
5697 cat <<EOF
5698 const char * EXE_PATH_VARNAME = "PATH";
5699 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
5700 EOF
5701 else
5702 cat <<"EOF"
5703 const char * EXE_PATH_VARNAME = "";
5704 const char * EXE_PATH_VALUE = "";
5705 EOF
5706 fi
5707
5708 if test yes = "$fast_install"; then
5709 cat <<EOF
5710 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
5711 EOF
5712 else
5713 cat <<EOF
5714 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
5715 EOF
5716 fi
5717
5718
5719 cat <<"EOF"
5720
5721 #define LTWRAPPER_OPTION_PREFIX "--lt-"
5722
5723 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
5724 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
5725 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
5726
5727 int
5728 main (int argc, char *argv[])
5729 {
5730 char **newargz;
5731 int newargc;
5732 char *tmp_pathspec;
5733 char *actual_cwrapper_path;
5734 char *actual_cwrapper_name;
5735 char *target_name;
5736 char *lt_argv_zero;
5737 int rval = 127;
5738
5739 int i;
5740
5741 program_name = (char *) xstrdup (base_name (argv[0]));
5742 newargz = XMALLOC (char *, (size_t) argc + 1);
5743
5744 /* very simple arg parsing; don't want to rely on getopt
5745 * also, copy all non cwrapper options to newargz, except
5746 * argz[0], which is handled differently
5747 */
5748 newargc=0;
5749 for (i = 1; i < argc; i++)
5750 {
5751 if (STREQ (argv[i], dumpscript_opt))
5752 {
5753 EOF
5754 case $host in
5755 *mingw* | *cygwin* )
5756 # make stdout use "unix" line endings
5757 echo " setmode(1,_O_BINARY);"
5758 ;;
5759 esac
5760
5761 cat <<"EOF"
5762 lt_dump_script (stdout);
5763 return 0;
5764 }
5765 if (STREQ (argv[i], debug_opt))
5766 {
5767 lt_debug = 1;
5768 continue;
5769 }
5770 if (STREQ (argv[i], ltwrapper_option_prefix))
5771 {
5772 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
5773 namespace, but it is not one of the ones we know about and
5774 have already dealt with, above (inluding dump-script), then
5775 report an error. Otherwise, targets might begin to believe
5776 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
5777 namespace. The first time any user complains about this, we'll
5778 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
5779 or a configure.ac-settable value.
5780 */
5781 lt_fatal (__FILE__, __LINE__,
5782 "unrecognized %s option: '%s'",
5783 ltwrapper_option_prefix, argv[i]);
5784 }
5785 /* otherwise ... */
5786 newargz[++newargc] = xstrdup (argv[i]);
5787 }
5788 newargz[++newargc] = NULL;
5789
5790 EOF
5791 cat <<EOF
5792 /* The GNU banner must be the first non-error debug message */
5793 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
5794 EOF
5795 cat <<"EOF"
5796 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
5797 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
5798
5799 tmp_pathspec = find_executable (argv[0]);
5800 if (tmp_pathspec == NULL)
5801 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
5802 lt_debugprintf (__FILE__, __LINE__,
5803 "(main) found exe (before symlink chase) at: %s\n",
5804 tmp_pathspec);
5805
5806 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
5807 lt_debugprintf (__FILE__, __LINE__,
5808 "(main) found exe (after symlink chase) at: %s\n",
5809 actual_cwrapper_path);
5810 XFREE (tmp_pathspec);
5811
5812 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
5813 strendzap (actual_cwrapper_path, actual_cwrapper_name);
5814
5815 /* wrapper name transforms */
5816 strendzap (actual_cwrapper_name, ".exe");
5817 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
5818 XFREE (actual_cwrapper_name);
5819 actual_cwrapper_name = tmp_pathspec;
5820 tmp_pathspec = 0;
5821
5822 /* target_name transforms -- use actual target program name; might have lt- prefix */
5823 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
5824 strendzap (target_name, ".exe");
5825 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
5826 XFREE (target_name);
5827 target_name = tmp_pathspec;
5828 tmp_pathspec = 0;
5829
5830 lt_debugprintf (__FILE__, __LINE__,
5831 "(main) libtool target name: %s\n",
5832 target_name);
5833 EOF
5834
5835 cat <<EOF
5836 newargz[0] =
5837 XMALLOC (char, (strlen (actual_cwrapper_path) +
5838 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
5839 strcpy (newargz[0], actual_cwrapper_path);
5840 strcat (newargz[0], "$objdir");
5841 strcat (newargz[0], "/");
5842 EOF
5843
5844 cat <<"EOF"
5845 /* stop here, and copy so we don't have to do this twice */
5846 tmp_pathspec = xstrdup (newargz[0]);
5847
5848 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
5849 strcat (newargz[0], actual_cwrapper_name);
5850
5851 /* DO want the lt- prefix here if it exists, so use target_name */
5852 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
5853 XFREE (tmp_pathspec);
5854 tmp_pathspec = NULL;
5855 EOF
5856
5857 case $host_os in
5858 mingw*)
5859 cat <<"EOF"
5860 {
5861 char* p;
5862 while ((p = strchr (newargz[0], '\\')) != NULL)
5863 {
5864 *p = '/';
5865 }
5866 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
5867 {
5868 *p = '/';
5869 }
5870 }
5871 EOF
5872 ;;
5873 esac
5874
5875 cat <<"EOF"
5876 XFREE (target_name);
5877 XFREE (actual_cwrapper_path);
5878 XFREE (actual_cwrapper_name);
5879
5880 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
5881 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
5882 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
5883 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
5884 because on Windows, both *_VARNAMEs are PATH but uninstalled
5885 libraries must come first. */
5886 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
5887 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
5888
5889 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
5890 nonnull (lt_argv_zero));
5891 for (i = 0; i < newargc; i++)
5892 {
5893 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
5894 i, nonnull (newargz[i]));
5895 }
5896
5897 EOF
5898
5899 case $host_os in
5900 mingw*)
5901 cat <<"EOF"
5902 /* execv doesn't actually work on mingw as expected on unix */
5903 newargz = prepare_spawn (newargz);
5904 rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
5905 if (rval == -1)
5906 {
5907 /* failed to start process */
5908 lt_debugprintf (__FILE__, __LINE__,
5909 "(main) failed to launch target \"%s\": %s\n",
5910 lt_argv_zero, nonnull (strerror (errno)));
5911 return 127;
5912 }
5913 return rval;
5914 EOF
5915 ;;
5916 *)
5917 cat <<"EOF"
5918 execv (lt_argv_zero, newargz);
5919 return rval; /* =127, but avoids unused variable warning */
5920 EOF
5921 ;;
5922 esac
5923
5924 cat <<"EOF"
5925 }
5926
5927 void *
5928 xmalloc (size_t num)
5929 {
5930 void *p = (void *) malloc (num);
5931 if (!p)
5932 lt_fatal (__FILE__, __LINE__, "memory exhausted");
5933
5934 return p;
5935 }
5936
5937 char *
5938 xstrdup (const char *string)
5939 {
5940 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
5941 string) : NULL;
5942 }
5943
5944 const char *
5945 base_name (const char *name)
5946 {
5947 const char *base;
5948
5949 #if defined HAVE_DOS_BASED_FILE_SYSTEM
5950 /* Skip over the disk name in MSDOS pathnames. */
5951 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5952 name += 2;
5953 #endif
5954
5955 for (base = name; *name; name++)
5956 if (IS_DIR_SEPARATOR (*name))
5957 base = name + 1;
5958 return base;
5959 }
5960
5961 int
5962 check_executable (const char *path)
5963 {
5964 struct stat st;
5965
5966 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
5967 nonempty (path));
5968 if ((!path) || (!*path))
5969 return 0;
5970
5971 if ((stat (path, &st) >= 0)
5972 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
5973 return 1;
5974 else
5975 return 0;
5976 }
5977
5978 int
5979 make_executable (const char *path)
5980 {
5981 int rval = 0;
5982 struct stat st;
5983
5984 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
5985 nonempty (path));
5986 if ((!path) || (!*path))
5987 return 0;
5988
5989 if (stat (path, &st) >= 0)
5990 {
5991 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
5992 }
5993 return rval;
5994 }
5995
5996 /* Searches for the full path of the wrapper. Returns
5997 newly allocated full path name if found, NULL otherwise
5998 Does not chase symlinks, even on platforms that support them.
5999 */
6000 char *
6001 find_executable (const char *wrapper)
6002 {
6003 int has_slash = 0;
6004 const char *p;
6005 const char *p_next;
6006 /* static buffer for getcwd */
6007 char tmp[LT_PATHMAX + 1];
6008 size_t tmp_len;
6009 char *concat_name;
6010
6011 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
6012 nonempty (wrapper));
6013
6014 if ((wrapper == NULL) || (*wrapper == '\0'))
6015 return NULL;
6016
6017 /* Absolute path? */
6018 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6019 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
6020 {
6021 concat_name = xstrdup (wrapper);
6022 if (check_executable (concat_name))
6023 return concat_name;
6024 XFREE (concat_name);
6025 }
6026 else
6027 {
6028 #endif
6029 if (IS_DIR_SEPARATOR (wrapper[0]))
6030 {
6031 concat_name = xstrdup (wrapper);
6032 if (check_executable (concat_name))
6033 return concat_name;
6034 XFREE (concat_name);
6035 }
6036 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6037 }
6038 #endif
6039
6040 for (p = wrapper; *p; p++)
6041 if (*p == '/')
6042 {
6043 has_slash = 1;
6044 break;
6045 }
6046 if (!has_slash)
6047 {
6048 /* no slashes; search PATH */
6049 const char *path = getenv ("PATH");
6050 if (path != NULL)
6051 {
6052 for (p = path; *p; p = p_next)
6053 {
6054 const char *q;
6055 size_t p_len;
6056 for (q = p; *q; q++)
6057 if (IS_PATH_SEPARATOR (*q))
6058 break;
6059 p_len = (size_t) (q - p);
6060 p_next = (*q == '\0' ? q : q + 1);
6061 if (p_len == 0)
6062 {
6063 /* empty path: current directory */
6064 if (getcwd (tmp, LT_PATHMAX) == NULL)
6065 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6066 nonnull (strerror (errno)));
6067 tmp_len = strlen (tmp);
6068 concat_name =
6069 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6070 memcpy (concat_name, tmp, tmp_len);
6071 concat_name[tmp_len] = '/';
6072 strcpy (concat_name + tmp_len + 1, wrapper);
6073 }
6074 else
6075 {
6076 concat_name =
6077 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
6078 memcpy (concat_name, p, p_len);
6079 concat_name[p_len] = '/';
6080 strcpy (concat_name + p_len + 1, wrapper);
6081 }
6082 if (check_executable (concat_name))
6083 return concat_name;
6084 XFREE (concat_name);
6085 }
6086 }
6087 /* not found in PATH; assume curdir */
6088 }
6089 /* Relative path | not found in path: prepend cwd */
6090 if (getcwd (tmp, LT_PATHMAX) == NULL)
6091 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6092 nonnull (strerror (errno)));
6093 tmp_len = strlen (tmp);
6094 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6095 memcpy (concat_name, tmp, tmp_len);
6096 concat_name[tmp_len] = '/';
6097 strcpy (concat_name + tmp_len + 1, wrapper);
6098
6099 if (check_executable (concat_name))
6100 return concat_name;
6101 XFREE (concat_name);
6102 return NULL;
6103 }
6104
6105 char *
6106 chase_symlinks (const char *pathspec)
6107 {
6108 #ifndef S_ISLNK
6109 return xstrdup (pathspec);
6110 #else
6111 char buf[LT_PATHMAX];
6112 struct stat s;
6113 char *tmp_pathspec = xstrdup (pathspec);
6114 char *p;
6115 int has_symlinks = 0;
6116 while (strlen (tmp_pathspec) && !has_symlinks)
6117 {
6118 lt_debugprintf (__FILE__, __LINE__,
6119 "checking path component for symlinks: %s\n",
6120 tmp_pathspec);
6121 if (lstat (tmp_pathspec, &s) == 0)
6122 {
6123 if (S_ISLNK (s.st_mode) != 0)
6124 {
6125 has_symlinks = 1;
6126 break;
6127 }
6128
6129 /* search backwards for last DIR_SEPARATOR */
6130 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
6131 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6132 p--;
6133 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6134 {
6135 /* no more DIR_SEPARATORS left */
6136 break;
6137 }
6138 *p = '\0';
6139 }
6140 else
6141 {
6142 lt_fatal (__FILE__, __LINE__,
6143 "error accessing file \"%s\": %s",
6144 tmp_pathspec, nonnull (strerror (errno)));
6145 }
6146 }
6147 XFREE (tmp_pathspec);
6148
6149 if (!has_symlinks)
6150 {
6151 return xstrdup (pathspec);
6152 }
6153
6154 tmp_pathspec = realpath (pathspec, buf);
6155 if (tmp_pathspec == 0)
6156 {
6157 lt_fatal (__FILE__, __LINE__,
6158 "could not follow symlinks for %s", pathspec);
6159 }
6160 return xstrdup (tmp_pathspec);
6161 #endif
6162 }
6163
6164 char *
6165 strendzap (char *str, const char *pat)
6166 {
6167 size_t len, patlen;
6168
6169 assert (str != NULL);
6170 assert (pat != NULL);
6171
6172 len = strlen (str);
6173 patlen = strlen (pat);
6174
6175 if (patlen <= len)
6176 {
6177 str += len - patlen;
6178 if (STREQ (str, pat))
6179 *str = '\0';
6180 }
6181 return str;
6182 }
6183
6184 void
6185 lt_debugprintf (const char *file, int line, const char *fmt, ...)
6186 {
6187 va_list args;
6188 if (lt_debug)
6189 {
6190 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
6191 va_start (args, fmt);
6192 (void) vfprintf (stderr, fmt, args);
6193 va_end (args);
6194 }
6195 }
6196
6197 static void
6198 lt_error_core (int exit_status, const char *file,
6199 int line, const char *mode,
6200 const char *message, va_list ap)
6201 {
6202 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
6203 vfprintf (stderr, message, ap);
6204 fprintf (stderr, ".\n");
6205
6206 if (exit_status >= 0)
6207 exit (exit_status);
6208 }
6209
6210 void
6211 lt_fatal (const char *file, int line, const char *message, ...)
6212 {
6213 va_list ap;
6214 va_start (ap, message);
6215 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
6216 va_end (ap);
6217 }
6218
6219 static const char *
6220 nonnull (const char *s)
6221 {
6222 return s ? s : "(null)";
6223 }
6224
6225 static const char *
6226 nonempty (const char *s)
6227 {
6228 return (s && !*s) ? "(empty)" : nonnull (s);
6229 }
6230
6231 void
6232 lt_setenv (const char *name, const char *value)
6233 {
6234 lt_debugprintf (__FILE__, __LINE__,
6235 "(lt_setenv) setting '%s' to '%s'\n",
6236 nonnull (name), nonnull (value));
6237 {
6238 #ifdef HAVE_SETENV
6239 /* always make a copy, for consistency with !HAVE_SETENV */
6240 char *str = xstrdup (value);
6241 setenv (name, str, 1);
6242 #else
6243 size_t len = strlen (name) + 1 + strlen (value) + 1;
6244 char *str = XMALLOC (char, len);
6245 sprintf (str, "%s=%s", name, value);
6246 if (putenv (str) != EXIT_SUCCESS)
6247 {
6248 XFREE (str);
6249 }
6250 #endif
6251 }
6252 }
6253
6254 char *
6255 lt_extend_str (const char *orig_value, const char *add, int to_end)
6256 {
6257 char *new_value;
6258 if (orig_value && *orig_value)
6259 {
6260 size_t orig_value_len = strlen (orig_value);
6261 size_t add_len = strlen (add);
6262 new_value = XMALLOC (char, add_len + orig_value_len + 1);
6263 if (to_end)
6264 {
6265 strcpy (new_value, orig_value);
6266 strcpy (new_value + orig_value_len, add);
6267 }
6268 else
6269 {
6270 strcpy (new_value, add);
6271 strcpy (new_value + add_len, orig_value);
6272 }
6273 }
6274 else
6275 {
6276 new_value = xstrdup (add);
6277 }
6278 return new_value;
6279 }
6280
6281 void
6282 lt_update_exe_path (const char *name, const char *value)
6283 {
6284 lt_debugprintf (__FILE__, __LINE__,
6285 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
6286 nonnull (name), nonnull (value));
6287
6288 if (name && *name && value && *value)
6289 {
6290 char *new_value = lt_extend_str (getenv (name), value, 0);
6291 /* some systems can't cope with a ':'-terminated path #' */
6292 size_t len = strlen (new_value);
6293 while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6294 {
6295 new_value[--len] = '\0';
6296 }
6297 lt_setenv (name, new_value);
6298 XFREE (new_value);
6299 }
6300 }
6301
6302 void
6303 lt_update_lib_path (const char *name, const char *value)
6304 {
6305 lt_debugprintf (__FILE__, __LINE__,
6306 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
6307 nonnull (name), nonnull (value));
6308
6309 if (name && *name && value && *value)
6310 {
6311 char *new_value = lt_extend_str (getenv (name), value, 0);
6312 lt_setenv (name, new_value);
6313 XFREE (new_value);
6314 }
6315 }
6316
6317 EOF
6318 case $host_os in
6319 mingw*)
6320 cat <<"EOF"
6321
6322 /* Prepares an argument vector before calling spawn().
6323 Note that spawn() does not by itself call the command interpreter
6324 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
6325 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
6326 GetVersionEx(&v);
6327 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
6328 }) ? "cmd.exe" : "command.com").
6329 Instead it simply concatenates the arguments, separated by ' ', and calls
6330 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
6331 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
6332 special way:
6333 - Space and tab are interpreted as delimiters. They are not treated as
6334 delimiters if they are surrounded by double quotes: "...".
6335 - Unescaped double quotes are removed from the input. Their only effect is
6336 that within double quotes, space and tab are treated like normal
6337 characters.
6338 - Backslashes not followed by double quotes are not special.
6339 - But 2*n+1 backslashes followed by a double quote become
6340 n backslashes followed by a double quote (n >= 0):
6341 \" -> "
6342 \\\" -> \"
6343 \\\\\" -> \\"
6344 */
6345 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
6346 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
6347 char **
6348 prepare_spawn (char **argv)
6349 {
6350 size_t argc;
6351 char **new_argv;
6352 size_t i;
6353
6354 /* Count number of arguments. */
6355 for (argc = 0; argv[argc] != NULL; argc++)
6356 ;
6357
6358 /* Allocate new argument vector. */
6359 new_argv = XMALLOC (char *, argc + 1);
6360
6361 /* Put quoted arguments into the new argument vector. */
6362 for (i = 0; i < argc; i++)
6363 {
6364 const char *string = argv[i];
6365
6366 if (string[0] == '\0')
6367 new_argv[i] = xstrdup ("\"\"");
6368 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
6369 {
6370 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
6371 size_t length;
6372 unsigned int backslashes;
6373 const char *s;
6374 char *quoted_string;
6375 char *p;
6376
6377 length = 0;
6378 backslashes = 0;
6379 if (quote_around)
6380 length++;
6381 for (s = string; *s != '\0'; s++)
6382 {
6383 char c = *s;
6384 if (c == '"')
6385 length += backslashes + 1;
6386 length++;
6387 if (c == '\\')
6388 backslashes++;
6389 else
6390 backslashes = 0;
6391 }
6392 if (quote_around)
6393 length += backslashes + 1;
6394
6395 quoted_string = XMALLOC (char, length + 1);
6396
6397 p = quoted_string;
6398 backslashes = 0;
6399 if (quote_around)
6400 *p++ = '"';
6401 for (s = string; *s != '\0'; s++)
6402 {
6403 char c = *s;
6404 if (c == '"')
6405 {
6406 unsigned int j;
6407 for (j = backslashes + 1; j > 0; j--)
6408 *p++ = '\\';
6409 }
6410 *p++ = c;
6411 if (c == '\\')
6412 backslashes++;
6413 else
6414 backslashes = 0;
6415 }
6416 if (quote_around)
6417 {
6418 unsigned int j;
6419 for (j = backslashes; j > 0; j--)
6420 *p++ = '\\';
6421 *p++ = '"';
6422 }
6423 *p = '\0';
6424
6425 new_argv[i] = quoted_string;
6426 }
6427 else
6428 new_argv[i] = (char *) string;
6429 }
6430 new_argv[argc] = NULL;
6431
6432 return new_argv;
6433 }
6434 EOF
6435 ;;
6436 esac
6437
6438 cat <<"EOF"
6439 void lt_dump_script (FILE* f)
6440 {
6441 EOF
6442 func_emit_wrapper yes |
6443 $SED -n -e '
6444 s/^\(.\{79\}\)\(..*\)/\1\
6445 \2/
6446 h
6447 s/\([\\"]\)/\\\1/g
6448 s/$/\\n/
6449 s/\([^\n]*\).*/ fputs ("\1", f);/p
6450 g
6451 D'
6452 cat <<"EOF"
6453 }
6454 EOF
6455 }
6456 # end: func_emit_cwrapperexe_src
6457
6458 # func_win32_import_lib_p ARG
6459 # True if ARG is an import lib, as indicated by $file_magic_cmd
6460 func_win32_import_lib_p ()
6461 {
6462 $debug_cmd
6463
6464 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
6465 *import*) : ;;
6466 *) false ;;
6467 esac
6468 }
6469
6470 # func_suncc_cstd_abi
6471 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6472 # Several compiler flags select an ABI that is incompatible with the
6473 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6474 func_suncc_cstd_abi ()
6475 {
6476 $debug_cmd
6477
6478 case " $compile_command " in
6479 *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6480 suncc_use_cstd_abi=no
6481 ;;
6482 *)
6483 suncc_use_cstd_abi=yes
6484 ;;
6485 esac
6486 }
6487
6488 # func_mode_link arg...
6489 func_mode_link ()
6490 {
6491 $debug_cmd
6492
6493 case $host in
6494 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6495 # It is impossible to link a dll without this setting, and
6496 # we shouldn't force the makefile maintainer to figure out
6497 # what system we are compiling for in order to pass an extra
6498 # flag for every libtool invocation.
6499 # allow_undefined=no
6500
6501 # FIXME: Unfortunately, there are problems with the above when trying
6502 # to make a dll that has undefined symbols, in which case not
6503 # even a static library is built. For now, we need to specify
6504 # -no-undefined on the libtool link line when we can be certain
6505 # that all symbols are satisfied, otherwise we get a static library.
6506 allow_undefined=yes
6507 ;;
6508 *)
6509 allow_undefined=yes
6510 ;;
6511 esac
6512 libtool_args=$nonopt
6513 base_compile="$nonopt $@"
6514 compile_command=$nonopt
6515 finalize_command=$nonopt
6516
6517 compile_rpath=
6518 finalize_rpath=
6519 compile_shlibpath=
6520 finalize_shlibpath=
6521 convenience=
6522 old_convenience=
6523 deplibs=
6524 old_deplibs=
6525 compiler_flags=
6526 linker_flags=
6527 dllsearchpath=
6528 lib_search_path=`pwd`
6529 inst_prefix_dir=
6530 new_inherited_linker_flags=
6531
6532 avoid_version=no
6533 bindir=
6534 dlfiles=
6535 dlprefiles=
6536 dlself=no
6537 export_dynamic=no
6538 export_symbols=
6539 export_symbols_regex=
6540 generated=
6541 libobjs=
6542 ltlibs=
6543 module=no
6544 no_install=no
6545 objs=
6546 os2dllname=
6547 non_pic_objects=
6548 precious_files_regex=
6549 prefer_static_libs=no
6550 preload=false
6551 prev=
6552 prevarg=
6553 release=
6554 rpath=
6555 xrpath=
6556 perm_rpath=
6557 temp_rpath=
6558 thread_safe=no
6559 vinfo=
6560 vinfo_number=no
6561 weak_libs=
6562 single_module=$wl-single_module
6563 func_infer_tag $base_compile
6564
6565 # We need to know -static, to get the right output filenames.
6566 for arg
6567 do
6568 case $arg in
6569 -shared)
6570 test yes != "$build_libtool_libs" \
6571 && func_fatal_configuration "cannot build a shared library"
6572 build_old_libs=no
6573 break
6574 ;;
6575 -all-static | -static | -static-libtool-libs)
6576 case $arg in
6577 -all-static)
6578 if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
6579 func_warning "complete static linking is impossible in this configuration"
6580 fi
6581 if test -n "$link_static_flag"; then
6582 dlopen_self=$dlopen_self_static
6583 fi
6584 prefer_static_libs=yes
6585 ;;
6586 -static)
6587 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6588 dlopen_self=$dlopen_self_static
6589 fi
6590 prefer_static_libs=built
6591 ;;
6592 -static-libtool-libs)
6593 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6594 dlopen_self=$dlopen_self_static
6595 fi
6596 prefer_static_libs=yes
6597 ;;
6598 esac
6599 build_libtool_libs=no
6600 build_old_libs=yes
6601 break
6602 ;;
6603 esac
6604 done
6605
6606 # See if our shared archives depend on static archives.
6607 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
6608
6609 # Go through the arguments, transforming them on the way.
6610 while test "$#" -gt 0; do
6611 arg=$1
6612 shift
6613 func_quote_for_eval "$arg"
6614 qarg=$func_quote_for_eval_unquoted_result
6615 func_append libtool_args " $func_quote_for_eval_result"
6616
6617 # If the previous option needs an argument, assign it.
6618 if test -n "$prev"; then
6619 case $prev in
6620 output)
6621 func_append compile_command " @OUTPUT@"
6622 func_append finalize_command " @OUTPUT@"
6623 ;;
6624 esac
6625
6626 case $prev in
6627 bindir)
6628 bindir=$arg
6629 prev=
6630 continue
6631 ;;
6632 dlfiles|dlprefiles)
6633 $preload || {
6634 # Add the symbol object into the linking commands.
6635 func_append compile_command " @SYMFILE@"
6636 func_append finalize_command " @SYMFILE@"
6637 preload=:
6638 }
6639 case $arg in
6640 *.la | *.lo) ;; # We handle these cases below.
6641 force)
6642 if test no = "$dlself"; then
6643 dlself=needless
6644 export_dynamic=yes
6645 fi
6646 prev=
6647 continue
6648 ;;
6649 self)
6650 if test dlprefiles = "$prev"; then
6651 dlself=yes
6652 elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
6653 dlself=yes
6654 else
6655 dlself=needless
6656 export_dynamic=yes
6657 fi
6658 prev=
6659 continue
6660 ;;
6661 *)
6662 if test dlfiles = "$prev"; then
6663 func_append dlfiles " $arg"
6664 else
6665 func_append dlprefiles " $arg"
6666 fi
6667 prev=
6668 continue
6669 ;;
6670 esac
6671 ;;
6672 expsyms)
6673 export_symbols=$arg
6674 test -f "$arg" \
6675 || func_fatal_error "symbol file '$arg' does not exist"
6676 prev=
6677 continue
6678 ;;
6679 expsyms_regex)
6680 export_symbols_regex=$arg
6681 prev=
6682 continue
6683 ;;
6684 framework)
6685 case $host in
6686 *-*-darwin*)
6687 case "$deplibs " in
6688 *" $qarg.ltframework "*) ;;
6689 *) func_append deplibs " $qarg.ltframework" # this is fixed later
6690 ;;
6691 esac
6692 ;;
6693 esac
6694 prev=
6695 continue
6696 ;;
6697 inst_prefix)
6698 inst_prefix_dir=$arg
6699 prev=
6700 continue
6701 ;;
6702 mllvm)
6703 # Clang does not use LLVM to link, so we can simply discard any
6704 # '-mllvm $arg' options when doing the link step.
6705 prev=
6706 continue
6707 ;;
6708 objectlist)
6709 if test -f "$arg"; then
6710 save_arg=$arg
6711 moreargs=
6712 for fil in `cat "$save_arg"`
6713 do
6714 # func_append moreargs " $fil"
6715 arg=$fil
6716 # A libtool-controlled object.
6717
6718 # Check to see that this really is a libtool object.
6719 if func_lalib_unsafe_p "$arg"; then
6720 pic_object=
6721 non_pic_object=
6722
6723 # Read the .lo file
6724 func_source "$arg"
6725
6726 if test -z "$pic_object" ||
6727 test -z "$non_pic_object" ||
6728 test none = "$pic_object" &&
6729 test none = "$non_pic_object"; then
6730 func_fatal_error "cannot find name of object for '$arg'"
6731 fi
6732
6733 # Extract subdirectory from the argument.
6734 func_dirname "$arg" "/" ""
6735 xdir=$func_dirname_result
6736
6737 if test none != "$pic_object"; then
6738 # Prepend the subdirectory the object is found in.
6739 pic_object=$xdir$pic_object
6740
6741 if test dlfiles = "$prev"; then
6742 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
6743 func_append dlfiles " $pic_object"
6744 prev=
6745 continue
6746 else
6747 # If libtool objects are unsupported, then we need to preload.
6748 prev=dlprefiles
6749 fi
6750 fi
6751
6752 # CHECK ME: I think I busted this. -Ossama
6753 if test dlprefiles = "$prev"; then
6754 # Preload the old-style object.
6755 func_append dlprefiles " $pic_object"
6756 prev=
6757 fi
6758
6759 # A PIC object.
6760 func_append libobjs " $pic_object"
6761 arg=$pic_object
6762 fi
6763
6764 # Non-PIC object.
6765 if test none != "$non_pic_object"; then
6766 # Prepend the subdirectory the object is found in.
6767 non_pic_object=$xdir$non_pic_object
6768
6769 # A standard non-PIC object
6770 func_append non_pic_objects " $non_pic_object"
6771 if test -z "$pic_object" || test none = "$pic_object"; then
6772 arg=$non_pic_object
6773 fi
6774 else
6775 # If the PIC object exists, use it instead.
6776 # $xdir was prepended to $pic_object above.
6777 non_pic_object=$pic_object
6778 func_append non_pic_objects " $non_pic_object"
6779 fi
6780 else
6781 # Only an error if not doing a dry-run.
6782 if $opt_dry_run; then
6783 # Extract subdirectory from the argument.
6784 func_dirname "$arg" "/" ""
6785 xdir=$func_dirname_result
6786
6787 func_lo2o "$arg"
6788 pic_object=$xdir$objdir/$func_lo2o_result
6789 non_pic_object=$xdir$func_lo2o_result
6790 func_append libobjs " $pic_object"
6791 func_append non_pic_objects " $non_pic_object"
6792 else
6793 func_fatal_error "'$arg' is not a valid libtool object"
6794 fi
6795 fi
6796 done
6797 else
6798 func_fatal_error "link input file '$arg' does not exist"
6799 fi
6800 arg=$save_arg
6801 prev=
6802 continue
6803 ;;
6804 os2dllname)
6805 os2dllname=$arg
6806 prev=
6807 continue
6808 ;;
6809 precious_regex)
6810 precious_files_regex=$arg
6811 prev=
6812 continue
6813 ;;
6814 release)
6815 release=-$arg
6816 prev=
6817 continue
6818 ;;
6819 rpath | xrpath)
6820 # We need an absolute path.
6821 case $arg in
6822 [\\/]* | [A-Za-z]:[\\/]*) ;;
6823 *)
6824 func_fatal_error "only absolute run-paths are allowed"
6825 ;;
6826 esac
6827 if test rpath = "$prev"; then
6828 case "$rpath " in
6829 *" $arg "*) ;;
6830 *) func_append rpath " $arg" ;;
6831 esac
6832 else
6833 case "$xrpath " in
6834 *" $arg "*) ;;
6835 *) func_append xrpath " $arg" ;;
6836 esac
6837 fi
6838 prev=
6839 continue
6840 ;;
6841 shrext)
6842 shrext_cmds=$arg
6843 prev=
6844 continue
6845 ;;
6846 weak)
6847 func_append weak_libs " $arg"
6848 prev=
6849 continue
6850 ;;
6851 xcclinker)
6852 func_append linker_flags " $qarg"
6853 func_append compiler_flags " $qarg"
6854 prev=
6855 func_append compile_command " $qarg"
6856 func_append finalize_command " $qarg"
6857 continue
6858 ;;
6859 xcompiler)
6860 func_append compiler_flags " $qarg"
6861 prev=
6862 func_append compile_command " $qarg"
6863 func_append finalize_command " $qarg"
6864 continue
6865 ;;
6866 xlinker)
6867 func_append linker_flags " $qarg"
6868 func_append compiler_flags " $wl$qarg"
6869 prev=
6870 func_append compile_command " $wl$qarg"
6871 func_append finalize_command " $wl$qarg"
6872 continue
6873 ;;
6874 *)
6875 eval "$prev=\"\$arg\""
6876 prev=
6877 continue
6878 ;;
6879 esac
6880 fi # test -n "$prev"
6881
6882 prevarg=$arg
6883
6884 case $arg in
6885 -all-static)
6886 if test -n "$link_static_flag"; then
6887 # See comment for -static flag below, for more details.
6888 func_append compile_command " $link_static_flag"
6889 func_append finalize_command " $link_static_flag"
6890 fi
6891 continue
6892 ;;
6893
6894 -allow-undefined)
6895 # FIXME: remove this flag sometime in the future.
6896 func_fatal_error "'-allow-undefined' must not be used because it is the default"
6897 ;;
6898
6899 -avoid-version)
6900 avoid_version=yes
6901 continue
6902 ;;
6903
6904 -bindir)
6905 prev=bindir
6906 continue
6907 ;;
6908
6909 -dlopen)
6910 prev=dlfiles
6911 continue
6912 ;;
6913
6914 -dlpreopen)
6915 prev=dlprefiles
6916 continue
6917 ;;
6918
6919 -export-dynamic)
6920 export_dynamic=yes
6921 continue
6922 ;;
6923
6924 -export-symbols | -export-symbols-regex)
6925 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
6926 func_fatal_error "more than one -exported-symbols argument is not allowed"
6927 fi
6928 if test X-export-symbols = "X$arg"; then
6929 prev=expsyms
6930 else
6931 prev=expsyms_regex
6932 fi
6933 continue
6934 ;;
6935
6936 -framework)
6937 prev=framework
6938 continue
6939 ;;
6940
6941 -inst-prefix-dir)
6942 prev=inst_prefix
6943 continue
6944 ;;
6945
6946 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
6947 # so, if we see these flags be careful not to treat them like -L
6948 -L[A-Z][A-Z]*:*)
6949 case $with_gcc/$host in
6950 no/*-*-irix* | /*-*-irix*)
6951 func_append compile_command " $arg"
6952 func_append finalize_command " $arg"
6953 ;;
6954 esac
6955 continue
6956 ;;
6957
6958 -L*)
6959 func_stripname "-L" '' "$arg"
6960 if test -z "$func_stripname_result"; then
6961 if test "$#" -gt 0; then
6962 func_fatal_error "require no space between '-L' and '$1'"
6963 else
6964 func_fatal_error "need path for '-L' option"
6965 fi
6966 fi
6967 func_resolve_sysroot "$func_stripname_result"
6968 dir=$func_resolve_sysroot_result
6969 # We need an absolute path.
6970 case $dir in
6971 [\\/]* | [A-Za-z]:[\\/]*) ;;
6972 *)
6973 absdir=`cd "$dir" && pwd`
6974 test -z "$absdir" && \
6975 func_fatal_error "cannot determine absolute directory name of '$dir'"
6976 dir=$absdir
6977 ;;
6978 esac
6979 case "$deplibs " in
6980 *" -L$dir "* | *" $arg "*)
6981 # Will only happen for absolute or sysroot arguments
6982 ;;
6983 *)
6984 # Preserve sysroot, but never include relative directories
6985 case $dir in
6986 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
6987 *) func_append deplibs " -L$dir" ;;
6988 esac
6989 func_append lib_search_path " $dir"
6990 ;;
6991 esac
6992 case $host in
6993 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6994 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
6995 case :$dllsearchpath: in
6996 *":$dir:"*) ;;
6997 ::) dllsearchpath=$dir;;
6998 *) func_append dllsearchpath ":$dir";;
6999 esac
7000 case :$dllsearchpath: in
7001 *":$testbindir:"*) ;;
7002 ::) dllsearchpath=$testbindir;;
7003 *) func_append dllsearchpath ":$testbindir";;
7004 esac
7005 ;;
7006 esac
7007 continue
7008 ;;
7009
7010 -l*)
7011 if test X-lc = "X$arg" || test X-lm = "X$arg"; then
7012 case $host in
7013 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
7014 # These systems don't actually have a C or math library (as such)
7015 continue
7016 ;;
7017 *-*-os2*)
7018 # These systems don't actually have a C library (as such)
7019 test X-lc = "X$arg" && continue
7020 ;;
7021 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
7022 # Do not include libc due to us having libc/libc_r.
7023 test X-lc = "X$arg" && continue
7024 ;;
7025 *-*-rhapsody* | *-*-darwin1.[012])
7026 # Rhapsody C and math libraries are in the System framework
7027 func_append deplibs " System.ltframework"
7028 continue
7029 ;;
7030 *-*-sco3.2v5* | *-*-sco5v6*)
7031 # Causes problems with __ctype
7032 test X-lc = "X$arg" && continue
7033 ;;
7034 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7035 # Compiler inserts libc in the correct place for threads to work
7036 test X-lc = "X$arg" && continue
7037 ;;
7038 esac
7039 elif test X-lc_r = "X$arg"; then
7040 case $host in
7041 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
7042 # Do not include libc_r directly, use -pthread flag.
7043 continue
7044 ;;
7045 esac
7046 fi
7047 func_append deplibs " $arg"
7048 continue
7049 ;;
7050
7051 -mllvm)
7052 prev=mllvm
7053 continue
7054 ;;
7055
7056 -module)
7057 module=yes
7058 continue
7059 ;;
7060
7061 # Tru64 UNIX uses -model [arg] to determine the layout of C++
7062 # classes, name mangling, and exception handling.
7063 # Darwin uses the -arch flag to determine output architecture.
7064 -model|-arch|-isysroot|--sysroot)
7065 func_append compiler_flags " $arg"
7066 func_append compile_command " $arg"
7067 func_append finalize_command " $arg"
7068 prev=xcompiler
7069 continue
7070 ;;
7071
7072 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7073 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7074 func_append compiler_flags " $arg"
7075 func_append compile_command " $arg"
7076 func_append finalize_command " $arg"
7077 case "$new_inherited_linker_flags " in
7078 *" $arg "*) ;;
7079 * ) func_append new_inherited_linker_flags " $arg" ;;
7080 esac
7081 continue
7082 ;;
7083
7084 -multi_module)
7085 single_module=$wl-multi_module
7086 continue
7087 ;;
7088
7089 -no-fast-install)
7090 fast_install=no
7091 continue
7092 ;;
7093
7094 -no-install)
7095 case $host in
7096 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
7097 # The PATH hackery in wrapper scripts is required on Windows
7098 # and Darwin in order for the loader to find any dlls it needs.
7099 func_warning "'-no-install' is ignored for $host"
7100 func_warning "assuming '-no-fast-install' instead"
7101 fast_install=no
7102 ;;
7103 *) no_install=yes ;;
7104 esac
7105 continue
7106 ;;
7107
7108 -no-undefined)
7109 allow_undefined=no
7110 continue
7111 ;;
7112
7113 -objectlist)
7114 prev=objectlist
7115 continue
7116 ;;
7117
7118 -os2dllname)
7119 prev=os2dllname
7120 continue
7121 ;;
7122
7123 -o) prev=output ;;
7124
7125 -precious-files-regex)
7126 prev=precious_regex
7127 continue
7128 ;;
7129
7130 -release)
7131 prev=release
7132 continue
7133 ;;
7134
7135 -rpath)
7136 prev=rpath
7137 continue
7138 ;;
7139
7140 -R)
7141 prev=xrpath
7142 continue
7143 ;;
7144
7145 -R*)
7146 func_stripname '-R' '' "$arg"
7147 dir=$func_stripname_result
7148 # We need an absolute path.
7149 case $dir in
7150 [\\/]* | [A-Za-z]:[\\/]*) ;;
7151 =*)
7152 func_stripname '=' '' "$dir"
7153 dir=$lt_sysroot$func_stripname_result
7154 ;;
7155 *)
7156 func_fatal_error "only absolute run-paths are allowed"
7157 ;;
7158 esac
7159 case "$xrpath " in
7160 *" $dir "*) ;;
7161 *) func_append xrpath " $dir" ;;
7162 esac
7163 continue
7164 ;;
7165
7166 -shared)
7167 # The effects of -shared are defined in a previous loop.
7168 continue
7169 ;;
7170
7171 -shrext)
7172 prev=shrext
7173 continue
7174 ;;
7175
7176 -static | -static-libtool-libs)
7177 # The effects of -static are defined in a previous loop.
7178 # We used to do the same as -all-static on platforms that
7179 # didn't have a PIC flag, but the assumption that the effects
7180 # would be equivalent was wrong. It would break on at least
7181 # Digital Unix and AIX.
7182 continue
7183 ;;
7184
7185 -thread-safe)
7186 thread_safe=yes
7187 continue
7188 ;;
7189
7190 -version-info)
7191 prev=vinfo
7192 continue
7193 ;;
7194
7195 -version-number)
7196 prev=vinfo
7197 vinfo_number=yes
7198 continue
7199 ;;
7200
7201 -weak)
7202 prev=weak
7203 continue
7204 ;;
7205
7206 -Wc,*)
7207 func_stripname '-Wc,' '' "$arg"
7208 args=$func_stripname_result
7209 arg=
7210 save_ifs=$IFS; IFS=,
7211 for flag in $args; do
7212 IFS=$save_ifs
7213 func_quote_for_eval "$flag"
7214 func_append arg " $func_quote_for_eval_result"
7215 func_append compiler_flags " $func_quote_for_eval_result"
7216 done
7217 IFS=$save_ifs
7218 func_stripname ' ' '' "$arg"
7219 arg=$func_stripname_result
7220 ;;
7221
7222 -Wl,*)
7223 func_stripname '-Wl,' '' "$arg"
7224 args=$func_stripname_result
7225 arg=
7226 save_ifs=$IFS; IFS=,
7227 for flag in $args; do
7228 IFS=$save_ifs
7229 func_quote_for_eval "$flag"
7230 func_append arg " $wl$func_quote_for_eval_result"
7231 func_append compiler_flags " $wl$func_quote_for_eval_result"
7232 func_append linker_flags " $func_quote_for_eval_result"
7233 done
7234 IFS=$save_ifs
7235 func_stripname ' ' '' "$arg"
7236 arg=$func_stripname_result
7237 ;;
7238
7239 -Xcompiler)
7240 prev=xcompiler
7241 continue
7242 ;;
7243
7244 -Xlinker)
7245 prev=xlinker
7246 continue
7247 ;;
7248
7249 -XCClinker)
7250 prev=xcclinker
7251 continue
7252 ;;
7253
7254 # -msg_* for osf cc
7255 -msg_*)
7256 func_quote_for_eval "$arg"
7257 arg=$func_quote_for_eval_result
7258 ;;
7259
7260 # Flags to be passed through unchanged, with rationale:
7261 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
7262 # -r[0-9][0-9]* specify processor for the SGI compiler
7263 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
7264 # +DA*, +DD* enable 64-bit mode for the HP compiler
7265 # -q* compiler args for the IBM compiler
7266 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
7267 # -F/path path to uninstalled frameworks, gcc on darwin
7268 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7269 # -fstack-protector* stack protector flags for GCC
7270 # @file GCC response files
7271 # -tp=* Portland pgcc target processor selection
7272 # --sysroot=* for sysroot support
7273 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7274 # -stdlib=* select c++ std lib with clang
7275 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7276 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7277 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
7278 func_quote_for_eval "$arg"
7279 arg=$func_quote_for_eval_result
7280 func_append compile_command " $arg"
7281 func_append finalize_command " $arg"
7282 func_append compiler_flags " $arg"
7283 continue
7284 ;;
7285
7286 -Z*)
7287 if test os2 = "`expr $host : '.*\(os2\)'`"; then
7288 # OS/2 uses -Zxxx to specify OS/2-specific options
7289 compiler_flags="$compiler_flags $arg"
7290 func_append compile_command " $arg"
7291 func_append finalize_command " $arg"
7292 case $arg in
7293 -Zlinker | -Zstack)
7294 prev=xcompiler
7295 ;;
7296 esac
7297 continue
7298 else
7299 # Otherwise treat like 'Some other compiler flag' below
7300 func_quote_for_eval "$arg"
7301 arg=$func_quote_for_eval_result
7302 fi
7303 ;;
7304
7305 # Some other compiler flag.
7306 -* | +*)
7307 func_quote_for_eval "$arg"
7308 arg=$func_quote_for_eval_result
7309 ;;
7310
7311 *.$objext)
7312 # A standard object.
7313 func_append objs " $arg"
7314 ;;
7315
7316 *.lo)
7317 # A libtool-controlled object.
7318
7319 # Check to see that this really is a libtool object.
7320 if func_lalib_unsafe_p "$arg"; then
7321 pic_object=
7322 non_pic_object=
7323
7324 # Read the .lo file
7325 func_source "$arg"
7326
7327 if test -z "$pic_object" ||
7328 test -z "$non_pic_object" ||
7329 test none = "$pic_object" &&
7330 test none = "$non_pic_object"; then
7331 func_fatal_error "cannot find name of object for '$arg'"
7332 fi
7333
7334 # Extract subdirectory from the argument.
7335 func_dirname "$arg" "/" ""
7336 xdir=$func_dirname_result
7337
7338 test none = "$pic_object" || {
7339 # Prepend the subdirectory the object is found in.
7340 pic_object=$xdir$pic_object
7341
7342 if test dlfiles = "$prev"; then
7343 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7344 func_append dlfiles " $pic_object"
7345 prev=
7346 continue
7347 else
7348 # If libtool objects are unsupported, then we need to preload.
7349 prev=dlprefiles
7350 fi
7351 fi
7352
7353 # CHECK ME: I think I busted this. -Ossama
7354 if test dlprefiles = "$prev"; then
7355 # Preload the old-style object.
7356 func_append dlprefiles " $pic_object"
7357 prev=
7358 fi
7359
7360 # A PIC object.
7361 func_append libobjs " $pic_object"
7362 arg=$pic_object
7363 }
7364
7365 # Non-PIC object.
7366 if test none != "$non_pic_object"; then
7367 # Prepend the subdirectory the object is found in.
7368 non_pic_object=$xdir$non_pic_object
7369
7370 # A standard non-PIC object
7371 func_append non_pic_objects " $non_pic_object"
7372 if test -z "$pic_object" || test none = "$pic_object"; then
7373 arg=$non_pic_object
7374 fi
7375 else
7376 # If the PIC object exists, use it instead.
7377 # $xdir was prepended to $pic_object above.
7378 non_pic_object=$pic_object
7379 func_append non_pic_objects " $non_pic_object"
7380 fi
7381 else
7382 # Only an error if not doing a dry-run.
7383 if $opt_dry_run; then
7384 # Extract subdirectory from the argument.
7385 func_dirname "$arg" "/" ""
7386 xdir=$func_dirname_result
7387
7388 func_lo2o "$arg"
7389 pic_object=$xdir$objdir/$func_lo2o_result
7390 non_pic_object=$xdir$func_lo2o_result
7391 func_append libobjs " $pic_object"
7392 func_append non_pic_objects " $non_pic_object"
7393 else
7394 func_fatal_error "'$arg' is not a valid libtool object"
7395 fi
7396 fi
7397 ;;
7398
7399 *.$libext)
7400 # An archive.
7401 func_append deplibs " $arg"
7402 func_append old_deplibs " $arg"
7403 continue
7404 ;;
7405
7406 *.la)
7407 # A libtool-controlled library.
7408
7409 func_resolve_sysroot "$arg"
7410 if test dlfiles = "$prev"; then
7411 # This library was specified with -dlopen.
7412 func_append dlfiles " $func_resolve_sysroot_result"
7413 prev=
7414 elif test dlprefiles = "$prev"; then
7415 # The library was specified with -dlpreopen.
7416 func_append dlprefiles " $func_resolve_sysroot_result"
7417 prev=
7418 else
7419 func_append deplibs " $func_resolve_sysroot_result"
7420 fi
7421 continue
7422 ;;
7423
7424 # Some other compiler argument.
7425 *)
7426 # Unknown arguments in both finalize_command and compile_command need
7427 # to be aesthetically quoted because they are evaled later.
7428 func_quote_for_eval "$arg"
7429 arg=$func_quote_for_eval_result
7430 ;;
7431 esac # arg
7432
7433 # Now actually substitute the argument into the commands.
7434 if test -n "$arg"; then
7435 func_append compile_command " $arg"
7436 func_append finalize_command " $arg"
7437 fi
7438 done # argument parsing loop
7439
7440 test -n "$prev" && \
7441 func_fatal_help "the '$prevarg' option requires an argument"
7442
7443 if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
7444 eval arg=\"$export_dynamic_flag_spec\"
7445 func_append compile_command " $arg"
7446 func_append finalize_command " $arg"
7447 fi
7448
7449 oldlibs=
7450 # calculate the name of the file, without its directory
7451 func_basename "$output"
7452 outputname=$func_basename_result
7453 libobjs_save=$libobjs
7454
7455 if test -n "$shlibpath_var"; then
7456 # get the directories listed in $shlibpath_var
7457 eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
7458 else
7459 shlib_search_path=
7460 fi
7461 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
7462 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
7463
7464 # Definition is injected by LT_CONFIG during libtool generation.
7465 func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7466
7467 func_dirname "$output" "/" ""
7468 output_objdir=$func_dirname_result$objdir
7469 func_to_tool_file "$output_objdir/"
7470 tool_output_objdir=$func_to_tool_file_result
7471 # Create the object directory.
7472 func_mkdir_p "$output_objdir"
7473
7474 # Determine the type of output
7475 case $output in
7476 "")
7477 func_fatal_help "you must specify an output file"
7478 ;;
7479 *.$libext) linkmode=oldlib ;;
7480 *.lo | *.$objext) linkmode=obj ;;
7481 *.la) linkmode=lib ;;
7482 *) linkmode=prog ;; # Anything else should be a program.
7483 esac
7484
7485 specialdeplibs=
7486
7487 libs=
7488 # Find all interdependent deplibs by searching for libraries
7489 # that are linked more than once (e.g. -la -lb -la)
7490 for deplib in $deplibs; do
7491 if $opt_preserve_dup_deps; then
7492 case "$libs " in
7493 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7494 esac
7495 fi
7496 func_append libs " $deplib"
7497 done
7498
7499 if test lib = "$linkmode"; then
7500 libs="$predeps $libs $compiler_lib_search_path $postdeps"
7501
7502 # Compute libraries that are listed more than once in $predeps
7503 # $postdeps and mark them as special (i.e., whose duplicates are
7504 # not to be eliminated).
7505 pre_post_deps=
7506 if $opt_duplicate_compiler_generated_deps; then
7507 for pre_post_dep in $predeps $postdeps; do
7508 case "$pre_post_deps " in
7509 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
7510 esac
7511 func_append pre_post_deps " $pre_post_dep"
7512 done
7513 fi
7514 pre_post_deps=
7515 fi
7516
7517 deplibs=
7518 newdependency_libs=
7519 newlib_search_path=
7520 need_relink=no # whether we're linking any uninstalled libtool libraries
7521 notinst_deplibs= # not-installed libtool libraries
7522 notinst_path= # paths that contain not-installed libtool libraries
7523
7524 case $linkmode in
7525 lib)
7526 passes="conv dlpreopen link"
7527 for file in $dlfiles $dlprefiles; do
7528 case $file in
7529 *.la) ;;
7530 *)
7531 func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
7532 ;;
7533 esac
7534 done
7535 ;;
7536 prog)
7537 compile_deplibs=
7538 finalize_deplibs=
7539 alldeplibs=false
7540 newdlfiles=
7541 newdlprefiles=
7542 passes="conv scan dlopen dlpreopen link"
7543 ;;
7544 *) passes="conv"
7545 ;;
7546 esac
7547
7548 for pass in $passes; do
7549 # The preopen pass in lib mode reverses $deplibs; put it back here
7550 # so that -L comes before libs that need it for instance...
7551 if test lib,link = "$linkmode,$pass"; then
7552 ## FIXME: Find the place where the list is rebuilt in the wrong
7553 ## order, and fix it there properly
7554 tmp_deplibs=
7555 for deplib in $deplibs; do
7556 tmp_deplibs="$deplib $tmp_deplibs"
7557 done
7558 deplibs=$tmp_deplibs
7559 fi
7560
7561 if test lib,link = "$linkmode,$pass" ||
7562 test prog,scan = "$linkmode,$pass"; then
7563 libs=$deplibs
7564 deplibs=
7565 fi
7566 if test prog = "$linkmode"; then
7567 case $pass in
7568 dlopen) libs=$dlfiles ;;
7569 dlpreopen) libs=$dlprefiles ;;
7570 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
7571 esac
7572 fi
7573 if test lib,dlpreopen = "$linkmode,$pass"; then
7574 # Collect and forward deplibs of preopened libtool libs
7575 for lib in $dlprefiles; do
7576 # Ignore non-libtool-libs
7577 dependency_libs=
7578 func_resolve_sysroot "$lib"
7579 case $lib in
7580 *.la) func_source "$func_resolve_sysroot_result" ;;
7581 esac
7582
7583 # Collect preopened libtool deplibs, except any this library
7584 # has declared as weak libs
7585 for deplib in $dependency_libs; do
7586 func_basename "$deplib"
7587 deplib_base=$func_basename_result
7588 case " $weak_libs " in
7589 *" $deplib_base "*) ;;
7590 *) func_append deplibs " $deplib" ;;
7591 esac
7592 done
7593 done
7594 libs=$dlprefiles
7595 fi
7596 if test dlopen = "$pass"; then
7597 # Collect dlpreopened libraries
7598 save_deplibs=$deplibs
7599 deplibs=
7600 fi
7601
7602 for deplib in $libs; do
7603 lib=
7604 found=false
7605 case $deplib in
7606 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7607 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7608 if test prog,link = "$linkmode,$pass"; then
7609 compile_deplibs="$deplib $compile_deplibs"
7610 finalize_deplibs="$deplib $finalize_deplibs"
7611 else
7612 func_append compiler_flags " $deplib"
7613 if test lib = "$linkmode"; then
7614 case "$new_inherited_linker_flags " in
7615 *" $deplib "*) ;;
7616 * ) func_append new_inherited_linker_flags " $deplib" ;;
7617 esac
7618 fi
7619 fi
7620 continue
7621 ;;
7622 -l*)
7623 if test lib != "$linkmode" && test prog != "$linkmode"; then
7624 func_warning "'-l' is ignored for archives/objects"
7625 continue
7626 fi
7627 func_stripname '-l' '' "$deplib"
7628 name=$func_stripname_result
7629 if test lib = "$linkmode"; then
7630 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
7631 else
7632 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
7633 fi
7634 for searchdir in $searchdirs; do
7635 for search_ext in .la $std_shrext .so .a; do
7636 # Search the libtool library
7637 lib=$searchdir/lib$name$search_ext
7638 if test -f "$lib"; then
7639 if test .la = "$search_ext"; then
7640 found=:
7641 else
7642 found=false
7643 fi
7644 break 2
7645 fi
7646 done
7647 done
7648 if $found; then
7649 # deplib is a libtool library
7650 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
7651 # We need to do some special things here, and not later.
7652 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7653 case " $predeps $postdeps " in
7654 *" $deplib "*)
7655 if func_lalib_p "$lib"; then
7656 library_names=
7657 old_library=
7658 func_source "$lib"
7659 for l in $old_library $library_names; do
7660 ll=$l
7661 done
7662 if test "X$ll" = "X$old_library"; then # only static version available
7663 found=false
7664 func_dirname "$lib" "" "."
7665 ladir=$func_dirname_result
7666 lib=$ladir/$old_library
7667 if test prog,link = "$linkmode,$pass"; then
7668 compile_deplibs="$deplib $compile_deplibs"
7669 finalize_deplibs="$deplib $finalize_deplibs"
7670 else
7671 deplibs="$deplib $deplibs"
7672 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7673 fi
7674 continue
7675 fi
7676 fi
7677 ;;
7678 *) ;;
7679 esac
7680 fi
7681 else
7682 # deplib doesn't seem to be a libtool library
7683 if test prog,link = "$linkmode,$pass"; then
7684 compile_deplibs="$deplib $compile_deplibs"
7685 finalize_deplibs="$deplib $finalize_deplibs"
7686 else
7687 deplibs="$deplib $deplibs"
7688 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7689 fi
7690 continue
7691 fi
7692 ;; # -l
7693 *.ltframework)
7694 if test prog,link = "$linkmode,$pass"; then
7695 compile_deplibs="$deplib $compile_deplibs"
7696 finalize_deplibs="$deplib $finalize_deplibs"
7697 else
7698 deplibs="$deplib $deplibs"
7699 if test lib = "$linkmode"; then
7700 case "$new_inherited_linker_flags " in
7701 *" $deplib "*) ;;
7702 * ) func_append new_inherited_linker_flags " $deplib" ;;
7703 esac
7704 fi
7705 fi
7706 continue
7707 ;;
7708 -L*)
7709 case $linkmode in
7710 lib)
7711 deplibs="$deplib $deplibs"
7712 test conv = "$pass" && continue
7713 newdependency_libs="$deplib $newdependency_libs"
7714 func_stripname '-L' '' "$deplib"
7715 func_resolve_sysroot "$func_stripname_result"
7716 func_append newlib_search_path " $func_resolve_sysroot_result"
7717 ;;
7718 prog)
7719 if test conv = "$pass"; then
7720 deplibs="$deplib $deplibs"
7721 continue
7722 fi
7723 if test scan = "$pass"; then
7724 deplibs="$deplib $deplibs"
7725 else
7726 compile_deplibs="$deplib $compile_deplibs"
7727 finalize_deplibs="$deplib $finalize_deplibs"
7728 fi
7729 func_stripname '-L' '' "$deplib"
7730 func_resolve_sysroot "$func_stripname_result"
7731 func_append newlib_search_path " $func_resolve_sysroot_result"
7732 ;;
7733 *)
7734 func_warning "'-L' is ignored for archives/objects"
7735 ;;
7736 esac # linkmode
7737 continue
7738 ;; # -L
7739 -R*)
7740 if test link = "$pass"; then
7741 func_stripname '-R' '' "$deplib"
7742 func_resolve_sysroot "$func_stripname_result"
7743 dir=$func_resolve_sysroot_result
7744 # Make sure the xrpath contains only unique directories.
7745 case "$xrpath " in
7746 *" $dir "*) ;;
7747 *) func_append xrpath " $dir" ;;
7748 esac
7749 fi
7750 deplibs="$deplib $deplibs"
7751 continue
7752 ;;
7753 *.la)
7754 func_resolve_sysroot "$deplib"
7755 lib=$func_resolve_sysroot_result
7756 ;;
7757 *.$libext)
7758 if test conv = "$pass"; then
7759 deplibs="$deplib $deplibs"
7760 continue
7761 fi
7762 case $linkmode in
7763 lib)
7764 # Linking convenience modules into shared libraries is allowed,
7765 # but linking other static libraries is non-portable.
7766 case " $dlpreconveniencelibs " in
7767 *" $deplib "*) ;;
7768 *)
7769 valid_a_lib=false
7770 case $deplibs_check_method in
7771 match_pattern*)
7772 set dummy $deplibs_check_method; shift
7773 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7774 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
7775 | $EGREP "$match_pattern_regex" > /dev/null; then
7776 valid_a_lib=:
7777 fi
7778 ;;
7779 pass_all)
7780 valid_a_lib=:
7781 ;;
7782 esac
7783 if $valid_a_lib; then
7784 echo
7785 $ECHO "*** Warning: Linking the shared library $output against the"
7786 $ECHO "*** static library $deplib is not portable!"
7787 deplibs="$deplib $deplibs"
7788 else
7789 echo
7790 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
7791 echo "*** I have the capability to make that library automatically link in when"
7792 echo "*** you link to this library. But I can only do this if you have a"
7793 echo "*** shared version of the library, which you do not appear to have"
7794 echo "*** because the file extensions .$libext of this argument makes me believe"
7795 echo "*** that it is just a static archive that I should not use here."
7796 fi
7797 ;;
7798 esac
7799 continue
7800 ;;
7801 prog)
7802 if test link != "$pass"; then
7803 deplibs="$deplib $deplibs"
7804 else
7805 compile_deplibs="$deplib $compile_deplibs"
7806 finalize_deplibs="$deplib $finalize_deplibs"
7807 fi
7808 continue
7809 ;;
7810 esac # linkmode
7811 ;; # *.$libext
7812 *.lo | *.$objext)
7813 if test conv = "$pass"; then
7814 deplibs="$deplib $deplibs"
7815 elif test prog = "$linkmode"; then
7816 if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
7817 # If there is no dlopen support or we're linking statically,
7818 # we need to preload.
7819 func_append newdlprefiles " $deplib"
7820 compile_deplibs="$deplib $compile_deplibs"
7821 finalize_deplibs="$deplib $finalize_deplibs"
7822 else
7823 func_append newdlfiles " $deplib"
7824 fi
7825 fi
7826 continue
7827 ;;
7828 %DEPLIBS%)
7829 alldeplibs=:
7830 continue
7831 ;;
7832 esac # case $deplib
7833
7834 $found || test -f "$lib" \
7835 || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
7836
7837 # Check to see that this really is a libtool archive.
7838 func_lalib_unsafe_p "$lib" \
7839 || func_fatal_error "'$lib' is not a valid libtool archive"
7840
7841 func_dirname "$lib" "" "."
7842 ladir=$func_dirname_result
7843
7844 dlname=
7845 dlopen=
7846 dlpreopen=
7847 libdir=
7848 library_names=
7849 old_library=
7850 inherited_linker_flags=
7851 # If the library was installed with an old release of libtool,
7852 # it will not redefine variables installed, or shouldnotlink
7853 installed=yes
7854 shouldnotlink=no
7855 avoidtemprpath=
7856
7857
7858 # Read the .la file
7859 func_source "$lib"
7860
7861 # Convert "-framework foo" to "foo.ltframework"
7862 if test -n "$inherited_linker_flags"; then
7863 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
7864 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
7865 case " $new_inherited_linker_flags " in
7866 *" $tmp_inherited_linker_flag "*) ;;
7867 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
7868 esac
7869 done
7870 fi
7871 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7872 if test lib,link = "$linkmode,$pass" ||
7873 test prog,scan = "$linkmode,$pass" ||
7874 { test prog != "$linkmode" && test lib != "$linkmode"; }; then
7875 test -n "$dlopen" && func_append dlfiles " $dlopen"
7876 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
7877 fi
7878
7879 if test conv = "$pass"; then
7880 # Only check for convenience libraries
7881 deplibs="$lib $deplibs"
7882 if test -z "$libdir"; then
7883 if test -z "$old_library"; then
7884 func_fatal_error "cannot find name of link library for '$lib'"
7885 fi
7886 # It is a libtool convenience library, so add in its objects.
7887 func_append convenience " $ladir/$objdir/$old_library"
7888 func_append old_convenience " $ladir/$objdir/$old_library"
7889 elif test prog != "$linkmode" && test lib != "$linkmode"; then
7890 func_fatal_error "'$lib' is not a convenience library"
7891 fi
7892 tmp_libs=
7893 for deplib in $dependency_libs; do
7894 deplibs="$deplib $deplibs"
7895 if $opt_preserve_dup_deps; then
7896 case "$tmp_libs " in
7897 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7898 esac
7899 fi
7900 func_append tmp_libs " $deplib"
7901 done
7902 continue
7903 fi # $pass = conv
7904
7905
7906 # Get the name of the library we link against.
7907 linklib=
7908 if test -n "$old_library" &&
7909 { test yes = "$prefer_static_libs" ||
7910 test built,no = "$prefer_static_libs,$installed"; }; then
7911 linklib=$old_library
7912 else
7913 for l in $old_library $library_names; do
7914 linklib=$l
7915 done
7916 fi
7917 if test -z "$linklib"; then
7918 func_fatal_error "cannot find name of link library for '$lib'"
7919 fi
7920
7921 # This library was specified with -dlopen.
7922 if test dlopen = "$pass"; then
7923 test -z "$libdir" \
7924 && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
7925 if test -z "$dlname" ||
7926 test yes != "$dlopen_support" ||
7927 test no = "$build_libtool_libs"
7928 then
7929 # If there is no dlname, no dlopen support or we're linking
7930 # statically, we need to preload. We also need to preload any
7931 # dependent libraries so libltdl's deplib preloader doesn't
7932 # bomb out in the load deplibs phase.
7933 func_append dlprefiles " $lib $dependency_libs"
7934 else
7935 func_append newdlfiles " $lib"
7936 fi
7937 continue
7938 fi # $pass = dlopen
7939
7940 # We need an absolute path.
7941 case $ladir in
7942 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
7943 *)
7944 abs_ladir=`cd "$ladir" && pwd`
7945 if test -z "$abs_ladir"; then
7946 func_warning "cannot determine absolute directory name of '$ladir'"
7947 func_warning "passing it literally to the linker, although it might fail"
7948 abs_ladir=$ladir
7949 fi
7950 ;;
7951 esac
7952 func_basename "$lib"
7953 laname=$func_basename_result
7954
7955 # Find the relevant object directory and library name.
7956 if test yes = "$installed"; then
7957 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7958 func_warning "library '$lib' was moved."
7959 dir=$ladir
7960 absdir=$abs_ladir
7961 libdir=$abs_ladir
7962 else
7963 dir=$lt_sysroot$libdir
7964 absdir=$lt_sysroot$libdir
7965 fi
7966 test yes = "$hardcode_automatic" && avoidtemprpath=yes
7967 else
7968 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7969 dir=$ladir
7970 absdir=$abs_ladir
7971 # Remove this search path later
7972 func_append notinst_path " $abs_ladir"
7973 else
7974 dir=$ladir/$objdir
7975 absdir=$abs_ladir/$objdir
7976 # Remove this search path later
7977 func_append notinst_path " $abs_ladir"
7978 fi
7979 fi # $installed = yes
7980 func_stripname 'lib' '.la' "$laname"
7981 name=$func_stripname_result
7982
7983 # This library was specified with -dlpreopen.
7984 if test dlpreopen = "$pass"; then
7985 if test -z "$libdir" && test prog = "$linkmode"; then
7986 func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
7987 fi
7988 case $host in
7989 # special handling for platforms with PE-DLLs.
7990 *cygwin* | *mingw* | *cegcc* )
7991 # Linker will automatically link against shared library if both
7992 # static and shared are present. Therefore, ensure we extract
7993 # symbols from the import library if a shared library is present
7994 # (otherwise, the dlopen module name will be incorrect). We do
7995 # this by putting the import library name into $newdlprefiles.
7996 # We recover the dlopen module name by 'saving' the la file
7997 # name in a special purpose variable, and (later) extracting the
7998 # dlname from the la file.
7999 if test -n "$dlname"; then
8000 func_tr_sh "$dir/$linklib"
8001 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
8002 func_append newdlprefiles " $dir/$linklib"
8003 else
8004 func_append newdlprefiles " $dir/$old_library"
8005 # Keep a list of preopened convenience libraries to check
8006 # that they are being used correctly in the link pass.
8007 test -z "$libdir" && \
8008 func_append dlpreconveniencelibs " $dir/$old_library"
8009 fi
8010 ;;
8011 * )
8012 # Prefer using a static library (so that no silly _DYNAMIC symbols
8013 # are required to link).
8014 if test -n "$old_library"; then
8015 func_append newdlprefiles " $dir/$old_library"
8016 # Keep a list of preopened convenience libraries to check
8017 # that they are being used correctly in the link pass.
8018 test -z "$libdir" && \
8019 func_append dlpreconveniencelibs " $dir/$old_library"
8020 # Otherwise, use the dlname, so that lt_dlopen finds it.
8021 elif test -n "$dlname"; then
8022 func_append newdlprefiles " $dir/$dlname"
8023 else
8024 func_append newdlprefiles " $dir/$linklib"
8025 fi
8026 ;;
8027 esac
8028 fi # $pass = dlpreopen
8029
8030 if test -z "$libdir"; then
8031 # Link the convenience library
8032 if test lib = "$linkmode"; then
8033 deplibs="$dir/$old_library $deplibs"
8034 elif test prog,link = "$linkmode,$pass"; then
8035 compile_deplibs="$dir/$old_library $compile_deplibs"
8036 finalize_deplibs="$dir/$old_library $finalize_deplibs"
8037 else
8038 deplibs="$lib $deplibs" # used for prog,scan pass
8039 fi
8040 continue
8041 fi
8042
8043
8044 if test prog = "$linkmode" && test link != "$pass"; then
8045 func_append newlib_search_path " $ladir"
8046 deplibs="$lib $deplibs"
8047
8048 linkalldeplibs=false
8049 if test no != "$link_all_deplibs" || test -z "$library_names" ||
8050 test no = "$build_libtool_libs"; then
8051 linkalldeplibs=:
8052 fi
8053
8054 tmp_libs=
8055 for deplib in $dependency_libs; do
8056 case $deplib in
8057 -L*) func_stripname '-L' '' "$deplib"
8058 func_resolve_sysroot "$func_stripname_result"
8059 func_append newlib_search_path " $func_resolve_sysroot_result"
8060 ;;
8061 esac
8062 # Need to link against all dependency_libs?
8063 if $linkalldeplibs; then
8064 deplibs="$deplib $deplibs"
8065 else
8066 # Need to hardcode shared library paths
8067 # or/and link against static libraries
8068 newdependency_libs="$deplib $newdependency_libs"
8069 fi
8070 if $opt_preserve_dup_deps; then
8071 case "$tmp_libs " in
8072 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8073 esac
8074 fi
8075 func_append tmp_libs " $deplib"
8076 done # for deplib
8077 continue
8078 fi # $linkmode = prog...
8079
8080 if test prog,link = "$linkmode,$pass"; then
8081 if test -n "$library_names" &&
8082 { { test no = "$prefer_static_libs" ||
8083 test built,yes = "$prefer_static_libs,$installed"; } ||
8084 test -z "$old_library"; }; then
8085 # We need to hardcode the library path
8086 if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
8087 # Make sure the rpath contains only unique directories.
8088 case $temp_rpath: in
8089 *"$absdir:"*) ;;
8090 *) func_append temp_rpath "$absdir:" ;;
8091 esac
8092 fi
8093
8094 # Hardcode the library path.
8095 # Skip directories that are in the system default run-time
8096 # search path.
8097 case " $sys_lib_dlsearch_path " in
8098 *" $absdir "*) ;;
8099 *)
8100 case "$compile_rpath " in
8101 *" $absdir "*) ;;
8102 *) func_append compile_rpath " $absdir" ;;
8103 esac
8104 ;;
8105 esac
8106 case " $sys_lib_dlsearch_path " in
8107 *" $libdir "*) ;;
8108 *)
8109 case "$finalize_rpath " in
8110 *" $libdir "*) ;;
8111 *) func_append finalize_rpath " $libdir" ;;
8112 esac
8113 ;;
8114 esac
8115 fi # $linkmode,$pass = prog,link...
8116
8117 if $alldeplibs &&
8118 { test pass_all = "$deplibs_check_method" ||
8119 { test yes = "$build_libtool_libs" &&
8120 test -n "$library_names"; }; }; then
8121 # We only need to search for static libraries
8122 continue
8123 fi
8124 fi
8125
8126 link_static=no # Whether the deplib will be linked statically
8127 use_static_libs=$prefer_static_libs
8128 if test built = "$use_static_libs" && test yes = "$installed"; then
8129 use_static_libs=no
8130 fi
8131 if test -n "$library_names" &&
8132 { test no = "$use_static_libs" || test -z "$old_library"; }; then
8133 case $host in
8134 *cygwin* | *mingw* | *cegcc* | *os2*)
8135 # No point in relinking DLLs because paths are not encoded
8136 func_append notinst_deplibs " $lib"
8137 need_relink=no
8138 ;;
8139 *)
8140 if test no = "$installed"; then
8141 func_append notinst_deplibs " $lib"
8142 need_relink=yes
8143 fi
8144 ;;
8145 esac
8146 # This is a shared library
8147
8148 # Warn about portability, can't link against -module's on some
8149 # systems (darwin). Don't bleat about dlopened modules though!
8150 dlopenmodule=
8151 for dlpremoduletest in $dlprefiles; do
8152 if test "X$dlpremoduletest" = "X$lib"; then
8153 dlopenmodule=$dlpremoduletest
8154 break
8155 fi
8156 done
8157 if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
8158 echo
8159 if test prog = "$linkmode"; then
8160 $ECHO "*** Warning: Linking the executable $output against the loadable module"
8161 else
8162 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
8163 fi
8164 $ECHO "*** $linklib is not portable!"
8165 fi
8166 if test lib = "$linkmode" &&
8167 test yes = "$hardcode_into_libs"; then
8168 # Hardcode the library path.
8169 # Skip directories that are in the system default run-time
8170 # search path.
8171 case " $sys_lib_dlsearch_path " in
8172 *" $absdir "*) ;;
8173 *)
8174 case "$compile_rpath " in
8175 *" $absdir "*) ;;
8176 *) func_append compile_rpath " $absdir" ;;
8177 esac
8178 ;;
8179 esac
8180 case " $sys_lib_dlsearch_path " in
8181 *" $libdir "*) ;;
8182 *)
8183 case "$finalize_rpath " in
8184 *" $libdir "*) ;;
8185 *) func_append finalize_rpath " $libdir" ;;
8186 esac
8187 ;;
8188 esac
8189 fi
8190
8191 if test -n "$old_archive_from_expsyms_cmds"; then
8192 # figure out the soname
8193 set dummy $library_names
8194 shift
8195 realname=$1
8196 shift
8197 libname=`eval "\\$ECHO \"$libname_spec\""`
8198 # use dlname if we got it. it's perfectly good, no?
8199 if test -n "$dlname"; then
8200 soname=$dlname
8201 elif test -n "$soname_spec"; then
8202 # bleh windows
8203 case $host in
8204 *cygwin* | mingw* | *cegcc* | *os2*)
8205 func_arith $current - $age
8206 major=$func_arith_result
8207 versuffix=-$major
8208 ;;
8209 esac
8210 eval soname=\"$soname_spec\"
8211 else
8212 soname=$realname
8213 fi
8214
8215 # Make a new name for the extract_expsyms_cmds to use
8216 soroot=$soname
8217 func_basename "$soroot"
8218 soname=$func_basename_result
8219 func_stripname 'lib' '.dll' "$soname"
8220 newlib=libimp-$func_stripname_result.a
8221
8222 # If the library has no export list, then create one now
8223 if test -f "$output_objdir/$soname-def"; then :
8224 else
8225 func_verbose "extracting exported symbol list from '$soname'"
8226 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
8227 fi
8228
8229 # Create $newlib
8230 if test -f "$output_objdir/$newlib"; then :; else
8231 func_verbose "generating import library for '$soname'"
8232 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
8233 fi
8234 # make sure the library variables are pointing to the new library
8235 dir=$output_objdir
8236 linklib=$newlib
8237 fi # test -n "$old_archive_from_expsyms_cmds"
8238
8239 if test prog = "$linkmode" || test relink != "$opt_mode"; then
8240 add_shlibpath=
8241 add_dir=
8242 add=
8243 lib_linked=yes
8244 case $hardcode_action in
8245 immediate | unsupported)
8246 if test no = "$hardcode_direct"; then
8247 add=$dir/$linklib
8248 case $host in
8249 *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8250 *-*-sysv4*uw2*) add_dir=-L$dir ;;
8251 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8252 *-*-unixware7*) add_dir=-L$dir ;;
8253 *-*-darwin* )
8254 # if the lib is a (non-dlopened) module then we cannot
8255 # link against it, someone is ignoring the earlier warnings
8256 if /usr/bin/file -L $add 2> /dev/null |
8257 $GREP ": [^:]* bundle" >/dev/null; then
8258 if test "X$dlopenmodule" != "X$lib"; then
8259 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
8260 if test -z "$old_library"; then
8261 echo
8262 echo "*** And there doesn't seem to be a static archive available"
8263 echo "*** The link will probably fail, sorry"
8264 else
8265 add=$dir/$old_library
8266 fi
8267 elif test -n "$old_library"; then
8268 add=$dir/$old_library
8269 fi
8270 fi
8271 esac
8272 elif test no = "$hardcode_minus_L"; then
8273 case $host in
8274 *-*-sunos*) add_shlibpath=$dir ;;
8275 esac
8276 add_dir=-L$dir
8277 add=-l$name
8278 elif test no = "$hardcode_shlibpath_var"; then
8279 add_shlibpath=$dir
8280 add=-l$name
8281 else
8282 lib_linked=no
8283 fi
8284 ;;
8285 relink)
8286 if test yes = "$hardcode_direct" &&
8287 test no = "$hardcode_direct_absolute"; then
8288 add=$dir/$linklib
8289 elif test yes = "$hardcode_minus_L"; then
8290 add_dir=-L$absdir
8291 # Try looking first in the location we're being installed to.
8292 if test -n "$inst_prefix_dir"; then
8293 case $libdir in
8294 [\\/]*)
8295 func_append add_dir " -L$inst_prefix_dir$libdir"
8296 ;;
8297 esac
8298 fi
8299 add=-l$name
8300 elif test yes = "$hardcode_shlibpath_var"; then
8301 add_shlibpath=$dir
8302 add=-l$name
8303 else
8304 lib_linked=no
8305 fi
8306 ;;
8307 *) lib_linked=no ;;
8308 esac
8309
8310 if test yes != "$lib_linked"; then
8311 func_fatal_configuration "unsupported hardcode properties"
8312 fi
8313
8314 if test -n "$add_shlibpath"; then
8315 case :$compile_shlibpath: in
8316 *":$add_shlibpath:"*) ;;
8317 *) func_append compile_shlibpath "$add_shlibpath:" ;;
8318 esac
8319 fi
8320 if test prog = "$linkmode"; then
8321 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
8322 test -n "$add" && compile_deplibs="$add $compile_deplibs"
8323 else
8324 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8325 test -n "$add" && deplibs="$add $deplibs"
8326 if test yes != "$hardcode_direct" &&
8327 test yes != "$hardcode_minus_L" &&
8328 test yes = "$hardcode_shlibpath_var"; then
8329 case :$finalize_shlibpath: in
8330 *":$libdir:"*) ;;
8331 *) func_append finalize_shlibpath "$libdir:" ;;
8332 esac
8333 fi
8334 fi
8335 fi
8336
8337 if test prog = "$linkmode" || test relink = "$opt_mode"; then
8338 add_shlibpath=
8339 add_dir=
8340 add=
8341 # Finalize command for both is simple: just hardcode it.
8342 if test yes = "$hardcode_direct" &&
8343 test no = "$hardcode_direct_absolute"; then
8344 add=$libdir/$linklib
8345 elif test yes = "$hardcode_minus_L"; then
8346 add_dir=-L$libdir
8347 add=-l$name
8348 elif test yes = "$hardcode_shlibpath_var"; then
8349 case :$finalize_shlibpath: in
8350 *":$libdir:"*) ;;
8351 *) func_append finalize_shlibpath "$libdir:" ;;
8352 esac
8353 add=-l$name
8354 elif test yes = "$hardcode_automatic"; then
8355 if test -n "$inst_prefix_dir" &&
8356 test -f "$inst_prefix_dir$libdir/$linklib"; then
8357 add=$inst_prefix_dir$libdir/$linklib
8358 else
8359 add=$libdir/$linklib
8360 fi
8361 else
8362 # We cannot seem to hardcode it, guess we'll fake it.
8363 add_dir=-L$libdir
8364 # Try looking first in the location we're being installed to.
8365 if test -n "$inst_prefix_dir"; then
8366 case $libdir in
8367 [\\/]*)
8368 func_append add_dir " -L$inst_prefix_dir$libdir"
8369 ;;
8370 esac
8371 fi
8372 add=-l$name
8373 fi
8374
8375 if test prog = "$linkmode"; then
8376 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
8377 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
8378 else
8379 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8380 test -n "$add" && deplibs="$add $deplibs"
8381 fi
8382 fi
8383 elif test prog = "$linkmode"; then
8384 # Here we assume that one of hardcode_direct or hardcode_minus_L
8385 # is not unsupported. This is valid on all known static and
8386 # shared platforms.
8387 if test unsupported != "$hardcode_direct"; then
8388 test -n "$old_library" && linklib=$old_library
8389 compile_deplibs="$dir/$linklib $compile_deplibs"
8390 finalize_deplibs="$dir/$linklib $finalize_deplibs"
8391 else
8392 compile_deplibs="-l$name -L$dir $compile_deplibs"
8393 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
8394 fi
8395 elif test yes = "$build_libtool_libs"; then
8396 # Not a shared library
8397 if test pass_all != "$deplibs_check_method"; then
8398 # We're trying link a shared library against a static one
8399 # but the system doesn't support it.
8400
8401 # Just print a warning and add the library to dependency_libs so
8402 # that the program can be linked against the static library.
8403 echo
8404 $ECHO "*** Warning: This system cannot link to static lib archive $lib."
8405 echo "*** I have the capability to make that library automatically link in when"
8406 echo "*** you link to this library. But I can only do this if you have a"
8407 echo "*** shared version of the library, which you do not appear to have."
8408 if test yes = "$module"; then
8409 echo "*** But as you try to build a module library, libtool will still create "
8410 echo "*** a static module, that should work as long as the dlopening application"
8411 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
8412 if test -z "$global_symbol_pipe"; then
8413 echo
8414 echo "*** However, this would only work if libtool was able to extract symbol"
8415 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
8416 echo "*** not find such a program. So, this module is probably useless."
8417 echo "*** 'nm' from GNU binutils and a full rebuild may help."
8418 fi
8419 if test no = "$build_old_libs"; then
8420 build_libtool_libs=module
8421 build_old_libs=yes
8422 else
8423 build_libtool_libs=no
8424 fi
8425 fi
8426 else
8427 deplibs="$dir/$old_library $deplibs"
8428 link_static=yes
8429 fi
8430 fi # link shared/static library?
8431
8432 if test lib = "$linkmode"; then
8433 if test -n "$dependency_libs" &&
8434 { test yes != "$hardcode_into_libs" ||
8435 test yes = "$build_old_libs" ||
8436 test yes = "$link_static"; }; then
8437 # Extract -R from dependency_libs
8438 temp_deplibs=
8439 for libdir in $dependency_libs; do
8440 case $libdir in
8441 -R*) func_stripname '-R' '' "$libdir"
8442 temp_xrpath=$func_stripname_result
8443 case " $xrpath " in
8444 *" $temp_xrpath "*) ;;
8445 *) func_append xrpath " $temp_xrpath";;
8446 esac;;
8447 *) func_append temp_deplibs " $libdir";;
8448 esac
8449 done
8450 dependency_libs=$temp_deplibs
8451 fi
8452
8453 func_append newlib_search_path " $absdir"
8454 # Link against this library
8455 test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8456 # ... and its dependency_libs
8457 tmp_libs=
8458 for deplib in $dependency_libs; do
8459 newdependency_libs="$deplib $newdependency_libs"
8460 case $deplib in
8461 -L*) func_stripname '-L' '' "$deplib"
8462 func_resolve_sysroot "$func_stripname_result";;
8463 *) func_resolve_sysroot "$deplib" ;;
8464 esac
8465 if $opt_preserve_dup_deps; then
8466 case "$tmp_libs " in
8467 *" $func_resolve_sysroot_result "*)
8468 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
8469 esac
8470 fi
8471 func_append tmp_libs " $func_resolve_sysroot_result"
8472 done
8473
8474 if test no != "$link_all_deplibs"; then
8475 # Add the search paths of all dependency libraries
8476 for deplib in $dependency_libs; do
8477 path=
8478 case $deplib in
8479 -L*) path=$deplib ;;
8480 *.la)
8481 func_resolve_sysroot "$deplib"
8482 deplib=$func_resolve_sysroot_result
8483 func_dirname "$deplib" "" "."
8484 dir=$func_dirname_result
8485 # We need an absolute path.
8486 case $dir in
8487 [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
8488 *)
8489 absdir=`cd "$dir" && pwd`
8490 if test -z "$absdir"; then
8491 func_warning "cannot determine absolute directory name of '$dir'"
8492 absdir=$dir
8493 fi
8494 ;;
8495 esac
8496 if $GREP "^installed=no" $deplib > /dev/null; then
8497 case $host in
8498 *-*-darwin*)
8499 depdepl=
8500 eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8501 if test -n "$deplibrary_names"; then
8502 for tmp in $deplibrary_names; do
8503 depdepl=$tmp
8504 done
8505 if test -f "$absdir/$objdir/$depdepl"; then
8506 depdepl=$absdir/$objdir/$depdepl
8507 darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8508 if test -z "$darwin_install_name"; then
8509 darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8510 fi
8511 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
8512 func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
8513 path=
8514 fi
8515 fi
8516 ;;
8517 *)
8518 path=-L$absdir/$objdir
8519 ;;
8520 esac
8521 else
8522 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8523 test -z "$libdir" && \
8524 func_fatal_error "'$deplib' is not a valid libtool archive"
8525 test "$absdir" != "$libdir" && \
8526 func_warning "'$deplib' seems to be moved"
8527
8528 path=-L$absdir
8529 fi
8530 ;;
8531 esac
8532 case " $deplibs " in
8533 *" $path "*) ;;
8534 *) deplibs="$path $deplibs" ;;
8535 esac
8536 done
8537 fi # link_all_deplibs != no
8538 fi # linkmode = lib
8539 done # for deplib in $libs
8540 if test link = "$pass"; then
8541 if test prog = "$linkmode"; then
8542 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
8543 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
8544 else
8545 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8546 fi
8547 fi
8548 dependency_libs=$newdependency_libs
8549 if test dlpreopen = "$pass"; then
8550 # Link the dlpreopened libraries before other libraries
8551 for deplib in $save_deplibs; do
8552 deplibs="$deplib $deplibs"
8553 done
8554 fi
8555 if test dlopen != "$pass"; then
8556 test conv = "$pass" || {
8557 # Make sure lib_search_path contains only unique directories.
8558 lib_search_path=
8559 for dir in $newlib_search_path; do
8560 case "$lib_search_path " in
8561 *" $dir "*) ;;
8562 *) func_append lib_search_path " $dir" ;;
8563 esac
8564 done
8565 newlib_search_path=
8566 }
8567
8568 if test prog,link = "$linkmode,$pass"; then
8569 vars="compile_deplibs finalize_deplibs"
8570 else
8571 vars=deplibs
8572 fi
8573 for var in $vars dependency_libs; do
8574 # Add libraries to $var in reverse order
8575 eval tmp_libs=\"\$$var\"
8576 new_libs=
8577 for deplib in $tmp_libs; do
8578 # FIXME: Pedantically, this is the right thing to do, so
8579 # that some nasty dependency loop isn't accidentally
8580 # broken:
8581 #new_libs="$deplib $new_libs"
8582 # Pragmatically, this seems to cause very few problems in
8583 # practice:
8584 case $deplib in
8585 -L*) new_libs="$deplib $new_libs" ;;
8586 -R*) ;;
8587 *)
8588 # And here is the reason: when a library appears more
8589 # than once as an explicit dependence of a library, or
8590 # is implicitly linked in more than once by the
8591 # compiler, it is considered special, and multiple
8592 # occurrences thereof are not removed. Compare this
8593 # with having the same library being listed as a
8594 # dependency of multiple other libraries: in this case,
8595 # we know (pedantically, we assume) the library does not
8596 # need to be listed more than once, so we keep only the
8597 # last copy. This is not always right, but it is rare
8598 # enough that we require users that really mean to play
8599 # such unportable linking tricks to link the library
8600 # using -Wl,-lname, so that libtool does not consider it
8601 # for duplicate removal.
8602 case " $specialdeplibs " in
8603 *" $deplib "*) new_libs="$deplib $new_libs" ;;
8604 *)
8605 case " $new_libs " in
8606 *" $deplib "*) ;;
8607 *) new_libs="$deplib $new_libs" ;;
8608 esac
8609 ;;
8610 esac
8611 ;;
8612 esac
8613 done
8614 tmp_libs=
8615 for deplib in $new_libs; do
8616 case $deplib in
8617 -L*)
8618 case " $tmp_libs " in
8619 *" $deplib "*) ;;
8620 *) func_append tmp_libs " $deplib" ;;
8621 esac
8622 ;;
8623 *) func_append tmp_libs " $deplib" ;;
8624 esac
8625 done
8626 eval $var=\"$tmp_libs\"
8627 done # for var
8628 fi
8629
8630 # Add Sun CC postdeps if required:
8631 test CXX = "$tagname" && {
8632 case $host_os in
8633 linux*)
8634 case `$CC -V 2>&1 | sed 5q` in
8635 *Sun\ C*) # Sun C++ 5.9
8636 func_suncc_cstd_abi
8637
8638 if test no != "$suncc_use_cstd_abi"; then
8639 func_append postdeps ' -library=Cstd -library=Crun'
8640 fi
8641 ;;
8642 esac
8643 ;;
8644
8645 solaris*)
8646 func_cc_basename "$CC"
8647 case $func_cc_basename_result in
8648 CC* | sunCC*)
8649 func_suncc_cstd_abi
8650
8651 if test no != "$suncc_use_cstd_abi"; then
8652 func_append postdeps ' -library=Cstd -library=Crun'
8653 fi
8654 ;;
8655 esac
8656 ;;
8657 esac
8658 }
8659
8660 # Last step: remove runtime libs from dependency_libs
8661 # (they stay in deplibs)
8662 tmp_libs=
8663 for i in $dependency_libs; do
8664 case " $predeps $postdeps $compiler_lib_search_path " in
8665 *" $i "*)
8666 i=
8667 ;;
8668 esac
8669 if test -n "$i"; then
8670 func_append tmp_libs " $i"
8671 fi
8672 done
8673 dependency_libs=$tmp_libs
8674 done # for pass
8675 if test prog = "$linkmode"; then
8676 dlfiles=$newdlfiles
8677 fi
8678 if test prog = "$linkmode" || test lib = "$linkmode"; then
8679 dlprefiles=$newdlprefiles
8680 fi
8681
8682 case $linkmode in
8683 oldlib)
8684 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
8685 func_warning "'-dlopen' is ignored for archives"
8686 fi
8687
8688 case " $deplibs" in
8689 *\ -l* | *\ -L*)
8690 func_warning "'-l' and '-L' are ignored for archives" ;;
8691 esac
8692
8693 test -n "$rpath" && \
8694 func_warning "'-rpath' is ignored for archives"
8695
8696 test -n "$xrpath" && \
8697 func_warning "'-R' is ignored for archives"
8698
8699 test -n "$vinfo" && \
8700 func_warning "'-version-info/-version-number' is ignored for archives"
8701
8702 test -n "$release" && \
8703 func_warning "'-release' is ignored for archives"
8704
8705 test -n "$export_symbols$export_symbols_regex" && \
8706 func_warning "'-export-symbols' is ignored for archives"
8707
8708 # Now set the variables for building old libraries.
8709 build_libtool_libs=no
8710 oldlibs=$output
8711 func_append objs "$old_deplibs"
8712 ;;
8713
8714 lib)
8715 # Make sure we only generate libraries of the form 'libNAME.la'.
8716 case $outputname in
8717 lib*)
8718 func_stripname 'lib' '.la' "$outputname"
8719 name=$func_stripname_result
8720 eval shared_ext=\"$shrext_cmds\"
8721 eval libname=\"$libname_spec\"
8722 ;;
8723 *)
8724 test no = "$module" \
8725 && func_fatal_help "libtool library '$output' must begin with 'lib'"
8726
8727 if test no != "$need_lib_prefix"; then
8728 # Add the "lib" prefix for modules if required
8729 func_stripname '' '.la' "$outputname"
8730 name=$func_stripname_result
8731 eval shared_ext=\"$shrext_cmds\"
8732 eval libname=\"$libname_spec\"
8733 else
8734 func_stripname '' '.la' "$outputname"
8735 libname=$func_stripname_result
8736 fi
8737 ;;
8738 esac
8739
8740 if test -n "$objs"; then
8741 if test pass_all != "$deplibs_check_method"; then
8742 func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
8743 else
8744 echo
8745 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
8746 $ECHO "*** objects $objs is not portable!"
8747 func_append libobjs " $objs"
8748 fi
8749 fi
8750
8751 test no = "$dlself" \
8752 || func_warning "'-dlopen self' is ignored for libtool libraries"
8753
8754 set dummy $rpath
8755 shift
8756 test 1 -lt "$#" \
8757 && func_warning "ignoring multiple '-rpath's for a libtool library"
8758
8759 install_libdir=$1
8760
8761 oldlibs=
8762 if test -z "$rpath"; then
8763 if test yes = "$build_libtool_libs"; then
8764 # Building a libtool convenience library.
8765 # Some compilers have problems with a '.al' extension so
8766 # convenience libraries should have the same extension an
8767 # archive normally would.
8768 oldlibs="$output_objdir/$libname.$libext $oldlibs"
8769 build_libtool_libs=convenience
8770 build_old_libs=yes
8771 fi
8772
8773 test -n "$vinfo" && \
8774 func_warning "'-version-info/-version-number' is ignored for convenience libraries"
8775
8776 test -n "$release" && \
8777 func_warning "'-release' is ignored for convenience libraries"
8778 else
8779
8780 # Parse the version information argument.
8781 save_ifs=$IFS; IFS=:
8782 set dummy $vinfo 0 0 0
8783 shift
8784 IFS=$save_ifs
8785
8786 test -n "$7" && \
8787 func_fatal_help "too many parameters to '-version-info'"
8788
8789 # convert absolute version numbers to libtool ages
8790 # this retains compatibility with .la files and attempts
8791 # to make the code below a bit more comprehensible
8792
8793 case $vinfo_number in
8794 yes)
8795 number_major=$1
8796 number_minor=$2
8797 number_revision=$3
8798 #
8799 # There are really only two kinds -- those that
8800 # use the current revision as the major version
8801 # and those that subtract age and use age as
8802 # a minor version. But, then there is irix
8803 # that has an extra 1 added just for fun
8804 #
8805 case $version_type in
8806 # correct linux to gnu/linux during the next big refactor
8807 darwin|freebsd-elf|linux|osf|windows|none)
8808 func_arith $number_major + $number_minor
8809 current=$func_arith_result
8810 age=$number_minor
8811 revision=$number_revision
8812 ;;
8813 freebsd-aout|qnx|sunos)
8814 current=$number_major
8815 revision=$number_minor
8816 age=0
8817 ;;
8818 irix|nonstopux)
8819 func_arith $number_major + $number_minor
8820 current=$func_arith_result
8821 age=$number_minor
8822 revision=$number_minor
8823 lt_irix_increment=no
8824 ;;
8825 esac
8826 ;;
8827 no)
8828 current=$1
8829 revision=$2
8830 age=$3
8831 ;;
8832 esac
8833
8834 # Check that each of the things are valid numbers.
8835 case $current in
8836 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8837 *)
8838 func_error "CURRENT '$current' must be a nonnegative integer"
8839 func_fatal_error "'$vinfo' is not valid version information"
8840 ;;
8841 esac
8842
8843 case $revision in
8844 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8845 *)
8846 func_error "REVISION '$revision' must be a nonnegative integer"
8847 func_fatal_error "'$vinfo' is not valid version information"
8848 ;;
8849 esac
8850
8851 case $age in
8852 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8853 *)
8854 func_error "AGE '$age' must be a nonnegative integer"
8855 func_fatal_error "'$vinfo' is not valid version information"
8856 ;;
8857 esac
8858
8859 if test "$age" -gt "$current"; then
8860 func_error "AGE '$age' is greater than the current interface number '$current'"
8861 func_fatal_error "'$vinfo' is not valid version information"
8862 fi
8863
8864 # Calculate the version variables.
8865 major=
8866 versuffix=
8867 verstring=
8868 case $version_type in
8869 none) ;;
8870
8871 darwin)
8872 # Like Linux, but with the current version available in
8873 # verstring for coding it into the library header
8874 func_arith $current - $age
8875 major=.$func_arith_result
8876 versuffix=$major.$age.$revision
8877 # Darwin ld doesn't like 0 for these options...
8878 func_arith $current + 1
8879 minor_current=$func_arith_result
8880 xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
8881 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8882 # On Darwin other compilers
8883 case $CC in
8884 nagfor*)
8885 verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
8886 ;;
8887 *)
8888 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8889 ;;
8890 esac
8891 ;;
8892
8893 freebsd-aout)
8894 major=.$current
8895 versuffix=.$current.$revision
8896 ;;
8897
8898 freebsd-elf)
8899 func_arith $current - $age
8900 major=.$func_arith_result
8901 versuffix=$major.$age.$revision
8902 ;;
8903
8904 irix | nonstopux)
8905 if test no = "$lt_irix_increment"; then
8906 func_arith $current - $age
8907 else
8908 func_arith $current - $age + 1
8909 fi
8910 major=$func_arith_result
8911
8912 case $version_type in
8913 nonstopux) verstring_prefix=nonstopux ;;
8914 *) verstring_prefix=sgi ;;
8915 esac
8916 verstring=$verstring_prefix$major.$revision
8917
8918 # Add in all the interfaces that we are compatible with.
8919 loop=$revision
8920 while test 0 -ne "$loop"; do
8921 func_arith $revision - $loop
8922 iface=$func_arith_result
8923 func_arith $loop - 1
8924 loop=$func_arith_result
8925 verstring=$verstring_prefix$major.$iface:$verstring
8926 done
8927
8928 # Before this point, $major must not contain '.'.
8929 major=.$major
8930 versuffix=$major.$revision
8931 ;;
8932
8933 linux) # correct to gnu/linux during the next big refactor
8934 func_arith $current - $age
8935 major=.$func_arith_result
8936 versuffix=$major.$age.$revision
8937 ;;
8938
8939 osf)
8940 func_arith $current - $age
8941 major=.$func_arith_result
8942 versuffix=.$current.$age.$revision
8943 verstring=$current.$age.$revision
8944
8945 # Add in all the interfaces that we are compatible with.
8946 loop=$age
8947 while test 0 -ne "$loop"; do
8948 func_arith $current - $loop
8949 iface=$func_arith_result
8950 func_arith $loop - 1
8951 loop=$func_arith_result
8952 verstring=$verstring:$iface.0
8953 done
8954
8955 # Make executables depend on our current version.
8956 func_append verstring ":$current.0"
8957 ;;
8958
8959 qnx)
8960 major=.$current
8961 versuffix=.$current
8962 ;;
8963
8964 sco)
8965 major=.$current
8966 versuffix=.$current
8967 ;;
8968
8969 sunos)
8970 major=.$current
8971 versuffix=.$current.$revision
8972 ;;
8973
8974 windows)
8975 # Use '-' rather than '.', since we only want one
8976 # extension on DOS 8.3 file systems.
8977 func_arith $current - $age
8978 major=$func_arith_result
8979 versuffix=-$major
8980 ;;
8981
8982 *)
8983 func_fatal_configuration "unknown library version type '$version_type'"
8984 ;;
8985 esac
8986
8987 # Clear the version info if we defaulted, and they specified a release.
8988 if test -z "$vinfo" && test -n "$release"; then
8989 major=
8990 case $version_type in
8991 darwin)
8992 # we can't check for "0.0" in archive_cmds due to quoting
8993 # problems, so we reset it completely
8994 verstring=
8995 ;;
8996 *)
8997 verstring=0.0
8998 ;;
8999 esac
9000 if test no = "$need_version"; then
9001 versuffix=
9002 else
9003 versuffix=.0.0
9004 fi
9005 fi
9006
9007 # Remove version info from name if versioning should be avoided
9008 if test yes,no = "$avoid_version,$need_version"; then
9009 major=
9010 versuffix=
9011 verstring=
9012 fi
9013
9014 # Check to see if the archive will have undefined symbols.
9015 if test yes = "$allow_undefined"; then
9016 if test unsupported = "$allow_undefined_flag"; then
9017 if test yes = "$build_old_libs"; then
9018 func_warning "undefined symbols not allowed in $host shared libraries; building static only"
9019 build_libtool_libs=no
9020 else
9021 func_fatal_error "can't build $host shared library unless -no-undefined is specified"
9022 fi
9023 fi
9024 else
9025 # Don't allow undefined symbols.
9026 allow_undefined_flag=$no_undefined_flag
9027 fi
9028
9029 fi
9030
9031 func_generate_dlsyms "$libname" "$libname" :
9032 func_append libobjs " $symfileobj"
9033 test " " = "$libobjs" && libobjs=
9034
9035 if test relink != "$opt_mode"; then
9036 # Remove our outputs, but don't remove object files since they
9037 # may have been created when compiling PIC objects.
9038 removelist=
9039 tempremovelist=`$ECHO "$output_objdir/*"`
9040 for p in $tempremovelist; do
9041 case $p in
9042 *.$objext | *.gcno)
9043 ;;
9044 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
9045 if test -n "$precious_files_regex"; then
9046 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
9047 then
9048 continue
9049 fi
9050 fi
9051 func_append removelist " $p"
9052 ;;
9053 *) ;;
9054 esac
9055 done
9056 test -n "$removelist" && \
9057 func_show_eval "${RM}r \$removelist"
9058 fi
9059
9060 # Now set the variables for building old libraries.
9061 if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
9062 func_append oldlibs " $output_objdir/$libname.$libext"
9063
9064 # Transform .lo files to .o files.
9065 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
9066 fi
9067
9068 # Eliminate all temporary directories.
9069 #for path in $notinst_path; do
9070 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
9071 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
9072 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
9073 #done
9074
9075 if test -n "$xrpath"; then
9076 # If the user specified any rpath flags, then add them.
9077 temp_xrpath=
9078 for libdir in $xrpath; do
9079 func_replace_sysroot "$libdir"
9080 func_append temp_xrpath " -R$func_replace_sysroot_result"
9081 case "$finalize_rpath " in
9082 *" $libdir "*) ;;
9083 *) func_append finalize_rpath " $libdir" ;;
9084 esac
9085 done
9086 if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
9087 dependency_libs="$temp_xrpath $dependency_libs"
9088 fi
9089 fi
9090
9091 # Make sure dlfiles contains only unique files that won't be dlpreopened
9092 old_dlfiles=$dlfiles
9093 dlfiles=
9094 for lib in $old_dlfiles; do
9095 case " $dlprefiles $dlfiles " in
9096 *" $lib "*) ;;
9097 *) func_append dlfiles " $lib" ;;
9098 esac
9099 done
9100
9101 # Make sure dlprefiles contains only unique files
9102 old_dlprefiles=$dlprefiles
9103 dlprefiles=
9104 for lib in $old_dlprefiles; do
9105 case "$dlprefiles " in
9106 *" $lib "*) ;;
9107 *) func_append dlprefiles " $lib" ;;
9108 esac
9109 done
9110
9111 if test yes = "$build_libtool_libs"; then
9112 if test -n "$rpath"; then
9113 case $host in
9114 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
9115 # these systems don't actually have a c library (as such)!
9116 ;;
9117 *-*-rhapsody* | *-*-darwin1.[012])
9118 # Rhapsody C library is in the System framework
9119 func_append deplibs " System.ltframework"
9120 ;;
9121 *-*-netbsd*)
9122 # Don't link with libc until the a.out ld.so is fixed.
9123 ;;
9124 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
9125 # Do not include libc due to us having libc/libc_r.
9126 ;;
9127 *-*-sco3.2v5* | *-*-sco5v6*)
9128 # Causes problems with __ctype
9129 ;;
9130 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
9131 # Compiler inserts libc in the correct place for threads to work
9132 ;;
9133 *)
9134 # Add libc to deplibs on all other systems if necessary.
9135 if test yes = "$build_libtool_need_lc"; then
9136 func_append deplibs " -lc"
9137 fi
9138 ;;
9139 esac
9140 fi
9141
9142 # Transform deplibs into only deplibs that can be linked in shared.
9143 name_save=$name
9144 libname_save=$libname
9145 release_save=$release
9146 versuffix_save=$versuffix
9147 major_save=$major
9148 # I'm not sure if I'm treating the release correctly. I think
9149 # release should show up in the -l (ie -lgmp5) so we don't want to
9150 # add it in twice. Is that correct?
9151 release=
9152 versuffix=
9153 major=
9154 newdeplibs=
9155 droppeddeps=no
9156 case $deplibs_check_method in
9157 pass_all)
9158 # Don't check for shared/static. Everything works.
9159 # This might be a little naive. We might want to check
9160 # whether the library exists or not. But this is on
9161 # osf3 & osf4 and I'm not really sure... Just
9162 # implementing what was already the behavior.
9163 newdeplibs=$deplibs
9164 ;;
9165 test_compile)
9166 # This code stresses the "libraries are programs" paradigm to its
9167 # limits. Maybe even breaks it. We compile a program, linking it
9168 # against the deplibs as a proxy for the library. Then we can check
9169 # whether they linked in statically or dynamically with ldd.
9170 $opt_dry_run || $RM conftest.c
9171 cat > conftest.c <<EOF
9172 int main() { return 0; }
9173 EOF
9174 $opt_dry_run || $RM conftest
9175 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
9176 ldd_output=`ldd conftest`
9177 for i in $deplibs; do
9178 case $i in
9179 -l*)
9180 func_stripname -l '' "$i"
9181 name=$func_stripname_result
9182 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9183 case " $predeps $postdeps " in
9184 *" $i "*)
9185 func_append newdeplibs " $i"
9186 i=
9187 ;;
9188 esac
9189 fi
9190 if test -n "$i"; then
9191 libname=`eval "\\$ECHO \"$libname_spec\""`
9192 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9193 set dummy $deplib_matches; shift
9194 deplib_match=$1
9195 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9196 func_append newdeplibs " $i"
9197 else
9198 droppeddeps=yes
9199 echo
9200 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9201 echo "*** I have the capability to make that library automatically link in when"
9202 echo "*** you link to this library. But I can only do this if you have a"
9203 echo "*** shared version of the library, which I believe you do not have"
9204 echo "*** because a test_compile did reveal that the linker did not use it for"
9205 echo "*** its dynamic dependency list that programs get resolved with at runtime."
9206 fi
9207 fi
9208 ;;
9209 *)
9210 func_append newdeplibs " $i"
9211 ;;
9212 esac
9213 done
9214 else
9215 # Error occurred in the first compile. Let's try to salvage
9216 # the situation: Compile a separate program for each library.
9217 for i in $deplibs; do
9218 case $i in
9219 -l*)
9220 func_stripname -l '' "$i"
9221 name=$func_stripname_result
9222 $opt_dry_run || $RM conftest
9223 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
9224 ldd_output=`ldd conftest`
9225 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9226 case " $predeps $postdeps " in
9227 *" $i "*)
9228 func_append newdeplibs " $i"
9229 i=
9230 ;;
9231 esac
9232 fi
9233 if test -n "$i"; then
9234 libname=`eval "\\$ECHO \"$libname_spec\""`
9235 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9236 set dummy $deplib_matches; shift
9237 deplib_match=$1
9238 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9239 func_append newdeplibs " $i"
9240 else
9241 droppeddeps=yes
9242 echo
9243 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9244 echo "*** I have the capability to make that library automatically link in when"
9245 echo "*** you link to this library. But I can only do this if you have a"
9246 echo "*** shared version of the library, which you do not appear to have"
9247 echo "*** because a test_compile did reveal that the linker did not use this one"
9248 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
9249 fi
9250 fi
9251 else
9252 droppeddeps=yes
9253 echo
9254 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
9255 echo "*** make it link in! You will probably need to install it or some"
9256 echo "*** library that it depends on before this library will be fully"
9257 echo "*** functional. Installing it before continuing would be even better."
9258 fi
9259 ;;
9260 *)
9261 func_append newdeplibs " $i"
9262 ;;
9263 esac
9264 done
9265 fi
9266 ;;
9267 file_magic*)
9268 set dummy $deplibs_check_method; shift
9269 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9270 for a_deplib in $deplibs; do
9271 case $a_deplib in
9272 -l*)
9273 func_stripname -l '' "$a_deplib"
9274 name=$func_stripname_result
9275 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9276 case " $predeps $postdeps " in
9277 *" $a_deplib "*)
9278 func_append newdeplibs " $a_deplib"
9279 a_deplib=
9280 ;;
9281 esac
9282 fi
9283 if test -n "$a_deplib"; then
9284 libname=`eval "\\$ECHO \"$libname_spec\""`
9285 if test -n "$file_magic_glob"; then
9286 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
9287 else
9288 libnameglob=$libname
9289 fi
9290 test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
9291 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9292 if test yes = "$want_nocaseglob"; then
9293 shopt -s nocaseglob
9294 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9295 $nocaseglob
9296 else
9297 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9298 fi
9299 for potent_lib in $potential_libs; do
9300 # Follow soft links.
9301 if ls -lLd "$potent_lib" 2>/dev/null |
9302 $GREP " -> " >/dev/null; then
9303 continue
9304 fi
9305 # The statement above tries to avoid entering an
9306 # endless loop below, in case of cyclic links.
9307 # We might still enter an endless loop, since a link
9308 # loop can be closed while we follow links,
9309 # but so what?
9310 potlib=$potent_lib
9311 while test -h "$potlib" 2>/dev/null; do
9312 potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
9313 case $potliblink in
9314 [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
9315 *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
9316 esac
9317 done
9318 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
9319 $SED -e 10q |
9320 $EGREP "$file_magic_regex" > /dev/null; then
9321 func_append newdeplibs " $a_deplib"
9322 a_deplib=
9323 break 2
9324 fi
9325 done
9326 done
9327 fi
9328 if test -n "$a_deplib"; then
9329 droppeddeps=yes
9330 echo
9331 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9332 echo "*** I have the capability to make that library automatically link in when"
9333 echo "*** you link to this library. But I can only do this if you have a"
9334 echo "*** shared version of the library, which you do not appear to have"
9335 echo "*** because I did check the linker path looking for a file starting"
9336 if test -z "$potlib"; then
9337 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
9338 else
9339 $ECHO "*** with $libname and none of the candidates passed a file format test"
9340 $ECHO "*** using a file magic. Last file checked: $potlib"
9341 fi
9342 fi
9343 ;;
9344 *)
9345 # Add a -L argument.
9346 func_append newdeplibs " $a_deplib"
9347 ;;
9348 esac
9349 done # Gone through all deplibs.
9350 ;;
9351 match_pattern*)
9352 set dummy $deplibs_check_method; shift
9353 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9354 for a_deplib in $deplibs; do
9355 case $a_deplib in
9356 -l*)
9357 func_stripname -l '' "$a_deplib"
9358 name=$func_stripname_result
9359 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9360 case " $predeps $postdeps " in
9361 *" $a_deplib "*)
9362 func_append newdeplibs " $a_deplib"
9363 a_deplib=
9364 ;;
9365 esac
9366 fi
9367 if test -n "$a_deplib"; then
9368 libname=`eval "\\$ECHO \"$libname_spec\""`
9369 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9370 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9371 for potent_lib in $potential_libs; do
9372 potlib=$potent_lib # see symlink-check above in file_magic test
9373 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
9374 $EGREP "$match_pattern_regex" > /dev/null; then
9375 func_append newdeplibs " $a_deplib"
9376 a_deplib=
9377 break 2
9378 fi
9379 done
9380 done
9381 fi
9382 if test -n "$a_deplib"; then
9383 droppeddeps=yes
9384 echo
9385 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9386 echo "*** I have the capability to make that library automatically link in when"
9387 echo "*** you link to this library. But I can only do this if you have a"
9388 echo "*** shared version of the library, which you do not appear to have"
9389 echo "*** because I did check the linker path looking for a file starting"
9390 if test -z "$potlib"; then
9391 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
9392 else
9393 $ECHO "*** with $libname and none of the candidates passed a file format test"
9394 $ECHO "*** using a regex pattern. Last file checked: $potlib"
9395 fi
9396 fi
9397 ;;
9398 *)
9399 # Add a -L argument.
9400 func_append newdeplibs " $a_deplib"
9401 ;;
9402 esac
9403 done # Gone through all deplibs.
9404 ;;
9405 none | unknown | *)
9406 newdeplibs=
9407 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9408 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9409 for i in $predeps $postdeps; do
9410 # can't use Xsed below, because $i might contain '/'
9411 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
9412 done
9413 fi
9414 case $tmp_deplibs in
9415 *[!\ \ ]*)
9416 echo
9417 if test none = "$deplibs_check_method"; then
9418 echo "*** Warning: inter-library dependencies are not supported in this platform."
9419 else
9420 echo "*** Warning: inter-library dependencies are not known to be supported."
9421 fi
9422 echo "*** All declared inter-library dependencies are being dropped."
9423 droppeddeps=yes
9424 ;;
9425 esac
9426 ;;
9427 esac
9428 versuffix=$versuffix_save
9429 major=$major_save
9430 release=$release_save
9431 libname=$libname_save
9432 name=$name_save
9433
9434 case $host in
9435 *-*-rhapsody* | *-*-darwin1.[012])
9436 # On Rhapsody replace the C library with the System framework
9437 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
9438 ;;
9439 esac
9440
9441 if test yes = "$droppeddeps"; then
9442 if test yes = "$module"; then
9443 echo
9444 echo "*** Warning: libtool could not satisfy all declared inter-library"
9445 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
9446 echo "*** a static module, that should work as long as the dlopening"
9447 echo "*** application is linked with the -dlopen flag."
9448 if test -z "$global_symbol_pipe"; then
9449 echo
9450 echo "*** However, this would only work if libtool was able to extract symbol"
9451 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
9452 echo "*** not find such a program. So, this module is probably useless."
9453 echo "*** 'nm' from GNU binutils and a full rebuild may help."
9454 fi
9455 if test no = "$build_old_libs"; then
9456 oldlibs=$output_objdir/$libname.$libext
9457 build_libtool_libs=module
9458 build_old_libs=yes
9459 else
9460 build_libtool_libs=no
9461 fi
9462 else
9463 echo "*** The inter-library dependencies that have been dropped here will be"
9464 echo "*** automatically added whenever a program is linked with this library"
9465 echo "*** or is declared to -dlopen it."
9466
9467 if test no = "$allow_undefined"; then
9468 echo
9469 echo "*** Since this library must not contain undefined symbols,"
9470 echo "*** because either the platform does not support them or"
9471 echo "*** it was explicitly requested with -no-undefined,"
9472 echo "*** libtool will only create a static version of it."
9473 if test no = "$build_old_libs"; then
9474 oldlibs=$output_objdir/$libname.$libext
9475 build_libtool_libs=module
9476 build_old_libs=yes
9477 else
9478 build_libtool_libs=no
9479 fi
9480 fi
9481 fi
9482 fi
9483 # Done checking deplibs!
9484 deplibs=$newdeplibs
9485 fi
9486 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9487 case $host in
9488 *-*-darwin*)
9489 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9490 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9491 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9492 ;;
9493 esac
9494
9495 # move library search paths that coincide with paths to not yet
9496 # installed libraries to the beginning of the library search list
9497 new_libs=
9498 for path in $notinst_path; do
9499 case " $new_libs " in
9500 *" -L$path/$objdir "*) ;;
9501 *)
9502 case " $deplibs " in
9503 *" -L$path/$objdir "*)
9504 func_append new_libs " -L$path/$objdir" ;;
9505 esac
9506 ;;
9507 esac
9508 done
9509 for deplib in $deplibs; do
9510 case $deplib in
9511 -L*)
9512 case " $new_libs " in
9513 *" $deplib "*) ;;
9514 *) func_append new_libs " $deplib" ;;
9515 esac
9516 ;;
9517 *) func_append new_libs " $deplib" ;;
9518 esac
9519 done
9520 deplibs=$new_libs
9521
9522 # All the library-specific variables (install_libdir is set above).
9523 library_names=
9524 old_library=
9525 dlname=
9526
9527 # Test again, we may have decided not to build it any more
9528 if test yes = "$build_libtool_libs"; then
9529 # Remove $wl instances when linking with ld.
9530 # FIXME: should test the right _cmds variable.
9531 case $archive_cmds in
9532 *\$LD\ *) wl= ;;
9533 esac
9534 if test yes = "$hardcode_into_libs"; then
9535 # Hardcode the library paths
9536 hardcode_libdirs=
9537 dep_rpath=
9538 rpath=$finalize_rpath
9539 test relink = "$opt_mode" || rpath=$compile_rpath$rpath
9540 for libdir in $rpath; do
9541 if test -n "$hardcode_libdir_flag_spec"; then
9542 if test -n "$hardcode_libdir_separator"; then
9543 func_replace_sysroot "$libdir"
9544 libdir=$func_replace_sysroot_result
9545 if test -z "$hardcode_libdirs"; then
9546 hardcode_libdirs=$libdir
9547 else
9548 # Just accumulate the unique libdirs.
9549 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9550 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9551 ;;
9552 *)
9553 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9554 ;;
9555 esac
9556 fi
9557 else
9558 eval flag=\"$hardcode_libdir_flag_spec\"
9559 func_append dep_rpath " $flag"
9560 fi
9561 elif test -n "$runpath_var"; then
9562 case "$perm_rpath " in
9563 *" $libdir "*) ;;
9564 *) func_append perm_rpath " $libdir" ;;
9565 esac
9566 fi
9567 done
9568 # Substitute the hardcoded libdirs into the rpath.
9569 if test -n "$hardcode_libdir_separator" &&
9570 test -n "$hardcode_libdirs"; then
9571 libdir=$hardcode_libdirs
9572 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
9573 fi
9574 if test -n "$runpath_var" && test -n "$perm_rpath"; then
9575 # We should set the runpath_var.
9576 rpath=
9577 for dir in $perm_rpath; do
9578 func_append rpath "$dir:"
9579 done
9580 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
9581 fi
9582 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
9583 fi
9584
9585 shlibpath=$finalize_shlibpath
9586 test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
9587 if test -n "$shlibpath"; then
9588 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
9589 fi
9590
9591 # Get the real and link names of the library.
9592 eval shared_ext=\"$shrext_cmds\"
9593 eval library_names=\"$library_names_spec\"
9594 set dummy $library_names
9595 shift
9596 realname=$1
9597 shift
9598
9599 if test -n "$soname_spec"; then
9600 eval soname=\"$soname_spec\"
9601 else
9602 soname=$realname
9603 fi
9604 if test -z "$dlname"; then
9605 dlname=$soname
9606 fi
9607
9608 lib=$output_objdir/$realname
9609 linknames=
9610 for link
9611 do
9612 func_append linknames " $link"
9613 done
9614
9615 # Use standard objects if they are pic
9616 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
9617 test "X$libobjs" = "X " && libobjs=
9618
9619 delfiles=
9620 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9621 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
9622 export_symbols=$output_objdir/$libname.uexp
9623 func_append delfiles " $export_symbols"
9624 fi
9625
9626 orig_export_symbols=
9627 case $host_os in
9628 cygwin* | mingw* | cegcc*)
9629 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
9630 # exporting using user supplied symfile
9631 func_dll_def_p "$export_symbols" || {
9632 # and it's NOT already a .def file. Must figure out
9633 # which of the given symbols are data symbols and tag
9634 # them as such. So, trigger use of export_symbols_cmds.
9635 # export_symbols gets reassigned inside the "prepare
9636 # the list of exported symbols" if statement, so the
9637 # include_expsyms logic still works.
9638 orig_export_symbols=$export_symbols
9639 export_symbols=
9640 always_export_symbols=yes
9641 }
9642 fi
9643 ;;
9644 esac
9645
9646 # Prepare the list of exported symbols
9647 if test -z "$export_symbols"; then
9648 if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
9649 func_verbose "generating symbol list for '$libname.la'"
9650 export_symbols=$output_objdir/$libname.exp
9651 $opt_dry_run || $RM $export_symbols
9652 cmds=$export_symbols_cmds
9653 save_ifs=$IFS; IFS='~'
9654 for cmd1 in $cmds; do
9655 IFS=$save_ifs
9656 # Take the normal branch if the nm_file_list_spec branch
9657 # doesn't work or if tool conversion is not needed.
9658 case $nm_file_list_spec~$to_tool_file_cmd in
9659 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
9660 try_normal_branch=yes
9661 eval cmd=\"$cmd1\"
9662 func_len " $cmd"
9663 len=$func_len_result
9664 ;;
9665 *)
9666 try_normal_branch=no
9667 ;;
9668 esac
9669 if test yes = "$try_normal_branch" \
9670 && { test "$len" -lt "$max_cmd_len" \
9671 || test "$max_cmd_len" -le -1; }
9672 then
9673 func_show_eval "$cmd" 'exit $?'
9674 skipped_export=false
9675 elif test -n "$nm_file_list_spec"; then
9676 func_basename "$output"
9677 output_la=$func_basename_result
9678 save_libobjs=$libobjs
9679 save_output=$output
9680 output=$output_objdir/$output_la.nm
9681 func_to_tool_file "$output"
9682 libobjs=$nm_file_list_spec$func_to_tool_file_result
9683 func_append delfiles " $output"
9684 func_verbose "creating $NM input file list: $output"
9685 for obj in $save_libobjs; do
9686 func_to_tool_file "$obj"
9687 $ECHO "$func_to_tool_file_result"
9688 done > "$output"
9689 eval cmd=\"$cmd1\"
9690 func_show_eval "$cmd" 'exit $?'
9691 output=$save_output
9692 libobjs=$save_libobjs
9693 skipped_export=false
9694 else
9695 # The command line is too long to execute in one step.
9696 func_verbose "using reloadable object file for export list..."
9697 skipped_export=:
9698 # Break out early, otherwise skipped_export may be
9699 # set to false by a later but shorter cmd.
9700 break
9701 fi
9702 done
9703 IFS=$save_ifs
9704 if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
9705 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9706 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9707 fi
9708 fi
9709 fi
9710
9711 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9712 tmp_export_symbols=$export_symbols
9713 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
9714 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
9715 fi
9716
9717 if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
9718 # The given exports_symbols file has to be filtered, so filter it.
9719 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
9720 # FIXME: $output_objdir/$libname.filter potentially contains lots of
9721 # 's' commands, which not all seds can handle. GNU sed should be fine
9722 # though. Also, the filter scales superlinearly with the number of
9723 # global variables. join(1) would be nice here, but unfortunately
9724 # isn't a blessed tool.
9725 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
9726 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
9727 export_symbols=$output_objdir/$libname.def
9728 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
9729 fi
9730
9731 tmp_deplibs=
9732 for test_deplib in $deplibs; do
9733 case " $convenience " in
9734 *" $test_deplib "*) ;;
9735 *)
9736 func_append tmp_deplibs " $test_deplib"
9737 ;;
9738 esac
9739 done
9740 deplibs=$tmp_deplibs
9741
9742 if test -n "$convenience"; then
9743 if test -n "$whole_archive_flag_spec" &&
9744 test yes = "$compiler_needs_object" &&
9745 test -z "$libobjs"; then
9746 # extract the archives, so we have objects to list.
9747 # TODO: could optimize this to just extract one archive.
9748 whole_archive_flag_spec=
9749 fi
9750 if test -n "$whole_archive_flag_spec"; then
9751 save_libobjs=$libobjs
9752 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
9753 test "X$libobjs" = "X " && libobjs=
9754 else
9755 gentop=$output_objdir/${outputname}x
9756 func_append generated " $gentop"
9757
9758 func_extract_archives $gentop $convenience
9759 func_append libobjs " $func_extract_archives_result"
9760 test "X$libobjs" = "X " && libobjs=
9761 fi
9762 fi
9763
9764 if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
9765 eval flag=\"$thread_safe_flag_spec\"
9766 func_append linker_flags " $flag"
9767 fi
9768
9769 # Make a backup of the uninstalled library when relinking
9770 if test relink = "$opt_mode"; then
9771 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
9772 fi
9773
9774 # Do each of the archive commands.
9775 if test yes = "$module" && test -n "$module_cmds"; then
9776 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9777 eval test_cmds=\"$module_expsym_cmds\"
9778 cmds=$module_expsym_cmds
9779 else
9780 eval test_cmds=\"$module_cmds\"
9781 cmds=$module_cmds
9782 fi
9783 else
9784 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
9785 eval test_cmds=\"$archive_expsym_cmds\"
9786 cmds=$archive_expsym_cmds
9787 else
9788 eval test_cmds=\"$archive_cmds\"
9789 cmds=$archive_cmds
9790 fi
9791 fi
9792
9793 if test : != "$skipped_export" &&
9794 func_len " $test_cmds" &&
9795 len=$func_len_result &&
9796 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9797 :
9798 else
9799 # The command line is too long to link in one step, link piecewise
9800 # or, if using GNU ld and skipped_export is not :, use a linker
9801 # script.
9802
9803 # Save the value of $output and $libobjs because we want to
9804 # use them later. If we have whole_archive_flag_spec, we
9805 # want to use save_libobjs as it was before
9806 # whole_archive_flag_spec was expanded, because we can't
9807 # assume the linker understands whole_archive_flag_spec.
9808 # This may have to be revisited, in case too many
9809 # convenience libraries get linked in and end up exceeding
9810 # the spec.
9811 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
9812 save_libobjs=$libobjs
9813 fi
9814 save_output=$output
9815 func_basename "$output"
9816 output_la=$func_basename_result
9817
9818 # Clear the reloadable object creation command queue and
9819 # initialize k to one.
9820 test_cmds=
9821 concat_cmds=
9822 objlist=
9823 last_robj=
9824 k=1
9825
9826 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
9827 output=$output_objdir/$output_la.lnkscript
9828 func_verbose "creating GNU ld script: $output"
9829 echo 'INPUT (' > $output
9830 for obj in $save_libobjs
9831 do
9832 func_to_tool_file "$obj"
9833 $ECHO "$func_to_tool_file_result" >> $output
9834 done
9835 echo ')' >> $output
9836 func_append delfiles " $output"
9837 func_to_tool_file "$output"
9838 output=$func_to_tool_file_result
9839 elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
9840 output=$output_objdir/$output_la.lnk
9841 func_verbose "creating linker input file list: $output"
9842 : > $output
9843 set x $save_libobjs
9844 shift
9845 firstobj=
9846 if test yes = "$compiler_needs_object"; then
9847 firstobj="$1 "
9848 shift
9849 fi
9850 for obj
9851 do
9852 func_to_tool_file "$obj"
9853 $ECHO "$func_to_tool_file_result" >> $output
9854 done
9855 func_append delfiles " $output"
9856 func_to_tool_file "$output"
9857 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
9858 else
9859 if test -n "$save_libobjs"; then
9860 func_verbose "creating reloadable object files..."
9861 output=$output_objdir/$output_la-$k.$objext
9862 eval test_cmds=\"$reload_cmds\"
9863 func_len " $test_cmds"
9864 len0=$func_len_result
9865 len=$len0
9866
9867 # Loop over the list of objects to be linked.
9868 for obj in $save_libobjs
9869 do
9870 func_len " $obj"
9871 func_arith $len + $func_len_result
9872 len=$func_arith_result
9873 if test -z "$objlist" ||
9874 test "$len" -lt "$max_cmd_len"; then
9875 func_append objlist " $obj"
9876 else
9877 # The command $test_cmds is almost too long, add a
9878 # command to the queue.
9879 if test 1 -eq "$k"; then
9880 # The first file doesn't have a previous command to add.
9881 reload_objs=$objlist
9882 eval concat_cmds=\"$reload_cmds\"
9883 else
9884 # All subsequent reloadable object files will link in
9885 # the last one created.
9886 reload_objs="$objlist $last_robj"
9887 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
9888 fi
9889 last_robj=$output_objdir/$output_la-$k.$objext
9890 func_arith $k + 1
9891 k=$func_arith_result
9892 output=$output_objdir/$output_la-$k.$objext
9893 objlist=" $obj"
9894 func_len " $last_robj"
9895 func_arith $len0 + $func_len_result
9896 len=$func_arith_result
9897 fi
9898 done
9899 # Handle the remaining objects by creating one last
9900 # reloadable object file. All subsequent reloadable object
9901 # files will link in the last one created.
9902 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9903 reload_objs="$objlist $last_robj"
9904 eval concat_cmds=\"\$concat_cmds$reload_cmds\"
9905 if test -n "$last_robj"; then
9906 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
9907 fi
9908 func_append delfiles " $output"
9909
9910 else
9911 output=
9912 fi
9913
9914 ${skipped_export-false} && {
9915 func_verbose "generating symbol list for '$libname.la'"
9916 export_symbols=$output_objdir/$libname.exp
9917 $opt_dry_run || $RM $export_symbols
9918 libobjs=$output
9919 # Append the command to create the export file.
9920 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9921 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
9922 if test -n "$last_robj"; then
9923 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
9924 fi
9925 }
9926
9927 test -n "$save_libobjs" &&
9928 func_verbose "creating a temporary reloadable object file: $output"
9929
9930 # Loop through the commands generated above and execute them.
9931 save_ifs=$IFS; IFS='~'
9932 for cmd in $concat_cmds; do
9933 IFS=$save_ifs
9934 $opt_quiet || {
9935 func_quote_for_expand "$cmd"
9936 eval "func_echo $func_quote_for_expand_result"
9937 }
9938 $opt_dry_run || eval "$cmd" || {
9939 lt_exit=$?
9940
9941 # Restore the uninstalled library and exit
9942 if test relink = "$opt_mode"; then
9943 ( cd "$output_objdir" && \
9944 $RM "${realname}T" && \
9945 $MV "${realname}U" "$realname" )
9946 fi
9947
9948 exit $lt_exit
9949 }
9950 done
9951 IFS=$save_ifs
9952
9953 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
9954 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9955 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9956 fi
9957 fi
9958
9959 ${skipped_export-false} && {
9960 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9961 tmp_export_symbols=$export_symbols
9962 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
9963 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
9964 fi
9965
9966 if test -n "$orig_export_symbols"; then
9967 # The given exports_symbols file has to be filtered, so filter it.
9968 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
9969 # FIXME: $output_objdir/$libname.filter potentially contains lots of
9970 # 's' commands, which not all seds can handle. GNU sed should be fine
9971 # though. Also, the filter scales superlinearly with the number of
9972 # global variables. join(1) would be nice here, but unfortunately
9973 # isn't a blessed tool.
9974 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
9975 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
9976 export_symbols=$output_objdir/$libname.def
9977 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
9978 fi
9979 }
9980
9981 libobjs=$output
9982 # Restore the value of output.
9983 output=$save_output
9984
9985 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
9986 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
9987 test "X$libobjs" = "X " && libobjs=
9988 fi
9989 # Expand the library linking commands again to reset the
9990 # value of $libobjs for piecewise linking.
9991
9992 # Do each of the archive commands.
9993 if test yes = "$module" && test -n "$module_cmds"; then
9994 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9995 cmds=$module_expsym_cmds
9996 else
9997 cmds=$module_cmds
9998 fi
9999 else
10000 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10001 cmds=$archive_expsym_cmds
10002 else
10003 cmds=$archive_cmds
10004 fi
10005 fi
10006 fi
10007
10008 if test -n "$delfiles"; then
10009 # Append the command to remove temporary files to $cmds.
10010 eval cmds=\"\$cmds~\$RM $delfiles\"
10011 fi
10012
10013 # Add any objects from preloaded convenience libraries
10014 if test -n "$dlprefiles"; then
10015 gentop=$output_objdir/${outputname}x
10016 func_append generated " $gentop"
10017
10018 func_extract_archives $gentop $dlprefiles
10019 func_append libobjs " $func_extract_archives_result"
10020 test "X$libobjs" = "X " && libobjs=
10021 fi
10022
10023 save_ifs=$IFS; IFS='~'
10024 for cmd in $cmds; do
10025 IFS=$sp$nl
10026 eval cmd=\"$cmd\"
10027 IFS=$save_ifs
10028 $opt_quiet || {
10029 func_quote_for_expand "$cmd"
10030 eval "func_echo $func_quote_for_expand_result"
10031 }
10032 $opt_dry_run || eval "$cmd" || {
10033 lt_exit=$?
10034
10035 # Restore the uninstalled library and exit
10036 if test relink = "$opt_mode"; then
10037 ( cd "$output_objdir" && \
10038 $RM "${realname}T" && \
10039 $MV "${realname}U" "$realname" )
10040 fi
10041
10042 exit $lt_exit
10043 }
10044 done
10045 IFS=$save_ifs
10046
10047 # Restore the uninstalled library and exit
10048 if test relink = "$opt_mode"; then
10049 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
10050
10051 if test -n "$convenience"; then
10052 if test -z "$whole_archive_flag_spec"; then
10053 func_show_eval '${RM}r "$gentop"'
10054 fi
10055 fi
10056
10057 exit $EXIT_SUCCESS
10058 fi
10059
10060 # Create links to the real library.
10061 for linkname in $linknames; do
10062 if test "$realname" != "$linkname"; then
10063 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
10064 fi
10065 done
10066
10067 # If -module or -export-dynamic was specified, set the dlname.
10068 if test yes = "$module" || test yes = "$export_dynamic"; then
10069 # On all known operating systems, these are identical.
10070 dlname=$soname
10071 fi
10072 fi
10073 ;;
10074
10075 obj)
10076 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
10077 func_warning "'-dlopen' is ignored for objects"
10078 fi
10079
10080 case " $deplibs" in
10081 *\ -l* | *\ -L*)
10082 func_warning "'-l' and '-L' are ignored for objects" ;;
10083 esac
10084
10085 test -n "$rpath" && \
10086 func_warning "'-rpath' is ignored for objects"
10087
10088 test -n "$xrpath" && \
10089 func_warning "'-R' is ignored for objects"
10090
10091 test -n "$vinfo" && \
10092 func_warning "'-version-info' is ignored for objects"
10093
10094 test -n "$release" && \
10095 func_warning "'-release' is ignored for objects"
10096
10097 case $output in
10098 *.lo)
10099 test -n "$objs$old_deplibs" && \
10100 func_fatal_error "cannot build library object '$output' from non-libtool objects"
10101
10102 libobj=$output
10103 func_lo2o "$libobj"
10104 obj=$func_lo2o_result
10105 ;;
10106 *)
10107 libobj=
10108 obj=$output
10109 ;;
10110 esac
10111
10112 # Delete the old objects.
10113 $opt_dry_run || $RM $obj $libobj
10114
10115 # Objects from convenience libraries. This assumes
10116 # single-version convenience libraries. Whenever we create
10117 # different ones for PIC/non-PIC, this we'll have to duplicate
10118 # the extraction.
10119 reload_conv_objs=
10120 gentop=
10121 # if reload_cmds runs $LD directly, get rid of -Wl from
10122 # whole_archive_flag_spec and hope we can get by with turning comma
10123 # into space.
10124 case $reload_cmds in
10125 *\$LD[\ \$]*) wl= ;;
10126 esac
10127 if test -n "$convenience"; then
10128 if test -n "$whole_archive_flag_spec"; then
10129 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10130 test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10131 reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
10132 else
10133 gentop=$output_objdir/${obj}x
10134 func_append generated " $gentop"
10135
10136 func_extract_archives $gentop $convenience
10137 reload_conv_objs="$reload_objs $func_extract_archives_result"
10138 fi
10139 fi
10140
10141 # If we're not building shared, we need to use non_pic_objs
10142 test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
10143
10144 # Create the old-style object.
10145 reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
10146
10147 output=$obj
10148 func_execute_cmds "$reload_cmds" 'exit $?'
10149
10150 # Exit if we aren't doing a library object file.
10151 if test -z "$libobj"; then
10152 if test -n "$gentop"; then
10153 func_show_eval '${RM}r "$gentop"'
10154 fi
10155
10156 exit $EXIT_SUCCESS
10157 fi
10158
10159 test yes = "$build_libtool_libs" || {
10160 if test -n "$gentop"; then
10161 func_show_eval '${RM}r "$gentop"'
10162 fi
10163
10164 # Create an invalid libtool object if no PIC, so that we don't
10165 # accidentally link it into a program.
10166 # $show "echo timestamp > $libobj"
10167 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
10168 exit $EXIT_SUCCESS
10169 }
10170
10171 if test -n "$pic_flag" || test default != "$pic_mode"; then
10172 # Only do commands if we really have different PIC objects.
10173 reload_objs="$libobjs $reload_conv_objs"
10174 output=$libobj
10175 func_execute_cmds "$reload_cmds" 'exit $?'
10176 fi
10177
10178 if test -n "$gentop"; then
10179 func_show_eval '${RM}r "$gentop"'
10180 fi
10181
10182 exit $EXIT_SUCCESS
10183 ;;
10184
10185 prog)
10186 case $host in
10187 *cygwin*) func_stripname '' '.exe' "$output"
10188 output=$func_stripname_result.exe;;
10189 esac
10190 test -n "$vinfo" && \
10191 func_warning "'-version-info' is ignored for programs"
10192
10193 test -n "$release" && \
10194 func_warning "'-release' is ignored for programs"
10195
10196 $preload \
10197 && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
10198 && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
10199
10200 case $host in
10201 *-*-rhapsody* | *-*-darwin1.[012])
10202 # On Rhapsody replace the C library is the System framework
10203 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
10204 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
10205 ;;
10206 esac
10207
10208 case $host in
10209 *-*-darwin*)
10210 # Don't allow lazy linking, it breaks C++ global constructors
10211 # But is supposedly fixed on 10.4 or later (yay!).
10212 if test CXX = "$tagname"; then
10213 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10214 10.[0123])
10215 func_append compile_command " $wl-bind_at_load"
10216 func_append finalize_command " $wl-bind_at_load"
10217 ;;
10218 esac
10219 fi
10220 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
10221 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10222 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10223 ;;
10224 esac
10225
10226
10227 # move library search paths that coincide with paths to not yet
10228 # installed libraries to the beginning of the library search list
10229 new_libs=
10230 for path in $notinst_path; do
10231 case " $new_libs " in
10232 *" -L$path/$objdir "*) ;;
10233 *)
10234 case " $compile_deplibs " in
10235 *" -L$path/$objdir "*)
10236 func_append new_libs " -L$path/$objdir" ;;
10237 esac
10238 ;;
10239 esac
10240 done
10241 for deplib in $compile_deplibs; do
10242 case $deplib in
10243 -L*)
10244 case " $new_libs " in
10245 *" $deplib "*) ;;
10246 *) func_append new_libs " $deplib" ;;
10247 esac
10248 ;;
10249 *) func_append new_libs " $deplib" ;;
10250 esac
10251 done
10252 compile_deplibs=$new_libs
10253
10254
10255 func_append compile_command " $compile_deplibs"
10256 func_append finalize_command " $finalize_deplibs"
10257
10258 if test -n "$rpath$xrpath"; then
10259 # If the user specified any rpath flags, then add them.
10260 for libdir in $rpath $xrpath; do
10261 # This is the magic to use -rpath.
10262 case "$finalize_rpath " in
10263 *" $libdir "*) ;;
10264 *) func_append finalize_rpath " $libdir" ;;
10265 esac
10266 done
10267 fi
10268
10269 # Now hardcode the library paths
10270 rpath=
10271 hardcode_libdirs=
10272 for libdir in $compile_rpath $finalize_rpath; do
10273 if test -n "$hardcode_libdir_flag_spec"; then
10274 if test -n "$hardcode_libdir_separator"; then
10275 if test -z "$hardcode_libdirs"; then
10276 hardcode_libdirs=$libdir
10277 else
10278 # Just accumulate the unique libdirs.
10279 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10280 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10281 ;;
10282 *)
10283 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10284 ;;
10285 esac
10286 fi
10287 else
10288 eval flag=\"$hardcode_libdir_flag_spec\"
10289 func_append rpath " $flag"
10290 fi
10291 elif test -n "$runpath_var"; then
10292 case "$perm_rpath " in
10293 *" $libdir "*) ;;
10294 *) func_append perm_rpath " $libdir" ;;
10295 esac
10296 fi
10297 case $host in
10298 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10299 testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
10300 case :$dllsearchpath: in
10301 *":$libdir:"*) ;;
10302 ::) dllsearchpath=$libdir;;
10303 *) func_append dllsearchpath ":$libdir";;
10304 esac
10305 case :$dllsearchpath: in
10306 *":$testbindir:"*) ;;
10307 ::) dllsearchpath=$testbindir;;
10308 *) func_append dllsearchpath ":$testbindir";;
10309 esac
10310 ;;
10311 esac
10312 done
10313 # Substitute the hardcoded libdirs into the rpath.
10314 if test -n "$hardcode_libdir_separator" &&
10315 test -n "$hardcode_libdirs"; then
10316 libdir=$hardcode_libdirs
10317 eval rpath=\" $hardcode_libdir_flag_spec\"
10318 fi
10319 compile_rpath=$rpath
10320
10321 rpath=
10322 hardcode_libdirs=
10323 for libdir in $finalize_rpath; do
10324 if test -n "$hardcode_libdir_flag_spec"; then
10325 if test -n "$hardcode_libdir_separator"; then
10326 if test -z "$hardcode_libdirs"; then
10327 hardcode_libdirs=$libdir
10328 else
10329 # Just accumulate the unique libdirs.
10330 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10331 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10332 ;;
10333 *)
10334 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10335 ;;
10336 esac
10337 fi
10338 else
10339 eval flag=\"$hardcode_libdir_flag_spec\"
10340 func_append rpath " $flag"
10341 fi
10342 elif test -n "$runpath_var"; then
10343 case "$finalize_perm_rpath " in
10344 *" $libdir "*) ;;
10345 *) func_append finalize_perm_rpath " $libdir" ;;
10346 esac
10347 fi
10348 done
10349 # Substitute the hardcoded libdirs into the rpath.
10350 if test -n "$hardcode_libdir_separator" &&
10351 test -n "$hardcode_libdirs"; then
10352 libdir=$hardcode_libdirs
10353 eval rpath=\" $hardcode_libdir_flag_spec\"
10354 fi
10355 finalize_rpath=$rpath
10356
10357 if test -n "$libobjs" && test yes = "$build_old_libs"; then
10358 # Transform all the library objects into standard objects.
10359 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10360 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10361 fi
10362
10363 func_generate_dlsyms "$outputname" "@PROGRAM@" false
10364
10365 # template prelinking step
10366 if test -n "$prelink_cmds"; then
10367 func_execute_cmds "$prelink_cmds" 'exit $?'
10368 fi
10369
10370 wrappers_required=:
10371 case $host in
10372 *cegcc* | *mingw32ce*)
10373 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10374 wrappers_required=false
10375 ;;
10376 *cygwin* | *mingw* )
10377 test yes = "$build_libtool_libs" || wrappers_required=false
10378 ;;
10379 *)
10380 if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
10381 wrappers_required=false
10382 fi
10383 ;;
10384 esac
10385 $wrappers_required || {
10386 # Replace the output file specification.
10387 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10388 link_command=$compile_command$compile_rpath
10389
10390 # We have no uninstalled library dependencies, so finalize right now.
10391 exit_status=0
10392 func_show_eval "$link_command" 'exit_status=$?'
10393
10394 if test -n "$postlink_cmds"; then
10395 func_to_tool_file "$output"
10396 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10397 func_execute_cmds "$postlink_cmds" 'exit $?'
10398 fi
10399
10400 # Delete the generated files.
10401 if test -f "$output_objdir/${outputname}S.$objext"; then
10402 func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
10403 fi
10404
10405 exit $exit_status
10406 }
10407
10408 if test -n "$compile_shlibpath$finalize_shlibpath"; then
10409 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
10410 fi
10411 if test -n "$finalize_shlibpath"; then
10412 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
10413 fi
10414
10415 compile_var=
10416 finalize_var=
10417 if test -n "$runpath_var"; then
10418 if test -n "$perm_rpath"; then
10419 # We should set the runpath_var.
10420 rpath=
10421 for dir in $perm_rpath; do
10422 func_append rpath "$dir:"
10423 done
10424 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
10425 fi
10426 if test -n "$finalize_perm_rpath"; then
10427 # We should set the runpath_var.
10428 rpath=
10429 for dir in $finalize_perm_rpath; do
10430 func_append rpath "$dir:"
10431 done
10432 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
10433 fi
10434 fi
10435
10436 if test yes = "$no_install"; then
10437 # We don't need to create a wrapper script.
10438 link_command=$compile_var$compile_command$compile_rpath
10439 # Replace the output file specification.
10440 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10441 # Delete the old output file.
10442 $opt_dry_run || $RM $output
10443 # Link the executable and exit
10444 func_show_eval "$link_command" 'exit $?'
10445
10446 if test -n "$postlink_cmds"; then
10447 func_to_tool_file "$output"
10448 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10449 func_execute_cmds "$postlink_cmds" 'exit $?'
10450 fi
10451
10452 exit $EXIT_SUCCESS
10453 fi
10454
10455 case $hardcode_action,$fast_install in
10456 relink,*)
10457 # Fast installation is not supported
10458 link_command=$compile_var$compile_command$compile_rpath
10459 relink_command=$finalize_var$finalize_command$finalize_rpath
10460
10461 func_warning "this platform does not like uninstalled shared libraries"
10462 func_warning "'$output' will be relinked during installation"
10463 ;;
10464 *,yes)
10465 link_command=$finalize_var$compile_command$finalize_rpath
10466 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10467 ;;
10468 *,no)
10469 link_command=$compile_var$compile_command$compile_rpath
10470 relink_command=$finalize_var$finalize_command$finalize_rpath
10471 ;;
10472 *,needless)
10473 link_command=$finalize_var$compile_command$finalize_rpath
10474 relink_command=
10475 ;;
10476 esac
10477
10478 # Replace the output file specification.
10479 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
10480
10481 # Delete the old output files.
10482 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
10483
10484 func_show_eval "$link_command" 'exit $?'
10485
10486 if test -n "$postlink_cmds"; then
10487 func_to_tool_file "$output_objdir/$outputname"
10488 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10489 func_execute_cmds "$postlink_cmds" 'exit $?'
10490 fi
10491
10492 # Now create the wrapper script.
10493 func_verbose "creating $output"
10494
10495 # Quote the relink command for shipping.
10496 if test -n "$relink_command"; then
10497 # Preserve any variables that may affect compiler behavior
10498 for var in $variables_saved_for_relink; do
10499 if eval test -z \"\${$var+set}\"; then
10500 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
10501 elif eval var_value=\$$var; test -z "$var_value"; then
10502 relink_command="$var=; export $var; $relink_command"
10503 else
10504 func_quote_for_eval "$var_value"
10505 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10506 fi
10507 done
10508 relink_command="(cd `pwd`; $relink_command)"
10509 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
10510 fi
10511
10512 # Only actually do things if not in dry run mode.
10513 $opt_dry_run || {
10514 # win32 will think the script is a binary if it has
10515 # a .exe suffix, so we strip it off here.
10516 case $output in
10517 *.exe) func_stripname '' '.exe' "$output"
10518 output=$func_stripname_result ;;
10519 esac
10520 # test for cygwin because mv fails w/o .exe extensions
10521 case $host in
10522 *cygwin*)
10523 exeext=.exe
10524 func_stripname '' '.exe' "$outputname"
10525 outputname=$func_stripname_result ;;
10526 *) exeext= ;;
10527 esac
10528 case $host in
10529 *cygwin* | *mingw* )
10530 func_dirname_and_basename "$output" "" "."
10531 output_name=$func_basename_result
10532 output_path=$func_dirname_result
10533 cwrappersource=$output_path/$objdir/lt-$output_name.c
10534 cwrapper=$output_path/$output_name.exe
10535 $RM $cwrappersource $cwrapper
10536 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
10537
10538 func_emit_cwrapperexe_src > $cwrappersource
10539
10540 # The wrapper executable is built using the $host compiler,
10541 # because it contains $host paths and files. If cross-
10542 # compiling, it, like the target executable, must be
10543 # executed on the $host or under an emulation environment.
10544 $opt_dry_run || {
10545 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
10546 $STRIP $cwrapper
10547 }
10548
10549 # Now, create the wrapper script for func_source use:
10550 func_ltwrapper_scriptname $cwrapper
10551 $RM $func_ltwrapper_scriptname_result
10552 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
10553 $opt_dry_run || {
10554 # note: this script will not be executed, so do not chmod.
10555 if test "x$build" = "x$host"; then
10556 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
10557 else
10558 func_emit_wrapper no > $func_ltwrapper_scriptname_result
10559 fi
10560 }
10561 ;;
10562 * )
10563 $RM $output
10564 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
10565
10566 func_emit_wrapper no > $output
10567 chmod +x $output
10568 ;;
10569 esac
10570 }
10571 exit $EXIT_SUCCESS
10572 ;;
10573 esac
10574
10575 # See if we need to build an old-fashioned archive.
10576 for oldlib in $oldlibs; do
10577
10578 case $build_libtool_libs in
10579 convenience)
10580 oldobjs="$libobjs_save $symfileobj"
10581 addlibs=$convenience
10582 build_libtool_libs=no
10583 ;;
10584 module)
10585 oldobjs=$libobjs_save
10586 addlibs=$old_convenience
10587 build_libtool_libs=no
10588 ;;
10589 *)
10590 oldobjs="$old_deplibs $non_pic_objects"
10591 $preload && test -f "$symfileobj" \
10592 && func_append oldobjs " $symfileobj"
10593 addlibs=$old_convenience
10594 ;;
10595 esac
10596
10597 if test -n "$addlibs"; then
10598 gentop=$output_objdir/${outputname}x
10599 func_append generated " $gentop"
10600
10601 func_extract_archives $gentop $addlibs
10602 func_append oldobjs " $func_extract_archives_result"
10603 fi
10604
10605 # Do each command in the archive commands.
10606 if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
10607 cmds=$old_archive_from_new_cmds
10608 else
10609
10610 # Add any objects from preloaded convenience libraries
10611 if test -n "$dlprefiles"; then
10612 gentop=$output_objdir/${outputname}x
10613 func_append generated " $gentop"
10614
10615 func_extract_archives $gentop $dlprefiles
10616 func_append oldobjs " $func_extract_archives_result"
10617 fi
10618
10619 # POSIX demands no paths to be encoded in archives. We have
10620 # to avoid creating archives with duplicate basenames if we
10621 # might have to extract them afterwards, e.g., when creating a
10622 # static archive out of a convenience library, or when linking
10623 # the entirety of a libtool archive into another (currently
10624 # not supported by libtool).
10625 if (for obj in $oldobjs
10626 do
10627 func_basename "$obj"
10628 $ECHO "$func_basename_result"
10629 done | sort | sort -uc >/dev/null 2>&1); then
10630 :
10631 else
10632 echo "copying selected object files to avoid basename conflicts..."
10633 gentop=$output_objdir/${outputname}x
10634 func_append generated " $gentop"
10635 func_mkdir_p "$gentop"
10636 save_oldobjs=$oldobjs
10637 oldobjs=
10638 counter=1
10639 for obj in $save_oldobjs
10640 do
10641 func_basename "$obj"
10642 objbase=$func_basename_result
10643 case " $oldobjs " in
10644 " ") oldobjs=$obj ;;
10645 *[\ /]"$objbase "*)
10646 while :; do
10647 # Make sure we don't pick an alternate name that also
10648 # overlaps.
10649 newobj=lt$counter-$objbase
10650 func_arith $counter + 1
10651 counter=$func_arith_result
10652 case " $oldobjs " in
10653 *[\ /]"$newobj "*) ;;
10654 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
10655 esac
10656 done
10657 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
10658 func_append oldobjs " $gentop/$newobj"
10659 ;;
10660 *) func_append oldobjs " $obj" ;;
10661 esac
10662 done
10663 fi
10664 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
10665 tool_oldlib=$func_to_tool_file_result
10666 eval cmds=\"$old_archive_cmds\"
10667
10668 func_len " $cmds"
10669 len=$func_len_result
10670 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10671 cmds=$old_archive_cmds
10672 elif test -n "$archiver_list_spec"; then
10673 func_verbose "using command file archive linking..."
10674 for obj in $oldobjs
10675 do
10676 func_to_tool_file "$obj"
10677 $ECHO "$func_to_tool_file_result"
10678 done > $output_objdir/$libname.libcmd
10679 func_to_tool_file "$output_objdir/$libname.libcmd"
10680 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
10681 cmds=$old_archive_cmds
10682 else
10683 # the command line is too long to link in one step, link in parts
10684 func_verbose "using piecewise archive linking..."
10685 save_RANLIB=$RANLIB
10686 RANLIB=:
10687 objlist=
10688 concat_cmds=
10689 save_oldobjs=$oldobjs
10690 oldobjs=
10691 # Is there a better way of finding the last object in the list?
10692 for obj in $save_oldobjs
10693 do
10694 last_oldobj=$obj
10695 done
10696 eval test_cmds=\"$old_archive_cmds\"
10697 func_len " $test_cmds"
10698 len0=$func_len_result
10699 len=$len0
10700 for obj in $save_oldobjs
10701 do
10702 func_len " $obj"
10703 func_arith $len + $func_len_result
10704 len=$func_arith_result
10705 func_append objlist " $obj"
10706 if test "$len" -lt "$max_cmd_len"; then
10707 :
10708 else
10709 # the above command should be used before it gets too long
10710 oldobjs=$objlist
10711 if test "$obj" = "$last_oldobj"; then
10712 RANLIB=$save_RANLIB
10713 fi
10714 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10715 eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
10716 objlist=
10717 len=$len0
10718 fi
10719 done
10720 RANLIB=$save_RANLIB
10721 oldobjs=$objlist
10722 if test -z "$oldobjs"; then
10723 eval cmds=\"\$concat_cmds\"
10724 else
10725 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
10726 fi
10727 fi
10728 fi
10729 func_execute_cmds "$cmds" 'exit $?'
10730 done
10731
10732 test -n "$generated" && \
10733 func_show_eval "${RM}r$generated"
10734
10735 # Now create the libtool archive.
10736 case $output in
10737 *.la)
10738 old_library=
10739 test yes = "$build_old_libs" && old_library=$libname.$libext
10740 func_verbose "creating $output"
10741
10742 # Preserve any variables that may affect compiler behavior
10743 for var in $variables_saved_for_relink; do
10744 if eval test -z \"\${$var+set}\"; then
10745 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
10746 elif eval var_value=\$$var; test -z "$var_value"; then
10747 relink_command="$var=; export $var; $relink_command"
10748 else
10749 func_quote_for_eval "$var_value"
10750 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10751 fi
10752 done
10753 # Quote the link command for shipping.
10754 relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
10755 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
10756 if test yes = "$hardcode_automatic"; then
10757 relink_command=
10758 fi
10759
10760 # Only create the output if not a dry run.
10761 $opt_dry_run || {
10762 for installed in no yes; do
10763 if test yes = "$installed"; then
10764 if test -z "$install_libdir"; then
10765 break
10766 fi
10767 output=$output_objdir/${outputname}i
10768 # Replace all uninstalled libtool libraries with the installed ones
10769 newdependency_libs=
10770 for deplib in $dependency_libs; do
10771 case $deplib in
10772 *.la)
10773 func_basename "$deplib"
10774 name=$func_basename_result
10775 func_resolve_sysroot "$deplib"
10776 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
10777 test -z "$libdir" && \
10778 func_fatal_error "'$deplib' is not a valid libtool archive"
10779 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
10780 ;;
10781 -L*)
10782 func_stripname -L '' "$deplib"
10783 func_replace_sysroot "$func_stripname_result"
10784 func_append newdependency_libs " -L$func_replace_sysroot_result"
10785 ;;
10786 -R*)
10787 func_stripname -R '' "$deplib"
10788 func_replace_sysroot "$func_stripname_result"
10789 func_append newdependency_libs " -R$func_replace_sysroot_result"
10790 ;;
10791 *) func_append newdependency_libs " $deplib" ;;
10792 esac
10793 done
10794 dependency_libs=$newdependency_libs
10795 newdlfiles=
10796
10797 for lib in $dlfiles; do
10798 case $lib in
10799 *.la)
10800 func_basename "$lib"
10801 name=$func_basename_result
10802 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10803 test -z "$libdir" && \
10804 func_fatal_error "'$lib' is not a valid libtool archive"
10805 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
10806 ;;
10807 *) func_append newdlfiles " $lib" ;;
10808 esac
10809 done
10810 dlfiles=$newdlfiles
10811 newdlprefiles=
10812 for lib in $dlprefiles; do
10813 case $lib in
10814 *.la)
10815 # Only pass preopened files to the pseudo-archive (for
10816 # eventual linking with the app. that links it) if we
10817 # didn't already link the preopened objects directly into
10818 # the library:
10819 func_basename "$lib"
10820 name=$func_basename_result
10821 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10822 test -z "$libdir" && \
10823 func_fatal_error "'$lib' is not a valid libtool archive"
10824 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
10825 ;;
10826 esac
10827 done
10828 dlprefiles=$newdlprefiles
10829 else
10830 newdlfiles=
10831 for lib in $dlfiles; do
10832 case $lib in
10833 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
10834 *) abs=`pwd`"/$lib" ;;
10835 esac
10836 func_append newdlfiles " $abs"
10837 done
10838 dlfiles=$newdlfiles
10839 newdlprefiles=
10840 for lib in $dlprefiles; do
10841 case $lib in
10842 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
10843 *) abs=`pwd`"/$lib" ;;
10844 esac
10845 func_append newdlprefiles " $abs"
10846 done
10847 dlprefiles=$newdlprefiles
10848 fi
10849 $RM $output
10850 # place dlname in correct position for cygwin
10851 # In fact, it would be nice if we could use this code for all target
10852 # systems that can't hard-code library paths into their executables
10853 # and that have no shared library path variable independent of PATH,
10854 # but it turns out we can't easily determine that from inspecting
10855 # libtool variables, so we have to hard-code the OSs to which it
10856 # applies here; at the moment, that means platforms that use the PE
10857 # object format with DLL files. See the long comment at the top of
10858 # tests/bindir.at for full details.
10859 tdlname=$dlname
10860 case $host,$output,$installed,$module,$dlname in
10861 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
10862 # If a -bindir argument was supplied, place the dll there.
10863 if test -n "$bindir"; then
10864 func_relative_path "$install_libdir" "$bindir"
10865 tdlname=$func_relative_path_result/$dlname
10866 else
10867 # Otherwise fall back on heuristic.
10868 tdlname=../bin/$dlname
10869 fi
10870 ;;
10871 esac
10872 $ECHO > $output "\
10873 # $outputname - a libtool library file
10874 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
10875 #
10876 # Please DO NOT delete this file!
10877 # It is necessary for linking the library.
10878
10879 # The name that we can dlopen(3).
10880 dlname='$tdlname'
10881
10882 # Names of this library.
10883 library_names='$library_names'
10884
10885 # The name of the static archive.
10886 old_library='$old_library'
10887
10888 # Linker flags that cannot go in dependency_libs.
10889 inherited_linker_flags='$new_inherited_linker_flags'
10890
10891 # Libraries that this one depends upon.
10892 dependency_libs='$dependency_libs'
10893
10894 # Names of additional weak libraries provided by this library
10895 weak_library_names='$weak_libs'
10896
10897 # Version information for $libname.
10898 current=$current
10899 age=$age
10900 revision=$revision
10901
10902 # Is this an already installed library?
10903 installed=$installed
10904
10905 # Should we warn about portability when linking against -modules?
10906 shouldnotlink=$module
10907
10908 # Files to dlopen/dlpreopen
10909 dlopen='$dlfiles'
10910 dlpreopen='$dlprefiles'
10911
10912 # Directory that this library needs to be installed in:
10913 libdir='$install_libdir'"
10914 if test no,yes = "$installed,$need_relink"; then
10915 $ECHO >> $output "\
10916 relink_command=\"$relink_command\""
10917 fi
10918 done
10919 }
10920
10921 # Do a symbolic link so that the libtool archive can be found in
10922 # LD_LIBRARY_PATH before the program is installed.
10923 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
10924 ;;
10925 esac
10926 exit $EXIT_SUCCESS
10927 }
10928
10929 if test link = "$opt_mode" || test relink = "$opt_mode"; then
10930 func_mode_link ${1+"$@"}
10931 fi
10932
10933
10934 # func_mode_uninstall arg...
10935 func_mode_uninstall ()
10936 {
10937 $debug_cmd
10938
10939 RM=$nonopt
10940 files=
10941 rmforce=false
10942 exit_status=0
10943
10944 # This variable tells wrapper scripts just to set variables rather
10945 # than running their programs.
10946 libtool_install_magic=$magic
10947
10948 for arg
10949 do
10950 case $arg in
10951 -f) func_append RM " $arg"; rmforce=: ;;
10952 -*) func_append RM " $arg" ;;
10953 *) func_append files " $arg" ;;
10954 esac
10955 done
10956
10957 test -z "$RM" && \
10958 func_fatal_help "you must specify an RM program"
10959
10960 rmdirs=
10961
10962 for file in $files; do
10963 func_dirname "$file" "" "."
10964 dir=$func_dirname_result
10965 if test . = "$dir"; then
10966 odir=$objdir
10967 else
10968 odir=$dir/$objdir
10969 fi
10970 func_basename "$file"
10971 name=$func_basename_result
10972 test uninstall = "$opt_mode" && odir=$dir
10973
10974 # Remember odir for removal later, being careful to avoid duplicates
10975 if test clean = "$opt_mode"; then
10976 case " $rmdirs " in
10977 *" $odir "*) ;;
10978 *) func_append rmdirs " $odir" ;;
10979 esac
10980 fi
10981
10982 # Don't error if the file doesn't exist and rm -f was used.
10983 if { test -L "$file"; } >/dev/null 2>&1 ||
10984 { test -h "$file"; } >/dev/null 2>&1 ||
10985 test -f "$file"; then
10986 :
10987 elif test -d "$file"; then
10988 exit_status=1
10989 continue
10990 elif $rmforce; then
10991 continue
10992 fi
10993
10994 rmfiles=$file
10995
10996 case $name in
10997 *.la)
10998 # Possibly a libtool archive, so verify it.
10999 if func_lalib_p "$file"; then
11000 func_source $dir/$name
11001
11002 # Delete the libtool libraries and symlinks.
11003 for n in $library_names; do
11004 func_append rmfiles " $odir/$n"
11005 done
11006 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
11007
11008 case $opt_mode in
11009 clean)
11010 case " $library_names " in
11011 *" $dlname "*) ;;
11012 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
11013 esac
11014 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
11015 ;;
11016 uninstall)
11017 if test -n "$library_names"; then
11018 # Do each command in the postuninstall commands.
11019 func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
11020 fi
11021
11022 if test -n "$old_library"; then
11023 # Do each command in the old_postuninstall commands.
11024 func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
11025 fi
11026 # FIXME: should reinstall the best remaining shared library.
11027 ;;
11028 esac
11029 fi
11030 ;;
11031
11032 *.lo)
11033 # Possibly a libtool object, so verify it.
11034 if func_lalib_p "$file"; then
11035
11036 # Read the .lo file
11037 func_source $dir/$name
11038
11039 # Add PIC object to the list of files to remove.
11040 if test -n "$pic_object" && test none != "$pic_object"; then
11041 func_append rmfiles " $dir/$pic_object"
11042 fi
11043
11044 # Add non-PIC object to the list of files to remove.
11045 if test -n "$non_pic_object" && test none != "$non_pic_object"; then
11046 func_append rmfiles " $dir/$non_pic_object"
11047 fi
11048 fi
11049 ;;
11050
11051 *)
11052 if test clean = "$opt_mode"; then
11053 noexename=$name
11054 case $file in
11055 *.exe)
11056 func_stripname '' '.exe' "$file"
11057 file=$func_stripname_result
11058 func_stripname '' '.exe' "$name"
11059 noexename=$func_stripname_result
11060 # $file with .exe has already been added to rmfiles,
11061 # add $file without .exe
11062 func_append rmfiles " $file"
11063 ;;
11064 esac
11065 # Do a test to see if this is a libtool program.
11066 if func_ltwrapper_p "$file"; then
11067 if func_ltwrapper_executable_p "$file"; then
11068 func_ltwrapper_scriptname "$file"
11069 relink_command=
11070 func_source $func_ltwrapper_scriptname_result
11071 func_append rmfiles " $func_ltwrapper_scriptname_result"
11072 else
11073 relink_command=
11074 func_source $dir/$noexename
11075 fi
11076
11077 # note $name still contains .exe if it was in $file originally
11078 # as does the version of $file that was added into $rmfiles
11079 func_append rmfiles " $odir/$name $odir/${name}S.$objext"
11080 if test yes = "$fast_install" && test -n "$relink_command"; then
11081 func_append rmfiles " $odir/lt-$name"
11082 fi
11083 if test "X$noexename" != "X$name"; then
11084 func_append rmfiles " $odir/lt-$noexename.c"
11085 fi
11086 fi
11087 fi
11088 ;;
11089 esac
11090 func_show_eval "$RM $rmfiles" 'exit_status=1'
11091 done
11092
11093 # Try to remove the $objdir's in the directories where we deleted files
11094 for dir in $rmdirs; do
11095 if test -d "$dir"; then
11096 func_show_eval "rmdir $dir >/dev/null 2>&1"
11097 fi
11098 done
11099
11100 exit $exit_status
11101 }
11102
11103 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
11104 func_mode_uninstall ${1+"$@"}
11105 fi
11106
11107 test -z "$opt_mode" && {
11108 help=$generic_help
11109 func_fatal_help "you must specify a MODE"
11110 }
11111
11112 test -z "$exec_cmd" && \
11113 func_fatal_help "invalid operation mode '$opt_mode'"
11114
11115 if test -n "$exec_cmd"; then
11116 eval exec "$exec_cmd"
11117 exit $EXIT_FAILURE
11118 fi
11119
11120 exit $exit_status
11121
11122
11123 # The TAGs below are defined such that we never get into a situation
11124 # where we disable both kinds of libraries. Given conflicting
11125 # choices, we go for a static library, that is the most portable,
11126 # since we can't tell whether shared libraries were disabled because
11127 # the user asked for that or because the platform doesn't support
11128 # them. This is particularly important on AIX, because we don't
11129 # support having both static and shared libraries enabled at the same
11130 # time on that platform, so we default to a shared-only configuration.
11131 # If a disable-shared tag is given, we'll fallback to a static-only
11132 # configuration. But we'll never go from static-only to shared-only.
11133
11134 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
11135 build_libtool_libs=no
11136 build_old_libs=yes
11137 # ### END LIBTOOL TAG CONFIG: disable-shared
11138
11139 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
11140 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
11141 # ### END LIBTOOL TAG CONFIG: disable-static
11142
11143 # Local Variables:
11144 # mode:shell-script
11145 # sh-indentation:2
11146 # End:
0 #! /bin/sh
1 # Common wrapper for a few potentially missing GNU programs.
2
3 scriptversion=2013-10-28.13; # UTC
4
5 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
6 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 if test $# -eq 0; then
27 echo 1>&2 "Try '$0 --help' for more information"
28 exit 1
29 fi
30
31 case $1 in
32
33 --is-lightweight)
34 # Used by our autoconf macros to check whether the available missing
35 # script is modern enough.
36 exit 0
37 ;;
38
39 --run)
40 # Back-compat with the calling convention used by older automake.
41 shift
42 ;;
43
44 -h|--h|--he|--hel|--help)
45 echo "\
46 $0 [OPTION]... PROGRAM [ARGUMENT]...
47
48 Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
49 to PROGRAM being missing or too old.
50
51 Options:
52 -h, --help display this help and exit
53 -v, --version output version information and exit
54
55 Supported PROGRAM values:
56 aclocal autoconf autoheader autom4te automake makeinfo
57 bison yacc flex lex help2man
58
59 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
60 'g' are ignored when checking the name.
61
62 Send bug reports to <bug-automake@gnu.org>."
63 exit $?
64 ;;
65
66 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
67 echo "missing $scriptversion (GNU Automake)"
68 exit $?
69 ;;
70
71 -*)
72 echo 1>&2 "$0: unknown '$1' option"
73 echo 1>&2 "Try '$0 --help' for more information"
74 exit 1
75 ;;
76
77 esac
78
79 # Run the given program, remember its exit status.
80 "$@"; st=$?
81
82 # If it succeeded, we are done.
83 test $st -eq 0 && exit 0
84
85 # Also exit now if we it failed (or wasn't found), and '--version' was
86 # passed; such an option is passed most likely to detect whether the
87 # program is present and works.
88 case $2 in --version|--help) exit $st;; esac
89
90 # Exit code 63 means version mismatch. This often happens when the user
91 # tries to use an ancient version of a tool on a file that requires a
92 # minimum version.
93 if test $st -eq 63; then
94 msg="probably too old"
95 elif test $st -eq 127; then
96 # Program was missing.
97 msg="missing on your system"
98 else
99 # Program was found and executed, but failed. Give up.
100 exit $st
101 fi
102
103 perl_URL=http://www.perl.org/
104 flex_URL=http://flex.sourceforge.net/
105 gnu_software_URL=http://www.gnu.org/software
106
107 program_details ()
108 {
109 case $1 in
110 aclocal|automake)
111 echo "The '$1' program is part of the GNU Automake package:"
112 echo "<$gnu_software_URL/automake>"
113 echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
114 echo "<$gnu_software_URL/autoconf>"
115 echo "<$gnu_software_URL/m4/>"
116 echo "<$perl_URL>"
117 ;;
118 autoconf|autom4te|autoheader)
119 echo "The '$1' program is part of the GNU Autoconf package:"
120 echo "<$gnu_software_URL/autoconf/>"
121 echo "It also requires GNU m4 and Perl in order to run:"
122 echo "<$gnu_software_URL/m4/>"
123 echo "<$perl_URL>"
124 ;;
125 esac
126 }
127
128 give_advice ()
129 {
130 # Normalize program name to check for.
131 normalized_program=`echo "$1" | sed '
132 s/^gnu-//; t
133 s/^gnu//; t
134 s/^g//; t'`
135
136 printf '%s\n' "'$1' is $msg."
137
138 configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
139 case $normalized_program in
140 autoconf*)
141 echo "You should only need it if you modified 'configure.ac',"
142 echo "or m4 files included by it."
143 program_details 'autoconf'
144 ;;
145 autoheader*)
146 echo "You should only need it if you modified 'acconfig.h' or"
147 echo "$configure_deps."
148 program_details 'autoheader'
149 ;;
150 automake*)
151 echo "You should only need it if you modified 'Makefile.am' or"
152 echo "$configure_deps."
153 program_details 'automake'
154 ;;
155 aclocal*)
156 echo "You should only need it if you modified 'acinclude.m4' or"
157 echo "$configure_deps."
158 program_details 'aclocal'
159 ;;
160 autom4te*)
161 echo "You might have modified some maintainer files that require"
162 echo "the 'autom4te' program to be rebuilt."
163 program_details 'autom4te'
164 ;;
165 bison*|yacc*)
166 echo "You should only need it if you modified a '.y' file."
167 echo "You may want to install the GNU Bison package:"
168 echo "<$gnu_software_URL/bison/>"
169 ;;
170 lex*|flex*)
171 echo "You should only need it if you modified a '.l' file."
172 echo "You may want to install the Fast Lexical Analyzer package:"
173 echo "<$flex_URL>"
174 ;;
175 help2man*)
176 echo "You should only need it if you modified a dependency" \
177 "of a man page."
178 echo "You may want to install the GNU Help2man package:"
179 echo "<$gnu_software_URL/help2man/>"
180 ;;
181 makeinfo*)
182 echo "You should only need it if you modified a '.texi' file, or"
183 echo "any other file indirectly affecting the aspect of the manual."
184 echo "You might want to install the Texinfo package:"
185 echo "<$gnu_software_URL/texinfo/>"
186 echo "The spurious makeinfo call might also be the consequence of"
187 echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
188 echo "want to install GNU make:"
189 echo "<$gnu_software_URL/make/>"
190 ;;
191 *)
192 echo "You might have modified some files without having the proper"
193 echo "tools for further handling them. Check the 'README' file, it"
194 echo "often tells you about the needed prerequisites for installing"
195 echo "this package. You may also peek at any GNU archive site, in"
196 echo "case some other package contains this missing '$1' program."
197 ;;
198 esac
199 }
200
201 give_advice "$1" | sed -e '1s/^/WARNING: /' \
202 -e '2,$s/^/ /' >&2
203
204 # Propagate the correct exit status (expected to be 127 for a program
205 # not found, 63 for a program that failed due to version mismatch).
206 exit $st
207
208 # Local variables:
209 # eval: (add-hook 'write-file-hooks 'time-stamp)
210 # time-stamp-start: "scriptversion="
211 # time-stamp-format: "%:y-%02m-%02d.%02H"
212 # time-stamp-time-zone: "UTC"
213 # time-stamp-end: "; # UTC"
214 # End:
0 #! /bin/sh
1 # test-driver - basic testsuite driver script.
2
3 scriptversion=2013-07-13.22; # UTC
4
5 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 # This file is maintained in Automake, please report
26 # bugs to <bug-automake@gnu.org> or send patches to
27 # <automake-patches@gnu.org>.
28
29 # Make unconditional expansion of undefined variables an error. This
30 # helps a lot in preventing typo-related bugs.
31 set -u
32
33 usage_error ()
34 {
35 echo "$0: $*" >&2
36 print_usage >&2
37 exit 2
38 }
39
40 print_usage ()
41 {
42 cat <<END
43 Usage:
44 test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
45 [--expect-failure={yes|no}] [--color-tests={yes|no}]
46 [--enable-hard-errors={yes|no}] [--]
47 TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
48 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
49 END
50 }
51
52 test_name= # Used for reporting.
53 log_file= # Where to save the output of the test script.
54 trs_file= # Where to save the metadata of the test run.
55 expect_failure=no
56 color_tests=no
57 enable_hard_errors=yes
58 while test $# -gt 0; do
59 case $1 in
60 --help) print_usage; exit $?;;
61 --version) echo "test-driver $scriptversion"; exit $?;;
62 --test-name) test_name=$2; shift;;
63 --log-file) log_file=$2; shift;;
64 --trs-file) trs_file=$2; shift;;
65 --color-tests) color_tests=$2; shift;;
66 --expect-failure) expect_failure=$2; shift;;
67 --enable-hard-errors) enable_hard_errors=$2; shift;;
68 --) shift; break;;
69 -*) usage_error "invalid option: '$1'";;
70 *) break;;
71 esac
72 shift
73 done
74
75 missing_opts=
76 test x"$test_name" = x && missing_opts="$missing_opts --test-name"
77 test x"$log_file" = x && missing_opts="$missing_opts --log-file"
78 test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
79 if test x"$missing_opts" != x; then
80 usage_error "the following mandatory options are missing:$missing_opts"
81 fi
82
83 if test $# -eq 0; then
84 usage_error "missing argument"
85 fi
86
87 if test $color_tests = yes; then
88 # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
89 red='' # Red.
90 grn='' # Green.
91 lgn='' # Light green.
92 blu='' # Blue.
93 mgn='' # Magenta.
94 std='' # No color.
95 else
96 red= grn= lgn= blu= mgn= std=
97 fi
98
99 do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
100 trap "st=129; $do_exit" 1
101 trap "st=130; $do_exit" 2
102 trap "st=141; $do_exit" 13
103 trap "st=143; $do_exit" 15
104
105 # Test script is run here.
106 "$@" >$log_file 2>&1
107 estatus=$?
108
109 if test $enable_hard_errors = no && test $estatus -eq 99; then
110 tweaked_estatus=1
111 else
112 tweaked_estatus=$estatus
113 fi
114
115 case $tweaked_estatus:$expect_failure in
116 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
117 0:*) col=$grn res=PASS recheck=no gcopy=no;;
118 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
119 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
120 *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
121 *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
122 esac
123
124 # Report the test outcome and exit status in the logs, so that one can
125 # know whether the test passed or failed simply by looking at the '.log'
126 # file, without the need of also peaking into the corresponding '.trs'
127 # file (automake bug#11814).
128 echo "$res $test_name (exit status: $estatus)" >>$log_file
129
130 # Report outcome to console.
131 echo "${col}${res}${std}: $test_name"
132
133 # Register the test result, and other relevant metadata.
134 echo ":test-result: $res" > $trs_file
135 echo ":global-test-result: $res" >> $trs_file
136 echo ":recheck: $recheck" >> $trs_file
137 echo ":copy-in-global-log: $gcopy" >> $trs_file
138
139 # Local Variables:
140 # mode: shell-script
141 # sh-indentation: 2
142 # eval: (add-hook 'write-file-hooks 'time-stamp)
143 # time-stamp-start: "scriptversion="
144 # time-stamp-format: "%:y-%02m-%02d.%02H"
145 # time-stamp-time-zone: "UTC"
146 # time-stamp-end: "; # UTC"
147 # End:
+0
-347
compile less more
0 #! /bin/sh
1 # Wrapper for compilers which do not understand '-c -o'.
2
3 scriptversion=2012-10-14.11; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
6 # Written by Tom Tromey <tromey@cygnus.com>.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 # This file is maintained in Automake, please report
27 # bugs to <bug-automake@gnu.org> or send patches to
28 # <automake-patches@gnu.org>.
29
30 nl='
31 '
32
33 # We need space, tab and new line, in precisely that order. Quoting is
34 # there to prevent tools from complaining about whitespace usage.
35 IFS=" "" $nl"
36
37 file_conv=
38
39 # func_file_conv build_file lazy
40 # Convert a $build file to $host form and store it in $file
41 # Currently only supports Windows hosts. If the determined conversion
42 # type is listed in (the comma separated) LAZY, no conversion will
43 # take place.
44 func_file_conv ()
45 {
46 file=$1
47 case $file in
48 / | /[!/]*) # absolute file, and not a UNC file
49 if test -z "$file_conv"; then
50 # lazily determine how to convert abs files
51 case `uname -s` in
52 MINGW*)
53 file_conv=mingw
54 ;;
55 CYGWIN*)
56 file_conv=cygwin
57 ;;
58 *)
59 file_conv=wine
60 ;;
61 esac
62 fi
63 case $file_conv/,$2, in
64 *,$file_conv,*)
65 ;;
66 mingw/*)
67 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
68 ;;
69 cygwin/*)
70 file=`cygpath -m "$file" || echo "$file"`
71 ;;
72 wine/*)
73 file=`winepath -w "$file" || echo "$file"`
74 ;;
75 esac
76 ;;
77 esac
78 }
79
80 # func_cl_dashL linkdir
81 # Make cl look for libraries in LINKDIR
82 func_cl_dashL ()
83 {
84 func_file_conv "$1"
85 if test -z "$lib_path"; then
86 lib_path=$file
87 else
88 lib_path="$lib_path;$file"
89 fi
90 linker_opts="$linker_opts -LIBPATH:$file"
91 }
92
93 # func_cl_dashl library
94 # Do a library search-path lookup for cl
95 func_cl_dashl ()
96 {
97 lib=$1
98 found=no
99 save_IFS=$IFS
100 IFS=';'
101 for dir in $lib_path $LIB
102 do
103 IFS=$save_IFS
104 if $shared && test -f "$dir/$lib.dll.lib"; then
105 found=yes
106 lib=$dir/$lib.dll.lib
107 break
108 fi
109 if test -f "$dir/$lib.lib"; then
110 found=yes
111 lib=$dir/$lib.lib
112 break
113 fi
114 if test -f "$dir/lib$lib.a"; then
115 found=yes
116 lib=$dir/lib$lib.a
117 break
118 fi
119 done
120 IFS=$save_IFS
121
122 if test "$found" != yes; then
123 lib=$lib.lib
124 fi
125 }
126
127 # func_cl_wrapper cl arg...
128 # Adjust compile command to suit cl
129 func_cl_wrapper ()
130 {
131 # Assume a capable shell
132 lib_path=
133 shared=:
134 linker_opts=
135 for arg
136 do
137 if test -n "$eat"; then
138 eat=
139 else
140 case $1 in
141 -o)
142 # configure might choose to run compile as 'compile cc -o foo foo.c'.
143 eat=1
144 case $2 in
145 *.o | *.[oO][bB][jJ])
146 func_file_conv "$2"
147 set x "$@" -Fo"$file"
148 shift
149 ;;
150 *)
151 func_file_conv "$2"
152 set x "$@" -Fe"$file"
153 shift
154 ;;
155 esac
156 ;;
157 -I)
158 eat=1
159 func_file_conv "$2" mingw
160 set x "$@" -I"$file"
161 shift
162 ;;
163 -I*)
164 func_file_conv "${1#-I}" mingw
165 set x "$@" -I"$file"
166 shift
167 ;;
168 -l)
169 eat=1
170 func_cl_dashl "$2"
171 set x "$@" "$lib"
172 shift
173 ;;
174 -l*)
175 func_cl_dashl "${1#-l}"
176 set x "$@" "$lib"
177 shift
178 ;;
179 -L)
180 eat=1
181 func_cl_dashL "$2"
182 ;;
183 -L*)
184 func_cl_dashL "${1#-L}"
185 ;;
186 -static)
187 shared=false
188 ;;
189 -Wl,*)
190 arg=${1#-Wl,}
191 save_ifs="$IFS"; IFS=','
192 for flag in $arg; do
193 IFS="$save_ifs"
194 linker_opts="$linker_opts $flag"
195 done
196 IFS="$save_ifs"
197 ;;
198 -Xlinker)
199 eat=1
200 linker_opts="$linker_opts $2"
201 ;;
202 -*)
203 set x "$@" "$1"
204 shift
205 ;;
206 *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
207 func_file_conv "$1"
208 set x "$@" -Tp"$file"
209 shift
210 ;;
211 *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
212 func_file_conv "$1" mingw
213 set x "$@" "$file"
214 shift
215 ;;
216 *)
217 set x "$@" "$1"
218 shift
219 ;;
220 esac
221 fi
222 shift
223 done
224 if test -n "$linker_opts"; then
225 linker_opts="-link$linker_opts"
226 fi
227 exec "$@" $linker_opts
228 exit 1
229 }
230
231 eat=
232
233 case $1 in
234 '')
235 echo "$0: No command. Try '$0 --help' for more information." 1>&2
236 exit 1;
237 ;;
238 -h | --h*)
239 cat <<\EOF
240 Usage: compile [--help] [--version] PROGRAM [ARGS]
241
242 Wrapper for compilers which do not understand '-c -o'.
243 Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
244 arguments, and rename the output as expected.
245
246 If you are trying to build a whole package this is not the
247 right script to run: please start by reading the file 'INSTALL'.
248
249 Report bugs to <bug-automake@gnu.org>.
250 EOF
251 exit $?
252 ;;
253 -v | --v*)
254 echo "compile $scriptversion"
255 exit $?
256 ;;
257 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
258 func_cl_wrapper "$@" # Doesn't return...
259 ;;
260 esac
261
262 ofile=
263 cfile=
264
265 for arg
266 do
267 if test -n "$eat"; then
268 eat=
269 else
270 case $1 in
271 -o)
272 # configure might choose to run compile as 'compile cc -o foo foo.c'.
273 # So we strip '-o arg' only if arg is an object.
274 eat=1
275 case $2 in
276 *.o | *.obj)
277 ofile=$2
278 ;;
279 *)
280 set x "$@" -o "$2"
281 shift
282 ;;
283 esac
284 ;;
285 *.c)
286 cfile=$1
287 set x "$@" "$1"
288 shift
289 ;;
290 *)
291 set x "$@" "$1"
292 shift
293 ;;
294 esac
295 fi
296 shift
297 done
298
299 if test -z "$ofile" || test -z "$cfile"; then
300 # If no '-o' option was seen then we might have been invoked from a
301 # pattern rule where we don't need one. That is ok -- this is a
302 # normal compilation that the losing compiler can handle. If no
303 # '.c' file was seen then we are probably linking. That is also
304 # ok.
305 exec "$@"
306 fi
307
308 # Name of file we expect compiler to create.
309 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
310
311 # Create the lock directory.
312 # Note: use '[/\\:.-]' here to ensure that we don't use the same name
313 # that we are using for the .o file. Also, base the name on the expected
314 # object file name, since that is what matters with a parallel build.
315 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
316 while true; do
317 if mkdir "$lockdir" >/dev/null 2>&1; then
318 break
319 fi
320 sleep 1
321 done
322 # FIXME: race condition here if user kills between mkdir and trap.
323 trap "rmdir '$lockdir'; exit 1" 1 2 15
324
325 # Run the compile.
326 "$@"
327 ret=$?
328
329 if test -f "$cofile"; then
330 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
331 elif test -f "${cofile}bj"; then
332 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
333 fi
334
335 rmdir "$lockdir"
336 exit $ret
337
338 # Local Variables:
339 # mode: shell-script
340 # sh-indentation: 2
341 # eval: (add-hook 'write-file-hooks 'time-stamp)
342 # time-stamp-start: "scriptversion="
343 # time-stamp-format: "%:y-%02m-%02d.%02H"
344 # time-stamp-time-zone: "UTC"
345 # time-stamp-end: "; # UTC"
346 # End:
+0
-1558
config.guess less more
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright 1992-2013 Free Software Foundation, Inc.
3
4 timestamp='2013-06-10'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25 #
26 # Originally written by Per Bothner.
27 #
28 # You can get the latest version of this script from:
29 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
30 #
31 # Please send patches with a ChangeLog entry to config-patches@gnu.org.
32
33
34 me=`echo "$0" | sed -e 's,.*/,,'`
35
36 usage="\
37 Usage: $0 [OPTION]
38
39 Output the configuration name of the system \`$me' is run on.
40
41 Operation modes:
42 -h, --help print this help, then exit
43 -t, --time-stamp print date of last modification, then exit
44 -v, --version print version number, then exit
45
46 Report bugs and patches to <config-patches@gnu.org>."
47
48 version="\
49 GNU config.guess ($timestamp)
50
51 Originally written by Per Bothner.
52 Copyright 1992-2013 Free Software Foundation, Inc.
53
54 This is free software; see the source for copying conditions. There is NO
55 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
56
57 help="
58 Try \`$me --help' for more information."
59
60 # Parse command line
61 while test $# -gt 0 ; do
62 case $1 in
63 --time-stamp | --time* | -t )
64 echo "$timestamp" ; exit ;;
65 --version | -v )
66 echo "$version" ; exit ;;
67 --help | --h* | -h )
68 echo "$usage"; exit ;;
69 -- ) # Stop option processing
70 shift; break ;;
71 - ) # Use stdin as input.
72 break ;;
73 -* )
74 echo "$me: invalid option $1$help" >&2
75 exit 1 ;;
76 * )
77 break ;;
78 esac
79 done
80
81 if test $# != 0; then
82 echo "$me: too many arguments$help" >&2
83 exit 1
84 fi
85
86 trap 'exit 1' 1 2 15
87
88 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
89 # compiler to aid in system detection is discouraged as it requires
90 # temporary files to be created and, as you can see below, it is a
91 # headache to deal with in a portable fashion.
92
93 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
94 # use `HOST_CC' if defined, but it is deprecated.
95
96 # Portable tmp directory creation inspired by the Autoconf team.
97
98 set_cc_for_build='
99 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
100 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
101 : ${TMPDIR=/tmp} ;
102 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
103 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
104 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
105 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
106 dummy=$tmp/dummy ;
107 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
108 case $CC_FOR_BUILD,$HOST_CC,$CC in
109 ,,) echo "int x;" > $dummy.c ;
110 for c in cc gcc c89 c99 ; do
111 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
112 CC_FOR_BUILD="$c"; break ;
113 fi ;
114 done ;
115 if test x"$CC_FOR_BUILD" = x ; then
116 CC_FOR_BUILD=no_compiler_found ;
117 fi
118 ;;
119 ,,*) CC_FOR_BUILD=$CC ;;
120 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
121 esac ; set_cc_for_build= ;'
122
123 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
124 # (ghazi@noc.rutgers.edu 1994-08-24)
125 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
126 PATH=$PATH:/.attbin ; export PATH
127 fi
128
129 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
130 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
134 case "${UNAME_SYSTEM}" in
135 Linux|GNU|GNU/*)
136 # If the system lacks a compiler, then just pick glibc.
137 # We could probably try harder.
138 LIBC=gnu
139
140 eval $set_cc_for_build
141 cat <<-EOF > $dummy.c
142 #include <features.h>
143 #if defined(__UCLIBC__)
144 LIBC=uclibc
145 #elif defined(__dietlibc__)
146 LIBC=dietlibc
147 #else
148 LIBC=gnu
149 #endif
150 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
152 ;;
153 esac
154
155 # Note: order is significant - the case branches are not exclusive.
156
157 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
158 *:NetBSD:*:*)
159 # NetBSD (nbsd) targets should (where applicable) match one or
160 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
161 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
162 # switched to ELF, *-*-netbsd* would select the old
163 # object file format. This provides both forward
164 # compatibility and a consistent mechanism for selecting the
165 # object file format.
166 #
167 # Note: NetBSD doesn't particularly care about the vendor
168 # portion of the name. We always set it to "unknown".
169 sysctl="sysctl -n hw.machine_arch"
170 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
171 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
172 case "${UNAME_MACHINE_ARCH}" in
173 armeb) machine=armeb-unknown ;;
174 arm*) machine=arm-unknown ;;
175 sh3el) machine=shl-unknown ;;
176 sh3eb) machine=sh-unknown ;;
177 sh5el) machine=sh5le-unknown ;;
178 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
179 esac
180 # The Operating System including object format, if it has switched
181 # to ELF recently, or will in the future.
182 case "${UNAME_MACHINE_ARCH}" in
183 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
184 eval $set_cc_for_build
185 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
186 | grep -q __ELF__
187 then
188 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
189 # Return netbsd for either. FIX?
190 os=netbsd
191 else
192 os=netbsdelf
193 fi
194 ;;
195 *)
196 os=netbsd
197 ;;
198 esac
199 # The OS release
200 # Debian GNU/NetBSD machines have a different userland, and
201 # thus, need a distinct triplet. However, they do not need
202 # kernel version information, so it can be replaced with a
203 # suitable tag, in the style of linux-gnu.
204 case "${UNAME_VERSION}" in
205 Debian*)
206 release='-gnu'
207 ;;
208 *)
209 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
210 ;;
211 esac
212 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
213 # contains redundant information, the shorter form:
214 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
215 echo "${machine}-${os}${release}"
216 exit ;;
217 *:Bitrig:*:*)
218 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
219 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
220 exit ;;
221 *:OpenBSD:*:*)
222 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
223 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
224 exit ;;
225 *:ekkoBSD:*:*)
226 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
227 exit ;;
228 *:SolidBSD:*:*)
229 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
230 exit ;;
231 macppc:MirBSD:*:*)
232 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
233 exit ;;
234 *:MirBSD:*:*)
235 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
236 exit ;;
237 alpha:OSF1:*:*)
238 case $UNAME_RELEASE in
239 *4.0)
240 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
241 ;;
242 *5.*)
243 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
244 ;;
245 esac
246 # According to Compaq, /usr/sbin/psrinfo has been available on
247 # OSF/1 and Tru64 systems produced since 1995. I hope that
248 # covers most systems running today. This code pipes the CPU
249 # types through head -n 1, so we only detect the type of CPU 0.
250 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
251 case "$ALPHA_CPU_TYPE" in
252 "EV4 (21064)")
253 UNAME_MACHINE="alpha" ;;
254 "EV4.5 (21064)")
255 UNAME_MACHINE="alpha" ;;
256 "LCA4 (21066/21068)")
257 UNAME_MACHINE="alpha" ;;
258 "EV5 (21164)")
259 UNAME_MACHINE="alphaev5" ;;
260 "EV5.6 (21164A)")
261 UNAME_MACHINE="alphaev56" ;;
262 "EV5.6 (21164PC)")
263 UNAME_MACHINE="alphapca56" ;;
264 "EV5.7 (21164PC)")
265 UNAME_MACHINE="alphapca57" ;;
266 "EV6 (21264)")
267 UNAME_MACHINE="alphaev6" ;;
268 "EV6.7 (21264A)")
269 UNAME_MACHINE="alphaev67" ;;
270 "EV6.8CB (21264C)")
271 UNAME_MACHINE="alphaev68" ;;
272 "EV6.8AL (21264B)")
273 UNAME_MACHINE="alphaev68" ;;
274 "EV6.8CX (21264D)")
275 UNAME_MACHINE="alphaev68" ;;
276 "EV6.9A (21264/EV69A)")
277 UNAME_MACHINE="alphaev69" ;;
278 "EV7 (21364)")
279 UNAME_MACHINE="alphaev7" ;;
280 "EV7.9 (21364A)")
281 UNAME_MACHINE="alphaev79" ;;
282 esac
283 # A Pn.n version is a patched version.
284 # A Vn.n version is a released version.
285 # A Tn.n version is a released field test version.
286 # A Xn.n version is an unreleased experimental baselevel.
287 # 1.2 uses "1.2" for uname -r.
288 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
289 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
290 exitcode=$?
291 trap '' 0
292 exit $exitcode ;;
293 Alpha\ *:Windows_NT*:*)
294 # How do we know it's Interix rather than the generic POSIX subsystem?
295 # Should we change UNAME_MACHINE based on the output of uname instead
296 # of the specific Alpha model?
297 echo alpha-pc-interix
298 exit ;;
299 21064:Windows_NT:50:3)
300 echo alpha-dec-winnt3.5
301 exit ;;
302 Amiga*:UNIX_System_V:4.0:*)
303 echo m68k-unknown-sysv4
304 exit ;;
305 *:[Aa]miga[Oo][Ss]:*:*)
306 echo ${UNAME_MACHINE}-unknown-amigaos
307 exit ;;
308 *:[Mm]orph[Oo][Ss]:*:*)
309 echo ${UNAME_MACHINE}-unknown-morphos
310 exit ;;
311 *:OS/390:*:*)
312 echo i370-ibm-openedition
313 exit ;;
314 *:z/VM:*:*)
315 echo s390-ibm-zvmoe
316 exit ;;
317 *:OS400:*:*)
318 echo powerpc-ibm-os400
319 exit ;;
320 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
321 echo arm-acorn-riscix${UNAME_RELEASE}
322 exit ;;
323 arm*:riscos:*:*|arm*:RISCOS:*:*)
324 echo arm-unknown-riscos
325 exit ;;
326 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
327 echo hppa1.1-hitachi-hiuxmpp
328 exit ;;
329 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
330 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
331 if test "`(/bin/universe) 2>/dev/null`" = att ; then
332 echo pyramid-pyramid-sysv3
333 else
334 echo pyramid-pyramid-bsd
335 fi
336 exit ;;
337 NILE*:*:*:dcosx)
338 echo pyramid-pyramid-svr4
339 exit ;;
340 DRS?6000:unix:4.0:6*)
341 echo sparc-icl-nx6
342 exit ;;
343 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
344 case `/usr/bin/uname -p` in
345 sparc) echo sparc-icl-nx7; exit ;;
346 esac ;;
347 s390x:SunOS:*:*)
348 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
349 exit ;;
350 sun4H:SunOS:5.*:*)
351 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
352 exit ;;
353 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
354 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
355 exit ;;
356 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
357 echo i386-pc-auroraux${UNAME_RELEASE}
358 exit ;;
359 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
360 eval $set_cc_for_build
361 SUN_ARCH="i386"
362 # If there is a compiler, see if it is configured for 64-bit objects.
363 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
364 # This test works for both compilers.
365 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
366 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
367 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
368 grep IS_64BIT_ARCH >/dev/null
369 then
370 SUN_ARCH="x86_64"
371 fi
372 fi
373 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
374 exit ;;
375 sun4*:SunOS:6*:*)
376 # According to config.sub, this is the proper way to canonicalize
377 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
378 # it's likely to be more like Solaris than SunOS4.
379 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
380 exit ;;
381 sun4*:SunOS:*:*)
382 case "`/usr/bin/arch -k`" in
383 Series*|S4*)
384 UNAME_RELEASE=`uname -v`
385 ;;
386 esac
387 # Japanese Language versions have a version number like `4.1.3-JL'.
388 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
389 exit ;;
390 sun3*:SunOS:*:*)
391 echo m68k-sun-sunos${UNAME_RELEASE}
392 exit ;;
393 sun*:*:4.2BSD:*)
394 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
395 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
396 case "`/bin/arch`" in
397 sun3)
398 echo m68k-sun-sunos${UNAME_RELEASE}
399 ;;
400 sun4)
401 echo sparc-sun-sunos${UNAME_RELEASE}
402 ;;
403 esac
404 exit ;;
405 aushp:SunOS:*:*)
406 echo sparc-auspex-sunos${UNAME_RELEASE}
407 exit ;;
408 # The situation for MiNT is a little confusing. The machine name
409 # can be virtually everything (everything which is not
410 # "atarist" or "atariste" at least should have a processor
411 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
412 # to the lowercase version "mint" (or "freemint"). Finally
413 # the system name "TOS" denotes a system which is actually not
414 # MiNT. But MiNT is downward compatible to TOS, so this should
415 # be no problem.
416 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
417 echo m68k-atari-mint${UNAME_RELEASE}
418 exit ;;
419 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
420 echo m68k-atari-mint${UNAME_RELEASE}
421 exit ;;
422 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
423 echo m68k-atari-mint${UNAME_RELEASE}
424 exit ;;
425 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
426 echo m68k-milan-mint${UNAME_RELEASE}
427 exit ;;
428 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
429 echo m68k-hades-mint${UNAME_RELEASE}
430 exit ;;
431 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
432 echo m68k-unknown-mint${UNAME_RELEASE}
433 exit ;;
434 m68k:machten:*:*)
435 echo m68k-apple-machten${UNAME_RELEASE}
436 exit ;;
437 powerpc:machten:*:*)
438 echo powerpc-apple-machten${UNAME_RELEASE}
439 exit ;;
440 RISC*:Mach:*:*)
441 echo mips-dec-mach_bsd4.3
442 exit ;;
443 RISC*:ULTRIX:*:*)
444 echo mips-dec-ultrix${UNAME_RELEASE}
445 exit ;;
446 VAX*:ULTRIX*:*:*)
447 echo vax-dec-ultrix${UNAME_RELEASE}
448 exit ;;
449 2020:CLIX:*:* | 2430:CLIX:*:*)
450 echo clipper-intergraph-clix${UNAME_RELEASE}
451 exit ;;
452 mips:*:*:UMIPS | mips:*:*:RISCos)
453 eval $set_cc_for_build
454 sed 's/^ //' << EOF >$dummy.c
455 #ifdef __cplusplus
456 #include <stdio.h> /* for printf() prototype */
457 int main (int argc, char *argv[]) {
458 #else
459 int main (argc, argv) int argc; char *argv[]; {
460 #endif
461 #if defined (host_mips) && defined (MIPSEB)
462 #if defined (SYSTYPE_SYSV)
463 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
464 #endif
465 #if defined (SYSTYPE_SVR4)
466 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
467 #endif
468 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
469 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
470 #endif
471 #endif
472 exit (-1);
473 }
474 EOF
475 $CC_FOR_BUILD -o $dummy $dummy.c &&
476 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
477 SYSTEM_NAME=`$dummy $dummyarg` &&
478 { echo "$SYSTEM_NAME"; exit; }
479 echo mips-mips-riscos${UNAME_RELEASE}
480 exit ;;
481 Motorola:PowerMAX_OS:*:*)
482 echo powerpc-motorola-powermax
483 exit ;;
484 Motorola:*:4.3:PL8-*)
485 echo powerpc-harris-powermax
486 exit ;;
487 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
488 echo powerpc-harris-powermax
489 exit ;;
490 Night_Hawk:Power_UNIX:*:*)
491 echo powerpc-harris-powerunix
492 exit ;;
493 m88k:CX/UX:7*:*)
494 echo m88k-harris-cxux7
495 exit ;;
496 m88k:*:4*:R4*)
497 echo m88k-motorola-sysv4
498 exit ;;
499 m88k:*:3*:R3*)
500 echo m88k-motorola-sysv3
501 exit ;;
502 AViiON:dgux:*:*)
503 # DG/UX returns AViiON for all architectures
504 UNAME_PROCESSOR=`/usr/bin/uname -p`
505 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
506 then
507 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
508 [ ${TARGET_BINARY_INTERFACE}x = x ]
509 then
510 echo m88k-dg-dgux${UNAME_RELEASE}
511 else
512 echo m88k-dg-dguxbcs${UNAME_RELEASE}
513 fi
514 else
515 echo i586-dg-dgux${UNAME_RELEASE}
516 fi
517 exit ;;
518 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
519 echo m88k-dolphin-sysv3
520 exit ;;
521 M88*:*:R3*:*)
522 # Delta 88k system running SVR3
523 echo m88k-motorola-sysv3
524 exit ;;
525 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
526 echo m88k-tektronix-sysv3
527 exit ;;
528 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
529 echo m68k-tektronix-bsd
530 exit ;;
531 *:IRIX*:*:*)
532 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
533 exit ;;
534 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
535 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
536 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
537 i*86:AIX:*:*)
538 echo i386-ibm-aix
539 exit ;;
540 ia64:AIX:*:*)
541 if [ -x /usr/bin/oslevel ] ; then
542 IBM_REV=`/usr/bin/oslevel`
543 else
544 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
545 fi
546 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
547 exit ;;
548 *:AIX:2:3)
549 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
550 eval $set_cc_for_build
551 sed 's/^ //' << EOF >$dummy.c
552 #include <sys/systemcfg.h>
553
554 main()
555 {
556 if (!__power_pc())
557 exit(1);
558 puts("powerpc-ibm-aix3.2.5");
559 exit(0);
560 }
561 EOF
562 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
563 then
564 echo "$SYSTEM_NAME"
565 else
566 echo rs6000-ibm-aix3.2.5
567 fi
568 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
569 echo rs6000-ibm-aix3.2.4
570 else
571 echo rs6000-ibm-aix3.2
572 fi
573 exit ;;
574 *:AIX:*:[4567])
575 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
576 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
577 IBM_ARCH=rs6000
578 else
579 IBM_ARCH=powerpc
580 fi
581 if [ -x /usr/bin/oslevel ] ; then
582 IBM_REV=`/usr/bin/oslevel`
583 else
584 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
585 fi
586 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
587 exit ;;
588 *:AIX:*:*)
589 echo rs6000-ibm-aix
590 exit ;;
591 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
592 echo romp-ibm-bsd4.4
593 exit ;;
594 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
595 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
596 exit ;; # report: romp-ibm BSD 4.3
597 *:BOSX:*:*)
598 echo rs6000-bull-bosx
599 exit ;;
600 DPX/2?00:B.O.S.:*:*)
601 echo m68k-bull-sysv3
602 exit ;;
603 9000/[34]??:4.3bsd:1.*:*)
604 echo m68k-hp-bsd
605 exit ;;
606 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
607 echo m68k-hp-bsd4.4
608 exit ;;
609 9000/[34678]??:HP-UX:*:*)
610 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
611 case "${UNAME_MACHINE}" in
612 9000/31? ) HP_ARCH=m68000 ;;
613 9000/[34]?? ) HP_ARCH=m68k ;;
614 9000/[678][0-9][0-9])
615 if [ -x /usr/bin/getconf ]; then
616 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
617 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
618 case "${sc_cpu_version}" in
619 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
620 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
621 532) # CPU_PA_RISC2_0
622 case "${sc_kernel_bits}" in
623 32) HP_ARCH="hppa2.0n" ;;
624 64) HP_ARCH="hppa2.0w" ;;
625 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
626 esac ;;
627 esac
628 fi
629 if [ "${HP_ARCH}" = "" ]; then
630 eval $set_cc_for_build
631 sed 's/^ //' << EOF >$dummy.c
632
633 #define _HPUX_SOURCE
634 #include <stdlib.h>
635 #include <unistd.h>
636
637 int main ()
638 {
639 #if defined(_SC_KERNEL_BITS)
640 long bits = sysconf(_SC_KERNEL_BITS);
641 #endif
642 long cpu = sysconf (_SC_CPU_VERSION);
643
644 switch (cpu)
645 {
646 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
647 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
648 case CPU_PA_RISC2_0:
649 #if defined(_SC_KERNEL_BITS)
650 switch (bits)
651 {
652 case 64: puts ("hppa2.0w"); break;
653 case 32: puts ("hppa2.0n"); break;
654 default: puts ("hppa2.0"); break;
655 } break;
656 #else /* !defined(_SC_KERNEL_BITS) */
657 puts ("hppa2.0"); break;
658 #endif
659 default: puts ("hppa1.0"); break;
660 }
661 exit (0);
662 }
663 EOF
664 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
665 test -z "$HP_ARCH" && HP_ARCH=hppa
666 fi ;;
667 esac
668 if [ ${HP_ARCH} = "hppa2.0w" ]
669 then
670 eval $set_cc_for_build
671
672 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
673 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
674 # generating 64-bit code. GNU and HP use different nomenclature:
675 #
676 # $ CC_FOR_BUILD=cc ./config.guess
677 # => hppa2.0w-hp-hpux11.23
678 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
679 # => hppa64-hp-hpux11.23
680
681 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
682 grep -q __LP64__
683 then
684 HP_ARCH="hppa2.0w"
685 else
686 HP_ARCH="hppa64"
687 fi
688 fi
689 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
690 exit ;;
691 ia64:HP-UX:*:*)
692 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
693 echo ia64-hp-hpux${HPUX_REV}
694 exit ;;
695 3050*:HI-UX:*:*)
696 eval $set_cc_for_build
697 sed 's/^ //' << EOF >$dummy.c
698 #include <unistd.h>
699 int
700 main ()
701 {
702 long cpu = sysconf (_SC_CPU_VERSION);
703 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
704 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
705 results, however. */
706 if (CPU_IS_PA_RISC (cpu))
707 {
708 switch (cpu)
709 {
710 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
711 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
712 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
713 default: puts ("hppa-hitachi-hiuxwe2"); break;
714 }
715 }
716 else if (CPU_IS_HP_MC68K (cpu))
717 puts ("m68k-hitachi-hiuxwe2");
718 else puts ("unknown-hitachi-hiuxwe2");
719 exit (0);
720 }
721 EOF
722 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
723 { echo "$SYSTEM_NAME"; exit; }
724 echo unknown-hitachi-hiuxwe2
725 exit ;;
726 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
727 echo hppa1.1-hp-bsd
728 exit ;;
729 9000/8??:4.3bsd:*:*)
730 echo hppa1.0-hp-bsd
731 exit ;;
732 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
733 echo hppa1.0-hp-mpeix
734 exit ;;
735 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
736 echo hppa1.1-hp-osf
737 exit ;;
738 hp8??:OSF1:*:*)
739 echo hppa1.0-hp-osf
740 exit ;;
741 i*86:OSF1:*:*)
742 if [ -x /usr/sbin/sysversion ] ; then
743 echo ${UNAME_MACHINE}-unknown-osf1mk
744 else
745 echo ${UNAME_MACHINE}-unknown-osf1
746 fi
747 exit ;;
748 parisc*:Lites*:*:*)
749 echo hppa1.1-hp-lites
750 exit ;;
751 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
752 echo c1-convex-bsd
753 exit ;;
754 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
755 if getsysinfo -f scalar_acc
756 then echo c32-convex-bsd
757 else echo c2-convex-bsd
758 fi
759 exit ;;
760 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
761 echo c34-convex-bsd
762 exit ;;
763 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
764 echo c38-convex-bsd
765 exit ;;
766 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
767 echo c4-convex-bsd
768 exit ;;
769 CRAY*Y-MP:*:*:*)
770 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
771 exit ;;
772 CRAY*[A-Z]90:*:*:*)
773 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
774 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
775 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
776 -e 's/\.[^.]*$/.X/'
777 exit ;;
778 CRAY*TS:*:*:*)
779 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
780 exit ;;
781 CRAY*T3E:*:*:*)
782 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
783 exit ;;
784 CRAY*SV1:*:*:*)
785 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
786 exit ;;
787 *:UNICOS/mp:*:*)
788 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
789 exit ;;
790 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
791 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
792 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
793 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
794 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
795 exit ;;
796 5000:UNIX_System_V:4.*:*)
797 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
798 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
799 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
800 exit ;;
801 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
802 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
803 exit ;;
804 sparc*:BSD/OS:*:*)
805 echo sparc-unknown-bsdi${UNAME_RELEASE}
806 exit ;;
807 *:BSD/OS:*:*)
808 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
809 exit ;;
810 *:FreeBSD:*:*)
811 UNAME_PROCESSOR=`/usr/bin/uname -p`
812 case ${UNAME_PROCESSOR} in
813 amd64)
814 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
815 *)
816 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
817 esac
818 exit ;;
819 i*:CYGWIN*:*)
820 echo ${UNAME_MACHINE}-pc-cygwin
821 exit ;;
822 *:MINGW64*:*)
823 echo ${UNAME_MACHINE}-pc-mingw64
824 exit ;;
825 *:MINGW*:*)
826 echo ${UNAME_MACHINE}-pc-mingw32
827 exit ;;
828 i*:MSYS*:*)
829 echo ${UNAME_MACHINE}-pc-msys
830 exit ;;
831 i*:windows32*:*)
832 # uname -m includes "-pc" on this system.
833 echo ${UNAME_MACHINE}-mingw32
834 exit ;;
835 i*:PW*:*)
836 echo ${UNAME_MACHINE}-pc-pw32
837 exit ;;
838 *:Interix*:*)
839 case ${UNAME_MACHINE} in
840 x86)
841 echo i586-pc-interix${UNAME_RELEASE}
842 exit ;;
843 authenticamd | genuineintel | EM64T)
844 echo x86_64-unknown-interix${UNAME_RELEASE}
845 exit ;;
846 IA64)
847 echo ia64-unknown-interix${UNAME_RELEASE}
848 exit ;;
849 esac ;;
850 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
851 echo i${UNAME_MACHINE}-pc-mks
852 exit ;;
853 8664:Windows_NT:*)
854 echo x86_64-pc-mks
855 exit ;;
856 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
857 # How do we know it's Interix rather than the generic POSIX subsystem?
858 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
859 # UNAME_MACHINE based on the output of uname instead of i386?
860 echo i586-pc-interix
861 exit ;;
862 i*:UWIN*:*)
863 echo ${UNAME_MACHINE}-pc-uwin
864 exit ;;
865 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
866 echo x86_64-unknown-cygwin
867 exit ;;
868 p*:CYGWIN*:*)
869 echo powerpcle-unknown-cygwin
870 exit ;;
871 prep*:SunOS:5.*:*)
872 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
873 exit ;;
874 *:GNU:*:*)
875 # the GNU system
876 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
877 exit ;;
878 *:GNU/*:*:*)
879 # other systems with GNU libc and userland
880 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
881 exit ;;
882 i*86:Minix:*:*)
883 echo ${UNAME_MACHINE}-pc-minix
884 exit ;;
885 aarch64:Linux:*:*)
886 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
887 exit ;;
888 aarch64_be:Linux:*:*)
889 UNAME_MACHINE=aarch64_be
890 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
891 exit ;;
892 alpha:Linux:*:*)
893 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
894 EV5) UNAME_MACHINE=alphaev5 ;;
895 EV56) UNAME_MACHINE=alphaev56 ;;
896 PCA56) UNAME_MACHINE=alphapca56 ;;
897 PCA57) UNAME_MACHINE=alphapca56 ;;
898 EV6) UNAME_MACHINE=alphaev6 ;;
899 EV67) UNAME_MACHINE=alphaev67 ;;
900 EV68*) UNAME_MACHINE=alphaev68 ;;
901 esac
902 objdump --private-headers /bin/sh | grep -q ld.so.1
903 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
904 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
905 exit ;;
906 arc:Linux:*:* | arceb:Linux:*:*)
907 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
908 exit ;;
909 arm*:Linux:*:*)
910 eval $set_cc_for_build
911 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
912 | grep -q __ARM_EABI__
913 then
914 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
915 else
916 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
917 | grep -q __ARM_PCS_VFP
918 then
919 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
920 else
921 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
922 fi
923 fi
924 exit ;;
925 avr32*:Linux:*:*)
926 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
927 exit ;;
928 cris:Linux:*:*)
929 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
930 exit ;;
931 crisv32:Linux:*:*)
932 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
933 exit ;;
934 frv:Linux:*:*)
935 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
936 exit ;;
937 hexagon:Linux:*:*)
938 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
939 exit ;;
940 i*86:Linux:*:*)
941 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
942 exit ;;
943 ia64:Linux:*:*)
944 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
945 exit ;;
946 m32r*:Linux:*:*)
947 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
948 exit ;;
949 m68*:Linux:*:*)
950 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
951 exit ;;
952 mips:Linux:*:* | mips64:Linux:*:*)
953 eval $set_cc_for_build
954 sed 's/^ //' << EOF >$dummy.c
955 #undef CPU
956 #undef ${UNAME_MACHINE}
957 #undef ${UNAME_MACHINE}el
958 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
959 CPU=${UNAME_MACHINE}el
960 #else
961 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
962 CPU=${UNAME_MACHINE}
963 #else
964 CPU=
965 #endif
966 #endif
967 EOF
968 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
969 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
970 ;;
971 or1k:Linux:*:*)
972 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
973 exit ;;
974 or32:Linux:*:*)
975 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
976 exit ;;
977 padre:Linux:*:*)
978 echo sparc-unknown-linux-${LIBC}
979 exit ;;
980 parisc64:Linux:*:* | hppa64:Linux:*:*)
981 echo hppa64-unknown-linux-${LIBC}
982 exit ;;
983 parisc:Linux:*:* | hppa:Linux:*:*)
984 # Look for CPU level
985 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
986 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
987 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
988 *) echo hppa-unknown-linux-${LIBC} ;;
989 esac
990 exit ;;
991 ppc64:Linux:*:*)
992 echo powerpc64-unknown-linux-${LIBC}
993 exit ;;
994 ppc:Linux:*:*)
995 echo powerpc-unknown-linux-${LIBC}
996 exit ;;
997 ppc64le:Linux:*:*)
998 echo powerpc64le-unknown-linux-${LIBC}
999 exit ;;
1000 ppcle:Linux:*:*)
1001 echo powerpcle-unknown-linux-${LIBC}
1002 exit ;;
1003 s390:Linux:*:* | s390x:Linux:*:*)
1004 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1005 exit ;;
1006 sh64*:Linux:*:*)
1007 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1008 exit ;;
1009 sh*:Linux:*:*)
1010 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1011 exit ;;
1012 sparc:Linux:*:* | sparc64:Linux:*:*)
1013 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1014 exit ;;
1015 tile*:Linux:*:*)
1016 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1017 exit ;;
1018 vax:Linux:*:*)
1019 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1020 exit ;;
1021 x86_64:Linux:*:*)
1022 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1023 exit ;;
1024 xtensa*:Linux:*:*)
1025 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1026 exit ;;
1027 i*86:DYNIX/ptx:4*:*)
1028 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1029 # earlier versions are messed up and put the nodename in both
1030 # sysname and nodename.
1031 echo i386-sequent-sysv4
1032 exit ;;
1033 i*86:UNIX_SV:4.2MP:2.*)
1034 # Unixware is an offshoot of SVR4, but it has its own version
1035 # number series starting with 2...
1036 # I am not positive that other SVR4 systems won't match this,
1037 # I just have to hope. -- rms.
1038 # Use sysv4.2uw... so that sysv4* matches it.
1039 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1040 exit ;;
1041 i*86:OS/2:*:*)
1042 # If we were able to find `uname', then EMX Unix compatibility
1043 # is probably installed.
1044 echo ${UNAME_MACHINE}-pc-os2-emx
1045 exit ;;
1046 i*86:XTS-300:*:STOP)
1047 echo ${UNAME_MACHINE}-unknown-stop
1048 exit ;;
1049 i*86:atheos:*:*)
1050 echo ${UNAME_MACHINE}-unknown-atheos
1051 exit ;;
1052 i*86:syllable:*:*)
1053 echo ${UNAME_MACHINE}-pc-syllable
1054 exit ;;
1055 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1056 echo i386-unknown-lynxos${UNAME_RELEASE}
1057 exit ;;
1058 i*86:*DOS:*:*)
1059 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1060 exit ;;
1061 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1062 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1063 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1064 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1065 else
1066 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1067 fi
1068 exit ;;
1069 i*86:*:5:[678]*)
1070 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1071 case `/bin/uname -X | grep "^Machine"` in
1072 *486*) UNAME_MACHINE=i486 ;;
1073 *Pentium) UNAME_MACHINE=i586 ;;
1074 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1075 esac
1076 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1077 exit ;;
1078 i*86:*:3.2:*)
1079 if test -f /usr/options/cb.name; then
1080 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1081 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1082 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1083 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1084 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1085 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1086 && UNAME_MACHINE=i586
1087 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1088 && UNAME_MACHINE=i686
1089 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1090 && UNAME_MACHINE=i686
1091 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1092 else
1093 echo ${UNAME_MACHINE}-pc-sysv32
1094 fi
1095 exit ;;
1096 pc:*:*:*)
1097 # Left here for compatibility:
1098 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1099 # the processor, so we play safe by assuming i586.
1100 # Note: whatever this is, it MUST be the same as what config.sub
1101 # prints for the "djgpp" host, or else GDB configury will decide that
1102 # this is a cross-build.
1103 echo i586-pc-msdosdjgpp
1104 exit ;;
1105 Intel:Mach:3*:*)
1106 echo i386-pc-mach3
1107 exit ;;
1108 paragon:*:*:*)
1109 echo i860-intel-osf1
1110 exit ;;
1111 i860:*:4.*:*) # i860-SVR4
1112 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1113 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1114 else # Add other i860-SVR4 vendors below as they are discovered.
1115 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1116 fi
1117 exit ;;
1118 mini*:CTIX:SYS*5:*)
1119 # "miniframe"
1120 echo m68010-convergent-sysv
1121 exit ;;
1122 mc68k:UNIX:SYSTEM5:3.51m)
1123 echo m68k-convergent-sysv
1124 exit ;;
1125 M680?0:D-NIX:5.3:*)
1126 echo m68k-diab-dnix
1127 exit ;;
1128 M68*:*:R3V[5678]*:*)
1129 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1130 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1131 OS_REL=''
1132 test -r /etc/.relid \
1133 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1134 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1135 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1136 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1137 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1138 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1139 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1140 && { echo i486-ncr-sysv4; exit; } ;;
1141 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1142 OS_REL='.3'
1143 test -r /etc/.relid \
1144 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1145 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1146 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1147 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1148 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1149 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1150 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1151 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1152 echo m68k-unknown-lynxos${UNAME_RELEASE}
1153 exit ;;
1154 mc68030:UNIX_System_V:4.*:*)
1155 echo m68k-atari-sysv4
1156 exit ;;
1157 TSUNAMI:LynxOS:2.*:*)
1158 echo sparc-unknown-lynxos${UNAME_RELEASE}
1159 exit ;;
1160 rs6000:LynxOS:2.*:*)
1161 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1162 exit ;;
1163 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1164 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1165 exit ;;
1166 SM[BE]S:UNIX_SV:*:*)
1167 echo mips-dde-sysv${UNAME_RELEASE}
1168 exit ;;
1169 RM*:ReliantUNIX-*:*:*)
1170 echo mips-sni-sysv4
1171 exit ;;
1172 RM*:SINIX-*:*:*)
1173 echo mips-sni-sysv4
1174 exit ;;
1175 *:SINIX-*:*:*)
1176 if uname -p 2>/dev/null >/dev/null ; then
1177 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1178 echo ${UNAME_MACHINE}-sni-sysv4
1179 else
1180 echo ns32k-sni-sysv
1181 fi
1182 exit ;;
1183 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1184 # says <Richard.M.Bartel@ccMail.Census.GOV>
1185 echo i586-unisys-sysv4
1186 exit ;;
1187 *:UNIX_System_V:4*:FTX*)
1188 # From Gerald Hewes <hewes@openmarket.com>.
1189 # How about differentiating between stratus architectures? -djm
1190 echo hppa1.1-stratus-sysv4
1191 exit ;;
1192 *:*:*:FTX*)
1193 # From seanf@swdc.stratus.com.
1194 echo i860-stratus-sysv4
1195 exit ;;
1196 i*86:VOS:*:*)
1197 # From Paul.Green@stratus.com.
1198 echo ${UNAME_MACHINE}-stratus-vos
1199 exit ;;
1200 *:VOS:*:*)
1201 # From Paul.Green@stratus.com.
1202 echo hppa1.1-stratus-vos
1203 exit ;;
1204 mc68*:A/UX:*:*)
1205 echo m68k-apple-aux${UNAME_RELEASE}
1206 exit ;;
1207 news*:NEWS-OS:6*:*)
1208 echo mips-sony-newsos6
1209 exit ;;
1210 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1211 if [ -d /usr/nec ]; then
1212 echo mips-nec-sysv${UNAME_RELEASE}
1213 else
1214 echo mips-unknown-sysv${UNAME_RELEASE}
1215 fi
1216 exit ;;
1217 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1218 echo powerpc-be-beos
1219 exit ;;
1220 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1221 echo powerpc-apple-beos
1222 exit ;;
1223 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1224 echo i586-pc-beos
1225 exit ;;
1226 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1227 echo i586-pc-haiku
1228 exit ;;
1229 x86_64:Haiku:*:*)
1230 echo x86_64-unknown-haiku
1231 exit ;;
1232 SX-4:SUPER-UX:*:*)
1233 echo sx4-nec-superux${UNAME_RELEASE}
1234 exit ;;
1235 SX-5:SUPER-UX:*:*)
1236 echo sx5-nec-superux${UNAME_RELEASE}
1237 exit ;;
1238 SX-6:SUPER-UX:*:*)
1239 echo sx6-nec-superux${UNAME_RELEASE}
1240 exit ;;
1241 SX-7:SUPER-UX:*:*)
1242 echo sx7-nec-superux${UNAME_RELEASE}
1243 exit ;;
1244 SX-8:SUPER-UX:*:*)
1245 echo sx8-nec-superux${UNAME_RELEASE}
1246 exit ;;
1247 SX-8R:SUPER-UX:*:*)
1248 echo sx8r-nec-superux${UNAME_RELEASE}
1249 exit ;;
1250 Power*:Rhapsody:*:*)
1251 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1252 exit ;;
1253 *:Rhapsody:*:*)
1254 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1255 exit ;;
1256 *:Darwin:*:*)
1257 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1258 eval $set_cc_for_build
1259 if test "$UNAME_PROCESSOR" = unknown ; then
1260 UNAME_PROCESSOR=powerpc
1261 fi
1262 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1263 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1264 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1265 grep IS_64BIT_ARCH >/dev/null
1266 then
1267 case $UNAME_PROCESSOR in
1268 i386) UNAME_PROCESSOR=x86_64 ;;
1269 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1270 esac
1271 fi
1272 fi
1273 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1274 exit ;;
1275 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1276 UNAME_PROCESSOR=`uname -p`
1277 if test "$UNAME_PROCESSOR" = "x86"; then
1278 UNAME_PROCESSOR=i386
1279 UNAME_MACHINE=pc
1280 fi
1281 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1282 exit ;;
1283 *:QNX:*:4*)
1284 echo i386-pc-qnx
1285 exit ;;
1286 NEO-?:NONSTOP_KERNEL:*:*)
1287 echo neo-tandem-nsk${UNAME_RELEASE}
1288 exit ;;
1289 NSE-*:NONSTOP_KERNEL:*:*)
1290 echo nse-tandem-nsk${UNAME_RELEASE}
1291 exit ;;
1292 NSR-?:NONSTOP_KERNEL:*:*)
1293 echo nsr-tandem-nsk${UNAME_RELEASE}
1294 exit ;;
1295 *:NonStop-UX:*:*)
1296 echo mips-compaq-nonstopux
1297 exit ;;
1298 BS2000:POSIX*:*:*)
1299 echo bs2000-siemens-sysv
1300 exit ;;
1301 DS/*:UNIX_System_V:*:*)
1302 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1303 exit ;;
1304 *:Plan9:*:*)
1305 # "uname -m" is not consistent, so use $cputype instead. 386
1306 # is converted to i386 for consistency with other x86
1307 # operating systems.
1308 if test "$cputype" = "386"; then
1309 UNAME_MACHINE=i386
1310 else
1311 UNAME_MACHINE="$cputype"
1312 fi
1313 echo ${UNAME_MACHINE}-unknown-plan9
1314 exit ;;
1315 *:TOPS-10:*:*)
1316 echo pdp10-unknown-tops10
1317 exit ;;
1318 *:TENEX:*:*)
1319 echo pdp10-unknown-tenex
1320 exit ;;
1321 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1322 echo pdp10-dec-tops20
1323 exit ;;
1324 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1325 echo pdp10-xkl-tops20
1326 exit ;;
1327 *:TOPS-20:*:*)
1328 echo pdp10-unknown-tops20
1329 exit ;;
1330 *:ITS:*:*)
1331 echo pdp10-unknown-its
1332 exit ;;
1333 SEI:*:*:SEIUX)
1334 echo mips-sei-seiux${UNAME_RELEASE}
1335 exit ;;
1336 *:DragonFly:*:*)
1337 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1338 exit ;;
1339 *:*VMS:*:*)
1340 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1341 case "${UNAME_MACHINE}" in
1342 A*) echo alpha-dec-vms ; exit ;;
1343 I*) echo ia64-dec-vms ; exit ;;
1344 V*) echo vax-dec-vms ; exit ;;
1345 esac ;;
1346 *:XENIX:*:SysV)
1347 echo i386-pc-xenix
1348 exit ;;
1349 i*86:skyos:*:*)
1350 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1351 exit ;;
1352 i*86:rdos:*:*)
1353 echo ${UNAME_MACHINE}-pc-rdos
1354 exit ;;
1355 i*86:AROS:*:*)
1356 echo ${UNAME_MACHINE}-pc-aros
1357 exit ;;
1358 x86_64:VMkernel:*:*)
1359 echo ${UNAME_MACHINE}-unknown-esx
1360 exit ;;
1361 esac
1362
1363 eval $set_cc_for_build
1364 cat >$dummy.c <<EOF
1365 #ifdef _SEQUENT_
1366 # include <sys/types.h>
1367 # include <sys/utsname.h>
1368 #endif
1369 main ()
1370 {
1371 #if defined (sony)
1372 #if defined (MIPSEB)
1373 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1374 I don't know.... */
1375 printf ("mips-sony-bsd\n"); exit (0);
1376 #else
1377 #include <sys/param.h>
1378 printf ("m68k-sony-newsos%s\n",
1379 #ifdef NEWSOS4
1380 "4"
1381 #else
1382 ""
1383 #endif
1384 ); exit (0);
1385 #endif
1386 #endif
1387
1388 #if defined (__arm) && defined (__acorn) && defined (__unix)
1389 printf ("arm-acorn-riscix\n"); exit (0);
1390 #endif
1391
1392 #if defined (hp300) && !defined (hpux)
1393 printf ("m68k-hp-bsd\n"); exit (0);
1394 #endif
1395
1396 #if defined (NeXT)
1397 #if !defined (__ARCHITECTURE__)
1398 #define __ARCHITECTURE__ "m68k"
1399 #endif
1400 int version;
1401 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1402 if (version < 4)
1403 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1404 else
1405 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1406 exit (0);
1407 #endif
1408
1409 #if defined (MULTIMAX) || defined (n16)
1410 #if defined (UMAXV)
1411 printf ("ns32k-encore-sysv\n"); exit (0);
1412 #else
1413 #if defined (CMU)
1414 printf ("ns32k-encore-mach\n"); exit (0);
1415 #else
1416 printf ("ns32k-encore-bsd\n"); exit (0);
1417 #endif
1418 #endif
1419 #endif
1420
1421 #if defined (__386BSD__)
1422 printf ("i386-pc-bsd\n"); exit (0);
1423 #endif
1424
1425 #if defined (sequent)
1426 #if defined (i386)
1427 printf ("i386-sequent-dynix\n"); exit (0);
1428 #endif
1429 #if defined (ns32000)
1430 printf ("ns32k-sequent-dynix\n"); exit (0);
1431 #endif
1432 #endif
1433
1434 #if defined (_SEQUENT_)
1435 struct utsname un;
1436
1437 uname(&un);
1438
1439 if (strncmp(un.version, "V2", 2) == 0) {
1440 printf ("i386-sequent-ptx2\n"); exit (0);
1441 }
1442 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1443 printf ("i386-sequent-ptx1\n"); exit (0);
1444 }
1445 printf ("i386-sequent-ptx\n"); exit (0);
1446
1447 #endif
1448
1449 #if defined (vax)
1450 # if !defined (ultrix)
1451 # include <sys/param.h>
1452 # if defined (BSD)
1453 # if BSD == 43
1454 printf ("vax-dec-bsd4.3\n"); exit (0);
1455 # else
1456 # if BSD == 199006
1457 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1458 # else
1459 printf ("vax-dec-bsd\n"); exit (0);
1460 # endif
1461 # endif
1462 # else
1463 printf ("vax-dec-bsd\n"); exit (0);
1464 # endif
1465 # else
1466 printf ("vax-dec-ultrix\n"); exit (0);
1467 # endif
1468 #endif
1469
1470 #if defined (alliant) && defined (i860)
1471 printf ("i860-alliant-bsd\n"); exit (0);
1472 #endif
1473
1474 exit (1);
1475 }
1476 EOF
1477
1478 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1479 { echo "$SYSTEM_NAME"; exit; }
1480
1481 # Apollos put the system type in the environment.
1482
1483 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1484
1485 # Convex versions that predate uname can use getsysinfo(1)
1486
1487 if [ -x /usr/convex/getsysinfo ]
1488 then
1489 case `getsysinfo -f cpu_type` in
1490 c1*)
1491 echo c1-convex-bsd
1492 exit ;;
1493 c2*)
1494 if getsysinfo -f scalar_acc
1495 then echo c32-convex-bsd
1496 else echo c2-convex-bsd
1497 fi
1498 exit ;;
1499 c34*)
1500 echo c34-convex-bsd
1501 exit ;;
1502 c38*)
1503 echo c38-convex-bsd
1504 exit ;;
1505 c4*)
1506 echo c4-convex-bsd
1507 exit ;;
1508 esac
1509 fi
1510
1511 cat >&2 <<EOF
1512 $0: unable to guess system type
1513
1514 This script, last modified $timestamp, has failed to recognize
1515 the operating system you are using. It is advised that you
1516 download the most up to date version of the config scripts from
1517
1518 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1519 and
1520 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1521
1522 If the version you run ($0) is already up to date, please
1523 send the following data and any information you think might be
1524 pertinent to <config-patches@gnu.org> in order to provide the needed
1525 information to handle your system.
1526
1527 config.guess timestamp = $timestamp
1528
1529 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1530 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1531 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1532 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1533
1534 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1535 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1536
1537 hostinfo = `(hostinfo) 2>/dev/null`
1538 /bin/universe = `(/bin/universe) 2>/dev/null`
1539 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1540 /bin/arch = `(/bin/arch) 2>/dev/null`
1541 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1542 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1543
1544 UNAME_MACHINE = ${UNAME_MACHINE}
1545 UNAME_RELEASE = ${UNAME_RELEASE}
1546 UNAME_SYSTEM = ${UNAME_SYSTEM}
1547 UNAME_VERSION = ${UNAME_VERSION}
1548 EOF
1549
1550 exit 1
1551
1552 # Local variables:
1553 # eval: (add-hook 'write-file-hooks 'time-stamp)
1554 # time-stamp-start: "timestamp='"
1555 # time-stamp-format: "%:y-%02m-%02d"
1556 # time-stamp-end: "'"
1557 # End:
3232 /* Define to 1 if you have the <unistd.h> header file. */
3333 #undef HAVE_UNISTD_H
3434
35 /* Define to the sub-directory in which libtool stores uninstalled libraries.
36 */
35 /* Define to the sub-directory where libtool stores uninstalled libraries. */
3736 #undef LT_OBJDIR
3837
3938 /* Name of package */
0 #! /bin/sh
1 # Output a system dependent set of variables, describing how to set the
2 # run time search path of shared libraries in an executable.
3 #
4 # Copyright 1996-2010 Free Software Foundation, Inc.
5 # Taken from GNU libtool, 2001
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 #
8 # This file is free software; the Free Software Foundation gives
9 # unlimited permission to copy and/or distribute it, with or without
10 # modifications, as long as this notice is preserved.
11 #
12 # The first argument passed to this file is the canonical host specification,
13 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
14 # or
15 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
16 # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
17 # should be set by the caller.
18 #
19 # The set of defined variables is at the end of this script.
20
21 # Known limitations:
22 # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
23 # than 256 bytes, otherwise the compiler driver will dump core. The only
24 # known workaround is to choose shorter directory names for the build
25 # directory and/or the installation directory.
26
27 # All known linkers require a `.a' archive for static linking (except MSVC,
28 # which needs '.lib').
29 libext=a
30 shrext=.so
31
32 host="$1"
33 host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
34 host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
35 host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
36
37 # Code taken from libtool.m4's _LT_CC_BASENAME.
38
39 for cc_temp in $CC""; do
40 case $cc_temp in
41 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
42 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
43 \-*) ;;
44 *) break;;
45 esac
46 done
47 cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
48
49 # Code taken from libtool.m4's _LT_COMPILER_PIC.
50
51 wl=
52 if test "$GCC" = yes; then
53 wl='-Wl,'
54 else
55 case "$host_os" in
56 aix*)
57 wl='-Wl,'
58 ;;
59 darwin*)
60 case $cc_basename in
61 xlc*)
62 wl='-Wl,'
63 ;;
64 esac
65 ;;
66 mingw* | cygwin* | pw32* | os2* | cegcc*)
67 ;;
68 hpux9* | hpux10* | hpux11*)
69 wl='-Wl,'
70 ;;
71 irix5* | irix6* | nonstopux*)
72 wl='-Wl,'
73 ;;
74 newsos6)
75 ;;
76 linux* | k*bsd*-gnu)
77 case $cc_basename in
78 ecc*)
79 wl='-Wl,'
80 ;;
81 icc* | ifort*)
82 wl='-Wl,'
83 ;;
84 lf95*)
85 wl='-Wl,'
86 ;;
87 pgcc | pgf77 | pgf90)
88 wl='-Wl,'
89 ;;
90 ccc*)
91 wl='-Wl,'
92 ;;
93 como)
94 wl='-lopt='
95 ;;
96 *)
97 case `$CC -V 2>&1 | sed 5q` in
98 *Sun\ C*)
99 wl='-Wl,'
100 ;;
101 esac
102 ;;
103 esac
104 ;;
105 osf3* | osf4* | osf5*)
106 wl='-Wl,'
107 ;;
108 rdos*)
109 ;;
110 solaris*)
111 wl='-Wl,'
112 ;;
113 sunos4*)
114 wl='-Qoption ld '
115 ;;
116 sysv4 | sysv4.2uw2* | sysv4.3*)
117 wl='-Wl,'
118 ;;
119 sysv4*MP*)
120 ;;
121 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
122 wl='-Wl,'
123 ;;
124 unicos*)
125 wl='-Wl,'
126 ;;
127 uts4*)
128 ;;
129 esac
130 fi
131
132 # Code taken from libtool.m4's _LT_LINKER_SHLIBS.
133
134 hardcode_libdir_flag_spec=
135 hardcode_libdir_separator=
136 hardcode_direct=no
137 hardcode_minus_L=no
138
139 case "$host_os" in
140 cygwin* | mingw* | pw32* | cegcc*)
141 # FIXME: the MSVC++ port hasn't been tested in a loooong time
142 # When not using gcc, we currently assume that we are using
143 # Microsoft Visual C++.
144 if test "$GCC" != yes; then
145 with_gnu_ld=no
146 fi
147 ;;
148 interix*)
149 # we just hope/assume this is gcc and not c89 (= MSVC++)
150 with_gnu_ld=yes
151 ;;
152 openbsd*)
153 with_gnu_ld=no
154 ;;
155 esac
156
157 ld_shlibs=yes
158 if test "$with_gnu_ld" = yes; then
159 # Set some defaults for GNU ld with shared library support. These
160 # are reset later if shared libraries are not supported. Putting them
161 # here allows them to be overridden if necessary.
162 # Unlike libtool, we use -rpath here, not --rpath, since the documented
163 # option of GNU ld is called -rpath, not --rpath.
164 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
165 case "$host_os" in
166 aix[3-9]*)
167 # On AIX/PPC, the GNU linker is very broken
168 if test "$host_cpu" != ia64; then
169 ld_shlibs=no
170 fi
171 ;;
172 amigaos*)
173 hardcode_libdir_flag_spec='-L$libdir'
174 hardcode_minus_L=yes
175 # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
176 # that the semantics of dynamic libraries on AmigaOS, at least up
177 # to version 4, is to share data among multiple programs linked
178 # with the same dynamic library. Since this doesn't match the
179 # behavior of shared libraries on other platforms, we cannot use
180 # them.
181 ld_shlibs=no
182 ;;
183 beos*)
184 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
185 :
186 else
187 ld_shlibs=no
188 fi
189 ;;
190 cygwin* | mingw* | pw32* | cegcc*)
191 # hardcode_libdir_flag_spec is actually meaningless, as there is
192 # no search path for DLLs.
193 hardcode_libdir_flag_spec='-L$libdir'
194 if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
195 :
196 else
197 ld_shlibs=no
198 fi
199 ;;
200 interix[3-9]*)
201 hardcode_direct=no
202 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
203 ;;
204 gnu* | linux* | k*bsd*-gnu)
205 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
206 :
207 else
208 ld_shlibs=no
209 fi
210 ;;
211 netbsd*)
212 ;;
213 solaris*)
214 if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
215 ld_shlibs=no
216 elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
217 :
218 else
219 ld_shlibs=no
220 fi
221 ;;
222 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
223 case `$LD -v 2>&1` in
224 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
225 ld_shlibs=no
226 ;;
227 *)
228 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
229 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
230 else
231 ld_shlibs=no
232 fi
233 ;;
234 esac
235 ;;
236 sunos4*)
237 hardcode_direct=yes
238 ;;
239 *)
240 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
241 :
242 else
243 ld_shlibs=no
244 fi
245 ;;
246 esac
247 if test "$ld_shlibs" = no; then
248 hardcode_libdir_flag_spec=
249 fi
250 else
251 case "$host_os" in
252 aix3*)
253 # Note: this linker hardcodes the directories in LIBPATH if there
254 # are no directories specified by -L.
255 hardcode_minus_L=yes
256 if test "$GCC" = yes; then
257 # Neither direct hardcoding nor static linking is supported with a
258 # broken collect2.
259 hardcode_direct=unsupported
260 fi
261 ;;
262 aix[4-9]*)
263 if test "$host_cpu" = ia64; then
264 # On IA64, the linker does run time linking by default, so we don't
265 # have to do anything special.
266 aix_use_runtimelinking=no
267 else
268 aix_use_runtimelinking=no
269 # Test if we are trying to use run time linking or normal
270 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
271 # need to do runtime linking.
272 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
273 for ld_flag in $LDFLAGS; do
274 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
275 aix_use_runtimelinking=yes
276 break
277 fi
278 done
279 ;;
280 esac
281 fi
282 hardcode_direct=yes
283 hardcode_libdir_separator=':'
284 if test "$GCC" = yes; then
285 case $host_os in aix4.[012]|aix4.[012].*)
286 collect2name=`${CC} -print-prog-name=collect2`
287 if test -f "$collect2name" && \
288 strings "$collect2name" | grep resolve_lib_name >/dev/null
289 then
290 # We have reworked collect2
291 :
292 else
293 # We have old collect2
294 hardcode_direct=unsupported
295 hardcode_minus_L=yes
296 hardcode_libdir_flag_spec='-L$libdir'
297 hardcode_libdir_separator=
298 fi
299 ;;
300 esac
301 fi
302 # Begin _LT_AC_SYS_LIBPATH_AIX.
303 echo 'int main () { return 0; }' > conftest.c
304 ${CC} ${LDFLAGS} conftest.c -o conftest
305 aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
306 }'`
307 if test -z "$aix_libpath"; then
308 aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
309 }'`
310 fi
311 if test -z "$aix_libpath"; then
312 aix_libpath="/usr/lib:/lib"
313 fi
314 rm -f conftest.c conftest
315 # End _LT_AC_SYS_LIBPATH_AIX.
316 if test "$aix_use_runtimelinking" = yes; then
317 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
318 else
319 if test "$host_cpu" = ia64; then
320 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
321 else
322 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
323 fi
324 fi
325 ;;
326 amigaos*)
327 hardcode_libdir_flag_spec='-L$libdir'
328 hardcode_minus_L=yes
329 # see comment about different semantics on the GNU ld section
330 ld_shlibs=no
331 ;;
332 bsdi[45]*)
333 ;;
334 cygwin* | mingw* | pw32* | cegcc*)
335 # When not using gcc, we currently assume that we are using
336 # Microsoft Visual C++.
337 # hardcode_libdir_flag_spec is actually meaningless, as there is
338 # no search path for DLLs.
339 hardcode_libdir_flag_spec=' '
340 libext=lib
341 ;;
342 darwin* | rhapsody*)
343 hardcode_direct=no
344 if test "$GCC" = yes ; then
345 :
346 else
347 case $cc_basename in
348 xlc*)
349 ;;
350 *)
351 ld_shlibs=no
352 ;;
353 esac
354 fi
355 ;;
356 dgux*)
357 hardcode_libdir_flag_spec='-L$libdir'
358 ;;
359 freebsd1*)
360 ld_shlibs=no
361 ;;
362 freebsd2.2*)
363 hardcode_libdir_flag_spec='-R$libdir'
364 hardcode_direct=yes
365 ;;
366 freebsd2*)
367 hardcode_direct=yes
368 hardcode_minus_L=yes
369 ;;
370 freebsd* | dragonfly*)
371 hardcode_libdir_flag_spec='-R$libdir'
372 hardcode_direct=yes
373 ;;
374 hpux9*)
375 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
376 hardcode_libdir_separator=:
377 hardcode_direct=yes
378 # hardcode_minus_L: Not really in the search PATH,
379 # but as the default location of the library.
380 hardcode_minus_L=yes
381 ;;
382 hpux10*)
383 if test "$with_gnu_ld" = no; then
384 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
385 hardcode_libdir_separator=:
386 hardcode_direct=yes
387 # hardcode_minus_L: Not really in the search PATH,
388 # but as the default location of the library.
389 hardcode_minus_L=yes
390 fi
391 ;;
392 hpux11*)
393 if test "$with_gnu_ld" = no; then
394 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
395 hardcode_libdir_separator=:
396 case $host_cpu in
397 hppa*64*|ia64*)
398 hardcode_direct=no
399 ;;
400 *)
401 hardcode_direct=yes
402 # hardcode_minus_L: Not really in the search PATH,
403 # but as the default location of the library.
404 hardcode_minus_L=yes
405 ;;
406 esac
407 fi
408 ;;
409 irix5* | irix6* | nonstopux*)
410 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
411 hardcode_libdir_separator=:
412 ;;
413 netbsd*)
414 hardcode_libdir_flag_spec='-R$libdir'
415 hardcode_direct=yes
416 ;;
417 newsos6)
418 hardcode_direct=yes
419 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
420 hardcode_libdir_separator=:
421 ;;
422 openbsd*)
423 if test -f /usr/libexec/ld.so; then
424 hardcode_direct=yes
425 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
426 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
427 else
428 case "$host_os" in
429 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
430 hardcode_libdir_flag_spec='-R$libdir'
431 ;;
432 *)
433 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
434 ;;
435 esac
436 fi
437 else
438 ld_shlibs=no
439 fi
440 ;;
441 os2*)
442 hardcode_libdir_flag_spec='-L$libdir'
443 hardcode_minus_L=yes
444 ;;
445 osf3*)
446 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
447 hardcode_libdir_separator=:
448 ;;
449 osf4* | osf5*)
450 if test "$GCC" = yes; then
451 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
452 else
453 # Both cc and cxx compiler support -rpath directly
454 hardcode_libdir_flag_spec='-rpath $libdir'
455 fi
456 hardcode_libdir_separator=:
457 ;;
458 solaris*)
459 hardcode_libdir_flag_spec='-R$libdir'
460 ;;
461 sunos4*)
462 hardcode_libdir_flag_spec='-L$libdir'
463 hardcode_direct=yes
464 hardcode_minus_L=yes
465 ;;
466 sysv4)
467 case $host_vendor in
468 sni)
469 hardcode_direct=yes # is this really true???
470 ;;
471 siemens)
472 hardcode_direct=no
473 ;;
474 motorola)
475 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
476 ;;
477 esac
478 ;;
479 sysv4.3*)
480 ;;
481 sysv4*MP*)
482 if test -d /usr/nec; then
483 ld_shlibs=yes
484 fi
485 ;;
486 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
487 ;;
488 sysv5* | sco3.2v5* | sco5v6*)
489 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
490 hardcode_libdir_separator=':'
491 ;;
492 uts4*)
493 hardcode_libdir_flag_spec='-L$libdir'
494 ;;
495 *)
496 ld_shlibs=no
497 ;;
498 esac
499 fi
500
501 # Check dynamic linker characteristics
502 # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
503 # Unlike libtool.m4, here we don't care about _all_ names of the library, but
504 # only about the one the linker finds when passed -lNAME. This is the last
505 # element of library_names_spec in libtool.m4, or possibly two of them if the
506 # linker has special search rules.
507 library_names_spec= # the last element of library_names_spec in libtool.m4
508 libname_spec='lib$name'
509 case "$host_os" in
510 aix3*)
511 library_names_spec='$libname.a'
512 ;;
513 aix[4-9]*)
514 library_names_spec='$libname$shrext'
515 ;;
516 amigaos*)
517 library_names_spec='$libname.a'
518 ;;
519 beos*)
520 library_names_spec='$libname$shrext'
521 ;;
522 bsdi[45]*)
523 library_names_spec='$libname$shrext'
524 ;;
525 cygwin* | mingw* | pw32* | cegcc*)
526 shrext=.dll
527 library_names_spec='$libname.dll.a $libname.lib'
528 ;;
529 darwin* | rhapsody*)
530 shrext=.dylib
531 library_names_spec='$libname$shrext'
532 ;;
533 dgux*)
534 library_names_spec='$libname$shrext'
535 ;;
536 freebsd1*)
537 ;;
538 freebsd* | dragonfly*)
539 case "$host_os" in
540 freebsd[123]*)
541 library_names_spec='$libname$shrext$versuffix' ;;
542 *)
543 library_names_spec='$libname$shrext' ;;
544 esac
545 ;;
546 gnu*)
547 library_names_spec='$libname$shrext'
548 ;;
549 hpux9* | hpux10* | hpux11*)
550 case $host_cpu in
551 ia64*)
552 shrext=.so
553 ;;
554 hppa*64*)
555 shrext=.sl
556 ;;
557 *)
558 shrext=.sl
559 ;;
560 esac
561 library_names_spec='$libname$shrext'
562 ;;
563 interix[3-9]*)
564 library_names_spec='$libname$shrext'
565 ;;
566 irix5* | irix6* | nonstopux*)
567 library_names_spec='$libname$shrext'
568 case "$host_os" in
569 irix5* | nonstopux*)
570 libsuff= shlibsuff=
571 ;;
572 *)
573 case $LD in
574 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
575 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
576 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
577 *) libsuff= shlibsuff= ;;
578 esac
579 ;;
580 esac
581 ;;
582 linux*oldld* | linux*aout* | linux*coff*)
583 ;;
584 linux* | k*bsd*-gnu)
585 library_names_spec='$libname$shrext'
586 ;;
587 knetbsd*-gnu)
588 library_names_spec='$libname$shrext'
589 ;;
590 netbsd*)
591 library_names_spec='$libname$shrext'
592 ;;
593 newsos6)
594 library_names_spec='$libname$shrext'
595 ;;
596 nto-qnx*)
597 library_names_spec='$libname$shrext'
598 ;;
599 openbsd*)
600 library_names_spec='$libname$shrext$versuffix'
601 ;;
602 os2*)
603 libname_spec='$name'
604 shrext=.dll
605 library_names_spec='$libname.a'
606 ;;
607 osf3* | osf4* | osf5*)
608 library_names_spec='$libname$shrext'
609 ;;
610 rdos*)
611 ;;
612 solaris*)
613 library_names_spec='$libname$shrext'
614 ;;
615 sunos4*)
616 library_names_spec='$libname$shrext$versuffix'
617 ;;
618 sysv4 | sysv4.3*)
619 library_names_spec='$libname$shrext'
620 ;;
621 sysv4*MP*)
622 library_names_spec='$libname$shrext'
623 ;;
624 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
625 library_names_spec='$libname$shrext'
626 ;;
627 uts4*)
628 library_names_spec='$libname$shrext'
629 ;;
630 esac
631
632 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
633 escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
634 shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
635 escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
636 escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
637 escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
638
639 LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
640
641 # How to pass a linker flag through the compiler.
642 wl="$escaped_wl"
643
644 # Static library suffix (normally "a").
645 libext="$libext"
646
647 # Shared library suffix (normally "so").
648 shlibext="$shlibext"
649
650 # Format of library name prefix.
651 libname_spec="$escaped_libname_spec"
652
653 # Library names that the linker finds when passed -lNAME.
654 library_names_spec="$escaped_library_names_spec"
655
656 # Flag to hardcode \$libdir into a binary during linking.
657 # This must work even if \$libdir does not exist.
658 hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
659
660 # Whether we need a single -rpath flag with a separated argument.
661 hardcode_libdir_separator="$hardcode_libdir_separator"
662
663 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
664 # resulting binary.
665 hardcode_direct="$hardcode_direct"
666
667 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
668 # resulting binary.
669 hardcode_minus_L="$hardcode_minus_L"
670
671 EOF
+0
-1788
config.sub less more
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright 1992-2013 Free Software Foundation, Inc.
3
4 timestamp='2013-04-24'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches with a ChangeLog entry to config-patches@gnu.org.
28 #
29 # Configuration subroutine to validate and canonicalize a configuration type.
30 # Supply the specified configuration type as an argument.
31 # If it is invalid, we print an error message on stderr and exit with code 1.
32 # Otherwise, we print the canonical config type on stdout and succeed.
33
34 # You can get the latest version of this script from:
35 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
36
37 # This file is supposed to be the same for all GNU packages
38 # and recognize all the CPU types, system types and aliases
39 # that are meaningful with *any* GNU software.
40 # Each package is responsible for reporting which valid configurations
41 # it does not support. The user should be able to distinguish
42 # a failure to support a valid configuration from a meaningless
43 # configuration.
44
45 # The goal of this file is to map all the various variations of a given
46 # machine specification into a single specification in the form:
47 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
48 # or in some cases, the newer four-part form:
49 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
50 # It is wrong to echo any other type of specification.
51
52 me=`echo "$0" | sed -e 's,.*/,,'`
53
54 usage="\
55 Usage: $0 [OPTION] CPU-MFR-OPSYS
56 $0 [OPTION] ALIAS
57
58 Canonicalize a configuration name.
59
60 Operation modes:
61 -h, --help print this help, then exit
62 -t, --time-stamp print date of last modification, then exit
63 -v, --version print version number, then exit
64
65 Report bugs and patches to <config-patches@gnu.org>."
66
67 version="\
68 GNU config.sub ($timestamp)
69
70 Copyright 1992-2013 Free Software Foundation, Inc.
71
72 This is free software; see the source for copying conditions. There is NO
73 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
74
75 help="
76 Try \`$me --help' for more information."
77
78 # Parse command line
79 while test $# -gt 0 ; do
80 case $1 in
81 --time-stamp | --time* | -t )
82 echo "$timestamp" ; exit ;;
83 --version | -v )
84 echo "$version" ; exit ;;
85 --help | --h* | -h )
86 echo "$usage"; exit ;;
87 -- ) # Stop option processing
88 shift; break ;;
89 - ) # Use stdin as input.
90 break ;;
91 -* )
92 echo "$me: invalid option $1$help"
93 exit 1 ;;
94
95 *local*)
96 # First pass through any local machine types.
97 echo $1
98 exit ;;
99
100 * )
101 break ;;
102 esac
103 done
104
105 case $# in
106 0) echo "$me: missing argument$help" >&2
107 exit 1;;
108 1) ;;
109 *) echo "$me: too many arguments$help" >&2
110 exit 1;;
111 esac
112
113 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
114 # Here we must recognize all the valid KERNEL-OS combinations.
115 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116 case $maybe_os in
117 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119 knetbsd*-gnu* | netbsd*-gnu* | \
120 kopensolaris*-gnu* | \
121 storm-chaos* | os2-emx* | rtmk-nova*)
122 os=-$maybe_os
123 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124 ;;
125 android-linux)
126 os=-linux-android
127 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128 ;;
129 *)
130 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131 if [ $basic_machine != $1 ]
132 then os=`echo $1 | sed 's/.*-/-/'`
133 else os=; fi
134 ;;
135 esac
136
137 ### Let's recognize common machines as not being operating systems so
138 ### that things like config.sub decstation-3100 work. We also
139 ### recognize some manufacturers as not being operating systems, so we
140 ### can provide default operating systems below.
141 case $os in
142 -sun*os*)
143 # Prevent following clause from handling this invalid input.
144 ;;
145 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151 -apple | -axis | -knuth | -cray | -microblaze*)
152 os=
153 basic_machine=$1
154 ;;
155 -bluegene*)
156 os=-cnk
157 ;;
158 -sim | -cisco | -oki | -wec | -winbond)
159 os=
160 basic_machine=$1
161 ;;
162 -scout)
163 ;;
164 -wrs)
165 os=-vxworks
166 basic_machine=$1
167 ;;
168 -chorusos*)
169 os=-chorusos
170 basic_machine=$1
171 ;;
172 -chorusrdb)
173 os=-chorusrdb
174 basic_machine=$1
175 ;;
176 -hiux*)
177 os=-hiuxwe2
178 ;;
179 -sco6)
180 os=-sco5v6
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco5)
184 os=-sco3.2v5
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco4)
188 os=-sco3.2v4
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2.[4-9]*)
192 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco3.2v[4-9]*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco5v6*)
200 # Don't forget version if it is 3.2v4 or newer.
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -sco*)
204 os=-sco3.2v2
205 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206 ;;
207 -udk*)
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -isc)
211 os=-isc2.2
212 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
213 ;;
214 -clix*)
215 basic_machine=clipper-intergraph
216 ;;
217 -isc*)
218 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219 ;;
220 -lynx*178)
221 os=-lynxos178
222 ;;
223 -lynx*5)
224 os=-lynxos5
225 ;;
226 -lynx*)
227 os=-lynxos
228 ;;
229 -ptx*)
230 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231 ;;
232 -windowsnt*)
233 os=`echo $os | sed -e 's/windowsnt/winnt/'`
234 ;;
235 -psos*)
236 os=-psos
237 ;;
238 -mint | -mint[0-9]*)
239 basic_machine=m68k-atari
240 os=-mint
241 ;;
242 esac
243
244 # Decode aliases for certain CPU-COMPANY combinations.
245 case $basic_machine in
246 # Recognize the basic CPU types without company name.
247 # Some are omitted here because they have special meanings below.
248 1750a | 580 \
249 | a29k \
250 | aarch64 | aarch64_be \
251 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
252 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
253 | am33_2.0 \
254 | arc | arceb \
255 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256 | avr | avr32 \
257 | be32 | be64 \
258 | bfin \
259 | c4x | clipper \
260 | d10v | d30v | dlx | dsp16xx \
261 | epiphany \
262 | fido | fr30 | frv \
263 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
264 | hexagon \
265 | i370 | i860 | i960 | ia64 \
266 | ip2k | iq2000 \
267 | le32 | le64 \
268 | lm32 \
269 | m32c | m32r | m32rle | m68000 | m68k | m88k \
270 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
271 | mips | mipsbe | mipseb | mipsel | mipsle \
272 | mips16 \
273 | mips64 | mips64el \
274 | mips64octeon | mips64octeonel \
275 | mips64orion | mips64orionel \
276 | mips64r5900 | mips64r5900el \
277 | mips64vr | mips64vrel \
278 | mips64vr4100 | mips64vr4100el \
279 | mips64vr4300 | mips64vr4300el \
280 | mips64vr5000 | mips64vr5000el \
281 | mips64vr5900 | mips64vr5900el \
282 | mipsisa32 | mipsisa32el \
283 | mipsisa32r2 | mipsisa32r2el \
284 | mipsisa64 | mipsisa64el \
285 | mipsisa64r2 | mipsisa64r2el \
286 | mipsisa64sb1 | mipsisa64sb1el \
287 | mipsisa64sr71k | mipsisa64sr71kel \
288 | mipsr5900 | mipsr5900el \
289 | mipstx39 | mipstx39el \
290 | mn10200 | mn10300 \
291 | moxie \
292 | mt \
293 | msp430 \
294 | nds32 | nds32le | nds32be \
295 | nios | nios2 | nios2eb | nios2el \
296 | ns16k | ns32k \
297 | open8 \
298 | or1k | or32 \
299 | pdp10 | pdp11 | pj | pjl \
300 | powerpc | powerpc64 | powerpc64le | powerpcle \
301 | pyramid \
302 | rl78 | rx \
303 | score \
304 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
305 | sh64 | sh64le \
306 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
307 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
308 | spu \
309 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
310 | ubicom32 \
311 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
312 | we32k \
313 | x86 | xc16x | xstormy16 | xtensa \
314 | z8k | z80)
315 basic_machine=$basic_machine-unknown
316 ;;
317 c54x)
318 basic_machine=tic54x-unknown
319 ;;
320 c55x)
321 basic_machine=tic55x-unknown
322 ;;
323 c6x)
324 basic_machine=tic6x-unknown
325 ;;
326 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
327 basic_machine=$basic_machine-unknown
328 os=-none
329 ;;
330 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
331 ;;
332 ms1)
333 basic_machine=mt-unknown
334 ;;
335
336 strongarm | thumb | xscale)
337 basic_machine=arm-unknown
338 ;;
339 xgate)
340 basic_machine=$basic_machine-unknown
341 os=-none
342 ;;
343 xscaleeb)
344 basic_machine=armeb-unknown
345 ;;
346
347 xscaleel)
348 basic_machine=armel-unknown
349 ;;
350
351 # We use `pc' rather than `unknown'
352 # because (1) that's what they normally are, and
353 # (2) the word "unknown" tends to confuse beginning users.
354 i*86 | x86_64)
355 basic_machine=$basic_machine-pc
356 ;;
357 # Object if more than one company name word.
358 *-*-*)
359 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
360 exit 1
361 ;;
362 # Recognize the basic CPU types with company name.
363 580-* \
364 | a29k-* \
365 | aarch64-* | aarch64_be-* \
366 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
367 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
368 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
369 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
370 | avr-* | avr32-* \
371 | be32-* | be64-* \
372 | bfin-* | bs2000-* \
373 | c[123]* | c30-* | [cjt]90-* | c4x-* \
374 | clipper-* | craynv-* | cydra-* \
375 | d10v-* | d30v-* | dlx-* \
376 | elxsi-* \
377 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
378 | h8300-* | h8500-* \
379 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
380 | hexagon-* \
381 | i*86-* | i860-* | i960-* | ia64-* \
382 | ip2k-* | iq2000-* \
383 | le32-* | le64-* \
384 | lm32-* \
385 | m32c-* | m32r-* | m32rle-* \
386 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
387 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
388 | microblaze-* | microblazeel-* \
389 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
390 | mips16-* \
391 | mips64-* | mips64el-* \
392 | mips64octeon-* | mips64octeonel-* \
393 | mips64orion-* | mips64orionel-* \
394 | mips64r5900-* | mips64r5900el-* \
395 | mips64vr-* | mips64vrel-* \
396 | mips64vr4100-* | mips64vr4100el-* \
397 | mips64vr4300-* | mips64vr4300el-* \
398 | mips64vr5000-* | mips64vr5000el-* \
399 | mips64vr5900-* | mips64vr5900el-* \
400 | mipsisa32-* | mipsisa32el-* \
401 | mipsisa32r2-* | mipsisa32r2el-* \
402 | mipsisa64-* | mipsisa64el-* \
403 | mipsisa64r2-* | mipsisa64r2el-* \
404 | mipsisa64sb1-* | mipsisa64sb1el-* \
405 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
406 | mipsr5900-* | mipsr5900el-* \
407 | mipstx39-* | mipstx39el-* \
408 | mmix-* \
409 | mt-* \
410 | msp430-* \
411 | nds32-* | nds32le-* | nds32be-* \
412 | nios-* | nios2-* | nios2eb-* | nios2el-* \
413 | none-* | np1-* | ns16k-* | ns32k-* \
414 | open8-* \
415 | orion-* \
416 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
417 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
418 | pyramid-* \
419 | rl78-* | romp-* | rs6000-* | rx-* \
420 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
421 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
422 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
423 | sparclite-* \
424 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
425 | tahoe-* \
426 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
427 | tile*-* \
428 | tron-* \
429 | ubicom32-* \
430 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
431 | vax-* \
432 | we32k-* \
433 | x86-* | x86_64-* | xc16x-* | xps100-* \
434 | xstormy16-* | xtensa*-* \
435 | ymp-* \
436 | z8k-* | z80-*)
437 ;;
438 # Recognize the basic CPU types without company name, with glob match.
439 xtensa*)
440 basic_machine=$basic_machine-unknown
441 ;;
442 # Recognize the various machine names and aliases which stand
443 # for a CPU type and a company and sometimes even an OS.
444 386bsd)
445 basic_machine=i386-unknown
446 os=-bsd
447 ;;
448 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
449 basic_machine=m68000-att
450 ;;
451 3b*)
452 basic_machine=we32k-att
453 ;;
454 a29khif)
455 basic_machine=a29k-amd
456 os=-udi
457 ;;
458 abacus)
459 basic_machine=abacus-unknown
460 ;;
461 adobe68k)
462 basic_machine=m68010-adobe
463 os=-scout
464 ;;
465 alliant | fx80)
466 basic_machine=fx80-alliant
467 ;;
468 altos | altos3068)
469 basic_machine=m68k-altos
470 ;;
471 am29k)
472 basic_machine=a29k-none
473 os=-bsd
474 ;;
475 amd64)
476 basic_machine=x86_64-pc
477 ;;
478 amd64-*)
479 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
480 ;;
481 amdahl)
482 basic_machine=580-amdahl
483 os=-sysv
484 ;;
485 amiga | amiga-*)
486 basic_machine=m68k-unknown
487 ;;
488 amigaos | amigados)
489 basic_machine=m68k-unknown
490 os=-amigaos
491 ;;
492 amigaunix | amix)
493 basic_machine=m68k-unknown
494 os=-sysv4
495 ;;
496 apollo68)
497 basic_machine=m68k-apollo
498 os=-sysv
499 ;;
500 apollo68bsd)
501 basic_machine=m68k-apollo
502 os=-bsd
503 ;;
504 aros)
505 basic_machine=i386-pc
506 os=-aros
507 ;;
508 aux)
509 basic_machine=m68k-apple
510 os=-aux
511 ;;
512 balance)
513 basic_machine=ns32k-sequent
514 os=-dynix
515 ;;
516 blackfin)
517 basic_machine=bfin-unknown
518 os=-linux
519 ;;
520 blackfin-*)
521 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
522 os=-linux
523 ;;
524 bluegene*)
525 basic_machine=powerpc-ibm
526 os=-cnk
527 ;;
528 c54x-*)
529 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
530 ;;
531 c55x-*)
532 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
533 ;;
534 c6x-*)
535 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
536 ;;
537 c90)
538 basic_machine=c90-cray
539 os=-unicos
540 ;;
541 cegcc)
542 basic_machine=arm-unknown
543 os=-cegcc
544 ;;
545 convex-c1)
546 basic_machine=c1-convex
547 os=-bsd
548 ;;
549 convex-c2)
550 basic_machine=c2-convex
551 os=-bsd
552 ;;
553 convex-c32)
554 basic_machine=c32-convex
555 os=-bsd
556 ;;
557 convex-c34)
558 basic_machine=c34-convex
559 os=-bsd
560 ;;
561 convex-c38)
562 basic_machine=c38-convex
563 os=-bsd
564 ;;
565 cray | j90)
566 basic_machine=j90-cray
567 os=-unicos
568 ;;
569 craynv)
570 basic_machine=craynv-cray
571 os=-unicosmp
572 ;;
573 cr16 | cr16-*)
574 basic_machine=cr16-unknown
575 os=-elf
576 ;;
577 crds | unos)
578 basic_machine=m68k-crds
579 ;;
580 crisv32 | crisv32-* | etraxfs*)
581 basic_machine=crisv32-axis
582 ;;
583 cris | cris-* | etrax*)
584 basic_machine=cris-axis
585 ;;
586 crx)
587 basic_machine=crx-unknown
588 os=-elf
589 ;;
590 da30 | da30-*)
591 basic_machine=m68k-da30
592 ;;
593 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
594 basic_machine=mips-dec
595 ;;
596 decsystem10* | dec10*)
597 basic_machine=pdp10-dec
598 os=-tops10
599 ;;
600 decsystem20* | dec20*)
601 basic_machine=pdp10-dec
602 os=-tops20
603 ;;
604 delta | 3300 | motorola-3300 | motorola-delta \
605 | 3300-motorola | delta-motorola)
606 basic_machine=m68k-motorola
607 ;;
608 delta88)
609 basic_machine=m88k-motorola
610 os=-sysv3
611 ;;
612 dicos)
613 basic_machine=i686-pc
614 os=-dicos
615 ;;
616 djgpp)
617 basic_machine=i586-pc
618 os=-msdosdjgpp
619 ;;
620 dpx20 | dpx20-*)
621 basic_machine=rs6000-bull
622 os=-bosx
623 ;;
624 dpx2* | dpx2*-bull)
625 basic_machine=m68k-bull
626 os=-sysv3
627 ;;
628 ebmon29k)
629 basic_machine=a29k-amd
630 os=-ebmon
631 ;;
632 elxsi)
633 basic_machine=elxsi-elxsi
634 os=-bsd
635 ;;
636 encore | umax | mmax)
637 basic_machine=ns32k-encore
638 ;;
639 es1800 | OSE68k | ose68k | ose | OSE)
640 basic_machine=m68k-ericsson
641 os=-ose
642 ;;
643 fx2800)
644 basic_machine=i860-alliant
645 ;;
646 genix)
647 basic_machine=ns32k-ns
648 ;;
649 gmicro)
650 basic_machine=tron-gmicro
651 os=-sysv
652 ;;
653 go32)
654 basic_machine=i386-pc
655 os=-go32
656 ;;
657 h3050r* | hiux*)
658 basic_machine=hppa1.1-hitachi
659 os=-hiuxwe2
660 ;;
661 h8300hms)
662 basic_machine=h8300-hitachi
663 os=-hms
664 ;;
665 h8300xray)
666 basic_machine=h8300-hitachi
667 os=-xray
668 ;;
669 h8500hms)
670 basic_machine=h8500-hitachi
671 os=-hms
672 ;;
673 harris)
674 basic_machine=m88k-harris
675 os=-sysv3
676 ;;
677 hp300-*)
678 basic_machine=m68k-hp
679 ;;
680 hp300bsd)
681 basic_machine=m68k-hp
682 os=-bsd
683 ;;
684 hp300hpux)
685 basic_machine=m68k-hp
686 os=-hpux
687 ;;
688 hp3k9[0-9][0-9] | hp9[0-9][0-9])
689 basic_machine=hppa1.0-hp
690 ;;
691 hp9k2[0-9][0-9] | hp9k31[0-9])
692 basic_machine=m68000-hp
693 ;;
694 hp9k3[2-9][0-9])
695 basic_machine=m68k-hp
696 ;;
697 hp9k6[0-9][0-9] | hp6[0-9][0-9])
698 basic_machine=hppa1.0-hp
699 ;;
700 hp9k7[0-79][0-9] | hp7[0-79][0-9])
701 basic_machine=hppa1.1-hp
702 ;;
703 hp9k78[0-9] | hp78[0-9])
704 # FIXME: really hppa2.0-hp
705 basic_machine=hppa1.1-hp
706 ;;
707 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
708 # FIXME: really hppa2.0-hp
709 basic_machine=hppa1.1-hp
710 ;;
711 hp9k8[0-9][13679] | hp8[0-9][13679])
712 basic_machine=hppa1.1-hp
713 ;;
714 hp9k8[0-9][0-9] | hp8[0-9][0-9])
715 basic_machine=hppa1.0-hp
716 ;;
717 hppa-next)
718 os=-nextstep3
719 ;;
720 hppaosf)
721 basic_machine=hppa1.1-hp
722 os=-osf
723 ;;
724 hppro)
725 basic_machine=hppa1.1-hp
726 os=-proelf
727 ;;
728 i370-ibm* | ibm*)
729 basic_machine=i370-ibm
730 ;;
731 i*86v32)
732 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
733 os=-sysv32
734 ;;
735 i*86v4*)
736 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
737 os=-sysv4
738 ;;
739 i*86v)
740 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
741 os=-sysv
742 ;;
743 i*86sol2)
744 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
745 os=-solaris2
746 ;;
747 i386mach)
748 basic_machine=i386-mach
749 os=-mach
750 ;;
751 i386-vsta | vsta)
752 basic_machine=i386-unknown
753 os=-vsta
754 ;;
755 iris | iris4d)
756 basic_machine=mips-sgi
757 case $os in
758 -irix*)
759 ;;
760 *)
761 os=-irix4
762 ;;
763 esac
764 ;;
765 isi68 | isi)
766 basic_machine=m68k-isi
767 os=-sysv
768 ;;
769 m68knommu)
770 basic_machine=m68k-unknown
771 os=-linux
772 ;;
773 m68knommu-*)
774 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
775 os=-linux
776 ;;
777 m88k-omron*)
778 basic_machine=m88k-omron
779 ;;
780 magnum | m3230)
781 basic_machine=mips-mips
782 os=-sysv
783 ;;
784 merlin)
785 basic_machine=ns32k-utek
786 os=-sysv
787 ;;
788 microblaze*)
789 basic_machine=microblaze-xilinx
790 ;;
791 mingw64)
792 basic_machine=x86_64-pc
793 os=-mingw64
794 ;;
795 mingw32)
796 basic_machine=i386-pc
797 os=-mingw32
798 ;;
799 mingw32ce)
800 basic_machine=arm-unknown
801 os=-mingw32ce
802 ;;
803 miniframe)
804 basic_machine=m68000-convergent
805 ;;
806 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
807 basic_machine=m68k-atari
808 os=-mint
809 ;;
810 mips3*-*)
811 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
812 ;;
813 mips3*)
814 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
815 ;;
816 monitor)
817 basic_machine=m68k-rom68k
818 os=-coff
819 ;;
820 morphos)
821 basic_machine=powerpc-unknown
822 os=-morphos
823 ;;
824 msdos)
825 basic_machine=i386-pc
826 os=-msdos
827 ;;
828 ms1-*)
829 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
830 ;;
831 msys)
832 basic_machine=i386-pc
833 os=-msys
834 ;;
835 mvs)
836 basic_machine=i370-ibm
837 os=-mvs
838 ;;
839 nacl)
840 basic_machine=le32-unknown
841 os=-nacl
842 ;;
843 ncr3000)
844 basic_machine=i486-ncr
845 os=-sysv4
846 ;;
847 netbsd386)
848 basic_machine=i386-unknown
849 os=-netbsd
850 ;;
851 netwinder)
852 basic_machine=armv4l-rebel
853 os=-linux
854 ;;
855 news | news700 | news800 | news900)
856 basic_machine=m68k-sony
857 os=-newsos
858 ;;
859 news1000)
860 basic_machine=m68030-sony
861 os=-newsos
862 ;;
863 news-3600 | risc-news)
864 basic_machine=mips-sony
865 os=-newsos
866 ;;
867 necv70)
868 basic_machine=v70-nec
869 os=-sysv
870 ;;
871 next | m*-next )
872 basic_machine=m68k-next
873 case $os in
874 -nextstep* )
875 ;;
876 -ns2*)
877 os=-nextstep2
878 ;;
879 *)
880 os=-nextstep3
881 ;;
882 esac
883 ;;
884 nh3000)
885 basic_machine=m68k-harris
886 os=-cxux
887 ;;
888 nh[45]000)
889 basic_machine=m88k-harris
890 os=-cxux
891 ;;
892 nindy960)
893 basic_machine=i960-intel
894 os=-nindy
895 ;;
896 mon960)
897 basic_machine=i960-intel
898 os=-mon960
899 ;;
900 nonstopux)
901 basic_machine=mips-compaq
902 os=-nonstopux
903 ;;
904 np1)
905 basic_machine=np1-gould
906 ;;
907 neo-tandem)
908 basic_machine=neo-tandem
909 ;;
910 nse-tandem)
911 basic_machine=nse-tandem
912 ;;
913 nsr-tandem)
914 basic_machine=nsr-tandem
915 ;;
916 op50n-* | op60c-*)
917 basic_machine=hppa1.1-oki
918 os=-proelf
919 ;;
920 openrisc | openrisc-*)
921 basic_machine=or32-unknown
922 ;;
923 os400)
924 basic_machine=powerpc-ibm
925 os=-os400
926 ;;
927 OSE68000 | ose68000)
928 basic_machine=m68000-ericsson
929 os=-ose
930 ;;
931 os68k)
932 basic_machine=m68k-none
933 os=-os68k
934 ;;
935 pa-hitachi)
936 basic_machine=hppa1.1-hitachi
937 os=-hiuxwe2
938 ;;
939 paragon)
940 basic_machine=i860-intel
941 os=-osf
942 ;;
943 parisc)
944 basic_machine=hppa-unknown
945 os=-linux
946 ;;
947 parisc-*)
948 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
949 os=-linux
950 ;;
951 pbd)
952 basic_machine=sparc-tti
953 ;;
954 pbb)
955 basic_machine=m68k-tti
956 ;;
957 pc532 | pc532-*)
958 basic_machine=ns32k-pc532
959 ;;
960 pc98)
961 basic_machine=i386-pc
962 ;;
963 pc98-*)
964 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
965 ;;
966 pentium | p5 | k5 | k6 | nexgen | viac3)
967 basic_machine=i586-pc
968 ;;
969 pentiumpro | p6 | 6x86 | athlon | athlon_*)
970 basic_machine=i686-pc
971 ;;
972 pentiumii | pentium2 | pentiumiii | pentium3)
973 basic_machine=i686-pc
974 ;;
975 pentium4)
976 basic_machine=i786-pc
977 ;;
978 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
979 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
980 ;;
981 pentiumpro-* | p6-* | 6x86-* | athlon-*)
982 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
983 ;;
984 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
985 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
986 ;;
987 pentium4-*)
988 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
989 ;;
990 pn)
991 basic_machine=pn-gould
992 ;;
993 power) basic_machine=power-ibm
994 ;;
995 ppc | ppcbe) basic_machine=powerpc-unknown
996 ;;
997 ppc-* | ppcbe-*)
998 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
999 ;;
1000 ppcle | powerpclittle | ppc-le | powerpc-little)
1001 basic_machine=powerpcle-unknown
1002 ;;
1003 ppcle-* | powerpclittle-*)
1004 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1005 ;;
1006 ppc64) basic_machine=powerpc64-unknown
1007 ;;
1008 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1009 ;;
1010 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1011 basic_machine=powerpc64le-unknown
1012 ;;
1013 ppc64le-* | powerpc64little-*)
1014 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1015 ;;
1016 ps2)
1017 basic_machine=i386-ibm
1018 ;;
1019 pw32)
1020 basic_machine=i586-unknown
1021 os=-pw32
1022 ;;
1023 rdos | rdos64)
1024 basic_machine=x86_64-pc
1025 os=-rdos
1026 ;;
1027 rdos32)
1028 basic_machine=i386-pc
1029 os=-rdos
1030 ;;
1031 rom68k)
1032 basic_machine=m68k-rom68k
1033 os=-coff
1034 ;;
1035 rm[46]00)
1036 basic_machine=mips-siemens
1037 ;;
1038 rtpc | rtpc-*)
1039 basic_machine=romp-ibm
1040 ;;
1041 s390 | s390-*)
1042 basic_machine=s390-ibm
1043 ;;
1044 s390x | s390x-*)
1045 basic_machine=s390x-ibm
1046 ;;
1047 sa29200)
1048 basic_machine=a29k-amd
1049 os=-udi
1050 ;;
1051 sb1)
1052 basic_machine=mipsisa64sb1-unknown
1053 ;;
1054 sb1el)
1055 basic_machine=mipsisa64sb1el-unknown
1056 ;;
1057 sde)
1058 basic_machine=mipsisa32-sde
1059 os=-elf
1060 ;;
1061 sei)
1062 basic_machine=mips-sei
1063 os=-seiux
1064 ;;
1065 sequent)
1066 basic_machine=i386-sequent
1067 ;;
1068 sh)
1069 basic_machine=sh-hitachi
1070 os=-hms
1071 ;;
1072 sh5el)
1073 basic_machine=sh5le-unknown
1074 ;;
1075 sh64)
1076 basic_machine=sh64-unknown
1077 ;;
1078 sparclite-wrs | simso-wrs)
1079 basic_machine=sparclite-wrs
1080 os=-vxworks
1081 ;;
1082 sps7)
1083 basic_machine=m68k-bull
1084 os=-sysv2
1085 ;;
1086 spur)
1087 basic_machine=spur-unknown
1088 ;;
1089 st2000)
1090 basic_machine=m68k-tandem
1091 ;;
1092 stratus)
1093 basic_machine=i860-stratus
1094 os=-sysv4
1095 ;;
1096 strongarm-* | thumb-*)
1097 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1098 ;;
1099 sun2)
1100 basic_machine=m68000-sun
1101 ;;
1102 sun2os3)
1103 basic_machine=m68000-sun
1104 os=-sunos3
1105 ;;
1106 sun2os4)
1107 basic_machine=m68000-sun
1108 os=-sunos4
1109 ;;
1110 sun3os3)
1111 basic_machine=m68k-sun
1112 os=-sunos3
1113 ;;
1114 sun3os4)
1115 basic_machine=m68k-sun
1116 os=-sunos4
1117 ;;
1118 sun4os3)
1119 basic_machine=sparc-sun
1120 os=-sunos3
1121 ;;
1122 sun4os4)
1123 basic_machine=sparc-sun
1124 os=-sunos4
1125 ;;
1126 sun4sol2)
1127 basic_machine=sparc-sun
1128 os=-solaris2
1129 ;;
1130 sun3 | sun3-*)
1131 basic_machine=m68k-sun
1132 ;;
1133 sun4)
1134 basic_machine=sparc-sun
1135 ;;
1136 sun386 | sun386i | roadrunner)
1137 basic_machine=i386-sun
1138 ;;
1139 sv1)
1140 basic_machine=sv1-cray
1141 os=-unicos
1142 ;;
1143 symmetry)
1144 basic_machine=i386-sequent
1145 os=-dynix
1146 ;;
1147 t3e)
1148 basic_machine=alphaev5-cray
1149 os=-unicos
1150 ;;
1151 t90)
1152 basic_machine=t90-cray
1153 os=-unicos
1154 ;;
1155 tile*)
1156 basic_machine=$basic_machine-unknown
1157 os=-linux-gnu
1158 ;;
1159 tx39)
1160 basic_machine=mipstx39-unknown
1161 ;;
1162 tx39el)
1163 basic_machine=mipstx39el-unknown
1164 ;;
1165 toad1)
1166 basic_machine=pdp10-xkl
1167 os=-tops20
1168 ;;
1169 tower | tower-32)
1170 basic_machine=m68k-ncr
1171 ;;
1172 tpf)
1173 basic_machine=s390x-ibm
1174 os=-tpf
1175 ;;
1176 udi29k)
1177 basic_machine=a29k-amd
1178 os=-udi
1179 ;;
1180 ultra3)
1181 basic_machine=a29k-nyu
1182 os=-sym1
1183 ;;
1184 v810 | necv810)
1185 basic_machine=v810-nec
1186 os=-none
1187 ;;
1188 vaxv)
1189 basic_machine=vax-dec
1190 os=-sysv
1191 ;;
1192 vms)
1193 basic_machine=vax-dec
1194 os=-vms
1195 ;;
1196 vpp*|vx|vx-*)
1197 basic_machine=f301-fujitsu
1198 ;;
1199 vxworks960)
1200 basic_machine=i960-wrs
1201 os=-vxworks
1202 ;;
1203 vxworks68)
1204 basic_machine=m68k-wrs
1205 os=-vxworks
1206 ;;
1207 vxworks29k)
1208 basic_machine=a29k-wrs
1209 os=-vxworks
1210 ;;
1211 w65*)
1212 basic_machine=w65-wdc
1213 os=-none
1214 ;;
1215 w89k-*)
1216 basic_machine=hppa1.1-winbond
1217 os=-proelf
1218 ;;
1219 xbox)
1220 basic_machine=i686-pc
1221 os=-mingw32
1222 ;;
1223 xps | xps100)
1224 basic_machine=xps100-honeywell
1225 ;;
1226 xscale-* | xscalee[bl]-*)
1227 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1228 ;;
1229 ymp)
1230 basic_machine=ymp-cray
1231 os=-unicos
1232 ;;
1233 z8k-*-coff)
1234 basic_machine=z8k-unknown
1235 os=-sim
1236 ;;
1237 z80-*-coff)
1238 basic_machine=z80-unknown
1239 os=-sim
1240 ;;
1241 none)
1242 basic_machine=none-none
1243 os=-none
1244 ;;
1245
1246 # Here we handle the default manufacturer of certain CPU types. It is in
1247 # some cases the only manufacturer, in others, it is the most popular.
1248 w89k)
1249 basic_machine=hppa1.1-winbond
1250 ;;
1251 op50n)
1252 basic_machine=hppa1.1-oki
1253 ;;
1254 op60c)
1255 basic_machine=hppa1.1-oki
1256 ;;
1257 romp)
1258 basic_machine=romp-ibm
1259 ;;
1260 mmix)
1261 basic_machine=mmix-knuth
1262 ;;
1263 rs6000)
1264 basic_machine=rs6000-ibm
1265 ;;
1266 vax)
1267 basic_machine=vax-dec
1268 ;;
1269 pdp10)
1270 # there are many clones, so DEC is not a safe bet
1271 basic_machine=pdp10-unknown
1272 ;;
1273 pdp11)
1274 basic_machine=pdp11-dec
1275 ;;
1276 we32k)
1277 basic_machine=we32k-att
1278 ;;
1279 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1280 basic_machine=sh-unknown
1281 ;;
1282 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1283 basic_machine=sparc-sun
1284 ;;
1285 cydra)
1286 basic_machine=cydra-cydrome
1287 ;;
1288 orion)
1289 basic_machine=orion-highlevel
1290 ;;
1291 orion105)
1292 basic_machine=clipper-highlevel
1293 ;;
1294 mac | mpw | mac-mpw)
1295 basic_machine=m68k-apple
1296 ;;
1297 pmac | pmac-mpw)
1298 basic_machine=powerpc-apple
1299 ;;
1300 *-unknown)
1301 # Make sure to match an already-canonicalized machine name.
1302 ;;
1303 *)
1304 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1305 exit 1
1306 ;;
1307 esac
1308
1309 # Here we canonicalize certain aliases for manufacturers.
1310 case $basic_machine in
1311 *-digital*)
1312 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1313 ;;
1314 *-commodore*)
1315 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1316 ;;
1317 *)
1318 ;;
1319 esac
1320
1321 # Decode manufacturer-specific aliases for certain operating systems.
1322
1323 if [ x"$os" != x"" ]
1324 then
1325 case $os in
1326 # First match some system type aliases
1327 # that might get confused with valid system types.
1328 # -solaris* is a basic system type, with this one exception.
1329 -auroraux)
1330 os=-auroraux
1331 ;;
1332 -solaris1 | -solaris1.*)
1333 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1334 ;;
1335 -solaris)
1336 os=-solaris2
1337 ;;
1338 -svr4*)
1339 os=-sysv4
1340 ;;
1341 -unixware*)
1342 os=-sysv4.2uw
1343 ;;
1344 -gnu/linux*)
1345 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1346 ;;
1347 # First accept the basic system types.
1348 # The portable systems comes first.
1349 # Each alternative MUST END IN A *, to match a version number.
1350 # -sysv* is not here because it comes later, after sysvr4.
1351 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1352 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1353 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1354 | -sym* | -kopensolaris* | -plan9* \
1355 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1356 | -aos* | -aros* \
1357 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1358 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1359 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1360 | -bitrig* | -openbsd* | -solidbsd* \
1361 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1362 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1363 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1364 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1365 | -chorusos* | -chorusrdb* | -cegcc* \
1366 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1367 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1368 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1369 | -uxpv* | -beos* | -mpeix* | -udk* \
1370 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1371 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1372 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1373 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1374 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1375 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1376 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1377 # Remember, each alternative MUST END IN *, to match a version number.
1378 ;;
1379 -qnx*)
1380 case $basic_machine in
1381 x86-* | i*86-*)
1382 ;;
1383 *)
1384 os=-nto$os
1385 ;;
1386 esac
1387 ;;
1388 -nto-qnx*)
1389 ;;
1390 -nto*)
1391 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1392 ;;
1393 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1394 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1395 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1396 ;;
1397 -mac*)
1398 os=`echo $os | sed -e 's|mac|macos|'`
1399 ;;
1400 -linux-dietlibc)
1401 os=-linux-dietlibc
1402 ;;
1403 -linux*)
1404 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1405 ;;
1406 -sunos5*)
1407 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1408 ;;
1409 -sunos6*)
1410 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1411 ;;
1412 -opened*)
1413 os=-openedition
1414 ;;
1415 -os400*)
1416 os=-os400
1417 ;;
1418 -wince*)
1419 os=-wince
1420 ;;
1421 -osfrose*)
1422 os=-osfrose
1423 ;;
1424 -osf*)
1425 os=-osf
1426 ;;
1427 -utek*)
1428 os=-bsd
1429 ;;
1430 -dynix*)
1431 os=-bsd
1432 ;;
1433 -acis*)
1434 os=-aos
1435 ;;
1436 -atheos*)
1437 os=-atheos
1438 ;;
1439 -syllable*)
1440 os=-syllable
1441 ;;
1442 -386bsd)
1443 os=-bsd
1444 ;;
1445 -ctix* | -uts*)
1446 os=-sysv
1447 ;;
1448 -nova*)
1449 os=-rtmk-nova
1450 ;;
1451 -ns2 )
1452 os=-nextstep2
1453 ;;
1454 -nsk*)
1455 os=-nsk
1456 ;;
1457 # Preserve the version number of sinix5.
1458 -sinix5.*)
1459 os=`echo $os | sed -e 's|sinix|sysv|'`
1460 ;;
1461 -sinix*)
1462 os=-sysv4
1463 ;;
1464 -tpf*)
1465 os=-tpf
1466 ;;
1467 -triton*)
1468 os=-sysv3
1469 ;;
1470 -oss*)
1471 os=-sysv3
1472 ;;
1473 -svr4)
1474 os=-sysv4
1475 ;;
1476 -svr3)
1477 os=-sysv3
1478 ;;
1479 -sysvr4)
1480 os=-sysv4
1481 ;;
1482 # This must come after -sysvr4.
1483 -sysv*)
1484 ;;
1485 -ose*)
1486 os=-ose
1487 ;;
1488 -es1800*)
1489 os=-ose
1490 ;;
1491 -xenix)
1492 os=-xenix
1493 ;;
1494 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1495 os=-mint
1496 ;;
1497 -aros*)
1498 os=-aros
1499 ;;
1500 -zvmoe)
1501 os=-zvmoe
1502 ;;
1503 -dicos*)
1504 os=-dicos
1505 ;;
1506 -nacl*)
1507 ;;
1508 -none)
1509 ;;
1510 *)
1511 # Get rid of the `-' at the beginning of $os.
1512 os=`echo $os | sed 's/[^-]*-//'`
1513 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1514 exit 1
1515 ;;
1516 esac
1517 else
1518
1519 # Here we handle the default operating systems that come with various machines.
1520 # The value should be what the vendor currently ships out the door with their
1521 # machine or put another way, the most popular os provided with the machine.
1522
1523 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1524 # "-sun"), then you have to tell the case statement up towards the top
1525 # that MANUFACTURER isn't an operating system. Otherwise, code above
1526 # will signal an error saying that MANUFACTURER isn't an operating
1527 # system, and we'll never get to this point.
1528
1529 case $basic_machine in
1530 score-*)
1531 os=-elf
1532 ;;
1533 spu-*)
1534 os=-elf
1535 ;;
1536 *-acorn)
1537 os=-riscix1.2
1538 ;;
1539 arm*-rebel)
1540 os=-linux
1541 ;;
1542 arm*-semi)
1543 os=-aout
1544 ;;
1545 c4x-* | tic4x-*)
1546 os=-coff
1547 ;;
1548 hexagon-*)
1549 os=-elf
1550 ;;
1551 tic54x-*)
1552 os=-coff
1553 ;;
1554 tic55x-*)
1555 os=-coff
1556 ;;
1557 tic6x-*)
1558 os=-coff
1559 ;;
1560 # This must come before the *-dec entry.
1561 pdp10-*)
1562 os=-tops20
1563 ;;
1564 pdp11-*)
1565 os=-none
1566 ;;
1567 *-dec | vax-*)
1568 os=-ultrix4.2
1569 ;;
1570 m68*-apollo)
1571 os=-domain
1572 ;;
1573 i386-sun)
1574 os=-sunos4.0.2
1575 ;;
1576 m68000-sun)
1577 os=-sunos3
1578 ;;
1579 m68*-cisco)
1580 os=-aout
1581 ;;
1582 mep-*)
1583 os=-elf
1584 ;;
1585 mips*-cisco)
1586 os=-elf
1587 ;;
1588 mips*-*)
1589 os=-elf
1590 ;;
1591 or1k-*)
1592 os=-elf
1593 ;;
1594 or32-*)
1595 os=-coff
1596 ;;
1597 *-tti) # must be before sparc entry or we get the wrong os.
1598 os=-sysv3
1599 ;;
1600 sparc-* | *-sun)
1601 os=-sunos4.1.1
1602 ;;
1603 *-be)
1604 os=-beos
1605 ;;
1606 *-haiku)
1607 os=-haiku
1608 ;;
1609 *-ibm)
1610 os=-aix
1611 ;;
1612 *-knuth)
1613 os=-mmixware
1614 ;;
1615 *-wec)
1616 os=-proelf
1617 ;;
1618 *-winbond)
1619 os=-proelf
1620 ;;
1621 *-oki)
1622 os=-proelf
1623 ;;
1624 *-hp)
1625 os=-hpux
1626 ;;
1627 *-hitachi)
1628 os=-hiux
1629 ;;
1630 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1631 os=-sysv
1632 ;;
1633 *-cbm)
1634 os=-amigaos
1635 ;;
1636 *-dg)
1637 os=-dgux
1638 ;;
1639 *-dolphin)
1640 os=-sysv3
1641 ;;
1642 m68k-ccur)
1643 os=-rtu
1644 ;;
1645 m88k-omron*)
1646 os=-luna
1647 ;;
1648 *-next )
1649 os=-nextstep
1650 ;;
1651 *-sequent)
1652 os=-ptx
1653 ;;
1654 *-crds)
1655 os=-unos
1656 ;;
1657 *-ns)
1658 os=-genix
1659 ;;
1660 i370-*)
1661 os=-mvs
1662 ;;
1663 *-next)
1664 os=-nextstep3
1665 ;;
1666 *-gould)
1667 os=-sysv
1668 ;;
1669 *-highlevel)
1670 os=-bsd
1671 ;;
1672 *-encore)
1673 os=-bsd
1674 ;;
1675 *-sgi)
1676 os=-irix
1677 ;;
1678 *-siemens)
1679 os=-sysv4
1680 ;;
1681 *-masscomp)
1682 os=-rtu
1683 ;;
1684 f30[01]-fujitsu | f700-fujitsu)
1685 os=-uxpv
1686 ;;
1687 *-rom68k)
1688 os=-coff
1689 ;;
1690 *-*bug)
1691 os=-coff
1692 ;;
1693 *-apple)
1694 os=-macos
1695 ;;
1696 *-atari*)
1697 os=-mint
1698 ;;
1699 *)
1700 os=-none
1701 ;;
1702 esac
1703 fi
1704
1705 # Here we handle the case where we know the os, and the CPU type, but not the
1706 # manufacturer. We pick the logical manufacturer.
1707 vendor=unknown
1708 case $basic_machine in
1709 *-unknown)
1710 case $os in
1711 -riscix*)
1712 vendor=acorn
1713 ;;
1714 -sunos*)
1715 vendor=sun
1716 ;;
1717 -cnk*|-aix*)
1718 vendor=ibm
1719 ;;
1720 -beos*)
1721 vendor=be
1722 ;;
1723 -hpux*)
1724 vendor=hp
1725 ;;
1726 -mpeix*)
1727 vendor=hp
1728 ;;
1729 -hiux*)
1730 vendor=hitachi
1731 ;;
1732 -unos*)
1733 vendor=crds
1734 ;;
1735 -dgux*)
1736 vendor=dg
1737 ;;
1738 -luna*)
1739 vendor=omron
1740 ;;
1741 -genix*)
1742 vendor=ns
1743 ;;
1744 -mvs* | -opened*)
1745 vendor=ibm
1746 ;;
1747 -os400*)
1748 vendor=ibm
1749 ;;
1750 -ptx*)
1751 vendor=sequent
1752 ;;
1753 -tpf*)
1754 vendor=ibm
1755 ;;
1756 -vxsim* | -vxworks* | -windiss*)
1757 vendor=wrs
1758 ;;
1759 -aux*)
1760 vendor=apple
1761 ;;
1762 -hms*)
1763 vendor=hitachi
1764 ;;
1765 -mpw* | -macos*)
1766 vendor=apple
1767 ;;
1768 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1769 vendor=atari
1770 ;;
1771 -vos*)
1772 vendor=stratus
1773 ;;
1774 esac
1775 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1776 ;;
1777 esac
1778
1779 echo $basic_machine$os
1780 exit
1781
1782 # Local variables:
1783 # eval: (add-hook 'write-file-hooks 'time-stamp)
1784 # time-stamp-start: "timestamp='"
1785 # time-stamp-format: "%:y-%02m-%02d"
1786 # time-stamp-end: "'"
1787 # End:
+1307
-899
configure less more
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for libdiscid 0.6.1.
2 # Generated by GNU Autoconf 2.69 for libdiscid 0.6.2.
33 #
44 #
55 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
586586 # Identity of this package.
587587 PACKAGE_NAME='libdiscid'
588588 PACKAGE_TARNAME='libdiscid'
589 PACKAGE_VERSION='0.6.1'
590 PACKAGE_STRING='libdiscid 0.6.1'
589 PACKAGE_VERSION='0.6.2'
590 PACKAGE_STRING='libdiscid 0.6.2'
591591 PACKAGE_BUGREPORT=''
592592 PACKAGE_URL=''
593593
638638 RUN_TESTS_TRUE
639639 RC
640640 CPP
641 LT_SYS_LIBRARY_PATH
641642 OTOOL64
642643 OTOOL
643644 LIPO
779780 enable_static
780781 with_pic
781782 enable_fast_install
783 with_aix_soname
782784 with_gnu_ld
783785 with_sysroot
784786 enable_libtool_lock
791793 LDFLAGS
792794 LIBS
793795 CPPFLAGS
796 LT_SYS_LIBRARY_PATH
794797 CPP'
795798
796799
13321335 # Omit some internal or obsolete options to make the list less imposing.
13331336 # This message is too long to be a string in the A/UX 3.1 sh.
13341337 cat <<_ACEOF
1335 \`configure' configures libdiscid 0.6.1 to adapt to many kinds of systems.
1338 \`configure' configures libdiscid 0.6.2 to adapt to many kinds of systems.
13361339
13371340 Usage: $0 [OPTION]... [VAR=VALUE]...
13381341
14021405
14031406 if test -n "$ac_init_help"; then
14041407 case $ac_init_help in
1405 short | recursive ) echo "Configuration of libdiscid 0.6.1:";;
1408 short | recursive ) echo "Configuration of libdiscid 0.6.2:";;
14061409 esac
14071410 cat <<\_ACEOF
14081411
14271430 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
14281431 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
14291432 both]
1433 --with-aix-soname=aix|svr4|both
1434 shared library versioning (aka "SONAME") variant to
1435 provide on AIX, [default=aix].
14301436 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1431 --with-sysroot=DIR Search for dependent libraries within DIR
1432 (or the compiler's sysroot if not specified).
1437 --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
1438 compiler's sysroot if not specified).
14331439
14341440 Some influential environment variables:
14351441 CC C compiler command
14391445 LIBS libraries to pass to the linker, e.g. -l<library>
14401446 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
14411447 you have headers in a nonstandard directory <include dir>
1448 LT_SYS_LIBRARY_PATH
1449 User-defined run-time library search path.
14421450 CPP C preprocessor
14431451
14441452 Use these variables to override the choices made by `configure' or to help
15071515 test -n "$ac_init_help" && exit $ac_status
15081516 if $ac_init_version; then
15091517 cat <<\_ACEOF
1510 libdiscid configure 0.6.1
1518 libdiscid configure 0.6.2
15111519 generated by GNU Autoconf 2.69
15121520
15131521 Copyright (C) 2012 Free Software Foundation, Inc.
20552063 This file contains any messages produced by compilers while
20562064 running configure, to aid debugging if configure makes a mistake.
20572065
2058 It was created by libdiscid $as_me 0.6.1, which was
2066 It was created by libdiscid $as_me 0.6.2, which was
20592067 generated by GNU Autoconf 2.69. Invocation command line was
20602068
20612069 $ $0 $@
24052413
24062414
24072415
2408 am__api_version='1.14'
2416 ac_config_headers="$ac_config_headers config.h"
24092417
24102418 ac_aux_dir=
2411 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
2419 for ac_dir in build-aux "$srcdir"/build-aux; do
24122420 if test -f "$ac_dir/install-sh"; then
24132421 ac_aux_dir=$ac_dir
24142422 ac_install_sh="$ac_aux_dir/install-sh -c"
24242432 fi
24252433 done
24262434 if test -z "$ac_aux_dir"; then
2427 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
2435 as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
24282436 fi
24292437
24302438 # These three variables are undocumented and unsupported,
24352443 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
24362444 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
24372445
2446 # where to put config.guess etc.
2447 am__api_version='1.15'
24382448
24392449 # Find a good install program. We prefer a C program (faster),
24402450 # so one script is as good as another. But avoid the broken or
26062616 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
26072617 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
26082618
2609 # expand $ac_aux_dir to an absolute path
2610 am_aux_dir=`cd $ac_aux_dir && pwd`
2619 # Expand $ac_aux_dir to an absolute path.
2620 am_aux_dir=`cd "$ac_aux_dir" && pwd`
26112621
26122622 if test x"${MISSING+set}" != xset; then
26132623 case $am_aux_dir in
26262636 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
26272637 fi
26282638
2629 if test x"${install_sh}" != xset; then
2639 if test x"${install_sh+set}" != xset; then
26302640 case $am_aux_dir in
26312641 *\ * | *\ *)
26322642 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
29202930
29212931 # Define the identity of the package.
29222932 PACKAGE='libdiscid'
2923 VERSION='0.6.1'
2933 VERSION='0.6.2'
29242934
29252935
29262936 cat >>confdefs.h <<_ACEOF
29542964 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
29552965 mkdir_p='$(MKDIR_P)'
29562966
2957 # We need awk for the "check" target. The system "awk" is bad on
2958 # some platforms.
2967 # We need awk for the "check" target (and possibly the TAP driver). The
2968 # system "awk" is bad on some platforms.
29592969 # Always define AMTAR for backward compatibility. Yes, it's still used
29602970 # in the wild :-( We should find a proper way to deprecate it ...
29612971 AMTAR='$${TAR-tar}'
30123022 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
30133023 fi
30143024 fi
3025
30153026 DEPDIR="${am__leading_dot}deps"
30163027
30173028 ac_config_commands="$ac_config_commands depfiles"
42234234 ;;
42244235 esac
42254236
4226 ac_config_headers="$ac_config_headers config.h"
4227
42284237
42294238 libdiscid_MAJOR=0
42304239 libdiscid_MINOR=6
4231 libdiscid_PATCH=1
4240 libdiscid_PATCH=2
42324241
42334242 libdiscid_VERSION_LT=${libdiscid_MAJOR}:${libdiscid_MINOR}:${libdiscid_PATCH}
42344243 libdiscid_VERSION_RC=${libdiscid_MAJOR},${libdiscid_MINOR},${libdiscid_PATCH},0
44114420
44124421
44134422
4414 macro_version='2.4.2'
4415 macro_revision='1.3337'
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429 ltmain="$ac_aux_dir/ltmain.sh"
4423 macro_version='2.4.6'
4424 macro_revision='2.4.6'
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438 ltmain=$ac_aux_dir/ltmain.sh
44304439
44314440 # Backslashify metacharacters that are still active within
44324441 # double-quoted strings.
44754484 $ECHO ""
44764485 }
44774486
4478 case "$ECHO" in
4487 case $ECHO in
44794488 printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
44804489 $as_echo "printf" >&6; } ;;
44814490 print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
47984807
47994808 # Check whether --with-gnu-ld was given.
48004809 if test "${with_gnu_ld+set}" = set; then :
4801 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4810 withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
48024811 else
48034812 with_gnu_ld=no
48044813 fi
48054814
48064815 ac_prog=ld
4807 if test "$GCC" = yes; then
4816 if test yes = "$GCC"; then
48084817 # Check if gcc -print-prog-name=ld gives a path.
48094818 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
48104819 $as_echo_n "checking for ld used by $CC... " >&6; }
48114820 case $host in
48124821 *-*-mingw*)
4813 # gcc leaves a trailing carriage return which upsets mingw
4822 # gcc leaves a trailing carriage return, which upsets mingw
48144823 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
48154824 *)
48164825 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
48244833 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
48254834 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
48264835 done
4827 test -z "$LD" && LD="$ac_prog"
4836 test -z "$LD" && LD=$ac_prog
48284837 ;;
48294838 "")
48304839 # If it fails, then pretend we aren't using GCC.
48354844 with_gnu_ld=unknown
48364845 ;;
48374846 esac
4838 elif test "$with_gnu_ld" = yes; then
4847 elif test yes = "$with_gnu_ld"; then
48394848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
48404849 $as_echo_n "checking for GNU ld... " >&6; }
48414850 else
48464855 $as_echo_n "(cached) " >&6
48474856 else
48484857 if test -z "$LD"; then
4849 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4858 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
48504859 for ac_dir in $PATH; do
4851 IFS="$lt_save_ifs"
4860 IFS=$lt_save_ifs
48524861 test -z "$ac_dir" && ac_dir=.
48534862 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4854 lt_cv_path_LD="$ac_dir/$ac_prog"
4863 lt_cv_path_LD=$ac_dir/$ac_prog
48554864 # Check to see if the program is GNU ld. I'd rather use --version,
48564865 # but apparently some variants of GNU ld only accept -v.
48574866 # Break only if it was the GNU/non-GNU ld that we prefer.
48584867 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
48594868 *GNU* | *'with BFD'*)
4860 test "$with_gnu_ld" != no && break
4869 test no != "$with_gnu_ld" && break
48614870 ;;
48624871 *)
4863 test "$with_gnu_ld" != yes && break
4872 test yes != "$with_gnu_ld" && break
48644873 ;;
48654874 esac
48664875 fi
48674876 done
4868 IFS="$lt_save_ifs"
4869 else
4870 lt_cv_path_LD="$LD" # Let the user override the test with a path.
4871 fi
4872 fi
4873
4874 LD="$lt_cv_path_LD"
4877 IFS=$lt_save_ifs
4878 else
4879 lt_cv_path_LD=$LD # Let the user override the test with a path.
4880 fi
4881 fi
4882
4883 LD=$lt_cv_path_LD
48754884 if test -n "$LD"; then
48764885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
48774886 $as_echo "$LD" >&6; }
49144923 else
49154924 if test -n "$NM"; then
49164925 # Let the user override the test.
4917 lt_cv_path_NM="$NM"
4918 else
4919 lt_nm_to_check="${ac_tool_prefix}nm"
4926 lt_cv_path_NM=$NM
4927 else
4928 lt_nm_to_check=${ac_tool_prefix}nm
49204929 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
49214930 lt_nm_to_check="$lt_nm_to_check nm"
49224931 fi
49234932 for lt_tmp_nm in $lt_nm_to_check; do
4924 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4933 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
49254934 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4926 IFS="$lt_save_ifs"
4935 IFS=$lt_save_ifs
49274936 test -z "$ac_dir" && ac_dir=.
4928 tmp_nm="$ac_dir/$lt_tmp_nm"
4929 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4937 tmp_nm=$ac_dir/$lt_tmp_nm
4938 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
49304939 # Check to see if the nm accepts a BSD-compat flag.
4931 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4940 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
49324941 # nm: unknown option "B" ignored
49334942 # Tru64's nm complains that /dev/null is an invalid object file
4934 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4935 */dev/null* | *'Invalid file or object type'*)
4943 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
4944 case $build_os in
4945 mingw*) lt_bad_file=conftest.nm/nofile ;;
4946 *) lt_bad_file=/dev/null ;;
4947 esac
4948 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
4949 *$lt_bad_file* | *'Invalid file or object type'*)
49364950 lt_cv_path_NM="$tmp_nm -B"
4937 break
4951 break 2
49384952 ;;
49394953 *)
49404954 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
49414955 */dev/null*)
49424956 lt_cv_path_NM="$tmp_nm -p"
4943 break
4957 break 2
49444958 ;;
49454959 *)
49464960 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
49514965 esac
49524966 fi
49534967 done
4954 IFS="$lt_save_ifs"
4968 IFS=$lt_save_ifs
49554969 done
49564970 : ${lt_cv_path_NM=no}
49574971 fi
49584972 fi
49594973 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
49604974 $as_echo "$lt_cv_path_NM" >&6; }
4961 if test "$lt_cv_path_NM" != "no"; then
4962 NM="$lt_cv_path_NM"
4975 if test no != "$lt_cv_path_NM"; then
4976 NM=$lt_cv_path_NM
49634977 else
49644978 # Didn't find any BSD compatible name lister, look for dumpbin.
49654979 if test -n "$DUMPBIN"; then :
50655079 fi
50665080 fi
50675081
5068 case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
5082 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
50695083 *COFF*)
5070 DUMPBIN="$DUMPBIN -symbols"
5084 DUMPBIN="$DUMPBIN -symbols -headers"
50715085 ;;
50725086 *)
50735087 DUMPBIN=:
50755089 esac
50765090 fi
50775091
5078 if test "$DUMPBIN" != ":"; then
5079 NM="$DUMPBIN"
5092 if test : != "$DUMPBIN"; then
5093 NM=$DUMPBIN
50805094 fi
50815095 fi
50825096 test -z "$NM" && NM=nm
51275141 $as_echo_n "(cached) " >&6
51285142 else
51295143 i=0
5130 teststring="ABCD"
5144 teststring=ABCD
51315145
51325146 case $build_os in
51335147 msdosdjgpp*)
51675181 lt_cv_sys_max_cmd_len=8192;
51685182 ;;
51695183
5170 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
5184 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
51715185 # This has been around since 386BSD, at least. Likely further.
51725186 if test -x /sbin/sysctl; then
51735187 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
52175231 ;;
52185232 *)
52195233 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5220 if test -n "$lt_cv_sys_max_cmd_len"; then
5234 if test -n "$lt_cv_sys_max_cmd_len" && \
5235 test undefined != "$lt_cv_sys_max_cmd_len"; then
52215236 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
52225237 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
52235238 else
52245239 # Make teststring a little bigger before we do anything with it.
52255240 # a 1K string should be a reasonable start.
5226 for i in 1 2 3 4 5 6 7 8 ; do
5241 for i in 1 2 3 4 5 6 7 8; do
52275242 teststring=$teststring$teststring
52285243 done
52295244 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
52305245 # If test is not a shell built-in, we'll probably end up computing a
52315246 # maximum length that is only half of the actual maximum length, but
52325247 # we can't tell.
5233 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
5248 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
52345249 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
5235 test $i != 17 # 1/2 MB should be enough
5250 test 17 != "$i" # 1/2 MB should be enough
52365251 do
52375252 i=`expr $i + 1`
52385253 teststring=$teststring$teststring
52505265
52515266 fi
52525267
5253 if test -n $lt_cv_sys_max_cmd_len ; then
5268 if test -n "$lt_cv_sys_max_cmd_len"; then
52545269 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
52555270 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
52565271 else
52675282 : ${CP="cp -f"}
52685283 : ${MV="mv -f"}
52695284 : ${RM="rm -f"}
5270
5271 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
5272 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
5273 # Try some XSI features
5274 xsi_shell=no
5275 ( _lt_dummy="a/b/c"
5276 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
5277 = c,a/b,b/c, \
5278 && eval 'test $(( 1 + 1 )) -eq 2 \
5279 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
5280 && xsi_shell=yes
5281 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
5282 $as_echo "$xsi_shell" >&6; }
5283
5284
5285 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
5286 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
5287 lt_shell_append=no
5288 ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
5289 >/dev/null 2>&1 \
5290 && lt_shell_append=yes
5291 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
5292 $as_echo "$lt_shell_append" >&6; }
5293
52945285
52955286 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
52965287 lt_unset=unset
54145405 reload_cmds='$LD$reload_flag -o $output$reload_objs'
54155406 case $host_os in
54165407 cygwin* | mingw* | pw32* | cegcc*)
5417 if test "$GCC" != yes; then
5408 if test yes != "$GCC"; then
54185409 reload_cmds=false
54195410 fi
54205411 ;;
54215412 darwin*)
5422 if test "$GCC" = yes; then
5423 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5413 if test yes = "$GCC"; then
5414 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
54245415 else
54255416 reload_cmds='$LD$reload_flag -o $output$reload_objs'
54265417 fi
55455536 # Need to set the preceding variable on all platforms that support
55465537 # interlibrary dependencies.
55475538 # 'none' -- dependencies not supported.
5548 # `unknown' -- same as none, but documents that we really don't know.
5539 # 'unknown' -- same as none, but documents that we really don't know.
55495540 # 'pass_all' -- all dependencies passed with no checks.
55505541 # 'test_compile' -- check by making test program.
55515542 # 'file_magic [[regex]]' -- check by looking for files in library path
5552 # which responds to the $file_magic_cmd with a given extended regex.
5553 # If you have `file' or equivalent on your system and you're not sure
5554 # whether `pass_all' will *always* work, you probably want this one.
5543 # that responds to the $file_magic_cmd with a given extended regex.
5544 # If you have 'file' or equivalent on your system and you're not sure
5545 # whether 'pass_all' will *always* work, you probably want this one.
55555546
55565547 case $host_os in
55575548 aix[4-9]*)
55785569 # Base MSYS/MinGW do not provide the 'file' command needed by
55795570 # func_win32_libid shell function, so use a weaker test based on 'objdump',
55805571 # unless we find 'file', for example because we are cross-compiling.
5581 # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
5582 if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
5572 if ( file / ) >/dev/null 2>&1; then
55835573 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
55845574 lt_cv_file_magic_cmd='func_win32_libid'
55855575 else
56135603 else
56145604 lt_cv_deplibs_check_method=pass_all
56155605 fi
5616 ;;
5617
5618 gnu*)
5619 lt_cv_deplibs_check_method=pass_all
56205606 ;;
56215607
56225608 haiku*)
56575643 ;;
56585644
56595645 # This must be glibc/ELF.
5660 linux* | k*bsd*-gnu | kopensolaris*-gnu)
5646 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
56615647 lt_cv_deplibs_check_method=pass_all
56625648 ;;
56635649
56795665 lt_cv_deplibs_check_method=pass_all
56805666 ;;
56815667
5682 openbsd*)
5683 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5668 openbsd* | bitrig*)
5669 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
56845670 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
56855671 else
56865672 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
57335719 tpf*)
57345720 lt_cv_deplibs_check_method=pass_all
57355721 ;;
5722 os2*)
5723 lt_cv_deplibs_check_method=pass_all
5724 ;;
57365725 esac
57375726
57385727 fi
58875876
58885877 case $host_os in
58895878 cygwin* | mingw* | pw32* | cegcc*)
5890 # two different shell functions defined in ltmain.sh
5891 # decide which to use based on capabilities of $DLLTOOL
5879 # two different shell functions defined in ltmain.sh;
5880 # decide which one to use based on capabilities of $DLLTOOL
58925881 case `$DLLTOOL --help 2>&1` in
58935882 *--identify-strict*)
58945883 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
59005889 ;;
59015890 *)
59025891 # fallback: assume linklib IS sharedlib
5903 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
5892 lt_cv_sharedlib_from_linklib_cmd=$ECHO
59045893 ;;
59055894 esac
59065895
60546043 ac_status=$?
60556044 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60566045 test $ac_status = 0; }
6057 if test "$ac_status" -eq 0; then
6046 if test 0 -eq "$ac_status"; then
60586047 # Ensure the archiver fails upon bogus file names.
60596048 rm -f conftest.$ac_objext libconftest.a
60606049 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
60626051 ac_status=$?
60636052 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60646053 test $ac_status = 0; }
6065 if test "$ac_status" -ne 0; then
6054 if test 0 -ne "$ac_status"; then
60666055 lt_cv_ar_at_file=@
60676056 fi
60686057 fi
60756064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
60766065 $as_echo "$lt_cv_ar_at_file" >&6; }
60776066
6078 if test "x$lt_cv_ar_at_file" = xno; then
6067 if test no = "$lt_cv_ar_at_file"; then
60796068 archiver_list_spec=
60806069 else
60816070 archiver_list_spec=$lt_cv_ar_at_file
62926281
62936282 if test -n "$RANLIB"; then
62946283 case $host_os in
6295 openbsd*)
6284 bitrig* | openbsd*)
62966285 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
62976286 ;;
62986287 *)
63826371 symcode='[ABCDGISTW]'
63836372 ;;
63846373 hpux*)
6385 if test "$host_cpu" = ia64; then
6374 if test ia64 = "$host_cpu"; then
63866375 symcode='[ABCDEGRST]'
63876376 fi
63886377 ;;
64156404 symcode='[ABCDGIRSTW]' ;;
64166405 esac
64176406
6407 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6408 # Gets list of data symbols to import.
6409 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
6410 # Adjust the below global symbol transforms to fixup imported variables.
6411 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
6412 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
6413 lt_c_name_lib_hook="\
6414 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
6415 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
6416 else
6417 # Disable hooks by default.
6418 lt_cv_sys_global_symbol_to_import=
6419 lt_cdecl_hook=
6420 lt_c_name_hook=
6421 lt_c_name_lib_hook=
6422 fi
6423
64186424 # Transform an extracted symbol line into a proper C declaration.
64196425 # Some systems (esp. on ia64) link data and code symbols differently,
64206426 # so use this general approach.
6421 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
6427 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
6428 $lt_cdecl_hook\
6429 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
6430 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
64226431
64236432 # Transform an extracted symbol line into symbol name and symbol address
6424 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
6425 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
6433 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
6434 $lt_c_name_hook\
6435 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6436 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
6437
6438 # Transform an extracted symbol line into symbol name with lib prefix and
6439 # symbol address.
6440 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
6441 $lt_c_name_lib_hook\
6442 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6443 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
6444 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
64266445
64276446 # Handle CRLF in mingw tool chain
64286447 opt_cr=
64406459
64416460 # Write the raw and C identifiers.
64426461 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6443 # Fake it for dumpbin and say T for any non-static function
6444 # and D for any global variable.
6462 # Fake it for dumpbin and say T for any non-static function,
6463 # D for any global variable and I for any imported variable.
64456464 # Also find C++ and __fastcall symbols from MSVC++,
64466465 # which start with @ or ?.
64476466 lt_cv_sys_global_symbol_pipe="$AWK '"\
64486467 " {last_section=section; section=\$ 3};"\
64496468 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
64506469 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
6470 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
6471 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
6472 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
64516473 " \$ 0!~/External *\|/{next};"\
64526474 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
64536475 " {if(hide[section]) next};"\
6454 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
6455 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
6456 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
6457 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
6476 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
6477 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
6478 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
6479 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
64586480 " ' prfx=^$ac_symprfx"
64596481 else
64606482 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
65026524 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
65036525 cat <<_LT_EOF > conftest.$ac_ext
65046526 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
6505 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
6506 /* DATA imports from DLLs on WIN32 con't be const, because runtime
6527 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
6528 /* DATA imports from DLLs on WIN32 can't be const, because runtime
65076529 relocations are performed -- see ld's documentation on pseudo-relocs. */
65086530 # define LT_DLSYM_CONST
6509 #elif defined(__osf__)
6531 #elif defined __osf__
65106532 /* This system does not cope well with relocations in const data. */
65116533 # define LT_DLSYM_CONST
65126534 #else
65326554 {
65336555 { "@PROGRAM@", (void *) 0 },
65346556 _LT_EOF
6535 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
6557 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
65366558 cat <<\_LT_EOF >> conftest.$ac_ext
65376559 {0, (void *) 0}
65386560 };
65526574 mv conftest.$ac_objext conftstm.$ac_objext
65536575 lt_globsym_save_LIBS=$LIBS
65546576 lt_globsym_save_CFLAGS=$CFLAGS
6555 LIBS="conftstm.$ac_objext"
6577 LIBS=conftstm.$ac_objext
65566578 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
65576579 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
65586580 (eval $ac_link) 2>&5
65596581 ac_status=$?
65606582 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6561 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
6583 test $ac_status = 0; } && test -s conftest$ac_exeext; then
65626584 pipe_works=yes
65636585 fi
65646586 LIBS=$lt_globsym_save_LIBS
65796601 rm -rf conftest* conftst*
65806602
65816603 # Do not use the global_symbol_pipe unless it works.
6582 if test "$pipe_works" = yes; then
6604 if test yes = "$pipe_works"; then
65836605 break
65846606 else
65856607 lt_cv_sys_global_symbol_pipe=
66326654
66336655
66346656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
66356667 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
66366668 $as_echo_n "checking for sysroot... " >&6; }
66376669
66446676
66456677
66466678 lt_sysroot=
6647 case ${with_sysroot} in #(
6679 case $with_sysroot in #(
66486680 yes)
6649 if test "$GCC" = yes; then
6681 if test yes = "$GCC"; then
66506682 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
66516683 fi
66526684 ;; #(
66566688 no|'')
66576689 ;; #(
66586690 *)
6659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
6660 $as_echo "${with_sysroot}" >&6; }
6691 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
6692 $as_echo "$with_sysroot" >&6; }
66616693 as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
66626694 ;;
66636695 esac
66696701
66706702
66716703
6704 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
6705 $as_echo_n "checking for a working dd... " >&6; }
6706 if ${ac_cv_path_lt_DD+:} false; then :
6707 $as_echo_n "(cached) " >&6
6708 else
6709 printf 0123456789abcdef0123456789abcdef >conftest.i
6710 cat conftest.i conftest.i >conftest2.i
6711 : ${lt_DD:=$DD}
6712 if test -z "$lt_DD"; then
6713 ac_path_lt_DD_found=false
6714 # Loop through the user's path and test for each of PROGNAME-LIST
6715 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6716 for as_dir in $PATH
6717 do
6718 IFS=$as_save_IFS
6719 test -z "$as_dir" && as_dir=.
6720 for ac_prog in dd; do
6721 for ac_exec_ext in '' $ac_executable_extensions; do
6722 ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
6723 as_fn_executable_p "$ac_path_lt_DD" || continue
6724 if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6725 cmp -s conftest.i conftest.out \
6726 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6727 fi
6728 $ac_path_lt_DD_found && break 3
6729 done
6730 done
6731 done
6732 IFS=$as_save_IFS
6733 if test -z "$ac_cv_path_lt_DD"; then
6734 :
6735 fi
6736 else
6737 ac_cv_path_lt_DD=$lt_DD
6738 fi
6739
6740 rm -f conftest.i conftest2.i conftest.out
6741 fi
6742 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
6743 $as_echo "$ac_cv_path_lt_DD" >&6; }
6744
6745
6746 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
6747 $as_echo_n "checking how to truncate binary pipes... " >&6; }
6748 if ${lt_cv_truncate_bin+:} false; then :
6749 $as_echo_n "(cached) " >&6
6750 else
6751 printf 0123456789abcdef0123456789abcdef >conftest.i
6752 cat conftest.i conftest.i >conftest2.i
6753 lt_cv_truncate_bin=
6754 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6755 cmp -s conftest.i conftest.out \
6756 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6757 fi
6758 rm -f conftest.i conftest2.i conftest.out
6759 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
6760 fi
6761 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
6762 $as_echo "$lt_cv_truncate_bin" >&6; }
6763
6764
6765
6766
6767
6768
6769
6770 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
6771 func_cc_basename ()
6772 {
6773 for cc_temp in $*""; do
6774 case $cc_temp in
6775 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
6776 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
6777 \-*) ;;
6778 *) break;;
6779 esac
6780 done
6781 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
6782 }
6783
66726784 # Check whether --enable-libtool-lock was given.
66736785 if test "${enable_libtool_lock+set}" = set; then :
66746786 enableval=$enable_libtool_lock;
66756787 fi
66766788
6677 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6789 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
66786790
66796791 # Some flags need to be propagated to the compiler or linker for good
66806792 # libtool support.
66816793 case $host in
66826794 ia64-*-hpux*)
6683 # Find out which ABI we are using.
6795 # Find out what ABI is being produced by ac_compile, and set mode
6796 # options accordingly.
66846797 echo 'int i;' > conftest.$ac_ext
66856798 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
66866799 (eval $ac_compile) 2>&5
66896802 test $ac_status = 0; }; then
66906803 case `/usr/bin/file conftest.$ac_objext` in
66916804 *ELF-32*)
6692 HPUX_IA64_MODE="32"
6805 HPUX_IA64_MODE=32
66936806 ;;
66946807 *ELF-64*)
6695 HPUX_IA64_MODE="64"
6808 HPUX_IA64_MODE=64
66966809 ;;
66976810 esac
66986811 fi
66996812 rm -rf conftest*
67006813 ;;
67016814 *-*-irix6*)
6702 # Find out which ABI we are using.
6815 # Find out what ABI is being produced by ac_compile, and set linker
6816 # options accordingly.
67036817 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
67046818 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
67056819 (eval $ac_compile) 2>&5
67066820 ac_status=$?
67076821 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
67086822 test $ac_status = 0; }; then
6709 if test "$lt_cv_prog_gnu_ld" = yes; then
6823 if test yes = "$lt_cv_prog_gnu_ld"; then
67106824 case `/usr/bin/file conftest.$ac_objext` in
67116825 *32-bit*)
67126826 LD="${LD-ld} -melf32bsmip"
67356849 rm -rf conftest*
67366850 ;;
67376851
6738 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6852 mips64*-*linux*)
6853 # Find out what ABI is being produced by ac_compile, and set linker
6854 # options accordingly.
6855 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
6856 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6857 (eval $ac_compile) 2>&5
6858 ac_status=$?
6859 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6860 test $ac_status = 0; }; then
6861 emul=elf
6862 case `/usr/bin/file conftest.$ac_objext` in
6863 *32-bit*)
6864 emul="${emul}32"
6865 ;;
6866 *64-bit*)
6867 emul="${emul}64"
6868 ;;
6869 esac
6870 case `/usr/bin/file conftest.$ac_objext` in
6871 *MSB*)
6872 emul="${emul}btsmip"
6873 ;;
6874 *LSB*)
6875 emul="${emul}ltsmip"
6876 ;;
6877 esac
6878 case `/usr/bin/file conftest.$ac_objext` in
6879 *N32*)
6880 emul="${emul}n32"
6881 ;;
6882 esac
6883 LD="${LD-ld} -m $emul"
6884 fi
6885 rm -rf conftest*
6886 ;;
6887
6888 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
67396889 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6740 # Find out which ABI we are using.
6890 # Find out what ABI is being produced by ac_compile, and set linker
6891 # options accordingly. Note that the listed cases only cover the
6892 # situations where additional linker options are needed (such as when
6893 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
6894 # vice versa); the common cases where no linker options are needed do
6895 # not appear in the list.
67416896 echo 'int i;' > conftest.$ac_ext
67426897 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
67436898 (eval $ac_compile) 2>&5
67516906 LD="${LD-ld} -m elf_i386_fbsd"
67526907 ;;
67536908 x86_64-*linux*)
6754 LD="${LD-ld} -m elf_i386"
6909 case `/usr/bin/file conftest.o` in
6910 *x86-64*)
6911 LD="${LD-ld} -m elf32_x86_64"
6912 ;;
6913 *)
6914 LD="${LD-ld} -m elf_i386"
6915 ;;
6916 esac
67556917 ;;
6756 ppc64-*linux*|powerpc64-*linux*)
6918 powerpc64le-*linux*)
6919 LD="${LD-ld} -m elf32lppclinux"
6920 ;;
6921 powerpc64-*linux*)
67576922 LD="${LD-ld} -m elf32ppclinux"
67586923 ;;
67596924 s390x-*linux*)
67726937 x86_64-*linux*)
67736938 LD="${LD-ld} -m elf_x86_64"
67746939 ;;
6775 ppc*-*linux*|powerpc*-*linux*)
6940 powerpcle-*linux*)
6941 LD="${LD-ld} -m elf64lppc"
6942 ;;
6943 powerpc-*linux*)
67766944 LD="${LD-ld} -m elf64ppc"
67776945 ;;
67786946 s390*-*linux*|s390*-*tpf*)
67906958
67916959 *-*-sco3.2v5*)
67926960 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6793 SAVE_CFLAGS="$CFLAGS"
6961 SAVE_CFLAGS=$CFLAGS
67946962 CFLAGS="$CFLAGS -belf"
67956963 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
67966964 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
68306998 fi
68316999 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
68327000 $as_echo "$lt_cv_cc_needs_belf" >&6; }
6833 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
7001 if test yes != "$lt_cv_cc_needs_belf"; then
68347002 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6835 CFLAGS="$SAVE_CFLAGS"
7003 CFLAGS=$SAVE_CFLAGS
68367004 fi
68377005 ;;
68387006 *-*solaris*)
6839 # Find out which ABI we are using.
7007 # Find out what ABI is being produced by ac_compile, and set linker
7008 # options accordingly.
68407009 echo 'int i;' > conftest.$ac_ext
68417010 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
68427011 (eval $ac_compile) 2>&5
68487017 case $lt_cv_prog_gnu_ld in
68497018 yes*)
68507019 case $host in
6851 i?86-*-solaris*)
7020 i?86-*-solaris*|x86_64-*-solaris*)
68527021 LD="${LD-ld} -m elf_x86_64"
68537022 ;;
68547023 sparc*-*-solaris*)
68577026 esac
68587027 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
68597028 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
6860 LD="${LD-ld}_sol2"
7029 LD=${LD-ld}_sol2
68617030 fi
68627031 ;;
68637032 *)
68737042 ;;
68747043 esac
68757044
6876 need_locks="$enable_libtool_lock"
7045 need_locks=$enable_libtool_lock
68777046
68787047 if test -n "$ac_tool_prefix"; then
68797048 # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
69847153 fi
69857154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
69867155 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
6987 if test "x$lt_cv_path_mainfest_tool" != xyes; then
7156 if test yes != "$lt_cv_path_mainfest_tool"; then
69887157 MANIFEST_TOOL=:
69897158 fi
69907159
74877656 $as_echo_n "(cached) " >&6
74887657 else
74897658 lt_cv_apple_cc_single_mod=no
7490 if test -z "${LT_MULTI_MODULE}"; then
7659 if test -z "$LT_MULTI_MODULE"; then
74917660 # By default we will add the -single_module flag. You can override
74927661 # by either setting the environment variable LT_MULTI_MODULE
74937662 # non-empty at configure time, or by adding -multi_module to the
75057674 cat conftest.err >&5
75067675 # Otherwise, if the output was created with a 0 exit code from
75077676 # the compiler, it worked.
7508 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
7677 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
75097678 lt_cv_apple_cc_single_mod=yes
75107679 else
75117680 cat conftest.err >&5
75447713 fi
75457714 rm -f core conftest.err conftest.$ac_objext \
75467715 conftest$ac_exeext conftest.$ac_ext
7547 LDFLAGS="$save_LDFLAGS"
7716 LDFLAGS=$save_LDFLAGS
75487717
75497718 fi
75507719 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
75737742 _lt_result=$?
75747743 if test -s conftest.err && $GREP force_load conftest.err; then
75757744 cat conftest.err >&5
7576 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
7745 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
75777746 lt_cv_ld_force_load=yes
75787747 else
75797748 cat conftest.err >&5
75867755 $as_echo "$lt_cv_ld_force_load" >&6; }
75877756 case $host_os in
75887757 rhapsody* | darwin1.[012])
7589 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
7758 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
75907759 darwin1.*)
7591 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7760 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
75927761 darwin*) # darwin 5.x on
75937762 # if running on 10.5 or later, the deployment target defaults
75947763 # to the OS version, if on x86, and 10.4, the deployment
75957764 # target defaults to 10.4. Don't you love it?
75967765 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
75977766 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
7598 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7599 10.[012]*)
7600 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7767 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
7768 10.[012][,.]*)
7769 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
76017770 10.*)
7602 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7771 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
76037772 esac
76047773 ;;
76057774 esac
7606 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
7775 if test yes = "$lt_cv_apple_cc_single_mod"; then
76077776 _lt_dar_single_mod='$single_module'
76087777 fi
7609 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
7610 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
7778 if test yes = "$lt_cv_ld_exported_symbols_list"; then
7779 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
76117780 else
7612 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
7781 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
76137782 fi
7614 if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
7783 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
76157784 _lt_dsymutil='~$DSYMUTIL $lib || :'
76167785 else
76177786 _lt_dsymutil=
76187787 fi
76197788 ;;
76207789 esac
7790
7791 # func_munge_path_list VARIABLE PATH
7792 # -----------------------------------
7793 # VARIABLE is name of variable containing _space_ separated list of
7794 # directories to be munged by the contents of PATH, which is string
7795 # having a format:
7796 # "DIR[:DIR]:"
7797 # string "DIR[ DIR]" will be prepended to VARIABLE
7798 # ":DIR[:DIR]"
7799 # string "DIR[ DIR]" will be appended to VARIABLE
7800 # "DIRP[:DIRP]::[DIRA:]DIRA"
7801 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
7802 # "DIRA[ DIRA]" will be appended to VARIABLE
7803 # "DIR[:DIR]"
7804 # VARIABLE will be replaced by "DIR[ DIR]"
7805 func_munge_path_list ()
7806 {
7807 case x$2 in
7808 x)
7809 ;;
7810 *:)
7811 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
7812 ;;
7813 x:*)
7814 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
7815 ;;
7816 *::*)
7817 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
7818 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
7819 ;;
7820 *)
7821 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
7822 ;;
7823 esac
7824 }
76217825
76227826 ac_ext=c
76237827 ac_cpp='$CPP $CPPFLAGS'
82208424 *)
82218425 enable_shared=no
82228426 # Look at the argument we got. We use all the common list separators.
8223 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8427 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
82248428 for pkg in $enableval; do
8225 IFS="$lt_save_ifs"
8429 IFS=$lt_save_ifs
82268430 if test "X$pkg" = "X$p"; then
82278431 enable_shared=yes
82288432 fi
82298433 done
8230 IFS="$lt_save_ifs"
8434 IFS=$lt_save_ifs
82318435 ;;
82328436 esac
82338437 else
82518455 *)
82528456 enable_static=no
82538457 # Look at the argument we got. We use all the common list separators.
8254 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8458 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
82558459 for pkg in $enableval; do
8256 IFS="$lt_save_ifs"
8460 IFS=$lt_save_ifs
82578461 if test "X$pkg" = "X$p"; then
82588462 enable_static=yes
82598463 fi
82608464 done
8261 IFS="$lt_save_ifs"
8465 IFS=$lt_save_ifs
82628466 ;;
82638467 esac
82648468 else
82828486 *)
82838487 pic_mode=default
82848488 # Look at the argument we got. We use all the common list separators.
8285 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8489 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
82868490 for lt_pkg in $withval; do
8287 IFS="$lt_save_ifs"
8491 IFS=$lt_save_ifs
82888492 if test "X$lt_pkg" = "X$lt_p"; then
82898493 pic_mode=yes
82908494 fi
82918495 done
8292 IFS="$lt_save_ifs"
8496 IFS=$lt_save_ifs
82938497 ;;
82948498 esac
82958499 else
82968500 pic_mode=default
82978501 fi
82988502
8299
8300 test -z "$pic_mode" && pic_mode=default
83018503
83028504
83038505
83148516 *)
83158517 enable_fast_install=no
83168518 # Look at the argument we got. We use all the common list separators.
8317 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8519 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
83188520 for pkg in $enableval; do
8319 IFS="$lt_save_ifs"
8521 IFS=$lt_save_ifs
83208522 if test "X$pkg" = "X$p"; then
83218523 enable_fast_install=yes
83228524 fi
83238525 done
8324 IFS="$lt_save_ifs"
8526 IFS=$lt_save_ifs
83258527 ;;
83268528 esac
83278529 else
83358537
83368538
83378539
8540 shared_archive_member_spec=
8541 case $host,$enable_shared in
8542 power*-*-aix[5-9]*,yes)
8543 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
8544 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
8545
8546 # Check whether --with-aix-soname was given.
8547 if test "${with_aix_soname+set}" = set; then :
8548 withval=$with_aix_soname; case $withval in
8549 aix|svr4|both)
8550 ;;
8551 *)
8552 as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
8553 ;;
8554 esac
8555 lt_cv_with_aix_soname=$with_aix_soname
8556 else
8557 if ${lt_cv_with_aix_soname+:} false; then :
8558 $as_echo_n "(cached) " >&6
8559 else
8560 lt_cv_with_aix_soname=aix
8561 fi
8562
8563 with_aix_soname=$lt_cv_with_aix_soname
8564 fi
8565
8566 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
8567 $as_echo "$with_aix_soname" >&6; }
8568 if test aix != "$with_aix_soname"; then
8569 # For the AIX way of multilib, we name the shared archive member
8570 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8571 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8572 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8573 # the AIX toolchain works better with OBJECT_MODE set (default 32).
8574 if test 64 = "${OBJECT_MODE-32}"; then
8575 shared_archive_member_spec=shr_64
8576 else
8577 shared_archive_member_spec=shr
8578 fi
8579 fi
8580 ;;
8581 *)
8582 with_aix_soname=aix
8583 ;;
8584 esac
8585
8586
8587
8588
8589
8590
8591
83388592
83398593
83408594
83418595 # This can be used to rebuild libtool when needed
8342 LIBTOOL_DEPS="$ltmain"
8596 LIBTOOL_DEPS=$ltmain
83438597
83448598 # Always use our own libtool.
83458599 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
83888642
83898643
83908644
8391 if test -n "${ZSH_VERSION+set}" ; then
8645 if test -n "${ZSH_VERSION+set}"; then
83928646 setopt NO_GLOB_SUBST
83938647 fi
83948648
84278681 # AIX sometimes has problems with the GCC collect2 program. For some
84288682 # reason, if we set the COLLECT_NAMES environment variable, the problems
84298683 # vanish in a puff of smoke.
8430 if test "X${COLLECT_NAMES+set}" != Xset; then
8684 if test set != "${COLLECT_NAMES+set}"; then
84318685 COLLECT_NAMES=
84328686 export COLLECT_NAMES
84338687 fi
84388692 ofile=libtool
84398693 can_build_shared=yes
84408694
8441 # All known linkers require a `.a' archive for static linking (except MSVC,
8695 # All known linkers require a '.a' archive for static linking (except MSVC,
84428696 # which needs '.lib').
84438697 libext=a
84448698
8445 with_gnu_ld="$lt_cv_prog_gnu_ld"
8446
8447 old_CC="$CC"
8448 old_CFLAGS="$CFLAGS"
8699 with_gnu_ld=$lt_cv_prog_gnu_ld
8700
8701 old_CC=$CC
8702 old_CFLAGS=$CFLAGS
84498703
84508704 # Set sane defaults for various variables
84518705 test -z "$CC" && CC=cc
84548708 test -z "$LD" && LD=ld
84558709 test -z "$ac_objext" && ac_objext=o
84568710
8457 for cc_temp in $compiler""; do
8458 case $cc_temp in
8459 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
8460 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
8461 \-*) ;;
8462 *) break;;
8463 esac
8464 done
8465 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
8711 func_cc_basename $compiler
8712 cc_basename=$func_cc_basename_result
84668713
84678714
84688715 # Only perform the check for file, if the check method requires it
84778724 else
84788725 case $MAGIC_CMD in
84798726 [\\/*] | ?:[\\/]*)
8480 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8727 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
84818728 ;;
84828729 *)
8483 lt_save_MAGIC_CMD="$MAGIC_CMD"
8484 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8730 lt_save_MAGIC_CMD=$MAGIC_CMD
8731 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
84858732 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
84868733 for ac_dir in $ac_dummy; do
8487 IFS="$lt_save_ifs"
8734 IFS=$lt_save_ifs
84888735 test -z "$ac_dir" && ac_dir=.
8489 if test -f $ac_dir/${ac_tool_prefix}file; then
8490 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
8736 if test -f "$ac_dir/${ac_tool_prefix}file"; then
8737 lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
84918738 if test -n "$file_magic_test_file"; then
84928739 case $deplibs_check_method in
84938740 "file_magic "*)
84948741 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8495 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8742 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
84968743 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
84978744 $EGREP "$file_magic_regex" > /dev/null; then
84988745 :
85158762 break
85168763 fi
85178764 done
8518 IFS="$lt_save_ifs"
8519 MAGIC_CMD="$lt_save_MAGIC_CMD"
8765 IFS=$lt_save_ifs
8766 MAGIC_CMD=$lt_save_MAGIC_CMD
85208767 ;;
85218768 esac
85228769 fi
85238770
8524 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8771 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
85258772 if test -n "$MAGIC_CMD"; then
85268773 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
85278774 $as_echo "$MAGIC_CMD" >&6; }
85438790 else
85448791 case $MAGIC_CMD in
85458792 [\\/*] | ?:[\\/]*)
8546 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8793 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
85478794 ;;
85488795 *)
8549 lt_save_MAGIC_CMD="$MAGIC_CMD"
8550 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8796 lt_save_MAGIC_CMD=$MAGIC_CMD
8797 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
85518798 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
85528799 for ac_dir in $ac_dummy; do
8553 IFS="$lt_save_ifs"
8800 IFS=$lt_save_ifs
85548801 test -z "$ac_dir" && ac_dir=.
8555 if test -f $ac_dir/file; then
8556 lt_cv_path_MAGIC_CMD="$ac_dir/file"
8802 if test -f "$ac_dir/file"; then
8803 lt_cv_path_MAGIC_CMD=$ac_dir/"file"
85578804 if test -n "$file_magic_test_file"; then
85588805 case $deplibs_check_method in
85598806 "file_magic "*)
85608807 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8561 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8808 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
85628809 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
85638810 $EGREP "$file_magic_regex" > /dev/null; then
85648811 :
85818828 break
85828829 fi
85838830 done
8584 IFS="$lt_save_ifs"
8585 MAGIC_CMD="$lt_save_MAGIC_CMD"
8831 IFS=$lt_save_ifs
8832 MAGIC_CMD=$lt_save_MAGIC_CMD
85868833 ;;
85878834 esac
85888835 fi
85898836
8590 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8837 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
85918838 if test -n "$MAGIC_CMD"; then
85928839 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
85938840 $as_echo "$MAGIC_CMD" >&6; }
86088855
86098856 # Use C for the default configuration in the libtool script
86108857
8611 lt_save_CC="$CC"
8858 lt_save_CC=$CC
86128859 ac_ext=c
86138860 ac_cpp='$CPP $CPPFLAGS'
86148861 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
86668913
86678914 lt_prog_compiler_no_builtin_flag=
86688915
8669 if test "$GCC" = yes; then
8916 if test yes = "$GCC"; then
86708917 case $cc_basename in
86718918 nvcc*)
86728919 lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
86828929 lt_cv_prog_compiler_rtti_exceptions=no
86838930 ac_outfile=conftest.$ac_objext
86848931 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8685 lt_compiler_flag="-fno-rtti -fno-exceptions"
8932 lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
86868933 # Insert the option either (1) after the last *FLAGS variable, or
86878934 # (2) before a word containing "conftest.", or (3) at the end.
86888935 # Note that $ac_compile itself does not contain backslashes and begins
87128959 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
87138960 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
87148961
8715 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
8962 if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
87168963 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
87178964 else
87188965 :
87308977 lt_prog_compiler_static=
87318978
87328979
8733 if test "$GCC" = yes; then
8980 if test yes = "$GCC"; then
87348981 lt_prog_compiler_wl='-Wl,'
87358982 lt_prog_compiler_static='-static'
87368983
87378984 case $host_os in
87388985 aix*)
87398986 # All AIX code is PIC.
8740 if test "$host_cpu" = ia64; then
8987 if test ia64 = "$host_cpu"; then
87418988 # AIX 5 now supports IA64 processor
87428989 lt_prog_compiler_static='-Bstatic'
87438990 fi
8991 lt_prog_compiler_pic='-fPIC'
87448992 ;;
87458993
87468994 amigaos*)
87518999 ;;
87529000 m68k)
87539001 # FIXME: we need at least 68020 code to build shared libraries, but
8754 # adding the `-m68020' flag to GCC prevents building anything better,
8755 # like `-m68040'.
9002 # adding the '-m68020' flag to GCC prevents building anything better,
9003 # like '-m68040'.
87569004 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
87579005 ;;
87589006 esac
87689016 # Although the cygwin gcc ignores -fPIC, still need this for old-style
87699017 # (--disable-auto-import) libraries
87709018 lt_prog_compiler_pic='-DDLL_EXPORT'
9019 case $host_os in
9020 os2*)
9021 lt_prog_compiler_static='$wl-static'
9022 ;;
9023 esac
87719024 ;;
87729025
87739026 darwin* | rhapsody*)
88389091 case $host_os in
88399092 aix*)
88409093 lt_prog_compiler_wl='-Wl,'
8841 if test "$host_cpu" = ia64; then
9094 if test ia64 = "$host_cpu"; then
88429095 # AIX 5 now supports IA64 processor
88439096 lt_prog_compiler_static='-Bstatic'
88449097 else
88469099 fi
88479100 ;;
88489101
9102 darwin* | rhapsody*)
9103 # PIC is the default on this platform
9104 # Common symbols not allowed in MH_DYLIB files
9105 lt_prog_compiler_pic='-fno-common'
9106 case $cc_basename in
9107 nagfor*)
9108 # NAG Fortran compiler
9109 lt_prog_compiler_wl='-Wl,-Wl,,'
9110 lt_prog_compiler_pic='-PIC'
9111 lt_prog_compiler_static='-Bstatic'
9112 ;;
9113 esac
9114 ;;
9115
88499116 mingw* | cygwin* | pw32* | os2* | cegcc*)
88509117 # This hack is so that the source file can tell whether it is being
88519118 # built for inclusion in a dll (and should export symbols for example).
88529119 lt_prog_compiler_pic='-DDLL_EXPORT'
9120 case $host_os in
9121 os2*)
9122 lt_prog_compiler_static='$wl-static'
9123 ;;
9124 esac
88539125 ;;
88549126
88559127 hpux9* | hpux10* | hpux11*)
88659137 ;;
88669138 esac
88679139 # Is there a better lt_prog_compiler_static that works with the bundled CC?
8868 lt_prog_compiler_static='${wl}-a ${wl}archive'
9140 lt_prog_compiler_static='$wl-a ${wl}archive'
88699141 ;;
88709142
88719143 irix5* | irix6* | nonstopux*)
88749146 lt_prog_compiler_static='-non_shared'
88759147 ;;
88769148
8877 linux* | k*bsd*-gnu | kopensolaris*-gnu)
9149 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
88789150 case $cc_basename in
8879 # old Intel for x86_64 which still supported -KPIC.
9151 # old Intel for x86_64, which still supported -KPIC.
88809152 ecc*)
88819153 lt_prog_compiler_wl='-Wl,'
88829154 lt_prog_compiler_pic='-KPIC'
89009172 lt_prog_compiler_wl='-Wl,-Wl,,'
89019173 lt_prog_compiler_pic='-PIC'
89029174 lt_prog_compiler_static='-Bstatic'
9175 ;;
9176 tcc*)
9177 # Fabrice Bellard et al's Tiny C Compiler
9178 lt_prog_compiler_wl='-Wl,'
9179 lt_prog_compiler_pic='-fPIC'
9180 lt_prog_compiler_static='-static'
89039181 ;;
89049182 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
89059183 # Portland Group compilers (*not* the Pentium gcc compiler,
89989276 ;;
89999277
90009278 sysv4*MP*)
9001 if test -d /usr/nec ;then
9279 if test -d /usr/nec; then
90029280 lt_prog_compiler_pic='-Kconform_pic'
90039281 lt_prog_compiler_static='-Bstatic'
90049282 fi
90279305 fi
90289306
90299307 case $host_os in
9030 # For platforms which do not support PIC, -DPIC is meaningless:
9308 # For platforms that do not support PIC, -DPIC is meaningless:
90319309 *djgpp*)
90329310 lt_prog_compiler_pic=
90339311 ;;
90599337 lt_cv_prog_compiler_pic_works=no
90609338 ac_outfile=conftest.$ac_objext
90619339 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9062 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
9340 lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
90639341 # Insert the option either (1) after the last *FLAGS variable, or
90649342 # (2) before a word containing "conftest.", or (3) at the end.
90659343 # Note that $ac_compile itself does not contain backslashes and begins
90899367 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
90909368 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
90919369
9092 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
9370 if test yes = "$lt_cv_prog_compiler_pic_works"; then
90939371 case $lt_prog_compiler_pic in
90949372 "" | " "*) ;;
90959373 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
91219399 $as_echo_n "(cached) " >&6
91229400 else
91239401 lt_cv_prog_compiler_static_works=no
9124 save_LDFLAGS="$LDFLAGS"
9402 save_LDFLAGS=$LDFLAGS
91259403 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
91269404 echo "$lt_simple_link_test_code" > conftest.$ac_ext
91279405 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
91409418 fi
91419419 fi
91429420 $RM -r conftest*
9143 LDFLAGS="$save_LDFLAGS"
9421 LDFLAGS=$save_LDFLAGS
91449422
91459423 fi
91469424 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
91479425 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
91489426
9149 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
9427 if test yes = "$lt_cv_prog_compiler_static_works"; then
91509428 :
91519429 else
91529430 lt_prog_compiler_static=
92669544
92679545
92689546
9269 hard_links="nottested"
9270 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
9547 hard_links=nottested
9548 if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
92719549 # do not overwrite the value of need_locks provided by the user
92729550 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
92739551 $as_echo_n "checking if we can lock with hard links... " >&6; }
92799557 ln conftest.a conftest.b 2>/dev/null && hard_links=no
92809558 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
92819559 $as_echo "$hard_links" >&6; }
9282 if test "$hard_links" = no; then
9283 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
9284 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
9560 if test no = "$hard_links"; then
9561 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
9562 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
92859563 need_locks=warn
92869564 fi
92879565 else
93249602 # included in the symbol list
93259603 include_expsyms=
93269604 # exclude_expsyms can be an extended regexp of symbols to exclude
9327 # it will be wrapped by ` (' and `)$', so one must not match beginning or
9328 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
9329 # as well as any symbol that contains `d'.
9605 # it will be wrapped by ' (' and ')$', so one must not match beginning or
9606 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
9607 # as well as any symbol that contains 'd'.
93309608 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
93319609 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
93329610 # platforms (ab)use it in PIC code, but their linkers get confused if
93419619 # FIXME: the MSVC++ port hasn't been tested in a loooong time
93429620 # When not using gcc, we currently assume that we are using
93439621 # Microsoft Visual C++.
9344 if test "$GCC" != yes; then
9622 if test yes != "$GCC"; then
93459623 with_gnu_ld=no
93469624 fi
93479625 ;;
93499627 # we just hope/assume this is gcc and not c89 (= MSVC++)
93509628 with_gnu_ld=yes
93519629 ;;
9352 openbsd*)
9630 openbsd* | bitrig*)
93539631 with_gnu_ld=no
93549632 ;;
93559633 esac
93599637 # On some targets, GNU ld is compatible enough with the native linker
93609638 # that we're better off using the native interface for both.
93619639 lt_use_gnu_ld_interface=no
9362 if test "$with_gnu_ld" = yes; then
9640 if test yes = "$with_gnu_ld"; then
93639641 case $host_os in
93649642 aix*)
93659643 # The AIX port of GNU ld has always aspired to compatibility
93819659 esac
93829660 fi
93839661
9384 if test "$lt_use_gnu_ld_interface" = yes; then
9662 if test yes = "$lt_use_gnu_ld_interface"; then
93859663 # If archive_cmds runs LD, not CC, wlarc should be empty
9386 wlarc='${wl}'
9664 wlarc='$wl'
93879665
93889666 # Set some defaults for GNU ld with shared library support. These
93899667 # are reset later if shared libraries are not supported. Putting them
93909668 # here allows them to be overridden if necessary.
93919669 runpath_var=LD_RUN_PATH
9392 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9393 export_dynamic_flag_spec='${wl}--export-dynamic'
9670 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9671 export_dynamic_flag_spec='$wl--export-dynamic'
93949672 # ancient GNU ld didn't support --whole-archive et. al.
93959673 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
9396 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
9674 whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
93979675 else
93989676 whole_archive_flag_spec=
93999677 fi
94009678 supports_anon_versioning=no
9401 case `$LD -v 2>&1` in
9679 case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
94029680 *GNU\ gold*) supports_anon_versioning=yes ;;
94039681 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
94049682 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
94119689 case $host_os in
94129690 aix[3-9]*)
94139691 # On AIX/PPC, the GNU linker is very broken
9414 if test "$host_cpu" != ia64; then
9692 if test ia64 != "$host_cpu"; then
94159693 ld_shlibs=no
94169694 cat <<_LT_EOF 1>&2
94179695
94309708 case $host_cpu in
94319709 powerpc)
94329710 # see comment about AmigaOS4 .so support
9433 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9711 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
94349712 archive_expsym_cmds=''
94359713 ;;
94369714 m68k)
94469724 allow_undefined_flag=unsupported
94479725 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
94489726 # support --undefined. This deserves some investigation. FIXME
9449 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9727 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
94509728 else
94519729 ld_shlibs=no
94529730 fi
94569734 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
94579735 # as there is no search path for DLLs.
94589736 hardcode_libdir_flag_spec='-L$libdir'
9459 export_dynamic_flag_spec='${wl}--export-all-symbols'
9737 export_dynamic_flag_spec='$wl--export-all-symbols'
94609738 allow_undefined_flag=unsupported
94619739 always_export_symbols=no
94629740 enable_shared_with_static_runtimes=yes
94649742 exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
94659743
94669744 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9467 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9468 # If the export-symbols file already is a .def file (1st line
9469 # is EXPORTS), use it as is; otherwise, prepend...
9470 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9471 cp $export_symbols $output_objdir/$soname.def;
9472 else
9473 echo EXPORTS > $output_objdir/$soname.def;
9474 cat $export_symbols >> $output_objdir/$soname.def;
9475 fi~
9476 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9745 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9746 # If the export-symbols file already is a .def file, use it as
9747 # is; otherwise, prepend EXPORTS...
9748 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
9749 cp $export_symbols $output_objdir/$soname.def;
9750 else
9751 echo EXPORTS > $output_objdir/$soname.def;
9752 cat $export_symbols >> $output_objdir/$soname.def;
9753 fi~
9754 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
94779755 else
94789756 ld_shlibs=no
94799757 fi
94809758 ;;
94819759
94829760 haiku*)
9483 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9761 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
94849762 link_all_deplibs=yes
9763 ;;
9764
9765 os2*)
9766 hardcode_libdir_flag_spec='-L$libdir'
9767 hardcode_minus_L=yes
9768 allow_undefined_flag=unsupported
9769 shrext_cmds=.dll
9770 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9771 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9772 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9773 $ECHO EXPORTS >> $output_objdir/$libname.def~
9774 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9775 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9776 emximp -o $lib $output_objdir/$libname.def'
9777 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9778 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9779 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9780 $ECHO EXPORTS >> $output_objdir/$libname.def~
9781 prefix_cmds="$SED"~
9782 if test EXPORTS = "`$SED 1q $export_symbols`"; then
9783 prefix_cmds="$prefix_cmds -e 1d";
9784 fi~
9785 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9786 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9787 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9788 emximp -o $lib $output_objdir/$libname.def'
9789 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9790 enable_shared_with_static_runtimes=yes
94859791 ;;
94869792
94879793 interix[3-9]*)
94889794 hardcode_direct=no
94899795 hardcode_shlibpath_var=no
9490 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
9491 export_dynamic_flag_spec='${wl}-E'
9796 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
9797 export_dynamic_flag_spec='$wl-E'
94929798 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
94939799 # Instead, shared libraries are loaded at an image base (0x10000000 by
94949800 # default) and relocated if they conflict, which is a slow very memory
94959801 # consuming and fragmenting process. To avoid this, we pick a random,
94969802 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
94979803 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
9498 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9499 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9804 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9805 archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
95009806 ;;
95019807
95029808 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
95039809 tmp_diet=no
9504 if test "$host_os" = linux-dietlibc; then
9810 if test linux-dietlibc = "$host_os"; then
95059811 case $cc_basename in
95069812 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
95079813 esac
95089814 fi
95099815 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
9510 && test "$tmp_diet" = no
9816 && test no = "$tmp_diet"
95119817 then
95129818 tmp_addflag=' $pic_flag'
95139819 tmp_sharedflag='-shared'
95149820 case $cc_basename,$host_cpu in
95159821 pgcc*) # Portland Group C compiler
9516 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9822 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
95179823 tmp_addflag=' $pic_flag'
95189824 ;;
95199825 pgf77* | pgf90* | pgf95* | pgfortran*)
95209826 # Portland Group f77 and f90 compilers
9521 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9827 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
95229828 tmp_addflag=' $pic_flag -Mnomain' ;;
95239829 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
95249830 tmp_addflag=' -i_dynamic' ;;
95299835 lf95*) # Lahey Fortran 8.1
95309836 whole_archive_flag_spec=
95319837 tmp_sharedflag='--shared' ;;
9838 nagfor*) # NAGFOR 5.3
9839 tmp_sharedflag='-Wl,-shared' ;;
95329840 xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
95339841 tmp_sharedflag='-qmkshrobj'
95349842 tmp_addflag= ;;
95359843 nvcc*) # Cuda Compiler Driver 2.2
9536 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9844 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
95379845 compiler_needs_object=yes
95389846 ;;
95399847 esac
95409848 case `$CC -V 2>&1 | sed 5q` in
95419849 *Sun\ C*) # Sun C 5.9
9542 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9850 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
95439851 compiler_needs_object=yes
95449852 tmp_sharedflag='-G' ;;
95459853 *Sun\ F*) # Sun Fortran 8.3
95469854 tmp_sharedflag='-G' ;;
95479855 esac
9548 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9549
9550 if test "x$supports_anon_versioning" = xyes; then
9856 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9857
9858 if test yes = "$supports_anon_versioning"; then
95519859 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9552 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9553 echo "local: *; };" >> $output_objdir/$libname.ver~
9554 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
9860 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9861 echo "local: *; };" >> $output_objdir/$libname.ver~
9862 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
95559863 fi
95569864
95579865 case $cc_basename in
9866 tcc*)
9867 export_dynamic_flag_spec='-rdynamic'
9868 ;;
95589869 xlf* | bgf* | bgxlf* | mpixlf*)
95599870 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
95609871 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
9561 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9872 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
95629873 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
9563 if test "x$supports_anon_versioning" = xyes; then
9874 if test yes = "$supports_anon_versioning"; then
95649875 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9565 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9566 echo "local: *; };" >> $output_objdir/$libname.ver~
9567 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
9876 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9877 echo "local: *; };" >> $output_objdir/$libname.ver~
9878 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
95689879 fi
95699880 ;;
95709881 esac
95789889 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
95799890 wlarc=
95809891 else
9581 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9582 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9892 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9893 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
95839894 fi
95849895 ;;
95859896
95979908
95989909 _LT_EOF
95999910 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9600 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9601 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9911 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9912 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
96029913 else
96039914 ld_shlibs=no
96049915 fi
96109921 ld_shlibs=no
96119922 cat <<_LT_EOF 1>&2
96129923
9613 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
9924 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
96149925 *** reliably create shared libraries on SCO systems. Therefore, libtool
96159926 *** is disabling shared libraries support. We urge you to upgrade GNU
96169927 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
96259936 # DT_RUNPATH tag from executables and libraries. But doing so
96269937 # requires that you compile everything twice, which is a pain.
96279938 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9628 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9629 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9630 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9939 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9940 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9941 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
96319942 else
96329943 ld_shlibs=no
96339944 fi
96449955
96459956 *)
96469957 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9647 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9648 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9958 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9959 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
96499960 else
96509961 ld_shlibs=no
96519962 fi
96529963 ;;
96539964 esac
96549965
9655 if test "$ld_shlibs" = no; then
9966 if test no = "$ld_shlibs"; then
96569967 runpath_var=
96579968 hardcode_libdir_flag_spec=
96589969 export_dynamic_flag_spec=
96689979 # Note: this linker hardcodes the directories in LIBPATH if there
96699980 # are no directories specified by -L.
96709981 hardcode_minus_L=yes
9671 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
9982 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
96729983 # Neither direct hardcoding nor static linking is supported with a
96739984 # broken collect2.
96749985 hardcode_direct=unsupported
96769987 ;;
96779988
96789989 aix[4-9]*)
9679 if test "$host_cpu" = ia64; then
9990 if test ia64 = "$host_cpu"; then
96809991 # On IA64, the linker does run time linking by default, so we don't
96819992 # have to do anything special.
96829993 aix_use_runtimelinking=no
96839994 exp_sym_flag='-Bexport'
9684 no_entry_flag=""
9995 no_entry_flag=
96859996 else
96869997 # If we're using GNU nm, then we don't want the "-C" option.
9687 # -C means demangle to AIX nm, but means don't demangle with GNU nm
9688 # Also, AIX nm treats weak defined symbols like other global
9689 # defined symbols, whereas GNU nm marks them as "W".
9998 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
9999 # Without the "-l" option, or with the "-B" option, AIX nm treats
10000 # weak defined symbols like other global defined symbols, whereas
10001 # GNU nm marks them as "W".
10002 # While the 'weak' keyword is ignored in the Export File, we need
10003 # it in the Import File for the 'aix-soname' feature, so we have
10004 # to replace the "-B" option with "-P" for AIX nm.
969010005 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9691 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
10006 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
969210007 else
9693 export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
10008 export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
969410009 fi
969510010 aix_use_runtimelinking=no
969610011
969710012 # Test if we are trying to use run time linking or normal
969810013 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9699 # need to do runtime linking.
10014 # have runtime linking enabled, and use it for executables.
10015 # For shared libraries, we enable/disable runtime linking
10016 # depending on the kind of the shared library created -
10017 # when "with_aix_soname,aix_use_runtimelinking" is:
10018 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
10019 # "aix,yes" lib.so shared, rtl:yes, for executables
10020 # lib.a static archive
10021 # "both,no" lib.so.V(shr.o) shared, rtl:yes
10022 # lib.a(lib.so.V) shared, rtl:no, for executables
10023 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
10024 # lib.a(lib.so.V) shared, rtl:no
10025 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
10026 # lib.a static archive
970010027 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
970110028 for ld_flag in $LDFLAGS; do
9702 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
10029 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
970310030 aix_use_runtimelinking=yes
970410031 break
970510032 fi
970610033 done
10034 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
10035 # With aix-soname=svr4, we create the lib.so.V shared archives only,
10036 # so we don't have lib.a shared libs to link our executables.
10037 # We have to force runtime linking in this case.
10038 aix_use_runtimelinking=yes
10039 LDFLAGS="$LDFLAGS -Wl,-brtl"
10040 fi
970710041 ;;
970810042 esac
970910043
972210056 hardcode_direct_absolute=yes
972310057 hardcode_libdir_separator=':'
972410058 link_all_deplibs=yes
9725 file_list_spec='${wl}-f,'
9726
9727 if test "$GCC" = yes; then
10059 file_list_spec='$wl-f,'
10060 case $with_aix_soname,$aix_use_runtimelinking in
10061 aix,*) ;; # traditional, no import file
10062 svr4,* | *,yes) # use import file
10063 # The Import File defines what to hardcode.
10064 hardcode_direct=no
10065 hardcode_direct_absolute=no
10066 ;;
10067 esac
10068
10069 if test yes = "$GCC"; then
972810070 case $host_os in aix4.[012]|aix4.[012].*)
972910071 # We only want to do this on AIX 4.2 and lower, the check
973010072 # below for broken collect2 doesn't work under 4.3+
9731 collect2name=`${CC} -print-prog-name=collect2`
10073 collect2name=`$CC -print-prog-name=collect2`
973210074 if test -f "$collect2name" &&
973310075 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
973410076 then
974710089 ;;
974810090 esac
974910091 shared_flag='-shared'
9750 if test "$aix_use_runtimelinking" = yes; then
9751 shared_flag="$shared_flag "'${wl}-G'
10092 if test yes = "$aix_use_runtimelinking"; then
10093 shared_flag="$shared_flag "'$wl-G'
975210094 fi
10095 # Need to ensure runtime linking is disabled for the traditional
10096 # shared library, or the linker may eventually find shared libraries
10097 # /with/ Import File - we do not want to mix them.
10098 shared_flag_aix='-shared'
10099 shared_flag_svr4='-shared $wl-G'
975310100 else
975410101 # not using gcc
9755 if test "$host_cpu" = ia64; then
10102 if test ia64 = "$host_cpu"; then
975610103 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
975710104 # chokes on -Wl,-G. The following line is correct:
975810105 shared_flag='-G'
975910106 else
9760 if test "$aix_use_runtimelinking" = yes; then
9761 shared_flag='${wl}-G'
10107 if test yes = "$aix_use_runtimelinking"; then
10108 shared_flag='$wl-G'
976210109 else
9763 shared_flag='${wl}-bM:SRE'
10110 shared_flag='$wl-bM:SRE'
976410111 fi
10112 shared_flag_aix='$wl-bM:SRE'
10113 shared_flag_svr4='$wl-G'
976510114 fi
976610115 fi
976710116
9768 export_dynamic_flag_spec='${wl}-bexpall'
10117 export_dynamic_flag_spec='$wl-bexpall'
976910118 # It seems that -bexpall does not export symbols beginning with
977010119 # underscore (_), so it is better to generate a list of symbols to export.
977110120 always_export_symbols=yes
9772 if test "$aix_use_runtimelinking" = yes; then
10121 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
977310122 # Warning - without using the other runtime loading flags (-brtl),
977410123 # -berok will link without error, but may produce a broken library.
977510124 allow_undefined_flag='-berok'
977610125 # Determine the default libpath from the value encoded in an
977710126 # empty executable.
9778 if test "${lt_cv_aix_libpath+set}" = set; then
10127 if test set = "${lt_cv_aix_libpath+set}"; then
977910128 aix_libpath=$lt_cv_aix_libpath
978010129 else
978110130 if ${lt_cv_aix_libpath_+:} false; then :
981010159 rm -f core conftest.err conftest.$ac_objext \
981110160 conftest$ac_exeext conftest.$ac_ext
981210161 if test -z "$lt_cv_aix_libpath_"; then
9813 lt_cv_aix_libpath_="/usr/lib:/lib"
10162 lt_cv_aix_libpath_=/usr/lib:/lib
981410163 fi
981510164
981610165 fi
981810167 aix_libpath=$lt_cv_aix_libpath_
981910168 fi
982010169
9821 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
9822 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
10170 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
10171 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
982310172 else
9824 if test "$host_cpu" = ia64; then
9825 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
10173 if test ia64 = "$host_cpu"; then
10174 hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
982610175 allow_undefined_flag="-z nodefs"
9827 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
10176 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
982810177 else
982910178 # Determine the default libpath from the value encoded in an
983010179 # empty executable.
9831 if test "${lt_cv_aix_libpath+set}" = set; then
10180 if test set = "${lt_cv_aix_libpath+set}"; then
983210181 aix_libpath=$lt_cv_aix_libpath
983310182 else
983410183 if ${lt_cv_aix_libpath_+:} false; then :
986310212 rm -f core conftest.err conftest.$ac_objext \
986410213 conftest$ac_exeext conftest.$ac_ext
986510214 if test -z "$lt_cv_aix_libpath_"; then
9866 lt_cv_aix_libpath_="/usr/lib:/lib"
10215 lt_cv_aix_libpath_=/usr/lib:/lib
986710216 fi
986810217
986910218 fi
987110220 aix_libpath=$lt_cv_aix_libpath_
987210221 fi
987310222
9874 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
10223 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
987510224 # Warning - without using the other run time loading flags,
987610225 # -berok will link without error, but may produce a broken library.
9877 no_undefined_flag=' ${wl}-bernotok'
9878 allow_undefined_flag=' ${wl}-berok'
9879 if test "$with_gnu_ld" = yes; then
10226 no_undefined_flag=' $wl-bernotok'
10227 allow_undefined_flag=' $wl-berok'
10228 if test yes = "$with_gnu_ld"; then
988010229 # We only use this code for GNU lds that support --whole-archive.
9881 whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
10230 whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
988210231 else
988310232 # Exported symbols can be pulled into shared objects from archives
988410233 whole_archive_flag_spec='$convenience'
988510234 fi
988610235 archive_cmds_need_lc=yes
9887 # This is similar to how AIX traditionally builds its shared libraries.
9888 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
10236 archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
10237 # -brtl affects multiple linker settings, -berok does not and is overridden later
10238 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
10239 if test svr4 != "$with_aix_soname"; then
10240 # This is similar to how AIX traditionally builds its shared libraries.
10241 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
10242 fi
10243 if test aix != "$with_aix_soname"; then
10244 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
10245 else
10246 # used by -dlpreopen to get the symbols
10247 archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
10248 fi
10249 archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
988910250 fi
989010251 fi
989110252 ;;
989410255 case $host_cpu in
989510256 powerpc)
989610257 # see comment about AmigaOS4 .so support
9897 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10258 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
989810259 archive_expsym_cmds=''
989910260 ;;
990010261 m68k)
992410285 # Tell ltmain to make .lib files, not .a files.
992510286 libext=lib
992610287 # Tell ltmain to make .dll files, not .so files.
9927 shrext_cmds=".dll"
10288 shrext_cmds=.dll
992810289 # FIXME: Setting linknames here is a bad hack.
9929 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
9930 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9931 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
9932 else
9933 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
9934 fi~
9935 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9936 linknames='
10290 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
10291 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
10292 cp "$export_symbols" "$output_objdir/$soname.def";
10293 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
10294 else
10295 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
10296 fi~
10297 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
10298 linknames='
993710299 # The linker will not automatically build a static lib if we build a DLL.
993810300 # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
993910301 enable_shared_with_static_runtimes=yes
994210304 # Don't use ranlib
994310305 old_postinstall_cmds='chmod 644 $oldlib'
994410306 postlink_cmds='lt_outputfile="@OUTPUT@"~
9945 lt_tool_outputfile="@TOOL_OUTPUT@"~
9946 case $lt_outputfile in
9947 *.exe|*.EXE) ;;
9948 *)
9949 lt_outputfile="$lt_outputfile.exe"
9950 lt_tool_outputfile="$lt_tool_outputfile.exe"
9951 ;;
9952 esac~
9953 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
9954 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9955 $RM "$lt_outputfile.manifest";
9956 fi'
10307 lt_tool_outputfile="@TOOL_OUTPUT@"~
10308 case $lt_outputfile in
10309 *.exe|*.EXE) ;;
10310 *)
10311 lt_outputfile=$lt_outputfile.exe
10312 lt_tool_outputfile=$lt_tool_outputfile.exe
10313 ;;
10314 esac~
10315 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
10316 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
10317 $RM "$lt_outputfile.manifest";
10318 fi'
995710319 ;;
995810320 *)
995910321 # Assume MSVC wrapper
996210324 # Tell ltmain to make .lib files, not .a files.
996310325 libext=lib
996410326 # Tell ltmain to make .dll files, not .so files.
9965 shrext_cmds=".dll"
10327 shrext_cmds=.dll
996610328 # FIXME: Setting linknames here is a bad hack.
996710329 archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
996810330 # The linker will automatically build a .lib file if we build a DLL.
998110343 hardcode_direct=no
998210344 hardcode_automatic=yes
998310345 hardcode_shlibpath_var=unsupported
9984 if test "$lt_cv_ld_force_load" = "yes"; then
9985 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
10346 if test yes = "$lt_cv_ld_force_load"; then
10347 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
998610348
998710349 else
998810350 whole_archive_flag_spec=''
998910351 fi
999010352 link_all_deplibs=yes
9991 allow_undefined_flag="$_lt_dar_allow_undefined"
10353 allow_undefined_flag=$_lt_dar_allow_undefined
999210354 case $cc_basename in
9993 ifort*) _lt_dar_can_shared=yes ;;
10355 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
999410356 *) _lt_dar_can_shared=$GCC ;;
999510357 esac
9996 if test "$_lt_dar_can_shared" = "yes"; then
10358 if test yes = "$_lt_dar_can_shared"; then
999710359 output_verbose_link_cmd=func_echo_all
9998 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
9999 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
10000 archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
10001 module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
10360 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
10361 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
10362 archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
10363 module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
1000210364
1000310365 else
1000410366 ld_shlibs=no
1004010402 ;;
1004110403
1004210404 hpux9*)
10043 if test "$GCC" = yes; then
10044 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
10405 if test yes = "$GCC"; then
10406 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
1004510407 else
10046 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
10408 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
1004710409 fi
10048 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
10410 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
1004910411 hardcode_libdir_separator=:
1005010412 hardcode_direct=yes
1005110413
1005210414 # hardcode_minus_L: Not really in the search PATH,
1005310415 # but as the default location of the library.
1005410416 hardcode_minus_L=yes
10055 export_dynamic_flag_spec='${wl}-E'
10417 export_dynamic_flag_spec='$wl-E'
1005610418 ;;
1005710419
1005810420 hpux10*)
10059 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
10060 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10421 if test yes,no = "$GCC,$with_gnu_ld"; then
10422 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
1006110423 else
1006210424 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
1006310425 fi
10064 if test "$with_gnu_ld" = no; then
10065 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
10426 if test no = "$with_gnu_ld"; then
10427 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
1006610428 hardcode_libdir_separator=:
1006710429 hardcode_direct=yes
1006810430 hardcode_direct_absolute=yes
10069 export_dynamic_flag_spec='${wl}-E'
10431 export_dynamic_flag_spec='$wl-E'
1007010432 # hardcode_minus_L: Not really in the search PATH,
1007110433 # but as the default location of the library.
1007210434 hardcode_minus_L=yes
1007410436 ;;
1007510437
1007610438 hpux11*)
10077 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
10439 if test yes,no = "$GCC,$with_gnu_ld"; then
1007810440 case $host_cpu in
1007910441 hppa*64*)
10080 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10442 archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
1008110443 ;;
1008210444 ia64*)
10083 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
10445 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
1008410446 ;;
1008510447 *)
10086 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10448 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
1008710449 ;;
1008810450 esac
1008910451 else
1009010452 case $host_cpu in
1009110453 hppa*64*)
10092 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10454 archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
1009310455 ;;
1009410456 ia64*)
10095 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
10457 archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
1009610458 ;;
1009710459 *)
1009810460
1010410466 $as_echo_n "(cached) " >&6
1010510467 else
1010610468 lt_cv_prog_compiler__b=no
10107 save_LDFLAGS="$LDFLAGS"
10469 save_LDFLAGS=$LDFLAGS
1010810470 LDFLAGS="$LDFLAGS -b"
1010910471 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1011010472 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1012310485 fi
1012410486 fi
1012510487 $RM -r conftest*
10126 LDFLAGS="$save_LDFLAGS"
10488 LDFLAGS=$save_LDFLAGS
1012710489
1012810490 fi
1012910491 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
1013010492 $as_echo "$lt_cv_prog_compiler__b" >&6; }
1013110493
10132 if test x"$lt_cv_prog_compiler__b" = xyes; then
10133 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10494 if test yes = "$lt_cv_prog_compiler__b"; then
10495 archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
1013410496 else
1013510497 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
1013610498 fi
1013810500 ;;
1013910501 esac
1014010502 fi
10141 if test "$with_gnu_ld" = no; then
10142 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
10503 if test no = "$with_gnu_ld"; then
10504 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
1014310505 hardcode_libdir_separator=:
1014410506
1014510507 case $host_cpu in
1015010512 *)
1015110513 hardcode_direct=yes
1015210514 hardcode_direct_absolute=yes
10153 export_dynamic_flag_spec='${wl}-E'
10515 export_dynamic_flag_spec='$wl-E'
1015410516
1015510517 # hardcode_minus_L: Not really in the search PATH,
1015610518 # but as the default location of the library.
1016110523 ;;
1016210524
1016310525 irix5* | irix6* | nonstopux*)
10164 if test "$GCC" = yes; then
10165 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10526 if test yes = "$GCC"; then
10527 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
1016610528 # Try to use the -exported_symbol ld option, if it does not
1016710529 # work, assume that -exports_file does not work either and
1016810530 # implicitly export all symbols.
1017210534 if ${lt_cv_irix_exported_symbol+:} false; then :
1017310535 $as_echo_n "(cached) " >&6
1017410536 else
10175 save_LDFLAGS="$LDFLAGS"
10176 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
10537 save_LDFLAGS=$LDFLAGS
10538 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
1017710539 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1017810540 /* end confdefs.h. */
1017910541 int foo (void) { return 0; }
1018510547 fi
1018610548 rm -f core conftest.err conftest.$ac_objext \
1018710549 conftest$ac_exeext conftest.$ac_ext
10188 LDFLAGS="$save_LDFLAGS"
10550 LDFLAGS=$save_LDFLAGS
1018910551 fi
1019010552 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
1019110553 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
10192 if test "$lt_cv_irix_exported_symbol" = yes; then
10193 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
10554 if test yes = "$lt_cv_irix_exported_symbol"; then
10555 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
1019410556 fi
1019510557 else
10196 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
10197 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
10558 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
10559 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
1019810560 fi
1019910561 archive_cmds_need_lc='no'
10200 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10562 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
1020110563 hardcode_libdir_separator=:
1020210564 inherit_rpath=yes
1020310565 link_all_deplibs=yes
10566 ;;
10567
10568 linux*)
10569 case $cc_basename in
10570 tcc*)
10571 # Fabrice Bellard et al's Tiny C Compiler
10572 ld_shlibs=yes
10573 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10574 ;;
10575 esac
1020410576 ;;
1020510577
1020610578 netbsd*)
1021710589 newsos6)
1021810590 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1021910591 hardcode_direct=yes
10220 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10592 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
1022110593 hardcode_libdir_separator=:
1022210594 hardcode_shlibpath_var=no
1022310595 ;;
1022510597 *nto* | *qnx*)
1022610598 ;;
1022710599
10228 openbsd*)
10600 openbsd* | bitrig*)
1022910601 if test -f /usr/libexec/ld.so; then
1023010602 hardcode_direct=yes
1023110603 hardcode_shlibpath_var=no
1023210604 hardcode_direct_absolute=yes
10233 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
10605 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
1023410606 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10235 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
10236 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
10237 export_dynamic_flag_spec='${wl}-E'
10607 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
10608 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
10609 export_dynamic_flag_spec='$wl-E'
1023810610 else
10239 case $host_os in
10240 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
10241 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10242 hardcode_libdir_flag_spec='-R$libdir'
10243 ;;
10244 *)
10245 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10246 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
10247 ;;
10248 esac
10611 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10612 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
1024910613 fi
1025010614 else
1025110615 ld_shlibs=no
1025610620 hardcode_libdir_flag_spec='-L$libdir'
1025710621 hardcode_minus_L=yes
1025810622 allow_undefined_flag=unsupported
10259 archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
10260 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
10623 shrext_cmds=.dll
10624 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10625 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10626 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10627 $ECHO EXPORTS >> $output_objdir/$libname.def~
10628 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
10629 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10630 emximp -o $lib $output_objdir/$libname.def'
10631 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10632 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10633 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10634 $ECHO EXPORTS >> $output_objdir/$libname.def~
10635 prefix_cmds="$SED"~
10636 if test EXPORTS = "`$SED 1q $export_symbols`"; then
10637 prefix_cmds="$prefix_cmds -e 1d";
10638 fi~
10639 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
10640 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
10641 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10642 emximp -o $lib $output_objdir/$libname.def'
10643 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
10644 enable_shared_with_static_runtimes=yes
1026110645 ;;
1026210646
1026310647 osf3*)
10264 if test "$GCC" = yes; then
10265 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
10266 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10648 if test yes = "$GCC"; then
10649 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
10650 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
1026710651 else
1026810652 allow_undefined_flag=' -expect_unresolved \*'
10269 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
10653 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
1027010654 fi
1027110655 archive_cmds_need_lc='no'
10272 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10656 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
1027310657 hardcode_libdir_separator=:
1027410658 ;;
1027510659
1027610660 osf4* | osf5*) # as osf3* with the addition of -msym flag
10277 if test "$GCC" = yes; then
10278 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
10279 archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10280 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10661 if test yes = "$GCC"; then
10662 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
10663 archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
10664 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
1028110665 else
1028210666 allow_undefined_flag=' -expect_unresolved \*'
10283 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
10667 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
1028410668 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
10285 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
10669 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
1028610670
1028710671 # Both c and cxx compiler support -rpath directly
1028810672 hardcode_libdir_flag_spec='-rpath $libdir'
1029310677
1029410678 solaris*)
1029510679 no_undefined_flag=' -z defs'
10296 if test "$GCC" = yes; then
10297 wlarc='${wl}'
10298 archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10680 if test yes = "$GCC"; then
10681 wlarc='$wl'
10682 archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
1029910683 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10300 $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10684 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
1030110685 else
1030210686 case `$CC -V 2>&1` in
1030310687 *"Compilers 5.0"*)
1030410688 wlarc=''
10305 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
10689 archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
1030610690 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10307 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
10691 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
1030810692 ;;
1030910693 *)
10310 wlarc='${wl}'
10311 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
10694 wlarc='$wl'
10695 archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
1031210696 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10313 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10697 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
1031410698 ;;
1031510699 esac
1031610700 fi
1032010704 solaris2.[0-5] | solaris2.[0-5].*) ;;
1032110705 *)
1032210706 # The compiler driver will combine and reorder linker options,
10323 # but understands `-z linker_flag'. GCC discards it without `$wl',
10707 # but understands '-z linker_flag'. GCC discards it without '$wl',
1032410708 # but is careful enough not to reorder.
1032510709 # Supported since Solaris 2.6 (maybe 2.5.1?)
10326 if test "$GCC" = yes; then
10327 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
10710 if test yes = "$GCC"; then
10711 whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
1032810712 else
1032910713 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
1033010714 fi
1033410718 ;;
1033510719
1033610720 sunos4*)
10337 if test "x$host_vendor" = xsequent; then
10721 if test sequent = "$host_vendor"; then
1033810722 # Use $CC to link under sequent, because it throws in some extra .o
1033910723 # files that make .init and .fini sections work.
10340 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10724 archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
1034110725 else
1034210726 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
1034310727 fi
1038610770 ;;
1038710771
1038810772 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
10389 no_undefined_flag='${wl}-z,text'
10773 no_undefined_flag='$wl-z,text'
1039010774 archive_cmds_need_lc=no
1039110775 hardcode_shlibpath_var=no
1039210776 runpath_var='LD_RUN_PATH'
1039310777
10394 if test "$GCC" = yes; then
10395 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10396 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10778 if test yes = "$GCC"; then
10779 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10780 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
1039710781 else
10398 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10399 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10782 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10783 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
1040010784 fi
1040110785 ;;
1040210786
1040310787 sysv5* | sco3.2v5* | sco5v6*)
10404 # Note: We can NOT use -z defs as we might desire, because we do not
10788 # Note: We CANNOT use -z defs as we might desire, because we do not
1040510789 # link with -lc, and that would cause any symbols used from libc to
1040610790 # always be unresolved, which means just about no library would
1040710791 # ever link correctly. If we're not using GNU ld we use -z text
1040810792 # though, which does catch some bad symbols but isn't as heavy-handed
1040910793 # as -z defs.
10410 no_undefined_flag='${wl}-z,text'
10411 allow_undefined_flag='${wl}-z,nodefs'
10794 no_undefined_flag='$wl-z,text'
10795 allow_undefined_flag='$wl-z,nodefs'
1041210796 archive_cmds_need_lc=no
1041310797 hardcode_shlibpath_var=no
10414 hardcode_libdir_flag_spec='${wl}-R,$libdir'
10798 hardcode_libdir_flag_spec='$wl-R,$libdir'
1041510799 hardcode_libdir_separator=':'
1041610800 link_all_deplibs=yes
10417 export_dynamic_flag_spec='${wl}-Bexport'
10801 export_dynamic_flag_spec='$wl-Bexport'
1041810802 runpath_var='LD_RUN_PATH'
1041910803
10420 if test "$GCC" = yes; then
10421 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10422 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10804 if test yes = "$GCC"; then
10805 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10806 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
1042310807 else
10424 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10425 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10808 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10809 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
1042610810 fi
1042710811 ;;
1042810812
1043710821 ;;
1043810822 esac
1043910823
10440 if test x$host_vendor = xsni; then
10824 if test sni = "$host_vendor"; then
1044110825 case $host in
1044210826 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10443 export_dynamic_flag_spec='${wl}-Blargedynsym'
10827 export_dynamic_flag_spec='$wl-Blargedynsym'
1044410828 ;;
1044510829 esac
1044610830 fi
1044810832
1044910833 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
1045010834 $as_echo "$ld_shlibs" >&6; }
10451 test "$ld_shlibs" = no && can_build_shared=no
10835 test no = "$ld_shlibs" && can_build_shared=no
1045210836
1045310837 with_gnu_ld=$with_gnu_ld
1045410838
1047410858 # Assume -lc should be added
1047510859 archive_cmds_need_lc=yes
1047610860
10477 if test "$enable_shared" = yes && test "$GCC" = yes; then
10861 if test yes,yes = "$GCC,$enable_shared"; then
1047810862 case $archive_cmds in
1047910863 *'~'*)
1048010864 # FIXME: we may have to deal with multi-command sequences.
1068911073 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
1069011074 $as_echo_n "checking dynamic linker characteristics... " >&6; }
1069111075
10692 if test "$GCC" = yes; then
11076 if test yes = "$GCC"; then
1069311077 case $host_os in
10694 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
10695 *) lt_awk_arg="/^libraries:/" ;;
11078 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
11079 *) lt_awk_arg='/^libraries:/' ;;
1069611080 esac
1069711081 case $host_os in
10698 mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
10699 *) lt_sed_strip_eq="s,=/,/,g" ;;
11082 mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
11083 *) lt_sed_strip_eq='s|=/|/|g' ;;
1070011084 esac
1070111085 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
1070211086 case $lt_search_path_spec in
1071211096 ;;
1071311097 esac
1071411098 # Ok, now we have the path, separated by spaces, we can step through it
10715 # and add multilib dir if necessary.
11099 # and add multilib dir if necessary...
1071611100 lt_tmp_lt_search_path_spec=
10717 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
11101 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
11102 # ...but if some path component already ends with the multilib dir we assume
11103 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
11104 case "$lt_multi_os_dir; $lt_search_path_spec " in
11105 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
11106 lt_multi_os_dir=
11107 ;;
11108 esac
1071811109 for lt_sys_path in $lt_search_path_spec; do
10719 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
10720 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
10721 else
11110 if test -d "$lt_sys_path$lt_multi_os_dir"; then
11111 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
11112 elif test -n "$lt_multi_os_dir"; then
1072211113 test -d "$lt_sys_path" && \
1072311114 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1072411115 fi
1072511116 done
1072611117 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
10727 BEGIN {RS=" "; FS="/|\n";} {
10728 lt_foo="";
10729 lt_count=0;
11118 BEGIN {RS = " "; FS = "/|\n";} {
11119 lt_foo = "";
11120 lt_count = 0;
1073011121 for (lt_i = NF; lt_i > 0; lt_i--) {
1073111122 if ($lt_i != "" && $lt_i != ".") {
1073211123 if ($lt_i == "..") {
1073311124 lt_count++;
1073411125 } else {
1073511126 if (lt_count == 0) {
10736 lt_foo="/" $lt_i lt_foo;
11127 lt_foo = "/" $lt_i lt_foo;
1073711128 } else {
1073811129 lt_count--;
1073911130 }
1074711138 # for these hosts.
1074811139 case $host_os in
1074911140 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
10750 $SED 's,/\([A-Za-z]:\),\1,g'` ;;
11141 $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
1075111142 esac
1075211143 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
1075311144 else
1075611147 library_names_spec=
1075711148 libname_spec='lib$name'
1075811149 soname_spec=
10759 shrext_cmds=".so"
11150 shrext_cmds=.so
1076011151 postinstall_cmds=
1076111152 postuninstall_cmds=
1076211153 finish_cmds=
1077311164 # flags to be left without arguments
1077411165 need_version=unknown
1077511166
11167
11168
1077611169 case $host_os in
1077711170 aix3*)
1077811171 version_type=linux # correct to gnu/linux during the next big refactor
10779 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
11172 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
1078011173 shlibpath_var=LIBPATH
1078111174
1078211175 # AIX 3 has no versioning support, so we append a major version to the name.
10783 soname_spec='${libname}${release}${shared_ext}$major'
11176 soname_spec='$libname$release$shared_ext$major'
1078411177 ;;
1078511178
1078611179 aix[4-9]*)
1078811181 need_lib_prefix=no
1078911182 need_version=no
1079011183 hardcode_into_libs=yes
10791 if test "$host_cpu" = ia64; then
11184 if test ia64 = "$host_cpu"; then
1079211185 # AIX 5 supports IA64
10793 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
11186 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
1079411187 shlibpath_var=LD_LIBRARY_PATH
1079511188 else
1079611189 # With GCC up to 2.95.x, collect2 would create an import file
1079711190 # for dependence libraries. The import file would start with
10798 # the line `#! .'. This would cause the generated library to
10799 # depend on `.', always an invalid library. This was fixed in
11191 # the line '#! .'. This would cause the generated library to
11192 # depend on '.', always an invalid library. This was fixed in
1080011193 # development snapshots of GCC prior to 3.0.
1080111194 case $host_os in
1080211195 aix4 | aix4.[01] | aix4.[01].*)
1080311196 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
1080411197 echo ' yes '
10805 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
11198 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
1080611199 :
1080711200 else
1080811201 can_build_shared=no
1080911202 fi
1081011203 ;;
1081111204 esac
10812 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
11205 # Using Import Files as archive members, it is possible to support
11206 # filename-based versioning of shared library archives on AIX. While
11207 # this would work for both with and without runtime linking, it will
11208 # prevent static linking of such archives. So we do filename-based
11209 # shared library versioning with .so extension only, which is used
11210 # when both runtime linking and shared linking is enabled.
11211 # Unfortunately, runtime linking may impact performance, so we do
11212 # not want this to be the default eventually. Also, we use the
11213 # versioned .so libs for executables only if there is the -brtl
11214 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
11215 # To allow for filename-based versioning support, we need to create
11216 # libNAME.so.V as an archive file, containing:
11217 # *) an Import File, referring to the versioned filename of the
11218 # archive as well as the shared archive member, telling the
11219 # bitwidth (32 or 64) of that shared object, and providing the
11220 # list of exported symbols of that shared object, eventually
11221 # decorated with the 'weak' keyword
11222 # *) the shared object with the F_LOADONLY flag set, to really avoid
11223 # it being seen by the linker.
11224 # At run time we better use the real file rather than another symlink,
11225 # but for link time we create the symlink libNAME.so -> libNAME.so.V
11226
11227 case $with_aix_soname,$aix_use_runtimelinking in
11228 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
1081311229 # soname into executable. Probably we can add versioning support to
1081411230 # collect2, so additional links can be useful in future.
10815 if test "$aix_use_runtimelinking" = yes; then
11231 aix,yes) # traditional libtool
11232 dynamic_linker='AIX unversionable lib.so'
1081611233 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
1081711234 # instead of lib<name>.a to let people know that these are not
1081811235 # typical AIX shared libraries.
10819 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10820 else
11236 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11237 ;;
11238 aix,no) # traditional AIX only
11239 dynamic_linker='AIX lib.a(lib.so.V)'
1082111240 # We preserve .a as extension for shared libraries through AIX4.2
1082211241 # and later when we are not doing run time linking.
10823 library_names_spec='${libname}${release}.a $libname.a'
10824 soname_spec='${libname}${release}${shared_ext}$major'
10825 fi
11242 library_names_spec='$libname$release.a $libname.a'
11243 soname_spec='$libname$release$shared_ext$major'
11244 ;;
11245 svr4,*) # full svr4 only
11246 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
11247 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
11248 # We do not specify a path in Import Files, so LIBPATH fires.
11249 shlibpath_overrides_runpath=yes
11250 ;;
11251 *,yes) # both, prefer svr4
11252 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
11253 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
11254 # unpreferred sharedlib libNAME.a needs extra handling
11255 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
11256 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
11257 # We do not specify a path in Import Files, so LIBPATH fires.
11258 shlibpath_overrides_runpath=yes
11259 ;;
11260 *,no) # both, prefer aix
11261 dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
11262 library_names_spec='$libname$release.a $libname.a'
11263 soname_spec='$libname$release$shared_ext$major'
11264 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
11265 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
11266 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
11267 ;;
11268 esac
1082611269 shlibpath_var=LIBPATH
1082711270 fi
1082811271 ;;
1083211275 powerpc)
1083311276 # Since July 2007 AmigaOS4 officially supports .so libraries.
1083411277 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
10835 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11278 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
1083611279 ;;
1083711280 m68k)
1083811281 library_names_spec='$libname.ixlibrary $libname.a'
1083911282 # Create ${libname}_ixlibrary.a entries in /sys/libs.
10840 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
11283 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
1084111284 ;;
1084211285 esac
1084311286 ;;
1084411287
1084511288 beos*)
10846 library_names_spec='${libname}${shared_ext}'
11289 library_names_spec='$libname$shared_ext'
1084711290 dynamic_linker="$host_os ld.so"
1084811291 shlibpath_var=LIBRARY_PATH
1084911292 ;;
1085111294 bsdi[45]*)
1085211295 version_type=linux # correct to gnu/linux during the next big refactor
1085311296 need_version=no
10854 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10855 soname_spec='${libname}${release}${shared_ext}$major'
11297 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11298 soname_spec='$libname$release$shared_ext$major'
1085611299 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1085711300 shlibpath_var=LD_LIBRARY_PATH
1085811301 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1086411307
1086511308 cygwin* | mingw* | pw32* | cegcc*)
1086611309 version_type=windows
10867 shrext_cmds=".dll"
11310 shrext_cmds=.dll
1086811311 need_version=no
1086911312 need_lib_prefix=no
1087011313
1087311316 # gcc
1087411317 library_names_spec='$libname.dll.a'
1087511318 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10876 postinstall_cmds='base_file=`basename \${file}`~
10877 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
11319 postinstall_cmds='base_file=`basename \$file`~
11320 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
1087811321 dldir=$destdir/`dirname \$dlpath`~
1087911322 test -d \$dldir || mkdir -p \$dldir~
1088011323 $install_prog $dir/$dlname \$dldir/$dlname~
1089011333 case $host_os in
1089111334 cygwin*)
1089211335 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
10893 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
11336 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
1089411337
1089511338 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
1089611339 ;;
1089711340 mingw* | cegcc*)
1089811341 # MinGW DLLs use traditional 'lib' prefix
10899 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
11342 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
1090011343 ;;
1090111344 pw32*)
1090211345 # pw32 DLLs use 'pw' prefix rather than 'lib'
10903 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
11346 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
1090411347 ;;
1090511348 esac
1090611349 dynamic_linker='Win32 ld.exe'
1090911352 *,cl*)
1091011353 # Native MSVC
1091111354 libname_spec='$name'
10912 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
10913 library_names_spec='${libname}.dll.lib'
11355 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
11356 library_names_spec='$libname.dll.lib'
1091411357
1091511358 case $build_os in
1091611359 mingw*)
1093711380 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
1093811381 ;;
1093911382 *)
10940 sys_lib_search_path_spec="$LIB"
11383 sys_lib_search_path_spec=$LIB
1094111384 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
1094211385 # It is most probably a Windows format PATH.
1094311386 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1095011393 esac
1095111394
1095211395 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10953 postinstall_cmds='base_file=`basename \${file}`~
10954 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
11396 postinstall_cmds='base_file=`basename \$file`~
11397 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
1095511398 dldir=$destdir/`dirname \$dlpath`~
1095611399 test -d \$dldir || mkdir -p \$dldir~
1095711400 $install_prog $dir/$dlname \$dldir/$dlname'
1096411407
1096511408 *)
1096611409 # Assume MSVC wrapper
10967 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
11410 library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
1096811411 dynamic_linker='Win32 ld.exe'
1096911412 ;;
1097011413 esac
1097711420 version_type=darwin
1097811421 need_lib_prefix=no
1097911422 need_version=no
10980 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
10981 soname_spec='${libname}${release}${major}$shared_ext'
11423 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
11424 soname_spec='$libname$release$major$shared_ext'
1098211425 shlibpath_overrides_runpath=yes
1098311426 shlibpath_var=DYLD_LIBRARY_PATH
1098411427 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1099111434 version_type=linux # correct to gnu/linux during the next big refactor
1099211435 need_lib_prefix=no
1099311436 need_version=no
10994 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
10995 soname_spec='${libname}${release}${shared_ext}$major'
11437 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11438 soname_spec='$libname$release$shared_ext$major'
1099611439 shlibpath_var=LD_LIBRARY_PATH
1099711440 ;;
1099811441
1101011453 version_type=freebsd-$objformat
1101111454 case $version_type in
1101211455 freebsd-elf*)
11013 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
11456 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11457 soname_spec='$libname$release$shared_ext$major'
1101411458 need_version=no
1101511459 need_lib_prefix=no
1101611460 ;;
1101711461 freebsd-*)
11018 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
11462 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
1101911463 need_version=yes
1102011464 ;;
1102111465 esac
1104011484 esac
1104111485 ;;
1104211486
11043 gnu*)
11044 version_type=linux # correct to gnu/linux during the next big refactor
11045 need_lib_prefix=no
11046 need_version=no
11047 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
11048 soname_spec='${libname}${release}${shared_ext}$major'
11049 shlibpath_var=LD_LIBRARY_PATH
11050 shlibpath_overrides_runpath=no
11051 hardcode_into_libs=yes
11052 ;;
11053
1105411487 haiku*)
1105511488 version_type=linux # correct to gnu/linux during the next big refactor
1105611489 need_lib_prefix=no
1105711490 need_version=no
1105811491 dynamic_linker="$host_os runtime_loader"
11059 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
11060 soname_spec='${libname}${release}${shared_ext}$major'
11492 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11493 soname_spec='$libname$release$shared_ext$major'
1106111494 shlibpath_var=LIBRARY_PATH
11062 shlibpath_overrides_runpath=yes
11495 shlibpath_overrides_runpath=no
1106311496 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
1106411497 hardcode_into_libs=yes
1106511498 ;;
1107711510 dynamic_linker="$host_os dld.so"
1107811511 shlibpath_var=LD_LIBRARY_PATH
1107911512 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
11080 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11081 soname_spec='${libname}${release}${shared_ext}$major'
11082 if test "X$HPUX_IA64_MODE" = X32; then
11513 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11514 soname_spec='$libname$release$shared_ext$major'
11515 if test 32 = "$HPUX_IA64_MODE"; then
1108311516 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
11517 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
1108411518 else
1108511519 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
11520 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
1108611521 fi
11087 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1108811522 ;;
1108911523 hppa*64*)
1109011524 shrext_cmds='.sl'
1109211526 dynamic_linker="$host_os dld.sl"
1109311527 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1109411528 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
11095 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11096 soname_spec='${libname}${release}${shared_ext}$major'
11529 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11530 soname_spec='$libname$release$shared_ext$major'
1109711531 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1109811532 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1109911533 ;;
1110211536 dynamic_linker="$host_os dld.sl"
1110311537 shlibpath_var=SHLIB_PATH
1110411538 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
11105 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11106 soname_spec='${libname}${release}${shared_ext}$major'
11539 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11540 soname_spec='$libname$release$shared_ext$major'
1110711541 ;;
1110811542 esac
1110911543 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
1111611550 version_type=linux # correct to gnu/linux during the next big refactor
1111711551 need_lib_prefix=no
1111811552 need_version=no
11119 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
11120 soname_spec='${libname}${release}${shared_ext}$major'
11553 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11554 soname_spec='$libname$release$shared_ext$major'
1112111555 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
1112211556 shlibpath_var=LD_LIBRARY_PATH
1112311557 shlibpath_overrides_runpath=no
1112811562 case $host_os in
1112911563 nonstopux*) version_type=nonstopux ;;
1113011564 *)
11131 if test "$lt_cv_prog_gnu_ld" = yes; then
11565 if test yes = "$lt_cv_prog_gnu_ld"; then
1113211566 version_type=linux # correct to gnu/linux during the next big refactor
1113311567 else
1113411568 version_type=irix
1113611570 esac
1113711571 need_lib_prefix=no
1113811572 need_version=no
11139 soname_spec='${libname}${release}${shared_ext}$major'
11140 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
11573 soname_spec='$libname$release$shared_ext$major'
11574 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
1114111575 case $host_os in
1114211576 irix5* | nonstopux*)
1114311577 libsuff= shlibsuff=
1115611590 esac
1115711591 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1115811592 shlibpath_overrides_runpath=no
11159 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
11160 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
11593 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
11594 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
1116111595 hardcode_into_libs=yes
1116211596 ;;
1116311597
1116611600 dynamic_linker=no
1116711601 ;;
1116811602
11603 linux*android*)
11604 version_type=none # Android doesn't support versioned libraries.
11605 need_lib_prefix=no
11606 need_version=no
11607 library_names_spec='$libname$release$shared_ext'
11608 soname_spec='$libname$release$shared_ext'
11609 finish_cmds=
11610 shlibpath_var=LD_LIBRARY_PATH
11611 shlibpath_overrides_runpath=yes
11612
11613 # This implies no fast_install, which is unacceptable.
11614 # Some rework will be needed to allow for fast_install
11615 # before this can be enabled.
11616 hardcode_into_libs=yes
11617
11618 dynamic_linker='Android linker'
11619 # Don't embed -rpath directories since the linker doesn't support them.
11620 hardcode_libdir_flag_spec='-L$libdir'
11621 ;;
11622
1116911623 # This must be glibc/ELF.
11170 linux* | k*bsd*-gnu | kopensolaris*-gnu)
11624 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
1117111625 version_type=linux # correct to gnu/linux during the next big refactor
1117211626 need_lib_prefix=no
1117311627 need_version=no
11174 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11175 soname_spec='${libname}${release}${shared_ext}$major'
11628 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11629 soname_spec='$libname$release$shared_ext$major'
1117611630 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1117711631 shlibpath_var=LD_LIBRARY_PATH
1117811632 shlibpath_overrides_runpath=no
1121611670 # before this can be enabled.
1121711671 hardcode_into_libs=yes
1121811672
11219 # Append ld.so.conf contents to the search path
11673 # Ideally, we could use ldconfig to report *all* directores which are
11674 # searched for libraries, however this is still not possible. Aside from not
11675 # being certain /sbin/ldconfig is available, command
11676 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
11677 # even though it is searched at run-time. Try to do the best guess by
11678 # appending ld.so.conf contents (and includes) to the search path.
1122011679 if test -f /etc/ld.so.conf; then
1122111680 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
1122211681 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
1123611695 need_lib_prefix=no
1123711696 need_version=no
1123811697 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
11239 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
11698 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
1124011699 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1124111700 dynamic_linker='NetBSD (a.out) ld.so'
1124211701 else
11243 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
11244 soname_spec='${libname}${release}${shared_ext}$major'
11702 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11703 soname_spec='$libname$release$shared_ext$major'
1124511704 dynamic_linker='NetBSD ld.elf_so'
1124611705 fi
1124711706 shlibpath_var=LD_LIBRARY_PATH
1125111710
1125211711 newsos6)
1125311712 version_type=linux # correct to gnu/linux during the next big refactor
11254 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11713 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
1125511714 shlibpath_var=LD_LIBRARY_PATH
1125611715 shlibpath_overrides_runpath=yes
1125711716 ;;
1126011719 version_type=qnx
1126111720 need_lib_prefix=no
1126211721 need_version=no
11263 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11264 soname_spec='${libname}${release}${shared_ext}$major'
11722 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11723 soname_spec='$libname$release$shared_ext$major'
1126511724 shlibpath_var=LD_LIBRARY_PATH
1126611725 shlibpath_overrides_runpath=no
1126711726 hardcode_into_libs=yes
1126811727 dynamic_linker='ldqnx.so'
1126911728 ;;
1127011729
11271 openbsd*)
11730 openbsd* | bitrig*)
1127211731 version_type=sunos
11273 sys_lib_dlsearch_path_spec="/usr/lib"
11732 sys_lib_dlsearch_path_spec=/usr/lib
1127411733 need_lib_prefix=no
11275 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
11276 case $host_os in
11277 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
11278 *) need_version=no ;;
11279 esac
11280 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
11734 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
11735 need_version=no
11736 else
11737 need_version=yes
11738 fi
11739 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
1128111740 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1128211741 shlibpath_var=LD_LIBRARY_PATH
11283 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11284 case $host_os in
11285 openbsd2.[89] | openbsd2.[89].*)
11286 shlibpath_overrides_runpath=no
11287 ;;
11288 *)
11289 shlibpath_overrides_runpath=yes
11290 ;;
11291 esac
11292 else
11293 shlibpath_overrides_runpath=yes
11294 fi
11742 shlibpath_overrides_runpath=yes
1129511743 ;;
1129611744
1129711745 os2*)
1129811746 libname_spec='$name'
11299 shrext_cmds=".dll"
11747 version_type=windows
11748 shrext_cmds=.dll
11749 need_version=no
1130011750 need_lib_prefix=no
11301 library_names_spec='$libname${shared_ext} $libname.a'
11751 # OS/2 can only load a DLL with a base name of 8 characters or less.
11752 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
11753 v=$($ECHO $release$versuffix | tr -d .-);
11754 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
11755 $ECHO $n$v`$shared_ext'
11756 library_names_spec='${libname}_dll.$libext'
1130211757 dynamic_linker='OS/2 ld.exe'
11303 shlibpath_var=LIBPATH
11758 shlibpath_var=BEGINLIBPATH
11759 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
11760 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
11761 postinstall_cmds='base_file=`basename \$file`~
11762 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
11763 dldir=$destdir/`dirname \$dlpath`~
11764 test -d \$dldir || mkdir -p \$dldir~
11765 $install_prog $dir/$dlname \$dldir/$dlname~
11766 chmod a+x \$dldir/$dlname~
11767 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
11768 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
11769 fi'
11770 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
11771 dlpath=$dir/\$dldll~
11772 $RM \$dlpath'
1130411773 ;;
1130511774
1130611775 osf3* | osf4* | osf5*)
1130711776 version_type=osf
1130811777 need_lib_prefix=no
1130911778 need_version=no
11310 soname_spec='${libname}${release}${shared_ext}$major'
11311 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11779 soname_spec='$libname$release$shared_ext$major'
11780 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
1131211781 shlibpath_var=LD_LIBRARY_PATH
1131311782 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
11314 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
11783 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1131511784 ;;
1131611785
1131711786 rdos*)
1132211791 version_type=linux # correct to gnu/linux during the next big refactor
1132311792 need_lib_prefix=no
1132411793 need_version=no
11325 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11326 soname_spec='${libname}${release}${shared_ext}$major'
11794 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11795 soname_spec='$libname$release$shared_ext$major'
1132711796 shlibpath_var=LD_LIBRARY_PATH
1132811797 shlibpath_overrides_runpath=yes
1132911798 hardcode_into_libs=yes
1133311802
1133411803 sunos4*)
1133511804 version_type=sunos
11336 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
11805 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
1133711806 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1133811807 shlibpath_var=LD_LIBRARY_PATH
1133911808 shlibpath_overrides_runpath=yes
11340 if test "$with_gnu_ld" = yes; then
11809 if test yes = "$with_gnu_ld"; then
1134111810 need_lib_prefix=no
1134211811 fi
1134311812 need_version=yes
1134511814
1134611815 sysv4 | sysv4.3*)
1134711816 version_type=linux # correct to gnu/linux during the next big refactor
11348 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11349 soname_spec='${libname}${release}${shared_ext}$major'
11817 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11818 soname_spec='$libname$release$shared_ext$major'
1135011819 shlibpath_var=LD_LIBRARY_PATH
1135111820 case $host_vendor in
1135211821 sni)
1136711836 ;;
1136811837
1136911838 sysv4*MP*)
11370 if test -d /usr/nec ;then
11839 if test -d /usr/nec; then
1137111840 version_type=linux # correct to gnu/linux during the next big refactor
11372 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
11373 soname_spec='$libname${shared_ext}.$major'
11841 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
11842 soname_spec='$libname$shared_ext.$major'
1137411843 shlibpath_var=LD_LIBRARY_PATH
1137511844 fi
1137611845 ;;
1137711846
1137811847 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
11379 version_type=freebsd-elf
11848 version_type=sco
1138011849 need_lib_prefix=no
1138111850 need_version=no
11382 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
11383 soname_spec='${libname}${release}${shared_ext}$major'
11851 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
11852 soname_spec='$libname$release$shared_ext$major'
1138411853 shlibpath_var=LD_LIBRARY_PATH
1138511854 shlibpath_overrides_runpath=yes
1138611855 hardcode_into_libs=yes
11387 if test "$with_gnu_ld" = yes; then
11856 if test yes = "$with_gnu_ld"; then
1138811857 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
1138911858 else
1139011859 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
1140211871 version_type=linux # correct to gnu/linux during the next big refactor
1140311872 need_lib_prefix=no
1140411873 need_version=no
11405 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11874 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
1140611875 shlibpath_var=LD_LIBRARY_PATH
1140711876 shlibpath_overrides_runpath=no
1140811877 hardcode_into_libs=yes
1141011879
1141111880 uts4*)
1141211881 version_type=linux # correct to gnu/linux during the next big refactor
11413 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11414 soname_spec='${libname}${release}${shared_ext}$major'
11882 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11883 soname_spec='$libname$release$shared_ext$major'
1141511884 shlibpath_var=LD_LIBRARY_PATH
1141611885 ;;
1141711886
1142111890 esac
1142211891 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
1142311892 $as_echo "$dynamic_linker" >&6; }
11424 test "$dynamic_linker" = no && can_build_shared=no
11893 test no = "$dynamic_linker" && can_build_shared=no
1142511894
1142611895 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11427 if test "$GCC" = yes; then
11896 if test yes = "$GCC"; then
1142811897 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1142911898 fi
1143011899
11431 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
11432 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
11433 fi
11434 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
11435 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
11436 fi
11900 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
11901 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
11902 fi
11903
11904 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
11905 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
11906 fi
11907
11908 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
11909 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
11910
11911 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
11912 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
11913
11914 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
11915 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
11916
11917
11918
11919
11920
1143711921
1143811922
1143911923
1153112015 hardcode_action=
1153212016 if test -n "$hardcode_libdir_flag_spec" ||
1153312017 test -n "$runpath_var" ||
11534 test "X$hardcode_automatic" = "Xyes" ; then
12018 test yes = "$hardcode_automatic"; then
1153512019
1153612020 # We can hardcode non-existent directories.
11537 if test "$hardcode_direct" != no &&
12021 if test no != "$hardcode_direct" &&
1153812022 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1153912023 # have to relink, otherwise we might link with an installed library
1154012024 # when we should be linking with a yet-to-be-installed one
11541 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
11542 test "$hardcode_minus_L" != no; then
12025 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
12026 test no != "$hardcode_minus_L"; then
1154312027 # Linking always hardcodes the temporary library directory.
1154412028 hardcode_action=relink
1154512029 else
1155412038 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
1155512039 $as_echo "$hardcode_action" >&6; }
1155612040
11557 if test "$hardcode_action" = relink ||
11558 test "$inherit_rpath" = yes; then
12041 if test relink = "$hardcode_action" ||
12042 test yes = "$inherit_rpath"; then
1155912043 # Fast installation is not supported
1156012044 enable_fast_install=no
11561 elif test "$shlibpath_overrides_runpath" = yes ||
11562 test "$enable_shared" = no; then
12045 elif test yes = "$shlibpath_overrides_runpath" ||
12046 test no = "$enable_shared"; then
1156312047 # Fast installation is not necessary
1156412048 enable_fast_install=needless
1156512049 fi
1156912053
1157012054
1157112055
11572 if test "x$enable_dlopen" != xyes; then
12056 if test yes != "$enable_dlopen"; then
1157312057 enable_dlopen=unknown
1157412058 enable_dlopen_self=unknown
1157512059 enable_dlopen_self_static=unknown
1157912063
1158012064 case $host_os in
1158112065 beos*)
11582 lt_cv_dlopen="load_add_on"
12066 lt_cv_dlopen=load_add_on
1158312067 lt_cv_dlopen_libs=
1158412068 lt_cv_dlopen_self=yes
1158512069 ;;
1158612070
1158712071 mingw* | pw32* | cegcc*)
11588 lt_cv_dlopen="LoadLibrary"
12072 lt_cv_dlopen=LoadLibrary
1158912073 lt_cv_dlopen_libs=
1159012074 ;;
1159112075
1159212076 cygwin*)
11593 lt_cv_dlopen="dlopen"
12077 lt_cv_dlopen=dlopen
1159412078 lt_cv_dlopen_libs=
1159512079 ;;
1159612080
1159712081 darwin*)
11598 # if libdl is installed we need to link against it
12082 # if libdl is installed we need to link against it
1159912083 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
1160012084 $as_echo_n "checking for dlopen in -ldl... " >&6; }
1160112085 if ${ac_cv_lib_dl_dlopen+:} false; then :
1163312117 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
1163412118 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
1163512119 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11636 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
11637 else
11638
11639 lt_cv_dlopen="dyld"
12120 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
12121 else
12122
12123 lt_cv_dlopen=dyld
1164012124 lt_cv_dlopen_libs=
1164112125 lt_cv_dlopen_self=yes
1164212126
1164312127 fi
1164412128
12129 ;;
12130
12131 tpf*)
12132 # Don't try to run any link tests for TPF. We know it's impossible
12133 # because TPF is a cross-compiler, and we know how we open DSOs.
12134 lt_cv_dlopen=dlopen
12135 lt_cv_dlopen_libs=
12136 lt_cv_dlopen_self=no
1164512137 ;;
1164612138
1164712139 *)
1164812140 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
1164912141 if test "x$ac_cv_func_shl_load" = xyes; then :
11650 lt_cv_dlopen="shl_load"
12142 lt_cv_dlopen=shl_load
1165112143 else
1165212144 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
1165312145 $as_echo_n "checking for shl_load in -ldld... " >&6; }
1168612178 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
1168712179 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
1168812180 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
11689 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
12181 lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
1169012182 else
1169112183 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
1169212184 if test "x$ac_cv_func_dlopen" = xyes; then :
11693 lt_cv_dlopen="dlopen"
12185 lt_cv_dlopen=dlopen
1169412186 else
1169512187 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
1169612188 $as_echo_n "checking for dlopen in -ldl... " >&6; }
1172912221 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
1173012222 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
1173112223 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11732 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
12224 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
1173312225 else
1173412226 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
1173512227 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
1176812260 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
1176912261 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
1177012262 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
11771 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
12263 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
1177212264 else
1177312265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
1177412266 $as_echo_n "checking for dld_link in -ldld... " >&6; }
1180712299 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
1180812300 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
1180912301 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
11810 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
12302 lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
1181112303 fi
1181212304
1181312305
1182812320 ;;
1182912321 esac
1183012322
11831 if test "x$lt_cv_dlopen" != xno; then
12323 if test no = "$lt_cv_dlopen"; then
12324 enable_dlopen=no
12325 else
1183212326 enable_dlopen=yes
11833 else
11834 enable_dlopen=no
1183512327 fi
1183612328
1183712329 case $lt_cv_dlopen in
1183812330 dlopen)
11839 save_CPPFLAGS="$CPPFLAGS"
11840 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
11841
11842 save_LDFLAGS="$LDFLAGS"
12331 save_CPPFLAGS=$CPPFLAGS
12332 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
12333
12334 save_LDFLAGS=$LDFLAGS
1184312335 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1184412336
11845 save_LIBS="$LIBS"
12337 save_LIBS=$LIBS
1184612338 LIBS="$lt_cv_dlopen_libs $LIBS"
1184712339
1184812340 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
1185012342 if ${lt_cv_dlopen_self+:} false; then :
1185112343 $as_echo_n "(cached) " >&6
1185212344 else
11853 if test "$cross_compiling" = yes; then :
12345 if test yes = "$cross_compiling"; then :
1185412346 lt_cv_dlopen_self=cross
1185512347 else
1185612348 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1189712389 # endif
1189812390 #endif
1189912391
11900 /* When -fvisbility=hidden is used, assume the code has been annotated
12392 /* When -fvisibility=hidden is used, assume the code has been annotated
1190112393 correspondingly for the symbols needed. */
11902 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
12394 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1190312395 int fnord () __attribute__((visibility("default")));
1190412396 #endif
1190512397
1192912421 (eval $ac_link) 2>&5
1193012422 ac_status=$?
1193112423 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11932 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
12424 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
1193312425 (./conftest; exit; ) >&5 2>/dev/null
1193412426 lt_status=$?
1193512427 case x$lt_status in
1194912441 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
1195012442 $as_echo "$lt_cv_dlopen_self" >&6; }
1195112443
11952 if test "x$lt_cv_dlopen_self" = xyes; then
12444 if test yes = "$lt_cv_dlopen_self"; then
1195312445 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1195412446 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
1195512447 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
1195612448 if ${lt_cv_dlopen_self_static+:} false; then :
1195712449 $as_echo_n "(cached) " >&6
1195812450 else
11959 if test "$cross_compiling" = yes; then :
12451 if test yes = "$cross_compiling"; then :
1196012452 lt_cv_dlopen_self_static=cross
1196112453 else
1196212454 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1200312495 # endif
1200412496 #endif
1200512497
12006 /* When -fvisbility=hidden is used, assume the code has been annotated
12498 /* When -fvisibility=hidden is used, assume the code has been annotated
1200712499 correspondingly for the symbols needed. */
12008 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
12500 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1200912501 int fnord () __attribute__((visibility("default")));
1201012502 #endif
1201112503
1203512527 (eval $ac_link) 2>&5
1203612528 ac_status=$?
1203712529 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12038 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
12530 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
1203912531 (./conftest; exit; ) >&5 2>/dev/null
1204012532 lt_status=$?
1204112533 case x$lt_status in
1205612548 $as_echo "$lt_cv_dlopen_self_static" >&6; }
1205712549 fi
1205812550
12059 CPPFLAGS="$save_CPPFLAGS"
12060 LDFLAGS="$save_LDFLAGS"
12061 LIBS="$save_LIBS"
12551 CPPFLAGS=$save_CPPFLAGS
12552 LDFLAGS=$save_LDFLAGS
12553 LIBS=$save_LIBS
1206212554 ;;
1206312555 esac
1206412556
1210212594 # FIXME - insert some real tests, host_os isn't really good enough
1210312595 case $host_os in
1210412596 darwin*)
12105 if test -n "$STRIP" ; then
12597 if test -n "$STRIP"; then
1210612598 striplib="$STRIP -x"
1210712599 old_striplib="$STRIP -S"
1210812600 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1213012622
1213112623
1213212624
12133 # Report which library types will actually be built
12625 # Report what library types will actually be built
1213412626 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
1213512627 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
1213612628 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
1213812630
1213912631 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
1214012632 $as_echo_n "checking whether to build shared libraries... " >&6; }
12141 test "$can_build_shared" = "no" && enable_shared=no
12633 test no = "$can_build_shared" && enable_shared=no
1214212634
1214312635 # On AIX, shared libraries and static libraries use the same namespace, and
1214412636 # are all built from PIC.
1214512637 case $host_os in
1214612638 aix3*)
12147 test "$enable_shared" = yes && enable_static=no
12639 test yes = "$enable_shared" && enable_static=no
1214812640 if test -n "$RANLIB"; then
1214912641 archive_cmds="$archive_cmds~\$RANLIB \$lib"
1215012642 postinstall_cmds='$RANLIB $lib'
1215212644 ;;
1215312645
1215412646 aix[4-9]*)
12155 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
12156 test "$enable_shared" = yes && enable_static=no
12647 if test ia64 != "$host_cpu"; then
12648 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
12649 yes,aix,yes) ;; # shared object as lib.so file only
12650 yes,svr4,*) ;; # shared object as lib.so archive member only
12651 yes,*) enable_static=no ;; # shared object in lib.a archive as well
12652 esac
1215712653 fi
1215812654 ;;
1215912655 esac
1216312659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
1216412660 $as_echo_n "checking whether to build static libraries... " >&6; }
1216512661 # Make sure either enable_shared or enable_static is yes.
12166 test "$enable_shared" = yes || enable_static=yes
12662 test yes = "$enable_shared" || enable_static=yes
1216712663 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
1216812664 $as_echo "$enable_static" >&6; }
1216912665
1217712673 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1217812674 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1217912675
12180 CC="$lt_save_CC"
12676 CC=$lt_save_CC
1218112677
1218212678
1218312679
1230712803 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
1230812804
1230912805 # Code to be used in simple link tests
12310 lt_simple_link_test_code="$lt_simple_compile_test_code"
12806 lt_simple_link_test_code=$lt_simple_compile_test_code
1231112807
1231212808 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
1231312809
1234112837
1234212838
1234312839 # Allow CC to be a program name with arguments.
12344 lt_save_CC="$CC"
12840 lt_save_CC=$CC
1234512841 lt_save_CFLAGS=$CFLAGS
1234612842 lt_save_GCC=$GCC
1234712843 GCC=
1234912845 CFLAGS=
1235012846 compiler=$CC
1235112847 compiler_RC=$CC
12352 for cc_temp in $compiler""; do
12353 case $cc_temp in
12354 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
12355 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
12356 \-*) ;;
12357 *) break;;
12358 esac
12359 done
12360 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
12848 func_cc_basename $compiler
12849 cc_basename=$func_cc_basename_result
1236112850
1236212851 lt_cv_prog_compiler_c_o_RC=yes
1236312852
1401714506 # report actual input values of CONFIG_FILES etc. instead of their
1401814507 # values after options handling.
1401914508 ac_log="
14020 This file was extended by libdiscid $as_me 0.6.1, which was
14509 This file was extended by libdiscid $as_me 0.6.2, which was
1402114510 generated by GNU Autoconf 2.69. Invocation command line was
1402214511
1402314512 CONFIG_FILES = $CONFIG_FILES
1408314572 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1408414573 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1408514574 ac_cs_version="\\
14086 libdiscid config.status 0.6.1
14575 libdiscid config.status 0.6.2
1408714576 configured by $0, generated by GNU Autoconf 2.69,
1408814577 with options \\"\$ac_cs_config\\"
1408914578
1422114710 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
1422214711 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
1422314712 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
14713 shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
1422414714 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
1422514715 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
1422614716 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
1426814758 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
1426914759 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
1427014760 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
14761 lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
1427114762 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
1427214763 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
14764 lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
1427314765 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
1427414766 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
14767 lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
1427514768 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
1427614769 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
1427714770 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
1433614829 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
1433714830 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
1433814831 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
14339 sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
14832 configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
14833 configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
1434014834 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
1434114835 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
1434214836 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
1443014924 compiler \
1443114925 lt_cv_sys_global_symbol_pipe \
1443214926 lt_cv_sys_global_symbol_to_cdecl \
14927 lt_cv_sys_global_symbol_to_import \
1443314928 lt_cv_sys_global_symbol_to_c_name_address \
1443414929 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
14930 lt_cv_nm_interface \
1443514931 nm_file_list_spec \
14932 lt_cv_truncate_bin \
1443614933 lt_prog_compiler_no_builtin_flag \
1443714934 lt_prog_compiler_pic \
1443814935 lt_prog_compiler_wl \
1448614983 file_list_spec_RC; do
1448714984 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1448814985 *[\\\\\\\`\\"\\\$]*)
14489 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
14986 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
1449014987 ;;
1449114988 *)
1449214989 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1451315010 postuninstall_cmds \
1451415011 finish_cmds \
1451515012 sys_lib_search_path_spec \
14516 sys_lib_dlsearch_path_spec \
15013 configure_time_dlsearch_path \
15014 configure_time_lt_sys_library_path \
1451715015 reload_cmds_RC \
1451815016 old_archive_cmds_RC \
1451915017 old_archive_from_new_cmds_RC \
1452715025 postlink_cmds_RC; do
1452815026 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1452915027 *[\\\\\\\`\\"\\\$]*)
14530 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
15028 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
1453115029 ;;
1453215030 *)
1453315031 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1453615034 done
1453715035
1453815036 ac_aux_dir='$ac_aux_dir'
14539 xsi_shell='$xsi_shell'
14540 lt_shell_append='$lt_shell_append'
14541
14542 # See if we are running on zsh, and set the options which allow our
15037
15038 # See if we are running on zsh, and set the options that allow our
1454315039 # commands through without removal of \ escapes INIT.
14544 if test -n "\${ZSH_VERSION+set}" ; then
15040 if test -n "\${ZSH_VERSION+set}"; then
1454515041 setopt NO_GLOB_SUBST
1454615042 fi
1454715043
1454815044
1454915045 PACKAGE='$PACKAGE'
1455015046 VERSION='$VERSION'
14551 TIMESTAMP='$TIMESTAMP'
1455215047 RM='$RM'
1455315048 ofile='$ofile'
1455415049
1456515060 for ac_config_target in $ac_config_targets
1456615061 do
1456715062 case $ac_config_target in
15063 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
1456815064 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
14569 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
1457015065 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
1457115066 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
1457215067 "libdiscid.pc") CONFIG_FILES="$CONFIG_FILES libdiscid.pc" ;;
1526315758 ;;
1526415759 "libtool":C)
1526515760
15266 # See if we are running on zsh, and set the options which allow our
15761 # See if we are running on zsh, and set the options that allow our
1526715762 # commands through without removal of \ escapes.
15268 if test -n "${ZSH_VERSION+set}" ; then
15763 if test -n "${ZSH_VERSION+set}"; then
1526915764 setopt NO_GLOB_SUBST
1527015765 fi
1527115766
15272 cfgfile="${ofile}T"
15767 cfgfile=${ofile}T
1527315768 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1527415769 $RM "$cfgfile"
1527515770
1527615771 cat <<_LT_EOF >> "$cfgfile"
1527715772 #! $SHELL
15278
15279 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
15280 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
15773 # Generated automatically by $as_me ($PACKAGE) $VERSION
1528115774 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1528215775 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
15776
15777 # Provide generalized library-building support services.
15778 # Written by Gordon Matzigkeit, 1996
15779
15780 # Copyright (C) 2014 Free Software Foundation, Inc.
15781 # This is free software; see the source for copying conditions. There is NO
15782 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15783
15784 # GNU Libtool is free software; you can redistribute it and/or modify
15785 # it under the terms of the GNU General Public License as published by
15786 # the Free Software Foundation; either version 2 of of the License, or
15787 # (at your option) any later version.
1528315788 #
15284 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
15285 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
15286 # Foundation, Inc.
15287 # Written by Gordon Matzigkeit, 1996
15789 # As a special exception to the GNU General Public License, if you
15790 # distribute this file as part of a program or library that is built
15791 # using GNU Libtool, you may include this file under the same
15792 # distribution terms that you use for the rest of that program.
1528815793 #
15289 # This file is part of GNU Libtool.
15290 #
15291 # GNU Libtool is free software; you can redistribute it and/or
15292 # modify it under the terms of the GNU General Public License as
15293 # published by the Free Software Foundation; either version 2 of
15294 # the License, or (at your option) any later version.
15295 #
15296 # As a special exception to the GNU General Public License,
15297 # if you distribute this file as part of a program or library that
15298 # is built using GNU Libtool, you may include this file under the
15299 # same distribution terms that you use for the rest of that program.
15300 #
15301 # GNU Libtool is distributed in the hope that it will be useful,
15302 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15794 # GNU Libtool is distributed in the hope that it will be useful, but
15795 # WITHOUT ANY WARRANTY; without even the implied warranty of
1530315796 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1530415797 # GNU General Public License for more details.
1530515798 #
1530615799 # You should have received a copy of the GNU General Public License
15307 # along with GNU Libtool; see the file COPYING. If not, a copy
15308 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
15309 # obtained by writing to the Free Software Foundation, Inc.,
15310 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15800 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1531115801
1531215802
1531315803 # The names of the tagged configurations supported by this script.
15314 available_tags="RC "
15804 available_tags='RC '
15805
15806 # Configured defaults for sys_lib_dlsearch_path munging.
15807 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
1531515808
1531615809 # ### BEGIN LIBTOOL CONFIG
1531715810
1533915832
1534015833 # Whether or not to optimize for fast installation.
1534115834 fast_install=$enable_fast_install
15835
15836 # Shared archive member basename,for filename based shared library versioning on AIX.
15837 shared_archive_member_spec=$shared_archive_member_spec
1534215838
1534315839 # Shell to use when invoking shell scripts.
1534415840 SHELL=$lt_SHELL
1545115947 # Transform the output of nm in a proper C declaration.
1545215948 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
1545315949
15950 # Transform the output of nm into a list of symbols to manually relocate.
15951 global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
15952
1545415953 # Transform the output of nm in a C name address pair.
1545515954 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
1545615955
1545715956 # Transform the output of nm in a C name address pair when lib prefix is needed.
1545815957 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
1545915958
15959 # The name lister interface.
15960 nm_interface=$lt_lt_cv_nm_interface
15961
1546015962 # Specify filename containing input files for \$NM.
1546115963 nm_file_list_spec=$lt_nm_file_list_spec
1546215964
15463 # The root where to search for dependent libraries,and in which our libraries should be installed.
15965 # The root where to search for dependent libraries,and where our libraries should be installed.
1546415966 lt_sysroot=$lt_sysroot
15967
15968 # Command to truncate a binary pipe.
15969 lt_truncate_bin=$lt_lt_cv_truncate_bin
1546515970
1546615971 # The name of the directory that contains temporary libtool files.
1546715972 objdir=$objdir
1555316058 # Compile-time system search path for libraries.
1555416059 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
1555516060
15556 # Run-time system search path for libraries.
15557 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
16061 # Detected run-time system search path for libraries.
16062 sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
16063
16064 # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
16065 configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
1555816066
1555916067 # Whether dlopen is supported.
1556016068 dlopen_support=$enable_dlopen
1564716155 # Whether we need a single "-rpath" flag with a separated argument.
1564816156 hardcode_libdir_separator=$lt_hardcode_libdir_separator
1564916157
15650 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
16158 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
1565116159 # DIR into the resulting binary.
1565216160 hardcode_direct=$hardcode_direct
1565316161
15654 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
16162 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
1565516163 # DIR into the resulting binary and the resulting library dependency is
15656 # "absolute",i.e impossible to change by setting \${shlibpath_var} if the
16164 # "absolute",i.e impossible to change by setting \$shlibpath_var if the
1565716165 # library is relocated.
1565816166 hardcode_direct_absolute=$hardcode_direct_absolute
1565916167
1570216210 hardcode_action=$hardcode_action
1570316211
1570416212 # ### END LIBTOOL CONFIG
16213
16214 _LT_EOF
16215
16216 cat <<'_LT_EOF' >> "$cfgfile"
16217
16218 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
16219
16220 # func_munge_path_list VARIABLE PATH
16221 # -----------------------------------
16222 # VARIABLE is name of variable containing _space_ separated list of
16223 # directories to be munged by the contents of PATH, which is string
16224 # having a format:
16225 # "DIR[:DIR]:"
16226 # string "DIR[ DIR]" will be prepended to VARIABLE
16227 # ":DIR[:DIR]"
16228 # string "DIR[ DIR]" will be appended to VARIABLE
16229 # "DIRP[:DIRP]::[DIRA:]DIRA"
16230 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
16231 # "DIRA[ DIRA]" will be appended to VARIABLE
16232 # "DIR[:DIR]"
16233 # VARIABLE will be replaced by "DIR[ DIR]"
16234 func_munge_path_list ()
16235 {
16236 case x$2 in
16237 x)
16238 ;;
16239 *:)
16240 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
16241 ;;
16242 x:*)
16243 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
16244 ;;
16245 *::*)
16246 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
16247 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
16248 ;;
16249 *)
16250 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
16251 ;;
16252 esac
16253 }
16254
16255
16256 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
16257 func_cc_basename ()
16258 {
16259 for cc_temp in $*""; do
16260 case $cc_temp in
16261 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
16262 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
16263 \-*) ;;
16264 *) break;;
16265 esac
16266 done
16267 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
16268 }
16269
16270
16271 # ### END FUNCTIONS SHARED WITH CONFIGURE
1570516272
1570616273 _LT_EOF
1570716274
1571116278 # AIX sometimes has problems with the GCC collect2 program. For some
1571216279 # reason, if we set the COLLECT_NAMES environment variable, the problems
1571316280 # vanish in a puff of smoke.
15714 if test "X${COLLECT_NAMES+set}" != Xset; then
16281 if test set != "${COLLECT_NAMES+set}"; then
1571516282 COLLECT_NAMES=
1571616283 export COLLECT_NAMES
1571716284 fi
1572016287 esac
1572116288
1572216289
15723 ltmain="$ac_aux_dir/ltmain.sh"
16290 ltmain=$ac_aux_dir/ltmain.sh
1572416291
1572516292
1572616293 # We use sed instead of cat because bash on DJGPP gets confused if
1573016297 sed '$q' "$ltmain" >> "$cfgfile" \
1573116298 || (rm -f "$cfgfile"; exit 1)
1573216299
15733 if test x"$xsi_shell" = xyes; then
15734 sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
15735 func_dirname ()\
15736 {\
15737 \ case ${1} in\
15738 \ */*) func_dirname_result="${1%/*}${2}" ;;\
15739 \ * ) func_dirname_result="${3}" ;;\
15740 \ esac\
15741 } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
15742 && mv -f "$cfgfile.tmp" "$cfgfile" \
15743 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15744 test 0 -eq $? || _lt_function_replace_fail=:
15745
15746
15747 sed -e '/^func_basename ()$/,/^} # func_basename /c\
15748 func_basename ()\
15749 {\
15750 \ func_basename_result="${1##*/}"\
15751 } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
15752 && mv -f "$cfgfile.tmp" "$cfgfile" \
15753 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15754 test 0 -eq $? || _lt_function_replace_fail=:
15755
15756
15757 sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
15758 func_dirname_and_basename ()\
15759 {\
15760 \ case ${1} in\
15761 \ */*) func_dirname_result="${1%/*}${2}" ;;\
15762 \ * ) func_dirname_result="${3}" ;;\
15763 \ esac\
15764 \ func_basename_result="${1##*/}"\
15765 } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
15766 && mv -f "$cfgfile.tmp" "$cfgfile" \
15767 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15768 test 0 -eq $? || _lt_function_replace_fail=:
15769
15770
15771 sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
15772 func_stripname ()\
15773 {\
15774 \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
15775 \ # positional parameters, so assign one to ordinary parameter first.\
15776 \ func_stripname_result=${3}\
15777 \ func_stripname_result=${func_stripname_result#"${1}"}\
15778 \ func_stripname_result=${func_stripname_result%"${2}"}\
15779 } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
15780 && mv -f "$cfgfile.tmp" "$cfgfile" \
15781 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15782 test 0 -eq $? || _lt_function_replace_fail=:
15783
15784
15785 sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
15786 func_split_long_opt ()\
15787 {\
15788 \ func_split_long_opt_name=${1%%=*}\
15789 \ func_split_long_opt_arg=${1#*=}\
15790 } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
15791 && mv -f "$cfgfile.tmp" "$cfgfile" \
15792 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15793 test 0 -eq $? || _lt_function_replace_fail=:
15794
15795
15796 sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
15797 func_split_short_opt ()\
15798 {\
15799 \ func_split_short_opt_arg=${1#??}\
15800 \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
15801 } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
15802 && mv -f "$cfgfile.tmp" "$cfgfile" \
15803 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15804 test 0 -eq $? || _lt_function_replace_fail=:
15805
15806
15807 sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
15808 func_lo2o ()\
15809 {\
15810 \ case ${1} in\
15811 \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
15812 \ *) func_lo2o_result=${1} ;;\
15813 \ esac\
15814 } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
15815 && mv -f "$cfgfile.tmp" "$cfgfile" \
15816 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15817 test 0 -eq $? || _lt_function_replace_fail=:
15818
15819
15820 sed -e '/^func_xform ()$/,/^} # func_xform /c\
15821 func_xform ()\
15822 {\
15823 func_xform_result=${1%.*}.lo\
15824 } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
15825 && mv -f "$cfgfile.tmp" "$cfgfile" \
15826 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15827 test 0 -eq $? || _lt_function_replace_fail=:
15828
15829
15830 sed -e '/^func_arith ()$/,/^} # func_arith /c\
15831 func_arith ()\
15832 {\
15833 func_arith_result=$(( $* ))\
15834 } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
15835 && mv -f "$cfgfile.tmp" "$cfgfile" \
15836 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15837 test 0 -eq $? || _lt_function_replace_fail=:
15838
15839
15840 sed -e '/^func_len ()$/,/^} # func_len /c\
15841 func_len ()\
15842 {\
15843 func_len_result=${#1}\
15844 } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
15845 && mv -f "$cfgfile.tmp" "$cfgfile" \
15846 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15847 test 0 -eq $? || _lt_function_replace_fail=:
15848
15849 fi
15850
15851 if test x"$lt_shell_append" = xyes; then
15852 sed -e '/^func_append ()$/,/^} # func_append /c\
15853 func_append ()\
15854 {\
15855 eval "${1}+=\\${2}"\
15856 } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
15857 && mv -f "$cfgfile.tmp" "$cfgfile" \
15858 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15859 test 0 -eq $? || _lt_function_replace_fail=:
15860
15861
15862 sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
15863 func_append_quoted ()\
15864 {\
15865 \ func_quote_for_eval "${2}"\
15866 \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
15867 } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
15868 && mv -f "$cfgfile.tmp" "$cfgfile" \
15869 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15870 test 0 -eq $? || _lt_function_replace_fail=:
15871
15872
15873 # Save a `func_append' function call where possible by direct use of '+='
15874 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
15875 && mv -f "$cfgfile.tmp" "$cfgfile" \
15876 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15877 test 0 -eq $? || _lt_function_replace_fail=:
15878 else
15879 # Save a `func_append' function call even when '+=' is not available
15880 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
15881 && mv -f "$cfgfile.tmp" "$cfgfile" \
15882 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15883 test 0 -eq $? || _lt_function_replace_fail=:
15884 fi
15885
15886 if test x"$_lt_function_replace_fail" = x":"; then
15887 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
15888 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
15889 fi
15890
15891
1589216300 mv -f "$cfgfile" "$ofile" ||
1589316301 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1589416302 chmod +x "$ofile"
1597516383 # Whether we need a single "-rpath" flag with a separated argument.
1597616384 hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
1597716385
15978 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
16386 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
1597916387 # DIR into the resulting binary.
1598016388 hardcode_direct=$hardcode_direct_RC
1598116389
15982 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
16390 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
1598316391 # DIR into the resulting binary and the resulting library dependency is
15984 # "absolute",i.e impossible to change by setting \${shlibpath_var} if the
16392 # "absolute",i.e impossible to change by setting \$shlibpath_var if the
1598516393 # library is relocated.
1598616394 hardcode_direct_absolute=$hardcode_direct_absolute_RC
1598716395
77 # PATCH is increase for all other releases
88 define(MAJOR, 0)
99 define(MINOR, 6)
10 define(PATCH, 1)
10 define(PATCH, 2)
1111 # currently the sole purpose of the project is the library,
1212 # so we use the library version also as project version
1313 AC_INIT(libdiscid, MAJOR.MINOR.PATCH)
1414
15 AC_CONFIG_SRCDIR(src/disc.c)
15 AC_CONFIG_SRCDIR([src/disc.c])
16 AC_CONFIG_HEADERS([config.h])
17 AC_CONFIG_AUX_DIR([build-aux]) # where to put config.guess etc.
1618 AM_INIT_AUTOMAKE([foreign subdir-objects])
1719 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
18 AC_CONFIG_HEADERS(config.h)
1920
2021 libdiscid_MAJOR=MAJOR
2122 libdiscid_MINOR=MINOR
+0
-791
depcomp less more
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2013-05-30.07; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
26
27 case $1 in
28 '')
29 echo "$0: No command. Try '$0 --help' for more information." 1>&2
30 exit 1;
31 ;;
32 -h | --h*)
33 cat <<\EOF
34 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
35
36 Run PROGRAMS ARGS to compile a file, generating dependencies
37 as side-effects.
38
39 Environment variables:
40 depmode Dependency tracking mode.
41 source Source file read by 'PROGRAMS ARGS'.
42 object Object file output by 'PROGRAMS ARGS'.
43 DEPDIR directory where to store dependencies.
44 depfile Dependency file to output.
45 tmpdepfile Temporary file to use when outputting dependencies.
46 libtool Whether libtool is used (yes/no).
47
48 Report bugs to <bug-automake@gnu.org>.
49 EOF
50 exit $?
51 ;;
52 -v | --v*)
53 echo "depcomp $scriptversion"
54 exit $?
55 ;;
56 esac
57
58 # Get the directory component of the given path, and save it in the
59 # global variables '$dir'. Note that this directory component will
60 # be either empty or ending with a '/' character. This is deliberate.
61 set_dir_from ()
62 {
63 case $1 in
64 */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
65 *) dir=;;
66 esac
67 }
68
69 # Get the suffix-stripped basename of the given path, and save it the
70 # global variable '$base'.
71 set_base_from ()
72 {
73 base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
74 }
75
76 # If no dependency file was actually created by the compiler invocation,
77 # we still have to create a dummy depfile, to avoid errors with the
78 # Makefile "include basename.Plo" scheme.
79 make_dummy_depfile ()
80 {
81 echo "#dummy" > "$depfile"
82 }
83
84 # Factor out some common post-processing of the generated depfile.
85 # Requires the auxiliary global variable '$tmpdepfile' to be set.
86 aix_post_process_depfile ()
87 {
88 # If the compiler actually managed to produce a dependency file,
89 # post-process it.
90 if test -f "$tmpdepfile"; then
91 # Each line is of the form 'foo.o: dependency.h'.
92 # Do two passes, one to just change these to
93 # $object: dependency.h
94 # and one to simply output
95 # dependency.h:
96 # which is needed to avoid the deleted-header problem.
97 { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
98 sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
99 } > "$depfile"
100 rm -f "$tmpdepfile"
101 else
102 make_dummy_depfile
103 fi
104 }
105
106 # A tabulation character.
107 tab=' '
108 # A newline character.
109 nl='
110 '
111 # Character ranges might be problematic outside the C locale.
112 # These definitions help.
113 upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
114 lower=abcdefghijklmnopqrstuvwxyz
115 digits=0123456789
116 alpha=${upper}${lower}
117
118 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
119 echo "depcomp: Variables source, object and depmode must be set" 1>&2
120 exit 1
121 fi
122
123 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
124 depfile=${depfile-`echo "$object" |
125 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
126 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
127
128 rm -f "$tmpdepfile"
129
130 # Avoid interferences from the environment.
131 gccflag= dashmflag=
132
133 # Some modes work just like other modes, but use different flags. We
134 # parameterize here, but still list the modes in the big case below,
135 # to make depend.m4 easier to write. Note that we *cannot* use a case
136 # here, because this file can only contain one case statement.
137 if test "$depmode" = hp; then
138 # HP compiler uses -M and no extra arg.
139 gccflag=-M
140 depmode=gcc
141 fi
142
143 if test "$depmode" = dashXmstdout; then
144 # This is just like dashmstdout with a different argument.
145 dashmflag=-xM
146 depmode=dashmstdout
147 fi
148
149 cygpath_u="cygpath -u -f -"
150 if test "$depmode" = msvcmsys; then
151 # This is just like msvisualcpp but w/o cygpath translation.
152 # Just convert the backslash-escaped backslashes to single forward
153 # slashes to satisfy depend.m4
154 cygpath_u='sed s,\\\\,/,g'
155 depmode=msvisualcpp
156 fi
157
158 if test "$depmode" = msvc7msys; then
159 # This is just like msvc7 but w/o cygpath translation.
160 # Just convert the backslash-escaped backslashes to single forward
161 # slashes to satisfy depend.m4
162 cygpath_u='sed s,\\\\,/,g'
163 depmode=msvc7
164 fi
165
166 if test "$depmode" = xlc; then
167 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
168 gccflag=-qmakedep=gcc,-MF
169 depmode=gcc
170 fi
171
172 case "$depmode" in
173 gcc3)
174 ## gcc 3 implements dependency tracking that does exactly what
175 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
176 ## it if -MD -MP comes after the -MF stuff. Hmm.
177 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
178 ## the command line argument order; so add the flags where they
179 ## appear in depend2.am. Note that the slowdown incurred here
180 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
181 for arg
182 do
183 case $arg in
184 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
185 *) set fnord "$@" "$arg" ;;
186 esac
187 shift # fnord
188 shift # $arg
189 done
190 "$@"
191 stat=$?
192 if test $stat -ne 0; then
193 rm -f "$tmpdepfile"
194 exit $stat
195 fi
196 mv "$tmpdepfile" "$depfile"
197 ;;
198
199 gcc)
200 ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
201 ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
202 ## (see the conditional assignment to $gccflag above).
203 ## There are various ways to get dependency output from gcc. Here's
204 ## why we pick this rather obscure method:
205 ## - Don't want to use -MD because we'd like the dependencies to end
206 ## up in a subdir. Having to rename by hand is ugly.
207 ## (We might end up doing this anyway to support other compilers.)
208 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
209 ## -MM, not -M (despite what the docs say). Also, it might not be
210 ## supported by the other compilers which use the 'gcc' depmode.
211 ## - Using -M directly means running the compiler twice (even worse
212 ## than renaming).
213 if test -z "$gccflag"; then
214 gccflag=-MD,
215 fi
216 "$@" -Wp,"$gccflag$tmpdepfile"
217 stat=$?
218 if test $stat -ne 0; then
219 rm -f "$tmpdepfile"
220 exit $stat
221 fi
222 rm -f "$depfile"
223 echo "$object : \\" > "$depfile"
224 # The second -e expression handles DOS-style file names with drive
225 # letters.
226 sed -e 's/^[^:]*: / /' \
227 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
228 ## This next piece of magic avoids the "deleted header file" problem.
229 ## The problem is that when a header file which appears in a .P file
230 ## is deleted, the dependency causes make to die (because there is
231 ## typically no way to rebuild the header). We avoid this by adding
232 ## dummy dependencies for each header file. Too bad gcc doesn't do
233 ## this for us directly.
234 ## Some versions of gcc put a space before the ':'. On the theory
235 ## that the space means something, we add a space to the output as
236 ## well. hp depmode also adds that space, but also prefixes the VPATH
237 ## to the object. Take care to not repeat it in the output.
238 ## Some versions of the HPUX 10.20 sed can't process this invocation
239 ## correctly. Breaking it into two sed invocations is a workaround.
240 tr ' ' "$nl" < "$tmpdepfile" \
241 | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
242 | sed -e 's/$/ :/' >> "$depfile"
243 rm -f "$tmpdepfile"
244 ;;
245
246 hp)
247 # This case exists only to let depend.m4 do its work. It works by
248 # looking at the text of this script. This case will never be run,
249 # since it is checked for above.
250 exit 1
251 ;;
252
253 sgi)
254 if test "$libtool" = yes; then
255 "$@" "-Wp,-MDupdate,$tmpdepfile"
256 else
257 "$@" -MDupdate "$tmpdepfile"
258 fi
259 stat=$?
260 if test $stat -ne 0; then
261 rm -f "$tmpdepfile"
262 exit $stat
263 fi
264 rm -f "$depfile"
265
266 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
267 echo "$object : \\" > "$depfile"
268 # Clip off the initial element (the dependent). Don't try to be
269 # clever and replace this with sed code, as IRIX sed won't handle
270 # lines with more than a fixed number of characters (4096 in
271 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
272 # the IRIX cc adds comments like '#:fec' to the end of the
273 # dependency line.
274 tr ' ' "$nl" < "$tmpdepfile" \
275 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
276 | tr "$nl" ' ' >> "$depfile"
277 echo >> "$depfile"
278 # The second pass generates a dummy entry for each header file.
279 tr ' ' "$nl" < "$tmpdepfile" \
280 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
281 >> "$depfile"
282 else
283 make_dummy_depfile
284 fi
285 rm -f "$tmpdepfile"
286 ;;
287
288 xlc)
289 # This case exists only to let depend.m4 do its work. It works by
290 # looking at the text of this script. This case will never be run,
291 # since it is checked for above.
292 exit 1
293 ;;
294
295 aix)
296 # The C for AIX Compiler uses -M and outputs the dependencies
297 # in a .u file. In older versions, this file always lives in the
298 # current directory. Also, the AIX compiler puts '$object:' at the
299 # start of each line; $object doesn't have directory information.
300 # Version 6 uses the directory in both cases.
301 set_dir_from "$object"
302 set_base_from "$object"
303 if test "$libtool" = yes; then
304 tmpdepfile1=$dir$base.u
305 tmpdepfile2=$base.u
306 tmpdepfile3=$dir.libs/$base.u
307 "$@" -Wc,-M
308 else
309 tmpdepfile1=$dir$base.u
310 tmpdepfile2=$dir$base.u
311 tmpdepfile3=$dir$base.u
312 "$@" -M
313 fi
314 stat=$?
315 if test $stat -ne 0; then
316 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
317 exit $stat
318 fi
319
320 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
321 do
322 test -f "$tmpdepfile" && break
323 done
324 aix_post_process_depfile
325 ;;
326
327 tcc)
328 # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
329 # FIXME: That version still under development at the moment of writing.
330 # Make that this statement remains true also for stable, released
331 # versions.
332 # It will wrap lines (doesn't matter whether long or short) with a
333 # trailing '\', as in:
334 #
335 # foo.o : \
336 # foo.c \
337 # foo.h \
338 #
339 # It will put a trailing '\' even on the last line, and will use leading
340 # spaces rather than leading tabs (at least since its commit 0394caf7
341 # "Emit spaces for -MD").
342 "$@" -MD -MF "$tmpdepfile"
343 stat=$?
344 if test $stat -ne 0; then
345 rm -f "$tmpdepfile"
346 exit $stat
347 fi
348 rm -f "$depfile"
349 # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
350 # We have to change lines of the first kind to '$object: \'.
351 sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
352 # And for each line of the second kind, we have to emit a 'dep.h:'
353 # dummy dependency, to avoid the deleted-header problem.
354 sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
355 rm -f "$tmpdepfile"
356 ;;
357
358 ## The order of this option in the case statement is important, since the
359 ## shell code in configure will try each of these formats in the order
360 ## listed in this file. A plain '-MD' option would be understood by many
361 ## compilers, so we must ensure this comes after the gcc and icc options.
362 pgcc)
363 # Portland's C compiler understands '-MD'.
364 # Will always output deps to 'file.d' where file is the root name of the
365 # source file under compilation, even if file resides in a subdirectory.
366 # The object file name does not affect the name of the '.d' file.
367 # pgcc 10.2 will output
368 # foo.o: sub/foo.c sub/foo.h
369 # and will wrap long lines using '\' :
370 # foo.o: sub/foo.c ... \
371 # sub/foo.h ... \
372 # ...
373 set_dir_from "$object"
374 # Use the source, not the object, to determine the base name, since
375 # that's sadly what pgcc will do too.
376 set_base_from "$source"
377 tmpdepfile=$base.d
378
379 # For projects that build the same source file twice into different object
380 # files, the pgcc approach of using the *source* file root name can cause
381 # problems in parallel builds. Use a locking strategy to avoid stomping on
382 # the same $tmpdepfile.
383 lockdir=$base.d-lock
384 trap "
385 echo '$0: caught signal, cleaning up...' >&2
386 rmdir '$lockdir'
387 exit 1
388 " 1 2 13 15
389 numtries=100
390 i=$numtries
391 while test $i -gt 0; do
392 # mkdir is a portable test-and-set.
393 if mkdir "$lockdir" 2>/dev/null; then
394 # This process acquired the lock.
395 "$@" -MD
396 stat=$?
397 # Release the lock.
398 rmdir "$lockdir"
399 break
400 else
401 # If the lock is being held by a different process, wait
402 # until the winning process is done or we timeout.
403 while test -d "$lockdir" && test $i -gt 0; do
404 sleep 1
405 i=`expr $i - 1`
406 done
407 fi
408 i=`expr $i - 1`
409 done
410 trap - 1 2 13 15
411 if test $i -le 0; then
412 echo "$0: failed to acquire lock after $numtries attempts" >&2
413 echo "$0: check lockdir '$lockdir'" >&2
414 exit 1
415 fi
416
417 if test $stat -ne 0; then
418 rm -f "$tmpdepfile"
419 exit $stat
420 fi
421 rm -f "$depfile"
422 # Each line is of the form `foo.o: dependent.h',
423 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
424 # Do two passes, one to just change these to
425 # `$object: dependent.h' and one to simply `dependent.h:'.
426 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
427 # Some versions of the HPUX 10.20 sed can't process this invocation
428 # correctly. Breaking it into two sed invocations is a workaround.
429 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
430 | sed -e 's/$/ :/' >> "$depfile"
431 rm -f "$tmpdepfile"
432 ;;
433
434 hp2)
435 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
436 # compilers, which have integrated preprocessors. The correct option
437 # to use with these is +Maked; it writes dependencies to a file named
438 # 'foo.d', which lands next to the object file, wherever that
439 # happens to be.
440 # Much of this is similar to the tru64 case; see comments there.
441 set_dir_from "$object"
442 set_base_from "$object"
443 if test "$libtool" = yes; then
444 tmpdepfile1=$dir$base.d
445 tmpdepfile2=$dir.libs/$base.d
446 "$@" -Wc,+Maked
447 else
448 tmpdepfile1=$dir$base.d
449 tmpdepfile2=$dir$base.d
450 "$@" +Maked
451 fi
452 stat=$?
453 if test $stat -ne 0; then
454 rm -f "$tmpdepfile1" "$tmpdepfile2"
455 exit $stat
456 fi
457
458 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
459 do
460 test -f "$tmpdepfile" && break
461 done
462 if test -f "$tmpdepfile"; then
463 sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
464 # Add 'dependent.h:' lines.
465 sed -ne '2,${
466 s/^ *//
467 s/ \\*$//
468 s/$/:/
469 p
470 }' "$tmpdepfile" >> "$depfile"
471 else
472 make_dummy_depfile
473 fi
474 rm -f "$tmpdepfile" "$tmpdepfile2"
475 ;;
476
477 tru64)
478 # The Tru64 compiler uses -MD to generate dependencies as a side
479 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
480 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
481 # dependencies in 'foo.d' instead, so we check for that too.
482 # Subdirectories are respected.
483 set_dir_from "$object"
484 set_base_from "$object"
485
486 if test "$libtool" = yes; then
487 # Libtool generates 2 separate objects for the 2 libraries. These
488 # two compilations output dependencies in $dir.libs/$base.o.d and
489 # in $dir$base.o.d. We have to check for both files, because
490 # one of the two compilations can be disabled. We should prefer
491 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
492 # automatically cleaned when .libs/ is deleted, while ignoring
493 # the former would cause a distcleancheck panic.
494 tmpdepfile1=$dir$base.o.d # libtool 1.5
495 tmpdepfile2=$dir.libs/$base.o.d # Likewise.
496 tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
497 "$@" -Wc,-MD
498 else
499 tmpdepfile1=$dir$base.d
500 tmpdepfile2=$dir$base.d
501 tmpdepfile3=$dir$base.d
502 "$@" -MD
503 fi
504
505 stat=$?
506 if test $stat -ne 0; then
507 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
508 exit $stat
509 fi
510
511 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
512 do
513 test -f "$tmpdepfile" && break
514 done
515 # Same post-processing that is required for AIX mode.
516 aix_post_process_depfile
517 ;;
518
519 msvc7)
520 if test "$libtool" = yes; then
521 showIncludes=-Wc,-showIncludes
522 else
523 showIncludes=-showIncludes
524 fi
525 "$@" $showIncludes > "$tmpdepfile"
526 stat=$?
527 grep -v '^Note: including file: ' "$tmpdepfile"
528 if test $stat -ne 0; then
529 rm -f "$tmpdepfile"
530 exit $stat
531 fi
532 rm -f "$depfile"
533 echo "$object : \\" > "$depfile"
534 # The first sed program below extracts the file names and escapes
535 # backslashes for cygpath. The second sed program outputs the file
536 # name when reading, but also accumulates all include files in the
537 # hold buffer in order to output them again at the end. This only
538 # works with sed implementations that can handle large buffers.
539 sed < "$tmpdepfile" -n '
540 /^Note: including file: *\(.*\)/ {
541 s//\1/
542 s/\\/\\\\/g
543 p
544 }' | $cygpath_u | sort -u | sed -n '
545 s/ /\\ /g
546 s/\(.*\)/'"$tab"'\1 \\/p
547 s/.\(.*\) \\/\1:/
548 H
549 $ {
550 s/.*/'"$tab"'/
551 G
552 p
553 }' >> "$depfile"
554 echo >> "$depfile" # make sure the fragment doesn't end with a backslash
555 rm -f "$tmpdepfile"
556 ;;
557
558 msvc7msys)
559 # This case exists only to let depend.m4 do its work. It works by
560 # looking at the text of this script. This case will never be run,
561 # since it is checked for above.
562 exit 1
563 ;;
564
565 #nosideeffect)
566 # This comment above is used by automake to tell side-effect
567 # dependency tracking mechanisms from slower ones.
568
569 dashmstdout)
570 # Important note: in order to support this mode, a compiler *must*
571 # always write the preprocessed file to stdout, regardless of -o.
572 "$@" || exit $?
573
574 # Remove the call to Libtool.
575 if test "$libtool" = yes; then
576 while test "X$1" != 'X--mode=compile'; do
577 shift
578 done
579 shift
580 fi
581
582 # Remove '-o $object'.
583 IFS=" "
584 for arg
585 do
586 case $arg in
587 -o)
588 shift
589 ;;
590 $object)
591 shift
592 ;;
593 *)
594 set fnord "$@" "$arg"
595 shift # fnord
596 shift # $arg
597 ;;
598 esac
599 done
600
601 test -z "$dashmflag" && dashmflag=-M
602 # Require at least two characters before searching for ':'
603 # in the target name. This is to cope with DOS-style filenames:
604 # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
605 "$@" $dashmflag |
606 sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
607 rm -f "$depfile"
608 cat < "$tmpdepfile" > "$depfile"
609 # Some versions of the HPUX 10.20 sed can't process this sed invocation
610 # correctly. Breaking it into two sed invocations is a workaround.
611 tr ' ' "$nl" < "$tmpdepfile" \
612 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
613 | sed -e 's/$/ :/' >> "$depfile"
614 rm -f "$tmpdepfile"
615 ;;
616
617 dashXmstdout)
618 # This case only exists to satisfy depend.m4. It is never actually
619 # run, as this mode is specially recognized in the preamble.
620 exit 1
621 ;;
622
623 makedepend)
624 "$@" || exit $?
625 # Remove any Libtool call
626 if test "$libtool" = yes; then
627 while test "X$1" != 'X--mode=compile'; do
628 shift
629 done
630 shift
631 fi
632 # X makedepend
633 shift
634 cleared=no eat=no
635 for arg
636 do
637 case $cleared in
638 no)
639 set ""; shift
640 cleared=yes ;;
641 esac
642 if test $eat = yes; then
643 eat=no
644 continue
645 fi
646 case "$arg" in
647 -D*|-I*)
648 set fnord "$@" "$arg"; shift ;;
649 # Strip any option that makedepend may not understand. Remove
650 # the object too, otherwise makedepend will parse it as a source file.
651 -arch)
652 eat=yes ;;
653 -*|$object)
654 ;;
655 *)
656 set fnord "$@" "$arg"; shift ;;
657 esac
658 done
659 obj_suffix=`echo "$object" | sed 's/^.*\././'`
660 touch "$tmpdepfile"
661 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
662 rm -f "$depfile"
663 # makedepend may prepend the VPATH from the source file name to the object.
664 # No need to regex-escape $object, excess matching of '.' is harmless.
665 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
666 # Some versions of the HPUX 10.20 sed can't process the last invocation
667 # correctly. Breaking it into two sed invocations is a workaround.
668 sed '1,2d' "$tmpdepfile" \
669 | tr ' ' "$nl" \
670 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
671 | sed -e 's/$/ :/' >> "$depfile"
672 rm -f "$tmpdepfile" "$tmpdepfile".bak
673 ;;
674
675 cpp)
676 # Important note: in order to support this mode, a compiler *must*
677 # always write the preprocessed file to stdout.
678 "$@" || exit $?
679
680 # Remove the call to Libtool.
681 if test "$libtool" = yes; then
682 while test "X$1" != 'X--mode=compile'; do
683 shift
684 done
685 shift
686 fi
687
688 # Remove '-o $object'.
689 IFS=" "
690 for arg
691 do
692 case $arg in
693 -o)
694 shift
695 ;;
696 $object)
697 shift
698 ;;
699 *)
700 set fnord "$@" "$arg"
701 shift # fnord
702 shift # $arg
703 ;;
704 esac
705 done
706
707 "$@" -E \
708 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
709 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
710 | sed '$ s: \\$::' > "$tmpdepfile"
711 rm -f "$depfile"
712 echo "$object : \\" > "$depfile"
713 cat < "$tmpdepfile" >> "$depfile"
714 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
715 rm -f "$tmpdepfile"
716 ;;
717
718 msvisualcpp)
719 # Important note: in order to support this mode, a compiler *must*
720 # always write the preprocessed file to stdout.
721 "$@" || exit $?
722
723 # Remove the call to Libtool.
724 if test "$libtool" = yes; then
725 while test "X$1" != 'X--mode=compile'; do
726 shift
727 done
728 shift
729 fi
730
731 IFS=" "
732 for arg
733 do
734 case "$arg" in
735 -o)
736 shift
737 ;;
738 $object)
739 shift
740 ;;
741 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
742 set fnord "$@"
743 shift
744 shift
745 ;;
746 *)
747 set fnord "$@" "$arg"
748 shift
749 shift
750 ;;
751 esac
752 done
753 "$@" -E 2>/dev/null |
754 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
755 rm -f "$depfile"
756 echo "$object : \\" > "$depfile"
757 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
758 echo "$tab" >> "$depfile"
759 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
760 rm -f "$tmpdepfile"
761 ;;
762
763 msvcmsys)
764 # This case exists only to let depend.m4 do its work. It works by
765 # looking at the text of this script. This case will never be run,
766 # since it is checked for above.
767 exit 1
768 ;;
769
770 none)
771 exec "$@"
772 ;;
773
774 *)
775 echo "Unknown depmode $depmode" 1>&2
776 exit 1
777 ;;
778 esac
779
780 exit 0
781
782 # Local Variables:
783 # mode: shell-script
784 # sh-indentation: 2
785 # eval: (add-hook 'write-file-hooks 'time-stamp)
786 # time-stamp-start: "scriptversion="
787 # time-stamp-format: "%:y-%02m-%02d.%02H"
788 # time-stamp-time-zone: "UTC"
789 # time-stamp-end: "; # UTC"
790 # End:
2020
2121 --------------------------------------------------------------------------- */
2222 #ifdef _MSC_VER
23 #define snprintf _snprintf
24 #define _CRT_SECURE_NO_WARNINGS
23 #define _CRT_SECURE_NO_WARNINGS
24 #if (_MSC_VER < 1900)
25 #define snprintf _snprintf
26 #endif
2527 #endif
2628
2729 #include <stdio.h>
5151
5252 #define DISCID_VERSION_MAJOR 0
5353 #define DISCID_VERSION_MINOR 6
54 #define DISCID_VERSION_PATCH 1
55 #define DISCID_VERSION_NUM 601
54 #define DISCID_VERSION_PATCH 2
55 #define DISCID_VERSION_NUM 602
5656
5757 #ifdef __cplusplus
5858 extern "C" {
+0
-527
install-sh less more
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2011-11-20.07; # UTC
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # 'make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
157 -t) dst_arg=$2
158 # Protect names problematic for 'test' and other utilities.
159 case $dst_arg in
160 -* | [=\(\)!]) dst_arg=./$dst_arg;;
161 esac
162 shift;;
163
164 -T) no_target_directory=true;;
165
166 --version) echo "$0 $scriptversion"; exit $?;;
167
168 --) shift
169 break;;
170
171 -*) echo "$0: invalid option: $1" >&2
172 exit 1;;
173
174 *) break;;
175 esac
176 shift
177 done
178
179 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
180 # When -d is used, all remaining arguments are directories to create.
181 # When -t is used, the destination is already specified.
182 # Otherwise, the last argument is the destination. Remove it from $@.
183 for arg
184 do
185 if test -n "$dst_arg"; then
186 # $@ is not empty: it contains at least $arg.
187 set fnord "$@" "$dst_arg"
188 shift # fnord
189 fi
190 shift # arg
191 dst_arg=$arg
192 # Protect names problematic for 'test' and other utilities.
193 case $dst_arg in
194 -* | [=\(\)!]) dst_arg=./$dst_arg;;
195 esac
196 done
197 fi
198
199 if test $# -eq 0; then
200 if test -z "$dir_arg"; then
201 echo "$0: no input file specified." >&2
202 exit 1
203 fi
204 # It's OK to call 'install-sh -d' without argument.
205 # This can happen when creating conditional directories.
206 exit 0
207 fi
208
209 if test -z "$dir_arg"; then
210 do_exit='(exit $ret); exit $ret'
211 trap "ret=129; $do_exit" 1
212 trap "ret=130; $do_exit" 2
213 trap "ret=141; $do_exit" 13
214 trap "ret=143; $do_exit" 15
215
216 # Set umask so as not to create temps with too-generous modes.
217 # However, 'strip' requires both read and write access to temps.
218 case $mode in
219 # Optimize common cases.
220 *644) cp_umask=133;;
221 *755) cp_umask=22;;
222
223 *[0-7])
224 if test -z "$stripcmd"; then
225 u_plus_rw=
226 else
227 u_plus_rw='% 200'
228 fi
229 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
230 *)
231 if test -z "$stripcmd"; then
232 u_plus_rw=
233 else
234 u_plus_rw=,u+rw
235 fi
236 cp_umask=$mode$u_plus_rw;;
237 esac
238 fi
239
240 for src
241 do
242 # Protect names problematic for 'test' and other utilities.
243 case $src in
244 -* | [=\(\)!]) src=./$src;;
245 esac
246
247 if test -n "$dir_arg"; then
248 dst=$src
249 dstdir=$dst
250 test -d "$dstdir"
251 dstdir_status=$?
252 else
253
254 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
255 # might cause directories to be created, which would be especially bad
256 # if $src (and thus $dsttmp) contains '*'.
257 if test ! -f "$src" && test ! -d "$src"; then
258 echo "$0: $src does not exist." >&2
259 exit 1
260 fi
261
262 if test -z "$dst_arg"; then
263 echo "$0: no destination specified." >&2
264 exit 1
265 fi
266 dst=$dst_arg
267
268 # If destination is a directory, append the input filename; won't work
269 # if double slashes aren't ignored.
270 if test -d "$dst"; then
271 if test -n "$no_target_directory"; then
272 echo "$0: $dst_arg: Is a directory" >&2
273 exit 1
274 fi
275 dstdir=$dst
276 dst=$dstdir/`basename "$src"`
277 dstdir_status=0
278 else
279 # Prefer dirname, but fall back on a substitute if dirname fails.
280 dstdir=`
281 (dirname "$dst") 2>/dev/null ||
282 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
283 X"$dst" : 'X\(//\)[^/]' \| \
284 X"$dst" : 'X\(//\)$' \| \
285 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
286 echo X"$dst" |
287 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
288 s//\1/
289 q
290 }
291 /^X\(\/\/\)[^/].*/{
292 s//\1/
293 q
294 }
295 /^X\(\/\/\)$/{
296 s//\1/
297 q
298 }
299 /^X\(\/\).*/{
300 s//\1/
301 q
302 }
303 s/.*/./; q'
304 `
305
306 test -d "$dstdir"
307 dstdir_status=$?
308 fi
309 fi
310
311 obsolete_mkdir_used=false
312
313 if test $dstdir_status != 0; then
314 case $posix_mkdir in
315 '')
316 # Create intermediate dirs using mode 755 as modified by the umask.
317 # This is like FreeBSD 'install' as of 1997-10-28.
318 umask=`umask`
319 case $stripcmd.$umask in
320 # Optimize common cases.
321 *[2367][2367]) mkdir_umask=$umask;;
322 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
323
324 *[0-7])
325 mkdir_umask=`expr $umask + 22 \
326 - $umask % 100 % 40 + $umask % 20 \
327 - $umask % 10 % 4 + $umask % 2
328 `;;
329 *) mkdir_umask=$umask,go-w;;
330 esac
331
332 # With -d, create the new directory with the user-specified mode.
333 # Otherwise, rely on $mkdir_umask.
334 if test -n "$dir_arg"; then
335 mkdir_mode=-m$mode
336 else
337 mkdir_mode=
338 fi
339
340 posix_mkdir=false
341 case $umask in
342 *[123567][0-7][0-7])
343 # POSIX mkdir -p sets u+wx bits regardless of umask, which
344 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
345 ;;
346 *)
347 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
348 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
349
350 if (umask $mkdir_umask &&
351 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
352 then
353 if test -z "$dir_arg" || {
354 # Check for POSIX incompatibilities with -m.
355 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
356 # other-writable bit of parent directory when it shouldn't.
357 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
358 ls_ld_tmpdir=`ls -ld "$tmpdir"`
359 case $ls_ld_tmpdir in
360 d????-?r-*) different_mode=700;;
361 d????-?--*) different_mode=755;;
362 *) false;;
363 esac &&
364 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
365 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
366 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
367 }
368 }
369 then posix_mkdir=:
370 fi
371 rmdir "$tmpdir/d" "$tmpdir"
372 else
373 # Remove any dirs left behind by ancient mkdir implementations.
374 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
375 fi
376 trap '' 0;;
377 esac;;
378 esac
379
380 if
381 $posix_mkdir && (
382 umask $mkdir_umask &&
383 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
384 )
385 then :
386 else
387
388 # The umask is ridiculous, or mkdir does not conform to POSIX,
389 # or it failed possibly due to a race condition. Create the
390 # directory the slow way, step by step, checking for races as we go.
391
392 case $dstdir in
393 /*) prefix='/';;
394 [-=\(\)!]*) prefix='./';;
395 *) prefix='';;
396 esac
397
398 eval "$initialize_posix_glob"
399
400 oIFS=$IFS
401 IFS=/
402 $posix_glob set -f
403 set fnord $dstdir
404 shift
405 $posix_glob set +f
406 IFS=$oIFS
407
408 prefixes=
409
410 for d
411 do
412 test X"$d" = X && continue
413
414 prefix=$prefix$d
415 if test -d "$prefix"; then
416 prefixes=
417 else
418 if $posix_mkdir; then
419 (umask=$mkdir_umask &&
420 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
421 # Don't fail if two instances are running concurrently.
422 test -d "$prefix" || exit 1
423 else
424 case $prefix in
425 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
426 *) qprefix=$prefix;;
427 esac
428 prefixes="$prefixes '$qprefix'"
429 fi
430 fi
431 prefix=$prefix/
432 done
433
434 if test -n "$prefixes"; then
435 # Don't fail if two instances are running concurrently.
436 (umask $mkdir_umask &&
437 eval "\$doit_exec \$mkdirprog $prefixes") ||
438 test -d "$dstdir" || exit 1
439 obsolete_mkdir_used=true
440 fi
441 fi
442 fi
443
444 if test -n "$dir_arg"; then
445 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
446 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
447 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
448 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
449 else
450
451 # Make a couple of temp file names in the proper directory.
452 dsttmp=$dstdir/_inst.$$_
453 rmtmp=$dstdir/_rm.$$_
454
455 # Trap to clean up those temp files at exit.
456 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
457
458 # Copy the file name to the temp name.
459 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
460
461 # and set any options; do chmod last to preserve setuid bits.
462 #
463 # If any of these fail, we abort the whole thing. If we want to
464 # ignore errors from any of these, just make sure not to ignore
465 # errors from the above "$doit $cpprog $src $dsttmp" command.
466 #
467 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
468 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
469 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
470 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
471
472 # If -C, don't bother to copy if it wouldn't change the file.
473 if $copy_on_change &&
474 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
475 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
476
477 eval "$initialize_posix_glob" &&
478 $posix_glob set -f &&
479 set X $old && old=:$2:$4:$5:$6 &&
480 set X $new && new=:$2:$4:$5:$6 &&
481 $posix_glob set +f &&
482
483 test "$old" = "$new" &&
484 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
485 then
486 rm -f "$dsttmp"
487 else
488 # Rename the file to the real destination.
489 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
490
491 # The rename failed, perhaps because mv can't rename something else
492 # to itself, or perhaps because mv is so ancient that it does not
493 # support -f.
494 {
495 # Now remove or move aside any old file at destination location.
496 # We try this two ways since rm can't unlink itself on some
497 # systems and the destination file might be busy for other
498 # reasons. In this case, the final cleanup might fail but the new
499 # file should still install successfully.
500 {
501 test ! -f "$dst" ||
502 $doit $rmcmd -f "$dst" 2>/dev/null ||
503 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
504 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
505 } ||
506 { echo "$0: cannot unlink or rename $dst" >&2
507 (exit 1); exit 1
508 }
509 } &&
510
511 # Now rename the file to the real destination.
512 $doit $mvcmd "$dsttmp" "$dst"
513 }
514 fi || exit 1
515
516 trap '' 0
517 fi
518 done
519
520 # Local variables:
521 # eval: (add-hook 'write-file-hooks 'time-stamp)
522 # time-stamp-start: "scriptversion="
523 # time-stamp-format: "%:y-%02m-%02d.%02H"
524 # time-stamp-time-zone: "UTC"
525 # time-stamp-end: "; # UTC"
526 # End:
+0
-9655
ltmain.sh less more
0
1 # libtool (GNU libtool) 2.4.2
2 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5 # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
6 # This is free software; see the source for copying conditions. There is NO
7 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8
9 # GNU Libtool is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # As a special exception to the GNU General Public License,
15 # if you distribute this file as part of a program or library that
16 # is built using GNU Libtool, you may include this file under the
17 # same distribution terms that you use for the rest of that program.
18 #
19 # GNU Libtool is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Libtool; see the file COPYING. If not, a copy
26 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
27 # or obtained by writing to the Free Software Foundation, Inc.,
28 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
30 # Usage: $progname [OPTION]... [MODE-ARG]...
31 #
32 # Provide generalized library-building support services.
33 #
34 # --config show all configuration variables
35 # --debug enable verbose shell tracing
36 # -n, --dry-run display commands without modifying any files
37 # --features display basic configuration information and exit
38 # --mode=MODE use operation mode MODE
39 # --preserve-dup-deps don't remove duplicate dependency libraries
40 # --quiet, --silent don't print informational messages
41 # --no-quiet, --no-silent
42 # print informational messages (default)
43 # --no-warn don't display warning messages
44 # --tag=TAG use configuration variables from tag TAG
45 # -v, --verbose print more informational messages than default
46 # --no-verbose don't print the extra informational messages
47 # --version print version information
48 # -h, --help, --help-all print short, long, or detailed help message
49 #
50 # MODE must be one of the following:
51 #
52 # clean remove files from the build directory
53 # compile compile a source file into a libtool object
54 # execute automatically set library path, then run a program
55 # finish complete the installation of libtool libraries
56 # install install libraries or executables
57 # link create a library or an executable
58 # uninstall remove libraries from an installed directory
59 #
60 # MODE-ARGS vary depending on the MODE. When passed as first option,
61 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
62 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
63 #
64 # When reporting a bug, please describe a test case to reproduce it and
65 # include the following information:
66 #
67 # host-triplet: $host
68 # shell: $SHELL
69 # compiler: $LTCC
70 # compiler flags: $LTCFLAGS
71 # linker: $LD (gnu? $with_gnu_ld)
72 # $progname: (GNU libtool) 2.4.2
73 # automake: $automake_version
74 # autoconf: $autoconf_version
75 #
76 # Report bugs to <bug-libtool@gnu.org>.
77 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
78 # General help using GNU software: <http://www.gnu.org/gethelp/>.
79
80 PROGRAM=libtool
81 PACKAGE=libtool
82 VERSION=2.4.2
83 TIMESTAMP=""
84 package_revision=1.3337
85
86 # Be Bourne compatible
87 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
88 emulate sh
89 NULLCMD=:
90 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
91 # is contrary to our usage. Disable this feature.
92 alias -g '${1+"$@"}'='"$@"'
93 setopt NO_GLOB_SUBST
94 else
95 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
96 fi
97 BIN_SH=xpg4; export BIN_SH # for Tru64
98 DUALCASE=1; export DUALCASE # for MKS sh
99
100 # A function that is used when there is no print builtin or printf.
101 func_fallback_echo ()
102 {
103 eval 'cat <<_LTECHO_EOF
104 $1
105 _LTECHO_EOF'
106 }
107
108 # NLS nuisances: We save the old values to restore during execute mode.
109 lt_user_locale=
110 lt_safe_locale=
111 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
112 do
113 eval "if test \"\${$lt_var+set}\" = set; then
114 save_$lt_var=\$$lt_var
115 $lt_var=C
116 export $lt_var
117 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
118 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
119 fi"
120 done
121 LC_ALL=C
122 LANGUAGE=C
123 export LANGUAGE LC_ALL
124
125 $lt_unset CDPATH
126
127
128 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
129 # is ksh but when the shell is invoked as "sh" and the current value of
130 # the _XPG environment variable is not equal to 1 (one), the special
131 # positional parameter $0, within a function call, is the name of the
132 # function.
133 progpath="$0"
134
135
136
137 : ${CP="cp -f"}
138 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
139 : ${MAKE="make"}
140 : ${MKDIR="mkdir"}
141 : ${MV="mv -f"}
142 : ${RM="rm -f"}
143 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
144 : ${Xsed="$SED -e 1s/^X//"}
145
146 # Global variables:
147 EXIT_SUCCESS=0
148 EXIT_FAILURE=1
149 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
150 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
151
152 exit_status=$EXIT_SUCCESS
153
154 # Make sure IFS has a sensible default
155 lt_nl='
156 '
157 IFS=" $lt_nl"
158
159 dirname="s,/[^/]*$,,"
160 basename="s,^.*/,,"
161
162 # func_dirname file append nondir_replacement
163 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
164 # otherwise set result to NONDIR_REPLACEMENT.
165 func_dirname ()
166 {
167 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
168 if test "X$func_dirname_result" = "X${1}"; then
169 func_dirname_result="${3}"
170 else
171 func_dirname_result="$func_dirname_result${2}"
172 fi
173 } # func_dirname may be replaced by extended shell implementation
174
175
176 # func_basename file
177 func_basename ()
178 {
179 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
180 } # func_basename may be replaced by extended shell implementation
181
182
183 # func_dirname_and_basename file append nondir_replacement
184 # perform func_basename and func_dirname in a single function
185 # call:
186 # dirname: Compute the dirname of FILE. If nonempty,
187 # add APPEND to the result, otherwise set result
188 # to NONDIR_REPLACEMENT.
189 # value returned in "$func_dirname_result"
190 # basename: Compute filename of FILE.
191 # value retuned in "$func_basename_result"
192 # Implementation must be kept synchronized with func_dirname
193 # and func_basename. For efficiency, we do not delegate to
194 # those functions but instead duplicate the functionality here.
195 func_dirname_and_basename ()
196 {
197 # Extract subdirectory from the argument.
198 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
199 if test "X$func_dirname_result" = "X${1}"; then
200 func_dirname_result="${3}"
201 else
202 func_dirname_result="$func_dirname_result${2}"
203 fi
204 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
205 } # func_dirname_and_basename may be replaced by extended shell implementation
206
207
208 # func_stripname prefix suffix name
209 # strip PREFIX and SUFFIX off of NAME.
210 # PREFIX and SUFFIX must not contain globbing or regex special
211 # characters, hashes, percent signs, but SUFFIX may contain a leading
212 # dot (in which case that matches only a dot).
213 # func_strip_suffix prefix name
214 func_stripname ()
215 {
216 case ${2} in
217 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
218 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
219 esac
220 } # func_stripname may be replaced by extended shell implementation
221
222
223 # These SED scripts presuppose an absolute path with a trailing slash.
224 pathcar='s,^/\([^/]*\).*$,\1,'
225 pathcdr='s,^/[^/]*,,'
226 removedotparts=':dotsl
227 s@/\./@/@g
228 t dotsl
229 s,/\.$,/,'
230 collapseslashes='s@/\{1,\}@/@g'
231 finalslash='s,/*$,/,'
232
233 # func_normal_abspath PATH
234 # Remove doubled-up and trailing slashes, "." path components,
235 # and cancel out any ".." path components in PATH after making
236 # it an absolute path.
237 # value returned in "$func_normal_abspath_result"
238 func_normal_abspath ()
239 {
240 # Start from root dir and reassemble the path.
241 func_normal_abspath_result=
242 func_normal_abspath_tpath=$1
243 func_normal_abspath_altnamespace=
244 case $func_normal_abspath_tpath in
245 "")
246 # Empty path, that just means $cwd.
247 func_stripname '' '/' "`pwd`"
248 func_normal_abspath_result=$func_stripname_result
249 return
250 ;;
251 # The next three entries are used to spot a run of precisely
252 # two leading slashes without using negated character classes;
253 # we take advantage of case's first-match behaviour.
254 ///*)
255 # Unusual form of absolute path, do nothing.
256 ;;
257 //*)
258 # Not necessarily an ordinary path; POSIX reserves leading '//'
259 # and for example Cygwin uses it to access remote file shares
260 # over CIFS/SMB, so we conserve a leading double slash if found.
261 func_normal_abspath_altnamespace=/
262 ;;
263 /*)
264 # Absolute path, do nothing.
265 ;;
266 *)
267 # Relative path, prepend $cwd.
268 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
269 ;;
270 esac
271 # Cancel out all the simple stuff to save iterations. We also want
272 # the path to end with a slash for ease of parsing, so make sure
273 # there is one (and only one) here.
274 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
275 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
276 while :; do
277 # Processed it all yet?
278 if test "$func_normal_abspath_tpath" = / ; then
279 # If we ascended to the root using ".." the result may be empty now.
280 if test -z "$func_normal_abspath_result" ; then
281 func_normal_abspath_result=/
282 fi
283 break
284 fi
285 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
286 -e "$pathcar"`
287 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
288 -e "$pathcdr"`
289 # Figure out what to do with it
290 case $func_normal_abspath_tcomponent in
291 "")
292 # Trailing empty path component, ignore it.
293 ;;
294 ..)
295 # Parent dir; strip last assembled component from result.
296 func_dirname "$func_normal_abspath_result"
297 func_normal_abspath_result=$func_dirname_result
298 ;;
299 *)
300 # Actual path component, append it.
301 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
302 ;;
303 esac
304 done
305 # Restore leading double-slash if one was found on entry.
306 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
307 }
308
309 # func_relative_path SRCDIR DSTDIR
310 # generates a relative path from SRCDIR to DSTDIR, with a trailing
311 # slash if non-empty, suitable for immediately appending a filename
312 # without needing to append a separator.
313 # value returned in "$func_relative_path_result"
314 func_relative_path ()
315 {
316 func_relative_path_result=
317 func_normal_abspath "$1"
318 func_relative_path_tlibdir=$func_normal_abspath_result
319 func_normal_abspath "$2"
320 func_relative_path_tbindir=$func_normal_abspath_result
321
322 # Ascend the tree starting from libdir
323 while :; do
324 # check if we have found a prefix of bindir
325 case $func_relative_path_tbindir in
326 $func_relative_path_tlibdir)
327 # found an exact match
328 func_relative_path_tcancelled=
329 break
330 ;;
331 $func_relative_path_tlibdir*)
332 # found a matching prefix
333 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
334 func_relative_path_tcancelled=$func_stripname_result
335 if test -z "$func_relative_path_result"; then
336 func_relative_path_result=.
337 fi
338 break
339 ;;
340 *)
341 func_dirname $func_relative_path_tlibdir
342 func_relative_path_tlibdir=${func_dirname_result}
343 if test "x$func_relative_path_tlibdir" = x ; then
344 # Have to descend all the way to the root!
345 func_relative_path_result=../$func_relative_path_result
346 func_relative_path_tcancelled=$func_relative_path_tbindir
347 break
348 fi
349 func_relative_path_result=../$func_relative_path_result
350 ;;
351 esac
352 done
353
354 # Now calculate path; take care to avoid doubling-up slashes.
355 func_stripname '' '/' "$func_relative_path_result"
356 func_relative_path_result=$func_stripname_result
357 func_stripname '/' '/' "$func_relative_path_tcancelled"
358 if test "x$func_stripname_result" != x ; then
359 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
360 fi
361
362 # Normalisation. If bindir is libdir, return empty string,
363 # else relative path ending with a slash; either way, target
364 # file name can be directly appended.
365 if test ! -z "$func_relative_path_result"; then
366 func_stripname './' '' "$func_relative_path_result/"
367 func_relative_path_result=$func_stripname_result
368 fi
369 }
370
371 # The name of this program:
372 func_dirname_and_basename "$progpath"
373 progname=$func_basename_result
374
375 # Make sure we have an absolute path for reexecution:
376 case $progpath in
377 [\\/]*|[A-Za-z]:\\*) ;;
378 *[\\/]*)
379 progdir=$func_dirname_result
380 progdir=`cd "$progdir" && pwd`
381 progpath="$progdir/$progname"
382 ;;
383 *)
384 save_IFS="$IFS"
385 IFS=${PATH_SEPARATOR-:}
386 for progdir in $PATH; do
387 IFS="$save_IFS"
388 test -x "$progdir/$progname" && break
389 done
390 IFS="$save_IFS"
391 test -n "$progdir" || progdir=`pwd`
392 progpath="$progdir/$progname"
393 ;;
394 esac
395
396 # Sed substitution that helps us do robust quoting. It backslashifies
397 # metacharacters that are still active within double-quoted strings.
398 Xsed="${SED}"' -e 1s/^X//'
399 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
400
401 # Same as above, but do not quote variable references.
402 double_quote_subst='s/\(["`\\]\)/\\\1/g'
403
404 # Sed substitution that turns a string into a regex matching for the
405 # string literally.
406 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
407
408 # Sed substitution that converts a w32 file name or path
409 # which contains forward slashes, into one that contains
410 # (escaped) backslashes. A very naive implementation.
411 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
412
413 # Re-`\' parameter expansions in output of double_quote_subst that were
414 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
415 # in input to double_quote_subst, that '$' was protected from expansion.
416 # Since each input `\' is now two `\'s, look for any number of runs of
417 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
418 bs='\\'
419 bs2='\\\\'
420 bs4='\\\\\\\\'
421 dollar='\$'
422 sed_double_backslash="\
423 s/$bs4/&\\
424 /g
425 s/^$bs2$dollar/$bs&/
426 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
427 s/\n//g"
428
429 # Standard options:
430 opt_dry_run=false
431 opt_help=false
432 opt_quiet=false
433 opt_verbose=false
434 opt_warning=:
435
436 # func_echo arg...
437 # Echo program name prefixed message, along with the current mode
438 # name if it has been set yet.
439 func_echo ()
440 {
441 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
442 }
443
444 # func_verbose arg...
445 # Echo program name prefixed message in verbose mode only.
446 func_verbose ()
447 {
448 $opt_verbose && func_echo ${1+"$@"}
449
450 # A bug in bash halts the script if the last line of a function
451 # fails when set -e is in force, so we need another command to
452 # work around that:
453 :
454 }
455
456 # func_echo_all arg...
457 # Invoke $ECHO with all args, space-separated.
458 func_echo_all ()
459 {
460 $ECHO "$*"
461 }
462
463 # func_error arg...
464 # Echo program name prefixed message to standard error.
465 func_error ()
466 {
467 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
468 }
469
470 # func_warning arg...
471 # Echo program name prefixed warning message to standard error.
472 func_warning ()
473 {
474 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
475
476 # bash bug again:
477 :
478 }
479
480 # func_fatal_error arg...
481 # Echo program name prefixed message to standard error, and exit.
482 func_fatal_error ()
483 {
484 func_error ${1+"$@"}
485 exit $EXIT_FAILURE
486 }
487
488 # func_fatal_help arg...
489 # Echo program name prefixed message to standard error, followed by
490 # a help hint, and exit.
491 func_fatal_help ()
492 {
493 func_error ${1+"$@"}
494 func_fatal_error "$help"
495 }
496 help="Try \`$progname --help' for more information." ## default
497
498
499 # func_grep expression filename
500 # Check whether EXPRESSION matches any line of FILENAME, without output.
501 func_grep ()
502 {
503 $GREP "$1" "$2" >/dev/null 2>&1
504 }
505
506
507 # func_mkdir_p directory-path
508 # Make sure the entire path to DIRECTORY-PATH is available.
509 func_mkdir_p ()
510 {
511 my_directory_path="$1"
512 my_dir_list=
513
514 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
515
516 # Protect directory names starting with `-'
517 case $my_directory_path in
518 -*) my_directory_path="./$my_directory_path" ;;
519 esac
520
521 # While some portion of DIR does not yet exist...
522 while test ! -d "$my_directory_path"; do
523 # ...make a list in topmost first order. Use a colon delimited
524 # list incase some portion of path contains whitespace.
525 my_dir_list="$my_directory_path:$my_dir_list"
526
527 # If the last portion added has no slash in it, the list is done
528 case $my_directory_path in */*) ;; *) break ;; esac
529
530 # ...otherwise throw away the child directory and loop
531 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
532 done
533 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
534
535 save_mkdir_p_IFS="$IFS"; IFS=':'
536 for my_dir in $my_dir_list; do
537 IFS="$save_mkdir_p_IFS"
538 # mkdir can fail with a `File exist' error if two processes
539 # try to create one of the directories concurrently. Don't
540 # stop in that case!
541 $MKDIR "$my_dir" 2>/dev/null || :
542 done
543 IFS="$save_mkdir_p_IFS"
544
545 # Bail out if we (or some other process) failed to create a directory.
546 test -d "$my_directory_path" || \
547 func_fatal_error "Failed to create \`$1'"
548 fi
549 }
550
551
552 # func_mktempdir [string]
553 # Make a temporary directory that won't clash with other running
554 # libtool processes, and avoids race conditions if possible. If
555 # given, STRING is the basename for that directory.
556 func_mktempdir ()
557 {
558 my_template="${TMPDIR-/tmp}/${1-$progname}"
559
560 if test "$opt_dry_run" = ":"; then
561 # Return a directory name, but don't create it in dry-run mode
562 my_tmpdir="${my_template}-$$"
563 else
564
565 # If mktemp works, use that first and foremost
566 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
567
568 if test ! -d "$my_tmpdir"; then
569 # Failing that, at least try and use $RANDOM to avoid a race
570 my_tmpdir="${my_template}-${RANDOM-0}$$"
571
572 save_mktempdir_umask=`umask`
573 umask 0077
574 $MKDIR "$my_tmpdir"
575 umask $save_mktempdir_umask
576 fi
577
578 # If we're not in dry-run mode, bomb out on failure
579 test -d "$my_tmpdir" || \
580 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
581 fi
582
583 $ECHO "$my_tmpdir"
584 }
585
586
587 # func_quote_for_eval arg
588 # Aesthetically quote ARG to be evaled later.
589 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
590 # is double-quoted, suitable for a subsequent eval, whereas
591 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
592 # which are still active within double quotes backslashified.
593 func_quote_for_eval ()
594 {
595 case $1 in
596 *[\\\`\"\$]*)
597 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
598 *)
599 func_quote_for_eval_unquoted_result="$1" ;;
600 esac
601
602 case $func_quote_for_eval_unquoted_result in
603 # Double-quote args containing shell metacharacters to delay
604 # word splitting, command substitution and and variable
605 # expansion for a subsequent eval.
606 # Many Bourne shells cannot handle close brackets correctly
607 # in scan sets, so we specify it separately.
608 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
609 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
610 ;;
611 *)
612 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
613 esac
614 }
615
616
617 # func_quote_for_expand arg
618 # Aesthetically quote ARG to be evaled later; same as above,
619 # but do not quote variable references.
620 func_quote_for_expand ()
621 {
622 case $1 in
623 *[\\\`\"]*)
624 my_arg=`$ECHO "$1" | $SED \
625 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
626 *)
627 my_arg="$1" ;;
628 esac
629
630 case $my_arg in
631 # Double-quote args containing shell metacharacters to delay
632 # word splitting and command substitution for a subsequent eval.
633 # Many Bourne shells cannot handle close brackets correctly
634 # in scan sets, so we specify it separately.
635 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
636 my_arg="\"$my_arg\""
637 ;;
638 esac
639
640 func_quote_for_expand_result="$my_arg"
641 }
642
643
644 # func_show_eval cmd [fail_exp]
645 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
646 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
647 # is given, then evaluate it.
648 func_show_eval ()
649 {
650 my_cmd="$1"
651 my_fail_exp="${2-:}"
652
653 ${opt_silent-false} || {
654 func_quote_for_expand "$my_cmd"
655 eval "func_echo $func_quote_for_expand_result"
656 }
657
658 if ${opt_dry_run-false}; then :; else
659 eval "$my_cmd"
660 my_status=$?
661 if test "$my_status" -eq 0; then :; else
662 eval "(exit $my_status); $my_fail_exp"
663 fi
664 fi
665 }
666
667
668 # func_show_eval_locale cmd [fail_exp]
669 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
670 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
671 # is given, then evaluate it. Use the saved locale for evaluation.
672 func_show_eval_locale ()
673 {
674 my_cmd="$1"
675 my_fail_exp="${2-:}"
676
677 ${opt_silent-false} || {
678 func_quote_for_expand "$my_cmd"
679 eval "func_echo $func_quote_for_expand_result"
680 }
681
682 if ${opt_dry_run-false}; then :; else
683 eval "$lt_user_locale
684 $my_cmd"
685 my_status=$?
686 eval "$lt_safe_locale"
687 if test "$my_status" -eq 0; then :; else
688 eval "(exit $my_status); $my_fail_exp"
689 fi
690 fi
691 }
692
693 # func_tr_sh
694 # Turn $1 into a string suitable for a shell variable name.
695 # Result is stored in $func_tr_sh_result. All characters
696 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
697 # if $1 begins with a digit, a '_' is prepended as well.
698 func_tr_sh ()
699 {
700 case $1 in
701 [0-9]* | *[!a-zA-Z0-9_]*)
702 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
703 ;;
704 * )
705 func_tr_sh_result=$1
706 ;;
707 esac
708 }
709
710
711 # func_version
712 # Echo version message to standard output and exit.
713 func_version ()
714 {
715 $opt_debug
716
717 $SED -n '/(C)/!b go
718 :more
719 /\./!{
720 N
721 s/\n# / /
722 b more
723 }
724 :go
725 /^# '$PROGRAM' (GNU /,/# warranty; / {
726 s/^# //
727 s/^# *$//
728 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
729 p
730 }' < "$progpath"
731 exit $?
732 }
733
734 # func_usage
735 # Echo short help message to standard output and exit.
736 func_usage ()
737 {
738 $opt_debug
739
740 $SED -n '/^# Usage:/,/^# *.*--help/ {
741 s/^# //
742 s/^# *$//
743 s/\$progname/'$progname'/
744 p
745 }' < "$progpath"
746 echo
747 $ECHO "run \`$progname --help | more' for full usage"
748 exit $?
749 }
750
751 # func_help [NOEXIT]
752 # Echo long help message to standard output and exit,
753 # unless 'noexit' is passed as argument.
754 func_help ()
755 {
756 $opt_debug
757
758 $SED -n '/^# Usage:/,/# Report bugs to/ {
759 :print
760 s/^# //
761 s/^# *$//
762 s*\$progname*'$progname'*
763 s*\$host*'"$host"'*
764 s*\$SHELL*'"$SHELL"'*
765 s*\$LTCC*'"$LTCC"'*
766 s*\$LTCFLAGS*'"$LTCFLAGS"'*
767 s*\$LD*'"$LD"'*
768 s/\$with_gnu_ld/'"$with_gnu_ld"'/
769 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
770 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
771 p
772 d
773 }
774 /^# .* home page:/b print
775 /^# General help using/b print
776 ' < "$progpath"
777 ret=$?
778 if test -z "$1"; then
779 exit $ret
780 fi
781 }
782
783 # func_missing_arg argname
784 # Echo program name prefixed message to standard error and set global
785 # exit_cmd.
786 func_missing_arg ()
787 {
788 $opt_debug
789
790 func_error "missing argument for $1."
791 exit_cmd=exit
792 }
793
794
795 # func_split_short_opt shortopt
796 # Set func_split_short_opt_name and func_split_short_opt_arg shell
797 # variables after splitting SHORTOPT after the 2nd character.
798 func_split_short_opt ()
799 {
800 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
801 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
802
803 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
804 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
805 } # func_split_short_opt may be replaced by extended shell implementation
806
807
808 # func_split_long_opt longopt
809 # Set func_split_long_opt_name and func_split_long_opt_arg shell
810 # variables after splitting LONGOPT at the `=' sign.
811 func_split_long_opt ()
812 {
813 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
814 my_sed_long_arg='1s/^--[^=]*=//'
815
816 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
817 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
818 } # func_split_long_opt may be replaced by extended shell implementation
819
820 exit_cmd=:
821
822
823
824
825
826 magic="%%%MAGIC variable%%%"
827 magic_exe="%%%MAGIC EXE variable%%%"
828
829 # Global variables.
830 nonopt=
831 preserve_args=
832 lo2o="s/\\.lo\$/.${objext}/"
833 o2lo="s/\\.${objext}\$/.lo/"
834 extracted_archives=
835 extracted_serial=0
836
837 # If this variable is set in any of the actions, the command in it
838 # will be execed at the end. This prevents here-documents from being
839 # left over by shells.
840 exec_cmd=
841
842 # func_append var value
843 # Append VALUE to the end of shell variable VAR.
844 func_append ()
845 {
846 eval "${1}=\$${1}\${2}"
847 } # func_append may be replaced by extended shell implementation
848
849 # func_append_quoted var value
850 # Quote VALUE and append to the end of shell variable VAR, separated
851 # by a space.
852 func_append_quoted ()
853 {
854 func_quote_for_eval "${2}"
855 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
856 } # func_append_quoted may be replaced by extended shell implementation
857
858
859 # func_arith arithmetic-term...
860 func_arith ()
861 {
862 func_arith_result=`expr "${@}"`
863 } # func_arith may be replaced by extended shell implementation
864
865
866 # func_len string
867 # STRING may not start with a hyphen.
868 func_len ()
869 {
870 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
871 } # func_len may be replaced by extended shell implementation
872
873
874 # func_lo2o object
875 func_lo2o ()
876 {
877 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
878 } # func_lo2o may be replaced by extended shell implementation
879
880
881 # func_xform libobj-or-source
882 func_xform ()
883 {
884 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
885 } # func_xform may be replaced by extended shell implementation
886
887
888 # func_fatal_configuration arg...
889 # Echo program name prefixed message to standard error, followed by
890 # a configuration failure hint, and exit.
891 func_fatal_configuration ()
892 {
893 func_error ${1+"$@"}
894 func_error "See the $PACKAGE documentation for more information."
895 func_fatal_error "Fatal configuration error."
896 }
897
898
899 # func_config
900 # Display the configuration for all the tags in this script.
901 func_config ()
902 {
903 re_begincf='^# ### BEGIN LIBTOOL'
904 re_endcf='^# ### END LIBTOOL'
905
906 # Default configuration.
907 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
908
909 # Now print the configurations for the tags.
910 for tagname in $taglist; do
911 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
912 done
913
914 exit $?
915 }
916
917 # func_features
918 # Display the features supported by this script.
919 func_features ()
920 {
921 echo "host: $host"
922 if test "$build_libtool_libs" = yes; then
923 echo "enable shared libraries"
924 else
925 echo "disable shared libraries"
926 fi
927 if test "$build_old_libs" = yes; then
928 echo "enable static libraries"
929 else
930 echo "disable static libraries"
931 fi
932
933 exit $?
934 }
935
936 # func_enable_tag tagname
937 # Verify that TAGNAME is valid, and either flag an error and exit, or
938 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
939 # variable here.
940 func_enable_tag ()
941 {
942 # Global variable:
943 tagname="$1"
944
945 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
946 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
947 sed_extractcf="/$re_begincf/,/$re_endcf/p"
948
949 # Validate tagname.
950 case $tagname in
951 *[!-_A-Za-z0-9,/]*)
952 func_fatal_error "invalid tag name: $tagname"
953 ;;
954 esac
955
956 # Don't test for the "default" C tag, as we know it's
957 # there but not specially marked.
958 case $tagname in
959 CC) ;;
960 *)
961 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
962 taglist="$taglist $tagname"
963
964 # Evaluate the configuration. Be careful to quote the path
965 # and the sed script, to avoid splitting on whitespace, but
966 # also don't use non-portable quotes within backquotes within
967 # quotes we have to do it in 2 steps:
968 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
969 eval "$extractedcf"
970 else
971 func_error "ignoring unknown tag $tagname"
972 fi
973 ;;
974 esac
975 }
976
977 # func_check_version_match
978 # Ensure that we are using m4 macros, and libtool script from the same
979 # release of libtool.
980 func_check_version_match ()
981 {
982 if test "$package_revision" != "$macro_revision"; then
983 if test "$VERSION" != "$macro_version"; then
984 if test -z "$macro_version"; then
985 cat >&2 <<_LT_EOF
986 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
987 $progname: definition of this LT_INIT comes from an older release.
988 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
989 $progname: and run autoconf again.
990 _LT_EOF
991 else
992 cat >&2 <<_LT_EOF
993 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
994 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
995 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
996 $progname: and run autoconf again.
997 _LT_EOF
998 fi
999 else
1000 cat >&2 <<_LT_EOF
1001 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1002 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1003 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1004 $progname: of $PACKAGE $VERSION and run autoconf again.
1005 _LT_EOF
1006 fi
1007
1008 exit $EXIT_MISMATCH
1009 fi
1010 }
1011
1012
1013 # Shorthand for --mode=foo, only valid as the first argument
1014 case $1 in
1015 clean|clea|cle|cl)
1016 shift; set dummy --mode clean ${1+"$@"}; shift
1017 ;;
1018 compile|compil|compi|comp|com|co|c)
1019 shift; set dummy --mode compile ${1+"$@"}; shift
1020 ;;
1021 execute|execut|execu|exec|exe|ex|e)
1022 shift; set dummy --mode execute ${1+"$@"}; shift
1023 ;;
1024 finish|finis|fini|fin|fi|f)
1025 shift; set dummy --mode finish ${1+"$@"}; shift
1026 ;;
1027 install|instal|insta|inst|ins|in|i)
1028 shift; set dummy --mode install ${1+"$@"}; shift
1029 ;;
1030 link|lin|li|l)
1031 shift; set dummy --mode link ${1+"$@"}; shift
1032 ;;
1033 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1034 shift; set dummy --mode uninstall ${1+"$@"}; shift
1035 ;;
1036 esac
1037
1038
1039
1040 # Option defaults:
1041 opt_debug=:
1042 opt_dry_run=false
1043 opt_config=false
1044 opt_preserve_dup_deps=false
1045 opt_features=false
1046 opt_finish=false
1047 opt_help=false
1048 opt_help_all=false
1049 opt_silent=:
1050 opt_warning=:
1051 opt_verbose=:
1052 opt_silent=false
1053 opt_verbose=false
1054
1055
1056 # Parse options once, thoroughly. This comes as soon as possible in the
1057 # script to make things like `--version' happen as quickly as we can.
1058 {
1059 # this just eases exit handling
1060 while test $# -gt 0; do
1061 opt="$1"
1062 shift
1063 case $opt in
1064 --debug|-x) opt_debug='set -x'
1065 func_echo "enabling shell trace mode"
1066 $opt_debug
1067 ;;
1068 --dry-run|--dryrun|-n)
1069 opt_dry_run=:
1070 ;;
1071 --config)
1072 opt_config=:
1073 func_config
1074 ;;
1075 --dlopen|-dlopen)
1076 optarg="$1"
1077 opt_dlopen="${opt_dlopen+$opt_dlopen
1078 }$optarg"
1079 shift
1080 ;;
1081 --preserve-dup-deps)
1082 opt_preserve_dup_deps=:
1083 ;;
1084 --features)
1085 opt_features=:
1086 func_features
1087 ;;
1088 --finish)
1089 opt_finish=:
1090 set dummy --mode finish ${1+"$@"}; shift
1091 ;;
1092 --help)
1093 opt_help=:
1094 ;;
1095 --help-all)
1096 opt_help_all=:
1097 opt_help=': help-all'
1098 ;;
1099 --mode)
1100 test $# = 0 && func_missing_arg $opt && break
1101 optarg="$1"
1102 opt_mode="$optarg"
1103 case $optarg in
1104 # Valid mode arguments:
1105 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1106
1107 # Catch anything else as an error
1108 *) func_error "invalid argument for $opt"
1109 exit_cmd=exit
1110 break
1111 ;;
1112 esac
1113 shift
1114 ;;
1115 --no-silent|--no-quiet)
1116 opt_silent=false
1117 func_append preserve_args " $opt"
1118 ;;
1119 --no-warning|--no-warn)
1120 opt_warning=false
1121 func_append preserve_args " $opt"
1122 ;;
1123 --no-verbose)
1124 opt_verbose=false
1125 func_append preserve_args " $opt"
1126 ;;
1127 --silent|--quiet)
1128 opt_silent=:
1129 func_append preserve_args " $opt"
1130 opt_verbose=false
1131 ;;
1132 --verbose|-v)
1133 opt_verbose=:
1134 func_append preserve_args " $opt"
1135 opt_silent=false
1136 ;;
1137 --tag)
1138 test $# = 0 && func_missing_arg $opt && break
1139 optarg="$1"
1140 opt_tag="$optarg"
1141 func_append preserve_args " $opt $optarg"
1142 func_enable_tag "$optarg"
1143 shift
1144 ;;
1145
1146 -\?|-h) func_usage ;;
1147 --help) func_help ;;
1148 --version) func_version ;;
1149
1150 # Separate optargs to long options:
1151 --*=*)
1152 func_split_long_opt "$opt"
1153 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1154 shift
1155 ;;
1156
1157 # Separate non-argument short options:
1158 -\?*|-h*|-n*|-v*)
1159 func_split_short_opt "$opt"
1160 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1161 shift
1162 ;;
1163
1164 --) break ;;
1165 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1166 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1167 esac
1168 done
1169
1170 # Validate options:
1171
1172 # save first non-option argument
1173 if test "$#" -gt 0; then
1174 nonopt="$opt"
1175 shift
1176 fi
1177
1178 # preserve --debug
1179 test "$opt_debug" = : || func_append preserve_args " --debug"
1180
1181 case $host in
1182 *cygwin* | *mingw* | *pw32* | *cegcc*)
1183 # don't eliminate duplications in $postdeps and $predeps
1184 opt_duplicate_compiler_generated_deps=:
1185 ;;
1186 *)
1187 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1188 ;;
1189 esac
1190
1191 $opt_help || {
1192 # Sanity checks first:
1193 func_check_version_match
1194
1195 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1196 func_fatal_configuration "not configured to build any kind of library"
1197 fi
1198
1199 # Darwin sucks
1200 eval std_shrext=\"$shrext_cmds\"
1201
1202 # Only execute mode is allowed to have -dlopen flags.
1203 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1204 func_error "unrecognized option \`-dlopen'"
1205 $ECHO "$help" 1>&2
1206 exit $EXIT_FAILURE
1207 fi
1208
1209 # Change the help message to a mode-specific one.
1210 generic_help="$help"
1211 help="Try \`$progname --help --mode=$opt_mode' for more information."
1212 }
1213
1214
1215 # Bail if the options were screwed
1216 $exit_cmd $EXIT_FAILURE
1217 }
1218
1219
1220
1221
1222 ## ----------- ##
1223 ## Main. ##
1224 ## ----------- ##
1225
1226 # func_lalib_p file
1227 # True iff FILE is a libtool `.la' library or `.lo' object file.
1228 # This function is only a basic sanity check; it will hardly flush out
1229 # determined imposters.
1230 func_lalib_p ()
1231 {
1232 test -f "$1" &&
1233 $SED -e 4q "$1" 2>/dev/null \
1234 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1235 }
1236
1237 # func_lalib_unsafe_p file
1238 # True iff FILE is a libtool `.la' library or `.lo' object file.
1239 # This function implements the same check as func_lalib_p without
1240 # resorting to external programs. To this end, it redirects stdin and
1241 # closes it afterwards, without saving the original file descriptor.
1242 # As a safety measure, use it only where a negative result would be
1243 # fatal anyway. Works if `file' does not exist.
1244 func_lalib_unsafe_p ()
1245 {
1246 lalib_p=no
1247 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1248 for lalib_p_l in 1 2 3 4
1249 do
1250 read lalib_p_line
1251 case "$lalib_p_line" in
1252 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1253 esac
1254 done
1255 exec 0<&5 5<&-
1256 fi
1257 test "$lalib_p" = yes
1258 }
1259
1260 # func_ltwrapper_script_p file
1261 # True iff FILE is a libtool wrapper script
1262 # This function is only a basic sanity check; it will hardly flush out
1263 # determined imposters.
1264 func_ltwrapper_script_p ()
1265 {
1266 func_lalib_p "$1"
1267 }
1268
1269 # func_ltwrapper_executable_p file
1270 # True iff FILE is a libtool wrapper executable
1271 # This function is only a basic sanity check; it will hardly flush out
1272 # determined imposters.
1273 func_ltwrapper_executable_p ()
1274 {
1275 func_ltwrapper_exec_suffix=
1276 case $1 in
1277 *.exe) ;;
1278 *) func_ltwrapper_exec_suffix=.exe ;;
1279 esac
1280 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1281 }
1282
1283 # func_ltwrapper_scriptname file
1284 # Assumes file is an ltwrapper_executable
1285 # uses $file to determine the appropriate filename for a
1286 # temporary ltwrapper_script.
1287 func_ltwrapper_scriptname ()
1288 {
1289 func_dirname_and_basename "$1" "" "."
1290 func_stripname '' '.exe' "$func_basename_result"
1291 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1292 }
1293
1294 # func_ltwrapper_p file
1295 # True iff FILE is a libtool wrapper script or wrapper executable
1296 # This function is only a basic sanity check; it will hardly flush out
1297 # determined imposters.
1298 func_ltwrapper_p ()
1299 {
1300 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1301 }
1302
1303
1304 # func_execute_cmds commands fail_cmd
1305 # Execute tilde-delimited COMMANDS.
1306 # If FAIL_CMD is given, eval that upon failure.
1307 # FAIL_CMD may read-access the current command in variable CMD!
1308 func_execute_cmds ()
1309 {
1310 $opt_debug
1311 save_ifs=$IFS; IFS='~'
1312 for cmd in $1; do
1313 IFS=$save_ifs
1314 eval cmd=\"$cmd\"
1315 func_show_eval "$cmd" "${2-:}"
1316 done
1317 IFS=$save_ifs
1318 }
1319
1320
1321 # func_source file
1322 # Source FILE, adding directory component if necessary.
1323 # Note that it is not necessary on cygwin/mingw to append a dot to
1324 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1325 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1326 # `FILE.' does not work on cygwin managed mounts.
1327 func_source ()
1328 {
1329 $opt_debug
1330 case $1 in
1331 */* | *\\*) . "$1" ;;
1332 *) . "./$1" ;;
1333 esac
1334 }
1335
1336
1337 # func_resolve_sysroot PATH
1338 # Replace a leading = in PATH with a sysroot. Store the result into
1339 # func_resolve_sysroot_result
1340 func_resolve_sysroot ()
1341 {
1342 func_resolve_sysroot_result=$1
1343 case $func_resolve_sysroot_result in
1344 =*)
1345 func_stripname '=' '' "$func_resolve_sysroot_result"
1346 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1347 ;;
1348 esac
1349 }
1350
1351 # func_replace_sysroot PATH
1352 # If PATH begins with the sysroot, replace it with = and
1353 # store the result into func_replace_sysroot_result.
1354 func_replace_sysroot ()
1355 {
1356 case "$lt_sysroot:$1" in
1357 ?*:"$lt_sysroot"*)
1358 func_stripname "$lt_sysroot" '' "$1"
1359 func_replace_sysroot_result="=$func_stripname_result"
1360 ;;
1361 *)
1362 # Including no sysroot.
1363 func_replace_sysroot_result=$1
1364 ;;
1365 esac
1366 }
1367
1368 # func_infer_tag arg
1369 # Infer tagged configuration to use if any are available and
1370 # if one wasn't chosen via the "--tag" command line option.
1371 # Only attempt this if the compiler in the base compile
1372 # command doesn't match the default compiler.
1373 # arg is usually of the form 'gcc ...'
1374 func_infer_tag ()
1375 {
1376 $opt_debug
1377 if test -n "$available_tags" && test -z "$tagname"; then
1378 CC_quoted=
1379 for arg in $CC; do
1380 func_append_quoted CC_quoted "$arg"
1381 done
1382 CC_expanded=`func_echo_all $CC`
1383 CC_quoted_expanded=`func_echo_all $CC_quoted`
1384 case $@ in
1385 # Blanks in the command may have been stripped by the calling shell,
1386 # but not from the CC environment variable when configure was run.
1387 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1388 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1389 # Blanks at the start of $base_compile will cause this to fail
1390 # if we don't check for them as well.
1391 *)
1392 for z in $available_tags; do
1393 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1394 # Evaluate the configuration.
1395 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1396 CC_quoted=
1397 for arg in $CC; do
1398 # Double-quote args containing other shell metacharacters.
1399 func_append_quoted CC_quoted "$arg"
1400 done
1401 CC_expanded=`func_echo_all $CC`
1402 CC_quoted_expanded=`func_echo_all $CC_quoted`
1403 case "$@ " in
1404 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1405 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1406 # The compiler in the base compile command matches
1407 # the one in the tagged configuration.
1408 # Assume this is the tagged configuration we want.
1409 tagname=$z
1410 break
1411 ;;
1412 esac
1413 fi
1414 done
1415 # If $tagname still isn't set, then no tagged configuration
1416 # was found and let the user know that the "--tag" command
1417 # line option must be used.
1418 if test -z "$tagname"; then
1419 func_echo "unable to infer tagged configuration"
1420 func_fatal_error "specify a tag with \`--tag'"
1421 # else
1422 # func_verbose "using $tagname tagged configuration"
1423 fi
1424 ;;
1425 esac
1426 fi
1427 }
1428
1429
1430
1431 # func_write_libtool_object output_name pic_name nonpic_name
1432 # Create a libtool object file (analogous to a ".la" file),
1433 # but don't create it if we're doing a dry run.
1434 func_write_libtool_object ()
1435 {
1436 write_libobj=${1}
1437 if test "$build_libtool_libs" = yes; then
1438 write_lobj=\'${2}\'
1439 else
1440 write_lobj=none
1441 fi
1442
1443 if test "$build_old_libs" = yes; then
1444 write_oldobj=\'${3}\'
1445 else
1446 write_oldobj=none
1447 fi
1448
1449 $opt_dry_run || {
1450 cat >${write_libobj}T <<EOF
1451 # $write_libobj - a libtool object file
1452 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1453 #
1454 # Please DO NOT delete this file!
1455 # It is necessary for linking the library.
1456
1457 # Name of the PIC object.
1458 pic_object=$write_lobj
1459
1460 # Name of the non-PIC object
1461 non_pic_object=$write_oldobj
1462
1463 EOF
1464 $MV "${write_libobj}T" "${write_libobj}"
1465 }
1466 }
1467
1468
1469 ##################################################
1470 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1471 ##################################################
1472
1473 # func_convert_core_file_wine_to_w32 ARG
1474 # Helper function used by file name conversion functions when $build is *nix,
1475 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1476 # correctly configured wine environment available, with the winepath program
1477 # in $build's $PATH.
1478 #
1479 # ARG is the $build file name to be converted to w32 format.
1480 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1481 # be empty on error (or when ARG is empty)
1482 func_convert_core_file_wine_to_w32 ()
1483 {
1484 $opt_debug
1485 func_convert_core_file_wine_to_w32_result="$1"
1486 if test -n "$1"; then
1487 # Unfortunately, winepath does not exit with a non-zero error code, so we
1488 # are forced to check the contents of stdout. On the other hand, if the
1489 # command is not found, the shell will set an exit code of 127 and print
1490 # *an error message* to stdout. So we must check for both error code of
1491 # zero AND non-empty stdout, which explains the odd construction:
1492 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1493 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1494 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1495 $SED -e "$lt_sed_naive_backslashify"`
1496 else
1497 func_convert_core_file_wine_to_w32_result=
1498 fi
1499 fi
1500 }
1501 # end: func_convert_core_file_wine_to_w32
1502
1503
1504 # func_convert_core_path_wine_to_w32 ARG
1505 # Helper function used by path conversion functions when $build is *nix, and
1506 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1507 # configured wine environment available, with the winepath program in $build's
1508 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1509 #
1510 # ARG is path to be converted from $build format to win32.
1511 # Result is available in $func_convert_core_path_wine_to_w32_result.
1512 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1513 # are convertible, then the result may be empty.
1514 func_convert_core_path_wine_to_w32 ()
1515 {
1516 $opt_debug
1517 # unfortunately, winepath doesn't convert paths, only file names
1518 func_convert_core_path_wine_to_w32_result=""
1519 if test -n "$1"; then
1520 oldIFS=$IFS
1521 IFS=:
1522 for func_convert_core_path_wine_to_w32_f in $1; do
1523 IFS=$oldIFS
1524 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1525 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1526 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1527 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1528 else
1529 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1530 fi
1531 fi
1532 done
1533 IFS=$oldIFS
1534 fi
1535 }
1536 # end: func_convert_core_path_wine_to_w32
1537
1538
1539 # func_cygpath ARGS...
1540 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1541 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1542 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1543 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1544 # file name or path is assumed to be in w32 format, as previously converted
1545 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1546 # or path in func_cygpath_result (input file name or path is assumed to be in
1547 # Cygwin format). Returns an empty string on error.
1548 #
1549 # ARGS are passed to cygpath, with the last one being the file name or path to
1550 # be converted.
1551 #
1552 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1553 # environment variable; do not put it in $PATH.
1554 func_cygpath ()
1555 {
1556 $opt_debug
1557 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1558 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1559 if test "$?" -ne 0; then
1560 # on failure, ensure result is empty
1561 func_cygpath_result=
1562 fi
1563 else
1564 func_cygpath_result=
1565 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1566 fi
1567 }
1568 #end: func_cygpath
1569
1570
1571 # func_convert_core_msys_to_w32 ARG
1572 # Convert file name or path ARG from MSYS format to w32 format. Return
1573 # result in func_convert_core_msys_to_w32_result.
1574 func_convert_core_msys_to_w32 ()
1575 {
1576 $opt_debug
1577 # awkward: cmd appends spaces to result
1578 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1579 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1580 }
1581 #end: func_convert_core_msys_to_w32
1582
1583
1584 # func_convert_file_check ARG1 ARG2
1585 # Verify that ARG1 (a file name in $build format) was converted to $host
1586 # format in ARG2. Otherwise, emit an error message, but continue (resetting
1587 # func_to_host_file_result to ARG1).
1588 func_convert_file_check ()
1589 {
1590 $opt_debug
1591 if test -z "$2" && test -n "$1" ; then
1592 func_error "Could not determine host file name corresponding to"
1593 func_error " \`$1'"
1594 func_error "Continuing, but uninstalled executables may not work."
1595 # Fallback:
1596 func_to_host_file_result="$1"
1597 fi
1598 }
1599 # end func_convert_file_check
1600
1601
1602 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1603 # Verify that FROM_PATH (a path in $build format) was converted to $host
1604 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1605 # func_to_host_file_result to a simplistic fallback value (see below).
1606 func_convert_path_check ()
1607 {
1608 $opt_debug
1609 if test -z "$4" && test -n "$3"; then
1610 func_error "Could not determine the host path corresponding to"
1611 func_error " \`$3'"
1612 func_error "Continuing, but uninstalled executables may not work."
1613 # Fallback. This is a deliberately simplistic "conversion" and
1614 # should not be "improved". See libtool.info.
1615 if test "x$1" != "x$2"; then
1616 lt_replace_pathsep_chars="s|$1|$2|g"
1617 func_to_host_path_result=`echo "$3" |
1618 $SED -e "$lt_replace_pathsep_chars"`
1619 else
1620 func_to_host_path_result="$3"
1621 fi
1622 fi
1623 }
1624 # end func_convert_path_check
1625
1626
1627 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1628 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1629 # and appending REPL if ORIG matches BACKPAT.
1630 func_convert_path_front_back_pathsep ()
1631 {
1632 $opt_debug
1633 case $4 in
1634 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
1635 ;;
1636 esac
1637 case $4 in
1638 $2 ) func_append func_to_host_path_result "$3"
1639 ;;
1640 esac
1641 }
1642 # end func_convert_path_front_back_pathsep
1643
1644
1645 ##################################################
1646 # $build to $host FILE NAME CONVERSION FUNCTIONS #
1647 ##################################################
1648 # invoked via `$to_host_file_cmd ARG'
1649 #
1650 # In each case, ARG is the path to be converted from $build to $host format.
1651 # Result will be available in $func_to_host_file_result.
1652
1653
1654 # func_to_host_file ARG
1655 # Converts the file name ARG from $build format to $host format. Return result
1656 # in func_to_host_file_result.
1657 func_to_host_file ()
1658 {
1659 $opt_debug
1660 $to_host_file_cmd "$1"
1661 }
1662 # end func_to_host_file
1663
1664
1665 # func_to_tool_file ARG LAZY
1666 # converts the file name ARG from $build format to toolchain format. Return
1667 # result in func_to_tool_file_result. If the conversion in use is listed
1668 # in (the comma separated) LAZY, no conversion takes place.
1669 func_to_tool_file ()
1670 {
1671 $opt_debug
1672 case ,$2, in
1673 *,"$to_tool_file_cmd",*)
1674 func_to_tool_file_result=$1
1675 ;;
1676 *)
1677 $to_tool_file_cmd "$1"
1678 func_to_tool_file_result=$func_to_host_file_result
1679 ;;
1680 esac
1681 }
1682 # end func_to_tool_file
1683
1684
1685 # func_convert_file_noop ARG
1686 # Copy ARG to func_to_host_file_result.
1687 func_convert_file_noop ()
1688 {
1689 func_to_host_file_result="$1"
1690 }
1691 # end func_convert_file_noop
1692
1693
1694 # func_convert_file_msys_to_w32 ARG
1695 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1696 # conversion to w32 is not available inside the cwrapper. Returns result in
1697 # func_to_host_file_result.
1698 func_convert_file_msys_to_w32 ()
1699 {
1700 $opt_debug
1701 func_to_host_file_result="$1"
1702 if test -n "$1"; then
1703 func_convert_core_msys_to_w32 "$1"
1704 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1705 fi
1706 func_convert_file_check "$1" "$func_to_host_file_result"
1707 }
1708 # end func_convert_file_msys_to_w32
1709
1710
1711 # func_convert_file_cygwin_to_w32 ARG
1712 # Convert file name ARG from Cygwin to w32 format. Returns result in
1713 # func_to_host_file_result.
1714 func_convert_file_cygwin_to_w32 ()
1715 {
1716 $opt_debug
1717 func_to_host_file_result="$1"
1718 if test -n "$1"; then
1719 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1720 # LT_CYGPATH in this case.
1721 func_to_host_file_result=`cygpath -m "$1"`
1722 fi
1723 func_convert_file_check "$1" "$func_to_host_file_result"
1724 }
1725 # end func_convert_file_cygwin_to_w32
1726
1727
1728 # func_convert_file_nix_to_w32 ARG
1729 # Convert file name ARG from *nix to w32 format. Requires a wine environment
1730 # and a working winepath. Returns result in func_to_host_file_result.
1731 func_convert_file_nix_to_w32 ()
1732 {
1733 $opt_debug
1734 func_to_host_file_result="$1"
1735 if test -n "$1"; then
1736 func_convert_core_file_wine_to_w32 "$1"
1737 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1738 fi
1739 func_convert_file_check "$1" "$func_to_host_file_result"
1740 }
1741 # end func_convert_file_nix_to_w32
1742
1743
1744 # func_convert_file_msys_to_cygwin ARG
1745 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1746 # Returns result in func_to_host_file_result.
1747 func_convert_file_msys_to_cygwin ()
1748 {
1749 $opt_debug
1750 func_to_host_file_result="$1"
1751 if test -n "$1"; then
1752 func_convert_core_msys_to_w32 "$1"
1753 func_cygpath -u "$func_convert_core_msys_to_w32_result"
1754 func_to_host_file_result="$func_cygpath_result"
1755 fi
1756 func_convert_file_check "$1" "$func_to_host_file_result"
1757 }
1758 # end func_convert_file_msys_to_cygwin
1759
1760
1761 # func_convert_file_nix_to_cygwin ARG
1762 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1763 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1764 # in func_to_host_file_result.
1765 func_convert_file_nix_to_cygwin ()
1766 {
1767 $opt_debug
1768 func_to_host_file_result="$1"
1769 if test -n "$1"; then
1770 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1771 func_convert_core_file_wine_to_w32 "$1"
1772 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1773 func_to_host_file_result="$func_cygpath_result"
1774 fi
1775 func_convert_file_check "$1" "$func_to_host_file_result"
1776 }
1777 # end func_convert_file_nix_to_cygwin
1778
1779
1780 #############################################
1781 # $build to $host PATH CONVERSION FUNCTIONS #
1782 #############################################
1783 # invoked via `$to_host_path_cmd ARG'
1784 #
1785 # In each case, ARG is the path to be converted from $build to $host format.
1786 # The result will be available in $func_to_host_path_result.
1787 #
1788 # Path separators are also converted from $build format to $host format. If
1789 # ARG begins or ends with a path separator character, it is preserved (but
1790 # converted to $host format) on output.
1791 #
1792 # All path conversion functions are named using the following convention:
1793 # file name conversion function : func_convert_file_X_to_Y ()
1794 # path conversion function : func_convert_path_X_to_Y ()
1795 # where, for any given $build/$host combination the 'X_to_Y' value is the
1796 # same. If conversion functions are added for new $build/$host combinations,
1797 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
1798 # will break.
1799
1800
1801 # func_init_to_host_path_cmd
1802 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
1803 # appropriate value, based on the value of $to_host_file_cmd.
1804 to_host_path_cmd=
1805 func_init_to_host_path_cmd ()
1806 {
1807 $opt_debug
1808 if test -z "$to_host_path_cmd"; then
1809 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1810 to_host_path_cmd="func_convert_path_${func_stripname_result}"
1811 fi
1812 }
1813
1814
1815 # func_to_host_path ARG
1816 # Converts the path ARG from $build format to $host format. Return result
1817 # in func_to_host_path_result.
1818 func_to_host_path ()
1819 {
1820 $opt_debug
1821 func_init_to_host_path_cmd
1822 $to_host_path_cmd "$1"
1823 }
1824 # end func_to_host_path
1825
1826
1827 # func_convert_path_noop ARG
1828 # Copy ARG to func_to_host_path_result.
1829 func_convert_path_noop ()
1830 {
1831 func_to_host_path_result="$1"
1832 }
1833 # end func_convert_path_noop
1834
1835
1836 # func_convert_path_msys_to_w32 ARG
1837 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1838 # conversion to w32 is not available inside the cwrapper. Returns result in
1839 # func_to_host_path_result.
1840 func_convert_path_msys_to_w32 ()
1841 {
1842 $opt_debug
1843 func_to_host_path_result="$1"
1844 if test -n "$1"; then
1845 # Remove leading and trailing path separator characters from ARG. MSYS
1846 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1847 # and winepath ignores them completely.
1848 func_stripname : : "$1"
1849 func_to_host_path_tmp1=$func_stripname_result
1850 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1851 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1852 func_convert_path_check : ";" \
1853 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1854 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1855 fi
1856 }
1857 # end func_convert_path_msys_to_w32
1858
1859
1860 # func_convert_path_cygwin_to_w32 ARG
1861 # Convert path ARG from Cygwin to w32 format. Returns result in
1862 # func_to_host_file_result.
1863 func_convert_path_cygwin_to_w32 ()
1864 {
1865 $opt_debug
1866 func_to_host_path_result="$1"
1867 if test -n "$1"; then
1868 # See func_convert_path_msys_to_w32:
1869 func_stripname : : "$1"
1870 func_to_host_path_tmp1=$func_stripname_result
1871 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1872 func_convert_path_check : ";" \
1873 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1874 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1875 fi
1876 }
1877 # end func_convert_path_cygwin_to_w32
1878
1879
1880 # func_convert_path_nix_to_w32 ARG
1881 # Convert path ARG from *nix to w32 format. Requires a wine environment and
1882 # a working winepath. Returns result in func_to_host_file_result.
1883 func_convert_path_nix_to_w32 ()
1884 {
1885 $opt_debug
1886 func_to_host_path_result="$1"
1887 if test -n "$1"; then
1888 # See func_convert_path_msys_to_w32:
1889 func_stripname : : "$1"
1890 func_to_host_path_tmp1=$func_stripname_result
1891 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1892 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1893 func_convert_path_check : ";" \
1894 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1895 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1896 fi
1897 }
1898 # end func_convert_path_nix_to_w32
1899
1900
1901 # func_convert_path_msys_to_cygwin ARG
1902 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1903 # Returns result in func_to_host_file_result.
1904 func_convert_path_msys_to_cygwin ()
1905 {
1906 $opt_debug
1907 func_to_host_path_result="$1"
1908 if test -n "$1"; then
1909 # See func_convert_path_msys_to_w32:
1910 func_stripname : : "$1"
1911 func_to_host_path_tmp1=$func_stripname_result
1912 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1913 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1914 func_to_host_path_result="$func_cygpath_result"
1915 func_convert_path_check : : \
1916 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1917 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1918 fi
1919 }
1920 # end func_convert_path_msys_to_cygwin
1921
1922
1923 # func_convert_path_nix_to_cygwin ARG
1924 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1925 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1926 # func_to_host_file_result.
1927 func_convert_path_nix_to_cygwin ()
1928 {
1929 $opt_debug
1930 func_to_host_path_result="$1"
1931 if test -n "$1"; then
1932 # Remove leading and trailing path separator characters from
1933 # ARG. msys behavior is inconsistent here, cygpath turns them
1934 # into '.;' and ';.', and winepath ignores them completely.
1935 func_stripname : : "$1"
1936 func_to_host_path_tmp1=$func_stripname_result
1937 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1938 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1939 func_to_host_path_result="$func_cygpath_result"
1940 func_convert_path_check : : \
1941 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1942 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1943 fi
1944 }
1945 # end func_convert_path_nix_to_cygwin
1946
1947
1948 # func_mode_compile arg...
1949 func_mode_compile ()
1950 {
1951 $opt_debug
1952 # Get the compilation command and the source file.
1953 base_compile=
1954 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1955 suppress_opt=yes
1956 suppress_output=
1957 arg_mode=normal
1958 libobj=
1959 later=
1960 pie_flag=
1961
1962 for arg
1963 do
1964 case $arg_mode in
1965 arg )
1966 # do not "continue". Instead, add this to base_compile
1967 lastarg="$arg"
1968 arg_mode=normal
1969 ;;
1970
1971 target )
1972 libobj="$arg"
1973 arg_mode=normal
1974 continue
1975 ;;
1976
1977 normal )
1978 # Accept any command-line options.
1979 case $arg in
1980 -o)
1981 test -n "$libobj" && \
1982 func_fatal_error "you cannot specify \`-o' more than once"
1983 arg_mode=target
1984 continue
1985 ;;
1986
1987 -pie | -fpie | -fPIE)
1988 func_append pie_flag " $arg"
1989 continue
1990 ;;
1991
1992 -shared | -static | -prefer-pic | -prefer-non-pic)
1993 func_append later " $arg"
1994 continue
1995 ;;
1996
1997 -no-suppress)
1998 suppress_opt=no
1999 continue
2000 ;;
2001
2002 -Xcompiler)
2003 arg_mode=arg # the next one goes into the "base_compile" arg list
2004 continue # The current "srcfile" will either be retained or
2005 ;; # replaced later. I would guess that would be a bug.
2006
2007 -Wc,*)
2008 func_stripname '-Wc,' '' "$arg"
2009 args=$func_stripname_result
2010 lastarg=
2011 save_ifs="$IFS"; IFS=','
2012 for arg in $args; do
2013 IFS="$save_ifs"
2014 func_append_quoted lastarg "$arg"
2015 done
2016 IFS="$save_ifs"
2017 func_stripname ' ' '' "$lastarg"
2018 lastarg=$func_stripname_result
2019
2020 # Add the arguments to base_compile.
2021 func_append base_compile " $lastarg"
2022 continue
2023 ;;
2024
2025 *)
2026 # Accept the current argument as the source file.
2027 # The previous "srcfile" becomes the current argument.
2028 #
2029 lastarg="$srcfile"
2030 srcfile="$arg"
2031 ;;
2032 esac # case $arg
2033 ;;
2034 esac # case $arg_mode
2035
2036 # Aesthetically quote the previous argument.
2037 func_append_quoted base_compile "$lastarg"
2038 done # for arg
2039
2040 case $arg_mode in
2041 arg)
2042 func_fatal_error "you must specify an argument for -Xcompile"
2043 ;;
2044 target)
2045 func_fatal_error "you must specify a target with \`-o'"
2046 ;;
2047 *)
2048 # Get the name of the library object.
2049 test -z "$libobj" && {
2050 func_basename "$srcfile"
2051 libobj="$func_basename_result"
2052 }
2053 ;;
2054 esac
2055
2056 # Recognize several different file suffixes.
2057 # If the user specifies -o file.o, it is replaced with file.lo
2058 case $libobj in
2059 *.[cCFSifmso] | \
2060 *.ada | *.adb | *.ads | *.asm | \
2061 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2062 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
2063 func_xform "$libobj"
2064 libobj=$func_xform_result
2065 ;;
2066 esac
2067
2068 case $libobj in
2069 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2070 *)
2071 func_fatal_error "cannot determine name of library object from \`$libobj'"
2072 ;;
2073 esac
2074
2075 func_infer_tag $base_compile
2076
2077 for arg in $later; do
2078 case $arg in
2079 -shared)
2080 test "$build_libtool_libs" != yes && \
2081 func_fatal_configuration "can not build a shared library"
2082 build_old_libs=no
2083 continue
2084 ;;
2085
2086 -static)
2087 build_libtool_libs=no
2088 build_old_libs=yes
2089 continue
2090 ;;
2091
2092 -prefer-pic)
2093 pic_mode=yes
2094 continue
2095 ;;
2096
2097 -prefer-non-pic)
2098 pic_mode=no
2099 continue
2100 ;;
2101 esac
2102 done
2103
2104 func_quote_for_eval "$libobj"
2105 test "X$libobj" != "X$func_quote_for_eval_result" \
2106 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2107 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2108 func_dirname_and_basename "$obj" "/" ""
2109 objname="$func_basename_result"
2110 xdir="$func_dirname_result"
2111 lobj=${xdir}$objdir/$objname
2112
2113 test -z "$base_compile" && \
2114 func_fatal_help "you must specify a compilation command"
2115
2116 # Delete any leftover library objects.
2117 if test "$build_old_libs" = yes; then
2118 removelist="$obj $lobj $libobj ${libobj}T"
2119 else
2120 removelist="$lobj $libobj ${libobj}T"
2121 fi
2122
2123 # On Cygwin there's no "real" PIC flag so we must build both object types
2124 case $host_os in
2125 cygwin* | mingw* | pw32* | os2* | cegcc*)
2126 pic_mode=default
2127 ;;
2128 esac
2129 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2130 # non-PIC code in shared libraries is not supported
2131 pic_mode=default
2132 fi
2133
2134 # Calculate the filename of the output object if compiler does
2135 # not support -o with -c
2136 if test "$compiler_c_o" = no; then
2137 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2138 lockfile="$output_obj.lock"
2139 else
2140 output_obj=
2141 need_locks=no
2142 lockfile=
2143 fi
2144
2145 # Lock this critical section if it is needed
2146 # We use this script file to make the link, it avoids creating a new file
2147 if test "$need_locks" = yes; then
2148 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2149 func_echo "Waiting for $lockfile to be removed"
2150 sleep 2
2151 done
2152 elif test "$need_locks" = warn; then
2153 if test -f "$lockfile"; then
2154 $ECHO "\
2155 *** ERROR, $lockfile exists and contains:
2156 `cat $lockfile 2>/dev/null`
2157
2158 This indicates that another process is trying to use the same
2159 temporary object file, and libtool could not work around it because
2160 your compiler does not support \`-c' and \`-o' together. If you
2161 repeat this compilation, it may succeed, by chance, but you had better
2162 avoid parallel builds (make -j) in this platform, or get a better
2163 compiler."
2164
2165 $opt_dry_run || $RM $removelist
2166 exit $EXIT_FAILURE
2167 fi
2168 func_append removelist " $output_obj"
2169 $ECHO "$srcfile" > "$lockfile"
2170 fi
2171
2172 $opt_dry_run || $RM $removelist
2173 func_append removelist " $lockfile"
2174 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2175
2176 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2177 srcfile=$func_to_tool_file_result
2178 func_quote_for_eval "$srcfile"
2179 qsrcfile=$func_quote_for_eval_result
2180
2181 # Only build a PIC object if we are building libtool libraries.
2182 if test "$build_libtool_libs" = yes; then
2183 # Without this assignment, base_compile gets emptied.
2184 fbsd_hideous_sh_bug=$base_compile
2185
2186 if test "$pic_mode" != no; then
2187 command="$base_compile $qsrcfile $pic_flag"
2188 else
2189 # Don't build PIC code
2190 command="$base_compile $qsrcfile"
2191 fi
2192
2193 func_mkdir_p "$xdir$objdir"
2194
2195 if test -z "$output_obj"; then
2196 # Place PIC objects in $objdir
2197 func_append command " -o $lobj"
2198 fi
2199
2200 func_show_eval_locale "$command" \
2201 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2202
2203 if test "$need_locks" = warn &&
2204 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2205 $ECHO "\
2206 *** ERROR, $lockfile contains:
2207 `cat $lockfile 2>/dev/null`
2208
2209 but it should contain:
2210 $srcfile
2211
2212 This indicates that another process is trying to use the same
2213 temporary object file, and libtool could not work around it because
2214 your compiler does not support \`-c' and \`-o' together. If you
2215 repeat this compilation, it may succeed, by chance, but you had better
2216 avoid parallel builds (make -j) in this platform, or get a better
2217 compiler."
2218
2219 $opt_dry_run || $RM $removelist
2220 exit $EXIT_FAILURE
2221 fi
2222
2223 # Just move the object if needed, then go on to compile the next one
2224 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2225 func_show_eval '$MV "$output_obj" "$lobj"' \
2226 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2227 fi
2228
2229 # Allow error messages only from the first compilation.
2230 if test "$suppress_opt" = yes; then
2231 suppress_output=' >/dev/null 2>&1'
2232 fi
2233 fi
2234
2235 # Only build a position-dependent object if we build old libraries.
2236 if test "$build_old_libs" = yes; then
2237 if test "$pic_mode" != yes; then
2238 # Don't build PIC code
2239 command="$base_compile $qsrcfile$pie_flag"
2240 else
2241 command="$base_compile $qsrcfile $pic_flag"
2242 fi
2243 if test "$compiler_c_o" = yes; then
2244 func_append command " -o $obj"
2245 fi
2246
2247 # Suppress compiler output if we already did a PIC compilation.
2248 func_append command "$suppress_output"
2249 func_show_eval_locale "$command" \
2250 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2251
2252 if test "$need_locks" = warn &&
2253 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2254 $ECHO "\
2255 *** ERROR, $lockfile contains:
2256 `cat $lockfile 2>/dev/null`
2257
2258 but it should contain:
2259 $srcfile
2260
2261 This indicates that another process is trying to use the same
2262 temporary object file, and libtool could not work around it because
2263 your compiler does not support \`-c' and \`-o' together. If you
2264 repeat this compilation, it may succeed, by chance, but you had better
2265 avoid parallel builds (make -j) in this platform, or get a better
2266 compiler."
2267
2268 $opt_dry_run || $RM $removelist
2269 exit $EXIT_FAILURE
2270 fi
2271
2272 # Just move the object if needed
2273 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2274 func_show_eval '$MV "$output_obj" "$obj"' \
2275 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2276 fi
2277 fi
2278
2279 $opt_dry_run || {
2280 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2281
2282 # Unlock the critical section if it was locked
2283 if test "$need_locks" != no; then
2284 removelist=$lockfile
2285 $RM "$lockfile"
2286 fi
2287 }
2288
2289 exit $EXIT_SUCCESS
2290 }
2291
2292 $opt_help || {
2293 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2294 }
2295
2296 func_mode_help ()
2297 {
2298 # We need to display help for each of the modes.
2299 case $opt_mode in
2300 "")
2301 # Generic help is extracted from the usage comments
2302 # at the start of this file.
2303 func_help
2304 ;;
2305
2306 clean)
2307 $ECHO \
2308 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2309
2310 Remove files from the build directory.
2311
2312 RM is the name of the program to use to delete files associated with each FILE
2313 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2314 to RM.
2315
2316 If FILE is a libtool library, object or program, all the files associated
2317 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2318 ;;
2319
2320 compile)
2321 $ECHO \
2322 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2323
2324 Compile a source file into a libtool library object.
2325
2326 This mode accepts the following additional options:
2327
2328 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2329 -no-suppress do not suppress compiler output for multiple passes
2330 -prefer-pic try to build PIC objects only
2331 -prefer-non-pic try to build non-PIC objects only
2332 -shared do not build a \`.o' file suitable for static linking
2333 -static only build a \`.o' file suitable for static linking
2334 -Wc,FLAG pass FLAG directly to the compiler
2335
2336 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2337 from the given SOURCEFILE.
2338
2339 The output file name is determined by removing the directory component from
2340 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2341 library object suffix, \`.lo'."
2342 ;;
2343
2344 execute)
2345 $ECHO \
2346 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2347
2348 Automatically set library path, then run a program.
2349
2350 This mode accepts the following additional options:
2351
2352 -dlopen FILE add the directory containing FILE to the library path
2353
2354 This mode sets the library path environment variable according to \`-dlopen'
2355 flags.
2356
2357 If any of the ARGS are libtool executable wrappers, then they are translated
2358 into their corresponding uninstalled binary, and any of their required library
2359 directories are added to the library path.
2360
2361 Then, COMMAND is executed, with ARGS as arguments."
2362 ;;
2363
2364 finish)
2365 $ECHO \
2366 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2367
2368 Complete the installation of libtool libraries.
2369
2370 Each LIBDIR is a directory that contains libtool libraries.
2371
2372 The commands that this mode executes may require superuser privileges. Use
2373 the \`--dry-run' option if you just want to see what would be executed."
2374 ;;
2375
2376 install)
2377 $ECHO \
2378 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2379
2380 Install executables or libraries.
2381
2382 INSTALL-COMMAND is the installation command. The first component should be
2383 either the \`install' or \`cp' program.
2384
2385 The following components of INSTALL-COMMAND are treated specially:
2386
2387 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2388
2389 The rest of the components are interpreted as arguments to that command (only
2390 BSD-compatible install options are recognized)."
2391 ;;
2392
2393 link)
2394 $ECHO \
2395 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2396
2397 Link object files or libraries together to form another library, or to
2398 create an executable program.
2399
2400 LINK-COMMAND is a command using the C compiler that you would use to create
2401 a program from several object files.
2402
2403 The following components of LINK-COMMAND are treated specially:
2404
2405 -all-static do not do any dynamic linking at all
2406 -avoid-version do not add a version suffix if possible
2407 -bindir BINDIR specify path to binaries directory (for systems where
2408 libraries must be found in the PATH setting at runtime)
2409 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2410 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2411 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2412 -export-symbols SYMFILE
2413 try to export only the symbols listed in SYMFILE
2414 -export-symbols-regex REGEX
2415 try to export only the symbols matching REGEX
2416 -LLIBDIR search LIBDIR for required installed libraries
2417 -lNAME OUTPUT-FILE requires the installed library libNAME
2418 -module build a library that can dlopened
2419 -no-fast-install disable the fast-install mode
2420 -no-install link a not-installable executable
2421 -no-undefined declare that a library does not refer to external symbols
2422 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2423 -objectlist FILE Use a list of object files found in FILE to specify objects
2424 -precious-files-regex REGEX
2425 don't remove output files matching REGEX
2426 -release RELEASE specify package release information
2427 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2428 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2429 -shared only do dynamic linking of libtool libraries
2430 -shrext SUFFIX override the standard shared library file extension
2431 -static do not do any dynamic linking of uninstalled libtool libraries
2432 -static-libtool-libs
2433 do not do any dynamic linking of libtool libraries
2434 -version-info CURRENT[:REVISION[:AGE]]
2435 specify library version info [each variable defaults to 0]
2436 -weak LIBNAME declare that the target provides the LIBNAME interface
2437 -Wc,FLAG
2438 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2439 -Wl,FLAG
2440 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2441 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2442
2443 All other options (arguments beginning with \`-') are ignored.
2444
2445 Every other argument is treated as a filename. Files ending in \`.la' are
2446 treated as uninstalled libtool libraries, other files are standard or library
2447 object files.
2448
2449 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2450 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2451 required, except when creating a convenience library.
2452
2453 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2454 using \`ar' and \`ranlib', or on Windows using \`lib'.
2455
2456 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2457 is created, otherwise an executable program is created."
2458 ;;
2459
2460 uninstall)
2461 $ECHO \
2462 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2463
2464 Remove libraries from an installation directory.
2465
2466 RM is the name of the program to use to delete files associated with each FILE
2467 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2468 to RM.
2469
2470 If FILE is a libtool library, all the files associated with it are deleted.
2471 Otherwise, only FILE itself is deleted using RM."
2472 ;;
2473
2474 *)
2475 func_fatal_help "invalid operation mode \`$opt_mode'"
2476 ;;
2477 esac
2478
2479 echo
2480 $ECHO "Try \`$progname --help' for more information about other modes."
2481 }
2482
2483 # Now that we've collected a possible --mode arg, show help if necessary
2484 if $opt_help; then
2485 if test "$opt_help" = :; then
2486 func_mode_help
2487 else
2488 {
2489 func_help noexit
2490 for opt_mode in compile link execute install finish uninstall clean; do
2491 func_mode_help
2492 done
2493 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2494 {
2495 func_help noexit
2496 for opt_mode in compile link execute install finish uninstall clean; do
2497 echo
2498 func_mode_help
2499 done
2500 } |
2501 sed '1d
2502 /^When reporting/,/^Report/{
2503 H
2504 d
2505 }
2506 $x
2507 /information about other modes/d
2508 /more detailed .*MODE/d
2509 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2510 fi
2511 exit $?
2512 fi
2513
2514
2515 # func_mode_execute arg...
2516 func_mode_execute ()
2517 {
2518 $opt_debug
2519 # The first argument is the command name.
2520 cmd="$nonopt"
2521 test -z "$cmd" && \
2522 func_fatal_help "you must specify a COMMAND"
2523
2524 # Handle -dlopen flags immediately.
2525 for file in $opt_dlopen; do
2526 test -f "$file" \
2527 || func_fatal_help "\`$file' is not a file"
2528
2529 dir=
2530 case $file in
2531 *.la)
2532 func_resolve_sysroot "$file"
2533 file=$func_resolve_sysroot_result
2534
2535 # Check to see that this really is a libtool archive.
2536 func_lalib_unsafe_p "$file" \
2537 || func_fatal_help "\`$lib' is not a valid libtool archive"
2538
2539 # Read the libtool library.
2540 dlname=
2541 library_names=
2542 func_source "$file"
2543
2544 # Skip this library if it cannot be dlopened.
2545 if test -z "$dlname"; then
2546 # Warn if it was a shared library.
2547 test -n "$library_names" && \
2548 func_warning "\`$file' was not linked with \`-export-dynamic'"
2549 continue
2550 fi
2551
2552 func_dirname "$file" "" "."
2553 dir="$func_dirname_result"
2554
2555 if test -f "$dir/$objdir/$dlname"; then
2556 func_append dir "/$objdir"
2557 else
2558 if test ! -f "$dir/$dlname"; then
2559 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2560 fi
2561 fi
2562 ;;
2563
2564 *.lo)
2565 # Just add the directory containing the .lo file.
2566 func_dirname "$file" "" "."
2567 dir="$func_dirname_result"
2568 ;;
2569
2570 *)
2571 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2572 continue
2573 ;;
2574 esac
2575
2576 # Get the absolute pathname.
2577 absdir=`cd "$dir" && pwd`
2578 test -n "$absdir" && dir="$absdir"
2579
2580 # Now add the directory to shlibpath_var.
2581 if eval "test -z \"\$$shlibpath_var\""; then
2582 eval "$shlibpath_var=\"\$dir\""
2583 else
2584 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2585 fi
2586 done
2587
2588 # This variable tells wrapper scripts just to set shlibpath_var
2589 # rather than running their programs.
2590 libtool_execute_magic="$magic"
2591
2592 # Check if any of the arguments is a wrapper script.
2593 args=
2594 for file
2595 do
2596 case $file in
2597 -* | *.la | *.lo ) ;;
2598 *)
2599 # Do a test to see if this is really a libtool program.
2600 if func_ltwrapper_script_p "$file"; then
2601 func_source "$file"
2602 # Transform arg to wrapped name.
2603 file="$progdir/$program"
2604 elif func_ltwrapper_executable_p "$file"; then
2605 func_ltwrapper_scriptname "$file"
2606 func_source "$func_ltwrapper_scriptname_result"
2607 # Transform arg to wrapped name.
2608 file="$progdir/$program"
2609 fi
2610 ;;
2611 esac
2612 # Quote arguments (to preserve shell metacharacters).
2613 func_append_quoted args "$file"
2614 done
2615
2616 if test "X$opt_dry_run" = Xfalse; then
2617 if test -n "$shlibpath_var"; then
2618 # Export the shlibpath_var.
2619 eval "export $shlibpath_var"
2620 fi
2621
2622 # Restore saved environment variables
2623 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2624 do
2625 eval "if test \"\${save_$lt_var+set}\" = set; then
2626 $lt_var=\$save_$lt_var; export $lt_var
2627 else
2628 $lt_unset $lt_var
2629 fi"
2630 done
2631
2632 # Now prepare to actually exec the command.
2633 exec_cmd="\$cmd$args"
2634 else
2635 # Display what would be done.
2636 if test -n "$shlibpath_var"; then
2637 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2638 echo "export $shlibpath_var"
2639 fi
2640 $ECHO "$cmd$args"
2641 exit $EXIT_SUCCESS
2642 fi
2643 }
2644
2645 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
2646
2647
2648 # func_mode_finish arg...
2649 func_mode_finish ()
2650 {
2651 $opt_debug
2652 libs=
2653 libdirs=
2654 admincmds=
2655
2656 for opt in "$nonopt" ${1+"$@"}
2657 do
2658 if test -d "$opt"; then
2659 func_append libdirs " $opt"
2660
2661 elif test -f "$opt"; then
2662 if func_lalib_unsafe_p "$opt"; then
2663 func_append libs " $opt"
2664 else
2665 func_warning "\`$opt' is not a valid libtool archive"
2666 fi
2667
2668 else
2669 func_fatal_error "invalid argument \`$opt'"
2670 fi
2671 done
2672
2673 if test -n "$libs"; then
2674 if test -n "$lt_sysroot"; then
2675 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2676 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2677 else
2678 sysroot_cmd=
2679 fi
2680
2681 # Remove sysroot references
2682 if $opt_dry_run; then
2683 for lib in $libs; do
2684 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
2685 done
2686 else
2687 tmpdir=`func_mktempdir`
2688 for lib in $libs; do
2689 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2690 > $tmpdir/tmp-la
2691 mv -f $tmpdir/tmp-la $lib
2692 done
2693 ${RM}r "$tmpdir"
2694 fi
2695 fi
2696
2697 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2698 for libdir in $libdirs; do
2699 if test -n "$finish_cmds"; then
2700 # Do each command in the finish commands.
2701 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2702 '"$cmd"'"'
2703 fi
2704 if test -n "$finish_eval"; then
2705 # Do the single finish_eval.
2706 eval cmds=\"$finish_eval\"
2707 $opt_dry_run || eval "$cmds" || func_append admincmds "
2708 $cmds"
2709 fi
2710 done
2711 fi
2712
2713 # Exit here if they wanted silent mode.
2714 $opt_silent && exit $EXIT_SUCCESS
2715
2716 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2717 echo "----------------------------------------------------------------------"
2718 echo "Libraries have been installed in:"
2719 for libdir in $libdirs; do
2720 $ECHO " $libdir"
2721 done
2722 echo
2723 echo "If you ever happen to want to link against installed libraries"
2724 echo "in a given directory, LIBDIR, you must either use libtool, and"
2725 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2726 echo "flag during linking and do at least one of the following:"
2727 if test -n "$shlibpath_var"; then
2728 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2729 echo " during execution"
2730 fi
2731 if test -n "$runpath_var"; then
2732 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2733 echo " during linking"
2734 fi
2735 if test -n "$hardcode_libdir_flag_spec"; then
2736 libdir=LIBDIR
2737 eval flag=\"$hardcode_libdir_flag_spec\"
2738
2739 $ECHO " - use the \`$flag' linker flag"
2740 fi
2741 if test -n "$admincmds"; then
2742 $ECHO " - have your system administrator run these commands:$admincmds"
2743 fi
2744 if test -f /etc/ld.so.conf; then
2745 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2746 fi
2747 echo
2748
2749 echo "See any operating system documentation about shared libraries for"
2750 case $host in
2751 solaris2.[6789]|solaris2.1[0-9])
2752 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2753 echo "pages."
2754 ;;
2755 *)
2756 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2757 ;;
2758 esac
2759 echo "----------------------------------------------------------------------"
2760 fi
2761 exit $EXIT_SUCCESS
2762 }
2763
2764 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
2765
2766
2767 # func_mode_install arg...
2768 func_mode_install ()
2769 {
2770 $opt_debug
2771 # There may be an optional sh(1) argument at the beginning of
2772 # install_prog (especially on Windows NT).
2773 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2774 # Allow the use of GNU shtool's install command.
2775 case $nonopt in *shtool*) :;; *) false;; esac; then
2776 # Aesthetically quote it.
2777 func_quote_for_eval "$nonopt"
2778 install_prog="$func_quote_for_eval_result "
2779 arg=$1
2780 shift
2781 else
2782 install_prog=
2783 arg=$nonopt
2784 fi
2785
2786 # The real first argument should be the name of the installation program.
2787 # Aesthetically quote it.
2788 func_quote_for_eval "$arg"
2789 func_append install_prog "$func_quote_for_eval_result"
2790 install_shared_prog=$install_prog
2791 case " $install_prog " in
2792 *[\\\ /]cp\ *) install_cp=: ;;
2793 *) install_cp=false ;;
2794 esac
2795
2796 # We need to accept at least all the BSD install flags.
2797 dest=
2798 files=
2799 opts=
2800 prev=
2801 install_type=
2802 isdir=no
2803 stripme=
2804 no_mode=:
2805 for arg
2806 do
2807 arg2=
2808 if test -n "$dest"; then
2809 func_append files " $dest"
2810 dest=$arg
2811 continue
2812 fi
2813
2814 case $arg in
2815 -d) isdir=yes ;;
2816 -f)
2817 if $install_cp; then :; else
2818 prev=$arg
2819 fi
2820 ;;
2821 -g | -m | -o)
2822 prev=$arg
2823 ;;
2824 -s)
2825 stripme=" -s"
2826 continue
2827 ;;
2828 -*)
2829 ;;
2830 *)
2831 # If the previous option needed an argument, then skip it.
2832 if test -n "$prev"; then
2833 if test "x$prev" = x-m && test -n "$install_override_mode"; then
2834 arg2=$install_override_mode
2835 no_mode=false
2836 fi
2837 prev=
2838 else
2839 dest=$arg
2840 continue
2841 fi
2842 ;;
2843 esac
2844
2845 # Aesthetically quote the argument.
2846 func_quote_for_eval "$arg"
2847 func_append install_prog " $func_quote_for_eval_result"
2848 if test -n "$arg2"; then
2849 func_quote_for_eval "$arg2"
2850 fi
2851 func_append install_shared_prog " $func_quote_for_eval_result"
2852 done
2853
2854 test -z "$install_prog" && \
2855 func_fatal_help "you must specify an install program"
2856
2857 test -n "$prev" && \
2858 func_fatal_help "the \`$prev' option requires an argument"
2859
2860 if test -n "$install_override_mode" && $no_mode; then
2861 if $install_cp; then :; else
2862 func_quote_for_eval "$install_override_mode"
2863 func_append install_shared_prog " -m $func_quote_for_eval_result"
2864 fi
2865 fi
2866
2867 if test -z "$files"; then
2868 if test -z "$dest"; then
2869 func_fatal_help "no file or destination specified"
2870 else
2871 func_fatal_help "you must specify a destination"
2872 fi
2873 fi
2874
2875 # Strip any trailing slash from the destination.
2876 func_stripname '' '/' "$dest"
2877 dest=$func_stripname_result
2878
2879 # Check to see that the destination is a directory.
2880 test -d "$dest" && isdir=yes
2881 if test "$isdir" = yes; then
2882 destdir="$dest"
2883 destname=
2884 else
2885 func_dirname_and_basename "$dest" "" "."
2886 destdir="$func_dirname_result"
2887 destname="$func_basename_result"
2888
2889 # Not a directory, so check to see that there is only one file specified.
2890 set dummy $files; shift
2891 test "$#" -gt 1 && \
2892 func_fatal_help "\`$dest' is not a directory"
2893 fi
2894 case $destdir in
2895 [\\/]* | [A-Za-z]:[\\/]*) ;;
2896 *)
2897 for file in $files; do
2898 case $file in
2899 *.lo) ;;
2900 *)
2901 func_fatal_help "\`$destdir' must be an absolute directory name"
2902 ;;
2903 esac
2904 done
2905 ;;
2906 esac
2907
2908 # This variable tells wrapper scripts just to set variables rather
2909 # than running their programs.
2910 libtool_install_magic="$magic"
2911
2912 staticlibs=
2913 future_libdirs=
2914 current_libdirs=
2915 for file in $files; do
2916
2917 # Do each installation.
2918 case $file in
2919 *.$libext)
2920 # Do the static libraries later.
2921 func_append staticlibs " $file"
2922 ;;
2923
2924 *.la)
2925 func_resolve_sysroot "$file"
2926 file=$func_resolve_sysroot_result
2927
2928 # Check to see that this really is a libtool archive.
2929 func_lalib_unsafe_p "$file" \
2930 || func_fatal_help "\`$file' is not a valid libtool archive"
2931
2932 library_names=
2933 old_library=
2934 relink_command=
2935 func_source "$file"
2936
2937 # Add the libdir to current_libdirs if it is the destination.
2938 if test "X$destdir" = "X$libdir"; then
2939 case "$current_libdirs " in
2940 *" $libdir "*) ;;
2941 *) func_append current_libdirs " $libdir" ;;
2942 esac
2943 else
2944 # Note the libdir as a future libdir.
2945 case "$future_libdirs " in
2946 *" $libdir "*) ;;
2947 *) func_append future_libdirs " $libdir" ;;
2948 esac
2949 fi
2950
2951 func_dirname "$file" "/" ""
2952 dir="$func_dirname_result"
2953 func_append dir "$objdir"
2954
2955 if test -n "$relink_command"; then
2956 # Determine the prefix the user has applied to our future dir.
2957 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2958
2959 # Don't allow the user to place us outside of our expected
2960 # location b/c this prevents finding dependent libraries that
2961 # are installed to the same prefix.
2962 # At present, this check doesn't affect windows .dll's that
2963 # are installed into $libdir/../bin (currently, that works fine)
2964 # but it's something to keep an eye on.
2965 test "$inst_prefix_dir" = "$destdir" && \
2966 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2967
2968 if test -n "$inst_prefix_dir"; then
2969 # Stick the inst_prefix_dir data into the link command.
2970 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2971 else
2972 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2973 fi
2974
2975 func_warning "relinking \`$file'"
2976 func_show_eval "$relink_command" \
2977 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2978 fi
2979
2980 # See the names of the shared library.
2981 set dummy $library_names; shift
2982 if test -n "$1"; then
2983 realname="$1"
2984 shift
2985
2986 srcname="$realname"
2987 test -n "$relink_command" && srcname="$realname"T
2988
2989 # Install the shared library and build the symlinks.
2990 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2991 'exit $?'
2992 tstripme="$stripme"
2993 case $host_os in
2994 cygwin* | mingw* | pw32* | cegcc*)
2995 case $realname in
2996 *.dll.a)
2997 tstripme=""
2998 ;;
2999 esac
3000 ;;
3001 esac
3002 if test -n "$tstripme" && test -n "$striplib"; then
3003 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3004 fi
3005
3006 if test "$#" -gt 0; then
3007 # Delete the old symlinks, and create new ones.
3008 # Try `ln -sf' first, because the `ln' binary might depend on
3009 # the symlink we replace! Solaris /bin/ln does not understand -f,
3010 # so we also need to try rm && ln -s.
3011 for linkname
3012 do
3013 test "$linkname" != "$realname" \
3014 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3015 done
3016 fi
3017
3018 # Do each command in the postinstall commands.
3019 lib="$destdir/$realname"
3020 func_execute_cmds "$postinstall_cmds" 'exit $?'
3021 fi
3022
3023 # Install the pseudo-library for information purposes.
3024 func_basename "$file"
3025 name="$func_basename_result"
3026 instname="$dir/$name"i
3027 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3028
3029 # Maybe install the static library, too.
3030 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3031 ;;
3032
3033 *.lo)
3034 # Install (i.e. copy) a libtool object.
3035
3036 # Figure out destination file name, if it wasn't already specified.
3037 if test -n "$destname"; then
3038 destfile="$destdir/$destname"
3039 else
3040 func_basename "$file"
3041 destfile="$func_basename_result"
3042 destfile="$destdir/$destfile"
3043 fi
3044
3045 # Deduce the name of the destination old-style object file.
3046 case $destfile in
3047 *.lo)
3048 func_lo2o "$destfile"
3049 staticdest=$func_lo2o_result
3050 ;;
3051 *.$objext)
3052 staticdest="$destfile"
3053 destfile=
3054 ;;
3055 *)
3056 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3057 ;;
3058 esac
3059
3060 # Install the libtool object if requested.
3061 test -n "$destfile" && \
3062 func_show_eval "$install_prog $file $destfile" 'exit $?'
3063
3064 # Install the old object if enabled.
3065 if test "$build_old_libs" = yes; then
3066 # Deduce the name of the old-style object file.
3067 func_lo2o "$file"
3068 staticobj=$func_lo2o_result
3069 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3070 fi
3071 exit $EXIT_SUCCESS
3072 ;;
3073
3074 *)
3075 # Figure out destination file name, if it wasn't already specified.
3076 if test -n "$destname"; then
3077 destfile="$destdir/$destname"
3078 else
3079 func_basename "$file"
3080 destfile="$func_basename_result"
3081 destfile="$destdir/$destfile"
3082 fi
3083
3084 # If the file is missing, and there is a .exe on the end, strip it
3085 # because it is most likely a libtool script we actually want to
3086 # install
3087 stripped_ext=""
3088 case $file in
3089 *.exe)
3090 if test ! -f "$file"; then
3091 func_stripname '' '.exe' "$file"
3092 file=$func_stripname_result
3093 stripped_ext=".exe"
3094 fi
3095 ;;
3096 esac
3097
3098 # Do a test to see if this is really a libtool program.
3099 case $host in
3100 *cygwin* | *mingw*)
3101 if func_ltwrapper_executable_p "$file"; then
3102 func_ltwrapper_scriptname "$file"
3103 wrapper=$func_ltwrapper_scriptname_result
3104 else
3105 func_stripname '' '.exe' "$file"
3106 wrapper=$func_stripname_result
3107 fi
3108 ;;
3109 *)
3110 wrapper=$file
3111 ;;
3112 esac
3113 if func_ltwrapper_script_p "$wrapper"; then
3114 notinst_deplibs=
3115 relink_command=
3116
3117 func_source "$wrapper"
3118
3119 # Check the variables that should have been set.
3120 test -z "$generated_by_libtool_version" && \
3121 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3122
3123 finalize=yes
3124 for lib in $notinst_deplibs; do
3125 # Check to see that each library is installed.
3126 libdir=
3127 if test -f "$lib"; then
3128 func_source "$lib"
3129 fi
3130 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3131 if test -n "$libdir" && test ! -f "$libfile"; then
3132 func_warning "\`$lib' has not been installed in \`$libdir'"
3133 finalize=no
3134 fi
3135 done
3136
3137 relink_command=
3138 func_source "$wrapper"
3139
3140 outputname=
3141 if test "$fast_install" = no && test -n "$relink_command"; then
3142 $opt_dry_run || {
3143 if test "$finalize" = yes; then
3144 tmpdir=`func_mktempdir`
3145 func_basename "$file$stripped_ext"
3146 file="$func_basename_result"
3147 outputname="$tmpdir/$file"
3148 # Replace the output file specification.
3149 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3150
3151 $opt_silent || {
3152 func_quote_for_expand "$relink_command"
3153 eval "func_echo $func_quote_for_expand_result"
3154 }
3155 if eval "$relink_command"; then :
3156 else
3157 func_error "error: relink \`$file' with the above command before installing it"
3158 $opt_dry_run || ${RM}r "$tmpdir"
3159 continue
3160 fi
3161 file="$outputname"
3162 else
3163 func_warning "cannot relink \`$file'"
3164 fi
3165 }
3166 else
3167 # Install the binary that we compiled earlier.
3168 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3169 fi
3170 fi
3171
3172 # remove .exe since cygwin /usr/bin/install will append another
3173 # one anyway
3174 case $install_prog,$host in
3175 */usr/bin/install*,*cygwin*)
3176 case $file:$destfile in
3177 *.exe:*.exe)
3178 # this is ok
3179 ;;
3180 *.exe:*)
3181 destfile=$destfile.exe
3182 ;;
3183 *:*.exe)
3184 func_stripname '' '.exe' "$destfile"
3185 destfile=$func_stripname_result
3186 ;;
3187 esac
3188 ;;
3189 esac
3190 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3191 $opt_dry_run || if test -n "$outputname"; then
3192 ${RM}r "$tmpdir"
3193 fi
3194 ;;
3195 esac
3196 done
3197
3198 for file in $staticlibs; do
3199 func_basename "$file"
3200 name="$func_basename_result"
3201
3202 # Set up the ranlib parameters.
3203 oldlib="$destdir/$name"
3204 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3205 tool_oldlib=$func_to_tool_file_result
3206
3207 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3208
3209 if test -n "$stripme" && test -n "$old_striplib"; then
3210 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
3211 fi
3212
3213 # Do each command in the postinstall commands.
3214 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3215 done
3216
3217 test -n "$future_libdirs" && \
3218 func_warning "remember to run \`$progname --finish$future_libdirs'"
3219
3220 if test -n "$current_libdirs"; then
3221 # Maybe just do a dry run.
3222 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3223 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3224 else
3225 exit $EXIT_SUCCESS
3226 fi
3227 }
3228
3229 test "$opt_mode" = install && func_mode_install ${1+"$@"}
3230
3231
3232 # func_generate_dlsyms outputname originator pic_p
3233 # Extract symbols from dlprefiles and create ${outputname}S.o with
3234 # a dlpreopen symbol table.
3235 func_generate_dlsyms ()
3236 {
3237 $opt_debug
3238 my_outputname="$1"
3239 my_originator="$2"
3240 my_pic_p="${3-no}"
3241 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3242 my_dlsyms=
3243
3244 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3245 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3246 my_dlsyms="${my_outputname}S.c"
3247 else
3248 func_error "not configured to extract global symbols from dlpreopened files"
3249 fi
3250 fi
3251
3252 if test -n "$my_dlsyms"; then
3253 case $my_dlsyms in
3254 "") ;;
3255 *.c)
3256 # Discover the nlist of each of the dlfiles.
3257 nlist="$output_objdir/${my_outputname}.nm"
3258
3259 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3260
3261 # Parse the name list into a source file.
3262 func_verbose "creating $output_objdir/$my_dlsyms"
3263
3264 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3265 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3266 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3267
3268 #ifdef __cplusplus
3269 extern \"C\" {
3270 #endif
3271
3272 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3273 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3274 #endif
3275
3276 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3277 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3278 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3279 relocations are performed -- see ld's documentation on pseudo-relocs. */
3280 # define LT_DLSYM_CONST
3281 #elif defined(__osf__)
3282 /* This system does not cope well with relocations in const data. */
3283 # define LT_DLSYM_CONST
3284 #else
3285 # define LT_DLSYM_CONST const
3286 #endif
3287
3288 /* External symbol declarations for the compiler. */\
3289 "
3290
3291 if test "$dlself" = yes; then
3292 func_verbose "generating symbol list for \`$output'"
3293
3294 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3295
3296 # Add our own program objects to the symbol list.
3297 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3298 for progfile in $progfiles; do
3299 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3300 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3301 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3302 done
3303
3304 if test -n "$exclude_expsyms"; then
3305 $opt_dry_run || {
3306 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3307 eval '$MV "$nlist"T "$nlist"'
3308 }
3309 fi
3310
3311 if test -n "$export_symbols_regex"; then
3312 $opt_dry_run || {
3313 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3314 eval '$MV "$nlist"T "$nlist"'
3315 }
3316 fi
3317
3318 # Prepare the list of exported symbols
3319 if test -z "$export_symbols"; then
3320 export_symbols="$output_objdir/$outputname.exp"
3321 $opt_dry_run || {
3322 $RM $export_symbols
3323 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3324 case $host in
3325 *cygwin* | *mingw* | *cegcc* )
3326 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3327 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3328 ;;
3329 esac
3330 }
3331 else
3332 $opt_dry_run || {
3333 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3334 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3335 eval '$MV "$nlist"T "$nlist"'
3336 case $host in
3337 *cygwin* | *mingw* | *cegcc* )
3338 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3339 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3340 ;;
3341 esac
3342 }
3343 fi
3344 fi
3345
3346 for dlprefile in $dlprefiles; do
3347 func_verbose "extracting global C symbols from \`$dlprefile'"
3348 func_basename "$dlprefile"
3349 name="$func_basename_result"
3350 case $host in
3351 *cygwin* | *mingw* | *cegcc* )
3352 # if an import library, we need to obtain dlname
3353 if func_win32_import_lib_p "$dlprefile"; then
3354 func_tr_sh "$dlprefile"
3355 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3356 dlprefile_dlbasename=""
3357 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3358 # Use subshell, to avoid clobbering current variable values
3359 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3360 if test -n "$dlprefile_dlname" ; then
3361 func_basename "$dlprefile_dlname"
3362 dlprefile_dlbasename="$func_basename_result"
3363 else
3364 # no lafile. user explicitly requested -dlpreopen <import library>.
3365 $sharedlib_from_linklib_cmd "$dlprefile"
3366 dlprefile_dlbasename=$sharedlib_from_linklib_result
3367 fi
3368 fi
3369 $opt_dry_run || {
3370 if test -n "$dlprefile_dlbasename" ; then
3371 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3372 else
3373 func_warning "Could not compute DLL name from $name"
3374 eval '$ECHO ": $name " >> "$nlist"'
3375 fi
3376 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3377 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3378 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3379 }
3380 else # not an import lib
3381 $opt_dry_run || {
3382 eval '$ECHO ": $name " >> "$nlist"'
3383 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3384 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3385 }
3386 fi
3387 ;;
3388 *)
3389 $opt_dry_run || {
3390 eval '$ECHO ": $name " >> "$nlist"'
3391 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3392 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3393 }
3394 ;;
3395 esac
3396 done
3397
3398 $opt_dry_run || {
3399 # Make sure we have at least an empty file.
3400 test -f "$nlist" || : > "$nlist"
3401
3402 if test -n "$exclude_expsyms"; then
3403 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3404 $MV "$nlist"T "$nlist"
3405 fi
3406
3407 # Try sorting and uniquifying the output.
3408 if $GREP -v "^: " < "$nlist" |
3409 if sort -k 3 </dev/null >/dev/null 2>&1; then
3410 sort -k 3
3411 else
3412 sort +2
3413 fi |
3414 uniq > "$nlist"S; then
3415 :
3416 else
3417 $GREP -v "^: " < "$nlist" > "$nlist"S
3418 fi
3419
3420 if test -f "$nlist"S; then
3421 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3422 else
3423 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3424 fi
3425
3426 echo >> "$output_objdir/$my_dlsyms" "\
3427
3428 /* The mapping between symbol names and symbols. */
3429 typedef struct {
3430 const char *name;
3431 void *address;
3432 } lt_dlsymlist;
3433 extern LT_DLSYM_CONST lt_dlsymlist
3434 lt_${my_prefix}_LTX_preloaded_symbols[];
3435 LT_DLSYM_CONST lt_dlsymlist
3436 lt_${my_prefix}_LTX_preloaded_symbols[] =
3437 {\
3438 { \"$my_originator\", (void *) 0 },"
3439
3440 case $need_lib_prefix in
3441 no)
3442 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3443 ;;
3444 *)
3445 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3446 ;;
3447 esac
3448 echo >> "$output_objdir/$my_dlsyms" "\
3449 {0, (void *) 0}
3450 };
3451
3452 /* This works around a problem in FreeBSD linker */
3453 #ifdef FREEBSD_WORKAROUND
3454 static const void *lt_preloaded_setup() {
3455 return lt_${my_prefix}_LTX_preloaded_symbols;
3456 }
3457 #endif
3458
3459 #ifdef __cplusplus
3460 }
3461 #endif\
3462 "
3463 } # !$opt_dry_run
3464
3465 pic_flag_for_symtable=
3466 case "$compile_command " in
3467 *" -static "*) ;;
3468 *)
3469 case $host in
3470 # compiling the symbol table file with pic_flag works around
3471 # a FreeBSD bug that causes programs to crash when -lm is
3472 # linked before any other PIC object. But we must not use
3473 # pic_flag when linking with -static. The problem exists in
3474 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3475 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3476 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3477 *-*-hpux*)
3478 pic_flag_for_symtable=" $pic_flag" ;;
3479 *)
3480 if test "X$my_pic_p" != Xno; then
3481 pic_flag_for_symtable=" $pic_flag"
3482 fi
3483 ;;
3484 esac
3485 ;;
3486 esac
3487 symtab_cflags=
3488 for arg in $LTCFLAGS; do
3489 case $arg in
3490 -pie | -fpie | -fPIE) ;;
3491 *) func_append symtab_cflags " $arg" ;;
3492 esac
3493 done
3494
3495 # Now compile the dynamic symbol file.
3496 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3497
3498 # Clean up the generated files.
3499 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3500
3501 # Transform the symbol file into the correct name.
3502 symfileobj="$output_objdir/${my_outputname}S.$objext"
3503 case $host in
3504 *cygwin* | *mingw* | *cegcc* )
3505 if test -f "$output_objdir/$my_outputname.def"; then
3506 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3507 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3508 else
3509 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3510 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3511 fi
3512 ;;
3513 *)
3514 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3515 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3516 ;;
3517 esac
3518 ;;
3519 *)
3520 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3521 ;;
3522 esac
3523 else
3524 # We keep going just in case the user didn't refer to
3525 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3526 # really was required.
3527
3528 # Nullify the symbol file.
3529 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3530 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3531 fi
3532 }
3533
3534 # func_win32_libid arg
3535 # return the library type of file 'arg'
3536 #
3537 # Need a lot of goo to handle *both* DLLs and import libs
3538 # Has to be a shell function in order to 'eat' the argument
3539 # that is supplied when $file_magic_command is called.
3540 # Despite the name, also deal with 64 bit binaries.
3541 func_win32_libid ()
3542 {
3543 $opt_debug
3544 win32_libid_type="unknown"
3545 win32_fileres=`file -L $1 2>/dev/null`
3546 case $win32_fileres in
3547 *ar\ archive\ import\ library*) # definitely import
3548 win32_libid_type="x86 archive import"
3549 ;;
3550 *ar\ archive*) # could be an import, or static
3551 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3552 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3553 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3554 func_to_tool_file "$1" func_convert_file_msys_to_w32
3555 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3556 $SED -n -e '
3557 1,100{
3558 / I /{
3559 s,.*,import,
3560 p
3561 q
3562 }
3563 }'`
3564 case $win32_nmres in
3565 import*) win32_libid_type="x86 archive import";;
3566 *) win32_libid_type="x86 archive static";;
3567 esac
3568 fi
3569 ;;
3570 *DLL*)
3571 win32_libid_type="x86 DLL"
3572 ;;
3573 *executable*) # but shell scripts are "executable" too...
3574 case $win32_fileres in
3575 *MS\ Windows\ PE\ Intel*)
3576 win32_libid_type="x86 DLL"
3577 ;;
3578 esac
3579 ;;
3580 esac
3581 $ECHO "$win32_libid_type"
3582 }
3583
3584 # func_cygming_dll_for_implib ARG
3585 #
3586 # Platform-specific function to extract the
3587 # name of the DLL associated with the specified
3588 # import library ARG.
3589 # Invoked by eval'ing the libtool variable
3590 # $sharedlib_from_linklib_cmd
3591 # Result is available in the variable
3592 # $sharedlib_from_linklib_result
3593 func_cygming_dll_for_implib ()
3594 {
3595 $opt_debug
3596 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3597 }
3598
3599 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3600 #
3601 # The is the core of a fallback implementation of a
3602 # platform-specific function to extract the name of the
3603 # DLL associated with the specified import library LIBNAME.
3604 #
3605 # SECTION_NAME is either .idata$6 or .idata$7, depending
3606 # on the platform and compiler that created the implib.
3607 #
3608 # Echos the name of the DLL associated with the
3609 # specified import library.
3610 func_cygming_dll_for_implib_fallback_core ()
3611 {
3612 $opt_debug
3613 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3614 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3615 $SED '/^Contents of section '"$match_literal"':/{
3616 # Place marker at beginning of archive member dllname section
3617 s/.*/====MARK====/
3618 p
3619 d
3620 }
3621 # These lines can sometimes be longer than 43 characters, but
3622 # are always uninteresting
3623 /:[ ]*file format pe[i]\{,1\}-/d
3624 /^In archive [^:]*:/d
3625 # Ensure marker is printed
3626 /^====MARK====/p
3627 # Remove all lines with less than 43 characters
3628 /^.\{43\}/!d
3629 # From remaining lines, remove first 43 characters
3630 s/^.\{43\}//' |
3631 $SED -n '
3632 # Join marker and all lines until next marker into a single line
3633 /^====MARK====/ b para
3634 H
3635 $ b para
3636 b
3637 :para
3638 x
3639 s/\n//g
3640 # Remove the marker
3641 s/^====MARK====//
3642 # Remove trailing dots and whitespace
3643 s/[\. \t]*$//
3644 # Print
3645 /./p' |
3646 # we now have a list, one entry per line, of the stringified
3647 # contents of the appropriate section of all members of the
3648 # archive which possess that section. Heuristic: eliminate
3649 # all those which have a first or second character that is
3650 # a '.' (that is, objdump's representation of an unprintable
3651 # character.) This should work for all archives with less than
3652 # 0x302f exports -- but will fail for DLLs whose name actually
3653 # begins with a literal '.' or a single character followed by
3654 # a '.'.
3655 #
3656 # Of those that remain, print the first one.
3657 $SED -e '/^\./d;/^.\./d;q'
3658 }
3659
3660 # func_cygming_gnu_implib_p ARG
3661 # This predicate returns with zero status (TRUE) if
3662 # ARG is a GNU/binutils-style import library. Returns
3663 # with nonzero status (FALSE) otherwise.
3664 func_cygming_gnu_implib_p ()
3665 {
3666 $opt_debug
3667 func_to_tool_file "$1" func_convert_file_msys_to_w32
3668 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3669 test -n "$func_cygming_gnu_implib_tmp"
3670 }
3671
3672 # func_cygming_ms_implib_p ARG
3673 # This predicate returns with zero status (TRUE) if
3674 # ARG is an MS-style import library. Returns
3675 # with nonzero status (FALSE) otherwise.
3676 func_cygming_ms_implib_p ()
3677 {
3678 $opt_debug
3679 func_to_tool_file "$1" func_convert_file_msys_to_w32
3680 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3681 test -n "$func_cygming_ms_implib_tmp"
3682 }
3683
3684 # func_cygming_dll_for_implib_fallback ARG
3685 # Platform-specific function to extract the
3686 # name of the DLL associated with the specified
3687 # import library ARG.
3688 #
3689 # This fallback implementation is for use when $DLLTOOL
3690 # does not support the --identify-strict option.
3691 # Invoked by eval'ing the libtool variable
3692 # $sharedlib_from_linklib_cmd
3693 # Result is available in the variable
3694 # $sharedlib_from_linklib_result
3695 func_cygming_dll_for_implib_fallback ()
3696 {
3697 $opt_debug
3698 if func_cygming_gnu_implib_p "$1" ; then
3699 # binutils import library
3700 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3701 elif func_cygming_ms_implib_p "$1" ; then
3702 # ms-generated import library
3703 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3704 else
3705 # unknown
3706 sharedlib_from_linklib_result=""
3707 fi
3708 }
3709
3710
3711 # func_extract_an_archive dir oldlib
3712 func_extract_an_archive ()
3713 {
3714 $opt_debug
3715 f_ex_an_ar_dir="$1"; shift
3716 f_ex_an_ar_oldlib="$1"
3717 if test "$lock_old_archive_extraction" = yes; then
3718 lockfile=$f_ex_an_ar_oldlib.lock
3719 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3720 func_echo "Waiting for $lockfile to be removed"
3721 sleep 2
3722 done
3723 fi
3724 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3725 'stat=$?; rm -f "$lockfile"; exit $stat'
3726 if test "$lock_old_archive_extraction" = yes; then
3727 $opt_dry_run || rm -f "$lockfile"
3728 fi
3729 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3730 :
3731 else
3732 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3733 fi
3734 }
3735
3736
3737 # func_extract_archives gentop oldlib ...
3738 func_extract_archives ()
3739 {
3740 $opt_debug
3741 my_gentop="$1"; shift
3742 my_oldlibs=${1+"$@"}
3743 my_oldobjs=""
3744 my_xlib=""
3745 my_xabs=""
3746 my_xdir=""
3747
3748 for my_xlib in $my_oldlibs; do
3749 # Extract the objects.
3750 case $my_xlib in
3751 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3752 *) my_xabs=`pwd`"/$my_xlib" ;;
3753 esac
3754 func_basename "$my_xlib"
3755 my_xlib="$func_basename_result"
3756 my_xlib_u=$my_xlib
3757 while :; do
3758 case " $extracted_archives " in
3759 *" $my_xlib_u "*)
3760 func_arith $extracted_serial + 1
3761 extracted_serial=$func_arith_result
3762 my_xlib_u=lt$extracted_serial-$my_xlib ;;
3763 *) break ;;
3764 esac
3765 done
3766 extracted_archives="$extracted_archives $my_xlib_u"
3767 my_xdir="$my_gentop/$my_xlib_u"
3768
3769 func_mkdir_p "$my_xdir"
3770
3771 case $host in
3772 *-darwin*)
3773 func_verbose "Extracting $my_xabs"
3774 # Do not bother doing anything if just a dry run
3775 $opt_dry_run || {
3776 darwin_orig_dir=`pwd`
3777 cd $my_xdir || exit $?
3778 darwin_archive=$my_xabs
3779 darwin_curdir=`pwd`
3780 darwin_base_archive=`basename "$darwin_archive"`
3781 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3782 if test -n "$darwin_arches"; then
3783 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3784 darwin_arch=
3785 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3786 for darwin_arch in $darwin_arches ; do
3787 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3788 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3789 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3790 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3791 cd "$darwin_curdir"
3792 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3793 done # $darwin_arches
3794 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3795 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3796 darwin_file=
3797 darwin_files=
3798 for darwin_file in $darwin_filelist; do
3799 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
3800 $LIPO -create -output "$darwin_file" $darwin_files
3801 done # $darwin_filelist
3802 $RM -rf unfat-$$
3803 cd "$darwin_orig_dir"
3804 else
3805 cd $darwin_orig_dir
3806 func_extract_an_archive "$my_xdir" "$my_xabs"
3807 fi # $darwin_arches
3808 } # !$opt_dry_run
3809 ;;
3810 *)
3811 func_extract_an_archive "$my_xdir" "$my_xabs"
3812 ;;
3813 esac
3814 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
3815 done
3816
3817 func_extract_archives_result="$my_oldobjs"
3818 }
3819
3820
3821 # func_emit_wrapper [arg=no]
3822 #
3823 # Emit a libtool wrapper script on stdout.
3824 # Don't directly open a file because we may want to
3825 # incorporate the script contents within a cygwin/mingw
3826 # wrapper executable. Must ONLY be called from within
3827 # func_mode_link because it depends on a number of variables
3828 # set therein.
3829 #
3830 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3831 # variable will take. If 'yes', then the emitted script
3832 # will assume that the directory in which it is stored is
3833 # the $objdir directory. This is a cygwin/mingw-specific
3834 # behavior.
3835 func_emit_wrapper ()
3836 {
3837 func_emit_wrapper_arg1=${1-no}
3838
3839 $ECHO "\
3840 #! $SHELL
3841
3842 # $output - temporary wrapper script for $objdir/$outputname
3843 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3844 #
3845 # The $output program cannot be directly executed until all the libtool
3846 # libraries that it depends on are installed.
3847 #
3848 # This wrapper script should never be moved out of the build directory.
3849 # If it is, it will not operate correctly.
3850
3851 # Sed substitution that helps us do robust quoting. It backslashifies
3852 # metacharacters that are still active within double-quoted strings.
3853 sed_quote_subst='$sed_quote_subst'
3854
3855 # Be Bourne compatible
3856 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3857 emulate sh
3858 NULLCMD=:
3859 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3860 # is contrary to our usage. Disable this feature.
3861 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3862 setopt NO_GLOB_SUBST
3863 else
3864 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3865 fi
3866 BIN_SH=xpg4; export BIN_SH # for Tru64
3867 DUALCASE=1; export DUALCASE # for MKS sh
3868
3869 # The HP-UX ksh and POSIX shell print the target directory to stdout
3870 # if CDPATH is set.
3871 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3872
3873 relink_command=\"$relink_command\"
3874
3875 # This environment variable determines our operation mode.
3876 if test \"\$libtool_install_magic\" = \"$magic\"; then
3877 # install mode needs the following variables:
3878 generated_by_libtool_version='$macro_version'
3879 notinst_deplibs='$notinst_deplibs'
3880 else
3881 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3882 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3883 file=\"\$0\""
3884
3885 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3886 $ECHO "\
3887
3888 # A function that is used when there is no print builtin or printf.
3889 func_fallback_echo ()
3890 {
3891 eval 'cat <<_LTECHO_EOF
3892 \$1
3893 _LTECHO_EOF'
3894 }
3895 ECHO=\"$qECHO\"
3896 fi
3897
3898 # Very basic option parsing. These options are (a) specific to
3899 # the libtool wrapper, (b) are identical between the wrapper
3900 # /script/ and the wrapper /executable/ which is used only on
3901 # windows platforms, and (c) all begin with the string "--lt-"
3902 # (application programs are unlikely to have options which match
3903 # this pattern).
3904 #
3905 # There are only two supported options: --lt-debug and
3906 # --lt-dump-script. There is, deliberately, no --lt-help.
3907 #
3908 # The first argument to this parsing function should be the
3909 # script's $0 value, followed by "$@".
3910 lt_option_debug=
3911 func_parse_lt_options ()
3912 {
3913 lt_script_arg0=\$0
3914 shift
3915 for lt_opt
3916 do
3917 case \"\$lt_opt\" in
3918 --lt-debug) lt_option_debug=1 ;;
3919 --lt-dump-script)
3920 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3921 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3922 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3923 cat \"\$lt_dump_D/\$lt_dump_F\"
3924 exit 0
3925 ;;
3926 --lt-*)
3927 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3928 exit 1
3929 ;;
3930 esac
3931 done
3932
3933 # Print the debug banner immediately:
3934 if test -n \"\$lt_option_debug\"; then
3935 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3936 fi
3937 }
3938
3939 # Used when --lt-debug. Prints its arguments to stdout
3940 # (redirection is the responsibility of the caller)
3941 func_lt_dump_args ()
3942 {
3943 lt_dump_args_N=1;
3944 for lt_arg
3945 do
3946 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3947 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3948 done
3949 }
3950
3951 # Core function for launching the target application
3952 func_exec_program_core ()
3953 {
3954 "
3955 case $host in
3956 # Backslashes separate directories on plain windows
3957 *-*-mingw | *-*-os2* | *-cegcc*)
3958 $ECHO "\
3959 if test -n \"\$lt_option_debug\"; then
3960 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3961 func_lt_dump_args \${1+\"\$@\"} 1>&2
3962 fi
3963 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3964 "
3965 ;;
3966
3967 *)
3968 $ECHO "\
3969 if test -n \"\$lt_option_debug\"; then
3970 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3971 func_lt_dump_args \${1+\"\$@\"} 1>&2
3972 fi
3973 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3974 "
3975 ;;
3976 esac
3977 $ECHO "\
3978 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3979 exit 1
3980 }
3981
3982 # A function to encapsulate launching the target application
3983 # Strips options in the --lt-* namespace from \$@ and
3984 # launches target application with the remaining arguments.
3985 func_exec_program ()
3986 {
3987 case \" \$* \" in
3988 *\\ --lt-*)
3989 for lt_wr_arg
3990 do
3991 case \$lt_wr_arg in
3992 --lt-*) ;;
3993 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3994 esac
3995 shift
3996 done ;;
3997 esac
3998 func_exec_program_core \${1+\"\$@\"}
3999 }
4000
4001 # Parse options
4002 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4003
4004 # Find the directory that this script lives in.
4005 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4006 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4007
4008 # Follow symbolic links until we get to the real thisdir.
4009 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4010 while test -n \"\$file\"; do
4011 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4012
4013 # If there was a directory component, then change thisdir.
4014 if test \"x\$destdir\" != \"x\$file\"; then
4015 case \"\$destdir\" in
4016 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4017 *) thisdir=\"\$thisdir/\$destdir\" ;;
4018 esac
4019 fi
4020
4021 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4022 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4023 done
4024
4025 # Usually 'no', except on cygwin/mingw when embedded into
4026 # the cwrapper.
4027 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4028 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4029 # special case for '.'
4030 if test \"\$thisdir\" = \".\"; then
4031 thisdir=\`pwd\`
4032 fi
4033 # remove .libs from thisdir
4034 case \"\$thisdir\" in
4035 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4036 $objdir ) thisdir=. ;;
4037 esac
4038 fi
4039
4040 # Try to get the absolute directory name.
4041 absdir=\`cd \"\$thisdir\" && pwd\`
4042 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4043 "
4044
4045 if test "$fast_install" = yes; then
4046 $ECHO "\
4047 program=lt-'$outputname'$exeext
4048 progdir=\"\$thisdir/$objdir\"
4049
4050 if test ! -f \"\$progdir/\$program\" ||
4051 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4052 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4053
4054 file=\"\$\$-\$program\"
4055
4056 if test ! -d \"\$progdir\"; then
4057 $MKDIR \"\$progdir\"
4058 else
4059 $RM \"\$progdir/\$file\"
4060 fi"
4061
4062 $ECHO "\
4063
4064 # relink executable if necessary
4065 if test -n \"\$relink_command\"; then
4066 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4067 else
4068 $ECHO \"\$relink_command_output\" >&2
4069 $RM \"\$progdir/\$file\"
4070 exit 1
4071 fi
4072 fi
4073
4074 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4075 { $RM \"\$progdir/\$program\";
4076 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4077 $RM \"\$progdir/\$file\"
4078 fi"
4079 else
4080 $ECHO "\
4081 program='$outputname'
4082 progdir=\"\$thisdir/$objdir\"
4083 "
4084 fi
4085
4086 $ECHO "\
4087
4088 if test -f \"\$progdir/\$program\"; then"
4089
4090 # fixup the dll searchpath if we need to.
4091 #
4092 # Fix the DLL searchpath if we need to. Do this before prepending
4093 # to shlibpath, because on Windows, both are PATH and uninstalled
4094 # libraries must come first.
4095 if test -n "$dllsearchpath"; then
4096 $ECHO "\
4097 # Add the dll search path components to the executable PATH
4098 PATH=$dllsearchpath:\$PATH
4099 "
4100 fi
4101
4102 # Export our shlibpath_var if we have one.
4103 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4104 $ECHO "\
4105 # Add our own library path to $shlibpath_var
4106 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4107
4108 # Some systems cannot cope with colon-terminated $shlibpath_var
4109 # The second colon is a workaround for a bug in BeOS R4 sed
4110 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4111
4112 export $shlibpath_var
4113 "
4114 fi
4115
4116 $ECHO "\
4117 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4118 # Run the actual program with our arguments.
4119 func_exec_program \${1+\"\$@\"}
4120 fi
4121 else
4122 # The program doesn't exist.
4123 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4124 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4125 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4126 exit 1
4127 fi
4128 fi\
4129 "
4130 }
4131
4132
4133 # func_emit_cwrapperexe_src
4134 # emit the source code for a wrapper executable on stdout
4135 # Must ONLY be called from within func_mode_link because
4136 # it depends on a number of variable set therein.
4137 func_emit_cwrapperexe_src ()
4138 {
4139 cat <<EOF
4140
4141 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4142 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4143
4144 The $output program cannot be directly executed until all the libtool
4145 libraries that it depends on are installed.
4146
4147 This wrapper executable should never be moved out of the build directory.
4148 If it is, it will not operate correctly.
4149 */
4150 EOF
4151 cat <<"EOF"
4152 #ifdef _MSC_VER
4153 # define _CRT_SECURE_NO_DEPRECATE 1
4154 #endif
4155 #include <stdio.h>
4156 #include <stdlib.h>
4157 #ifdef _MSC_VER
4158 # include <direct.h>
4159 # include <process.h>
4160 # include <io.h>
4161 #else
4162 # include <unistd.h>
4163 # include <stdint.h>
4164 # ifdef __CYGWIN__
4165 # include <io.h>
4166 # endif
4167 #endif
4168 #include <malloc.h>
4169 #include <stdarg.h>
4170 #include <assert.h>
4171 #include <string.h>
4172 #include <ctype.h>
4173 #include <errno.h>
4174 #include <fcntl.h>
4175 #include <sys/stat.h>
4176
4177 /* declarations of non-ANSI functions */
4178 #if defined(__MINGW32__)
4179 # ifdef __STRICT_ANSI__
4180 int _putenv (const char *);
4181 # endif
4182 #elif defined(__CYGWIN__)
4183 # ifdef __STRICT_ANSI__
4184 char *realpath (const char *, char *);
4185 int putenv (char *);
4186 int setenv (const char *, const char *, int);
4187 # endif
4188 /* #elif defined (other platforms) ... */
4189 #endif
4190
4191 /* portability defines, excluding path handling macros */
4192 #if defined(_MSC_VER)
4193 # define setmode _setmode
4194 # define stat _stat
4195 # define chmod _chmod
4196 # define getcwd _getcwd
4197 # define putenv _putenv
4198 # define S_IXUSR _S_IEXEC
4199 # ifndef _INTPTR_T_DEFINED
4200 # define _INTPTR_T_DEFINED
4201 # define intptr_t int
4202 # endif
4203 #elif defined(__MINGW32__)
4204 # define setmode _setmode
4205 # define stat _stat
4206 # define chmod _chmod
4207 # define getcwd _getcwd
4208 # define putenv _putenv
4209 #elif defined(__CYGWIN__)
4210 # define HAVE_SETENV
4211 # define FOPEN_WB "wb"
4212 /* #elif defined (other platforms) ... */
4213 #endif
4214
4215 #if defined(PATH_MAX)
4216 # define LT_PATHMAX PATH_MAX
4217 #elif defined(MAXPATHLEN)
4218 # define LT_PATHMAX MAXPATHLEN
4219 #else
4220 # define LT_PATHMAX 1024
4221 #endif
4222
4223 #ifndef S_IXOTH
4224 # define S_IXOTH 0
4225 #endif
4226 #ifndef S_IXGRP
4227 # define S_IXGRP 0
4228 #endif
4229
4230 /* path handling portability macros */
4231 #ifndef DIR_SEPARATOR
4232 # define DIR_SEPARATOR '/'
4233 # define PATH_SEPARATOR ':'
4234 #endif
4235
4236 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4237 defined (__OS2__)
4238 # define HAVE_DOS_BASED_FILE_SYSTEM
4239 # define FOPEN_WB "wb"
4240 # ifndef DIR_SEPARATOR_2
4241 # define DIR_SEPARATOR_2 '\\'
4242 # endif
4243 # ifndef PATH_SEPARATOR_2
4244 # define PATH_SEPARATOR_2 ';'
4245 # endif
4246 #endif
4247
4248 #ifndef DIR_SEPARATOR_2
4249 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4250 #else /* DIR_SEPARATOR_2 */
4251 # define IS_DIR_SEPARATOR(ch) \
4252 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4253 #endif /* DIR_SEPARATOR_2 */
4254
4255 #ifndef PATH_SEPARATOR_2
4256 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4257 #else /* PATH_SEPARATOR_2 */
4258 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4259 #endif /* PATH_SEPARATOR_2 */
4260
4261 #ifndef FOPEN_WB
4262 # define FOPEN_WB "w"
4263 #endif
4264 #ifndef _O_BINARY
4265 # define _O_BINARY 0
4266 #endif
4267
4268 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4269 #define XFREE(stale) do { \
4270 if (stale) { free ((void *) stale); stale = 0; } \
4271 } while (0)
4272
4273 #if defined(LT_DEBUGWRAPPER)
4274 static int lt_debug = 1;
4275 #else
4276 static int lt_debug = 0;
4277 #endif
4278
4279 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4280
4281 void *xmalloc (size_t num);
4282 char *xstrdup (const char *string);
4283 const char *base_name (const char *name);
4284 char *find_executable (const char *wrapper);
4285 char *chase_symlinks (const char *pathspec);
4286 int make_executable (const char *path);
4287 int check_executable (const char *path);
4288 char *strendzap (char *str, const char *pat);
4289 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4290 void lt_fatal (const char *file, int line, const char *message, ...);
4291 static const char *nonnull (const char *s);
4292 static const char *nonempty (const char *s);
4293 void lt_setenv (const char *name, const char *value);
4294 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4295 void lt_update_exe_path (const char *name, const char *value);
4296 void lt_update_lib_path (const char *name, const char *value);
4297 char **prepare_spawn (char **argv);
4298 void lt_dump_script (FILE *f);
4299 EOF
4300
4301 cat <<EOF
4302 volatile const char * MAGIC_EXE = "$magic_exe";
4303 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4304 EOF
4305
4306 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4307 func_to_host_path "$temp_rpath"
4308 cat <<EOF
4309 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4310 EOF
4311 else
4312 cat <<"EOF"
4313 const char * LIB_PATH_VALUE = "";
4314 EOF
4315 fi
4316
4317 if test -n "$dllsearchpath"; then
4318 func_to_host_path "$dllsearchpath:"
4319 cat <<EOF
4320 const char * EXE_PATH_VARNAME = "PATH";
4321 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4322 EOF
4323 else
4324 cat <<"EOF"
4325 const char * EXE_PATH_VARNAME = "";
4326 const char * EXE_PATH_VALUE = "";
4327 EOF
4328 fi
4329
4330 if test "$fast_install" = yes; then
4331 cat <<EOF
4332 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4333 EOF
4334 else
4335 cat <<EOF
4336 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4337 EOF
4338 fi
4339
4340
4341 cat <<"EOF"
4342
4343 #define LTWRAPPER_OPTION_PREFIX "--lt-"
4344
4345 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4346 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4347 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4348
4349 int
4350 main (int argc, char *argv[])
4351 {
4352 char **newargz;
4353 int newargc;
4354 char *tmp_pathspec;
4355 char *actual_cwrapper_path;
4356 char *actual_cwrapper_name;
4357 char *target_name;
4358 char *lt_argv_zero;
4359 intptr_t rval = 127;
4360
4361 int i;
4362
4363 program_name = (char *) xstrdup (base_name (argv[0]));
4364 newargz = XMALLOC (char *, argc + 1);
4365
4366 /* very simple arg parsing; don't want to rely on getopt
4367 * also, copy all non cwrapper options to newargz, except
4368 * argz[0], which is handled differently
4369 */
4370 newargc=0;
4371 for (i = 1; i < argc; i++)
4372 {
4373 if (strcmp (argv[i], dumpscript_opt) == 0)
4374 {
4375 EOF
4376 case "$host" in
4377 *mingw* | *cygwin* )
4378 # make stdout use "unix" line endings
4379 echo " setmode(1,_O_BINARY);"
4380 ;;
4381 esac
4382
4383 cat <<"EOF"
4384 lt_dump_script (stdout);
4385 return 0;
4386 }
4387 if (strcmp (argv[i], debug_opt) == 0)
4388 {
4389 lt_debug = 1;
4390 continue;
4391 }
4392 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4393 {
4394 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4395 namespace, but it is not one of the ones we know about and
4396 have already dealt with, above (inluding dump-script), then
4397 report an error. Otherwise, targets might begin to believe
4398 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4399 namespace. The first time any user complains about this, we'll
4400 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4401 or a configure.ac-settable value.
4402 */
4403 lt_fatal (__FILE__, __LINE__,
4404 "unrecognized %s option: '%s'",
4405 ltwrapper_option_prefix, argv[i]);
4406 }
4407 /* otherwise ... */
4408 newargz[++newargc] = xstrdup (argv[i]);
4409 }
4410 newargz[++newargc] = NULL;
4411
4412 EOF
4413 cat <<EOF
4414 /* The GNU banner must be the first non-error debug message */
4415 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4416 EOF
4417 cat <<"EOF"
4418 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4419 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4420
4421 tmp_pathspec = find_executable (argv[0]);
4422 if (tmp_pathspec == NULL)
4423 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4424 lt_debugprintf (__FILE__, __LINE__,
4425 "(main) found exe (before symlink chase) at: %s\n",
4426 tmp_pathspec);
4427
4428 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4429 lt_debugprintf (__FILE__, __LINE__,
4430 "(main) found exe (after symlink chase) at: %s\n",
4431 actual_cwrapper_path);
4432 XFREE (tmp_pathspec);
4433
4434 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4435 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4436
4437 /* wrapper name transforms */
4438 strendzap (actual_cwrapper_name, ".exe");
4439 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4440 XFREE (actual_cwrapper_name);
4441 actual_cwrapper_name = tmp_pathspec;
4442 tmp_pathspec = 0;
4443
4444 /* target_name transforms -- use actual target program name; might have lt- prefix */
4445 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4446 strendzap (target_name, ".exe");
4447 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4448 XFREE (target_name);
4449 target_name = tmp_pathspec;
4450 tmp_pathspec = 0;
4451
4452 lt_debugprintf (__FILE__, __LINE__,
4453 "(main) libtool target name: %s\n",
4454 target_name);
4455 EOF
4456
4457 cat <<EOF
4458 newargz[0] =
4459 XMALLOC (char, (strlen (actual_cwrapper_path) +
4460 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4461 strcpy (newargz[0], actual_cwrapper_path);
4462 strcat (newargz[0], "$objdir");
4463 strcat (newargz[0], "/");
4464 EOF
4465
4466 cat <<"EOF"
4467 /* stop here, and copy so we don't have to do this twice */
4468 tmp_pathspec = xstrdup (newargz[0]);
4469
4470 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4471 strcat (newargz[0], actual_cwrapper_name);
4472
4473 /* DO want the lt- prefix here if it exists, so use target_name */
4474 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4475 XFREE (tmp_pathspec);
4476 tmp_pathspec = NULL;
4477 EOF
4478
4479 case $host_os in
4480 mingw*)
4481 cat <<"EOF"
4482 {
4483 char* p;
4484 while ((p = strchr (newargz[0], '\\')) != NULL)
4485 {
4486 *p = '/';
4487 }
4488 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4489 {
4490 *p = '/';
4491 }
4492 }
4493 EOF
4494 ;;
4495 esac
4496
4497 cat <<"EOF"
4498 XFREE (target_name);
4499 XFREE (actual_cwrapper_path);
4500 XFREE (actual_cwrapper_name);
4501
4502 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4503 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4504 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4505 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4506 because on Windows, both *_VARNAMEs are PATH but uninstalled
4507 libraries must come first. */
4508 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4509 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4510
4511 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4512 nonnull (lt_argv_zero));
4513 for (i = 0; i < newargc; i++)
4514 {
4515 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4516 i, nonnull (newargz[i]));
4517 }
4518
4519 EOF
4520
4521 case $host_os in
4522 mingw*)
4523 cat <<"EOF"
4524 /* execv doesn't actually work on mingw as expected on unix */
4525 newargz = prepare_spawn (newargz);
4526 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4527 if (rval == -1)
4528 {
4529 /* failed to start process */
4530 lt_debugprintf (__FILE__, __LINE__,
4531 "(main) failed to launch target \"%s\": %s\n",
4532 lt_argv_zero, nonnull (strerror (errno)));
4533 return 127;
4534 }
4535 return rval;
4536 EOF
4537 ;;
4538 *)
4539 cat <<"EOF"
4540 execv (lt_argv_zero, newargz);
4541 return rval; /* =127, but avoids unused variable warning */
4542 EOF
4543 ;;
4544 esac
4545
4546 cat <<"EOF"
4547 }
4548
4549 void *
4550 xmalloc (size_t num)
4551 {
4552 void *p = (void *) malloc (num);
4553 if (!p)
4554 lt_fatal (__FILE__, __LINE__, "memory exhausted");
4555
4556 return p;
4557 }
4558
4559 char *
4560 xstrdup (const char *string)
4561 {
4562 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4563 string) : NULL;
4564 }
4565
4566 const char *
4567 base_name (const char *name)
4568 {
4569 const char *base;
4570
4571 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4572 /* Skip over the disk name in MSDOS pathnames. */
4573 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4574 name += 2;
4575 #endif
4576
4577 for (base = name; *name; name++)
4578 if (IS_DIR_SEPARATOR (*name))
4579 base = name + 1;
4580 return base;
4581 }
4582
4583 int
4584 check_executable (const char *path)
4585 {
4586 struct stat st;
4587
4588 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
4589 nonempty (path));
4590 if ((!path) || (!*path))
4591 return 0;
4592
4593 if ((stat (path, &st) >= 0)
4594 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
4595 return 1;
4596 else
4597 return 0;
4598 }
4599
4600 int
4601 make_executable (const char *path)
4602 {
4603 int rval = 0;
4604 struct stat st;
4605
4606 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
4607 nonempty (path));
4608 if ((!path) || (!*path))
4609 return 0;
4610
4611 if (stat (path, &st) >= 0)
4612 {
4613 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
4614 }
4615 return rval;
4616 }
4617
4618 /* Searches for the full path of the wrapper. Returns
4619 newly allocated full path name if found, NULL otherwise
4620 Does not chase symlinks, even on platforms that support them.
4621 */
4622 char *
4623 find_executable (const char *wrapper)
4624 {
4625 int has_slash = 0;
4626 const char *p;
4627 const char *p_next;
4628 /* static buffer for getcwd */
4629 char tmp[LT_PATHMAX + 1];
4630 int tmp_len;
4631 char *concat_name;
4632
4633 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
4634 nonempty (wrapper));
4635
4636 if ((wrapper == NULL) || (*wrapper == '\0'))
4637 return NULL;
4638
4639 /* Absolute path? */
4640 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4641 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4642 {
4643 concat_name = xstrdup (wrapper);
4644 if (check_executable (concat_name))
4645 return concat_name;
4646 XFREE (concat_name);
4647 }
4648 else
4649 {
4650 #endif
4651 if (IS_DIR_SEPARATOR (wrapper[0]))
4652 {
4653 concat_name = xstrdup (wrapper);
4654 if (check_executable (concat_name))
4655 return concat_name;
4656 XFREE (concat_name);
4657 }
4658 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4659 }
4660 #endif
4661
4662 for (p = wrapper; *p; p++)
4663 if (*p == '/')
4664 {
4665 has_slash = 1;
4666 break;
4667 }
4668 if (!has_slash)
4669 {
4670 /* no slashes; search PATH */
4671 const char *path = getenv ("PATH");
4672 if (path != NULL)
4673 {
4674 for (p = path; *p; p = p_next)
4675 {
4676 const char *q;
4677 size_t p_len;
4678 for (q = p; *q; q++)
4679 if (IS_PATH_SEPARATOR (*q))
4680 break;
4681 p_len = q - p;
4682 p_next = (*q == '\0' ? q : q + 1);
4683 if (p_len == 0)
4684 {
4685 /* empty path: current directory */
4686 if (getcwd (tmp, LT_PATHMAX) == NULL)
4687 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4688 nonnull (strerror (errno)));
4689 tmp_len = strlen (tmp);
4690 concat_name =
4691 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4692 memcpy (concat_name, tmp, tmp_len);
4693 concat_name[tmp_len] = '/';
4694 strcpy (concat_name + tmp_len + 1, wrapper);
4695 }
4696 else
4697 {
4698 concat_name =
4699 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
4700 memcpy (concat_name, p, p_len);
4701 concat_name[p_len] = '/';
4702 strcpy (concat_name + p_len + 1, wrapper);
4703 }
4704 if (check_executable (concat_name))
4705 return concat_name;
4706 XFREE (concat_name);
4707 }
4708 }
4709 /* not found in PATH; assume curdir */
4710 }
4711 /* Relative path | not found in path: prepend cwd */
4712 if (getcwd (tmp, LT_PATHMAX) == NULL)
4713 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4714 nonnull (strerror (errno)));
4715 tmp_len = strlen (tmp);
4716 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4717 memcpy (concat_name, tmp, tmp_len);
4718 concat_name[tmp_len] = '/';
4719 strcpy (concat_name + tmp_len + 1, wrapper);
4720
4721 if (check_executable (concat_name))
4722 return concat_name;
4723 XFREE (concat_name);
4724 return NULL;
4725 }
4726
4727 char *
4728 chase_symlinks (const char *pathspec)
4729 {
4730 #ifndef S_ISLNK
4731 return xstrdup (pathspec);
4732 #else
4733 char buf[LT_PATHMAX];
4734 struct stat s;
4735 char *tmp_pathspec = xstrdup (pathspec);
4736 char *p;
4737 int has_symlinks = 0;
4738 while (strlen (tmp_pathspec) && !has_symlinks)
4739 {
4740 lt_debugprintf (__FILE__, __LINE__,
4741 "checking path component for symlinks: %s\n",
4742 tmp_pathspec);
4743 if (lstat (tmp_pathspec, &s) == 0)
4744 {
4745 if (S_ISLNK (s.st_mode) != 0)
4746 {
4747 has_symlinks = 1;
4748 break;
4749 }
4750
4751 /* search backwards for last DIR_SEPARATOR */
4752 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
4753 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4754 p--;
4755 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4756 {
4757 /* no more DIR_SEPARATORS left */
4758 break;
4759 }
4760 *p = '\0';
4761 }
4762 else
4763 {
4764 lt_fatal (__FILE__, __LINE__,
4765 "error accessing file \"%s\": %s",
4766 tmp_pathspec, nonnull (strerror (errno)));
4767 }
4768 }
4769 XFREE (tmp_pathspec);
4770
4771 if (!has_symlinks)
4772 {
4773 return xstrdup (pathspec);
4774 }
4775
4776 tmp_pathspec = realpath (pathspec, buf);
4777 if (tmp_pathspec == 0)
4778 {
4779 lt_fatal (__FILE__, __LINE__,
4780 "could not follow symlinks for %s", pathspec);
4781 }
4782 return xstrdup (tmp_pathspec);
4783 #endif
4784 }
4785
4786 char *
4787 strendzap (char *str, const char *pat)
4788 {
4789 size_t len, patlen;
4790
4791 assert (str != NULL);
4792 assert (pat != NULL);
4793
4794 len = strlen (str);
4795 patlen = strlen (pat);
4796
4797 if (patlen <= len)
4798 {
4799 str += len - patlen;
4800 if (strcmp (str, pat) == 0)
4801 *str = '\0';
4802 }
4803 return str;
4804 }
4805
4806 void
4807 lt_debugprintf (const char *file, int line, const char *fmt, ...)
4808 {
4809 va_list args;
4810 if (lt_debug)
4811 {
4812 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
4813 va_start (args, fmt);
4814 (void) vfprintf (stderr, fmt, args);
4815 va_end (args);
4816 }
4817 }
4818
4819 static void
4820 lt_error_core (int exit_status, const char *file,
4821 int line, const char *mode,
4822 const char *message, va_list ap)
4823 {
4824 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
4825 vfprintf (stderr, message, ap);
4826 fprintf (stderr, ".\n");
4827
4828 if (exit_status >= 0)
4829 exit (exit_status);
4830 }
4831
4832 void
4833 lt_fatal (const char *file, int line, const char *message, ...)
4834 {
4835 va_list ap;
4836 va_start (ap, message);
4837 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
4838 va_end (ap);
4839 }
4840
4841 static const char *
4842 nonnull (const char *s)
4843 {
4844 return s ? s : "(null)";
4845 }
4846
4847 static const char *
4848 nonempty (const char *s)
4849 {
4850 return (s && !*s) ? "(empty)" : nonnull (s);
4851 }
4852
4853 void
4854 lt_setenv (const char *name, const char *value)
4855 {
4856 lt_debugprintf (__FILE__, __LINE__,
4857 "(lt_setenv) setting '%s' to '%s'\n",
4858 nonnull (name), nonnull (value));
4859 {
4860 #ifdef HAVE_SETENV
4861 /* always make a copy, for consistency with !HAVE_SETENV */
4862 char *str = xstrdup (value);
4863 setenv (name, str, 1);
4864 #else
4865 int len = strlen (name) + 1 + strlen (value) + 1;
4866 char *str = XMALLOC (char, len);
4867 sprintf (str, "%s=%s", name, value);
4868 if (putenv (str) != EXIT_SUCCESS)
4869 {
4870 XFREE (str);
4871 }
4872 #endif
4873 }
4874 }
4875
4876 char *
4877 lt_extend_str (const char *orig_value, const char *add, int to_end)
4878 {
4879 char *new_value;
4880 if (orig_value && *orig_value)
4881 {
4882 int orig_value_len = strlen (orig_value);
4883 int add_len = strlen (add);
4884 new_value = XMALLOC (char, add_len + orig_value_len + 1);
4885 if (to_end)
4886 {
4887 strcpy (new_value, orig_value);
4888 strcpy (new_value + orig_value_len, add);
4889 }
4890 else
4891 {
4892 strcpy (new_value, add);
4893 strcpy (new_value + add_len, orig_value);
4894 }
4895 }
4896 else
4897 {
4898 new_value = xstrdup (add);
4899 }
4900 return new_value;
4901 }
4902
4903 void
4904 lt_update_exe_path (const char *name, const char *value)
4905 {
4906 lt_debugprintf (__FILE__, __LINE__,
4907 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4908 nonnull (name), nonnull (value));
4909
4910 if (name && *name && value && *value)
4911 {
4912 char *new_value = lt_extend_str (getenv (name), value, 0);
4913 /* some systems can't cope with a ':'-terminated path #' */
4914 int len = strlen (new_value);
4915 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4916 {
4917 new_value[len-1] = '\0';
4918 }
4919 lt_setenv (name, new_value);
4920 XFREE (new_value);
4921 }
4922 }
4923
4924 void
4925 lt_update_lib_path (const char *name, const char *value)
4926 {
4927 lt_debugprintf (__FILE__, __LINE__,
4928 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4929 nonnull (name), nonnull (value));
4930
4931 if (name && *name && value && *value)
4932 {
4933 char *new_value = lt_extend_str (getenv (name), value, 0);
4934 lt_setenv (name, new_value);
4935 XFREE (new_value);
4936 }
4937 }
4938
4939 EOF
4940 case $host_os in
4941 mingw*)
4942 cat <<"EOF"
4943
4944 /* Prepares an argument vector before calling spawn().
4945 Note that spawn() does not by itself call the command interpreter
4946 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4947 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4948 GetVersionEx(&v);
4949 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4950 }) ? "cmd.exe" : "command.com").
4951 Instead it simply concatenates the arguments, separated by ' ', and calls
4952 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4953 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4954 special way:
4955 - Space and tab are interpreted as delimiters. They are not treated as
4956 delimiters if they are surrounded by double quotes: "...".
4957 - Unescaped double quotes are removed from the input. Their only effect is
4958 that within double quotes, space and tab are treated like normal
4959 characters.
4960 - Backslashes not followed by double quotes are not special.
4961 - But 2*n+1 backslashes followed by a double quote become
4962 n backslashes followed by a double quote (n >= 0):
4963 \" -> "
4964 \\\" -> \"
4965 \\\\\" -> \\"
4966 */
4967 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4968 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4969 char **
4970 prepare_spawn (char **argv)
4971 {
4972 size_t argc;
4973 char **new_argv;
4974 size_t i;
4975
4976 /* Count number of arguments. */
4977 for (argc = 0; argv[argc] != NULL; argc++)
4978 ;
4979
4980 /* Allocate new argument vector. */
4981 new_argv = XMALLOC (char *, argc + 1);
4982
4983 /* Put quoted arguments into the new argument vector. */
4984 for (i = 0; i < argc; i++)
4985 {
4986 const char *string = argv[i];
4987
4988 if (string[0] == '\0')
4989 new_argv[i] = xstrdup ("\"\"");
4990 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4991 {
4992 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4993 size_t length;
4994 unsigned int backslashes;
4995 const char *s;
4996 char *quoted_string;
4997 char *p;
4998
4999 length = 0;
5000 backslashes = 0;
5001 if (quote_around)
5002 length++;
5003 for (s = string; *s != '\0'; s++)
5004 {
5005 char c = *s;
5006 if (c == '"')
5007 length += backslashes + 1;
5008 length++;
5009 if (c == '\\')
5010 backslashes++;
5011 else
5012 backslashes = 0;
5013 }
5014 if (quote_around)
5015 length += backslashes + 1;
5016
5017 quoted_string = XMALLOC (char, length + 1);
5018
5019 p = quoted_string;
5020 backslashes = 0;
5021 if (quote_around)
5022 *p++ = '"';
5023 for (s = string; *s != '\0'; s++)
5024 {
5025 char c = *s;
5026 if (c == '"')
5027 {
5028 unsigned int j;
5029 for (j = backslashes + 1; j > 0; j--)
5030 *p++ = '\\';
5031 }
5032 *p++ = c;
5033 if (c == '\\')
5034 backslashes++;
5035 else
5036 backslashes = 0;
5037 }
5038 if (quote_around)
5039 {
5040 unsigned int j;
5041 for (j = backslashes; j > 0; j--)
5042 *p++ = '\\';
5043 *p++ = '"';
5044 }
5045 *p = '\0';
5046
5047 new_argv[i] = quoted_string;
5048 }
5049 else
5050 new_argv[i] = (char *) string;
5051 }
5052 new_argv[argc] = NULL;
5053
5054 return new_argv;
5055 }
5056 EOF
5057 ;;
5058 esac
5059
5060 cat <<"EOF"
5061 void lt_dump_script (FILE* f)
5062 {
5063 EOF
5064 func_emit_wrapper yes |
5065 $SED -n -e '
5066 s/^\(.\{79\}\)\(..*\)/\1\
5067 \2/
5068 h
5069 s/\([\\"]\)/\\\1/g
5070 s/$/\\n/
5071 s/\([^\n]*\).*/ fputs ("\1", f);/p
5072 g
5073 D'
5074 cat <<"EOF"
5075 }
5076 EOF
5077 }
5078 # end: func_emit_cwrapperexe_src
5079
5080 # func_win32_import_lib_p ARG
5081 # True if ARG is an import lib, as indicated by $file_magic_cmd
5082 func_win32_import_lib_p ()
5083 {
5084 $opt_debug
5085 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5086 *import*) : ;;
5087 *) false ;;
5088 esac
5089 }
5090
5091 # func_mode_link arg...
5092 func_mode_link ()
5093 {
5094 $opt_debug
5095 case $host in
5096 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5097 # It is impossible to link a dll without this setting, and
5098 # we shouldn't force the makefile maintainer to figure out
5099 # which system we are compiling for in order to pass an extra
5100 # flag for every libtool invocation.
5101 # allow_undefined=no
5102
5103 # FIXME: Unfortunately, there are problems with the above when trying
5104 # to make a dll which has undefined symbols, in which case not
5105 # even a static library is built. For now, we need to specify
5106 # -no-undefined on the libtool link line when we can be certain
5107 # that all symbols are satisfied, otherwise we get a static library.
5108 allow_undefined=yes
5109 ;;
5110 *)
5111 allow_undefined=yes
5112 ;;
5113 esac
5114 libtool_args=$nonopt
5115 base_compile="$nonopt $@"
5116 compile_command=$nonopt
5117 finalize_command=$nonopt
5118
5119 compile_rpath=
5120 finalize_rpath=
5121 compile_shlibpath=
5122 finalize_shlibpath=
5123 convenience=
5124 old_convenience=
5125 deplibs=
5126 old_deplibs=
5127 compiler_flags=
5128 linker_flags=
5129 dllsearchpath=
5130 lib_search_path=`pwd`
5131 inst_prefix_dir=
5132 new_inherited_linker_flags=
5133
5134 avoid_version=no
5135 bindir=
5136 dlfiles=
5137 dlprefiles=
5138 dlself=no
5139 export_dynamic=no
5140 export_symbols=
5141 export_symbols_regex=
5142 generated=
5143 libobjs=
5144 ltlibs=
5145 module=no
5146 no_install=no
5147 objs=
5148 non_pic_objects=
5149 precious_files_regex=
5150 prefer_static_libs=no
5151 preload=no
5152 prev=
5153 prevarg=
5154 release=
5155 rpath=
5156 xrpath=
5157 perm_rpath=
5158 temp_rpath=
5159 thread_safe=no
5160 vinfo=
5161 vinfo_number=no
5162 weak_libs=
5163 single_module="${wl}-single_module"
5164 func_infer_tag $base_compile
5165
5166 # We need to know -static, to get the right output filenames.
5167 for arg
5168 do
5169 case $arg in
5170 -shared)
5171 test "$build_libtool_libs" != yes && \
5172 func_fatal_configuration "can not build a shared library"
5173 build_old_libs=no
5174 break
5175 ;;
5176 -all-static | -static | -static-libtool-libs)
5177 case $arg in
5178 -all-static)
5179 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5180 func_warning "complete static linking is impossible in this configuration"
5181 fi
5182 if test -n "$link_static_flag"; then
5183 dlopen_self=$dlopen_self_static
5184 fi
5185 prefer_static_libs=yes
5186 ;;
5187 -static)
5188 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5189 dlopen_self=$dlopen_self_static
5190 fi
5191 prefer_static_libs=built
5192 ;;
5193 -static-libtool-libs)
5194 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5195 dlopen_self=$dlopen_self_static
5196 fi
5197 prefer_static_libs=yes
5198 ;;
5199 esac
5200 build_libtool_libs=no
5201 build_old_libs=yes
5202 break
5203 ;;
5204 esac
5205 done
5206
5207 # See if our shared archives depend on static archives.
5208 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5209
5210 # Go through the arguments, transforming them on the way.
5211 while test "$#" -gt 0; do
5212 arg="$1"
5213 shift
5214 func_quote_for_eval "$arg"
5215 qarg=$func_quote_for_eval_unquoted_result
5216 func_append libtool_args " $func_quote_for_eval_result"
5217
5218 # If the previous option needs an argument, assign it.
5219 if test -n "$prev"; then
5220 case $prev in
5221 output)
5222 func_append compile_command " @OUTPUT@"
5223 func_append finalize_command " @OUTPUT@"
5224 ;;
5225 esac
5226
5227 case $prev in
5228 bindir)
5229 bindir="$arg"
5230 prev=
5231 continue
5232 ;;
5233 dlfiles|dlprefiles)
5234 if test "$preload" = no; then
5235 # Add the symbol object into the linking commands.
5236 func_append compile_command " @SYMFILE@"
5237 func_append finalize_command " @SYMFILE@"
5238 preload=yes
5239 fi
5240 case $arg in
5241 *.la | *.lo) ;; # We handle these cases below.
5242 force)
5243 if test "$dlself" = no; then
5244 dlself=needless
5245 export_dynamic=yes
5246 fi
5247 prev=
5248 continue
5249 ;;
5250 self)
5251 if test "$prev" = dlprefiles; then
5252 dlself=yes
5253 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5254 dlself=yes
5255 else
5256 dlself=needless
5257 export_dynamic=yes
5258 fi
5259 prev=
5260 continue
5261 ;;
5262 *)
5263 if test "$prev" = dlfiles; then
5264 func_append dlfiles " $arg"
5265 else
5266 func_append dlprefiles " $arg"
5267 fi
5268 prev=
5269 continue
5270 ;;
5271 esac
5272 ;;
5273 expsyms)
5274 export_symbols="$arg"
5275 test -f "$arg" \
5276 || func_fatal_error "symbol file \`$arg' does not exist"
5277 prev=
5278 continue
5279 ;;
5280 expsyms_regex)
5281 export_symbols_regex="$arg"
5282 prev=
5283 continue
5284 ;;
5285 framework)
5286 case $host in
5287 *-*-darwin*)
5288 case "$deplibs " in
5289 *" $qarg.ltframework "*) ;;
5290 *) func_append deplibs " $qarg.ltframework" # this is fixed later
5291 ;;
5292 esac
5293 ;;
5294 esac
5295 prev=
5296 continue
5297 ;;
5298 inst_prefix)
5299 inst_prefix_dir="$arg"
5300 prev=
5301 continue
5302 ;;
5303 objectlist)
5304 if test -f "$arg"; then
5305 save_arg=$arg
5306 moreargs=
5307 for fil in `cat "$save_arg"`
5308 do
5309 # func_append moreargs " $fil"
5310 arg=$fil
5311 # A libtool-controlled object.
5312
5313 # Check to see that this really is a libtool object.
5314 if func_lalib_unsafe_p "$arg"; then
5315 pic_object=
5316 non_pic_object=
5317
5318 # Read the .lo file
5319 func_source "$arg"
5320
5321 if test -z "$pic_object" ||
5322 test -z "$non_pic_object" ||
5323 test "$pic_object" = none &&
5324 test "$non_pic_object" = none; then
5325 func_fatal_error "cannot find name of object for \`$arg'"
5326 fi
5327
5328 # Extract subdirectory from the argument.
5329 func_dirname "$arg" "/" ""
5330 xdir="$func_dirname_result"
5331
5332 if test "$pic_object" != none; then
5333 # Prepend the subdirectory the object is found in.
5334 pic_object="$xdir$pic_object"
5335
5336 if test "$prev" = dlfiles; then
5337 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5338 func_append dlfiles " $pic_object"
5339 prev=
5340 continue
5341 else
5342 # If libtool objects are unsupported, then we need to preload.
5343 prev=dlprefiles
5344 fi
5345 fi
5346
5347 # CHECK ME: I think I busted this. -Ossama
5348 if test "$prev" = dlprefiles; then
5349 # Preload the old-style object.
5350 func_append dlprefiles " $pic_object"
5351 prev=
5352 fi
5353
5354 # A PIC object.
5355 func_append libobjs " $pic_object"
5356 arg="$pic_object"
5357 fi
5358
5359 # Non-PIC object.
5360 if test "$non_pic_object" != none; then
5361 # Prepend the subdirectory the object is found in.
5362 non_pic_object="$xdir$non_pic_object"
5363
5364 # A standard non-PIC object
5365 func_append non_pic_objects " $non_pic_object"
5366 if test -z "$pic_object" || test "$pic_object" = none ; then
5367 arg="$non_pic_object"
5368 fi
5369 else
5370 # If the PIC object exists, use it instead.
5371 # $xdir was prepended to $pic_object above.
5372 non_pic_object="$pic_object"
5373 func_append non_pic_objects " $non_pic_object"
5374 fi
5375 else
5376 # Only an error if not doing a dry-run.
5377 if $opt_dry_run; then
5378 # Extract subdirectory from the argument.
5379 func_dirname "$arg" "/" ""
5380 xdir="$func_dirname_result"
5381
5382 func_lo2o "$arg"
5383 pic_object=$xdir$objdir/$func_lo2o_result
5384 non_pic_object=$xdir$func_lo2o_result
5385 func_append libobjs " $pic_object"
5386 func_append non_pic_objects " $non_pic_object"
5387 else
5388 func_fatal_error "\`$arg' is not a valid libtool object"
5389 fi
5390 fi
5391 done
5392 else
5393 func_fatal_error "link input file \`$arg' does not exist"
5394 fi
5395 arg=$save_arg
5396 prev=
5397 continue
5398 ;;
5399 precious_regex)
5400 precious_files_regex="$arg"
5401 prev=
5402 continue
5403 ;;
5404 release)
5405 release="-$arg"
5406 prev=
5407 continue
5408 ;;
5409 rpath | xrpath)
5410 # We need an absolute path.
5411 case $arg in
5412 [\\/]* | [A-Za-z]:[\\/]*) ;;
5413 *)
5414 func_fatal_error "only absolute run-paths are allowed"
5415 ;;
5416 esac
5417 if test "$prev" = rpath; then
5418 case "$rpath " in
5419 *" $arg "*) ;;
5420 *) func_append rpath " $arg" ;;
5421 esac
5422 else
5423 case "$xrpath " in
5424 *" $arg "*) ;;
5425 *) func_append xrpath " $arg" ;;
5426 esac
5427 fi
5428 prev=
5429 continue
5430 ;;
5431 shrext)
5432 shrext_cmds="$arg"
5433 prev=
5434 continue
5435 ;;
5436 weak)
5437 func_append weak_libs " $arg"
5438 prev=
5439 continue
5440 ;;
5441 xcclinker)
5442 func_append linker_flags " $qarg"
5443 func_append compiler_flags " $qarg"
5444 prev=
5445 func_append compile_command " $qarg"
5446 func_append finalize_command " $qarg"
5447 continue
5448 ;;
5449 xcompiler)
5450 func_append compiler_flags " $qarg"
5451 prev=
5452 func_append compile_command " $qarg"
5453 func_append finalize_command " $qarg"
5454 continue
5455 ;;
5456 xlinker)
5457 func_append linker_flags " $qarg"
5458 func_append compiler_flags " $wl$qarg"
5459 prev=
5460 func_append compile_command " $wl$qarg"
5461 func_append finalize_command " $wl$qarg"
5462 continue
5463 ;;
5464 *)
5465 eval "$prev=\"\$arg\""
5466 prev=
5467 continue
5468 ;;
5469 esac
5470 fi # test -n "$prev"
5471
5472 prevarg="$arg"
5473
5474 case $arg in
5475 -all-static)
5476 if test -n "$link_static_flag"; then
5477 # See comment for -static flag below, for more details.
5478 func_append compile_command " $link_static_flag"
5479 func_append finalize_command " $link_static_flag"
5480 fi
5481 continue
5482 ;;
5483
5484 -allow-undefined)
5485 # FIXME: remove this flag sometime in the future.
5486 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5487 ;;
5488
5489 -avoid-version)
5490 avoid_version=yes
5491 continue
5492 ;;
5493
5494 -bindir)
5495 prev=bindir
5496 continue
5497 ;;
5498
5499 -dlopen)
5500 prev=dlfiles
5501 continue
5502 ;;
5503
5504 -dlpreopen)
5505 prev=dlprefiles
5506 continue
5507 ;;
5508
5509 -export-dynamic)
5510 export_dynamic=yes
5511 continue
5512 ;;
5513
5514 -export-symbols | -export-symbols-regex)
5515 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5516 func_fatal_error "more than one -exported-symbols argument is not allowed"
5517 fi
5518 if test "X$arg" = "X-export-symbols"; then
5519 prev=expsyms
5520 else
5521 prev=expsyms_regex
5522 fi
5523 continue
5524 ;;
5525
5526 -framework)
5527 prev=framework
5528 continue
5529 ;;
5530
5531 -inst-prefix-dir)
5532 prev=inst_prefix
5533 continue
5534 ;;
5535
5536 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5537 # so, if we see these flags be careful not to treat them like -L
5538 -L[A-Z][A-Z]*:*)
5539 case $with_gcc/$host in
5540 no/*-*-irix* | /*-*-irix*)
5541 func_append compile_command " $arg"
5542 func_append finalize_command " $arg"
5543 ;;
5544 esac
5545 continue
5546 ;;
5547
5548 -L*)
5549 func_stripname "-L" '' "$arg"
5550 if test -z "$func_stripname_result"; then
5551 if test "$#" -gt 0; then
5552 func_fatal_error "require no space between \`-L' and \`$1'"
5553 else
5554 func_fatal_error "need path for \`-L' option"
5555 fi
5556 fi
5557 func_resolve_sysroot "$func_stripname_result"
5558 dir=$func_resolve_sysroot_result
5559 # We need an absolute path.
5560 case $dir in
5561 [\\/]* | [A-Za-z]:[\\/]*) ;;
5562 *)
5563 absdir=`cd "$dir" && pwd`
5564 test -z "$absdir" && \
5565 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5566 dir="$absdir"
5567 ;;
5568 esac
5569 case "$deplibs " in
5570 *" -L$dir "* | *" $arg "*)
5571 # Will only happen for absolute or sysroot arguments
5572 ;;
5573 *)
5574 # Preserve sysroot, but never include relative directories
5575 case $dir in
5576 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
5577 *) func_append deplibs " -L$dir" ;;
5578 esac
5579 func_append lib_search_path " $dir"
5580 ;;
5581 esac
5582 case $host in
5583 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5584 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
5585 case :$dllsearchpath: in
5586 *":$dir:"*) ;;
5587 ::) dllsearchpath=$dir;;
5588 *) func_append dllsearchpath ":$dir";;
5589 esac
5590 case :$dllsearchpath: in
5591 *":$testbindir:"*) ;;
5592 ::) dllsearchpath=$testbindir;;
5593 *) func_append dllsearchpath ":$testbindir";;
5594 esac
5595 ;;
5596 esac
5597 continue
5598 ;;
5599
5600 -l*)
5601 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
5602 case $host in
5603 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
5604 # These systems don't actually have a C or math library (as such)
5605 continue
5606 ;;
5607 *-*-os2*)
5608 # These systems don't actually have a C library (as such)
5609 test "X$arg" = "X-lc" && continue
5610 ;;
5611 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5612 # Do not include libc due to us having libc/libc_r.
5613 test "X$arg" = "X-lc" && continue
5614 ;;
5615 *-*-rhapsody* | *-*-darwin1.[012])
5616 # Rhapsody C and math libraries are in the System framework
5617 func_append deplibs " System.ltframework"
5618 continue
5619 ;;
5620 *-*-sco3.2v5* | *-*-sco5v6*)
5621 # Causes problems with __ctype
5622 test "X$arg" = "X-lc" && continue
5623 ;;
5624 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5625 # Compiler inserts libc in the correct place for threads to work
5626 test "X$arg" = "X-lc" && continue
5627 ;;
5628 esac
5629 elif test "X$arg" = "X-lc_r"; then
5630 case $host in
5631 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5632 # Do not include libc_r directly, use -pthread flag.
5633 continue
5634 ;;
5635 esac
5636 fi
5637 func_append deplibs " $arg"
5638 continue
5639 ;;
5640
5641 -module)
5642 module=yes
5643 continue
5644 ;;
5645
5646 # Tru64 UNIX uses -model [arg] to determine the layout of C++
5647 # classes, name mangling, and exception handling.
5648 # Darwin uses the -arch flag to determine output architecture.
5649 -model|-arch|-isysroot|--sysroot)
5650 func_append compiler_flags " $arg"
5651 func_append compile_command " $arg"
5652 func_append finalize_command " $arg"
5653 prev=xcompiler
5654 continue
5655 ;;
5656
5657 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
5658 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5659 func_append compiler_flags " $arg"
5660 func_append compile_command " $arg"
5661 func_append finalize_command " $arg"
5662 case "$new_inherited_linker_flags " in
5663 *" $arg "*) ;;
5664 * ) func_append new_inherited_linker_flags " $arg" ;;
5665 esac
5666 continue
5667 ;;
5668
5669 -multi_module)
5670 single_module="${wl}-multi_module"
5671 continue
5672 ;;
5673
5674 -no-fast-install)
5675 fast_install=no
5676 continue
5677 ;;
5678
5679 -no-install)
5680 case $host in
5681 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5682 # The PATH hackery in wrapper scripts is required on Windows
5683 # and Darwin in order for the loader to find any dlls it needs.
5684 func_warning "\`-no-install' is ignored for $host"
5685 func_warning "assuming \`-no-fast-install' instead"
5686 fast_install=no
5687 ;;
5688 *) no_install=yes ;;
5689 esac
5690 continue
5691 ;;
5692
5693 -no-undefined)
5694 allow_undefined=no
5695 continue
5696 ;;
5697
5698 -objectlist)
5699 prev=objectlist
5700 continue
5701 ;;
5702
5703 -o) prev=output ;;
5704
5705 -precious-files-regex)
5706 prev=precious_regex
5707 continue
5708 ;;
5709
5710 -release)
5711 prev=release
5712 continue
5713 ;;
5714
5715 -rpath)
5716 prev=rpath
5717 continue
5718 ;;
5719
5720 -R)
5721 prev=xrpath
5722 continue
5723 ;;
5724
5725 -R*)
5726 func_stripname '-R' '' "$arg"
5727 dir=$func_stripname_result
5728 # We need an absolute path.
5729 case $dir in
5730 [\\/]* | [A-Za-z]:[\\/]*) ;;
5731 =*)
5732 func_stripname '=' '' "$dir"
5733 dir=$lt_sysroot$func_stripname_result
5734 ;;
5735 *)
5736 func_fatal_error "only absolute run-paths are allowed"
5737 ;;
5738 esac
5739 case "$xrpath " in
5740 *" $dir "*) ;;
5741 *) func_append xrpath " $dir" ;;
5742 esac
5743 continue
5744 ;;
5745
5746 -shared)
5747 # The effects of -shared are defined in a previous loop.
5748 continue
5749 ;;
5750
5751 -shrext)
5752 prev=shrext
5753 continue
5754 ;;
5755
5756 -static | -static-libtool-libs)
5757 # The effects of -static are defined in a previous loop.
5758 # We used to do the same as -all-static on platforms that
5759 # didn't have a PIC flag, but the assumption that the effects
5760 # would be equivalent was wrong. It would break on at least
5761 # Digital Unix and AIX.
5762 continue
5763 ;;
5764
5765 -thread-safe)
5766 thread_safe=yes
5767 continue
5768 ;;
5769
5770 -version-info)
5771 prev=vinfo
5772 continue
5773 ;;
5774
5775 -version-number)
5776 prev=vinfo
5777 vinfo_number=yes
5778 continue
5779 ;;
5780
5781 -weak)
5782 prev=weak
5783 continue
5784 ;;
5785
5786 -Wc,*)
5787 func_stripname '-Wc,' '' "$arg"
5788 args=$func_stripname_result
5789 arg=
5790 save_ifs="$IFS"; IFS=','
5791 for flag in $args; do
5792 IFS="$save_ifs"
5793 func_quote_for_eval "$flag"
5794 func_append arg " $func_quote_for_eval_result"
5795 func_append compiler_flags " $func_quote_for_eval_result"
5796 done
5797 IFS="$save_ifs"
5798 func_stripname ' ' '' "$arg"
5799 arg=$func_stripname_result
5800 ;;
5801
5802 -Wl,*)
5803 func_stripname '-Wl,' '' "$arg"
5804 args=$func_stripname_result
5805 arg=
5806 save_ifs="$IFS"; IFS=','
5807 for flag in $args; do
5808 IFS="$save_ifs"
5809 func_quote_for_eval "$flag"
5810 func_append arg " $wl$func_quote_for_eval_result"
5811 func_append compiler_flags " $wl$func_quote_for_eval_result"
5812 func_append linker_flags " $func_quote_for_eval_result"
5813 done
5814 IFS="$save_ifs"
5815 func_stripname ' ' '' "$arg"
5816 arg=$func_stripname_result
5817 ;;
5818
5819 -Xcompiler)
5820 prev=xcompiler
5821 continue
5822 ;;
5823
5824 -Xlinker)
5825 prev=xlinker
5826 continue
5827 ;;
5828
5829 -XCClinker)
5830 prev=xcclinker
5831 continue
5832 ;;
5833
5834 # -msg_* for osf cc
5835 -msg_*)
5836 func_quote_for_eval "$arg"
5837 arg="$func_quote_for_eval_result"
5838 ;;
5839
5840 # Flags to be passed through unchanged, with rationale:
5841 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5842 # -r[0-9][0-9]* specify processor for the SGI compiler
5843 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5844 # +DA*, +DD* enable 64-bit mode for the HP compiler
5845 # -q* compiler args for the IBM compiler
5846 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5847 # -F/path path to uninstalled frameworks, gcc on darwin
5848 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
5849 # @file GCC response files
5850 # -tp=* Portland pgcc target processor selection
5851 # --sysroot=* for sysroot support
5852 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5853 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5854 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5855 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
5856 func_quote_for_eval "$arg"
5857 arg="$func_quote_for_eval_result"
5858 func_append compile_command " $arg"
5859 func_append finalize_command " $arg"
5860 func_append compiler_flags " $arg"
5861 continue
5862 ;;
5863
5864 # Some other compiler flag.
5865 -* | +*)
5866 func_quote_for_eval "$arg"
5867 arg="$func_quote_for_eval_result"
5868 ;;
5869
5870 *.$objext)
5871 # A standard object.
5872 func_append objs " $arg"
5873 ;;
5874
5875 *.lo)
5876 # A libtool-controlled object.
5877
5878 # Check to see that this really is a libtool object.
5879 if func_lalib_unsafe_p "$arg"; then
5880 pic_object=
5881 non_pic_object=
5882
5883 # Read the .lo file
5884 func_source "$arg"
5885
5886 if test -z "$pic_object" ||
5887 test -z "$non_pic_object" ||
5888 test "$pic_object" = none &&
5889 test "$non_pic_object" = none; then
5890 func_fatal_error "cannot find name of object for \`$arg'"
5891 fi
5892
5893 # Extract subdirectory from the argument.
5894 func_dirname "$arg" "/" ""
5895 xdir="$func_dirname_result"
5896
5897 if test "$pic_object" != none; then
5898 # Prepend the subdirectory the object is found in.
5899 pic_object="$xdir$pic_object"
5900
5901 if test "$prev" = dlfiles; then
5902 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5903 func_append dlfiles " $pic_object"
5904 prev=
5905 continue
5906 else
5907 # If libtool objects are unsupported, then we need to preload.
5908 prev=dlprefiles
5909 fi
5910 fi
5911
5912 # CHECK ME: I think I busted this. -Ossama
5913 if test "$prev" = dlprefiles; then
5914 # Preload the old-style object.
5915 func_append dlprefiles " $pic_object"
5916 prev=
5917 fi
5918
5919 # A PIC object.
5920 func_append libobjs " $pic_object"
5921 arg="$pic_object"
5922 fi
5923
5924 # Non-PIC object.
5925 if test "$non_pic_object" != none; then
5926 # Prepend the subdirectory the object is found in.
5927 non_pic_object="$xdir$non_pic_object"
5928
5929 # A standard non-PIC object
5930 func_append non_pic_objects " $non_pic_object"
5931 if test -z "$pic_object" || test "$pic_object" = none ; then
5932 arg="$non_pic_object"
5933 fi
5934 else
5935 # If the PIC object exists, use it instead.
5936 # $xdir was prepended to $pic_object above.
5937 non_pic_object="$pic_object"
5938 func_append non_pic_objects " $non_pic_object"
5939 fi
5940 else
5941 # Only an error if not doing a dry-run.
5942 if $opt_dry_run; then
5943 # Extract subdirectory from the argument.
5944 func_dirname "$arg" "/" ""
5945 xdir="$func_dirname_result"
5946
5947 func_lo2o "$arg"
5948 pic_object=$xdir$objdir/$func_lo2o_result
5949 non_pic_object=$xdir$func_lo2o_result
5950 func_append libobjs " $pic_object"
5951 func_append non_pic_objects " $non_pic_object"
5952 else
5953 func_fatal_error "\`$arg' is not a valid libtool object"
5954 fi
5955 fi
5956 ;;
5957
5958 *.$libext)
5959 # An archive.
5960 func_append deplibs " $arg"
5961 func_append old_deplibs " $arg"
5962 continue
5963 ;;
5964
5965 *.la)
5966 # A libtool-controlled library.
5967
5968 func_resolve_sysroot "$arg"
5969 if test "$prev" = dlfiles; then
5970 # This library was specified with -dlopen.
5971 func_append dlfiles " $func_resolve_sysroot_result"
5972 prev=
5973 elif test "$prev" = dlprefiles; then
5974 # The library was specified with -dlpreopen.
5975 func_append dlprefiles " $func_resolve_sysroot_result"
5976 prev=
5977 else
5978 func_append deplibs " $func_resolve_sysroot_result"
5979 fi
5980 continue
5981 ;;
5982
5983 # Some other compiler argument.
5984 *)
5985 # Unknown arguments in both finalize_command and compile_command need
5986 # to be aesthetically quoted because they are evaled later.
5987 func_quote_for_eval "$arg"
5988 arg="$func_quote_for_eval_result"
5989 ;;
5990 esac # arg
5991
5992 # Now actually substitute the argument into the commands.
5993 if test -n "$arg"; then
5994 func_append compile_command " $arg"
5995 func_append finalize_command " $arg"
5996 fi
5997 done # argument parsing loop
5998
5999 test -n "$prev" && \
6000 func_fatal_help "the \`$prevarg' option requires an argument"
6001
6002 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6003 eval arg=\"$export_dynamic_flag_spec\"
6004 func_append compile_command " $arg"
6005 func_append finalize_command " $arg"
6006 fi
6007
6008 oldlibs=
6009 # calculate the name of the file, without its directory
6010 func_basename "$output"
6011 outputname="$func_basename_result"
6012 libobjs_save="$libobjs"
6013
6014 if test -n "$shlibpath_var"; then
6015 # get the directories listed in $shlibpath_var
6016 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6017 else
6018 shlib_search_path=
6019 fi
6020 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6021 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6022
6023 func_dirname "$output" "/" ""
6024 output_objdir="$func_dirname_result$objdir"
6025 func_to_tool_file "$output_objdir/"
6026 tool_output_objdir=$func_to_tool_file_result
6027 # Create the object directory.
6028 func_mkdir_p "$output_objdir"
6029
6030 # Determine the type of output
6031 case $output in
6032 "")
6033 func_fatal_help "you must specify an output file"
6034 ;;
6035 *.$libext) linkmode=oldlib ;;
6036 *.lo | *.$objext) linkmode=obj ;;
6037 *.la) linkmode=lib ;;
6038 *) linkmode=prog ;; # Anything else should be a program.
6039 esac
6040
6041 specialdeplibs=
6042
6043 libs=
6044 # Find all interdependent deplibs by searching for libraries
6045 # that are linked more than once (e.g. -la -lb -la)
6046 for deplib in $deplibs; do
6047 if $opt_preserve_dup_deps ; then
6048 case "$libs " in
6049 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6050 esac
6051 fi
6052 func_append libs " $deplib"
6053 done
6054
6055 if test "$linkmode" = lib; then
6056 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6057
6058 # Compute libraries that are listed more than once in $predeps
6059 # $postdeps and mark them as special (i.e., whose duplicates are
6060 # not to be eliminated).
6061 pre_post_deps=
6062 if $opt_duplicate_compiler_generated_deps; then
6063 for pre_post_dep in $predeps $postdeps; do
6064 case "$pre_post_deps " in
6065 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
6066 esac
6067 func_append pre_post_deps " $pre_post_dep"
6068 done
6069 fi
6070 pre_post_deps=
6071 fi
6072
6073 deplibs=
6074 newdependency_libs=
6075 newlib_search_path=
6076 need_relink=no # whether we're linking any uninstalled libtool libraries
6077 notinst_deplibs= # not-installed libtool libraries
6078 notinst_path= # paths that contain not-installed libtool libraries
6079
6080 case $linkmode in
6081 lib)
6082 passes="conv dlpreopen link"
6083 for file in $dlfiles $dlprefiles; do
6084 case $file in
6085 *.la) ;;
6086 *)
6087 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6088 ;;
6089 esac
6090 done
6091 ;;
6092 prog)
6093 compile_deplibs=
6094 finalize_deplibs=
6095 alldeplibs=no
6096 newdlfiles=
6097 newdlprefiles=
6098 passes="conv scan dlopen dlpreopen link"
6099 ;;
6100 *) passes="conv"
6101 ;;
6102 esac
6103
6104 for pass in $passes; do
6105 # The preopen pass in lib mode reverses $deplibs; put it back here
6106 # so that -L comes before libs that need it for instance...
6107 if test "$linkmode,$pass" = "lib,link"; then
6108 ## FIXME: Find the place where the list is rebuilt in the wrong
6109 ## order, and fix it there properly
6110 tmp_deplibs=
6111 for deplib in $deplibs; do
6112 tmp_deplibs="$deplib $tmp_deplibs"
6113 done
6114 deplibs="$tmp_deplibs"
6115 fi
6116
6117 if test "$linkmode,$pass" = "lib,link" ||
6118 test "$linkmode,$pass" = "prog,scan"; then
6119 libs="$deplibs"
6120 deplibs=
6121 fi
6122 if test "$linkmode" = prog; then
6123 case $pass in
6124 dlopen) libs="$dlfiles" ;;
6125 dlpreopen) libs="$dlprefiles" ;;
6126 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6127 esac
6128 fi
6129 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6130 # Collect and forward deplibs of preopened libtool libs
6131 for lib in $dlprefiles; do
6132 # Ignore non-libtool-libs
6133 dependency_libs=
6134 func_resolve_sysroot "$lib"
6135 case $lib in
6136 *.la) func_source "$func_resolve_sysroot_result" ;;
6137 esac
6138
6139 # Collect preopened libtool deplibs, except any this library
6140 # has declared as weak libs
6141 for deplib in $dependency_libs; do
6142 func_basename "$deplib"
6143 deplib_base=$func_basename_result
6144 case " $weak_libs " in
6145 *" $deplib_base "*) ;;
6146 *) func_append deplibs " $deplib" ;;
6147 esac
6148 done
6149 done
6150 libs="$dlprefiles"
6151 fi
6152 if test "$pass" = dlopen; then
6153 # Collect dlpreopened libraries
6154 save_deplibs="$deplibs"
6155 deplibs=
6156 fi
6157
6158 for deplib in $libs; do
6159 lib=
6160 found=no
6161 case $deplib in
6162 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6163 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6164 if test "$linkmode,$pass" = "prog,link"; then
6165 compile_deplibs="$deplib $compile_deplibs"
6166 finalize_deplibs="$deplib $finalize_deplibs"
6167 else
6168 func_append compiler_flags " $deplib"
6169 if test "$linkmode" = lib ; then
6170 case "$new_inherited_linker_flags " in
6171 *" $deplib "*) ;;
6172 * ) func_append new_inherited_linker_flags " $deplib" ;;
6173 esac
6174 fi
6175 fi
6176 continue
6177 ;;
6178 -l*)
6179 if test "$linkmode" != lib && test "$linkmode" != prog; then
6180 func_warning "\`-l' is ignored for archives/objects"
6181 continue
6182 fi
6183 func_stripname '-l' '' "$deplib"
6184 name=$func_stripname_result
6185 if test "$linkmode" = lib; then
6186 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6187 else
6188 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6189 fi
6190 for searchdir in $searchdirs; do
6191 for search_ext in .la $std_shrext .so .a; do
6192 # Search the libtool library
6193 lib="$searchdir/lib${name}${search_ext}"
6194 if test -f "$lib"; then
6195 if test "$search_ext" = ".la"; then
6196 found=yes
6197 else
6198 found=no
6199 fi
6200 break 2
6201 fi
6202 done
6203 done
6204 if test "$found" != yes; then
6205 # deplib doesn't seem to be a libtool library
6206 if test "$linkmode,$pass" = "prog,link"; then
6207 compile_deplibs="$deplib $compile_deplibs"
6208 finalize_deplibs="$deplib $finalize_deplibs"
6209 else
6210 deplibs="$deplib $deplibs"
6211 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6212 fi
6213 continue
6214 else # deplib is a libtool library
6215 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6216 # We need to do some special things here, and not later.
6217 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6218 case " $predeps $postdeps " in
6219 *" $deplib "*)
6220 if func_lalib_p "$lib"; then
6221 library_names=
6222 old_library=
6223 func_source "$lib"
6224 for l in $old_library $library_names; do
6225 ll="$l"
6226 done
6227 if test "X$ll" = "X$old_library" ; then # only static version available
6228 found=no
6229 func_dirname "$lib" "" "."
6230 ladir="$func_dirname_result"
6231 lib=$ladir/$old_library
6232 if test "$linkmode,$pass" = "prog,link"; then
6233 compile_deplibs="$deplib $compile_deplibs"
6234 finalize_deplibs="$deplib $finalize_deplibs"
6235 else
6236 deplibs="$deplib $deplibs"
6237 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6238 fi
6239 continue
6240 fi
6241 fi
6242 ;;
6243 *) ;;
6244 esac
6245 fi
6246 fi
6247 ;; # -l
6248 *.ltframework)
6249 if test "$linkmode,$pass" = "prog,link"; then
6250 compile_deplibs="$deplib $compile_deplibs"
6251 finalize_deplibs="$deplib $finalize_deplibs"
6252 else
6253 deplibs="$deplib $deplibs"
6254 if test "$linkmode" = lib ; then
6255 case "$new_inherited_linker_flags " in
6256 *" $deplib "*) ;;
6257 * ) func_append new_inherited_linker_flags " $deplib" ;;
6258 esac
6259 fi
6260 fi
6261 continue
6262 ;;
6263 -L*)
6264 case $linkmode in
6265 lib)
6266 deplibs="$deplib $deplibs"
6267 test "$pass" = conv && continue
6268 newdependency_libs="$deplib $newdependency_libs"
6269 func_stripname '-L' '' "$deplib"
6270 func_resolve_sysroot "$func_stripname_result"
6271 func_append newlib_search_path " $func_resolve_sysroot_result"
6272 ;;
6273 prog)
6274 if test "$pass" = conv; then
6275 deplibs="$deplib $deplibs"
6276 continue
6277 fi
6278 if test "$pass" = scan; then
6279 deplibs="$deplib $deplibs"
6280 else
6281 compile_deplibs="$deplib $compile_deplibs"
6282 finalize_deplibs="$deplib $finalize_deplibs"
6283 fi
6284 func_stripname '-L' '' "$deplib"
6285 func_resolve_sysroot "$func_stripname_result"
6286 func_append newlib_search_path " $func_resolve_sysroot_result"
6287 ;;
6288 *)
6289 func_warning "\`-L' is ignored for archives/objects"
6290 ;;
6291 esac # linkmode
6292 continue
6293 ;; # -L
6294 -R*)
6295 if test "$pass" = link; then
6296 func_stripname '-R' '' "$deplib"
6297 func_resolve_sysroot "$func_stripname_result"
6298 dir=$func_resolve_sysroot_result
6299 # Make sure the xrpath contains only unique directories.
6300 case "$xrpath " in
6301 *" $dir "*) ;;
6302 *) func_append xrpath " $dir" ;;
6303 esac
6304 fi
6305 deplibs="$deplib $deplibs"
6306 continue
6307 ;;
6308 *.la)
6309 func_resolve_sysroot "$deplib"
6310 lib=$func_resolve_sysroot_result
6311 ;;
6312 *.$libext)
6313 if test "$pass" = conv; then
6314 deplibs="$deplib $deplibs"
6315 continue
6316 fi
6317 case $linkmode in
6318 lib)
6319 # Linking convenience modules into shared libraries is allowed,
6320 # but linking other static libraries is non-portable.
6321 case " $dlpreconveniencelibs " in
6322 *" $deplib "*) ;;
6323 *)
6324 valid_a_lib=no
6325 case $deplibs_check_method in
6326 match_pattern*)
6327 set dummy $deplibs_check_method; shift
6328 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6329 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6330 | $EGREP "$match_pattern_regex" > /dev/null; then
6331 valid_a_lib=yes
6332 fi
6333 ;;
6334 pass_all)
6335 valid_a_lib=yes
6336 ;;
6337 esac
6338 if test "$valid_a_lib" != yes; then
6339 echo
6340 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6341 echo "*** I have the capability to make that library automatically link in when"
6342 echo "*** you link to this library. But I can only do this if you have a"
6343 echo "*** shared version of the library, which you do not appear to have"
6344 echo "*** because the file extensions .$libext of this argument makes me believe"
6345 echo "*** that it is just a static archive that I should not use here."
6346 else
6347 echo
6348 $ECHO "*** Warning: Linking the shared library $output against the"
6349 $ECHO "*** static library $deplib is not portable!"
6350 deplibs="$deplib $deplibs"
6351 fi
6352 ;;
6353 esac
6354 continue
6355 ;;
6356 prog)
6357 if test "$pass" != link; then
6358 deplibs="$deplib $deplibs"
6359 else
6360 compile_deplibs="$deplib $compile_deplibs"
6361 finalize_deplibs="$deplib $finalize_deplibs"
6362 fi
6363 continue
6364 ;;
6365 esac # linkmode
6366 ;; # *.$libext
6367 *.lo | *.$objext)
6368 if test "$pass" = conv; then
6369 deplibs="$deplib $deplibs"
6370 elif test "$linkmode" = prog; then
6371 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6372 # If there is no dlopen support or we're linking statically,
6373 # we need to preload.
6374 func_append newdlprefiles " $deplib"
6375 compile_deplibs="$deplib $compile_deplibs"
6376 finalize_deplibs="$deplib $finalize_deplibs"
6377 else
6378 func_append newdlfiles " $deplib"
6379 fi
6380 fi
6381 continue
6382 ;;
6383 %DEPLIBS%)
6384 alldeplibs=yes
6385 continue
6386 ;;
6387 esac # case $deplib
6388
6389 if test "$found" = yes || test -f "$lib"; then :
6390 else
6391 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6392 fi
6393
6394 # Check to see that this really is a libtool archive.
6395 func_lalib_unsafe_p "$lib" \
6396 || func_fatal_error "\`$lib' is not a valid libtool archive"
6397
6398 func_dirname "$lib" "" "."
6399 ladir="$func_dirname_result"
6400
6401 dlname=
6402 dlopen=
6403 dlpreopen=
6404 libdir=
6405 library_names=
6406 old_library=
6407 inherited_linker_flags=
6408 # If the library was installed with an old release of libtool,
6409 # it will not redefine variables installed, or shouldnotlink
6410 installed=yes
6411 shouldnotlink=no
6412 avoidtemprpath=
6413
6414
6415 # Read the .la file
6416 func_source "$lib"
6417
6418 # Convert "-framework foo" to "foo.ltframework"
6419 if test -n "$inherited_linker_flags"; then
6420 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6421 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6422 case " $new_inherited_linker_flags " in
6423 *" $tmp_inherited_linker_flag "*) ;;
6424 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
6425 esac
6426 done
6427 fi
6428 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6429 if test "$linkmode,$pass" = "lib,link" ||
6430 test "$linkmode,$pass" = "prog,scan" ||
6431 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6432 test -n "$dlopen" && func_append dlfiles " $dlopen"
6433 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6434 fi
6435
6436 if test "$pass" = conv; then
6437 # Only check for convenience libraries
6438 deplibs="$lib $deplibs"
6439 if test -z "$libdir"; then
6440 if test -z "$old_library"; then
6441 func_fatal_error "cannot find name of link library for \`$lib'"
6442 fi
6443 # It is a libtool convenience library, so add in its objects.
6444 func_append convenience " $ladir/$objdir/$old_library"
6445 func_append old_convenience " $ladir/$objdir/$old_library"
6446 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6447 func_fatal_error "\`$lib' is not a convenience library"
6448 fi
6449 tmp_libs=
6450 for deplib in $dependency_libs; do
6451 deplibs="$deplib $deplibs"
6452 if $opt_preserve_dup_deps ; then
6453 case "$tmp_libs " in
6454 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6455 esac
6456 fi
6457 func_append tmp_libs " $deplib"
6458 done
6459 continue
6460 fi # $pass = conv
6461
6462
6463 # Get the name of the library we link against.
6464 linklib=
6465 if test -n "$old_library" &&
6466 { test "$prefer_static_libs" = yes ||
6467 test "$prefer_static_libs,$installed" = "built,no"; }; then
6468 linklib=$old_library
6469 else
6470 for l in $old_library $library_names; do
6471 linklib="$l"
6472 done
6473 fi
6474 if test -z "$linklib"; then
6475 func_fatal_error "cannot find name of link library for \`$lib'"
6476 fi
6477
6478 # This library was specified with -dlopen.
6479 if test "$pass" = dlopen; then
6480 if test -z "$libdir"; then
6481 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6482 fi
6483 if test -z "$dlname" ||
6484 test "$dlopen_support" != yes ||
6485 test "$build_libtool_libs" = no; then
6486 # If there is no dlname, no dlopen support or we're linking
6487 # statically, we need to preload. We also need to preload any
6488 # dependent libraries so libltdl's deplib preloader doesn't
6489 # bomb out in the load deplibs phase.
6490 func_append dlprefiles " $lib $dependency_libs"
6491 else
6492 func_append newdlfiles " $lib"
6493 fi
6494 continue
6495 fi # $pass = dlopen
6496
6497 # We need an absolute path.
6498 case $ladir in
6499 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6500 *)
6501 abs_ladir=`cd "$ladir" && pwd`
6502 if test -z "$abs_ladir"; then
6503 func_warning "cannot determine absolute directory name of \`$ladir'"
6504 func_warning "passing it literally to the linker, although it might fail"
6505 abs_ladir="$ladir"
6506 fi
6507 ;;
6508 esac
6509 func_basename "$lib"
6510 laname="$func_basename_result"
6511
6512 # Find the relevant object directory and library name.
6513 if test "X$installed" = Xyes; then
6514 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6515 func_warning "library \`$lib' was moved."
6516 dir="$ladir"
6517 absdir="$abs_ladir"
6518 libdir="$abs_ladir"
6519 else
6520 dir="$lt_sysroot$libdir"
6521 absdir="$lt_sysroot$libdir"
6522 fi
6523 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6524 else
6525 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6526 dir="$ladir"
6527 absdir="$abs_ladir"
6528 # Remove this search path later
6529 func_append notinst_path " $abs_ladir"
6530 else
6531 dir="$ladir/$objdir"
6532 absdir="$abs_ladir/$objdir"
6533 # Remove this search path later
6534 func_append notinst_path " $abs_ladir"
6535 fi
6536 fi # $installed = yes
6537 func_stripname 'lib' '.la' "$laname"
6538 name=$func_stripname_result
6539
6540 # This library was specified with -dlpreopen.
6541 if test "$pass" = dlpreopen; then
6542 if test -z "$libdir" && test "$linkmode" = prog; then
6543 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6544 fi
6545 case "$host" in
6546 # special handling for platforms with PE-DLLs.
6547 *cygwin* | *mingw* | *cegcc* )
6548 # Linker will automatically link against shared library if both
6549 # static and shared are present. Therefore, ensure we extract
6550 # symbols from the import library if a shared library is present
6551 # (otherwise, the dlopen module name will be incorrect). We do
6552 # this by putting the import library name into $newdlprefiles.
6553 # We recover the dlopen module name by 'saving' the la file
6554 # name in a special purpose variable, and (later) extracting the
6555 # dlname from the la file.
6556 if test -n "$dlname"; then
6557 func_tr_sh "$dir/$linklib"
6558 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6559 func_append newdlprefiles " $dir/$linklib"
6560 else
6561 func_append newdlprefiles " $dir/$old_library"
6562 # Keep a list of preopened convenience libraries to check
6563 # that they are being used correctly in the link pass.
6564 test -z "$libdir" && \
6565 func_append dlpreconveniencelibs " $dir/$old_library"
6566 fi
6567 ;;
6568 * )
6569 # Prefer using a static library (so that no silly _DYNAMIC symbols
6570 # are required to link).
6571 if test -n "$old_library"; then
6572 func_append newdlprefiles " $dir/$old_library"
6573 # Keep a list of preopened convenience libraries to check
6574 # that they are being used correctly in the link pass.
6575 test -z "$libdir" && \
6576 func_append dlpreconveniencelibs " $dir/$old_library"
6577 # Otherwise, use the dlname, so that lt_dlopen finds it.
6578 elif test -n "$dlname"; then
6579 func_append newdlprefiles " $dir/$dlname"
6580 else
6581 func_append newdlprefiles " $dir/$linklib"
6582 fi
6583 ;;
6584 esac
6585 fi # $pass = dlpreopen
6586
6587 if test -z "$libdir"; then
6588 # Link the convenience library
6589 if test "$linkmode" = lib; then
6590 deplibs="$dir/$old_library $deplibs"
6591 elif test "$linkmode,$pass" = "prog,link"; then
6592 compile_deplibs="$dir/$old_library $compile_deplibs"
6593 finalize_deplibs="$dir/$old_library $finalize_deplibs"
6594 else
6595 deplibs="$lib $deplibs" # used for prog,scan pass
6596 fi
6597 continue
6598 fi
6599
6600
6601 if test "$linkmode" = prog && test "$pass" != link; then
6602 func_append newlib_search_path " $ladir"
6603 deplibs="$lib $deplibs"
6604
6605 linkalldeplibs=no
6606 if test "$link_all_deplibs" != no || test -z "$library_names" ||
6607 test "$build_libtool_libs" = no; then
6608 linkalldeplibs=yes
6609 fi
6610
6611 tmp_libs=
6612 for deplib in $dependency_libs; do
6613 case $deplib in
6614 -L*) func_stripname '-L' '' "$deplib"
6615 func_resolve_sysroot "$func_stripname_result"
6616 func_append newlib_search_path " $func_resolve_sysroot_result"
6617 ;;
6618 esac
6619 # Need to link against all dependency_libs?
6620 if test "$linkalldeplibs" = yes; then
6621 deplibs="$deplib $deplibs"
6622 else
6623 # Need to hardcode shared library paths
6624 # or/and link against static libraries
6625 newdependency_libs="$deplib $newdependency_libs"
6626 fi
6627 if $opt_preserve_dup_deps ; then
6628 case "$tmp_libs " in
6629 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6630 esac
6631 fi
6632 func_append tmp_libs " $deplib"
6633 done # for deplib
6634 continue
6635 fi # $linkmode = prog...
6636
6637 if test "$linkmode,$pass" = "prog,link"; then
6638 if test -n "$library_names" &&
6639 { { test "$prefer_static_libs" = no ||
6640 test "$prefer_static_libs,$installed" = "built,yes"; } ||
6641 test -z "$old_library"; }; then
6642 # We need to hardcode the library path
6643 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
6644 # Make sure the rpath contains only unique directories.
6645 case "$temp_rpath:" in
6646 *"$absdir:"*) ;;
6647 *) func_append temp_rpath "$absdir:" ;;
6648 esac
6649 fi
6650
6651 # Hardcode the library path.
6652 # Skip directories that are in the system default run-time
6653 # search path.
6654 case " $sys_lib_dlsearch_path " in
6655 *" $absdir "*) ;;
6656 *)
6657 case "$compile_rpath " in
6658 *" $absdir "*) ;;
6659 *) func_append compile_rpath " $absdir" ;;
6660 esac
6661 ;;
6662 esac
6663 case " $sys_lib_dlsearch_path " in
6664 *" $libdir "*) ;;
6665 *)
6666 case "$finalize_rpath " in
6667 *" $libdir "*) ;;
6668 *) func_append finalize_rpath " $libdir" ;;
6669 esac
6670 ;;
6671 esac
6672 fi # $linkmode,$pass = prog,link...
6673
6674 if test "$alldeplibs" = yes &&
6675 { test "$deplibs_check_method" = pass_all ||
6676 { test "$build_libtool_libs" = yes &&
6677 test -n "$library_names"; }; }; then
6678 # We only need to search for static libraries
6679 continue
6680 fi
6681 fi
6682
6683 link_static=no # Whether the deplib will be linked statically
6684 use_static_libs=$prefer_static_libs
6685 if test "$use_static_libs" = built && test "$installed" = yes; then
6686 use_static_libs=no
6687 fi
6688 if test -n "$library_names" &&
6689 { test "$use_static_libs" = no || test -z "$old_library"; }; then
6690 case $host in
6691 *cygwin* | *mingw* | *cegcc*)
6692 # No point in relinking DLLs because paths are not encoded
6693 func_append notinst_deplibs " $lib"
6694 need_relink=no
6695 ;;
6696 *)
6697 if test "$installed" = no; then
6698 func_append notinst_deplibs " $lib"
6699 need_relink=yes
6700 fi
6701 ;;
6702 esac
6703 # This is a shared library
6704
6705 # Warn about portability, can't link against -module's on some
6706 # systems (darwin). Don't bleat about dlopened modules though!
6707 dlopenmodule=""
6708 for dlpremoduletest in $dlprefiles; do
6709 if test "X$dlpremoduletest" = "X$lib"; then
6710 dlopenmodule="$dlpremoduletest"
6711 break
6712 fi
6713 done
6714 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
6715 echo
6716 if test "$linkmode" = prog; then
6717 $ECHO "*** Warning: Linking the executable $output against the loadable module"
6718 else
6719 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6720 fi
6721 $ECHO "*** $linklib is not portable!"
6722 fi
6723 if test "$linkmode" = lib &&
6724 test "$hardcode_into_libs" = yes; then
6725 # Hardcode the library path.
6726 # Skip directories that are in the system default run-time
6727 # search path.
6728 case " $sys_lib_dlsearch_path " in
6729 *" $absdir "*) ;;
6730 *)
6731 case "$compile_rpath " in
6732 *" $absdir "*) ;;
6733 *) func_append compile_rpath " $absdir" ;;
6734 esac
6735 ;;
6736 esac
6737 case " $sys_lib_dlsearch_path " in
6738 *" $libdir "*) ;;
6739 *)
6740 case "$finalize_rpath " in
6741 *" $libdir "*) ;;
6742 *) func_append finalize_rpath " $libdir" ;;
6743 esac
6744 ;;
6745 esac
6746 fi
6747
6748 if test -n "$old_archive_from_expsyms_cmds"; then
6749 # figure out the soname
6750 set dummy $library_names
6751 shift
6752 realname="$1"
6753 shift
6754 libname=`eval "\\$ECHO \"$libname_spec\""`
6755 # use dlname if we got it. it's perfectly good, no?
6756 if test -n "$dlname"; then
6757 soname="$dlname"
6758 elif test -n "$soname_spec"; then
6759 # bleh windows
6760 case $host in
6761 *cygwin* | mingw* | *cegcc*)
6762 func_arith $current - $age
6763 major=$func_arith_result
6764 versuffix="-$major"
6765 ;;
6766 esac
6767 eval soname=\"$soname_spec\"
6768 else
6769 soname="$realname"
6770 fi
6771
6772 # Make a new name for the extract_expsyms_cmds to use
6773 soroot="$soname"
6774 func_basename "$soroot"
6775 soname="$func_basename_result"
6776 func_stripname 'lib' '.dll' "$soname"
6777 newlib=libimp-$func_stripname_result.a
6778
6779 # If the library has no export list, then create one now
6780 if test -f "$output_objdir/$soname-def"; then :
6781 else
6782 func_verbose "extracting exported symbol list from \`$soname'"
6783 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6784 fi
6785
6786 # Create $newlib
6787 if test -f "$output_objdir/$newlib"; then :; else
6788 func_verbose "generating import library for \`$soname'"
6789 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6790 fi
6791 # make sure the library variables are pointing to the new library
6792 dir=$output_objdir
6793 linklib=$newlib
6794 fi # test -n "$old_archive_from_expsyms_cmds"
6795
6796 if test "$linkmode" = prog || test "$opt_mode" != relink; then
6797 add_shlibpath=
6798 add_dir=
6799 add=
6800 lib_linked=yes
6801 case $hardcode_action in
6802 immediate | unsupported)
6803 if test "$hardcode_direct" = no; then
6804 add="$dir/$linklib"
6805 case $host in
6806 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6807 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6808 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6809 *-*-unixware7*) add_dir="-L$dir" ;;
6810 *-*-darwin* )
6811 # if the lib is a (non-dlopened) module then we can not
6812 # link against it, someone is ignoring the earlier warnings
6813 if /usr/bin/file -L $add 2> /dev/null |
6814 $GREP ": [^:]* bundle" >/dev/null ; then
6815 if test "X$dlopenmodule" != "X$lib"; then
6816 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6817 if test -z "$old_library" ; then
6818 echo
6819 echo "*** And there doesn't seem to be a static archive available"
6820 echo "*** The link will probably fail, sorry"
6821 else
6822 add="$dir/$old_library"
6823 fi
6824 elif test -n "$old_library"; then
6825 add="$dir/$old_library"
6826 fi
6827 fi
6828 esac
6829 elif test "$hardcode_minus_L" = no; then
6830 case $host in
6831 *-*-sunos*) add_shlibpath="$dir" ;;
6832 esac
6833 add_dir="-L$dir"
6834 add="-l$name"
6835 elif test "$hardcode_shlibpath_var" = no; then
6836 add_shlibpath="$dir"
6837 add="-l$name"
6838 else
6839 lib_linked=no
6840 fi
6841 ;;
6842 relink)
6843 if test "$hardcode_direct" = yes &&
6844 test "$hardcode_direct_absolute" = no; then
6845 add="$dir/$linklib"
6846 elif test "$hardcode_minus_L" = yes; then
6847 add_dir="-L$absdir"
6848 # Try looking first in the location we're being installed to.
6849 if test -n "$inst_prefix_dir"; then
6850 case $libdir in
6851 [\\/]*)
6852 func_append add_dir " -L$inst_prefix_dir$libdir"
6853 ;;
6854 esac
6855 fi
6856 add="-l$name"
6857 elif test "$hardcode_shlibpath_var" = yes; then
6858 add_shlibpath="$dir"
6859 add="-l$name"
6860 else
6861 lib_linked=no
6862 fi
6863 ;;
6864 *) lib_linked=no ;;
6865 esac
6866
6867 if test "$lib_linked" != yes; then
6868 func_fatal_configuration "unsupported hardcode properties"
6869 fi
6870
6871 if test -n "$add_shlibpath"; then
6872 case :$compile_shlibpath: in
6873 *":$add_shlibpath:"*) ;;
6874 *) func_append compile_shlibpath "$add_shlibpath:" ;;
6875 esac
6876 fi
6877 if test "$linkmode" = prog; then
6878 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6879 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6880 else
6881 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6882 test -n "$add" && deplibs="$add $deplibs"
6883 if test "$hardcode_direct" != yes &&
6884 test "$hardcode_minus_L" != yes &&
6885 test "$hardcode_shlibpath_var" = yes; then
6886 case :$finalize_shlibpath: in
6887 *":$libdir:"*) ;;
6888 *) func_append finalize_shlibpath "$libdir:" ;;
6889 esac
6890 fi
6891 fi
6892 fi
6893
6894 if test "$linkmode" = prog || test "$opt_mode" = relink; then
6895 add_shlibpath=
6896 add_dir=
6897 add=
6898 # Finalize command for both is simple: just hardcode it.
6899 if test "$hardcode_direct" = yes &&
6900 test "$hardcode_direct_absolute" = no; then
6901 add="$libdir/$linklib"
6902 elif test "$hardcode_minus_L" = yes; then
6903 add_dir="-L$libdir"
6904 add="-l$name"
6905 elif test "$hardcode_shlibpath_var" = yes; then
6906 case :$finalize_shlibpath: in
6907 *":$libdir:"*) ;;
6908 *) func_append finalize_shlibpath "$libdir:" ;;
6909 esac
6910 add="-l$name"
6911 elif test "$hardcode_automatic" = yes; then
6912 if test -n "$inst_prefix_dir" &&
6913 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6914 add="$inst_prefix_dir$libdir/$linklib"
6915 else
6916 add="$libdir/$linklib"
6917 fi
6918 else
6919 # We cannot seem to hardcode it, guess we'll fake it.
6920 add_dir="-L$libdir"
6921 # Try looking first in the location we're being installed to.
6922 if test -n "$inst_prefix_dir"; then
6923 case $libdir in
6924 [\\/]*)
6925 func_append add_dir " -L$inst_prefix_dir$libdir"
6926 ;;
6927 esac
6928 fi
6929 add="-l$name"
6930 fi
6931
6932 if test "$linkmode" = prog; then
6933 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6934 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6935 else
6936 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6937 test -n "$add" && deplibs="$add $deplibs"
6938 fi
6939 fi
6940 elif test "$linkmode" = prog; then
6941 # Here we assume that one of hardcode_direct or hardcode_minus_L
6942 # is not unsupported. This is valid on all known static and
6943 # shared platforms.
6944 if test "$hardcode_direct" != unsupported; then
6945 test -n "$old_library" && linklib="$old_library"
6946 compile_deplibs="$dir/$linklib $compile_deplibs"
6947 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6948 else
6949 compile_deplibs="-l$name -L$dir $compile_deplibs"
6950 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6951 fi
6952 elif test "$build_libtool_libs" = yes; then
6953 # Not a shared library
6954 if test "$deplibs_check_method" != pass_all; then
6955 # We're trying link a shared library against a static one
6956 # but the system doesn't support it.
6957
6958 # Just print a warning and add the library to dependency_libs so
6959 # that the program can be linked against the static library.
6960 echo
6961 $ECHO "*** Warning: This system can not link to static lib archive $lib."
6962 echo "*** I have the capability to make that library automatically link in when"
6963 echo "*** you link to this library. But I can only do this if you have a"
6964 echo "*** shared version of the library, which you do not appear to have."
6965 if test "$module" = yes; then
6966 echo "*** But as you try to build a module library, libtool will still create "
6967 echo "*** a static module, that should work as long as the dlopening application"
6968 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6969 if test -z "$global_symbol_pipe"; then
6970 echo
6971 echo "*** However, this would only work if libtool was able to extract symbol"
6972 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6973 echo "*** not find such a program. So, this module is probably useless."
6974 echo "*** \`nm' from GNU binutils and a full rebuild may help."
6975 fi
6976 if test "$build_old_libs" = no; then
6977 build_libtool_libs=module
6978 build_old_libs=yes
6979 else
6980 build_libtool_libs=no
6981 fi
6982 fi
6983 else
6984 deplibs="$dir/$old_library $deplibs"
6985 link_static=yes
6986 fi
6987 fi # link shared/static library?
6988
6989 if test "$linkmode" = lib; then
6990 if test -n "$dependency_libs" &&
6991 { test "$hardcode_into_libs" != yes ||
6992 test "$build_old_libs" = yes ||
6993 test "$link_static" = yes; }; then
6994 # Extract -R from dependency_libs
6995 temp_deplibs=
6996 for libdir in $dependency_libs; do
6997 case $libdir in
6998 -R*) func_stripname '-R' '' "$libdir"
6999 temp_xrpath=$func_stripname_result
7000 case " $xrpath " in
7001 *" $temp_xrpath "*) ;;
7002 *) func_append xrpath " $temp_xrpath";;
7003 esac;;
7004 *) func_append temp_deplibs " $libdir";;
7005 esac
7006 done
7007 dependency_libs="$temp_deplibs"
7008 fi
7009
7010 func_append newlib_search_path " $absdir"
7011 # Link against this library
7012 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7013 # ... and its dependency_libs
7014 tmp_libs=
7015 for deplib in $dependency_libs; do
7016 newdependency_libs="$deplib $newdependency_libs"
7017 case $deplib in
7018 -L*) func_stripname '-L' '' "$deplib"
7019 func_resolve_sysroot "$func_stripname_result";;
7020 *) func_resolve_sysroot "$deplib" ;;
7021 esac
7022 if $opt_preserve_dup_deps ; then
7023 case "$tmp_libs " in
7024 *" $func_resolve_sysroot_result "*)
7025 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7026 esac
7027 fi
7028 func_append tmp_libs " $func_resolve_sysroot_result"
7029 done
7030
7031 if test "$link_all_deplibs" != no; then
7032 # Add the search paths of all dependency libraries
7033 for deplib in $dependency_libs; do
7034 path=
7035 case $deplib in
7036 -L*) path="$deplib" ;;
7037 *.la)
7038 func_resolve_sysroot "$deplib"
7039 deplib=$func_resolve_sysroot_result
7040 func_dirname "$deplib" "" "."
7041 dir=$func_dirname_result
7042 # We need an absolute path.
7043 case $dir in
7044 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7045 *)
7046 absdir=`cd "$dir" && pwd`
7047 if test -z "$absdir"; then
7048 func_warning "cannot determine absolute directory name of \`$dir'"
7049 absdir="$dir"
7050 fi
7051 ;;
7052 esac
7053 if $GREP "^installed=no" $deplib > /dev/null; then
7054 case $host in
7055 *-*-darwin*)
7056 depdepl=
7057 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7058 if test -n "$deplibrary_names" ; then
7059 for tmp in $deplibrary_names ; do
7060 depdepl=$tmp
7061 done
7062 if test -f "$absdir/$objdir/$depdepl" ; then
7063 depdepl="$absdir/$objdir/$depdepl"
7064 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7065 if test -z "$darwin_install_name"; then
7066 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7067 fi
7068 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7069 func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
7070 path=
7071 fi
7072 fi
7073 ;;
7074 *)
7075 path="-L$absdir/$objdir"
7076 ;;
7077 esac
7078 else
7079 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7080 test -z "$libdir" && \
7081 func_fatal_error "\`$deplib' is not a valid libtool archive"
7082 test "$absdir" != "$libdir" && \
7083 func_warning "\`$deplib' seems to be moved"
7084
7085 path="-L$absdir"
7086 fi
7087 ;;
7088 esac
7089 case " $deplibs " in
7090 *" $path "*) ;;
7091 *) deplibs="$path $deplibs" ;;
7092 esac
7093 done
7094 fi # link_all_deplibs != no
7095 fi # linkmode = lib
7096 done # for deplib in $libs
7097 if test "$pass" = link; then
7098 if test "$linkmode" = "prog"; then
7099 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7100 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7101 else
7102 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7103 fi
7104 fi
7105 dependency_libs="$newdependency_libs"
7106 if test "$pass" = dlpreopen; then
7107 # Link the dlpreopened libraries before other libraries
7108 for deplib in $save_deplibs; do
7109 deplibs="$deplib $deplibs"
7110 done
7111 fi
7112 if test "$pass" != dlopen; then
7113 if test "$pass" != conv; then
7114 # Make sure lib_search_path contains only unique directories.
7115 lib_search_path=
7116 for dir in $newlib_search_path; do
7117 case "$lib_search_path " in
7118 *" $dir "*) ;;
7119 *) func_append lib_search_path " $dir" ;;
7120 esac
7121 done
7122 newlib_search_path=
7123 fi
7124
7125 if test "$linkmode,$pass" != "prog,link"; then
7126 vars="deplibs"
7127 else
7128 vars="compile_deplibs finalize_deplibs"
7129 fi
7130 for var in $vars dependency_libs; do
7131 # Add libraries to $var in reverse order
7132 eval tmp_libs=\"\$$var\"
7133 new_libs=
7134 for deplib in $tmp_libs; do
7135 # FIXME: Pedantically, this is the right thing to do, so
7136 # that some nasty dependency loop isn't accidentally
7137 # broken:
7138 #new_libs="$deplib $new_libs"
7139 # Pragmatically, this seems to cause very few problems in
7140 # practice:
7141 case $deplib in
7142 -L*) new_libs="$deplib $new_libs" ;;
7143 -R*) ;;
7144 *)
7145 # And here is the reason: when a library appears more
7146 # than once as an explicit dependence of a library, or
7147 # is implicitly linked in more than once by the
7148 # compiler, it is considered special, and multiple
7149 # occurrences thereof are not removed. Compare this
7150 # with having the same library being listed as a
7151 # dependency of multiple other libraries: in this case,
7152 # we know (pedantically, we assume) the library does not
7153 # need to be listed more than once, so we keep only the
7154 # last copy. This is not always right, but it is rare
7155 # enough that we require users that really mean to play
7156 # such unportable linking tricks to link the library
7157 # using -Wl,-lname, so that libtool does not consider it
7158 # for duplicate removal.
7159 case " $specialdeplibs " in
7160 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7161 *)
7162 case " $new_libs " in
7163 *" $deplib "*) ;;
7164 *) new_libs="$deplib $new_libs" ;;
7165 esac
7166 ;;
7167 esac
7168 ;;
7169 esac
7170 done
7171 tmp_libs=
7172 for deplib in $new_libs; do
7173 case $deplib in
7174 -L*)
7175 case " $tmp_libs " in
7176 *" $deplib "*) ;;
7177 *) func_append tmp_libs " $deplib" ;;
7178 esac
7179 ;;
7180 *) func_append tmp_libs " $deplib" ;;
7181 esac
7182 done
7183 eval $var=\"$tmp_libs\"
7184 done # for var
7185 fi
7186 # Last step: remove runtime libs from dependency_libs
7187 # (they stay in deplibs)
7188 tmp_libs=
7189 for i in $dependency_libs ; do
7190 case " $predeps $postdeps $compiler_lib_search_path " in
7191 *" $i "*)
7192 i=""
7193 ;;
7194 esac
7195 if test -n "$i" ; then
7196 func_append tmp_libs " $i"
7197 fi
7198 done
7199 dependency_libs=$tmp_libs
7200 done # for pass
7201 if test "$linkmode" = prog; then
7202 dlfiles="$newdlfiles"
7203 fi
7204 if test "$linkmode" = prog || test "$linkmode" = lib; then
7205 dlprefiles="$newdlprefiles"
7206 fi
7207
7208 case $linkmode in
7209 oldlib)
7210 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7211 func_warning "\`-dlopen' is ignored for archives"
7212 fi
7213
7214 case " $deplibs" in
7215 *\ -l* | *\ -L*)
7216 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7217 esac
7218
7219 test -n "$rpath" && \
7220 func_warning "\`-rpath' is ignored for archives"
7221
7222 test -n "$xrpath" && \
7223 func_warning "\`-R' is ignored for archives"
7224
7225 test -n "$vinfo" && \
7226 func_warning "\`-version-info/-version-number' is ignored for archives"
7227
7228 test -n "$release" && \
7229 func_warning "\`-release' is ignored for archives"
7230
7231 test -n "$export_symbols$export_symbols_regex" && \
7232 func_warning "\`-export-symbols' is ignored for archives"
7233
7234 # Now set the variables for building old libraries.
7235 build_libtool_libs=no
7236 oldlibs="$output"
7237 func_append objs "$old_deplibs"
7238 ;;
7239
7240 lib)
7241 # Make sure we only generate libraries of the form `libNAME.la'.
7242 case $outputname in
7243 lib*)
7244 func_stripname 'lib' '.la' "$outputname"
7245 name=$func_stripname_result
7246 eval shared_ext=\"$shrext_cmds\"
7247 eval libname=\"$libname_spec\"
7248 ;;
7249 *)
7250 test "$module" = no && \
7251 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7252
7253 if test "$need_lib_prefix" != no; then
7254 # Add the "lib" prefix for modules if required
7255 func_stripname '' '.la' "$outputname"
7256 name=$func_stripname_result
7257 eval shared_ext=\"$shrext_cmds\"
7258 eval libname=\"$libname_spec\"
7259 else
7260 func_stripname '' '.la' "$outputname"
7261 libname=$func_stripname_result
7262 fi
7263 ;;
7264 esac
7265
7266 if test -n "$objs"; then
7267 if test "$deplibs_check_method" != pass_all; then
7268 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7269 else
7270 echo
7271 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7272 $ECHO "*** objects $objs is not portable!"
7273 func_append libobjs " $objs"
7274 fi
7275 fi
7276
7277 test "$dlself" != no && \
7278 func_warning "\`-dlopen self' is ignored for libtool libraries"
7279
7280 set dummy $rpath
7281 shift
7282 test "$#" -gt 1 && \
7283 func_warning "ignoring multiple \`-rpath's for a libtool library"
7284
7285 install_libdir="$1"
7286
7287 oldlibs=
7288 if test -z "$rpath"; then
7289 if test "$build_libtool_libs" = yes; then
7290 # Building a libtool convenience library.
7291 # Some compilers have problems with a `.al' extension so
7292 # convenience libraries should have the same extension an
7293 # archive normally would.
7294 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7295 build_libtool_libs=convenience
7296 build_old_libs=yes
7297 fi
7298
7299 test -n "$vinfo" && \
7300 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7301
7302 test -n "$release" && \
7303 func_warning "\`-release' is ignored for convenience libraries"
7304 else
7305
7306 # Parse the version information argument.
7307 save_ifs="$IFS"; IFS=':'
7308 set dummy $vinfo 0 0 0
7309 shift
7310 IFS="$save_ifs"
7311
7312 test -n "$7" && \
7313 func_fatal_help "too many parameters to \`-version-info'"
7314
7315 # convert absolute version numbers to libtool ages
7316 # this retains compatibility with .la files and attempts
7317 # to make the code below a bit more comprehensible
7318
7319 case $vinfo_number in
7320 yes)
7321 number_major="$1"
7322 number_minor="$2"
7323 number_revision="$3"
7324 #
7325 # There are really only two kinds -- those that
7326 # use the current revision as the major version
7327 # and those that subtract age and use age as
7328 # a minor version. But, then there is irix
7329 # which has an extra 1 added just for fun
7330 #
7331 case $version_type in
7332 # correct linux to gnu/linux during the next big refactor
7333 darwin|linux|osf|windows|none)
7334 func_arith $number_major + $number_minor
7335 current=$func_arith_result
7336 age="$number_minor"
7337 revision="$number_revision"
7338 ;;
7339 freebsd-aout|freebsd-elf|qnx|sunos)
7340 current="$number_major"
7341 revision="$number_minor"
7342 age="0"
7343 ;;
7344 irix|nonstopux)
7345 func_arith $number_major + $number_minor
7346 current=$func_arith_result
7347 age="$number_minor"
7348 revision="$number_minor"
7349 lt_irix_increment=no
7350 ;;
7351 esac
7352 ;;
7353 no)
7354 current="$1"
7355 revision="$2"
7356 age="$3"
7357 ;;
7358 esac
7359
7360 # Check that each of the things are valid numbers.
7361 case $current in
7362 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7363 *)
7364 func_error "CURRENT \`$current' must be a nonnegative integer"
7365 func_fatal_error "\`$vinfo' is not valid version information"
7366 ;;
7367 esac
7368
7369 case $revision in
7370 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7371 *)
7372 func_error "REVISION \`$revision' must be a nonnegative integer"
7373 func_fatal_error "\`$vinfo' is not valid version information"
7374 ;;
7375 esac
7376
7377 case $age in
7378 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7379 *)
7380 func_error "AGE \`$age' must be a nonnegative integer"
7381 func_fatal_error "\`$vinfo' is not valid version information"
7382 ;;
7383 esac
7384
7385 if test "$age" -gt "$current"; then
7386 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7387 func_fatal_error "\`$vinfo' is not valid version information"
7388 fi
7389
7390 # Calculate the version variables.
7391 major=
7392 versuffix=
7393 verstring=
7394 case $version_type in
7395 none) ;;
7396
7397 darwin)
7398 # Like Linux, but with the current version available in
7399 # verstring for coding it into the library header
7400 func_arith $current - $age
7401 major=.$func_arith_result
7402 versuffix="$major.$age.$revision"
7403 # Darwin ld doesn't like 0 for these options...
7404 func_arith $current + 1
7405 minor_current=$func_arith_result
7406 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7407 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7408 ;;
7409
7410 freebsd-aout)
7411 major=".$current"
7412 versuffix=".$current.$revision";
7413 ;;
7414
7415 freebsd-elf)
7416 major=".$current"
7417 versuffix=".$current"
7418 ;;
7419
7420 irix | nonstopux)
7421 if test "X$lt_irix_increment" = "Xno"; then
7422 func_arith $current - $age
7423 else
7424 func_arith $current - $age + 1
7425 fi
7426 major=$func_arith_result
7427
7428 case $version_type in
7429 nonstopux) verstring_prefix=nonstopux ;;
7430 *) verstring_prefix=sgi ;;
7431 esac
7432 verstring="$verstring_prefix$major.$revision"
7433
7434 # Add in all the interfaces that we are compatible with.
7435 loop=$revision
7436 while test "$loop" -ne 0; do
7437 func_arith $revision - $loop
7438 iface=$func_arith_result
7439 func_arith $loop - 1
7440 loop=$func_arith_result
7441 verstring="$verstring_prefix$major.$iface:$verstring"
7442 done
7443
7444 # Before this point, $major must not contain `.'.
7445 major=.$major
7446 versuffix="$major.$revision"
7447 ;;
7448
7449 linux) # correct to gnu/linux during the next big refactor
7450 func_arith $current - $age
7451 major=.$func_arith_result
7452 versuffix="$major.$age.$revision"
7453 ;;
7454
7455 osf)
7456 func_arith $current - $age
7457 major=.$func_arith_result
7458 versuffix=".$current.$age.$revision"
7459 verstring="$current.$age.$revision"
7460
7461 # Add in all the interfaces that we are compatible with.
7462 loop=$age
7463 while test "$loop" -ne 0; do
7464 func_arith $current - $loop
7465 iface=$func_arith_result
7466 func_arith $loop - 1
7467 loop=$func_arith_result
7468 verstring="$verstring:${iface}.0"
7469 done
7470
7471 # Make executables depend on our current version.
7472 func_append verstring ":${current}.0"
7473 ;;
7474
7475 qnx)
7476 major=".$current"
7477 versuffix=".$current"
7478 ;;
7479
7480 sunos)
7481 major=".$current"
7482 versuffix=".$current.$revision"
7483 ;;
7484
7485 windows)
7486 # Use '-' rather than '.', since we only want one
7487 # extension on DOS 8.3 filesystems.
7488 func_arith $current - $age
7489 major=$func_arith_result
7490 versuffix="-$major"
7491 ;;
7492
7493 *)
7494 func_fatal_configuration "unknown library version type \`$version_type'"
7495 ;;
7496 esac
7497
7498 # Clear the version info if we defaulted, and they specified a release.
7499 if test -z "$vinfo" && test -n "$release"; then
7500 major=
7501 case $version_type in
7502 darwin)
7503 # we can't check for "0.0" in archive_cmds due to quoting
7504 # problems, so we reset it completely
7505 verstring=
7506 ;;
7507 *)
7508 verstring="0.0"
7509 ;;
7510 esac
7511 if test "$need_version" = no; then
7512 versuffix=
7513 else
7514 versuffix=".0.0"
7515 fi
7516 fi
7517
7518 # Remove version info from name if versioning should be avoided
7519 if test "$avoid_version" = yes && test "$need_version" = no; then
7520 major=
7521 versuffix=
7522 verstring=""
7523 fi
7524
7525 # Check to see if the archive will have undefined symbols.
7526 if test "$allow_undefined" = yes; then
7527 if test "$allow_undefined_flag" = unsupported; then
7528 func_warning "undefined symbols not allowed in $host shared libraries"
7529 build_libtool_libs=no
7530 build_old_libs=yes
7531 fi
7532 else
7533 # Don't allow undefined symbols.
7534 allow_undefined_flag="$no_undefined_flag"
7535 fi
7536
7537 fi
7538
7539 func_generate_dlsyms "$libname" "$libname" "yes"
7540 func_append libobjs " $symfileobj"
7541 test "X$libobjs" = "X " && libobjs=
7542
7543 if test "$opt_mode" != relink; then
7544 # Remove our outputs, but don't remove object files since they
7545 # may have been created when compiling PIC objects.
7546 removelist=
7547 tempremovelist=`$ECHO "$output_objdir/*"`
7548 for p in $tempremovelist; do
7549 case $p in
7550 *.$objext | *.gcno)
7551 ;;
7552 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7553 if test "X$precious_files_regex" != "X"; then
7554 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7555 then
7556 continue
7557 fi
7558 fi
7559 func_append removelist " $p"
7560 ;;
7561 *) ;;
7562 esac
7563 done
7564 test -n "$removelist" && \
7565 func_show_eval "${RM}r \$removelist"
7566 fi
7567
7568 # Now set the variables for building old libraries.
7569 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7570 func_append oldlibs " $output_objdir/$libname.$libext"
7571
7572 # Transform .lo files to .o files.
7573 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
7574 fi
7575
7576 # Eliminate all temporary directories.
7577 #for path in $notinst_path; do
7578 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
7579 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
7580 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
7581 #done
7582
7583 if test -n "$xrpath"; then
7584 # If the user specified any rpath flags, then add them.
7585 temp_xrpath=
7586 for libdir in $xrpath; do
7587 func_replace_sysroot "$libdir"
7588 func_append temp_xrpath " -R$func_replace_sysroot_result"
7589 case "$finalize_rpath " in
7590 *" $libdir "*) ;;
7591 *) func_append finalize_rpath " $libdir" ;;
7592 esac
7593 done
7594 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7595 dependency_libs="$temp_xrpath $dependency_libs"
7596 fi
7597 fi
7598
7599 # Make sure dlfiles contains only unique files that won't be dlpreopened
7600 old_dlfiles="$dlfiles"
7601 dlfiles=
7602 for lib in $old_dlfiles; do
7603 case " $dlprefiles $dlfiles " in
7604 *" $lib "*) ;;
7605 *) func_append dlfiles " $lib" ;;
7606 esac
7607 done
7608
7609 # Make sure dlprefiles contains only unique files
7610 old_dlprefiles="$dlprefiles"
7611 dlprefiles=
7612 for lib in $old_dlprefiles; do
7613 case "$dlprefiles " in
7614 *" $lib "*) ;;
7615 *) func_append dlprefiles " $lib" ;;
7616 esac
7617 done
7618
7619 if test "$build_libtool_libs" = yes; then
7620 if test -n "$rpath"; then
7621 case $host in
7622 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
7623 # these systems don't actually have a c library (as such)!
7624 ;;
7625 *-*-rhapsody* | *-*-darwin1.[012])
7626 # Rhapsody C library is in the System framework
7627 func_append deplibs " System.ltframework"
7628 ;;
7629 *-*-netbsd*)
7630 # Don't link with libc until the a.out ld.so is fixed.
7631 ;;
7632 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7633 # Do not include libc due to us having libc/libc_r.
7634 ;;
7635 *-*-sco3.2v5* | *-*-sco5v6*)
7636 # Causes problems with __ctype
7637 ;;
7638 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7639 # Compiler inserts libc in the correct place for threads to work
7640 ;;
7641 *)
7642 # Add libc to deplibs on all other systems if necessary.
7643 if test "$build_libtool_need_lc" = "yes"; then
7644 func_append deplibs " -lc"
7645 fi
7646 ;;
7647 esac
7648 fi
7649
7650 # Transform deplibs into only deplibs that can be linked in shared.
7651 name_save=$name
7652 libname_save=$libname
7653 release_save=$release
7654 versuffix_save=$versuffix
7655 major_save=$major
7656 # I'm not sure if I'm treating the release correctly. I think
7657 # release should show up in the -l (ie -lgmp5) so we don't want to
7658 # add it in twice. Is that correct?
7659 release=""
7660 versuffix=""
7661 major=""
7662 newdeplibs=
7663 droppeddeps=no
7664 case $deplibs_check_method in
7665 pass_all)
7666 # Don't check for shared/static. Everything works.
7667 # This might be a little naive. We might want to check
7668 # whether the library exists or not. But this is on
7669 # osf3 & osf4 and I'm not really sure... Just
7670 # implementing what was already the behavior.
7671 newdeplibs=$deplibs
7672 ;;
7673 test_compile)
7674 # This code stresses the "libraries are programs" paradigm to its
7675 # limits. Maybe even breaks it. We compile a program, linking it
7676 # against the deplibs as a proxy for the library. Then we can check
7677 # whether they linked in statically or dynamically with ldd.
7678 $opt_dry_run || $RM conftest.c
7679 cat > conftest.c <<EOF
7680 int main() { return 0; }
7681 EOF
7682 $opt_dry_run || $RM conftest
7683 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7684 ldd_output=`ldd conftest`
7685 for i in $deplibs; do
7686 case $i in
7687 -l*)
7688 func_stripname -l '' "$i"
7689 name=$func_stripname_result
7690 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7691 case " $predeps $postdeps " in
7692 *" $i "*)
7693 func_append newdeplibs " $i"
7694 i=""
7695 ;;
7696 esac
7697 fi
7698 if test -n "$i" ; then
7699 libname=`eval "\\$ECHO \"$libname_spec\""`
7700 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7701 set dummy $deplib_matches; shift
7702 deplib_match=$1
7703 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7704 func_append newdeplibs " $i"
7705 else
7706 droppeddeps=yes
7707 echo
7708 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7709 echo "*** I have the capability to make that library automatically link in when"
7710 echo "*** you link to this library. But I can only do this if you have a"
7711 echo "*** shared version of the library, which I believe you do not have"
7712 echo "*** because a test_compile did reveal that the linker did not use it for"
7713 echo "*** its dynamic dependency list that programs get resolved with at runtime."
7714 fi
7715 fi
7716 ;;
7717 *)
7718 func_append newdeplibs " $i"
7719 ;;
7720 esac
7721 done
7722 else
7723 # Error occurred in the first compile. Let's try to salvage
7724 # the situation: Compile a separate program for each library.
7725 for i in $deplibs; do
7726 case $i in
7727 -l*)
7728 func_stripname -l '' "$i"
7729 name=$func_stripname_result
7730 $opt_dry_run || $RM conftest
7731 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7732 ldd_output=`ldd conftest`
7733 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7734 case " $predeps $postdeps " in
7735 *" $i "*)
7736 func_append newdeplibs " $i"
7737 i=""
7738 ;;
7739 esac
7740 fi
7741 if test -n "$i" ; then
7742 libname=`eval "\\$ECHO \"$libname_spec\""`
7743 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7744 set dummy $deplib_matches; shift
7745 deplib_match=$1
7746 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7747 func_append newdeplibs " $i"
7748 else
7749 droppeddeps=yes
7750 echo
7751 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7752 echo "*** I have the capability to make that library automatically link in when"
7753 echo "*** you link to this library. But I can only do this if you have a"
7754 echo "*** shared version of the library, which you do not appear to have"
7755 echo "*** because a test_compile did reveal that the linker did not use this one"
7756 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
7757 fi
7758 fi
7759 else
7760 droppeddeps=yes
7761 echo
7762 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
7763 echo "*** make it link in! You will probably need to install it or some"
7764 echo "*** library that it depends on before this library will be fully"
7765 echo "*** functional. Installing it before continuing would be even better."
7766 fi
7767 ;;
7768 *)
7769 func_append newdeplibs " $i"
7770 ;;
7771 esac
7772 done
7773 fi
7774 ;;
7775 file_magic*)
7776 set dummy $deplibs_check_method; shift
7777 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7778 for a_deplib in $deplibs; do
7779 case $a_deplib in
7780 -l*)
7781 func_stripname -l '' "$a_deplib"
7782 name=$func_stripname_result
7783 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7784 case " $predeps $postdeps " in
7785 *" $a_deplib "*)
7786 func_append newdeplibs " $a_deplib"
7787 a_deplib=""
7788 ;;
7789 esac
7790 fi
7791 if test -n "$a_deplib" ; then
7792 libname=`eval "\\$ECHO \"$libname_spec\""`
7793 if test -n "$file_magic_glob"; then
7794 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7795 else
7796 libnameglob=$libname
7797 fi
7798 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
7799 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7800 if test "$want_nocaseglob" = yes; then
7801 shopt -s nocaseglob
7802 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7803 $nocaseglob
7804 else
7805 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7806 fi
7807 for potent_lib in $potential_libs; do
7808 # Follow soft links.
7809 if ls -lLd "$potent_lib" 2>/dev/null |
7810 $GREP " -> " >/dev/null; then
7811 continue
7812 fi
7813 # The statement above tries to avoid entering an
7814 # endless loop below, in case of cyclic links.
7815 # We might still enter an endless loop, since a link
7816 # loop can be closed while we follow links,
7817 # but so what?
7818 potlib="$potent_lib"
7819 while test -h "$potlib" 2>/dev/null; do
7820 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7821 case $potliblink in
7822 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7823 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
7824 esac
7825 done
7826 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7827 $SED -e 10q |
7828 $EGREP "$file_magic_regex" > /dev/null; then
7829 func_append newdeplibs " $a_deplib"
7830 a_deplib=""
7831 break 2
7832 fi
7833 done
7834 done
7835 fi
7836 if test -n "$a_deplib" ; then
7837 droppeddeps=yes
7838 echo
7839 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7840 echo "*** I have the capability to make that library automatically link in when"
7841 echo "*** you link to this library. But I can only do this if you have a"
7842 echo "*** shared version of the library, which you do not appear to have"
7843 echo "*** because I did check the linker path looking for a file starting"
7844 if test -z "$potlib" ; then
7845 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7846 else
7847 $ECHO "*** with $libname and none of the candidates passed a file format test"
7848 $ECHO "*** using a file magic. Last file checked: $potlib"
7849 fi
7850 fi
7851 ;;
7852 *)
7853 # Add a -L argument.
7854 func_append newdeplibs " $a_deplib"
7855 ;;
7856 esac
7857 done # Gone through all deplibs.
7858 ;;
7859 match_pattern*)
7860 set dummy $deplibs_check_method; shift
7861 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7862 for a_deplib in $deplibs; do
7863 case $a_deplib in
7864 -l*)
7865 func_stripname -l '' "$a_deplib"
7866 name=$func_stripname_result
7867 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7868 case " $predeps $postdeps " in
7869 *" $a_deplib "*)
7870 func_append newdeplibs " $a_deplib"
7871 a_deplib=""
7872 ;;
7873 esac
7874 fi
7875 if test -n "$a_deplib" ; then
7876 libname=`eval "\\$ECHO \"$libname_spec\""`
7877 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7878 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7879 for potent_lib in $potential_libs; do
7880 potlib="$potent_lib" # see symlink-check above in file_magic test
7881 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7882 $EGREP "$match_pattern_regex" > /dev/null; then
7883 func_append newdeplibs " $a_deplib"
7884 a_deplib=""
7885 break 2
7886 fi
7887 done
7888 done
7889 fi
7890 if test -n "$a_deplib" ; then
7891 droppeddeps=yes
7892 echo
7893 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7894 echo "*** I have the capability to make that library automatically link in when"
7895 echo "*** you link to this library. But I can only do this if you have a"
7896 echo "*** shared version of the library, which you do not appear to have"
7897 echo "*** because I did check the linker path looking for a file starting"
7898 if test -z "$potlib" ; then
7899 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7900 else
7901 $ECHO "*** with $libname and none of the candidates passed a file format test"
7902 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7903 fi
7904 fi
7905 ;;
7906 *)
7907 # Add a -L argument.
7908 func_append newdeplibs " $a_deplib"
7909 ;;
7910 esac
7911 done # Gone through all deplibs.
7912 ;;
7913 none | unknown | *)
7914 newdeplibs=""
7915 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7916 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7917 for i in $predeps $postdeps ; do
7918 # can't use Xsed below, because $i might contain '/'
7919 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
7920 done
7921 fi
7922 case $tmp_deplibs in
7923 *[!\ \ ]*)
7924 echo
7925 if test "X$deplibs_check_method" = "Xnone"; then
7926 echo "*** Warning: inter-library dependencies are not supported in this platform."
7927 else
7928 echo "*** Warning: inter-library dependencies are not known to be supported."
7929 fi
7930 echo "*** All declared inter-library dependencies are being dropped."
7931 droppeddeps=yes
7932 ;;
7933 esac
7934 ;;
7935 esac
7936 versuffix=$versuffix_save
7937 major=$major_save
7938 release=$release_save
7939 libname=$libname_save
7940 name=$name_save
7941
7942 case $host in
7943 *-*-rhapsody* | *-*-darwin1.[012])
7944 # On Rhapsody replace the C library with the System framework
7945 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
7946 ;;
7947 esac
7948
7949 if test "$droppeddeps" = yes; then
7950 if test "$module" = yes; then
7951 echo
7952 echo "*** Warning: libtool could not satisfy all declared inter-library"
7953 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7954 echo "*** a static module, that should work as long as the dlopening"
7955 echo "*** application is linked with the -dlopen flag."
7956 if test -z "$global_symbol_pipe"; then
7957 echo
7958 echo "*** However, this would only work if libtool was able to extract symbol"
7959 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7960 echo "*** not find such a program. So, this module is probably useless."
7961 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7962 fi
7963 if test "$build_old_libs" = no; then
7964 oldlibs="$output_objdir/$libname.$libext"
7965 build_libtool_libs=module
7966 build_old_libs=yes
7967 else
7968 build_libtool_libs=no
7969 fi
7970 else
7971 echo "*** The inter-library dependencies that have been dropped here will be"
7972 echo "*** automatically added whenever a program is linked with this library"
7973 echo "*** or is declared to -dlopen it."
7974
7975 if test "$allow_undefined" = no; then
7976 echo
7977 echo "*** Since this library must not contain undefined symbols,"
7978 echo "*** because either the platform does not support them or"
7979 echo "*** it was explicitly requested with -no-undefined,"
7980 echo "*** libtool will only create a static version of it."
7981 if test "$build_old_libs" = no; then
7982 oldlibs="$output_objdir/$libname.$libext"
7983 build_libtool_libs=module
7984 build_old_libs=yes
7985 else
7986 build_libtool_libs=no
7987 fi
7988 fi
7989 fi
7990 fi
7991 # Done checking deplibs!
7992 deplibs=$newdeplibs
7993 fi
7994 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7995 case $host in
7996 *-*-darwin*)
7997 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7998 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7999 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8000 ;;
8001 esac
8002
8003 # move library search paths that coincide with paths to not yet
8004 # installed libraries to the beginning of the library search list
8005 new_libs=
8006 for path in $notinst_path; do
8007 case " $new_libs " in
8008 *" -L$path/$objdir "*) ;;
8009 *)
8010 case " $deplibs " in
8011 *" -L$path/$objdir "*)
8012 func_append new_libs " -L$path/$objdir" ;;
8013 esac
8014 ;;
8015 esac
8016 done
8017 for deplib in $deplibs; do
8018 case $deplib in
8019 -L*)
8020 case " $new_libs " in
8021 *" $deplib "*) ;;
8022 *) func_append new_libs " $deplib" ;;
8023 esac
8024 ;;
8025 *) func_append new_libs " $deplib" ;;
8026 esac
8027 done
8028 deplibs="$new_libs"
8029
8030 # All the library-specific variables (install_libdir is set above).
8031 library_names=
8032 old_library=
8033 dlname=
8034
8035 # Test again, we may have decided not to build it any more
8036 if test "$build_libtool_libs" = yes; then
8037 # Remove ${wl} instances when linking with ld.
8038 # FIXME: should test the right _cmds variable.
8039 case $archive_cmds in
8040 *\$LD\ *) wl= ;;
8041 esac
8042 if test "$hardcode_into_libs" = yes; then
8043 # Hardcode the library paths
8044 hardcode_libdirs=
8045 dep_rpath=
8046 rpath="$finalize_rpath"
8047 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8048 for libdir in $rpath; do
8049 if test -n "$hardcode_libdir_flag_spec"; then
8050 if test -n "$hardcode_libdir_separator"; then
8051 func_replace_sysroot "$libdir"
8052 libdir=$func_replace_sysroot_result
8053 if test -z "$hardcode_libdirs"; then
8054 hardcode_libdirs="$libdir"
8055 else
8056 # Just accumulate the unique libdirs.
8057 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8058 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8059 ;;
8060 *)
8061 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8062 ;;
8063 esac
8064 fi
8065 else
8066 eval flag=\"$hardcode_libdir_flag_spec\"
8067 func_append dep_rpath " $flag"
8068 fi
8069 elif test -n "$runpath_var"; then
8070 case "$perm_rpath " in
8071 *" $libdir "*) ;;
8072 *) func_append perm_rpath " $libdir" ;;
8073 esac
8074 fi
8075 done
8076 # Substitute the hardcoded libdirs into the rpath.
8077 if test -n "$hardcode_libdir_separator" &&
8078 test -n "$hardcode_libdirs"; then
8079 libdir="$hardcode_libdirs"
8080 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8081 fi
8082 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8083 # We should set the runpath_var.
8084 rpath=
8085 for dir in $perm_rpath; do
8086 func_append rpath "$dir:"
8087 done
8088 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8089 fi
8090 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8091 fi
8092
8093 shlibpath="$finalize_shlibpath"
8094 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8095 if test -n "$shlibpath"; then
8096 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8097 fi
8098
8099 # Get the real and link names of the library.
8100 eval shared_ext=\"$shrext_cmds\"
8101 eval library_names=\"$library_names_spec\"
8102 set dummy $library_names
8103 shift
8104 realname="$1"
8105 shift
8106
8107 if test -n "$soname_spec"; then
8108 eval soname=\"$soname_spec\"
8109 else
8110 soname="$realname"
8111 fi
8112 if test -z "$dlname"; then
8113 dlname=$soname
8114 fi
8115
8116 lib="$output_objdir/$realname"
8117 linknames=
8118 for link
8119 do
8120 func_append linknames " $link"
8121 done
8122
8123 # Use standard objects if they are pic
8124 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8125 test "X$libobjs" = "X " && libobjs=
8126
8127 delfiles=
8128 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8129 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8130 export_symbols="$output_objdir/$libname.uexp"
8131 func_append delfiles " $export_symbols"
8132 fi
8133
8134 orig_export_symbols=
8135 case $host_os in
8136 cygwin* | mingw* | cegcc*)
8137 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8138 # exporting using user supplied symfile
8139 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8140 # and it's NOT already a .def file. Must figure out
8141 # which of the given symbols are data symbols and tag
8142 # them as such. So, trigger use of export_symbols_cmds.
8143 # export_symbols gets reassigned inside the "prepare
8144 # the list of exported symbols" if statement, so the
8145 # include_expsyms logic still works.
8146 orig_export_symbols="$export_symbols"
8147 export_symbols=
8148 always_export_symbols=yes
8149 fi
8150 fi
8151 ;;
8152 esac
8153
8154 # Prepare the list of exported symbols
8155 if test -z "$export_symbols"; then
8156 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8157 func_verbose "generating symbol list for \`$libname.la'"
8158 export_symbols="$output_objdir/$libname.exp"
8159 $opt_dry_run || $RM $export_symbols
8160 cmds=$export_symbols_cmds
8161 save_ifs="$IFS"; IFS='~'
8162 for cmd1 in $cmds; do
8163 IFS="$save_ifs"
8164 # Take the normal branch if the nm_file_list_spec branch
8165 # doesn't work or if tool conversion is not needed.
8166 case $nm_file_list_spec~$to_tool_file_cmd in
8167 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8168 try_normal_branch=yes
8169 eval cmd=\"$cmd1\"
8170 func_len " $cmd"
8171 len=$func_len_result
8172 ;;
8173 *)
8174 try_normal_branch=no
8175 ;;
8176 esac
8177 if test "$try_normal_branch" = yes \
8178 && { test "$len" -lt "$max_cmd_len" \
8179 || test "$max_cmd_len" -le -1; }
8180 then
8181 func_show_eval "$cmd" 'exit $?'
8182 skipped_export=false
8183 elif test -n "$nm_file_list_spec"; then
8184 func_basename "$output"
8185 output_la=$func_basename_result
8186 save_libobjs=$libobjs
8187 save_output=$output
8188 output=${output_objdir}/${output_la}.nm
8189 func_to_tool_file "$output"
8190 libobjs=$nm_file_list_spec$func_to_tool_file_result
8191 func_append delfiles " $output"
8192 func_verbose "creating $NM input file list: $output"
8193 for obj in $save_libobjs; do
8194 func_to_tool_file "$obj"
8195 $ECHO "$func_to_tool_file_result"
8196 done > "$output"
8197 eval cmd=\"$cmd1\"
8198 func_show_eval "$cmd" 'exit $?'
8199 output=$save_output
8200 libobjs=$save_libobjs
8201 skipped_export=false
8202 else
8203 # The command line is too long to execute in one step.
8204 func_verbose "using reloadable object file for export list..."
8205 skipped_export=:
8206 # Break out early, otherwise skipped_export may be
8207 # set to false by a later but shorter cmd.
8208 break
8209 fi
8210 done
8211 IFS="$save_ifs"
8212 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8213 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8214 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8215 fi
8216 fi
8217 fi
8218
8219 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8220 tmp_export_symbols="$export_symbols"
8221 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8222 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8223 fi
8224
8225 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8226 # The given exports_symbols file has to be filtered, so filter it.
8227 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8228 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8229 # 's' commands which not all seds can handle. GNU sed should be fine
8230 # though. Also, the filter scales superlinearly with the number of
8231 # global variables. join(1) would be nice here, but unfortunately
8232 # isn't a blessed tool.
8233 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8234 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8235 export_symbols=$output_objdir/$libname.def
8236 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8237 fi
8238
8239 tmp_deplibs=
8240 for test_deplib in $deplibs; do
8241 case " $convenience " in
8242 *" $test_deplib "*) ;;
8243 *)
8244 func_append tmp_deplibs " $test_deplib"
8245 ;;
8246 esac
8247 done
8248 deplibs="$tmp_deplibs"
8249
8250 if test -n "$convenience"; then
8251 if test -n "$whole_archive_flag_spec" &&
8252 test "$compiler_needs_object" = yes &&
8253 test -z "$libobjs"; then
8254 # extract the archives, so we have objects to list.
8255 # TODO: could optimize this to just extract one archive.
8256 whole_archive_flag_spec=
8257 fi
8258 if test -n "$whole_archive_flag_spec"; then
8259 save_libobjs=$libobjs
8260 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8261 test "X$libobjs" = "X " && libobjs=
8262 else
8263 gentop="$output_objdir/${outputname}x"
8264 func_append generated " $gentop"
8265
8266 func_extract_archives $gentop $convenience
8267 func_append libobjs " $func_extract_archives_result"
8268 test "X$libobjs" = "X " && libobjs=
8269 fi
8270 fi
8271
8272 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8273 eval flag=\"$thread_safe_flag_spec\"
8274 func_append linker_flags " $flag"
8275 fi
8276
8277 # Make a backup of the uninstalled library when relinking
8278 if test "$opt_mode" = relink; then
8279 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8280 fi
8281
8282 # Do each of the archive commands.
8283 if test "$module" = yes && test -n "$module_cmds" ; then
8284 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8285 eval test_cmds=\"$module_expsym_cmds\"
8286 cmds=$module_expsym_cmds
8287 else
8288 eval test_cmds=\"$module_cmds\"
8289 cmds=$module_cmds
8290 fi
8291 else
8292 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8293 eval test_cmds=\"$archive_expsym_cmds\"
8294 cmds=$archive_expsym_cmds
8295 else
8296 eval test_cmds=\"$archive_cmds\"
8297 cmds=$archive_cmds
8298 fi
8299 fi
8300
8301 if test "X$skipped_export" != "X:" &&
8302 func_len " $test_cmds" &&
8303 len=$func_len_result &&
8304 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8305 :
8306 else
8307 # The command line is too long to link in one step, link piecewise
8308 # or, if using GNU ld and skipped_export is not :, use a linker
8309 # script.
8310
8311 # Save the value of $output and $libobjs because we want to
8312 # use them later. If we have whole_archive_flag_spec, we
8313 # want to use save_libobjs as it was before
8314 # whole_archive_flag_spec was expanded, because we can't
8315 # assume the linker understands whole_archive_flag_spec.
8316 # This may have to be revisited, in case too many
8317 # convenience libraries get linked in and end up exceeding
8318 # the spec.
8319 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8320 save_libobjs=$libobjs
8321 fi
8322 save_output=$output
8323 func_basename "$output"
8324 output_la=$func_basename_result
8325
8326 # Clear the reloadable object creation command queue and
8327 # initialize k to one.
8328 test_cmds=
8329 concat_cmds=
8330 objlist=
8331 last_robj=
8332 k=1
8333
8334 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8335 output=${output_objdir}/${output_la}.lnkscript
8336 func_verbose "creating GNU ld script: $output"
8337 echo 'INPUT (' > $output
8338 for obj in $save_libobjs
8339 do
8340 func_to_tool_file "$obj"
8341 $ECHO "$func_to_tool_file_result" >> $output
8342 done
8343 echo ')' >> $output
8344 func_append delfiles " $output"
8345 func_to_tool_file "$output"
8346 output=$func_to_tool_file_result
8347 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8348 output=${output_objdir}/${output_la}.lnk
8349 func_verbose "creating linker input file list: $output"
8350 : > $output
8351 set x $save_libobjs
8352 shift
8353 firstobj=
8354 if test "$compiler_needs_object" = yes; then
8355 firstobj="$1 "
8356 shift
8357 fi
8358 for obj
8359 do
8360 func_to_tool_file "$obj"
8361 $ECHO "$func_to_tool_file_result" >> $output
8362 done
8363 func_append delfiles " $output"
8364 func_to_tool_file "$output"
8365 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8366 else
8367 if test -n "$save_libobjs"; then
8368 func_verbose "creating reloadable object files..."
8369 output=$output_objdir/$output_la-${k}.$objext
8370 eval test_cmds=\"$reload_cmds\"
8371 func_len " $test_cmds"
8372 len0=$func_len_result
8373 len=$len0
8374
8375 # Loop over the list of objects to be linked.
8376 for obj in $save_libobjs
8377 do
8378 func_len " $obj"
8379 func_arith $len + $func_len_result
8380 len=$func_arith_result
8381 if test "X$objlist" = X ||
8382 test "$len" -lt "$max_cmd_len"; then
8383 func_append objlist " $obj"
8384 else
8385 # The command $test_cmds is almost too long, add a
8386 # command to the queue.
8387 if test "$k" -eq 1 ; then
8388 # The first file doesn't have a previous command to add.
8389 reload_objs=$objlist
8390 eval concat_cmds=\"$reload_cmds\"
8391 else
8392 # All subsequent reloadable object files will link in
8393 # the last one created.
8394 reload_objs="$objlist $last_robj"
8395 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8396 fi
8397 last_robj=$output_objdir/$output_la-${k}.$objext
8398 func_arith $k + 1
8399 k=$func_arith_result
8400 output=$output_objdir/$output_la-${k}.$objext
8401 objlist=" $obj"
8402 func_len " $last_robj"
8403 func_arith $len0 + $func_len_result
8404 len=$func_arith_result
8405 fi
8406 done
8407 # Handle the remaining objects by creating one last
8408 # reloadable object file. All subsequent reloadable object
8409 # files will link in the last one created.
8410 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8411 reload_objs="$objlist $last_robj"
8412 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8413 if test -n "$last_robj"; then
8414 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8415 fi
8416 func_append delfiles " $output"
8417
8418 else
8419 output=
8420 fi
8421
8422 if ${skipped_export-false}; then
8423 func_verbose "generating symbol list for \`$libname.la'"
8424 export_symbols="$output_objdir/$libname.exp"
8425 $opt_dry_run || $RM $export_symbols
8426 libobjs=$output
8427 # Append the command to create the export file.
8428 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8429 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8430 if test -n "$last_robj"; then
8431 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8432 fi
8433 fi
8434
8435 test -n "$save_libobjs" &&
8436 func_verbose "creating a temporary reloadable object file: $output"
8437
8438 # Loop through the commands generated above and execute them.
8439 save_ifs="$IFS"; IFS='~'
8440 for cmd in $concat_cmds; do
8441 IFS="$save_ifs"
8442 $opt_silent || {
8443 func_quote_for_expand "$cmd"
8444 eval "func_echo $func_quote_for_expand_result"
8445 }
8446 $opt_dry_run || eval "$cmd" || {
8447 lt_exit=$?
8448
8449 # Restore the uninstalled library and exit
8450 if test "$opt_mode" = relink; then
8451 ( cd "$output_objdir" && \
8452 $RM "${realname}T" && \
8453 $MV "${realname}U" "$realname" )
8454 fi
8455
8456 exit $lt_exit
8457 }
8458 done
8459 IFS="$save_ifs"
8460
8461 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8462 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8463 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8464 fi
8465 fi
8466
8467 if ${skipped_export-false}; then
8468 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8469 tmp_export_symbols="$export_symbols"
8470 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8471 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8472 fi
8473
8474 if test -n "$orig_export_symbols"; then
8475 # The given exports_symbols file has to be filtered, so filter it.
8476 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8477 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8478 # 's' commands which not all seds can handle. GNU sed should be fine
8479 # though. Also, the filter scales superlinearly with the number of
8480 # global variables. join(1) would be nice here, but unfortunately
8481 # isn't a blessed tool.
8482 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8483 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8484 export_symbols=$output_objdir/$libname.def
8485 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8486 fi
8487 fi
8488
8489 libobjs=$output
8490 # Restore the value of output.
8491 output=$save_output
8492
8493 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8494 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8495 test "X$libobjs" = "X " && libobjs=
8496 fi
8497 # Expand the library linking commands again to reset the
8498 # value of $libobjs for piecewise linking.
8499
8500 # Do each of the archive commands.
8501 if test "$module" = yes && test -n "$module_cmds" ; then
8502 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8503 cmds=$module_expsym_cmds
8504 else
8505 cmds=$module_cmds
8506 fi
8507 else
8508 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8509 cmds=$archive_expsym_cmds
8510 else
8511 cmds=$archive_cmds
8512 fi
8513 fi
8514 fi
8515
8516 if test -n "$delfiles"; then
8517 # Append the command to remove temporary files to $cmds.
8518 eval cmds=\"\$cmds~\$RM $delfiles\"
8519 fi
8520
8521 # Add any objects from preloaded convenience libraries
8522 if test -n "$dlprefiles"; then
8523 gentop="$output_objdir/${outputname}x"
8524 func_append generated " $gentop"
8525
8526 func_extract_archives $gentop $dlprefiles
8527 func_append libobjs " $func_extract_archives_result"
8528 test "X$libobjs" = "X " && libobjs=
8529 fi
8530
8531 save_ifs="$IFS"; IFS='~'
8532 for cmd in $cmds; do
8533 IFS="$save_ifs"
8534 eval cmd=\"$cmd\"
8535 $opt_silent || {
8536 func_quote_for_expand "$cmd"
8537 eval "func_echo $func_quote_for_expand_result"
8538 }
8539 $opt_dry_run || eval "$cmd" || {
8540 lt_exit=$?
8541
8542 # Restore the uninstalled library and exit
8543 if test "$opt_mode" = relink; then
8544 ( cd "$output_objdir" && \
8545 $RM "${realname}T" && \
8546 $MV "${realname}U" "$realname" )
8547 fi
8548
8549 exit $lt_exit
8550 }
8551 done
8552 IFS="$save_ifs"
8553
8554 # Restore the uninstalled library and exit
8555 if test "$opt_mode" = relink; then
8556 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8557
8558 if test -n "$convenience"; then
8559 if test -z "$whole_archive_flag_spec"; then
8560 func_show_eval '${RM}r "$gentop"'
8561 fi
8562 fi
8563
8564 exit $EXIT_SUCCESS
8565 fi
8566
8567 # Create links to the real library.
8568 for linkname in $linknames; do
8569 if test "$realname" != "$linkname"; then
8570 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
8571 fi
8572 done
8573
8574 # If -module or -export-dynamic was specified, set the dlname.
8575 if test "$module" = yes || test "$export_dynamic" = yes; then
8576 # On all known operating systems, these are identical.
8577 dlname="$soname"
8578 fi
8579 fi
8580 ;;
8581
8582 obj)
8583 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8584 func_warning "\`-dlopen' is ignored for objects"
8585 fi
8586
8587 case " $deplibs" in
8588 *\ -l* | *\ -L*)
8589 func_warning "\`-l' and \`-L' are ignored for objects" ;;
8590 esac
8591
8592 test -n "$rpath" && \
8593 func_warning "\`-rpath' is ignored for objects"
8594
8595 test -n "$xrpath" && \
8596 func_warning "\`-R' is ignored for objects"
8597
8598 test -n "$vinfo" && \
8599 func_warning "\`-version-info' is ignored for objects"
8600
8601 test -n "$release" && \
8602 func_warning "\`-release' is ignored for objects"
8603
8604 case $output in
8605 *.lo)
8606 test -n "$objs$old_deplibs" && \
8607 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
8608
8609 libobj=$output
8610 func_lo2o "$libobj"
8611 obj=$func_lo2o_result
8612 ;;
8613 *)
8614 libobj=
8615 obj="$output"
8616 ;;
8617 esac
8618
8619 # Delete the old objects.
8620 $opt_dry_run || $RM $obj $libobj
8621
8622 # Objects from convenience libraries. This assumes
8623 # single-version convenience libraries. Whenever we create
8624 # different ones for PIC/non-PIC, this we'll have to duplicate
8625 # the extraction.
8626 reload_conv_objs=
8627 gentop=
8628 # reload_cmds runs $LD directly, so let us get rid of
8629 # -Wl from whole_archive_flag_spec and hope we can get by with
8630 # turning comma into space..
8631 wl=
8632
8633 if test -n "$convenience"; then
8634 if test -n "$whole_archive_flag_spec"; then
8635 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8636 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
8637 else
8638 gentop="$output_objdir/${obj}x"
8639 func_append generated " $gentop"
8640
8641 func_extract_archives $gentop $convenience
8642 reload_conv_objs="$reload_objs $func_extract_archives_result"
8643 fi
8644 fi
8645
8646 # If we're not building shared, we need to use non_pic_objs
8647 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
8648
8649 # Create the old-style object.
8650 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8651
8652 output="$obj"
8653 func_execute_cmds "$reload_cmds" 'exit $?'
8654
8655 # Exit if we aren't doing a library object file.
8656 if test -z "$libobj"; then
8657 if test -n "$gentop"; then
8658 func_show_eval '${RM}r "$gentop"'
8659 fi
8660
8661 exit $EXIT_SUCCESS
8662 fi
8663
8664 if test "$build_libtool_libs" != yes; then
8665 if test -n "$gentop"; then
8666 func_show_eval '${RM}r "$gentop"'
8667 fi
8668
8669 # Create an invalid libtool object if no PIC, so that we don't
8670 # accidentally link it into a program.
8671 # $show "echo timestamp > $libobj"
8672 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8673 exit $EXIT_SUCCESS
8674 fi
8675
8676 if test -n "$pic_flag" || test "$pic_mode" != default; then
8677 # Only do commands if we really have different PIC objects.
8678 reload_objs="$libobjs $reload_conv_objs"
8679 output="$libobj"
8680 func_execute_cmds "$reload_cmds" 'exit $?'
8681 fi
8682
8683 if test -n "$gentop"; then
8684 func_show_eval '${RM}r "$gentop"'
8685 fi
8686
8687 exit $EXIT_SUCCESS
8688 ;;
8689
8690 prog)
8691 case $host in
8692 *cygwin*) func_stripname '' '.exe' "$output"
8693 output=$func_stripname_result.exe;;
8694 esac
8695 test -n "$vinfo" && \
8696 func_warning "\`-version-info' is ignored for programs"
8697
8698 test -n "$release" && \
8699 func_warning "\`-release' is ignored for programs"
8700
8701 test "$preload" = yes \
8702 && test "$dlopen_support" = unknown \
8703 && test "$dlopen_self" = unknown \
8704 && test "$dlopen_self_static" = unknown && \
8705 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8706
8707 case $host in
8708 *-*-rhapsody* | *-*-darwin1.[012])
8709 # On Rhapsody replace the C library is the System framework
8710 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
8711 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
8712 ;;
8713 esac
8714
8715 case $host in
8716 *-*-darwin*)
8717 # Don't allow lazy linking, it breaks C++ global constructors
8718 # But is supposedly fixed on 10.4 or later (yay!).
8719 if test "$tagname" = CXX ; then
8720 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8721 10.[0123])
8722 func_append compile_command " ${wl}-bind_at_load"
8723 func_append finalize_command " ${wl}-bind_at_load"
8724 ;;
8725 esac
8726 fi
8727 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8728 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8729 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8730 ;;
8731 esac
8732
8733
8734 # move library search paths that coincide with paths to not yet
8735 # installed libraries to the beginning of the library search list
8736 new_libs=
8737 for path in $notinst_path; do
8738 case " $new_libs " in
8739 *" -L$path/$objdir "*) ;;
8740 *)
8741 case " $compile_deplibs " in
8742 *" -L$path/$objdir "*)
8743 func_append new_libs " -L$path/$objdir" ;;
8744 esac
8745 ;;
8746 esac
8747 done
8748 for deplib in $compile_deplibs; do
8749 case $deplib in
8750 -L*)
8751 case " $new_libs " in
8752 *" $deplib "*) ;;
8753 *) func_append new_libs " $deplib" ;;
8754 esac
8755 ;;
8756 *) func_append new_libs " $deplib" ;;
8757 esac
8758 done
8759 compile_deplibs="$new_libs"
8760
8761
8762 func_append compile_command " $compile_deplibs"
8763 func_append finalize_command " $finalize_deplibs"
8764
8765 if test -n "$rpath$xrpath"; then
8766 # If the user specified any rpath flags, then add them.
8767 for libdir in $rpath $xrpath; do
8768 # This is the magic to use -rpath.
8769 case "$finalize_rpath " in
8770 *" $libdir "*) ;;
8771 *) func_append finalize_rpath " $libdir" ;;
8772 esac
8773 done
8774 fi
8775
8776 # Now hardcode the library paths
8777 rpath=
8778 hardcode_libdirs=
8779 for libdir in $compile_rpath $finalize_rpath; do
8780 if test -n "$hardcode_libdir_flag_spec"; then
8781 if test -n "$hardcode_libdir_separator"; then
8782 if test -z "$hardcode_libdirs"; then
8783 hardcode_libdirs="$libdir"
8784 else
8785 # Just accumulate the unique libdirs.
8786 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8787 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8788 ;;
8789 *)
8790 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8791 ;;
8792 esac
8793 fi
8794 else
8795 eval flag=\"$hardcode_libdir_flag_spec\"
8796 func_append rpath " $flag"
8797 fi
8798 elif test -n "$runpath_var"; then
8799 case "$perm_rpath " in
8800 *" $libdir "*) ;;
8801 *) func_append perm_rpath " $libdir" ;;
8802 esac
8803 fi
8804 case $host in
8805 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8806 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
8807 case :$dllsearchpath: in
8808 *":$libdir:"*) ;;
8809 ::) dllsearchpath=$libdir;;
8810 *) func_append dllsearchpath ":$libdir";;
8811 esac
8812 case :$dllsearchpath: in
8813 *":$testbindir:"*) ;;
8814 ::) dllsearchpath=$testbindir;;
8815 *) func_append dllsearchpath ":$testbindir";;
8816 esac
8817 ;;
8818 esac
8819 done
8820 # Substitute the hardcoded libdirs into the rpath.
8821 if test -n "$hardcode_libdir_separator" &&
8822 test -n "$hardcode_libdirs"; then
8823 libdir="$hardcode_libdirs"
8824 eval rpath=\" $hardcode_libdir_flag_spec\"
8825 fi
8826 compile_rpath="$rpath"
8827
8828 rpath=
8829 hardcode_libdirs=
8830 for libdir in $finalize_rpath; do
8831 if test -n "$hardcode_libdir_flag_spec"; then
8832 if test -n "$hardcode_libdir_separator"; then
8833 if test -z "$hardcode_libdirs"; then
8834 hardcode_libdirs="$libdir"
8835 else
8836 # Just accumulate the unique libdirs.
8837 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8838 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8839 ;;
8840 *)
8841 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8842 ;;
8843 esac
8844 fi
8845 else
8846 eval flag=\"$hardcode_libdir_flag_spec\"
8847 func_append rpath " $flag"
8848 fi
8849 elif test -n "$runpath_var"; then
8850 case "$finalize_perm_rpath " in
8851 *" $libdir "*) ;;
8852 *) func_append finalize_perm_rpath " $libdir" ;;
8853 esac
8854 fi
8855 done
8856 # Substitute the hardcoded libdirs into the rpath.
8857 if test -n "$hardcode_libdir_separator" &&
8858 test -n "$hardcode_libdirs"; then
8859 libdir="$hardcode_libdirs"
8860 eval rpath=\" $hardcode_libdir_flag_spec\"
8861 fi
8862 finalize_rpath="$rpath"
8863
8864 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8865 # Transform all the library objects into standard objects.
8866 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8867 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8868 fi
8869
8870 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8871
8872 # template prelinking step
8873 if test -n "$prelink_cmds"; then
8874 func_execute_cmds "$prelink_cmds" 'exit $?'
8875 fi
8876
8877 wrappers_required=yes
8878 case $host in
8879 *cegcc* | *mingw32ce*)
8880 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8881 wrappers_required=no
8882 ;;
8883 *cygwin* | *mingw* )
8884 if test "$build_libtool_libs" != yes; then
8885 wrappers_required=no
8886 fi
8887 ;;
8888 *)
8889 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8890 wrappers_required=no
8891 fi
8892 ;;
8893 esac
8894 if test "$wrappers_required" = no; then
8895 # Replace the output file specification.
8896 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8897 link_command="$compile_command$compile_rpath"
8898
8899 # We have no uninstalled library dependencies, so finalize right now.
8900 exit_status=0
8901 func_show_eval "$link_command" 'exit_status=$?'
8902
8903 if test -n "$postlink_cmds"; then
8904 func_to_tool_file "$output"
8905 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8906 func_execute_cmds "$postlink_cmds" 'exit $?'
8907 fi
8908
8909 # Delete the generated files.
8910 if test -f "$output_objdir/${outputname}S.${objext}"; then
8911 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8912 fi
8913
8914 exit $exit_status
8915 fi
8916
8917 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8918 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8919 fi
8920 if test -n "$finalize_shlibpath"; then
8921 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8922 fi
8923
8924 compile_var=
8925 finalize_var=
8926 if test -n "$runpath_var"; then
8927 if test -n "$perm_rpath"; then
8928 # We should set the runpath_var.
8929 rpath=
8930 for dir in $perm_rpath; do
8931 func_append rpath "$dir:"
8932 done
8933 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8934 fi
8935 if test -n "$finalize_perm_rpath"; then
8936 # We should set the runpath_var.
8937 rpath=
8938 for dir in $finalize_perm_rpath; do
8939 func_append rpath "$dir:"
8940 done
8941 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8942 fi
8943 fi
8944
8945 if test "$no_install" = yes; then
8946 # We don't need to create a wrapper script.
8947 link_command="$compile_var$compile_command$compile_rpath"
8948 # Replace the output file specification.
8949 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8950 # Delete the old output file.
8951 $opt_dry_run || $RM $output
8952 # Link the executable and exit
8953 func_show_eval "$link_command" 'exit $?'
8954
8955 if test -n "$postlink_cmds"; then
8956 func_to_tool_file "$output"
8957 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8958 func_execute_cmds "$postlink_cmds" 'exit $?'
8959 fi
8960
8961 exit $EXIT_SUCCESS
8962 fi
8963
8964 if test "$hardcode_action" = relink; then
8965 # Fast installation is not supported
8966 link_command="$compile_var$compile_command$compile_rpath"
8967 relink_command="$finalize_var$finalize_command$finalize_rpath"
8968
8969 func_warning "this platform does not like uninstalled shared libraries"
8970 func_warning "\`$output' will be relinked during installation"
8971 else
8972 if test "$fast_install" != no; then
8973 link_command="$finalize_var$compile_command$finalize_rpath"
8974 if test "$fast_install" = yes; then
8975 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8976 else
8977 # fast_install is set to needless
8978 relink_command=
8979 fi
8980 else
8981 link_command="$compile_var$compile_command$compile_rpath"
8982 relink_command="$finalize_var$finalize_command$finalize_rpath"
8983 fi
8984 fi
8985
8986 # Replace the output file specification.
8987 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8988
8989 # Delete the old output files.
8990 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8991
8992 func_show_eval "$link_command" 'exit $?'
8993
8994 if test -n "$postlink_cmds"; then
8995 func_to_tool_file "$output_objdir/$outputname"
8996 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8997 func_execute_cmds "$postlink_cmds" 'exit $?'
8998 fi
8999
9000 # Now create the wrapper script.
9001 func_verbose "creating $output"
9002
9003 # Quote the relink command for shipping.
9004 if test -n "$relink_command"; then
9005 # Preserve any variables that may affect compiler behavior
9006 for var in $variables_saved_for_relink; do
9007 if eval test -z \"\${$var+set}\"; then
9008 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9009 elif eval var_value=\$$var; test -z "$var_value"; then
9010 relink_command="$var=; export $var; $relink_command"
9011 else
9012 func_quote_for_eval "$var_value"
9013 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9014 fi
9015 done
9016 relink_command="(cd `pwd`; $relink_command)"
9017 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9018 fi
9019
9020 # Only actually do things if not in dry run mode.
9021 $opt_dry_run || {
9022 # win32 will think the script is a binary if it has
9023 # a .exe suffix, so we strip it off here.
9024 case $output in
9025 *.exe) func_stripname '' '.exe' "$output"
9026 output=$func_stripname_result ;;
9027 esac
9028 # test for cygwin because mv fails w/o .exe extensions
9029 case $host in
9030 *cygwin*)
9031 exeext=.exe
9032 func_stripname '' '.exe' "$outputname"
9033 outputname=$func_stripname_result ;;
9034 *) exeext= ;;
9035 esac
9036 case $host in
9037 *cygwin* | *mingw* )
9038 func_dirname_and_basename "$output" "" "."
9039 output_name=$func_basename_result
9040 output_path=$func_dirname_result
9041 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9042 cwrapper="$output_path/$output_name.exe"
9043 $RM $cwrappersource $cwrapper
9044 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9045
9046 func_emit_cwrapperexe_src > $cwrappersource
9047
9048 # The wrapper executable is built using the $host compiler,
9049 # because it contains $host paths and files. If cross-
9050 # compiling, it, like the target executable, must be
9051 # executed on the $host or under an emulation environment.
9052 $opt_dry_run || {
9053 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9054 $STRIP $cwrapper
9055 }
9056
9057 # Now, create the wrapper script for func_source use:
9058 func_ltwrapper_scriptname $cwrapper
9059 $RM $func_ltwrapper_scriptname_result
9060 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9061 $opt_dry_run || {
9062 # note: this script will not be executed, so do not chmod.
9063 if test "x$build" = "x$host" ; then
9064 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9065 else
9066 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9067 fi
9068 }
9069 ;;
9070 * )
9071 $RM $output
9072 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9073
9074 func_emit_wrapper no > $output
9075 chmod +x $output
9076 ;;
9077 esac
9078 }
9079 exit $EXIT_SUCCESS
9080 ;;
9081 esac
9082
9083 # See if we need to build an old-fashioned archive.
9084 for oldlib in $oldlibs; do
9085
9086 if test "$build_libtool_libs" = convenience; then
9087 oldobjs="$libobjs_save $symfileobj"
9088 addlibs="$convenience"
9089 build_libtool_libs=no
9090 else
9091 if test "$build_libtool_libs" = module; then
9092 oldobjs="$libobjs_save"
9093 build_libtool_libs=no
9094 else
9095 oldobjs="$old_deplibs $non_pic_objects"
9096 if test "$preload" = yes && test -f "$symfileobj"; then
9097 func_append oldobjs " $symfileobj"
9098 fi
9099 fi
9100 addlibs="$old_convenience"
9101 fi
9102
9103 if test -n "$addlibs"; then
9104 gentop="$output_objdir/${outputname}x"
9105 func_append generated " $gentop"
9106
9107 func_extract_archives $gentop $addlibs
9108 func_append oldobjs " $func_extract_archives_result"
9109 fi
9110
9111 # Do each command in the archive commands.
9112 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9113 cmds=$old_archive_from_new_cmds
9114 else
9115
9116 # Add any objects from preloaded convenience libraries
9117 if test -n "$dlprefiles"; then
9118 gentop="$output_objdir/${outputname}x"
9119 func_append generated " $gentop"
9120
9121 func_extract_archives $gentop $dlprefiles
9122 func_append oldobjs " $func_extract_archives_result"
9123 fi
9124
9125 # POSIX demands no paths to be encoded in archives. We have
9126 # to avoid creating archives with duplicate basenames if we
9127 # might have to extract them afterwards, e.g., when creating a
9128 # static archive out of a convenience library, or when linking
9129 # the entirety of a libtool archive into another (currently
9130 # not supported by libtool).
9131 if (for obj in $oldobjs
9132 do
9133 func_basename "$obj"
9134 $ECHO "$func_basename_result"
9135 done | sort | sort -uc >/dev/null 2>&1); then
9136 :
9137 else
9138 echo "copying selected object files to avoid basename conflicts..."
9139 gentop="$output_objdir/${outputname}x"
9140 func_append generated " $gentop"
9141 func_mkdir_p "$gentop"
9142 save_oldobjs=$oldobjs
9143 oldobjs=
9144 counter=1
9145 for obj in $save_oldobjs
9146 do
9147 func_basename "$obj"
9148 objbase="$func_basename_result"
9149 case " $oldobjs " in
9150 " ") oldobjs=$obj ;;
9151 *[\ /]"$objbase "*)
9152 while :; do
9153 # Make sure we don't pick an alternate name that also
9154 # overlaps.
9155 newobj=lt$counter-$objbase
9156 func_arith $counter + 1
9157 counter=$func_arith_result
9158 case " $oldobjs " in
9159 *[\ /]"$newobj "*) ;;
9160 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9161 esac
9162 done
9163 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9164 func_append oldobjs " $gentop/$newobj"
9165 ;;
9166 *) func_append oldobjs " $obj" ;;
9167 esac
9168 done
9169 fi
9170 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
9171 tool_oldlib=$func_to_tool_file_result
9172 eval cmds=\"$old_archive_cmds\"
9173
9174 func_len " $cmds"
9175 len=$func_len_result
9176 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9177 cmds=$old_archive_cmds
9178 elif test -n "$archiver_list_spec"; then
9179 func_verbose "using command file archive linking..."
9180 for obj in $oldobjs
9181 do
9182 func_to_tool_file "$obj"
9183 $ECHO "$func_to_tool_file_result"
9184 done > $output_objdir/$libname.libcmd
9185 func_to_tool_file "$output_objdir/$libname.libcmd"
9186 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9187 cmds=$old_archive_cmds
9188 else
9189 # the command line is too long to link in one step, link in parts
9190 func_verbose "using piecewise archive linking..."
9191 save_RANLIB=$RANLIB
9192 RANLIB=:
9193 objlist=
9194 concat_cmds=
9195 save_oldobjs=$oldobjs
9196 oldobjs=
9197 # Is there a better way of finding the last object in the list?
9198 for obj in $save_oldobjs
9199 do
9200 last_oldobj=$obj
9201 done
9202 eval test_cmds=\"$old_archive_cmds\"
9203 func_len " $test_cmds"
9204 len0=$func_len_result
9205 len=$len0
9206 for obj in $save_oldobjs
9207 do
9208 func_len " $obj"
9209 func_arith $len + $func_len_result
9210 len=$func_arith_result
9211 func_append objlist " $obj"
9212 if test "$len" -lt "$max_cmd_len"; then
9213 :
9214 else
9215 # the above command should be used before it gets too long
9216 oldobjs=$objlist
9217 if test "$obj" = "$last_oldobj" ; then
9218 RANLIB=$save_RANLIB
9219 fi
9220 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9221 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9222 objlist=
9223 len=$len0
9224 fi
9225 done
9226 RANLIB=$save_RANLIB
9227 oldobjs=$objlist
9228 if test "X$oldobjs" = "X" ; then
9229 eval cmds=\"\$concat_cmds\"
9230 else
9231 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9232 fi
9233 fi
9234 fi
9235 func_execute_cmds "$cmds" 'exit $?'
9236 done
9237
9238 test -n "$generated" && \
9239 func_show_eval "${RM}r$generated"
9240
9241 # Now create the libtool archive.
9242 case $output in
9243 *.la)
9244 old_library=
9245 test "$build_old_libs" = yes && old_library="$libname.$libext"
9246 func_verbose "creating $output"
9247
9248 # Preserve any variables that may affect compiler behavior
9249 for var in $variables_saved_for_relink; do
9250 if eval test -z \"\${$var+set}\"; then
9251 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9252 elif eval var_value=\$$var; test -z "$var_value"; then
9253 relink_command="$var=; export $var; $relink_command"
9254 else
9255 func_quote_for_eval "$var_value"
9256 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9257 fi
9258 done
9259 # Quote the link command for shipping.
9260 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9261 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9262 if test "$hardcode_automatic" = yes ; then
9263 relink_command=
9264 fi
9265
9266 # Only create the output if not a dry run.
9267 $opt_dry_run || {
9268 for installed in no yes; do
9269 if test "$installed" = yes; then
9270 if test -z "$install_libdir"; then
9271 break
9272 fi
9273 output="$output_objdir/$outputname"i
9274 # Replace all uninstalled libtool libraries with the installed ones
9275 newdependency_libs=
9276 for deplib in $dependency_libs; do
9277 case $deplib in
9278 *.la)
9279 func_basename "$deplib"
9280 name="$func_basename_result"
9281 func_resolve_sysroot "$deplib"
9282 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9283 test -z "$libdir" && \
9284 func_fatal_error "\`$deplib' is not a valid libtool archive"
9285 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9286 ;;
9287 -L*)
9288 func_stripname -L '' "$deplib"
9289 func_replace_sysroot "$func_stripname_result"
9290 func_append newdependency_libs " -L$func_replace_sysroot_result"
9291 ;;
9292 -R*)
9293 func_stripname -R '' "$deplib"
9294 func_replace_sysroot "$func_stripname_result"
9295 func_append newdependency_libs " -R$func_replace_sysroot_result"
9296 ;;
9297 *) func_append newdependency_libs " $deplib" ;;
9298 esac
9299 done
9300 dependency_libs="$newdependency_libs"
9301 newdlfiles=
9302
9303 for lib in $dlfiles; do
9304 case $lib in
9305 *.la)
9306 func_basename "$lib"
9307 name="$func_basename_result"
9308 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9309 test -z "$libdir" && \
9310 func_fatal_error "\`$lib' is not a valid libtool archive"
9311 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9312 ;;
9313 *) func_append newdlfiles " $lib" ;;
9314 esac
9315 done
9316 dlfiles="$newdlfiles"
9317 newdlprefiles=
9318 for lib in $dlprefiles; do
9319 case $lib in
9320 *.la)
9321 # Only pass preopened files to the pseudo-archive (for
9322 # eventual linking with the app. that links it) if we
9323 # didn't already link the preopened objects directly into
9324 # the library:
9325 func_basename "$lib"
9326 name="$func_basename_result"
9327 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9328 test -z "$libdir" && \
9329 func_fatal_error "\`$lib' is not a valid libtool archive"
9330 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9331 ;;
9332 esac
9333 done
9334 dlprefiles="$newdlprefiles"
9335 else
9336 newdlfiles=
9337 for lib in $dlfiles; do
9338 case $lib in
9339 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9340 *) abs=`pwd`"/$lib" ;;
9341 esac
9342 func_append newdlfiles " $abs"
9343 done
9344 dlfiles="$newdlfiles"
9345 newdlprefiles=
9346 for lib in $dlprefiles; do
9347 case $lib in
9348 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9349 *) abs=`pwd`"/$lib" ;;
9350 esac
9351 func_append newdlprefiles " $abs"
9352 done
9353 dlprefiles="$newdlprefiles"
9354 fi
9355 $RM $output
9356 # place dlname in correct position for cygwin
9357 # In fact, it would be nice if we could use this code for all target
9358 # systems that can't hard-code library paths into their executables
9359 # and that have no shared library path variable independent of PATH,
9360 # but it turns out we can't easily determine that from inspecting
9361 # libtool variables, so we have to hard-code the OSs to which it
9362 # applies here; at the moment, that means platforms that use the PE
9363 # object format with DLL files. See the long comment at the top of
9364 # tests/bindir.at for full details.
9365 tdlname=$dlname
9366 case $host,$output,$installed,$module,$dlname in
9367 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9368 # If a -bindir argument was supplied, place the dll there.
9369 if test "x$bindir" != x ;
9370 then
9371 func_relative_path "$install_libdir" "$bindir"
9372 tdlname=$func_relative_path_result$dlname
9373 else
9374 # Otherwise fall back on heuristic.
9375 tdlname=../bin/$dlname
9376 fi
9377 ;;
9378 esac
9379 $ECHO > $output "\
9380 # $outputname - a libtool library file
9381 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9382 #
9383 # Please DO NOT delete this file!
9384 # It is necessary for linking the library.
9385
9386 # The name that we can dlopen(3).
9387 dlname='$tdlname'
9388
9389 # Names of this library.
9390 library_names='$library_names'
9391
9392 # The name of the static archive.
9393 old_library='$old_library'
9394
9395 # Linker flags that can not go in dependency_libs.
9396 inherited_linker_flags='$new_inherited_linker_flags'
9397
9398 # Libraries that this one depends upon.
9399 dependency_libs='$dependency_libs'
9400
9401 # Names of additional weak libraries provided by this library
9402 weak_library_names='$weak_libs'
9403
9404 # Version information for $libname.
9405 current=$current
9406 age=$age
9407 revision=$revision
9408
9409 # Is this an already installed library?
9410 installed=$installed
9411
9412 # Should we warn about portability when linking against -modules?
9413 shouldnotlink=$module
9414
9415 # Files to dlopen/dlpreopen
9416 dlopen='$dlfiles'
9417 dlpreopen='$dlprefiles'
9418
9419 # Directory that this library needs to be installed in:
9420 libdir='$install_libdir'"
9421 if test "$installed" = no && test "$need_relink" = yes; then
9422 $ECHO >> $output "\
9423 relink_command=\"$relink_command\""
9424 fi
9425 done
9426 }
9427
9428 # Do a symbolic link so that the libtool archive can be found in
9429 # LD_LIBRARY_PATH before the program is installed.
9430 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9431 ;;
9432 esac
9433 exit $EXIT_SUCCESS
9434 }
9435
9436 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9437 func_mode_link ${1+"$@"}
9438
9439
9440 # func_mode_uninstall arg...
9441 func_mode_uninstall ()
9442 {
9443 $opt_debug
9444 RM="$nonopt"
9445 files=
9446 rmforce=
9447 exit_status=0
9448
9449 # This variable tells wrapper scripts just to set variables rather
9450 # than running their programs.
9451 libtool_install_magic="$magic"
9452
9453 for arg
9454 do
9455 case $arg in
9456 -f) func_append RM " $arg"; rmforce=yes ;;
9457 -*) func_append RM " $arg" ;;
9458 *) func_append files " $arg" ;;
9459 esac
9460 done
9461
9462 test -z "$RM" && \
9463 func_fatal_help "you must specify an RM program"
9464
9465 rmdirs=
9466
9467 for file in $files; do
9468 func_dirname "$file" "" "."
9469 dir="$func_dirname_result"
9470 if test "X$dir" = X.; then
9471 odir="$objdir"
9472 else
9473 odir="$dir/$objdir"
9474 fi
9475 func_basename "$file"
9476 name="$func_basename_result"
9477 test "$opt_mode" = uninstall && odir="$dir"
9478
9479 # Remember odir for removal later, being careful to avoid duplicates
9480 if test "$opt_mode" = clean; then
9481 case " $rmdirs " in
9482 *" $odir "*) ;;
9483 *) func_append rmdirs " $odir" ;;
9484 esac
9485 fi
9486
9487 # Don't error if the file doesn't exist and rm -f was used.
9488 if { test -L "$file"; } >/dev/null 2>&1 ||
9489 { test -h "$file"; } >/dev/null 2>&1 ||
9490 test -f "$file"; then
9491 :
9492 elif test -d "$file"; then
9493 exit_status=1
9494 continue
9495 elif test "$rmforce" = yes; then
9496 continue
9497 fi
9498
9499 rmfiles="$file"
9500
9501 case $name in
9502 *.la)
9503 # Possibly a libtool archive, so verify it.
9504 if func_lalib_p "$file"; then
9505 func_source $dir/$name
9506
9507 # Delete the libtool libraries and symlinks.
9508 for n in $library_names; do
9509 func_append rmfiles " $odir/$n"
9510 done
9511 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9512
9513 case "$opt_mode" in
9514 clean)
9515 case " $library_names " in
9516 *" $dlname "*) ;;
9517 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9518 esac
9519 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
9520 ;;
9521 uninstall)
9522 if test -n "$library_names"; then
9523 # Do each command in the postuninstall commands.
9524 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9525 fi
9526
9527 if test -n "$old_library"; then
9528 # Do each command in the old_postuninstall commands.
9529 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9530 fi
9531 # FIXME: should reinstall the best remaining shared library.
9532 ;;
9533 esac
9534 fi
9535 ;;
9536
9537 *.lo)
9538 # Possibly a libtool object, so verify it.
9539 if func_lalib_p "$file"; then
9540
9541 # Read the .lo file
9542 func_source $dir/$name
9543
9544 # Add PIC object to the list of files to remove.
9545 if test -n "$pic_object" &&
9546 test "$pic_object" != none; then
9547 func_append rmfiles " $dir/$pic_object"
9548 fi
9549
9550 # Add non-PIC object to the list of files to remove.
9551 if test -n "$non_pic_object" &&
9552 test "$non_pic_object" != none; then
9553 func_append rmfiles " $dir/$non_pic_object"
9554 fi
9555 fi
9556 ;;
9557
9558 *)
9559 if test "$opt_mode" = clean ; then
9560 noexename=$name
9561 case $file in
9562 *.exe)
9563 func_stripname '' '.exe' "$file"
9564 file=$func_stripname_result
9565 func_stripname '' '.exe' "$name"
9566 noexename=$func_stripname_result
9567 # $file with .exe has already been added to rmfiles,
9568 # add $file without .exe
9569 func_append rmfiles " $file"
9570 ;;
9571 esac
9572 # Do a test to see if this is a libtool program.
9573 if func_ltwrapper_p "$file"; then
9574 if func_ltwrapper_executable_p "$file"; then
9575 func_ltwrapper_scriptname "$file"
9576 relink_command=
9577 func_source $func_ltwrapper_scriptname_result
9578 func_append rmfiles " $func_ltwrapper_scriptname_result"
9579 else
9580 relink_command=
9581 func_source $dir/$noexename
9582 fi
9583
9584 # note $name still contains .exe if it was in $file originally
9585 # as does the version of $file that was added into $rmfiles
9586 func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
9587 if test "$fast_install" = yes && test -n "$relink_command"; then
9588 func_append rmfiles " $odir/lt-$name"
9589 fi
9590 if test "X$noexename" != "X$name" ; then
9591 func_append rmfiles " $odir/lt-${noexename}.c"
9592 fi
9593 fi
9594 fi
9595 ;;
9596 esac
9597 func_show_eval "$RM $rmfiles" 'exit_status=1'
9598 done
9599
9600 # Try to remove the ${objdir}s in the directories where we deleted files
9601 for dir in $rmdirs; do
9602 if test -d "$dir"; then
9603 func_show_eval "rmdir $dir >/dev/null 2>&1"
9604 fi
9605 done
9606
9607 exit $exit_status
9608 }
9609
9610 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
9611 func_mode_uninstall ${1+"$@"}
9612
9613 test -z "$opt_mode" && {
9614 help="$generic_help"
9615 func_fatal_help "you must specify a MODE"
9616 }
9617
9618 test -z "$exec_cmd" && \
9619 func_fatal_help "invalid operation mode \`$opt_mode'"
9620
9621 if test -n "$exec_cmd"; then
9622 eval exec "$exec_cmd"
9623 exit $EXIT_FAILURE
9624 fi
9625
9626 exit $exit_status
9627
9628
9629 # The TAGs below are defined such that we never get into a situation
9630 # in which we disable both kinds of libraries. Given conflicting
9631 # choices, we go for a static library, that is the most portable,
9632 # since we can't tell whether shared libraries were disabled because
9633 # the user asked for that or because the platform doesn't support
9634 # them. This is particularly important on AIX, because we don't
9635 # support having both static and shared libraries enabled at the same
9636 # time on that platform, so we default to a shared-only configuration.
9637 # If a disable-shared tag is given, we'll fallback to a static-only
9638 # configuration. But we'll never go from static-only to shared-only.
9639
9640 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
9641 build_libtool_libs=no
9642 build_old_libs=yes
9643 # ### END LIBTOOL TAG CONFIG: disable-shared
9644
9645 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
9646 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
9647 # ### END LIBTOOL TAG CONFIG: disable-static
9648
9649 # Local Variables:
9650 # mode:shell-script
9651 # sh-indentation:2
9652 # End:
9653 # vi:sw=2
9654
+0
-215
missing less more
0 #! /bin/sh
1 # Common wrapper for a few potentially missing GNU programs.
2
3 scriptversion=2012-06-26.16; # UTC
4
5 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
6 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 if test $# -eq 0; then
27 echo 1>&2 "Try '$0 --help' for more information"
28 exit 1
29 fi
30
31 case $1 in
32
33 --is-lightweight)
34 # Used by our autoconf macros to check whether the available missing
35 # script is modern enough.
36 exit 0
37 ;;
38
39 --run)
40 # Back-compat with the calling convention used by older automake.
41 shift
42 ;;
43
44 -h|--h|--he|--hel|--help)
45 echo "\
46 $0 [OPTION]... PROGRAM [ARGUMENT]...
47
48 Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
49 to PROGRAM being missing or too old.
50
51 Options:
52 -h, --help display this help and exit
53 -v, --version output version information and exit
54
55 Supported PROGRAM values:
56 aclocal autoconf autoheader autom4te automake makeinfo
57 bison yacc flex lex help2man
58
59 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
60 'g' are ignored when checking the name.
61
62 Send bug reports to <bug-automake@gnu.org>."
63 exit $?
64 ;;
65
66 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
67 echo "missing $scriptversion (GNU Automake)"
68 exit $?
69 ;;
70
71 -*)
72 echo 1>&2 "$0: unknown '$1' option"
73 echo 1>&2 "Try '$0 --help' for more information"
74 exit 1
75 ;;
76
77 esac
78
79 # Run the given program, remember its exit status.
80 "$@"; st=$?
81
82 # If it succeeded, we are done.
83 test $st -eq 0 && exit 0
84
85 # Also exit now if we it failed (or wasn't found), and '--version' was
86 # passed; such an option is passed most likely to detect whether the
87 # program is present and works.
88 case $2 in --version|--help) exit $st;; esac
89
90 # Exit code 63 means version mismatch. This often happens when the user
91 # tries to use an ancient version of a tool on a file that requires a
92 # minimum version.
93 if test $st -eq 63; then
94 msg="probably too old"
95 elif test $st -eq 127; then
96 # Program was missing.
97 msg="missing on your system"
98 else
99 # Program was found and executed, but failed. Give up.
100 exit $st
101 fi
102
103 perl_URL=http://www.perl.org/
104 flex_URL=http://flex.sourceforge.net/
105 gnu_software_URL=http://www.gnu.org/software
106
107 program_details ()
108 {
109 case $1 in
110 aclocal|automake)
111 echo "The '$1' program is part of the GNU Automake package:"
112 echo "<$gnu_software_URL/automake>"
113 echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
114 echo "<$gnu_software_URL/autoconf>"
115 echo "<$gnu_software_URL/m4/>"
116 echo "<$perl_URL>"
117 ;;
118 autoconf|autom4te|autoheader)
119 echo "The '$1' program is part of the GNU Autoconf package:"
120 echo "<$gnu_software_URL/autoconf/>"
121 echo "It also requires GNU m4 and Perl in order to run:"
122 echo "<$gnu_software_URL/m4/>"
123 echo "<$perl_URL>"
124 ;;
125 esac
126 }
127
128 give_advice ()
129 {
130 # Normalize program name to check for.
131 normalized_program=`echo "$1" | sed '
132 s/^gnu-//; t
133 s/^gnu//; t
134 s/^g//; t'`
135
136 printf '%s\n' "'$1' is $msg."
137
138 configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
139 case $normalized_program in
140 autoconf*)
141 echo "You should only need it if you modified 'configure.ac',"
142 echo "or m4 files included by it."
143 program_details 'autoconf'
144 ;;
145 autoheader*)
146 echo "You should only need it if you modified 'acconfig.h' or"
147 echo "$configure_deps."
148 program_details 'autoheader'
149 ;;
150 automake*)
151 echo "You should only need it if you modified 'Makefile.am' or"
152 echo "$configure_deps."
153 program_details 'automake'
154 ;;
155 aclocal*)
156 echo "You should only need it if you modified 'acinclude.m4' or"
157 echo "$configure_deps."
158 program_details 'aclocal'
159 ;;
160 autom4te*)
161 echo "You might have modified some maintainer files that require"
162 echo "the 'automa4te' program to be rebuilt."
163 program_details 'autom4te'
164 ;;
165 bison*|yacc*)
166 echo "You should only need it if you modified a '.y' file."
167 echo "You may want to install the GNU Bison package:"
168 echo "<$gnu_software_URL/bison/>"
169 ;;
170 lex*|flex*)
171 echo "You should only need it if you modified a '.l' file."
172 echo "You may want to install the Fast Lexical Analyzer package:"
173 echo "<$flex_URL>"
174 ;;
175 help2man*)
176 echo "You should only need it if you modified a dependency" \
177 "of a man page."
178 echo "You may want to install the GNU Help2man package:"
179 echo "<$gnu_software_URL/help2man/>"
180 ;;
181 makeinfo*)
182 echo "You should only need it if you modified a '.texi' file, or"
183 echo "any other file indirectly affecting the aspect of the manual."
184 echo "You might want to install the Texinfo package:"
185 echo "<$gnu_software_URL/texinfo/>"
186 echo "The spurious makeinfo call might also be the consequence of"
187 echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
188 echo "want to install GNU make:"
189 echo "<$gnu_software_URL/make/>"
190 ;;
191 *)
192 echo "You might have modified some files without having the proper"
193 echo "tools for further handling them. Check the 'README' file, it"
194 echo "often tells you about the needed prerequisites for installing"
195 echo "this package. You may also peek at any GNU archive site, in"
196 echo "case some other package contains this missing '$1' program."
197 ;;
198 esac
199 }
200
201 give_advice "$1" | sed -e '1s/^/WARNING: /' \
202 -e '2,$s/^/ /' >&2
203
204 # Propagate the correct exit status (expected to be 127 for a program
205 # not found, 63 for a program that failed due to version mismatch).
206 exit $st
207
208 # Local variables:
209 # eval: (add-hook 'write-file-hooks 'time-stamp)
210 # time-stamp-start: "scriptversion="
211 # time-stamp-format: "%:y-%02m-%02d.%02H"
212 # time-stamp-time-zone: "UTC"
213 # time-stamp-end: "; # UTC"
214 # End:
0 /* --------------------------------------------------------------------------
1
2 MusicBrainz -- The Internet music metadatabase
3
4 Copyright (C) 2008 Patrick Hurrelmann
5 Copyright (C) 2006 Matthias Friedrich
6 Copyright (C) 2000 Robert Kaye
7 Copyright (C) 1999 Marc E E van Woerkom
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
23 --------------------------------------------------------------------------- */
24
25 #include <assert.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <sys/cdio.h>
30 #include <sys/ioctl.h>
31 #include <sys/types.h>
32 #include <unistd.h>
33
34 #if defined(__FreeBSD__)
35 #include <netinet/in.h> /* for ntohl() */
36 #else
37 #include <util.h> /* for getrawpartition() */
38 #endif
39
40 #include "discid/discid_private.h"
41 #include "unix.h"
42
43 #define MAX_DEV_LEN 15
44
45 static int get_device(int n, char* device_name, size_t device_name_length) {
46 #if !defined(__FreeBSD__) /* /dev/rcdNX, where X is the letter for the raw partition */
47 snprintf(device_name, device_name_length, "/dev/rcd%d%c", n - 1, 'a' + getrawpartition());
48 #else /* on FreeBSD it's just /dev/cdN */
49 snprintf(device_name, device_name_length, "/dev/cd%d", n - 1);
50 #endif
51 return mb_disc_unix_exists(device_name);
52 }
53
54 int mb_disc_unix_read_toc_header(int fd, mb_disc_toc *toc) {
55 struct ioc_toc_header th;
56 struct cd_toc_entry te[100];
57 struct ioc_read_toc_entry rte;
58 int i;
59
60 memset(&th, 0, sizeof th);
61 if (ioctl(fd, CDIOREADTOCHEADER, &th) < 0)
62 return 0; /* error */
63
64 toc->first_track_num = th.starting_track;
65 toc->last_track_num = th.ending_track;
66
67 if (toc->last_track_num == 0)
68 return 1; /* no entries to read */
69
70 /* Read all the TOC entries in one icotl() call */
71
72 memset(&te, 0, sizeof te);
73 memset(&rte, 0, sizeof rte);
74 rte.address_format = CD_LBA_FORMAT;
75 rte.data = &te[0];
76 rte.data_len = sizeof te;
77 rte.starting_track = toc->first_track_num;
78
79 if (ioctl(fd, CDIOREADTOCENTRYS, &rte) < 0)
80 return 0; /* error */
81
82 for (i = toc->first_track_num; i <= toc->last_track_num; ++i) {
83 assert(te[i - toc->first_track_num].track == i);
84 #if defined(__FreeBSD__) /* LBA address is in network byte order */
85 toc->tracks[i].address = ntohl(te[i - toc->first_track_num].addr.lba);
86 #else
87 toc->tracks[i].address = te[i - toc->first_track_num].addr.lba;
88 #endif
89 toc->tracks[i].control = te[i - toc->first_track_num].control;
90 }
91 /* leadout - track number 170 (0xAA) */
92 assert(te[i - toc->first_track_num].track == 0xAA);
93 #if defined(__FreeBSD__) /* LBA address is in network byte order */
94 toc->tracks[0].address = ntohl(te[i - toc->first_track_num].addr.lba);
95 #else
96 toc->tracks[0].address = te[i - toc->first_track_num].addr.lba;
97 #endif
98 toc->tracks[0].control = te[i - toc->first_track_num].control;
99
100 return 1;
101 }
102
103 int mb_disc_unix_read_toc_entry(int fd, int track_num, mb_disc_toc_track *track) {
104 /* All TOC entries were already read by mb_disc_unix_read_toc_header() */
105 return 1;
106 }
107
108 void mb_disc_unix_read_mcn(int fd, mb_disc_private *disc) {
109 struct cd_sub_channel_info sci;
110 struct ioc_read_subchannel rsc;
111
112 memset(&sci, 0, sizeof sci);
113 memset(&rsc, 0, sizeof rsc);
114 rsc.address_format = CD_LBA_FORMAT; /* not technically relevant */
115 rsc.data_format = CD_MEDIA_CATALOG;
116 rsc.data_len = sizeof sci;
117 rsc.data = &sci;
118
119 if ( ioctl(fd, CDIOCREADSUBCHANNEL, &rsc) < 0 )
120 perror ("Warning: Unable to read the disc's media catalog number");
121 else {
122 if (sci.what.media_catalog.mc_valid)
123 strncpy( disc->mcn,
124 (const char *) sci.what.media_catalog.mc_number,
125 MCN_STR_LENGTH );
126 else
127 memset( disc->mcn, 0, MCN_STR_LENGTH );
128 }
129 }
130
131 void mb_disc_unix_read_isrc(int fd, mb_disc_private *disc, int track_num) {
132 struct cd_sub_channel_info sci;
133 struct ioc_read_subchannel rsc;
134
135 memset(&sci, 0, sizeof sci);
136 memset(&rsc, 0, sizeof rsc);
137 rsc.address_format = CD_LBA_FORMAT; /* not technically relevant */
138 rsc.data_format = CD_TRACK_INFO;
139 rsc.track = track_num;
140 rsc.data_len = sizeof sci;
141 rsc.data = &sci;
142
143 if ( ioctl(fd, CDIOCREADSUBCHANNEL, &rsc) < 0 )
144 perror ("Warning: Unable to read track info (ISRC)");
145 else {
146 if (sci.what.track_info.ti_valid)
147 strncpy( disc->isrc[track_num],
148 (const char *) sci.what.track_info.ti_number,
149 ISRC_STR_LENGTH );
150 else
151 memset( disc->isrc[track_num], 0, ISRC_STR_LENGTH );
152 }
153 }
154
155 int mb_disc_has_feature_unportable(enum discid_feature feature) {
156 switch(feature) {
157 case DISCID_FEATURE_READ:
158 case DISCID_FEATURE_MCN:
159 case DISCID_FEATURE_ISRC:
160 return 1;
161 default:
162 return 0;
163 }
164 }
165
166 int mb_disc_read_unportable(mb_disc_private *disc, const char *device,
167 unsigned int features) {
168 char device_name[MAX_DEV_LEN] = "";
169 int device_number;
170
171 device_number = (int) strtol(device, NULL, 10);
172
173 if (device_number > 0) {
174 if(!get_device(device_number, device_name, MAX_DEV_LEN)) {
175 snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
176 "cannot find cd device with the number '%d'",
177 device_number);
178 return 0; /* error */
179 }
180 device = device_name;
181 }
182
183 return mb_disc_unix_read(disc, device, features);
184 }
185
186 char *mb_disc_get_default_device_unportable(void) {
187 static char result[MAX_DEV_LEN + 1];
188 /* No error check here, so we always return the appropriate device for cd0 */
189 get_device(1, result, sizeof result);
190 return result;
191 }
192
193 /* EOF */
+0
-115
src/disc_freebsd.c less more
0 /* --------------------------------------------------------------------------
1
2 MusicBrainz -- The Internet music metadatabase
3
4 Copyright (C) 2008 Patrick Hurrelmann
5 Copyright (C) 2006 Matthias Friedrich
6 Copyright (C) 2000 Robert Kaye
7 Copyright (C) 1999 Marc E E van Woerkom
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
23 --------------------------------------------------------------------------- */
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <string.h>
27 #include <fcntl.h>
28 #include <unistd.h>
29 #include <assert.h>
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include <sys/ioctl.h>
33 #include <sys/cdio.h>
34 #include <arpa/inet.h>
35
36
37 #include "discid/discid.h"
38 #include "discid/discid_private.h"
39 #include "unix.h"
40
41
42 #define NUM_CANDIDATES 2
43
44 /* starting with FreeBSD 9 /dev/cd0 is always used, /dev/acd0 is deprecated */
45 static char *device_candidates[NUM_CANDIDATES] = {"/dev/cd0", "/dev/acd0"};
46
47
48 int mb_disc_unix_read_toc_header(int fd, mb_disc_toc *toc) {
49 struct ioc_toc_header th;
50
51 int ret = ioctl(fd, CDIOREADTOCHEADER, &th);
52
53 if ( ret < 0 )
54 return 0; /* error */
55
56 toc->first_track_num = th.starting_track;
57 toc->last_track_num = th.ending_track;
58
59 return 1;
60 }
61
62
63 int mb_disc_unix_read_toc_entry(int fd, int track_num, mb_disc_toc_track *track) {
64 struct ioc_read_toc_single_entry te;
65 int ret;
66
67 memset(&te, 0, sizeof te);
68 te.track = track_num;
69 te.address_format = CD_LBA_FORMAT;
70
71 /* CDIOREADTOCENTRY is created in FreeBSD because it doesn't need
72 * an additional struct inside the te struct.
73 * (freebsd commit ae544a60069e99ed14cab46e981a79ba165564a9)
74 */
75 ret = ioctl(fd, CDIOREADTOCENTRY, &te);
76
77 if ( ret < 0 )
78 return 0; /* error */
79
80 assert( te.address_format == CD_LBA_FORMAT );
81 /* FreeBSD header note: the lba has network byte order */
82 track->address = ntohl(te.entry.addr.lba);
83 track->control = te.entry.control;
84
85 return 1;
86 }
87
88 void mb_disc_unix_read_mcn(int fd, mb_disc_private *disc) {
89 return;
90 }
91
92 void mb_disc_unix_read_isrc(int fd, mb_disc_private *disc, int track_num) {
93 return;
94 }
95
96 char *mb_disc_get_default_device_unportable(void) {
97 return mb_disc_unix_find_device(device_candidates, NUM_CANDIDATES);
98 }
99
100 int mb_disc_has_feature_unportable(enum discid_feature feature) {
101 switch(feature) {
102 case DISCID_FEATURE_READ:
103 return 1;
104 default:
105 return 0;
106 }
107 }
108
109 int mb_disc_read_unportable(mb_disc_private *disc, const char *device,
110 unsigned int features) {
111 return mb_disc_unix_read(disc, device, features);
112 }
113
114 /* EOF */
2525
2626
2727 char *mb_disc_get_default_device_unportable(void) {
28 return "";
28 return "/dev/null";
2929 }
3030
3131
100100 }
101101
102102 /* trim the trailing \n for the last entry = first device */
103 if (default_device[strlen(default_device)-1] == '\n') {
104 default_device[strlen(default_device)-1] = '\0';
103 if (return_value && device[strlen(device)-1] == '\n') {
104 device[strlen(device)-1] = '\0';
105105 }
106106 free(lineptr);
107107 fclose(proc_file);
156156 }
157157 }
158158
159 void mb_disc_unix_read_mcn(int fd, mb_disc_private *disc)
160 {
159 void mb_disc_unix_read_mcn(int fd, mb_disc_private *disc) {
161160 struct cdrom_mcn mcn;
162161 memset(&mcn, 0, sizeof mcn);
163162
+0
-107
src/disc_netbsd.c less more
0 /* --------------------------------------------------------------------------
1
2 MusicBrainz -- The Internet music metadatabase
3
4 Copyright (C) 2009 Anton Yabchinskiy
5 Copyright (C) 2006 Matthias Friedrich
6 Copyright (C) 2000 Robert Kaye
7 Copyright (C) 1999 Marc E E van Woerkom
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
23 --------------------------------------------------------------------------- */
24
25 #include <sys/types.h>
26 #include <sys/cdio.h>
27 #include <sys/ioctl.h>
28
29 #include <errno.h>
30 #include <fcntl.h>
31 #include <stdio.h>
32 #include <string.h>
33 #include <unistd.h>
34
35 #include "discid/discid.h"
36 #include "discid/discid_private.h"
37 #include "unix.h"
38
39 #define NUM_CANDIDATES 2
40
41 /* rcd0c = OpenBSD (+ NetBSD?), rcd0d = x86 NetBSD */
42 static char *device_candidates[NUM_CANDIDATES] = {"/dev/rcd0c", "/dev/rcd0d"};
43
44
45 char *mb_disc_get_default_device_unportable(void) {
46 return mb_disc_unix_find_device(device_candidates, NUM_CANDIDATES);
47 }
48
49
50 int mb_disc_unix_read_toc_header(int fd, mb_disc_toc *toc) {
51 struct ioc_toc_header th;
52
53 int ret = ioctl(fd, CDIOREADTOCHEADER, &th);
54
55 if ( ret < 0 )
56 return 0; /* error */
57
58 toc->first_track_num = th.starting_track;
59 toc->last_track_num = th.ending_track;
60
61 return 1;
62 }
63
64 int mb_disc_unix_read_toc_entry(int fd, int track_num, mb_disc_toc_track *track) {
65 struct cd_toc_entry te;
66 struct ioc_read_toc_entry rte;
67 int ret;
68
69 memset(&rte, 0, sizeof rte);
70 rte.address_format = CD_LBA_FORMAT;
71 rte.data = &te;
72 rte.data_len = sizeof te;
73 rte.starting_track = track_num;
74
75 ret = ioctl (fd, CDIOREADTOCENTRYS, &rte);
76
77 if ( ret < 0 )
78 return 0; /* error */
79
80 track->address = te.addr.lba;
81 track->control = te.control;
82
83 return 1;
84 }
85
86 void mb_disc_unix_read_mcn(int fd, mb_disc_private *disc) {
87 return;
88 }
89
90 void mb_disc_unix_read_isrc(int fd, mb_disc_private *disc, int track_num) {
91 return;
92 }
93
94 int mb_disc_has_feature_unportable(enum discid_feature feature) {
95 switch(feature) {
96 case DISCID_FEATURE_READ:
97 return 1;
98 default:
99 return 0;
100 }
101 }
102
103 int mb_disc_read_unportable(mb_disc_private *disc, const char *device,
104 unsigned int features) {
105 return mb_disc_unix_read(disc, device, features);
106 }
6969 ret = ioctl(fd, CDROMREADTOCENTRY, &te);
7070
7171 if ( ret < 0 )
72 return ret; /* error */
72 return 0; /* error */
7373
7474 assert( te.cdte_format == CDROM_LBA );
7575 track->address = te.cdte_addr.lba;
7676 track->control = te.cdte_ctrl;
7777
78 return ret;
78 return 1;
7979 }
8080
8181 void mb_disc_unix_read_mcn(int fd, mb_disc_private *disc) {
2020 ----------------------------------------------------------------------------*/
2121
2222 #ifdef _MSC_VER
23 #define snprintf _snprintf
24 #define _CRT_SECURE_NO_WARNINGS
23 #define _CRT_SECURE_NO_WARNINGS
24 #if (_MSC_VER < 1900)
25 #define snprintf _snprintf
26 #endif
2527 #endif
2628
2729 #include <windows.h>
5355
5456 static THREAD_LOCAL char default_device[MAX_DEV_LEN] = "\0";
5557
56 static int address_to_sectors(UCHAR address[4])
57 {
58 static int address_to_sectors(UCHAR address[4]) {
5859 return address[1] * 4500 + address[2] * 75 + address[3];
5960 }
6061
61 static HANDLE create_device_handle(mb_disc_private *disc, const char *device)
62 {
62 static HANDLE create_device_handle(mb_disc_private *disc, const char *device) {
6363 HANDLE hDevice;
6464 char filename[128];
6565 const char* colon;
8585 return hDevice;
8686 }
8787
88 static void read_disc_mcn(HANDLE hDevice, mb_disc_private *disc)
89 {
88 static void read_disc_mcn(HANDLE hDevice, mb_disc_private *disc) {
9089 DWORD dwReturned;
9190 BOOL bResult;
9291 CDROM_SUB_Q_DATA_FORMAT format;
10099 &dwReturned, NULL);
101100 if (bResult == FALSE) {
102101 fprintf(stderr, "Warning: Unable to read the disc's media catalog number.\n");
103 }
104 else {
102 } else {
105103 strncpy(disc->mcn, (char *) data.MediaCatalog.MediaCatalog,
106104 MCN_STR_LENGTH);
107105 }
108106 }
109107
110 static void read_disc_isrc(HANDLE hDevice, mb_disc_private *disc, int track)
111 {
108 static void read_disc_isrc(HANDLE hDevice, mb_disc_private *disc, int track) {
112109 DWORD dwReturned;
113110 BOOL bResult;
114111 CDROM_SUB_Q_DATA_FORMAT format;
122119 &dwReturned, NULL);
123120 if (bResult == FALSE) {
124121 fprintf(stderr, "Warning: Unable to read the international standard recording code (ISRC) for track %i\n", track);
125 }
126 else {
122 } else {
127123 strncpy(disc->isrc[track], (char *) data.TrackIsrc.TrackIsrc,
128124 ISRC_STR_LENGTH);
129125 }
130126 }
131127
132 int get_nth_device(int number, char* device, int device_length) {
128 static int get_nth_device(int number, char* device, int device_length) {
133129 int i, counter = 0;
134130 char tmpDevice[MAX_DEV_LEN];
135131 DWORD mask = GetLogicalDrives();
137133 for (i = 0; i <= 25; i++) {
138134 if (mask >> i & 1) {
139135 snprintf(tmpDevice, MAX_DEV_LEN, "%c:", i + 'A');
140
141136 if (GetDriveType(tmpDevice) == DRIVE_CDROM) {
142137 counter++;
143
144 if (counter == number)
145 {
138 if (counter == number) {
146139 strncpy(device, tmpDevice, device_length);
147140 return TRUE;
148141 }
154147 }
155148
156149 char *mb_disc_get_default_device_unportable(void) {
157 if (!get_nth_device(1, default_device, MAX_DEV_LEN))
158 {
150 if (!get_nth_device(1, default_device, MAX_DEV_LEN)) {
159151 return MB_DEFAULT_DEVICE;
160152 }
161153
173165 }
174166 }
175167
176 int mb_disc_winnt_read_toc(HANDLE device, mb_disc_private *disc, mb_disc_toc *toc)
177 {
168 static int mb_disc_winnt_read_toc(HANDLE device, mb_disc_private *disc, mb_disc_toc *toc) {
178169 DWORD dwReturned;
179170 BOOL bResult;
180171 CDROM_TOC cd;
221212 "cannot find the CD audio device '%i'", device_number);
222213 return 0;
223214 }
224
225215 device = tmpDevice;
226216 }
227217
2020 --------------------------------------------------------------------------- */
2121
2222 #ifdef _MSC_VER
23 #define snprintf _snprintf
24 #define _CRT_SECURE_NO_WARNINGS
23 #define _CRT_SECURE_NO_WARNINGS
24 #if (_MSC_VER < 1900)
25 #define snprintf _snprintf
26 #endif
2527 #endif
28
2629 #include <stdlib.h>
2730 #include <stdio.h>
2831 #include <string.h>
7979 if ( !mb_disc_unix_read_toc_header(fd, toc) ) {
8080 snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
8181 "cannot read table of contents");
82 close(fd);
8382 return 0;
8483 }
8584
8786 if ( toc->last_track_num == 0 ) {
8887 snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
8988 "this disc has no tracks");
90 close(fd);
9189 return 0;
9290 }
9391
9593 * Read the TOC entry for every track.
9694 */
9795 for (i = toc->first_track_num; i <= toc->last_track_num; i++) {
98 mb_disc_unix_read_toc_entry(fd, i, &toc->tracks[i]);
96 if ( !mb_disc_unix_read_toc_entry(fd, i, &toc->tracks[i]) ) {
97 snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
98 "cannot read TOC entry for track %d", i);
99 return 0;
100 }
99101 }
100 mb_disc_unix_read_toc_entry(fd, 0xAA, &toc->tracks[0]);
102 if ( !mb_disc_unix_read_toc_entry(fd, 0xAA, &toc->tracks[0]) ) {
103 snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
104 "cannot read TOC entry for lead-out");
105 return 0;
106 }
101107
102108 return 1;
103109 }
113119 return 0;
114120
115121
116 if ( !mb_disc_unix_read_toc(fd, disc, &toc) )
122 if ( !mb_disc_unix_read_toc(fd, disc, &toc) ) {
123 close(fd);
117124 return 0;
125 }
118126
119 if ( !mb_disc_load_toc(disc, &toc) )
127 if ( !mb_disc_load_toc(disc, &toc) ) {
128 close(fd);
120129 return 0;
130 }
121131
122132 /* Read in the media catalog number */
123133 if (features & DISCID_FEATURE_MCN
+0
-127
test-driver less more
0 #! /bin/sh
1 # test-driver - basic testsuite driver script.
2
3 scriptversion=2012-06-27.10; # UTC
4
5 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 # This file is maintained in Automake, please report
26 # bugs to <bug-automake@gnu.org> or send patches to
27 # <automake-patches@gnu.org>.
28
29 # Make unconditional expansion of undefined variables an error. This
30 # helps a lot in preventing typo-related bugs.
31 set -u
32
33 usage_error ()
34 {
35 echo "$0: $*" >&2
36 print_usage >&2
37 exit 2
38 }
39
40 print_usage ()
41 {
42 cat <<END
43 Usage:
44 test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
45 [--expect-failure={yes|no}] [--color-tests={yes|no}]
46 [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
47 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
48 END
49 }
50
51 # TODO: better error handling in option parsing (in particular, ensure
52 # TODO: $log_file, $trs_file and $test_name are defined).
53 test_name= # Used for reporting.
54 log_file= # Where to save the output of the test script.
55 trs_file= # Where to save the metadata of the test run.
56 expect_failure=no
57 color_tests=no
58 enable_hard_errors=yes
59 while test $# -gt 0; do
60 case $1 in
61 --help) print_usage; exit $?;;
62 --version) echo "test-driver $scriptversion"; exit $?;;
63 --test-name) test_name=$2; shift;;
64 --log-file) log_file=$2; shift;;
65 --trs-file) trs_file=$2; shift;;
66 --color-tests) color_tests=$2; shift;;
67 --expect-failure) expect_failure=$2; shift;;
68 --enable-hard-errors) enable_hard_errors=$2; shift;;
69 --) shift; break;;
70 -*) usage_error "invalid option: '$1'";;
71 esac
72 shift
73 done
74
75 if test $color_tests = yes; then
76 # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
77 red='' # Red.
78 grn='' # Green.
79 lgn='' # Light green.
80 blu='' # Blue.
81 mgn='' # Magenta.
82 std='' # No color.
83 else
84 red= grn= lgn= blu= mgn= std=
85 fi
86
87 do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
88 trap "st=129; $do_exit" 1
89 trap "st=130; $do_exit" 2
90 trap "st=141; $do_exit" 13
91 trap "st=143; $do_exit" 15
92
93 # Test script is run here.
94 "$@" >$log_file 2>&1
95 estatus=$?
96 if test $enable_hard_errors = no && test $estatus -eq 99; then
97 estatus=1
98 fi
99
100 case $estatus:$expect_failure in
101 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
102 0:*) col=$grn res=PASS recheck=no gcopy=no;;
103 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
104 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
105 *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
106 *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
107 esac
108
109 # Report outcome to console.
110 echo "${col}${res}${std}: $test_name"
111
112 # Register the test result, and other relevant metadata.
113 echo ":test-result: $res" > $trs_file
114 echo ":global-test-result: $res" >> $trs_file
115 echo ":recheck: $recheck" >> $trs_file
116 echo ":copy-in-global-log: $gcopy" >> $trs_file
117
118 # Local Variables:
119 # mode: shell-script
120 # sh-indentation: 2
121 # eval: (add-hook 'write-file-hooks 'time-stamp)
122 # time-stamp-start: "scriptversion="
123 # time-stamp-format: "%:y-%02m-%02d.%02H"
124 # time-stamp-time-zone: "UTC"
125 # time-stamp-end: "; # UTC"
126 # End:
00 #include <winver.h>
11
2 #define VER_FILEVERSION 0,6,1,0
3 #define VER_FILEVERSION_STR "0.6.1\0"
2 #define VER_FILEVERSION 0,6,2,0
3 #define VER_FILEVERSION_STR "0.6.2\0"
44
5 #define VER_PRODUCTVERSION 0,6,1,0
6 #define VER_PRODUCTVERSION_STR "0.6.1\0"
5 #define VER_PRODUCTVERSION 0,6,2,0
6 #define VER_PRODUCTVERSION_STR "0.6.2\0"
77
88 VS_VERSION_INFO VERSIONINFO
99 FILEVERSION VER_FILEVERSION