aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/mimesh/libg3d-0.0.8/config
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-03-29 02:16:55 +1000
committerDavid Walter Seikel2016-03-29 02:16:55 +1000
commitcb3716ffb584fe0f593b6f1669a8efdba1305104 (patch)
tree5d1ebc4b6fc17b30f4b34e7e64a2d9514893459b /src/others/mimesh/libg3d-0.0.8/config
parentAdd Prosody build script. (diff)
downloadSledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.zip
SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.gz
SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.bz2
SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.xz
Added my version of libg3d and friends.
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/config')
-rwxr-xr-xsrc/others/mimesh/libg3d-0.0.8/config/config.guess1526
-rwxr-xr-xsrc/others/mimesh/libg3d-0.0.8/config/config.sub1658
-rwxr-xr-xsrc/others/mimesh/libg3d-0.0.8/config/depcomp589
-rwxr-xr-xsrc/others/mimesh/libg3d-0.0.8/config/install-sh519
-rw-r--r--src/others/mimesh/libg3d-0.0.8/config/ltmain.sh6964
-rwxr-xr-xsrc/others/mimesh/libg3d-0.0.8/config/missing367
-rwxr-xr-xsrc/others/mimesh/libg3d-0.0.8/config/ylwrap223
7 files changed, 11846 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/config/config.guess b/src/others/mimesh/libg3d-0.0.8/config/config.guess
new file mode 100755
index 0000000..f32079a
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/config/config.guess
@@ -0,0 +1,1526 @@
1#! /bin/sh
2# Attempt to guess a canonical system name.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5# Free Software Foundation, Inc.
6
7timestamp='2008-01-23'
8
9# This file is free software; you can redistribute it and/or modify it
10# 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# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22# 02110-1301, USA.
23#
24# As a special exception to the GNU General Public License, if you
25# distribute this file as part of a program that contains a
26# configuration script generated by Autoconf, you may include it under
27# the same distribution terms that you use for the rest of that program.
28
29
30# Originally written by Per Bothner <per@bothner.com>.
31# Please send patches to <config-patches@gnu.org>. Submit a context
32# diff and a properly formatted ChangeLog entry.
33#
34# This script attempts to guess a canonical system name similar to
35# config.sub. If it succeeds, it prints the system name on stdout, and
36# exits with 0. Otherwise, it exits with 1.
37#
38# The plan is that this can be called by configure scripts if you
39# don't specify an explicit build system type.
40
41me=`echo "$0" | sed -e 's,.*/,,'`
42
43usage="\
44Usage: $0 [OPTION]
45
46Output the configuration name of the system \`$me' is run on.
47
48Operation modes:
49 -h, --help print this help, then exit
50 -t, --time-stamp print date of last modification, then exit
51 -v, --version print version number, then exit
52
53Report bugs and patches to <config-patches@gnu.org>."
54
55version="\
56GNU config.guess ($timestamp)
57
58Originally written by Per Bothner.
59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
602002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
61
62This is free software; see the source for copying conditions. There is NO
63warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
64
65help="
66Try \`$me --help' for more information."
67
68# Parse command line
69while test $# -gt 0 ; do
70 case $1 in
71 --time-stamp | --time* | -t )
72 echo "$timestamp" ; exit ;;
73 --version | -v )
74 echo "$version" ; exit ;;
75 --help | --h* | -h )
76 echo "$usage"; exit ;;
77 -- ) # Stop option processing
78 shift; break ;;
79 - ) # Use stdin as input.
80 break ;;
81 -* )
82 echo "$me: invalid option $1$help" >&2
83 exit 1 ;;
84 * )
85 break ;;
86 esac
87done
88
89if test $# != 0; then
90 echo "$me: too many arguments$help" >&2
91 exit 1
92fi
93
94trap 'exit 1' 1 2 15
95
96# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
97# compiler to aid in system detection is discouraged as it requires
98# temporary files to be created and, as you can see below, it is a
99# headache to deal with in a portable fashion.
100
101# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
102# use `HOST_CC' if defined, but it is deprecated.
103
104# Portable tmp directory creation inspired by the Autoconf team.
105
106set_cc_for_build='
107trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109: ${TMPDIR=/tmp} ;
110 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
113 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114dummy=$tmp/dummy ;
115tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
116case $CC_FOR_BUILD,$HOST_CC,$CC in
117 ,,) echo "int x;" > $dummy.c ;
118 for c in cc gcc c89 c99 ; do
119 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
120 CC_FOR_BUILD="$c"; break ;
121 fi ;
122 done ;
123 if test x"$CC_FOR_BUILD" = x ; then
124 CC_FOR_BUILD=no_compiler_found ;
125 fi
126 ;;
127 ,,*) CC_FOR_BUILD=$CC ;;
128 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
129esac ; set_cc_for_build= ;'
130
131# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
132# (ghazi@noc.rutgers.edu 1994-08-24)
133if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
134 PATH=$PATH:/.attbin ; export PATH
135fi
136
137UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
138UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
139UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
140UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
142# Note: order is significant - the case branches are not exclusive.
143
144case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
145 *:NetBSD:*:*)
146 # NetBSD (nbsd) targets should (where applicable) match one or
147 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
148 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
149 # switched to ELF, *-*-netbsd* would select the old
150 # object file format. This provides both forward
151 # compatibility and a consistent mechanism for selecting the
152 # object file format.
153 #
154 # Note: NetBSD doesn't particularly care about the vendor
155 # portion of the name. We always set it to "unknown".
156 sysctl="sysctl -n hw.machine_arch"
157 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159 case "${UNAME_MACHINE_ARCH}" in
160 armeb) machine=armeb-unknown ;;
161 arm*) machine=arm-unknown ;;
162 sh3el) machine=shl-unknown ;;
163 sh3eb) machine=sh-unknown ;;
164 sh5el) machine=sh5le-unknown ;;
165 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
166 esac
167 # The Operating System including object format, if it has switched
168 # to ELF recently, or will in the future.
169 case "${UNAME_MACHINE_ARCH}" in
170 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171 eval $set_cc_for_build
172 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173 | grep __ELF__ >/dev/null
174 then
175 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176 # Return netbsd for either. FIX?
177 os=netbsd
178 else
179 os=netbsdelf
180 fi
181 ;;
182 *)
183 os=netbsd
184 ;;
185 esac
186 # The OS release
187 # Debian GNU/NetBSD machines have a different userland, and
188 # thus, need a distinct triplet. However, they do not need
189 # kernel version information, so it can be replaced with a
190 # suitable tag, in the style of linux-gnu.
191 case "${UNAME_VERSION}" in
192 Debian*)
193 release='-gnu'
194 ;;
195 *)
196 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
197 ;;
198 esac
199 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
200 # contains redundant information, the shorter form:
201 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
202 echo "${machine}-${os}${release}"
203 exit ;;
204 *:OpenBSD:*:*)
205 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
207 exit ;;
208 *:ekkoBSD:*:*)
209 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
210 exit ;;
211 *:SolidBSD:*:*)
212 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
213 exit ;;
214 macppc:MirBSD:*:*)
215 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
216 exit ;;
217 *:MirBSD:*:*)
218 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
219 exit ;;
220 alpha:OSF1:*:*)
221 case $UNAME_RELEASE in
222 *4.0)
223 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224 ;;
225 *5.*)
226 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227 ;;
228 esac
229 # According to Compaq, /usr/sbin/psrinfo has been available on
230 # OSF/1 and Tru64 systems produced since 1995. I hope that
231 # covers most systems running today. This code pipes the CPU
232 # types through head -n 1, so we only detect the type of CPU 0.
233 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
234 case "$ALPHA_CPU_TYPE" in
235 "EV4 (21064)")
236 UNAME_MACHINE="alpha" ;;
237 "EV4.5 (21064)")
238 UNAME_MACHINE="alpha" ;;
239 "LCA4 (21066/21068)")
240 UNAME_MACHINE="alpha" ;;
241 "EV5 (21164)")
242 UNAME_MACHINE="alphaev5" ;;
243 "EV5.6 (21164A)")
244 UNAME_MACHINE="alphaev56" ;;
245 "EV5.6 (21164PC)")
246 UNAME_MACHINE="alphapca56" ;;
247 "EV5.7 (21164PC)")
248 UNAME_MACHINE="alphapca57" ;;
249 "EV6 (21264)")
250 UNAME_MACHINE="alphaev6" ;;
251 "EV6.7 (21264A)")
252 UNAME_MACHINE="alphaev67" ;;
253 "EV6.8CB (21264C)")
254 UNAME_MACHINE="alphaev68" ;;
255 "EV6.8AL (21264B)")
256 UNAME_MACHINE="alphaev68" ;;
257 "EV6.8CX (21264D)")
258 UNAME_MACHINE="alphaev68" ;;
259 "EV6.9A (21264/EV69A)")
260 UNAME_MACHINE="alphaev69" ;;
261 "EV7 (21364)")
262 UNAME_MACHINE="alphaev7" ;;
263 "EV7.9 (21364A)")
264 UNAME_MACHINE="alphaev79" ;;
265 esac
266 # A Pn.n version is a patched version.
267 # A Vn.n version is a released version.
268 # A Tn.n version is a released field test version.
269 # A Xn.n version is an unreleased experimental baselevel.
270 # 1.2 uses "1.2" for uname -r.
271 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272 exit ;;
273 Alpha\ *:Windows_NT*:*)
274 # How do we know it's Interix rather than the generic POSIX subsystem?
275 # Should we change UNAME_MACHINE based on the output of uname instead
276 # of the specific Alpha model?
277 echo alpha-pc-interix
278 exit ;;
279 21064:Windows_NT:50:3)
280 echo alpha-dec-winnt3.5
281 exit ;;
282 Amiga*:UNIX_System_V:4.0:*)
283 echo m68k-unknown-sysv4
284 exit ;;
285 *:[Aa]miga[Oo][Ss]:*:*)
286 echo ${UNAME_MACHINE}-unknown-amigaos
287 exit ;;
288 *:[Mm]orph[Oo][Ss]:*:*)
289 echo ${UNAME_MACHINE}-unknown-morphos
290 exit ;;
291 *:OS/390:*:*)
292 echo i370-ibm-openedition
293 exit ;;
294 *:z/VM:*:*)
295 echo s390-ibm-zvmoe
296 exit ;;
297 *:OS400:*:*)
298 echo powerpc-ibm-os400
299 exit ;;
300 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
301 echo arm-acorn-riscix${UNAME_RELEASE}
302 exit ;;
303 arm:riscos:*:*|arm:RISCOS:*:*)
304 echo arm-unknown-riscos
305 exit ;;
306 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
307 echo hppa1.1-hitachi-hiuxmpp
308 exit ;;
309 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
310 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
311 if test "`(/bin/universe) 2>/dev/null`" = att ; then
312 echo pyramid-pyramid-sysv3
313 else
314 echo pyramid-pyramid-bsd
315 fi
316 exit ;;
317 NILE*:*:*:dcosx)
318 echo pyramid-pyramid-svr4
319 exit ;;
320 DRS?6000:unix:4.0:6*)
321 echo sparc-icl-nx6
322 exit ;;
323 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
324 case `/usr/bin/uname -p` in
325 sparc) echo sparc-icl-nx7; exit ;;
326 esac ;;
327 sun4H:SunOS:5.*:*)
328 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329 exit ;;
330 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
331 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332 exit ;;
333 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
334 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335 exit ;;
336 sun4*:SunOS:6*:*)
337 # According to config.sub, this is the proper way to canonicalize
338 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
339 # it's likely to be more like Solaris than SunOS4.
340 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
341 exit ;;
342 sun4*:SunOS:*:*)
343 case "`/usr/bin/arch -k`" in
344 Series*|S4*)
345 UNAME_RELEASE=`uname -v`
346 ;;
347 esac
348 # Japanese Language versions have a version number like `4.1.3-JL'.
349 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
350 exit ;;
351 sun3*:SunOS:*:*)
352 echo m68k-sun-sunos${UNAME_RELEASE}
353 exit ;;
354 sun*:*:4.2BSD:*)
355 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
356 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
357 case "`/bin/arch`" in
358 sun3)
359 echo m68k-sun-sunos${UNAME_RELEASE}
360 ;;
361 sun4)
362 echo sparc-sun-sunos${UNAME_RELEASE}
363 ;;
364 esac
365 exit ;;
366 aushp:SunOS:*:*)
367 echo sparc-auspex-sunos${UNAME_RELEASE}
368 exit ;;
369 # The situation for MiNT is a little confusing. The machine name
370 # can be virtually everything (everything which is not
371 # "atarist" or "atariste" at least should have a processor
372 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
373 # to the lowercase version "mint" (or "freemint"). Finally
374 # the system name "TOS" denotes a system which is actually not
375 # MiNT. But MiNT is downward compatible to TOS, so this should
376 # be no problem.
377 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
378 echo m68k-atari-mint${UNAME_RELEASE}
379 exit ;;
380 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
381 echo m68k-atari-mint${UNAME_RELEASE}
382 exit ;;
383 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
384 echo m68k-atari-mint${UNAME_RELEASE}
385 exit ;;
386 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
387 echo m68k-milan-mint${UNAME_RELEASE}
388 exit ;;
389 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
390 echo m68k-hades-mint${UNAME_RELEASE}
391 exit ;;
392 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
393 echo m68k-unknown-mint${UNAME_RELEASE}
394 exit ;;
395 m68k:machten:*:*)
396 echo m68k-apple-machten${UNAME_RELEASE}
397 exit ;;
398 powerpc:machten:*:*)
399 echo powerpc-apple-machten${UNAME_RELEASE}
400 exit ;;
401 RISC*:Mach:*:*)
402 echo mips-dec-mach_bsd4.3
403 exit ;;
404 RISC*:ULTRIX:*:*)
405 echo mips-dec-ultrix${UNAME_RELEASE}
406 exit ;;
407 VAX*:ULTRIX*:*:*)
408 echo vax-dec-ultrix${UNAME_RELEASE}
409 exit ;;
410 2020:CLIX:*:* | 2430:CLIX:*:*)
411 echo clipper-intergraph-clix${UNAME_RELEASE}
412 exit ;;
413 mips:*:*:UMIPS | mips:*:*:RISCos)
414 eval $set_cc_for_build
415 sed 's/^ //' << EOF >$dummy.c
416#ifdef __cplusplus
417#include <stdio.h> /* for printf() prototype */
418 int main (int argc, char *argv[]) {
419#else
420 int main (argc, argv) int argc; char *argv[]; {
421#endif
422 #if defined (host_mips) && defined (MIPSEB)
423 #if defined (SYSTYPE_SYSV)
424 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
425 #endif
426 #if defined (SYSTYPE_SVR4)
427 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
428 #endif
429 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
430 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
431 #endif
432 #endif
433 exit (-1);
434 }
435EOF
436 $CC_FOR_BUILD -o $dummy $dummy.c &&
437 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
438 SYSTEM_NAME=`$dummy $dummyarg` &&
439 { echo "$SYSTEM_NAME"; exit; }
440 echo mips-mips-riscos${UNAME_RELEASE}
441 exit ;;
442 Motorola:PowerMAX_OS:*:*)
443 echo powerpc-motorola-powermax
444 exit ;;
445 Motorola:*:4.3:PL8-*)
446 echo powerpc-harris-powermax
447 exit ;;
448 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
449 echo powerpc-harris-powermax
450 exit ;;
451 Night_Hawk:Power_UNIX:*:*)
452 echo powerpc-harris-powerunix
453 exit ;;
454 m88k:CX/UX:7*:*)
455 echo m88k-harris-cxux7
456 exit ;;
457 m88k:*:4*:R4*)
458 echo m88k-motorola-sysv4
459 exit ;;
460 m88k:*:3*:R3*)
461 echo m88k-motorola-sysv3
462 exit ;;
463 AViiON:dgux:*:*)
464 # DG/UX returns AViiON for all architectures
465 UNAME_PROCESSOR=`/usr/bin/uname -p`
466 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
467 then
468 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
469 [ ${TARGET_BINARY_INTERFACE}x = x ]
470 then
471 echo m88k-dg-dgux${UNAME_RELEASE}
472 else
473 echo m88k-dg-dguxbcs${UNAME_RELEASE}
474 fi
475 else
476 echo i586-dg-dgux${UNAME_RELEASE}
477 fi
478 exit ;;
479 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
480 echo m88k-dolphin-sysv3
481 exit ;;
482 M88*:*:R3*:*)
483 # Delta 88k system running SVR3
484 echo m88k-motorola-sysv3
485 exit ;;
486 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
487 echo m88k-tektronix-sysv3
488 exit ;;
489 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
490 echo m68k-tektronix-bsd
491 exit ;;
492 *:IRIX*:*:*)
493 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
494 exit ;;
495 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
496 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
497 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
498 i*86:AIX:*:*)
499 echo i386-ibm-aix
500 exit ;;
501 ia64:AIX:*:*)
502 if [ -x /usr/bin/oslevel ] ; then
503 IBM_REV=`/usr/bin/oslevel`
504 else
505 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
506 fi
507 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
508 exit ;;
509 *:AIX:2:3)
510 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
511 eval $set_cc_for_build
512 sed 's/^ //' << EOF >$dummy.c
513 #include <sys/systemcfg.h>
514
515 main()
516 {
517 if (!__power_pc())
518 exit(1);
519 puts("powerpc-ibm-aix3.2.5");
520 exit(0);
521 }
522EOF
523 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
524 then
525 echo "$SYSTEM_NAME"
526 else
527 echo rs6000-ibm-aix3.2.5
528 fi
529 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
530 echo rs6000-ibm-aix3.2.4
531 else
532 echo rs6000-ibm-aix3.2
533 fi
534 exit ;;
535 *:AIX:*:[456])
536 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
537 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
538 IBM_ARCH=rs6000
539 else
540 IBM_ARCH=powerpc
541 fi
542 if [ -x /usr/bin/oslevel ] ; then
543 IBM_REV=`/usr/bin/oslevel`
544 else
545 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
546 fi
547 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
548 exit ;;
549 *:AIX:*:*)
550 echo rs6000-ibm-aix
551 exit ;;
552 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
553 echo romp-ibm-bsd4.4
554 exit ;;
555 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
556 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
557 exit ;; # report: romp-ibm BSD 4.3
558 *:BOSX:*:*)
559 echo rs6000-bull-bosx
560 exit ;;
561 DPX/2?00:B.O.S.:*:*)
562 echo m68k-bull-sysv3
563 exit ;;
564 9000/[34]??:4.3bsd:1.*:*)
565 echo m68k-hp-bsd
566 exit ;;
567 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
568 echo m68k-hp-bsd4.4
569 exit ;;
570 9000/[34678]??:HP-UX:*:*)
571 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
572 case "${UNAME_MACHINE}" in
573 9000/31? ) HP_ARCH=m68000 ;;
574 9000/[34]?? ) HP_ARCH=m68k ;;
575 9000/[678][0-9][0-9])
576 if [ -x /usr/bin/getconf ]; then
577 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
578 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
579 case "${sc_cpu_version}" in
580 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
581 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
582 532) # CPU_PA_RISC2_0
583 case "${sc_kernel_bits}" in
584 32) HP_ARCH="hppa2.0n" ;;
585 64) HP_ARCH="hppa2.0w" ;;
586 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
587 esac ;;
588 esac
589 fi
590 if [ "${HP_ARCH}" = "" ]; then
591 eval $set_cc_for_build
592 sed 's/^ //' << EOF >$dummy.c
593
594 #define _HPUX_SOURCE
595 #include <stdlib.h>
596 #include <unistd.h>
597
598 int main ()
599 {
600 #if defined(_SC_KERNEL_BITS)
601 long bits = sysconf(_SC_KERNEL_BITS);
602 #endif
603 long cpu = sysconf (_SC_CPU_VERSION);
604
605 switch (cpu)
606 {
607 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
608 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
609 case CPU_PA_RISC2_0:
610 #if defined(_SC_KERNEL_BITS)
611 switch (bits)
612 {
613 case 64: puts ("hppa2.0w"); break;
614 case 32: puts ("hppa2.0n"); break;
615 default: puts ("hppa2.0"); break;
616 } break;
617 #else /* !defined(_SC_KERNEL_BITS) */
618 puts ("hppa2.0"); break;
619 #endif
620 default: puts ("hppa1.0"); break;
621 }
622 exit (0);
623 }
624EOF
625 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
626 test -z "$HP_ARCH" && HP_ARCH=hppa
627 fi ;;
628 esac
629 if [ ${HP_ARCH} = "hppa2.0w" ]
630 then
631 eval $set_cc_for_build
632
633 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
634 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
635 # generating 64-bit code. GNU and HP use different nomenclature:
636 #
637 # $ CC_FOR_BUILD=cc ./config.guess
638 # => hppa2.0w-hp-hpux11.23
639 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
640 # => hppa64-hp-hpux11.23
641
642 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
643 grep __LP64__ >/dev/null
644 then
645 HP_ARCH="hppa2.0w"
646 else
647 HP_ARCH="hppa64"
648 fi
649 fi
650 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
651 exit ;;
652 ia64:HP-UX:*:*)
653 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
654 echo ia64-hp-hpux${HPUX_REV}
655 exit ;;
656 3050*:HI-UX:*:*)
657 eval $set_cc_for_build
658 sed 's/^ //' << EOF >$dummy.c
659 #include <unistd.h>
660 int
661 main ()
662 {
663 long cpu = sysconf (_SC_CPU_VERSION);
664 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
665 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
666 results, however. */
667 if (CPU_IS_PA_RISC (cpu))
668 {
669 switch (cpu)
670 {
671 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
672 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
673 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
674 default: puts ("hppa-hitachi-hiuxwe2"); break;
675 }
676 }
677 else if (CPU_IS_HP_MC68K (cpu))
678 puts ("m68k-hitachi-hiuxwe2");
679 else puts ("unknown-hitachi-hiuxwe2");
680 exit (0);
681 }
682EOF
683 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
684 { echo "$SYSTEM_NAME"; exit; }
685 echo unknown-hitachi-hiuxwe2
686 exit ;;
687 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
688 echo hppa1.1-hp-bsd
689 exit ;;
690 9000/8??:4.3bsd:*:*)
691 echo hppa1.0-hp-bsd
692 exit ;;
693 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
694 echo hppa1.0-hp-mpeix
695 exit ;;
696 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
697 echo hppa1.1-hp-osf
698 exit ;;
699 hp8??:OSF1:*:*)
700 echo hppa1.0-hp-osf
701 exit ;;
702 i*86:OSF1:*:*)
703 if [ -x /usr/sbin/sysversion ] ; then
704 echo ${UNAME_MACHINE}-unknown-osf1mk
705 else
706 echo ${UNAME_MACHINE}-unknown-osf1
707 fi
708 exit ;;
709 parisc*:Lites*:*:*)
710 echo hppa1.1-hp-lites
711 exit ;;
712 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
713 echo c1-convex-bsd
714 exit ;;
715 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
716 if getsysinfo -f scalar_acc
717 then echo c32-convex-bsd
718 else echo c2-convex-bsd
719 fi
720 exit ;;
721 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
722 echo c34-convex-bsd
723 exit ;;
724 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
725 echo c38-convex-bsd
726 exit ;;
727 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
728 echo c4-convex-bsd
729 exit ;;
730 CRAY*Y-MP:*:*:*)
731 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
732 exit ;;
733 CRAY*[A-Z]90:*:*:*)
734 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
735 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
736 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
737 -e 's/\.[^.]*$/.X/'
738 exit ;;
739 CRAY*TS:*:*:*)
740 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
741 exit ;;
742 CRAY*T3E:*:*:*)
743 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
744 exit ;;
745 CRAY*SV1:*:*:*)
746 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
747 exit ;;
748 *:UNICOS/mp:*:*)
749 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
750 exit ;;
751 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
752 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
753 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
754 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
755 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
756 exit ;;
757 5000:UNIX_System_V:4.*:*)
758 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
759 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
760 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
761 exit ;;
762 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
763 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
764 exit ;;
765 sparc*:BSD/OS:*:*)
766 echo sparc-unknown-bsdi${UNAME_RELEASE}
767 exit ;;
768 *:BSD/OS:*:*)
769 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
770 exit ;;
771 *:FreeBSD:*:*)
772 case ${UNAME_MACHINE} in
773 pc98)
774 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
775 amd64)
776 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
777 *)
778 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
779 esac
780 exit ;;
781 i*:CYGWIN*:*)
782 echo ${UNAME_MACHINE}-pc-cygwin
783 exit ;;
784 *:MINGW*:*)
785 echo ${UNAME_MACHINE}-pc-mingw32
786 exit ;;
787 i*:windows32*:*)
788 # uname -m includes "-pc" on this system.
789 echo ${UNAME_MACHINE}-mingw32
790 exit ;;
791 i*:PW*:*)
792 echo ${UNAME_MACHINE}-pc-pw32
793 exit ;;
794 *:Interix*:[3456]*)
795 case ${UNAME_MACHINE} in
796 x86)
797 echo i586-pc-interix${UNAME_RELEASE}
798 exit ;;
799 EM64T | authenticamd)
800 echo x86_64-unknown-interix${UNAME_RELEASE}
801 exit ;;
802 IA64)
803 echo ia64-unknown-interix${UNAME_RELEASE}
804 exit ;;
805 esac ;;
806 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
807 echo i${UNAME_MACHINE}-pc-mks
808 exit ;;
809 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
810 # How do we know it's Interix rather than the generic POSIX subsystem?
811 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
812 # UNAME_MACHINE based on the output of uname instead of i386?
813 echo i586-pc-interix
814 exit ;;
815 i*:UWIN*:*)
816 echo ${UNAME_MACHINE}-pc-uwin
817 exit ;;
818 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
819 echo x86_64-unknown-cygwin
820 exit ;;
821 p*:CYGWIN*:*)
822 echo powerpcle-unknown-cygwin
823 exit ;;
824 prep*:SunOS:5.*:*)
825 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
826 exit ;;
827 *:GNU:*:*)
828 # the GNU system
829 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
830 exit ;;
831 *:GNU/*:*:*)
832 # other systems with GNU libc and userland
833 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
834 exit ;;
835 i*86:Minix:*:*)
836 echo ${UNAME_MACHINE}-pc-minix
837 exit ;;
838 arm*:Linux:*:*)
839 eval $set_cc_for_build
840 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
841 | grep -q __ARM_EABI__
842 then
843 echo ${UNAME_MACHINE}-unknown-linux-gnu
844 else
845 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
846 fi
847 exit ;;
848 avr32*:Linux:*:*)
849 echo ${UNAME_MACHINE}-unknown-linux-gnu
850 exit ;;
851 cris:Linux:*:*)
852 echo cris-axis-linux-gnu
853 exit ;;
854 crisv32:Linux:*:*)
855 echo crisv32-axis-linux-gnu
856 exit ;;
857 frv:Linux:*:*)
858 echo frv-unknown-linux-gnu
859 exit ;;
860 ia64:Linux:*:*)
861 echo ${UNAME_MACHINE}-unknown-linux-gnu
862 exit ;;
863 m32r*:Linux:*:*)
864 echo ${UNAME_MACHINE}-unknown-linux-gnu
865 exit ;;
866 m68*:Linux:*:*)
867 echo ${UNAME_MACHINE}-unknown-linux-gnu
868 exit ;;
869 mips:Linux:*:*)
870 eval $set_cc_for_build
871 sed 's/^ //' << EOF >$dummy.c
872 #undef CPU
873 #undef mips
874 #undef mipsel
875 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
876 CPU=mipsel
877 #else
878 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
879 CPU=mips
880 #else
881 CPU=
882 #endif
883 #endif
884EOF
885 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
886 /^CPU/{
887 s: ::g
888 p
889 }'`"
890 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
891 ;;
892 mips64:Linux:*:*)
893 eval $set_cc_for_build
894 sed 's/^ //' << EOF >$dummy.c
895 #undef CPU
896 #undef mips64
897 #undef mips64el
898 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
899 CPU=mips64el
900 #else
901 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
902 CPU=mips64
903 #else
904 CPU=
905 #endif
906 #endif
907EOF
908 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
909 /^CPU/{
910 s: ::g
911 p
912 }'`"
913 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
914 ;;
915 or32:Linux:*:*)
916 echo or32-unknown-linux-gnu
917 exit ;;
918 ppc:Linux:*:*)
919 echo powerpc-unknown-linux-gnu
920 exit ;;
921 ppc64:Linux:*:*)
922 echo powerpc64-unknown-linux-gnu
923 exit ;;
924 alpha:Linux:*:*)
925 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
926 EV5) UNAME_MACHINE=alphaev5 ;;
927 EV56) UNAME_MACHINE=alphaev56 ;;
928 PCA56) UNAME_MACHINE=alphapca56 ;;
929 PCA57) UNAME_MACHINE=alphapca56 ;;
930 EV6) UNAME_MACHINE=alphaev6 ;;
931 EV67) UNAME_MACHINE=alphaev67 ;;
932 EV68*) UNAME_MACHINE=alphaev68 ;;
933 esac
934 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
935 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
936 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
937 exit ;;
938 parisc:Linux:*:* | hppa:Linux:*:*)
939 # Look for CPU level
940 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
941 PA7*) echo hppa1.1-unknown-linux-gnu ;;
942 PA8*) echo hppa2.0-unknown-linux-gnu ;;
943 *) echo hppa-unknown-linux-gnu ;;
944 esac
945 exit ;;
946 parisc64:Linux:*:* | hppa64:Linux:*:*)
947 echo hppa64-unknown-linux-gnu
948 exit ;;
949 s390:Linux:*:* | s390x:Linux:*:*)
950 echo ${UNAME_MACHINE}-ibm-linux
951 exit ;;
952 sh64*:Linux:*:*)
953 echo ${UNAME_MACHINE}-unknown-linux-gnu
954 exit ;;
955 sh*:Linux:*:*)
956 echo ${UNAME_MACHINE}-unknown-linux-gnu
957 exit ;;
958 sparc:Linux:*:* | sparc64:Linux:*:*)
959 echo ${UNAME_MACHINE}-unknown-linux-gnu
960 exit ;;
961 vax:Linux:*:*)
962 echo ${UNAME_MACHINE}-dec-linux-gnu
963 exit ;;
964 x86_64:Linux:*:*)
965 echo x86_64-unknown-linux-gnu
966 exit ;;
967 xtensa*:Linux:*:*)
968 echo ${UNAME_MACHINE}-unknown-linux-gnu
969 exit ;;
970 i*86:Linux:*:*)
971 # The BFD linker knows what the default object file format is, so
972 # first see if it will tell us. cd to the root directory to prevent
973 # problems with other programs or directories called `ld' in the path.
974 # Set LC_ALL=C to ensure ld outputs messages in English.
975 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
976 | sed -ne '/supported targets:/!d
977 s/[ ][ ]*/ /g
978 s/.*supported targets: *//
979 s/ .*//
980 p'`
981 case "$ld_supported_targets" in
982 elf32-i386)
983 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
984 ;;
985 a.out-i386-linux)
986 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
987 exit ;;
988 coff-i386)
989 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
990 exit ;;
991 "")
992 # Either a pre-BFD a.out linker (linux-gnuoldld) or
993 # one that does not give us useful --help.
994 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
995 exit ;;
996 esac
997 # Determine whether the default compiler is a.out or elf
998 eval $set_cc_for_build
999 sed 's/^ //' << EOF >$dummy.c
1000 #include <features.h>
1001 #ifdef __ELF__
1002 # ifdef __GLIBC__
1003 # if __GLIBC__ >= 2
1004 LIBC=gnu
1005 # else
1006 LIBC=gnulibc1
1007 # endif
1008 # else
1009 LIBC=gnulibc1
1010 # endif
1011 #else
1012 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1013 LIBC=gnu
1014 #else
1015 LIBC=gnuaout
1016 #endif
1017 #endif
1018 #ifdef __dietlibc__
1019 LIBC=dietlibc
1020 #endif
1021EOF
1022 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1023 /^LIBC/{
1024 s: ::g
1025 p
1026 }'`"
1027 test x"${LIBC}" != x && {
1028 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1029 exit
1030 }
1031 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1032 ;;
1033 i*86:DYNIX/ptx:4*:*)
1034 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1035 # earlier versions are messed up and put the nodename in both
1036 # sysname and nodename.
1037 echo i386-sequent-sysv4
1038 exit ;;
1039 i*86:UNIX_SV:4.2MP:2.*)
1040 # Unixware is an offshoot of SVR4, but it has its own version
1041 # number series starting with 2...
1042 # I am not positive that other SVR4 systems won't match this,
1043 # I just have to hope. -- rms.
1044 # Use sysv4.2uw... so that sysv4* matches it.
1045 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1046 exit ;;
1047 i*86:OS/2:*:*)
1048 # If we were able to find `uname', then EMX Unix compatibility
1049 # is probably installed.
1050 echo ${UNAME_MACHINE}-pc-os2-emx
1051 exit ;;
1052 i*86:XTS-300:*:STOP)
1053 echo ${UNAME_MACHINE}-unknown-stop
1054 exit ;;
1055 i*86:atheos:*:*)
1056 echo ${UNAME_MACHINE}-unknown-atheos
1057 exit ;;
1058 i*86:syllable:*:*)
1059 echo ${UNAME_MACHINE}-pc-syllable
1060 exit ;;
1061 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1062 echo i386-unknown-lynxos${UNAME_RELEASE}
1063 exit ;;
1064 i*86:*DOS:*:*)
1065 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1066 exit ;;
1067 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1068 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1069 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1070 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1071 else
1072 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1073 fi
1074 exit ;;
1075 i*86:*:5:[678]*)
1076 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1077 case `/bin/uname -X | grep "^Machine"` in
1078 *486*) UNAME_MACHINE=i486 ;;
1079 *Pentium) UNAME_MACHINE=i586 ;;
1080 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1081 esac
1082 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1083 exit ;;
1084 i*86:*:3.2:*)
1085 if test -f /usr/options/cb.name; then
1086 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1087 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1088 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1089 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1090 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1091 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1092 && UNAME_MACHINE=i586
1093 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1094 && UNAME_MACHINE=i686
1095 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1096 && UNAME_MACHINE=i686
1097 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1098 else
1099 echo ${UNAME_MACHINE}-pc-sysv32
1100 fi
1101 exit ;;
1102 pc:*:*:*)
1103 # Left here for compatibility:
1104 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1105 # the processor, so we play safe by assuming i386.
1106 echo i386-pc-msdosdjgpp
1107 exit ;;
1108 Intel:Mach:3*:*)
1109 echo i386-pc-mach3
1110 exit ;;
1111 paragon:*:*:*)
1112 echo i860-intel-osf1
1113 exit ;;
1114 i860:*:4.*:*) # i860-SVR4
1115 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1116 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1117 else # Add other i860-SVR4 vendors below as they are discovered.
1118 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1119 fi
1120 exit ;;
1121 mini*:CTIX:SYS*5:*)
1122 # "miniframe"
1123 echo m68010-convergent-sysv
1124 exit ;;
1125 mc68k:UNIX:SYSTEM5:3.51m)
1126 echo m68k-convergent-sysv
1127 exit ;;
1128 M680?0:D-NIX:5.3:*)
1129 echo m68k-diab-dnix
1130 exit ;;
1131 M68*:*:R3V[5678]*:*)
1132 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1133 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)
1134 OS_REL=''
1135 test -r /etc/.relid \
1136 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1137 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1138 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1139 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1140 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1141 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1142 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1143 && { echo i486-ncr-sysv4; exit; } ;;
1144 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1145 echo m68k-unknown-lynxos${UNAME_RELEASE}
1146 exit ;;
1147 mc68030:UNIX_System_V:4.*:*)
1148 echo m68k-atari-sysv4
1149 exit ;;
1150 TSUNAMI:LynxOS:2.*:*)
1151 echo sparc-unknown-lynxos${UNAME_RELEASE}
1152 exit ;;
1153 rs6000:LynxOS:2.*:*)
1154 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1155 exit ;;
1156 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1157 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1158 exit ;;
1159 SM[BE]S:UNIX_SV:*:*)
1160 echo mips-dde-sysv${UNAME_RELEASE}
1161 exit ;;
1162 RM*:ReliantUNIX-*:*:*)
1163 echo mips-sni-sysv4
1164 exit ;;
1165 RM*:SINIX-*:*:*)
1166 echo mips-sni-sysv4
1167 exit ;;
1168 *:SINIX-*:*:*)
1169 if uname -p 2>/dev/null >/dev/null ; then
1170 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1171 echo ${UNAME_MACHINE}-sni-sysv4
1172 else
1173 echo ns32k-sni-sysv
1174 fi
1175 exit ;;
1176 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1177 # says <Richard.M.Bartel@ccMail.Census.GOV>
1178 echo i586-unisys-sysv4
1179 exit ;;
1180 *:UNIX_System_V:4*:FTX*)
1181 # From Gerald Hewes <hewes@openmarket.com>.
1182 # How about differentiating between stratus architectures? -djm
1183 echo hppa1.1-stratus-sysv4
1184 exit ;;
1185 *:*:*:FTX*)
1186 # From seanf@swdc.stratus.com.
1187 echo i860-stratus-sysv4
1188 exit ;;
1189 i*86:VOS:*:*)
1190 # From Paul.Green@stratus.com.
1191 echo ${UNAME_MACHINE}-stratus-vos
1192 exit ;;
1193 *:VOS:*:*)
1194 # From Paul.Green@stratus.com.
1195 echo hppa1.1-stratus-vos
1196 exit ;;
1197 mc68*:A/UX:*:*)
1198 echo m68k-apple-aux${UNAME_RELEASE}
1199 exit ;;
1200 news*:NEWS-OS:6*:*)
1201 echo mips-sony-newsos6
1202 exit ;;
1203 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1204 if [ -d /usr/nec ]; then
1205 echo mips-nec-sysv${UNAME_RELEASE}
1206 else
1207 echo mips-unknown-sysv${UNAME_RELEASE}
1208 fi
1209 exit ;;
1210 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1211 echo powerpc-be-beos
1212 exit ;;
1213 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1214 echo powerpc-apple-beos
1215 exit ;;
1216 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1217 echo i586-pc-beos
1218 exit ;;
1219 SX-4:SUPER-UX:*:*)
1220 echo sx4-nec-superux${UNAME_RELEASE}
1221 exit ;;
1222 SX-5:SUPER-UX:*:*)
1223 echo sx5-nec-superux${UNAME_RELEASE}
1224 exit ;;
1225 SX-6:SUPER-UX:*:*)
1226 echo sx6-nec-superux${UNAME_RELEASE}
1227 exit ;;
1228 SX-7:SUPER-UX:*:*)
1229 echo sx7-nec-superux${UNAME_RELEASE}
1230 exit ;;
1231 SX-8:SUPER-UX:*:*)
1232 echo sx8-nec-superux${UNAME_RELEASE}
1233 exit ;;
1234 SX-8R:SUPER-UX:*:*)
1235 echo sx8r-nec-superux${UNAME_RELEASE}
1236 exit ;;
1237 Power*:Rhapsody:*:*)
1238 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1239 exit ;;
1240 *:Rhapsody:*:*)
1241 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1242 exit ;;
1243 *:Darwin:*:*)
1244 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1245 case $UNAME_PROCESSOR in
1246 unknown) UNAME_PROCESSOR=powerpc ;;
1247 esac
1248 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1249 exit ;;
1250 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1251 UNAME_PROCESSOR=`uname -p`
1252 if test "$UNAME_PROCESSOR" = "x86"; then
1253 UNAME_PROCESSOR=i386
1254 UNAME_MACHINE=pc
1255 fi
1256 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1257 exit ;;
1258 *:QNX:*:4*)
1259 echo i386-pc-qnx
1260 exit ;;
1261 NSE-?:NONSTOP_KERNEL:*:*)
1262 echo nse-tandem-nsk${UNAME_RELEASE}
1263 exit ;;
1264 NSR-?:NONSTOP_KERNEL:*:*)
1265 echo nsr-tandem-nsk${UNAME_RELEASE}
1266 exit ;;
1267 *:NonStop-UX:*:*)
1268 echo mips-compaq-nonstopux
1269 exit ;;
1270 BS2000:POSIX*:*:*)
1271 echo bs2000-siemens-sysv
1272 exit ;;
1273 DS/*:UNIX_System_V:*:*)
1274 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1275 exit ;;
1276 *:Plan9:*:*)
1277 # "uname -m" is not consistent, so use $cputype instead. 386
1278 # is converted to i386 for consistency with other x86
1279 # operating systems.
1280 if test "$cputype" = "386"; then
1281 UNAME_MACHINE=i386
1282 else
1283 UNAME_MACHINE="$cputype"
1284 fi
1285 echo ${UNAME_MACHINE}-unknown-plan9
1286 exit ;;
1287 *:TOPS-10:*:*)
1288 echo pdp10-unknown-tops10
1289 exit ;;
1290 *:TENEX:*:*)
1291 echo pdp10-unknown-tenex
1292 exit ;;
1293 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1294 echo pdp10-dec-tops20
1295 exit ;;
1296 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1297 echo pdp10-xkl-tops20
1298 exit ;;
1299 *:TOPS-20:*:*)
1300 echo pdp10-unknown-tops20
1301 exit ;;
1302 *:ITS:*:*)
1303 echo pdp10-unknown-its
1304 exit ;;
1305 SEI:*:*:SEIUX)
1306 echo mips-sei-seiux${UNAME_RELEASE}
1307 exit ;;
1308 *:DragonFly:*:*)
1309 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1310 exit ;;
1311 *:*VMS:*:*)
1312 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1313 case "${UNAME_MACHINE}" in
1314 A*) echo alpha-dec-vms ; exit ;;
1315 I*) echo ia64-dec-vms ; exit ;;
1316 V*) echo vax-dec-vms ; exit ;;
1317 esac ;;
1318 *:XENIX:*:SysV)
1319 echo i386-pc-xenix
1320 exit ;;
1321 i*86:skyos:*:*)
1322 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1323 exit ;;
1324 i*86:rdos:*:*)
1325 echo ${UNAME_MACHINE}-pc-rdos
1326 exit ;;
1327esac
1328
1329#echo '(No uname command or uname output not recognized.)' 1>&2
1330#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1331
1332eval $set_cc_for_build
1333cat >$dummy.c <<EOF
1334#ifdef _SEQUENT_
1335# include <sys/types.h>
1336# include <sys/utsname.h>
1337#endif
1338main ()
1339{
1340#if defined (sony)
1341#if defined (MIPSEB)
1342 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1343 I don't know.... */
1344 printf ("mips-sony-bsd\n"); exit (0);
1345#else
1346#include <sys/param.h>
1347 printf ("m68k-sony-newsos%s\n",
1348#ifdef NEWSOS4
1349 "4"
1350#else
1351 ""
1352#endif
1353 ); exit (0);
1354#endif
1355#endif
1356
1357#if defined (__arm) && defined (__acorn) && defined (__unix)
1358 printf ("arm-acorn-riscix\n"); exit (0);
1359#endif
1360
1361#if defined (hp300) && !defined (hpux)
1362 printf ("m68k-hp-bsd\n"); exit (0);
1363#endif
1364
1365#if defined (NeXT)
1366#if !defined (__ARCHITECTURE__)
1367#define __ARCHITECTURE__ "m68k"
1368#endif
1369 int version;
1370 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1371 if (version < 4)
1372 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1373 else
1374 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1375 exit (0);
1376#endif
1377
1378#if defined (MULTIMAX) || defined (n16)
1379#if defined (UMAXV)
1380 printf ("ns32k-encore-sysv\n"); exit (0);
1381#else
1382#if defined (CMU)
1383 printf ("ns32k-encore-mach\n"); exit (0);
1384#else
1385 printf ("ns32k-encore-bsd\n"); exit (0);
1386#endif
1387#endif
1388#endif
1389
1390#if defined (__386BSD__)
1391 printf ("i386-pc-bsd\n"); exit (0);
1392#endif
1393
1394#if defined (sequent)
1395#if defined (i386)
1396 printf ("i386-sequent-dynix\n"); exit (0);
1397#endif
1398#if defined (ns32000)
1399 printf ("ns32k-sequent-dynix\n"); exit (0);
1400#endif
1401#endif
1402
1403#if defined (_SEQUENT_)
1404 struct utsname un;
1405
1406 uname(&un);
1407
1408 if (strncmp(un.version, "V2", 2) == 0) {
1409 printf ("i386-sequent-ptx2\n"); exit (0);
1410 }
1411 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1412 printf ("i386-sequent-ptx1\n"); exit (0);
1413 }
1414 printf ("i386-sequent-ptx\n"); exit (0);
1415
1416#endif
1417
1418#if defined (vax)
1419# if !defined (ultrix)
1420# include <sys/param.h>
1421# if defined (BSD)
1422# if BSD == 43
1423 printf ("vax-dec-bsd4.3\n"); exit (0);
1424# else
1425# if BSD == 199006
1426 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1427# else
1428 printf ("vax-dec-bsd\n"); exit (0);
1429# endif
1430# endif
1431# else
1432 printf ("vax-dec-bsd\n"); exit (0);
1433# endif
1434# else
1435 printf ("vax-dec-ultrix\n"); exit (0);
1436# endif
1437#endif
1438
1439#if defined (alliant) && defined (i860)
1440 printf ("i860-alliant-bsd\n"); exit (0);
1441#endif
1442
1443 exit (1);
1444}
1445EOF
1446
1447$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1448 { echo "$SYSTEM_NAME"; exit; }
1449
1450# Apollos put the system type in the environment.
1451
1452test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1453
1454# Convex versions that predate uname can use getsysinfo(1)
1455
1456if [ -x /usr/convex/getsysinfo ]
1457then
1458 case `getsysinfo -f cpu_type` in
1459 c1*)
1460 echo c1-convex-bsd
1461 exit ;;
1462 c2*)
1463 if getsysinfo -f scalar_acc
1464 then echo c32-convex-bsd
1465 else echo c2-convex-bsd
1466 fi
1467 exit ;;
1468 c34*)
1469 echo c34-convex-bsd
1470 exit ;;
1471 c38*)
1472 echo c38-convex-bsd
1473 exit ;;
1474 c4*)
1475 echo c4-convex-bsd
1476 exit ;;
1477 esac
1478fi
1479
1480cat >&2 <<EOF
1481$0: unable to guess system type
1482
1483This script, last modified $timestamp, has failed to recognize
1484the operating system you are using. It is advised that you
1485download the most up to date version of the config scripts from
1486
1487 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1488and
1489 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1490
1491If the version you run ($0) is already up to date, please
1492send the following data and any information you think might be
1493pertinent to <config-patches@gnu.org> in order to provide the needed
1494information to handle your system.
1495
1496config.guess timestamp = $timestamp
1497
1498uname -m = `(uname -m) 2>/dev/null || echo unknown`
1499uname -r = `(uname -r) 2>/dev/null || echo unknown`
1500uname -s = `(uname -s) 2>/dev/null || echo unknown`
1501uname -v = `(uname -v) 2>/dev/null || echo unknown`
1502
1503/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1504/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1505
1506hostinfo = `(hostinfo) 2>/dev/null`
1507/bin/universe = `(/bin/universe) 2>/dev/null`
1508/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1509/bin/arch = `(/bin/arch) 2>/dev/null`
1510/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1511/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1512
1513UNAME_MACHINE = ${UNAME_MACHINE}
1514UNAME_RELEASE = ${UNAME_RELEASE}
1515UNAME_SYSTEM = ${UNAME_SYSTEM}
1516UNAME_VERSION = ${UNAME_VERSION}
1517EOF
1518
1519exit 1
1520
1521# Local variables:
1522# eval: (add-hook 'write-file-hooks 'time-stamp)
1523# time-stamp-start: "timestamp='"
1524# time-stamp-format: "%:y-%02m-%02d"
1525# time-stamp-end: "'"
1526# End:
diff --git a/src/others/mimesh/libg3d-0.0.8/config/config.sub b/src/others/mimesh/libg3d-0.0.8/config/config.sub
new file mode 100755
index 0000000..6759825
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/config/config.sub
@@ -0,0 +1,1658 @@
1#! /bin/sh
2# Configuration validation subroutine script.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5# Free Software Foundation, Inc.
6
7timestamp='2008-01-16'
8
9# This file is (in principle) common to ALL GNU software.
10# The presence of a machine in this file suggests that SOME GNU software
11# can handle that machine. It does not imply ALL GNU software can.
12#
13# This file is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26# 02110-1301, USA.
27#
28# As a special exception to the GNU General Public License, if you
29# distribute this file as part of a program that contains a
30# configuration script generated by Autoconf, you may include it under
31# the same distribution terms that you use for the rest of that program.
32
33
34# Please send patches to <config-patches@gnu.org>. Submit a context
35# diff and a properly formatted ChangeLog entry.
36#
37# Configuration subroutine to validate and canonicalize a configuration type.
38# Supply the specified configuration type as an argument.
39# If it is invalid, we print an error message on stderr and exit with code 1.
40# Otherwise, we print the canonical config type on stdout and succeed.
41
42# This file is supposed to be the same for all GNU packages
43# and recognize all the CPU types, system types and aliases
44# that are meaningful with *any* GNU software.
45# Each package is responsible for reporting which valid configurations
46# it does not support. The user should be able to distinguish
47# a failure to support a valid configuration from a meaningless
48# configuration.
49
50# The goal of this file is to map all the various variations of a given
51# machine specification into a single specification in the form:
52# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
53# or in some cases, the newer four-part form:
54# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
55# It is wrong to echo any other type of specification.
56
57me=`echo "$0" | sed -e 's,.*/,,'`
58
59usage="\
60Usage: $0 [OPTION] CPU-MFR-OPSYS
61 $0 [OPTION] ALIAS
62
63Canonicalize a configuration name.
64
65Operation modes:
66 -h, --help print this help, then exit
67 -t, --time-stamp print date of last modification, then exit
68 -v, --version print version number, then exit
69
70Report bugs and patches to <config-patches@gnu.org>."
71
72version="\
73GNU config.sub ($timestamp)
74
75Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
762002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
77
78This is free software; see the source for copying conditions. There is NO
79warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
80
81help="
82Try \`$me --help' for more information."
83
84# Parse command line
85while test $# -gt 0 ; do
86 case $1 in
87 --time-stamp | --time* | -t )
88 echo "$timestamp" ; exit ;;
89 --version | -v )
90 echo "$version" ; exit ;;
91 --help | --h* | -h )
92 echo "$usage"; exit ;;
93 -- ) # Stop option processing
94 shift; break ;;
95 - ) # Use stdin as input.
96 break ;;
97 -* )
98 echo "$me: invalid option $1$help"
99 exit 1 ;;
100
101 *local*)
102 # First pass through any local machine types.
103 echo $1
104 exit ;;
105
106 * )
107 break ;;
108 esac
109done
110
111case $# in
112 0) echo "$me: missing argument$help" >&2
113 exit 1;;
114 1) ;;
115 *) echo "$me: too many arguments$help" >&2
116 exit 1;;
117esac
118
119# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
120# Here we must recognize all the valid KERNEL-OS combinations.
121maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122case $maybe_os in
123 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125 storm-chaos* | os2-emx* | rtmk-nova*)
126 os=-$maybe_os
127 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
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 ;;
135esac
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.
141case $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)
152 os=
153 basic_machine=$1
154 ;;
155 -sim | -cisco | -oki | -wec | -winbond)
156 os=
157 basic_machine=$1
158 ;;
159 -scout)
160 ;;
161 -wrs)
162 os=-vxworks
163 basic_machine=$1
164 ;;
165 -chorusos*)
166 os=-chorusos
167 basic_machine=$1
168 ;;
169 -chorusrdb)
170 os=-chorusrdb
171 basic_machine=$1
172 ;;
173 -hiux*)
174 os=-hiuxwe2
175 ;;
176 -sco6)
177 os=-sco5v6
178 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
179 ;;
180 -sco5)
181 os=-sco3.2v5
182 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
183 ;;
184 -sco4)
185 os=-sco3.2v4
186 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187 ;;
188 -sco3.2.[4-9]*)
189 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
190 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191 ;;
192 -sco3.2v[4-9]*)
193 # Don't forget version if it is 3.2v4 or newer.
194 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195 ;;
196 -sco5v6*)
197 # Don't forget version if it is 3.2v4 or newer.
198 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199 ;;
200 -sco*)
201 os=-sco3.2v2
202 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203 ;;
204 -udk*)
205 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206 ;;
207 -isc)
208 os=-isc2.2
209 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
210 ;;
211 -clix*)
212 basic_machine=clipper-intergraph
213 ;;
214 -isc*)
215 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
216 ;;
217 -lynx*)
218 os=-lynxos
219 ;;
220 -ptx*)
221 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
222 ;;
223 -windowsnt*)
224 os=`echo $os | sed -e 's/windowsnt/winnt/'`
225 ;;
226 -psos*)
227 os=-psos
228 ;;
229 -mint | -mint[0-9]*)
230 basic_machine=m68k-atari
231 os=-mint
232 ;;
233esac
234
235# Decode aliases for certain CPU-COMPANY combinations.
236case $basic_machine in
237 # Recognize the basic CPU types without company name.
238 # Some are omitted here because they have special meanings below.
239 1750a | 580 \
240 | a29k \
241 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
242 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
243 | am33_2.0 \
244 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
245 | bfin \
246 | c4x | clipper \
247 | d10v | d30v | dlx | dsp16xx \
248 | fido | fr30 | frv \
249 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
250 | i370 | i860 | i960 | ia64 \
251 | ip2k | iq2000 \
252 | m32c | m32r | m32rle | m68000 | m68k | m88k \
253 | maxq | mb | microblaze | mcore | mep \
254 | mips | mipsbe | mipseb | mipsel | mipsle \
255 | mips16 \
256 | mips64 | mips64el \
257 | mips64vr | mips64vrel \
258 | mips64orion | mips64orionel \
259 | mips64vr4100 | mips64vr4100el \
260 | mips64vr4300 | mips64vr4300el \
261 | mips64vr5000 | mips64vr5000el \
262 | mips64vr5900 | mips64vr5900el \
263 | mipsisa32 | mipsisa32el \
264 | mipsisa32r2 | mipsisa32r2el \
265 | mipsisa64 | mipsisa64el \
266 | mipsisa64r2 | mipsisa64r2el \
267 | mipsisa64sb1 | mipsisa64sb1el \
268 | mipsisa64sr71k | mipsisa64sr71kel \
269 | mipstx39 | mipstx39el \
270 | mn10200 | mn10300 \
271 | mt \
272 | msp430 \
273 | nios | nios2 \
274 | ns16k | ns32k \
275 | or32 \
276 | pdp10 | pdp11 | pj | pjl \
277 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
278 | pyramid \
279 | score \
280 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
281 | sh64 | sh64le \
282 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
283 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
284 | spu | strongarm \
285 | tahoe | thumb | tic4x | tic80 | tron \
286 | v850 | v850e \
287 | we32k \
288 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
289 | z8k)
290 basic_machine=$basic_machine-unknown
291 ;;
292 m6811 | m68hc11 | m6812 | m68hc12)
293 # Motorola 68HC11/12.
294 basic_machine=$basic_machine-unknown
295 os=-none
296 ;;
297 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
298 ;;
299 ms1)
300 basic_machine=mt-unknown
301 ;;
302
303 # We use `pc' rather than `unknown'
304 # because (1) that's what they normally are, and
305 # (2) the word "unknown" tends to confuse beginning users.
306 i*86 | x86_64)
307 basic_machine=$basic_machine-pc
308 ;;
309 # Object if more than one company name word.
310 *-*-*)
311 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
312 exit 1
313 ;;
314 # Recognize the basic CPU types with company name.
315 580-* \
316 | a29k-* \
317 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
318 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
319 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
320 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
321 | avr-* | avr32-* \
322 | bfin-* | bs2000-* \
323 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
324 | clipper-* | craynv-* | cydra-* \
325 | d10v-* | d30v-* | dlx-* \
326 | elxsi-* \
327 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
328 | h8300-* | h8500-* \
329 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
330 | i*86-* | i860-* | i960-* | ia64-* \
331 | ip2k-* | iq2000-* \
332 | m32c-* | m32r-* | m32rle-* \
333 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
334 | m88110-* | m88k-* | maxq-* | mcore-* \
335 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
336 | mips16-* \
337 | mips64-* | mips64el-* \
338 | mips64vr-* | mips64vrel-* \
339 | mips64orion-* | mips64orionel-* \
340 | mips64vr4100-* | mips64vr4100el-* \
341 | mips64vr4300-* | mips64vr4300el-* \
342 | mips64vr5000-* | mips64vr5000el-* \
343 | mips64vr5900-* | mips64vr5900el-* \
344 | mipsisa32-* | mipsisa32el-* \
345 | mipsisa32r2-* | mipsisa32r2el-* \
346 | mipsisa64-* | mipsisa64el-* \
347 | mipsisa64r2-* | mipsisa64r2el-* \
348 | mipsisa64sb1-* | mipsisa64sb1el-* \
349 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
350 | mipstx39-* | mipstx39el-* \
351 | mmix-* \
352 | mt-* \
353 | msp430-* \
354 | nios-* | nios2-* \
355 | none-* | np1-* | ns16k-* | ns32k-* \
356 | orion-* \
357 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
358 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
359 | pyramid-* \
360 | romp-* | rs6000-* \
361 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
362 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
363 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
364 | sparclite-* \
365 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
366 | tahoe-* | thumb-* \
367 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
368 | tron-* \
369 | v850-* | v850e-* | vax-* \
370 | we32k-* \
371 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
372 | xstormy16-* | xtensa*-* \
373 | ymp-* \
374 | z8k-*)
375 ;;
376 # Recognize the basic CPU types without company name, with glob match.
377 xtensa*)
378 basic_machine=$basic_machine-unknown
379 ;;
380 # Recognize the various machine names and aliases which stand
381 # for a CPU type and a company and sometimes even an OS.
382 386bsd)
383 basic_machine=i386-unknown
384 os=-bsd
385 ;;
386 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
387 basic_machine=m68000-att
388 ;;
389 3b*)
390 basic_machine=we32k-att
391 ;;
392 a29khif)
393 basic_machine=a29k-amd
394 os=-udi
395 ;;
396 abacus)
397 basic_machine=abacus-unknown
398 ;;
399 adobe68k)
400 basic_machine=m68010-adobe
401 os=-scout
402 ;;
403 alliant | fx80)
404 basic_machine=fx80-alliant
405 ;;
406 altos | altos3068)
407 basic_machine=m68k-altos
408 ;;
409 am29k)
410 basic_machine=a29k-none
411 os=-bsd
412 ;;
413 amd64)
414 basic_machine=x86_64-pc
415 ;;
416 amd64-*)
417 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
418 ;;
419 amdahl)
420 basic_machine=580-amdahl
421 os=-sysv
422 ;;
423 amiga | amiga-*)
424 basic_machine=m68k-unknown
425 ;;
426 amigaos | amigados)
427 basic_machine=m68k-unknown
428 os=-amigaos
429 ;;
430 amigaunix | amix)
431 basic_machine=m68k-unknown
432 os=-sysv4
433 ;;
434 apollo68)
435 basic_machine=m68k-apollo
436 os=-sysv
437 ;;
438 apollo68bsd)
439 basic_machine=m68k-apollo
440 os=-bsd
441 ;;
442 aux)
443 basic_machine=m68k-apple
444 os=-aux
445 ;;
446 balance)
447 basic_machine=ns32k-sequent
448 os=-dynix
449 ;;
450 blackfin)
451 basic_machine=bfin-unknown
452 os=-linux
453 ;;
454 blackfin-*)
455 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
456 os=-linux
457 ;;
458 c90)
459 basic_machine=c90-cray
460 os=-unicos
461 ;;
462 convex-c1)
463 basic_machine=c1-convex
464 os=-bsd
465 ;;
466 convex-c2)
467 basic_machine=c2-convex
468 os=-bsd
469 ;;
470 convex-c32)
471 basic_machine=c32-convex
472 os=-bsd
473 ;;
474 convex-c34)
475 basic_machine=c34-convex
476 os=-bsd
477 ;;
478 convex-c38)
479 basic_machine=c38-convex
480 os=-bsd
481 ;;
482 cray | j90)
483 basic_machine=j90-cray
484 os=-unicos
485 ;;
486 craynv)
487 basic_machine=craynv-cray
488 os=-unicosmp
489 ;;
490 cr16)
491 basic_machine=cr16-unknown
492 os=-elf
493 ;;
494 crds | unos)
495 basic_machine=m68k-crds
496 ;;
497 crisv32 | crisv32-* | etraxfs*)
498 basic_machine=crisv32-axis
499 ;;
500 cris | cris-* | etrax*)
501 basic_machine=cris-axis
502 ;;
503 crx)
504 basic_machine=crx-unknown
505 os=-elf
506 ;;
507 da30 | da30-*)
508 basic_machine=m68k-da30
509 ;;
510 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
511 basic_machine=mips-dec
512 ;;
513 decsystem10* | dec10*)
514 basic_machine=pdp10-dec
515 os=-tops10
516 ;;
517 decsystem20* | dec20*)
518 basic_machine=pdp10-dec
519 os=-tops20
520 ;;
521 delta | 3300 | motorola-3300 | motorola-delta \
522 | 3300-motorola | delta-motorola)
523 basic_machine=m68k-motorola
524 ;;
525 delta88)
526 basic_machine=m88k-motorola
527 os=-sysv3
528 ;;
529 djgpp)
530 basic_machine=i586-pc
531 os=-msdosdjgpp
532 ;;
533 dpx20 | dpx20-*)
534 basic_machine=rs6000-bull
535 os=-bosx
536 ;;
537 dpx2* | dpx2*-bull)
538 basic_machine=m68k-bull
539 os=-sysv3
540 ;;
541 ebmon29k)
542 basic_machine=a29k-amd
543 os=-ebmon
544 ;;
545 elxsi)
546 basic_machine=elxsi-elxsi
547 os=-bsd
548 ;;
549 encore | umax | mmax)
550 basic_machine=ns32k-encore
551 ;;
552 es1800 | OSE68k | ose68k | ose | OSE)
553 basic_machine=m68k-ericsson
554 os=-ose
555 ;;
556 fx2800)
557 basic_machine=i860-alliant
558 ;;
559 genix)
560 basic_machine=ns32k-ns
561 ;;
562 gmicro)
563 basic_machine=tron-gmicro
564 os=-sysv
565 ;;
566 go32)
567 basic_machine=i386-pc
568 os=-go32
569 ;;
570 h3050r* | hiux*)
571 basic_machine=hppa1.1-hitachi
572 os=-hiuxwe2
573 ;;
574 h8300hms)
575 basic_machine=h8300-hitachi
576 os=-hms
577 ;;
578 h8300xray)
579 basic_machine=h8300-hitachi
580 os=-xray
581 ;;
582 h8500hms)
583 basic_machine=h8500-hitachi
584 os=-hms
585 ;;
586 harris)
587 basic_machine=m88k-harris
588 os=-sysv3
589 ;;
590 hp300-*)
591 basic_machine=m68k-hp
592 ;;
593 hp300bsd)
594 basic_machine=m68k-hp
595 os=-bsd
596 ;;
597 hp300hpux)
598 basic_machine=m68k-hp
599 os=-hpux
600 ;;
601 hp3k9[0-9][0-9] | hp9[0-9][0-9])
602 basic_machine=hppa1.0-hp
603 ;;
604 hp9k2[0-9][0-9] | hp9k31[0-9])
605 basic_machine=m68000-hp
606 ;;
607 hp9k3[2-9][0-9])
608 basic_machine=m68k-hp
609 ;;
610 hp9k6[0-9][0-9] | hp6[0-9][0-9])
611 basic_machine=hppa1.0-hp
612 ;;
613 hp9k7[0-79][0-9] | hp7[0-79][0-9])
614 basic_machine=hppa1.1-hp
615 ;;
616 hp9k78[0-9] | hp78[0-9])
617 # FIXME: really hppa2.0-hp
618 basic_machine=hppa1.1-hp
619 ;;
620 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
621 # FIXME: really hppa2.0-hp
622 basic_machine=hppa1.1-hp
623 ;;
624 hp9k8[0-9][13679] | hp8[0-9][13679])
625 basic_machine=hppa1.1-hp
626 ;;
627 hp9k8[0-9][0-9] | hp8[0-9][0-9])
628 basic_machine=hppa1.0-hp
629 ;;
630 hppa-next)
631 os=-nextstep3
632 ;;
633 hppaosf)
634 basic_machine=hppa1.1-hp
635 os=-osf
636 ;;
637 hppro)
638 basic_machine=hppa1.1-hp
639 os=-proelf
640 ;;
641 i370-ibm* | ibm*)
642 basic_machine=i370-ibm
643 ;;
644# I'm not sure what "Sysv32" means. Should this be sysv3.2?
645 i*86v32)
646 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
647 os=-sysv32
648 ;;
649 i*86v4*)
650 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
651 os=-sysv4
652 ;;
653 i*86v)
654 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
655 os=-sysv
656 ;;
657 i*86sol2)
658 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
659 os=-solaris2
660 ;;
661 i386mach)
662 basic_machine=i386-mach
663 os=-mach
664 ;;
665 i386-vsta | vsta)
666 basic_machine=i386-unknown
667 os=-vsta
668 ;;
669 iris | iris4d)
670 basic_machine=mips-sgi
671 case $os in
672 -irix*)
673 ;;
674 *)
675 os=-irix4
676 ;;
677 esac
678 ;;
679 isi68 | isi)
680 basic_machine=m68k-isi
681 os=-sysv
682 ;;
683 m68knommu)
684 basic_machine=m68k-unknown
685 os=-linux
686 ;;
687 m68knommu-*)
688 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
689 os=-linux
690 ;;
691 m88k-omron*)
692 basic_machine=m88k-omron
693 ;;
694 magnum | m3230)
695 basic_machine=mips-mips
696 os=-sysv
697 ;;
698 merlin)
699 basic_machine=ns32k-utek
700 os=-sysv
701 ;;
702 mingw32)
703 basic_machine=i386-pc
704 os=-mingw32
705 ;;
706 mingw32ce)
707 basic_machine=arm-unknown
708 os=-mingw32ce
709 ;;
710 miniframe)
711 basic_machine=m68000-convergent
712 ;;
713 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
714 basic_machine=m68k-atari
715 os=-mint
716 ;;
717 mips3*-*)
718 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
719 ;;
720 mips3*)
721 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
722 ;;
723 monitor)
724 basic_machine=m68k-rom68k
725 os=-coff
726 ;;
727 morphos)
728 basic_machine=powerpc-unknown
729 os=-morphos
730 ;;
731 msdos)
732 basic_machine=i386-pc
733 os=-msdos
734 ;;
735 ms1-*)
736 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
737 ;;
738 mvs)
739 basic_machine=i370-ibm
740 os=-mvs
741 ;;
742 ncr3000)
743 basic_machine=i486-ncr
744 os=-sysv4
745 ;;
746 netbsd386)
747 basic_machine=i386-unknown
748 os=-netbsd
749 ;;
750 netwinder)
751 basic_machine=armv4l-rebel
752 os=-linux
753 ;;
754 news | news700 | news800 | news900)
755 basic_machine=m68k-sony
756 os=-newsos
757 ;;
758 news1000)
759 basic_machine=m68030-sony
760 os=-newsos
761 ;;
762 news-3600 | risc-news)
763 basic_machine=mips-sony
764 os=-newsos
765 ;;
766 necv70)
767 basic_machine=v70-nec
768 os=-sysv
769 ;;
770 next | m*-next )
771 basic_machine=m68k-next
772 case $os in
773 -nextstep* )
774 ;;
775 -ns2*)
776 os=-nextstep2
777 ;;
778 *)
779 os=-nextstep3
780 ;;
781 esac
782 ;;
783 nh3000)
784 basic_machine=m68k-harris
785 os=-cxux
786 ;;
787 nh[45]000)
788 basic_machine=m88k-harris
789 os=-cxux
790 ;;
791 nindy960)
792 basic_machine=i960-intel
793 os=-nindy
794 ;;
795 mon960)
796 basic_machine=i960-intel
797 os=-mon960
798 ;;
799 nonstopux)
800 basic_machine=mips-compaq
801 os=-nonstopux
802 ;;
803 np1)
804 basic_machine=np1-gould
805 ;;
806 nsr-tandem)
807 basic_machine=nsr-tandem
808 ;;
809 op50n-* | op60c-*)
810 basic_machine=hppa1.1-oki
811 os=-proelf
812 ;;
813 openrisc | openrisc-*)
814 basic_machine=or32-unknown
815 ;;
816 os400)
817 basic_machine=powerpc-ibm
818 os=-os400
819 ;;
820 OSE68000 | ose68000)
821 basic_machine=m68000-ericsson
822 os=-ose
823 ;;
824 os68k)
825 basic_machine=m68k-none
826 os=-os68k
827 ;;
828 pa-hitachi)
829 basic_machine=hppa1.1-hitachi
830 os=-hiuxwe2
831 ;;
832 paragon)
833 basic_machine=i860-intel
834 os=-osf
835 ;;
836 parisc)
837 basic_machine=hppa-unknown
838 os=-linux
839 ;;
840 parisc-*)
841 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
842 os=-linux
843 ;;
844 pbd)
845 basic_machine=sparc-tti
846 ;;
847 pbb)
848 basic_machine=m68k-tti
849 ;;
850 pc532 | pc532-*)
851 basic_machine=ns32k-pc532
852 ;;
853 pc98)
854 basic_machine=i386-pc
855 ;;
856 pc98-*)
857 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
858 ;;
859 pentium | p5 | k5 | k6 | nexgen | viac3)
860 basic_machine=i586-pc
861 ;;
862 pentiumpro | p6 | 6x86 | athlon | athlon_*)
863 basic_machine=i686-pc
864 ;;
865 pentiumii | pentium2 | pentiumiii | pentium3)
866 basic_machine=i686-pc
867 ;;
868 pentium4)
869 basic_machine=i786-pc
870 ;;
871 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
872 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
873 ;;
874 pentiumpro-* | p6-* | 6x86-* | athlon-*)
875 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
876 ;;
877 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
878 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
879 ;;
880 pentium4-*)
881 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
882 ;;
883 pn)
884 basic_machine=pn-gould
885 ;;
886 power) basic_machine=power-ibm
887 ;;
888 ppc) basic_machine=powerpc-unknown
889 ;;
890 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
891 ;;
892 ppcle | powerpclittle | ppc-le | powerpc-little)
893 basic_machine=powerpcle-unknown
894 ;;
895 ppcle-* | powerpclittle-*)
896 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
897 ;;
898 ppc64) basic_machine=powerpc64-unknown
899 ;;
900 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
901 ;;
902 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
903 basic_machine=powerpc64le-unknown
904 ;;
905 ppc64le-* | powerpc64little-*)
906 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
907 ;;
908 ps2)
909 basic_machine=i386-ibm
910 ;;
911 pw32)
912 basic_machine=i586-unknown
913 os=-pw32
914 ;;
915 rdos)
916 basic_machine=i386-pc
917 os=-rdos
918 ;;
919 rom68k)
920 basic_machine=m68k-rom68k
921 os=-coff
922 ;;
923 rm[46]00)
924 basic_machine=mips-siemens
925 ;;
926 rtpc | rtpc-*)
927 basic_machine=romp-ibm
928 ;;
929 s390 | s390-*)
930 basic_machine=s390-ibm
931 ;;
932 s390x | s390x-*)
933 basic_machine=s390x-ibm
934 ;;
935 sa29200)
936 basic_machine=a29k-amd
937 os=-udi
938 ;;
939 sb1)
940 basic_machine=mipsisa64sb1-unknown
941 ;;
942 sb1el)
943 basic_machine=mipsisa64sb1el-unknown
944 ;;
945 sde)
946 basic_machine=mipsisa32-sde
947 os=-elf
948 ;;
949 sei)
950 basic_machine=mips-sei
951 os=-seiux
952 ;;
953 sequent)
954 basic_machine=i386-sequent
955 ;;
956 sh)
957 basic_machine=sh-hitachi
958 os=-hms
959 ;;
960 sh5el)
961 basic_machine=sh5le-unknown
962 ;;
963 sh64)
964 basic_machine=sh64-unknown
965 ;;
966 sparclite-wrs | simso-wrs)
967 basic_machine=sparclite-wrs
968 os=-vxworks
969 ;;
970 sps7)
971 basic_machine=m68k-bull
972 os=-sysv2
973 ;;
974 spur)
975 basic_machine=spur-unknown
976 ;;
977 st2000)
978 basic_machine=m68k-tandem
979 ;;
980 stratus)
981 basic_machine=i860-stratus
982 os=-sysv4
983 ;;
984 sun2)
985 basic_machine=m68000-sun
986 ;;
987 sun2os3)
988 basic_machine=m68000-sun
989 os=-sunos3
990 ;;
991 sun2os4)
992 basic_machine=m68000-sun
993 os=-sunos4
994 ;;
995 sun3os3)
996 basic_machine=m68k-sun
997 os=-sunos3
998 ;;
999 sun3os4)
1000 basic_machine=m68k-sun
1001 os=-sunos4
1002 ;;
1003 sun4os3)
1004 basic_machine=sparc-sun
1005 os=-sunos3
1006 ;;
1007 sun4os4)
1008 basic_machine=sparc-sun
1009 os=-sunos4
1010 ;;
1011 sun4sol2)
1012 basic_machine=sparc-sun
1013 os=-solaris2
1014 ;;
1015 sun3 | sun3-*)
1016 basic_machine=m68k-sun
1017 ;;
1018 sun4)
1019 basic_machine=sparc-sun
1020 ;;
1021 sun386 | sun386i | roadrunner)
1022 basic_machine=i386-sun
1023 ;;
1024 sv1)
1025 basic_machine=sv1-cray
1026 os=-unicos
1027 ;;
1028 symmetry)
1029 basic_machine=i386-sequent
1030 os=-dynix
1031 ;;
1032 t3e)
1033 basic_machine=alphaev5-cray
1034 os=-unicos
1035 ;;
1036 t90)
1037 basic_machine=t90-cray
1038 os=-unicos
1039 ;;
1040 tic54x | c54x*)
1041 basic_machine=tic54x-unknown
1042 os=-coff
1043 ;;
1044 tic55x | c55x*)
1045 basic_machine=tic55x-unknown
1046 os=-coff
1047 ;;
1048 tic6x | c6x*)
1049 basic_machine=tic6x-unknown
1050 os=-coff
1051 ;;
1052 tile*)
1053 basic_machine=tile-unknown
1054 os=-linux-gnu
1055 ;;
1056 tx39)
1057 basic_machine=mipstx39-unknown
1058 ;;
1059 tx39el)
1060 basic_machine=mipstx39el-unknown
1061 ;;
1062 toad1)
1063 basic_machine=pdp10-xkl
1064 os=-tops20
1065 ;;
1066 tower | tower-32)
1067 basic_machine=m68k-ncr
1068 ;;
1069 tpf)
1070 basic_machine=s390x-ibm
1071 os=-tpf
1072 ;;
1073 udi29k)
1074 basic_machine=a29k-amd
1075 os=-udi
1076 ;;
1077 ultra3)
1078 basic_machine=a29k-nyu
1079 os=-sym1
1080 ;;
1081 v810 | necv810)
1082 basic_machine=v810-nec
1083 os=-none
1084 ;;
1085 vaxv)
1086 basic_machine=vax-dec
1087 os=-sysv
1088 ;;
1089 vms)
1090 basic_machine=vax-dec
1091 os=-vms
1092 ;;
1093 vpp*|vx|vx-*)
1094 basic_machine=f301-fujitsu
1095 ;;
1096 vxworks960)
1097 basic_machine=i960-wrs
1098 os=-vxworks
1099 ;;
1100 vxworks68)
1101 basic_machine=m68k-wrs
1102 os=-vxworks
1103 ;;
1104 vxworks29k)
1105 basic_machine=a29k-wrs
1106 os=-vxworks
1107 ;;
1108 w65*)
1109 basic_machine=w65-wdc
1110 os=-none
1111 ;;
1112 w89k-*)
1113 basic_machine=hppa1.1-winbond
1114 os=-proelf
1115 ;;
1116 xbox)
1117 basic_machine=i686-pc
1118 os=-mingw32
1119 ;;
1120 xps | xps100)
1121 basic_machine=xps100-honeywell
1122 ;;
1123 ymp)
1124 basic_machine=ymp-cray
1125 os=-unicos
1126 ;;
1127 z8k-*-coff)
1128 basic_machine=z8k-unknown
1129 os=-sim
1130 ;;
1131 none)
1132 basic_machine=none-none
1133 os=-none
1134 ;;
1135
1136# Here we handle the default manufacturer of certain CPU types. It is in
1137# some cases the only manufacturer, in others, it is the most popular.
1138 w89k)
1139 basic_machine=hppa1.1-winbond
1140 ;;
1141 op50n)
1142 basic_machine=hppa1.1-oki
1143 ;;
1144 op60c)
1145 basic_machine=hppa1.1-oki
1146 ;;
1147 romp)
1148 basic_machine=romp-ibm
1149 ;;
1150 mmix)
1151 basic_machine=mmix-knuth
1152 ;;
1153 rs6000)
1154 basic_machine=rs6000-ibm
1155 ;;
1156 vax)
1157 basic_machine=vax-dec
1158 ;;
1159 pdp10)
1160 # there are many clones, so DEC is not a safe bet
1161 basic_machine=pdp10-unknown
1162 ;;
1163 pdp11)
1164 basic_machine=pdp11-dec
1165 ;;
1166 we32k)
1167 basic_machine=we32k-att
1168 ;;
1169 sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1170 basic_machine=sh-unknown
1171 ;;
1172 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1173 basic_machine=sparc-sun
1174 ;;
1175 cydra)
1176 basic_machine=cydra-cydrome
1177 ;;
1178 orion)
1179 basic_machine=orion-highlevel
1180 ;;
1181 orion105)
1182 basic_machine=clipper-highlevel
1183 ;;
1184 mac | mpw | mac-mpw)
1185 basic_machine=m68k-apple
1186 ;;
1187 pmac | pmac-mpw)
1188 basic_machine=powerpc-apple
1189 ;;
1190 *-unknown)
1191 # Make sure to match an already-canonicalized machine name.
1192 ;;
1193 *)
1194 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1195 exit 1
1196 ;;
1197esac
1198
1199# Here we canonicalize certain aliases for manufacturers.
1200case $basic_machine in
1201 *-digital*)
1202 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1203 ;;
1204 *-commodore*)
1205 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1206 ;;
1207 *)
1208 ;;
1209esac
1210
1211# Decode manufacturer-specific aliases for certain operating systems.
1212
1213if [ x"$os" != x"" ]
1214then
1215case $os in
1216 # First match some system type aliases
1217 # that might get confused with valid system types.
1218 # -solaris* is a basic system type, with this one exception.
1219 -solaris1 | -solaris1.*)
1220 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1221 ;;
1222 -solaris)
1223 os=-solaris2
1224 ;;
1225 -svr4*)
1226 os=-sysv4
1227 ;;
1228 -unixware*)
1229 os=-sysv4.2uw
1230 ;;
1231 -gnu/linux*)
1232 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1233 ;;
1234 # First accept the basic system types.
1235 # The portable systems comes first.
1236 # Each alternative MUST END IN A *, to match a version number.
1237 # -sysv* is not here because it comes later, after sysvr4.
1238 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1239 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1240 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1241 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1242 | -aos* \
1243 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1244 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1245 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1246 | -openbsd* | -solidbsd* \
1247 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1248 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1249 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1250 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1251 | -chorusos* | -chorusrdb* \
1252 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1253 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1254 | -uxpv* | -beos* | -mpeix* | -udk* \
1255 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1256 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1257 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1258 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1259 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1260 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1261 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1262 # Remember, each alternative MUST END IN *, to match a version number.
1263 ;;
1264 -qnx*)
1265 case $basic_machine in
1266 x86-* | i*86-*)
1267 ;;
1268 *)
1269 os=-nto$os
1270 ;;
1271 esac
1272 ;;
1273 -nto-qnx*)
1274 ;;
1275 -nto*)
1276 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1277 ;;
1278 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1279 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1280 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1281 ;;
1282 -mac*)
1283 os=`echo $os | sed -e 's|mac|macos|'`
1284 ;;
1285 -linux-dietlibc)
1286 os=-linux-dietlibc
1287 ;;
1288 -linux*)
1289 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1290 ;;
1291 -sunos5*)
1292 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1293 ;;
1294 -sunos6*)
1295 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1296 ;;
1297 -opened*)
1298 os=-openedition
1299 ;;
1300 -os400*)
1301 os=-os400
1302 ;;
1303 -wince*)
1304 os=-wince
1305 ;;
1306 -osfrose*)
1307 os=-osfrose
1308 ;;
1309 -osf*)
1310 os=-osf
1311 ;;
1312 -utek*)
1313 os=-bsd
1314 ;;
1315 -dynix*)
1316 os=-bsd
1317 ;;
1318 -acis*)
1319 os=-aos
1320 ;;
1321 -atheos*)
1322 os=-atheos
1323 ;;
1324 -syllable*)
1325 os=-syllable
1326 ;;
1327 -386bsd)
1328 os=-bsd
1329 ;;
1330 -ctix* | -uts*)
1331 os=-sysv
1332 ;;
1333 -nova*)
1334 os=-rtmk-nova
1335 ;;
1336 -ns2 )
1337 os=-nextstep2
1338 ;;
1339 -nsk*)
1340 os=-nsk
1341 ;;
1342 # Preserve the version number of sinix5.
1343 -sinix5.*)
1344 os=`echo $os | sed -e 's|sinix|sysv|'`
1345 ;;
1346 -sinix*)
1347 os=-sysv4
1348 ;;
1349 -tpf*)
1350 os=-tpf
1351 ;;
1352 -triton*)
1353 os=-sysv3
1354 ;;
1355 -oss*)
1356 os=-sysv3
1357 ;;
1358 -svr4)
1359 os=-sysv4
1360 ;;
1361 -svr3)
1362 os=-sysv3
1363 ;;
1364 -sysvr4)
1365 os=-sysv4
1366 ;;
1367 # This must come after -sysvr4.
1368 -sysv*)
1369 ;;
1370 -ose*)
1371 os=-ose
1372 ;;
1373 -es1800*)
1374 os=-ose
1375 ;;
1376 -xenix)
1377 os=-xenix
1378 ;;
1379 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1380 os=-mint
1381 ;;
1382 -aros*)
1383 os=-aros
1384 ;;
1385 -kaos*)
1386 os=-kaos
1387 ;;
1388 -zvmoe)
1389 os=-zvmoe
1390 ;;
1391 -none)
1392 ;;
1393 *)
1394 # Get rid of the `-' at the beginning of $os.
1395 os=`echo $os | sed 's/[^-]*-//'`
1396 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1397 exit 1
1398 ;;
1399esac
1400else
1401
1402# Here we handle the default operating systems that come with various machines.
1403# The value should be what the vendor currently ships out the door with their
1404# machine or put another way, the most popular os provided with the machine.
1405
1406# Note that if you're going to try to match "-MANUFACTURER" here (say,
1407# "-sun"), then you have to tell the case statement up towards the top
1408# that MANUFACTURER isn't an operating system. Otherwise, code above
1409# will signal an error saying that MANUFACTURER isn't an operating
1410# system, and we'll never get to this point.
1411
1412case $basic_machine in
1413 score-*)
1414 os=-elf
1415 ;;
1416 spu-*)
1417 os=-elf
1418 ;;
1419 *-acorn)
1420 os=-riscix1.2
1421 ;;
1422 arm*-rebel)
1423 os=-linux
1424 ;;
1425 arm*-semi)
1426 os=-aout
1427 ;;
1428 c4x-* | tic4x-*)
1429 os=-coff
1430 ;;
1431 # This must come before the *-dec entry.
1432 pdp10-*)
1433 os=-tops20
1434 ;;
1435 pdp11-*)
1436 os=-none
1437 ;;
1438 *-dec | vax-*)
1439 os=-ultrix4.2
1440 ;;
1441 m68*-apollo)
1442 os=-domain
1443 ;;
1444 i386-sun)
1445 os=-sunos4.0.2
1446 ;;
1447 m68000-sun)
1448 os=-sunos3
1449 # This also exists in the configure program, but was not the
1450 # default.
1451 # os=-sunos4
1452 ;;
1453 m68*-cisco)
1454 os=-aout
1455 ;;
1456 mep-*)
1457 os=-elf
1458 ;;
1459 mips*-cisco)
1460 os=-elf
1461 ;;
1462 mips*-*)
1463 os=-elf
1464 ;;
1465 or32-*)
1466 os=-coff
1467 ;;
1468 *-tti) # must be before sparc entry or we get the wrong os.
1469 os=-sysv3
1470 ;;
1471 sparc-* | *-sun)
1472 os=-sunos4.1.1
1473 ;;
1474 *-be)
1475 os=-beos
1476 ;;
1477 *-haiku)
1478 os=-haiku
1479 ;;
1480 *-ibm)
1481 os=-aix
1482 ;;
1483 *-knuth)
1484 os=-mmixware
1485 ;;
1486 *-wec)
1487 os=-proelf
1488 ;;
1489 *-winbond)
1490 os=-proelf
1491 ;;
1492 *-oki)
1493 os=-proelf
1494 ;;
1495 *-hp)
1496 os=-hpux
1497 ;;
1498 *-hitachi)
1499 os=-hiux
1500 ;;
1501 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1502 os=-sysv
1503 ;;
1504 *-cbm)
1505 os=-amigaos
1506 ;;
1507 *-dg)
1508 os=-dgux
1509 ;;
1510 *-dolphin)
1511 os=-sysv3
1512 ;;
1513 m68k-ccur)
1514 os=-rtu
1515 ;;
1516 m88k-omron*)
1517 os=-luna
1518 ;;
1519 *-next )
1520 os=-nextstep
1521 ;;
1522 *-sequent)
1523 os=-ptx
1524 ;;
1525 *-crds)
1526 os=-unos
1527 ;;
1528 *-ns)
1529 os=-genix
1530 ;;
1531 i370-*)
1532 os=-mvs
1533 ;;
1534 *-next)
1535 os=-nextstep3
1536 ;;
1537 *-gould)
1538 os=-sysv
1539 ;;
1540 *-highlevel)
1541 os=-bsd
1542 ;;
1543 *-encore)
1544 os=-bsd
1545 ;;
1546 *-sgi)
1547 os=-irix
1548 ;;
1549 *-siemens)
1550 os=-sysv4
1551 ;;
1552 *-masscomp)
1553 os=-rtu
1554 ;;
1555 f30[01]-fujitsu | f700-fujitsu)
1556 os=-uxpv
1557 ;;
1558 *-rom68k)
1559 os=-coff
1560 ;;
1561 *-*bug)
1562 os=-coff
1563 ;;
1564 *-apple)
1565 os=-macos
1566 ;;
1567 *-atari*)
1568 os=-mint
1569 ;;
1570 *)
1571 os=-none
1572 ;;
1573esac
1574fi
1575
1576# Here we handle the case where we know the os, and the CPU type, but not the
1577# manufacturer. We pick the logical manufacturer.
1578vendor=unknown
1579case $basic_machine in
1580 *-unknown)
1581 case $os in
1582 -riscix*)
1583 vendor=acorn
1584 ;;
1585 -sunos*)
1586 vendor=sun
1587 ;;
1588 -aix*)
1589 vendor=ibm
1590 ;;
1591 -beos*)
1592 vendor=be
1593 ;;
1594 -hpux*)
1595 vendor=hp
1596 ;;
1597 -mpeix*)
1598 vendor=hp
1599 ;;
1600 -hiux*)
1601 vendor=hitachi
1602 ;;
1603 -unos*)
1604 vendor=crds
1605 ;;
1606 -dgux*)
1607 vendor=dg
1608 ;;
1609 -luna*)
1610 vendor=omron
1611 ;;
1612 -genix*)
1613 vendor=ns
1614 ;;
1615 -mvs* | -opened*)
1616 vendor=ibm
1617 ;;
1618 -os400*)
1619 vendor=ibm
1620 ;;
1621 -ptx*)
1622 vendor=sequent
1623 ;;
1624 -tpf*)
1625 vendor=ibm
1626 ;;
1627 -vxsim* | -vxworks* | -windiss*)
1628 vendor=wrs
1629 ;;
1630 -aux*)
1631 vendor=apple
1632 ;;
1633 -hms*)
1634 vendor=hitachi
1635 ;;
1636 -mpw* | -macos*)
1637 vendor=apple
1638 ;;
1639 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1640 vendor=atari
1641 ;;
1642 -vos*)
1643 vendor=stratus
1644 ;;
1645 esac
1646 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1647 ;;
1648esac
1649
1650echo $basic_machine$os
1651exit
1652
1653# Local variables:
1654# eval: (add-hook 'write-file-hooks 'time-stamp)
1655# time-stamp-start: "timestamp='"
1656# time-stamp-format: "%:y-%02m-%02d"
1657# time-stamp-end: "'"
1658# End:
diff --git a/src/others/mimesh/libg3d-0.0.8/config/depcomp b/src/others/mimesh/libg3d-0.0.8/config/depcomp
new file mode 100755
index 0000000..e5f9736
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/config/depcomp
@@ -0,0 +1,589 @@
1#! /bin/sh
2# depcomp - compile a program generating dependencies as side-effects
3
4scriptversion=2007-03-29.01
5
6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
7# Foundation, Inc.
8
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2, or (at your option)
12# any later version.
13
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22# 02110-1301, USA.
23
24# As a special exception to the GNU General Public License, if you
25# distribute this file as part of a program that contains a
26# configuration script generated by Autoconf, you may include it under
27# the same distribution terms that you use for the rest of that program.
28
29# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
30
31case $1 in
32 '')
33 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
34 exit 1;
35 ;;
36 -h | --h*)
37 cat <<\EOF
38Usage: depcomp [--help] [--version] PROGRAM [ARGS]
39
40Run PROGRAMS ARGS to compile a file, generating dependencies
41as side-effects.
42
43Environment variables:
44 depmode Dependency tracking mode.
45 source Source file read by `PROGRAMS ARGS'.
46 object Object file output by `PROGRAMS ARGS'.
47 DEPDIR directory where to store dependencies.
48 depfile Dependency file to output.
49 tmpdepfile Temporary file to use when outputing dependencies.
50 libtool Whether libtool is used (yes/no).
51
52Report bugs to <bug-automake@gnu.org>.
53EOF
54 exit $?
55 ;;
56 -v | --v*)
57 echo "depcomp $scriptversion"
58 exit $?
59 ;;
60esac
61
62if test -z "$depmode" || test -z "$source" || test -z "$object"; then
63 echo "depcomp: Variables source, object and depmode must be set" 1>&2
64 exit 1
65fi
66
67# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
68depfile=${depfile-`echo "$object" |
69 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
70tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
71
72rm -f "$tmpdepfile"
73
74# Some modes work just like other modes, but use different flags. We
75# parameterize here, but still list the modes in the big case below,
76# to make depend.m4 easier to write. Note that we *cannot* use a case
77# here, because this file can only contain one case statement.
78if test "$depmode" = hp; then
79 # HP compiler uses -M and no extra arg.
80 gccflag=-M
81 depmode=gcc
82fi
83
84if test "$depmode" = dashXmstdout; then
85 # This is just like dashmstdout with a different argument.
86 dashmflag=-xM
87 depmode=dashmstdout
88fi
89
90case "$depmode" in
91gcc3)
92## gcc 3 implements dependency tracking that does exactly what
93## we want. Yay! Note: for some reason libtool 1.4 doesn't like
94## it if -MD -MP comes after the -MF stuff. Hmm.
95## Unfortunately, FreeBSD c89 acceptance of flags depends upon
96## the command line argument order; so add the flags where they
97## appear in depend2.am. Note that the slowdown incurred here
98## affects only configure: in makefiles, %FASTDEP% shortcuts this.
99 for arg
100 do
101 case $arg in
102 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
103 *) set fnord "$@" "$arg" ;;
104 esac
105 shift # fnord
106 shift # $arg
107 done
108 "$@"
109 stat=$?
110 if test $stat -eq 0; then :
111 else
112 rm -f "$tmpdepfile"
113 exit $stat
114 fi
115 mv "$tmpdepfile" "$depfile"
116 ;;
117
118gcc)
119## There are various ways to get dependency output from gcc. Here's
120## why we pick this rather obscure method:
121## - Don't want to use -MD because we'd like the dependencies to end
122## up in a subdir. Having to rename by hand is ugly.
123## (We might end up doing this anyway to support other compilers.)
124## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
125## -MM, not -M (despite what the docs say).
126## - Using -M directly means running the compiler twice (even worse
127## than renaming).
128 if test -z "$gccflag"; then
129 gccflag=-MD,
130 fi
131 "$@" -Wp,"$gccflag$tmpdepfile"
132 stat=$?
133 if test $stat -eq 0; then :
134 else
135 rm -f "$tmpdepfile"
136 exit $stat
137 fi
138 rm -f "$depfile"
139 echo "$object : \\" > "$depfile"
140 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
141## The second -e expression handles DOS-style file names with drive letters.
142 sed -e 's/^[^:]*: / /' \
143 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
144## This next piece of magic avoids the `deleted header file' problem.
145## The problem is that when a header file which appears in a .P file
146## is deleted, the dependency causes make to die (because there is
147## typically no way to rebuild the header). We avoid this by adding
148## dummy dependencies for each header file. Too bad gcc doesn't do
149## this for us directly.
150 tr ' ' '
151' < "$tmpdepfile" |
152## Some versions of gcc put a space before the `:'. On the theory
153## that the space means something, we add a space to the output as
154## well.
155## Some versions of the HPUX 10.20 sed can't process this invocation
156## correctly. Breaking it into two sed invocations is a workaround.
157 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
158 rm -f "$tmpdepfile"
159 ;;
160
161hp)
162 # This case exists only to let depend.m4 do its work. It works by
163 # looking at the text of this script. This case will never be run,
164 # since it is checked for above.
165 exit 1
166 ;;
167
168sgi)
169 if test "$libtool" = yes; then
170 "$@" "-Wp,-MDupdate,$tmpdepfile"
171 else
172 "$@" -MDupdate "$tmpdepfile"
173 fi
174 stat=$?
175 if test $stat -eq 0; then :
176 else
177 rm -f "$tmpdepfile"
178 exit $stat
179 fi
180 rm -f "$depfile"
181
182 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
183 echo "$object : \\" > "$depfile"
184
185 # Clip off the initial element (the dependent). Don't try to be
186 # clever and replace this with sed code, as IRIX sed won't handle
187 # lines with more than a fixed number of characters (4096 in
188 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
189 # the IRIX cc adds comments like `#:fec' to the end of the
190 # dependency line.
191 tr ' ' '
192' < "$tmpdepfile" \
193 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
194 tr '
195' ' ' >> $depfile
196 echo >> $depfile
197
198 # The second pass generates a dummy entry for each header file.
199 tr ' ' '
200' < "$tmpdepfile" \
201 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
202 >> $depfile
203 else
204 # The sourcefile does not contain any dependencies, so just
205 # store a dummy comment line, to avoid errors with the Makefile
206 # "include basename.Plo" scheme.
207 echo "#dummy" > "$depfile"
208 fi
209 rm -f "$tmpdepfile"
210 ;;
211
212aix)
213 # The C for AIX Compiler uses -M and outputs the dependencies
214 # in a .u file. In older versions, this file always lives in the
215 # current directory. Also, the AIX compiler puts `$object:' at the
216 # start of each line; $object doesn't have directory information.
217 # Version 6 uses the directory in both cases.
218 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
219 test "x$dir" = "x$object" && dir=
220 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
221 if test "$libtool" = yes; then
222 tmpdepfile1=$dir$base.u
223 tmpdepfile2=$base.u
224 tmpdepfile3=$dir.libs/$base.u
225 "$@" -Wc,-M
226 else
227 tmpdepfile1=$dir$base.u
228 tmpdepfile2=$dir$base.u
229 tmpdepfile3=$dir$base.u
230 "$@" -M
231 fi
232 stat=$?
233
234 if test $stat -eq 0; then :
235 else
236 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
237 exit $stat
238 fi
239
240 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
241 do
242 test -f "$tmpdepfile" && break
243 done
244 if test -f "$tmpdepfile"; then
245 # Each line is of the form `foo.o: dependent.h'.
246 # Do two passes, one to just change these to
247 # `$object: dependent.h' and one to simply `dependent.h:'.
248 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
249 # That's a tab and a space in the [].
250 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
251 else
252 # The sourcefile does not contain any dependencies, so just
253 # store a dummy comment line, to avoid errors with the Makefile
254 # "include basename.Plo" scheme.
255 echo "#dummy" > "$depfile"
256 fi
257 rm -f "$tmpdepfile"
258 ;;
259
260icc)
261 # Intel's C compiler understands `-MD -MF file'. However on
262 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
263 # ICC 7.0 will fill foo.d with something like
264 # foo.o: sub/foo.c
265 # foo.o: sub/foo.h
266 # which is wrong. We want:
267 # sub/foo.o: sub/foo.c
268 # sub/foo.o: sub/foo.h
269 # sub/foo.c:
270 # sub/foo.h:
271 # ICC 7.1 will output
272 # foo.o: sub/foo.c sub/foo.h
273 # and will wrap long lines using \ :
274 # foo.o: sub/foo.c ... \
275 # sub/foo.h ... \
276 # ...
277
278 "$@" -MD -MF "$tmpdepfile"
279 stat=$?
280 if test $stat -eq 0; then :
281 else
282 rm -f "$tmpdepfile"
283 exit $stat
284 fi
285 rm -f "$depfile"
286 # Each line is of the form `foo.o: dependent.h',
287 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
288 # Do two passes, one to just change these to
289 # `$object: dependent.h' and one to simply `dependent.h:'.
290 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
291 # Some versions of the HPUX 10.20 sed can't process this invocation
292 # correctly. Breaking it into two sed invocations is a workaround.
293 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
294 sed -e 's/$/ :/' >> "$depfile"
295 rm -f "$tmpdepfile"
296 ;;
297
298hp2)
299 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
300 # compilers, which have integrated preprocessors. The correct option
301 # to use with these is +Maked; it writes dependencies to a file named
302 # 'foo.d', which lands next to the object file, wherever that
303 # happens to be.
304 # Much of this is similar to the tru64 case; see comments there.
305 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
306 test "x$dir" = "x$object" && dir=
307 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
308 if test "$libtool" = yes; then
309 tmpdepfile1=$dir$base.d
310 tmpdepfile2=$dir.libs/$base.d
311 "$@" -Wc,+Maked
312 else
313 tmpdepfile1=$dir$base.d
314 tmpdepfile2=$dir$base.d
315 "$@" +Maked
316 fi
317 stat=$?
318 if test $stat -eq 0; then :
319 else
320 rm -f "$tmpdepfile1" "$tmpdepfile2"
321 exit $stat
322 fi
323
324 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
325 do
326 test -f "$tmpdepfile" && break
327 done
328 if test -f "$tmpdepfile"; then
329 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
330 # Add `dependent.h:' lines.
331 sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
332 else
333 echo "#dummy" > "$depfile"
334 fi
335 rm -f "$tmpdepfile" "$tmpdepfile2"
336 ;;
337
338tru64)
339 # The Tru64 compiler uses -MD to generate dependencies as a side
340 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
341 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
342 # dependencies in `foo.d' instead, so we check for that too.
343 # Subdirectories are respected.
344 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
345 test "x$dir" = "x$object" && dir=
346 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
347
348 if test "$libtool" = yes; then
349 # With Tru64 cc, shared objects can also be used to make a
350 # static library. This mechanism is used in libtool 1.4 series to
351 # handle both shared and static libraries in a single compilation.
352 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
353 #
354 # With libtool 1.5 this exception was removed, and libtool now
355 # generates 2 separate objects for the 2 libraries. These two
356 # compilations output dependencies in $dir.libs/$base.o.d and
357 # in $dir$base.o.d. We have to check for both files, because
358 # one of the two compilations can be disabled. We should prefer
359 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
360 # automatically cleaned when .libs/ is deleted, while ignoring
361 # the former would cause a distcleancheck panic.
362 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
363 tmpdepfile2=$dir$base.o.d # libtool 1.5
364 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
365 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
366 "$@" -Wc,-MD
367 else
368 tmpdepfile1=$dir$base.o.d
369 tmpdepfile2=$dir$base.d
370 tmpdepfile3=$dir$base.d
371 tmpdepfile4=$dir$base.d
372 "$@" -MD
373 fi
374
375 stat=$?
376 if test $stat -eq 0; then :
377 else
378 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
379 exit $stat
380 fi
381
382 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
383 do
384 test -f "$tmpdepfile" && break
385 done
386 if test -f "$tmpdepfile"; then
387 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
388 # That's a tab and a space in the [].
389 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
390 else
391 echo "#dummy" > "$depfile"
392 fi
393 rm -f "$tmpdepfile"
394 ;;
395
396#nosideeffect)
397 # This comment above is used by automake to tell side-effect
398 # dependency tracking mechanisms from slower ones.
399
400dashmstdout)
401 # Important note: in order to support this mode, a compiler *must*
402 # always write the preprocessed file to stdout, regardless of -o.
403 "$@" || exit $?
404
405 # Remove the call to Libtool.
406 if test "$libtool" = yes; then
407 while test $1 != '--mode=compile'; do
408 shift
409 done
410 shift
411 fi
412
413 # Remove `-o $object'.
414 IFS=" "
415 for arg
416 do
417 case $arg in
418 -o)
419 shift
420 ;;
421 $object)
422 shift
423 ;;
424 *)
425 set fnord "$@" "$arg"
426 shift # fnord
427 shift # $arg
428 ;;
429 esac
430 done
431
432 test -z "$dashmflag" && dashmflag=-M
433 # Require at least two characters before searching for `:'
434 # in the target name. This is to cope with DOS-style filenames:
435 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
436 "$@" $dashmflag |
437 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
438 rm -f "$depfile"
439 cat < "$tmpdepfile" > "$depfile"
440 tr ' ' '
441' < "$tmpdepfile" | \
442## Some versions of the HPUX 10.20 sed can't process this invocation
443## correctly. Breaking it into two sed invocations is a workaround.
444 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
445 rm -f "$tmpdepfile"
446 ;;
447
448dashXmstdout)
449 # This case only exists to satisfy depend.m4. It is never actually
450 # run, as this mode is specially recognized in the preamble.
451 exit 1
452 ;;
453
454makedepend)
455 "$@" || exit $?
456 # Remove any Libtool call
457 if test "$libtool" = yes; then
458 while test $1 != '--mode=compile'; do
459 shift
460 done
461 shift
462 fi
463 # X makedepend
464 shift
465 cleared=no
466 for arg in "$@"; do
467 case $cleared in
468 no)
469 set ""; shift
470 cleared=yes ;;
471 esac
472 case "$arg" in
473 -D*|-I*)
474 set fnord "$@" "$arg"; shift ;;
475 # Strip any option that makedepend may not understand. Remove
476 # the object too, otherwise makedepend will parse it as a source file.
477 -*|$object)
478 ;;
479 *)
480 set fnord "$@" "$arg"; shift ;;
481 esac
482 done
483 obj_suffix="`echo $object | sed 's/^.*\././'`"
484 touch "$tmpdepfile"
485 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
486 rm -f "$depfile"
487 cat < "$tmpdepfile" > "$depfile"
488 sed '1,2d' "$tmpdepfile" | tr ' ' '
489' | \
490## Some versions of the HPUX 10.20 sed can't process this invocation
491## correctly. Breaking it into two sed invocations is a workaround.
492 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
493 rm -f "$tmpdepfile" "$tmpdepfile".bak
494 ;;
495
496cpp)
497 # Important note: in order to support this mode, a compiler *must*
498 # always write the preprocessed file to stdout.
499 "$@" || exit $?
500
501 # Remove the call to Libtool.
502 if test "$libtool" = yes; then
503 while test $1 != '--mode=compile'; do
504 shift
505 done
506 shift
507 fi
508
509 # Remove `-o $object'.
510 IFS=" "
511 for arg
512 do
513 case $arg in
514 -o)
515 shift
516 ;;
517 $object)
518 shift
519 ;;
520 *)
521 set fnord "$@" "$arg"
522 shift # fnord
523 shift # $arg
524 ;;
525 esac
526 done
527
528 "$@" -E |
529 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
530 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
531 sed '$ s: \\$::' > "$tmpdepfile"
532 rm -f "$depfile"
533 echo "$object : \\" > "$depfile"
534 cat < "$tmpdepfile" >> "$depfile"
535 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
536 rm -f "$tmpdepfile"
537 ;;
538
539msvisualcpp)
540 # Important note: in order to support this mode, a compiler *must*
541 # always write the preprocessed file to stdout, regardless of -o,
542 # because we must use -o when running libtool.
543 "$@" || exit $?
544 IFS=" "
545 for arg
546 do
547 case "$arg" in
548 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
549 set fnord "$@"
550 shift
551 shift
552 ;;
553 *)
554 set fnord "$@" "$arg"
555 shift
556 shift
557 ;;
558 esac
559 done
560 "$@" -E |
561 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
562 rm -f "$depfile"
563 echo "$object : \\" > "$depfile"
564 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
565 echo " " >> "$depfile"
566 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
567 rm -f "$tmpdepfile"
568 ;;
569
570none)
571 exec "$@"
572 ;;
573
574*)
575 echo "Unknown depmode $depmode" 1>&2
576 exit 1
577 ;;
578esac
579
580exit 0
581
582# Local Variables:
583# mode: shell-script
584# sh-indentation: 2
585# eval: (add-hook 'write-file-hooks 'time-stamp)
586# time-stamp-start: "scriptversion="
587# time-stamp-format: "%:y-%02m-%02d.%02H"
588# time-stamp-end: "$"
589# End:
diff --git a/src/others/mimesh/libg3d-0.0.8/config/install-sh b/src/others/mimesh/libg3d-0.0.8/config/install-sh
new file mode 100755
index 0000000..a5897de
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/config/install-sh
@@ -0,0 +1,519 @@
1#!/bin/sh
2# install - install a program, script, or datafile
3
4scriptversion=2006-12-25.00
5
6# This originates from X11R5 (mit/util/scripts/install.sh), which was
7# later released in X11R6 (xc/config/util/install.sh) with the
8# following copyright and license.
9#
10# Copyright (C) 1994 X Consortium
11#
12# Permission is hereby granted, free of charge, to any person obtaining a copy
13# of this software and associated documentation files (the "Software"), to
14# deal in the Software without restriction, including without limitation the
15# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16# sell copies of the Software, and to permit persons to whom the Software is
17# furnished to do so, subject to the following conditions:
18#
19# The above copyright notice and this permission notice shall be included in
20# all copies or substantial portions of the Software.
21#
22# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
27# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28#
29# Except as contained in this notice, the name of the X Consortium shall not
30# be used in advertising or otherwise to promote the sale, use or other deal-
31# ings in this Software without prior written authorization from the X Consor-
32# tium.
33#
34#
35# FSF changes to this file are in the public domain.
36#
37# Calling this script install-sh is preferred over install.sh, to prevent
38# `make' implicit rules from creating a file called install from it
39# when there is no Makefile.
40#
41# This script is compatible with the BSD install script, but was written
42# from scratch.
43
44nl='
45'
46IFS=" "" $nl"
47
48# set DOITPROG to echo to test this script
49
50# Don't use :- since 4.3BSD and earlier shells don't like it.
51doit=${DOITPROG-}
52if test -z "$doit"; then
53 doit_exec=exec
54else
55 doit_exec=$doit
56fi
57
58# Put in absolute file names if you don't have them in your path;
59# or use environment vars.
60
61chgrpprog=${CHGRPPROG-chgrp}
62chmodprog=${CHMODPROG-chmod}
63chownprog=${CHOWNPROG-chown}
64cmpprog=${CMPPROG-cmp}
65cpprog=${CPPROG-cp}
66mkdirprog=${MKDIRPROG-mkdir}
67mvprog=${MVPROG-mv}
68rmprog=${RMPROG-rm}
69stripprog=${STRIPPROG-strip}
70
71posix_glob='?'
72initialize_posix_glob='
73 test "$posix_glob" != "?" || {
74 if (set -f) 2>/dev/null; then
75 posix_glob=
76 else
77 posix_glob=:
78 fi
79 }
80'
81
82posix_mkdir=
83
84# Desired mode of installed file.
85mode=0755
86
87chgrpcmd=
88chmodcmd=$chmodprog
89chowncmd=
90mvcmd=$mvprog
91rmcmd="$rmprog -f"
92stripcmd=
93
94src=
95dst=
96dir_arg=
97dst_arg=
98
99copy_on_change=false
100no_target_directory=
101
102usage="\
103Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
104 or: $0 [OPTION]... SRCFILES... DIRECTORY
105 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
106 or: $0 [OPTION]... -d DIRECTORIES...
107
108In the 1st form, copy SRCFILE to DSTFILE.
109In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
110In the 4th, create DIRECTORIES.
111
112Options:
113 --help display this help and exit.
114 --version display version info and exit.
115
116 -c (ignored)
117 -C install only if different (preserve the last data modification time)
118 -d create directories instead of installing files.
119 -g GROUP $chgrpprog installed files to GROUP.
120 -m MODE $chmodprog installed files to MODE.
121 -o USER $chownprog installed files to USER.
122 -s $stripprog installed files.
123 -t DIRECTORY install into DIRECTORY.
124 -T report an error if DSTFILE is a directory.
125
126Environment variables override the default commands:
127 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
128 RMPROG STRIPPROG
129"
130
131while test $# -ne 0; do
132 case $1 in
133 -c) ;;
134
135 -C) copy_on_change=true;;
136
137 -d) dir_arg=true;;
138
139 -g) chgrpcmd="$chgrpprog $2"
140 shift;;
141
142 --help) echo "$usage"; exit $?;;
143
144 -m) mode=$2
145 case $mode in
146 *' '* | *' '* | *'
147'* | *'*'* | *'?'* | *'['*)
148 echo "$0: invalid mode: $mode" >&2
149 exit 1;;
150 esac
151 shift;;
152
153 -o) chowncmd="$chownprog $2"
154 shift;;
155
156 -s) stripcmd=$stripprog;;
157
158 -t) dst_arg=$2
159 shift;;
160
161 -T) no_target_directory=true;;
162
163 --version) echo "$0 $scriptversion"; exit $?;;
164
165 --) shift
166 break;;
167
168 -*) echo "$0: invalid option: $1" >&2
169 exit 1;;
170
171 *) break;;
172 esac
173 shift
174done
175
176if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
177 # When -d is used, all remaining arguments are directories to create.
178 # When -t is used, the destination is already specified.
179 # Otherwise, the last argument is the destination. Remove it from $@.
180 for arg
181 do
182 if test -n "$dst_arg"; then
183 # $@ is not empty: it contains at least $arg.
184 set fnord "$@" "$dst_arg"
185 shift # fnord
186 fi
187 shift # arg
188 dst_arg=$arg
189 done
190fi
191
192if test $# -eq 0; then
193 if test -z "$dir_arg"; then
194 echo "$0: no input file specified." >&2
195 exit 1
196 fi
197 # It's OK to call `install-sh -d' without argument.
198 # This can happen when creating conditional directories.
199 exit 0
200fi
201
202if test -z "$dir_arg"; then
203 trap '(exit $?); exit' 1 2 13 15
204
205 # Set umask so as not to create temps with too-generous modes.
206 # However, 'strip' requires both read and write access to temps.
207 case $mode in
208 # Optimize common cases.
209 *644) cp_umask=133;;
210 *755) cp_umask=22;;
211
212 *[0-7])
213 if test -z "$stripcmd"; then
214 u_plus_rw=
215 else
216 u_plus_rw='% 200'
217 fi
218 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
219 *)
220 if test -z "$stripcmd"; then
221 u_plus_rw=
222 else
223 u_plus_rw=,u+rw
224 fi
225 cp_umask=$mode$u_plus_rw;;
226 esac
227fi
228
229for src
230do
231 # Protect names starting with `-'.
232 case $src in
233 -*) src=./$src;;
234 esac
235
236 if test -n "$dir_arg"; then
237 dst=$src
238 dstdir=$dst
239 test -d "$dstdir"
240 dstdir_status=$?
241 else
242
243 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
244 # might cause directories to be created, which would be especially bad
245 # if $src (and thus $dsttmp) contains '*'.
246 if test ! -f "$src" && test ! -d "$src"; then
247 echo "$0: $src does not exist." >&2
248 exit 1
249 fi
250
251 if test -z "$dst_arg"; then
252 echo "$0: no destination specified." >&2
253 exit 1
254 fi
255
256 dst=$dst_arg
257 # Protect names starting with `-'.
258 case $dst in
259 -*) dst=./$dst;;
260 esac
261
262 # If destination is a directory, append the input filename; won't work
263 # if double slashes aren't ignored.
264 if test -d "$dst"; then
265 if test -n "$no_target_directory"; then
266 echo "$0: $dst_arg: Is a directory" >&2
267 exit 1
268 fi
269 dstdir=$dst
270 dst=$dstdir/`basename "$src"`
271 dstdir_status=0
272 else
273 # Prefer dirname, but fall back on a substitute if dirname fails.
274 dstdir=`
275 (dirname "$dst") 2>/dev/null ||
276 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
277 X"$dst" : 'X\(//\)[^/]' \| \
278 X"$dst" : 'X\(//\)$' \| \
279 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
280 echo X"$dst" |
281 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
282 s//\1/
283 q
284 }
285 /^X\(\/\/\)[^/].*/{
286 s//\1/
287 q
288 }
289 /^X\(\/\/\)$/{
290 s//\1/
291 q
292 }
293 /^X\(\/\).*/{
294 s//\1/
295 q
296 }
297 s/.*/./; q'
298 `
299
300 test -d "$dstdir"
301 dstdir_status=$?
302 fi
303 fi
304
305 obsolete_mkdir_used=false
306
307 if test $dstdir_status != 0; then
308 case $posix_mkdir in
309 '')
310 # Create intermediate dirs using mode 755 as modified by the umask.
311 # This is like FreeBSD 'install' as of 1997-10-28.
312 umask=`umask`
313 case $stripcmd.$umask in
314 # Optimize common cases.
315 *[2367][2367]) mkdir_umask=$umask;;
316 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
317
318 *[0-7])
319 mkdir_umask=`expr $umask + 22 \
320 - $umask % 100 % 40 + $umask % 20 \
321 - $umask % 10 % 4 + $umask % 2
322 `;;
323 *) mkdir_umask=$umask,go-w;;
324 esac
325
326 # With -d, create the new directory with the user-specified mode.
327 # Otherwise, rely on $mkdir_umask.
328 if test -n "$dir_arg"; then
329 mkdir_mode=-m$mode
330 else
331 mkdir_mode=
332 fi
333
334 posix_mkdir=false
335 case $umask in
336 *[123567][0-7][0-7])
337 # POSIX mkdir -p sets u+wx bits regardless of umask, which
338 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
339 ;;
340 *)
341 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
342 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
343
344 if (umask $mkdir_umask &&
345 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
346 then
347 if test -z "$dir_arg" || {
348 # Check for POSIX incompatibilities with -m.
349 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
350 # other-writeable bit of parent directory when it shouldn't.
351 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
352 ls_ld_tmpdir=`ls -ld "$tmpdir"`
353 case $ls_ld_tmpdir in
354 d????-?r-*) different_mode=700;;
355 d????-?--*) different_mode=755;;
356 *) false;;
357 esac &&
358 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
359 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
360 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
361 }
362 }
363 then posix_mkdir=:
364 fi
365 rmdir "$tmpdir/d" "$tmpdir"
366 else
367 # Remove any dirs left behind by ancient mkdir implementations.
368 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
369 fi
370 trap '' 0;;
371 esac;;
372 esac
373
374 if
375 $posix_mkdir && (
376 umask $mkdir_umask &&
377 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
378 )
379 then :
380 else
381
382 # The umask is ridiculous, or mkdir does not conform to POSIX,
383 # or it failed possibly due to a race condition. Create the
384 # directory the slow way, step by step, checking for races as we go.
385
386 case $dstdir in
387 /*) prefix='/';;
388 -*) prefix='./';;
389 *) prefix='';;
390 esac
391
392 eval "$initialize_posix_glob"
393
394 oIFS=$IFS
395 IFS=/
396 $posix_glob set -f
397 set fnord $dstdir
398 shift
399 $posix_glob set +f
400 IFS=$oIFS
401
402 prefixes=
403
404 for d
405 do
406 test -z "$d" && continue
407
408 prefix=$prefix$d
409 if test -d "$prefix"; then
410 prefixes=
411 else
412 if $posix_mkdir; then
413 (umask=$mkdir_umask &&
414 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415 # Don't fail if two instances are running concurrently.
416 test -d "$prefix" || exit 1
417 else
418 case $prefix in
419 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
420 *) qprefix=$prefix;;
421 esac
422 prefixes="$prefixes '$qprefix'"
423 fi
424 fi
425 prefix=$prefix/
426 done
427
428 if test -n "$prefixes"; then
429 # Don't fail if two instances are running concurrently.
430 (umask $mkdir_umask &&
431 eval "\$doit_exec \$mkdirprog $prefixes") ||
432 test -d "$dstdir" || exit 1
433 obsolete_mkdir_used=true
434 fi
435 fi
436 fi
437
438 if test -n "$dir_arg"; then
439 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
440 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
441 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
442 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
443 else
444
445 # Make a couple of temp file names in the proper directory.
446 dsttmp=$dstdir/_inst.$$_
447 rmtmp=$dstdir/_rm.$$_
448
449 # Trap to clean up those temp files at exit.
450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
451
452 # Copy the file name to the temp name.
453 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
454
455 # and set any options; do chmod last to preserve setuid bits.
456 #
457 # If any of these fail, we abort the whole thing. If we want to
458 # ignore errors from any of these, just make sure not to ignore
459 # errors from the above "$doit $cpprog $src $dsttmp" command.
460 #
461 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
462 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
463 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
464 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
465
466 # If -C, don't bother to copy if it wouldn't change the file.
467 if $copy_on_change &&
468 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
469 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
470
471 eval "$initialize_posix_glob" &&
472 $posix_glob set -f &&
473 set X $old && old=:$2:$4:$5:$6 &&
474 set X $new && new=:$2:$4:$5:$6 &&
475 $posix_glob set +f &&
476
477 test "$old" = "$new" &&
478 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
479 then
480 rm -f "$dsttmp"
481 else
482 # Rename the file to the real destination.
483 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
484
485 # The rename failed, perhaps because mv can't rename something else
486 # to itself, or perhaps because mv is so ancient that it does not
487 # support -f.
488 {
489 # Now remove or move aside any old file at destination location.
490 # We try this two ways since rm can't unlink itself on some
491 # systems and the destination file might be busy for other
492 # reasons. In this case, the final cleanup might fail but the new
493 # file should still install successfully.
494 {
495 test ! -f "$dst" ||
496 $doit $rmcmd -f "$dst" 2>/dev/null ||
497 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
498 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
499 } ||
500 { echo "$0: cannot unlink or rename $dst" >&2
501 (exit 1); exit 1
502 }
503 } &&
504
505 # Now rename the file to the real destination.
506 $doit $mvcmd "$dsttmp" "$dst"
507 }
508 fi || exit 1
509
510 trap '' 0
511 fi
512done
513
514# Local variables:
515# eval: (add-hook 'write-file-hooks 'time-stamp)
516# time-stamp-start: "scriptversion="
517# time-stamp-format: "%:y-%02m-%02d.%02H"
518# time-stamp-end: "$"
519# End:
diff --git a/src/others/mimesh/libg3d-0.0.8/config/ltmain.sh b/src/others/mimesh/libg3d-0.0.8/config/ltmain.sh
new file mode 100644
index 0000000..0bf3848
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/config/ltmain.sh
@@ -0,0 +1,6964 @@
1# ltmain.sh - Provide generalized library-building support services.
2# NOTE: Changing this file will not affect anything until you rerun configure.
3#
4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5# 2007, 2008 Free Software Foundation, Inc.
6# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21#
22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program.
26
27basename="s,^.*/,,g"
28
29# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30# is ksh but when the shell is invoked as "sh" and the current value of
31# the _XPG environment variable is not equal to 1 (one), the special
32# positional parameter $0, within a function call, is the name of the
33# function.
34progpath="$0"
35
36# The name of this program:
37progname=`echo "$progpath" | $SED $basename`
38modename="$progname"
39
40# Global variables:
41EXIT_SUCCESS=0
42EXIT_FAILURE=1
43
44PROGRAM=ltmain.sh
45PACKAGE=libtool
46VERSION="1.5.26 Debian 1.5.26-4"
47TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
48
49# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
50if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
51 emulate sh
52 NULLCMD=:
53 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
54 # is contrary to our usage. Disable this feature.
55 alias -g '${1+"$@"}'='"$@"'
56 setopt NO_GLOB_SUBST
57else
58 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
59fi
60BIN_SH=xpg4; export BIN_SH # for Tru64
61DUALCASE=1; export DUALCASE # for MKS sh
62
63# Check that we have a working $echo.
64if test "X$1" = X--no-reexec; then
65 # Discard the --no-reexec flag, and continue.
66 shift
67elif test "X$1" = X--fallback-echo; then
68 # Avoid inline document here, it may be left over
69 :
70elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
71 # Yippee, $echo works!
72 :
73else
74 # Restart under the correct shell, and then maybe $echo will work.
75 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
76fi
77
78if test "X$1" = X--fallback-echo; then
79 # used as fallback echo
80 shift
81 cat <<EOF
82$*
83EOF
84 exit $EXIT_SUCCESS
85fi
86
87default_mode=
88help="Try \`$progname --help' for more information."
89magic="%%%MAGIC variable%%%"
90mkdir="mkdir"
91mv="mv -f"
92rm="rm -f"
93
94# Sed substitution that helps us do robust quoting. It backslashifies
95# metacharacters that are still active within double-quoted strings.
96Xsed="${SED}"' -e 1s/^X//'
97sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
98# test EBCDIC or ASCII
99case `echo X|tr X '\101'` in
100 A) # ASCII based system
101 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
102 SP2NL='tr \040 \012'
103 NL2SP='tr \015\012 \040\040'
104 ;;
105 *) # EBCDIC based system
106 SP2NL='tr \100 \n'
107 NL2SP='tr \r\n \100\100'
108 ;;
109esac
110
111# NLS nuisances.
112# Only set LANG and LC_ALL to C if already set.
113# These must not be set unconditionally because not all systems understand
114# e.g. LANG=C (notably SCO).
115# We save the old values to restore during execute mode.
116lt_env=
117for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
118do
119 eval "if test \"\${$lt_var+set}\" = set; then
120 save_$lt_var=\$$lt_var
121 lt_env=\"$lt_var=\$$lt_var \$lt_env\"
122 $lt_var=C
123 export $lt_var
124 fi"
125done
126
127if test -n "$lt_env"; then
128 lt_env="env $lt_env"
129fi
130
131# Make sure IFS has a sensible default
132lt_nl='
133'
134IFS=" $lt_nl"
135
136if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
137 $echo "$modename: not configured to build any kind of library" 1>&2
138 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
139 exit $EXIT_FAILURE
140fi
141
142# Global variables.
143mode=$default_mode
144nonopt=
145prev=
146prevopt=
147run=
148show="$echo"
149show_help=
150execute_dlfiles=
151duplicate_deps=no
152preserve_args=
153lo2o="s/\\.lo\$/.${objext}/"
154o2lo="s/\\.${objext}\$/.lo/"
155extracted_archives=
156extracted_serial=0
157
158#####################################
159# Shell function definitions:
160# This seems to be the best place for them
161
162# func_mktempdir [string]
163# Make a temporary directory that won't clash with other running
164# libtool processes, and avoids race conditions if possible. If
165# given, STRING is the basename for that directory.
166func_mktempdir ()
167{
168 my_template="${TMPDIR-/tmp}/${1-$progname}"
169
170 if test "$run" = ":"; then
171 # Return a directory name, but don't create it in dry-run mode
172 my_tmpdir="${my_template}-$$"
173 else
174
175 # If mktemp works, use that first and foremost
176 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
177
178 if test ! -d "$my_tmpdir"; then
179 # Failing that, at least try and use $RANDOM to avoid a race
180 my_tmpdir="${my_template}-${RANDOM-0}$$"
181
182 save_mktempdir_umask=`umask`
183 umask 0077
184 $mkdir "$my_tmpdir"
185 umask $save_mktempdir_umask
186 fi
187
188 # If we're not in dry-run mode, bomb out on failure
189 test -d "$my_tmpdir" || {
190 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
191 exit $EXIT_FAILURE
192 }
193 fi
194
195 $echo "X$my_tmpdir" | $Xsed
196}
197
198
199# func_win32_libid arg
200# return the library type of file 'arg'
201#
202# Need a lot of goo to handle *both* DLLs and import libs
203# Has to be a shell function in order to 'eat' the argument
204# that is supplied when $file_magic_command is called.
205func_win32_libid ()
206{
207 win32_libid_type="unknown"
208 win32_fileres=`file -L $1 2>/dev/null`
209 case $win32_fileres in
210 *ar\ archive\ import\ library*) # definitely import
211 win32_libid_type="x86 archive import"
212 ;;
213 *ar\ archive*) # could be an import, or static
214 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
215 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
216 win32_nmres=`eval $NM -f posix -A $1 | \
217 $SED -n -e '1,100{
218 / I /{
219 s,.*,import,
220 p
221 q
222 }
223 }'`
224 case $win32_nmres in
225 import*) win32_libid_type="x86 archive import";;
226 *) win32_libid_type="x86 archive static";;
227 esac
228 fi
229 ;;
230 *DLL*)
231 win32_libid_type="x86 DLL"
232 ;;
233 *executable*) # but shell scripts are "executable" too...
234 case $win32_fileres in
235 *MS\ Windows\ PE\ Intel*)
236 win32_libid_type="x86 DLL"
237 ;;
238 esac
239 ;;
240 esac
241 $echo $win32_libid_type
242}
243
244
245# func_infer_tag arg
246# Infer tagged configuration to use if any are available and
247# if one wasn't chosen via the "--tag" command line option.
248# Only attempt this if the compiler in the base compile
249# command doesn't match the default compiler.
250# arg is usually of the form 'gcc ...'
251func_infer_tag ()
252{
253 if test -n "$available_tags" && test -z "$tagname"; then
254 CC_quoted=
255 for arg in $CC; do
256 case $arg in
257 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
258 arg="\"$arg\""
259 ;;
260 esac
261 CC_quoted="$CC_quoted $arg"
262 done
263 case $@ in
264 # Blanks in the command may have been stripped by the calling shell,
265 # but not from the CC environment variable when configure was run.
266 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
267 # Blanks at the start of $base_compile will cause this to fail
268 # if we don't check for them as well.
269 *)
270 for z in $available_tags; do
271 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
272 # Evaluate the configuration.
273 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
274 CC_quoted=
275 for arg in $CC; do
276 # Double-quote args containing other shell metacharacters.
277 case $arg in
278 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
279 arg="\"$arg\""
280 ;;
281 esac
282 CC_quoted="$CC_quoted $arg"
283 done
284 case "$@ " in
285 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
286 # The compiler in the base compile command matches
287 # the one in the tagged configuration.
288 # Assume this is the tagged configuration we want.
289 tagname=$z
290 break
291 ;;
292 esac
293 fi
294 done
295 # If $tagname still isn't set, then no tagged configuration
296 # was found and let the user know that the "--tag" command
297 # line option must be used.
298 if test -z "$tagname"; then
299 $echo "$modename: unable to infer tagged configuration"
300 $echo "$modename: specify a tag with \`--tag'" 1>&2
301 exit $EXIT_FAILURE
302# else
303# $echo "$modename: using $tagname tagged configuration"
304 fi
305 ;;
306 esac
307 fi
308}
309
310
311# func_extract_an_archive dir oldlib
312func_extract_an_archive ()
313{
314 f_ex_an_ar_dir="$1"; shift
315 f_ex_an_ar_oldlib="$1"
316
317 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
318 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
319 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
320 :
321 else
322 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
323 exit $EXIT_FAILURE
324 fi
325}
326
327# func_extract_archives gentop oldlib ...
328func_extract_archives ()
329{
330 my_gentop="$1"; shift
331 my_oldlibs=${1+"$@"}
332 my_oldobjs=""
333 my_xlib=""
334 my_xabs=""
335 my_xdir=""
336 my_status=""
337
338 $show "${rm}r $my_gentop"
339 $run ${rm}r "$my_gentop"
340 $show "$mkdir $my_gentop"
341 $run $mkdir "$my_gentop"
342 my_status=$?
343 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
344 exit $my_status
345 fi
346
347 for my_xlib in $my_oldlibs; do
348 # Extract the objects.
349 case $my_xlib in
350 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
351 *) my_xabs=`pwd`"/$my_xlib" ;;
352 esac
353 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
354 my_xlib_u=$my_xlib
355 while :; do
356 case " $extracted_archives " in
357 *" $my_xlib_u "*)
358 extracted_serial=`expr $extracted_serial + 1`
359 my_xlib_u=lt$extracted_serial-$my_xlib ;;
360 *) break ;;
361 esac
362 done
363 extracted_archives="$extracted_archives $my_xlib_u"
364 my_xdir="$my_gentop/$my_xlib_u"
365
366 $show "${rm}r $my_xdir"
367 $run ${rm}r "$my_xdir"
368 $show "$mkdir $my_xdir"
369 $run $mkdir "$my_xdir"
370 exit_status=$?
371 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
372 exit $exit_status
373 fi
374 case $host in
375 *-darwin*)
376 $show "Extracting $my_xabs"
377 # Do not bother doing anything if just a dry run
378 if test -z "$run"; then
379 darwin_orig_dir=`pwd`
380 cd $my_xdir || exit $?
381 darwin_archive=$my_xabs
382 darwin_curdir=`pwd`
383 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
384 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
385 if test -n "$darwin_arches"; then
386 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
387 darwin_arch=
388 $show "$darwin_base_archive has multiple architectures $darwin_arches"
389 for darwin_arch in $darwin_arches ; do
390 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
391 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
392 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
393 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
394 cd "$darwin_curdir"
395 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
396 done # $darwin_arches
397 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
398 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
399 darwin_file=
400 darwin_files=
401 for darwin_file in $darwin_filelist; do
402 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
403 lipo -create -output "$darwin_file" $darwin_files
404 done # $darwin_filelist
405 ${rm}r unfat-$$
406 cd "$darwin_orig_dir"
407 else
408 cd "$darwin_orig_dir"
409 func_extract_an_archive "$my_xdir" "$my_xabs"
410 fi # $darwin_arches
411 fi # $run
412 ;;
413 *)
414 func_extract_an_archive "$my_xdir" "$my_xabs"
415 ;;
416 esac
417 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
418 done
419 func_extract_archives_result="$my_oldobjs"
420}
421# End of Shell function definitions
422#####################################
423
424# Darwin sucks
425eval std_shrext=\"$shrext_cmds\"
426
427disable_libs=no
428
429# Parse our command line options once, thoroughly.
430while test "$#" -gt 0
431do
432 arg="$1"
433 shift
434
435 case $arg in
436 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
437 *) optarg= ;;
438 esac
439
440 # If the previous option needs an argument, assign it.
441 if test -n "$prev"; then
442 case $prev in
443 execute_dlfiles)
444 execute_dlfiles="$execute_dlfiles $arg"
445 ;;
446 tag)
447 tagname="$arg"
448 preserve_args="${preserve_args}=$arg"
449
450 # Check whether tagname contains only valid characters
451 case $tagname in
452 *[!-_A-Za-z0-9,/]*)
453 $echo "$progname: invalid tag name: $tagname" 1>&2
454 exit $EXIT_FAILURE
455 ;;
456 esac
457
458 case $tagname in
459 CC)
460 # Don't test for the "default" C tag, as we know, it's there, but
461 # not specially marked.
462 ;;
463 *)
464 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
465 taglist="$taglist $tagname"
466 # Evaluate the configuration.
467 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
468 else
469 $echo "$progname: ignoring unknown tag $tagname" 1>&2
470 fi
471 ;;
472 esac
473 ;;
474 *)
475 eval "$prev=\$arg"
476 ;;
477 esac
478
479 prev=
480 prevopt=
481 continue
482 fi
483
484 # Have we seen a non-optional argument yet?
485 case $arg in
486 --help)
487 show_help=yes
488 ;;
489
490 --version)
491 echo "\
492$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
493
494Copyright (C) 2008 Free Software Foundation, Inc.
495This is free software; see the source for copying conditions. There is NO
496warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
497 exit $?
498 ;;
499
500 --config)
501 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
502 # Now print the configurations for the tags.
503 for tagname in $taglist; do
504 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
505 done
506 exit $?
507 ;;
508
509 --debug)
510 $echo "$progname: enabling shell trace mode"
511 set -x
512 preserve_args="$preserve_args $arg"
513 ;;
514
515 --dry-run | -n)
516 run=:
517 ;;
518
519 --features)
520 $echo "host: $host"
521 if test "$build_libtool_libs" = yes; then
522 $echo "enable shared libraries"
523 else
524 $echo "disable shared libraries"
525 fi
526 if test "$build_old_libs" = yes; then
527 $echo "enable static libraries"
528 else
529 $echo "disable static libraries"
530 fi
531 exit $?
532 ;;
533
534 --finish) mode="finish" ;;
535
536 --mode) prevopt="--mode" prev=mode ;;
537 --mode=*) mode="$optarg" ;;
538
539 --preserve-dup-deps) duplicate_deps="yes" ;;
540
541 --quiet | --silent)
542 show=:
543 preserve_args="$preserve_args $arg"
544 ;;
545
546 --tag)
547 prevopt="--tag"
548 prev=tag
549 preserve_args="$preserve_args --tag"
550 ;;
551 --tag=*)
552 set tag "$optarg" ${1+"$@"}
553 shift
554 prev=tag
555 preserve_args="$preserve_args --tag"
556 ;;
557
558 -dlopen)
559 prevopt="-dlopen"
560 prev=execute_dlfiles
561 ;;
562
563 -*)
564 $echo "$modename: unrecognized option \`$arg'" 1>&2
565 $echo "$help" 1>&2
566 exit $EXIT_FAILURE
567 ;;
568
569 *)
570 nonopt="$arg"
571 break
572 ;;
573 esac
574done
575
576if test -n "$prevopt"; then
577 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
578 $echo "$help" 1>&2
579 exit $EXIT_FAILURE
580fi
581
582case $disable_libs in
583no)
584 ;;
585shared)
586 build_libtool_libs=no
587 build_old_libs=yes
588 ;;
589static)
590 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
591 ;;
592esac
593
594# If this variable is set in any of the actions, the command in it
595# will be execed at the end. This prevents here-documents from being
596# left over by shells.
597exec_cmd=
598
599if test -z "$show_help"; then
600
601 # Infer the operation mode.
602 if test -z "$mode"; then
603 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
604 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
605 case $nonopt in
606 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
607 mode=link
608 for arg
609 do
610 case $arg in
611 -c)
612 mode=compile
613 break
614 ;;
615 esac
616 done
617 ;;
618 *db | *dbx | *strace | *truss)
619 mode=execute
620 ;;
621 *install*|cp|mv)
622 mode=install
623 ;;
624 *rm)
625 mode=uninstall
626 ;;
627 *)
628 # If we have no mode, but dlfiles were specified, then do execute mode.
629 test -n "$execute_dlfiles" && mode=execute
630
631 # Just use the default operation mode.
632 if test -z "$mode"; then
633 if test -n "$nonopt"; then
634 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
635 else
636 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
637 fi
638 fi
639 ;;
640 esac
641 fi
642
643 # Only execute mode is allowed to have -dlopen flags.
644 if test -n "$execute_dlfiles" && test "$mode" != execute; then
645 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
646 $echo "$help" 1>&2
647 exit $EXIT_FAILURE
648 fi
649
650 # Change the help message to a mode-specific one.
651 generic_help="$help"
652 help="Try \`$modename --help --mode=$mode' for more information."
653
654 # These modes are in order of execution frequency so that they run quickly.
655 case $mode in
656 # libtool compile mode
657 compile)
658 modename="$modename: compile"
659 # Get the compilation command and the source file.
660 base_compile=
661 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
662 suppress_opt=yes
663 suppress_output=
664 arg_mode=normal
665 libobj=
666 later=
667
668 for arg
669 do
670 case $arg_mode in
671 arg )
672 # do not "continue". Instead, add this to base_compile
673 lastarg="$arg"
674 arg_mode=normal
675 ;;
676
677 target )
678 libobj="$arg"
679 arg_mode=normal
680 continue
681 ;;
682
683 normal )
684 # Accept any command-line options.
685 case $arg in
686 -o)
687 if test -n "$libobj" ; then
688 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
689 exit $EXIT_FAILURE
690 fi
691 arg_mode=target
692 continue
693 ;;
694
695 -static | -prefer-pic | -prefer-non-pic)
696 later="$later $arg"
697 continue
698 ;;
699
700 -no-suppress)
701 suppress_opt=no
702 continue
703 ;;
704
705 -Xcompiler)
706 arg_mode=arg # the next one goes into the "base_compile" arg list
707 continue # The current "srcfile" will either be retained or
708 ;; # replaced later. I would guess that would be a bug.
709
710 -Wc,*)
711 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
712 lastarg=
713 save_ifs="$IFS"; IFS=','
714 for arg in $args; do
715 IFS="$save_ifs"
716
717 # Double-quote args containing other shell metacharacters.
718 # Many Bourne shells cannot handle close brackets correctly
719 # in scan sets, so we specify it separately.
720 case $arg in
721 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
722 arg="\"$arg\""
723 ;;
724 esac
725 lastarg="$lastarg $arg"
726 done
727 IFS="$save_ifs"
728 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
729
730 # Add the arguments to base_compile.
731 base_compile="$base_compile $lastarg"
732 continue
733 ;;
734
735 * )
736 # Accept the current argument as the source file.
737 # The previous "srcfile" becomes the current argument.
738 #
739 lastarg="$srcfile"
740 srcfile="$arg"
741 ;;
742 esac # case $arg
743 ;;
744 esac # case $arg_mode
745
746 # Aesthetically quote the previous argument.
747 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
748
749 case $lastarg in
750 # Double-quote args containing other shell metacharacters.
751 # Many Bourne shells cannot handle close brackets correctly
752 # in scan sets, and some SunOS ksh mistreat backslash-escaping
753 # in scan sets (worked around with variable expansion),
754 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
755 # at all, so we specify them separately.
756 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
757 lastarg="\"$lastarg\""
758 ;;
759 esac
760
761 base_compile="$base_compile $lastarg"
762 done # for arg
763
764 case $arg_mode in
765 arg)
766 $echo "$modename: you must specify an argument for -Xcompile"
767 exit $EXIT_FAILURE
768 ;;
769 target)
770 $echo "$modename: you must specify a target with \`-o'" 1>&2
771 exit $EXIT_FAILURE
772 ;;
773 *)
774 # Get the name of the library object.
775 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
776 ;;
777 esac
778
779 # Recognize several different file suffixes.
780 # If the user specifies -o file.o, it is replaced with file.lo
781 xform='[cCFSifmso]'
782 case $libobj in
783 *.ada) xform=ada ;;
784 *.adb) xform=adb ;;
785 *.ads) xform=ads ;;
786 *.asm) xform=asm ;;
787 *.c++) xform=c++ ;;
788 *.cc) xform=cc ;;
789 *.ii) xform=ii ;;
790 *.class) xform=class ;;
791 *.cpp) xform=cpp ;;
792 *.cxx) xform=cxx ;;
793 *.[fF][09]?) xform=[fF][09]. ;;
794 *.for) xform=for ;;
795 *.java) xform=java ;;
796 *.obj) xform=obj ;;
797 *.sx) xform=sx ;;
798 esac
799
800 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
801
802 case $libobj in
803 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
804 *)
805 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
806 exit $EXIT_FAILURE
807 ;;
808 esac
809
810 func_infer_tag $base_compile
811
812 for arg in $later; do
813 case $arg in
814 -static)
815 build_old_libs=yes
816 continue
817 ;;
818
819 -prefer-pic)
820 pic_mode=yes
821 continue
822 ;;
823
824 -prefer-non-pic)
825 pic_mode=no
826 continue
827 ;;
828 esac
829 done
830
831 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
832 case $qlibobj in
833 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
834 qlibobj="\"$qlibobj\"" ;;
835 esac
836 test "X$libobj" != "X$qlibobj" \
837 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
838 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
839 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
840 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
841 if test "X$xdir" = "X$obj"; then
842 xdir=
843 else
844 xdir=$xdir/
845 fi
846 lobj=${xdir}$objdir/$objname
847
848 if test -z "$base_compile"; then
849 $echo "$modename: you must specify a compilation command" 1>&2
850 $echo "$help" 1>&2
851 exit $EXIT_FAILURE
852 fi
853
854 # Delete any leftover library objects.
855 if test "$build_old_libs" = yes; then
856 removelist="$obj $lobj $libobj ${libobj}T"
857 else
858 removelist="$lobj $libobj ${libobj}T"
859 fi
860
861 $run $rm $removelist
862 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
863
864 # On Cygwin there's no "real" PIC flag so we must build both object types
865 case $host_os in
866 cygwin* | mingw* | pw32* | os2*)
867 pic_mode=default
868 ;;
869 esac
870 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
871 # non-PIC code in shared libraries is not supported
872 pic_mode=default
873 fi
874
875 # Calculate the filename of the output object if compiler does
876 # not support -o with -c
877 if test "$compiler_c_o" = no; then
878 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
879 lockfile="$output_obj.lock"
880 removelist="$removelist $output_obj $lockfile"
881 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
882 else
883 output_obj=
884 need_locks=no
885 lockfile=
886 fi
887
888 # Lock this critical section if it is needed
889 # We use this script file to make the link, it avoids creating a new file
890 if test "$need_locks" = yes; then
891 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
892 $show "Waiting for $lockfile to be removed"
893 sleep 2
894 done
895 elif test "$need_locks" = warn; then
896 if test -f "$lockfile"; then
897 $echo "\
898*** ERROR, $lockfile exists and contains:
899`cat $lockfile 2>/dev/null`
900
901This indicates that another process is trying to use the same
902temporary object file, and libtool could not work around it because
903your compiler does not support \`-c' and \`-o' together. If you
904repeat this compilation, it may succeed, by chance, but you had better
905avoid parallel builds (make -j) in this platform, or get a better
906compiler."
907
908 $run $rm $removelist
909 exit $EXIT_FAILURE
910 fi
911 $echo "$srcfile" > "$lockfile"
912 fi
913
914 if test -n "$fix_srcfile_path"; then
915 eval srcfile=\"$fix_srcfile_path\"
916 fi
917 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
918 case $qsrcfile in
919 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
920 qsrcfile="\"$qsrcfile\"" ;;
921 esac
922
923 $run $rm "$libobj" "${libobj}T"
924
925 # Create a libtool object file (analogous to a ".la" file),
926 # but don't create it if we're doing a dry run.
927 test -z "$run" && cat > ${libobj}T <<EOF
928# $libobj - a libtool object file
929# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
930#
931# Please DO NOT delete this file!
932# It is necessary for linking the library.
933
934# Name of the PIC object.
935EOF
936
937 # Only build a PIC object if we are building libtool libraries.
938 if test "$build_libtool_libs" = yes; then
939 # Without this assignment, base_compile gets emptied.
940 fbsd_hideous_sh_bug=$base_compile
941
942 if test "$pic_mode" != no; then
943 command="$base_compile $qsrcfile $pic_flag"
944 else
945 # Don't build PIC code
946 command="$base_compile $qsrcfile"
947 fi
948
949 if test ! -d "${xdir}$objdir"; then
950 $show "$mkdir ${xdir}$objdir"
951 $run $mkdir ${xdir}$objdir
952 exit_status=$?
953 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
954 exit $exit_status
955 fi
956 fi
957
958 if test -z "$output_obj"; then
959 # Place PIC objects in $objdir
960 command="$command -o $lobj"
961 fi
962
963 $run $rm "$lobj" "$output_obj"
964
965 $show "$command"
966 if $run eval $lt_env "$command"; then :
967 else
968 test -n "$output_obj" && $run $rm $removelist
969 exit $EXIT_FAILURE
970 fi
971
972 if test "$need_locks" = warn &&
973 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
974 $echo "\
975*** ERROR, $lockfile contains:
976`cat $lockfile 2>/dev/null`
977
978but it should contain:
979$srcfile
980
981This indicates that another process is trying to use the same
982temporary object file, and libtool could not work around it because
983your compiler does not support \`-c' and \`-o' together. If you
984repeat this compilation, it may succeed, by chance, but you had better
985avoid parallel builds (make -j) in this platform, or get a better
986compiler."
987
988 $run $rm $removelist
989 exit $EXIT_FAILURE
990 fi
991
992 # Just move the object if needed, then go on to compile the next one
993 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
994 $show "$mv $output_obj $lobj"
995 if $run $mv $output_obj $lobj; then :
996 else
997 error=$?
998 $run $rm $removelist
999 exit $error
1000 fi
1001 fi
1002
1003 # Append the name of the PIC object to the libtool object file.
1004 test -z "$run" && cat >> ${libobj}T <<EOF
1005pic_object='$objdir/$objname'
1006
1007EOF
1008
1009 # Allow error messages only from the first compilation.
1010 if test "$suppress_opt" = yes; then
1011 suppress_output=' >/dev/null 2>&1'
1012 fi
1013 else
1014 # No PIC object so indicate it doesn't exist in the libtool
1015 # object file.
1016 test -z "$run" && cat >> ${libobj}T <<EOF
1017pic_object=none
1018
1019EOF
1020 fi
1021
1022 # Only build a position-dependent object if we build old libraries.
1023 if test "$build_old_libs" = yes; then
1024 if test "$pic_mode" != yes; then
1025 # Don't build PIC code
1026 command="$base_compile $qsrcfile"
1027 else
1028 command="$base_compile $qsrcfile $pic_flag"
1029 fi
1030 if test "$compiler_c_o" = yes; then
1031 command="$command -o $obj"
1032 fi
1033
1034 # Suppress compiler output if we already did a PIC compilation.
1035 command="$command$suppress_output"
1036 $run $rm "$obj" "$output_obj"
1037 $show "$command"
1038 if $run eval $lt_env "$command"; then :
1039 else
1040 $run $rm $removelist
1041 exit $EXIT_FAILURE
1042 fi
1043
1044 if test "$need_locks" = warn &&
1045 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1046 $echo "\
1047*** ERROR, $lockfile contains:
1048`cat $lockfile 2>/dev/null`
1049
1050but it should contain:
1051$srcfile
1052
1053This indicates that another process is trying to use the same
1054temporary object file, and libtool could not work around it because
1055your compiler does not support \`-c' and \`-o' together. If you
1056repeat this compilation, it may succeed, by chance, but you had better
1057avoid parallel builds (make -j) in this platform, or get a better
1058compiler."
1059
1060 $run $rm $removelist
1061 exit $EXIT_FAILURE
1062 fi
1063
1064 # Just move the object if needed
1065 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1066 $show "$mv $output_obj $obj"
1067 if $run $mv $output_obj $obj; then :
1068 else
1069 error=$?
1070 $run $rm $removelist
1071 exit $error
1072 fi
1073 fi
1074
1075 # Append the name of the non-PIC object the libtool object file.
1076 # Only append if the libtool object file exists.
1077 test -z "$run" && cat >> ${libobj}T <<EOF
1078# Name of the non-PIC object.
1079non_pic_object='$objname'
1080
1081EOF
1082 else
1083 # Append the name of the non-PIC object the libtool object file.
1084 # Only append if the libtool object file exists.
1085 test -z "$run" && cat >> ${libobj}T <<EOF
1086# Name of the non-PIC object.
1087non_pic_object=none
1088
1089EOF
1090 fi
1091
1092 $run $mv "${libobj}T" "${libobj}"
1093
1094 # Unlock the critical section if it was locked
1095 if test "$need_locks" != no; then
1096 $run $rm "$lockfile"
1097 fi
1098
1099 exit $EXIT_SUCCESS
1100 ;;
1101
1102 # libtool link mode
1103 link | relink)
1104 modename="$modename: link"
1105 case $host in
1106 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1107 # It is impossible to link a dll without this setting, and
1108 # we shouldn't force the makefile maintainer to figure out
1109 # which system we are compiling for in order to pass an extra
1110 # flag for every libtool invocation.
1111 # allow_undefined=no
1112
1113 # FIXME: Unfortunately, there are problems with the above when trying
1114 # to make a dll which has undefined symbols, in which case not
1115 # even a static library is built. For now, we need to specify
1116 # -no-undefined on the libtool link line when we can be certain
1117 # that all symbols are satisfied, otherwise we get a static library.
1118 allow_undefined=yes
1119 ;;
1120 *)
1121 allow_undefined=yes
1122 ;;
1123 esac
1124 libtool_args="$nonopt"
1125 base_compile="$nonopt $@"
1126 compile_command="$nonopt"
1127 finalize_command="$nonopt"
1128
1129 compile_rpath=
1130 finalize_rpath=
1131 compile_shlibpath=
1132 finalize_shlibpath=
1133 convenience=
1134 old_convenience=
1135 deplibs=
1136 old_deplibs=
1137 compiler_flags=
1138 linker_flags=
1139 dllsearchpath=
1140 lib_search_path=`pwd`
1141 inst_prefix_dir=
1142
1143 avoid_version=no
1144 dlfiles=
1145 dlprefiles=
1146 dlself=no
1147 export_dynamic=no
1148 export_symbols=
1149 export_symbols_regex=
1150 generated=
1151 libobjs=
1152 ltlibs=
1153 module=no
1154 no_install=no
1155 objs=
1156 non_pic_objects=
1157 notinst_path= # paths that contain not-installed libtool libraries
1158 precious_files_regex=
1159 prefer_static_libs=no
1160 preload=no
1161 prev=
1162 prevarg=
1163 release=
1164 rpath=
1165 xrpath=
1166 perm_rpath=
1167 temp_rpath=
1168 thread_safe=no
1169 vinfo=
1170 vinfo_number=no
1171 single_module="${wl}-single_module"
1172
1173 func_infer_tag $base_compile
1174
1175 # We need to know -static, to get the right output filenames.
1176 for arg
1177 do
1178 case $arg in
1179 -all-static | -static | -static-libtool-libs)
1180 case $arg in
1181 -all-static)
1182 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1183 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1184 fi
1185 if test -n "$link_static_flag"; then
1186 dlopen_self=$dlopen_self_static
1187 fi
1188 prefer_static_libs=yes
1189 ;;
1190 -static)
1191 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1192 dlopen_self=$dlopen_self_static
1193 fi
1194 prefer_static_libs=built
1195 ;;
1196 -static-libtool-libs)
1197 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1198 dlopen_self=$dlopen_self_static
1199 fi
1200 prefer_static_libs=yes
1201 ;;
1202 esac
1203 build_libtool_libs=no
1204 build_old_libs=yes
1205 break
1206 ;;
1207 esac
1208 done
1209
1210 # See if our shared archives depend on static archives.
1211 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1212
1213 # Go through the arguments, transforming them on the way.
1214 while test "$#" -gt 0; do
1215 arg="$1"
1216 shift
1217 case $arg in
1218 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1219 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1220 ;;
1221 *) qarg=$arg ;;
1222 esac
1223 libtool_args="$libtool_args $qarg"
1224
1225 # If the previous option needs an argument, assign it.
1226 if test -n "$prev"; then
1227 case $prev in
1228 output)
1229 compile_command="$compile_command @OUTPUT@"
1230 finalize_command="$finalize_command @OUTPUT@"
1231 ;;
1232 esac
1233
1234 case $prev in
1235 dlfiles|dlprefiles)
1236 if test "$preload" = no; then
1237 # Add the symbol object into the linking commands.
1238 compile_command="$compile_command @SYMFILE@"
1239 finalize_command="$finalize_command @SYMFILE@"
1240 preload=yes
1241 fi
1242 case $arg in
1243 *.la | *.lo) ;; # We handle these cases below.
1244 force)
1245 if test "$dlself" = no; then
1246 dlself=needless
1247 export_dynamic=yes
1248 fi
1249 prev=
1250 continue
1251 ;;
1252 self)
1253 if test "$prev" = dlprefiles; then
1254 dlself=yes
1255 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1256 dlself=yes
1257 else
1258 dlself=needless
1259 export_dynamic=yes
1260 fi
1261 prev=
1262 continue
1263 ;;
1264 *)
1265 if test "$prev" = dlfiles; then
1266 dlfiles="$dlfiles $arg"
1267 else
1268 dlprefiles="$dlprefiles $arg"
1269 fi
1270 prev=
1271 continue
1272 ;;
1273 esac
1274 ;;
1275 expsyms)
1276 export_symbols="$arg"
1277 if test ! -f "$arg"; then
1278 $echo "$modename: symbol file \`$arg' does not exist"
1279 exit $EXIT_FAILURE
1280 fi
1281 prev=
1282 continue
1283 ;;
1284 expsyms_regex)
1285 export_symbols_regex="$arg"
1286 prev=
1287 continue
1288 ;;
1289 inst_prefix)
1290 inst_prefix_dir="$arg"
1291 prev=
1292 continue
1293 ;;
1294 precious_regex)
1295 precious_files_regex="$arg"
1296 prev=
1297 continue
1298 ;;
1299 release)
1300 release="-$arg"
1301 prev=
1302 continue
1303 ;;
1304 objectlist)
1305 if test -f "$arg"; then
1306 save_arg=$arg
1307 moreargs=
1308 for fil in `cat $save_arg`
1309 do
1310# moreargs="$moreargs $fil"
1311 arg=$fil
1312 # A libtool-controlled object.
1313
1314 # Check to see that this really is a libtool object.
1315 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1316 pic_object=
1317 non_pic_object=
1318
1319 # Read the .lo file
1320 # If there is no directory component, then add one.
1321 case $arg in
1322 */* | *\\*) . $arg ;;
1323 *) . ./$arg ;;
1324 esac
1325
1326 if test -z "$pic_object" || \
1327 test -z "$non_pic_object" ||
1328 test "$pic_object" = none && \
1329 test "$non_pic_object" = none; then
1330 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1331 exit $EXIT_FAILURE
1332 fi
1333
1334 # Extract subdirectory from the argument.
1335 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1336 if test "X$xdir" = "X$arg"; then
1337 xdir=
1338 else
1339 xdir="$xdir/"
1340 fi
1341
1342 if test "$pic_object" != none; then
1343 # Prepend the subdirectory the object is found in.
1344 pic_object="$xdir$pic_object"
1345
1346 if test "$prev" = dlfiles; then
1347 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1348 dlfiles="$dlfiles $pic_object"
1349 prev=
1350 continue
1351 else
1352 # If libtool objects are unsupported, then we need to preload.
1353 prev=dlprefiles
1354 fi
1355 fi
1356
1357 # CHECK ME: I think I busted this. -Ossama
1358 if test "$prev" = dlprefiles; then
1359 # Preload the old-style object.
1360 dlprefiles="$dlprefiles $pic_object"
1361 prev=
1362 fi
1363
1364 # A PIC object.
1365 libobjs="$libobjs $pic_object"
1366 arg="$pic_object"
1367 fi
1368
1369 # Non-PIC object.
1370 if test "$non_pic_object" != none; then
1371 # Prepend the subdirectory the object is found in.
1372 non_pic_object="$xdir$non_pic_object"
1373
1374 # A standard non-PIC object
1375 non_pic_objects="$non_pic_objects $non_pic_object"
1376 if test -z "$pic_object" || test "$pic_object" = none ; then
1377 arg="$non_pic_object"
1378 fi
1379 else
1380 # If the PIC object exists, use it instead.
1381 # $xdir was prepended to $pic_object above.
1382 non_pic_object="$pic_object"
1383 non_pic_objects="$non_pic_objects $non_pic_object"
1384 fi
1385 else
1386 # Only an error if not doing a dry-run.
1387 if test -z "$run"; then
1388 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1389 exit $EXIT_FAILURE
1390 else
1391 # Dry-run case.
1392
1393 # Extract subdirectory from the argument.
1394 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1395 if test "X$xdir" = "X$arg"; then
1396 xdir=
1397 else
1398 xdir="$xdir/"
1399 fi
1400
1401 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1402 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1403 libobjs="$libobjs $pic_object"
1404 non_pic_objects="$non_pic_objects $non_pic_object"
1405 fi
1406 fi
1407 done
1408 else
1409 $echo "$modename: link input file \`$save_arg' does not exist"
1410 exit $EXIT_FAILURE
1411 fi
1412 arg=$save_arg
1413 prev=
1414 continue
1415 ;;
1416 rpath | xrpath)
1417 # We need an absolute path.
1418 case $arg in
1419 [\\/]* | [A-Za-z]:[\\/]*) ;;
1420 *)
1421 $echo "$modename: only absolute run-paths are allowed" 1>&2
1422 exit $EXIT_FAILURE
1423 ;;
1424 esac
1425 if test "$prev" = rpath; then
1426 case "$rpath " in
1427 *" $arg "*) ;;
1428 *) rpath="$rpath $arg" ;;
1429 esac
1430 else
1431 case "$xrpath " in
1432 *" $arg "*) ;;
1433 *) xrpath="$xrpath $arg" ;;
1434 esac
1435 fi
1436 prev=
1437 continue
1438 ;;
1439 xcompiler)
1440 compiler_flags="$compiler_flags $qarg"
1441 prev=
1442 compile_command="$compile_command $qarg"
1443 finalize_command="$finalize_command $qarg"
1444 continue
1445 ;;
1446 xlinker)
1447 linker_flags="$linker_flags $qarg"
1448 compiler_flags="$compiler_flags $wl$qarg"
1449 prev=
1450 compile_command="$compile_command $wl$qarg"
1451 finalize_command="$finalize_command $wl$qarg"
1452 continue
1453 ;;
1454 xcclinker)
1455 linker_flags="$linker_flags $qarg"
1456 compiler_flags="$compiler_flags $qarg"
1457 prev=
1458 compile_command="$compile_command $qarg"
1459 finalize_command="$finalize_command $qarg"
1460 continue
1461 ;;
1462 shrext)
1463 shrext_cmds="$arg"
1464 prev=
1465 continue
1466 ;;
1467 darwin_framework|darwin_framework_skip)
1468 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1469 compile_command="$compile_command $arg"
1470 finalize_command="$finalize_command $arg"
1471 prev=
1472 continue
1473 ;;
1474 *)
1475 eval "$prev=\"\$arg\""
1476 prev=
1477 continue
1478 ;;
1479 esac
1480 fi # test -n "$prev"
1481
1482 prevarg="$arg"
1483
1484 case $arg in
1485 -all-static)
1486 if test -n "$link_static_flag"; then
1487 compile_command="$compile_command $link_static_flag"
1488 finalize_command="$finalize_command $link_static_flag"
1489 fi
1490 continue
1491 ;;
1492
1493 -allow-undefined)
1494 # FIXME: remove this flag sometime in the future.
1495 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1496 continue
1497 ;;
1498
1499 -avoid-version)
1500 avoid_version=yes
1501 continue
1502 ;;
1503
1504 -dlopen)
1505 prev=dlfiles
1506 continue
1507 ;;
1508
1509 -dlpreopen)
1510 prev=dlprefiles
1511 continue
1512 ;;
1513
1514 -export-dynamic)
1515 export_dynamic=yes
1516 continue
1517 ;;
1518
1519 -export-symbols | -export-symbols-regex)
1520 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1521 $echo "$modename: more than one -exported-symbols argument is not allowed"
1522 exit $EXIT_FAILURE
1523 fi
1524 if test "X$arg" = "X-export-symbols"; then
1525 prev=expsyms
1526 else
1527 prev=expsyms_regex
1528 fi
1529 continue
1530 ;;
1531
1532 -framework|-arch|-isysroot)
1533 case " $CC " in
1534 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1535 prev=darwin_framework_skip ;;
1536 *) compiler_flags="$compiler_flags $arg"
1537 prev=darwin_framework ;;
1538 esac
1539 compile_command="$compile_command $arg"
1540 finalize_command="$finalize_command $arg"
1541 continue
1542 ;;
1543
1544 -inst-prefix-dir)
1545 prev=inst_prefix
1546 continue
1547 ;;
1548
1549 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1550 # so, if we see these flags be careful not to treat them like -L
1551 -L[A-Z][A-Z]*:*)
1552 case $with_gcc/$host in
1553 no/*-*-irix* | /*-*-irix*)
1554 compile_command="$compile_command $arg"
1555 finalize_command="$finalize_command $arg"
1556 ;;
1557 esac
1558 continue
1559 ;;
1560
1561 -L*)
1562 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1563 # We need an absolute path.
1564 case $dir in
1565 [\\/]* | [A-Za-z]:[\\/]*) ;;
1566 *)
1567 absdir=`cd "$dir" && pwd`
1568 if test -z "$absdir"; then
1569 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1570 absdir="$dir"
1571 notinst_path="$notinst_path $dir"
1572 fi
1573 dir="$absdir"
1574 ;;
1575 esac
1576 case "$deplibs " in
1577 *" -L$dir "*) ;;
1578 *)
1579 deplibs="$deplibs -L$dir"
1580 lib_search_path="$lib_search_path $dir"
1581 ;;
1582 esac
1583 case $host in
1584 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1585 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1586 case :$dllsearchpath: in
1587 *":$dir:"*) ;;
1588 *) dllsearchpath="$dllsearchpath:$dir";;
1589 esac
1590 case :$dllsearchpath: in
1591 *":$testbindir:"*) ;;
1592 *) dllsearchpath="$dllsearchpath:$testbindir";;
1593 esac
1594 ;;
1595 esac
1596 continue
1597 ;;
1598
1599 -l*)
1600 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1601 case $host in
1602 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1603 # These systems don't actually have a C or math library (as such)
1604 continue
1605 ;;
1606 *-*-os2*)
1607 # These systems don't actually have a C library (as such)
1608 test "X$arg" = "X-lc" && continue
1609 ;;
1610 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1611 # Do not include libc due to us having libc/libc_r.
1612 test "X$arg" = "X-lc" && continue
1613 ;;
1614 *-*-rhapsody* | *-*-darwin1.[012])
1615 # Rhapsody C and math libraries are in the System framework
1616 deplibs="$deplibs -framework System"
1617 continue
1618 ;;
1619 *-*-sco3.2v5* | *-*-sco5v6*)
1620 # Causes problems with __ctype
1621 test "X$arg" = "X-lc" && continue
1622 ;;
1623 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1624 # Compiler inserts libc in the correct place for threads to work
1625 test "X$arg" = "X-lc" && continue
1626 ;;
1627 esac
1628 elif test "X$arg" = "X-lc_r"; then
1629 case $host in
1630 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1631 # Do not include libc_r directly, use -pthread flag.
1632 continue
1633 ;;
1634 esac
1635 fi
1636 deplibs="$deplibs $arg"
1637 continue
1638 ;;
1639
1640 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1641 # classes, name mangling, and exception handling.
1642 -model)
1643 compile_command="$compile_command $arg"
1644 compiler_flags="$compiler_flags $arg"
1645 finalize_command="$finalize_command $arg"
1646 prev=xcompiler
1647 continue
1648 ;;
1649
1650 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1651 compiler_flags="$compiler_flags $arg"
1652 compile_command="$compile_command $arg"
1653 finalize_command="$finalize_command $arg"
1654 continue
1655 ;;
1656
1657 -multi_module)
1658 single_module="${wl}-multi_module"
1659 continue
1660 ;;
1661
1662 -module)
1663 module=yes
1664 continue
1665 ;;
1666
1667 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1668 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1669 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1670 # +DA*, +DD* enable 64-bit mode on the HP compiler
1671 # -q* pass through compiler args for the IBM compiler
1672 # -m* pass through architecture-specific compiler args for GCC
1673 # -m*, -t[45]*, -txscale* pass through architecture-specific
1674 # compiler args for GCC
1675 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1676 # -F/path gives path to uninstalled frameworks, gcc on darwin
1677 # @file GCC response files
1678 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
1679 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
1680
1681 # Unknown arguments in both finalize_command and compile_command need
1682 # to be aesthetically quoted because they are evaled later.
1683 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1684 case $arg in
1685 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1686 arg="\"$arg\""
1687 ;;
1688 esac
1689 compile_command="$compile_command $arg"
1690 finalize_command="$finalize_command $arg"
1691 compiler_flags="$compiler_flags $arg"
1692 continue
1693 ;;
1694
1695 -shrext)
1696 prev=shrext
1697 continue
1698 ;;
1699
1700 -no-fast-install)
1701 fast_install=no
1702 continue
1703 ;;
1704
1705 -no-install)
1706 case $host in
1707 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
1708 # The PATH hackery in wrapper scripts is required on Windows
1709 # and Darwin in order for the loader to find any dlls it needs.
1710 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1711 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1712 fast_install=no
1713 ;;
1714 *) no_install=yes ;;
1715 esac
1716 continue
1717 ;;
1718
1719 -no-undefined)
1720 allow_undefined=no
1721 continue
1722 ;;
1723
1724 -objectlist)
1725 prev=objectlist
1726 continue
1727 ;;
1728
1729 -o) prev=output ;;
1730
1731 -precious-files-regex)
1732 prev=precious_regex
1733 continue
1734 ;;
1735
1736 -release)
1737 prev=release
1738 continue
1739 ;;
1740
1741 -rpath)
1742 prev=rpath
1743 continue
1744 ;;
1745
1746 -R)
1747 prev=xrpath
1748 continue
1749 ;;
1750
1751 -R*)
1752 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1753 # We need an absolute path.
1754 case $dir in
1755 [\\/]* | [A-Za-z]:[\\/]*) ;;
1756 *)
1757 $echo "$modename: only absolute run-paths are allowed" 1>&2
1758 exit $EXIT_FAILURE
1759 ;;
1760 esac
1761 case "$xrpath " in
1762 *" $dir "*) ;;
1763 *) xrpath="$xrpath $dir" ;;
1764 esac
1765 continue
1766 ;;
1767
1768 -static | -static-libtool-libs)
1769 # The effects of -static are defined in a previous loop.
1770 # We used to do the same as -all-static on platforms that
1771 # didn't have a PIC flag, but the assumption that the effects
1772 # would be equivalent was wrong. It would break on at least
1773 # Digital Unix and AIX.
1774 continue
1775 ;;
1776
1777 -thread-safe)
1778 thread_safe=yes
1779 continue
1780 ;;
1781
1782 -version-info)
1783 prev=vinfo
1784 continue
1785 ;;
1786 -version-number)
1787 prev=vinfo
1788 vinfo_number=yes
1789 continue
1790 ;;
1791
1792 -Wc,*)
1793 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1794 arg=
1795 save_ifs="$IFS"; IFS=','
1796 for flag in $args; do
1797 IFS="$save_ifs"
1798 case $flag in
1799 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1800 flag="\"$flag\""
1801 ;;
1802 esac
1803 arg="$arg $wl$flag"
1804 compiler_flags="$compiler_flags $flag"
1805 done
1806 IFS="$save_ifs"
1807 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1808 ;;
1809
1810 -Wl,*)
1811 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1812 arg=
1813 save_ifs="$IFS"; IFS=','
1814 for flag in $args; do
1815 IFS="$save_ifs"
1816 case $flag in
1817 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1818 flag="\"$flag\""
1819 ;;
1820 esac
1821 arg="$arg $wl$flag"
1822 compiler_flags="$compiler_flags $wl$flag"
1823 linker_flags="$linker_flags $flag"
1824 done
1825 IFS="$save_ifs"
1826 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1827 ;;
1828
1829 -Xcompiler)
1830 prev=xcompiler
1831 continue
1832 ;;
1833
1834 -Xlinker)
1835 prev=xlinker
1836 continue
1837 ;;
1838
1839 -XCClinker)
1840 prev=xcclinker
1841 continue
1842 ;;
1843
1844 # Some other compiler flag.
1845 -* | +*)
1846 # Unknown arguments in both finalize_command and compile_command need
1847 # to be aesthetically quoted because they are evaled later.
1848 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1849 case $arg in
1850 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1851 arg="\"$arg\""
1852 ;;
1853 esac
1854 ;;
1855
1856 *.$objext)
1857 # A standard object.
1858 objs="$objs $arg"
1859 ;;
1860
1861 *.lo)
1862 # A libtool-controlled object.
1863
1864 # Check to see that this really is a libtool object.
1865 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1866 pic_object=
1867 non_pic_object=
1868
1869 # Read the .lo file
1870 # If there is no directory component, then add one.
1871 case $arg in
1872 */* | *\\*) . $arg ;;
1873 *) . ./$arg ;;
1874 esac
1875
1876 if test -z "$pic_object" || \
1877 test -z "$non_pic_object" ||
1878 test "$pic_object" = none && \
1879 test "$non_pic_object" = none; then
1880 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1881 exit $EXIT_FAILURE
1882 fi
1883
1884 # Extract subdirectory from the argument.
1885 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1886 if test "X$xdir" = "X$arg"; then
1887 xdir=
1888 else
1889 xdir="$xdir/"
1890 fi
1891
1892 if test "$pic_object" != none; then
1893 # Prepend the subdirectory the object is found in.
1894 pic_object="$xdir$pic_object"
1895
1896 if test "$prev" = dlfiles; then
1897 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1898 dlfiles="$dlfiles $pic_object"
1899 prev=
1900 continue
1901 else
1902 # If libtool objects are unsupported, then we need to preload.
1903 prev=dlprefiles
1904 fi
1905 fi
1906
1907 # CHECK ME: I think I busted this. -Ossama
1908 if test "$prev" = dlprefiles; then
1909 # Preload the old-style object.
1910 dlprefiles="$dlprefiles $pic_object"
1911 prev=
1912 fi
1913
1914 # A PIC object.
1915 libobjs="$libobjs $pic_object"
1916 arg="$pic_object"
1917 fi
1918
1919 # Non-PIC object.
1920 if test "$non_pic_object" != none; then
1921 # Prepend the subdirectory the object is found in.
1922 non_pic_object="$xdir$non_pic_object"
1923
1924 # A standard non-PIC object
1925 non_pic_objects="$non_pic_objects $non_pic_object"
1926 if test -z "$pic_object" || test "$pic_object" = none ; then
1927 arg="$non_pic_object"
1928 fi
1929 else
1930 # If the PIC object exists, use it instead.
1931 # $xdir was prepended to $pic_object above.
1932 non_pic_object="$pic_object"
1933 non_pic_objects="$non_pic_objects $non_pic_object"
1934 fi
1935 else
1936 # Only an error if not doing a dry-run.
1937 if test -z "$run"; then
1938 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1939 exit $EXIT_FAILURE
1940 else
1941 # Dry-run case.
1942
1943 # Extract subdirectory from the argument.
1944 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1945 if test "X$xdir" = "X$arg"; then
1946 xdir=
1947 else
1948 xdir="$xdir/"
1949 fi
1950
1951 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1952 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1953 libobjs="$libobjs $pic_object"
1954 non_pic_objects="$non_pic_objects $non_pic_object"
1955 fi
1956 fi
1957 ;;
1958
1959 *.$libext)
1960 # An archive.
1961 deplibs="$deplibs $arg"
1962 old_deplibs="$old_deplibs $arg"
1963 continue
1964 ;;
1965
1966 *.la)
1967 # A libtool-controlled library.
1968
1969 if test "$prev" = dlfiles; then
1970 # This library was specified with -dlopen.
1971 dlfiles="$dlfiles $arg"
1972 prev=
1973 elif test "$prev" = dlprefiles; then
1974 # The library was specified with -dlpreopen.
1975 dlprefiles="$dlprefiles $arg"
1976 prev=
1977 else
1978 deplibs="$deplibs $arg"
1979 fi
1980 continue
1981 ;;
1982
1983 # Some other compiler argument.
1984 *)
1985 # Unknown arguments in both finalize_command and compile_command need
1986 # to be aesthetically quoted because they are evaled later.
1987 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1988 case $arg in
1989 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1990 arg="\"$arg\""
1991 ;;
1992 esac
1993 ;;
1994 esac # arg
1995
1996 # Now actually substitute the argument into the commands.
1997 if test -n "$arg"; then
1998 compile_command="$compile_command $arg"
1999 finalize_command="$finalize_command $arg"
2000 fi
2001 done # argument parsing loop
2002
2003 if test -n "$prev"; then
2004 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2005 $echo "$help" 1>&2
2006 exit $EXIT_FAILURE
2007 fi
2008
2009 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2010 eval arg=\"$export_dynamic_flag_spec\"
2011 compile_command="$compile_command $arg"
2012 finalize_command="$finalize_command $arg"
2013 fi
2014
2015 oldlibs=
2016 # calculate the name of the file, without its directory
2017 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2018 libobjs_save="$libobjs"
2019
2020 if test -n "$shlibpath_var"; then
2021 # get the directories listed in $shlibpath_var
2022 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2023 else
2024 shlib_search_path=
2025 fi
2026 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2027 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2028
2029 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2030 if test "X$output_objdir" = "X$output"; then
2031 output_objdir="$objdir"
2032 else
2033 output_objdir="$output_objdir/$objdir"
2034 fi
2035 # Create the object directory.
2036 if test ! -d "$output_objdir"; then
2037 $show "$mkdir $output_objdir"
2038 $run $mkdir $output_objdir
2039 exit_status=$?
2040 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2041 exit $exit_status
2042 fi
2043 fi
2044
2045 # Determine the type of output
2046 case $output in
2047 "")
2048 $echo "$modename: you must specify an output file" 1>&2
2049 $echo "$help" 1>&2
2050 exit $EXIT_FAILURE
2051 ;;
2052 *.$libext) linkmode=oldlib ;;
2053 *.lo | *.$objext) linkmode=obj ;;
2054 *.la) linkmode=lib ;;
2055 *) linkmode=prog ;; # Anything else should be a program.
2056 esac
2057
2058 case $host in
2059 *cygwin* | *mingw* | *pw32*)
2060 # don't eliminate duplications in $postdeps and $predeps
2061 duplicate_compiler_generated_deps=yes
2062 ;;
2063 *)
2064 duplicate_compiler_generated_deps=$duplicate_deps
2065 ;;
2066 esac
2067 specialdeplibs=
2068
2069 libs=
2070 # Find all interdependent deplibs by searching for libraries
2071 # that are linked more than once (e.g. -la -lb -la)
2072 for deplib in $deplibs; do
2073 if test "X$duplicate_deps" = "Xyes" ; then
2074 case "$libs " in
2075 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2076 esac
2077 fi
2078 libs="$libs $deplib"
2079 done
2080
2081 if test "$linkmode" = lib; then
2082 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2083
2084 # Compute libraries that are listed more than once in $predeps
2085 # $postdeps and mark them as special (i.e., whose duplicates are
2086 # not to be eliminated).
2087 pre_post_deps=
2088 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2089 for pre_post_dep in $predeps $postdeps; do
2090 case "$pre_post_deps " in
2091 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2092 esac
2093 pre_post_deps="$pre_post_deps $pre_post_dep"
2094 done
2095 fi
2096 pre_post_deps=
2097 fi
2098
2099 deplibs=
2100 newdependency_libs=
2101 newlib_search_path=
2102 need_relink=no # whether we're linking any uninstalled libtool libraries
2103 notinst_deplibs= # not-installed libtool libraries
2104 case $linkmode in
2105 lib)
2106 passes="conv link"
2107 for file in $dlfiles $dlprefiles; do
2108 case $file in
2109 *.la) ;;
2110 *)
2111 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2112 exit $EXIT_FAILURE
2113 ;;
2114 esac
2115 done
2116 ;;
2117 prog)
2118 compile_deplibs=
2119 finalize_deplibs=
2120 alldeplibs=no
2121 newdlfiles=
2122 newdlprefiles=
2123 passes="conv scan dlopen dlpreopen link"
2124 ;;
2125 *) passes="conv"
2126 ;;
2127 esac
2128 for pass in $passes; do
2129 if test "$linkmode,$pass" = "lib,link" ||
2130 test "$linkmode,$pass" = "prog,scan"; then
2131 libs="$deplibs"
2132 deplibs=
2133 fi
2134 if test "$linkmode" = prog; then
2135 case $pass in
2136 dlopen) libs="$dlfiles" ;;
2137 dlpreopen) libs="$dlprefiles" ;;
2138 link)
2139 libs="$deplibs %DEPLIBS%"
2140 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2141 ;;
2142 esac
2143 fi
2144 if test "$pass" = dlopen; then
2145 # Collect dlpreopened libraries
2146 save_deplibs="$deplibs"
2147 deplibs=
2148 fi
2149 for deplib in $libs; do
2150 lib=
2151 found=no
2152 case $deplib in
2153 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2154 if test "$linkmode,$pass" = "prog,link"; then
2155 compile_deplibs="$deplib $compile_deplibs"
2156 finalize_deplibs="$deplib $finalize_deplibs"
2157 else
2158 compiler_flags="$compiler_flags $deplib"
2159 fi
2160 continue
2161 ;;
2162 -l*)
2163 if test "$linkmode" != lib && test "$linkmode" != prog; then
2164 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2165 continue
2166 fi
2167 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2168 if test "$linkmode" = lib; then
2169 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2170 else
2171 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2172 fi
2173 for searchdir in $searchdirs; do
2174 for search_ext in .la $std_shrext .so .a; do
2175 # Search the libtool library
2176 lib="$searchdir/lib${name}${search_ext}"
2177 if test -f "$lib"; then
2178 if test "$search_ext" = ".la"; then
2179 found=yes
2180 else
2181 found=no
2182 fi
2183 break 2
2184 fi
2185 done
2186 done
2187 if test "$found" != yes; then
2188 # deplib doesn't seem to be a libtool library
2189 if test "$linkmode,$pass" = "prog,link"; then
2190 compile_deplibs="$deplib $compile_deplibs"
2191 finalize_deplibs="$deplib $finalize_deplibs"
2192 else
2193 deplibs="$deplib $deplibs"
2194 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2195 fi
2196 continue
2197 else # deplib is a libtool library
2198 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2199 # We need to do some special things here, and not later.
2200 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2201 case " $predeps $postdeps " in
2202 *" $deplib "*)
2203 if (${SED} -e '2q' $lib |
2204 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2205 library_names=
2206 old_library=
2207 case $lib in
2208 */* | *\\*) . $lib ;;
2209 *) . ./$lib ;;
2210 esac
2211 for l in $old_library $library_names; do
2212 ll="$l"
2213 done
2214 if test "X$ll" = "X$old_library" ; then # only static version available
2215 found=no
2216 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2217 test "X$ladir" = "X$lib" && ladir="."
2218 lib=$ladir/$old_library
2219 if test "$linkmode,$pass" = "prog,link"; then
2220 compile_deplibs="$deplib $compile_deplibs"
2221 finalize_deplibs="$deplib $finalize_deplibs"
2222 else
2223 deplibs="$deplib $deplibs"
2224 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2225 fi
2226 continue
2227 fi
2228 fi
2229 ;;
2230 *) ;;
2231 esac
2232 fi
2233 fi
2234 ;; # -l
2235 -L*)
2236 case $linkmode in
2237 lib)
2238 deplibs="$deplib $deplibs"
2239 test "$pass" = conv && continue
2240 newdependency_libs="$deplib $newdependency_libs"
2241 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2242 ;;
2243 prog)
2244 if test "$pass" = conv; then
2245 deplibs="$deplib $deplibs"
2246 continue
2247 fi
2248 if test "$pass" = scan; then
2249 deplibs="$deplib $deplibs"
2250 else
2251 compile_deplibs="$deplib $compile_deplibs"
2252 finalize_deplibs="$deplib $finalize_deplibs"
2253 fi
2254 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2255 ;;
2256 *)
2257 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2258 ;;
2259 esac # linkmode
2260 continue
2261 ;; # -L
2262 -R*)
2263 if test "$pass" = link; then
2264 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2265 # Make sure the xrpath contains only unique directories.
2266 case "$xrpath " in
2267 *" $dir "*) ;;
2268 *) xrpath="$xrpath $dir" ;;
2269 esac
2270 fi
2271 deplibs="$deplib $deplibs"
2272 continue
2273 ;;
2274 *.la) lib="$deplib" ;;
2275 *.$libext)
2276 if test "$pass" = conv; then
2277 deplibs="$deplib $deplibs"
2278 continue
2279 fi
2280 case $linkmode in
2281 lib)
2282 valid_a_lib=no
2283 case $deplibs_check_method in
2284 match_pattern*)
2285 set dummy $deplibs_check_method
2286 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2287 if eval $echo \"$deplib\" 2>/dev/null \
2288 | $SED 10q \
2289 | $EGREP "$match_pattern_regex" > /dev/null; then
2290 valid_a_lib=yes
2291 fi
2292 ;;
2293 pass_all)
2294 valid_a_lib=yes
2295 ;;
2296 esac
2297 if test "$valid_a_lib" != yes; then
2298 $echo
2299 $echo "*** Warning: Trying to link with static lib archive $deplib."
2300 $echo "*** I have the capability to make that library automatically link in when"
2301 $echo "*** you link to this library. But I can only do this if you have a"
2302 $echo "*** shared version of the library, which you do not appear to have"
2303 $echo "*** because the file extensions .$libext of this argument makes me believe"
2304 $echo "*** that it is just a static archive that I should not used here."
2305 else
2306 $echo
2307 $echo "*** Warning: Linking the shared library $output against the"
2308 $echo "*** static library $deplib is not portable!"
2309 deplibs="$deplib $deplibs"
2310 fi
2311 continue
2312 ;;
2313 prog)
2314 if test "$pass" != link; then
2315 deplibs="$deplib $deplibs"
2316 else
2317 compile_deplibs="$deplib $compile_deplibs"
2318 finalize_deplibs="$deplib $finalize_deplibs"
2319 fi
2320 continue
2321 ;;
2322 esac # linkmode
2323 ;; # *.$libext
2324 *.lo | *.$objext)
2325 if test "$pass" = conv; then
2326 deplibs="$deplib $deplibs"
2327 elif test "$linkmode" = prog; then
2328 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2329 # If there is no dlopen support or we're linking statically,
2330 # we need to preload.
2331 newdlprefiles="$newdlprefiles $deplib"
2332 compile_deplibs="$deplib $compile_deplibs"
2333 finalize_deplibs="$deplib $finalize_deplibs"
2334 else
2335 newdlfiles="$newdlfiles $deplib"
2336 fi
2337 fi
2338 continue
2339 ;;
2340 %DEPLIBS%)
2341 alldeplibs=yes
2342 continue
2343 ;;
2344 esac # case $deplib
2345 if test "$found" = yes || test -f "$lib"; then :
2346 else
2347 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2348 exit $EXIT_FAILURE
2349 fi
2350
2351 # Check to see that this really is a libtool archive.
2352 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2353 else
2354 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2355 exit $EXIT_FAILURE
2356 fi
2357
2358 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2359 test "X$ladir" = "X$lib" && ladir="."
2360
2361 dlname=
2362 dlopen=
2363 dlpreopen=
2364 libdir=
2365 library_names=
2366 old_library=
2367 # If the library was installed with an old release of libtool,
2368 # it will not redefine variables installed, or shouldnotlink
2369 installed=yes
2370 shouldnotlink=no
2371 avoidtemprpath=
2372
2373
2374 # Read the .la file
2375 case $lib in
2376 */* | *\\*) . $lib ;;
2377 *) . ./$lib ;;
2378 esac
2379
2380 if test "$linkmode,$pass" = "lib,link" ||
2381 test "$linkmode,$pass" = "prog,scan" ||
2382 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2383 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2384 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2385 fi
2386
2387 if test "$pass" = conv; then
2388 # Only check for convenience libraries
2389 deplibs="$lib $deplibs"
2390 if test -z "$libdir"; then
2391 if test -z "$old_library"; then
2392 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2393 exit $EXIT_FAILURE
2394 fi
2395 # It is a libtool convenience library, so add in its objects.
2396 convenience="$convenience $ladir/$objdir/$old_library"
2397 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2398 tmp_libs=
2399 for deplib in $dependency_libs; do
2400 deplibs="$deplib $deplibs"
2401 if test "X$duplicate_deps" = "Xyes" ; then
2402 case "$tmp_libs " in
2403 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2404 esac
2405 fi
2406 tmp_libs="$tmp_libs $deplib"
2407 done
2408 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2409 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2410 exit $EXIT_FAILURE
2411 fi
2412 continue
2413 fi # $pass = conv
2414
2415
2416 # Get the name of the library we link against.
2417 linklib=
2418 for l in $old_library $library_names; do
2419 linklib="$l"
2420 done
2421 if test -z "$linklib"; then
2422 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2423 exit $EXIT_FAILURE
2424 fi
2425
2426 # This library was specified with -dlopen.
2427 if test "$pass" = dlopen; then
2428 if test -z "$libdir"; then
2429 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2430 exit $EXIT_FAILURE
2431 fi
2432 if test -z "$dlname" ||
2433 test "$dlopen_support" != yes ||
2434 test "$build_libtool_libs" = no; then
2435 # If there is no dlname, no dlopen support or we're linking
2436 # statically, we need to preload. We also need to preload any
2437 # dependent libraries so libltdl's deplib preloader doesn't
2438 # bomb out in the load deplibs phase.
2439 dlprefiles="$dlprefiles $lib $dependency_libs"
2440 else
2441 newdlfiles="$newdlfiles $lib"
2442 fi
2443 continue
2444 fi # $pass = dlopen
2445
2446 # We need an absolute path.
2447 case $ladir in
2448 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2449 *)
2450 abs_ladir=`cd "$ladir" && pwd`
2451 if test -z "$abs_ladir"; then
2452 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2453 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2454 abs_ladir="$ladir"
2455 fi
2456 ;;
2457 esac
2458 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2459
2460 # Find the relevant object directory and library name.
2461 if test "X$installed" = Xyes; then
2462 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2463 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2464 dir="$ladir"
2465 absdir="$abs_ladir"
2466 libdir="$abs_ladir"
2467 else
2468 dir="$libdir"
2469 absdir="$libdir"
2470 fi
2471 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2472 else
2473 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2474 dir="$ladir"
2475 absdir="$abs_ladir"
2476 # Remove this search path later
2477 notinst_path="$notinst_path $abs_ladir"
2478 else
2479 dir="$ladir/$objdir"
2480 absdir="$abs_ladir/$objdir"
2481 # Remove this search path later
2482 notinst_path="$notinst_path $abs_ladir"
2483 fi
2484 fi # $installed = yes
2485 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2486
2487 # This library was specified with -dlpreopen.
2488 if test "$pass" = dlpreopen; then
2489 if test -z "$libdir"; then
2490 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2491 exit $EXIT_FAILURE
2492 fi
2493 # Prefer using a static library (so that no silly _DYNAMIC symbols
2494 # are required to link).
2495 if test -n "$old_library"; then
2496 newdlprefiles="$newdlprefiles $dir/$old_library"
2497 # Otherwise, use the dlname, so that lt_dlopen finds it.
2498 elif test -n "$dlname"; then
2499 newdlprefiles="$newdlprefiles $dir/$dlname"
2500 else
2501 newdlprefiles="$newdlprefiles $dir/$linklib"
2502 fi
2503 fi # $pass = dlpreopen
2504
2505 if test -z "$libdir"; then
2506 # Link the convenience library
2507 if test "$linkmode" = lib; then
2508 deplibs="$dir/$old_library $deplibs"
2509 elif test "$linkmode,$pass" = "prog,link"; then
2510 compile_deplibs="$dir/$old_library $compile_deplibs"
2511 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2512 else
2513 deplibs="$lib $deplibs" # used for prog,scan pass
2514 fi
2515 continue
2516 fi
2517
2518
2519 if test "$linkmode" = prog && test "$pass" != link; then
2520 newlib_search_path="$newlib_search_path $ladir"
2521 deplibs="$lib $deplibs"
2522
2523 linkalldeplibs=no
2524 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2525 test "$build_libtool_libs" = no; then
2526 linkalldeplibs=yes
2527 fi
2528
2529 tmp_libs=
2530 for deplib in $dependency_libs; do
2531 case $deplib in
2532 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2533 esac
2534 # Need to link against all dependency_libs?
2535 if test "$linkalldeplibs" = yes; then
2536 deplibs="$deplib $deplibs"
2537 else
2538 # Need to hardcode shared library paths
2539 # or/and link against static libraries
2540 newdependency_libs="$deplib $newdependency_libs"
2541 fi
2542 if test "X$duplicate_deps" = "Xyes" ; then
2543 case "$tmp_libs " in
2544 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2545 esac
2546 fi
2547 tmp_libs="$tmp_libs $deplib"
2548 done # for deplib
2549 continue
2550 fi # $linkmode = prog...
2551
2552 if test "$linkmode,$pass" = "prog,link"; then
2553 if test -n "$library_names" &&
2554 { { test "$prefer_static_libs" = no ||
2555 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2556 test -z "$old_library"; }; then
2557 # We need to hardcode the library path
2558 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2559 # Make sure the rpath contains only unique directories.
2560 case "$temp_rpath " in
2561 *" $dir "*) ;;
2562 *" $absdir "*) ;;
2563 *) temp_rpath="$temp_rpath $absdir" ;;
2564 esac
2565 fi
2566
2567 # Hardcode the library path.
2568 # Skip directories that are in the system default run-time
2569 # search path.
2570 case " $sys_lib_dlsearch_path " in
2571 *" $absdir "*) ;;
2572 *)
2573 case "$compile_rpath " in
2574 *" $absdir "*) ;;
2575 *) compile_rpath="$compile_rpath $absdir"
2576 esac
2577 ;;
2578 esac
2579 case " $sys_lib_dlsearch_path " in
2580 *" $libdir "*) ;;
2581 *)
2582 case "$finalize_rpath " in
2583 *" $libdir "*) ;;
2584 *) finalize_rpath="$finalize_rpath $libdir"
2585 esac
2586 ;;
2587 esac
2588 fi # $linkmode,$pass = prog,link...
2589
2590 if test "$alldeplibs" = yes &&
2591 { test "$deplibs_check_method" = pass_all ||
2592 { test "$build_libtool_libs" = yes &&
2593 test -n "$library_names"; }; }; then
2594 # We only need to search for static libraries
2595 continue
2596 fi
2597 fi
2598
2599 link_static=no # Whether the deplib will be linked statically
2600 use_static_libs=$prefer_static_libs
2601 if test "$use_static_libs" = built && test "$installed" = yes ; then
2602 use_static_libs=no
2603 fi
2604 if test -n "$library_names" &&
2605 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2606 if test "$installed" = no; then
2607 notinst_deplibs="$notinst_deplibs $lib"
2608 need_relink=yes
2609 fi
2610 # This is a shared library
2611
2612 # Warn about portability, can't link against -module's on
2613 # some systems (darwin)
2614 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2615 $echo
2616 if test "$linkmode" = prog; then
2617 $echo "*** Warning: Linking the executable $output against the loadable module"
2618 else
2619 $echo "*** Warning: Linking the shared library $output against the loadable module"
2620 fi
2621 $echo "*** $linklib is not portable!"
2622 fi
2623 if test "$linkmode" = lib &&
2624 test "$hardcode_into_libs" = yes; then
2625 # Hardcode the library path.
2626 # Skip directories that are in the system default run-time
2627 # search path.
2628 case " $sys_lib_dlsearch_path " in
2629 *" $absdir "*) ;;
2630 *)
2631 case "$compile_rpath " in
2632 *" $absdir "*) ;;
2633 *) compile_rpath="$compile_rpath $absdir"
2634 esac
2635 ;;
2636 esac
2637 case " $sys_lib_dlsearch_path " in
2638 *" $libdir "*) ;;
2639 *)
2640 case "$finalize_rpath " in
2641 *" $libdir "*) ;;
2642 *) finalize_rpath="$finalize_rpath $libdir"
2643 esac
2644 ;;
2645 esac
2646 fi
2647
2648 if test -n "$old_archive_from_expsyms_cmds"; then
2649 # figure out the soname
2650 set dummy $library_names
2651 realname="$2"
2652 shift; shift
2653 libname=`eval \\$echo \"$libname_spec\"`
2654 # use dlname if we got it. it's perfectly good, no?
2655 if test -n "$dlname"; then
2656 soname="$dlname"
2657 elif test -n "$soname_spec"; then
2658 # bleh windows
2659 case $host in
2660 *cygwin* | mingw*)
2661 major=`expr $current - $age`
2662 versuffix="-$major"
2663 ;;
2664 esac
2665 eval soname=\"$soname_spec\"
2666 else
2667 soname="$realname"
2668 fi
2669
2670 # Make a new name for the extract_expsyms_cmds to use
2671 soroot="$soname"
2672 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2673 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2674
2675 # If the library has no export list, then create one now
2676 if test -f "$output_objdir/$soname-def"; then :
2677 else
2678 $show "extracting exported symbol list from \`$soname'"
2679 save_ifs="$IFS"; IFS='~'
2680 cmds=$extract_expsyms_cmds
2681 for cmd in $cmds; do
2682 IFS="$save_ifs"
2683 eval cmd=\"$cmd\"
2684 $show "$cmd"
2685 $run eval "$cmd" || exit $?
2686 done
2687 IFS="$save_ifs"
2688 fi
2689
2690 # Create $newlib
2691 if test -f "$output_objdir/$newlib"; then :; else
2692 $show "generating import library for \`$soname'"
2693 save_ifs="$IFS"; IFS='~'
2694 cmds=$old_archive_from_expsyms_cmds
2695 for cmd in $cmds; do
2696 IFS="$save_ifs"
2697 eval cmd=\"$cmd\"
2698 $show "$cmd"
2699 $run eval "$cmd" || exit $?
2700 done
2701 IFS="$save_ifs"
2702 fi
2703 # make sure the library variables are pointing to the new library
2704 dir=$output_objdir
2705 linklib=$newlib
2706 fi # test -n "$old_archive_from_expsyms_cmds"
2707
2708 if test "$linkmode" = prog || test "$mode" != relink; then
2709 add_shlibpath=
2710 add_dir=
2711 add=
2712 lib_linked=yes
2713 case $hardcode_action in
2714 immediate | unsupported)
2715 if test "$hardcode_direct" = no; then
2716 add="$dir/$linklib"
2717 case $host in
2718 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2719 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
2720 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2721 *-*-unixware7*) add_dir="-L$dir" ;;
2722 *-*-darwin* )
2723 # if the lib is a module then we can not link against
2724 # it, someone is ignoring the new warnings I added
2725 if /usr/bin/file -L $add 2> /dev/null |
2726 $EGREP ": [^:]* bundle" >/dev/null ; then
2727 $echo "** Warning, lib $linklib is a module, not a shared library"
2728 if test -z "$old_library" ; then
2729 $echo
2730 $echo "** And there doesn't seem to be a static archive available"
2731 $echo "** The link will probably fail, sorry"
2732 else
2733 add="$dir/$old_library"
2734 fi
2735 fi
2736 esac
2737 elif test "$hardcode_minus_L" = no; then
2738 case $host in
2739 *-*-sunos*) add_shlibpath="$dir" ;;
2740 esac
2741 add_dir="-L$dir"
2742 add="-l$name"
2743 elif test "$hardcode_shlibpath_var" = no; then
2744 add_shlibpath="$dir"
2745 add="-l$name"
2746 else
2747 lib_linked=no
2748 fi
2749 ;;
2750 relink)
2751 if test "$hardcode_direct" = yes; then
2752 add="$dir/$linklib"
2753 elif test "$hardcode_minus_L" = yes; then
2754 add_dir="-L$dir"
2755 # Try looking first in the location we're being installed to.
2756 if test -n "$inst_prefix_dir"; then
2757 case $libdir in
2758 [\\/]*)
2759 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2760 ;;
2761 esac
2762 fi
2763 add="-l$name"
2764 elif test "$hardcode_shlibpath_var" = yes; then
2765 add_shlibpath="$dir"
2766 add="-l$name"
2767 else
2768 lib_linked=no
2769 fi
2770 ;;
2771 *) lib_linked=no ;;
2772 esac
2773
2774 if test "$lib_linked" != yes; then
2775 $echo "$modename: configuration error: unsupported hardcode properties"
2776 exit $EXIT_FAILURE
2777 fi
2778
2779 if test -n "$add_shlibpath"; then
2780 case :$compile_shlibpath: in
2781 *":$add_shlibpath:"*) ;;
2782 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2783 esac
2784 fi
2785 if test "$linkmode" = prog; then
2786 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2787 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2788 else
2789 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2790 test -n "$add" && deplibs="$add $deplibs"
2791 if test "$hardcode_direct" != yes && \
2792 test "$hardcode_minus_L" != yes && \
2793 test "$hardcode_shlibpath_var" = yes; then
2794 case :$finalize_shlibpath: in
2795 *":$libdir:"*) ;;
2796 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2797 esac
2798 fi
2799 fi
2800 fi
2801
2802 if test "$linkmode" = prog || test "$mode" = relink; then
2803 add_shlibpath=
2804 add_dir=
2805 add=
2806 # Finalize command for both is simple: just hardcode it.
2807 if test "$hardcode_direct" = yes; then
2808 add="$libdir/$linklib"
2809 elif test "$hardcode_minus_L" = yes; then
2810 add_dir="-L$libdir"
2811 add="-l$name"
2812 elif test "$hardcode_shlibpath_var" = yes; then
2813 case :$finalize_shlibpath: in
2814 *":$libdir:"*) ;;
2815 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2816 esac
2817 add="-l$name"
2818 elif test "$hardcode_automatic" = yes; then
2819 if test -n "$inst_prefix_dir" &&
2820 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2821 add="$inst_prefix_dir$libdir/$linklib"
2822 else
2823 add="$libdir/$linklib"
2824 fi
2825 else
2826 # We cannot seem to hardcode it, guess we'll fake it.
2827 add_dir="-L$libdir"
2828 # Try looking first in the location we're being installed to.
2829 if test -n "$inst_prefix_dir"; then
2830 case $libdir in
2831 [\\/]*)
2832 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2833 ;;
2834 esac
2835 fi
2836 add="-l$name"
2837 fi
2838
2839 if test "$linkmode" = prog; then
2840 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2841 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2842 else
2843 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2844 test -n "$add" && deplibs="$add $deplibs"
2845 fi
2846 fi
2847 elif test "$linkmode" = prog; then
2848 # Here we assume that one of hardcode_direct or hardcode_minus_L
2849 # is not unsupported. This is valid on all known static and
2850 # shared platforms.
2851 if test "$hardcode_direct" != unsupported; then
2852 test -n "$old_library" && linklib="$old_library"
2853 compile_deplibs="$dir/$linklib $compile_deplibs"
2854 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2855 else
2856 compile_deplibs="-l$name -L$dir $compile_deplibs"
2857 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2858 fi
2859 elif test "$build_libtool_libs" = yes; then
2860 # Not a shared library
2861 if test "$deplibs_check_method" != pass_all; then
2862 # We're trying link a shared library against a static one
2863 # but the system doesn't support it.
2864
2865 # Just print a warning and add the library to dependency_libs so
2866 # that the program can be linked against the static library.
2867 $echo
2868 $echo "*** Warning: This system can not link to static lib archive $lib."
2869 $echo "*** I have the capability to make that library automatically link in when"
2870 $echo "*** you link to this library. But I can only do this if you have a"
2871 $echo "*** shared version of the library, which you do not appear to have."
2872 if test "$module" = yes; then
2873 $echo "*** But as you try to build a module library, libtool will still create "
2874 $echo "*** a static module, that should work as long as the dlopening application"
2875 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2876 if test -z "$global_symbol_pipe"; then
2877 $echo
2878 $echo "*** However, this would only work if libtool was able to extract symbol"
2879 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2880 $echo "*** not find such a program. So, this module is probably useless."
2881 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2882 fi
2883 if test "$build_old_libs" = no; then
2884 build_libtool_libs=module
2885 build_old_libs=yes
2886 else
2887 build_libtool_libs=no
2888 fi
2889 fi
2890 else
2891 deplibs="$dir/$old_library $deplibs"
2892 link_static=yes
2893 fi
2894 fi # link shared/static library?
2895
2896 if test "$linkmode" = lib; then
2897 if test -n "$dependency_libs" &&
2898 { test "$hardcode_into_libs" != yes ||
2899 test "$build_old_libs" = yes ||
2900 test "$link_static" = yes; }; then
2901 # Extract -R from dependency_libs
2902 temp_deplibs=
2903 for libdir in $dependency_libs; do
2904 case $libdir in
2905 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2906 case " $xrpath " in
2907 *" $temp_xrpath "*) ;;
2908 *) xrpath="$xrpath $temp_xrpath";;
2909 esac;;
2910 *) temp_deplibs="$temp_deplibs $libdir";;
2911 esac
2912 done
2913 dependency_libs="$temp_deplibs"
2914 fi
2915
2916 newlib_search_path="$newlib_search_path $absdir"
2917 # Link against this library
2918 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2919 # ... and its dependency_libs
2920 tmp_libs=
2921 for deplib in $dependency_libs; do
2922 newdependency_libs="$deplib $newdependency_libs"
2923 if test "X$duplicate_deps" = "Xyes" ; then
2924 case "$tmp_libs " in
2925 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2926 esac
2927 fi
2928 tmp_libs="$tmp_libs $deplib"
2929 done
2930
2931 if test "$link_all_deplibs" != no; then
2932 # Add the search paths of all dependency libraries
2933 for deplib in $dependency_libs; do
2934 case $deplib in
2935 -L*) path="$deplib" ;;
2936 *.la)
2937 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2938 test "X$dir" = "X$deplib" && dir="."
2939 # We need an absolute path.
2940 case $dir in
2941 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2942 *)
2943 absdir=`cd "$dir" && pwd`
2944 if test -z "$absdir"; then
2945 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2946 absdir="$dir"
2947 fi
2948 ;;
2949 esac
2950 if grep "^installed=no" $deplib > /dev/null; then
2951 path="$absdir/$objdir"
2952 else
2953 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2954 if test -z "$libdir"; then
2955 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2956 exit $EXIT_FAILURE
2957 fi
2958 if test "$absdir" != "$libdir"; then
2959 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2960 fi
2961 path="$absdir"
2962 fi
2963 depdepl=
2964 case $host in
2965 *-*-darwin*)
2966 # we do not want to link against static libs,
2967 # but need to link against shared
2968 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2969 eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2970 if test -n "$deplibrary_names" ; then
2971 for tmp in $deplibrary_names ; do
2972 depdepl=$tmp
2973 done
2974 if test -f "$deplibdir/$depdepl" ; then
2975 depdepl="$deplibdir/$depdepl"
2976 elif test -f "$path/$depdepl" ; then
2977 depdepl="$path/$depdepl"
2978 else
2979 # Can't find it, oh well...
2980 depdepl=
2981 fi
2982 # do not add paths which are already there
2983 case " $newlib_search_path " in
2984 *" $path "*) ;;
2985 *) newlib_search_path="$newlib_search_path $path";;
2986 esac
2987 fi
2988 path=""
2989 ;;
2990 *)
2991 path="-L$path"
2992 ;;
2993 esac
2994 ;;
2995 -l*)
2996 case $host in
2997 *-*-darwin*)
2998 # Again, we only want to link against shared libraries
2999 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3000 for tmp in $newlib_search_path ; do
3001 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3002 eval depdepl="$tmp/lib$tmp_libs.dylib"
3003 break
3004 fi
3005 done
3006 path=""
3007 ;;
3008 *) continue ;;
3009 esac
3010 ;;
3011 *) continue ;;
3012 esac
3013 case " $deplibs " in
3014 *" $path "*) ;;
3015 *) deplibs="$path $deplibs" ;;
3016 esac
3017 case " $deplibs " in
3018 *" $depdepl "*) ;;
3019 *) deplibs="$depdepl $deplibs" ;;
3020 esac
3021 done
3022 fi # link_all_deplibs != no
3023 fi # linkmode = lib
3024 done # for deplib in $libs
3025 dependency_libs="$newdependency_libs"
3026 if test "$pass" = dlpreopen; then
3027 # Link the dlpreopened libraries before other libraries
3028 for deplib in $save_deplibs; do
3029 deplibs="$deplib $deplibs"
3030 done
3031 fi
3032 if test "$pass" != dlopen; then
3033 if test "$pass" != conv; then
3034 # Make sure lib_search_path contains only unique directories.
3035 lib_search_path=
3036 for dir in $newlib_search_path; do
3037 case "$lib_search_path " in
3038 *" $dir "*) ;;
3039 *) lib_search_path="$lib_search_path $dir" ;;
3040 esac
3041 done
3042 newlib_search_path=
3043 fi
3044
3045 if test "$linkmode,$pass" != "prog,link"; then
3046 vars="deplibs"
3047 else
3048 vars="compile_deplibs finalize_deplibs"
3049 fi
3050 for var in $vars dependency_libs; do
3051 # Add libraries to $var in reverse order
3052 eval tmp_libs=\"\$$var\"
3053 new_libs=
3054 for deplib in $tmp_libs; do
3055 # FIXME: Pedantically, this is the right thing to do, so
3056 # that some nasty dependency loop isn't accidentally
3057 # broken:
3058 #new_libs="$deplib $new_libs"
3059 # Pragmatically, this seems to cause very few problems in
3060 # practice:
3061 case $deplib in
3062 -L*) new_libs="$deplib $new_libs" ;;
3063 -R*) ;;
3064 *)
3065 # And here is the reason: when a library appears more
3066 # than once as an explicit dependence of a library, or
3067 # is implicitly linked in more than once by the
3068 # compiler, it is considered special, and multiple
3069 # occurrences thereof are not removed. Compare this
3070 # with having the same library being listed as a
3071 # dependency of multiple other libraries: in this case,
3072 # we know (pedantically, we assume) the library does not
3073 # need to be listed more than once, so we keep only the
3074 # last copy. This is not always right, but it is rare
3075 # enough that we require users that really mean to play
3076 # such unportable linking tricks to link the library
3077 # using -Wl,-lname, so that libtool does not consider it
3078 # for duplicate removal.
3079 case " $specialdeplibs " in
3080 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3081 *)
3082 case " $new_libs " in
3083 *" $deplib "*) ;;
3084 *) new_libs="$deplib $new_libs" ;;
3085 esac
3086 ;;
3087 esac
3088 ;;
3089 esac
3090 done
3091 tmp_libs=
3092 for deplib in $new_libs; do
3093 case $deplib in
3094 -L*)
3095 case " $tmp_libs " in
3096 *" $deplib "*) ;;
3097 *) tmp_libs="$tmp_libs $deplib" ;;
3098 esac
3099 ;;
3100 *) tmp_libs="$tmp_libs $deplib" ;;
3101 esac
3102 done
3103 eval $var=\"$tmp_libs\"
3104 done # for var
3105 fi
3106 # Last step: remove runtime libs from dependency_libs
3107 # (they stay in deplibs)
3108 tmp_libs=
3109 for i in $dependency_libs ; do
3110 case " $predeps $postdeps $compiler_lib_search_path " in
3111 *" $i "*)
3112 i=""
3113 ;;
3114 esac
3115 if test -n "$i" ; then
3116 tmp_libs="$tmp_libs $i"
3117 fi
3118 done
3119 dependency_libs=$tmp_libs
3120 done # for pass
3121 if test "$linkmode" = prog; then
3122 dlfiles="$newdlfiles"
3123 dlprefiles="$newdlprefiles"
3124 fi
3125
3126 case $linkmode in
3127 oldlib)
3128 case " $deplibs" in
3129 *\ -l* | *\ -L*)
3130 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3131 esac
3132
3133 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3134 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3135 fi
3136
3137 if test -n "$rpath"; then
3138 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3139 fi
3140
3141 if test -n "$xrpath"; then
3142 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3143 fi
3144
3145 if test -n "$vinfo"; then
3146 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3147 fi
3148
3149 if test -n "$release"; then
3150 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3151 fi
3152
3153 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3154 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3155 fi
3156
3157 # Now set the variables for building old libraries.
3158 build_libtool_libs=no
3159 oldlibs="$output"
3160 objs="$objs$old_deplibs"
3161 ;;
3162
3163 lib)
3164 # Make sure we only generate libraries of the form `libNAME.la'.
3165 case $outputname in
3166 lib*)
3167 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3168 eval shared_ext=\"$shrext_cmds\"
3169 eval libname=\"$libname_spec\"
3170 ;;
3171 *)
3172 if test "$module" = no; then
3173 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3174 $echo "$help" 1>&2
3175 exit $EXIT_FAILURE
3176 fi
3177 if test "$need_lib_prefix" != no; then
3178 # Add the "lib" prefix for modules if required
3179 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3180 eval shared_ext=\"$shrext_cmds\"
3181 eval libname=\"$libname_spec\"
3182 else
3183 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3184 fi
3185 ;;
3186 esac
3187
3188 if test -n "$objs"; then
3189 if test "$deplibs_check_method" != pass_all; then
3190 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3191 exit $EXIT_FAILURE
3192 else
3193 $echo
3194 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3195 $echo "*** objects $objs is not portable!"
3196 libobjs="$libobjs $objs"
3197 fi
3198 fi
3199
3200 if test "$dlself" != no; then
3201 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3202 fi
3203
3204 set dummy $rpath
3205 if test "$#" -gt 2; then
3206 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3207 fi
3208 install_libdir="$2"
3209
3210 oldlibs=
3211 if test -z "$rpath"; then
3212 if test "$build_libtool_libs" = yes; then
3213 # Building a libtool convenience library.
3214 # Some compilers have problems with a `.al' extension so
3215 # convenience libraries should have the same extension an
3216 # archive normally would.
3217 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3218 build_libtool_libs=convenience
3219 build_old_libs=yes
3220 fi
3221
3222 if test -n "$vinfo"; then
3223 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3224 fi
3225
3226 if test -n "$release"; then
3227 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3228 fi
3229 else
3230
3231 # Parse the version information argument.
3232 save_ifs="$IFS"; IFS=':'
3233 set dummy $vinfo 0 0 0
3234 IFS="$save_ifs"
3235
3236 if test -n "$8"; then
3237 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3238 $echo "$help" 1>&2
3239 exit $EXIT_FAILURE
3240 fi
3241
3242 # convert absolute version numbers to libtool ages
3243 # this retains compatibility with .la files and attempts
3244 # to make the code below a bit more comprehensible
3245
3246 case $vinfo_number in
3247 yes)
3248 number_major="$2"
3249 number_minor="$3"
3250 number_revision="$4"
3251 #
3252 # There are really only two kinds -- those that
3253 # use the current revision as the major version
3254 # and those that subtract age and use age as
3255 # a minor version. But, then there is irix
3256 # which has an extra 1 added just for fun
3257 #
3258 case $version_type in
3259 darwin|linux|osf|windows|none)
3260 current=`expr $number_major + $number_minor`
3261 age="$number_minor"
3262 revision="$number_revision"
3263 ;;
3264 freebsd-aout|freebsd-elf|sunos)
3265 current="$number_major"
3266 revision="$number_minor"
3267 age="0"
3268 ;;
3269 irix|nonstopux)
3270 current=`expr $number_major + $number_minor`
3271 age="$number_minor"
3272 revision="$number_minor"
3273 lt_irix_increment=no
3274 ;;
3275 *)
3276 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3277 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3278 exit $EXIT_FAILURE
3279 ;;
3280 esac
3281 ;;
3282 no)
3283 current="$2"
3284 revision="$3"
3285 age="$4"
3286 ;;
3287 esac
3288
3289 # Check that each of the things are valid numbers.
3290 case $current in
3291 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]) ;;
3292 *)
3293 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3294 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3295 exit $EXIT_FAILURE
3296 ;;
3297 esac
3298
3299 case $revision in
3300 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]) ;;
3301 *)
3302 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3303 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3304 exit $EXIT_FAILURE
3305 ;;
3306 esac
3307
3308 case $age in
3309 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]) ;;
3310 *)
3311 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3312 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3313 exit $EXIT_FAILURE
3314 ;;
3315 esac
3316
3317 if test "$age" -gt "$current"; then
3318 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3319 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3320 exit $EXIT_FAILURE
3321 fi
3322
3323 # Calculate the version variables.
3324 major=
3325 versuffix=
3326 verstring=
3327 case $version_type in
3328 none) ;;
3329
3330 darwin)
3331 # Like Linux, but with the current version available in
3332 # verstring for coding it into the library header
3333 major=.`expr $current - $age`
3334 versuffix="$major.$age.$revision"
3335 # Darwin ld doesn't like 0 for these options...
3336 minor_current=`expr $current + 1`
3337 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3338 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3339 ;;
3340
3341 freebsd-aout)
3342 major=".$current"
3343 versuffix=".$current.$revision";
3344 ;;
3345
3346 freebsd-elf)
3347 major=".$current"
3348 versuffix=".$current";
3349 ;;
3350
3351 irix | nonstopux)
3352 if test "X$lt_irix_increment" = "Xno"; then
3353 major=`expr $current - $age`
3354 else
3355 major=`expr $current - $age + 1`
3356 fi
3357 case $version_type in
3358 nonstopux) verstring_prefix=nonstopux ;;
3359 *) verstring_prefix=sgi ;;
3360 esac
3361 verstring="$verstring_prefix$major.$revision"
3362
3363 # Add in all the interfaces that we are compatible with.
3364 loop=$revision
3365 while test "$loop" -ne 0; do
3366 iface=`expr $revision - $loop`
3367 loop=`expr $loop - 1`
3368 verstring="$verstring_prefix$major.$iface:$verstring"
3369 done
3370
3371 # Before this point, $major must not contain `.'.
3372 major=.$major
3373 versuffix="$major.$revision"
3374 ;;
3375
3376 linux)
3377 major=.`expr $current - $age`
3378 versuffix="$major.$age.$revision"
3379 ;;
3380
3381 osf)
3382 major=.`expr $current - $age`
3383 versuffix=".$current.$age.$revision"
3384 verstring="$current.$age.$revision"
3385
3386 # Add in all the interfaces that we are compatible with.
3387 loop=$age
3388 while test "$loop" -ne 0; do
3389 iface=`expr $current - $loop`
3390 loop=`expr $loop - 1`
3391 verstring="$verstring:${iface}.0"
3392 done
3393
3394 # Make executables depend on our current version.
3395 verstring="$verstring:${current}.0"
3396 ;;
3397
3398 sunos)
3399 major=".$current"
3400 versuffix=".$current.$revision"
3401 ;;
3402
3403 windows)
3404 # Use '-' rather than '.', since we only want one
3405 # extension on DOS 8.3 filesystems.
3406 major=`expr $current - $age`
3407 versuffix="-$major"
3408 ;;
3409
3410 *)
3411 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3412 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3413 exit $EXIT_FAILURE
3414 ;;
3415 esac
3416
3417 # Clear the version info if we defaulted, and they specified a release.
3418 if test -z "$vinfo" && test -n "$release"; then
3419 major=
3420 case $version_type in
3421 darwin)
3422 # we can't check for "0.0" in archive_cmds due to quoting
3423 # problems, so we reset it completely
3424 verstring=
3425 ;;
3426 *)
3427 verstring="0.0"
3428 ;;
3429 esac
3430 if test "$need_version" = no; then
3431 versuffix=
3432 else
3433 versuffix=".0.0"
3434 fi
3435 fi
3436
3437 # Remove version info from name if versioning should be avoided
3438 if test "$avoid_version" = yes && test "$need_version" = no; then
3439 major=
3440 versuffix=
3441 verstring=""
3442 fi
3443
3444 # Check to see if the archive will have undefined symbols.
3445 if test "$allow_undefined" = yes; then
3446 if test "$allow_undefined_flag" = unsupported; then
3447 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3448 build_libtool_libs=no
3449 build_old_libs=yes
3450 fi
3451 else
3452 # Don't allow undefined symbols.
3453 allow_undefined_flag="$no_undefined_flag"
3454 fi
3455 fi
3456
3457 if test "$mode" != relink; then
3458 # Remove our outputs, but don't remove object files since they
3459 # may have been created when compiling PIC objects.
3460 removelist=
3461 tempremovelist=`$echo "$output_objdir/*"`
3462 for p in $tempremovelist; do
3463 case $p in
3464 *.$objext)
3465 ;;
3466 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3467 if test "X$precious_files_regex" != "X"; then
3468 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3469 then
3470 continue
3471 fi
3472 fi
3473 removelist="$removelist $p"
3474 ;;
3475 *) ;;
3476 esac
3477 done
3478 if test -n "$removelist"; then
3479 $show "${rm}r $removelist"
3480 $run ${rm}r $removelist
3481 fi
3482 fi
3483
3484 # Now set the variables for building old libraries.
3485 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3486 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3487
3488 # Transform .lo files to .o files.
3489 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3490 fi
3491
3492 # Eliminate all temporary directories.
3493 #for path in $notinst_path; do
3494 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3495 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3496 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3497 #done
3498
3499 if test -n "$xrpath"; then
3500 # If the user specified any rpath flags, then add them.
3501 temp_xrpath=
3502 for libdir in $xrpath; do
3503 temp_xrpath="$temp_xrpath -R$libdir"
3504 case "$finalize_rpath " in
3505 *" $libdir "*) ;;
3506 *) finalize_rpath="$finalize_rpath $libdir" ;;
3507 esac
3508 done
3509 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3510 dependency_libs="$temp_xrpath $dependency_libs"
3511 fi
3512 fi
3513
3514 # Make sure dlfiles contains only unique files that won't be dlpreopened
3515 old_dlfiles="$dlfiles"
3516 dlfiles=
3517 for lib in $old_dlfiles; do
3518 case " $dlprefiles $dlfiles " in
3519 *" $lib "*) ;;
3520 *) dlfiles="$dlfiles $lib" ;;
3521 esac
3522 done
3523
3524 # Make sure dlprefiles contains only unique files
3525 old_dlprefiles="$dlprefiles"
3526 dlprefiles=
3527 for lib in $old_dlprefiles; do
3528 case "$dlprefiles " in
3529 *" $lib "*) ;;
3530 *) dlprefiles="$dlprefiles $lib" ;;
3531 esac
3532 done
3533
3534 if test "$build_libtool_libs" = yes; then
3535 if test -n "$rpath"; then
3536 case $host in
3537 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3538 # these systems don't actually have a c library (as such)!
3539 ;;
3540 *-*-rhapsody* | *-*-darwin1.[012])
3541 # Rhapsody C library is in the System framework
3542 deplibs="$deplibs -framework System"
3543 ;;
3544 *-*-netbsd*)
3545 # Don't link with libc until the a.out ld.so is fixed.
3546 ;;
3547 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3548 # Do not include libc due to us having libc/libc_r.
3549 ;;
3550 *-*-sco3.2v5* | *-*-sco5v6*)
3551 # Causes problems with __ctype
3552 ;;
3553 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3554 # Compiler inserts libc in the correct place for threads to work
3555 ;;
3556 *)
3557 # Add libc to deplibs on all other systems if necessary.
3558 if test "$build_libtool_need_lc" = "yes"; then
3559 deplibs="$deplibs -lc"
3560 fi
3561 ;;
3562 esac
3563 fi
3564
3565 # Transform deplibs into only deplibs that can be linked in shared.
3566 name_save=$name
3567 libname_save=$libname
3568 release_save=$release
3569 versuffix_save=$versuffix
3570 major_save=$major
3571 # I'm not sure if I'm treating the release correctly. I think
3572 # release should show up in the -l (ie -lgmp5) so we don't want to
3573 # add it in twice. Is that correct?
3574 release=""
3575 versuffix=""
3576 major=""
3577 newdeplibs=
3578 droppeddeps=no
3579 case $deplibs_check_method in
3580 pass_all)
3581 # Don't check for shared/static. Everything works.
3582 # This might be a little naive. We might want to check
3583 # whether the library exists or not. But this is on
3584 # osf3 & osf4 and I'm not really sure... Just
3585 # implementing what was already the behavior.
3586 newdeplibs=$deplibs
3587 ;;
3588 test_compile)
3589 # This code stresses the "libraries are programs" paradigm to its
3590 # limits. Maybe even breaks it. We compile a program, linking it
3591 # against the deplibs as a proxy for the library. Then we can check
3592 # whether they linked in statically or dynamically with ldd.
3593 $rm conftest.c
3594 cat > conftest.c <<EOF
3595 int main() { return 0; }
3596EOF
3597 $rm conftest
3598 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3599 ldd_output=`ldd conftest`
3600 for i in $deplibs; do
3601 name=`expr $i : '-l\(.*\)'`
3602 # If $name is empty we are operating on a -L argument.
3603 if test "$name" != "" && test "$name" != "0"; then
3604 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3605 case " $predeps $postdeps " in
3606 *" $i "*)
3607 newdeplibs="$newdeplibs $i"
3608 i=""
3609 ;;
3610 esac
3611 fi
3612 if test -n "$i" ; then
3613 libname=`eval \\$echo \"$libname_spec\"`
3614 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3615 set dummy $deplib_matches
3616 deplib_match=$2
3617 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3618 newdeplibs="$newdeplibs $i"
3619 else
3620 droppeddeps=yes
3621 $echo
3622 $echo "*** Warning: dynamic linker does not accept needed library $i."
3623 $echo "*** I have the capability to make that library automatically link in when"
3624 $echo "*** you link to this library. But I can only do this if you have a"
3625 $echo "*** shared version of the library, which I believe you do not have"
3626 $echo "*** because a test_compile did reveal that the linker did not use it for"
3627 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3628 fi
3629 fi
3630 else
3631 newdeplibs="$newdeplibs $i"
3632 fi
3633 done
3634 else
3635 # Error occurred in the first compile. Let's try to salvage
3636 # the situation: Compile a separate program for each library.
3637 for i in $deplibs; do
3638 name=`expr $i : '-l\(.*\)'`
3639 # If $name is empty we are operating on a -L argument.
3640 if test "$name" != "" && test "$name" != "0"; then
3641 $rm conftest
3642 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3643 ldd_output=`ldd conftest`
3644 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3645 case " $predeps $postdeps " in
3646 *" $i "*)
3647 newdeplibs="$newdeplibs $i"
3648 i=""
3649 ;;
3650 esac
3651 fi
3652 if test -n "$i" ; then
3653 libname=`eval \\$echo \"$libname_spec\"`
3654 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3655 set dummy $deplib_matches
3656 deplib_match=$2
3657 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3658 newdeplibs="$newdeplibs $i"
3659 else
3660 droppeddeps=yes
3661 $echo
3662 $echo "*** Warning: dynamic linker does not accept needed library $i."
3663 $echo "*** I have the capability to make that library automatically link in when"
3664 $echo "*** you link to this library. But I can only do this if you have a"
3665 $echo "*** shared version of the library, which you do not appear to have"
3666 $echo "*** because a test_compile did reveal that the linker did not use this one"
3667 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3668 fi
3669 fi
3670 else
3671 droppeddeps=yes
3672 $echo
3673 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3674 $echo "*** make it link in! You will probably need to install it or some"
3675 $echo "*** library that it depends on before this library will be fully"
3676 $echo "*** functional. Installing it before continuing would be even better."
3677 fi
3678 else
3679 newdeplibs="$newdeplibs $i"
3680 fi
3681 done
3682 fi
3683 ;;
3684 file_magic*)
3685 set dummy $deplibs_check_method
3686 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3687 for a_deplib in $deplibs; do
3688 name=`expr $a_deplib : '-l\(.*\)'`
3689 # If $name is empty we are operating on a -L argument.
3690 if test "$name" != "" && test "$name" != "0"; then
3691 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3692 case " $predeps $postdeps " in
3693 *" $a_deplib "*)
3694 newdeplibs="$newdeplibs $a_deplib"
3695 a_deplib=""
3696 ;;
3697 esac
3698 fi
3699 if test -n "$a_deplib" ; then
3700 libname=`eval \\$echo \"$libname_spec\"`
3701 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3702 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3703 for potent_lib in $potential_libs; do
3704 # Follow soft links.
3705 if ls -lLd "$potent_lib" 2>/dev/null \
3706 | grep " -> " >/dev/null; then
3707 continue
3708 fi
3709 # The statement above tries to avoid entering an
3710 # endless loop below, in case of cyclic links.
3711 # We might still enter an endless loop, since a link
3712 # loop can be closed while we follow links,
3713 # but so what?
3714 potlib="$potent_lib"
3715 while test -h "$potlib" 2>/dev/null; do
3716 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3717 case $potliblink in
3718 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3719 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3720 esac
3721 done
3722 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3723 | ${SED} 10q \
3724 | $EGREP "$file_magic_regex" > /dev/null; then
3725 newdeplibs="$newdeplibs $a_deplib"
3726 a_deplib=""
3727 break 2
3728 fi
3729 done
3730 done
3731 fi
3732 if test -n "$a_deplib" ; then
3733 droppeddeps=yes
3734 $echo
3735 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3736 $echo "*** I have the capability to make that library automatically link in when"
3737 $echo "*** you link to this library. But I can only do this if you have a"
3738 $echo "*** shared version of the library, which you do not appear to have"
3739 $echo "*** because I did check the linker path looking for a file starting"
3740 if test -z "$potlib" ; then
3741 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3742 else
3743 $echo "*** with $libname and none of the candidates passed a file format test"
3744 $echo "*** using a file magic. Last file checked: $potlib"
3745 fi
3746 fi
3747 else
3748 # Add a -L argument.
3749 newdeplibs="$newdeplibs $a_deplib"
3750 fi
3751 done # Gone through all deplibs.
3752 ;;
3753 match_pattern*)
3754 set dummy $deplibs_check_method
3755 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3756 for a_deplib in $deplibs; do
3757 name=`expr $a_deplib : '-l\(.*\)'`
3758 # If $name is empty we are operating on a -L argument.
3759 if test -n "$name" && test "$name" != "0"; then
3760 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3761 case " $predeps $postdeps " in
3762 *" $a_deplib "*)
3763 newdeplibs="$newdeplibs $a_deplib"
3764 a_deplib=""
3765 ;;
3766 esac
3767 fi
3768 if test -n "$a_deplib" ; then
3769 libname=`eval \\$echo \"$libname_spec\"`
3770 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3771 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3772 for potent_lib in $potential_libs; do
3773 potlib="$potent_lib" # see symlink-check above in file_magic test
3774 if eval $echo \"$potent_lib\" 2>/dev/null \
3775 | ${SED} 10q \
3776 | $EGREP "$match_pattern_regex" > /dev/null; then
3777 newdeplibs="$newdeplibs $a_deplib"
3778 a_deplib=""
3779 break 2
3780 fi
3781 done
3782 done
3783 fi
3784 if test -n "$a_deplib" ; then
3785 droppeddeps=yes
3786 $echo
3787 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3788 $echo "*** I have the capability to make that library automatically link in when"
3789 $echo "*** you link to this library. But I can only do this if you have a"
3790 $echo "*** shared version of the library, which you do not appear to have"
3791 $echo "*** because I did check the linker path looking for a file starting"
3792 if test -z "$potlib" ; then
3793 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3794 else
3795 $echo "*** with $libname and none of the candidates passed a file format test"
3796 $echo "*** using a regex pattern. Last file checked: $potlib"
3797 fi
3798 fi
3799 else
3800 # Add a -L argument.
3801 newdeplibs="$newdeplibs $a_deplib"
3802 fi
3803 done # Gone through all deplibs.
3804 ;;
3805 none | unknown | *)
3806 newdeplibs=""
3807 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3808 -e 's/ -[LR][^ ]*//g'`
3809 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3810 for i in $predeps $postdeps ; do
3811 # can't use Xsed below, because $i might contain '/'
3812 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3813 done
3814 fi
3815 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3816 | grep . >/dev/null; then
3817 $echo
3818 if test "X$deplibs_check_method" = "Xnone"; then
3819 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3820 else
3821 $echo "*** Warning: inter-library dependencies are not known to be supported."
3822 fi
3823 $echo "*** All declared inter-library dependencies are being dropped."
3824 droppeddeps=yes
3825 fi
3826 ;;
3827 esac
3828 versuffix=$versuffix_save
3829 major=$major_save
3830 release=$release_save
3831 libname=$libname_save
3832 name=$name_save
3833
3834 case $host in
3835 *-*-rhapsody* | *-*-darwin1.[012])
3836 # On Rhapsody replace the C library is the System framework
3837 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3838 ;;
3839 esac
3840
3841 if test "$droppeddeps" = yes; then
3842 if test "$module" = yes; then
3843 $echo
3844 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3845 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3846 $echo "*** a static module, that should work as long as the dlopening"
3847 $echo "*** application is linked with the -dlopen flag."
3848 if test -z "$global_symbol_pipe"; then
3849 $echo
3850 $echo "*** However, this would only work if libtool was able to extract symbol"
3851 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3852 $echo "*** not find such a program. So, this module is probably useless."
3853 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3854 fi
3855 if test "$build_old_libs" = no; then
3856 oldlibs="$output_objdir/$libname.$libext"
3857 build_libtool_libs=module
3858 build_old_libs=yes
3859 else
3860 build_libtool_libs=no
3861 fi
3862 else
3863 $echo "*** The inter-library dependencies that have been dropped here will be"
3864 $echo "*** automatically added whenever a program is linked with this library"
3865 $echo "*** or is declared to -dlopen it."
3866
3867 if test "$allow_undefined" = no; then
3868 $echo
3869 $echo "*** Since this library must not contain undefined symbols,"
3870 $echo "*** because either the platform does not support them or"
3871 $echo "*** it was explicitly requested with -no-undefined,"
3872 $echo "*** libtool will only create a static version of it."
3873 if test "$build_old_libs" = no; then
3874 oldlibs="$output_objdir/$libname.$libext"
3875 build_libtool_libs=module
3876 build_old_libs=yes
3877 else
3878 build_libtool_libs=no
3879 fi
3880 fi
3881 fi
3882 fi
3883 # Done checking deplibs!
3884 deplibs=$newdeplibs
3885 fi
3886
3887
3888 # move library search paths that coincide with paths to not yet
3889 # installed libraries to the beginning of the library search list
3890 new_libs=
3891 for path in $notinst_path; do
3892 case " $new_libs " in
3893 *" -L$path/$objdir "*) ;;
3894 *)
3895 case " $deplibs " in
3896 *" -L$path/$objdir "*)
3897 new_libs="$new_libs -L$path/$objdir" ;;
3898 esac
3899 ;;
3900 esac
3901 done
3902 for deplib in $deplibs; do
3903 case $deplib in
3904 -L*)
3905 case " $new_libs " in
3906 *" $deplib "*) ;;
3907 *) new_libs="$new_libs $deplib" ;;
3908 esac
3909 ;;
3910 *) new_libs="$new_libs $deplib" ;;
3911 esac
3912 done
3913 deplibs="$new_libs"
3914
3915
3916 # All the library-specific variables (install_libdir is set above).
3917 library_names=
3918 old_library=
3919 dlname=
3920
3921 # Test again, we may have decided not to build it any more
3922 if test "$build_libtool_libs" = yes; then
3923 if test "$hardcode_into_libs" = yes; then
3924 # Hardcode the library paths
3925 hardcode_libdirs=
3926 dep_rpath=
3927 rpath="$finalize_rpath"
3928 test "$mode" != relink && rpath="$compile_rpath$rpath"
3929 for libdir in $rpath; do
3930 if test -n "$hardcode_libdir_flag_spec"; then
3931 if test -n "$hardcode_libdir_separator"; then
3932 if test -z "$hardcode_libdirs"; then
3933 hardcode_libdirs="$libdir"
3934 else
3935 # Just accumulate the unique libdirs.
3936 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3937 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3938 ;;
3939 *)
3940 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3941 ;;
3942 esac
3943 fi
3944 else
3945 eval flag=\"$hardcode_libdir_flag_spec\"
3946 dep_rpath="$dep_rpath $flag"
3947 fi
3948 elif test -n "$runpath_var"; then
3949 case "$perm_rpath " in
3950 *" $libdir "*) ;;
3951 *) perm_rpath="$perm_rpath $libdir" ;;
3952 esac
3953 fi
3954 done
3955 # Substitute the hardcoded libdirs into the rpath.
3956 if test -n "$hardcode_libdir_separator" &&
3957 test -n "$hardcode_libdirs"; then
3958 libdir="$hardcode_libdirs"
3959 if test -n "$hardcode_libdir_flag_spec_ld"; then
3960 case $archive_cmds in
3961 *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
3962 *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
3963 esac
3964 else
3965 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3966 fi
3967 fi
3968 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3969 # We should set the runpath_var.
3970 rpath=
3971 for dir in $perm_rpath; do
3972 rpath="$rpath$dir:"
3973 done
3974 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3975 fi
3976 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3977 fi
3978
3979 shlibpath="$finalize_shlibpath"
3980 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3981 if test -n "$shlibpath"; then
3982 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3983 fi
3984
3985 # Get the real and link names of the library.
3986 eval shared_ext=\"$shrext_cmds\"
3987 eval library_names=\"$library_names_spec\"
3988 set dummy $library_names
3989 realname="$2"
3990 shift; shift
3991
3992 if test -n "$soname_spec"; then
3993 eval soname=\"$soname_spec\"
3994 else
3995 soname="$realname"
3996 fi
3997 if test -z "$dlname"; then
3998 dlname=$soname
3999 fi
4000
4001 lib="$output_objdir/$realname"
4002 linknames=
4003 for link
4004 do
4005 linknames="$linknames $link"
4006 done
4007
4008 # Use standard objects if they are pic
4009 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4010
4011 # Prepare the list of exported symbols
4012 if test -z "$export_symbols"; then
4013 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4014 $show "generating symbol list for \`$libname.la'"
4015 export_symbols="$output_objdir/$libname.exp"
4016 $run $rm $export_symbols
4017 cmds=$export_symbols_cmds
4018 save_ifs="$IFS"; IFS='~'
4019 for cmd in $cmds; do
4020 IFS="$save_ifs"
4021 eval cmd=\"$cmd\"
4022 if len=`expr "X$cmd" : ".*"` &&
4023 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4024 $show "$cmd"
4025 $run eval "$cmd" || exit $?
4026 skipped_export=false
4027 else
4028 # The command line is too long to execute in one step.
4029 $show "using reloadable object file for export list..."
4030 skipped_export=:
4031 # Break out early, otherwise skipped_export may be
4032 # set to false by a later but shorter cmd.
4033 break
4034 fi
4035 done
4036 IFS="$save_ifs"
4037 if test -n "$export_symbols_regex"; then
4038 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4039 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4040 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4041 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4042 fi
4043 fi
4044 fi
4045
4046 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4047 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4048 fi
4049
4050 tmp_deplibs=
4051 for test_deplib in $deplibs; do
4052 case " $convenience " in
4053 *" $test_deplib "*) ;;
4054 *)
4055 tmp_deplibs="$tmp_deplibs $test_deplib"
4056 ;;
4057 esac
4058 done
4059 deplibs="$tmp_deplibs"
4060
4061 if test -n "$convenience"; then
4062 if test -n "$whole_archive_flag_spec"; then
4063 save_libobjs=$libobjs
4064 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4065 else
4066 gentop="$output_objdir/${outputname}x"
4067 generated="$generated $gentop"
4068
4069 func_extract_archives $gentop $convenience
4070 libobjs="$libobjs $func_extract_archives_result"
4071 fi
4072 fi
4073
4074 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4075 eval flag=\"$thread_safe_flag_spec\"
4076 linker_flags="$linker_flags $flag"
4077 fi
4078
4079 # Make a backup of the uninstalled library when relinking
4080 if test "$mode" = relink; then
4081 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4082 fi
4083
4084 # Do each of the archive commands.
4085 if test "$module" = yes && test -n "$module_cmds" ; then
4086 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4087 eval test_cmds=\"$module_expsym_cmds\"
4088 cmds=$module_expsym_cmds
4089 else
4090 eval test_cmds=\"$module_cmds\"
4091 cmds=$module_cmds
4092 fi
4093 else
4094 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4095 eval test_cmds=\"$archive_expsym_cmds\"
4096 cmds=$archive_expsym_cmds
4097 else
4098 eval test_cmds=\"$archive_cmds\"
4099 cmds=$archive_cmds
4100 fi
4101 fi
4102
4103 if test "X$skipped_export" != "X:" &&
4104 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4105 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4106 :
4107 else
4108 # The command line is too long to link in one step, link piecewise.
4109 $echo "creating reloadable object files..."
4110
4111 # Save the value of $output and $libobjs because we want to
4112 # use them later. If we have whole_archive_flag_spec, we
4113 # want to use save_libobjs as it was before
4114 # whole_archive_flag_spec was expanded, because we can't
4115 # assume the linker understands whole_archive_flag_spec.
4116 # This may have to be revisited, in case too many
4117 # convenience libraries get linked in and end up exceeding
4118 # the spec.
4119 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4120 save_libobjs=$libobjs
4121 fi
4122 save_output=$output
4123 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4124
4125 # Clear the reloadable object creation command queue and
4126 # initialize k to one.
4127 test_cmds=
4128 concat_cmds=
4129 objlist=
4130 delfiles=
4131 last_robj=
4132 k=1
4133 output=$output_objdir/$output_la-${k}.$objext
4134 # Loop over the list of objects to be linked.
4135 for obj in $save_libobjs
4136 do
4137 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4138 if test "X$objlist" = X ||
4139 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4140 test "$len" -le "$max_cmd_len"; }; then
4141 objlist="$objlist $obj"
4142 else
4143 # The command $test_cmds is almost too long, add a
4144 # command to the queue.
4145 if test "$k" -eq 1 ; then
4146 # The first file doesn't have a previous command to add.
4147 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4148 else
4149 # All subsequent reloadable object files will link in
4150 # the last one created.
4151 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4152 fi
4153 last_robj=$output_objdir/$output_la-${k}.$objext
4154 k=`expr $k + 1`
4155 output=$output_objdir/$output_la-${k}.$objext
4156 objlist=$obj
4157 len=1
4158 fi
4159 done
4160 # Handle the remaining objects by creating one last
4161 # reloadable object file. All subsequent reloadable object
4162 # files will link in the last one created.
4163 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4164 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4165
4166 if ${skipped_export-false}; then
4167 $show "generating symbol list for \`$libname.la'"
4168 export_symbols="$output_objdir/$libname.exp"
4169 $run $rm $export_symbols
4170 libobjs=$output
4171 # Append the command to create the export file.
4172 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4173 fi
4174
4175 # Set up a command to remove the reloadable object files
4176 # after they are used.
4177 i=0
4178 while test "$i" -lt "$k"
4179 do
4180 i=`expr $i + 1`
4181 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4182 done
4183
4184 $echo "creating a temporary reloadable object file: $output"
4185
4186 # Loop through the commands generated above and execute them.
4187 save_ifs="$IFS"; IFS='~'
4188 for cmd in $concat_cmds; do
4189 IFS="$save_ifs"
4190 $show "$cmd"
4191 $run eval "$cmd" || exit $?
4192 done
4193 IFS="$save_ifs"
4194
4195 libobjs=$output
4196 # Restore the value of output.
4197 output=$save_output
4198
4199 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4200 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4201 fi
4202 # Expand the library linking commands again to reset the
4203 # value of $libobjs for piecewise linking.
4204
4205 # Do each of the archive commands.
4206 if test "$module" = yes && test -n "$module_cmds" ; then
4207 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4208 cmds=$module_expsym_cmds
4209 else
4210 cmds=$module_cmds
4211 fi
4212 else
4213 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4214 cmds=$archive_expsym_cmds
4215 else
4216 cmds=$archive_cmds
4217 fi
4218 fi
4219
4220 # Append the command to remove the reloadable object files
4221 # to the just-reset $cmds.
4222 eval cmds=\"\$cmds~\$rm $delfiles\"
4223 fi
4224 save_ifs="$IFS"; IFS='~'
4225 for cmd in $cmds; do
4226 IFS="$save_ifs"
4227 eval cmd=\"$cmd\"
4228 $show "$cmd"
4229 $run eval "$cmd" || {
4230 lt_exit=$?
4231
4232 # Restore the uninstalled library and exit
4233 if test "$mode" = relink; then
4234 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4235 fi
4236
4237 exit $lt_exit
4238 }
4239 done
4240 IFS="$save_ifs"
4241
4242 # Restore the uninstalled library and exit
4243 if test "$mode" = relink; then
4244 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4245
4246 if test -n "$convenience"; then
4247 if test -z "$whole_archive_flag_spec"; then
4248 $show "${rm}r $gentop"
4249 $run ${rm}r "$gentop"
4250 fi
4251 fi
4252
4253 exit $EXIT_SUCCESS
4254 fi
4255
4256 # Create links to the real library.
4257 for linkname in $linknames; do
4258 if test "$realname" != "$linkname"; then
4259 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4260 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4261 fi
4262 done
4263
4264 # If -module or -export-dynamic was specified, set the dlname.
4265 if test "$module" = yes || test "$export_dynamic" = yes; then
4266 # On all known operating systems, these are identical.
4267 dlname="$soname"
4268 fi
4269 fi
4270 ;;
4271
4272 obj)
4273 case " $deplibs" in
4274 *\ -l* | *\ -L*)
4275 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
4276 esac
4277
4278 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4279 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4280 fi
4281
4282 if test -n "$rpath"; then
4283 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4284 fi
4285
4286 if test -n "$xrpath"; then
4287 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4288 fi
4289
4290 if test -n "$vinfo"; then
4291 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4292 fi
4293
4294 if test -n "$release"; then
4295 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4296 fi
4297
4298 case $output in
4299 *.lo)
4300 if test -n "$objs$old_deplibs"; then
4301 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4302 exit $EXIT_FAILURE
4303 fi
4304 libobj="$output"
4305 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4306 ;;
4307 *)
4308 libobj=
4309 obj="$output"
4310 ;;
4311 esac
4312
4313 # Delete the old objects.
4314 $run $rm $obj $libobj
4315
4316 # Objects from convenience libraries. This assumes
4317 # single-version convenience libraries. Whenever we create
4318 # different ones for PIC/non-PIC, this we'll have to duplicate
4319 # the extraction.
4320 reload_conv_objs=
4321 gentop=
4322 # reload_cmds runs $LD directly, so let us get rid of
4323 # -Wl from whole_archive_flag_spec and hope we can get by with
4324 # turning comma into space..
4325 wl=
4326
4327 if test -n "$convenience"; then
4328 if test -n "$whole_archive_flag_spec"; then
4329 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4330 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4331 else
4332 gentop="$output_objdir/${obj}x"
4333 generated="$generated $gentop"
4334
4335 func_extract_archives $gentop $convenience
4336 reload_conv_objs="$reload_objs $func_extract_archives_result"
4337 fi
4338 fi
4339
4340 # Create the old-style object.
4341 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
4342
4343 output="$obj"
4344 cmds=$reload_cmds
4345 save_ifs="$IFS"; IFS='~'
4346 for cmd in $cmds; do
4347 IFS="$save_ifs"
4348 eval cmd=\"$cmd\"
4349 $show "$cmd"
4350 $run eval "$cmd" || exit $?
4351 done
4352 IFS="$save_ifs"
4353
4354 # Exit if we aren't doing a library object file.
4355 if test -z "$libobj"; then
4356 if test -n "$gentop"; then
4357 $show "${rm}r $gentop"
4358 $run ${rm}r $gentop
4359 fi
4360
4361 exit $EXIT_SUCCESS
4362 fi
4363
4364 if test "$build_libtool_libs" != yes; then
4365 if test -n "$gentop"; then
4366 $show "${rm}r $gentop"
4367 $run ${rm}r $gentop
4368 fi
4369
4370 # Create an invalid libtool object if no PIC, so that we don't
4371 # accidentally link it into a program.
4372 # $show "echo timestamp > $libobj"
4373 # $run eval "echo timestamp > $libobj" || exit $?
4374 exit $EXIT_SUCCESS
4375 fi
4376
4377 if test -n "$pic_flag" || test "$pic_mode" != default; then
4378 # Only do commands if we really have different PIC objects.
4379 reload_objs="$libobjs $reload_conv_objs"
4380 output="$libobj"
4381 cmds=$reload_cmds
4382 save_ifs="$IFS"; IFS='~'
4383 for cmd in $cmds; do
4384 IFS="$save_ifs"
4385 eval cmd=\"$cmd\"
4386 $show "$cmd"
4387 $run eval "$cmd" || exit $?
4388 done
4389 IFS="$save_ifs"
4390 fi
4391
4392 if test -n "$gentop"; then
4393 $show "${rm}r $gentop"
4394 $run ${rm}r $gentop
4395 fi
4396
4397 exit $EXIT_SUCCESS
4398 ;;
4399
4400 prog)
4401 case $host in
4402 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4403 esac
4404 if test -n "$vinfo"; then
4405 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4406 fi
4407
4408 if test -n "$release"; then
4409 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4410 fi
4411
4412 if test "$preload" = yes; then
4413 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4414 test "$dlopen_self_static" = unknown; then
4415 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4416 fi
4417 fi
4418
4419 case $host in
4420 *-*-rhapsody* | *-*-darwin1.[012])
4421 # On Rhapsody replace the C library is the System framework
4422 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4423 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4424 ;;
4425 esac
4426
4427 case $host in
4428 *darwin*)
4429 # Don't allow lazy linking, it breaks C++ global constructors
4430 if test "$tagname" = CXX ; then
4431 compile_command="$compile_command ${wl}-bind_at_load"
4432 finalize_command="$finalize_command ${wl}-bind_at_load"
4433 fi
4434 ;;
4435 esac
4436
4437
4438 # move library search paths that coincide with paths to not yet
4439 # installed libraries to the beginning of the library search list
4440 new_libs=
4441 for path in $notinst_path; do
4442 case " $new_libs " in
4443 *" -L$path/$objdir "*) ;;
4444 *)
4445 case " $compile_deplibs " in
4446 *" -L$path/$objdir "*)
4447 new_libs="$new_libs -L$path/$objdir" ;;
4448 esac
4449 ;;
4450 esac
4451 done
4452 for deplib in $compile_deplibs; do
4453 case $deplib in
4454 -L*)
4455 case " $new_libs " in
4456 *" $deplib "*) ;;
4457 *) new_libs="$new_libs $deplib" ;;
4458 esac
4459 ;;
4460 *) new_libs="$new_libs $deplib" ;;
4461 esac
4462 done
4463 compile_deplibs="$new_libs"
4464
4465
4466 compile_command="$compile_command $compile_deplibs"
4467 finalize_command="$finalize_command $finalize_deplibs"
4468
4469 if test -n "$rpath$xrpath"; then
4470 # If the user specified any rpath flags, then add them.
4471 for libdir in $rpath $xrpath; do
4472 # This is the magic to use -rpath.
4473 case "$finalize_rpath " in
4474 *" $libdir "*) ;;
4475 *) finalize_rpath="$finalize_rpath $libdir" ;;
4476 esac
4477 done
4478 fi
4479
4480 # Now hardcode the library paths
4481 rpath=
4482 hardcode_libdirs=
4483 for libdir in $compile_rpath $finalize_rpath; do
4484 if test -n "$hardcode_libdir_flag_spec"; then
4485 if test -n "$hardcode_libdir_separator"; then
4486 if test -z "$hardcode_libdirs"; then
4487 hardcode_libdirs="$libdir"
4488 else
4489 # Just accumulate the unique libdirs.
4490 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4491 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4492 ;;
4493 *)
4494 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4495 ;;
4496 esac
4497 fi
4498 else
4499 eval flag=\"$hardcode_libdir_flag_spec\"
4500 rpath="$rpath $flag"
4501 fi
4502 elif test -n "$runpath_var"; then
4503 case "$perm_rpath " in
4504 *" $libdir "*) ;;
4505 *) perm_rpath="$perm_rpath $libdir" ;;
4506 esac
4507 fi
4508 case $host in
4509 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4510 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4511 case :$dllsearchpath: in
4512 *":$libdir:"*) ;;
4513 *) dllsearchpath="$dllsearchpath:$libdir";;
4514 esac
4515 case :$dllsearchpath: in
4516 *":$testbindir:"*) ;;
4517 *) dllsearchpath="$dllsearchpath:$testbindir";;
4518 esac
4519 ;;
4520 esac
4521 done
4522 # Substitute the hardcoded libdirs into the rpath.
4523 if test -n "$hardcode_libdir_separator" &&
4524 test -n "$hardcode_libdirs"; then
4525 libdir="$hardcode_libdirs"
4526 eval rpath=\" $hardcode_libdir_flag_spec\"
4527 fi
4528 compile_rpath="$rpath"
4529
4530 rpath=
4531 hardcode_libdirs=
4532 for libdir in $finalize_rpath; do
4533 if test -n "$hardcode_libdir_flag_spec"; then
4534 if test -n "$hardcode_libdir_separator"; then
4535 if test -z "$hardcode_libdirs"; then
4536 hardcode_libdirs="$libdir"
4537 else
4538 # Just accumulate the unique libdirs.
4539 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4540 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4541 ;;
4542 *)
4543 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4544 ;;
4545 esac
4546 fi
4547 else
4548 eval flag=\"$hardcode_libdir_flag_spec\"
4549 rpath="$rpath $flag"
4550 fi
4551 elif test -n "$runpath_var"; then
4552 case "$finalize_perm_rpath " in
4553 *" $libdir "*) ;;
4554 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4555 esac
4556 fi
4557 done
4558 # Substitute the hardcoded libdirs into the rpath.
4559 if test -n "$hardcode_libdir_separator" &&
4560 test -n "$hardcode_libdirs"; then
4561 libdir="$hardcode_libdirs"
4562 eval rpath=\" $hardcode_libdir_flag_spec\"
4563 fi
4564 finalize_rpath="$rpath"
4565
4566 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4567 # Transform all the library objects into standard objects.
4568 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4569 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4570 fi
4571
4572 dlsyms=
4573 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4574 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4575 dlsyms="${outputname}S.c"
4576 else
4577 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4578 fi
4579 fi
4580
4581 if test -n "$dlsyms"; then
4582 case $dlsyms in
4583 "") ;;
4584 *.c)
4585 # Discover the nlist of each of the dlfiles.
4586 nlist="$output_objdir/${outputname}.nm"
4587
4588 $show "$rm $nlist ${nlist}S ${nlist}T"
4589 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4590
4591 # Parse the name list into a source file.
4592 $show "creating $output_objdir/$dlsyms"
4593
4594 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4595/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4596/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4597
4598#ifdef __cplusplus
4599extern \"C\" {
4600#endif
4601
4602/* Prevent the only kind of declaration conflicts we can make. */
4603#define lt_preloaded_symbols some_other_symbol
4604
4605/* External symbol declarations for the compiler. */\
4606"
4607
4608 if test "$dlself" = yes; then
4609 $show "generating symbol list for \`$output'"
4610
4611 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4612
4613 # Add our own program objects to the symbol list.
4614 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4615 for arg in $progfiles; do
4616 $show "extracting global C symbols from \`$arg'"
4617 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4618 done
4619
4620 if test -n "$exclude_expsyms"; then
4621 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4622 $run eval '$mv "$nlist"T "$nlist"'
4623 fi
4624
4625 if test -n "$export_symbols_regex"; then
4626 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4627 $run eval '$mv "$nlist"T "$nlist"'
4628 fi
4629
4630 # Prepare the list of exported symbols
4631 if test -z "$export_symbols"; then
4632 export_symbols="$output_objdir/$outputname.exp"
4633 $run $rm $export_symbols
4634 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4635 case $host in
4636 *cygwin* | *mingw* )
4637 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4638 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4639 ;;
4640 esac
4641 else
4642 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4643 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4644 $run eval 'mv "$nlist"T "$nlist"'
4645 case $host in
4646 *cygwin* | *mingw* )
4647 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4648 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4649 ;;
4650 esac
4651 fi
4652 fi
4653
4654 for arg in $dlprefiles; do
4655 $show "extracting global C symbols from \`$arg'"
4656 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4657 $run eval '$echo ": $name " >> "$nlist"'
4658 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4659 done
4660
4661 if test -z "$run"; then
4662 # Make sure we have at least an empty file.
4663 test -f "$nlist" || : > "$nlist"
4664
4665 if test -n "$exclude_expsyms"; then
4666 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4667 $mv "$nlist"T "$nlist"
4668 fi
4669
4670 # Try sorting and uniquifying the output.
4671 if grep -v "^: " < "$nlist" |
4672 if sort -k 3 </dev/null >/dev/null 2>&1; then
4673 sort -k 3
4674 else
4675 sort +2
4676 fi |
4677 uniq > "$nlist"S; then
4678 :
4679 else
4680 grep -v "^: " < "$nlist" > "$nlist"S
4681 fi
4682
4683 if test -f "$nlist"S; then
4684 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4685 else
4686 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4687 fi
4688
4689 $echo >> "$output_objdir/$dlsyms" "\
4690
4691#undef lt_preloaded_symbols
4692
4693#if defined (__STDC__) && __STDC__
4694# define lt_ptr void *
4695#else
4696# define lt_ptr char *
4697# define const
4698#endif
4699
4700/* The mapping between symbol names and symbols. */
4701"
4702
4703 case $host in
4704 *cygwin* | *mingw* )
4705 $echo >> "$output_objdir/$dlsyms" "\
4706/* DATA imports from DLLs on WIN32 can't be const, because
4707 runtime relocations are performed -- see ld's documentation
4708 on pseudo-relocs */
4709struct {
4710"
4711 ;;
4712 * )
4713 $echo >> "$output_objdir/$dlsyms" "\
4714const struct {
4715"
4716 ;;
4717 esac
4718
4719
4720 $echo >> "$output_objdir/$dlsyms" "\
4721 const char *name;
4722 lt_ptr address;
4723}
4724lt_preloaded_symbols[] =
4725{\
4726"
4727
4728 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4729
4730 $echo >> "$output_objdir/$dlsyms" "\
4731 {0, (lt_ptr) 0}
4732};
4733
4734/* This works around a problem in FreeBSD linker */
4735#ifdef FREEBSD_WORKAROUND
4736static const void *lt_preloaded_setup() {
4737 return lt_preloaded_symbols;
4738}
4739#endif
4740
4741#ifdef __cplusplus
4742}
4743#endif\
4744"
4745 fi
4746
4747 pic_flag_for_symtable=
4748 case $host in
4749 # compiling the symbol table file with pic_flag works around
4750 # a FreeBSD bug that causes programs to crash when -lm is
4751 # linked before any other PIC object. But we must not use
4752 # pic_flag when linking with -static. The problem exists in
4753 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4754 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4755 case "$compile_command " in
4756 *" -static "*) ;;
4757 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4758 esac;;
4759 *-*-hpux*)
4760 case "$compile_command " in
4761 *" -static "*) ;;
4762 *) pic_flag_for_symtable=" $pic_flag";;
4763 esac
4764 esac
4765
4766 # Now compile the dynamic symbol file.
4767 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4768 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4769
4770 # Clean up the generated files.
4771 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4772 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4773
4774 # Transform the symbol file into the correct name.
4775 case $host in
4776 *cygwin* | *mingw* )
4777 if test -f "$output_objdir/${outputname}.def" ; then
4778 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4779 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4780 else
4781 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4782 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4783 fi
4784 ;;
4785 * )
4786 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4787 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4788 ;;
4789 esac
4790 ;;
4791 *)
4792 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4793 exit $EXIT_FAILURE
4794 ;;
4795 esac
4796 else
4797 # We keep going just in case the user didn't refer to
4798 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4799 # really was required.
4800
4801 # Nullify the symbol file.
4802 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4803 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4804 fi
4805
4806 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4807 # Replace the output file specification.
4808 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4809 link_command="$compile_command$compile_rpath"
4810
4811 # We have no uninstalled library dependencies, so finalize right now.
4812 $show "$link_command"
4813 $run eval "$link_command"
4814 exit_status=$?
4815
4816 # Delete the generated files.
4817 if test -n "$dlsyms"; then
4818 $show "$rm $output_objdir/${outputname}S.${objext}"
4819 $run $rm "$output_objdir/${outputname}S.${objext}"
4820 fi
4821
4822 exit $exit_status
4823 fi
4824
4825 if test -n "$shlibpath_var"; then
4826 # We should set the shlibpath_var
4827 rpath=
4828 for dir in $temp_rpath; do
4829 case $dir in
4830 [\\/]* | [A-Za-z]:[\\/]*)
4831 # Absolute path.
4832 rpath="$rpath$dir:"
4833 ;;
4834 *)
4835 # Relative path: add a thisdir entry.
4836 rpath="$rpath\$thisdir/$dir:"
4837 ;;
4838 esac
4839 done
4840 temp_rpath="$rpath"
4841 fi
4842
4843 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4844 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4845 fi
4846 if test -n "$finalize_shlibpath"; then
4847 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4848 fi
4849
4850 compile_var=
4851 finalize_var=
4852 if test -n "$runpath_var"; then
4853 if test -n "$perm_rpath"; then
4854 # We should set the runpath_var.
4855 rpath=
4856 for dir in $perm_rpath; do
4857 rpath="$rpath$dir:"
4858 done
4859 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4860 fi
4861 if test -n "$finalize_perm_rpath"; then
4862 # We should set the runpath_var.
4863 rpath=
4864 for dir in $finalize_perm_rpath; do
4865 rpath="$rpath$dir:"
4866 done
4867 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4868 fi
4869 fi
4870
4871 if test "$no_install" = yes; then
4872 # We don't need to create a wrapper script.
4873 link_command="$compile_var$compile_command$compile_rpath"
4874 # Replace the output file specification.
4875 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4876 # Delete the old output file.
4877 $run $rm $output
4878 # Link the executable and exit
4879 $show "$link_command"
4880 $run eval "$link_command" || exit $?
4881 exit $EXIT_SUCCESS
4882 fi
4883
4884 if test "$hardcode_action" = relink; then
4885 # Fast installation is not supported
4886 link_command="$compile_var$compile_command$compile_rpath"
4887 relink_command="$finalize_var$finalize_command$finalize_rpath"
4888
4889 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4890 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4891 else
4892 if test "$fast_install" != no; then
4893 link_command="$finalize_var$compile_command$finalize_rpath"
4894 if test "$fast_install" = yes; then
4895 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4896 else
4897 # fast_install is set to needless
4898 relink_command=
4899 fi
4900 else
4901 link_command="$compile_var$compile_command$compile_rpath"
4902 relink_command="$finalize_var$finalize_command$finalize_rpath"
4903 fi
4904 fi
4905
4906 # Replace the output file specification.
4907 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4908
4909 # Delete the old output files.
4910 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4911
4912 $show "$link_command"
4913 $run eval "$link_command" || exit $?
4914
4915 # Now create the wrapper script.
4916 $show "creating $output"
4917
4918 # Quote the relink command for shipping.
4919 if test -n "$relink_command"; then
4920 # Preserve any variables that may affect compiler behavior
4921 for var in $variables_saved_for_relink; do
4922 if eval test -z \"\${$var+set}\"; then
4923 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4924 elif eval var_value=\$$var; test -z "$var_value"; then
4925 relink_command="$var=; export $var; $relink_command"
4926 else
4927 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4928 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4929 fi
4930 done
4931 relink_command="(cd `pwd`; $relink_command)"
4932 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
4933 fi
4934
4935 # Quote $echo for shipping.
4936 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4937 case $progpath in
4938 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4939 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4940 esac
4941 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4942 else
4943 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4944 fi
4945
4946 # Only actually do things if our run command is non-null.
4947 if test -z "$run"; then
4948 # win32 will think the script is a binary if it has
4949 # a .exe suffix, so we strip it off here.
4950 case $output in
4951 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4952 esac
4953 # test for cygwin because mv fails w/o .exe extensions
4954 case $host in
4955 *cygwin*)
4956 exeext=.exe
4957 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4958 *) exeext= ;;
4959 esac
4960 case $host in
4961 *cygwin* | *mingw* )
4962 output_name=`basename $output`
4963 output_path=`dirname $output`
4964 cwrappersource="$output_path/$objdir/lt-$output_name.c"
4965 cwrapper="$output_path/$output_name.exe"
4966 $rm $cwrappersource $cwrapper
4967 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4968
4969 cat > $cwrappersource <<EOF
4970
4971/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4972 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4973
4974 The $output program cannot be directly executed until all the libtool
4975 libraries that it depends on are installed.
4976
4977 This wrapper executable should never be moved out of the build directory.
4978 If it is, it will not operate correctly.
4979
4980 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4981 but could eventually absorb all of the scripts functionality and
4982 exec $objdir/$outputname directly.
4983*/
4984EOF
4985 cat >> $cwrappersource<<"EOF"
4986#include <stdio.h>
4987#include <stdlib.h>
4988#include <unistd.h>
4989#include <malloc.h>
4990#include <stdarg.h>
4991#include <assert.h>
4992#include <string.h>
4993#include <ctype.h>
4994#include <sys/stat.h>
4995
4996#if defined(PATH_MAX)
4997# define LT_PATHMAX PATH_MAX
4998#elif defined(MAXPATHLEN)
4999# define LT_PATHMAX MAXPATHLEN
5000#else
5001# define LT_PATHMAX 1024
5002#endif
5003
5004#ifndef DIR_SEPARATOR
5005# define DIR_SEPARATOR '/'
5006# define PATH_SEPARATOR ':'
5007#endif
5008
5009#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5010 defined (__OS2__)
5011# define HAVE_DOS_BASED_FILE_SYSTEM
5012# ifndef DIR_SEPARATOR_2
5013# define DIR_SEPARATOR_2 '\\'
5014# endif
5015# ifndef PATH_SEPARATOR_2
5016# define PATH_SEPARATOR_2 ';'
5017# endif
5018#endif
5019
5020#ifndef DIR_SEPARATOR_2
5021# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5022#else /* DIR_SEPARATOR_2 */
5023# define IS_DIR_SEPARATOR(ch) \
5024 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5025#endif /* DIR_SEPARATOR_2 */
5026
5027#ifndef PATH_SEPARATOR_2
5028# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5029#else /* PATH_SEPARATOR_2 */
5030# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5031#endif /* PATH_SEPARATOR_2 */
5032
5033#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5034#define XFREE(stale) do { \
5035 if (stale) { free ((void *) stale); stale = 0; } \
5036} while (0)
5037
5038/* -DDEBUG is fairly common in CFLAGS. */
5039#undef DEBUG
5040#if defined DEBUGWRAPPER
5041# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5042#else
5043# define DEBUG(format, ...)
5044#endif
5045
5046const char *program_name = NULL;
5047
5048void * xmalloc (size_t num);
5049char * xstrdup (const char *string);
5050const char * base_name (const char *name);
5051char * find_executable(const char *wrapper);
5052int check_executable(const char *path);
5053char * strendzap(char *str, const char *pat);
5054void lt_fatal (const char *message, ...);
5055
5056int
5057main (int argc, char *argv[])
5058{
5059 char **newargz;
5060 int i;
5061
5062 program_name = (char *) xstrdup (base_name (argv[0]));
5063 DEBUG("(main) argv[0] : %s\n",argv[0]);
5064 DEBUG("(main) program_name : %s\n",program_name);
5065 newargz = XMALLOC(char *, argc+2);
5066EOF
5067
5068 cat >> $cwrappersource <<EOF
5069 newargz[0] = (char *) xstrdup("$SHELL");
5070EOF
5071
5072 cat >> $cwrappersource <<"EOF"
5073 newargz[1] = find_executable(argv[0]);
5074 if (newargz[1] == NULL)
5075 lt_fatal("Couldn't find %s", argv[0]);
5076 DEBUG("(main) found exe at : %s\n",newargz[1]);
5077 /* we know the script has the same name, without the .exe */
5078 /* so make sure newargz[1] doesn't end in .exe */
5079 strendzap(newargz[1],".exe");
5080 for (i = 1; i < argc; i++)
5081 newargz[i+1] = xstrdup(argv[i]);
5082 newargz[argc+1] = NULL;
5083
5084 for (i=0; i<argc+1; i++)
5085 {
5086 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5087 ;
5088 }
5089
5090EOF
5091
5092 case $host_os in
5093 mingw*)
5094 cat >> $cwrappersource <<EOF
5095 execv("$SHELL",(char const **)newargz);
5096EOF
5097 ;;
5098 *)
5099 cat >> $cwrappersource <<EOF
5100 execv("$SHELL",newargz);
5101EOF
5102 ;;
5103 esac
5104
5105 cat >> $cwrappersource <<"EOF"
5106 return 127;
5107}
5108
5109void *
5110xmalloc (size_t num)
5111{
5112 void * p = (void *) malloc (num);
5113 if (!p)
5114 lt_fatal ("Memory exhausted");
5115
5116 return p;
5117}
5118
5119char *
5120xstrdup (const char *string)
5121{
5122 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5123;
5124}
5125
5126const char *
5127base_name (const char *name)
5128{
5129 const char *base;
5130
5131#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5132 /* Skip over the disk name in MSDOS pathnames. */
5133 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5134 name += 2;
5135#endif
5136
5137 for (base = name; *name; name++)
5138 if (IS_DIR_SEPARATOR (*name))
5139 base = name + 1;
5140 return base;
5141}
5142
5143int
5144check_executable(const char * path)
5145{
5146 struct stat st;
5147
5148 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5149 if ((!path) || (!*path))
5150 return 0;
5151
5152 if ((stat (path, &st) >= 0) &&
5153 (
5154 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5155#if defined (S_IXOTH)
5156 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5157#endif
5158#if defined (S_IXGRP)
5159 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5160#endif
5161 ((st.st_mode & S_IXUSR) == S_IXUSR))
5162 )
5163 return 1;
5164 else
5165 return 0;
5166}
5167
5168/* Searches for the full path of the wrapper. Returns
5169 newly allocated full path name if found, NULL otherwise */
5170char *
5171find_executable (const char* wrapper)
5172{
5173 int has_slash = 0;
5174 const char* p;
5175 const char* p_next;
5176 /* static buffer for getcwd */
5177 char tmp[LT_PATHMAX + 1];
5178 int tmp_len;
5179 char* concat_name;
5180
5181 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5182
5183 if ((wrapper == NULL) || (*wrapper == '\0'))
5184 return NULL;
5185
5186 /* Absolute path? */
5187#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5188 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5189 {
5190 concat_name = xstrdup (wrapper);
5191 if (check_executable(concat_name))
5192 return concat_name;
5193 XFREE(concat_name);
5194 }
5195 else
5196 {
5197#endif
5198 if (IS_DIR_SEPARATOR (wrapper[0]))
5199 {
5200 concat_name = xstrdup (wrapper);
5201 if (check_executable(concat_name))
5202 return concat_name;
5203 XFREE(concat_name);
5204 }
5205#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5206 }
5207#endif
5208
5209 for (p = wrapper; *p; p++)
5210 if (*p == '/')
5211 {
5212 has_slash = 1;
5213 break;
5214 }
5215 if (!has_slash)
5216 {
5217 /* no slashes; search PATH */
5218 const char* path = getenv ("PATH");
5219 if (path != NULL)
5220 {
5221 for (p = path; *p; p = p_next)
5222 {
5223 const char* q;
5224 size_t p_len;
5225 for (q = p; *q; q++)
5226 if (IS_PATH_SEPARATOR(*q))
5227 break;
5228 p_len = q - p;
5229 p_next = (*q == '\0' ? q : q + 1);
5230 if (p_len == 0)
5231 {
5232 /* empty path: current directory */
5233 if (getcwd (tmp, LT_PATHMAX) == NULL)
5234 lt_fatal ("getcwd failed");
5235 tmp_len = strlen(tmp);
5236 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5237 memcpy (concat_name, tmp, tmp_len);
5238 concat_name[tmp_len] = '/';
5239 strcpy (concat_name + tmp_len + 1, wrapper);
5240 }
5241 else
5242 {
5243 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5244 memcpy (concat_name, p, p_len);
5245 concat_name[p_len] = '/';
5246 strcpy (concat_name + p_len + 1, wrapper);
5247 }
5248 if (check_executable(concat_name))
5249 return concat_name;
5250 XFREE(concat_name);
5251 }
5252 }
5253 /* not found in PATH; assume curdir */
5254 }
5255 /* Relative path | not found in path: prepend cwd */
5256 if (getcwd (tmp, LT_PATHMAX) == NULL)
5257 lt_fatal ("getcwd failed");
5258 tmp_len = strlen(tmp);
5259 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5260 memcpy (concat_name, tmp, tmp_len);
5261 concat_name[tmp_len] = '/';
5262 strcpy (concat_name + tmp_len + 1, wrapper);
5263
5264 if (check_executable(concat_name))
5265 return concat_name;
5266 XFREE(concat_name);
5267 return NULL;
5268}
5269
5270char *
5271strendzap(char *str, const char *pat)
5272{
5273 size_t len, patlen;
5274
5275 assert(str != NULL);
5276 assert(pat != NULL);
5277
5278 len = strlen(str);
5279 patlen = strlen(pat);
5280
5281 if (patlen <= len)
5282 {
5283 str += len - patlen;
5284 if (strcmp(str, pat) == 0)
5285 *str = '\0';
5286 }
5287 return str;
5288}
5289
5290static void
5291lt_error_core (int exit_status, const char * mode,
5292 const char * message, va_list ap)
5293{
5294 fprintf (stderr, "%s: %s: ", program_name, mode);
5295 vfprintf (stderr, message, ap);
5296 fprintf (stderr, ".\n");
5297
5298 if (exit_status >= 0)
5299 exit (exit_status);
5300}
5301
5302void
5303lt_fatal (const char *message, ...)
5304{
5305 va_list ap;
5306 va_start (ap, message);
5307 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5308 va_end (ap);
5309}
5310EOF
5311 # we should really use a build-platform specific compiler
5312 # here, but OTOH, the wrappers (shell script and this C one)
5313 # are only useful if you want to execute the "real" binary.
5314 # Since the "real" binary is built for $host, then this
5315 # wrapper might as well be built for $host, too.
5316 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5317 ;;
5318 esac
5319 $rm $output
5320 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5321
5322 $echo > $output "\
5323#! $SHELL
5324
5325# $output - temporary wrapper script for $objdir/$outputname
5326# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5327#
5328# The $output program cannot be directly executed until all the libtool
5329# libraries that it depends on are installed.
5330#
5331# This wrapper script should never be moved out of the build directory.
5332# If it is, it will not operate correctly.
5333
5334# Sed substitution that helps us do robust quoting. It backslashifies
5335# metacharacters that are still active within double-quoted strings.
5336Xsed='${SED} -e 1s/^X//'
5337sed_quote_subst='$sed_quote_subst'
5338
5339# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5340if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5341 emulate sh
5342 NULLCMD=:
5343 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5344 # is contrary to our usage. Disable this feature.
5345 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5346 setopt NO_GLOB_SUBST
5347else
5348 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5349fi
5350BIN_SH=xpg4; export BIN_SH # for Tru64
5351DUALCASE=1; export DUALCASE # for MKS sh
5352
5353# The HP-UX ksh and POSIX shell print the target directory to stdout
5354# if CDPATH is set.
5355(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5356
5357relink_command=\"$relink_command\"
5358
5359# This environment variable determines our operation mode.
5360if test \"\$libtool_install_magic\" = \"$magic\"; then
5361 # install mode needs the following variable:
5362 notinst_deplibs='$notinst_deplibs'
5363else
5364 # When we are sourced in execute mode, \$file and \$echo are already set.
5365 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5366 echo=\"$qecho\"
5367 file=\"\$0\"
5368 # Make sure echo works.
5369 if test \"X\$1\" = X--no-reexec; then
5370 # Discard the --no-reexec flag, and continue.
5371 shift
5372 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5373 # Yippee, \$echo works!
5374 :
5375 else
5376 # Restart under the correct shell, and then maybe \$echo will work.
5377 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5378 fi
5379 fi\
5380"
5381 $echo >> $output "\
5382
5383 # Find the directory that this script lives in.
5384 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5385 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5386
5387 # Follow symbolic links until we get to the real thisdir.
5388 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5389 while test -n \"\$file\"; do
5390 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5391
5392 # If there was a directory component, then change thisdir.
5393 if test \"x\$destdir\" != \"x\$file\"; then
5394 case \"\$destdir\" in
5395 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5396 *) thisdir=\"\$thisdir/\$destdir\" ;;
5397 esac
5398 fi
5399
5400 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5401 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5402 done
5403
5404 # Try to get the absolute directory name.
5405 absdir=\`cd \"\$thisdir\" && pwd\`
5406 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5407"
5408
5409 if test "$fast_install" = yes; then
5410 $echo >> $output "\
5411 program=lt-'$outputname'$exeext
5412 progdir=\"\$thisdir/$objdir\"
5413
5414 if test ! -f \"\$progdir/\$program\" || \\
5415 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5416 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5417
5418 file=\"\$\$-\$program\"
5419
5420 if test ! -d \"\$progdir\"; then
5421 $mkdir \"\$progdir\"
5422 else
5423 $rm \"\$progdir/\$file\"
5424 fi"
5425
5426 $echo >> $output "\
5427
5428 # relink executable if necessary
5429 if test -n \"\$relink_command\"; then
5430 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5431 else
5432 $echo \"\$relink_command_output\" >&2
5433 $rm \"\$progdir/\$file\"
5434 exit $EXIT_FAILURE
5435 fi
5436 fi
5437
5438 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5439 { $rm \"\$progdir/\$program\";
5440 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5441 $rm \"\$progdir/\$file\"
5442 fi"
5443 else
5444 $echo >> $output "\
5445 program='$outputname'
5446 progdir=\"\$thisdir/$objdir\"
5447"
5448 fi
5449
5450 $echo >> $output "\
5451
5452 if test -f \"\$progdir/\$program\"; then"
5453
5454 # Export our shlibpath_var if we have one.
5455 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5456 $echo >> $output "\
5457 # Add our own library path to $shlibpath_var
5458 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5459
5460 # Some systems cannot cope with colon-terminated $shlibpath_var
5461 # The second colon is a workaround for a bug in BeOS R4 sed
5462 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5463
5464 export $shlibpath_var
5465"
5466 fi
5467
5468 # fixup the dll searchpath if we need to.
5469 if test -n "$dllsearchpath"; then
5470 $echo >> $output "\
5471 # Add the dll search path components to the executable PATH
5472 PATH=$dllsearchpath:\$PATH
5473"
5474 fi
5475
5476 $echo >> $output "\
5477 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5478 # Run the actual program with our arguments.
5479"
5480 case $host in
5481 # Backslashes separate directories on plain windows
5482 *-*-mingw | *-*-os2*)
5483 $echo >> $output "\
5484 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5485"
5486 ;;
5487
5488 *)
5489 $echo >> $output "\
5490 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5491"
5492 ;;
5493 esac
5494 $echo >> $output "\
5495 \$echo \"\$0: cannot exec \$program \$*\"
5496 exit $EXIT_FAILURE
5497 fi
5498 else
5499 # The program doesn't exist.
5500 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5501 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5502 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5503 exit $EXIT_FAILURE
5504 fi
5505fi\
5506"
5507 chmod +x $output
5508 fi
5509 exit $EXIT_SUCCESS
5510 ;;
5511 esac
5512
5513 # See if we need to build an old-fashioned archive.
5514 for oldlib in $oldlibs; do
5515
5516 if test "$build_libtool_libs" = convenience; then
5517 oldobjs="$libobjs_save"
5518 addlibs="$convenience"
5519 build_libtool_libs=no
5520 else
5521 if test "$build_libtool_libs" = module; then
5522 oldobjs="$libobjs_save"
5523 build_libtool_libs=no
5524 else
5525 oldobjs="$old_deplibs $non_pic_objects"
5526 fi
5527 addlibs="$old_convenience"
5528 fi
5529
5530 if test -n "$addlibs"; then
5531 gentop="$output_objdir/${outputname}x"
5532 generated="$generated $gentop"
5533
5534 func_extract_archives $gentop $addlibs
5535 oldobjs="$oldobjs $func_extract_archives_result"
5536 fi
5537
5538 # Do each command in the archive commands.
5539 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5540 cmds=$old_archive_from_new_cmds
5541 else
5542 # POSIX demands no paths to be encoded in archives. We have
5543 # to avoid creating archives with duplicate basenames if we
5544 # might have to extract them afterwards, e.g., when creating a
5545 # static archive out of a convenience library, or when linking
5546 # the entirety of a libtool archive into another (currently
5547 # not supported by libtool).
5548 if (for obj in $oldobjs
5549 do
5550 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5551 done | sort | sort -uc >/dev/null 2>&1); then
5552 :
5553 else
5554 $echo "copying selected object files to avoid basename conflicts..."
5555
5556 if test -z "$gentop"; then
5557 gentop="$output_objdir/${outputname}x"
5558 generated="$generated $gentop"
5559
5560 $show "${rm}r $gentop"
5561 $run ${rm}r "$gentop"
5562 $show "$mkdir $gentop"
5563 $run $mkdir "$gentop"
5564 exit_status=$?
5565 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5566 exit $exit_status
5567 fi
5568 fi
5569
5570 save_oldobjs=$oldobjs
5571 oldobjs=
5572 counter=1
5573 for obj in $save_oldobjs
5574 do
5575 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5576 case " $oldobjs " in
5577 " ") oldobjs=$obj ;;
5578 *[\ /]"$objbase "*)
5579 while :; do
5580 # Make sure we don't pick an alternate name that also
5581 # overlaps.
5582 newobj=lt$counter-$objbase
5583 counter=`expr $counter + 1`
5584 case " $oldobjs " in
5585 *[\ /]"$newobj "*) ;;
5586 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5587 esac
5588 done
5589 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5590 $run ln "$obj" "$gentop/$newobj" ||
5591 $run cp "$obj" "$gentop/$newobj"
5592 oldobjs="$oldobjs $gentop/$newobj"
5593 ;;
5594 *) oldobjs="$oldobjs $obj" ;;
5595 esac
5596 done
5597 fi
5598
5599 eval cmds=\"$old_archive_cmds\"
5600
5601 if len=`expr "X$cmds" : ".*"` &&
5602 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5603 cmds=$old_archive_cmds
5604 else
5605 # the command line is too long to link in one step, link in parts
5606 $echo "using piecewise archive linking..."
5607 save_RANLIB=$RANLIB
5608 RANLIB=:
5609 objlist=
5610 concat_cmds=
5611 save_oldobjs=$oldobjs
5612
5613 # Is there a better way of finding the last object in the list?
5614 for obj in $save_oldobjs
5615 do
5616 last_oldobj=$obj
5617 done
5618 for obj in $save_oldobjs
5619 do
5620 oldobjs="$objlist $obj"
5621 objlist="$objlist $obj"
5622 eval test_cmds=\"$old_archive_cmds\"
5623 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5624 test "$len" -le "$max_cmd_len"; then
5625 :
5626 else
5627 # the above command should be used before it gets too long
5628 oldobjs=$objlist
5629 if test "$obj" = "$last_oldobj" ; then
5630 RANLIB=$save_RANLIB
5631 fi
5632 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5633 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5634 objlist=
5635 fi
5636 done
5637 RANLIB=$save_RANLIB
5638 oldobjs=$objlist
5639 if test "X$oldobjs" = "X" ; then
5640 eval cmds=\"\$concat_cmds\"
5641 else
5642 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5643 fi
5644 fi
5645 fi
5646 save_ifs="$IFS"; IFS='~'
5647 for cmd in $cmds; do
5648 eval cmd=\"$cmd\"
5649 IFS="$save_ifs"
5650 $show "$cmd"
5651 $run eval "$cmd" || exit $?
5652 done
5653 IFS="$save_ifs"
5654 done
5655
5656 if test -n "$generated"; then
5657 $show "${rm}r$generated"
5658 $run ${rm}r$generated
5659 fi
5660
5661 # Now create the libtool archive.
5662 case $output in
5663 *.la)
5664 old_library=
5665 test "$build_old_libs" = yes && old_library="$libname.$libext"
5666 $show "creating $output"
5667
5668 # Preserve any variables that may affect compiler behavior
5669 for var in $variables_saved_for_relink; do
5670 if eval test -z \"\${$var+set}\"; then
5671 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5672 elif eval var_value=\$$var; test -z "$var_value"; then
5673 relink_command="$var=; export $var; $relink_command"
5674 else
5675 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5676 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5677 fi
5678 done
5679 # Quote the link command for shipping.
5680 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5681 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5682 if test "$hardcode_automatic" = yes ; then
5683 relink_command=
5684 fi
5685
5686
5687 # Only create the output if not a dry run.
5688 if test -z "$run"; then
5689 for installed in no yes; do
5690 if test "$installed" = yes; then
5691 if test -z "$install_libdir"; then
5692 break
5693 fi
5694 output="$output_objdir/$outputname"i
5695 # Replace all uninstalled libtool libraries with the installed ones
5696 newdependency_libs=
5697 for deplib in $dependency_libs; do
5698 case $deplib in
5699 *.la)
5700 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5701 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5702 if test -z "$libdir"; then
5703 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5704 exit $EXIT_FAILURE
5705 fi
5706 newdependency_libs="$newdependency_libs $libdir/$name"
5707 ;;
5708 *) newdependency_libs="$newdependency_libs $deplib" ;;
5709 esac
5710 done
5711 dependency_libs="$newdependency_libs"
5712 newdlfiles=
5713 for lib in $dlfiles; do
5714 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5715 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5716 if test -z "$libdir"; then
5717 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5718 exit $EXIT_FAILURE
5719 fi
5720 newdlfiles="$newdlfiles $libdir/$name"
5721 done
5722 dlfiles="$newdlfiles"
5723 newdlprefiles=
5724 for lib in $dlprefiles; do
5725 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5726 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5727 if test -z "$libdir"; then
5728 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5729 exit $EXIT_FAILURE
5730 fi
5731 newdlprefiles="$newdlprefiles $libdir/$name"
5732 done
5733 dlprefiles="$newdlprefiles"
5734 else
5735 newdlfiles=
5736 for lib in $dlfiles; do
5737 case $lib in
5738 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5739 *) abs=`pwd`"/$lib" ;;
5740 esac
5741 newdlfiles="$newdlfiles $abs"
5742 done
5743 dlfiles="$newdlfiles"
5744 newdlprefiles=
5745 for lib in $dlprefiles; do
5746 case $lib in
5747 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5748 *) abs=`pwd`"/$lib" ;;
5749 esac
5750 newdlprefiles="$newdlprefiles $abs"
5751 done
5752 dlprefiles="$newdlprefiles"
5753 fi
5754 $rm $output
5755 # place dlname in correct position for cygwin
5756 tdlname=$dlname
5757 case $host,$output,$installed,$module,$dlname in
5758 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5759 esac
5760 $echo > $output "\
5761# $outputname - a libtool library file
5762# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5763#
5764# Please DO NOT delete this file!
5765# It is necessary for linking the library.
5766
5767# The name that we can dlopen(3).
5768dlname='$tdlname'
5769
5770# Names of this library.
5771library_names='$library_names'
5772
5773# The name of the static archive.
5774old_library='$old_library'
5775
5776# Libraries that this one depends upon.
5777dependency_libs='$dependency_libs'
5778
5779# Version information for $libname.
5780current=$current
5781age=$age
5782revision=$revision
5783
5784# Is this an already installed library?
5785installed=$installed
5786
5787# Should we warn about portability when linking against -modules?
5788shouldnotlink=$module
5789
5790# Files to dlopen/dlpreopen
5791dlopen='$dlfiles'
5792dlpreopen='$dlprefiles'
5793
5794# Directory that this library needs to be installed in:
5795libdir='$install_libdir'"
5796 if test "$installed" = no && test "$need_relink" = yes; then
5797 $echo >> $output "\
5798relink_command=\"$relink_command\""
5799 fi
5800 done
5801 fi
5802
5803 # Do a symbolic link so that the libtool archive can be found in
5804 # LD_LIBRARY_PATH before the program is installed.
5805 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5806 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5807 ;;
5808 esac
5809 exit $EXIT_SUCCESS
5810 ;;
5811
5812 # libtool install mode
5813 install)
5814 modename="$modename: install"
5815
5816 # There may be an optional sh(1) argument at the beginning of
5817 # install_prog (especially on Windows NT).
5818 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5819 # Allow the use of GNU shtool's install command.
5820 $echo "X$nonopt" | grep shtool > /dev/null; then
5821 # Aesthetically quote it.
5822 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5823 case $arg in
5824 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5825 arg="\"$arg\""
5826 ;;
5827 esac
5828 install_prog="$arg "
5829 arg="$1"
5830 shift
5831 else
5832 install_prog=
5833 arg=$nonopt
5834 fi
5835
5836 # The real first argument should be the name of the installation program.
5837 # Aesthetically quote it.
5838 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5839 case $arg in
5840 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5841 arg="\"$arg\""
5842 ;;
5843 esac
5844 install_prog="$install_prog$arg"
5845
5846 # We need to accept at least all the BSD install flags.
5847 dest=
5848 files=
5849 opts=
5850 prev=
5851 install_type=
5852 isdir=no
5853 stripme=
5854 for arg
5855 do
5856 if test -n "$dest"; then
5857 files="$files $dest"
5858 dest=$arg
5859 continue
5860 fi
5861
5862 case $arg in
5863 -d) isdir=yes ;;
5864 -f)
5865 case " $install_prog " in
5866 *[\\\ /]cp\ *) ;;
5867 *) prev=$arg ;;
5868 esac
5869 ;;
5870 -g | -m | -o) prev=$arg ;;
5871 -s)
5872 stripme=" -s"
5873 continue
5874 ;;
5875 -*)
5876 ;;
5877 *)
5878 # If the previous option needed an argument, then skip it.
5879 if test -n "$prev"; then
5880 prev=
5881 else
5882 dest=$arg
5883 continue
5884 fi
5885 ;;
5886 esac
5887
5888 # Aesthetically quote the argument.
5889 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5890 case $arg in
5891 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5892 arg="\"$arg\""
5893 ;;
5894 esac
5895 install_prog="$install_prog $arg"
5896 done
5897
5898 if test -z "$install_prog"; then
5899 $echo "$modename: you must specify an install program" 1>&2
5900 $echo "$help" 1>&2
5901 exit $EXIT_FAILURE
5902 fi
5903
5904 if test -n "$prev"; then
5905 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5906 $echo "$help" 1>&2
5907 exit $EXIT_FAILURE
5908 fi
5909
5910 if test -z "$files"; then
5911 if test -z "$dest"; then
5912 $echo "$modename: no file or destination specified" 1>&2
5913 else
5914 $echo "$modename: you must specify a destination" 1>&2
5915 fi
5916 $echo "$help" 1>&2
5917 exit $EXIT_FAILURE
5918 fi
5919
5920 # Strip any trailing slash from the destination.
5921 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5922
5923 # Check to see that the destination is a directory.
5924 test -d "$dest" && isdir=yes
5925 if test "$isdir" = yes; then
5926 destdir="$dest"
5927 destname=
5928 else
5929 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5930 test "X$destdir" = "X$dest" && destdir=.
5931 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5932
5933 # Not a directory, so check to see that there is only one file specified.
5934 set dummy $files
5935 if test "$#" -gt 2; then
5936 $echo "$modename: \`$dest' is not a directory" 1>&2
5937 $echo "$help" 1>&2
5938 exit $EXIT_FAILURE
5939 fi
5940 fi
5941 case $destdir in
5942 [\\/]* | [A-Za-z]:[\\/]*) ;;
5943 *)
5944 for file in $files; do
5945 case $file in
5946 *.lo) ;;
5947 *)
5948 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5949 $echo "$help" 1>&2
5950 exit $EXIT_FAILURE
5951 ;;
5952 esac
5953 done
5954 ;;
5955 esac
5956
5957 # This variable tells wrapper scripts just to set variables rather
5958 # than running their programs.
5959 libtool_install_magic="$magic"
5960
5961 staticlibs=
5962 future_libdirs=
5963 current_libdirs=
5964 for file in $files; do
5965
5966 # Do each installation.
5967 case $file in
5968 *.$libext)
5969 # Do the static libraries later.
5970 staticlibs="$staticlibs $file"
5971 ;;
5972
5973 *.la)
5974 # Check to see that this really is a libtool archive.
5975 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5976 else
5977 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5978 $echo "$help" 1>&2
5979 exit $EXIT_FAILURE
5980 fi
5981
5982 library_names=
5983 old_library=
5984 relink_command=
5985 # If there is no directory component, then add one.
5986 case $file in
5987 */* | *\\*) . $file ;;
5988 *) . ./$file ;;
5989 esac
5990
5991 # Add the libdir to current_libdirs if it is the destination.
5992 if test "X$destdir" = "X$libdir"; then
5993 case "$current_libdirs " in
5994 *" $libdir "*) ;;
5995 *) current_libdirs="$current_libdirs $libdir" ;;
5996 esac
5997 else
5998 # Note the libdir as a future libdir.
5999 case "$future_libdirs " in
6000 *" $libdir "*) ;;
6001 *) future_libdirs="$future_libdirs $libdir" ;;
6002 esac
6003 fi
6004
6005 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6006 test "X$dir" = "X$file/" && dir=
6007 dir="$dir$objdir"
6008
6009 if test -n "$relink_command"; then
6010 # Determine the prefix the user has applied to our future dir.
6011 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6012
6013 # Don't allow the user to place us outside of our expected
6014 # location b/c this prevents finding dependent libraries that
6015 # are installed to the same prefix.
6016 # At present, this check doesn't affect windows .dll's that
6017 # are installed into $libdir/../bin (currently, that works fine)
6018 # but it's something to keep an eye on.
6019 if test "$inst_prefix_dir" = "$destdir"; then
6020 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6021 exit $EXIT_FAILURE
6022 fi
6023
6024 if test -n "$inst_prefix_dir"; then
6025 # Stick the inst_prefix_dir data into the link command.
6026 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6027 else
6028 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6029 fi
6030
6031 $echo "$modename: warning: relinking \`$file'" 1>&2
6032 $show "$relink_command"
6033 if $run eval "$relink_command"; then :
6034 else
6035 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6036 exit $EXIT_FAILURE
6037 fi
6038 fi
6039
6040 # See the names of the shared library.
6041 set dummy $library_names
6042 if test -n "$2"; then
6043 realname="$2"
6044 shift
6045 shift
6046
6047 srcname="$realname"
6048 test -n "$relink_command" && srcname="$realname"T
6049
6050 # Install the shared library and build the symlinks.
6051 $show "$install_prog $dir/$srcname $destdir/$realname"
6052 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6053 if test -n "$stripme" && test -n "$striplib"; then
6054 $show "$striplib $destdir/$realname"
6055 $run eval "$striplib $destdir/$realname" || exit $?
6056 fi
6057
6058 if test "$#" -gt 0; then
6059 # Delete the old symlinks, and create new ones.
6060 # Try `ln -sf' first, because the `ln' binary might depend on
6061 # the symlink we replace! Solaris /bin/ln does not understand -f,
6062 # so we also need to try rm && ln -s.
6063 for linkname
6064 do
6065 if test "$linkname" != "$realname"; then
6066 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6067 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6068 fi
6069 done
6070 fi
6071
6072 # Do each command in the postinstall commands.
6073 lib="$destdir/$realname"
6074 cmds=$postinstall_cmds
6075 save_ifs="$IFS"; IFS='~'
6076 for cmd in $cmds; do
6077 IFS="$save_ifs"
6078 eval cmd=\"$cmd\"
6079 $show "$cmd"
6080 $run eval "$cmd" || {
6081 lt_exit=$?
6082
6083 # Restore the uninstalled library and exit
6084 if test "$mode" = relink; then
6085 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6086 fi
6087
6088 exit $lt_exit
6089 }
6090 done
6091 IFS="$save_ifs"
6092 fi
6093
6094 # Install the pseudo-library for information purposes.
6095 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6096 instname="$dir/$name"i
6097 $show "$install_prog $instname $destdir/$name"
6098 $run eval "$install_prog $instname $destdir/$name" || exit $?
6099
6100 # Maybe install the static library, too.
6101 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6102 ;;
6103
6104 *.lo)
6105 # Install (i.e. copy) a libtool object.
6106
6107 # Figure out destination file name, if it wasn't already specified.
6108 if test -n "$destname"; then
6109 destfile="$destdir/$destname"
6110 else
6111 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6112 destfile="$destdir/$destfile"
6113 fi
6114
6115 # Deduce the name of the destination old-style object file.
6116 case $destfile in
6117 *.lo)
6118 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6119 ;;
6120 *.$objext)
6121 staticdest="$destfile"
6122 destfile=
6123 ;;
6124 *)
6125 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6126 $echo "$help" 1>&2
6127 exit $EXIT_FAILURE
6128 ;;
6129 esac
6130
6131 # Install the libtool object if requested.
6132 if test -n "$destfile"; then
6133 $show "$install_prog $file $destfile"
6134 $run eval "$install_prog $file $destfile" || exit $?
6135 fi
6136
6137 # Install the old object if enabled.
6138 if test "$build_old_libs" = yes; then
6139 # Deduce the name of the old-style object file.
6140 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6141
6142 $show "$install_prog $staticobj $staticdest"
6143 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6144 fi
6145 exit $EXIT_SUCCESS
6146 ;;
6147
6148 *)
6149 # Figure out destination file name, if it wasn't already specified.
6150 if test -n "$destname"; then
6151 destfile="$destdir/$destname"
6152 else
6153 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6154 destfile="$destdir/$destfile"
6155 fi
6156
6157 # If the file is missing, and there is a .exe on the end, strip it
6158 # because it is most likely a libtool script we actually want to
6159 # install
6160 stripped_ext=""
6161 case $file in
6162 *.exe)
6163 if test ! -f "$file"; then
6164 file=`$echo $file|${SED} 's,.exe$,,'`
6165 stripped_ext=".exe"
6166 fi
6167 ;;
6168 esac
6169
6170 # Do a test to see if this is really a libtool program.
6171 case $host in
6172 *cygwin*|*mingw*)
6173 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6174 ;;
6175 *)
6176 wrapper=$file
6177 ;;
6178 esac
6179 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6180 notinst_deplibs=
6181 relink_command=
6182
6183 # Note that it is not necessary on cygwin/mingw to append a dot to
6184 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6185 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6186 # `FILE.' does not work on cygwin managed mounts.
6187 #
6188 # If there is no directory component, then add one.
6189 case $wrapper in
6190 */* | *\\*) . ${wrapper} ;;
6191 *) . ./${wrapper} ;;
6192 esac
6193
6194 # Check the variables that should have been set.
6195 if test -z "$notinst_deplibs"; then
6196 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6197 exit $EXIT_FAILURE
6198 fi
6199
6200 finalize=yes
6201 for lib in $notinst_deplibs; do
6202 # Check to see that each library is installed.
6203 libdir=
6204 if test -f "$lib"; then
6205 # If there is no directory component, then add one.
6206 case $lib in
6207 */* | *\\*) . $lib ;;
6208 *) . ./$lib ;;
6209 esac
6210 fi
6211 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6212 if test -n "$libdir" && test ! -f "$libfile"; then
6213 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6214 finalize=no
6215 fi
6216 done
6217
6218 relink_command=
6219 # Note that it is not necessary on cygwin/mingw to append a dot to
6220 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6221 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6222 # `FILE.' does not work on cygwin managed mounts.
6223 #
6224 # If there is no directory component, then add one.
6225 case $wrapper in
6226 */* | *\\*) . ${wrapper} ;;
6227 *) . ./${wrapper} ;;
6228 esac
6229
6230 outputname=
6231 if test "$fast_install" = no && test -n "$relink_command"; then
6232 if test "$finalize" = yes && test -z "$run"; then
6233 tmpdir=`func_mktempdir`
6234 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6235 outputname="$tmpdir/$file"
6236 # Replace the output file specification.
6237 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6238
6239 $show "$relink_command"
6240 if $run eval "$relink_command"; then :
6241 else
6242 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6243 ${rm}r "$tmpdir"
6244 continue
6245 fi
6246 file="$outputname"
6247 else
6248 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6249 fi
6250 else
6251 # Install the binary that we compiled earlier.
6252 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6253 fi
6254 fi
6255
6256 # remove .exe since cygwin /usr/bin/install will append another
6257 # one anyway
6258 case $install_prog,$host in
6259 */usr/bin/install*,*cygwin*)
6260 case $file:$destfile in
6261 *.exe:*.exe)
6262 # this is ok
6263 ;;
6264 *.exe:*)
6265 destfile=$destfile.exe
6266 ;;
6267 *:*.exe)
6268 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6269 ;;
6270 esac
6271 ;;
6272 esac
6273 $show "$install_prog$stripme $file $destfile"
6274 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6275 test -n "$outputname" && ${rm}r "$tmpdir"
6276 ;;
6277 esac
6278 done
6279
6280 for file in $staticlibs; do
6281 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6282
6283 # Set up the ranlib parameters.
6284 oldlib="$destdir/$name"
6285
6286 $show "$install_prog $file $oldlib"
6287 $run eval "$install_prog \$file \$oldlib" || exit $?
6288
6289 if test -n "$stripme" && test -n "$old_striplib"; then
6290 $show "$old_striplib $oldlib"
6291 $run eval "$old_striplib $oldlib" || exit $?
6292 fi
6293
6294 # Do each command in the postinstall commands.
6295 cmds=$old_postinstall_cmds
6296 save_ifs="$IFS"; IFS='~'
6297 for cmd in $cmds; do
6298 IFS="$save_ifs"
6299 eval cmd=\"$cmd\"
6300 $show "$cmd"
6301 $run eval "$cmd" || exit $?
6302 done
6303 IFS="$save_ifs"
6304 done
6305
6306 if test -n "$future_libdirs"; then
6307 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6308 fi
6309
6310 if test -n "$current_libdirs"; then
6311 # Maybe just do a dry run.
6312 test -n "$run" && current_libdirs=" -n$current_libdirs"
6313 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6314 else
6315 exit $EXIT_SUCCESS
6316 fi
6317 ;;
6318
6319 # libtool finish mode
6320 finish)
6321 modename="$modename: finish"
6322 libdirs="$nonopt"
6323 admincmds=
6324
6325 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6326 for dir
6327 do
6328 libdirs="$libdirs $dir"
6329 done
6330
6331 for libdir in $libdirs; do
6332 if test -n "$finish_cmds"; then
6333 # Do each command in the finish commands.
6334 cmds=$finish_cmds
6335 save_ifs="$IFS"; IFS='~'
6336 for cmd in $cmds; do
6337 IFS="$save_ifs"
6338 eval cmd=\"$cmd\"
6339 $show "$cmd"
6340 $run eval "$cmd" || admincmds="$admincmds
6341 $cmd"
6342 done
6343 IFS="$save_ifs"
6344 fi
6345 if test -n "$finish_eval"; then
6346 # Do the single finish_eval.
6347 eval cmds=\"$finish_eval\"
6348 $run eval "$cmds" || admincmds="$admincmds
6349 $cmds"
6350 fi
6351 done
6352 fi
6353
6354 # Exit here if they wanted silent mode.
6355 test "$show" = : && exit $EXIT_SUCCESS
6356
6357 $echo "X----------------------------------------------------------------------" | $Xsed
6358 $echo "Libraries have been installed in:"
6359 for libdir in $libdirs; do
6360 $echo " $libdir"
6361 done
6362 $echo
6363 $echo "If you ever happen to want to link against installed libraries"
6364 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6365 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6366 $echo "flag during linking and do at least one of the following:"
6367 if test -n "$shlibpath_var"; then
6368 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6369 $echo " during execution"
6370 fi
6371 if test -n "$runpath_var"; then
6372 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6373 $echo " during linking"
6374 fi
6375 if test -n "$hardcode_libdir_flag_spec"; then
6376 libdir=LIBDIR
6377 eval flag=\"$hardcode_libdir_flag_spec\"
6378
6379 $echo " - use the \`$flag' linker flag"
6380 fi
6381 if test -n "$admincmds"; then
6382 $echo " - have your system administrator run these commands:$admincmds"
6383 fi
6384 if test -f /etc/ld.so.conf; then
6385 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6386 fi
6387 $echo
6388 $echo "See any operating system documentation about shared libraries for"
6389 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6390 $echo "X----------------------------------------------------------------------" | $Xsed
6391 exit $EXIT_SUCCESS
6392 ;;
6393
6394 # libtool execute mode
6395 execute)
6396 modename="$modename: execute"
6397
6398 # The first argument is the command name.
6399 cmd="$nonopt"
6400 if test -z "$cmd"; then
6401 $echo "$modename: you must specify a COMMAND" 1>&2
6402 $echo "$help"
6403 exit $EXIT_FAILURE
6404 fi
6405
6406 # Handle -dlopen flags immediately.
6407 for file in $execute_dlfiles; do
6408 if test ! -f "$file"; then
6409 $echo "$modename: \`$file' is not a file" 1>&2
6410 $echo "$help" 1>&2
6411 exit $EXIT_FAILURE
6412 fi
6413
6414 dir=
6415 case $file in
6416 *.la)
6417 # Check to see that this really is a libtool archive.
6418 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6419 else
6420 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6421 $echo "$help" 1>&2
6422 exit $EXIT_FAILURE
6423 fi
6424
6425 # Read the libtool library.
6426 dlname=
6427 library_names=
6428
6429 # If there is no directory component, then add one.
6430 case $file in
6431 */* | *\\*) . $file ;;
6432 *) . ./$file ;;
6433 esac
6434
6435 # Skip this library if it cannot be dlopened.
6436 if test -z "$dlname"; then
6437 # Warn if it was a shared library.
6438 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6439 continue
6440 fi
6441
6442 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6443 test "X$dir" = "X$file" && dir=.
6444
6445 if test -f "$dir/$objdir/$dlname"; then
6446 dir="$dir/$objdir"
6447 else
6448 if test ! -f "$dir/$dlname"; then
6449 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6450 exit $EXIT_FAILURE
6451 fi
6452 fi
6453 ;;
6454
6455 *.lo)
6456 # Just add the directory containing the .lo file.
6457 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6458 test "X$dir" = "X$file" && dir=.
6459 ;;
6460
6461 *)
6462 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6463 continue
6464 ;;
6465 esac
6466
6467 # Get the absolute pathname.
6468 absdir=`cd "$dir" && pwd`
6469 test -n "$absdir" && dir="$absdir"
6470
6471 # Now add the directory to shlibpath_var.
6472 if eval "test -z \"\$$shlibpath_var\""; then
6473 eval "$shlibpath_var=\"\$dir\""
6474 else
6475 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6476 fi
6477 done
6478
6479 # This variable tells wrapper scripts just to set shlibpath_var
6480 # rather than running their programs.
6481 libtool_execute_magic="$magic"
6482
6483 # Check if any of the arguments is a wrapper script.
6484 args=
6485 for file
6486 do
6487 case $file in
6488 -*) ;;
6489 *)
6490 # Do a test to see if this is really a libtool program.
6491 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6492 # If there is no directory component, then add one.
6493 case $file in
6494 */* | *\\*) . $file ;;
6495 *) . ./$file ;;
6496 esac
6497
6498 # Transform arg to wrapped name.
6499 file="$progdir/$program"
6500 fi
6501 ;;
6502 esac
6503 # Quote arguments (to preserve shell metacharacters).
6504 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6505 args="$args \"$file\""
6506 done
6507
6508 if test -z "$run"; then
6509 if test -n "$shlibpath_var"; then
6510 # Export the shlibpath_var.
6511 eval "export $shlibpath_var"
6512 fi
6513
6514 # Restore saved environment variables
6515 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6516 do
6517 eval "if test \"\${save_$lt_var+set}\" = set; then
6518 $lt_var=\$save_$lt_var; export $lt_var
6519 fi"
6520 done
6521
6522 # Now prepare to actually exec the command.
6523 exec_cmd="\$cmd$args"
6524 else
6525 # Display what would be done.
6526 if test -n "$shlibpath_var"; then
6527 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6528 $echo "export $shlibpath_var"
6529 fi
6530 $echo "$cmd$args"
6531 exit $EXIT_SUCCESS
6532 fi
6533 ;;
6534
6535 # libtool clean and uninstall mode
6536 clean | uninstall)
6537 modename="$modename: $mode"
6538 rm="$nonopt"
6539 files=
6540 rmforce=
6541 exit_status=0
6542
6543 # This variable tells wrapper scripts just to set variables rather
6544 # than running their programs.
6545 libtool_install_magic="$magic"
6546
6547 for arg
6548 do
6549 case $arg in
6550 -f) rm="$rm $arg"; rmforce=yes ;;
6551 -*) rm="$rm $arg" ;;
6552 *) files="$files $arg" ;;
6553 esac
6554 done
6555
6556 if test -z "$rm"; then
6557 $echo "$modename: you must specify an RM program" 1>&2
6558 $echo "$help" 1>&2
6559 exit $EXIT_FAILURE
6560 fi
6561
6562 rmdirs=
6563
6564 origobjdir="$objdir"
6565 for file in $files; do
6566 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6567 if test "X$dir" = "X$file"; then
6568 dir=.
6569 objdir="$origobjdir"
6570 else
6571 objdir="$dir/$origobjdir"
6572 fi
6573 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6574 test "$mode" = uninstall && objdir="$dir"
6575
6576 # Remember objdir for removal later, being careful to avoid duplicates
6577 if test "$mode" = clean; then
6578 case " $rmdirs " in
6579 *" $objdir "*) ;;
6580 *) rmdirs="$rmdirs $objdir" ;;
6581 esac
6582 fi
6583
6584 # Don't error if the file doesn't exist and rm -f was used.
6585 if (test -L "$file") >/dev/null 2>&1 \
6586 || (test -h "$file") >/dev/null 2>&1 \
6587 || test -f "$file"; then
6588 :
6589 elif test -d "$file"; then
6590 exit_status=1
6591 continue
6592 elif test "$rmforce" = yes; then
6593 continue
6594 fi
6595
6596 rmfiles="$file"
6597
6598 case $name in
6599 *.la)
6600 # Possibly a libtool archive, so verify it.
6601 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6602 . $dir/$name
6603
6604 # Delete the libtool libraries and symlinks.
6605 for n in $library_names; do
6606 rmfiles="$rmfiles $objdir/$n"
6607 done
6608 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6609
6610 case "$mode" in
6611 clean)
6612 case " $library_names " in
6613 # " " in the beginning catches empty $dlname
6614 *" $dlname "*) ;;
6615 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6616 esac
6617 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6618 ;;
6619 uninstall)
6620 if test -n "$library_names"; then
6621 # Do each command in the postuninstall commands.
6622 cmds=$postuninstall_cmds
6623 save_ifs="$IFS"; IFS='~'
6624 for cmd in $cmds; do
6625 IFS="$save_ifs"
6626 eval cmd=\"$cmd\"
6627 $show "$cmd"
6628 $run eval "$cmd"
6629 if test "$?" -ne 0 && test "$rmforce" != yes; then
6630 exit_status=1
6631 fi
6632 done
6633 IFS="$save_ifs"
6634 fi
6635
6636 if test -n "$old_library"; then
6637 # Do each command in the old_postuninstall commands.
6638 cmds=$old_postuninstall_cmds
6639 save_ifs="$IFS"; IFS='~'
6640 for cmd in $cmds; do
6641 IFS="$save_ifs"
6642 eval cmd=\"$cmd\"
6643 $show "$cmd"
6644 $run eval "$cmd"
6645 if test "$?" -ne 0 && test "$rmforce" != yes; then
6646 exit_status=1
6647 fi
6648 done
6649 IFS="$save_ifs"
6650 fi
6651 # FIXME: should reinstall the best remaining shared library.
6652 ;;
6653 esac
6654 fi
6655 ;;
6656
6657 *.lo)
6658 # Possibly a libtool object, so verify it.
6659 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6660
6661 # Read the .lo file
6662 . $dir/$name
6663
6664 # Add PIC object to the list of files to remove.
6665 if test -n "$pic_object" \
6666 && test "$pic_object" != none; then
6667 rmfiles="$rmfiles $dir/$pic_object"
6668 fi
6669
6670 # Add non-PIC object to the list of files to remove.
6671 if test -n "$non_pic_object" \
6672 && test "$non_pic_object" != none; then
6673 rmfiles="$rmfiles $dir/$non_pic_object"
6674 fi
6675 fi
6676 ;;
6677
6678 *)
6679 if test "$mode" = clean ; then
6680 noexename=$name
6681 case $file in
6682 *.exe)
6683 file=`$echo $file|${SED} 's,.exe$,,'`
6684 noexename=`$echo $name|${SED} 's,.exe$,,'`
6685 # $file with .exe has already been added to rmfiles,
6686 # add $file without .exe
6687 rmfiles="$rmfiles $file"
6688 ;;
6689 esac
6690 # Do a test to see if this is a libtool program.
6691 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6692 relink_command=
6693 . $dir/$noexename
6694
6695 # note $name still contains .exe if it was in $file originally
6696 # as does the version of $file that was added into $rmfiles
6697 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6698 if test "$fast_install" = yes && test -n "$relink_command"; then
6699 rmfiles="$rmfiles $objdir/lt-$name"
6700 fi
6701 if test "X$noexename" != "X$name" ; then
6702 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6703 fi
6704 fi
6705 fi
6706 ;;
6707 esac
6708 $show "$rm $rmfiles"
6709 $run $rm $rmfiles || exit_status=1
6710 done
6711 objdir="$origobjdir"
6712
6713 # Try to remove the ${objdir}s in the directories where we deleted files
6714 for dir in $rmdirs; do
6715 if test -d "$dir"; then
6716 $show "rmdir $dir"
6717 $run rmdir $dir >/dev/null 2>&1
6718 fi
6719 done
6720
6721 exit $exit_status
6722 ;;
6723
6724 "")
6725 $echo "$modename: you must specify a MODE" 1>&2
6726 $echo "$generic_help" 1>&2
6727 exit $EXIT_FAILURE
6728 ;;
6729 esac
6730
6731 if test -z "$exec_cmd"; then
6732 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6733 $echo "$generic_help" 1>&2
6734 exit $EXIT_FAILURE
6735 fi
6736fi # test -z "$show_help"
6737
6738if test -n "$exec_cmd"; then
6739 eval exec $exec_cmd
6740 exit $EXIT_FAILURE
6741fi
6742
6743# We need to display help for each of the modes.
6744case $mode in
6745"") $echo \
6746"Usage: $modename [OPTION]... [MODE-ARG]...
6747
6748Provide generalized library-building support services.
6749
6750 --config show all configuration variables
6751 --debug enable verbose shell tracing
6752-n, --dry-run display commands without modifying any files
6753 --features display basic configuration information and exit
6754 --finish same as \`--mode=finish'
6755 --help display this help message and exit
6756 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6757 --quiet same as \`--silent'
6758 --silent don't print informational messages
6759 --tag=TAG use configuration variables from tag TAG
6760 --version print version information
6761
6762MODE must be one of the following:
6763
6764 clean remove files from the build directory
6765 compile compile a source file into a libtool object
6766 execute automatically set library path, then run a program
6767 finish complete the installation of libtool libraries
6768 install install libraries or executables
6769 link create a library or an executable
6770 uninstall remove libraries from an installed directory
6771
6772MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6773a more detailed description of MODE.
6774
6775Report bugs to <bug-libtool@gnu.org>."
6776 exit $EXIT_SUCCESS
6777 ;;
6778
6779clean)
6780 $echo \
6781"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6782
6783Remove files from the build directory.
6784
6785RM is the name of the program to use to delete files associated with each FILE
6786(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6787to RM.
6788
6789If FILE is a libtool library, object or program, all the files associated
6790with it are deleted. Otherwise, only FILE itself is deleted using RM."
6791 ;;
6792
6793compile)
6794 $echo \
6795"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6796
6797Compile a source file into a libtool library object.
6798
6799This mode accepts the following additional options:
6800
6801 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6802 -prefer-pic try to building PIC objects only
6803 -prefer-non-pic try to building non-PIC objects only
6804 -static always build a \`.o' file suitable for static linking
6805
6806COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6807from the given SOURCEFILE.
6808
6809The output file name is determined by removing the directory component from
6810SOURCEFILE, then substituting the C source code suffix \`.c' with the
6811library object suffix, \`.lo'."
6812 ;;
6813
6814execute)
6815 $echo \
6816"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6817
6818Automatically set library path, then run a program.
6819
6820This mode accepts the following additional options:
6821
6822 -dlopen FILE add the directory containing FILE to the library path
6823
6824This mode sets the library path environment variable according to \`-dlopen'
6825flags.
6826
6827If any of the ARGS are libtool executable wrappers, then they are translated
6828into their corresponding uninstalled binary, and any of their required library
6829directories are added to the library path.
6830
6831Then, COMMAND is executed, with ARGS as arguments."
6832 ;;
6833
6834finish)
6835 $echo \
6836"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6837
6838Complete the installation of libtool libraries.
6839
6840Each LIBDIR is a directory that contains libtool libraries.
6841
6842The commands that this mode executes may require superuser privileges. Use
6843the \`--dry-run' option if you just want to see what would be executed."
6844 ;;
6845
6846install)
6847 $echo \
6848"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6849
6850Install executables or libraries.
6851
6852INSTALL-COMMAND is the installation command. The first component should be
6853either the \`install' or \`cp' program.
6854
6855The rest of the components are interpreted as arguments to that command (only
6856BSD-compatible install options are recognized)."
6857 ;;
6858
6859link)
6860 $echo \
6861"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6862
6863Link object files or libraries together to form another library, or to
6864create an executable program.
6865
6866LINK-COMMAND is a command using the C compiler that you would use to create
6867a program from several object files.
6868
6869The following components of LINK-COMMAND are treated specially:
6870
6871 -all-static do not do any dynamic linking at all
6872 -avoid-version do not add a version suffix if possible
6873 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6874 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6875 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6876 -export-symbols SYMFILE
6877 try to export only the symbols listed in SYMFILE
6878 -export-symbols-regex REGEX
6879 try to export only the symbols matching REGEX
6880 -LLIBDIR search LIBDIR for required installed libraries
6881 -lNAME OUTPUT-FILE requires the installed library libNAME
6882 -module build a library that can dlopened
6883 -no-fast-install disable the fast-install mode
6884 -no-install link a not-installable executable
6885 -no-undefined declare that a library does not refer to external symbols
6886 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6887 -objectlist FILE Use a list of object files found in FILE to specify objects
6888 -precious-files-regex REGEX
6889 don't remove output files matching REGEX
6890 -release RELEASE specify package release information
6891 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6892 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6893 -static do not do any dynamic linking of uninstalled libtool libraries
6894 -static-libtool-libs
6895 do not do any dynamic linking of libtool libraries
6896 -version-info CURRENT[:REVISION[:AGE]]
6897 specify library version info [each variable defaults to 0]
6898
6899All other options (arguments beginning with \`-') are ignored.
6900
6901Every other argument is treated as a filename. Files ending in \`.la' are
6902treated as uninstalled libtool libraries, other files are standard or library
6903object files.
6904
6905If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6906only library objects (\`.lo' files) may be specified, and \`-rpath' is
6907required, except when creating a convenience library.
6908
6909If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6910using \`ar' and \`ranlib', or on Windows using \`lib'.
6911
6912If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6913is created, otherwise an executable program is created."
6914 ;;
6915
6916uninstall)
6917 $echo \
6918"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6919
6920Remove libraries from an installation directory.
6921
6922RM is the name of the program to use to delete files associated with each FILE
6923(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6924to RM.
6925
6926If FILE is a libtool library, all the files associated with it are deleted.
6927Otherwise, only FILE itself is deleted using RM."
6928 ;;
6929
6930*)
6931 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6932 $echo "$help" 1>&2
6933 exit $EXIT_FAILURE
6934 ;;
6935esac
6936
6937$echo
6938$echo "Try \`$modename --help' for more information about other modes."
6939
6940exit $?
6941
6942# The TAGs below are defined such that we never get into a situation
6943# in which we disable both kinds of libraries. Given conflicting
6944# choices, we go for a static library, that is the most portable,
6945# since we can't tell whether shared libraries were disabled because
6946# the user asked for that or because the platform doesn't support
6947# them. This is particularly important on AIX, because we don't
6948# support having both static and shared libraries enabled at the same
6949# time on that platform, so we default to a shared-only configuration.
6950# If a disable-shared tag is given, we'll fallback to a static-only
6951# configuration. But we'll never go from static-only to shared-only.
6952
6953# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6954disable_libs=shared
6955# ### END LIBTOOL TAG CONFIG: disable-shared
6956
6957# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6958disable_libs=static
6959# ### END LIBTOOL TAG CONFIG: disable-static
6960
6961# Local Variables:
6962# mode:shell-script
6963# sh-indentation:2
6964# End:
diff --git a/src/others/mimesh/libg3d-0.0.8/config/missing b/src/others/mimesh/libg3d-0.0.8/config/missing
new file mode 100755
index 0000000..1c8ff70
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/config/missing
@@ -0,0 +1,367 @@
1#! /bin/sh
2# Common stub for a few missing GNU programs while installing.
3
4scriptversion=2006-05-10.23
5
6# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
7# Free Software Foundation, Inc.
8# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
9
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2, or (at your option)
13# any later version.
14
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, write to the Free Software
22# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23# 02110-1301, USA.
24
25# As a special exception to the GNU General Public License, if you
26# distribute this file as part of a program that contains a
27# configuration script generated by Autoconf, you may include it under
28# the same distribution terms that you use for the rest of that program.
29
30if test $# -eq 0; then
31 echo 1>&2 "Try \`$0 --help' for more information"
32 exit 1
33fi
34
35run=:
36sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
37sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
38
39# In the cases where this matters, `missing' is being run in the
40# srcdir already.
41if test -f configure.ac; then
42 configure_ac=configure.ac
43else
44 configure_ac=configure.in
45fi
46
47msg="missing on your system"
48
49case $1 in
50--run)
51 # Try to run requested program, and just exit if it succeeds.
52 run=
53 shift
54 "$@" && exit 0
55 # Exit code 63 means version mismatch. This often happens
56 # when the user try to use an ancient version of a tool on
57 # a file that requires a minimum version. In this case we
58 # we should proceed has if the program had been absent, or
59 # if --run hadn't been passed.
60 if test $? = 63; then
61 run=:
62 msg="probably too old"
63 fi
64 ;;
65
66 -h|--h|--he|--hel|--help)
67 echo "\
68$0 [OPTION]... PROGRAM [ARGUMENT]...
69
70Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
71error status if there is no known handling for PROGRAM.
72
73Options:
74 -h, --help display this help and exit
75 -v, --version output version information and exit
76 --run try to run the given command, and emulate it if it fails
77
78Supported PROGRAM values:
79 aclocal touch file \`aclocal.m4'
80 autoconf touch file \`configure'
81 autoheader touch file \`config.h.in'
82 autom4te touch the output file, or create a stub one
83 automake touch all \`Makefile.in' files
84 bison create \`y.tab.[ch]', if possible, from existing .[ch]
85 flex create \`lex.yy.c', if possible, from existing .c
86 help2man touch the output file
87 lex create \`lex.yy.c', if possible, from existing .c
88 makeinfo touch the output file
89 tar try tar, gnutar, gtar, then tar without non-portable flags
90 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
91
92Send bug reports to <bug-automake@gnu.org>."
93 exit $?
94 ;;
95
96 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
97 echo "missing $scriptversion (GNU Automake)"
98 exit $?
99 ;;
100
101 -*)
102 echo 1>&2 "$0: Unknown \`$1' option"
103 echo 1>&2 "Try \`$0 --help' for more information"
104 exit 1
105 ;;
106
107esac
108
109# Now exit if we have it, but it failed. Also exit now if we
110# don't have it and --version was passed (most likely to detect
111# the program).
112case $1 in
113 lex|yacc)
114 # Not GNU programs, they don't have --version.
115 ;;
116
117 tar)
118 if test -n "$run"; then
119 echo 1>&2 "ERROR: \`tar' requires --run"
120 exit 1
121 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
122 exit 1
123 fi
124 ;;
125
126 *)
127 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
128 # We have it, but it failed.
129 exit 1
130 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
131 # Could not run --version or --help. This is probably someone
132 # running `$TOOL --version' or `$TOOL --help' to check whether
133 # $TOOL exists and not knowing $TOOL uses missing.
134 exit 1
135 fi
136 ;;
137esac
138
139# If it does not exist, or fails to run (possibly an outdated version),
140# try to emulate it.
141case $1 in
142 aclocal*)
143 echo 1>&2 "\
144WARNING: \`$1' is $msg. You should only need it if
145 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
146 to install the \`Automake' and \`Perl' packages. Grab them from
147 any GNU archive site."
148 touch aclocal.m4
149 ;;
150
151 autoconf)
152 echo 1>&2 "\
153WARNING: \`$1' is $msg. You should only need it if
154 you modified \`${configure_ac}'. You might want to install the
155 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
156 archive site."
157 touch configure
158 ;;
159
160 autoheader)
161 echo 1>&2 "\
162WARNING: \`$1' is $msg. You should only need it if
163 you modified \`acconfig.h' or \`${configure_ac}'. You might want
164 to install the \`Autoconf' and \`GNU m4' packages. Grab them
165 from any GNU archive site."
166 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
167 test -z "$files" && files="config.h"
168 touch_files=
169 for f in $files; do
170 case $f in
171 *:*) touch_files="$touch_files "`echo "$f" |
172 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
173 *) touch_files="$touch_files $f.in";;
174 esac
175 done
176 touch $touch_files
177 ;;
178
179 automake*)
180 echo 1>&2 "\
181WARNING: \`$1' is $msg. You should only need it if
182 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
183 You might want to install the \`Automake' and \`Perl' packages.
184 Grab them from any GNU archive site."
185 find . -type f -name Makefile.am -print |
186 sed 's/\.am$/.in/' |
187 while read f; do touch "$f"; done
188 ;;
189
190 autom4te)
191 echo 1>&2 "\
192WARNING: \`$1' is needed, but is $msg.
193 You might have modified some files without having the
194 proper tools for further handling them.
195 You can get \`$1' as part of \`Autoconf' from any GNU
196 archive site."
197
198 file=`echo "$*" | sed -n "$sed_output"`
199 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
200 if test -f "$file"; then
201 touch $file
202 else
203 test -z "$file" || exec >$file
204 echo "#! /bin/sh"
205 echo "# Created by GNU Automake missing as a replacement of"
206 echo "# $ $@"
207 echo "exit 0"
208 chmod +x $file
209 exit 1
210 fi
211 ;;
212
213 bison|yacc)
214 echo 1>&2 "\
215WARNING: \`$1' $msg. You should only need it if
216 you modified a \`.y' file. You may need the \`Bison' package
217 in order for those modifications to take effect. You can get
218 \`Bison' from any GNU archive site."
219 rm -f y.tab.c y.tab.h
220 if test $# -ne 1; then
221 eval LASTARG="\${$#}"
222 case $LASTARG in
223 *.y)
224 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
225 if test -f "$SRCFILE"; then
226 cp "$SRCFILE" y.tab.c
227 fi
228 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
229 if test -f "$SRCFILE"; then
230 cp "$SRCFILE" y.tab.h
231 fi
232 ;;
233 esac
234 fi
235 if test ! -f y.tab.h; then
236 echo >y.tab.h
237 fi
238 if test ! -f y.tab.c; then
239 echo 'main() { return 0; }' >y.tab.c
240 fi
241 ;;
242
243 lex|flex)
244 echo 1>&2 "\
245WARNING: \`$1' is $msg. You should only need it if
246 you modified a \`.l' file. You may need the \`Flex' package
247 in order for those modifications to take effect. You can get
248 \`Flex' from any GNU archive site."
249 rm -f lex.yy.c
250 if test $# -ne 1; then
251 eval LASTARG="\${$#}"
252 case $LASTARG in
253 *.l)
254 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
255 if test -f "$SRCFILE"; then
256 cp "$SRCFILE" lex.yy.c
257 fi
258 ;;
259 esac
260 fi
261 if test ! -f lex.yy.c; then
262 echo 'main() { return 0; }' >lex.yy.c
263 fi
264 ;;
265
266 help2man)
267 echo 1>&2 "\
268WARNING: \`$1' is $msg. You should only need it if
269 you modified a dependency of a manual page. You may need the
270 \`Help2man' package in order for those modifications to take
271 effect. You can get \`Help2man' from any GNU archive site."
272
273 file=`echo "$*" | sed -n "$sed_output"`
274 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
275 if test -f "$file"; then
276 touch $file
277 else
278 test -z "$file" || exec >$file
279 echo ".ab help2man is required to generate this page"
280 exit 1
281 fi
282 ;;
283
284 makeinfo)
285 echo 1>&2 "\
286WARNING: \`$1' is $msg. You should only need it if
287 you modified a \`.texi' or \`.texinfo' file, or any other file
288 indirectly affecting the aspect of the manual. The spurious
289 call might also be the consequence of using a buggy \`make' (AIX,
290 DU, IRIX). You might want to install the \`Texinfo' package or
291 the \`GNU make' package. Grab either from any GNU archive site."
292 # The file to touch is that specified with -o ...
293 file=`echo "$*" | sed -n "$sed_output"`
294 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
295 if test -z "$file"; then
296 # ... or it is the one specified with @setfilename ...
297 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
298 file=`sed -n '
299 /^@setfilename/{
300 s/.* \([^ ]*\) *$/\1/
301 p
302 q
303 }' $infile`
304 # ... or it is derived from the source name (dir/f.texi becomes f.info)
305 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
306 fi
307 # If the file does not exist, the user really needs makeinfo;
308 # let's fail without touching anything.
309 test -f $file || exit 1
310 touch $file
311 ;;
312
313 tar)
314 shift
315
316 # We have already tried tar in the generic part.
317 # Look for gnutar/gtar before invocation to avoid ugly error
318 # messages.
319 if (gnutar --version > /dev/null 2>&1); then
320 gnutar "$@" && exit 0
321 fi
322 if (gtar --version > /dev/null 2>&1); then
323 gtar "$@" && exit 0
324 fi
325 firstarg="$1"
326 if shift; then
327 case $firstarg in
328 *o*)
329 firstarg=`echo "$firstarg" | sed s/o//`
330 tar "$firstarg" "$@" && exit 0
331 ;;
332 esac
333 case $firstarg in
334 *h*)
335 firstarg=`echo "$firstarg" | sed s/h//`
336 tar "$firstarg" "$@" && exit 0
337 ;;
338 esac
339 fi
340
341 echo 1>&2 "\
342WARNING: I can't seem to be able to run \`tar' with the given arguments.
343 You may want to install GNU tar or Free paxutils, or check the
344 command line arguments."
345 exit 1
346 ;;
347
348 *)
349 echo 1>&2 "\
350WARNING: \`$1' is needed, and is $msg.
351 You might have modified some files without having the
352 proper tools for further handling them. Check the \`README' file,
353 it often tells you about the needed prerequisites for installing
354 this package. You may also peek at any GNU archive site, in case
355 some other package would contain this missing \`$1' program."
356 exit 1
357 ;;
358esac
359
360exit 0
361
362# Local variables:
363# eval: (add-hook 'write-file-hooks 'time-stamp)
364# time-stamp-start: "scriptversion="
365# time-stamp-format: "%:y-%02m-%02d.%02H"
366# time-stamp-end: "$"
367# End:
diff --git a/src/others/mimesh/libg3d-0.0.8/config/ylwrap b/src/others/mimesh/libg3d-0.0.8/config/ylwrap
new file mode 100755
index 0000000..7278b6a
--- /dev/null
+++ b/src/others/mimesh/libg3d-0.0.8/config/ylwrap
@@ -0,0 +1,223 @@
1#! /bin/sh
2# ylwrap - wrapper for lex/yacc invocations.
3
4scriptversion=2007-11-22.22
5
6# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
7# 2007 Free Software Foundation, Inc.
8#
9# Written by Tom Tromey <tromey@cygnus.com>.
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2, or (at your option)
14# any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24# 02110-1301, USA.
25
26# As a special exception to the GNU General Public License, if you
27# distribute this file as part of a program that contains a
28# configuration script generated by Autoconf, you may include it under
29# the same distribution terms that you use for the rest of that program.
30
31# This file is maintained in Automake, please report
32# bugs to <bug-automake@gnu.org> or send patches to
33# <automake-patches@gnu.org>.
34
35case "$1" in
36 '')
37 echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
38 exit 1
39 ;;
40 --basedir)
41 basedir=$2
42 shift 2
43 ;;
44 -h|--h*)
45 cat <<\EOF
46Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
47
48Wrapper for lex/yacc invocations, renaming files as desired.
49
50 INPUT is the input file
51 OUTPUT is one file PROG generates
52 DESIRED is the file we actually want instead of OUTPUT
53 PROGRAM is program to run
54 ARGS are passed to PROG
55
56Any number of OUTPUT,DESIRED pairs may be used.
57
58Report bugs to <bug-automake@gnu.org>.
59EOF
60 exit $?
61 ;;
62 -v|--v*)
63 echo "ylwrap $scriptversion"
64 exit $?
65 ;;
66esac
67
68
69# The input.
70input="$1"
71shift
72case "$input" in
73 [\\/]* | ?:[\\/]*)
74 # Absolute path; do nothing.
75 ;;
76 *)
77 # Relative path. Make it absolute.
78 input="`pwd`/$input"
79 ;;
80esac
81
82pairlist=
83while test "$#" -ne 0; do
84 if test "$1" = "--"; then
85 shift
86 break
87 fi
88 pairlist="$pairlist $1"
89 shift
90done
91
92# The program to run.
93prog="$1"
94shift
95# Make any relative path in $prog absolute.
96case "$prog" in
97 [\\/]* | ?:[\\/]*) ;;
98 *[\\/]*) prog="`pwd`/$prog" ;;
99esac
100
101# FIXME: add hostname here for parallel makes that run commands on
102# other machines. But that might take us over the 14-char limit.
103dirname=ylwrap$$
104trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
105mkdir $dirname || exit 1
106
107cd $dirname
108
109case $# in
110 0) "$prog" "$input" ;;
111 *) "$prog" "$@" "$input" ;;
112esac
113ret=$?
114
115if test $ret -eq 0; then
116 set X $pairlist
117 shift
118 first=yes
119 # Since DOS filename conventions don't allow two dots,
120 # the DOS version of Bison writes out y_tab.c instead of y.tab.c
121 # and y_tab.h instead of y.tab.h. Test to see if this is the case.
122 y_tab_nodot="no"
123 if test -f y_tab.c || test -f y_tab.h; then
124 y_tab_nodot="yes"
125 fi
126
127 # The directory holding the input.
128 input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
129 # Quote $INPUT_DIR so we can use it in a regexp.
130 # FIXME: really we should care about more than `.' and `\'.
131 input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
132
133 while test "$#" -ne 0; do
134 from="$1"
135 # Handle y_tab.c and y_tab.h output by DOS
136 if test $y_tab_nodot = "yes"; then
137 if test $from = "y.tab.c"; then
138 from="y_tab.c"
139 else
140 if test $from = "y.tab.h"; then
141 from="y_tab.h"
142 fi
143 fi
144 fi
145 if test -f "$from"; then
146 # If $2 is an absolute path name, then just use that,
147 # otherwise prepend `../'.
148 case "$2" in
149 [\\/]* | ?:[\\/]*) target="$2";;
150 *) target="../$2";;
151 esac
152
153 # We do not want to overwrite a header file if it hasn't
154 # changed. This avoid useless recompilations. However the
155 # parser itself (the first file) should always be updated,
156 # because it is the destination of the .y.c rule in the
157 # Makefile. Divert the output of all other files to a temporary
158 # file so we can compare them to existing versions.
159 if test $first = no; then
160 realtarget="$target"
161 target="tmp-`echo $target | sed s/.*[\\/]//g`"
162 fi
163 # Edit out `#line' or `#' directives.
164 #
165 # We don't want the resulting debug information to point at
166 # an absolute srcdir; it is better for it to just mention the
167 # .y file with no path.
168 #
169 # We want to use the real output file name, not yy.lex.c for
170 # instance.
171 #
172 # We want the include guards to be adjusted too.
173 FROM=`echo "$from" | sed \
174 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
175 -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
176 TARGET=`echo "$2" | sed \
177 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
178 -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
179
180 sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
181 -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
182
183 # Check whether header files must be updated.
184 if test $first = no; then
185 if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
186 echo "$2" is unchanged
187 rm -f "$target"
188 else
189 echo updating "$2"
190 mv -f "$target" "$realtarget"
191 fi
192 fi
193 else
194 # A missing file is only an error for the first file. This
195 # is a blatant hack to let us support using "yacc -d". If -d
196 # is not specified, we don't want an error when the header
197 # file is "missing".
198 if test $first = yes; then
199 ret=1
200 fi
201 fi
202 shift
203 shift
204 first=no
205 done
206else
207 ret=$?
208fi
209
210# Remove the directory.
211cd ..
212rm -rf $dirname
213
214exit $ret
215
216# Local Variables:
217# mode: shell-script
218# sh-indentation: 2
219# eval: (add-hook 'write-file-hooks 'time-stamp)
220# time-stamp-start: "scriptversion="
221# time-stamp-format: "%:y-%02m-%02d.%02H"
222# time-stamp-end: "$"
223# End: